Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219

Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK!2\msvc.pynu[""" Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. """ import json from io import open from os import listdir, pathsep from os.path import join, isfile, isdir, dirname import sys import platform import itertools import distutils.errors from setuptools.extern.packaging.version import LegacyVersion from setuptools.extern.six.moves import filterfalse from .monkey import get_unpatched if platform.system() == 'Windows': from setuptools.extern.six.moves import winreg from os import environ else: # Mock winreg and environ so the module can be imported on this platform. class winreg: HKEY_USERS = None HKEY_CURRENT_USER = None HKEY_LOCAL_MACHINE = None HKEY_CLASSES_ROOT = None environ = dict() _msvc9_suppress_errors = ( # msvc9compiler isn't available on some platforms ImportError, # msvc9compiler raises DistutilsPlatformError in some # environments. See #1118. distutils.errors.DistutilsPlatformError, ) try: from distutils.msvc9compiler import Reg except _msvc9_suppress_errors: pass def msvc9_find_vcvarsall(version): """ Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython / Microsoft Visual C++ Compiler for Python 2.7). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ str vcvarsall.bat path """ vc_base = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' key = vc_base % ('', version) try: # Per-user installs register the compiler path here productdir = Reg.get_value(key, "installdir") except KeyError: try: # All-user installs on a 64-bit system register here key = vc_base % ('Wow6432Node\\', version) productdir = Reg.get_value(key, "installdir") except KeyError: productdir = None if productdir: vcvarsall = join(productdir, "vcvarsall.bat") if isfile(vcvarsall): return vcvarsall return get_unpatched(msvc9_find_vcvarsall)(version) def msvc9_query_vcvarsall(ver, arch='x86', *args, **kwargs): """ Patched "distutils.msvc9compiler.query_vcvarsall" for support extra Microsoft Visual C++ 9.0 and 10.0 compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ dict environment """ # Try to get environment from vcvarsall.bat (Classical way) try: orig = get_unpatched(msvc9_query_vcvarsall) return orig(ver, arch, *args, **kwargs) except distutils.errors.DistutilsPlatformError: # Pass error if Vcvarsall.bat is missing pass except ValueError: # Pass error if environment not set after executing vcvarsall.bat pass # If error, try to set environment directly try: return EnvironmentInfo(arch, ver).return_env() except distutils.errors.DistutilsPlatformError as exc: _augment_exception(exc, ver, arch) raise def msvc14_get_vc_env(plat_spec): """ Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment """ # Try to get environment from vcvarsall.bat (Classical way) try: return get_unpatched(msvc14_get_vc_env)(plat_spec) except distutils.errors.DistutilsPlatformError: # Pass error Vcvarsall.bat is missing pass # If error, try to set environment directly try: return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env() except distutils.errors.DistutilsPlatformError as exc: _augment_exception(exc, 14.0) raise def msvc14_gen_lib_options(*args, **kwargs): """ Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) """ if "numpy.distutils" in sys.modules: import numpy as np if LegacyVersion(np.__version__) < LegacyVersion('1.11.2'): return np.distutils.ccompiler.gen_lib_options(*args, **kwargs) return get_unpatched(msvc14_gen_lib_options)(*args, **kwargs) def _augment_exception(exc, version, arch=''): """ Add details to the exception message to help guide the user as to what action will resolve it. """ # Error if MSVC++ directory not found or environment not set message = exc.args[0] if "vcvarsall" in message.lower() or "visual c" in message.lower(): # Special error message if MSVC++ not installed tmpl = 'Microsoft Visual C++ {version:0.1f} is required.' message = tmpl.format(**locals()) msdownload = 'www.microsoft.com/download/details.aspx?id=%d' if version == 9.0: if arch.lower().find('ia64') > -1: # For VC++ 9.0, if IA64 support is needed, redirect user # to Windows SDK 7.0. # Note: No download link available from Microsoft. message += ' Get it with "Microsoft Windows SDK 7.0"' else: # For VC++ 9.0 redirect user to Vc++ for Python 2.7 : # This redirection link is maintained by Microsoft. # Contact vspython@microsoft.com if it needs updating. message += ' Get it from http://aka.ms/vcpython27' elif version == 10.0: # For VC++ 10.0 Redirect user to Windows SDK 7.1 message += ' Get it with "Microsoft Windows SDK 7.1": ' message += msdownload % 8279 elif version >= 14.0: # For VC++ 14.X Redirect user to latest Visual C++ Build Tools message += (' Get it with "Build Tools for Visual Studio": ' r'https://visualstudio.microsoft.com/downloads/') exc.args = (message, ) class PlatformInfo: """ Current and Target Architectures information. Parameters ---------- arch: str Target architecture. """ current_cpu = environ.get('processor_architecture', '').lower() def __init__(self, arch): self.arch = arch.lower().replace('x64', 'amd64') @property def target_cpu(self): """ Return Target CPU architecture. Return ------ str Target CPU """ return self.arch[self.arch.find('_') + 1:] def target_is_x86(self): """ Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits """ return self.target_cpu == 'x86' def current_is_x86(self): """ Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits """ return self.current_cpu == 'x86' def current_dir(self, hidex86=False, x64=False): """ Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\target', or '' (see hidex86 parameter) """ return ( '' if (self.current_cpu == 'x86' and hidex86) else r'\x64' if (self.current_cpu == 'amd64' and x64) else r'\%s' % self.current_cpu ) def target_dir(self, hidex86=False, x64=False): r""" Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) """ return ( '' if (self.target_cpu == 'x86' and hidex86) else r'\x64' if (self.target_cpu == 'amd64' and x64) else r'\%s' % self.target_cpu ) def cross_dir(self, forcex86=False): r""" Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. """ current = 'x86' if forcex86 else self.current_cpu return ( '' if self.target_cpu == current else self.target_dir().replace('\\', '\\%s_' % current) ) class RegistryInfo: """ Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. """ HKEYS = (winreg.HKEY_USERS, winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CLASSES_ROOT) def __init__(self, platform_info): self.pi = platform_info @property def visualstudio(self): """ Microsoft Visual Studio root registry key. Return ------ str Registry key """ return 'VisualStudio' @property def sxs(self): """ Microsoft Visual Studio SxS registry key. Return ------ str Registry key """ return join(self.visualstudio, 'SxS') @property def vc(self): """ Microsoft Visual C++ VC7 registry key. Return ------ str Registry key """ return join(self.sxs, 'VC7') @property def vs(self): """ Microsoft Visual Studio VS7 registry key. Return ------ str Registry key """ return join(self.sxs, 'VS7') @property def vc_for_python(self): """ Microsoft Visual C++ for Python registry key. Return ------ str Registry key """ return r'DevDiv\VCForPython' @property def microsoft_sdk(self): """ Microsoft SDK registry key. Return ------ str Registry key """ return 'Microsoft SDKs' @property def windows_sdk(self): """ Microsoft Windows/Platform SDK registry key. Return ------ str Registry key """ return join(self.microsoft_sdk, 'Windows') @property def netfx_sdk(self): """ Microsoft .NET Framework SDK registry key. Return ------ str Registry key """ return join(self.microsoft_sdk, 'NETFXSDK') @property def windows_kits_roots(self): """ Microsoft Windows Kits Roots registry key. Return ------ str Registry key """ return r'Windows Kits\Installed Roots' def microsoft(self, key, x86=False): """ Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key """ node64 = '' if self.pi.current_is_x86() or x86 else 'Wow6432Node' return join('Software', node64, 'Microsoft', key) def lookup(self, key, name): """ Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value """ key_read = winreg.KEY_READ openkey = winreg.OpenKey ms = self.microsoft for hkey in self.HKEYS: try: bkey = openkey(hkey, ms(key), 0, key_read) except (OSError, IOError): if not self.pi.current_is_x86(): try: bkey = openkey(hkey, ms(key, True), 0, key_read) except (OSError, IOError): continue else: continue try: return winreg.QueryValueEx(bkey, name)[0] except (OSError, IOError): pass class SystemInfo: """ Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. """ # Variables and properties in this class use originals CamelCase variables # names from Microsoft source files for more easy comparison. WinDir = environ.get('WinDir', '') ProgramFiles = environ.get('ProgramFiles', '') ProgramFilesx86 = environ.get('ProgramFiles(x86)', ProgramFiles) def __init__(self, registry_info, vc_ver=None): self.ri = registry_info self.pi = self.ri.pi self.known_vs_paths = self.find_programdata_vs_vers() # Except for VS15+, VC version is aligned with VS version self.vs_ver = self.vc_ver = ( vc_ver or self._find_latest_available_vs_ver()) def _find_latest_available_vs_ver(self): """ Find the latest VC version Return ------ float version """ reg_vc_vers = self.find_reg_vs_vers() if not (reg_vc_vers or self.known_vs_paths): raise distutils.errors.DistutilsPlatformError( 'No Microsoft Visual C++ version found') vc_vers = set(reg_vc_vers) vc_vers.update(self.known_vs_paths) return sorted(vc_vers)[-1] def find_reg_vs_vers(self): """ Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions """ ms = self.ri.microsoft vckeys = (self.ri.vc, self.ri.vc_for_python, self.ri.vs) vs_vers = [] for hkey in self.ri.HKEYS: for key in vckeys: try: bkey = winreg.OpenKey(hkey, ms(key), 0, winreg.KEY_READ) except (OSError, IOError): continue subkeys, values, _ = winreg.QueryInfoKey(bkey) for i in range(values): try: ver = float(winreg.EnumValue(bkey, i)[0]) if ver not in vs_vers: vs_vers.append(ver) except ValueError: pass for i in range(subkeys): try: ver = float(winreg.EnumKey(bkey, i)) if ver not in vs_vers: vs_vers.append(ver) except ValueError: pass return sorted(vs_vers) def find_programdata_vs_vers(self): r""" Find Visual studio 2017+ versions from information in "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances". Return ------ dict float version as key, path as value. """ vs_versions = {} instances_dir = \ r'C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances' try: hashed_names = listdir(instances_dir) except (OSError, IOError): # Directory not exists with all Visual Studio versions return vs_versions for name in hashed_names: try: # Get VS installation path from "state.json" file state_path = join(instances_dir, name, 'state.json') with open(state_path, 'rt', encoding='utf-8') as state_file: state = json.load(state_file) vs_path = state['installationPath'] # Raises OSError if this VS installation does not contain VC listdir(join(vs_path, r'VC\Tools\MSVC')) # Store version and path vs_versions[self._as_float_version( state['installationVersion'])] = vs_path except (OSError, IOError, KeyError): # Skip if "state.json" file is missing or bad format continue return vs_versions @staticmethod def _as_float_version(version): """ Return a string version as a simplified float version (major.minor) Parameters ---------- version: str Version. Return ------ float version """ return float('.'.join(version.split('.')[:2])) @property def VSInstallDir(self): """ Microsoft Visual Studio directory. Return ------ str path """ # Default path default = join(self.ProgramFilesx86, 'Microsoft Visual Studio %0.1f' % self.vs_ver) # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vs, '%0.1f' % self.vs_ver) or default @property def VCInstallDir(self): """ Microsoft Visual C++ directory. Return ------ str path """ path = self._guess_vc() or self._guess_vc_legacy() if not isdir(path): msg = 'Microsoft Visual C++ directory not found' raise distutils.errors.DistutilsPlatformError(msg) return path def _guess_vc(self): """ Locate Visual C++ for VS2017+. Return ------ str path """ if self.vs_ver <= 14.0: return '' try: # First search in known VS paths vs_dir = self.known_vs_paths[self.vs_ver] except KeyError: # Else, search with path from registry vs_dir = self.VSInstallDir guess_vc = join(vs_dir, r'VC\Tools\MSVC') # Subdir with VC exact version as name try: # Update the VC version with real one instead of VS version vc_ver = listdir(guess_vc)[-1] self.vc_ver = self._as_float_version(vc_ver) return join(guess_vc, vc_ver) except (OSError, IOError, IndexError): return '' def _guess_vc_legacy(self): """ Locate Visual C++ for versions prior to 2017. Return ------ str path """ default = join(self.ProgramFilesx86, r'Microsoft Visual Studio %0.1f\VC' % self.vs_ver) # Try to get "VC++ for Python" path from registry as default path reg_path = join(self.ri.vc_for_python, '%0.1f' % self.vs_ver) python_vc = self.ri.lookup(reg_path, 'installdir') default_vc = join(python_vc, 'VC') if python_vc else default # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vc, '%0.1f' % self.vs_ver) or default_vc @property def WindowsSdkVersion(self): """ Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions """ if self.vs_ver <= 9.0: return '7.0', '6.1', '6.0a' elif self.vs_ver == 10.0: return '7.1', '7.0a' elif self.vs_ver == 11.0: return '8.0', '8.0a' elif self.vs_ver == 12.0: return '8.1', '8.1a' elif self.vs_ver >= 14.0: return '10.0', '8.1' @property def WindowsSdkLastVersion(self): """ Microsoft Windows SDK last version. Return ------ str version """ return self._use_last_dir_name(join(self.WindowsSdkDir, 'lib')) @property def WindowsSdkDir(self): """ Microsoft Windows SDK directory. Return ------ str path """ sdkdir = '' for ver in self.WindowsSdkVersion: # Try to get it from registry loc = join(self.ri.windows_sdk, 'v%s' % ver) sdkdir = self.ri.lookup(loc, 'installationfolder') if sdkdir: break if not sdkdir or not isdir(sdkdir): # Try to get "VC++ for Python" version from registry path = join(self.ri.vc_for_python, '%0.1f' % self.vc_ver) install_base = self.ri.lookup(path, 'installdir') if install_base: sdkdir = join(install_base, 'WinSDK') if not sdkdir or not isdir(sdkdir): # If fail, use default new path for ver in self.WindowsSdkVersion: intver = ver[:ver.rfind('.')] path = r'Microsoft SDKs\Windows Kits\%s' % intver d = join(self.ProgramFiles, path) if isdir(d): sdkdir = d if not sdkdir or not isdir(sdkdir): # If fail, use default old path for ver in self.WindowsSdkVersion: path = r'Microsoft SDKs\Windows\v%s' % ver d = join(self.ProgramFiles, path) if isdir(d): sdkdir = d if not sdkdir: # If fail, use Platform SDK sdkdir = join(self.VCInstallDir, 'PlatformSDK') return sdkdir @property def WindowsSDKExecutablePath(self): """ Microsoft Windows SDK executable directory. Return ------ str path """ # Find WinSDK NetFx Tools registry dir name if self.vs_ver <= 11.0: netfxver = 35 arch = '' else: netfxver = 40 hidex86 = True if self.vs_ver <= 12.0 else False arch = self.pi.current_dir(x64=True, hidex86=hidex86) fx = 'WinSDK-NetFx%dTools%s' % (netfxver, arch.replace('\\', '-')) # list all possibles registry paths regpaths = [] if self.vs_ver >= 14.0: for ver in self.NetFxSdkVersion: regpaths += [join(self.ri.netfx_sdk, ver, fx)] for ver in self.WindowsSdkVersion: regpaths += [join(self.ri.windows_sdk, 'v%sA' % ver, fx)] # Return installation folder from the more recent path for path in regpaths: execpath = self.ri.lookup(path, 'installationfolder') if execpath: return execpath @property def FSharpInstallDir(self): """ Microsoft Visual F# directory. Return ------ str path """ path = join(self.ri.visualstudio, r'%0.1f\Setup\F#' % self.vs_ver) return self.ri.lookup(path, 'productdir') or '' @property def UniversalCRTSdkDir(self): """ Microsoft Universal CRT SDK directory. Return ------ str path """ # Set Kit Roots versions for specified MSVC++ version vers = ('10', '81') if self.vs_ver >= 14.0 else () # Find path of the more recent Kit for ver in vers: sdkdir = self.ri.lookup(self.ri.windows_kits_roots, 'kitsroot%s' % ver) if sdkdir: return sdkdir or '' @property def UniversalCRTSdkLastVersion(self): """ Microsoft Universal C Runtime SDK last version. Return ------ str version """ return self._use_last_dir_name(join(self.UniversalCRTSdkDir, 'lib')) @property def NetFxSdkVersion(self): """ Microsoft .NET Framework SDK versions. Return ------ tuple of str versions """ # Set FxSdk versions for specified VS version return (('4.7.2', '4.7.1', '4.7', '4.6.2', '4.6.1', '4.6', '4.5.2', '4.5.1', '4.5') if self.vs_ver >= 14.0 else ()) @property def NetFxSdkDir(self): """ Microsoft .NET Framework SDK directory. Return ------ str path """ sdkdir = '' for ver in self.NetFxSdkVersion: loc = join(self.ri.netfx_sdk, ver) sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder') if sdkdir: break return sdkdir @property def FrameworkDir32(self): """ Microsoft .NET Framework 32bit directory. Return ------ str path """ # Default path guess_fw = join(self.WinDir, r'Microsoft.NET\Framework') # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vc, 'frameworkdir32') or guess_fw @property def FrameworkDir64(self): """ Microsoft .NET Framework 64bit directory. Return ------ str path """ # Default path guess_fw = join(self.WinDir, r'Microsoft.NET\Framework64') # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vc, 'frameworkdir64') or guess_fw @property def FrameworkVersion32(self): """ Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions """ return self._find_dot_net_versions(32) @property def FrameworkVersion64(self): """ Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions """ return self._find_dot_net_versions(64) def _find_dot_net_versions(self, bits): """ Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions """ # Find actual .NET version in registry reg_ver = self.ri.lookup(self.ri.vc, 'frameworkver%d' % bits) dot_net_dir = getattr(self, 'FrameworkDir%d' % bits) ver = reg_ver or self._use_last_dir_name(dot_net_dir, 'v') or '' # Set .NET versions for specified MSVC++ version if self.vs_ver >= 12.0: return ver, 'v4.0' elif self.vs_ver >= 10.0: return 'v4.0.30319' if ver.lower()[:2] != 'v4' else ver, 'v3.5' elif self.vs_ver == 9.0: return 'v3.5', 'v2.0.50727' elif self.vs_ver == 8.0: return 'v3.0', 'v2.0.50727' @staticmethod def _use_last_dir_name(path, prefix=''): """ Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name """ matching_dirs = ( dir_name for dir_name in reversed(listdir(path)) if isdir(join(path, dir_name)) and dir_name.startswith(prefix) ) return next(matching_dirs, None) or '' class EnvironmentInfo: """ Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. """ # Variables and properties in this class use originals CamelCase variables # names from Microsoft source files for more easy comparison. def __init__(self, arch, vc_ver=None, vc_min_ver=0): self.pi = PlatformInfo(arch) self.ri = RegistryInfo(self.pi) self.si = SystemInfo(self.ri, vc_ver) if self.vc_ver < vc_min_ver: err = 'No suitable Microsoft Visual C++ version found' raise distutils.errors.DistutilsPlatformError(err) @property def vs_ver(self): """ Microsoft Visual Studio. Return ------ float version """ return self.si.vs_ver @property def vc_ver(self): """ Microsoft Visual C++ version. Return ------ float version """ return self.si.vc_ver @property def VSTools(self): """ Microsoft Visual Studio Tools. Return ------ list of str paths """ paths = [r'Common7\IDE', r'Common7\Tools'] if self.vs_ver >= 14.0: arch_subdir = self.pi.current_dir(hidex86=True, x64=True) paths += [r'Common7\IDE\CommonExtensions\Microsoft\TestWindow'] paths += [r'Team Tools\Performance Tools'] paths += [r'Team Tools\Performance Tools%s' % arch_subdir] return [join(self.si.VSInstallDir, path) for path in paths] @property def VCIncludes(self): """ Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths """ return [join(self.si.VCInstallDir, 'Include'), join(self.si.VCInstallDir, r'ATLMFC\Include')] @property def VCLibraries(self): """ Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths """ if self.vs_ver >= 15.0: arch_subdir = self.pi.target_dir(x64=True) else: arch_subdir = self.pi.target_dir(hidex86=True) paths = ['Lib%s' % arch_subdir, r'ATLMFC\Lib%s' % arch_subdir] if self.vs_ver >= 14.0: paths += [r'Lib\store%s' % arch_subdir] return [join(self.si.VCInstallDir, path) for path in paths] @property def VCStoreRefs(self): """ Microsoft Visual C++ store references Libraries. Return ------ list of str paths """ if self.vs_ver < 14.0: return [] return [join(self.si.VCInstallDir, r'Lib\store\references')] @property def VCTools(self): """ Microsoft Visual C++ Tools. Return ------ list of str paths """ si = self.si tools = [join(si.VCInstallDir, 'VCPackages')] forcex86 = True if self.vs_ver <= 10.0 else False arch_subdir = self.pi.cross_dir(forcex86) if arch_subdir: tools += [join(si.VCInstallDir, 'Bin%s' % arch_subdir)] if self.vs_ver == 14.0: path = 'Bin%s' % self.pi.current_dir(hidex86=True) tools += [join(si.VCInstallDir, path)] elif self.vs_ver >= 15.0: host_dir = (r'bin\HostX86%s' if self.pi.current_is_x86() else r'bin\HostX64%s') tools += [join( si.VCInstallDir, host_dir % self.pi.target_dir(x64=True))] if self.pi.current_cpu != self.pi.target_cpu: tools += [join( si.VCInstallDir, host_dir % self.pi.current_dir(x64=True))] else: tools += [join(si.VCInstallDir, 'Bin')] return tools @property def OSLibraries(self): """ Microsoft Windows SDK Libraries. Return ------ list of str paths """ if self.vs_ver <= 10.0: arch_subdir = self.pi.target_dir(hidex86=True, x64=True) return [join(self.si.WindowsSdkDir, 'Lib%s' % arch_subdir)] else: arch_subdir = self.pi.target_dir(x64=True) lib = join(self.si.WindowsSdkDir, 'lib') libver = self._sdk_subdir return [join(lib, '%sum%s' % (libver , arch_subdir))] @property def OSIncludes(self): """ Microsoft Windows SDK Include. Return ------ list of str paths """ include = join(self.si.WindowsSdkDir, 'include') if self.vs_ver <= 10.0: return [include, join(include, 'gl')] else: if self.vs_ver >= 14.0: sdkver = self._sdk_subdir else: sdkver = '' return [join(include, '%sshared' % sdkver), join(include, '%sum' % sdkver), join(include, '%swinrt' % sdkver)] @property def OSLibpath(self): """ Microsoft Windows SDK Libraries Paths. Return ------ list of str paths """ ref = join(self.si.WindowsSdkDir, 'References') libpath = [] if self.vs_ver <= 9.0: libpath += self.OSLibraries if self.vs_ver >= 11.0: libpath += [join(ref, r'CommonConfiguration\Neutral')] if self.vs_ver >= 14.0: libpath += [ ref, join(self.si.WindowsSdkDir, 'UnionMetadata'), join(ref, 'Windows.Foundation.UniversalApiContract', '1.0.0.0'), join(ref, 'Windows.Foundation.FoundationContract', '1.0.0.0'), join(ref,'Windows.Networking.Connectivity.WwanContract', '1.0.0.0'), join(self.si.WindowsSdkDir, 'ExtensionSDKs', 'Microsoft.VCLibs', '%0.1f' % self.vs_ver, 'References', 'CommonConfiguration', 'neutral'), ] return libpath @property def SdkTools(self): """ Microsoft Windows SDK Tools. Return ------ list of str paths """ return list(self._sdk_tools()) def _sdk_tools(self): """ Microsoft Windows SDK Tools paths generator. Return ------ generator of str paths """ if self.vs_ver < 15.0: bin_dir = 'Bin' if self.vs_ver <= 11.0 else r'Bin\x86' yield join(self.si.WindowsSdkDir, bin_dir) if not self.pi.current_is_x86(): arch_subdir = self.pi.current_dir(x64=True) path = 'Bin%s' % arch_subdir yield join(self.si.WindowsSdkDir, path) if self.vs_ver in (10.0, 11.0): if self.pi.target_is_x86(): arch_subdir = '' else: arch_subdir = self.pi.current_dir(hidex86=True, x64=True) path = r'Bin\NETFX 4.0 Tools%s' % arch_subdir yield join(self.si.WindowsSdkDir, path) elif self.vs_ver >= 15.0: path = join(self.si.WindowsSdkDir, 'Bin') arch_subdir = self.pi.current_dir(x64=True) sdkver = self.si.WindowsSdkLastVersion yield join(path, '%s%s' % (sdkver, arch_subdir)) if self.si.WindowsSDKExecutablePath: yield self.si.WindowsSDKExecutablePath @property def _sdk_subdir(self): """ Microsoft Windows SDK version subdir. Return ------ str subdir """ ucrtver = self.si.WindowsSdkLastVersion return ('%s\\' % ucrtver) if ucrtver else '' @property def SdkSetup(self): """ Microsoft Windows SDK Setup. Return ------ list of str paths """ if self.vs_ver > 9.0: return [] return [join(self.si.WindowsSdkDir, 'Setup')] @property def FxTools(self): """ Microsoft .NET Framework Tools. Return ------ list of str paths """ pi = self.pi si = self.si if self.vs_ver <= 10.0: include32 = True include64 = not pi.target_is_x86() and not pi.current_is_x86() else: include32 = pi.target_is_x86() or pi.current_is_x86() include64 = pi.current_cpu == 'amd64' or pi.target_cpu == 'amd64' tools = [] if include32: tools += [join(si.FrameworkDir32, ver) for ver in si.FrameworkVersion32] if include64: tools += [join(si.FrameworkDir64, ver) for ver in si.FrameworkVersion64] return tools @property def NetFxSDKLibraries(self): """ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths """ if self.vs_ver < 14.0 or not self.si.NetFxSdkDir: return [] arch_subdir = self.pi.target_dir(x64=True) return [join(self.si.NetFxSdkDir, r'lib\um%s' % arch_subdir)] @property def NetFxSDKIncludes(self): """ Microsoft .Net Framework SDK Includes. Return ------ list of str paths """ if self.vs_ver < 14.0 or not self.si.NetFxSdkDir: return [] return [join(self.si.NetFxSdkDir, r'include\um')] @property def VsTDb(self): """ Microsoft Visual Studio Team System Database. Return ------ list of str paths """ return [join(self.si.VSInstallDir, r'VSTSDB\Deploy')] @property def MSBuild(self): """ Microsoft Build Engine. Return ------ list of str paths """ if self.vs_ver < 12.0: return [] elif self.vs_ver < 15.0: base_path = self.si.ProgramFilesx86 arch_subdir = self.pi.current_dir(hidex86=True) else: base_path = self.si.VSInstallDir arch_subdir = '' path = r'MSBuild\%0.1f\bin%s' % (self.vs_ver, arch_subdir) build = [join(base_path, path)] if self.vs_ver >= 15.0: # Add Roslyn C# & Visual Basic Compiler build += [join(base_path, path, 'Roslyn')] return build @property def HTMLHelpWorkshop(self): """ Microsoft HTML Help Workshop. Return ------ list of str paths """ if self.vs_ver < 11.0: return [] return [join(self.si.ProgramFilesx86, 'HTML Help Workshop')] @property def UCRTLibraries(self): """ Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths """ if self.vs_ver < 14.0: return [] arch_subdir = self.pi.target_dir(x64=True) lib = join(self.si.UniversalCRTSdkDir, 'lib') ucrtver = self._ucrt_subdir return [join(lib, '%sucrt%s' % (ucrtver, arch_subdir))] @property def UCRTIncludes(self): """ Microsoft Universal C Runtime SDK Include. Return ------ list of str paths """ if self.vs_ver < 14.0: return [] include = join(self.si.UniversalCRTSdkDir, 'include') return [join(include, '%sucrt' % self._ucrt_subdir)] @property def _ucrt_subdir(self): """ Microsoft Universal C Runtime SDK version subdir. Return ------ str subdir """ ucrtver = self.si.UniversalCRTSdkLastVersion return ('%s\\' % ucrtver) if ucrtver else '' @property def FSharp(self): """ Microsoft Visual F#. Return ------ list of str paths """ if 11.0 > self.vs_ver > 12.0: return [] return [self.si.FSharpInstallDir] @property def VCRuntimeRedist(self): """ Microsoft Visual C++ runtime redistributable dll. Return ------ str path """ vcruntime = 'vcruntime%d0.dll' % self.vc_ver arch_subdir = self.pi.target_dir(x64=True).strip('\\') # Installation prefixes candidates prefixes = [] tools_path = self.si.VCInstallDir redist_path = dirname(tools_path.replace(r'\Tools', r'\Redist')) if isdir(redist_path): # Redist version may not be exactly the same as tools redist_path = join(redist_path, listdir(redist_path)[-1]) prefixes += [redist_path, join(redist_path, 'onecore')] prefixes += [join(tools_path, 'redist')] # VS14 legacy path # CRT directory crt_dirs = ('Microsoft.VC%d.CRT' % (self.vc_ver * 10), # Sometime store in directory with VS version instead of VC 'Microsoft.VC%d.CRT' % (int(self.vs_ver) * 10)) # vcruntime path for prefix, crt_dir in itertools.product(prefixes, crt_dirs): path = join(prefix, arch_subdir, crt_dir, vcruntime) if isfile(path): return path def return_env(self, exists=True): """ Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment """ env = dict( include=self._build_paths('include', [self.VCIncludes, self.OSIncludes, self.UCRTIncludes, self.NetFxSDKIncludes], exists), lib=self._build_paths('lib', [self.VCLibraries, self.OSLibraries, self.FxTools, self.UCRTLibraries, self.NetFxSDKLibraries], exists), libpath=self._build_paths('libpath', [self.VCLibraries, self.FxTools, self.VCStoreRefs, self.OSLibpath], exists), path=self._build_paths('path', [self.VCTools, self.VSTools, self.VsTDb, self.SdkTools, self.SdkSetup, self.FxTools, self.MSBuild, self.HTMLHelpWorkshop, self.FSharp], exists), ) if self.vs_ver >= 14 and isfile(self.VCRuntimeRedist): env['py_vcruntime_redist'] = self.VCRuntimeRedist return env def _build_paths(self, name, spec_path_lists, exists): """ Given an environment variable name and specified paths, return a pathsep-separated string of paths containing unique, extant, directories from those paths and from the environment variable. Raise an error if no paths are resolved. Parameters ---------- name: str Environment variable name spec_path_lists: list of str Paths exists: bool It True, only return existing paths. Return ------ str Pathsep-separated paths """ # flatten spec_path_lists spec_paths = itertools.chain.from_iterable(spec_path_lists) env_paths = environ.get(name, '').split(pathsep) paths = itertools.chain(spec_paths, env_paths) extant_paths = list(filter(isdir, paths)) if exists else paths if not extant_paths: msg = "%s environment variable is empty" % name.upper() raise distutils.errors.DistutilsPlatformError(msg) unique_paths = self._unique_everseen(extant_paths) return pathsep.join(unique_paths) # from Python docs @staticmethod def _unique_everseen(iterable, key=None): """ List unique elements, preserving order. Remember all elements ever seen. _unique_everseen('AAAABBBCCDAABBB') --> A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D """ seen = set() seen_add = seen.add if key is None: for element in filterfalse(seen.__contains__, iterable): seen_add(element) yield element else: for element in iterable: k = key(element) if k not in seen: seen_add(k) yield element PK!ss __init__.pynu["""Extensions to the 'distutils' for large or complex distributions""" import os import sys import functools import distutils.core import distutils.filelist import re from distutils.errors import DistutilsOptionError from distutils.util import convert_path from fnmatch import fnmatchcase from ._deprecation_warning import SetuptoolsDeprecationWarning from setuptools.extern.six import PY3, string_types from setuptools.extern.six.moves import filter, map import setuptools.version from setuptools.extension import Extension from setuptools.dist import Distribution, Feature from setuptools.depends import Require from . import monkey __metaclass__ = type __all__ = [ 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 'SetuptoolsDeprecationWarning', 'find_packages' ] if PY3: __all__.append('find_namespace_packages') __version__ = setuptools.version.__version__ bootstrap_install_from = None # If we run 2to3 on .py files, should we also convert docstrings? # Default: yes; assume that we can detect doctests reliably run_2to3_on_doctests = True # Standard package names for fixer packages lib2to3_fixer_packages = ['lib2to3.fixes'] class PackageFinder: """ Generate a list of all Python packages found within a directory """ @classmethod def find(cls, where='.', exclude=(), include=('*',)): """Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. """ return list(cls._find_packages_iter( convert_path(where), cls._build_filter('ez_setup', '*__pycache__', *exclude), cls._build_filter(*include))) @classmethod def _find_packages_iter(cls, where, exclude, include): """ All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. """ for root, dirs, files in os.walk(where, followlinks=True): # Copy dirs to iterate over it, then empty dirs. all_dirs = dirs[:] dirs[:] = [] for dir in all_dirs: full_path = os.path.join(root, dir) rel_path = os.path.relpath(full_path, where) package = rel_path.replace(os.path.sep, '.') # Skip directory trees that are not valid packages if ('.' in dir or not cls._looks_like_package(full_path)): continue # Should this package be included? if include(package) and not exclude(package): yield package # Keep searching subdirectories, as there may be more packages # down there, even if the parent was excluded. dirs.append(dir) @staticmethod def _looks_like_package(path): """Does a directory look like a package?""" return os.path.isfile(os.path.join(path, '__init__.py')) @staticmethod def _build_filter(*patterns): """ Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. """ return lambda name: any(fnmatchcase(name, pat=pat) for pat in patterns) class PEP420PackageFinder(PackageFinder): @staticmethod def _looks_like_package(path): return True find_packages = PackageFinder.find if PY3: find_namespace_packages = PEP420PackageFinder.find def _install_setup_requires(attrs): # Note: do not use `setuptools.Distribution` directly, as # our PEP 517 backend patch `distutils.core.Distribution`. dist = distutils.core.Distribution(dict( (k, v) for k, v in attrs.items() if k in ('dependency_links', 'setup_requires') )) # Honor setup.cfg's options. dist.parse_config_files(ignore_option_errors=True) if dist.setup_requires: dist.fetch_build_eggs(dist.setup_requires) def setup(**attrs): # Make sure we have any requirements needed to interpret 'attrs'. _install_setup_requires(attrs) return distutils.core.setup(**attrs) setup.__doc__ = distutils.core.setup.__doc__ _Command = monkey.get_unpatched(distutils.core.Command) class Command(_Command): __doc__ = _Command.__doc__ command_consumes_arguments = False def __init__(self, dist, **kw): """ Construct the command for dist, updating vars(self) with any keyword parameters. """ _Command.__init__(self, dist) vars(self).update(kw) def _ensure_stringlike(self, option, what, default=None): val = getattr(self, option) if val is None: setattr(self, option, default) return default elif not isinstance(val, string_types): raise DistutilsOptionError("'%s' must be a %s (got `%s`)" % (option, what, val)) return val def ensure_string_list(self, option): r"""Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. """ val = getattr(self, option) if val is None: return elif isinstance(val, string_types): setattr(self, option, re.split(r',\s*|\s+', val)) else: if isinstance(val, list): ok = all(isinstance(v, string_types) for v in val) else: ok = False if not ok: raise DistutilsOptionError( "'%s' must be a list of strings (got %r)" % (option, val)) def reinitialize_command(self, command, reinit_subcommands=0, **kw): cmd = _Command.reinitialize_command(self, command, reinit_subcommands) vars(cmd).update(kw) return cmd def _find_all_simple(path): """ Find all files under 'path' """ results = ( os.path.join(base, file) for base, dirs, files in os.walk(path, followlinks=True) for file in files ) return filter(os.path.isfile, results) def findall(dir=os.curdir): """ Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. """ files = _find_all_simple(dir) if dir == os.curdir: make_rel = functools.partial(os.path.relpath, start=dir) files = map(make_rel, files) return list(files) # Apply monkey patches monkey.patch_all() PK!c   namespaces.pynu[import os from distutils import log import itertools from setuptools.extern.six.moves import map flatten = itertools.chain.from_iterable class Installer: nspkg_ext = '-nspkg.pth' def install_namespaces(self): nsp = self._get_all_ns_packages() if not nsp: return filename, ext = os.path.splitext(self._get_target()) filename += self.nspkg_ext self.outputs.append(filename) log.info("Installing %s", filename) lines = map(self._gen_nspkg_line, nsp) if self.dry_run: # always generate the lines, even in dry run list(lines) return with open(filename, 'wt') as f: f.writelines(lines) def uninstall_namespaces(self): filename, ext = os.path.splitext(self._get_target()) filename += self.nspkg_ext if not os.path.exists(filename): return log.info("Removing %s", filename) os.remove(filename) def _get_target(self): return self.target _nspkg_tmpl = ( "import sys, types, os", "has_mfs = sys.version_info > (3, 5)", "p = os.path.join(%(root)s, *%(pth)r)", "importlib = has_mfs and __import__('importlib.util')", "has_mfs and __import__('importlib.machinery')", "m = has_mfs and " "sys.modules.setdefault(%(pkg)r, " "importlib.util.module_from_spec(" "importlib.machinery.PathFinder.find_spec(%(pkg)r, " "[os.path.dirname(p)])))", "m = m or " "sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))", "mp = (m or []) and m.__dict__.setdefault('__path__',[])", "(p not in mp) and mp.append(p)", ) "lines for the namespace installer" _nspkg_tmpl_multi = ( 'm and setattr(sys.modules[%(parent)r], %(child)r, m)', ) "additional line(s) when a parent package is indicated" def _get_root(self): return "sys._getframe(1).f_locals['sitedir']" def _gen_nspkg_line(self, pkg): # ensure pkg is not a unicode string under Python 2.7 pkg = str(pkg) pth = tuple(pkg.split('.')) root = self._get_root() tmpl_lines = self._nspkg_tmpl parent, sep, child = pkg.rpartition('.') if parent: tmpl_lines += self._nspkg_tmpl_multi return ';'.join(tmpl_lines) % locals() + '\n' def _get_all_ns_packages(self): """Return sorted list of all package namespaces""" pkgs = self.distribution.namespace_packages or [] return sorted(flatten(map(self._pkg_names, pkgs))) @staticmethod def _pkg_names(pkg): """ Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True """ parts = pkg.split('.') while parts: yield '.'.join(parts) parts.pop() class DevelopInstaller(Installer): def _get_root(self): return repr(str(self.egg_path)) def _get_target(self): return self.egg_link PK!0FF py31compat.pynu[__all__ = [] __metaclass__ = type try: # Python >=3.2 from tempfile import TemporaryDirectory except ImportError: import shutil import tempfile class TemporaryDirectory: """ Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. """ def __init__(self, **kwargs): self.name = None # Handle mkdtemp raising an exception self.name = tempfile.mkdtemp(**kwargs) def __enter__(self): return self.name def __exit__(self, exctype, excvalue, exctrace): try: shutil.rmtree(self.name, True) except OSError: # removal errors are not the only possible pass self.name = None PK!$l extern/__init__.pynu[import sys class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. """ def __init__(self, root_name, vendored_names=(), vendor_pkg=None): self.root_name = root_name self.vendored_names = set(vendored_names) self.vendor_pkg = vendor_pkg or root_name.replace('extern', '_vendor') @property def search_path(self): """ Search first the vendor package then as a natural package. """ yield self.vendor_pkg + '.' yield '' def find_module(self, fullname, path=None): """ Return self when fullname starts with root_name and the target module is one vendored through this importer. """ root, base, target = fullname.partition(self.root_name + '.') if root: return if not any(map(target.startswith, self.vendored_names)): return return self def load_module(self, fullname): """ Iterate over the search path to locate and load fullname. """ root, base, target = fullname.partition(self.root_name + '.') for prefix in self.search_path: try: extant = prefix + target __import__(extant) mod = sys.modules[extant] sys.modules[fullname] = mod # mysterious hack: # Remove the reference to the extant package/module # on later Python versions to cause relative imports # in the vendor package to resolve the same modules # as those going through this importer. if sys.version_info >= (3, ): del sys.modules[extant] return mod except ImportError: pass else: raise ImportError( "The '{target}' package is required; " "normally this is bundled with this package so if you get " "this warning, consult the packager of your " "distribution.".format(**locals()) ) def install(self): """ Install this importer into sys.meta_path if not already present. """ if self not in sys.meta_path: sys.meta_path.append(self) names = 'six', 'packaging', 'pyparsing', 'ordered_set', VendorImporter(__name__, names, 'setuptools._vendor').install() PK!t t 0extern/__pycache__/__init__.cpython-38.opt-1.pycnu[U Qab @s.ddlZGdddZdZeeeddS)Nc@s@eZdZdZdddZeddZddd Zd d Zd d Z dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|dd|_dS)NZexternZ_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrrrr>/usr/lib/python3.8/site-packages/setuptools/extern/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)rr rrr search_paths zVendorImporter.search_pathcCs8||jd\}}}|rdStt|j|js4dS|S)z Return self when fullname starts with root_name and the target module is one vendored through this importer. r N) partitionranymap startswithr)r fullnamepathrootbasetargetrrr find_modules zVendorImporter.find_modulec Cs||jd\}}}|jD]Z}z@||}t|tj|}|tj|<tjdkrXtj|=|WStk rtYqXqtdjft dS)zK Iterate over the search path to locate and load fullname. r )zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N) rrr __import__sysmodules version_info ImportErrorformatlocals)r rrrrprefixZextantmodrrr load_module#s"     zVendorImporter.load_modulecCs|tjkrtj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappendrrrr install@s zVendorImporter.install)rN)N) __name__ __module__ __qualname____doc__r propertyrrr$r'rrrr rs   r)ZsixZ packagingZ pyparsingZ ordered_setzsetuptools._vendor)rrnamesr(r'rrrr sDPK!t t *extern/__pycache__/__init__.cpython-38.pycnu[U Qab @s.ddlZGdddZdZeeeddS)Nc@s@eZdZdZdddZeddZddd Zd d Zd d Z dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|dd|_dS)NZexternZ_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrrrr>/usr/lib/python3.8/site-packages/setuptools/extern/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)rr rrr search_paths zVendorImporter.search_pathcCs8||jd\}}}|rdStt|j|js4dS|S)z Return self when fullname starts with root_name and the target module is one vendored through this importer. r N) partitionranymap startswithr)r fullnamepathrootbasetargetrrr find_modules zVendorImporter.find_modulec Cs||jd\}}}|jD]Z}z@||}t|tj|}|tj|<tjdkrXtj|=|WStk rtYqXqtdjft dS)zK Iterate over the search path to locate and load fullname. r )zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N) rrr __import__sysmodules version_info ImportErrorformatlocals)r rrrrprefixZextantmodrrr load_module#s"     zVendorImporter.load_modulecCs|tjkrtj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappendrrrr install@s zVendorImporter.install)rN)N) __name__ __module__ __qualname____doc__r propertyrrr$r'rrrr rs   r)ZsixZ packagingZ pyparsingZ ordered_setzsetuptools._vendor)rrnamesr(r'rrrr sDPK! windows_support.pynu[import platform import ctypes def windows_only(func): if platform.system() != 'Windows': return lambda *args, **kwargs: None return func @windows_only def hide_file(path): """ Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. """ __import__('ctypes.wintypes') SetFileAttributes = ctypes.windll.kernel32.SetFileAttributesW SetFileAttributes.argtypes = ctypes.wintypes.LPWSTR, ctypes.wintypes.DWORD SetFileAttributes.restype = ctypes.wintypes.BOOL FILE_ATTRIBUTE_HIDDEN = 0x02 ret = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) if not ret: raise ctypes.WinError() PK!eQarchive_util.pynu["""Utilities for extracting common archive formats""" import zipfile import tarfile import os import shutil import posixpath import contextlib from distutils.errors import DistutilsError from pkg_resources import ensure_directory __all__ = [ "unpack_archive", "unpack_zipfile", "unpack_tarfile", "default_filter", "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] class UnrecognizedFormat(DistutilsError): """Couldn't recognize the archive type""" def default_filter(src, dst): """The default progress/filter callback; returns True for all files""" return dst def unpack_archive(filename, extract_dir, progress_filter=default_filter, drivers=None): """Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. """ for driver in drivers or extraction_drivers: try: driver(filename, extract_dir, progress_filter) except UnrecognizedFormat: continue else: return else: raise UnrecognizedFormat( "Not a recognized archive type: %s" % filename ) def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory """ if not os.path.isdir(filename): raise UnrecognizedFormat("%s is not a directory" % filename) paths = { filename: ('', extract_dir), } for base, dirs, files in os.walk(filename): src, dst = paths[base] for d in dirs: paths[os.path.join(base, d)] = src + d + '/', os.path.join(dst, d) for f in files: target = os.path.join(dst, f) target = progress_filter(src + f, target) if not target: # skip non-files continue ensure_directory(target) f = os.path.join(base, f) shutil.copyfile(f, target) shutil.copystat(f, target) def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): """Unpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. """ if not zipfile.is_zipfile(filename): raise UnrecognizedFormat("%s is not a zip file" % (filename,)) with zipfile.ZipFile(filename) as z: for info in z.infolist(): name = info.filename # don't extract absolute paths or ones with .. in them if name.startswith('/') or '..' in name.split('/'): continue target = os.path.join(extract_dir, *name.split('/')) target = progress_filter(name, target) if not target: continue if name.endswith('/'): # directory ensure_directory(target) else: # file ensure_directory(target) data = z.read(info.filename) with open(target, 'wb') as f: f.write(data) unix_attributes = info.external_attr >> 16 if unix_attributes: os.chmod(target, unix_attributes) def unpack_tarfile(filename, extract_dir, progress_filter=default_filter): """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. """ try: tarobj = tarfile.open(filename) except tarfile.TarError: raise UnrecognizedFormat( "%s is not a compressed or uncompressed tar file" % (filename,) ) with contextlib.closing(tarobj): # don't do any chowning! tarobj.chown = lambda *args: None for member in tarobj: name = member.name # don't extract absolute paths or ones with .. in them if not name.startswith('/') and '..' not in name.split('/'): prelim_dst = os.path.join(extract_dir, *name.split('/')) # resolve any links and to extract the link targets as normal # files while member is not None and (member.islnk() or member.issym()): linkpath = member.linkname if member.issym(): base = posixpath.dirname(member.name) linkpath = posixpath.join(base, linkpath) linkpath = posixpath.normpath(linkpath) member = tarobj._getmember(linkpath) if member is not None and (member.isfile() or member.isdir()): final_dst = progress_filter(name, prelim_dst) if final_dst: if final_dst.endswith(os.sep): final_dst = final_dst[:-1] try: # XXX Ugh tarobj._extract_member(member, final_dst) except tarfile.ExtractError: # chown/chmod/mkfifo/mknode/makedev failed pass return True extraction_drivers = unpack_directory, unpack_zipfile, unpack_tarfile PK!bdist.pynu[# -*- coding: utf-8 -*- __all__ = ['Distribution'] import io import sys import re import os import warnings import numbers import distutils.log import distutils.core import distutils.cmd import distutils.dist from distutils.util import strtobool from distutils.debug import DEBUG from distutils.fancy_getopt import translate_longopt import itertools from collections import defaultdict from email import message_from_file from distutils.errors import ( DistutilsOptionError, DistutilsPlatformError, DistutilsSetupError, ) from distutils.util import rfc822_escape from distutils.version import StrictVersion from setuptools.extern import six from setuptools.extern import packaging from setuptools.extern import ordered_set from setuptools.extern.six.moves import map, filter, filterfalse from . import SetuptoolsDeprecationWarning from setuptools.depends import Require from setuptools import windows_support from setuptools.monkey import get_unpatched from setuptools.config import parse_configuration import pkg_resources __import__('setuptools.extern.packaging.specifiers') __import__('setuptools.extern.packaging.version') def _get_unpatched(cls): warnings.warn("Do not call this function", DistDeprecationWarning) return get_unpatched(cls) def get_metadata_version(self): mv = getattr(self, 'metadata_version', None) if mv is None: if self.long_description_content_type or self.provides_extras: mv = StrictVersion('2.1') elif (self.maintainer is not None or self.maintainer_email is not None or getattr(self, 'python_requires', None) is not None or self.project_urls): mv = StrictVersion('1.2') elif (self.provides or self.requires or self.obsoletes or self.classifiers or self.download_url): mv = StrictVersion('1.1') else: mv = StrictVersion('1.0') self.metadata_version = mv return mv def read_pkg_file(self, file): """Reads the metadata values from a file object.""" msg = message_from_file(file) def _read_field(name): value = msg[name] if value == 'UNKNOWN': return None return value def _read_list(name): values = msg.get_all(name, None) if values == []: return None return values self.metadata_version = StrictVersion(msg['metadata-version']) self.name = _read_field('name') self.version = _read_field('version') self.description = _read_field('summary') # we are filling author only. self.author = _read_field('author') self.maintainer = None self.author_email = _read_field('author-email') self.maintainer_email = None self.url = _read_field('home-page') self.license = _read_field('license') if 'download-url' in msg: self.download_url = _read_field('download-url') else: self.download_url = None self.long_description = _read_field('description') self.description = _read_field('summary') if 'keywords' in msg: self.keywords = _read_field('keywords').split(',') self.platforms = _read_list('platform') self.classifiers = _read_list('classifier') # PEP 314 - these fields only exist in 1.1 if self.metadata_version == StrictVersion('1.1'): self.requires = _read_list('requires') self.provides = _read_list('provides') self.obsoletes = _read_list('obsoletes') else: self.requires = None self.provides = None self.obsoletes = None # Based on Python 3.5 version def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ version = self.get_metadata_version() if six.PY2: def write_field(key, value): file.write("%s: %s\n" % (key, self._encode_field(value))) else: def write_field(key, value): file.write("%s: %s\n" % (key, value)) write_field('Metadata-Version', str(version)) write_field('Name', self.get_name()) write_field('Version', self.get_version()) write_field('Summary', self.get_description()) write_field('Home-page', self.get_url()) if version < StrictVersion('1.2'): write_field('Author', self.get_contact()) write_field('Author-email', self.get_contact_email()) else: optional_fields = ( ('Author', 'author'), ('Author-email', 'author_email'), ('Maintainer', 'maintainer'), ('Maintainer-email', 'maintainer_email'), ) for field, attr in optional_fields: attr_val = getattr(self, attr) if attr_val is not None: write_field(field, attr_val) write_field('License', self.get_license()) if self.download_url: write_field('Download-URL', self.download_url) for project_url in self.project_urls.items(): write_field('Project-URL', '%s, %s' % project_url) long_desc = rfc822_escape(self.get_long_description()) write_field('Description', long_desc) keywords = ','.join(self.get_keywords()) if keywords: write_field('Keywords', keywords) if version >= StrictVersion('1.2'): for platform in self.get_platforms(): write_field('Platform', platform) else: self._write_list(file, 'Platform', self.get_platforms()) self._write_list(file, 'Classifier', self.get_classifiers()) # PEP 314 self._write_list(file, 'Requires', self.get_requires()) self._write_list(file, 'Provides', self.get_provides()) self._write_list(file, 'Obsoletes', self.get_obsoletes()) # Setuptools specific for PEP 345 if hasattr(self, 'python_requires'): write_field('Requires-Python', self.python_requires) # PEP 566 if self.long_description_content_type: write_field( 'Description-Content-Type', self.long_description_content_type ) if self.provides_extras: for extra in self.provides_extras: write_field('Provides-Extra', extra) sequence = tuple, list def check_importable(dist, attr, value): try: ep = pkg_resources.EntryPoint.parse('x=' + value) assert not ep.extras except (TypeError, ValueError, AttributeError, AssertionError): raise DistutilsSetupError( "%r must be importable 'module:attrs' string (got %r)" % (attr, value) ) def assert_string_list(dist, attr, value): """Verify that value is a string list""" try: # verify that value is a list or tuple to exclude unordered # or single-use iterables assert isinstance(value, (list, tuple)) # verify that elements of value are strings assert ''.join(value) != value except (TypeError, ValueError, AttributeError, AssertionError): raise DistutilsSetupError( "%r must be a list of strings (got %r)" % (attr, value) ) def check_nsp(dist, attr, value): """Verify that namespace packages are valid""" ns_packages = value assert_string_list(dist, attr, ns_packages) for nsp in ns_packages: if not dist.has_contents_for(nsp): raise DistutilsSetupError( "Distribution contains no modules or packages for " + "namespace package %r" % nsp ) parent, sep, child = nsp.rpartition('.') if parent and parent not in ns_packages: distutils.log.warn( "WARNING: %r is declared as a package namespace, but %r" " is not: please correct this in setup.py", nsp, parent ) def check_extras(dist, attr, value): """Verify that extras_require mapping is valid""" try: list(itertools.starmap(_check_extra, value.items())) except (TypeError, ValueError, AttributeError): raise DistutilsSetupError( "'extras_require' must be a dictionary whose values are " "strings or lists of strings containing valid project/version " "requirement specifiers." ) def _check_extra(extra, reqs): name, sep, marker = extra.partition(':') if marker and pkg_resources.invalid_marker(marker): raise DistutilsSetupError("Invalid environment marker: " + marker) list(pkg_resources.parse_requirements(reqs)) def assert_bool(dist, attr, value): """Verify that value is True, False, 0, or 1""" if bool(value) != value: tmpl = "{attr!r} must be a boolean value (got {value!r})" raise DistutilsSetupError(tmpl.format(attr=attr, value=value)) def check_requirements(dist, attr, value): """Verify that install_requires is a valid requirements list""" try: list(pkg_resources.parse_requirements(value)) if isinstance(value, (dict, set)): raise TypeError("Unordered types are not allowed") except (TypeError, ValueError) as error: tmpl = ( "{attr!r} must be a string or list of strings " "containing valid project/version requirement specifiers; {error}" ) raise DistutilsSetupError(tmpl.format(attr=attr, error=error)) def check_specifier(dist, attr, value): """Verify that value is a valid version specifier""" try: packaging.specifiers.SpecifierSet(value) except packaging.specifiers.InvalidSpecifier as error: tmpl = ( "{attr!r} must be a string " "containing valid version specifiers; {error}" ) raise DistutilsSetupError(tmpl.format(attr=attr, error=error)) def check_entry_points(dist, attr, value): """Verify that entry_points map is parseable""" try: pkg_resources.EntryPoint.parse_map(value) except ValueError as e: raise DistutilsSetupError(e) def check_test_suite(dist, attr, value): if not isinstance(value, six.string_types): raise DistutilsSetupError("test_suite must be a string") def check_package_data(dist, attr, value): """Verify that value is a dictionary of package names to glob lists""" if not isinstance(value, dict): raise DistutilsSetupError( "{!r} must be a dictionary mapping package names to lists of " "string wildcard patterns".format(attr)) for k, v in value.items(): if not isinstance(k, six.string_types): raise DistutilsSetupError( "keys of {!r} dict must be strings (got {!r})" .format(attr, k) ) assert_string_list(dist, 'values of {!r} dict'.format(attr), v) def check_packages(dist, attr, value): for pkgname in value: if not re.match(r'\w+(\.\w+)*', pkgname): distutils.log.warn( "WARNING: %r not a valid package name; please use only " ".-separated package names in setup.py", pkgname ) _Distribution = get_unpatched(distutils.core.Distribution) class Distribution(_Distribution): """Distribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. """ _DISTUTILS_UNSUPPORTED_METADATA = { 'long_description_content_type': None, 'project_urls': dict, 'provides_extras': ordered_set.OrderedSet, } _patched_dist = None def patch_missing_pkg_info(self, attrs): # Fake up a replacement for the data that would normally come from # PKG-INFO, but which might not yet be built if this is a fresh # checkout. # if not attrs or 'name' not in attrs or 'version' not in attrs: return key = pkg_resources.safe_name(str(attrs['name'])).lower() dist = pkg_resources.working_set.by_key.get(key) if dist is not None and not dist.has_metadata('PKG-INFO'): dist._version = pkg_resources.safe_version(str(attrs['version'])) self._patched_dist = dist def __init__(self, attrs=None): have_package_data = hasattr(self, "package_data") if not have_package_data: self.package_data = {} attrs = attrs or {} if 'features' in attrs or 'require_features' in attrs: Feature.warn_deprecated() self.require_features = [] self.features = {} self.dist_files = [] # Filter-out setuptools' specific options. self.src_root = attrs.pop("src_root", None) self.patch_missing_pkg_info(attrs) self.dependency_links = attrs.pop('dependency_links', []) self.setup_requires = attrs.pop('setup_requires', []) for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'): vars(self).setdefault(ep.name, None) _Distribution.__init__(self, { k: v for k, v in attrs.items() if k not in self._DISTUTILS_UNSUPPORTED_METADATA }) # Fill-in missing metadata fields not supported by distutils. # Note some fields may have been set by other tools (e.g. pbr) # above; they are taken preferrentially to setup() arguments for option, default in self._DISTUTILS_UNSUPPORTED_METADATA.items(): for source in self.metadata.__dict__, attrs: if option in source: value = source[option] break else: value = default() if default else None setattr(self.metadata, option, value) if isinstance(self.metadata.version, numbers.Number): # Some people apparently take "version number" too literally :) self.metadata.version = str(self.metadata.version) if self.metadata.version is not None: try: ver = packaging.version.Version(self.metadata.version) normalized_version = str(ver) if self.metadata.version != normalized_version: warnings.warn( "Normalizing '%s' to '%s'" % ( self.metadata.version, normalized_version, ) ) self.metadata.version = normalized_version except (packaging.version.InvalidVersion, TypeError): warnings.warn( "The version specified (%r) is an invalid version, this " "may not work as expected with newer versions of " "setuptools, pip, and PyPI. Please see PEP 440 for more " "details." % self.metadata.version ) self._finalize_requires() def _finalize_requires(self): """ Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. """ if getattr(self, 'python_requires', None): self.metadata.python_requires = self.python_requires if getattr(self, 'extras_require', None): for extra in self.extras_require.keys(): # Since this gets called multiple times at points where the # keys have become 'converted' extras, ensure that we are only # truly adding extras we haven't seen before here. extra = extra.split(':')[0] if extra: self.metadata.provides_extras.add(extra) self._convert_extras_requirements() self._move_install_requirements_markers() def _convert_extras_requirements(self): """ Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. """ spec_ext_reqs = getattr(self, 'extras_require', None) or {} self._tmp_extras_require = defaultdict(list) for section, v in spec_ext_reqs.items(): # Do not strip empty sections. self._tmp_extras_require[section] for r in pkg_resources.parse_requirements(v): suffix = self._suffix_for(r) self._tmp_extras_require[section + suffix].append(r) @staticmethod def _suffix_for(req): """ For a requirement, return the 'extras_require' suffix for that requirement. """ return ':' + str(req.marker) if req.marker else '' def _move_install_requirements_markers(self): """ Move requirements in `install_requires` that are using environment markers `extras_require`. """ # divide the install_requires into two sets, simple ones still # handled by install_requires and more complex ones handled # by extras_require. def is_simple_req(req): return not req.marker spec_inst_reqs = getattr(self, 'install_requires', None) or () inst_reqs = list(pkg_resources.parse_requirements(spec_inst_reqs)) simple_reqs = filter(is_simple_req, inst_reqs) complex_reqs = filterfalse(is_simple_req, inst_reqs) self.install_requires = list(map(str, simple_reqs)) for r in complex_reqs: self._tmp_extras_require[':' + str(r.marker)].append(r) self.extras_require = dict( (k, [str(r) for r in map(self._clean_req, v)]) for k, v in self._tmp_extras_require.items() ) def _clean_req(self, req): """ Given a Requirement, remove environment markers and return it. """ req.marker = None return req def _parse_config_files(self, filenames=None): """ Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. """ from setuptools.extern.six.moves.configparser import ConfigParser # Ignore install directory options if we have a venv if six.PY3 and sys.prefix != sys.base_prefix: ignore_options = [ 'install-base', 'install-platbase', 'install-lib', 'install-platlib', 'install-purelib', 'install-headers', 'install-scripts', 'install-data', 'prefix', 'exec-prefix', 'home', 'user', 'root'] else: ignore_options = [] ignore_options = frozenset(ignore_options) if filenames is None: filenames = self.find_config_files() if DEBUG: self.announce("Distribution.parse_config_files():") parser = ConfigParser() for filename in filenames: with io.open(filename, encoding='utf-8') as reader: if DEBUG: self.announce(" reading {filename}".format(**locals())) (parser.read_file if six.PY3 else parser.readfp)(reader) for section in parser.sections(): options = parser.options(section) opt_dict = self.get_option_dict(section) for opt in options: if opt != '__name__' and opt not in ignore_options: val = self._try_str(parser.get(section, opt)) opt = opt.replace('-', '_') opt_dict[opt] = (filename, val) # Make the ConfigParser forget everything (so we retain # the original filenames that options come from) parser.__init__() # If there was a "global" section in the config file, use it # to set Distribution options. if 'global' in self.command_options: for (opt, (src, val)) in self.command_options['global'].items(): alias = self.negative_opt.get(opt) try: if alias: setattr(self, alias, not strtobool(val)) elif opt in ('verbose', 'dry_run'): # ugh! setattr(self, opt, strtobool(val)) else: setattr(self, opt, val) except ValueError as msg: raise DistutilsOptionError(msg) @staticmethod def _try_str(val): """ On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that. Why the default encoding? Because that value can be implicitly decoded back to text if needed. Ref #1653 """ if six.PY3: return val try: return val.encode() except UnicodeEncodeError: pass return val def _set_command_options(self, command_obj, option_dict=None): """ Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) """ command_name = command_obj.get_command_name() if option_dict is None: option_dict = self.get_option_dict(command_name) if DEBUG: self.announce(" setting options for '%s' command:" % command_name) for (option, (source, value)) in option_dict.items(): if DEBUG: self.announce(" %s = %s (from %s)" % (option, value, source)) try: bool_opts = [translate_longopt(o) for o in command_obj.boolean_options] except AttributeError: bool_opts = [] try: neg_opt = command_obj.negative_opt except AttributeError: neg_opt = {} try: is_string = isinstance(value, six.string_types) if option in neg_opt and is_string: setattr(command_obj, neg_opt[option], not strtobool(value)) elif option in bool_opts and is_string: setattr(command_obj, option, strtobool(value)) elif hasattr(command_obj, option): setattr(command_obj, option, value) else: raise DistutilsOptionError( "error in %s: command '%s' has no such option '%s'" % (source, command_name, option)) except ValueError as msg: raise DistutilsOptionError(msg) def parse_config_files(self, filenames=None, ignore_option_errors=False): """Parses configuration files from various levels and loads configuration. """ self._parse_config_files(filenames=filenames) parse_configuration(self, self.command_options, ignore_option_errors=ignore_option_errors) self._finalize_requires() def parse_command_line(self): """Process features after parsing command line options""" result = _Distribution.parse_command_line(self) if self.features: self._finalize_features() return result def _feature_attrname(self, name): """Convert feature name to corresponding option attribute name""" return 'with_' + name.replace('-', '_') def fetch_build_eggs(self, requires): """Resolve pre-setup requirements""" resolved_dists = pkg_resources.working_set.resolve( pkg_resources.parse_requirements(requires), installer=self.fetch_build_egg, replace_conflicting=True, ) for dist in resolved_dists: pkg_resources.working_set.add(dist, replace=True) return resolved_dists def finalize_options(self): _Distribution.finalize_options(self) if self.features: self._set_global_opts_from_features() for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'): value = getattr(self, ep.name, None) if value is not None: ep.require(installer=self.fetch_build_egg) ep.load()(self, ep.name, value) if getattr(self, 'convert_2to3_doctests', None): # XXX may convert to set here when we can rely on set being builtin self.convert_2to3_doctests = [ os.path.abspath(p) for p in self.convert_2to3_doctests ] else: self.convert_2to3_doctests = [] def get_egg_cache_dir(self): egg_cache_dir = os.path.join(os.curdir, '.eggs') if not os.path.exists(egg_cache_dir): os.mkdir(egg_cache_dir) windows_support.hide_file(egg_cache_dir) readme_txt_filename = os.path.join(egg_cache_dir, 'README.txt') with open(readme_txt_filename, 'w') as f: f.write('This directory contains eggs that were downloaded ' 'by setuptools to build, test, and run plug-ins.\n\n') f.write('This directory caches those eggs to prevent ' 'repeated downloads.\n\n') f.write('However, it is safe to delete this directory.\n\n') return egg_cache_dir def fetch_build_egg(self, req): """Fetch an egg needed for building""" from setuptools.command.easy_install import easy_install dist = self.__class__({'script_args': ['easy_install']}) opts = dist.get_option_dict('easy_install') opts.clear() opts.update( (k, v) for k, v in self.get_option_dict('easy_install').items() if k in ( # don't use any other settings 'find_links', 'site_dirs', 'index_url', 'optimize', 'site_dirs', 'allow_hosts', )) if self.dependency_links: links = self.dependency_links[:] if 'find_links' in opts: links = opts['find_links'][1] + links opts['find_links'] = ('setup', links) install_dir = self.get_egg_cache_dir() cmd = easy_install( dist, args=["x"], install_dir=install_dir, exclude_scripts=True, always_copy=False, build_directory=None, editable=False, upgrade=False, multi_version=True, no_report=True, user=False ) cmd.ensure_finalized() return cmd.easy_install(req) def _set_global_opts_from_features(self): """Add --with-X/--without-X options based on optional features""" go = [] no = self.negative_opt.copy() for name, feature in self.features.items(): self._set_feature(name, None) feature.validate(self) if feature.optional: descr = feature.description incdef = ' (default)' excdef = '' if not feature.include_by_default(): excdef, incdef = incdef, excdef new = ( ('with-' + name, None, 'include ' + descr + incdef), ('without-' + name, None, 'exclude ' + descr + excdef), ) go.extend(new) no['without-' + name] = 'with-' + name self.global_options = self.feature_options = go + self.global_options self.negative_opt = self.feature_negopt = no def _finalize_features(self): """Add/remove features and resolve dependencies between them""" # First, flag all the enabled items (and thus their dependencies) for name, feature in self.features.items(): enabled = self.feature_is_included(name) if enabled or (enabled is None and feature.include_by_default()): feature.include_in(self) self._set_feature(name, 1) # Then disable the rest, so that off-by-default features don't # get flagged as errors when they're required by an enabled feature for name, feature in self.features.items(): if not self.feature_is_included(name): feature.exclude_from(self) self._set_feature(name, 0) def get_command_class(self, command): """Pluggable version of get_command_class()""" if command in self.cmdclass: return self.cmdclass[command] eps = pkg_resources.iter_entry_points('distutils.commands', command) for ep in eps: ep.require(installer=self.fetch_build_egg) self.cmdclass[command] = cmdclass = ep.load() return cmdclass else: return _Distribution.get_command_class(self, command) def print_commands(self): for ep in pkg_resources.iter_entry_points('distutils.commands'): if ep.name not in self.cmdclass: # don't require extras as the commands won't be invoked cmdclass = ep.resolve() self.cmdclass[ep.name] = cmdclass return _Distribution.print_commands(self) def get_command_list(self): for ep in pkg_resources.iter_entry_points('distutils.commands'): if ep.name not in self.cmdclass: # don't require extras as the commands won't be invoked cmdclass = ep.resolve() self.cmdclass[ep.name] = cmdclass return _Distribution.get_command_list(self) def _set_feature(self, name, status): """Set feature's inclusion status""" setattr(self, self._feature_attrname(name), status) def feature_is_included(self, name): """Return 1 if feature is included, 0 if excluded, 'None' if unknown""" return getattr(self, self._feature_attrname(name)) def include_feature(self, name): """Request inclusion of feature named 'name'""" if self.feature_is_included(name) == 0: descr = self.features[name].description raise DistutilsOptionError( descr + " is required, but was excluded or is not available" ) self.features[name].include_in(self) self._set_feature(name, 1) def include(self, **attrs): """Add items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. """ for k, v in attrs.items(): include = getattr(self, '_include_' + k, None) if include: include(v) else: self._include_misc(k, v) def exclude_package(self, package): """Remove packages, modules, and extensions in named package""" pfx = package + '.' if self.packages: self.packages = [ p for p in self.packages if p != package and not p.startswith(pfx) ] if self.py_modules: self.py_modules = [ p for p in self.py_modules if p != package and not p.startswith(pfx) ] if self.ext_modules: self.ext_modules = [ p for p in self.ext_modules if p.name != package and not p.name.startswith(pfx) ] def has_contents_for(self, package): """Return true if 'exclude_package(package)' would do something""" pfx = package + '.' for p in self.iter_distribution_names(): if p == package or p.startswith(pfx): return True def _exclude_misc(self, name, value): """Handle 'exclude()' for list/tuple attrs without a special handler""" if not isinstance(value, sequence): raise DistutilsSetupError( "%s: setting must be a list or tuple (%r)" % (name, value) ) try: old = getattr(self, name) except AttributeError: raise DistutilsSetupError( "%s: No such distribution setting" % name ) if old is not None and not isinstance(old, sequence): raise DistutilsSetupError( name + ": this setting cannot be changed via include/exclude" ) elif old: setattr(self, name, [item for item in old if item not in value]) def _include_misc(self, name, value): """Handle 'include()' for list/tuple attrs without a special handler""" if not isinstance(value, sequence): raise DistutilsSetupError( "%s: setting must be a list (%r)" % (name, value) ) try: old = getattr(self, name) except AttributeError: raise DistutilsSetupError( "%s: No such distribution setting" % name ) if old is None: setattr(self, name, value) elif not isinstance(old, sequence): raise DistutilsSetupError( name + ": this setting cannot be changed via include/exclude" ) else: new = [item for item in value if item not in old] setattr(self, name, old + new) def exclude(self, **attrs): """Remove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. """ for k, v in attrs.items(): exclude = getattr(self, '_exclude_' + k, None) if exclude: exclude(v) else: self._exclude_misc(k, v) def _exclude_packages(self, packages): if not isinstance(packages, sequence): raise DistutilsSetupError( "packages: setting must be a list or tuple (%r)" % (packages,) ) list(map(self.exclude_package, packages)) def _parse_command_opts(self, parser, args): # Remove --with-X/--without-X options when processing command args self.global_options = self.__class__.global_options self.negative_opt = self.__class__.negative_opt # First, expand any aliases command = args[0] aliases = self.get_option_dict('aliases') while command in aliases: src, alias = aliases[command] del aliases[command] # ensure each alias can expand only once! import shlex args[:1] = shlex.split(alias, True) command = args[0] nargs = _Distribution._parse_command_opts(self, parser, args) # Handle commands that want to consume all remaining arguments cmd_class = self.get_command_class(command) if getattr(cmd_class, 'command_consumes_arguments', None): self.get_option_dict(command)['args'] = ("command line", nargs) if nargs is not None: return [] return nargs def get_cmdline_options(self): """Return a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. """ d = {} for cmd, opts in self.command_options.items(): for opt, (src, val) in opts.items(): if src != "command line": continue opt = opt.replace('_', '-') if val == 0: cmdobj = self.get_command_obj(cmd) neg_opt = self.negative_opt.copy() neg_opt.update(getattr(cmdobj, 'negative_opt', {})) for neg, pos in neg_opt.items(): if pos == opt: opt = neg val = None break else: raise AssertionError("Shouldn't be able to get here") elif val == 1: val = None d.setdefault(cmd, {})[opt] = val return d def iter_distribution_names(self): """Yield all packages, modules, and extension names in distribution""" for pkg in self.packages or (): yield pkg for module in self.py_modules or (): yield module for ext in self.ext_modules or (): if isinstance(ext, tuple): name, buildinfo = ext else: name = ext.name if name.endswith('module'): name = name[:-6] yield name def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ import sys if six.PY2 or self.help_commands: return _Distribution.handle_display_options(self, option_order) # Stdout may be StringIO (e.g. in tests) if not isinstance(sys.stdout, io.TextIOWrapper): return _Distribution.handle_display_options(self, option_order) # Don't wrap stdout if utf-8 is already the encoding. Provides # workaround for #334. if sys.stdout.encoding.lower() in ('utf-8', 'utf8'): return _Distribution.handle_display_options(self, option_order) # Print metadata in UTF-8 no matter the platform encoding = sys.stdout.encoding errors = sys.stdout.errors newline = sys.platform != 'win32' and '\n' or None line_buffering = sys.stdout.line_buffering sys.stdout = io.TextIOWrapper( sys.stdout.detach(), 'utf-8', errors, newline, line_buffering) try: return _Distribution.handle_display_options(self, option_order) finally: sys.stdout = io.TextIOWrapper( sys.stdout.detach(), encoding, errors, newline, line_buffering) class Feature: """ **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. """ @staticmethod def warn_deprecated(): msg = ( "Features are deprecated and will be removed in a future " "version. See https://github.com/pypa/setuptools/issues/65." ) warnings.warn(msg, DistDeprecationWarning, stacklevel=3) def __init__( self, description, standard=False, available=True, optional=True, require_features=(), remove=(), **extras): self.warn_deprecated() self.description = description self.standard = standard self.available = available self.optional = optional if isinstance(require_features, (str, Require)): require_features = require_features, self.require_features = [ r for r in require_features if isinstance(r, str) ] er = [r for r in require_features if not isinstance(r, str)] if er: extras['require_features'] = er if isinstance(remove, str): remove = remove, self.remove = remove self.extras = extras if not remove and not require_features and not extras: raise DistutilsSetupError( "Feature %s: must define 'require_features', 'remove', or " "at least one of 'packages', 'py_modules', etc." ) def include_by_default(self): """Should this feature be included by default?""" return self.available and self.standard def include_in(self, dist): """Ensure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. """ if not self.available: raise DistutilsPlatformError( self.description + " is required, " "but is not available on this platform" ) dist.include(**self.extras) for f in self.require_features: dist.include_feature(f) def exclude_from(self, dist): """Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. """ dist.exclude(**self.extras) if self.remove: for item in self.remove: dist.exclude_package(item) def validate(self, dist): """Verify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. """ for item in self.remove: if not dist.has_contents_for(item): raise DistutilsSetupError( "%s wants to be able to remove %s, but the distribution" " doesn't contain any packages or modules under %s" % (self.description, item, item) ) class DistDeprecationWarning(SetuptoolsDeprecationWarning): """Class for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.""" PK![  depends.pynu[import sys import marshal import contextlib from distutils.version import StrictVersion from .py33compat import Bytecode from .py27compat import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE from . import py27compat __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building or installing a distribution""" def __init__( self, name, requested_version, module, homepage='', attribute=None, format=None): if format is None and requested_version is not None: format = StrictVersion if format is not None: requested_version = format(requested_version) if attribute is None: attribute = '__version__' self.__dict__.update(locals()) del self.self def full_name(self): """Return full package/distribution name, w/version""" if self.requested_version is not None: return '%s-%s' % (self.name, self.requested_version) return self.name def version_ok(self, version): """Is 'version' sufficiently up-to-date?""" return self.attribute is None or self.format is None or \ str(version) != "unknown" and version >= self.requested_version def get_version(self, paths=None, default="unknown"): """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'. """ if self.attribute is None: try: f, p, i = find_module(self.module, paths) if f: f.close() return default except ImportError: return None v = get_module_constant(self.module, self.attribute, default, paths) if v is not None and v is not default and self.format is not None: return self.format(v) return v def is_present(self, paths=None): """Return true if dependency is present on 'paths'""" return self.get_version(paths) is not None def is_current(self, paths=None): """Return true if dependency is present and up-to-date on 'paths'""" version = self.get_version(paths) if version is None: return False return self.version_ok(version) def maybe_close(f): @contextlib.contextmanager def empty(): yield return if not f: return empty() return contextlib.closing(f) def get_module_constant(module, symbol, default=-1, paths=None): """Find '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'.""" try: f, path, (suffix, mode, kind) = info = find_module(module, paths) except ImportError: # Module doesn't exist return None with maybe_close(f): if kind == PY_COMPILED: f.read(8) # skip magic & date code = marshal.load(f) elif kind == PY_FROZEN: code = py27compat.get_frozen_object(module, paths) elif kind == PY_SOURCE: code = compile(f.read(), path, 'exec') else: # Not something we can parse; we'll have to import it. :( imported = py27compat.get_module(module, paths, info) return getattr(imported, symbol, None) return extract_constant(code, symbol, default) def extract_constant(code, symbol, default=-1): """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'. """ if symbol not in code.co_names: # name's not there, can't possibly be an assignment return None name_idx = list(code.co_names).index(symbol) STORE_NAME = 90 STORE_GLOBAL = 97 LOAD_CONST = 100 const = default for byte_code in Bytecode(code): op = byte_code.opcode arg = byte_code.arg if op == LOAD_CONST: const = code.co_consts[arg] elif arg == name_idx and (op == STORE_NAME or op == STORE_GLOBAL): return const else: const = default def _update_globals(): """ Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. """ if not sys.platform.startswith('java') and sys.platform != 'cli': return incompatible = 'extract_constant', 'get_module_constant' for name in incompatible: del globals()[name] __all__.remove(name) _update_globals() PK!Okglob.pynu[""" Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. """ import os import re import fnmatch __all__ = ["glob", "iglob", "escape"] def glob(pathname, recursive=False): """Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. """ return list(iglob(pathname, recursive=recursive)) def iglob(pathname, recursive=False): """Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. """ it = _iglob(pathname, recursive) if recursive and _isrecursive(pathname): s = next(it) # skip empty string assert not s return it def _iglob(pathname, recursive): dirname, basename = os.path.split(pathname) if not has_magic(pathname): if basename: if os.path.lexists(pathname): yield pathname else: # Patterns ending with a slash should match only directories if os.path.isdir(dirname): yield pathname return if not dirname: if recursive and _isrecursive(basename): for x in glob2(dirname, basename): yield x else: for x in glob1(dirname, basename): yield x return # `os.path.split()` returns the argument itself as a dirname if it is a # drive or UNC path. Prevent an infinite recursion if a drive or UNC path # contains magic characters (i.e. r'\\?\C:'). if dirname != pathname and has_magic(dirname): dirs = _iglob(dirname, recursive) else: dirs = [dirname] if has_magic(basename): if recursive and _isrecursive(basename): glob_in_dir = glob2 else: glob_in_dir = glob1 else: glob_in_dir = glob0 for dirname in dirs: for name in glob_in_dir(dirname, basename): yield os.path.join(dirname, name) # These 2 helper functions non-recursively glob inside a literal directory. # They return a list of basenames. `glob1` accepts a pattern while `glob0` # takes a literal basename (so it only has to check for its existence). def glob1(dirname, pattern): if not dirname: if isinstance(pattern, bytes): dirname = os.curdir.encode('ASCII') else: dirname = os.curdir try: names = os.listdir(dirname) except OSError: return [] return fnmatch.filter(names, pattern) def glob0(dirname, basename): if not basename: # `os.path.split()` returns an empty basename for paths ending with a # directory separator. 'q*x/' should match only directories. if os.path.isdir(dirname): return [basename] else: if os.path.lexists(os.path.join(dirname, basename)): return [basename] return [] # This helper function recursively yields relative pathnames inside a literal # directory. def glob2(dirname, pattern): assert _isrecursive(pattern) yield pattern[:0] for x in _rlistdir(dirname): yield x # Recursively yields relative pathnames inside a literal directory. def _rlistdir(dirname): if not dirname: if isinstance(dirname, bytes): dirname = os.curdir.encode('ASCII') else: dirname = os.curdir try: names = os.listdir(dirname) except os.error: return for x in names: yield x path = os.path.join(dirname, x) if dirname else x for y in _rlistdir(path): yield os.path.join(x, y) magic_check = re.compile('([*?[])') magic_check_bytes = re.compile(b'([*?[])') def has_magic(s): if isinstance(s, bytes): match = magic_check_bytes.search(s) else: match = magic_check.search(s) return match is not None def _isrecursive(pattern): if isinstance(pattern, bytes): return pattern == b'**' else: return pattern == '**' def escape(pathname): """Escape all special characters. """ # Escaping is done by wrapping any of "*?[" between square brackets. # Metacharacters do not work in the drive part and shouldn't be escaped. drive, pathname = os.path.splitdrive(pathname) if isinstance(pathname, bytes): pathname = magic_check_bytes.sub(br'[\1]', pathname) else: pathname = magic_check.sub(r'[\1]', pathname) return drive + pathname PK!Bךunicode_utils.pynu[import unicodedata import sys from setuptools.extern import six # HFS Plus uses decomposed UTF-8 def decompose(path): if isinstance(path, six.text_type): return unicodedata.normalize('NFD', path) try: path = path.decode('utf-8') path = unicodedata.normalize('NFD', path) path = path.encode('utf-8') except UnicodeError: pass # Not UTF-8 return path def filesys_decode(path): """ Ensure that the given path is decoded, NONE when no expected encoding works """ if isinstance(path, six.text_type): return path fs_enc = sys.getfilesystemencoding() or 'utf-8' candidates = fs_enc, 'utf-8' for enc in candidates: try: return path.decode(enc) except UnicodeDecodeError: continue def try_encode(string, enc): "turn unicode encoding into a functional routine" try: return string.encode(enc) except UnicodeEncodeError: return None PK! extension.pynu[import re import functools import distutils.core import distutils.errors import distutils.extension from setuptools.extern.six.moves import map from .monkey import get_unpatched def _have_cython(): """ Return True if Cython can be imported. """ cython_impl = 'Cython.Distutils.build_ext' try: # from (cython_impl) import build_ext __import__(cython_impl, fromlist=['build_ext']).build_ext return True except Exception: pass return False # for compatibility have_pyrex = _have_cython _Extension = get_unpatched(distutils.core.Extension) class Extension(_Extension): """Extension that uses '.c' files in place of '.pyx' files""" def __init__(self, name, sources, *args, **kw): # The *args is needed for compatibility as calls may use positional # arguments. py_limited_api may be set only via keyword. self.py_limited_api = kw.pop("py_limited_api", False) _Extension.__init__(self, name, sources, *args, **kw) def _convert_pyx_sources_to_lang(self): """ Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. """ if _have_cython(): # the build has Cython, so allow it to compile the .pyx files return lang = self.language or '' target_ext = '.cpp' if lang.lower() == 'c++' else '.c' sub = functools.partial(re.sub, '.pyx$', target_ext) self.sources = list(map(sub, self.sources)) class Library(Extension): """Just like a regular Extension, but built as a library instead""" PK!script (dev).tmplnu[# EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r __requires__ = %(spec)r __import__('pkg_resources').require(%(spec)r) __file__ = %(dev_path)r with open(__file__) as f: exec(compile(f.read(), __file__, 'exec')) PK!3wheel.pynu["""Wheels support.""" from distutils.util import get_platform import email import itertools import os import posixpath import re import zipfile import pkg_resources import setuptools from pkg_resources import parse_version from setuptools.extern.packaging.utils import canonicalize_name from setuptools.extern.six import PY3 from setuptools import pep425tags from setuptools.command.egg_info import write_requirements __metaclass__ = type WHEEL_NAME = re.compile( r"""^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$""", re.VERBOSE).match NAMESPACE_PACKAGE_INIT = '''\ try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) ''' def unpack(src_dir, dst_dir): '''Move everything under `src_dir` to `dst_dir`, and delete the former.''' for dirpath, dirnames, filenames in os.walk(src_dir): subdir = os.path.relpath(dirpath, src_dir) for f in filenames: src = os.path.join(dirpath, f) dst = os.path.join(dst_dir, subdir, f) os.renames(src, dst) for n, d in reversed(list(enumerate(dirnames))): src = os.path.join(dirpath, d) dst = os.path.join(dst_dir, subdir, d) if not os.path.exists(dst): # Directory does not exist in destination, # rename it and prune it from os.walk list. os.renames(src, dst) del dirnames[n] # Cleanup. for dirpath, dirnames, filenames in os.walk(src_dir, topdown=True): assert not filenames os.rmdir(dirpath) class Wheel: def __init__(self, filename): match = WHEEL_NAME(os.path.basename(filename)) if match is None: raise ValueError('invalid wheel name: %r' % filename) self.filename = filename for k, v in match.groupdict().items(): setattr(self, k, v) def tags(self): '''List tags (py_version, abi, platform) supported by this wheel.''' return itertools.product( self.py_version.split('.'), self.abi.split('.'), self.platform.split('.'), ) def is_compatible(self): '''Is the wheel is compatible with the current platform?''' supported_tags = pep425tags.get_supported() return next((True for t in self.tags() if t in supported_tags), False) def egg_name(self): return pkg_resources.Distribution( project_name=self.project_name, version=self.version, platform=(None if self.platform == 'any' else get_platform()), ).egg_name() + '.egg' def get_dist_info(self, zf): # find the correct name of the .dist-info dir in the wheel file for member in zf.namelist(): dirname = posixpath.dirname(member) if (dirname.endswith('.dist-info') and canonicalize_name(dirname).startswith( canonicalize_name(self.project_name))): return dirname raise ValueError("unsupported wheel format. .dist-info not found") def install_as_egg(self, destination_eggdir): '''Install wheel as an egg directory.''' with zipfile.ZipFile(self.filename) as zf: self._install_as_egg(destination_eggdir, zf) def _install_as_egg(self, destination_eggdir, zf): dist_basename = '%s-%s' % (self.project_name, self.version) dist_info = self.get_dist_info(zf) dist_data = '%s.data' % dist_basename egg_info = os.path.join(destination_eggdir, 'EGG-INFO') self._convert_metadata(zf, destination_eggdir, dist_info, egg_info) self._move_data_entries(destination_eggdir, dist_data) self._fix_namespace_packages(egg_info, destination_eggdir) @staticmethod def _convert_metadata(zf, destination_eggdir, dist_info, egg_info): def get_metadata(name): with zf.open(posixpath.join(dist_info, name)) as fp: value = fp.read().decode('utf-8') if PY3 else fp.read() return email.parser.Parser().parsestr(value) wheel_metadata = get_metadata('WHEEL') # Check wheel format version is supported. wheel_version = parse_version(wheel_metadata.get('Wheel-Version')) wheel_v1 = ( parse_version('1.0') <= wheel_version < parse_version('2.0dev0') ) if not wheel_v1: raise ValueError( 'unsupported wheel format version: %s' % wheel_version) # Extract to target directory. os.mkdir(destination_eggdir) zf.extractall(destination_eggdir) # Convert metadata. dist_info = os.path.join(destination_eggdir, dist_info) dist = pkg_resources.Distribution.from_location( destination_eggdir, dist_info, metadata=pkg_resources.PathMetadata(destination_eggdir, dist_info), ) # Note: Evaluate and strip markers now, # as it's difficult to convert back from the syntax: # foobar; "linux" in sys_platform and extra == 'test' def raw_req(req): req.marker = None return str(req) install_requires = list(sorted(map(raw_req, dist.requires()))) extras_require = { extra: sorted( req for req in map(raw_req, dist.requires((extra,))) if req not in install_requires ) for extra in dist.extras } os.rename(dist_info, egg_info) os.rename( os.path.join(egg_info, 'METADATA'), os.path.join(egg_info, 'PKG-INFO'), ) setup_dist = setuptools.Distribution( attrs=dict( install_requires=install_requires, extras_require=extras_require, ), ) write_requirements( setup_dist.get_command_obj('egg_info'), None, os.path.join(egg_info, 'requires.txt'), ) @staticmethod def _move_data_entries(destination_eggdir, dist_data): """Move data entries to their correct location.""" dist_data = os.path.join(destination_eggdir, dist_data) dist_data_scripts = os.path.join(dist_data, 'scripts') if os.path.exists(dist_data_scripts): egg_info_scripts = os.path.join( destination_eggdir, 'EGG-INFO', 'scripts') os.mkdir(egg_info_scripts) for entry in os.listdir(dist_data_scripts): # Remove bytecode, as it's not properly handled # during easy_install scripts install phase. if entry.endswith('.pyc'): os.unlink(os.path.join(dist_data_scripts, entry)) else: os.rename( os.path.join(dist_data_scripts, entry), os.path.join(egg_info_scripts, entry), ) os.rmdir(dist_data_scripts) for subdir in filter(os.path.exists, ( os.path.join(dist_data, d) for d in ('data', 'headers', 'purelib', 'platlib') )): unpack(subdir, destination_eggdir) if os.path.exists(dist_data): os.rmdir(dist_data) @staticmethod def _fix_namespace_packages(egg_info, destination_eggdir): namespace_packages = os.path.join( egg_info, 'namespace_packages.txt') if os.path.exists(namespace_packages): with open(namespace_packages) as fp: namespace_packages = fp.read().split() for mod in namespace_packages: mod_dir = os.path.join(destination_eggdir, *mod.split('.')) mod_init = os.path.join(mod_dir, '__init__.py') if os.path.exists(mod_dir) and not os.path.exists(mod_init): with open(mod_init, 'w') as fp: fp.write(NAMESPACE_PACKAGE_INIT) PK!VD py34compat.pynu[import importlib try: import importlib.util except ImportError: pass try: module_from_spec = importlib.util.module_from_spec except AttributeError: def module_from_spec(spec): return spec.loader.load_module(spec.name) PK!s   PK!T-k k %__pycache__/lib2to3_ex.cpython-38.pycnu[U Qab@sXdZddlmZddlmZddlmZmZddl Z GdddeZ Gdd d eZdS) zy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. ) Mixin2to3)log)RefactoringToolget_fixers_from_packageNc@s$eZdZddZddZddZdS)DistutilsRefactoringToolcOstj|f|dSN)rerror)selfmsgargskwr 9/usr/lib/python3.8/site-packages/setuptools/lib2to3_ex.py log_errorsz"DistutilsRefactoringTool.log_errorcGstj|f|dSr)rinfor r r r r r log_messagesz$DistutilsRefactoringTool.log_messagecGstj|f|dSr)rdebugrr r r log_debugsz"DistutilsRefactoringTool.log_debugN)__name__ __module__ __qualname__rrrr r r rrsrc@s&eZdZd ddZddZddZdS) rFcCsr|jjdk rdS|sdStdd||||rbtjrnt |j }|j |dddn t ||dS)NTzFixing  )writeZ doctests_only) distributionZuse_2to3rrjoin_Mixin2to3__build_fixer_names_Mixin2to3__exclude_fixers setuptoolsZrun_2to3_on_doctestsr fixer_namesZrefactor _Mixin2to3run_2to3)r filesZdoctestsrr r rr!s  zMixin2to3.run_2to3cCsZ|jr dSg|_tjD]}|jt|q|jjdk rV|jjD]}|jt|q@dSr)rrZlib2to3_fixer_packagesextendrrZuse_2to3_fixers)r pr r rZ__build_fixer_names.s   zMixin2to3.__build_fixer_namescCsJt|dg}|jjdk r&||jj|D]}||jkr*|j|q*dS)NZexclude_fixers)getattrrZuse_2to3_exclude_fixersr$rremove)r Zexcluded_fixersZ fixer_namer r rZ__exclude_fixers8s    zMixin2to3.__exclude_fixersN)F)rrrr!rrr r r rrs  r) __doc__Zdistutils.utilrr Z distutilsrZlib2to3.refactorrrrrr r r rs    PK!ئ*__pycache__/windows_support.cpython-38.pycnu[U Qab@s(ddlZddlZddZeddZdS)NcCstdkrddS|S)NZWindowsc_sdS)N)argskwargsrr>/usr/lib/python3.8/site-packages/setuptools/windows_support.pyzwindows_only..)platformsystem)funcrrr windows_onlys r cCsLtdtjjj}tjjtjjf|_tjj |_ d}|||}|sHt dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. zctypes.wintypesN) __import__ctypesZwindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDZargtypesZBOOLZrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr hide_file s    r)rrr rrrrrsPK!!%__pycache__/py31compat.cpython-38.pycnu[U QabF@sPgZeZzddlmZWn2ek rJddlZddlZGdddZYnXdS))TemporaryDirectoryNc@s(eZdZdZddZddZddZdS) rz Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cKsd|_tjf||_dSN)nametempfileZmkdtemp)selfkwargsr9/usr/lib/python3.8/site-packages/setuptools/py31compat.py__init__szTemporaryDirectory.__init__cCs|jSr)r)rrrr __enter__szTemporaryDirectory.__enter__cCs2zt|jdWntk r&YnXd|_dS)NT)shutilZrmtreerOSError)rexctypeZexcvalueZexctracerrr __exit__s zTemporaryDirectory.__exit__N)__name__ __module__ __qualname____doc__r r rrrrr r sr)__all__typeZ __metaclass__rr ImportErrorr rrrr sPK!C33)__pycache__/dep_util.cpython-38.opt-1.pycnu[U Qab@sddlmZddZdS)) newer_groupcCsht|t|krtdg}g}tt|D]2}t||||r,||||||q,||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)Zsources_groupsZtargetsZ n_sourcesZ n_targetsir7/usr/lib/python3.8/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr N)Zdistutils.dep_utilrr rrrr s PK!\+__pycache__/py34compat.cpython-38.opt-1.pycnu[U Qab@sXddlZz ddlZWnek r(YnXz ejjZWnek rRddZYnXdS)NcCs|j|jS)N)loader load_modulename)specr9/usr/lib/python3.8/site-packages/setuptools/py34compat.pymodule_from_spec sr) importlibimportlib.util ImportErrorutilrAttributeErrorrrrrs  PK!T-k k +__pycache__/lib2to3_ex.cpython-38.opt-1.pycnu[U Qab@sXdZddlmZddlmZddlmZmZddl Z GdddeZ Gdd d eZdS) zy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. ) Mixin2to3)log)RefactoringToolget_fixers_from_packageNc@s$eZdZddZddZddZdS)DistutilsRefactoringToolcOstj|f|dSN)rerror)selfmsgargskwr 9/usr/lib/python3.8/site-packages/setuptools/lib2to3_ex.py log_errorsz"DistutilsRefactoringTool.log_errorcGstj|f|dSr)rinfor r r r r r log_messagesz$DistutilsRefactoringTool.log_messagecGstj|f|dSr)rdebugrr r r log_debugsz"DistutilsRefactoringTool.log_debugN)__name__ __module__ __qualname__rrrr r r rrsrc@s&eZdZd ddZddZddZdS) rFcCsr|jjdk rdS|sdStdd||||rbtjrnt |j }|j |dddn t ||dS)NTzFixing  )writeZ doctests_only) distributionZuse_2to3rrjoin_Mixin2to3__build_fixer_names_Mixin2to3__exclude_fixers setuptoolsZrun_2to3_on_doctestsr fixer_namesZrefactor _Mixin2to3run_2to3)r filesZdoctestsrr r rr!s  zMixin2to3.run_2to3cCsZ|jr dSg|_tjD]}|jt|q|jjdk rV|jjD]}|jt|q@dSr)rrZlib2to3_fixer_packagesextendrrZuse_2to3_fixers)r pr r rZ__build_fixer_names.s   zMixin2to3.__build_fixer_namescCsJt|dg}|jjdk r&||jj|D]}||jkr*|j|q*dS)NZexclude_fixers)getattrrZuse_2to3_exclude_fixersr$rremove)r Zexcluded_fixersZ fixer_namer r rZ__exclude_fixers8s    zMixin2to3.__exclude_fixersN)F)rrrr!rrr r r rrs  r) __doc__Zdistutils.utilrr Z distutilsrZlib2to3.refactorrrrrr r r rs    PK!\%__pycache__/py34compat.cpython-38.pycnu[U Qab@sXddlZz ddlZWnek r(YnXz ejjZWnek rRddZYnXdS)NcCs|j|jS)N)loader load_modulename)specr9/usr/lib/python3.8/site-packages/setuptools/py34compat.pymodule_from_spec sr) importlibimportlib.util ImportErrorutilrAttributeErrorrrrrs  PK!s   PK!M]/!/!%__pycache__/build_meta.cpython-38.pycnu[U Qab}%@s dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZdddd d d d gZGd d d eZGdddejjZddZddZddZddZGdddeZGdddeZeZejZejZejZejZej Z eZ!dS)a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. N)TemporaryDirectory)parse_requirements)makedirsget_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheel build_wheel build_sdist __legacy__SetupRequirementsErrorc@seZdZddZdS)r cCs ||_dSN) specifiers)selfr r9/usr/lib/python3.8/site-packages/setuptools/build_meta.py__init__4szSetupRequirementsError.__init__N)__name__ __module__ __qualname__rrrrrr 3sc@s&eZdZddZeejddZdS) DistributioncCstttt|}t|dSr )listmapstrrr )rr Zspecifier_listrrrfetch_build_eggs9szDistribution.fetch_build_eggsccs*tjj}|tj_z dVW5|tj_XdS)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilsZcorer)clsZorigrrrpatch>s  zDistribution.patchN)rrrr classmethod contextlibcontextmanagerrrrrrr8srcCs*tjddkr&t|ts&|tS|S)z Convert a filename to a string (on Python 2, explicitly a byte string, not Unicode) as distutils checks for the exact type str. r)sys version_info isinstancerencodegetfilesystemencoding)srrr_to_strNsr'csfddtDS)Ncs&g|]}tjtj|r|qSr)ospathisdirjoin).0nameZa_dirrr \sz1_get_immediate_subdirectories..r(listdirr.rr.r_get_immediate_subdirectories[sr2cs"fddt|D}|\}|S)Nc3s|]}|r|VqdSr endswithr,f extensionrr as z'_file_with_extension..r0)Z directoryr8Zmatchingfilerr7r_file_with_extension`s  r;cCs&tj|stdSttdt|S)Nz%from setuptools import setup; setup()open)r(r)existsioStringIOgetattrtokenizer< setup_scriptrrr_open_setup_scriptis  rDc@s`eZdZddZddZdddZdd d Zdd d Zdd dZddZ dddZ dddZ dS)_BuildMetaBackendcCs|pi}|dg|S)N--global-option) setdefaultrconfig_settingsrrr _fix_configss z_BuildMetaBackend._fix_configc Csz||}tjdddg|dt_z t|W5QRXWn,tk rt}z||j7}W5d}~XYnX|S)NZegg_inforF)rJr!argvrr run_setupr r )rrI requirementserrr_get_build_requiresxs  z%_BuildMetaBackend._get_build_requiressetup.pyc CsD|}d}t|}|dd}W5QRXtt||dtdS)N__main__z\r\nz\nexec)rDreadreplacerScompilelocals)rrC__file__rr6coderrrrMs  z_BuildMetaBackend.run_setupNcCs||}|j|dgdS)NZwheelrNrJrPrHrrrrs z._BuildMetaBackend.get_requires_for_build_wheelcCs||}|j|gdS)NrZr[rHrrrrs z._BuildMetaBackend.get_requires_for_build_sdistcCstjddddt|gt_||}ddt|D}t|dkrttt|dkrttj |t|d}q*t|dkst qq*||krt tj ||d|t j |dd|dS) NrKZ dist_infoz --egg-basecSsg|]}|dr|qS)z .dist-infor3r5rrrr/s zF_BuildMetaBackend.prepare_metadata_for_build_wheel..rT) ignore_errors)r!rLr'rMr(r1lenr2r)r+AssertionErrorshutilZmoveZrmtree)rmetadata_directoryrIZdist_info_directoryZ dist_infosrrrrs.  z2_BuildMetaBackend.prepare_metadata_for_build_wheelc Cs||}tj|}t|ddt|dv}tjdd|d|g|dt_|t ||}tj ||}tj |rt |t tj |||W5QRX|S)NT)exist_ok)dirrKz --dist-dirrF)rJr(r)abspathrrr!rLrMr;r+r=removerename)rZ setup_commandZresult_extensionZresult_directoryrIZ tmp_dist_dirZresult_basenameZ result_pathrrr_build_with_temp_dirs         z&_BuildMetaBackend._build_with_temp_dircCs|dgd||S)NZ bdist_wheelz.whlrf)rZwheel_directoryrIr`rrrrs z_BuildMetaBackend.build_wheelcCs|dddgd||S)NZsdistz --formatsZgztarz.tar.gzrg)rZsdist_directoryrIrrrr s  z_BuildMetaBackend.build_sdist)rQ)N)N)N)NN)N) rrrrJrPrMrrrrfrr rrrrrEqs    rEcs"eZdZdZdfdd ZZS)_BuildMetaLegacyBackendaCCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. rQc sbttj}tjtj|}|tjkr6tjd|ztt|j |dW5|tjdd<XdS)NrrB) rr!r)r(dirnamercinsertsuperrhrM)rrCZsys_pathZ script_dir __class__rrrMs   z!_BuildMetaLegacyBackend.run_setup)rQ)rrr__doc__rM __classcell__rrrlrrhsrh)"rnr>r(r!rAr_rZ setuptoolsrZsetuptools.py31compatrZ pkg_resourcesrZpkg_resources.py31compatr__all__ BaseExceptionr Zdistrr'r2r;rDobjectrErhZ_BACKENDrrrrr r rrrrsD     hPK!tEE'__pycache__/config.cpython-38.opt-1.pycnu[U Qab6P@sddlmZmZddlZddlZddlZddlZddlZddlm Z ddlm Z ddlm Z ddl m Z ddlmZmZddlmZmZdd lmZdd lmZmZeZdd d ZddZddZdddZGdddZGdddeZ GdddeZ!dS))absolute_importunicode_literalsN) defaultdict)partialwraps) import_module)DistutilsOptionErrorDistutilsFileError) LegacyVersionparse) SpecifierSet) string_typesPY3Fc Csddlm}m}tj|}tj|s4td|t}t tj |zJ|}|rb| ng}||krx| ||j ||dt||j|d}W5t |Xt|S)a,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict r) Distribution _Distributionz%Configuration file %s does not exist.) filenames)ignore_option_errors)Zsetuptools.distrrospathabspathisfiler getcwdchdirdirnameZfind_config_filesappendZparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersrrrZcurrent_directoryZdistrhandlersr!5/usr/lib/python3.8/site-packages/setuptools/config.pyread_configurations*     r#cCs.djft}tt||}t|||}|S)z Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. z get_{key})formatlocals functoolsrgetattr) target_objkeyZ getter_nameZ by_attributegetterr!r!r" _get_optionEs r+cCs<tt}|D]*}|jD]}t|j|}|||j|<qq |S)zReturns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict )rdict set_optionsr+r(section_prefix)r Z config_dictZhandlerZoptionvaluer!r!r"rQs   rcCs6t|||}|t|j|||j}|||fS)aPerforms additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list )ConfigOptionsHandlerr ConfigMetadataHandlermetadata package_dir)Z distributionrroptionsmetar!r!r"rcsrc@seZdZdZdZiZd%ddZeddZdd Z e d&d d Z e d dZ e ddZ e ddZe ddZeddZeddZe d'ddZe ddZe d(ddZdd Zd!d"Zd#d$ZdS)) ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|D].\}}||s&q||dd}|||<q||_||_||_g|_dS)N.) r.items startswithreplacestriprr(sectionsr-)selfr(r4rr=r. section_namesection_optionsr!r!r"__init__s  zConfigHandler.__init__cCstd|jjdS).Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError __class____name__)r>r!r!r"parserss zConfigHandler.parsersc Cst}|j}|j||}t|||}||kr6t||r>dSd}|j|}|rz ||}Wn tk r~d}|jszYnX|rdSt|d|d}|dkrt |||n|||j |dS)NFTzset_%s) tupler(aliasesgetr'KeyErrorrF Exceptionrsetattrr-r) r>Z option_namer/unknownr(Z current_valueZ skip_optionparsersetterr!r!r" __setitem__s0   zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |}n ||}dd|DS)zRepresents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list  cSsg|]}|r|qSr!)r<).0chunkr!r!r" sz-ConfigHandler._parse_list..) isinstancelist splitlinessplit)clsr/ separatorr!r!r" _parse_lists   zConfigHandler._parse_listcCsPd}i}||D]8}||\}}}||kr:td||||<q|S)zPRepresents value as a dict. :param value: :rtype: dict =z(Unable to parse option value to dict: %s)r\ partitionr r<)rZr/r[resultliner)sepvalr!r!r" _parse_dictszConfigHandler._parse_dictcCs|}|dkS)zQRepresents value as boolean. :param value: :rtype: bool )1trueZyes)lower)rZr/r!r!r" _parse_boolszConfigHandler._parse_boolcsfdd}|S)zReturns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable cs d}||rtd|S)Nfile:zCOnly strings are accepted for the {0} field, files are not accepted)r: ValueErrorr$)r/Zexclude_directiver)r!r"rNs z3ConfigHandler._exclude_files_parser..parserr!)rZr)rNr!rjr"_exclude_files_parsers z#ConfigHandler._exclude_files_parsercs\d}t|ts|S||s |S|t|d}dd|dD}dfdd|DS)aORepresents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtype: str rhNcss|]}tj|VqdSN)rrrr<rSrr!r!r" %sz,ConfigHandler._parse_file..rQrRc3s.|]&}|stj|r|VqdS)TN) _assert_localrrr _read_filermrZr!r"rn&s   )rVrr:lenrYjoin)rZr/Zinclude_directivespecZ filepathsr!rqr" _parse_files  zConfigHandler._parse_filecCs|tstd|dS)Nz#`file:` directive can not access %s)r:rrr )rr!r!r"ro-szConfigHandler._assert_localc Cs.tj|dd}|W5QRSQRXdS)Nzutf-8)encoding)ioopenread)rfr!r!r"rp3szConfigHandler._read_filec Csd}||s|S||dd}|}d|}|p@d}t}|r|d|kr||d}|dd} t | dkrtj t| d}| d}q|}nd|krtj t|d}t j d|zt |} t| |}W5t j ddt _ X|S) zRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str zattr:r7r8rAr/N)r:r;r<rYpoprsrrrsplitrrrsysinsertrr') rZr/r3Zattr_directiveZ attrs_pathZ attr_nameZ module_name parent_pathZ custom_pathpartsmoduler!r!r" _parse_attr8s0        zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable cs|}D] }||}q|Srlr!)r/parsedmethod parse_methodsr!r"r ns z1ConfigHandler._get_parser_compound..parser!)rZrr r!rr"_get_parser_compoundes z"ConfigHandler._get_parser_compoundcCs6i}|pdd}|D]\}\}}||||<q|S)zParses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict cSs|Srlr!)rbr!r!r"z6ConfigHandler._parse_section_to_dict..)r9)rZr@Z values_parserr/r)_rbr!r!r"_parse_section_to_dictxs  z$ConfigHandler._parse_section_to_dictc Cs<|D].\}\}}z |||<Wqtk r4YqXqdS)zQParses configuration file section. :param dict section_options: N)r9rJ)r>r@namerr/r!r!r" parse_sections  zConfigHandler.parse_sectioncCsb|jD]R\}}d}|r"d|}t|d|ddd}|dkrTtd|j|f||q dS)zTParses configuration file items from one or more related sections. r7z_%szparse_section%sr8__Nz0Unsupported distribution option section: [%s.%s])r=r9r'r;r r.)r>r?r@Zmethod_postfixZsection_parser_methodr!r!r"r s"zConfigHandler.parsecstfdd}|S)z this function will wrap around parameters that are deprecated :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around cst||Srl)warningswarn)argskwargsfuncmsg warning_classr!r"config_handlers z@ConfigHandler._deprecated_config_handler..config_handlerr)r>rrrrr!rr"_deprecated_config_handlersz(ConfigHandler._deprecated_config_handler)F)rQ)N)N)rE __module__ __qualname____doc__r.rHrApropertyrFrP classmethodr\rcrgrkru staticmethodrorprrrrr rr!r!r!r"r6~s<  &        ,   r6csHeZdZdZdddddZdZdfd d Zed d Zd dZ Z S)r1r2Zurl description classifiers platforms)Z home_pageZsummaryZ classifierplatformFNcstt||||||_dSrl)superr1rAr3)r>r(r4rr3rDr!r"rAszConfigMetadataHandler.__init__c CsL|j}|j}|j}|j}|||||dt|||||d|||j|d S)rBz[The requires parameter is deprecated, please use install_requires for runtime dependencies.license) rkeywordsZprovidesZrequiresZ obsoletesrrrZlong_descriptionversionZ project_urls)r\rurcrkrDeprecationWarningr_parse_version)r> parse_listZ parse_file parse_dictZexclude_files_parserr!r!r"rFs( zConfigMetadataHandler.parserscCs||}||krB|}tt|tr>d}t|jft|S|||j }t |r^|}t|t st |drd tt|}nd|}|S)zSParses `version` option value. :param value: :rtype: str zCVersion loaded from {value} does not comply with PEP 440: {version}__iter__r8z%s)rur<rVr r r r$r%rr3callablerhasattrrsmapstr)r>r/rZtmplr!r!r"rs    z$ConfigMetadataHandler._parse_version)FN) rErrr.rHZ strict_moderArrFr __classcell__r!r!rr"r1s r1c@s\eZdZdZeddZddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)r0r4cCsN|j}t|jdd}|j}|j}|||||||||||||||j|j|tdS)rB;r[)Zzip_safeZuse_2to3Zinclude_package_datar3Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsZscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requireZpackages entry_pointsZ py_modulesZpython_requires)r\rrgrc_parse_packagesrur )r>rZparse_list_semicolonZ parse_boolrr!r!r"rFs.zConfigOptionsHandler.parserscCszddg}|}||kr"||S||dk}|r>ts>td||jdi}|rdddlm}n ddlm }|f|S) zTParses `packages` option value. :param value: :rtype: list zfind:zfind_namespace:r|z8find_namespace: directive is unsupported on Python < 3.3z packages.findr)find_namespace_packages) find_packages) r<r\rr parse_section_packages__findr=rIZ setuptoolsrr)r>r/Zfind_directivesZ trimmed_valueZfindns find_kwargsrr!r!r"r1s     z$ConfigOptionsHandler._parse_packagescsT|||j}dddgtfdd|D}|d}|dk rP|d|d<|S)zParses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: whereZincludeexcludecs$g|]\}}|kr|r||fqSr!r!rSkvZ valid_keysr!r"rUZszEConfigOptionsHandler.parse_section_packages__find..Nr)rr\r,r9rI)r>r@Z section_datarrr!rr"rMs   z1ConfigOptionsHandler.parse_section_packages__findcCs|||j}||d<dS)z`Parses `entry_points` configuration file section. :param dict section_options: rN)rr\r>r@rr!r!r"parse_section_entry_pointsbsz/ConfigOptionsHandler.parse_section_entry_pointscCs.|||j}|d}|r*||d<|d=|S)N*r7)rr\rI)r>r@rrootr!r!r"_parse_package_datajs  z(ConfigOptionsHandler._parse_package_datacCs|||d<dS)z`Parses `package_data` configuration file section. :param dict section_options: Z package_dataNrr>r@r!r!r"parse_section_package_datatsz/ConfigOptionsHandler.parse_section_package_datacCs|||d<dS)zhParses `exclude_package_data` configuration file section. :param dict section_options: Zexclude_package_dataNrrr!r!r""parse_section_exclude_package_data{sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}||||d<dS)zbParses `extras_require` configuration file section. :param dict section_options: rrZextras_requireN)rr\r)r>r@rr!r!r"parse_section_extras_requires z1ConfigOptionsHandler.parse_section_extras_requirecCs(|||j}dd|D|d<dS)z^Parses `data_files` configuration file section. :param dict section_options: cSsg|]\}}||fqSr!r!rr!r!r"rUszAConfigOptionsHandler.parse_section_data_files..Z data_filesN)rr\r9rr!r!r"parse_section_data_filessz-ConfigOptionsHandler.parse_section_data_filesN)rErrr.rrFrrrrrrrrr!r!r!r"r0s   r0)FF)F)"Z __future__rrrwrrrr& collectionsrrr importlibrZdistutils.errorsr r Z#setuptools.extern.packaging.versionr r Z&setuptools.extern.packaging.specifiersr Zsetuptools.extern.sixrrtypeZ __metaclass__r#r+rrr6r1r0r!r!r!r"s4      /  ?UPK!K&~ __pycache__/wheel.cpython-38.pycnu[U Qab@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl m Z ddlmZddl mZddlmZeZed ejjZd Zd d ZGd ddZdS)zWheels support.) get_platformN) parse_version)canonicalize_name)PY3) pep425tags)write_requirementsz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$ztry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c Cst|D]\}}}tj||}|D].}tj||}tj|||}t||q&ttt|D]D\} } tj|| }tj||| }tj |sft|||| =qfq tj|ddD]\}}}|rt t |qdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsAssertionErrorrmdir) Zsrc_dirZdst_dirdirpathZdirnames filenamessubdirfsrcZdstndr4/usr/lib/python3.8/site-packages/setuptools/wheel.pyunpack%s   rc@sheZdZddZddZddZddZd d Zd d Zd dZ e ddZ e ddZ e ddZ dS)WheelcCsPttj|}|dkr$td|||_|D]\}}t|||q6dS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr#matchkvrrr__init__=s  zWheel.__init__cCs&t|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproductZ py_versionsplitZabiplatformr'rrrtagsEs    z Wheel.tagscs$ttfdd|DdS)z5Is the wheel is compatible with the current platform?c3s|]}|krdVqdS)TNr).0tZsupported_tagsrr Psz&Wheel.is_compatible..F)rZ get_supportednextr2r1rr5r is_compatibleMszWheel.is_compatiblecCs,tj|j|j|jdkrdntddS)Nany) project_nameversionr0z.egg) pkg_resources Distributionr:r;r0regg_namer1rrrr>RszWheel.egg_namecCsJ|D]4}t|}|drt|t|jr|SqtddS)Nz .dist-infoz.unsupported wheel format. .dist-info not found)Znamelist posixpathdirnameendswithr startswithr:r")r'zfmemberr@rrr get_dist_infoXs    zWheel.get_dist_infoc Cs(t|j}|||W5QRXdS)z"Install wheel as an egg directory.N)zipfileZZipFiler#_install_as_egg)r'destination_eggdirrCrrrinstall_as_eggbszWheel.install_as_eggcCs\d|j|jf}||}d|}tj|d}|||||||||||dS)Nz%s-%sz%s.dataEGG-INFO) r:r;rEr r r _convert_metadata_move_data_entries_fix_namespace_packages)r'rHrCZ dist_basename dist_info dist_dataegg_inforrrrGgs  zWheel._install_as_eggc s&fdd}|d}t|d}td|ko>tdkn}|sTtd|t||tj|tj j |t |dd d t t tfd d jD}t|ttj|d tj|dtj t|dd} t| ddtj|ddS)Nc sTt|8}tr&|dn|}tj |W5QRSQRXdS)Nzutf-8) openr?r rreaddecodeemailparserZParserZparsestr)namefpvalue)rNrCrr get_metadatassz-Wheel._convert_metadata..get_metadataZWHEELz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|SN)Zmarkerstr)reqrrrraw_reqsz(Wheel._convert_metadata..raw_reqc s2i|]*}|tfddt|fDqS)c3s|]}|kr|VqdSrZr)r3r\)install_requiresrrr6sz5Wheel._convert_metadata...)sortedmaprequires)r3Zextra)distr^r]rr s  z+Wheel._convert_metadata..ZMETADATAzPKG-INFO)r^extras_require)ZattrsrPz requires.txt)rgetr"r mkdirZ extractallr r r<r=Z from_locationZ PathMetadatarr_r`raZextrasrename setuptoolsdictrZget_command_obj) rCrHrNrPrYZwheel_metadataZ wheel_versionZwheel_v1rdZ setup_distr)rbrNr^r]rCrrKqsL       zWheel._convert_metadatacstj|tjd}tj|rtj|dd}t|t|D]D}|drpttj||qLttj||tj||qLt |t tjjfdddDD]}t ||qtjrt dS)z,Move data entries to their correct location.ZscriptsrJz.pycc3s|]}tj|VqdSrZ)r r r )r3rrOrrr6sz+Wheel._move_data_entries..)dataZheadersZpurelibZplatlibN) r r r rrflistdirrAunlinkrgrfilterr)rHrOZdist_data_scriptsZegg_info_scriptsentryrrrjrrLs.         zWheel._move_data_entriesc Cstj|d}tj|rt|}|}W5QRX|D]b}tjj|f|d}tj|d}tj|r>tj|s>t|d}|tW5QRXq>dS)Nznamespace_packages.txtr,z __init__.pyw) r r r rrQrRr/writeNAMESPACE_PACKAGE_INIT)rPrHZnamespace_packagesrWmodZmod_dirZmod_initrrrrMs   zWheel._fix_namespace_packagesN)__name__ __module__ __qualname__r+r2r8r>rErIrG staticmethodrKrLrMrrrrr;s   9 r)__doc__Zdistutils.utilrrTr-r r?rerFr<rhrZ!setuptools.extern.packaging.utilsrZsetuptools.extern.sixrrZsetuptools.command.egg_infortypeZ __metaclass__compileVERBOSEr(r rrrrrrrrs,      PK![g``"__pycache__/depends.cpython-38.pycnu[U Qab@sddlZddlZddlZddlmZddlmZddlmZm Z m Z m Z ddl mZddd d gZ Gd ddZd d Zddd Zddd ZddZedS)N) StrictVersion)Bytecode) find_module PY_COMPILED PY_FROZEN PY_SOURCE) py27compatRequirerget_module_constantextract_constantc@sHeZdZdZdddZddZdd Zdd d Zdd dZdddZ dS)r z7A prerequisite to building or installing a distributionNcCsF|dkr|dk rt}|dk r0||}|dkr0d}|jt|`dS)N __version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage attributeformatr6/usr/lib/python3.8/site-packages/setuptools/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_okrcCs|jdkrFz$t|j|\}}}|r*||WStk rDYdSXt|j|j||}|dk r|||k r||jdk r|||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)rrrclose ImportErrorr r)rpathsdefaultfpivrrr get_version.s  zRequire.get_versioncCs||dk S)z/Return true if dependency is present on 'paths'N)r()rr"rrr is_presentIszRequire.is_presentcCs ||}|dkrdS||S)z>Return true if dependency is present and up-to-date on 'paths'NF)r(r)rr"rrrr is_currentMs zRequire.is_current)r NN)Nr)N)N) __name__ __module__ __qualname____doc__rrrr(r)r*rrrrr s   cCs"tjdd}|s|St|S)Ncss dVdS)NrrrrremptyVszmaybe_close..empty) contextlibcontextmanagerclosing)r$r/rrr maybe_closeUs  r3c Cszt||\}}\}}}} Wntk r4YdSXt|z|tkr^|dt|} nV|tkrtt ||} n@|t krt ||d} n&t ||| } t | |dW5QRSW5QRXt| ||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)rr!r3rreadmarshalloadrr get_frozen_objectrcompileZ get_modulegetattrr ) rsymbolr#r"r$pathsuffixmodeZkindinfocodeZimportedrrrr `s   "c Cs||jkrdSt|j|}d}d}d}|}t|D]H}|j} |j} | |krZ|j| }q6| |krz| |ksr| |krz|S|}q6dS)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) rBr=r#Zname_idxZ STORE_NAMEZ STORE_GLOBALZ LOAD_CONSTconstZ byte_codeoprIrrrr }s   cCs>tjdstjdkrdSd}|D]}t|=t|q"dS)z Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. javaZcliN)r r )sysplatform startswithglobals__all__remove)Z incompatiblerrrr_update_globalss rT)r4N)r4)rNr8r0Zdistutils.versionrZ py33compatrr rrrrr rRr r3r r rTrrrrs"   D  $PK!$$'__pycache__/monkey.cpython-38.opt-1.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ ddZddZd d Zd d Zd dZddZddZddZdS)z Monkey patching of distutils. N) import_module)sixcCs"tdkr|f|jSt|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. ZJython)platformZpython_implementation __bases__inspectZgetmro)clsr5/usr/lib/python3.8/site-packages/setuptools/monkey.py_get_mros  r cCs0t|tjrtnt|tjr tndd}||S)NcSsdS)Nr)itemrrr *zget_unpatched..) isinstancerZ class_typesget_unpatched_classtypes FunctionTypeget_unpatched_function)r lookuprrr get_unpatched&s rcCs:ddt|D}t|}|jds6d|}t||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css|]}|jds|VqdS) setuptoolsN) __module__ startswith).0rrrr 5s z&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextrrAssertionError)rZexternal_basesbasemsgrrr r/s rcCstjtj_tjdk}|r"tjtj_tjdkp^dtjko@dknp^dtjkoZdkn}|rrd}|tjj _ t tj tjtj fD]}tj j|_qtjjtj_tjjtj_dtjkrtjjtjd_tdS)N)r) )r)rr$)rr zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rZCommandrZcoresys version_infofindallZfilelistZconfigZ PyPIRCCommandZDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdZ Distribution extensionZ Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehousemodulerrr patch_allAs*          r0cCs*dD] }ttj|}ttjj||qdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Zwrite_pkg_fileZ read_pkg_fileZget_metadata_versionN)getattrrr*setattrrZDistributionMetadata)attrZnew_valrrr r)hs r)cCs*t||}t|d|t|||dS)z Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. unpatchedN)r1vars setdefaultr2)Z replacementZ target_mod func_nameoriginalrrr patch_funcos r9cCs t|dS)Nr4)r1) candidaterrr rsrcstdtdkrdSfdd}t|d}t|d}zt|dt|d Wntk rlYnXzt|d Wntk rYnXzt|d Wntk rYnXdS) z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcZWindowsNcsLd|kr dnd}||d}t|}t|}t||sBt||||fS)zT Prepare the parameters for patch_func to patch indicated function. msvc9Zmsvc9_Zmsvc14__)lstripr1rhasattr ImportError)Zmod_namer7Z repl_prefixZ repl_namereplmodZmsvcrr patch_paramss  z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ _get_vc_envZgen_lib_options)rrsystem functoolspartialr9r?)rCr;Zmsvc14rrBr r.s&    r.)__doc__r&Zdistutils.filelistrrrrE importlibrrZsetuptools.externrr__all__r rrr0r)r9rr.rrrr s$   'PK!վ+__pycache__/site-patch.cpython-38.opt-1.pycnu[U Qab@sddZedkre[dS)c Cs ddl}ddl}|jd}|dks2|jdkr8|s8g}n ||j}t|di}|jt |d}|j t }|D]}||ksr|sqr||}|dk r| d}|dk r| dq.qrz ddl} | d|g\} } } Wntk rYqrYnX| dkrqrz| d| | | W5| Xq.qrtdtdd|jD} t|d d}d|_|D]}t|qX|j|7_t|d\}}d}g}|jD]b}t|\}}||kr|dkrt |}|| ks|dkr||n||||d 7}q||jdd<dS) N PYTHONPATHZwin32path_importer_cachesitez$Couldn't find the real 'site' modulecSsg|]}t|ddfqS))makepath).0itemr 9/usr/lib/python3.8/site-packages/setuptools/site-patch.py )sz__boot.. __egginsertr)sysosenvirongetplatformsplitpathsepgetattrpathlendirname__file__ find_module load_moduleimp ImportErrorclosedictr addsitedirrappendinsert)r rrZpicZstdpathZmydirrZimporterloaderrstreamrZdescr known_pathsZoldposdZndZ insert_atnew_pathpZnpr r r __boots`                 r(rN)r(__name__r r r r sGPK!A88'__pycache__/launch.cpython-38.opt-1.pycnu[U Qab@s.dZddlZddlZddZedkr*edS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. NcCsrttjd}t|ddd}tjddtjdd<ttdt}||}|dd}t ||d}t ||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizerreadreplacecompiler)Z script_name namespaceZopen_ZscriptZ norm_scriptcoder5/usr/lib/python3.8/site-packages/setuptools/launch.pyrun s     rr)rrr rrrrrrs PK!ئ0__pycache__/windows_support.cpython-38.opt-1.pycnu[U Qab@s(ddlZddlZddZeddZdS)NcCstdkrddS|S)NZWindowsc_sdS)N)argskwargsrr>/usr/lib/python3.8/site-packages/setuptools/windows_support.pyzwindows_only..)platformsystem)funcrrr windows_onlys r cCsLtdtjjj}tjjtjjf|_tjj |_ d}|||}|sHt dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. zctypes.wintypesN) __import__ctypesZwindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDZargtypesZBOOLZrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr hide_file s    r)rrr rrrrrsPK!ϚϚ__pycache__/msvc.cpython-38.pycnu[U Qab@sXdZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl Z ddl Z ddlZddlZddlmZddlmZdd lmZe d krdd lmZdd lmZnGd ddZeZeejjfZzddlm Z Wnek rYnXddZ!d$ddZ"ddZ#ddZ$d%ddZ%GdddZ&GdddZ'Gd d!d!Z(Gd"d#d#Z)dS)&a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname) LegacyVersion) filterfalse) get_unpatchedWindows)winreg)environc@seZdZdZdZdZdZdS)rN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr3/usr/lib/python3.8/site-packages/setuptools/msvc.pyr*sr)Regc Csd}|d|f}zt|d}WnJtk rjz|d|f}t|d}Wntk rdd}YnXYnX|rt|d}t|r|Stt|S)a Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython / Microsoft Visual C++ Compiler for Python 2.7). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ str vcvarsall.bat path z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f installdirz Wow6432Node\Nz vcvarsall.bat)rZ get_valueKeyErrorrrr msvc9_find_vcvarsall)versionZvc_basekey productdir vcvarsallrrrrAs   rx86c Osztt}|||f||WStjjk r4Yntk rFYnXzt||WStjjk r}zt|||W5d}~XYnXdS)ao Patched "distutils.msvc9compiler.query_vcvarsall" for support extra Microsoft Visual C++ 9.0 and 10.0 compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ dict environment N) r msvc9_query_vcvarsall distutilserrorsDistutilsPlatformError ValueErrorEnvironmentInfo return_env_augment_exception)verarchargskwargsZorigexcrrrr#ks r#c Csrztt|WStjjk r&YnXzt|ddWStjjk rl}zt|dW5d}~XYnXdS)a* Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment ,@) vc_min_verN)r msvc14_get_vc_envr$r%r&r(r)r*)Z plat_specr/rrrr2s r2cOsBdtjkr4ddl}t|jtdkr4|jjj||Stt ||S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesZnumpyr __version__r$Z ccompilerZgen_lib_optionsr msvc14_gen_lib_options)r-r.Znprrrr6s  r6rcCs|jd}d|ks"d|krd}|jft}d}|dkrf|ddkr\|d 7}q|d 7}n.|d kr|d 7}||d 7}n|dkr|d7}|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rr!zvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%d"@Zia64z( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW r0z[ Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/N)r-lowerformatlocalsfind)r/rr,messageZtmplZ msdownloadrrrr*s   r*c@sbeZdZdZeddZddZe ddZ dd Z d d Z dd dZ dddZdddZdS) PlatformInfoz Current and Target Architectures information. Parameters ---------- arch: str Target architecture. Zprocessor_architecturercCs|dd|_dS)Nx64amd64)r:replacer,)selfr,rrr__init__szPlatformInfo.__init__cCs|j|jdddS)zs Return Target CPU architecture. Return ------ str Target CPU _r N)r,r=rCrrr target_cpus zPlatformInfo.target_cpucCs |jdkS)z Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r"rGrFrrr target_is_x86s zPlatformInfo.target_is_x86cCs |jdkS)z Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r" current_cpurFrrrcurrent_is_x86s zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ str subfolder: ' arget', or '' (see hidex86 parameter) r"rrA\x64\%srJrChidex86r@rrr current_dirszPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) r"rrArMrNrHrOrrr target_dir(szPlatformInfo.target_dircCs0|rdn|j}|j|krdS|dd|S)ap Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. r"r\z\%s_)rKrGrRrB)rCforcex86Zcurrentrrr cross_dir>szPlatformInfo.cross_dirN)FF)FF)F)rrr__doc__rgetr:rKrDpropertyrGrIrLrQrRrUrrrrr?s    r?c@seZdZdZejejejejfZ ddZ e ddZ e ddZ e dd Ze d d Ze d d Ze ddZe ddZe ddZe ddZdddZddZdS) RegistryInfoz Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dSN)pi)rCZ platform_inforrrrDcszRegistryInfo.__init__cCsdS)z Microsoft Visual Studio root registry key. Return ------ str Registry key Z VisualStudiorrFrrr visualstudiofs zRegistryInfo.visualstudiocCs t|jdS)z Microsoft Visual Studio SxS registry key. Return ------ str Registry key ZSxS)rr\rFrrrsxsrs zRegistryInfo.sxscCs t|jdS)z| Microsoft Visual C++ VC7 registry key. Return ------ str Registry key ZVC7rr]rFrrrvc~s zRegistryInfo.vccCs t|jdS)z Microsoft Visual Studio VS7 registry key. Return ------ str Registry key ZVS7r^rFrrrvss zRegistryInfo.vscCsdS)z Microsoft Visual C++ for Python registry key. Return ------ str Registry key zDevDiv\VCForPythonrrFrrr vc_for_pythons zRegistryInfo.vc_for_pythoncCsdS)zq Microsoft SDK registry key. Return ------ str Registry key zMicrosoft SDKsrrFrrr microsoft_sdks zRegistryInfo.microsoft_sdkcCs t|jdS)z Microsoft Windows/Platform SDK registry key. Return ------ str Registry key r rrbrFrrr windows_sdks zRegistryInfo.windows_sdkcCs t|jdS)z Microsoft .NET Framework SDK registry key. Return ------ str Registry key ZNETFXSDKrcrFrrr netfx_sdks zRegistryInfo.netfx_sdkcCsdS)z Microsoft Windows Kits Roots registry key. Return ------ str Registry key zWindows Kits\Installed RootsrrFrrrwindows_kits_rootss zRegistryInfo.windows_kits_rootsFcCs$|js|rdnd}td|d|S)a Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key rZ Wow6432NodeZSoftwareZ Microsoft)r[rLr)rCrr"Znode64rrr microsoftszRegistryInfo.microsoftc Cstj}tj}|j}|jD]}z||||d|}Wn`ttfk r|jsz||||dd|}Wqttfk rYYqYqXnYqYnXzt ||dWSttfk rYqXqdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value rTN) rKEY_READOpenKeyrgHKEYSOSErrorIOErrorr[rLZ QueryValueEx)rCrnameZkey_readZopenkeymshkeybkeyrrrlookups"   zRegistryInfo.lookupN)F)rrrrVrrrrrrjrDrXr\r]r_r`rarbrdrerfrgrqrrrrrYUs6         rYc@s<eZdZdZeddZeddZedeZd7ddZ d d Z d d Z d dZ e ddZeddZeddZddZddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Z d3d4Z!e d8d5d6Z"dS)9 SystemInfoz Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirr ProgramFileszProgramFiles(x86)NcCs2||_|jj|_||_|p$||_|_dSrZ)rir[find_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)rCZ registry_inforzrrrrDs    zSystemInfo.__init__cCs>|}|s|jstjdt|}||jt|dS)zm Find the latest VC version Return ------ float version z%No Microsoft Visual C++ version foundr8)find_reg_vs_versrwr$r%r&setupdatesorted)rCZ reg_vc_versZvc_versrrrrx%s   z(SystemInfo._find_latest_available_vs_verc Cs$|jj}|jj|jj|jjf}g}|jjD]}|D]}zt|||dtj}Wnt t fk rlYq2YnXt |\}}} t |D]D} z*t t|| d} | |kr|| Wqtk rYqXqt |D]B} z&t t|| } | |kr|| Wqtk rYqXqq2q*t|S)z Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions r)rurgr_rar`rjrrirhrkrlZ QueryInfoKeyrangefloatZ EnumValueappendr'ZEnumKeyr~) rCrnZvckeysZvs_versrorrpZsubkeysvaluesrEir+rrrr{8s2      zSystemInfo.find_reg_vs_versc Csi}d}z t|}Wnttfk r0|YSX|D]}z\t||d}t|ddd}t|}W5QRX|d}tt|d||||d<Wq6tttfk rYq6Yq6Xq6|S) z Find Visual studio 2017+ versions from information in "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances". Return ------ dict float version as key, path as value. z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz state.jsonZrtzutf-8)encodingZinstallationPath VC\Tools\MSVCZinstallationVersion) rrkrlrrjsonload_as_float_versionr) rCZ vs_versionsZ instances_dirZ hashed_namesrmZ state_pathZ state_filestateZvs_pathrrrrv[s*     z#SystemInfo.find_programdata_vs_verscCstd|dddS)z Return a string version as a simplified float version (major.minor) Parameters ---------- version: str Version. Return ------ float version .N)rrsplit)rrrrrszSystemInfo._as_float_versioncCs.t|jd|j}|j|jjd|jp,|S)zp Microsoft Visual Studio directory. Return ------ str path zMicrosoft Visual Studio %0.1f%0.1f)rProgramFilesx86ryrurqr`)rCdefaultrrr VSInstallDirs zSystemInfo.VSInstallDircCs,|p|}t|s(d}tj||S)zm Microsoft Visual C++ directory. Return ------ str path z(Microsoft Visual C++ directory not found) _guess_vc_guess_vc_legacyrr$r%r&)rCpathmsgrrr VCInstallDirs  zSystemInfo.VCInstallDirc Cs|jdkrdSz|j|j}Wntk r8|j}YnXt|d}z$t|d}|||_t||WStt t fk rYdSXdS)zl Locate Visual C++ for VS2017+. Return ------ str path r0rrr8N) ryrwrrrrrrzrkrl IndexError)rCZvs_dirZguess_vcrzrrrrs      zSystemInfo._guess_vccCsbt|jd|j}t|jjd|j}|j|d}|rBt|dn|}|j|jjd|jp`|S)z{ Locate Visual C++ for versions prior to 2017. Return ------ str path z Microsoft Visual Studio %0.1f\VCrrZVC)rrryrurarqr_)rCrZreg_pathZ python_vcZ default_vcrrrrs zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd krFd Sd S) z Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions r7)z7.0z6.1z6.0ar9)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar0)z10.0rNryrFrrrWindowsSdkVersions     zSystemInfo.WindowsSdkVersioncCs|t|jdS)zt Microsoft Windows SDK last version. Return ------ str version lib)_use_last_dir_namer WindowsSdkDirrFrrrWindowsSdkLastVersions z SystemInfo.WindowsSdkLastVersioncCs d}|jD],}t|jjd|}|j|d}|r q8q |rDt|stt|jjd|j}|j|d}|rtt|d}|rt|s|jD]6}|d|d}d |}t|j |}t|r|}q|rt|s|jD]$}d |}t|j |}t|r|}q|st|j d }|S) zn Microsoft Windows SDK directory. Return ------ str path rzv%sinstallationfolderrrZWinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZ PlatformSDK) rrrurdrqrrarzrfindrtr)rCsdkdirr+locrZ install_baseZintverdrrrr s6           zSystemInfo.WindowsSdkDirc Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d ||d d f}g}|jd kr~|jD]}|t|jj||g7}qb|jD]}|t|jj d ||g7}q|D]}|j |d}|r|SqdS)zy Microsoft Windows SDK executable directory. Return ------ str path r#r(rTF)r@rPzWinSDK-NetFx%dTools%srS-r0zv%sArN) ryr[rQrBNetFxSdkVersionrrurerrdrq) rCZnetfxverr,rPZfxZregpathsr+rZexecpathrrrWindowsSDKExecutablePath7s"    z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j}|j|dp$dS)zl Microsoft Visual F# directory. Return ------ str path z%0.1f\Setup\F#r r)rrur\ryrq)rCrrrrFSharpInstallDirZs zSystemInfo.FSharpInstallDircCsF|jdkrdnd}|D]*}|j|jjd|}|r|p:dSqdS)zt Microsoft Universal CRT SDK directory. Return ------ str path r0)Z10Z81rz kitsroot%srN)ryrurqrf)rCZversr+rrrrUniversalCRTSdkDirgs  zSystemInfo.UniversalCRTSdkDircCs|t|jdS)z Microsoft Universal C Runtime SDK last version. Return ------ str version r)rrrrFrrrUniversalCRTSdkLastVersion{s z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z Microsoft .NET Framework SDK versions. Return ------ tuple of str versions r0) z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rrrFrrrrszSystemInfo.NetFxSdkVersioncCs8d}|jD](}t|jj|}|j|d}|r q4q |S)zu Microsoft .NET Framework SDK directory. Return ------ str path rZkitsinstallationfolder)rrrurerq)rCrr+rrrr NetFxSdkDirs  zSystemInfo.NetFxSdkDircCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 32bit directory. Return ------ str path zMicrosoft.NET\FrameworkZframeworkdir32rrsrurqr_rCZguess_fwrrrFrameworkDir32s zSystemInfo.FrameworkDir32cCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 64bit directory. Return ------ str path zMicrosoft.NET\Framework64Zframeworkdir64rrrrrFrameworkDir64s zSystemInfo.FrameworkDir64cCs |dS)z Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions _find_dot_net_versionsrFrrrFrameworkVersion32s zSystemInfo.FrameworkVersion32cCs |dS)z Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions @rrFrrrFrameworkVersion64s zSystemInfo.FrameworkVersion64cCs|j|jjd|}t|d|}|p6||dp6d}|jdkrJ|dfS|jdkrt|dd d krld n|d fS|jd krdS|jdkrdSdS)z Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions zframeworkver%dzFrameworkDir%dvrrzv4.0r9NrZv4z v4.0.30319v3.5r7)r v2.0.50727g @)zv3.0r)rurqr_getattrrryr:)rCbitsZreg_verZ dot_net_dirr+rrrrs     z!SystemInfo._find_dot_net_versionscs*fddttD}t|dp(dS)a) Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name c3s*|]"}tt|r|r|VqdSrZ)rr startswith).0Zdir_namerprefixrr s z0SystemInfo._use_last_dir_name..Nr)reversedrnext)rrZ matching_dirsrrrrs  zSystemInfo._use_last_dir_name)N)r)#rrrrVrrWrsrtrrDrxr{rv staticmethodrrXrrrrrrrrrrrrrrrrrrrrrrrrr sZ    #*      * "         rrc@sbeZdZdZd?ddZeddZedd Zed d Zed d Z eddZ eddZ eddZ eddZ eddZeddZeddZddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zed6d7Zd@d9d:Zd;d<Z e!dAd=d>Z"dS)Br(aY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. NrcCsBt||_t|j|_t|j||_|j|kr>d}tj |dS)Nz.No suitable Microsoft Visual C++ version found) r?r[rYrurrsirzr$r%r&)rCr,rzr1errrrrrD0s    zEnvironmentInfo.__init__cCs|jjS)zk Microsoft Visual Studio. Return ------ float version )rryrFrrrry9s zEnvironmentInfo.vs_vercCs|jjS)zp Microsoft Visual C++ version. Return ------ float version )rrzrFrrrrzEs zEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd d |DS) zu Microsoft Visual Studio Tools. Return ------ list of str paths z Common7\IDEz Common7\Toolsr0TrPr@z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjj|qSrrrrrrrFrr csz+EnvironmentInfo.VSTools..)ryr[rQ)rCpaths arch_subdirrrFrVSToolsQs    zEnvironmentInfo.VSToolscCst|jjdt|jjdgS)z Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths ZIncludezATLMFC\IncluderrrrFrrr VCIncludeses  zEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd d |DS) z Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths .@Tr@rPLib%sz ATLMFC\Lib%sr0z Lib\store%scsg|]}tjj|qSrrrrFrrrsz/EnvironmentInfo.VCLibraries..)ryr[rR)rCrrrrFr VCLibrariesrs  zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjdgS)z Microsoft Visual C++ store references Libraries. Return ------ list of str paths r0zLib\store\references)ryrrrrFrrr VCStoreRefss zEnvironmentInfo.VCStoreRefscCs|j}t|jdg}|jdkr"dnd}|j|}|rL|t|jd|g7}|jdkr|d|jjdd}|t|j|g7}n|jdkr|jrd nd }|t|j||jjdd g7}|jj |jj kr|t|j||jjdd g7}n|t|jd g7}|S) zr Microsoft Visual C++ Tools. Return ------ list of str paths Z VCPackagesr9TFBin%sr0rrz bin\HostX86%sz bin\HostX64%srBin) rrrryr[rUrQrLrRrKrG)rCrtoolsrTrrZhost_dirrrrVCToolss0     zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd}t|jjd|gS|jjdd}t|jjd}|j}t|d||fgSdS) zw Microsoft Windows SDK Libraries. Return ------ list of str paths r9Trrrrz%sum%sN)ryr[rRrrr _sdk_subdir)rCrrZlibverrrr OSLibrariess zEnvironmentInfo.OSLibrariescCsht|jjd}|jdkr&|t|dgS|jdkr8|j}nd}t|d|t|d|t|d|gSd S) zu Microsoft Windows SDK Include. Return ------ list of str paths includer9Zglr0rz%ssharedz%sumz%swinrtN)rrrryr)rCrsdkverrrr OSIncludess      zEnvironmentInfo.OSIncludescCst|jjd}g}|jdkr&||j7}|jdkr@|t|dg7}|jdkr||t|jjdt|ddt|d dt|d dt|jjd d d |jdddg7}|S)z} Microsoft Windows SDK Libraries Paths. Return ------ list of str paths Z Referencesr7rzCommonConfiguration\Neutralr0Z UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ ExtensionSDKszMicrosoft.VCLibsrZCommonConfigurationZneutral)rrrryr)rCreflibpathrrr OSLibpaths.          zEnvironmentInfo.OSLibpathcCs t|S)zs Microsoft Windows SDK Tools. Return ------ list of str paths )list _sdk_toolsrFrrrSdkToolss zEnvironmentInfo.SdkToolsccs|jdkr,|jdkrdnd}t|jj|V|js\|jjdd}d|}t|jj|V|jdkr|jrvd }n|jjddd }d |}t|jj|VnB|jdkrt|jjd}|jjdd}|jj}t|d ||fV|jj r|jj Vd S)z Microsoft Windows SDK Tools paths generator. Return ------ generator of str paths rrrzBin\x86Trr)r9rrrzBin\NETFX 4.0 Tools%sz%s%sN) ryrrrr[rLrQrIrr)rCZbin_dirrrrrrrrs(     zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu Microsoft Windows SDK version subdir. Return ------ str subdir %s\r)rrrCucrtverrrrr6s zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjdgS)zs Microsoft Windows SDK Setup. Return ------ list of str paths r7ZSetup)ryrrrrFrrrSdkSetupCs zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}| o,| }n$|p>|}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)zv Microsoft .NET Framework Tools. Return ------ list of str paths r9TrAcsg|]}tj|qSr)rrrr+rrrrhsz+EnvironmentInfo.FxTools..csg|]}tj|qSr)rrrrrrrks) r[rryrIrLrKrGrr)rCr[Z include32Z include64rrrrFxToolsRs"    zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd}t|jjd|gS)z~ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths r0Trzlib\um%s)ryrrr[rRr)rCrrrrNetFxSDKLibrariesos z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjdgS)z} Microsoft .Net Framework SDK Includes. Return ------ list of str paths r0z include\um)ryrrrrFrrrNetFxSDKIncludess z EnvironmentInfo.NetFxSDKIncludescCst|jjdgS)z Microsoft Visual Studio Team System Database. Return ------ list of str paths z VSTSDB\DeployrrFrrrVsTDbs zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd}n |jj}d}d|j|f}t||g}|jdkrr|t||dg7}|S)zn Microsoft Build Engine. Return ------ list of str paths rrTrrzMSBuild\%0.1f\bin%sZRoslyn)ryrrr[rQrr)rC base_pathrrZbuildrrrMSBuilds    zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjdgS)zt Microsoft HTML Help Workshop. Return ------ list of str paths rzHTML Help Workshop)ryrrrrFrrrHTMLHelpWorkshops z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjd}|j}t|d||fgS)z Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths r0Trrz%sucrt%s)ryr[rRrrr _ucrt_subdir)rCrrrrrr UCRTLibrariess zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd}t|d|jgS)z Microsoft Universal C Runtime SDK Include. Return ------ list of str paths r0rz%sucrt)ryrrrr)rCrrrr UCRTIncludess zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z Microsoft Universal C Runtime SDK version subdir. Return ------ str subdir rr)rrrrrrrs zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk Microsoft Visual F#. Return ------ list of str paths rr)ryrrrFrrrFSharps zEnvironmentInfo.FSharpc Csd|j}|jjddd}g}|jj}t|dd}t|rft |t |d}||t |dg7}|t |d g7}d |jd d t |j d f}t ||D]&\}}t ||||} t| r| Sqd S) z Microsoft Visual C++ runtime redistributable dll. Return ------ str path zvcruntime%d0.dllTrrSz\Toolsz\Redistr8ZonecoreZredistzMicrosoft.VC%d.CRT N)rzr[rRstriprrrrBrrrintry itertoolsproductr) rCZ vcruntimerprefixesZ tools_pathZ redist_pathZcrt_dirsrZcrt_dirrrrrVCRuntimeRedists  zEnvironmentInfo.VCRuntimeRedistTcCst|d|j|j|j|jg||d|j|j|j|j |j g||d|j|j|j |j g||d|j |j|j|j|j|j|j|j|jg |d}|jdkrt|jr|j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment rrrr)rrrrZpy_vcruntime_redist)dict _build_pathsrrrrrrrrrrrrrrrrrrrryrr)rCexistsenvrrrr)&sV   zEnvironmentInfo.return_envc Csptj|}t|dt}t||}|r A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N)r|addr __contains__)iterablerseenZseen_addZelementkrrrrzs  z EnvironmentInfo._unique_everseen)Nr)T)N)#rrrrVrDrXryrzrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrrr(sn        $    #             " 2"r()r")r)*rVriorosrrZos.pathrrrrr3platformrZdistutils.errorsr$Z#setuptools.extern.packaging.versionr Zsetuptools.extern.six.movesr Zmonkeyr systemrrr ImportErrorr%r&Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr#r2r6r*r?rYrrr(rrrrsJ       * &  $s5PK!!+__pycache__/py31compat.cpython-38.opt-1.pycnu[U QabF@sPgZeZzddlmZWn2ek rJddlZddlZGdddZYnXdS))TemporaryDirectoryNc@s(eZdZdZddZddZddZdS) rz Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cKsd|_tjf||_dSN)nametempfileZmkdtemp)selfkwargsr9/usr/lib/python3.8/site-packages/setuptools/py31compat.py__init__szTemporaryDirectory.__init__cCs|jSr)r)rrrr __enter__szTemporaryDirectory.__enter__cCs2zt|jdWntk r&YnXd|_dS)NT)shutilZrmtreerOSError)rexctypeZexcvalueZexctracerrr __exit__s zTemporaryDirectory.__exit__N)__name__ __module__ __qualname____doc__r r rrrrr r sr)__all__typeZ __metaclass__rr ImportErrorr rrrr sPK!A.__pycache__/unicode_utils.cpython-38.opt-1.pycnu[U Qab@s8ddlZddlZddlmZddZddZddZdS) N)sixcCsVt|tjrtd|Sz$|d}td|}|d}Wntk rPYnX|S)NZNFDutf-8) isinstancer text_type unicodedataZ normalizedecodeencode UnicodeError)pathr s   PK!5) XX)__pycache__/__init__.cpython-38.opt-1.pycnu[U Qabs@sdZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZddlmZmZdd lmZmZddlZdd lmZdd lmZmZdd lmZdd lm Z e!Z"ddddddddgZ#ere#$dej%j&Z&dZ'dZ(dgZ)GdddZ*Gddde*Z+e*j,Z-er,e+j,Z.ddZ/ddZ0ej1j0je0_e 2ej1j3Z4Gd dde4Z3d!d"Z5ej6fd#d$Z7e 8dS)%z@Extensions to the 'distutils' for large or complex distributionsN)DistutilsOptionError) convert_path fnmatchcase)SetuptoolsDeprecationWarning)PY3 string_types)filtermap) Extension) DistributionFeature)Require)monkeysetupr rCommandr rr find_packagesfind_namespace_packagesTz lib2to3.fixesc@sBeZdZdZedddZeddZed d Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs&t|t||jd||j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. ez_setup *__pycache__)rr)list_find_packages_iterr _build_filter)clswhereexcludeincluderr7/usr/lib/python3.8/site-packages/setuptools/__init__.pyfind4s  zPackageFinder.findc cstj|ddD]\}}}|dd}g|dd<|D]d}tj||} tj| |} | tjjd} d|ks4|| sxq4|| r|| s| V||q4qdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rr r!r"rootdirsfilesZall_dirsdir full_pathZrel_pathpackagerrr#rKs  z!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z __init__.py)r'r)isfiler*r)rrr#r.gsz!PackageFinder._looks_like_packagecs fddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s|]}t|dVqdS))patNr).0r8namerr# rsz@PackageFinder._build_filter....)anyr:Zpatternsr:r#rz-PackageFinder._build_filter..rr>rr>r#rlszPackageFinder._build_filterN)rrr) __name__ __module__ __qualname____doc__ classmethodr$r staticmethodr.rrrrr#r/s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTrr7rrr#r.vsz'PEP420PackageFinder._looks_like_packageN)rArBrCrFr.rrrr#rGusrGcCs@tjtdd|D}|jdd|jr<||jdS)Ncss"|]\}}|dkr||fVqdS))Zdependency_linkssetup_requiresNr)r9kvrrr#r<sz*_install_setup_requires..T)Zignore_option_errors) distutilscorer dictitemsZparse_config_filesrHZfetch_build_eggs)attrsdistrrr#_install_setup_requiress   rQcKst|tjjf|SN)rQrKrLr)rOrrr#rsc@s:eZdZejZdZddZd ddZddZd d d Z dS)rFcKst||t||dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfrPkwrrr#rTs zCommand.__init__NcCsBt||}|dkr"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr isinstancer r)rWoptionZwhatdefaultvalrrr#_ensure_stringlikes   zCommand._ensure_stringlikecCspt||}|dkrdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+css|]}t|tVqdSrR)r[r )r9rJrrr#r<sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r)) rYr[r rZresplitrallr)rWr\r^okrrr#ensure_string_lists   zCommand.ensure_string_listrcKs t|||}t|||SrR)rSreinitialize_commandrUrV)rWZcommandZreinit_subcommandsrXcmdrrr#reszCommand.reinitialize_command)N)r) rArBrCrSrDZcommand_consumes_argumentsrTr_rdrerrrr#rs  cCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tj||VqqdSrR)r'r)r*)r9baser1r2filerrr#r<sz#_find_all_simple..Tr%)r'r(r r)r6)r)resultsrrr#_find_all_simples rjcCs6t|}|tjkr.tjtjj|d}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rjr'curdir functoolspartialr)r+r r)r3r2Zmake_relrrr#findalls   ro)9rDr'sysrmZdistutils.corerKZdistutils.filelistr`Zdistutils.errorsrZdistutils.utilrZfnmatchrZ_deprecation_warningrZsetuptools.extern.sixrr Zsetuptools.extern.six.movesr r Zsetuptools.versionZ setuptoolsZsetuptools.extensionr Zsetuptools.distr rZsetuptools.dependsrrtypeZ __metaclass____all__r/version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesrrGr$rrrQrrLZ get_unpatchedrrSrjrlroZ patch_allrrrr#s\        F  2  PK!KӤӤ__pycache__/dist.cpython-38.pycnu[U Qab@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl m Z ddlmZddlmZddlZddlmZddlmZddlmZmZmZdd l mZdd lmZdd lmZdd lm Z dd lm!Z!ddl"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0Z0e1de1dddZ2ddZ3ddZ4ddZ5e6e7fZ8dd Z9d!d"Z:d#d$Z;d%d&Zd+d,Z?d-d.Z@d/d0ZAd1d2ZBd3d4ZCd5d6ZDe-ejEjFZGGd7ddeGZFGd8d9d9ZHGd:d;d;e'ZIdS)< DistributionN) strtobool)DEBUGtranslate_longopt) defaultdict)message_from_file)DistutilsOptionErrorDistutilsPlatformErrorDistutilsSetupError) rfc822_escape) StrictVersion)six) packaging) ordered_set)mapfilter filterfalse)SetuptoolsDeprecationWarning)Require)windows_support) get_unpatched)parse_configurationz&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr3/usr/lib/python3.8/site-packages/setuptools/dist.py_get_unpatched-s r cCst|dd}|dkr|js |jr*td}nd|jdk sT|jdk sTt|dddk sT|jr^td}n0|js||js||j s||j s||j rtd}ntd}||_ |S)Nmetadata_versionz2.1python_requires1.21.1z1.0) getattrlong_description_content_typeprovides_extrasr maintainermaintainer_email project_urlsprovidesrequires obsoletes classifiers download_urlr!)selfZmvrrrget_metadata_version2s*      r1cs t|fdd}fdd}td|_|d|_|d|_|d|_|d |_d |_|d |_d |_ |d |_ |d |_ dkr|d|_ nd |_ |d|_ |d|_dkr|dd|_|d|_|d|_|jtdkr |d|_|d|_|d|_nd |_d |_d |_d S)z-Reads the metadata values from a file object.cs|}|dkrdS|S)NZUNKNOWNr)namevaluemsgrr _read_fieldLsz"read_pkg_file.._read_fieldcs|d}|gkrdS|SN)Zget_all)r2valuesr4rr _read_listRs z!read_pkg_file.._read_listzmetadata-versionr2versionZsummaryauthorNz author-emailz home-pagelicensez download-url descriptionkeywords,platformZ classifierr$r,r+r-)rr r!r2r:r=r;r( author_emailr)Zurlr<r/Zlong_descriptionsplitr>Z platformsr.r,r+r-)r0filer6r9rr4r read_pkg_fileHs:                 rDc s}tjrfdd}n fdd}|dt||d|d|d|d|td kr|d  |d  n.d }|D]$\}}t |}|d k r|||q|d j r|dj jD]}|dd|qt} |d| d} | r:|d| |td krdD]} |d| qPndddddtdr|djjr|djjr jD]} |d| qd S)z5Write the PKG-INFO format data to a file object. csd||fdSNz%s: %s )writeZ _encode_fieldkeyr3rCr0rr write_fieldsz#write_pkg_file..write_fieldcsd||fdSrE)rFrG)rCrrrJszMetadata-VersionNameVersionZSummaryz Home-pager#Author Author-email))rMr;)rNrA)Z Maintainerr()zMaintainer-emailr)NZLicensez Download-URLz Project-URLz%s, %sZ Descriptionr?ZKeywordsZPlatformZ ClassifierZRequiresZProvidesZ Obsoletesr"zRequires-PythonzDescription-Content-TypezProvides-Extra)r1rPY2strZget_nameZ get_versionZget_descriptionZget_urlr Z get_contactZget_contact_emailr%Z get_licenser/r*itemsr Zget_long_descriptionjoinZ get_keywordsZ get_platformsZ _write_listZget_classifiersZ get_requiresZ get_providesZ get_obsoleteshasattrr"r&r') r0rCr:rJZoptional_fieldsZfieldattrZattr_valZ project_urlZ long_descr>r@extrarrIrwrite_pkg_file~sZ             rVc CsPztjd|}|jrtWn,ttttfk rJtd||fYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r)) pkg_resources EntryPointparseextrasAssertionError TypeError ValueErrorAttributeErrorr )distrTr3eprrrcheck_importablesrac CsZz(t|ttfstd||ks&tWn,ttttfk rTtd||fYnXdS)z"Verify that value is a string listz%%r must be a list of strings (got %r)N) isinstancelisttupler[rRr\r]r^r r_rTr3rrrassert_string_lists rgcCsd|}t||||D]J}||s2tdd||d\}}}|r||krtjd||qdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rghas_contents_forr rpartition distutilslogr)r_rTr3Z ns_packagesZnspparentsepZchildrrr check_nsps    roc Cs@zttt|Wn"tttfk r:tdYnXdS)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N) rd itertoolsstarmap _check_extrarQr\r]r^r rfrrr check_extrass rscCs<|d\}}}|r*t|r*td|tt|dS)N:zInvalid environment marker: ) partitionrWZinvalid_markerr rdparse_requirements)rUZreqsr2rnmarkerrrrrrs rrcCs&t||kr"d}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rTr3N)boolr format)r_rTr3tmplrrr assert_bool s r{c Csjz(tt|t|ttfr&tdWn<ttfk rd}zd}t|j ||dW5d}~XYnXdS)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rTerrorN) rdrWrvrcdictsetr\r]r ryr_rTr3r}rzrrrcheck_requirementss rc CsRztj|Wn<tjjk rL}zd}t|j||dW5d}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}r|N)rZ specifiersZ SpecifierSetZInvalidSpecifierr ryrrrrcheck_specifier s rc Cs@ztj|Wn*tk r:}z t|W5d}~XYnXdS)z)Verify that entry_points map is parseableN)rWrXZ parse_mapr]r )r_rTr3errrcheck_entry_points,srcCst|tjstddS)Nztest_suite must be a string)rcr string_typesr rfrrrcheck_test_suite4s rcCs\t|tstd||D]6\}}t|tjsDtd||t|d||q dS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rcr~r ryrQrrrg)r_rTr3kvrrrcheck_package_data9s  rcCs(|D]}td|stjd|qdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrkrlr)r_rTr3Zpkgnamerrrcheck_packagesHs  rc@sReZdZdZdeejdZdZddZ dMddZ dd Z d d Z e d d ZddZddZdNddZe ddZdOddZdPddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z d3d4Z!d5d6Z"d7d8Z#d9d:Z$d;d<Z%d=d>Z&d?d@Z'dAdBZ(dCdDZ)dEdFZ*dGdHZ+dIdJZ,dKdLZ-dS)QraDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. N)r&r*r'cCsl|rd|ksd|krdStt|d}tjj|}|dk rh|dshtt|d|_ ||_ dS)Nr2r:zPKG-INFO) rWZ safe_namerPlower working_setZby_keygetZ has_metadataZ safe_versionZ_version _patched_dist)r0attrsrHr_rrrpatch_missing_pkg_infosz#Distribution.patch_missing_pkg_infoc std}|si_|pi}d|ks,d|kr4tg_i_g_|dd_ ||dg_ |dg_ t dD]}t|jdqtfdd |DjD]L\}}jj|fD]}||kr||}qq|r|nd}tj||qtjjtjr4tjjj_jjdk rzHtjjj}t|} jj| krt d jj| f| j_Wn0tjj!t"fk rt d jjYnX#dS) N package_datafeaturesrequire_featuressrc_rootdependency_linkssetup_requiresdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA.0rrr0rr s z)Distribution.__init__..zNormalizing '%s' to '%s'zThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)$rSrFeaturewarn_deprecatedrrZ dist_filespoprrrrrWiter_entry_pointsvars setdefaultr2 _Distribution__init__rQrmetadata__dict__setattrrcr:numbersNumberrPrrLrrZInvalidVersionr\_finalize_requires) r0rZhave_package_datar`optiondefaultsourcer3ZverZnormalized_versionrrrrs\    zDistribution.__init__cCsft|ddr|j|j_t|ddrR|jD]$}|dd}|r,|jj|q,|| dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. r"Nextras_requirertr) r%r"rrkeysrBr'add_convert_extras_requirements"_move_install_requirements_markers)r0rUrrrrs   zDistribution._finalize_requirescCsht|ddpi}tt|_|D]@\}}|j|t|D]"}||}|j|||q>q"dS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r%rrd_tmp_extras_requirerQrWrv _suffix_forappend)r0Z spec_ext_reqssectionrrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rtrb)rwrPreqrrrr szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_|D]}j dt|j  |qNt fddj D_dS) zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j Sr7rwrrrr is_simple_reqszFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrtc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rPrrrrr )szMDistribution._move_install_requirements_markers...N)r _clean_reqrrrr (szBDistribution._move_install_requirements_markers..)r%rdrWrvrrrrPrrrwrr~rQr)r0rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrrrrrs    z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. Nr)r0rrrrr-szDistribution._clean_reqc Csddlm}tjr>tjtjkr>ddddddd d d d d ddg }ng}t|}|dkrZ|}t rh| d|}|D]}t j |dd4}t r| dj fttjr|jn|j|W5QRX|D]\}||}||} |D]>} | dkr| |kr|||| } | dd} || f| | <qq|qrd|jkr|jdD]\} \} } |j| } zF| r|t|| t|  n(| dkrt|| t| n t|| | Wn,tk r}z t|W5d}~XYnXqHdS)z Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r) ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8)encodingz reading {filename}__name__-_global)verboseZdry_run)Z(setuptools.extern.six.moves.configparserrrPY3sysr base_prefix frozensetZfind_config_filesrannounceioopenrylocalsZ read_fileZreadfpZsectionsoptionsget_option_dict_try_strrreplacercommand_optionsrQ negative_optrrr]r )r0 filenamesrZignore_optionsparserfilenamereaderrrZopt_dictoptvalsrcaliasr5rrr_parse_config_files4s`           z Distribution._parse_config_filescCs.tjr |Sz |WStk r(YnX|S)ab On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that. Why the default encoding? Because that value can be implicitly decoded back to text if needed. Ref #1653 )rrencodeUnicodeEncodeError)rrrrrrs  zDistribution._try_strc Cs^|}|dkr||}tr,|d||D]"\}\}}trZ|d|||fzdd|jD}Wntk rg}YnXz |j}Wntk ri}YnXz~t|t j } ||kr| rt |||t | nJ||kr| rt ||t |n,t ||rt |||ntd|||fWq4tk rV} z t| W5d} ~ XYq4Xq4dS)a Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) Nz# setting options for '%s' command:z %s = %s (from %s)cSsg|] }t|qSrr)rorrrrsz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')Zget_command_namerrrrQZboolean_optionsr^rrcrrrrrSr r]) r0Z command_objZ option_dictZ command_namerrr3Z bool_optsneg_optZ is_stringr5rrr_set_command_optionssF           z!Distribution._set_command_optionsFcCs(|j|dt||j|d|dS)zYParses configuration files from various levels and loads configuration. )r)ignore_option_errorsN)rrrr)r0rrrrrparse_config_filess  zDistribution.parse_config_filescCst|}|jr||S)z3Process features after parsing command line options)rparse_command_liner_finalize_features)r0resultrrrrs zDistribution.parse_command_linecCsd|ddS)z;Convert feature name to corresponding option attribute nameZwith_rrrr0r2rrr_feature_attrnameszDistribution._feature_attrnamecCs8tjjt||jdd}|D]}tjj|ddq|S)zResolve pre-setup requirementsT) installerZreplace_conflictingr)rWrresolvervfetch_build_eggr)r0r,Zresolved_distsr_rrrfetch_build_eggsszDistribution.fetch_build_eggscCst||jr|tdD]:}t||jd}|dk r"|j|j d| ||j|q"t|ddr~dd|j D|_ ng|_ dS)Nrrconvert_2to3_doctestscSsg|]}tj|qSr)ospathabspathrprrrrsz1Distribution.finalize_options..) rfinalize_optionsr_set_global_opts_from_featuresrWrr%r2requirerloadr)r0r`r3rrrrs   zDistribution.finalize_optionsc Csvtjtjd}tj|srt|t|tj|d}t|d$}| d| d| dW5QRX|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) rrrRcurdirexistsmkdirrZ hide_filerrF)r0Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirs      zDistribution.get_egg_cache_dirc Csddlm}|ddgi}|d}||dd|dD|jr|jdd}d|krx|dd |}d |f|d<|}||d g|d d dd d d d d d }| ||S)z Fetch an egg needed for buildingr) easy_installZ script_argsr css"|]\}}|dkr||fVqdS)) find_links site_dirsZ index_urloptimizer Z allow_hostsNrrrrrrsz/Distribution.fetch_build_egg..Nr rZsetupxTF) args install_dirZexclude_scriptsZ always_copyZbuild_directoryZeditableZupgradeZ multi_versionZ no_reportr) Zsetuptools.command.easy_installr  __class__rclearupdaterQrrZensure_finalized)r0rr r_optsZlinksrcmdrrrrs8     zDistribution.fetch_build_eggc Csg}|j}|jD]\}}||d|||jr|j}d}d}|s\||}}d|dd||fd|dd||ff}| |d||d|<q||j |_ |_ ||_|_ dS)z;Add --with-X/--without-X options based on optional featuresNz (default)rbzwith-zinclude zwithout-zexclude ) rcopyrrQ _set_featurevalidateoptionalr=include_by_defaultextendglobal_optionsZfeature_optionsZfeature_negopt) r0ZgoZnor2featuredescrZincdefZexcdefnewrrrrs$     z+Distribution._set_global_opts_from_featurescCs|jD]<\}}||}|s0|dkr |r ||||dq |jD](\}}||sR||||dqRdS)z9Add/remove features and resolve dependencies between themNrr)rrQfeature_is_includedr include_inr exclude_from)r0r2rZenabledrrrr0s    zDistribution._finalize_featurescCs\||jkr|j|Std|}|D]*}|j|jd||j|<}|St||S)z(Pluggable version of get_command_class()distutils.commandsrN)cmdclassrWrrrrrget_command_class)r0commandZepsr`r#rrrr$As   zDistribution.get_command_classcCs:tdD]$}|j|jkr |}||j|j<q t|SNr")rWrr2r#rrprint_commandsr0r`r#rrrr'Ns  zDistribution.print_commandscCs:tdD]$}|j|jkr |}||j|j<q t|Sr&)rWrr2r#rrget_command_listr(rrrr)Vs  zDistribution.get_command_listcCst||||dS)zSet feature's inclusion statusN)rr)r0r2Zstatusrrrr^szDistribution._set_featurecCst|||S)zAReturn 1 if feature is included, 0 if excluded, 'None' if unknown)r%rrrrrrbsz Distribution.feature_is_includedcCsF||dkr&|j|j}t|d|j||||ddS)z)Request inclusion of feature named 'name'rz2 is required, but was excluded or is not availablerN)rrr=r r r)r0r2rrrrinclude_featurefs zDistribution.include_featurecKs@|D]2\}}t|d|d}|r.||q|||qdS)aAdd items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. Z _include_N)rQr% _include_misc)r0rrrincluderrrr,qs  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagerhcs"g|]}|kr|s|qSr startswithrpackagepfxrrrs z0Distribution.exclude_package..cs"g|]}|kr|s|qSrr-rr/rrrs cs&g|]}|jkr|js|qSr)r2r.rr/rrrs N)packages py_modules ext_modules)r0r0rr/rexclude_packages   zDistribution.exclude_packagecCs2|d}|D]}||ks&||rdSqdS)z.rcsequencer r%r^r)r0r2r3oldrr;r _exclude_miscs    zDistribution._exclude_misccst|tstd||fzt||Wn tk rHtd|YnXdkr`t|||n:ttsxt|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)r7Nr8csg|]}|kr|qSrrr9r>rrrsz.Distribution._include_misc..r<)r0r2r3rrr@rr+s$    zDistribution._include_misccKs@|D]2\}}t|d|d}|r.||q|||qdS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. Z _exclude_N)rQr%r?)r0rrrexcluderrrrAs  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rcr=r rdrr5)r0r2rrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|d}||krf||\}}||=ddl}||d|dd<|d}q&t|||}||} t | ddrd|f||d<|dk rgS|S)NraliasesTrZcommand_consumes_arguments command liner) rrrrshlexrBr_parse_command_optsr$r%) r0rrr%rCrrrEnargsZ cmd_classrrrrFs"       z Distribution._parse_command_optsc Csi}|jD]\}}|D]\}\}}|dkr4q|dd}|dkr||}|j}|t|di|D]\} } | |krv| }d}qqvtdn |dkrd}|| |i|<qq|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. rDrrrrNzShouldn't be able to get herer) rrQrZget_command_objrrrr%r[r) r0drrrrrZcmdobjrnegposrrrget_cmdline_optionss(     z Distribution.get_cmdline_optionsccsv|jpdD] }|Vq |jpdD] }|Vq |jp4dD]:}t|trN|\}}n|j}|drj|dd}|Vq6dS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)r2r3r4rcrer2endswith)r0ZpkgrLZextr2Z buildinforrrr60s    z$Distribution.iter_distribution_namesc Csddl}tjs|jr t||St|jtj s:t||S|jj dkrVt||S|jj }|jj }|j dkrtdpvd}|jj}t |jd||||_zt||WSt |j|||||_XdS)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rN)rutf8Zwin32 r)rrrOZ help_commandsrhandle_display_optionsrcstdoutr TextIOWrapperrrerrorsr@line_bufferingdetach)r0Z option_orderrrrSnewlinerTrrrrPBs6    z#Distribution.handle_display_options)N)N)N)NF).r __module__ __qualname____doc__r~rZ OrderedSetrrrrrr staticmethodrrrrrrrrrrrrrrrr$r'r)rrr*r,r5rir?r+rArBrFrKr6rPrrrrrTsXD ;  >  /     (c@sFeZdZdZeddZdddZd d Zd d Zd dZ ddZ dS)ra **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCsd}tj|tdddS)NzrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.) stacklevel)rrrr4rrrrszFeature.warn_deprecatedFTrc Ks|||_||_||_||_t|ttfr4|f}dd|D|_dd|D}|r^||d<t|trn|f}||_ ||_ |s|s|st ddS)NcSsg|]}t|tr|qSrrcrPrrrrrs z$Feature.__init__..cSsg|]}t|ts|qSrr]rrrrrs rzgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.) rr=standard availablerrcrPrrremoverZr ) r0r=r^r_rrr`rZZerrrrrs*  zFeature.__init__cCs |jo |jS)z+Should this feature be included by default?)r_r^rrrrrszFeature.include_by_defaultcCs<|jst|jd|jf|j|jD]}||q(dS)aEnsure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. z3 is required, but is not available on this platformN)r_r r=r,rZrr*)r0r_rrrrr s  zFeature.include_incCs.|jf|j|jr*|jD]}||qdS)a2Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. N)rArZr`r5r0r_r:rrrr!s  zFeature.exclude_fromcCs.|jD]"}||std|j||fqdS)aVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. zg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN)r`rir r=rarrrrs   zFeature.validateN)FTTrr) rrWrXrYrZrrrr r!rrrrrres8  rc@seZdZdZdS)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rrWrXrYrrrrrsr)J__all__rrrrrrZ distutils.logrkZdistutils.coreZ distutils.cmdZdistutils.distZdistutils.utilrZdistutils.debugrZdistutils.fancy_getoptrrp collectionsrZemailrZdistutils.errorsr r r r Zdistutils.versionr Zsetuptools.externrrrZsetuptools.extern.six.movesrrrrbrZsetuptools.dependsrZ setuptoolsrZsetuptools.monkeyrZsetuptools.configrrW __import__r r1rDrVrerdr=rargrorsrrr{rrrrrrZcorerrrrrrrrsv               6L    PK!C;bb%__pycache__/_imp.cpython-38.opt-1.pycnu[U Qab@s\dZddlZddlZddlZddlmZdZdZdZ dZ dZ dd d Z dd d Z d dZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. N)module_from_specc CsVtj||}|dkr"td||jsBt|drBtjd|j}d}d}t|jt }|j dkst|rt |jtj j rt}d}d}}n|j dks|rt |jtj jrt}d}d}}n|jr:|j }tj|d }|tj jkrd nd }|tj jkrt}n&|tj jkrt}n|tj jkr t}|tthkrFt||}n d}d}}|||||ffS) z7Just like 'imp.find_module()', but with package supportN Can't find %ssubmodule_search_locationsz __init__.pyfrozenzbuilt-inrrrb) importlibutil find_spec ImportError has_locationhasattrspec_from_loaderloader isinstancetypeorigin issubclass machineryFrozenImporter PY_FROZENBuiltinImporter C_BUILTINospathsplitextSOURCE_SUFFIXES PY_SOURCEBYTECODE_SUFFIXES PY_COMPILEDEXTENSION_SUFFIXES C_EXTENSIONopen) modulepathsspecZkindfileZstaticr!suffixmoder03/usr/lib/python3.8/site-packages/setuptools/_imp.py find_modulesJ      r2cCs*tj||}|std||j|SNr)rrrrrget_code)r*r+r,r0r0r1get_frozen_object>s r5cCs&tj||}|std|t|Sr3)rrrrr)r*r+infor,r0r0r1 get_moduleEs r7)N)N)__doc__r importlib.utilrZimportlib.machineryZ py34compatrr$r&r(rrr2r5r7r0r0r0r1s  * PK!$$"__pycache__/version.cpython-38.pycnu[U Qab@s6ddlZzedjZWnek r0dZYnXdS)NZ setuptoolsunknown)Z pkg_resourcesZget_distributionversion __version__ Exceptionrr6/usr/lib/python3.8/site-packages/setuptools/version.pysPK!{BB ! !+__pycache__/build_meta.cpython-38.opt-1.pycnu[U Qab}%@s dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZdddd d d d gZGd d d eZGdddejjZddZddZddZddZGdddeZGdddeZeZejZejZejZejZej Z eZ!dS)a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. N)TemporaryDirectory)parse_requirements)makedirsget_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheel build_wheel build_sdist __legacy__SetupRequirementsErrorc@seZdZddZdS)r cCs ||_dSN) specifiers)selfr r9/usr/lib/python3.8/site-packages/setuptools/build_meta.py__init__4szSetupRequirementsError.__init__N)__name__ __module__ __qualname__rrrrrr 3sc@s&eZdZddZeejddZdS) DistributioncCstttt|}t|dSr )listmapstrrr )rr Zspecifier_listrrrfetch_build_eggs9szDistribution.fetch_build_eggsccs*tjj}|tj_z dVW5|tj_XdS)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilsZcorer)clsZorigrrrpatch>s  zDistribution.patchN)rrrr classmethod contextlibcontextmanagerrrrrrr8srcCs*tjddkr&t|ts&|tS|S)z Convert a filename to a string (on Python 2, explicitly a byte string, not Unicode) as distutils checks for the exact type str. r)sys version_info isinstancerencodegetfilesystemencoding)srrr_to_strNsr'csfddtDS)Ncs&g|]}tjtj|r|qSr)ospathisdirjoin).0nameZa_dirrr \sz1_get_immediate_subdirectories..r(listdirr.rr.r_get_immediate_subdirectories[sr2cs"fddt|D}|\}|S)Nc3s|]}|r|VqdSr endswithr,f extensionrr as z'_file_with_extension..r0)Z directoryr8Zmatchingfilerr7r_file_with_extension`s  r;cCs&tj|stdSttdt|S)Nz%from setuptools import setup; setup()open)r(r)existsioStringIOgetattrtokenizer< setup_scriptrrr_open_setup_scriptis  rDc@s`eZdZddZddZdddZdd d Zdd d Zdd dZddZ dddZ dddZ dS)_BuildMetaBackendcCs|pi}|dg|S)N--global-option) setdefaultrconfig_settingsrrr _fix_configss z_BuildMetaBackend._fix_configc Csz||}tjdddg|dt_z t|W5QRXWn,tk rt}z||j7}W5d}~XYnX|S)NZegg_inforF)rJr!argvrr run_setupr r )rrI requirementserrr_get_build_requiresxs  z%_BuildMetaBackend._get_build_requiressetup.pyc CsD|}d}t|}|dd}W5QRXtt||dtdS)N__main__z\r\nz\nexec)rDreadreplacerScompilelocals)rrC__file__rr6coderrrrMs  z_BuildMetaBackend.run_setupNcCs||}|j|dgdS)NZwheelrNrJrPrHrrrrs z._BuildMetaBackend.get_requires_for_build_wheelcCs||}|j|gdS)NrZr[rHrrrrs z._BuildMetaBackend.get_requires_for_build_sdistcCstjddddt|gt_||}ddt|D}t|dkrxtt|dkrxtj |t|d}q*qxq*||krt tj ||d|t j |dd|dS) NrKZ dist_infoz --egg-basecSsg|]}|dr|qS)z .dist-infor3r5rrrr/s zF_BuildMetaBackend.prepare_metadata_for_build_wheel..rT) ignore_errors) r!rLr'rMr(r1lenr2r)r+shutilZmoveZrmtree)rmetadata_directoryrIZdist_info_directoryZ dist_infosrrrrs,  z2_BuildMetaBackend.prepare_metadata_for_build_wheelc Cs||}tj|}t|ddt|dv}tjdd|d|g|dt_|t ||}tj ||}tj |rt |t tj |||W5QRX|S)NT)exist_ok)dirrKz --dist-dirrF)rJr(r)abspathrrr!rLrMr;r+r=removerename)rZ setup_commandZresult_extensionZresult_directoryrIZ tmp_dist_dirZresult_basenameZ result_pathrrr_build_with_temp_dirs         z&_BuildMetaBackend._build_with_temp_dircCs|dgd||S)NZ bdist_wheelz.whlre)rZwheel_directoryrIr_rrrrs z_BuildMetaBackend.build_wheelcCs|dddgd||S)NZsdistz --formatsZgztarz.tar.gzrf)rZsdist_directoryrIrrrr s  z_BuildMetaBackend.build_sdist)rQ)N)N)N)NN)N) rrrrJrPrMrrrrerr rrrrrEqs    rEcs"eZdZdZdfdd ZZS)_BuildMetaLegacyBackendaCCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. rQc sbttj}tjtj|}|tjkr6tjd|ztt|j |dW5|tjdd<XdS)NrrB) rr!r)r(dirnamerbinsertsuperrgrM)rrCZsys_pathZ script_dir __class__rrrMs   z!_BuildMetaLegacyBackend.run_setup)rQ)rrr__doc__rM __classcell__rrrkrrgsrg)"rmr>r(r!rAr^rZ setuptoolsrZsetuptools.py31compatrZ pkg_resourcesrZpkg_resources.py31compatr__all__ BaseExceptionr Zdistrr'r2r;rDobjectrErgZ_BACKENDrrrrr r rrrrsD     hPK!C;bb__pycache__/_imp.cpython-38.pycnu[U Qab@s\dZddlZddlZddlZddlmZdZdZdZ dZ dZ dd d Z dd d Z d dZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. N)module_from_specc CsVtj||}|dkr"td||jsBt|drBtjd|j}d}d}t|jt }|j dkst|rt |jtj j rt}d}d}}n|j dks|rt |jtj jrt}d}d}}n|jr:|j }tj|d }|tj jkrd nd }|tj jkrt}n&|tj jkrt}n|tj jkr t}|tthkrFt||}n d}d}}|||||ffS) z7Just like 'imp.find_module()', but with package supportN Can't find %ssubmodule_search_locationsz __init__.pyfrozenzbuilt-inrrrb) importlibutil find_spec ImportError has_locationhasattrspec_from_loaderloader isinstancetypeorigin issubclass machineryFrozenImporter PY_FROZENBuiltinImporter C_BUILTINospathsplitextSOURCE_SUFFIXES PY_SOURCEBYTECODE_SUFFIXES PY_COMPILEDEXTENSION_SUFFIXES C_EXTENSIONopen) modulepathsspecZkindfileZstaticr!suffixmoder03/usr/lib/python3.8/site-packages/setuptools/_imp.py find_modulesJ      r2cCs*tj||}|std||j|SNr)rrrrrget_code)r*r+r,r0r0r1get_frozen_object>s r5cCs&tj||}|std|t|Sr3)rrrrr)r*r+infor,r0r0r1 get_moduleEs r7)N)N)__doc__r importlib.utilrZimportlib.machineryZ py34compatrr$r&r(rrr2r5r7r0r0r0r1s  * PK! M]]-__pycache__/archive_util.cpython-38.opt-1.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ Gd d d eZ d dZ e dfddZe fdd Ze fddZe fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__rr;/usr/lib/python3.8/site-packages/setuptools/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsc CsN|ptD]4}z||||Wntk r4YqYqXdSqtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r)filename extract_dirprogress_filterZdriversZdriverrrrrs  c Cstj|std||d|fi}t|D]\}}}||\}}|D],} || dtj|| f|tj|| <qH|D]T} tj|| } ||| | } | sqzt| tj|| } t| | t | | qzq.dS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirrwalkjoinrshutilZcopyfileZcopystat) rrrpathsbasedirsfilesrrdftargetrrrr ?s$   * c Cst|std|ft|}|D]}|j}|ds,d|dkrPq,tj j |f|d}|||}|sxq,| drt |n4t || |j}t|d}||W5QRX|jd?} | r,t|| q,W5QRXdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z%s is not a zip filer..wbN)zipfileZ is_zipfilerZZipFileZinfolistr startswithsplitrrrendswithrreadopenwriteZ external_attrchmod) rrrzinfonamer$datar#Zunix_attributesrrrrZs(         c Csfzt|}Wn$tjk r2td|fYnXt|dd|_|D]}|j}|dsPd| dkrPt j j |f| d}|dk r| s|r|j}|rt|j}t ||}t|}||}q|dk rP|s|rP|||} | rP| t jr"| dd} z||| WqPtjk rJYqPXqPW5QRdSQRXdS) zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z/%s is not a compressed or uncompressed tar filecWsdS)Nr)argsrrrz unpack_tarfile..rr%NT)tarfiler-ZTarErrorr contextlibclosingchownr2r)r*rrrZislnkZissymZlinkname posixpathdirnamenormpathZ _getmemberisfilerr+sepZ_extract_memberZ ExtractError) rrrZtarobjmemberr2Z prelim_dstZlinkpathrZ final_dstrrrrs:         )rr(r8rrr<r9Zdistutils.errorsrZ pkg_resourcesr__all__rrrr rrr rrrrs2   #  % .PK!9@##%__pycache__/pep425tags.cpython-38.pycnu[U Qabm*@sdZddlmZddlZddlmZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZddlmZed Zd d Zd d ZddZddZddZd$ddZddZddZddZddZdd Zd%d"d#ZeZdS)&z2Generate and work with PEP 425 Compatibility Tags.)absolute_importN)log) OrderedDict)six)glibcz(.+)_(\d+)_(\d+)_(.+)c CsLz t|WStk rF}ztd|tWYdSd}~XYnXdS)Nz{}) sysconfigget_config_varIOErrorwarningswarnformatRuntimeWarning)varer9/usr/lib/python3.8/site-packages/setuptools/pep425tags.pyr s  r cCs:ttdrd}n&tjdr"d}ntjdkr2d}nd}|S)z'Return abbreviated implementation name.pypy_version_infoppjavaZjyZcliZipcp)hasattrsysplatform startswith)Zpyimplrrr get_abbr_impls   rcCs,td}|rtdkr(dttt}|S)zReturn implementation version.Zpy_version_nodotr)r rjoinmapstrget_impl_version_info)Zimpl_verrrr get_impl_ver+sr!cCs:tdkr"tjdtjjtjjfStjdtjdfSdS)zQReturn sys.version_info-like tuple for use in decrementing the minor version.rrrN)rr version_informajorminorrrrrr 3s  r cCsdttS)z; Returns the Tag for this specific implementation. z{}{})r rr!rrrr get_impl_tag>sr%TcCs.t|}|dkr&|r td||S||kS)zgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)r rdebug)rZfallbackexpectedr valrrrget_flagEsr)cstd}t|sdkrttdrd}d}d}tddddkd rJd }td fd ddkd rhd }tdddddkotjdrtjrd}dt|||f}n@|r|drd| dd}n|r| dd dd}nd}|S)zXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).ZSOABI>rr maxunicoderZPy_DEBUGcSs ttdS)NZgettotalrefcount)rrrrrr[zget_abi_tag..r)r dZ WITH_PYMALLOCcsdkS)Nrrrimplrrr+_r,mZPy_UNICODE_SIZEcSs tjdkS)Ni)rr*rrrrr+cr,)r'r uz %s%s%s%s%szcpython--r._N) r rrrr)rZPY2r!rsplitreplace)Zsoabir-r0r2abirr.r get_abi_tagQs@ r9cCs tjdkS)Ni)rmaxsizerrrr_is_running_32bitssr;cCstjdkr^t\}}}|d}|dkr6tr6d}n|dkrHtrHd}d|d|d |Stj dd  d d }|d krtrd }|S)z0Return our platform name 'win32', 'linux_x86_64'darwinr4x86_64i386ppc64ppczmacosx_{}_{}_{}rrr5r3 linux_x86_64 linux_i686) rrZmac_verr6r;r distutilsutil get_platformr7)releaser5machineZ split_verresultrrrrEws  rEc CsHtdkrdSzddl}t|jWSttfk r:YnXtddS)N>rArBFr)rE _manylinuxboolZmanylinux1_compatible ImportErrorAttributeErrorrZhave_compatible_glibc)rKrrris_manylinux1_compatibles  rOcsrg}fddtddddg|||r8||D]&}||kr<|||r<||q<|d|S)zReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of a macOS machine. cs||dkr||fdkS|dkr(||fdkS|dkr<||fdkS|dkrP||fdkS|krx|D]}|||r`dSq`dS) Nr@) rJr?r>)rPr1r=TFr)r#r$archgarch_supports_archgroupsrrrTs      z)get_darwin_arches.._supports_arch)Zfat)r>r@)Zintel)r=r>)Zfat64)r=r?)Zfat32)r=r>r@Z universal)rappend)r#r$rGarchesrRrrSrget_darwin_archess$    rXFc Csg}|dkrTg}t}|dd}t|dddD] }|dtt||fq2|p\t}g} |pjt}|r~|g| dd<t} ddl } | D],} | d dr| | d dddq| tt| | d |sT|pt} | d rzt| }|rr|\}}}}d ||}g}ttt|dD]0}tt|||D]}||||fqRq>n| g}n*|dkrtr| d d | g}n| g}| D].}|D]"} |d||df|| fqq|ddD]F}|dkrq,| D]*}|D]} |d||f|| fqqq|D]"} |d|ddd | fq0|d||dfd df|d||ddfd dft|D]B\}}|d|fd df|dkr|d|dd dfq|S)acReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. Nrrz.abir4rIrZnoneZmacosxz {}_{}_%i_%sZlinuxZ manylinux1z%s%s>3031zpy%sany)r rangerVrrrrr9setimpZ get_suffixesraddr6extendsortedlistrE _osx_arch_patmatchrUr reversedintrXrOr7 enumerate)ZversionsZnoarchrr/r8Z supportedr"r#r$ZabisZabi3sr_suffixrQrenameZ actual_archZtplrWr0aversionirrr get_supportedsh         $ $   rn)TT)NFNNN) __doc__Z __future__rZdistutils.utilrCrrrerrr collectionsrZexternrrrcompilerdr rr!r r%r)r9r;rErOrXrnZimplementation_tagrrrrs8         "= `PK!8H,__pycache__/ssl_support.cpython-38.opt-1.pycnu[U Qab-! @sddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z z ddl Z Wnek rtdZ YnXdddddgZd ZzejjZejZWnek reZZYnXe dk oeeefkZzdd l mZmZWnRek r:zdd lmZdd lmZWnek r4dZdZYnXYnXesRGd ddeZesjdddZddZGdddeZGdddeZd ddZ ddZ!e!ddZ"ddZ#ddZ$dS)!N)urllib http_clientmapfilter)ResolutionErrorExtractionErrorVerifyingHTTPSHandlerfind_ca_bundle is_available cert_paths opener_fora /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem )CertificateErrormatch_hostname)r )rc@s eZdZdS)r N)__name__ __module__ __qualname__rr:/usr/lib/python3.8/site-packages/setuptools/ssl_support.pyr 5sr c Csg}|s dS|d}|d}|dd}|d}||krLtdt||s`||kS|dkrt|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |S)zqMatching according to RFC 6125, section 6.4.3 https://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsZfragZpatrrr_dnsname_match;s,     r&cCs|s tdg}|dd}|D]*\}}|dkr t||r@dS||q |s|ddD]6}|D],\}}|dkrdt||rdS||qdq\t|dkrtd |d tt|fn*t|dkrtd ||d fntd dS)a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. zempty or no certificateZsubjectAltNamerZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetr&rlenr r!rr)Zcertr$ZdnsnamesZsankeyvaluesubrrrros2         rc@s eZdZdZddZddZdS)rz=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_t|dSN) ca_bundle HTTPSHandler__init__)selfr.rrrr0szVerifyingHTTPSHandler.__init__csfdd|S)Ncst|jf|Sr-)VerifyingHTTPSConnr.)hostkwr1rrz2VerifyingHTTPSHandler.https_open..)Zdo_open)r1Zreqrr5r https_opens z VerifyingHTTPSHandler.https_openN)rrr__doc__r0r8rrrrrsc@s eZdZdZddZddZdS)r2z@Simple verifying connection: no auth, subclasses, timeouts, etc.cKstj||f|||_dSr-)HTTPSConnectionr0r.)r1r3r.r4rrrr0szVerifyingHTTPSConn.__init__cCst|j|jft|dd}t|drHt|ddrH||_||j}n|j}tt drxt j |j d}|j ||d|_nt j |t j |j d|_zt|j|Wn.tk r|jtj|jYnXdS)NZsource_address_tunnel _tunnel_hostcreate_default_context)Zcafile)Zserver_hostname)Z cert_reqsZca_certs)socketZcreate_connectionr3Zportgetattrhasattrsockr;r<sslr=r.Z wrap_socketZ CERT_REQUIREDrZ getpeercertr ZshutdownZ SHUT_RDWRclose)r1rAZ actual_hostZctxrrrconnects.   zVerifyingHTTPSConn.connectN)rrrr9r0rDrrrrr2sr2cCstjt|ptjS)z@Get a urlopen() replacement that uses ca_bundle for verification)rrequestZ build_openerrr open)r.rrrr s cstfdd}|S)Ncstds||_jS)Nalways_returns)r@rG)argskwargsfuncrrwrappers  zonce..wrapper) functoolswraps)rKrLrrJroncesrOcsZz ddl}Wntk r"YdSXGfddd|j}|d|d|jS)Nrcs,eZdZfddZfddZZS)z"get_win_certfile..CertFilecst|t|jdSr-)superr0atexitregisterrCr5CertFile __class__rrr0sz+get_win_certfile..CertFile.__init__cs,zt|Wntk r&YnXdSr-)rPrCOSErrorr5rSrrrCsz(get_win_certfile..CertFile.close)rrrr0rC __classcell__rrT)rUrrTsrTZCAZROOT) wincertstore ImportErrorrTZaddstorename)rYZ _wincertsrrXrget_win_certfiles    r\cCs$ttjjt}tp"t|dp"tS)z*Return an existing CA bundle path, or NoneN)rospathisfiler r\next_certifi_where)Zextant_cert_pathsrrrr s c Cs.ztdWStttfk r(YnXdS)NZcertifi) __import__whererZrrrrrrrasra)r)N)%r]r>rQrrMZsetuptools.extern.six.movesrrrrZ pkg_resourcesrrrBrZ__all__striprr rEr/r:AttributeErrorobjectr r rZbackports.ssl_match_hostnamer'r&rr2r rOr\r rarrrrsZ      4) (    PK!yʀʀ(__pycache__/package_index.cpython-38.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddlm"Z"ddl#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.e/Z0e1dZ2e1dej3Z4e1dZ5e1dej3j6Z7d8Z9ddddgZ:dZ;dZedZ?ddZ@ddZAddZBdGd dZCdHd!d"ZDdId#d$ZEdedfd%dZFdJd&d'ZGd(d)ZHe1d*ej3ZIeHd+d,ZJGd-d.d.ZKGd/d0d0eKZLGd1ddeZMe1d2jNZOd3d4ZPd5d6ZQdKd7d8ZRd9d:ZSGd;d<d<ZTGd=d>d>ejUZVejWjXfd?d@ZYdAdBZZeRe;eYZYdCdDZ[dEdFZ\dS)Lz#PyPI and direct package downloadingNwraps)six)urllib http_client configparsermap) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST) ssl_support)log)DistutilsError) translate)get_all_headers)unescape)Wheelz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezrP)filenamerGr&r&r'distros_for_filenames  rTc cs||d}|s,tdd|ddDr,dStdt|dD]8}t||d|d|d||d|||dVq>dS)zGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! rJcss|]}td|VqdS)z py\d\.\d$N)rerE).0pr&r&r' sz(interpret_distro_name..Nr6) py_versionrBrQ)r9anyrangerOr join)rKrPrGrZrBrQr;rWr&r&r'r s ccsft}|j}|dkr:tj|j|D]}|||Vq$n(|D]"}||}||kr>|||Vq>dS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrZmoves filterfalse __contains__)iterablekeyseenZseen_addZelementkr&r&r'unique_everseens rfcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||SN)rf)argskwargsfuncr&r'wrapperszunique_values..wrapperr)rkrlr&rjr' unique_valuessrmz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c cst|D]d}|\}}tttj|d}d|ksDd|kr t |D]}t j |t |dVqNq dD]@}||}|dkrtt ||}|rtt j |t |dVqtdS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager3r6)z Home PagezDownload URLr2N)RELfinditergroupsr^rstrstripr+r9HREFrr#urljoin htmldecoderFfindsearch)r:pagerEtagZrelZrelsposr&r&r'find_external_linkss   r|c@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr&selfblockr&r&r'feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr&rr&r&r'is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr&)rreportertemplater&r&r'reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr&r&r&r'r}sr}c@sBeZdZedZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t||_||_dSrg) hash_namehashlibnewhashexpected)rrrr&r&r'__init__s zHashChecker.__init__cCs>tj|d}|stS|j|}|s0tS|f|S)z5Construct a (possibly null) ContentChecker from a URLr2)rr#r7r}patternrx groupdict)clsr:r@rEr&r&r'from_urls zHashChecker.from_urlcCs|j|dSrg)rupdater~r&r&r'rszHashChecker.feedcCs|j|jkSrg)rZ hexdigestrrr&r&r'r"szHashChecker.is_validcCs||j}||Srg)r)rrrmsgr&r&r'r%s zHashChecker.reportN) rrrrUcompilerr classmethodrrrrr&r&r&r'r s rcs<eZdZdZdJddZdKd d ZdLd d ZdMd dZddZddZ ddZ ddZ dNddZ ddZ dOfdd ZddZdd Zd!d"Zd#d$Zd%d&ZdPd'd(ZdQd)d*Zd+d,Zd-Zd.d/Zd0d1ZdRd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&Z'S)Trz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOstj|f|||dd|d |_i|_i|_i|_td t t |j |_ g|_|ortjor|prt}|rt||_n tjj|_dS)Nr1|)rrr, index_url scanned_urls fetched_urls package_pagesrUrr]rrrEallowsto_scanrZ is_availableZfind_ca_bundleZ opener_foropenerrrequesturlopen)rrZhostsZ ca_bundleZ verify_sslrhkwZuse_sslr&r&r'r-s zPackageIndex.__init__Fc Cs||jkr|sdSd|j|<t|s2||dStt|}|r\||sPdS|d||sn|rn||jkrtt|j |dS||sd|j|<dS| d|d|j|<d}| |||}|dkrdSd|j|j <d|j ddkr|dS|j }|}t|tsNt|tjjr0d }n|j d p@d }||d }|t|D](} tj|t| d } || q`| |j!rt"|d ddkr|#||}dS)zexistswarnisdirrealpathlistdirrr]rTrrrr_)rfnnestedr>itemrr&r&r'rus    zPackageIndex.process_filenamecCsbt|}|o|ddk}|s8|tj|drentryr&r&r'rXs   z.PackageIndex.scan_egg_links..)filterrRr>rr itertoolsstarmap scan_egg_link)rZ search_pathdirsZ egg_linksr&r&r'scan_egg_linkss zPackageIndex.scan_egg_linksc Csttj||}ttdttj|}W5QRXt |dkrDdS|\}}t tj||D](}tjj|f||_ t |_ ||q^dS)NrY)openrRr>r]rrrrrrsrOrrKr rBr_)rr>rZ raw_lineslinesZegg_pathZ setup_pathrHr&r&r'rs  zPackageIndex.scan_egg_linkc sfdd}t|D]:}z |tj|t|dWqtk rNYqXq||\}}|rt||D]H}t |\}} | dr| s|r|d||f7}n | |qlt dd|SdSd S) z#Process the contents of a PyPI pagecs|jrtttjj|tjdd}t|dkrd|dkrt |d}t |d}dj | i|<t|t|fSdS)Nr1rYr5r6rT)NN)r-rrrrr#r8rOr9rrr setdefaultr+r)rr;pkgverrr&r'scans   z(PackageIndex.process_index..scanr6.pyz #egg=%s-%scSsd|dddS)Nz%sr6rY)rF)mr&r&r'z,PackageIndex.process_index..rN)rtrprr#rurvrFr$r|rAr,need_version_infoscan_urlPYPI_MD5sub) rr:ryrrErrnew_urlr/fragr&rr'rs(      zPackageIndex.process_indexcCs|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_allrr:r&r&r'rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrrrrrhr&r&r'rs zPackageIndex.scan_allcCsz||j|jd|j|js:||j|jd|j|jsR||t|j|jdD]}||qfdS)Nr1r&) rr unsafe_namerrrcrLnot_found_in_indexr)r requirementr:r&r&r' find_packagess zPackageIndex.find_packagescsR|||||jD]"}||kr0|S|d||qtt|||S)Nz%s does not match %s)prescanrrcrsuperrobtain)rrZ installerrH __class__r&r'rs zPackageIndex.obtaincCsL||jd||sH|t|td|jjtj |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrRunlinkrrr.r>rP)rcheckerrStfpr&r&r' check_hashs zPackageIndex.check_hashcCsN|D]D}|jdks0t|r0|ds0tt|r<||q|j|qdS)z;Add `urls` to the list that will be prescanned for searchesNfile:)rrr-rrrappend)rZurlsr:r&r&r'add_find_linkss  zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrrrr&r&r'rszPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rcrrrr)rrZmethrr&r&r'r#s  zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR||d||}t|\}}|drN||||}|Stj |rb|St |}t | ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r6rrKN)rrr _download_urlrFrAr, gen_setuprRr>rr(rfetch_distribution)rr%tmpdirr<foundr/r@r&r&r'r3-s    zPackageIndex.downloadc sd|id}d fdd }|rH|||}|s^|dk r^|||}|dkrjdk rx||}|dkr|s|||}|dkrdrdpd|nd||j|jd SdS) a|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. zSearching for %sNcs|dkr }||jD]v}|jtkrFsF|krd|d|<q||ko\|jtkp\ }|r|j}||_tj |jr|SqdS)Nz&Skipping development or system egg: %sr6) rcrBrrr r3rKdownload_locationrRr>r)ZreqenvrHZtestZloc develop_okrZskippedsourcerr&r'rwgs&z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rK)N)rrrrrZcloner) rrr force_scanrrZ local_indexrHrwr&rr'rOs2         zPackageIndex.fetch_distributioncCs"|||||}|dk r|jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)rrK)rrrrrrHr&r&r'fetchszPackageIndex.fetchc Cst|}|r*ddt||ddDp,g}t|dkrtj|}tj||krtj ||}ddl m }|||st |||}ttj |dd2} | d|dj|djtj|dfW5QRX|S|rtd ||fntd dS) NcSsg|]}|jr|qSr&)rM)rVdr&r&r' sz*PackageIndex.gen_setup..r6r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rDrEr rFrOrRr>rPdirnamer]Zsetuptools.command.easy_installr shutilZcopy2rwriterLrMsplitextr) rrSr@rrErrPZdstr rr&r&r'rsB       zPackageIndex.gen_setupi c Cs|d|d}zt|}||}t|tjjrJt d||j |j f|}d}|j }d}d|krt |d} ttt| }||||||t|dV} ||} | r|| | | |d7}||||||qqq|||| W5QRX|WS|r|XdS) NzDownloading %szCan't download %s: %s %srr2zcontent-lengthzContent-Lengthwbr6)rrrrrrrrrrrr dl_blocksizermaxrint reporthookrrrr r) rr:rSfprrblocknumZbssizeZsizesrrr&r&r' _download_tos:        zPackageIndex._download_tocCsdSrgr&)rr:rSrZblksizerr&r&r'rszPackageIndex.reporthookc Cs|drt|Szt||jWSttjfk r}z.z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r- local_openopen_with_authrr$r InvalidURLr]rhrrrrrZURLErrorreasonZ BadStatusLinelineZ HTTPExceptionsocket)rr:Zwarningvrr&r&r'rs> "zPackageIndex.open_urlcCst|\}}|r0d|kr4|dddd}qnd}|drJ|dd}tj||}|dksj|d rv|||S|d ks|d r|||S|d r| ||S|d krt j t j |dS||d|||SdS)Nz...\_Z__downloaded__rIr*Zsvnzsvn+Zgitzgit+zhg+rrYT)rAreplacer,rRr>r]r- _download_svn _download_git _download_hgrr url2pathnamer#r7r_attempt_download)rr<r:rr.r@rSr&r&r'rs$        zPackageIndex._download_urlcCs||ddS)NT)rrr&r&r'r:szPackageIndex.scan_urlcCs6|||}d|ddkr.||||S|SdS)Nrrr)rrr+_download_html)rr:rSrr&r&r'r)=s zPackageIndex._attempt_downloadcCsnt|}|D]>}|r td|rF|t||||SqLq |t|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rs���rU���rx���r���rR���r���r%��r���)r���r:���r���rS���r���r��r&���r&���r'���r*��D��s����   zPackageIndex._download_htmlc�����������������C���s��t�dt�|ddd�}d}|�drd|krtj|\}}}}}} |s|drd |d d��kr|d d��d d\}}t |\} } | rd | kr| d d\} } d | | f�}nd | �}| }|||||| f}tj |}|� d||�t d|||f��|S�)Nz"SVN download support is deprecatedr5���r6���r���r���zsvn:@z//r1���rY���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)warningsr��� UserWarningr9���r+���r-���r���r#���r7��� _splituser urlunparser���rR���system)r���r:���rS���Zcredsr<���netlocr>���rW���qr���authhostuserZpwr;���r&���r&���r'���r%��S��s&����   zPackageIndex._download_svnc�����������������C���sp���t�j|�\}}}}}|ddd�}|ddd�}d�}d|krR|dd\}}t�j||||df}�|�|fS�)N+r6���r2���r5���r���r+��r���)r���r#���Zurlsplitr9���rsplitZ urlunsplit)r:��� pop_prefixr<���r2��r>���r?���r���revr&���r&���r'���_vcs_split_rev_from_urli��s����z$PackageIndex._vcs_split_rev_from_urlc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k rh|�d|�td ||f��|S�) Nr5���r6���r���Tr9��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %sr9���r;��r���rR���r1��r���r:���rS���r:��r&���r&���r'���r&��{��s���� zPackageIndex._download_gitc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k rh|�d|�td ||f��|S�) Nr5���r6���r���Tr<��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qr=��r>��r&���r&���r'���r'����s���� zPackageIndex._download_hgc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.debugc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.infoc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.warn)r���r���NT)F)F)F)N)N)FFFN)FF)N)F)(r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r3���r���r��r���r��r��r��r���r���r���r)��r*��r%�� staticmethodr;��r&��r'��r���r���r��� __classcell__r&���r&���r���r'���r���*��sX���������  3   +   #������ L )$ # z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������C���s���|��d}t|S�)Nr���)rF���r���)rE���Zwhatr&���r&���r'��� decode_entity��s���� rA��c�����������������C���s ���t�t|�S�)a�� Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz') 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz' ) entity_subrA��)textr&���r&���r'���rv�����s���� rv���c��������������������s����fdd}|S�)Nc��������������������s����fdd}|S�)Nc��������������� ������s2���t��}t��z�|�|W�S�t�|�X�d�S�rg���)r��ZgetdefaulttimeoutZsetdefaulttimeout)rh���ri���Z old_timeout)rk���timeoutr&���r'���_socket_timeout��s ���� z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr&���)rk���rE��rD��rj���r'���rE����s����z'socket_timeout.<locals>._socket_timeoutr&���)rD��rE��r&���rF��r'���socket_timeout��s���� rG��c�����������������C���s2���t�j|�}|�}t|}|�}|ddS�)aq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r���r#���r8���encodebase64Z b64encoder���r$��)r4��Zauth_sZ auth_bytesZ encoded_bytesZencodedr&���r&���r'��� _encode_auth��s ����  rK��c�������������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�����������������C���s���||�_�||�_d�S�rg���usernamepassword)r���rN��rO��r&���r&���r'���r�����s����zCredential.__init__c�����������������c���s���|�j�V��|�jV��d�S�rg���rM��r���r&���r&���r'���__iter__��s����zCredential.__iter__c�����������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)varsr���r&���r&���r'���__str__��s����zCredential.__str__N)r���r���r���r���r���rP��rR��r&���r&���r&���r'���rL����s���rL��c�������������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�����������������C���sP���t�dddgd}tj|�|�tjtjdd}tj |rL|� |�dS�)z% Load from ~/.pypirc rN��rO�� repositoryr���~z.pypircN) dictfromkeysr���RawConfigParserr���rR���r>���r]��� expanduserr���r���)r���defaultsZrcr&���r&���r'���r�����s ���� zPyPIConfig.__init__c��������������������s&����fdd���D�}tt�j|S�)Nc��������������������s ���g�|�]}��|d��r|qS�)rT��)r���rs���)rV���sectionr���r&���r'���r����s���z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrV��r���_get_repo_cred)r���Zsections_with_repositoriesr&���r���r'���creds_by_repository��s���� zPyPIConfig.creds_by_repositoryc�����������������C���s6���|��|d�}|t|��|d�|��|d�fS�)NrT��rN��rO��)r���rs���rL��)r���r[��Zrepor&���r&���r'���r\����s ����zPyPIConfig._get_repo_credc�����������������C���s*���|�j��D�]\}}||r |��S�q dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r]��itemsr-���)r���r:���rT��credr&���r&���r'���find_credential ��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyr]��r\��r`��r&���r&���r&���r'���rS����s ���  rS��c�����������������C���s:��t�j|�}|\}}}}}}|dr0td|dkrFt|\} } nd} | s~t�|�} | r~t | } | j |�f} t j d | ��| rdt | �} || ||||f} t�j| }t�j|}|d| �n t�j|�}|dt�||}| r6t�j|j\}}}}}}||kr6|| kr6||||||f} t�j| |_|S�) z4Open a urllib2 request, handling HTTP authenticationr,��znonnumeric port: '')ZhttpZhttpsN*Authenticating as %s for %s (from .pypirc)zBasic Z Authorizationz User-Agent)rb��)r���r#���r7���r,���r���r��r/��rS��r`��rr���rN��r���r���rK��r0��r���ZRequestZ add_header user_agentr:���)r:���r���Zparsedr<���r2��r>���Zparamsr?���r���r4��Zaddressr_��r���r;���r���r���r��s2Zh2Zpath2Zparam2Zquery2Zfrag2r&���r&���r'���r����s8����          r��c�����������������C���s ���|��d\}}}�|r|nd|�fS�)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r+��N) rpartition)r5��r6��Zdelimr&���r&���r'���r/��F��s����r/��c�����������������C���s���|�S�rg���r&���)r:���r&���r&���r'��� fix_sf_urlP��s����rf��c�������������� ���C���s��t�j|�\}}}}}}t�j|}tj|r<t�j|�S�| drtj |rg�}t |D�]d} tj || } | dkrt | d} | �} W�5�Q�R�X��qntj | r| d7�} |dj| d�q`d} | j|�d |d} d \}}n d \}}} d d i}t| }t�j|�||||S�) z7Read a local path, with special support for directoriesr1���z index.htmlrz<a href="{name}">{name}</a>)r.���zB<html><head><title>{url}{files}rH)r:files)ZOK)rzPath not foundz Not foundrz text/html)rr#r7rr(rRr>isfilerr,rrr]rrrformatrStringIOrr)r:r<r=r>Zparamr?rrSrhrfilepathrZbodyrZstatusmessagerZ body_streamr&r&r'rTs.        r)N)N)N)N)r!)]rsysrRrUr rrJrrr- functoolsrZsetuptools.externrZsetuptools.extern.six.movesrrrrr"Z pkg_resourcesr r r r r rrrrrrrrrZ distutilsrZdistutils.errorsrZfnmatchrZsetuptools.py27compatrZsetuptools.py33compatrZsetuptools.wheelrtypeZ __metaclass__rrDIrtrrErr9rN__all__Z_SOCKET_TIMEOUTZ_tmplrk version_inforcr(rrArrCrTr rfrmror|r}rrrrBrArvrGrKrLrXrSrrrr/rfrr&r&r&r's  <           !  $   !  &/ PK!8H&__pycache__/ssl_support.cpython-38.pycnu[U Qab-! @sddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z z ddl Z Wnek rtdZ YnXdddddgZd ZzejjZejZWnek reZZYnXe dk oeeefkZzdd l mZmZWnRek r:zdd lmZdd lmZWnek r4dZdZYnXYnXesRGd ddeZesjdddZddZGdddeZGdddeZd ddZ ddZ!e!ddZ"ddZ#ddZ$dS)!N)urllib http_clientmapfilter)ResolutionErrorExtractionErrorVerifyingHTTPSHandlerfind_ca_bundle is_available cert_paths opener_fora /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem )CertificateErrormatch_hostname)r )rc@s eZdZdS)r N)__name__ __module__ __qualname__rr:/usr/lib/python3.8/site-packages/setuptools/ssl_support.pyr 5sr c Csg}|s dS|d}|d}|dd}|d}||krLtdt||s`||kS|dkrt|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |S)zqMatching according to RFC 6125, section 6.4.3 https://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsZfragZpatrrr_dnsname_match;s,     r&cCs|s tdg}|dd}|D]*\}}|dkr t||r@dS||q |s|ddD]6}|D],\}}|dkrdt||rdS||qdq\t|dkrtd |d tt|fn*t|dkrtd ||d fntd dS)a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. zempty or no certificateZsubjectAltNamerZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetr&rlenr r!rr)Zcertr$ZdnsnamesZsankeyvaluesubrrrros2         rc@s eZdZdZddZddZdS)rz=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_t|dSN) ca_bundle HTTPSHandler__init__)selfr.rrrr0szVerifyingHTTPSHandler.__init__csfdd|S)Ncst|jf|Sr-)VerifyingHTTPSConnr.)hostkwr1rrz2VerifyingHTTPSHandler.https_open..)Zdo_open)r1Zreqrr5r https_opens z VerifyingHTTPSHandler.https_openN)rrr__doc__r0r8rrrrrsc@s eZdZdZddZddZdS)r2z@Simple verifying connection: no auth, subclasses, timeouts, etc.cKstj||f|||_dSr-)HTTPSConnectionr0r.)r1r3r.r4rrrr0szVerifyingHTTPSConn.__init__cCst|j|jft|dd}t|drHt|ddrH||_||j}n|j}tt drxt j |j d}|j ||d|_nt j |t j |j d|_zt|j|Wn.tk r|jtj|jYnXdS)NZsource_address_tunnel _tunnel_hostcreate_default_context)Zcafile)Zserver_hostname)Z cert_reqsZca_certs)socketZcreate_connectionr3Zportgetattrhasattrsockr;r<sslr=r.Z wrap_socketZ CERT_REQUIREDrZ getpeercertr ZshutdownZ SHUT_RDWRclose)r1rAZ actual_hostZctxrrrconnects.   zVerifyingHTTPSConn.connectN)rrrr9r0rDrrrrr2sr2cCstjt|ptjS)z@Get a urlopen() replacement that uses ca_bundle for verification)rrequestZ build_openerrr open)r.rrrr s cstfdd}|S)Ncstds||_jS)Nalways_returns)r@rG)argskwargsfuncrrwrappers  zonce..wrapper) functoolswraps)rKrLrrJroncesrOcsZz ddl}Wntk r"YdSXGfddd|j}|d|d|jS)Nrcs,eZdZfddZfddZZS)z"get_win_certfile..CertFilecst|t|jdSr-)superr0atexitregisterrCr5CertFile __class__rrr0sz+get_win_certfile..CertFile.__init__cs,zt|Wntk r&YnXdSr-)rPrCOSErrorr5rSrrrCsz(get_win_certfile..CertFile.close)rrrr0rC __classcell__rrT)rUrrTsrTZCAZROOT) wincertstore ImportErrorrTZaddstorename)rYZ _wincertsrrXrget_win_certfiles    r\cCs$ttjjt}tp"t|dp"tS)z*Return an existing CA bundle path, or NoneN)rospathisfiler r\next_certifi_where)Zextant_cert_pathsrrrr s c Cs.ztdWStttfk r(YnXdS)NZcertifi) __import__whererZrrrrrrrasra)r)N)%r]r>rQrrMZsetuptools.extern.six.movesrrrrZ pkg_resourcesrrrBrZ__all__striprr rEr/r:AttributeErrorobjectr r rZbackports.ssl_match_hostnamer'r&rr2r rOr\r rarrrrsZ      4) (    PK!+__pycache__/py27compat.cpython-38.opt-1.pycnu[U Qab@sdZddlZddlZddlmZddZejr6ddZedkoFejZerPe ndd Z z,d d l m Z m Z mZmZd d l mZmZWnJek rddlZdd lm Z mZmZdddZ ddZddZYnXdS)z2 Compatibility Support for Python 2.7 and earlier N)sixcCs ||S)zH Given an HTTPMessage, return all headers matching a given key. )Zget_allmessagekeyr9/usr/lib/python3.8/site-packages/setuptools/py27compat.pyget_all_headers srcCs ||SN)Z getheadersrrrrrsZLinuxcCs|Sr r)xrrrr ) find_module PY_COMPILED PY_FROZEN PY_SOURCE)get_frozen_object get_module)rrrc Csj|d}|rf|d}t||\}}\}}}} |tjkrP|pFdg}|g}q |r td||fq | S)z7Just like 'imp.find_module()', but with package support.r__init__zCan't find %r in %s)splitpopimprZ PKG_DIRECTORY ImportError) modulepathspartspartfpathsuffixmodeZkindinforrrr's    rcCs t|Sr )rr)rrrrrr7srcCstj|f|tj|Sr )r load_modulesysmodules)rrr"rrrr:sr)N)__doc__r$platformZsetuptools.externrrZPY2systemZlinux_py2_asciistrZ rmtree_safe_imprrrrrrrrrrrrs&   PK!tEE!__pycache__/config.cpython-38.pycnu[U Qab6P@sddlmZmZddlZddlZddlZddlZddlZddlm Z ddlm Z ddlm Z ddl m Z ddlmZmZddlmZmZdd lmZdd lmZmZeZdd d ZddZddZdddZGdddZGdddeZ GdddeZ!dS))absolute_importunicode_literalsN) defaultdict)partialwraps) import_module)DistutilsOptionErrorDistutilsFileError) LegacyVersionparse) SpecifierSet) string_typesPY3Fc Csddlm}m}tj|}tj|s4td|t}t tj |zJ|}|rb| ng}||krx| ||j ||dt||j|d}W5t |Xt|S)a,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict r) Distribution _Distributionz%Configuration file %s does not exist.) filenames)ignore_option_errors)Zsetuptools.distrrospathabspathisfiler getcwdchdirdirnameZfind_config_filesappendZparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersrrrZcurrent_directoryZdistrhandlersr!5/usr/lib/python3.8/site-packages/setuptools/config.pyread_configurations*     r#cCs.djft}tt||}t|||}|S)z Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. z get_{key})formatlocals functoolsrgetattr) target_objkeyZ getter_nameZ by_attributegetterr!r!r" _get_optionEs r+cCs<tt}|D]*}|jD]}t|j|}|||j|<qq |S)zReturns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict )rdict set_optionsr+r(section_prefix)r Z config_dictZhandlerZoptionvaluer!r!r"rQs   rcCs6t|||}|t|j|||j}|||fS)aPerforms additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list )ConfigOptionsHandlerr ConfigMetadataHandlermetadata package_dir)Z distributionrroptionsmetar!r!r"rcsrc@seZdZdZdZiZd%ddZeddZdd Z e d&d d Z e d dZ e ddZ e ddZe ddZeddZeddZe d'ddZe ddZe d(ddZdd Zd!d"Zd#d$ZdS)) ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|D].\}}||s&q||dd}|||<q||_||_||_g|_dS)N.) r.items startswithreplacestriprr(sectionsr-)selfr(r4rr=r. section_namesection_optionsr!r!r"__init__s  zConfigHandler.__init__cCstd|jjdS).Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError __class____name__)r>r!r!r"parserss zConfigHandler.parsersc Cst}|j}|j||}t|||}||kr6t||r>dSd}|j|}|rz ||}Wn tk r~d}|jszYnX|rdSt|d|d}|dkrt |||n|||j |dS)NFTzset_%s) tupler(aliasesgetr'KeyErrorrF Exceptionrsetattrr-r) r>Z option_namer/unknownr(Z current_valueZ skip_optionparsersetterr!r!r" __setitem__s0   zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |}n ||}dd|DS)zRepresents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list  cSsg|]}|r|qSr!)r<).0chunkr!r!r" sz-ConfigHandler._parse_list..) isinstancelist splitlinessplit)clsr/ separatorr!r!r" _parse_lists   zConfigHandler._parse_listcCsPd}i}||D]8}||\}}}||kr:td||||<q|S)zPRepresents value as a dict. :param value: :rtype: dict =z(Unable to parse option value to dict: %s)r\ partitionr r<)rZr/r[resultliner)sepvalr!r!r" _parse_dictszConfigHandler._parse_dictcCs|}|dkS)zQRepresents value as boolean. :param value: :rtype: bool )1trueZyes)lower)rZr/r!r!r" _parse_boolszConfigHandler._parse_boolcsfdd}|S)zReturns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable cs d}||rtd|S)Nfile:zCOnly strings are accepted for the {0} field, files are not accepted)r: ValueErrorr$)r/Zexclude_directiver)r!r"rNs z3ConfigHandler._exclude_files_parser..parserr!)rZr)rNr!rjr"_exclude_files_parsers z#ConfigHandler._exclude_files_parsercs\d}t|ts|S||s |S|t|d}dd|dD}dfdd|DS)aORepresents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtype: str rhNcss|]}tj|VqdSN)rrrr<rSrr!r!r" %sz,ConfigHandler._parse_file..rQrRc3s.|]&}|stj|r|VqdS)TN) _assert_localrrr _read_filermrZr!r"rn&s   )rVrr:lenrYjoin)rZr/Zinclude_directivespecZ filepathsr!rqr" _parse_files  zConfigHandler._parse_filecCs|tstd|dS)Nz#`file:` directive can not access %s)r:rrr )rr!r!r"ro-szConfigHandler._assert_localc Cs.tj|dd}|W5QRSQRXdS)Nzutf-8)encoding)ioopenread)rfr!r!r"rp3szConfigHandler._read_filec Csd}||s|S||dd}|}d|}|p@d}t}|r|d|kr||d}|dd} t | dkrtj t| d}| d}q|}nd|krtj t|d}t j d|zt |} t| |}W5t j ddt _ X|S) zRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str zattr:r7r8rAr/N)r:r;r<rYpoprsrrrsplitrrrsysinsertrr') rZr/r3Zattr_directiveZ attrs_pathZ attr_nameZ module_name parent_pathZ custom_pathpartsmoduler!r!r" _parse_attr8s0        zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable cs|}D] }||}q|Srlr!)r/parsedmethod parse_methodsr!r"r ns z1ConfigHandler._get_parser_compound..parser!)rZrr r!rr"_get_parser_compoundes z"ConfigHandler._get_parser_compoundcCs6i}|pdd}|D]\}\}}||||<q|S)zParses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict cSs|Srlr!)rbr!r!r"z6ConfigHandler._parse_section_to_dict..)r9)rZr@Z values_parserr/r)_rbr!r!r"_parse_section_to_dictxs  z$ConfigHandler._parse_section_to_dictc Cs<|D].\}\}}z |||<Wqtk r4YqXqdS)zQParses configuration file section. :param dict section_options: N)r9rJ)r>r@namerr/r!r!r" parse_sections  zConfigHandler.parse_sectioncCsb|jD]R\}}d}|r"d|}t|d|ddd}|dkrTtd|j|f||q dS)zTParses configuration file items from one or more related sections. r7z_%szparse_section%sr8__Nz0Unsupported distribution option section: [%s.%s])r=r9r'r;r r.)r>r?r@Zmethod_postfixZsection_parser_methodr!r!r"r s"zConfigHandler.parsecstfdd}|S)z this function will wrap around parameters that are deprecated :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around cst||Srl)warningswarn)argskwargsfuncmsg warning_classr!r"config_handlers z@ConfigHandler._deprecated_config_handler..config_handlerr)r>rrrrr!rr"_deprecated_config_handlersz(ConfigHandler._deprecated_config_handler)F)rQ)N)N)rE __module__ __qualname____doc__r.rHrApropertyrFrP classmethodr\rcrgrkru staticmethodrorprrrrr rr!r!r!r"r6~s<  &        ,   r6csHeZdZdZdddddZdZdfd d Zed d Zd dZ Z S)r1r2Zurl description classifiers platforms)Z home_pageZsummaryZ classifierplatformFNcstt||||||_dSrl)superr1rAr3)r>r(r4rr3rDr!r"rAszConfigMetadataHandler.__init__c CsL|j}|j}|j}|j}|||||dt|||||d|||j|d S)rBz[The requires parameter is deprecated, please use install_requires for runtime dependencies.license) rkeywordsZprovidesZrequiresZ obsoletesrrrZlong_descriptionversionZ project_urls)r\rurcrkrDeprecationWarningr_parse_version)r> parse_listZ parse_file parse_dictZexclude_files_parserr!r!r"rFs( zConfigMetadataHandler.parserscCs||}||krB|}tt|tr>d}t|jft|S|||j }t |r^|}t|t st |drd tt|}nd|}|S)zSParses `version` option value. :param value: :rtype: str zCVersion loaded from {value} does not comply with PEP 440: {version}__iter__r8z%s)rur<rVr r r r$r%rr3callablerhasattrrsmapstr)r>r/rZtmplr!r!r"rs    z$ConfigMetadataHandler._parse_version)FN) rErrr.rHZ strict_moderArrFr __classcell__r!r!rr"r1s r1c@s\eZdZdZeddZddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)r0r4cCsN|j}t|jdd}|j}|j}|||||||||||||||j|j|tdS)rB;r[)Zzip_safeZuse_2to3Zinclude_package_datar3Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsZscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requireZpackages entry_pointsZ py_modulesZpython_requires)r\rrgrc_parse_packagesrur )r>rZparse_list_semicolonZ parse_boolrr!r!r"rFs.zConfigOptionsHandler.parserscCszddg}|}||kr"||S||dk}|r>ts>td||jdi}|rdddlm}n ddlm }|f|S) zTParses `packages` option value. :param value: :rtype: list zfind:zfind_namespace:r|z8find_namespace: directive is unsupported on Python < 3.3z packages.findr)find_namespace_packages) find_packages) r<r\rr parse_section_packages__findr=rIZ setuptoolsrr)r>r/Zfind_directivesZ trimmed_valueZfindns find_kwargsrr!r!r"r1s     z$ConfigOptionsHandler._parse_packagescsT|||j}dddgtfdd|D}|d}|dk rP|d|d<|S)zParses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: whereZincludeexcludecs$g|]\}}|kr|r||fqSr!r!rSkvZ valid_keysr!r"rUZszEConfigOptionsHandler.parse_section_packages__find..Nr)rr\r,r9rI)r>r@Z section_datarrr!rr"rMs   z1ConfigOptionsHandler.parse_section_packages__findcCs|||j}||d<dS)z`Parses `entry_points` configuration file section. :param dict section_options: rN)rr\r>r@rr!r!r"parse_section_entry_pointsbsz/ConfigOptionsHandler.parse_section_entry_pointscCs.|||j}|d}|r*||d<|d=|S)N*r7)rr\rI)r>r@rrootr!r!r"_parse_package_datajs  z(ConfigOptionsHandler._parse_package_datacCs|||d<dS)z`Parses `package_data` configuration file section. :param dict section_options: Z package_dataNrr>r@r!r!r"parse_section_package_datatsz/ConfigOptionsHandler.parse_section_package_datacCs|||d<dS)zhParses `exclude_package_data` configuration file section. :param dict section_options: Zexclude_package_dataNrrr!r!r""parse_section_exclude_package_data{sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}||||d<dS)zbParses `extras_require` configuration file section. :param dict section_options: rrZextras_requireN)rr\r)r>r@rr!r!r"parse_section_extras_requires z1ConfigOptionsHandler.parse_section_extras_requirecCs(|||j}dd|D|d<dS)z^Parses `data_files` configuration file section. :param dict section_options: cSsg|]\}}||fqSr!r!rr!r!r"rUszAConfigOptionsHandler.parse_section_data_files..Z data_filesN)rr\r9rr!r!r"parse_section_data_filessz-ConfigOptionsHandler.parse_section_data_filesN)rErrr.rrFrrrrrrrrr!r!r!r"r0s   r0)FF)F)"Z __future__rrrwrrrr& collectionsrrr importlibrZdistutils.errorsr r Z#setuptools.extern.packaging.versionr r Z&setuptools.extern.packaging.specifiersr Zsetuptools.extern.sixrrtypeZ __metaclass__r#r+rrr6r1r0r!r!r!r"s4      /  ?UPK!@Řtt&__pycache__/wheel.cpython-38.opt-1.pycnu[U Qab@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl m Z ddlmZddl mZddlmZeZed ejjZd Zd d ZGd ddZdS)zWheels support.) get_platformN) parse_version)canonicalize_name)PY3) pep425tags)write_requirementsz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$ztry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c Cst|D]\}}}tj||}|D].}tj||}tj|||}t||q&ttt|D]D\} } tj|| }tj||| }tj |sft|||| =qfq tj|ddD]\}}}t |qdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsrmdir) Zsrc_dirZdst_dirdirpathZdirnames filenamessubdirfsrcZdstndr4/usr/lib/python3.8/site-packages/setuptools/wheel.pyunpack%s   rc@sheZdZddZddZddZddZd d Zd d Zd dZ e ddZ e ddZ e ddZ dS)WheelcCsPttj|}|dkr$td|||_|D]\}}t|||q6dS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr"matchkvrrr__init__=s  zWheel.__init__cCs&t|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproductZ py_versionsplitZabiplatformr&rrrtagsEs    z Wheel.tagscs$ttfdd|DdS)z5Is the wheel is compatible with the current platform?c3s|]}|krdVqdS)TNr).0tZsupported_tagsrr Psz&Wheel.is_compatible..F)rZ get_supportednextr1r0rr4r is_compatibleMszWheel.is_compatiblecCs,tj|j|j|jdkrdntddS)Nany) project_nameversionr/z.egg) pkg_resources Distributionr9r:r/regg_namer0rrrr=RszWheel.egg_namecCsJ|D]4}t|}|drt|t|jr|SqtddS)Nz .dist-infoz.unsupported wheel format. .dist-info not found)Znamelist posixpathdirnameendswithr startswithr9r!)r&zfmemberr?rrr get_dist_infoXs    zWheel.get_dist_infoc Cs(t|j}|||W5QRXdS)z"Install wheel as an egg directory.N)zipfileZZipFiler"_install_as_egg)r&destination_eggdirrBrrrinstall_as_eggbszWheel.install_as_eggcCs\d|j|jf}||}d|}tj|d}|||||||||||dS)Nz%s-%sz%s.dataEGG-INFO) r9r:rDr r r _convert_metadata_move_data_entries_fix_namespace_packages)r&rGrBZ dist_basename dist_info dist_dataegg_inforrrrFgs  zWheel._install_as_eggc s&fdd}|d}t|d}td|ko>tdkn}|sTtd|t||tj|tj j |t |dd d t t tfd d jD}t|ttj|d tj|dtj t|dd} t| ddtj|ddS)Nc sTt|8}tr&|dn|}tj |W5QRSQRXdS)Nzutf-8) openr>r rreaddecodeemailparserZParserZparsestr)namefpvalue)rMrBrr get_metadatassz-Wheel._convert_metadata..get_metadataZWHEELz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|SN)Zmarkerstr)reqrrrraw_reqsz(Wheel._convert_metadata..raw_reqc s2i|]*}|tfddt|fDqS)c3s|]}|kr|VqdSrYr)r2r[)install_requiresrrr5sz5Wheel._convert_metadata...)sortedmaprequires)r2Zextra)distr]r\rr s  z+Wheel._convert_metadata..ZMETADATAzPKG-INFO)r]extras_require)ZattrsrOz requires.txt)rgetr!r mkdirZ extractallr r r;r<Z from_locationZ PathMetadatarr^r_r`Zextrasrename setuptoolsdictrZget_command_obj) rBrGrMrOrXZwheel_metadataZ wheel_versionZwheel_v1rcZ setup_distr)rarMr]r\rBrrJqsL       zWheel._convert_metadatacstj|tjd}tj|rtj|dd}t|t|D]D}|drpttj||qLttj||tj||qLt |t tjjfdddDD]}t ||qtjrt dS)z,Move data entries to their correct location.ZscriptsrIz.pycc3s|]}tj|VqdSrY)r r r )r2rrNrrr5sz+Wheel._move_data_entries..)dataZheadersZpurelibZplatlibN) r r r rrelistdirr@unlinkrfrfilterr)rGrNZdist_data_scriptsZegg_info_scriptsentryrrrirrKs.         zWheel._move_data_entriesc Cstj|d}tj|rt|}|}W5QRX|D]b}tjj|f|d}tj|d}tj|r>tj|s>t|d}|tW5QRXq>dS)Nznamespace_packages.txtr+z __init__.pyw) r r r rrPrQr.writeNAMESPACE_PACKAGE_INIT)rOrGZnamespace_packagesrVmodZmod_dirZmod_initrrrrLs   zWheel._fix_namespace_packagesN)__name__ __module__ __qualname__r*r1r7r=rDrHrF staticmethodrJrKrLrrrrr;s   9 r)__doc__Zdistutils.utilrrSr,r r>rerEr;rgrZ!setuptools.extern.packaging.utilsrZsetuptools.extern.sixrrZsetuptools.command.egg_infortypeZ __metaclass__compileVERBOSEr'rrqrrrrrrs,      PK!>T5__pycache__/_deprecation_warning.cpython-38.opt-1.pycnu[U Qab@sGdddeZdS)c@seZdZdZdS)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. N)__name__ __module__ __qualname____doc__rrC/usr/lib/python3.8/site-packages/setuptools/_deprecation_warning.pyrsrN)WarningrrrrrPK!cc%__pycache__/glob.cpython-38.opt-1.pycnu[U Qab@sdZddlZddlZddlZdddgZdddZdddZd d Zd d Zd dZ ddZ ddZ e dZ e dZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. NglobiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamerr3/usr/lib/python3.8/site-packages/setuptools/glob.pyrs cCs"t||}|rt|rt|}|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenext)rritsrrr rs  ccstj|\}}t|sF|r0tj|rB|Vntj|rB|VdS|s|rnt|rnt||D] }|Vq`nt||D] }|VqxdS||krt|rt ||}n|g}t|r|rt|rt}qt}nt }|D]$}|||D]}tj ||VqqdSN) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirsZ glob_in_dirnamerrr r 0s4      r cCsV|s"t|trtjd}ntj}zt|}Wntk rHgYSXt||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr r[s  rcCs8|stj|r4|gSntjtj||r4|gSgSr)rrrrr)rrrrr rhs  rccs&|ddVt|D] }|VqdS)Nr) _rlistdir)rr)rrrr rxs rccs|s"t|trtjd}ntj}zt|}Wntjk rHYdSX|D]>}|V|rjtj||n|}t |D]}tj||VqvqNdSr) r!r"rr#r$r%errorrrr+)rr*rryrrr r+s  r+z([*?[])s([*?[])cCs(t|trt|}n t|}|dk Sr)r!r"magic_check_bytessearch magic_check)rmatchrrr rs   rcCst|tr|dkS|dkSdS)Ns**z**)r!r")r)rrr r s r cCs<tj|\}}t|tr(td|}n td|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver!r"r.subr0)rZdriverrr rs   )F)F)__doc__rrer'__all__rrr rrrr+compiler0r.rr rrrrr s    +   PK!  +__pycache__/namespaces.cpython-38.opt-1.pycnu[U Qab @sRddlZddlmZddlZddlmZejjZGdddZ Gddde Z dS)N)log)mapc@sTeZdZdZddZddZddZdZd Zd d Z d d Z ddZ e ddZ dS) Installerz -nspkg.pthc Cs|}|sdStj|\}}||j7}|j|t d|t |j |}|j rdt |dSt|d}||W5QRXdS)Nz Installing %sZwt)_get_all_ns_packagesospathsplitext _get_target nspkg_extZoutputsappendrinfor_gen_nspkg_lineZdry_runlistopen writelines)selfZnspfilenameextlinesfr9/usr/lib/python3.8/site-packages/setuptools/namespaces.pyinstall_namespacess     zInstaller.install_namespacescCsHtj|\}}||j7}tj|s.dStd|t|dS)Nz Removing %s) rrrr r existsrr remove)rrrrrruninstall_namespaces!s    zInstaller.uninstall_namespacescCs|jSN)targetrrrrr )szInstaller._get_target) zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']rrrrr _get_rootCszInstaller._get_rootcCsVt|}t|d}|}|j}|d\}}}|rB||j7}d|tdS)N.; ) strtuplesplitr _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgZpthrootZ tmpl_linesparentsepZchildrrrr Fs zInstaller._gen_nspkg_linecCs |jjp g}ttt|j|S)z,Return sorted list of all package namespaces)Z distributionZnamespace_packagessortedflattenr _pkg_names)rZpkgsrrrrQs zInstaller._get_all_ns_packagesccs(|d}|r$d|V|q dS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r N)r%r)pop)r+partsrrrr1Vs  zInstaller._pkg_namesN)__name__ __module__ __qualname__r rrr r&r(rr r staticmethodr1rrrrr s rc@seZdZddZddZdS)DevelopInstallercCstt|jSr)reprr#Zegg_pathrrrrrgszDevelopInstaller._get_rootcCs|jSr)Zegg_linkrrrrr jszDevelopInstaller._get_targetN)r4r5r6rr rrrrr8fsr8) rZ distutilsr itertoolsZsetuptools.extern.six.movesrchain from_iterabler0rr8rrrrs   [PK!A(__pycache__/unicode_utils.cpython-38.pycnu[U Qab@s8ddlZddlZddlmZddZddZddZdS) N)sixcCsVt|tjrtd|Sz$|d}td|}|d}Wntk rPYnX|S)NZNFDutf-8) isinstancer text_type unicodedataZ normalizedecodeencode UnicodeError)pathr s   PK!A88!__pycache__/launch.cpython-38.pycnu[U Qab@s.dZddlZddlZddZedkr*edS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. NcCsrttjd}t|ddd}tjddtjdd<ttdt}||}|dd}t ||d}t ||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizerreadreplacecompiler)Z script_name namespaceZopen_ZscriptZ norm_scriptcoder5/usr/lib/python3.8/site-packages/setuptools/launch.pyrun s     rr)rrr rrrrrrs PK!  %__pycache__/namespaces.cpython-38.pycnu[U Qab @sRddlZddlmZddlZddlmZejjZGdddZ Gddde Z dS)N)log)mapc@sTeZdZdZddZddZddZdZd Zd d Z d d Z ddZ e ddZ dS) Installerz -nspkg.pthc Cs|}|sdStj|\}}||j7}|j|t d|t |j |}|j rdt |dSt|d}||W5QRXdS)Nz Installing %sZwt)_get_all_ns_packagesospathsplitext _get_target nspkg_extZoutputsappendrinfor_gen_nspkg_lineZdry_runlistopen writelines)selfZnspfilenameextlinesfr9/usr/lib/python3.8/site-packages/setuptools/namespaces.pyinstall_namespacess     zInstaller.install_namespacescCsHtj|\}}||j7}tj|s.dStd|t|dS)Nz Removing %s) rrrr r existsrr remove)rrrrrruninstall_namespaces!s    zInstaller.uninstall_namespacescCs|jSN)targetrrrrr )szInstaller._get_target) zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']rrrrr _get_rootCszInstaller._get_rootcCsVt|}t|d}|}|j}|d\}}}|rB||j7}d|tdS)N.; ) strtuplesplitr _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgZpthrootZ tmpl_linesparentsepZchildrrrr Fs zInstaller._gen_nspkg_linecCs |jjp g}ttt|j|S)z,Return sorted list of all package namespaces)Z distributionZnamespace_packagessortedflattenr _pkg_names)rZpkgsrrrrQs zInstaller._get_all_ns_packagesccs(|d}|r$d|V|q dS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r N)r%r)pop)r+partsrrrr1Vs  zInstaller._pkg_namesN)__name__ __module__ __qualname__r rrr r&r(rr r staticmethodr1rrrrr s rc@seZdZddZddZdS)DevelopInstallercCstt|jSr)reprr#Zegg_pathrrrrrgszDevelopInstaller._get_rootcCs|jSr)Zegg_linkrrrrr jszDevelopInstaller._get_targetN)r4r5r6rr rrrrr8fsr8) rZ distutilsr itertoolsZsetuptools.extern.six.movesrchain from_iterabler0rr8rrrrs   [PK![g``(__pycache__/depends.cpython-38.opt-1.pycnu[U Qab@sddlZddlZddlZddlmZddlmZddlmZm Z m Z m Z ddl mZddd d gZ Gd ddZd d Zddd Zddd ZddZedS)N) StrictVersion)Bytecode) find_module PY_COMPILED PY_FROZEN PY_SOURCE) py27compatRequirerget_module_constantextract_constantc@sHeZdZdZdddZddZdd Zdd d Zdd dZdddZ dS)r z7A prerequisite to building or installing a distributionNcCsF|dkr|dk rt}|dk r0||}|dkr0d}|jt|`dS)N __version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage attributeformatr6/usr/lib/python3.8/site-packages/setuptools/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_okrcCs|jdkrFz$t|j|\}}}|r*||WStk rDYdSXt|j|j||}|dk r|||k r||jdk r|||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)rrrclose ImportErrorr r)rpathsdefaultfpivrrr get_version.s  zRequire.get_versioncCs||dk S)z/Return true if dependency is present on 'paths'N)r()rr"rrr is_presentIszRequire.is_presentcCs ||}|dkrdS||S)z>Return true if dependency is present and up-to-date on 'paths'NF)r(r)rr"rrrr is_currentMs zRequire.is_current)r NN)Nr)N)N) __name__ __module__ __qualname____doc__rrrr(r)r*rrrrr s   cCs"tjdd}|s|St|S)Ncss dVdS)NrrrrremptyVszmaybe_close..empty) contextlibcontextmanagerclosing)r$r/rrr maybe_closeUs  r3c Cszt||\}}\}}}} Wntk r4YdSXt|z|tkr^|dt|} nV|tkrtt ||} n@|t krt ||d} n&t ||| } t | |dW5QRSW5QRXt| ||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)rr!r3rreadmarshalloadrr get_frozen_objectrcompileZ get_modulegetattrr ) rsymbolr#r"r$pathsuffixmodeZkindinfocodeZimportedrrrr `s   "c Cs||jkrdSt|j|}d}d}d}|}t|D]H}|j} |j} | |krZ|j| }q6| |krz| |ksr| |krz|S|}q6dS)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) rBr=r#Zname_idxZ STORE_NAMEZ STORE_GLOBALZ LOAD_CONSTconstZ byte_codeoprIrrrr }s   cCs>tjdstjdkrdSd}|D]}t|=t|q"dS)z Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. javaZcliN)r r )sysplatform startswithglobals__all__remove)Z incompatiblerrrr_update_globalss rT)r4N)r4)rNr8r0Zdistutils.versionrZ py33compatrr rrrrr rRr r3r r rTrrrrs"   D  $PK!b'/&__pycache__/glibc.cpython-38.opt-1.pycnu[U QabJ @sHddlmZddlZddlZddlZddZddZddZd d ZdS) )absolute_importNcCsRtd}z |j}Wntk r*YdSXtj|_|}t|tsN|d}|S)z9Returns glibc version string, or None if not using glibc.Nascii) ctypesZCDLLgnu_get_libc_versionAttributeErrorZc_char_pZrestype isinstancestrdecode)Zprocess_namespacer version_strr 4/usr/lib/python3.8/site-packages/setuptools/glibc.pyglibc_version_string s    r cCsHtd|}|s$td|tdSt|d|koFt|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFmajorminor)rematchwarningswarnRuntimeWarningintgroup)r required_major minimum_minormr r r check_glibc_version$s rcCst}|dkrdSt|||S)NF)r r)rrr r r r have_compatible_glibc4srcCst}|dkrdSd|fSdS)zTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. N)rZglibc)r )Z glibc_versionr r r libc_verLsr) Z __future__rrrrr rrrr r r r s PK!ĺ<<(__pycache__/sandbox.cpython-38.opt-1.pycnu[U Qab7@s ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejdrddlmmmmZn ejejZzeZWnek rdZYnXeZddlm Z ddlm!Z!ddd d gZ"d-d d Z#ej$d.d dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d Z2Gd&ddZ3e4ed'rej5gZ6ngZ6Gd(dde3Z7e8ej9d)d*d+:DZ;Gd,d d e Zr4r5tbrrr__exit__{s zExceptionSaver.__exit__cCs6dt|krdSttj|j\}}t|||jdS)z"restore and re-raise any exceptionrAN)varsrr.loadsrArZreraiserB)r>r4r5rrrresumes zExceptionSaver.resumeN)r7r8r9r:r?rDrGrrrrr<rs r<c #sVtjt }VW5QRXtjfddtjD}t||dS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. c3s$|]}|kr|ds|VqdS)z encodings.N startswith).0mod_namer!rr s zsave_modules..N)rmodulescopyr<update_clear_modulesrG) saved_excZ del_modulesrr!r save_moduless   rRcCst|D] }tj|=qdSr)listrrM)Z module_namesrKrrrrPs rPc cs$t}z |VW5t|XdSr)r$ __getstate__ __setstate__r!rrrsave_pkg_resources_states rVccstj|d}txtfttNt<t|(t |t ddVW5QRXW5QRXW5QRXW5QRXW5QRXW5QRXdS)NZtempZ setuptools) r(r joinrVrRhide_setuptoolsr"rr'r, __import__) setup_dirZtemp_dirrrr setup_contexts  r[cCstd}t||S)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rKpatternrrr _needs_hidings r`cCstttj}t|dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N)filterr`rrMrP)rMrrrrXs rXc Cstjtj|}t|z|gt|tjdd<tjd|t t j ddt |trl|n |t}t|t|dd}t||W5QRXWn4tk r}z|jr|jdrʂW5d}~XYnXW5QRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|Sr)Zactivate)Zdistrrrzrun_setup..__main__)__file__r7)r(r abspathdirnamer[rSrrinsertr__init__Z callbacksappend isinstancestrencodegetfilesystemencodingr dictr SystemExitargs)Z setup_scriptrqrZZ dunder_filensvrrrr s"    c@seZdZdZdZddZddZddZd d Zd d Z d dZ dD]Z e e e rDe e ee <qDd$ddZerzedeZedeZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZddZd d!Zd"d#ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs$g|]}|dst|r|qS)_)rIhasattr)rJnamer=rr s z,AbstractSandbox.__init__..)dir_os_attrsr=rr=rris zAbstractSandbox.__init__cCs"|jD]}tt|t||qdSr)rzsetattrr(getattr)r>sourcervrrr_copy s zAbstractSandbox._copycCs(||tr|jt_|jt_d|_dSr@)r~_filerfile_openr_activer=rrrr?s  zAbstractSandbox.__enter__cCs$d|_trtt_tt_|tdSNF)rrrrrrr~ry)r>exc_type exc_value tracebackrrrrDs zAbstractSandbox.__exit__c Cs"||W5QRSQRXdS)zRun 'func' under os sandboxingNr)r>funcrrrrunszAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||Sr)r _remap_pair)r>srcdstrqkwrvoriginalrrwrap&sz3AbstractSandbox._mk_dual_path_wrapper..wrapr|ryrvrrrr_mk_dual_path_wrapper#s z%AbstractSandbox._mk_dual_path_wrapper)renamelinksymlinkNcs p ttfdd}|S)Ncs*|jr|j|f||}|f||Sr)r _remap_inputr>r rqrrrrr4sz5AbstractSandbox._mk_single_path_wrapper..wrapr)rvrrrrr_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperrr)statlistdirr*rchmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}||f||S|f||Sr)rr _remap_outputrrrrrIsz4AbstractSandbox._mk_single_with_return..wraprrrrr_mk_single_with_returnFs z&AbstractSandbox._mk_single_with_return)readlinktempnamcsttfdd}|S)Ncs ||}|jr||S|Sr)rr)r>rqrZretvalrrrrXs  z'AbstractSandbox._mk_query..wraprrrrr _mk_queryUs zAbstractSandbox._mk_query)r)tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r>r rrr_validate_pathdszAbstractSandbox._validate_pathcOs ||SzCalled for path inputsrr> operationr rqrrrrrhszAbstractSandbox._remap_inputcCs ||S)zCalled for path outputsr)r>rr rrrrlszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)?Called for path pairs like rename, link, and symlink operationsz-fromz-to)rr>rrrrqrrrrrpszAbstractSandbox._remap_pair)N)r7r8r9r:rrir~r?rDrrrvruryrrrrrrrrrrrrrrrs<          devnullc@seZdZdZedddddddd d d d d dg ZdgZefddZ ddZ e rXd'ddZ d(ddZ ddZ ddZddZdd Zd!d"Zd)d$d%Zd&S)*r z.) r(r rr_sandboxrW_prefix _exceptionsrri)r>Zsandbox exceptionsrrrris zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r )r1r )r>rrqrr rrr _violations zDirectorySandbox._violationrcOs:|dkr(||s(|jd||f||t||f||S)NrZrtr ZrUUr)_okrrr>r rrqrrrrrszDirectorySandbox._filecOs:|dkr(||s(|jd||f||t||f||S)Nrr)rrrrrrrrszDirectorySandbox._opencCs|ddS)Nr)rr=rrrrszDirectorySandbox.tmpnamcCsR|j}z>d|_tjtj|}||p@||jkp@||jWS||_XdSr) rr(r rr _exemptedrrIr)r>r Zactiverrrrrs  zDirectorySandbox._okcs<fdd|jD}fdd|jD}t||}t|S)Nc3s|]}|VqdSrrH)rJZ exceptionfilepathrrrLsz-DirectorySandbox._exempted..c3s|]}t|VqdSr)r\r^)rJr_rrrrLs)r_exception_patterns itertoolschainany)r>rZ start_matchesZpattern_matchesZ candidatesrrrrs   zDirectorySandbox._exemptedcOs4||jkr0||s0|j|tj|f|||Sr) write_opsrrr(r rrrrrrszDirectorySandbox._remap_inputcOs2||r||s*|j|||f||||fS)r)rrrrrrrszDirectorySandbox._remap_paircOs@|t@r*||s*|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open) WRITE_FLAGSrrryr)r>rflagsrrqrrrrrszDirectorySandbox.openN)r)r)r)r7r8r9r:rofromkeysrr _EXCEPTIONSrirrrrrrrrrrrrrr ~s:     cCsg|]}tt|dqS)rr)rJarrrrwsrwz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZedZddZdS)r zEA setup script attempted to modify the filesystem outside the sandboxa SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs|j\}}}|jjftSr)rqtmplformatr)r>cmdrqkwargsrrr__str__s zSandboxViolation.__str__N) r7r8r9r:textwrapdedentlstriprrrrrrr s )N)N)=r(rr&operator functoolsrr\ contextlibr.rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr$platformrIZ$org.python.modules.posix.PosixModulepythonrMposixZ PosixModuleryrvrr NameErrorrrZdistutils.errorsrr__all__rcontextmanagerrr"r'r,r0r-r<rRrPrVr[r`rXr rrurrr reduceor_splitrr rrrrsx                w  VPK!\h+__pycache__/py33compat.cpython-38.opt-1.pycnu[U Qab2@sddlZddlZddlZz ddlZWnek r<dZYnXddlmZddlmZe Z e ddZ GdddZ eede Zeed dZedkrejZdS) N)six) html_parserOpArgz opcode argc@seZdZddZddZdS)Bytecode_compatcCs ||_dS)N)code)selfrr9/usr/lib/python3.8/site-packages/setuptools/py33compat.py__init__szBytecode_compat.__init__ccstd|jj}t|jj}d}d}||kr||}|tjkr||d||dd|}|d7}|tjkrtjd}||d}q$n d }|d7}t ||Vq$d S) z>Yield '(op,arg)' pair for each operation in code object 'code'briN) arrayrco_codelendisZ HAVE_ARGUMENTZ EXTENDED_ARGrZ integer_typesr)rbyteseofZptrZ extended_argopargZ long_typerrr __iter__s       zBytecode_compat.__iter__N)__name__ __module__ __qualname__r rrrrr rsrBytecodeunescape)rr collectionsZhtml ImportErrorZsetuptools.externrZsetuptools.extern.six.movesrtypeZ __metaclass__ namedtuplerrgetattrrrZ HTMLParserrrrr s     "  PK!ĺ<<"__pycache__/sandbox.cpython-38.pycnu[U Qab7@s ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejdrddlmmmmZn ejejZzeZWnek rdZYnXeZddlm Z ddlm!Z!ddd d gZ"d-d d Z#ej$d.d dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d Z2Gd&ddZ3e4ed'rej5gZ6ngZ6Gd(dde3Z7e8ej9d)d*d+:DZ;Gd,d d e Zr4r5tbrrr__exit__{s zExceptionSaver.__exit__cCs6dt|krdSttj|j\}}t|||jdS)z"restore and re-raise any exceptionrAN)varsrr.loadsrArZreraiserB)r>r4r5rrrresumes zExceptionSaver.resumeN)r7r8r9r:r?rDrGrrrrr<rs r<c #sVtjt }VW5QRXtjfddtjD}t||dS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. c3s$|]}|kr|ds|VqdS)z encodings.N startswith).0mod_namer!rr s zsave_modules..N)rmodulescopyr<update_clear_modulesrG) saved_excZ del_modulesrr!r save_moduless   rRcCst|D] }tj|=qdSr)listrrM)Z module_namesrKrrrrPs rPc cs$t}z |VW5t|XdSr)r$ __getstate__ __setstate__r!rrrsave_pkg_resources_states rVccstj|d}txtfttNt<t|(t |t ddVW5QRXW5QRXW5QRXW5QRXW5QRXW5QRXdS)NZtempZ setuptools) r(r joinrVrRhide_setuptoolsr"rr'r, __import__) setup_dirZtemp_dirrrr setup_contexts  r[cCstd}t||S)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rKpatternrrr _needs_hidings r`cCstttj}t|dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N)filterr`rrMrP)rMrrrrXs rXc Cstjtj|}t|z|gt|tjdd<tjd|t t j ddt |trl|n |t}t|t|dd}t||W5QRXWn4tk r}z|jr|jdrʂW5d}~XYnXW5QRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|Sr)Zactivate)Zdistrrrzrun_setup..__main__)__file__r7)r(r abspathdirnamer[rSrrinsertr__init__Z callbacksappend isinstancestrencodegetfilesystemencodingr dictr SystemExitargs)Z setup_scriptrqrZZ dunder_filensvrrrr s"    c@seZdZdZdZddZddZddZd d Zd d Z d dZ dD]Z e e e rDe e ee <qDd$ddZerzedeZedeZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZddZd d!Zd"d#ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs$g|]}|dst|r|qS)_)rIhasattr)rJnamer=rr s z,AbstractSandbox.__init__..)dir_os_attrsr=rr=rris zAbstractSandbox.__init__cCs"|jD]}tt|t||qdSr)rzsetattrr(getattr)r>sourcervrrr_copy s zAbstractSandbox._copycCs(||tr|jt_|jt_d|_dSr@)r~_filerfile_openr_activer=rrrr?s  zAbstractSandbox.__enter__cCs$d|_trtt_tt_|tdSNF)rrrrrrr~ry)r>exc_type exc_value tracebackrrrrDs zAbstractSandbox.__exit__c Cs"||W5QRSQRXdS)zRun 'func' under os sandboxingNr)r>funcrrrrunszAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||Sr)r _remap_pair)r>srcdstrqkwrvoriginalrrwrap&sz3AbstractSandbox._mk_dual_path_wrapper..wrapr|ryrvrrrr_mk_dual_path_wrapper#s z%AbstractSandbox._mk_dual_path_wrapper)renamelinksymlinkNcs p ttfdd}|S)Ncs*|jr|j|f||}|f||Sr)r _remap_inputr>r rqrrrrr4sz5AbstractSandbox._mk_single_path_wrapper..wrapr)rvrrrrr_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperrr)statlistdirr*rchmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}||f||S|f||Sr)rr _remap_outputrrrrrIsz4AbstractSandbox._mk_single_with_return..wraprrrrr_mk_single_with_returnFs z&AbstractSandbox._mk_single_with_return)readlinktempnamcsttfdd}|S)Ncs ||}|jr||S|Sr)rr)r>rqrZretvalrrrrXs  z'AbstractSandbox._mk_query..wraprrrrr _mk_queryUs zAbstractSandbox._mk_query)r)tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r>r rrr_validate_pathdszAbstractSandbox._validate_pathcOs ||SzCalled for path inputsrr> operationr rqrrrrrhszAbstractSandbox._remap_inputcCs ||S)zCalled for path outputsr)r>rr rrrrlszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)?Called for path pairs like rename, link, and symlink operationsz-fromz-to)rr>rrrrqrrrrrpszAbstractSandbox._remap_pair)N)r7r8r9r:rrir~r?rDrrrvruryrrrrrrrrrrrrrrrs<          devnullc@seZdZdZedddddddd d d d d dg ZdgZefddZ ddZ e rXd'ddZ d(ddZ ddZ ddZddZdd Zd!d"Zd)d$d%Zd&S)*r z.) r(r rr_sandboxrW_prefix _exceptionsrri)r>Zsandbox exceptionsrrrris zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r )r1r )r>rrqrr rrr _violations zDirectorySandbox._violationrcOs:|dkr(||s(|jd||f||t||f||S)NrZrtr ZrUUr)_okrrr>r rrqrrrrrszDirectorySandbox._filecOs:|dkr(||s(|jd||f||t||f||S)Nrr)rrrrrrrrszDirectorySandbox._opencCs|ddS)Nr)rr=rrrrszDirectorySandbox.tmpnamcCsR|j}z>d|_tjtj|}||p@||jkp@||jWS||_XdSr) rr(r rr _exemptedrrIr)r>r Zactiverrrrrs  zDirectorySandbox._okcs<fdd|jD}fdd|jD}t||}t|S)Nc3s|]}|VqdSrrH)rJZ exceptionfilepathrrrLsz-DirectorySandbox._exempted..c3s|]}t|VqdSr)r\r^)rJr_rrrrLs)r_exception_patterns itertoolschainany)r>rZ start_matchesZpattern_matchesZ candidatesrrrrs   zDirectorySandbox._exemptedcOs4||jkr0||s0|j|tj|f|||Sr) write_opsrrr(r rrrrrrszDirectorySandbox._remap_inputcOs2||r||s*|j|||f||||fS)r)rrrrrrrszDirectorySandbox._remap_paircOs@|t@r*||s*|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open) WRITE_FLAGSrrryr)r>rflagsrrqrrrrrszDirectorySandbox.openN)r)r)r)r7r8r9r:rofromkeysrr _EXCEPTIONSrirrrrrrrrrrrrrr ~s:     cCsg|]}tt|dqS)rr)rJarrrrwsrwz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZedZddZdS)r zEA setup script attempted to modify the filesystem outside the sandboxa SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs|j\}}}|jjftSr)rqtmplformatr)r>cmdrqkwargsrrr__str__s zSandboxViolation.__str__N) r7r8r9r:textwrapdedentlstriprrrrrrr s )N)N)=r(rr&operator functoolsrr\ contextlibr.rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr$platformrIZ$org.python.modules.posix.PosixModulepythonrMposixZ PosixModuleryrvrr NameErrorrrZdistutils.errorsrr__all__rcontextmanagerrr"r'r,r0r-r<rRrPrVr[r`rXr rrurrr reduceor_splitrr rrrrsx                w  VPK!C33#__pycache__/dep_util.cpython-38.pycnu[U Qab@sddlmZddZdS)) newer_groupcCsht|t|krtdg}g}tt|D]2}t||||r,||||||q,||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)Zsources_groupsZtargetsZ n_sourcesZ n_targetsir7/usr/lib/python3.8/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr N)Zdistutils.dep_utilrr rrrr s PK!>T/__pycache__/_deprecation_warning.cpython-38.pycnu[U Qab@sGdddeZdS)c@seZdZdZdS)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. N)__name__ __module__ __qualname____doc__rrC/usr/lib/python3.8/site-packages/setuptools/_deprecation_warning.pyrsrN)WarningrrrrrPK!\h%__pycache__/py33compat.cpython-38.pycnu[U Qab2@sddlZddlZddlZz ddlZWnek r<dZYnXddlmZddlmZe Z e ddZ GdddZ eede Zeed dZedkrejZdS) N)six) html_parserOpArgz opcode argc@seZdZddZddZdS)Bytecode_compatcCs ||_dS)N)code)selfrr9/usr/lib/python3.8/site-packages/setuptools/py33compat.py__init__szBytecode_compat.__init__ccstd|jj}t|jj}d}d}||kr||}|tjkr||d||dd|}|d7}|tjkrtjd}||d}q$n d }|d7}t ||Vq$d S) z>Yield '(op,arg)' pair for each operation in code object 'code'briN) arrayrco_codelendisZ HAVE_ARGUMENTZ EXTENDED_ARGrZ integer_typesr)rbyteseofZptrZ extended_argopargZ long_typerrr __iter__s       zBytecode_compat.__iter__N)__name__ __module__ __qualname__r rrrrr rsrBytecodeunescape)rr collectionsZhtml ImportErrorZsetuptools.externrZsetuptools.extern.six.movesrtypeZ __metaclass__ namedtuplerrgetattrrrZ HTMLParserrrrr s     "  PK!b'/ __pycache__/glibc.cpython-38.pycnu[U QabJ @sHddlmZddlZddlZddlZddZddZddZd d ZdS) )absolute_importNcCsRtd}z |j}Wntk r*YdSXtj|_|}t|tsN|d}|S)z9Returns glibc version string, or None if not using glibc.Nascii) ctypesZCDLLgnu_get_libc_versionAttributeErrorZc_char_pZrestype isinstancestrdecode)Zprocess_namespacer version_strr 4/usr/lib/python3.8/site-packages/setuptools/glibc.pyglibc_version_string s    r cCsHtd|}|s$td|tdSt|d|koFt|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFmajorminor)rematchwarningswarnRuntimeWarningintgroup)r required_major minimum_minormr r r check_glibc_version$s rcCst}|dkrdSt|||S)NF)r r)rrr r r r have_compatible_glibc4srcCst}|dkrdSd|fSdS)zTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. N)rZglibc)r )Z glibc_versionr r r libc_verLsr) Z __future__rrrrr rrrr r r r s PK!ߧ} %__pycache__/dist.cpython-38.opt-1.pycnu[U Qab@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl m Z ddlmZddlmZddlZddlmZddlmZddlmZmZmZdd l mZdd lmZdd lmZdd lm Z dd lm!Z!ddl"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-ddl.m/Z/ddl0Z0e1de1dddZ2ddZ3ddZ4ddZ5e6e7fZ8dd Z9d!d"Z:d#d$Z;d%d&Zd+d,Z?d-d.Z@d/d0ZAd1d2ZBd3d4ZCd5d6ZDe-ejEjFZGGd7ddeGZFGd8d9d9ZHGd:d;d;e'ZIdS)< DistributionN) strtobool)DEBUGtranslate_longopt) defaultdict)message_from_file)DistutilsOptionErrorDistutilsPlatformErrorDistutilsSetupError) rfc822_escape) StrictVersion)six) packaging) ordered_set)mapfilter filterfalse)SetuptoolsDeprecationWarning)Require)windows_support) get_unpatched)parse_configurationz&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr3/usr/lib/python3.8/site-packages/setuptools/dist.py_get_unpatched-s r cCst|dd}|dkr|js |jr*td}nd|jdk sT|jdk sTt|dddk sT|jr^td}n0|js||js||j s||j s||j rtd}ntd}||_ |S)Nmetadata_versionz2.1python_requires1.21.1z1.0) getattrlong_description_content_typeprovides_extrasr maintainermaintainer_email project_urlsprovidesrequires obsoletes classifiers download_urlr!)selfZmvrrrget_metadata_version2s*      r1cs t|fdd}fdd}td|_|d|_|d|_|d|_|d |_d |_|d |_d |_ |d |_ |d |_ dkr|d|_ nd |_ |d|_ |d|_dkr|dd|_|d|_|d|_|jtdkr |d|_|d|_|d|_nd |_d |_d |_d S)z-Reads the metadata values from a file object.cs|}|dkrdS|S)NZUNKNOWNr)namevaluemsgrr _read_fieldLsz"read_pkg_file.._read_fieldcs|d}|gkrdS|SN)Zget_all)r2valuesr4rr _read_listRs z!read_pkg_file.._read_listzmetadata-versionr2versionZsummaryauthorNz author-emailz home-pagelicensez download-url descriptionkeywords,platformZ classifierr$r,r+r-)rr r!r2r:r=r;r( author_emailr)Zurlr<r/Zlong_descriptionsplitr>Z platformsr.r,r+r-)r0filer6r9rr4r read_pkg_fileHs:                 rDc s}tjrfdd}n fdd}|dt||d|d|d|d|td kr|d  |d  n.d }|D]$\}}t |}|d k r|||q|d j r|dj jD]}|dd|qt} |d| d} | r:|d| |td krdD]} |d| qPndddddtdr|djjr|djjr jD]} |d| qd S)z5Write the PKG-INFO format data to a file object. csd||fdSNz%s: %s )writeZ _encode_fieldkeyr3rCr0rr write_fieldsz#write_pkg_file..write_fieldcsd||fdSrE)rFrG)rCrrrJszMetadata-VersionNameVersionZSummaryz Home-pager#Author Author-email))rMr;)rNrA)Z Maintainerr()zMaintainer-emailr)NZLicensez Download-URLz Project-URLz%s, %sZ Descriptionr?ZKeywordsZPlatformZ ClassifierZRequiresZProvidesZ Obsoletesr"zRequires-PythonzDescription-Content-TypezProvides-Extra)r1rPY2strZget_nameZ get_versionZget_descriptionZget_urlr Z get_contactZget_contact_emailr%Z get_licenser/r*itemsr Zget_long_descriptionjoinZ get_keywordsZ get_platformsZ _write_listZget_classifiersZ get_requiresZ get_providesZ get_obsoleteshasattrr"r&r') r0rCr:rJZoptional_fieldsZfieldattrZattr_valZ project_urlZ long_descr>r@extrarrIrwrite_pkg_file~sZ             rVc CsFztjd|}Wn,ttttfk r@td||fYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r)) pkg_resources EntryPointparse TypeError ValueErrorAttributeErrorAssertionErrorr )distrTr3eprrrcheck_importablesr`c Cs6zWn,ttttfk r0td||fYnXdS)z"Verify that value is a string listz%%r must be a list of strings (got %r)N)rZr[r\r]r r^rTr3rrrassert_string_lists  rbcCsd|}t||||D]J}||s2tdd||d\}}}|r||krtjd||qdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rbhas_contents_forr rpartition distutilslogr)r^rTr3Z ns_packagesZnspparentsepZchildrrr check_nsps    rjc Cs@zttt|Wn"tttfk r:tdYnXdS)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N) list itertoolsstarmap _check_extrarQrZr[r\r rarrr check_extrass rocCs<|d\}}}|r*t|r*td|tt|dS)N:zInvalid environment marker: ) partitionrWZinvalid_markerr rkparse_requirements)rUZreqsr2rimarkerrrrrns rncCs&t||kr"d}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rTr3N)boolr format)r^rTr3tmplrrr assert_bool s rwc Csjz(tt|t|ttfr&tdWn<ttfk rd}zd}t|j ||dW5d}~XYnXdS)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rTerrorN) rkrWrr isinstancedictsetrZr[r rur^rTr3ryrvrrrcheck_requirementss r~c CsRztj|Wn<tjjk rL}zd}t|j||dW5d}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rxN)rZ specifiersZ SpecifierSetZInvalidSpecifierr rur}rrrcheck_specifier s rc Cs@ztj|Wn*tk r:}z t|W5d}~XYnXdS)z)Verify that entry_points map is parseableN)rWrXZ parse_mapr[r )r^rTr3errrcheck_entry_points,srcCst|tjstddS)Nztest_suite must be a string)rzr string_typesr rarrrcheck_test_suite4s rcCs\t|tstd||D]6\}}t|tjsDtd||t|d||q dS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rzr{r rurQrrrb)r^rTr3kvrrrcheck_package_data9s  rcCs(|D]}td|stjd|qdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrfrgr)r^rTr3Zpkgnamerrrcheck_packagesHs  rc@sReZdZdZdeejdZdZddZ dMddZ dd Z d d Z e d d ZddZddZdNddZe ddZdOddZdPddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Z d3d4Z!d5d6Z"d7d8Z#d9d:Z$d;d<Z%d=d>Z&d?d@Z'dAdBZ(dCdDZ)dEdFZ*dGdHZ+dIdJZ,dKdLZ-dS)QraDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. N)r&r*r'cCsl|rd|ksd|krdStt|d}tjj|}|dk rh|dshtt|d|_ ||_ dS)Nr2r:zPKG-INFO) rWZ safe_namerPlower working_setZby_keygetZ has_metadataZ safe_versionZ_version _patched_dist)r0attrsrHr^rrrpatch_missing_pkg_infosz#Distribution.patch_missing_pkg_infoc std}|si_|pi}d|ks,d|kr4tg_i_g_|dd_ ||dg_ |dg_ t dD]}t|jdqtfdd |DjD]L\}}jj|fD]}||kr||}qq|r|nd}tj||qtjjtjr4tjjj_jjdk rzHtjjj}t|} jj| krt d jj| f| j_Wn0tjj!t"fk rt d jjYnX#dS) N package_datafeaturesrequire_featuressrc_rootdependency_linkssetup_requiresdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA.0rrr0rr s z)Distribution.__init__..zNormalizing '%s' to '%s'zThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)$rSrFeaturewarn_deprecatedrrZ dist_filespoprrrrrWiter_entry_pointsvars setdefaultr2 _Distribution__init__rQrmetadata__dict__setattrrzr:numbersNumberrPrrLrrZInvalidVersionrZ_finalize_requires) r0rZhave_package_datar_optiondefaultsourcer3ZverZnormalized_versionrrrrs\    zDistribution.__init__cCsft|ddr|j|j_t|ddrR|jD]$}|dd}|r,|jj|q,|| dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. r"Nextras_requirerpr) r%r"rrkeysrBr'add_convert_extras_requirements"_move_install_requirements_markers)r0rUrrrrs   zDistribution._finalize_requirescCsht|ddpi}tt|_|D]@\}}|j|t|D]"}||}|j|||q>q"dS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r%rrk_tmp_extras_requirerQrWrr _suffix_forappend)r0Z spec_ext_reqssectionrrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rp)rsrPreqrrrr szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_|D]}j dt|j  |qNt fddj D_dS) zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j Sr7rsrrrr is_simple_reqszFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrpc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rPrrrrr )szMDistribution._move_install_requirements_markers...N)r _clean_reqrrrr (szBDistribution._move_install_requirements_markers..)r%rkrWrrrrrrPrrrsrr{rQr)r0rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrrrrrs    z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. Nr)r0rrrrr-szDistribution._clean_reqc Csddlm}tjr>tjtjkr>ddddddd d d d d ddg }ng}t|}|dkrZ|}t rh| d|}|D]}t j |dd4}t r| dj fttjr|jn|j|W5QRX|D]\}||}||} |D]>} | dkr| |kr|||| } | dd} || f| | <qq|qrd|jkr|jdD]\} \} } |j| } zF| r|t|| t|  n(| dkrt|| t| n t|| | Wn,tk r}z t|W5d}~XYnXqHdS)z Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r) ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8)encodingz reading {filename}__name__-_global)verboseZdry_run)Z(setuptools.extern.six.moves.configparserrrPY3sysr base_prefix frozensetZfind_config_filesrannounceioopenrulocalsZ read_fileZreadfpZsectionsoptionsget_option_dict_try_strrreplacercommand_optionsrQ negative_optrrr[r )r0 filenamesrZignore_optionsparserfilenamereaderrrZopt_dictoptvalsrcaliasr5rrr_parse_config_files4s`           z Distribution._parse_config_filescCs.tjr |Sz |WStk r(YnX|S)ab On Python 2, much of distutils relies on string values being of type 'str' (bytes) and not unicode text. If the value can be safely encoded to bytes using the default encoding, prefer that. Why the default encoding? Because that value can be implicitly decoded back to text if needed. Ref #1653 )rrencodeUnicodeEncodeError)rrrrrrs  zDistribution._try_strc Cs^|}|dkr||}tr,|d||D]"\}\}}trZ|d|||fzdd|jD}Wntk rg}YnXz |j}Wntk ri}YnXz~t|t j } ||kr| rt |||t | nJ||kr| rt ||t |n,t ||rt |||ntd|||fWq4tk rV} z t| W5d} ~ XYq4Xq4dS)a Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) Nz# setting options for '%s' command:z %s = %s (from %s)cSsg|] }t|qSrr)rorrrrsz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')Zget_command_namerrrrQZboolean_optionsr\rrzrrrrrSr r[) r0Z command_objZ option_dictZ command_namerrr3Z bool_optsneg_optZ is_stringr5rrr_set_command_optionssF           z!Distribution._set_command_optionsFcCs(|j|dt||j|d|dS)zYParses configuration files from various levels and loads configuration. )r)ignore_option_errorsN)rrrr)r0rrrrrparse_config_filess  zDistribution.parse_config_filescCst|}|jr||S)z3Process features after parsing command line options)rparse_command_liner_finalize_features)r0resultrrrrs zDistribution.parse_command_linecCsd|ddS)z;Convert feature name to corresponding option attribute nameZwith_rrrr0r2rrr_feature_attrnameszDistribution._feature_attrnamecCs8tjjt||jdd}|D]}tjj|ddq|S)zResolve pre-setup requirementsT) installerZreplace_conflictingr)rWrresolverrfetch_build_eggr)r0r,Zresolved_distsr^rrrfetch_build_eggsszDistribution.fetch_build_eggscCst||jr|tdD]:}t||jd}|dk r"|j|j d| ||j|q"t|ddr~dd|j D|_ ng|_ dS)Nrrconvert_2to3_doctestscSsg|]}tj|qSr)ospathabspathrprrrrsz1Distribution.finalize_options..) rfinalize_optionsr_set_global_opts_from_featuresrWrr%r2requirerloadr)r0r_r3rrrrs   zDistribution.finalize_optionsc Csvtjtjd}tj|srt|t|tj|d}t|d$}| d| d| dW5QRX|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) rrrRcurdirexistsmkdirrZ hide_filerrF)r0Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirs      zDistribution.get_egg_cache_dirc Csddlm}|ddgi}|d}||dd|dD|jr|jdd}d|krx|dd |}d |f|d<|}||d g|d d dd d d d d d }| ||S)z Fetch an egg needed for buildingr) easy_installZ script_argsrcss"|]\}}|dkr||fVqdS)) find_links site_dirsZ index_urloptimizer Z allow_hostsNrrrrrrsz/Distribution.fetch_build_egg..NrrZsetupxTF) args install_dirZexclude_scriptsZ always_copyZbuild_directoryZeditableZupgradeZ multi_versionZ no_reportr) Zsetuptools.command.easy_installr __class__rclearupdaterQrrZensure_finalized)r0rrr^optsZlinksr cmdrrrrs8     zDistribution.fetch_build_eggc Csg}|j}|jD]\}}||d|||jr|j}d}d}|s\||}}d|dd||fd|dd||ff}| |d||d|<q||j |_ |_ ||_|_ dS)z;Add --with-X/--without-X options based on optional featuresNz (default)rzwith-zinclude zwithout-zexclude ) rcopyrrQ _set_featurevalidateoptionalr=include_by_defaultextendglobal_optionsZfeature_optionsZfeature_negopt) r0ZgoZnor2featuredescrZincdefZexcdefnewrrrrs$     z+Distribution._set_global_opts_from_featurescCs|jD]<\}}||}|s0|dkr |r ||||dq |jD](\}}||sR||||dqRdS)z9Add/remove features and resolve dependencies between themNrr)rrQfeature_is_includedr include_inr exclude_from)r0r2rZenabledrrrr0s    zDistribution._finalize_featurescCs\||jkr|j|Std|}|D]*}|j|jd||j|<}|St||S)z(Pluggable version of get_command_class()distutils.commandsrN)cmdclassrWrrrrrget_command_class)r0commandZepsr_r!rrrr"As   zDistribution.get_command_classcCs:tdD]$}|j|jkr |}||j|j<q t|SNr )rWrr2r!rrprint_commandsr0r_r!rrrr%Ns  zDistribution.print_commandscCs:tdD]$}|j|jkr |}||j|j<q t|Sr$)rWrr2r!rrget_command_listr&rrrr'Vs  zDistribution.get_command_listcCst||||dS)zSet feature's inclusion statusN)rr)r0r2Zstatusrrrr^szDistribution._set_featurecCst|||S)zAReturn 1 if feature is included, 0 if excluded, 'None' if unknown)r%rrrrrrbsz Distribution.feature_is_includedcCsF||dkr&|j|j}t|d|j||||ddS)z)Request inclusion of feature named 'name'rz2 is required, but was excluded or is not availablerN)rrr=r rr)r0r2rrrrinclude_featurefs zDistribution.include_featurecKs@|D]2\}}t|d|d}|r.||q|||qdS)aAdd items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. Z _include_N)rQr% _include_misc)r0rrrincluderrrr*qs  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagerccs"g|]}|kr|s|qSr startswithrpackagepfxrrrs z0Distribution.exclude_package..cs"g|]}|kr|s|qSrr+rr-rrrs cs&g|]}|jkr|js|qSr)r2r,rr-rrrs N)packages py_modules ext_modules)r0r.rr-rexclude_packages   zDistribution.exclude_packagecCs2|d}|D]}||ks&||rdSqdS)z.rzsequencer r%r\r)r0r2r3oldrr9r _exclude_miscs    zDistribution._exclude_misccst|tstd||fzt||Wn tk rHtd|YnXdkr`t|||n:ttsxt|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)r5Nr6csg|]}|kr|qSrrr7r<rrrsz.Distribution._include_misc..r:)r0r2r3rrr>rr)s$    zDistribution._include_misccKs@|D]2\}}t|d|d}|r.||q|||qdS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. Z _exclude_N)rQr%r=)r0rrrexcluderrrr?s  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rzr;r rkrr3)r0r0rrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|d}||krf||\}}||=ddl}||d|dd<|d}q&t|||}||} t | ddrd|f||d<|dk rgS|S)NraliasesTrZcommand_consumes_arguments command liner ) rrrrshlexrBr_parse_command_optsr"r%) r0rr r#rArrrCnargsZ cmd_classrrrrDs"       z Distribution._parse_command_optsc Csi}|jD]\}}|D]\}\}}|dkr4q|dd}|dkr||}|j}|t|di|D]\} } | |krv| }d}qqvtdn |dkrd}|| |i|<qq|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. rBrrrrNzShouldn't be able to get herer) rrQrZget_command_objrrrr%r]r) r0drrrrrZcmdobjrnegposrrrget_cmdline_optionss(     z Distribution.get_cmdline_optionsccsv|jpdD] }|Vq |jpdD] }|Vq |jp4dD]:}t|trN|\}}n|j}|drj|dd}|Vq6dS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)r0r1r2rztupler2endswith)r0ZpkgrJZextr2Z buildinforrrr40s    z$Distribution.iter_distribution_namesc Csddl}tjs|jr t||St|jtj s:t||S|jj dkrVt||S|jj }|jj }|j dkrtdpvd}|jj}t |jd||||_zt||WSt |j|||||_XdS)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rN)rutf8Zwin32 r)rrrOZ help_commandsrhandle_display_optionsrzstdoutr TextIOWrapperrrerrorsr@line_bufferingdetach)r0Z option_orderrrrRnewlinerSrrrrOBs6    z#Distribution.handle_display_options)N)N)N)NF).r __module__ __qualname____doc__r{rZ OrderedSetrrrrrr staticmethodrrrrrrrrrrrrrrrr"r%r'rrr(r*r3rdr=r)r?r@rDrIr4rOrrrrrTsXD ;  >  /     (c@sFeZdZdZeddZdddZd d Zd d Zd dZ ddZ dS)ra **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCsd}tj|tdddS)NzrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.) stacklevel)rrrr4rrrrszFeature.warn_deprecatedFTrc Ks|||_||_||_||_t|ttfr4|f}dd|D|_dd|D}|r^||d<t|trn|f}||_ ||_ |s|s|st ddS)NcSsg|]}t|tr|qSrrzrPrrrrrs z$Feature.__init__..cSsg|]}t|ts|qSrr\rrrrrs rzgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.) rr=standard availablerrzrPrrremoveextrasr ) r0r=r]r^rrr_r`Zerrrrrs*  zFeature.__init__cCs |jo |jS)z+Should this feature be included by default?)r^r]rrrrrszFeature.include_by_defaultcCs<|jst|jd|jf|j|jD]}||q(dS)aEnsure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. z3 is required, but is not available on this platformN)r^r r=r*r`rr()r0r^rrrrrs  zFeature.include_incCs.|jf|j|jr*|jD]}||qdS)a2Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. N)r?r`r_r3r0r^r8rrrrs  zFeature.exclude_fromcCs.|jD]"}||std|j||fqdS)aVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. zg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN)r_rdr r=rarrrrs   zFeature.validateN)FTTrr) rrVrWrXrYrrrrrrrrrrres8  rc@seZdZdZdS)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rrVrWrXrrrrrsr)J__all__rrrrrrZ distutils.logrfZdistutils.coreZ distutils.cmdZdistutils.distZdistutils.utilrZdistutils.debugrZdistutils.fancy_getoptrrl collectionsrZemailrZdistutils.errorsr r r r Zdistutils.versionr Zsetuptools.externrrrZsetuptools.extern.six.movesrrrrrZsetuptools.dependsrZ setuptoolsrZsetuptools.monkeyrZsetuptools.configrrW __import__r r1rDrVrKrkr;r`rbrjrornrwr~rrrrrZcorerrrrrrrrsv               6L    PK!$$(__pycache__/version.cpython-38.opt-1.pycnu[U Qab@s6ddlZzedjZWnek r0dZYnXdS)NZ setuptoolsunknown)Z pkg_resourcesZget_distributionversion __version__ Exceptionrr6/usr/lib/python3.8/site-packages/setuptools/version.pysPK!ϚϚ%__pycache__/msvc.cpython-38.opt-1.pycnu[U Qab@sXdZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl Z ddl Z ddlZddlZddlmZddlmZdd lmZe d krdd lmZdd lmZnGd ddZeZeejjfZzddlm Z Wnek rYnXddZ!d$ddZ"ddZ#ddZ$d%ddZ%GdddZ&GdddZ'Gd d!d!Z(Gd"d#d#Z)dS)&a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname) LegacyVersion) filterfalse) get_unpatchedWindows)winreg)environc@seZdZdZdZdZdZdS)rN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr3/usr/lib/python3.8/site-packages/setuptools/msvc.pyr*sr)Regc Csd}|d|f}zt|d}WnJtk rjz|d|f}t|d}Wntk rdd}YnXYnX|rt|d}t|r|Stt|S)a Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython / Microsoft Visual C++ Compiler for Python 2.7). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ str vcvarsall.bat path z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f installdirz Wow6432Node\Nz vcvarsall.bat)rZ get_valueKeyErrorrrr msvc9_find_vcvarsall)versionZvc_basekey productdir vcvarsallrrrrAs   rx86c Osztt}|||f||WStjjk r4Yntk rFYnXzt||WStjjk r}zt|||W5d}~XYnXdS)ao Patched "distutils.msvc9compiler.query_vcvarsall" for support extra Microsoft Visual C++ 9.0 and 10.0 compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ dict environment N) r msvc9_query_vcvarsall distutilserrorsDistutilsPlatformError ValueErrorEnvironmentInfo return_env_augment_exception)verarchargskwargsZorigexcrrrr#ks r#c Csrztt|WStjjk r&YnXzt|ddWStjjk rl}zt|dW5d}~XYnXdS)a* Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment ,@) vc_min_verN)r msvc14_get_vc_envr$r%r&r(r)r*)Z plat_specr/rrrr2s r2cOsBdtjkr4ddl}t|jtdkr4|jjj||Stt ||S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesZnumpyr __version__r$Z ccompilerZgen_lib_optionsr msvc14_gen_lib_options)r-r.Znprrrr6s  r6rcCs|jd}d|ks"d|krd}|jft}d}|dkrf|ddkr\|d 7}q|d 7}n.|d kr|d 7}||d 7}n|dkr|d7}|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rr!zvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%d"@Zia64z( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW r0z[ Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/N)r-lowerformatlocalsfind)r/rr,messageZtmplZ msdownloadrrrr*s   r*c@sbeZdZdZeddZddZe ddZ dd Z d d Z dd dZ dddZdddZdS) PlatformInfoz Current and Target Architectures information. Parameters ---------- arch: str Target architecture. Zprocessor_architecturercCs|dd|_dS)Nx64amd64)r:replacer,)selfr,rrr__init__szPlatformInfo.__init__cCs|j|jdddS)zs Return Target CPU architecture. Return ------ str Target CPU _r N)r,r=rCrrr target_cpus zPlatformInfo.target_cpucCs |jdkS)z Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r"rGrFrrr target_is_x86s zPlatformInfo.target_is_x86cCs |jdkS)z Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r" current_cpurFrrrcurrent_is_x86s zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ str subfolder: ' arget', or '' (see hidex86 parameter) r"rrA\x64\%srJrChidex86r@rrr current_dirszPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) r"rrArMrNrHrOrrr target_dir(szPlatformInfo.target_dircCs0|rdn|j}|j|krdS|dd|S)ap Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. r"r\z\%s_)rKrGrRrB)rCforcex86Zcurrentrrr cross_dir>szPlatformInfo.cross_dirN)FF)FF)F)rrr__doc__rgetr:rKrDpropertyrGrIrLrQrRrUrrrrr?s    r?c@seZdZdZejejejejfZ ddZ e ddZ e ddZ e dd Ze d d Ze d d Ze ddZe ddZe ddZe ddZdddZddZdS) RegistryInfoz Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dSN)pi)rCZ platform_inforrrrDcszRegistryInfo.__init__cCsdS)z Microsoft Visual Studio root registry key. Return ------ str Registry key Z VisualStudiorrFrrr visualstudiofs zRegistryInfo.visualstudiocCs t|jdS)z Microsoft Visual Studio SxS registry key. Return ------ str Registry key ZSxS)rr\rFrrrsxsrs zRegistryInfo.sxscCs t|jdS)z| Microsoft Visual C++ VC7 registry key. Return ------ str Registry key ZVC7rr]rFrrrvc~s zRegistryInfo.vccCs t|jdS)z Microsoft Visual Studio VS7 registry key. Return ------ str Registry key ZVS7r^rFrrrvss zRegistryInfo.vscCsdS)z Microsoft Visual C++ for Python registry key. Return ------ str Registry key zDevDiv\VCForPythonrrFrrr vc_for_pythons zRegistryInfo.vc_for_pythoncCsdS)zq Microsoft SDK registry key. Return ------ str Registry key zMicrosoft SDKsrrFrrr microsoft_sdks zRegistryInfo.microsoft_sdkcCs t|jdS)z Microsoft Windows/Platform SDK registry key. Return ------ str Registry key r rrbrFrrr windows_sdks zRegistryInfo.windows_sdkcCs t|jdS)z Microsoft .NET Framework SDK registry key. Return ------ str Registry key ZNETFXSDKrcrFrrr netfx_sdks zRegistryInfo.netfx_sdkcCsdS)z Microsoft Windows Kits Roots registry key. Return ------ str Registry key zWindows Kits\Installed RootsrrFrrrwindows_kits_rootss zRegistryInfo.windows_kits_rootsFcCs$|js|rdnd}td|d|S)a Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key rZ Wow6432NodeZSoftwareZ Microsoft)r[rLr)rCrr"Znode64rrr microsoftszRegistryInfo.microsoftc Cstj}tj}|j}|jD]}z||||d|}Wn`ttfk r|jsz||||dd|}Wqttfk rYYqYqXnYqYnXzt ||dWSttfk rYqXqdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value rTN) rKEY_READOpenKeyrgHKEYSOSErrorIOErrorr[rLZ QueryValueEx)rCrnameZkey_readZopenkeymshkeybkeyrrrlookups"   zRegistryInfo.lookupN)F)rrrrVrrrrrrjrDrXr\r]r_r`rarbrdrerfrgrqrrrrrYUs6         rYc@s<eZdZdZeddZeddZedeZd7ddZ d d Z d d Z d dZ e ddZeddZeddZddZddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Z d3d4Z!e d8d5d6Z"dS)9 SystemInfoz Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirr ProgramFileszProgramFiles(x86)NcCs2||_|jj|_||_|p$||_|_dSrZ)rir[find_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)rCZ registry_inforzrrrrDs    zSystemInfo.__init__cCs>|}|s|jstjdt|}||jt|dS)zm Find the latest VC version Return ------ float version z%No Microsoft Visual C++ version foundr8)find_reg_vs_versrwr$r%r&setupdatesorted)rCZ reg_vc_versZvc_versrrrrx%s   z(SystemInfo._find_latest_available_vs_verc Cs$|jj}|jj|jj|jjf}g}|jjD]}|D]}zt|||dtj}Wnt t fk rlYq2YnXt |\}}} t |D]D} z*t t|| d} | |kr|| Wqtk rYqXqt |D]B} z&t t|| } | |kr|| Wqtk rYqXqq2q*t|S)z Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions r)rurgr_rar`rjrrirhrkrlZ QueryInfoKeyrangefloatZ EnumValueappendr'ZEnumKeyr~) rCrnZvckeysZvs_versrorrpZsubkeysvaluesrEir+rrrr{8s2      zSystemInfo.find_reg_vs_versc Csi}d}z t|}Wnttfk r0|YSX|D]}z\t||d}t|ddd}t|}W5QRX|d}tt|d||||d<Wq6tttfk rYq6Yq6Xq6|S) z Find Visual studio 2017+ versions from information in "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances". Return ------ dict float version as key, path as value. z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz state.jsonZrtzutf-8)encodingZinstallationPath VC\Tools\MSVCZinstallationVersion) rrkrlrrjsonload_as_float_versionr) rCZ vs_versionsZ instances_dirZ hashed_namesrmZ state_pathZ state_filestateZvs_pathrrrrv[s*     z#SystemInfo.find_programdata_vs_verscCstd|dddS)z Return a string version as a simplified float version (major.minor) Parameters ---------- version: str Version. Return ------ float version .N)rrsplit)rrrrrszSystemInfo._as_float_versioncCs.t|jd|j}|j|jjd|jp,|S)zp Microsoft Visual Studio directory. Return ------ str path zMicrosoft Visual Studio %0.1f%0.1f)rProgramFilesx86ryrurqr`)rCdefaultrrr VSInstallDirs zSystemInfo.VSInstallDircCs,|p|}t|s(d}tj||S)zm Microsoft Visual C++ directory. Return ------ str path z(Microsoft Visual C++ directory not found) _guess_vc_guess_vc_legacyrr$r%r&)rCpathmsgrrr VCInstallDirs  zSystemInfo.VCInstallDirc Cs|jdkrdSz|j|j}Wntk r8|j}YnXt|d}z$t|d}|||_t||WStt t fk rYdSXdS)zl Locate Visual C++ for VS2017+. Return ------ str path r0rrr8N) ryrwrrrrrrzrkrl IndexError)rCZvs_dirZguess_vcrzrrrrs      zSystemInfo._guess_vccCsbt|jd|j}t|jjd|j}|j|d}|rBt|dn|}|j|jjd|jp`|S)z{ Locate Visual C++ for versions prior to 2017. Return ------ str path z Microsoft Visual Studio %0.1f\VCrrZVC)rrryrurarqr_)rCrZreg_pathZ python_vcZ default_vcrrrrs zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd krFd Sd S) z Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions r7)z7.0z6.1z6.0ar9)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar0)z10.0rNryrFrrrWindowsSdkVersions     zSystemInfo.WindowsSdkVersioncCs|t|jdS)zt Microsoft Windows SDK last version. Return ------ str version lib)_use_last_dir_namer WindowsSdkDirrFrrrWindowsSdkLastVersions z SystemInfo.WindowsSdkLastVersioncCs d}|jD],}t|jjd|}|j|d}|r q8q |rDt|stt|jjd|j}|j|d}|rtt|d}|rt|s|jD]6}|d|d}d |}t|j |}t|r|}q|rt|s|jD]$}d |}t|j |}t|r|}q|st|j d }|S) zn Microsoft Windows SDK directory. Return ------ str path rzv%sinstallationfolderrrZWinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZ PlatformSDK) rrrurdrqrrarzrfindrtr)rCsdkdirr+locrZ install_baseZintverdrrrr s6           zSystemInfo.WindowsSdkDirc Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d ||d d f}g}|jd kr~|jD]}|t|jj||g7}qb|jD]}|t|jj d ||g7}q|D]}|j |d}|r|SqdS)zy Microsoft Windows SDK executable directory. Return ------ str path r#r(rTF)r@rPzWinSDK-NetFx%dTools%srS-r0zv%sArN) ryr[rQrBNetFxSdkVersionrrurerrdrq) rCZnetfxverr,rPZfxZregpathsr+rZexecpathrrrWindowsSDKExecutablePath7s"    z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j}|j|dp$dS)zl Microsoft Visual F# directory. Return ------ str path z%0.1f\Setup\F#r r)rrur\ryrq)rCrrrrFSharpInstallDirZs zSystemInfo.FSharpInstallDircCsF|jdkrdnd}|D]*}|j|jjd|}|r|p:dSqdS)zt Microsoft Universal CRT SDK directory. Return ------ str path r0)Z10Z81rz kitsroot%srN)ryrurqrf)rCZversr+rrrrUniversalCRTSdkDirgs  zSystemInfo.UniversalCRTSdkDircCs|t|jdS)z Microsoft Universal C Runtime SDK last version. Return ------ str version r)rrrrFrrrUniversalCRTSdkLastVersion{s z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z Microsoft .NET Framework SDK versions. Return ------ tuple of str versions r0) z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rrrFrrrrszSystemInfo.NetFxSdkVersioncCs8d}|jD](}t|jj|}|j|d}|r q4q |S)zu Microsoft .NET Framework SDK directory. Return ------ str path rZkitsinstallationfolder)rrrurerq)rCrr+rrrr NetFxSdkDirs  zSystemInfo.NetFxSdkDircCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 32bit directory. Return ------ str path zMicrosoft.NET\FrameworkZframeworkdir32rrsrurqr_rCZguess_fwrrrFrameworkDir32s zSystemInfo.FrameworkDir32cCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 64bit directory. Return ------ str path zMicrosoft.NET\Framework64Zframeworkdir64rrrrrFrameworkDir64s zSystemInfo.FrameworkDir64cCs |dS)z Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions _find_dot_net_versionsrFrrrFrameworkVersion32s zSystemInfo.FrameworkVersion32cCs |dS)z Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions @rrFrrrFrameworkVersion64s zSystemInfo.FrameworkVersion64cCs|j|jjd|}t|d|}|p6||dp6d}|jdkrJ|dfS|jdkrt|dd d krld n|d fS|jd krdS|jdkrdSdS)z Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions zframeworkver%dzFrameworkDir%dvrrzv4.0r9NrZv4z v4.0.30319v3.5r7)r v2.0.50727g @)zv3.0r)rurqr_getattrrryr:)rCbitsZreg_verZ dot_net_dirr+rrrrs     z!SystemInfo._find_dot_net_versionscs*fddttD}t|dp(dS)a) Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name c3s*|]"}tt|r|r|VqdSrZ)rr startswith).0Zdir_namerprefixrr s z0SystemInfo._use_last_dir_name..Nr)reversedrnext)rrZ matching_dirsrrrrs  zSystemInfo._use_last_dir_name)N)r)#rrrrVrrWrsrtrrDrxr{rv staticmethodrrXrrrrrrrrrrrrrrrrrrrrrrrrr sZ    #*      * "         rrc@sbeZdZdZd?ddZeddZedd Zed d Zed d Z eddZ eddZ eddZ eddZ eddZeddZeddZddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zed6d7Zd@d9d:Zd;d<Z e!dAd=d>Z"dS)Br(aY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. NrcCsBt||_t|j|_t|j||_|j|kr>d}tj |dS)Nz.No suitable Microsoft Visual C++ version found) r?r[rYrurrsirzr$r%r&)rCr,rzr1errrrrrD0s    zEnvironmentInfo.__init__cCs|jjS)zk Microsoft Visual Studio. Return ------ float version )rryrFrrrry9s zEnvironmentInfo.vs_vercCs|jjS)zp Microsoft Visual C++ version. Return ------ float version )rrzrFrrrrzEs zEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd d |DS) zu Microsoft Visual Studio Tools. Return ------ list of str paths z Common7\IDEz Common7\Toolsr0TrPr@z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjj|qSrrrrrrrFrr csz+EnvironmentInfo.VSTools..)ryr[rQ)rCpaths arch_subdirrrFrVSToolsQs    zEnvironmentInfo.VSToolscCst|jjdt|jjdgS)z Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths ZIncludezATLMFC\IncluderrrrFrrr VCIncludeses  zEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd d |DS) z Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths .@Tr@rPLib%sz ATLMFC\Lib%sr0z Lib\store%scsg|]}tjj|qSrrrrFrrrsz/EnvironmentInfo.VCLibraries..)ryr[rR)rCrrrrFr VCLibrariesrs  zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjdgS)z Microsoft Visual C++ store references Libraries. Return ------ list of str paths r0zLib\store\references)ryrrrrFrrr VCStoreRefss zEnvironmentInfo.VCStoreRefscCs|j}t|jdg}|jdkr"dnd}|j|}|rL|t|jd|g7}|jdkr|d|jjdd}|t|j|g7}n|jdkr|jrd nd }|t|j||jjdd g7}|jj |jj kr|t|j||jjdd g7}n|t|jd g7}|S) zr Microsoft Visual C++ Tools. Return ------ list of str paths Z VCPackagesr9TFBin%sr0rrz bin\HostX86%sz bin\HostX64%srBin) rrrryr[rUrQrLrRrKrG)rCrtoolsrTrrZhost_dirrrrVCToolss0     zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd}t|jjd|gS|jjdd}t|jjd}|j}t|d||fgSdS) zw Microsoft Windows SDK Libraries. Return ------ list of str paths r9Trrrrz%sum%sN)ryr[rRrrr _sdk_subdir)rCrrZlibverrrr OSLibrariess zEnvironmentInfo.OSLibrariescCsht|jjd}|jdkr&|t|dgS|jdkr8|j}nd}t|d|t|d|t|d|gSd S) zu Microsoft Windows SDK Include. Return ------ list of str paths includer9Zglr0rz%ssharedz%sumz%swinrtN)rrrryr)rCrsdkverrrr OSIncludess      zEnvironmentInfo.OSIncludescCst|jjd}g}|jdkr&||j7}|jdkr@|t|dg7}|jdkr||t|jjdt|ddt|d dt|d dt|jjd d d |jdddg7}|S)z} Microsoft Windows SDK Libraries Paths. Return ------ list of str paths Z Referencesr7rzCommonConfiguration\Neutralr0Z UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ ExtensionSDKszMicrosoft.VCLibsrZCommonConfigurationZneutral)rrrryr)rCreflibpathrrr OSLibpaths.          zEnvironmentInfo.OSLibpathcCs t|S)zs Microsoft Windows SDK Tools. Return ------ list of str paths )list _sdk_toolsrFrrrSdkToolss zEnvironmentInfo.SdkToolsccs|jdkr,|jdkrdnd}t|jj|V|js\|jjdd}d|}t|jj|V|jdkr|jrvd }n|jjddd }d |}t|jj|VnB|jdkrt|jjd}|jjdd}|jj}t|d ||fV|jj r|jj Vd S)z Microsoft Windows SDK Tools paths generator. Return ------ generator of str paths rrrzBin\x86Trr)r9rrrzBin\NETFX 4.0 Tools%sz%s%sN) ryrrrr[rLrQrIrr)rCZbin_dirrrrrrrrs(     zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu Microsoft Windows SDK version subdir. Return ------ str subdir %s\r)rrrCucrtverrrrr6s zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjdgS)zs Microsoft Windows SDK Setup. Return ------ list of str paths r7ZSetup)ryrrrrFrrrSdkSetupCs zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}| o,| }n$|p>|}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)zv Microsoft .NET Framework Tools. Return ------ list of str paths r9TrAcsg|]}tj|qSr)rrrr+rrrrhsz+EnvironmentInfo.FxTools..csg|]}tj|qSr)rrrrrrrks) r[rryrIrLrKrGrr)rCr[Z include32Z include64rrrrFxToolsRs"    zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd}t|jjd|gS)z~ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths r0Trzlib\um%s)ryrrr[rRr)rCrrrrNetFxSDKLibrariesos z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjdgS)z} Microsoft .Net Framework SDK Includes. Return ------ list of str paths r0z include\um)ryrrrrFrrrNetFxSDKIncludess z EnvironmentInfo.NetFxSDKIncludescCst|jjdgS)z Microsoft Visual Studio Team System Database. Return ------ list of str paths z VSTSDB\DeployrrFrrrVsTDbs zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd}n |jj}d}d|j|f}t||g}|jdkrr|t||dg7}|S)zn Microsoft Build Engine. Return ------ list of str paths rrTrrzMSBuild\%0.1f\bin%sZRoslyn)ryrrr[rQrr)rC base_pathrrZbuildrrrMSBuilds    zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjdgS)zt Microsoft HTML Help Workshop. Return ------ list of str paths rzHTML Help Workshop)ryrrrrFrrrHTMLHelpWorkshops z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjd}|j}t|d||fgS)z Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths r0Trrz%sucrt%s)ryr[rRrrr _ucrt_subdir)rCrrrrrr UCRTLibrariess zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd}t|d|jgS)z Microsoft Universal C Runtime SDK Include. Return ------ list of str paths r0rz%sucrt)ryrrrr)rCrrrr UCRTIncludess zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z Microsoft Universal C Runtime SDK version subdir. Return ------ str subdir rr)rrrrrrrs zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk Microsoft Visual F#. Return ------ list of str paths rr)ryrrrFrrrFSharps zEnvironmentInfo.FSharpc Csd|j}|jjddd}g}|jj}t|dd}t|rft |t |d}||t |dg7}|t |d g7}d |jd d t |j d f}t ||D]&\}}t ||||} t| r| Sqd S) z Microsoft Visual C++ runtime redistributable dll. Return ------ str path zvcruntime%d0.dllTrrSz\Toolsz\Redistr8ZonecoreZredistzMicrosoft.VC%d.CRT N)rzr[rRstriprrrrBrrrintry itertoolsproductr) rCZ vcruntimerprefixesZ tools_pathZ redist_pathZcrt_dirsrZcrt_dirrrrrVCRuntimeRedists  zEnvironmentInfo.VCRuntimeRedistTcCst|d|j|j|j|jg||d|j|j|j|j |j g||d|j|j|j |j g||d|j |j|j|j|j|j|j|j|jg |d}|jdkrt|jr|j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment rrrr)rrrrZpy_vcruntime_redist)dict _build_pathsrrrrrrrrrrrrrrrrrrrryrr)rCexistsenvrrrr)&sV   zEnvironmentInfo.return_envc Csptj|}t|dt}t||}|r A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N)r|addr __contains__)iterablerseenZseen_addZelementkrrrrzs  z EnvironmentInfo._unique_everseen)Nr)T)N)#rrrrVrDrXryrzrrrrrrrrrrrrrrrrrrrrrrrr)rrrrrrrr(sn        $    #             " 2"r()r")r)*rVriorosrrZos.pathrrrrr3platformrZdistutils.errorsr$Z#setuptools.extern.packaging.versionr Zsetuptools.extern.six.movesr Zmonkeyr systemrrr ImportErrorr%r&Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr#r2r6r*r?rYrrr(rrrrsJ       * &  $s5PK! M]]'__pycache__/archive_util.cpython-38.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ Gd d d eZ d dZ e dfddZe fdd Ze fddZe fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__rr;/usr/lib/python3.8/site-packages/setuptools/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsc CsN|ptD]4}z||||Wntk r4YqYqXdSqtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r)filename extract_dirprogress_filterZdriversZdriverrrrrs  c Cstj|std||d|fi}t|D]\}}}||\}}|D],} || dtj|| f|tj|| <qH|D]T} tj|| } ||| | } | sqzt| tj|| } t| | t | | qzq.dS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirrwalkjoinrshutilZcopyfileZcopystat) rrrpathsbasedirsfilesrrdftargetrrrr ?s$   * c Cst|std|ft|}|D]}|j}|ds,d|dkrPq,tj j |f|d}|||}|sxq,| drt |n4t || |j}t|d}||W5QRX|jd?} | r,t|| q,W5QRXdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z%s is not a zip filer..wbN)zipfileZ is_zipfilerZZipFileZinfolistr startswithsplitrrrendswithrreadopenwriteZ external_attrchmod) rrrzinfonamer$datar#Zunix_attributesrrrrZs(         c Csfzt|}Wn$tjk r2td|fYnXt|dd|_|D]}|j}|dsPd| dkrPt j j |f| d}|dk r| s|r|j}|rt|j}t ||}t|}||}q|dk rP|s|rP|||} | rP| t jr"| dd} z||| WqPtjk rJYqPXqPW5QRdSQRXdS) zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z/%s is not a compressed or uncompressed tar filecWsdS)Nr)argsrrrz unpack_tarfile..rr%NT)tarfiler-ZTarErrorr contextlibclosingchownr2r)r*rrrZislnkZissymZlinkname posixpathdirnamenormpathZ _getmemberisfilerr+sepZ_extract_memberZ ExtractError) rrrZtarobjmemberr2Z prelim_dstZlinkpathrZ final_dstrrrrs:         )rr(r8rrr<r9Zdistutils.errorsrZ pkg_resourcesr__all__rrrr rrr rrrrs2   #  % .PK!վ%__pycache__/site-patch.cpython-38.pycnu[U Qab@sddZedkre[dS)c Cs ddl}ddl}|jd}|dks2|jdkr8|s8g}n ||j}t|di}|jt |d}|j t }|D]}||ksr|sqr||}|dk r| d}|dk r| dq.qrz ddl} | d|g\} } } Wntk rYqrYnX| dkrqrz| d| | | W5| Xq.qrtdtdd|jD} t|d d}d|_|D]}t|qX|j|7_t|d\}}d}g}|jD]b}t|\}}||kr|dkrt |}|| ks|dkr||n||||d 7}q||jdd<dS) N PYTHONPATHZwin32path_importer_cachesitez$Couldn't find the real 'site' modulecSsg|]}t|ddfqS))makepath).0itemr 9/usr/lib/python3.8/site-packages/setuptools/site-patch.py )sz__boot.. __egginsertr)sysosenvirongetplatformsplitpathsepgetattrpathlendirname__file__ find_module load_moduleimp ImportErrorclosedictr addsitedirrappendinsert)r rrZpicZstdpathZmydirrZimporterloaderrstreamrZdescr known_pathsZoldposdZndZ insert_atnew_pathpZnpr r r __boots`                 r(rN)r(__name__r r r r sGPK!__pycache__/glob.cpython-38.pycnu[U Qab@sdZddlZddlZddlZdddgZdddZdddZd d Zd d Zd dZ ddZ ddZ e dZ e dZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. NglobiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamerr3/usr/lib/python3.8/site-packages/setuptools/glob.pyrs cCs*t||}|r&t|r&t|}|r&t|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenextAssertionError)rritsrrr rs  ccstj|\}}t|sF|r0tj|rB|Vntj|rB|VdS|s|rnt|rnt||D] }|Vq`nt||D] }|VqxdS||krt|rt ||}n|g}t|r|rt|rt}qt}nt }|D]$}|||D]}tj ||VqqdSN) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirsZ glob_in_dirnamerrr r 0s4      r cCsV|s"t|trtjd}ntj}zt|}Wntk rHgYSXt||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr r[s  rcCs8|stj|r4|gSntjtj||r4|gSgSr)rrrrr)rrrrr rhs  rccs2t|s t|ddVt|D] }|Vq"dS)Nr)r r _rlistdir)rr*rrrr rxs  rccs|s"t|trtjd}ntj}zt|}Wntjk rHYdSX|D]>}|V|rjtj||n|}t |D]}tj||VqvqNdSr ) r"r#rr$r%r&errorrrr,)rr+rryrrr r,s  r,z([*?[])s([*?[])cCs(t|trt|}n t|}|dk Sr)r"r#magic_check_bytessearch magic_check)rmatchrrr rs   rcCst|tr|dkS|dkSdS)Ns**z**)r"r#)r*rrr r s r cCs<tj|\}}t|tr(td|}n td|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver"r#r/subr1)rZdriverrr rs   )F)F)__doc__rrer(__all__rrr rrrr,compiler1r/rr rrrrr s    +   PK!$$!__pycache__/monkey.cpython-38.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ ddZddZd d Zd d Zd dZddZddZddZdS)z Monkey patching of distutils. N) import_module)sixcCs"tdkr|f|jSt|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. ZJython)platformZpython_implementation __bases__inspectZgetmro)clsr5/usr/lib/python3.8/site-packages/setuptools/monkey.py_get_mros  r cCs0t|tjrtnt|tjr tndd}||S)NcSsdS)Nr)itemrrr *zget_unpatched..) isinstancerZ class_typesget_unpatched_classtypes FunctionTypeget_unpatched_function)r lookuprrr get_unpatched&s rcCs:ddt|D}t|}|jds6d|}t||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css|]}|jds|VqdS) setuptoolsN) __module__ startswith).0rrrr 5s z&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextrrAssertionError)rZexternal_basesbasemsgrrr r/s rcCstjtj_tjdk}|r"tjtj_tjdkp^dtjko@dknp^dtjkoZdkn}|rrd}|tjj _ t tj tjtj fD]}tj j|_qtjjtj_tjjtj_dtjkrtjjtjd_tdS)N)r) )r)rr$)rr zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rZCommandrZcoresys version_infofindallZfilelistZconfigZ PyPIRCCommandZDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdZ Distribution extensionZ Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehousemodulerrr patch_allAs*          r0cCs*dD] }ttj|}ttjj||qdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)Zwrite_pkg_fileZ read_pkg_fileZget_metadata_versionN)getattrrr*setattrrZDistributionMetadata)attrZnew_valrrr r)hs r)cCs*t||}t|d|t|||dS)z Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. unpatchedN)r1vars setdefaultr2)Z replacementZ target_mod func_nameoriginalrrr patch_funcos r9cCs t|dS)Nr4)r1) candidaterrr rsrcstdtdkrdSfdd}t|d}t|d}zt|dt|d Wntk rlYnXzt|d Wntk rYnXzt|d Wntk rYnXdS) z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcZWindowsNcsLd|kr dnd}||d}t|}t|}t||sBt||||fS)zT Prepare the parameters for patch_func to patch indicated function. msvc9Zmsvc9_Zmsvc14__)lstripr1rhasattr ImportError)Zmod_namer7Z repl_prefixZ repl_namereplmodZmsvcrr patch_paramss  z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ _get_vc_envZgen_lib_options)rrsystem functoolspartialr9r?)rCr;Zmsvc14rrBr r.s&    r.)__doc__r&Zdistutils.filelistrrrrE importlibrrZsetuptools.externrr__all__r rrr0r)r9rr.rrrr s$   'PK!`['##+__pycache__/pep425tags.cpython-38.opt-1.pycnu[U Qabm*@sdZddlmZddlZddlmZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZddlmZed Zd d Zd d ZddZddZddZd$ddZddZddZddZddZdd Zd%d"d#ZeZdS)&z2Generate and work with PEP 425 Compatibility Tags.)absolute_importN)log) OrderedDict)six)glibcz(.+)_(\d+)_(\d+)_(.+)c CsLz t|WStk rF}ztd|tWYdSd}~XYnXdS)Nz{}) sysconfigget_config_varIOErrorwarningswarnformatRuntimeWarning)varer9/usr/lib/python3.8/site-packages/setuptools/pep425tags.pyr s  r cCs:ttdrd}n&tjdr"d}ntjdkr2d}nd}|S)z'Return abbreviated implementation name.pypy_version_infoppjavaZjyZcliZipcp)hasattrsysplatform startswith)Zpyimplrrr get_abbr_impls   rcCs,td}|rtdkr(dttt}|S)zReturn implementation version.Zpy_version_nodotr)r rjoinmapstrget_impl_version_info)Zimpl_verrrr get_impl_ver+sr!cCs:tdkr"tjdtjjtjjfStjdtjdfSdS)zQReturn sys.version_info-like tuple for use in decrementing the minor version.rrrN)rr version_informajorminorrrrrr 3s  r cCsdttS)z; Returns the Tag for this specific implementation. z{}{})r rr!rrrr get_impl_tag>sr%TcCs.t|}|dkr&|r td||S||kS)zgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)r rdebug)rZfallbackexpectedr valrrrget_flagEsr)cstd}t|sdkrttdrd}d}d}tddddkd rJd }td fd ddkd rhd }tdddddkotjdrtjrd}dt|||f}n@|r|drd| dd}n|r| dd dd}nd}|S)zXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).ZSOABI>rr maxunicoderZPy_DEBUGcSs ttdS)NZgettotalrefcount)rrrrrr[zget_abi_tag..r)r dZ WITH_PYMALLOCcsdkS)Nrrrimplrrr+_r,mZPy_UNICODE_SIZEcSs tjdkS)Ni)rr*rrrrr+cr,)r'r uz %s%s%s%s%szcpython--r._N) r rrrr)rZPY2r!rsplitreplace)Zsoabir-r0r2abirr.r get_abi_tagQs@ r9cCs tjdkS)Ni)rmaxsizerrrr_is_running_32bitssr;cCstjdkr^t\}}}|d}|dkr6tr6d}n|dkrHtrHd}d|d|d |Stj dd  d d }|d krtrd }|S)z0Return our platform name 'win32', 'linux_x86_64'darwinr4x86_64i386ppc64ppczmacosx_{}_{}_{}rrr5r3 linux_x86_64 linux_i686) rrZmac_verr6r;r distutilsutil get_platformr7)releaser5machineZ split_verresultrrrrEws  rEc CsHtdkrdSzddl}t|jWSttfk r:YnXtddS)N>rArBFr)rE _manylinuxboolZmanylinux1_compatible ImportErrorAttributeErrorrZhave_compatible_glibc)rKrrris_manylinux1_compatibles  rOcsrg}fddtddddg|||r8||D]&}||kr<|||r<||q<|d|S)zReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of a macOS machine. cs||dkr||fdkS|dkr(||fdkS|dkr<||fdkS|dkrP||fdkS|krx|D]}|||r`dSq`dS) Nr@) rJr?r>)rPr1r=TFr)r#r$archgarch_supports_archgroupsrrrTs      z)get_darwin_arches.._supports_arch)Zfat)r>r@)Zintel)r=r>)Zfat64)r=r?)Zfat32)r=r>r@Z universal)rappend)r#r$rGarchesrRrrSrget_darwin_archess$    rXFc Csg}|dkrTg}t}|dd}t|dddD] }|dtt||fq2|p\t}g} |pjt}|r~|g| dd<t} ddl } | D],} | d dr| | d dddq| tt| | d |sT|pt} | d rzt| }|rr|\}}}}d ||}g}ttt|dD]0}tt|||D]}||||fqRq>n| g}n*|dkrtr| d d | g}n| g}| D].}|D]"} |d||df|| fqq|ddD]F}|dkrq,| D]*}|D]} |d||f|| fqqq|D]"} |d|ddd | fq0|d||dfd df|d||ddfd dft|D]B\}}|d|fd df|dkr|d|dd dfq|S)acReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. Nrrz.abir4rIrZnoneZmacosxz {}_{}_%i_%sZlinuxZ manylinux1z%s%s>3031zpy%sany)r rangerVrrrrr9setimpZ get_suffixesraddr6extendsortedlistrE _osx_arch_patmatchrUr reversedintrXrOr7 enumerate)ZversionsZnoarchrr/r8Z supportedr"r#r$ZabisZabi3sr_suffixrQrenameZ actual_archZtplrWr0aversionirrr get_supportedsh         $ $   rn)TT)NFNNN) __doc__Z __future__rZdistutils.utilrCrrrerrr collectionsrZexternrrrcompilerdr rr!r r%r)r9r;rErOrXrnZimplementation_tagrrrrs8         "= `PK!5) XX#__pycache__/__init__.cpython-38.pycnu[U Qabs@sdZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z ddlmZddlmZmZdd lmZmZddlZdd lmZdd lmZmZdd lmZdd lm Z e!Z"ddddddddgZ#ere#$dej%j&Z&dZ'dZ(dgZ)GdddZ*Gddde*Z+e*j,Z-er,e+j,Z.ddZ/ddZ0ej1j0je0_e 2ej1j3Z4Gd dde4Z3d!d"Z5ej6fd#d$Z7e 8dS)%z@Extensions to the 'distutils' for large or complex distributionsN)DistutilsOptionError) convert_path fnmatchcase)SetuptoolsDeprecationWarning)PY3 string_types)filtermap) Extension) DistributionFeature)Require)monkeysetupr rCommandr rr find_packagesfind_namespace_packagesTz lib2to3.fixesc@sBeZdZdZedddZeddZed d Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs&t|t||jd||j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. ez_setup *__pycache__)rr)list_find_packages_iterr _build_filter)clswhereexcludeincluderr7/usr/lib/python3.8/site-packages/setuptools/__init__.pyfind4s  zPackageFinder.findc cstj|ddD]\}}}|dd}g|dd<|D]d}tj||} tj| |} | tjjd} d|ks4|| sxq4|| r|| s| V||q4qdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rr r!r"rootdirsfilesZall_dirsdir full_pathZrel_pathpackagerrr#rKs  z!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z __init__.py)r'r)isfiler*r)rrr#r.gsz!PackageFinder._looks_like_packagecs fddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s|]}t|dVqdS))patNr).0r8namerr# rsz@PackageFinder._build_filter....)anyr:Zpatternsr:r#rz-PackageFinder._build_filter..rr>rr>r#rlszPackageFinder._build_filterN)rrr) __name__ __module__ __qualname____doc__ classmethodr$r staticmethodr.rrrrr#r/s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTrr7rrr#r.vsz'PEP420PackageFinder._looks_like_packageN)rArBrCrFr.rrrr#rGusrGcCs@tjtdd|D}|jdd|jr<||jdS)Ncss"|]\}}|dkr||fVqdS))Zdependency_linkssetup_requiresNr)r9kvrrr#r<sz*_install_setup_requires..T)Zignore_option_errors) distutilscorer dictitemsZparse_config_filesrHZfetch_build_eggs)attrsdistrrr#_install_setup_requiress   rQcKst|tjjf|SN)rQrKrLr)rOrrr#rsc@s:eZdZejZdZddZd ddZddZd d d Z dS)rFcKst||t||dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfrPkwrrr#rTs zCommand.__init__NcCsBt||}|dkr"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr isinstancer r)rWoptionZwhatdefaultvalrrr#_ensure_stringlikes   zCommand._ensure_stringlikecCspt||}|dkrdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+css|]}t|tVqdSrR)r[r )r9rJrrr#r<sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r)) rYr[r rZresplitrallr)rWr\r^okrrr#ensure_string_lists   zCommand.ensure_string_listrcKs t|||}t|||SrR)rSreinitialize_commandrUrV)rWZcommandZreinit_subcommandsrXcmdrrr#reszCommand.reinitialize_command)N)r) rArBrCrSrDZcommand_consumes_argumentsrTr_rdrerrrr#rs  cCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tj||VqqdSrR)r'r)r*)r9baser1r2filerrr#r<sz#_find_all_simple..Tr%)r'r(r r)r6)r)resultsrrr#_find_all_simples rjcCs6t|}|tjkr.tjtjj|d}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rjr'curdir functoolspartialr)r+r r)r3r2Zmake_relrrr#findalls   ro)9rDr'sysrmZdistutils.corerKZdistutils.filelistr`Zdistutils.errorsrZdistutils.utilrZfnmatchrZ_deprecation_warningrZsetuptools.extern.sixrr Zsetuptools.extern.six.movesr r Zsetuptools.versionZ setuptoolsZsetuptools.extensionr Zsetuptools.distr rZsetuptools.dependsrrtypeZ __metaclass____all__r/version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesrrGr$rrrQrrLZ get_unpatchedrrSrjrlroZ patch_allrrrr#s\        F  2  PK!yʀʀ.__pycache__/package_index.cpython-38.opt-1.pycnu[U Qab@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddlm"Z"ddl#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.e/Z0e1dZ2e1dej3Z4e1dZ5e1dej3j6Z7d8Z9ddddgZ:dZ;dZedZ?ddZ@ddZAddZBdGd dZCdHd!d"ZDdId#d$ZEdedfd%dZFdJd&d'ZGd(d)ZHe1d*ej3ZIeHd+d,ZJGd-d.d.ZKGd/d0d0eKZLGd1ddeZMe1d2jNZOd3d4ZPd5d6ZQdKd7d8ZRd9d:ZSGd;d<d<ZTGd=d>d>ejUZVejWjXfd?d@ZYdAdBZZeRe;eYZYdCdDZ[dEdFZ\dS)Lz#PyPI and direct package downloadingNwraps)six)urllib http_client configparsermap) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST) ssl_support)log)DistutilsError) translate)get_all_headers)unescape)Wheelz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezrP)filenamerGr&r&r'distros_for_filenames  rTc cs||d}|s,tdd|ddDr,dStdt|dD]8}t||d|d|d||d|||dVq>dS)zGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! rJcss|]}td|VqdS)z py\d\.\d$N)rerE).0pr&r&r' sz(interpret_distro_name..Nr6) py_versionrBrQ)r9anyrangerOr join)rKrPrGrZrBrQr;rWr&r&r'r s ccsft}|j}|dkr:tj|j|D]}|||Vq$n(|D]"}||}||kr>|||Vq>dS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrZmoves filterfalse __contains__)iterablekeyseenZseen_addZelementkr&r&r'unique_everseens rfcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||SN)rf)argskwargsfuncr&r'wrapperszunique_values..wrapperr)rkrlr&rjr' unique_valuessrmz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c cst|D]d}|\}}tttj|d}d|ksDd|kr t |D]}t j |t |dVqNq dD]@}||}|dkrtt ||}|rtt j |t |dVqtdS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager3r6)z Home PagezDownload URLr2N)RELfinditergroupsr^rstrstripr+r9HREFrr#urljoin htmldecoderFfindsearch)r:pagerEtagZrelZrelsposr&r&r'find_external_linkss   r|c@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr&selfblockr&r&r'feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr&rr&r&r'is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr&)rreportertemplater&r&r'reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr&r&r&r'r}sr}c@sBeZdZedZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t||_||_dSrg) hash_namehashlibnewhashexpected)rrrr&r&r'__init__s zHashChecker.__init__cCs>tj|d}|stS|j|}|s0tS|f|S)z5Construct a (possibly null) ContentChecker from a URLr2)rr#r7r}patternrx groupdict)clsr:r@rEr&r&r'from_urls zHashChecker.from_urlcCs|j|dSrg)rupdater~r&r&r'rszHashChecker.feedcCs|j|jkSrg)rZ hexdigestrrr&r&r'r"szHashChecker.is_validcCs||j}||Srg)r)rrrmsgr&r&r'r%s zHashChecker.reportN) rrrrUcompilerr classmethodrrrrr&r&r&r'r s rcs<eZdZdZdJddZdKd d ZdLd d ZdMd dZddZddZ ddZ ddZ dNddZ ddZ dOfdd ZddZdd Zd!d"Zd#d$Zd%d&ZdPd'd(ZdQd)d*Zd+d,Zd-Zd.d/Zd0d1ZdRd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&Z'S)Trz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOstj|f|||dd|d |_i|_i|_i|_td t t |j |_ g|_|ortjor|prt}|rt||_n tjj|_dS)Nr1|)rrr, index_url scanned_urls fetched_urls package_pagesrUrr]rrrEallowsto_scanrZ is_availableZfind_ca_bundleZ opener_foropenerrrequesturlopen)rrZhostsZ ca_bundleZ verify_sslrhkwZuse_sslr&r&r'r-s zPackageIndex.__init__Fc Cs||jkr|sdSd|j|<t|s2||dStt|}|r\||sPdS|d||sn|rn||jkrtt|j |dS||sd|j|<dS| d|d|j|<d}| |||}|dkrdSd|j|j <d|j ddkr|dS|j }|}t|tsNt|tjjr0d }n|j d p@d }||d }|t|D](} tj|t| d } || q`| |j!rt"|d ddkr|#||}dS)zexistswarnisdirrealpathlistdirrr]rTrrrr_)rfnnestedr>itemrr&r&r'rus    zPackageIndex.process_filenamecCsbt|}|o|ddk}|s8|tj|drentryr&r&r'rXs   z.PackageIndex.scan_egg_links..)filterrRr>rr itertoolsstarmap scan_egg_link)rZ search_pathdirsZ egg_linksr&r&r'scan_egg_linkss zPackageIndex.scan_egg_linksc Csttj||}ttdttj|}W5QRXt |dkrDdS|\}}t tj||D](}tjj|f||_ t |_ ||q^dS)NrY)openrRr>r]rrrrrrsrOrrKr rBr_)rr>rZ raw_lineslinesZegg_pathZ setup_pathrHr&r&r'rs  zPackageIndex.scan_egg_linkc sfdd}t|D]:}z |tj|t|dWqtk rNYqXq||\}}|rt||D]H}t |\}} | dr| s|r|d||f7}n | |qlt dd|SdSd S) z#Process the contents of a PyPI pagecs|jrtttjj|tjdd}t|dkrd|dkrt |d}t |d}dj | i|<t|t|fSdS)Nr1rYr5r6rT)NN)r-rrrrr#r8rOr9rrr setdefaultr+r)rr;pkgverrr&r'scans   z(PackageIndex.process_index..scanr6.pyz #egg=%s-%scSsd|dddS)Nz%sr6rY)rF)mr&r&r'z,PackageIndex.process_index..rN)rtrprr#rurvrFr$r|rAr,need_version_infoscan_urlPYPI_MD5sub) rr:ryrrErrnew_urlr/fragr&rr'rs(      zPackageIndex.process_indexcCs|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_allrr:r&r&r'rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrrrrrhr&r&r'rs zPackageIndex.scan_allcCsz||j|jd|j|js:||j|jd|j|jsR||t|j|jdD]}||qfdS)Nr1r&) rr unsafe_namerrrcrLnot_found_in_indexr)r requirementr:r&r&r' find_packagess zPackageIndex.find_packagescsR|||||jD]"}||kr0|S|d||qtt|||S)Nz%s does not match %s)prescanrrcrsuperrobtain)rrZ installerrH __class__r&r'rs zPackageIndex.obtaincCsL||jd||sH|t|td|jjtj |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrRunlinkrrr.r>rP)rcheckerrStfpr&r&r' check_hashs zPackageIndex.check_hashcCsN|D]D}|jdks0t|r0|ds0tt|r<||q|j|qdS)z;Add `urls` to the list that will be prescanned for searchesNfile:)rrr-rrrappend)rZurlsr:r&r&r'add_find_linkss  zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrrrr&r&r'rszPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rcrrrr)rrZmethrr&r&r'r#s  zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR||d||}t|\}}|drN||||}|Stj |rb|St |}t | ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r6rrKN)rrr _download_urlrFrAr, gen_setuprRr>rr(rfetch_distribution)rr%tmpdirr<foundr/r@r&r&r'r3-s    zPackageIndex.downloadc sd|id}d fdd }|rH|||}|s^|dk r^|||}|dkrjdk rx||}|dkr|s|||}|dkrdrdpd|nd||j|jd SdS) a|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. zSearching for %sNcs|dkr }||jD]v}|jtkrFsF|krd|d|<q||ko\|jtkp\ }|r|j}||_tj |jr|SqdS)Nz&Skipping development or system egg: %sr6) rcrBrrr r3rKdownload_locationrRr>r)ZreqenvrHZtestZloc develop_okrZskippedsourcerr&r'rwgs&z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rK)N)rrrrrZcloner) rrr force_scanrrZ local_indexrHrwr&rr'rOs2         zPackageIndex.fetch_distributioncCs"|||||}|dk r|jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)rrK)rrrrrrHr&r&r'fetchszPackageIndex.fetchc Cst|}|r*ddt||ddDp,g}t|dkrtj|}tj||krtj ||}ddl m }|||st |||}ttj |dd2} | d|dj|djtj|dfW5QRX|S|rtd ||fntd dS) NcSsg|]}|jr|qSr&)rM)rVdr&r&r' sz*PackageIndex.gen_setup..r6r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rDrEr rFrOrRr>rPdirnamer]Zsetuptools.command.easy_installr shutilZcopy2rwriterLrMsplitextr) rrSr@rrErrPZdstr rr&r&r'rsB       zPackageIndex.gen_setupi c Cs|d|d}zt|}||}t|tjjrJt d||j |j f|}d}|j }d}d|krt |d} ttt| }||||||t|dV} ||} | r|| | | |d7}||||||qqq|||| W5QRX|WS|r|XdS) NzDownloading %szCan't download %s: %s %srr2zcontent-lengthzContent-Lengthwbr6)rrrrrrrrrrrr dl_blocksizermaxrint reporthookrrrr r) rr:rSfprrblocknumZbssizeZsizesrrr&r&r' _download_tos:        zPackageIndex._download_tocCsdSrgr&)rr:rSrZblksizerr&r&r'rszPackageIndex.reporthookc Cs|drt|Szt||jWSttjfk r}z.z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r- local_openopen_with_authrr$r InvalidURLr]rhrrrrrZURLErrorreasonZ BadStatusLinelineZ HTTPExceptionsocket)rr:Zwarningvrr&r&r'rs> "zPackageIndex.open_urlcCst|\}}|r0d|kr4|dddd}qnd}|drJ|dd}tj||}|dksj|d rv|||S|d ks|d r|||S|d r| ||S|d krt j t j |dS||d|||SdS)Nz...\_Z__downloaded__rIr*Zsvnzsvn+Zgitzgit+zhg+rrYT)rAreplacer,rRr>r]r- _download_svn _download_git _download_hgrr url2pathnamer#r7r_attempt_download)rr<r:rr.r@rSr&r&r'rs$        zPackageIndex._download_urlcCs||ddS)NT)rrr&r&r'r:szPackageIndex.scan_urlcCs6|||}d|ddkr.||||S|SdS)Nrrr)rrr+_download_html)rr:rSrr&r&r'r)=s zPackageIndex._attempt_downloadcCsnt|}|D]>}|r td|rF|t||||SqLq |t|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rs���rU���rx���r���rR���r���r%��r���)r���r:���r���rS���r���r��r&���r&���r'���r*��D��s����   zPackageIndex._download_htmlc�����������������C���s��t�dt�|ddd�}d}|�drd|krtj|\}}}}}} |s|drd |d d��kr|d d��d d\}}t |\} } | rd | kr| d d\} } d | | f�}nd | �}| }|||||| f}tj |}|� d||�t d|||f��|S�)Nz"SVN download support is deprecatedr5���r6���r���r���zsvn:@z//r1���rY���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)warningsr��� UserWarningr9���r+���r-���r���r#���r7��� _splituser urlunparser���rR���system)r���r:���rS���Zcredsr<���netlocr>���rW���qr���authhostuserZpwr;���r&���r&���r'���r%��S��s&����   zPackageIndex._download_svnc�����������������C���sp���t�j|�\}}}}}|ddd�}|ddd�}d�}d|krR|dd\}}t�j||||df}�|�|fS�)N+r6���r2���r5���r���r+��r���)r���r#���Zurlsplitr9���rsplitZ urlunsplit)r:��� pop_prefixr<���r2��r>���r?���r���revr&���r&���r'���_vcs_split_rev_from_urli��s����z$PackageIndex._vcs_split_rev_from_urlc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k rh|�d|�td ||f��|S�) Nr5���r6���r���Tr9��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %sr9���r;��r���rR���r1��r���r:���rS���r:��r&���r&���r'���r&��{��s���� zPackageIndex._download_gitc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k rh|�d|�td ||f��|S�) Nr5���r6���r���Tr<��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qr=��r>��r&���r&���r'���r'����s���� zPackageIndex._download_hgc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.debugc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.infoc�����������������G���s���t�j|f|��d�S�rg���)r���r���r���r&���r&���r'���r�����s����zPackageIndex.warn)r���r���NT)F)F)F)N)N)FFFN)FF)N)F)(r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r3���r���r��r���r��r��r��r���r���r���r)��r*��r%�� staticmethodr;��r&��r'��r���r���r��� __classcell__r&���r&���r���r'���r���*��sX���������  3   +   #������ L )$ # z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������C���s���|��d}t|S�)Nr���)rF���r���)rE���Zwhatr&���r&���r'��� decode_entity��s���� rA��c�����������������C���s ���t�t|�S�)a�� Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz') 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz' ) entity_subrA��)textr&���r&���r'���rv�����s���� rv���c��������������������s����fdd}|S�)Nc��������������������s����fdd}|S�)Nc��������������� ������s2���t��}t��z�|�|W�S�t�|�X�d�S�rg���)r��ZgetdefaulttimeoutZsetdefaulttimeout)rh���ri���Z old_timeout)rk���timeoutr&���r'���_socket_timeout��s ���� z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr&���)rk���rE��rD��rj���r'���rE����s����z'socket_timeout.<locals>._socket_timeoutr&���)rD��rE��r&���rF��r'���socket_timeout��s���� rG��c�����������������C���s2���t�j|�}|�}t|}|�}|ddS�)aq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r���r#���r8���encodebase64Z b64encoder���r$��)r4��Zauth_sZ auth_bytesZ encoded_bytesZencodedr&���r&���r'��� _encode_auth��s ����  rK��c�������������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�����������������C���s���||�_�||�_d�S�rg���usernamepassword)r���rN��rO��r&���r&���r'���r�����s����zCredential.__init__c�����������������c���s���|�j�V��|�jV��d�S�rg���rM��r���r&���r&���r'���__iter__��s����zCredential.__iter__c�����������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)varsr���r&���r&���r'���__str__��s����zCredential.__str__N)r���r���r���r���r���rP��rR��r&���r&���r&���r'���rL����s���rL��c�������������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�����������������C���sP���t�dddgd}tj|�|�tjtjdd}tj |rL|� |�dS�)z% Load from ~/.pypirc rN��rO�� repositoryr���~z.pypircN) dictfromkeysr���RawConfigParserr���rR���r>���r]��� expanduserr���r���)r���defaultsZrcr&���r&���r'���r�����s ���� zPyPIConfig.__init__c��������������������s&����fdd���D�}tt�j|S�)Nc��������������������s ���g�|�]}��|d��r|qS�)rT��)r���rs���)rV���sectionr���r&���r'���r����s���z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrV��r���_get_repo_cred)r���Zsections_with_repositoriesr&���r���r'���creds_by_repository��s���� zPyPIConfig.creds_by_repositoryc�����������������C���s6���|��|d�}|t|��|d�|��|d�fS�)NrT��rN��rO��)r���rs���rL��)r���r[��Zrepor&���r&���r'���r\����s ����zPyPIConfig._get_repo_credc�����������������C���s*���|�j��D�]\}}||r |��S�q dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r]��itemsr-���)r���r:���rT��credr&���r&���r'���find_credential ��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyr]��r\��r`��r&���r&���r&���r'���rS����s ���  rS��c�����������������C���s:��t�j|�}|\}}}}}}|dr0td|dkrFt|\} } nd} | s~t�|�} | r~t | } | j |�f} t j d | ��| rdt | �} || ||||f} t�j| }t�j|}|d| �n t�j|�}|dt�||}| r6t�j|j\}}}}}}||kr6|| kr6||||||f} t�j| |_|S�) z4Open a urllib2 request, handling HTTP authenticationr,��znonnumeric port: '')ZhttpZhttpsN*Authenticating as %s for %s (from .pypirc)zBasic Z Authorizationz User-Agent)rb��)r���r#���r7���r,���r���r��r/��rS��r`��rr���rN��r���r���rK��r0��r���ZRequestZ add_header user_agentr:���)r:���r���Zparsedr<���r2��r>���Zparamsr?���r���r4��Zaddressr_��r���r;���r���r���r��s2Zh2Zpath2Zparam2Zquery2Zfrag2r&���r&���r'���r����s8����          r��c�����������������C���s ���|��d\}}}�|r|nd|�fS�)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r+��N) rpartition)r5��r6��Zdelimr&���r&���r'���r/��F��s����r/��c�����������������C���s���|�S�rg���r&���)r:���r&���r&���r'��� fix_sf_urlP��s����rf��c�������������� ���C���s��t�j|�\}}}}}}t�j|}tj|r<t�j|�S�| drtj |rg�}t |D�]d} tj || } | dkrt | d} | �} W�5�Q�R�X��qntj | r| d7�} |dj| d�q`d} | j|�d |d} d \}}n d \}}} d d i}t| }t�j|�||||S�) z7Read a local path, with special support for directoriesr1���z index.htmlrz<a href="{name}">{name}</a>)r.���zB<html><head><title>{url}{files}rH)r:files)ZOK)rzPath not foundz Not foundrz text/html)rr#r7rr(rRr>isfilerr,rrr]rrrformatrStringIOrr)r:r<r=r>Zparamr?rrSrhrfilepathrZbodyrZstatusmessagerZ body_streamr&r&r'rTs.        r)N)N)N)N)r!)]rsysrRrUr rrJrrr- functoolsrZsetuptools.externrZsetuptools.extern.six.movesrrrrr"Z pkg_resourcesr r r r r rrrrrrrrrZ distutilsrZdistutils.errorsrZfnmatchrZsetuptools.py27compatrZsetuptools.py33compatrZsetuptools.wheelrtypeZ __metaclass__rrDIrtrrErr9rN__all__Z_SOCKET_TIMEOUTZ_tmplrk version_inforcr(rrArrCrTr rfrmror|r}rrrrBrArvrGrKrLrXrSrrrr/rfrr&r&r&r's  <           !  $   !  &/ PK!%__pycache__/py27compat.cpython-38.pycnu[U Qab@sdZddlZddlZddlmZddZejr6ddZedkoFejZerPe ndd Z z,d d l m Z m Z mZmZd d l mZmZWnJek rddlZdd lm Z mZmZdddZ ddZddZYnXdS)z2 Compatibility Support for Python 2.7 and earlier N)sixcCs ||S)zH Given an HTTPMessage, return all headers matching a given key. )Zget_allmessagekeyr9/usr/lib/python3.8/site-packages/setuptools/py27compat.pyget_all_headers srcCs ||SN)Z getheadersrrrrrsZLinuxcCs|Sr r)xrrrr ) find_module PY_COMPILED PY_FROZEN PY_SOURCE)get_frozen_object get_module)rrrc Csj|d}|rf|d}t||\}}\}}}} |tjkrP|pFdg}|g}q |r td||fq | S)z7Just like 'imp.find_module()', but with package support.r__init__zCan't find %r in %s)splitpopimprZ PKG_DIRECTORY ImportError) modulepathspartspartfpathsuffixmodeZkindinforrrr's    rcCs t|Sr )rr)rrrrrr7srcCstj|f|tj|Sr )r load_modulesysmodules)rrr"rrrr:sr)N)__doc__r$platformZsetuptools.externrrZPY2systemZlinux_py2_asciistrZ rmtree_safe_imprrrrrrrrrrrrs&   PK!_vendor/__init__.pynu[PK!v_vendor/packaging/__init__.pynu[# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from .__about__ import ( __author__, __copyright__, __email__, __license__, __summary__, __title__, __uri__, __version__ ) __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] PK!iJ\\_vendor/packaging/_compat.pynu[# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 # flake8: noqa if PY3: string_types = str, else: string_types = basestring, def with_metaclass(meta, *bases): """ Create a base class with a metaclass. """ # This requires a bit of explanation: the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass(meta): def __new__(cls, name, this_bases, d): return meta(name, bases, d) return type.__new__(metaclass, 'temporary_class', (), {}) PK! _vendor/packaging/_structures.pynu[# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function class Infinity(object): def __repr__(self): return "Infinity" def __hash__(self): return hash(repr(self)) def __lt__(self, other): return False def __le__(self, other): return False def __eq__(self, other): return isinstance(other, self.__class__) def __ne__(self, other): return not isinstance(other, self.__class__) def __gt__(self, other): return True def __ge__(self, other): return True def __neg__(self): return NegativeInfinity Infinity = Infinity() class NegativeInfinity(object): def __repr__(self): return "-Infinity" def __hash__(self): return hash(repr(self)) def __lt__(self, other): return True def __le__(self, other): return True def __eq__(self, other): return isinstance(other, self.__class__) def __ne__(self, other): return not isinstance(other, self.__class__) def __gt__(self, other): return False def __ge__(self, other): return False def __neg__(self): return Infinity NegativeInfinity = NegativeInfinity() PK!yt9_vendor/packaging/__pycache__/requirements.cpython-38.pycnu[U Qab@srddlmZmZmZddlZddlZddlmZmZm Z m Z ddlm Z m Z m Z mZmZddlmZddlmZddlmZmZdd lmZmZmZGd d d eZe ejejZ ed !Z"ed !Z#ed!Z$ed!Z%ed!Z&ed!Z'ed!Z(e dZ)e e e)e BZ*ee e e*Z+e+dZ,e+Z-eddZ.e(e.Z/e-e e&e-Z0e"e e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7e e&e7ddddZ8e e$e8e%e8BZ9e9:dde e9dZ;e;:dde edZe:d de'Ze/e e=Z?e,e e1e?e>BZ@ee@eZAGd!d"d"eBZCdS)#)absolute_importdivisionprint_functionN) stringStart stringEndoriginalTextForParseException) ZeroOrMoreWordOptionalRegexCombine)Literal)parse) MARKER_EXPRMarker)LegacySpecifier Specifier SpecifierSetc@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rrM/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)Z joinStringZadjacent _raw_speccCs |jpdS)N)r'sltrrr6r- specifiercCs|dS)Nrrr)rrrr-9r.markercCst||j|jS)N)rZ_original_startZ _original_endr)rrrr-=r.c@s(eZdZdZddZddZddZdS) RequirementzParse a requirement. Parse a given requirement string into its parts, such as name, specifier, URL, and extras. Raises InvalidRequirement on a badly-formed requirement string. c Cszt|}Wn@tk rN}z"td||j|jdW5d}~XYnX|j|_|jrt|j}|j r|j r|j s|j std|j|_nd|_t |j r|j ng|_ t|j|_|jr|jnd|_dS)Nz+Invalid requirement, parse error at "{0!r}"zInvalid URL given) REQUIREMENTZ parseStringrrformatZlocr$r%urlparseZschemeZnetlocsetr&ZasListrr/r0)selfZrequirement_stringZreqeZ parsed_urlrrr__init__Xs,    zRequirement.__init__cCsz|jg}|jr*|ddt|j|jr@|t|j|jrX|d|j|j rp|d|j d|S)Nz[{0}]r!z@ {0}z; {0}r() r$r&appendr4joinsortedr/strr%r0)r7partsrrr__str__mszRequirement.__str__cCsdt|S)Nz)r4r=)r7rrr__repr__~szRequirement.__repr__N)rrrrr9r?r@rrrrr1Ks r1)DZ __future__rrrstringreZsetuptools.extern.pyparsingrrrrr r r r r rLZ"setuptools.extern.six.moves.urllibrr5ZmarkersrrZ specifiersrrr ValueErrorrZ ascii_lettersZdigitsZALPHANUMsuppressZLBRACKETZRBRACKETZLPARENZRPARENCOMMAZ SEMICOLONATZ PUNCTUATIONZIDENTIFIER_ENDZ IDENTIFIERNAMEZEXTRAZURIZURLZ EXTRAS_LISTZEXTRASZ _regex_strVERBOSE IGNORECASEZVERSION_PEP440ZVERSION_LEGACYZ VERSION_ONEZ VERSION_MANYZ _VERSION_SPECZsetParseActionZ VERSION_SPECZMARKER_SEPERATORZMARKERZVERSION_AND_MARKERZURL_AND_MARKERZNAMED_REQUIREMENTr3objectr1rrrrsf              PK!" ""4_vendor/packaging/__pycache__/markers.cpython-38.pycnu[U Qab/ @s@ddlmZmZmZddlZddlZddlZddlZddlm Z m Z m Z m Z ddlm Z mZmZmZddlmZddlmZddlmZmZd d d d d gZGdd d eZGdd d eZGdd d eZGdddeZGdddeZGdddeZ GdddeZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"d#d"ddddd+Z#e"$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&$d8d-ed9ed:BZ'e'$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*$d>d-ed?+Z,ed@+Z-eZ.e*ee,e.e-BZ/e.e/e e(e.>e e.e Z0dAdBZ1dSdDdEZ2dFd-dGd-ej3ej4ej5ej6ej7ej8dHZ9dIdJZ:eZ;dKdLZdQd Z?GdRd d eZ@dS)T)absolute_importdivisionprint_functionN)ParseException ParseResults stringStart stringEnd) ZeroOrMoreGroupForward QuotedString)Literal) string_types) SpecifierInvalidSpecifier InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE An invalid marker was found, users should refer to PEP 508. N__name__ __module__ __qualname____doc__rrH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/markers.pyrsc@seZdZdZdS)rzP An invalid operation was attempted on a value that doesn't support it. Nrrrrrrsc@seZdZdZdS)rz\ A name was attempted to be used that does not exist inside of the environment. Nrrrrrr%sc@s,eZdZddZddZddZddZd S) NodecCs ||_dSN)value)selfr rrr__init__.sz Node.__init__cCs t|jSr)strr r!rrr__str__1sz Node.__str__cCsd|jjt|S)Nz <{0}({1!r})>)format __class__rr#r$rrr__repr__4sz Node.__repr__cCstdSr)NotImplementedErrorr$rrr serialize7szNode.serializeN)rrrr"r%r(r*rrrrr,src@seZdZddZdS)VariablecCst|Srr#r$rrrr*=szVariable.serializeNrrrr*rrrrr+;sr+c@seZdZddZdS)ValuecCs d|S)Nz"{0}")r&r$rrrr*CszValue.serializeNr-rrrrr.Asr.c@seZdZddZdS)OpcCst|Srr,r$rrrr*Isz Op.serializeNr-rrrrr/Gsr/implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_version sys_platformos_nameos.name sys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationZextra)r;r<r=r>r?r@cCstt|d|dSNr)r+ALIASESgetsltrrrirHz=====>=<=!=z~=><not inincCs t|dSrA)r/rDrrrrHwrI'"cCs t|dSrA)r.rDrrrrHzrIandorcCs t|dSrA)tuplerDrrrrHrI()cCs t|trdd|DS|SdS)NcSsg|] }t|qSr)_coerce_parse_result).0irrr sz(_coerce_parse_result..) isinstancer)resultsrrrrYs rYTcCst|tttfstt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rnd|Sdd|dSn"t|trddd |DS|SdS) Nrrcss|]}t|ddVqdS)F)firstN)_format_markerrZmrrr sz!_format_marker.. rWrXcSsg|] }|qSr)r*rarrrr\sz"_format_marker..)r]listrVrAssertionErrorlenr`join)markerr_innerrrrr`s    r`cCs||kSrrlhsrhsrrrrHrIcCs||kSrrrkrrrrHrI)rQrPrOrLrJrMrKrNcCslztd||g}Wntk r.Yn X||St|}|dkrbtd||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.) rrhr*rcontains _operatorsrCrr&)rloprmspecZoperrrr_eval_ops  rscCs&||t}|tkr"td||S)Nz/{0!r} does not exist in evaluation environment.)rC _undefinedrr&) environmentnamer rrr_get_envs  rwc Csgg}|D]}t|tttfs"tt|trB|dt||q t|tr|\}}}t|trtt||j }|j }n|j }t||j }|dt |||q |dkst|dkr |gq t dd|DS)N)rTrUrUcss|]}t|VqdSr)all)rZitemrrrrcsz$_evaluate_markers..) r]rerVrrfappend_evaluate_markersr+rwr rsany) ZmarkersrugroupsrirlrqrmZ lhs_valueZ rhs_valuerrrr|s"        r|cCs2d|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r& releaselevelr#serial)infoversionZkindrrrformat_full_versions  rc Cslttdr ttjj}tjj}nd}d}||tjtt t tt t t ddtjd S)Nimplementation0rn) r2r0r:r6r4r7r5r3r1r8r9) hasattrsysrrrrvosplatformmachinereleasesystemr8r@)Ziverr2rrrrs"   c@s.eZdZddZddZddZd dd ZdS) rc Cs`ztt||_WnFtk rZ}z(d|||j|jd}t|W5d}~XYnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rYMARKERZ parseString_markersrr&Zlocr)r!rieZerr_strrrrr"szMarker.__init__cCs t|jSr)r`rr$rrrr%szMarker.__str__cCsdt|S)Nz)r&r#r$rrrr(szMarker.__repr__NcCs$t}|dk r||t|j|S)a$Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Python process. N)rupdater|r)r!ruZcurrent_environmentrrrevaluate s  zMarker.evaluate)N)rrrr"r%r(rrrrrrs)T)AZ __future__rrroperatorrrrZsetuptools.extern.pyparsingrrrrr r r r r LZ_compatrZ specifiersrr__all__ ValueErrorrrrobjectrr+r.r/ZVARIABLErBZsetParseActionZ VERSION_CMPZ MARKER_OPZ MARKER_VALUEZBOOLOPZ MARKER_VARZ MARKER_ITEMsuppressZLPARENZRPARENZ MARKER_EXPRZ MARKER_ATOMrrYr`ltleeqnegegtrprsrtrwr|rrrrrrrs              PK!*q6_vendor/packaging/__pycache__/__about__.cpython-38.pycnu[U Qab@sPddlmZmZmZdddddddd gZd Zd Zd Zd ZdZ dZ dZ de Z dS))absolute_importdivisionprint_function __title__ __summary____uri__ __version__ __author__ __email__ __license__ __copyright__Z packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz16.8z)Donald Stufft and individual contributorszdonald@stufft.ioz"BSD or Apache License, Version 2.0zCopyright 2014-2016 %sN) Z __future__rrr__all__rrrrr r r r rrJ/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/__about__.pys"PK!rj;_vendor/packaging/__pycache__/__init__.cpython-38.opt-1.pycnu[U Qab@sTddlmZmZmZddlmZmZmZmZm Z m Z m Z m Z dddddd d d gZ d S) )absolute_importdivisionprint_function) __author__ __copyright__ __email__ __license__ __summary__ __title____uri__ __version__r r r r rrr rN)Z __future__rrr __about__rrrr r r r r __all__rrI/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/__init__.pys(PK!dR 8_vendor/packaging/__pycache__/_structures.cpython-38.pycnu[U Qab@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)InfinitycCsdS)NrselfrrL/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/_structures.py__repr__ szInfinity.__repr__cCs tt|SNhashreprrrrr __hash__ szInfinity.__hash__cCsdSNFrrotherrrr __lt__szInfinity.__lt__cCsdSrrrrrr __le__szInfinity.__le__cCs t||jSr  isinstance __class__rrrr __eq__szInfinity.__eq__cCst||j Sr rrrrr __ne__szInfinity.__ne__cCsdSNTrrrrr __gt__szInfinity.__gt__cCsdSrrrrrr __ge__szInfinity.__ge__cCstSr )NegativeInfinityrrrr __neg__!szInfinity.__neg__N __name__ __module__ __qualname__r rrrrrrrrrrrr rsrc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)rcCsdS)Nz -Infinityrrrrr r )szNegativeInfinity.__repr__cCs tt|Sr r rrrr r,szNegativeInfinity.__hash__cCsdSrrrrrr r/szNegativeInfinity.__lt__cCsdSrrrrrr r2szNegativeInfinity.__le__cCs t||jSr rrrrr r5szNegativeInfinity.__eq__cCst||j Sr rrrrr r8szNegativeInfinity.__ne__cCsdSrrrrrr r;szNegativeInfinity.__gt__cCsdSrrrrrr r>szNegativeInfinity.__ge__cCstSr )rrrrr rAszNegativeInfinity.__neg__Nrrrrr r'srN)Z __future__rrrobjectrrrrrr sPK!gn݇))4_vendor/packaging/__pycache__/version.cpython-38.pycnu[U Qab$- @sddlmZmZmZddlZddlZddlZddlmZddddd gZ e d d d d dddgZ ddZ Gddde ZGdddeZGdddeZedejZddddddZddZddZdZGd ddeZd!d"Zed#Zd$d%Zd&d'ZdS)()absolute_importdivisionprint_functionN)InfinityparseVersion LegacyVersionInvalidVersionVERSION_PATTERN_VersionepochreleasedevprepostlocalcCs,z t|WStk r&t|YSXdS)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. N)rr r )versionrH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.pyrs c@seZdZdZdS)r zF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrrrr $sc@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS) _BaseVersioncCs t|jSN)hash_keyselfrrr__hash__,sz_BaseVersion.__hash__cCs||ddS)NcSs||kSrrsorrr0z%_BaseVersion.__lt__.._comparerotherrrr__lt__/sz_BaseVersion.__lt__cCs||ddS)NcSs||kSrrr!rrrr$3r%z%_BaseVersion.__le__..r&r(rrr__le__2sz_BaseVersion.__le__cCs||ddS)NcSs||kSrrr!rrrr$6r%z%_BaseVersion.__eq__..r&r(rrr__eq__5sz_BaseVersion.__eq__cCs||ddS)NcSs||kSrrr!rrrr$9r%z%_BaseVersion.__ge__..r&r(rrr__ge__8sz_BaseVersion.__ge__cCs||ddS)NcSs||kSrrr!rrrr$<r%z%_BaseVersion.__gt__..r&r(rrr__gt__;sz_BaseVersion.__gt__cCs||ddS)NcSs||kSrrr!rrrr$?r%z%_BaseVersion.__ne__..r&r(rrr__ne__>sz_BaseVersion.__ne__cCst|tstS||j|jSr) isinstancerNotImplementedr)rr)methodrrrr'As z_BaseVersion._compareN) rrrr r*r+r,r-r.r/r'rrrrr*src@s`eZdZddZddZddZeddZed d Zed d Z ed dZ eddZ dS)r cCst||_t|j|_dSr)str_version_legacy_cmpkeyr)rrrrr__init__Js zLegacyVersion.__init__cCs|jSrr4rrrr__str__NszLegacyVersion.__str__cCsdtt|S)Nzformatreprr3rrrr__repr__QszLegacyVersion.__repr__cCs|jSrr7rrrrpublicTszLegacyVersion.publiccCs|jSrr7rrrr base_versionXszLegacyVersion.base_versioncCsdSrrrrrrr\szLegacyVersion.localcCsdSNFrrrrr is_prerelease`szLegacyVersion.is_prereleasecCsdSr?rrrrris_postreleasedszLegacyVersion.is_postreleaseN) rrrr6r8r<propertyr=r>rr@rArrrrr Hs    z(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccs\t|D]F}t||}|r |dkr(q |dddkrF|dVq d|Vq dVdS)N.r 0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)r"partrrr_parse_version_partsrs   rScCszd}g}t|D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|}||fS)NrKrLz*final-Z00000000)rSlower startswithpopappendtuple)rr partsrRrrrr5s    r5a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@s|eZdZededejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZdS)rz^\s*z\s*$c
Cs|j|}|std|t|dr8t|dndtdd|ddDt	|d|d	t	|d
|dp|dt	|d
|dt
|dd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'r
rcss|]}t|VqdSr)int.0irrr	sz#Version.__init__..rrHZpre_lZpre_nZpost_lZpost_n1Zpost_n2Zdev_lZdev_nrr
rrrrr)_regexsearchr
r:rgroupr[rYrN_parse_letter_version_parse_local_versionr4_cmpkeyr
rrrrrr)rrmatchrrrr6s8zVersion.__init__cCsdtt|S)Nzr9rrrrr<szVersion.__repr__cCsg}|jjdkr$|d|jj|ddd|jjD|jjdk	rl|ddd|jjD|jjdk	r|d|jjd	|jjdk	r|d
|jjd	|jj	dk	r|dddd|jj	Dd|S)
Nr{0}!rHcss|]}t|VqdSrr3r]xrrrr_sz"Version.__str__..css|]}t|VqdSrrirjrrrr_sz.post{0}rz.dev{0}z+{0}css|]}t|VqdSrrirjrrrr_s)
r4r
rXr:joinrrrrrrrZrrrr8szVersion.__str__cCst|dddS)N+rrr3rNrrrrr=
szVersion.publiccCsLg}|jjdkr$|d|jj|ddd|jjDd|S)NrrhrHcss|]}t|VqdSrrirjrrrr_sz'Version.base_version..rl)r4r
rXr:rmrrnrrrr>s
zVersion.base_versioncCs$t|}d|kr |dddSdS)Nrorrp)rZversion_stringrrrrsz
Version.localcCst|jjp|jjSr)boolr4rrrrrrr@!szVersion.is_prereleasecCst|jjSr)rqr4rrrrrrA%szVersion.is_postreleaseN)rrrrecompilerVERBOSE
IGNORECASErar6r<r8rBr=r>rr@rArrrrrs"

#



cCsv|rZ|dkrd}|}|dkr&d}n(|dkr4d}n|dkrBd}n|dkrNd	}|t|fS|sr|rrd	}|t|fSdS)
NrZalphaaZbetab)rCrrErG)Zrevrr)rUr[)ZletterZnumberrrrrd*s rdz[\._-]cCs$|dk	r tddt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|s|nt|VqdSr)isdigitrUr[)r]rRrrrr_Qsz'_parse_local_version..)rY_local_version_seperatorsrN)rrrrreLsrecCsttttddt|}|dkr@|dkr@|dk	r@t}n|dkrLt}|dkrZt}|dkrft}|dkrvt}ntdd|D}||||||fS)NcSs|dkS)Nrr)rkrrrr$`r%z_cmpkey..css*|]"}t|tr|dfnt|fVqdS)rlN)r0r[rr\rrrr_sz_cmpkey..)rYreversedlist	itertools	dropwhilerr`rrrrfWs,
	rf)Z
__future__rrrcollectionsr}rrZ_structuresr__all__
namedtuplerr
ValueErrorr
objectrr	rsrtrMrOrSr5rrrdrzrerfrrrrsH! k
PK!4_vendor/packaging/__pycache__/_compat.cpython-38.pycnu[U

Qab\@sVddlmZmZmZddlZejddkZejddkZerDefZ	ne
fZ	ddZdS))absolute_importdivisionprint_functionNcs&Gfddd}t|ddiS)z/
    Create a base class with a metaclass.
    cseZdZfddZdS)z!with_metaclass..metaclasscs||S)N)clsnameZ
this_basesdbasesmetarH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/_compat.py__new__sz)with_metaclass..metaclass.__new__N)__name__
__module____qualname__rrrrr	metaclasssrZtemporary_classr)typer)r
rrrrrwith_metaclasssr)Z
__future__rrrsysversion_infoZPY2ZPY3strZstring_typesZ
basestringrrrrrsPK!*HMHM7_vendor/packaging/__pycache__/specifiers.cpython-38.pycnu[U

Qabym@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGdddeZGdd	d	e
ejeZGd
ddeZGdd
d
eZddZGdddeZedZddZddZGdddeZdS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)Version
LegacyVersionparsec@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rrK/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/specifiers.pyrsrc@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nrselfrrr__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nrrrrr__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nrrotherrrr__eq__$szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrrrrr__ne__+szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrrrrprereleases2szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrvaluerrrr9sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nrritemrrrrcontains@szBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterablerrrrfilterFszBaseSpecifier.filter)N)N)rr
rabcabstractmethodrrrrabstractpropertyrsetterr r"rrrrrs 





rc@seZdZiZd ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZeddZejddZddZd!ddZd"ddZdS)#_IndividualSpecifierNcCsF|j|}|std||d|df|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecrmatchrrr__init__Rsz_IndividualSpecifier.__init__cCs0|jdk	rd|jnd}d|jjt||S)N, prereleases={0!r}r(z<{0}({1!r}{2})>)r1r-r	__class__rstrrZprerrr__repr___sz_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r-r0rrrrrlsz_IndividualSpecifier.__str__cCs
t|jSN)hashr0rrrrrosz_IndividualSpecifier.__hash__cCsPt|tr4z||}WqDtk
r0tYSXnt||jsDtS|j|jkSr:
isinstancerr6rNotImplementedr0rrrrrrs
z_IndividualSpecifier.__eq__cCsPt|tr4z||}WqDtk
r0tYSXnt||jsDtS|j|jkSr:r<rrrrr}s
z_IndividualSpecifier.__ne__cCst|d|j|S)Nz_compare_{0})getattrr-
_operators)roprrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|Sr:)r=r	rr
rr*rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nrr0rrrrr)sz_IndividualSpecifier.operatorcCs
|jdS)NrrErrrrr*sz_IndividualSpecifier.versioncCs|jSr:r1rrrrrsz _IndividualSpecifier.prereleasescCs
||_dSr:rFrrrrrscCs
||Sr:r rrrrr__contains__sz!_IndividualSpecifier.__contains__cCs:|dkr|j}||}|jr&|s&dS||j||jSNF)rrD
is_prereleaserBr)r*rrrrr s

z_IndividualSpecifier.containsccsd}g}d|dk	r|ndi}|D]B}||}|j|f|r |jrX|sX|jsX||q d}|Vq |s||r||D]
}|VqpdS)NFrT)rDr rKrappend)rr!rZyieldedfound_prereleaseskwr*parsed_versionrrrr"s"
z_IndividualSpecifier.filter)r(N)N)N)rr
rr@r4r9rrrrrBrDpropertyr)r*rr&rIr r"rrrrr'Ns(







r'c@sveZdZdZededejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ^\s*\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)==!=<=>=<>cCst|tstt|}|Sr:)r=r	r7rCrrrrDs
zLegacySpecifier._coerce_versioncCs|||kSr:rDrprospectiver2rrr_compare_equalszLegacySpecifier._compare_equalcCs|||kSr:r`rarrr_compare_not_equalsz"LegacySpecifier._compare_not_equalcCs|||kSr:r`rarrr_compare_less_than_equalsz(LegacySpecifier._compare_less_than_equalcCs|||kSr:r`rarrr_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs|||kSr:r`rarrr_compare_less_thansz"LegacySpecifier._compare_less_thancCs|||kSr:r`rarrr_compare_greater_thansz%LegacySpecifier._compare_greater_thanN)rr
r
_regex_strrecompileVERBOSE
IGNORECASEr+r@rDrcrdrerfrgrhrrrrrQs(

	rQcstfdd}|S)Ncst|tsdS|||SrJ)r=rrafnrrwrappeds
z)_require_version_compare..wrapped)	functoolswraps)rorprrnr_require_version_compare
srsc	@seZdZdZededejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?sz/Specifier._compare_compatible...*r]rZ)joinlist	itertools	takewhile_version_splitrB)rrbr2prefixrrr_compare_compatibleszSpecifier._compare_compatiblecCsp|drPt|j}t|dd}tt|}|dt|}t||\}}nt|}|jsht|j}||kS)Nr})endswithrZpublicrr7len_pad_versionlocalrarrrrcs


zSpecifier._compare_equalcCs|||Sr:)rcrarrrrdszSpecifier._compare_not_equalcCs|t|kSr:rrarrrresz"Specifier._compare_less_than_equalcCs|t|kSr:rrarrrrfsz%Specifier._compare_greater_than_equalcCs<t|}||ksdS|js8|jr8t|jt|jkr8dSdSNFT)rrKbase_versionrarrrrgszSpecifier._compare_less_thancCs^t|}||ksdS|js8|jr8t|jt|jkr8dS|jdk	rZt|jt|jkrZdSdSr)rZis_postreleaserrrarrrrhs
zSpecifier._compare_greater_thancCst|t|kSr:)r7lowerrarrr_compare_arbitraryszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|dkrN|dkr@|dr@|dd}t|jrNdSdS)N)rZr]r\rurvrZr}rTF)r1r0rr
rK)rr)r*rrrrs


zSpecifier.prereleasescCs
||_dSr:rFrrrrrsN)rr
rrirjrkrlrmr+r@rsrrcrdrerfrgrhrrPrr&rrrrrtsD_



"





rtz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}|dD],}t|}|r0||q||q|S)Nrw)split
_prefix_regexr,extendgroupsrL)r*resultrr3rrrr's
rc
Csgg}}|ttdd||ttdd|||t|dd||t|dd|ddgtdt|dt|d|ddgtdt|dt|dttj|ttj|fS)NcSs|Sr:isdigitryrrrr{6z_pad_version..cSs|Sr:rryrrrr{7rrr0)rLrrrrinsertmaxchain)leftrightZ
left_splitZright_splitrrrr2s 
""rc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr(Nc	Csndd|dD}t}|D]:}z|t|Wqtk
rV|t|YqXqt||_||_dS)NcSsg|]}|r|qSr)r/.0srrr
Rsz)SpecifierSet.__init__..,)	rsetaddrtrrQ	frozenset_specsr1)rZ
specifiersrZparsed	specifierrrrr4Os
zSpecifierSet.__init__cCs*|jdk	rd|jnd}dt||S)Nr5r(z)r1r-rr7r8rrrr9ds
zSpecifierSet.__repr__cCsdtdd|jDS)Nrcss|]}t|VqdSr:)r7rrrr	nsz'SpecifierSet.__str__..)r~sortedrrrrrrmszSpecifierSet.__str__cCs
t|jSr:)r;rrrrrrpszSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r=rrr>rrr1
ValueError)rrrrrr__and__ss 





zSpecifierSet.__and__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkSr:r=rrr'r7r>rrrrrrs



zSpecifierSet.__eq__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkSr:rrrrrrs



zSpecifierSet.__ne__cCs
t|jSr:)rrrrrr__len__szSpecifierSet.__len__cCs
t|jSr:)iterrrrrr__iter__szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd|jDS)Ncss|]}|jVqdSr:rrrrrrsz+SpecifierSet.prereleases..)r1ranyrrrrrs

zSpecifierSet.prereleasescCs
||_dSr:rFrrrrrscCs
||Sr:rGrHrrrrIszSpecifierSet.__contains__csLtttfstdkr$|js2jr2dStfdd|jDS)NFc3s|]}|jdVqdS)rNrGrrrrrrsz(SpecifierSet.contains..)r=r	rr
rrKallrrrrrr s
zSpecifierSet.containscCs|dkr|j}|jr6|jD]}|j|t|d}q|Sg}g}|D]P}t|ttfs^t|}n|}t|trnqB|jr|s|s|	|qB|	|qB|s|r|dkr|S|SdS)Nr)
rrr"boolr=r	rr
rKrL)rr!rr2ZfilteredrMrrOrrrr"s*



zSpecifierSet.filter)r(N)N)N)rr
rr4r9rrrrrrrrPrr&rIr r"rrrrrMs 
	




r)Z
__future__rrrr#rqrrjZ_compatrrr*rr	r
rrABCMetaobjectrr'rQrsrtrkrrrrrrrrs&9	4	
PK!dR

>_vendor/packaging/__pycache__/_structures.cpython-38.opt-1.pycnu[U

Qab@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)InfinitycCsdS)NrselfrrL/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/_structures.py__repr__	szInfinity.__repr__cCstt|SNhashreprrrrr	__hash__szInfinity.__hash__cCsdSNFrrotherrrr	__lt__szInfinity.__lt__cCsdSrrrrrr	__le__szInfinity.__le__cCst||jSr
isinstance	__class__rrrr	__eq__szInfinity.__eq__cCst||jSrrrrrr	__ne__szInfinity.__ne__cCsdSNTrrrrr	__gt__szInfinity.__gt__cCsdSrrrrrr	__ge__szInfinity.__ge__cCstSr)NegativeInfinityrrrr	__neg__!szInfinity.__neg__N__name__
__module____qualname__r
rrrrrrrrrrrr	rsrc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)rcCsdS)Nz	-Infinityrrrrr	r
)szNegativeInfinity.__repr__cCstt|Srrrrrr	r,szNegativeInfinity.__hash__cCsdSrrrrrr	r/szNegativeInfinity.__lt__cCsdSrrrrrr	r2szNegativeInfinity.__le__cCst||jSrrrrrr	r5szNegativeInfinity.__eq__cCst||jSrrrrrr	r8szNegativeInfinity.__ne__cCsdSrrrrrr	r;szNegativeInfinity.__gt__cCsdSrrrrrr	r>szNegativeInfinity.__ge__cCstSr)rrrrr	rAszNegativeInfinity.__neg__Nrrrrr	r'srN)Z
__future__rrrobjectrrrrrr	sPK!:_vendor/packaging/__pycache__/_compat.cpython-38.opt-1.pycnu[U

Qab\@sVddlmZmZmZddlZejddkZejddkZerDefZ	ne
fZ	ddZdS))absolute_importdivisionprint_functionNcs&Gfddd}t|ddiS)z/
    Create a base class with a metaclass.
    cseZdZfddZdS)z!with_metaclass..metaclasscs||S)N)clsnameZ
this_basesdbasesmetarH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/_compat.py__new__sz)with_metaclass..metaclass.__new__N)__name__
__module____qualname__rrrrr	metaclasssrZtemporary_classr)typer)r
rrrrrwith_metaclasssr)Z
__future__rrrsysversion_infoZPY2ZPY3strZstring_typesZ
basestringrrrrrsPK!*q<_vendor/packaging/__pycache__/__about__.cpython-38.opt-1.pycnu[U

Qab@sPddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS))absolute_importdivisionprint_function	__title____summary____uri____version__
__author__	__email____license__
__copyright__Z	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz16.8z)Donald Stufft and individual contributorszdonald@stufft.ioz"BSD or Apache License, Version 2.0zCopyright 2014-2016 %sN)
Z
__future__rrr__all__rrrrr	r
rrrrJ/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/__about__.pys"PK!6	8_vendor/packaging/__pycache__/utils.cpython-38.opt-1.pycnu[U

Qab@s2ddlmZmZmZddlZedZddZdS))absolute_importdivisionprint_functionNz[-_.]+cCstd|S)N-)_canonicalize_regexsublower)namer
F/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/utils.pycanonicalize_namesr)Z
__future__rrrrecompilerrr
r
r
rs
PK!*HMHM=_vendor/packaging/__pycache__/specifiers.cpython-38.opt-1.pycnu[U

Qabym@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGdddeZGdd	d	e
ejeZGd
ddeZGdd
d
eZddZGdddeZedZddZddZGdddeZdS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)Version
LegacyVersionparsec@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rrK/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/specifiers.pyrsrc@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nrselfrrr__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nrrrrr__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nrrotherrrr__eq__$szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrrrrr__ne__+szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrrrrprereleases2szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrvaluerrrr9sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nrritemrrrrcontains@szBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterablerrrrfilterFszBaseSpecifier.filter)N)N)rr
rabcabstractmethodrrrrabstractpropertyrsetterr r"rrrrrs 





rc@seZdZiZd ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZeddZejddZddZd!ddZd"ddZdS)#_IndividualSpecifierNcCsF|j|}|std||d|df|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecrmatchrrr__init__Rsz_IndividualSpecifier.__init__cCs0|jdk	rd|jnd}d|jjt||S)N, prereleases={0!r}r(z<{0}({1!r}{2})>)r1r-r	__class__rstrrZprerrr__repr___sz_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r-r0rrrrrlsz_IndividualSpecifier.__str__cCs
t|jSN)hashr0rrrrrosz_IndividualSpecifier.__hash__cCsPt|tr4z||}WqDtk
r0tYSXnt||jsDtS|j|jkSr:
isinstancerr6rNotImplementedr0rrrrrrs
z_IndividualSpecifier.__eq__cCsPt|tr4z||}WqDtk
r0tYSXnt||jsDtS|j|jkSr:r<rrrrr}s
z_IndividualSpecifier.__ne__cCst|d|j|S)Nz_compare_{0})getattrr-
_operators)roprrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|Sr:)r=r	rr
rr*rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nrr0rrrrr)sz_IndividualSpecifier.operatorcCs
|jdS)NrrErrrrr*sz_IndividualSpecifier.versioncCs|jSr:r1rrrrrsz _IndividualSpecifier.prereleasescCs
||_dSr:rFrrrrrscCs
||Sr:r rrrrr__contains__sz!_IndividualSpecifier.__contains__cCs:|dkr|j}||}|jr&|s&dS||j||jSNF)rrD
is_prereleaserBr)r*rrrrr s

z_IndividualSpecifier.containsccsd}g}d|dk	r|ndi}|D]B}||}|j|f|r |jrX|sX|jsX||q d}|Vq |s||r||D]
}|VqpdS)NFrT)rDr rKrappend)rr!rZyieldedfound_prereleaseskwr*parsed_versionrrrr"s"
z_IndividualSpecifier.filter)r(N)N)N)rr
rr@r4r9rrrrrBrDpropertyr)r*rr&rIr r"rrrrr'Ns(







r'c@sveZdZdZededejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ^\s*\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)==!=<=>=<>cCst|tstt|}|Sr:)r=r	r7rCrrrrDs
zLegacySpecifier._coerce_versioncCs|||kSr:rDrprospectiver2rrr_compare_equalszLegacySpecifier._compare_equalcCs|||kSr:r`rarrr_compare_not_equalsz"LegacySpecifier._compare_not_equalcCs|||kSr:r`rarrr_compare_less_than_equalsz(LegacySpecifier._compare_less_than_equalcCs|||kSr:r`rarrr_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs|||kSr:r`rarrr_compare_less_thansz"LegacySpecifier._compare_less_thancCs|||kSr:r`rarrr_compare_greater_thansz%LegacySpecifier._compare_greater_thanN)rr
r
_regex_strrecompileVERBOSE
IGNORECASEr+r@rDrcrdrerfrgrhrrrrrQs(

	rQcstfdd}|S)Ncst|tsdS|||SrJ)r=rrafnrrwrappeds
z)_require_version_compare..wrapped)	functoolswraps)rorprrnr_require_version_compare
srsc	@seZdZdZededejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?sz/Specifier._compare_compatible...*r]rZ)joinlist	itertools	takewhile_version_splitrB)rrbr2prefixrrr_compare_compatibleszSpecifier._compare_compatiblecCsp|drPt|j}t|dd}tt|}|dt|}t||\}}nt|}|jsht|j}||kS)Nr})endswithrZpublicrr7len_pad_versionlocalrarrrrcs


zSpecifier._compare_equalcCs|||Sr:)rcrarrrrdszSpecifier._compare_not_equalcCs|t|kSr:rrarrrresz"Specifier._compare_less_than_equalcCs|t|kSr:rrarrrrfsz%Specifier._compare_greater_than_equalcCs<t|}||ksdS|js8|jr8t|jt|jkr8dSdSNFT)rrKbase_versionrarrrrgszSpecifier._compare_less_thancCs^t|}||ksdS|js8|jr8t|jt|jkr8dS|jdk	rZt|jt|jkrZdSdSr)rZis_postreleaserrrarrrrhs
zSpecifier._compare_greater_thancCst|t|kSr:)r7lowerrarrr_compare_arbitraryszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|dkrN|dkr@|dr@|dd}t|jrNdSdS)N)rZr]r\rurvrZr}rTF)r1r0rr
rK)rr)r*rrrrs


zSpecifier.prereleasescCs
||_dSr:rFrrrrrsN)rr
rrirjrkrlrmr+r@rsrrcrdrerfrgrhrrPrr&rrrrrtsD_



"





rtz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}|dD],}t|}|r0||q||q|S)Nrw)split
_prefix_regexr,extendgroupsrL)r*resultrr3rrrr's
rc
Csgg}}|ttdd||ttdd|||t|dd||t|dd|ddgtdt|dt|d|ddgtdt|dt|dttj|ttj|fS)NcSs|Sr:isdigitryrrrr{6z_pad_version..cSs|Sr:rryrrrr{7rrr0)rLrrrrinsertmaxchain)leftrightZ
left_splitZright_splitrrrr2s 
""rc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr(Nc	Csndd|dD}t}|D]:}z|t|Wqtk
rV|t|YqXqt||_||_dS)NcSsg|]}|r|qSr)r/.0srrr
Rsz)SpecifierSet.__init__..,)	rsetaddrtrrQ	frozenset_specsr1)rZ
specifiersrZparsed	specifierrrrr4Os
zSpecifierSet.__init__cCs*|jdk	rd|jnd}dt||S)Nr5r(z)r1r-rr7r8rrrr9ds
zSpecifierSet.__repr__cCsdtdd|jDS)Nrcss|]}t|VqdSr:)r7rrrr	nsz'SpecifierSet.__str__..)r~sortedrrrrrrmszSpecifierSet.__str__cCs
t|jSr:)r;rrrrrrpszSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r=rrr>rrr1
ValueError)rrrrrr__and__ss 





zSpecifierSet.__and__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkSr:r=rrr'r7r>rrrrrrs



zSpecifierSet.__eq__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkSr:rrrrrrs



zSpecifierSet.__ne__cCs
t|jSr:)rrrrrr__len__szSpecifierSet.__len__cCs
t|jSr:)iterrrrrr__iter__szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd|jDS)Ncss|]}|jVqdSr:rrrrrrsz+SpecifierSet.prereleases..)r1ranyrrrrrs

zSpecifierSet.prereleasescCs
||_dSr:rFrrrrrscCs
||Sr:rGrHrrrrIszSpecifierSet.__contains__csLtttfstdkr$|js2jr2dStfdd|jDS)NFc3s|]}|jdVqdS)rNrGrrrrrrsz(SpecifierSet.contains..)r=r	rr
rrKallrrrrrr s
zSpecifierSet.containscCs|dkr|j}|jr6|jD]}|j|t|d}q|Sg}g}|D]P}t|ttfs^t|}n|}t|trnqB|jr|s|s|	|qB|	|qB|s|r|dkr|S|SdS)Nr)
rrr"boolr=r	rr
rKrL)rr!rr2ZfilteredrMrrOrrrr"s*



zSpecifierSet.filter)r(N)N)N)rr
rr4r9rrrrrrrrPrr&rIr r"rrrrrMs 
	




r)Z
__future__rrrr#rqrrjZ_compatrrr*rr	r
rrABCMetaobjectrr'rQrsrtrkrrrrrrrrs&9	4	
PK!yt?_vendor/packaging/__pycache__/requirements.cpython-38.opt-1.pycnu[U

Qab@srddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZmZdd	lmZmZmZGd
ddeZeejejZ ed!Z"ed
!Z#ed!Z$ed!Z%ed!Z&ed!Z'ed!Z(edZ)e ee)e BZ*ee ee*Z+e+dZ,e+Z-eddZ.e(e.Z/e-ee&e-Z0e"e
e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7ee&e7ddddZ8e
e$e8e%e8BZ9e9:dde	e9dZ;e;:dde	edZe:d de'Ze/e
e=Z?e,e
e1e?e>BZ@ee@eZAGd!d"d"eBZCdS)#)absolute_importdivisionprint_functionN)stringStart	stringEndoriginalTextForParseException)
ZeroOrMoreWordOptionalRegexCombine)Literal)parse)MARKER_EXPRMarker)LegacySpecifier	SpecifierSpecifierSetc@seZdZdZdS)InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rrM/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)Z
joinStringZadjacent	_raw_speccCs
|jpdS)N)r'sltrrr6r-	specifiercCs|dS)Nrrr)rrrr-9r.markercCst||j|jS)N)rZ_original_startZ
_original_endr)rrrr-=r.c@s(eZdZdZddZddZddZdS)	RequirementzParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    c
Cszt|}Wn@tk
rN}z"td||j|jdW5d}~XYnX|j|_|jrt|j}|j	r|j
r|j	s|j
std|j|_nd|_t|jr|j
ng|_t|j|_|jr|jnd|_dS)Nz+Invalid requirement, parse error at "{0!r}"zInvalid URL given)REQUIREMENTZparseStringrrformatZlocr$r%urlparseZschemeZnetlocsetr&ZasListrr/r0)selfZrequirement_stringZreqeZ
parsed_urlrrr__init__Xs,
zRequirement.__init__cCsz|jg}|jr*|ddt|j|jr@|t|j|jrX|d|j|j	rp|d|j	d|S)Nz[{0}]r!z@ {0}z; {0}r()
r$r&appendr4joinsortedr/strr%r0)r7partsrrr__str__mszRequirement.__str__cCsdt|S)Nz)r4r=)r7rrr__repr__~szRequirement.__repr__N)rrrrr9r?r@rrrrr1Ksr1)DZ
__future__rrrstringreZsetuptools.extern.pyparsingrrrrr	r
rrr
rLZ"setuptools.extern.six.moves.urllibrr5ZmarkersrrZ
specifiersrrr
ValueErrorrZ
ascii_lettersZdigitsZALPHANUMsuppressZLBRACKETZRBRACKETZLPARENZRPARENCOMMAZ	SEMICOLONATZPUNCTUATIONZIDENTIFIER_ENDZ
IDENTIFIERNAMEZEXTRAZURIZURLZEXTRAS_LISTZEXTRASZ
_regex_strVERBOSE
IGNORECASEZVERSION_PEP440ZVERSION_LEGACYZVERSION_ONEZVERSION_MANYZ
_VERSION_SPECZsetParseActionZVERSION_SPECZMARKER_SEPERATORZMARKERZVERSION_AND_MARKERZURL_AND_MARKERZNAMED_REQUIREMENTr3objectr1rrrrsfPK!6	2_vendor/packaging/__pycache__/utils.cpython-38.pycnu[U

Qab@s2ddlmZmZmZddlZedZddZdS))absolute_importdivisionprint_functionNz[-_.]+cCstd|S)N-)_canonicalize_regexsublower)namer
F/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/utils.pycanonicalize_namesr)Z
__future__rrrrecompilerrr
r
r
rs
PK!gn݇)):_vendor/packaging/__pycache__/version.cpython-38.opt-1.pycnu[U

Qab$-	@sddlmZmZmZddlZddlZddlZddlmZddddd	gZ	e
d
ddd
dddgZddZGddde
ZGdddeZGdddeZedejZddddddZddZddZdZGd ddeZd!d"Zed#Zd$d%Zd&d'ZdS)()absolute_importdivisionprint_functionN)InfinityparseVersion
LegacyVersionInvalidVersionVERSION_PATTERN_VersionepochreleasedevprepostlocalcCs,z
t|WStk
r&t|YSXdS)z
    Parse the given version string and return either a :class:`Version` object
    or a :class:`LegacyVersion` object depending on if the given version is
    a valid PEP 440 version or a legacy version.
    N)rr
r	)versionrH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.pyrs
c@seZdZdZdS)r
zF
    An invalid version was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rrrrr
$sc@sLeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
dS)_BaseVersioncCs
t|jSN)hash_keyselfrrr__hash__,sz_BaseVersion.__hash__cCs||ddS)NcSs||kSrrsorrr0z%_BaseVersion.__lt__.._comparerotherrrr__lt__/sz_BaseVersion.__lt__cCs||ddS)NcSs||kSrrr!rrrr$3r%z%_BaseVersion.__le__..r&r(rrr__le__2sz_BaseVersion.__le__cCs||ddS)NcSs||kSrrr!rrrr$6r%z%_BaseVersion.__eq__..r&r(rrr__eq__5sz_BaseVersion.__eq__cCs||ddS)NcSs||kSrrr!rrrr$9r%z%_BaseVersion.__ge__..r&r(rrr__ge__8sz_BaseVersion.__ge__cCs||ddS)NcSs||kSrrr!rrrr$<r%z%_BaseVersion.__gt__..r&r(rrr__gt__;sz_BaseVersion.__gt__cCs||ddS)NcSs||kSrrr!rrrr$?r%z%_BaseVersion.__ne__..r&r(rrr__ne__>sz_BaseVersion.__ne__cCst|tstS||j|jSr)
isinstancerNotImplementedr)rr)methodrrrr'As
z_BaseVersion._compareN)rrrr r*r+r,r-r.r/r'rrrrr*src@s`eZdZddZddZddZeddZed	d
ZeddZ	ed
dZ
eddZdS)r	cCst||_t|j|_dSr)str_version_legacy_cmpkeyr)rrrrr__init__Js
zLegacyVersion.__init__cCs|jSrr4rrrr__str__NszLegacyVersion.__str__cCsdtt|S)Nzformatreprr3rrrr__repr__QszLegacyVersion.__repr__cCs|jSrr7rrrrpublicTszLegacyVersion.publiccCs|jSrr7rrrrbase_versionXszLegacyVersion.base_versioncCsdSrrrrrrr\szLegacyVersion.localcCsdSNFrrrrr
is_prerelease`szLegacyVersion.is_prereleasecCsdSr?rrrrris_postreleasedszLegacyVersion.is_postreleaseN)rrrr6r8r<propertyr=r>rr@rArrrrr	Hs



z(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccs\t|D]F}t||}|r
|dkr(q
|dddkrF|dVq
d|Vq
dVdS)N.r
0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)r"partrrr_parse_version_partsrsrScCszd}g}t|D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|}||fS)NrKrLz*final-Z00000000)rSlower
startswithpopappendtuple)rr
partsrRrrrr5s


r5a
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@s|eZdZededejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZdS)rz^\s*z\s*$c
Cs|j|}|std|t|dr8t|dndtdd|ddDt	|d|d	t	|d
|dp|dt	|d
|dt
|dd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'r
rcss|]}t|VqdSr)int.0irrr	sz#Version.__init__..rrHZpre_lZpre_nZpost_lZpost_n1Zpost_n2Zdev_lZdev_nrr
rrrrr)_regexsearchr
r:rgroupr[rYrN_parse_letter_version_parse_local_versionr4_cmpkeyr
rrrrrr)rrmatchrrrr6s8zVersion.__init__cCsdtt|S)Nzr9rrrrr<szVersion.__repr__cCsg}|jjdkr$|d|jj|ddd|jjD|jjdk	rl|ddd|jjD|jjdk	r|d|jjd	|jjdk	r|d
|jjd	|jj	dk	r|dddd|jj	Dd|S)
Nr{0}!rHcss|]}t|VqdSrr3r]xrrrr_sz"Version.__str__..css|]}t|VqdSrrirjrrrr_sz.post{0}rz.dev{0}z+{0}css|]}t|VqdSrrirjrrrr_s)
r4r
rXr:joinrrrrrrrZrrrr8szVersion.__str__cCst|dddS)N+rrr3rNrrrrr=
szVersion.publiccCsLg}|jjdkr$|d|jj|ddd|jjDd|S)NrrhrHcss|]}t|VqdSrrirjrrrr_sz'Version.base_version..rl)r4r
rXr:rmrrnrrrr>s
zVersion.base_versioncCs$t|}d|kr |dddSdS)Nrorrp)rZversion_stringrrrrsz
Version.localcCst|jjp|jjSr)boolr4rrrrrrr@!szVersion.is_prereleasecCst|jjSr)rqr4rrrrrrA%szVersion.is_postreleaseN)rrrrecompilerVERBOSE
IGNORECASErar6r<r8rBr=r>rr@rArrrrrs"

#



cCsv|rZ|dkrd}|}|dkr&d}n(|dkr4d}n|dkrBd}n|dkrNd	}|t|fS|sr|rrd	}|t|fSdS)
NrZalphaaZbetab)rCrrErG)Zrevrr)rUr[)ZletterZnumberrrrrd*s rdz[\._-]cCs$|dk	r tddt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|s|nt|VqdSr)isdigitrUr[)r]rRrrrr_Qsz'_parse_local_version..)rY_local_version_seperatorsrN)rrrrreLsrecCsttttddt|}|dkr@|dkr@|dk	r@t}n|dkrLt}|dkrZt}|dkrft}|dkrvt}ntdd|D}||||||fS)NcSs|dkS)Nrr)rkrrrr$`r%z_cmpkey..css*|]"}t|tr|dfnt|fVqdS)rlN)r0r[rr\rrrr_sz_cmpkey..)rYreversedlist	itertools	dropwhilerr`rrrrfWs,
	rf)Z
__future__rrrcollectionsr}rrZ_structuresr__all__
namedtuplerr
ValueErrorr
objectrr	rsrtrMrOrSr5rrrdrzrerfrrrrsH! k
PK!$ʤl"l":_vendor/packaging/__pycache__/markers.cpython-38.opt-1.pycnu[U

Qab/ 	@s@ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZmZd	d
ddd
gZGdd	d	eZGdd
d
eZGdddeZGdddeZGdddeZGdddeZ GdddeZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"d#d"ddddd+Z#e"$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&$d8d-ed9ed:BZ'e'$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*$d>d-ed?+Z,ed@+Z-eZ.e*ee,e.e-BZ/e.e/e
e(e.>ee.eZ0dAdBZ1dSdDdEZ2dFd-dGd-ej3ej4ej5ej6ej7ej8dHZ9dIdJZ:eZ;dKdLZdQd
Z?GdRddeZ@dS)T)absolute_importdivisionprint_functionN)ParseExceptionParseResultsstringStart	stringEnd)
ZeroOrMoreGroupForwardQuotedString)Literal)string_types)	SpecifierInvalidSpecifier
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N__name__
__module____qualname____doc__rrH/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/markers.pyrsc@seZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    Nrrrrrrsc@seZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    Nrrrrrr%sc@s,eZdZddZddZddZddZd	S)
NodecCs
||_dSN)value)selfr rrr__init__.sz
Node.__init__cCs
t|jSr)strr r!rrr__str__1szNode.__str__cCsd|jjt|S)Nz<{0}({1!r})>)format	__class__rr#r$rrr__repr__4sz
Node.__repr__cCstdSr)NotImplementedErrorr$rrr	serialize7szNode.serializeN)rrrr"r%r(r*rrrrr,src@seZdZddZdS)VariablecCst|Srr#r$rrrr*=szVariable.serializeNrrrr*rrrrr+;sr+c@seZdZddZdS)ValuecCs
d|S)Nz"{0}")r&r$rrrr*CszValue.serializeNr-rrrrr.Asr.c@seZdZddZdS)OpcCst|Srr,r$rrrr*IszOp.serializeNr-rrrrr/Gsr/implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_nameos.namesys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationZextra)r;r<r=r>r?r@cCstt|d|dSNr)r+ALIASESgetsltrrrirHz=====>=<=!=z~=><not inincCst|dSrA)r/rDrrrrHwrI'"cCst|dSrA)r.rDrrrrHzrIandorcCst|dSrA)tuplerDrrrrHrI()cCs t|trdd|DS|SdS)NcSsg|]}t|qSr)_coerce_parse_result).0irrr
sz(_coerce_parse_result..)
isinstancer)resultsrrrrYs
rYTcCst|tr4t|dkr4t|dttfr4t|dSt|trndd|D}|rZd|Sdd|dSn"t|trddd	|DS|SdS)
Nrrcss|]}t|ddVqdS)F)firstN)_format_markerrZmrrr	sz!_format_marker.. rWrXcSsg|]}|qSr)r*rarrrr\sz"_format_marker..)r]listlenrVr`join)markerr_innerrrrr`s


r`cCs||kSrrlhsrhsrrrrHrIcCs||kSrrrjrrrrHrI)rQrPrOrLrJrMrKrNcCslztd||g}Wntk
r.YnX||St|}|dkrbtd||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.)	rrgr*rcontains
_operatorsrCrr&)rkoprlspecZoperrrr_eval_ops
rrcCs&||t}|tkr"td||S)Nz/{0!r} does not exist in evaluation environment.)rC
_undefinedrr&)environmentnamer rrr_get_envsrvc	Csgg}|D]}t|tr.|dt||q
t|tr|\}}}t|tr`t||j}|j}n|j}t||j}|dt|||q
|dkr
|gq
t	dd|DS)NrUcss|]}t|VqdSr)all)rZitemrrrrcsz$_evaluate_markers..)
r]reappend_evaluate_markersrVr+rvr rrany)	ZmarkersrtgroupsrhrkrprlZ	lhs_valueZ	rhs_valuerrrr{s



r{cCs2d|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r&releaselevelr#serial)infoversionZkindrrrformat_full_versions

rcCslttdr ttjj}tjj}nd}d}||tjtt	t
ttttddtjdS)Nimplementation0rm)r2r0r:r6r4r7r5r3r1r8r9)
hasattrsysrrrruosplatformmachinereleasesystemr8r@)Ziverr2rrrrs"

c@s.eZdZddZddZddZd
dd	ZdS)rc
Cs`ztt||_WnFtk
rZ}z(d|||j|jd}t|W5d}~XYnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rYMARKERZparseString_markersrr&Zlocr)r!rheZerr_strrrrr"szMarker.__init__cCs
t|jSr)r`rr$rrrr%szMarker.__str__cCsdt|S)Nz)r&r#r$rrrr(szMarker.__repr__NcCs$t}|dk	r||t|j|S)a$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N)rupdater{r)r!rtZcurrent_environmentrrrevaluate s	
zMarker.evaluate)N)rrrr"r%r(rrrrrrs)T)AZ
__future__rrroperatorrrrZsetuptools.extern.pyparsingrrrrr	r
rrr
LZ_compatrZ
specifiersrr__all__
ValueErrorrrrobjectrr+r.r/ZVARIABLErBZsetParseActionZVERSION_CMPZ	MARKER_OPZMARKER_VALUEZBOOLOPZ
MARKER_VARZMARKER_ITEMsuppressZLPARENZRPARENZMARKER_EXPRZMARKER_ATOMrrYr`ltleeqnegegtrorrrsrvr{rrrrrrrs	


PK!rj5_vendor/packaging/__pycache__/__init__.cpython-38.pycnu[U

Qab@sTddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZdddddd	d
dgZ
dS)
)absolute_importdivisionprint_function)
__author__
__copyright__	__email____license____summary__	__title____uri____version__rr
rr
rrr	rN)Z
__future__rrr	__about__rrrr	r
rrr
__all__rrI/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/__init__.pys(PK!'_vendor/packaging/utils.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

import re


_canonicalize_regex = re.compile(r"[-_.]+")


def canonicalize_name(name):
    # This is taken from PEP 503.
    return _canonicalize_regex.sub("-", name).lower()
PK!H/ / _vendor/packaging/markers.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

import operator
import os
import platform
import sys

from setuptools.extern.pyparsing import ParseException, ParseResults, stringStart, stringEnd
from setuptools.extern.pyparsing import ZeroOrMore, Group, Forward, QuotedString
from setuptools.extern.pyparsing import Literal as L  # noqa

from ._compat import string_types
from .specifiers import Specifier, InvalidSpecifier


__all__ = [
    "InvalidMarker", "UndefinedComparison", "UndefinedEnvironmentName",
    "Marker", "default_environment",
]


class InvalidMarker(ValueError):
    """
    An invalid marker was found, users should refer to PEP 508.
    """


class UndefinedComparison(ValueError):
    """
    An invalid operation was attempted on a value that doesn't support it.
    """


class UndefinedEnvironmentName(ValueError):
    """
    A name was attempted to be used that does not exist inside of the
    environment.
    """


class Node(object):

    def __init__(self, value):
        self.value = value

    def __str__(self):
        return str(self.value)

    def __repr__(self):
        return "<{0}({1!r})>".format(self.__class__.__name__, str(self))

    def serialize(self):
        raise NotImplementedError


class Variable(Node):

    def serialize(self):
        return str(self)


class Value(Node):

    def serialize(self):
        return '"{0}"'.format(self)


class Op(Node):

    def serialize(self):
        return str(self)


VARIABLE = (
    L("implementation_version") |
    L("platform_python_implementation") |
    L("implementation_name") |
    L("python_full_version") |
    L("platform_release") |
    L("platform_version") |
    L("platform_machine") |
    L("platform_system") |
    L("python_version") |
    L("sys_platform") |
    L("os_name") |
    L("os.name") |  # PEP-345
    L("sys.platform") |  # PEP-345
    L("platform.version") |  # PEP-345
    L("platform.machine") |  # PEP-345
    L("platform.python_implementation") |  # PEP-345
    L("python_implementation") |  # undocumented setuptools legacy
    L("extra")
)
ALIASES = {
    'os.name': 'os_name',
    'sys.platform': 'sys_platform',
    'platform.version': 'platform_version',
    'platform.machine': 'platform_machine',
    'platform.python_implementation': 'platform_python_implementation',
    'python_implementation': 'platform_python_implementation'
}
VARIABLE.setParseAction(lambda s, l, t: Variable(ALIASES.get(t[0], t[0])))

VERSION_CMP = (
    L("===") |
    L("==") |
    L(">=") |
    L("<=") |
    L("!=") |
    L("~=") |
    L(">") |
    L("<")
)

MARKER_OP = VERSION_CMP | L("not in") | L("in")
MARKER_OP.setParseAction(lambda s, l, t: Op(t[0]))

MARKER_VALUE = QuotedString("'") | QuotedString('"')
MARKER_VALUE.setParseAction(lambda s, l, t: Value(t[0]))

BOOLOP = L("and") | L("or")

MARKER_VAR = VARIABLE | MARKER_VALUE

MARKER_ITEM = Group(MARKER_VAR + MARKER_OP + MARKER_VAR)
MARKER_ITEM.setParseAction(lambda s, l, t: tuple(t[0]))

LPAREN = L("(").suppress()
RPAREN = L(")").suppress()

MARKER_EXPR = Forward()
MARKER_ATOM = MARKER_ITEM | Group(LPAREN + MARKER_EXPR + RPAREN)
MARKER_EXPR << MARKER_ATOM + ZeroOrMore(BOOLOP + MARKER_EXPR)

MARKER = stringStart + MARKER_EXPR + stringEnd


def _coerce_parse_result(results):
    if isinstance(results, ParseResults):
        return [_coerce_parse_result(i) for i in results]
    else:
        return results


def _format_marker(marker, first=True):
    assert isinstance(marker, (list, tuple, string_types))

    # Sometimes we have a structure like [[...]] which is a single item list
    # where the single item is itself it's own list. In that case we want skip
    # the rest of this function so that we don't get extraneous () on the
    # outside.
    if (isinstance(marker, list) and len(marker) == 1 and
            isinstance(marker[0], (list, tuple))):
        return _format_marker(marker[0])

    if isinstance(marker, list):
        inner = (_format_marker(m, first=False) for m in marker)
        if first:
            return " ".join(inner)
        else:
            return "(" + " ".join(inner) + ")"
    elif isinstance(marker, tuple):
        return " ".join([m.serialize() for m in marker])
    else:
        return marker


_operators = {
    "in": lambda lhs, rhs: lhs in rhs,
    "not in": lambda lhs, rhs: lhs not in rhs,
    "<": operator.lt,
    "<=": operator.le,
    "==": operator.eq,
    "!=": operator.ne,
    ">=": operator.ge,
    ">": operator.gt,
}


def _eval_op(lhs, op, rhs):
    try:
        spec = Specifier("".join([op.serialize(), rhs]))
    except InvalidSpecifier:
        pass
    else:
        return spec.contains(lhs)

    oper = _operators.get(op.serialize())
    if oper is None:
        raise UndefinedComparison(
            "Undefined {0!r} on {1!r} and {2!r}.".format(op, lhs, rhs)
        )

    return oper(lhs, rhs)


_undefined = object()


def _get_env(environment, name):
    value = environment.get(name, _undefined)

    if value is _undefined:
        raise UndefinedEnvironmentName(
            "{0!r} does not exist in evaluation environment.".format(name)
        )

    return value


def _evaluate_markers(markers, environment):
    groups = [[]]

    for marker in markers:
        assert isinstance(marker, (list, tuple, string_types))

        if isinstance(marker, list):
            groups[-1].append(_evaluate_markers(marker, environment))
        elif isinstance(marker, tuple):
            lhs, op, rhs = marker

            if isinstance(lhs, Variable):
                lhs_value = _get_env(environment, lhs.value)
                rhs_value = rhs.value
            else:
                lhs_value = lhs.value
                rhs_value = _get_env(environment, rhs.value)

            groups[-1].append(_eval_op(lhs_value, op, rhs_value))
        else:
            assert marker in ["and", "or"]
            if marker == "or":
                groups.append([])

    return any(all(item) for item in groups)


def format_full_version(info):
    version = '{0.major}.{0.minor}.{0.micro}'.format(info)
    kind = info.releaselevel
    if kind != 'final':
        version += kind[0] + str(info.serial)
    return version


def default_environment():
    if hasattr(sys, 'implementation'):
        iver = format_full_version(sys.implementation.version)
        implementation_name = sys.implementation.name
    else:
        iver = '0'
        implementation_name = ''

    return {
        "implementation_name": implementation_name,
        "implementation_version": iver,
        "os_name": os.name,
        "platform_machine": platform.machine(),
        "platform_release": platform.release(),
        "platform_system": platform.system(),
        "platform_version": platform.version(),
        "python_full_version": platform.python_version(),
        "platform_python_implementation": platform.python_implementation(),
        "python_version": platform.python_version()[:3],
        "sys_platform": sys.platform,
    }


class Marker(object):

    def __init__(self, marker):
        try:
            self._markers = _coerce_parse_result(MARKER.parseString(marker))
        except ParseException as e:
            err_str = "Invalid marker: {0!r}, parse error at {1!r}".format(
                marker, marker[e.loc:e.loc + 8])
            raise InvalidMarker(err_str)

    def __str__(self):
        return _format_marker(self._markers)

    def __repr__(self):
        return "".format(str(self))

    def evaluate(self, environment=None):
        """Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        """
        current_environment = default_environment()
        if environment is not None:
            current_environment.update(environment)

        return _evaluate_markers(self._markers, current_environment)
PK!ơ$-$-_vendor/packaging/version.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

import collections
import itertools
import re

from ._structures import Infinity


__all__ = [
    "parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"
]


_Version = collections.namedtuple(
    "_Version",
    ["epoch", "release", "dev", "pre", "post", "local"],
)


def parse(version):
    """
    Parse the given version string and return either a :class:`Version` object
    or a :class:`LegacyVersion` object depending on if the given version is
    a valid PEP 440 version or a legacy version.
    """
    try:
        return Version(version)
    except InvalidVersion:
        return LegacyVersion(version)


class InvalidVersion(ValueError):
    """
    An invalid version was found, users should refer to PEP 440.
    """


class _BaseVersion(object):

    def __hash__(self):
        return hash(self._key)

    def __lt__(self, other):
        return self._compare(other, lambda s, o: s < o)

    def __le__(self, other):
        return self._compare(other, lambda s, o: s <= o)

    def __eq__(self, other):
        return self._compare(other, lambda s, o: s == o)

    def __ge__(self, other):
        return self._compare(other, lambda s, o: s >= o)

    def __gt__(self, other):
        return self._compare(other, lambda s, o: s > o)

    def __ne__(self, other):
        return self._compare(other, lambda s, o: s != o)

    def _compare(self, other, method):
        if not isinstance(other, _BaseVersion):
            return NotImplemented

        return method(self._key, other._key)


class LegacyVersion(_BaseVersion):

    def __init__(self, version):
        self._version = str(version)
        self._key = _legacy_cmpkey(self._version)

    def __str__(self):
        return self._version

    def __repr__(self):
        return "".format(repr(str(self)))

    @property
    def public(self):
        return self._version

    @property
    def base_version(self):
        return self._version

    @property
    def local(self):
        return None

    @property
    def is_prerelease(self):
        return False

    @property
    def is_postrelease(self):
        return False


_legacy_version_component_re = re.compile(
    r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE,
)

_legacy_version_replacement_map = {
    "pre": "c", "preview": "c", "-": "final-", "rc": "c", "dev": "@",
}


def _parse_version_parts(s):
    for part in _legacy_version_component_re.split(s):
        part = _legacy_version_replacement_map.get(part, part)

        if not part or part == ".":
            continue

        if part[:1] in "0123456789":
            # pad for numeric comparison
            yield part.zfill(8)
        else:
            yield "*" + part

    # ensure that alpha/beta/candidate are before final
    yield "*final"


def _legacy_cmpkey(version):
    # We hardcode an epoch of -1 here. A PEP 440 version can only have a epoch
    # greater than or equal to 0. This will effectively put the LegacyVersion,
    # which uses the defacto standard originally implemented by setuptools,
    # as before all PEP 440 versions.
    epoch = -1

    # This scheme is taken from pkg_resources.parse_version setuptools prior to
    # it's adoption of the packaging library.
    parts = []
    for part in _parse_version_parts(version.lower()):
        if part.startswith("*"):
            # remove "-" before a prerelease tag
            if part < "*final":
                while parts and parts[-1] == "*final-":
                    parts.pop()

            # remove trailing zeros from each series of numeric parts
            while parts and parts[-1] == "00000000":
                parts.pop()

        parts.append(part)
    parts = tuple(parts)

    return epoch, parts

# Deliberately not anchored to the start and end of the string, to make it
# easier for 3rd party code to reuse
VERSION_PATTERN = r"""
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
"""


class Version(_BaseVersion):

    _regex = re.compile(
        r"^\s*" + VERSION_PATTERN + r"\s*$",
        re.VERBOSE | re.IGNORECASE,
    )

    def __init__(self, version):
        # Validate the version and parse it into pieces
        match = self._regex.search(version)
        if not match:
            raise InvalidVersion("Invalid version: '{0}'".format(version))

        # Store the parsed out pieces of the version
        self._version = _Version(
            epoch=int(match.group("epoch")) if match.group("epoch") else 0,
            release=tuple(int(i) for i in match.group("release").split(".")),
            pre=_parse_letter_version(
                match.group("pre_l"),
                match.group("pre_n"),
            ),
            post=_parse_letter_version(
                match.group("post_l"),
                match.group("post_n1") or match.group("post_n2"),
            ),
            dev=_parse_letter_version(
                match.group("dev_l"),
                match.group("dev_n"),
            ),
            local=_parse_local_version(match.group("local")),
        )

        # Generate a key which will be used for sorting
        self._key = _cmpkey(
            self._version.epoch,
            self._version.release,
            self._version.pre,
            self._version.post,
            self._version.dev,
            self._version.local,
        )

    def __repr__(self):
        return "".format(repr(str(self)))

    def __str__(self):
        parts = []

        # Epoch
        if self._version.epoch != 0:
            parts.append("{0}!".format(self._version.epoch))

        # Release segment
        parts.append(".".join(str(x) for x in self._version.release))

        # Pre-release
        if self._version.pre is not None:
            parts.append("".join(str(x) for x in self._version.pre))

        # Post-release
        if self._version.post is not None:
            parts.append(".post{0}".format(self._version.post[1]))

        # Development release
        if self._version.dev is not None:
            parts.append(".dev{0}".format(self._version.dev[1]))

        # Local version segment
        if self._version.local is not None:
            parts.append(
                "+{0}".format(".".join(str(x) for x in self._version.local))
            )

        return "".join(parts)

    @property
    def public(self):
        return str(self).split("+", 1)[0]

    @property
    def base_version(self):
        parts = []

        # Epoch
        if self._version.epoch != 0:
            parts.append("{0}!".format(self._version.epoch))

        # Release segment
        parts.append(".".join(str(x) for x in self._version.release))

        return "".join(parts)

    @property
    def local(self):
        version_string = str(self)
        if "+" in version_string:
            return version_string.split("+", 1)[1]

    @property
    def is_prerelease(self):
        return bool(self._version.dev or self._version.pre)

    @property
    def is_postrelease(self):
        return bool(self._version.post)


def _parse_letter_version(letter, number):
    if letter:
        # We consider there to be an implicit 0 in a pre-release if there is
        # not a numeral associated with it.
        if number is None:
            number = 0

        # We normalize any letters to their lower case form
        letter = letter.lower()

        # We consider some words to be alternate spellings of other words and
        # in those cases we want to normalize the spellings to our preferred
        # spelling.
        if letter == "alpha":
            letter = "a"
        elif letter == "beta":
            letter = "b"
        elif letter in ["c", "pre", "preview"]:
            letter = "rc"
        elif letter in ["rev", "r"]:
            letter = "post"

        return letter, int(number)
    if not letter and number:
        # We assume if we are given a number, but we are not given a letter
        # then this is using the implicit post release syntax (e.g. 1.0-1)
        letter = "post"

        return letter, int(number)


_local_version_seperators = re.compile(r"[\._-]")


def _parse_local_version(local):
    """
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    """
    if local is not None:
        return tuple(
            part.lower() if not part.isdigit() else int(part)
            for part in _local_version_seperators.split(local)
        )


def _cmpkey(epoch, release, pre, post, dev, local):
    # When we compare a release version, we want to compare it with all of the
    # trailing zeros removed. So we'll use a reverse the list, drop all the now
    # leading zeros until we come to something non zero, then take the rest
    # re-reverse it back into the correct order and make it a tuple and use
    # that for our sorting key.
    release = tuple(
        reversed(list(
            itertools.dropwhile(
                lambda x: x == 0,
                reversed(release),
            )
        ))
    )

    # We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0.
    # We'll do this by abusing the pre segment, but we _only_ want to do this
    # if there is not a pre or a post segment. If we have one of those then
    # the normal sorting rules will handle this case correctly.
    if pre is None and post is None and dev is not None:
        pre = -Infinity
    # Versions without a pre-release (except as noted above) should sort after
    # those with one.
    elif pre is None:
        pre = Infinity

    # Versions without a post segment should sort before those with one.
    if post is None:
        post = -Infinity

    # Versions without a development segment should sort after those with one.
    if dev is None:
        dev = Infinity

    if local is None:
        # Versions without a local segment should sort before those with one.
        local = -Infinity
    else:
        # Versions with a local segment need that segment parsed to implement
        # the sorting rules in PEP440.
        # - Alpha numeric segments sort before numeric segments
        # - Alpha numeric segments sort lexicographically
        # - Numeric segments sort numerically
        # - Shorter versions sort before longer versions when the prefixes
        #   match exactly
        local = tuple(
            (i, "") if isinstance(i, int) else (-Infinity, i)
            for i in local
        )

    return epoch, release, pre, post, dev, local
PK!vЁ!_vendor/packaging/requirements.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

import string
import re

from setuptools.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
from setuptools.extern.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
from setuptools.extern.pyparsing import Literal as L  # noqa
from setuptools.extern.six.moves.urllib import parse as urlparse

from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet


class InvalidRequirement(ValueError):
    """
    An invalid requirement was found, users should refer to PEP 508.
    """


ALPHANUM = Word(string.ascii_letters + string.digits)

LBRACKET = L("[").suppress()
RBRACKET = L("]").suppress()
LPAREN = L("(").suppress()
RPAREN = L(")").suppress()
COMMA = L(",").suppress()
SEMICOLON = L(";").suppress()
AT = L("@").suppress()

PUNCTUATION = Word("-_.")
IDENTIFIER_END = ALPHANUM | (ZeroOrMore(PUNCTUATION) + ALPHANUM)
IDENTIFIER = Combine(ALPHANUM + ZeroOrMore(IDENTIFIER_END))

NAME = IDENTIFIER("name")
EXTRA = IDENTIFIER

URI = Regex(r'[^ ]+')("url")
URL = (AT + URI)

EXTRAS_LIST = EXTRA + ZeroOrMore(COMMA + EXTRA)
EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras")

VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE)

VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY
VERSION_MANY = Combine(VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE),
                       joinString=",", adjacent=False)("_raw_spec")
_VERSION_SPEC = Optional(((LPAREN + VERSION_MANY + RPAREN) | VERSION_MANY))
_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or '')

VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
VERSION_SPEC.setParseAction(lambda s, l, t: t[1])

MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR.setParseAction(
    lambda s, l, t: Marker(s[t._original_start:t._original_end])
)
MARKER_SEPERATOR = SEMICOLON
MARKER = MARKER_SEPERATOR + MARKER_EXPR

VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER)
URL_AND_MARKER = URL + Optional(MARKER)

NAMED_REQUIREMENT = \
    NAME + Optional(EXTRAS) + (URL_AND_MARKER | VERSION_AND_MARKER)

REQUIREMENT = stringStart + NAMED_REQUIREMENT + stringEnd


class Requirement(object):
    """Parse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    """

    # TODO: Can we test whether something is contained within a requirement?
    #       If so how do we do that? Do we need to test against the _name_ of
    #       the thing as well as the version? What about the markers?
    # TODO: Can we normalize the name and extra name?

    def __init__(self, requirement_string):
        try:
            req = REQUIREMENT.parseString(requirement_string)
        except ParseException as e:
            raise InvalidRequirement(
                "Invalid requirement, parse error at \"{0!r}\"".format(
                    requirement_string[e.loc:e.loc + 8]))

        self.name = req.name
        if req.url:
            parsed_url = urlparse.urlparse(req.url)
            if not (parsed_url.scheme and parsed_url.netloc) or (
                    not parsed_url.scheme and not parsed_url.netloc):
                raise InvalidRequirement("Invalid URL given")
            self.url = req.url
        else:
            self.url = None
        self.extras = set(req.extras.asList() if req.extras else [])
        self.specifier = SpecifierSet(req.specifier)
        self.marker = req.marker if req.marker else None

    def __str__(self):
        parts = [self.name]

        if self.extras:
            parts.append("[{0}]".format(",".join(sorted(self.extras))))

        if self.specifier:
            parts.append(str(self.specifier))

        if self.url:
            parts.append("@ {0}".format(self.url))

        if self.marker:
            parts.append("; {0}".format(self.marker))

        return "".join(parts)

    def __repr__(self):
        return "".format(str(self))
PK!|Eymym_vendor/packaging/specifiers.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

import abc
import functools
import itertools
import re

from ._compat import string_types, with_metaclass
from .version import Version, LegacyVersion, parse


class InvalidSpecifier(ValueError):
    """
    An invalid specifier was found, users should refer to PEP 440.
    """


class BaseSpecifier(with_metaclass(abc.ABCMeta, object)):

    @abc.abstractmethod
    def __str__(self):
        """
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        """

    @abc.abstractmethod
    def __hash__(self):
        """
        Returns a hash value for this Specifier like object.
        """

    @abc.abstractmethod
    def __eq__(self, other):
        """
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        """

    @abc.abstractmethod
    def __ne__(self, other):
        """
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        """

    @abc.abstractproperty
    def prereleases(self):
        """
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        """

    @prereleases.setter
    def prereleases(self, value):
        """
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        """

    @abc.abstractmethod
    def contains(self, item, prereleases=None):
        """
        Determines if the given item is contained within this specifier.
        """

    @abc.abstractmethod
    def filter(self, iterable, prereleases=None):
        """
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        """


class _IndividualSpecifier(BaseSpecifier):

    _operators = {}

    def __init__(self, spec="", prereleases=None):
        match = self._regex.search(spec)
        if not match:
            raise InvalidSpecifier("Invalid specifier: '{0}'".format(spec))

        self._spec = (
            match.group("operator").strip(),
            match.group("version").strip(),
        )

        # Store whether or not this Specifier should accept prereleases
        self._prereleases = prereleases

    def __repr__(self):
        pre = (
            ", prereleases={0!r}".format(self.prereleases)
            if self._prereleases is not None
            else ""
        )

        return "<{0}({1!r}{2})>".format(
            self.__class__.__name__,
            str(self),
            pre,
        )

    def __str__(self):
        return "{0}{1}".format(*self._spec)

    def __hash__(self):
        return hash(self._spec)

    def __eq__(self, other):
        if isinstance(other, string_types):
            try:
                other = self.__class__(other)
            except InvalidSpecifier:
                return NotImplemented
        elif not isinstance(other, self.__class__):
            return NotImplemented

        return self._spec == other._spec

    def __ne__(self, other):
        if isinstance(other, string_types):
            try:
                other = self.__class__(other)
            except InvalidSpecifier:
                return NotImplemented
        elif not isinstance(other, self.__class__):
            return NotImplemented

        return self._spec != other._spec

    def _get_operator(self, op):
        return getattr(self, "_compare_{0}".format(self._operators[op]))

    def _coerce_version(self, version):
        if not isinstance(version, (LegacyVersion, Version)):
            version = parse(version)
        return version

    @property
    def operator(self):
        return self._spec[0]

    @property
    def version(self):
        return self._spec[1]

    @property
    def prereleases(self):
        return self._prereleases

    @prereleases.setter
    def prereleases(self, value):
        self._prereleases = value

    def __contains__(self, item):
        return self.contains(item)

    def contains(self, item, prereleases=None):
        # Determine if prereleases are to be allowed or not.
        if prereleases is None:
            prereleases = self.prereleases

        # Normalize item to a Version or LegacyVersion, this allows us to have
        # a shortcut for ``"2.0" in Specifier(">=2")
        item = self._coerce_version(item)

        # Determine if we should be supporting prereleases in this specifier
        # or not, if we do not support prereleases than we can short circuit
        # logic if this version is a prereleases.
        if item.is_prerelease and not prereleases:
            return False

        # Actually do the comparison to determine if this item is contained
        # within this Specifier or not.
        return self._get_operator(self.operator)(item, self.version)

    def filter(self, iterable, prereleases=None):
        yielded = False
        found_prereleases = []

        kw = {"prereleases": prereleases if prereleases is not None else True}

        # Attempt to iterate over all the values in the iterable and if any of
        # them match, yield them.
        for version in iterable:
            parsed_version = self._coerce_version(version)

            if self.contains(parsed_version, **kw):
                # If our version is a prerelease, and we were not set to allow
                # prereleases, then we'll store it for later incase nothing
                # else matches this specifier.
                if (parsed_version.is_prerelease and not
                        (prereleases or self.prereleases)):
                    found_prereleases.append(version)
                # Either this is not a prerelease, or we should have been
                # accepting prereleases from the begining.
                else:
                    yielded = True
                    yield version

        # Now that we've iterated over everything, determine if we've yielded
        # any values, and if we have not and we have any prereleases stored up
        # then we will go ahead and yield the prereleases.
        if not yielded and found_prereleases:
            for version in found_prereleases:
                yield version


class LegacySpecifier(_IndividualSpecifier):

    _regex_str = (
        r"""
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        """
    )

    _regex = re.compile(
        r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)

    _operators = {
        "==": "equal",
        "!=": "not_equal",
        "<=": "less_than_equal",
        ">=": "greater_than_equal",
        "<": "less_than",
        ">": "greater_than",
    }

    def _coerce_version(self, version):
        if not isinstance(version, LegacyVersion):
            version = LegacyVersion(str(version))
        return version

    def _compare_equal(self, prospective, spec):
        return prospective == self._coerce_version(spec)

    def _compare_not_equal(self, prospective, spec):
        return prospective != self._coerce_version(spec)

    def _compare_less_than_equal(self, prospective, spec):
        return prospective <= self._coerce_version(spec)

    def _compare_greater_than_equal(self, prospective, spec):
        return prospective >= self._coerce_version(spec)

    def _compare_less_than(self, prospective, spec):
        return prospective < self._coerce_version(spec)

    def _compare_greater_than(self, prospective, spec):
        return prospective > self._coerce_version(spec)


def _require_version_compare(fn):
    @functools.wraps(fn)
    def wrapped(self, prospective, spec):
        if not isinstance(prospective, Version):
            return False
        return fn(self, prospective, spec)
    return wrapped


class Specifier(_IndividualSpecifier):

    _regex_str = (
        r"""
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=": "greater_than_equal",
        "<": "less_than",
        ">": "greater_than",
        "===": "arbitrary",
    }

    @_require_version_compare
    def _compare_compatible(self, prospective, spec):
        # Compatible releases have an equivalent combination of >= and ==. That
        # is that ~=2.2 is equivalent to >=2.2,==2.*. This allows us to
        # implement this in terms of the other specifiers instead of
        # implementing it ourselves. The only thing we need to do is construct
        # the other specifiers.

        # We want everything but the last item in the version, but we want to
        # ignore post and dev releases and we want to treat the pre-release as
        # it's own separate segment.
        prefix = ".".join(
            list(
                itertools.takewhile(
                    lambda x: (not x.startswith("post") and not
                               x.startswith("dev")),
                    _version_split(spec),
                )
            )[:-1]
        )

        # Add the prefix notation to the end of our string
        prefix += ".*"

        return (self._get_operator(">=")(prospective, spec) and
                self._get_operator("==")(prospective, prefix))

    @_require_version_compare
    def _compare_equal(self, prospective, spec):
        # We need special logic to handle prefix matching
        if spec.endswith(".*"):
            # In the case of prefix matching we want to ignore local segment.
            prospective = Version(prospective.public)
            # Split the spec out by dots, and pretend that there is an implicit
            # dot in between a release segment and a pre-release segment.
            spec = _version_split(spec[:-2])  # Remove the trailing .*

            # Split the prospective version out by dots, and pretend that there
            # is an implicit dot in between a release segment and a pre-release
            # segment.
            prospective = _version_split(str(prospective))

            # Shorten the prospective version to be the same length as the spec
            # so that we can determine if the specifier is a prefix of the
            # prospective version or not.
            prospective = prospective[:len(spec)]

            # Pad out our two sides with zeros so that they both equal the same
            # length.
            spec, prospective = _pad_version(spec, prospective)
        else:
            # Convert our spec string into a Version
            spec = Version(spec)

            # If the specifier does not have a local segment, then we want to
            # act as if the prospective version also does not have a local
            # segment.
            if not spec.local:
                prospective = Version(prospective.public)

        return prospective == spec

    @_require_version_compare
    def _compare_not_equal(self, prospective, spec):
        return not self._compare_equal(prospective, spec)

    @_require_version_compare
    def _compare_less_than_equal(self, prospective, spec):
        return prospective <= Version(spec)

    @_require_version_compare
    def _compare_greater_than_equal(self, prospective, spec):
        return prospective >= Version(spec)

    @_require_version_compare
    def _compare_less_than(self, prospective, spec):
        # Convert our spec to a Version instance, since we'll want to work with
        # it as a version.
        spec = Version(spec)

        # Check to see if the prospective version is less than the spec
        # version. If it's not we can short circuit and just return False now
        # instead of doing extra unneeded work.
        if not prospective < spec:
            return False

        # This special case is here so that, unless the specifier itself
        # includes is a pre-release version, that we do not accept pre-release
        # versions for the version mentioned in the specifier (e.g. <3.1 should
        # not match 3.1.dev0, but should match 3.0.dev0).
        if not spec.is_prerelease and prospective.is_prerelease:
            if Version(prospective.base_version) == Version(spec.base_version):
                return False

        # If we've gotten to here, it means that prospective version is both
        # less than the spec version *and* it's not a pre-release of the same
        # version in the spec.
        return True

    @_require_version_compare
    def _compare_greater_than(self, prospective, spec):
        # Convert our spec to a Version instance, since we'll want to work with
        # it as a version.
        spec = Version(spec)

        # Check to see if the prospective version is greater than the spec
        # version. If it's not we can short circuit and just return False now
        # instead of doing extra unneeded work.
        if not prospective > spec:
            return False

        # This special case is here so that, unless the specifier itself
        # includes is a post-release version, that we do not accept
        # post-release versions for the version mentioned in the specifier
        # (e.g. >3.1 should not match 3.0.post0, but should match 3.2.post0).
        if not spec.is_postrelease and prospective.is_postrelease:
            if Version(prospective.base_version) == Version(spec.base_version):
                return False

        # Ensure that we do not allow a local version of the version mentioned
        # in the specifier, which is techincally greater than, to match.
        if prospective.local is not None:
            if Version(prospective.base_version) == Version(spec.base_version):
                return False

        # If we've gotten to here, it means that prospective version is both
        # greater than the spec version *and* it's not a pre-release of the
        # same version in the spec.
        return True

    def _compare_arbitrary(self, prospective, spec):
        return str(prospective).lower() == str(spec).lower()

    @property
    def prereleases(self):
        # If there is an explicit prereleases set for this, then we'll just
        # blindly use that.
        if self._prereleases is not None:
            return self._prereleases

        # Look at all of our specifiers and determine if they are inclusive
        # operators, and if they are if they are including an explicit
        # prerelease.
        operator, version = self._spec
        if operator in ["==", ">=", "<=", "~=", "==="]:
            # The == specifier can include a trailing .*, if it does we
            # want to remove before parsing.
            if operator == "==" and version.endswith(".*"):
                version = version[:-2]

            # Parse the version, and if it is a pre-release than this
            # specifier allows pre-releases.
            if parse(version).is_prerelease:
                return True

        return False

    @prereleases.setter
    def prereleases(self, value):
        self._prereleases = value


_prefix_regex = re.compile(r"^([0-9]+)((?:a|b|c|rc)[0-9]+)$")


def _version_split(version):
    result = []
    for item in version.split("."):
        match = _prefix_regex.search(item)
        if match:
            result.extend(match.groups())
        else:
            result.append(item)
    return result


def _pad_version(left, right):
    left_split, right_split = [], []

    # Get the release segment of our versions
    left_split.append(list(itertools.takewhile(lambda x: x.isdigit(), left)))
    right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right)))

    # Get the rest of our versions
    left_split.append(left[len(left_split[0]):])
    right_split.append(right[len(right_split[0]):])

    # Insert our padding
    left_split.insert(
        1,
        ["0"] * max(0, len(right_split[0]) - len(left_split[0])),
    )
    right_split.insert(
        1,
        ["0"] * max(0, len(left_split[0]) - len(right_split[0])),
    )

    return (
        list(itertools.chain(*left_split)),
        list(itertools.chain(*right_split)),
    )


class SpecifierSet(BaseSpecifier):

    def __init__(self, specifiers="", prereleases=None):
        # Split on , to break each indidivual specifier into it's own item, and
        # strip each item to remove leading/trailing whitespace.
        specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]

        # Parsed each individual specifier, attempting first to make it a
        # Specifier and falling back to a LegacySpecifier.
        parsed = set()
        for specifier in specifiers:
            try:
                parsed.add(Specifier(specifier))
            except InvalidSpecifier:
                parsed.add(LegacySpecifier(specifier))

        # Turn our parsed specifiers into a frozen set and save them for later.
        self._specs = frozenset(parsed)

        # Store our prereleases value so we can use it later to determine if
        # we accept prereleases or not.
        self._prereleases = prereleases

    def __repr__(self):
        pre = (
            ", prereleases={0!r}".format(self.prereleases)
            if self._prereleases is not None
            else ""
        )

        return "".format(str(self), pre)

    def __str__(self):
        return ",".join(sorted(str(s) for s in self._specs))

    def __hash__(self):
        return hash(self._specs)

    def __and__(self, other):
        if isinstance(other, string_types):
            other = SpecifierSet(other)
        elif not isinstance(other, SpecifierSet):
            return NotImplemented

        specifier = SpecifierSet()
        specifier._specs = frozenset(self._specs | other._specs)

        if self._prereleases is None and other._prereleases is not None:
            specifier._prereleases = other._prereleases
        elif self._prereleases is not None and other._prereleases is None:
            specifier._prereleases = self._prereleases
        elif self._prereleases == other._prereleases:
            specifier._prereleases = self._prereleases
        else:
            raise ValueError(
                "Cannot combine SpecifierSets with True and False prerelease "
                "overrides."
            )

        return specifier

    def __eq__(self, other):
        if isinstance(other, string_types):
            other = SpecifierSet(other)
        elif isinstance(other, _IndividualSpecifier):
            other = SpecifierSet(str(other))
        elif not isinstance(other, SpecifierSet):
            return NotImplemented

        return self._specs == other._specs

    def __ne__(self, other):
        if isinstance(other, string_types):
            other = SpecifierSet(other)
        elif isinstance(other, _IndividualSpecifier):
            other = SpecifierSet(str(other))
        elif not isinstance(other, SpecifierSet):
            return NotImplemented

        return self._specs != other._specs

    def __len__(self):
        return len(self._specs)

    def __iter__(self):
        return iter(self._specs)

    @property
    def prereleases(self):
        # If we have been given an explicit prerelease modifier, then we'll
        # pass that through here.
        if self._prereleases is not None:
            return self._prereleases

        # If we don't have any specifiers, and we don't have a forced value,
        # then we'll just return None since we don't know if this should have
        # pre-releases or not.
        if not self._specs:
            return None

        # Otherwise we'll see if any of the given specifiers accept
        # prereleases, if any of them do we'll return True, otherwise False.
        return any(s.prereleases for s in self._specs)

    @prereleases.setter
    def prereleases(self, value):
        self._prereleases = value

    def __contains__(self, item):
        return self.contains(item)

    def contains(self, item, prereleases=None):
        # Ensure that our item is a Version or LegacyVersion instance.
        if not isinstance(item, (LegacyVersion, Version)):
            item = parse(item)

        # Determine if we're forcing a prerelease or not, if we're not forcing
        # one for this particular filter call, then we'll use whatever the
        # SpecifierSet thinks for whether or not we should support prereleases.
        if prereleases is None:
            prereleases = self.prereleases

        # We can determine if we're going to allow pre-releases by looking to
        # see if any of the underlying items supports them. If none of them do
        # and this item is a pre-release then we do not allow it and we can
        # short circuit that here.
        # Note: This means that 1.0.dev1 would not be contained in something
        #       like >=1.0.devabc however it would be in >=1.0.debabc,>0.0.dev0
        if not prereleases and item.is_prerelease:
            return False

        # We simply dispatch to the underlying specs here to make sure that the
        # given version is contained within all of them.
        # Note: This use of all() here means that an empty set of specifiers
        #       will always return True, this is an explicit design decision.
        return all(
            s.contains(item, prereleases=prereleases)
            for s in self._specs
        )

    def filter(self, iterable, prereleases=None):
        # Determine if we're forcing a prerelease or not, if we're not forcing
        # one for this particular filter call, then we'll use whatever the
        # SpecifierSet thinks for whether or not we should support prereleases.
        if prereleases is None:
            prereleases = self.prereleases

        # If we have any specifiers, then we want to wrap our iterable in the
        # filter method for each one, this will act as a logical AND amongst
        # each specifier.
        if self._specs:
            for spec in self._specs:
                iterable = spec.filter(iterable, prereleases=bool(prereleases))
            return iterable
        # If we do not have any specifiers, then we need to have a rough filter
        # which will filter out any pre-releases, unless there are no final
        # releases, and which will filter out LegacyVersion in general.
        else:
            filtered = []
            found_prereleases = []

            for item in iterable:
                # Ensure that we some kind of Version class for this item.
                if not isinstance(item, (LegacyVersion, Version)):
                    parsed_version = parse(item)
                else:
                    parsed_version = item

                # Filter out any item which is parsed as a LegacyVersion
                if isinstance(parsed_version, LegacyVersion):
                    continue

                # Store any item which is a pre-release for later unless we've
                # already found a final version or we are accepting prereleases
                if parsed_version.is_prerelease and not prereleases:
                    if not filtered:
                        found_prereleases.append(item)
                else:
                    filtered.append(item)

            # If we've found no items except for pre-releases, then we'll go
            # ahead and use the pre-releases
            if not filtered and found_prereleases and prereleases is None:
                return found_prereleases

            return filtered
PK!<)X_vendor/packaging/__about__.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function

__all__ = [
    "__title__", "__summary__", "__uri__", "__version__", "__author__",
    "__email__", "__license__", "__copyright__",
]

__title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"

__version__ = "16.8"

__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"

__license__ = "BSD or Apache License, Version 2.0"
__copyright__ = "Copyright 2014-2016 %s" % __author__
PK!XMZuu_vendor/six.pynu["""Utilities for writing code that runs on Python 2 and 3"""

# Copyright (c) 2010-2015 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from __future__ import absolute_import

import functools
import itertools
import operator
import sys
import types

__author__ = "Benjamin Peterson "
__version__ = "1.10.0"


# Useful for very coarse version differentiation.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
PY34 = sys.version_info[0:2] >= (3, 4)

if PY3:
    string_types = str,
    integer_types = int,
    class_types = type,
    text_type = str
    binary_type = bytes

    MAXSIZE = sys.maxsize
else:
    string_types = basestring,
    integer_types = (int, long)
    class_types = (type, types.ClassType)
    text_type = unicode
    binary_type = str

    if sys.platform.startswith("java"):
        # Jython always uses 32 bits.
        MAXSIZE = int((1 << 31) - 1)
    else:
        # It's possible to have sizeof(long) != sizeof(Py_ssize_t).
        class X(object):

            def __len__(self):
                return 1 << 31
        try:
            len(X())
        except OverflowError:
            # 32-bit
            MAXSIZE = int((1 << 31) - 1)
        else:
            # 64-bit
            MAXSIZE = int((1 << 63) - 1)
        del X


def _add_doc(func, doc):
    """Add documentation to a function."""
    func.__doc__ = doc


def _import_module(name):
    """Import module, returning the module after the last dot."""
    __import__(name)
    return sys.modules[name]


class _LazyDescr(object):

    def __init__(self, name):
        self.name = name

    def __get__(self, obj, tp):
        result = self._resolve()
        setattr(obj, self.name, result)  # Invokes __set__.
        try:
            # This is a bit ugly, but it avoids running this again by
            # removing this descriptor.
            delattr(obj.__class__, self.name)
        except AttributeError:
            pass
        return result


class MovedModule(_LazyDescr):

    def __init__(self, name, old, new=None):
        super(MovedModule, self).__init__(name)
        if PY3:
            if new is None:
                new = name
            self.mod = new
        else:
            self.mod = old

    def _resolve(self):
        return _import_module(self.mod)

    def __getattr__(self, attr):
        _module = self._resolve()
        value = getattr(_module, attr)
        setattr(self, attr, value)
        return value


class _LazyModule(types.ModuleType):

    def __init__(self, name):
        super(_LazyModule, self).__init__(name)
        self.__doc__ = self.__class__.__doc__

    def __dir__(self):
        attrs = ["__doc__", "__name__"]
        attrs += [attr.name for attr in self._moved_attributes]
        return attrs

    # Subclasses should override this
    _moved_attributes = []


class MovedAttribute(_LazyDescr):

    def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
        super(MovedAttribute, self).__init__(name)
        if PY3:
            if new_mod is None:
                new_mod = name
            self.mod = new_mod
            if new_attr is None:
                if old_attr is None:
                    new_attr = name
                else:
                    new_attr = old_attr
            self.attr = new_attr
        else:
            self.mod = old_mod
            if old_attr is None:
                old_attr = name
            self.attr = old_attr

    def _resolve(self):
        module = _import_module(self.mod)
        return getattr(module, self.attr)


class _SixMetaPathImporter(object):

    """
    A meta path importer to import six.moves and its submodules.

    This class implements a PEP302 finder and loader. It should be compatible
    with Python 2.5 and all existing versions of Python3
    """

    def __init__(self, six_module_name):
        self.name = six_module_name
        self.known_modules = {}

    def _add_module(self, mod, *fullnames):
        for fullname in fullnames:
            self.known_modules[self.name + "." + fullname] = mod

    def _get_module(self, fullname):
        return self.known_modules[self.name + "." + fullname]

    def find_module(self, fullname, path=None):
        if fullname in self.known_modules:
            return self
        return None

    def __get_module(self, fullname):
        try:
            return self.known_modules[fullname]
        except KeyError:
            raise ImportError("This loader does not know module " + fullname)

    def load_module(self, fullname):
        try:
            # in case of a reload
            return sys.modules[fullname]
        except KeyError:
            pass
        mod = self.__get_module(fullname)
        if isinstance(mod, MovedModule):
            mod = mod._resolve()
        else:
            mod.__loader__ = self
        sys.modules[fullname] = mod
        return mod

    def is_package(self, fullname):
        """
        Return true, if the named module is a package.

        We need this method to get correct spec objects with
        Python 3.4 (see PEP451)
        """
        return hasattr(self.__get_module(fullname), "__path__")

    def get_code(self, fullname):
        """Return None

        Required, if is_package is implemented"""
        self.__get_module(fullname)  # eventually raises ImportError
        return None
    get_source = get_code  # same as get_code

_importer = _SixMetaPathImporter(__name__)


class _MovedItems(_LazyModule):

    """Lazy loading of moved objects"""
    __path__ = []  # mark as package


_moved_attributes = [
    MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"),
    MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"),
    MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"),
    MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"),
    MovedAttribute("intern", "__builtin__", "sys"),
    MovedAttribute("map", "itertools", "builtins", "imap", "map"),
    MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"),
    MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"),
    MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"),
    MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"),
    MovedAttribute("reduce", "__builtin__", "functools"),
    MovedAttribute("shlex_quote", "pipes", "shlex", "quote"),
    MovedAttribute("StringIO", "StringIO", "io"),
    MovedAttribute("UserDict", "UserDict", "collections"),
    MovedAttribute("UserList", "UserList", "collections"),
    MovedAttribute("UserString", "UserString", "collections"),
    MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"),
    MovedAttribute("zip", "itertools", "builtins", "izip", "zip"),
    MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"),
    MovedModule("builtins", "__builtin__"),
    MovedModule("configparser", "ConfigParser"),
    MovedModule("copyreg", "copy_reg"),
    MovedModule("dbm_gnu", "gdbm", "dbm.gnu"),
    MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"),
    MovedModule("http_cookiejar", "cookielib", "http.cookiejar"),
    MovedModule("http_cookies", "Cookie", "http.cookies"),
    MovedModule("html_entities", "htmlentitydefs", "html.entities"),
    MovedModule("html_parser", "HTMLParser", "html.parser"),
    MovedModule("http_client", "httplib", "http.client"),
    MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"),
    MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"),
    MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"),
    MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"),
    MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"),
    MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"),
    MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"),
    MovedModule("cPickle", "cPickle", "pickle"),
    MovedModule("queue", "Queue"),
    MovedModule("reprlib", "repr"),
    MovedModule("socketserver", "SocketServer"),
    MovedModule("_thread", "thread", "_thread"),
    MovedModule("tkinter", "Tkinter"),
    MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"),
    MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"),
    MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"),
    MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"),
    MovedModule("tkinter_tix", "Tix", "tkinter.tix"),
    MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"),
    MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"),
    MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"),
    MovedModule("tkinter_colorchooser", "tkColorChooser",
                "tkinter.colorchooser"),
    MovedModule("tkinter_commondialog", "tkCommonDialog",
                "tkinter.commondialog"),
    MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"),
    MovedModule("tkinter_font", "tkFont", "tkinter.font"),
    MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"),
    MovedModule("tkinter_tksimpledialog", "tkSimpleDialog",
                "tkinter.simpledialog"),
    MovedModule("urllib_parse", __name__ + ".moves.urllib_parse", "urllib.parse"),
    MovedModule("urllib_error", __name__ + ".moves.urllib_error", "urllib.error"),
    MovedModule("urllib", __name__ + ".moves.urllib", __name__ + ".moves.urllib"),
    MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"),
    MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"),
    MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"),
]
# Add windows specific modules.
if sys.platform == "win32":
    _moved_attributes += [
        MovedModule("winreg", "_winreg"),
    ]

for attr in _moved_attributes:
    setattr(_MovedItems, attr.name, attr)
    if isinstance(attr, MovedModule):
        _importer._add_module(attr, "moves." + attr.name)
del attr

_MovedItems._moved_attributes = _moved_attributes

moves = _MovedItems(__name__ + ".moves")
_importer._add_module(moves, "moves")


class Module_six_moves_urllib_parse(_LazyModule):

    """Lazy loading of moved objects in six.moves.urllib_parse"""


_urllib_parse_moved_attributes = [
    MovedAttribute("ParseResult", "urlparse", "urllib.parse"),
    MovedAttribute("SplitResult", "urlparse", "urllib.parse"),
    MovedAttribute("parse_qs", "urlparse", "urllib.parse"),
    MovedAttribute("parse_qsl", "urlparse", "urllib.parse"),
    MovedAttribute("urldefrag", "urlparse", "urllib.parse"),
    MovedAttribute("urljoin", "urlparse", "urllib.parse"),
    MovedAttribute("urlparse", "urlparse", "urllib.parse"),
    MovedAttribute("urlsplit", "urlparse", "urllib.parse"),
    MovedAttribute("urlunparse", "urlparse", "urllib.parse"),
    MovedAttribute("urlunsplit", "urlparse", "urllib.parse"),
    MovedAttribute("quote", "urllib", "urllib.parse"),
    MovedAttribute("quote_plus", "urllib", "urllib.parse"),
    MovedAttribute("unquote", "urllib", "urllib.parse"),
    MovedAttribute("unquote_plus", "urllib", "urllib.parse"),
    MovedAttribute("urlencode", "urllib", "urllib.parse"),
    MovedAttribute("splitquery", "urllib", "urllib.parse"),
    MovedAttribute("splittag", "urllib", "urllib.parse"),
    MovedAttribute("splituser", "urllib", "urllib.parse"),
    MovedAttribute("uses_fragment", "urlparse", "urllib.parse"),
    MovedAttribute("uses_netloc", "urlparse", "urllib.parse"),
    MovedAttribute("uses_params", "urlparse", "urllib.parse"),
    MovedAttribute("uses_query", "urlparse", "urllib.parse"),
    MovedAttribute("uses_relative", "urlparse", "urllib.parse"),
]
for attr in _urllib_parse_moved_attributes:
    setattr(Module_six_moves_urllib_parse, attr.name, attr)
del attr

Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes

_importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"),
                      "moves.urllib_parse", "moves.urllib.parse")


class Module_six_moves_urllib_error(_LazyModule):

    """Lazy loading of moved objects in six.moves.urllib_error"""


_urllib_error_moved_attributes = [
    MovedAttribute("URLError", "urllib2", "urllib.error"),
    MovedAttribute("HTTPError", "urllib2", "urllib.error"),
    MovedAttribute("ContentTooShortError", "urllib", "urllib.error"),
]
for attr in _urllib_error_moved_attributes:
    setattr(Module_six_moves_urllib_error, attr.name, attr)
del attr

Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes

_importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"),
                      "moves.urllib_error", "moves.urllib.error")


class Module_six_moves_urllib_request(_LazyModule):

    """Lazy loading of moved objects in six.moves.urllib_request"""


_urllib_request_moved_attributes = [
    MovedAttribute("urlopen", "urllib2", "urllib.request"),
    MovedAttribute("install_opener", "urllib2", "urllib.request"),
    MovedAttribute("build_opener", "urllib2", "urllib.request"),
    MovedAttribute("pathname2url", "urllib", "urllib.request"),
    MovedAttribute("url2pathname", "urllib", "urllib.request"),
    MovedAttribute("getproxies", "urllib", "urllib.request"),
    MovedAttribute("Request", "urllib2", "urllib.request"),
    MovedAttribute("OpenerDirector", "urllib2", "urllib.request"),
    MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"),
    MovedAttribute("ProxyHandler", "urllib2", "urllib.request"),
    MovedAttribute("BaseHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"),
    MovedAttribute("HTTPPasswordMgrWithDefaultRealm", "urllib2", "urllib.request"),
    MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"),
    MovedAttribute("FileHandler", "urllib2", "urllib.request"),
    MovedAttribute("FTPHandler", "urllib2", "urllib.request"),
    MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"),
    MovedAttribute("UnknownHandler", "urllib2", "urllib.request"),
    MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"),
    MovedAttribute("urlretrieve", "urllib", "urllib.request"),
    MovedAttribute("urlcleanup", "urllib", "urllib.request"),
    MovedAttribute("URLopener", "urllib", "urllib.request"),
    MovedAttribute("FancyURLopener", "urllib", "urllib.request"),
    MovedAttribute("proxy_bypass", "urllib", "urllib.request"),
]
for attr in _urllib_request_moved_attributes:
    setattr(Module_six_moves_urllib_request, attr.name, attr)
del attr

Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes

_importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"),
                      "moves.urllib_request", "moves.urllib.request")


class Module_six_moves_urllib_response(_LazyModule):

    """Lazy loading of moved objects in six.moves.urllib_response"""


_urllib_response_moved_attributes = [
    MovedAttribute("addbase", "urllib", "urllib.response"),
    MovedAttribute("addclosehook", "urllib", "urllib.response"),
    MovedAttribute("addinfo", "urllib", "urllib.response"),
    MovedAttribute("addinfourl", "urllib", "urllib.response"),
]
for attr in _urllib_response_moved_attributes:
    setattr(Module_six_moves_urllib_response, attr.name, attr)
del attr

Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes

_importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"),
                      "moves.urllib_response", "moves.urllib.response")


class Module_six_moves_urllib_robotparser(_LazyModule):

    """Lazy loading of moved objects in six.moves.urllib_robotparser"""


_urllib_robotparser_moved_attributes = [
    MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"),
]
for attr in _urllib_robotparser_moved_attributes:
    setattr(Module_six_moves_urllib_robotparser, attr.name, attr)
del attr

Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes

_importer._add_module(Module_six_moves_urllib_robotparser(__name__ + ".moves.urllib.robotparser"),
                      "moves.urllib_robotparser", "moves.urllib.robotparser")


class Module_six_moves_urllib(types.ModuleType):

    """Create a six.moves.urllib namespace that resembles the Python 3 namespace"""
    __path__ = []  # mark as package
    parse = _importer._get_module("moves.urllib_parse")
    error = _importer._get_module("moves.urllib_error")
    request = _importer._get_module("moves.urllib_request")
    response = _importer._get_module("moves.urllib_response")
    robotparser = _importer._get_module("moves.urllib_robotparser")

    def __dir__(self):
        return ['parse', 'error', 'request', 'response', 'robotparser']

_importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"),
                      "moves.urllib")


def add_move(move):
    """Add an item to six.moves."""
    setattr(_MovedItems, move.name, move)


def remove_move(name):
    """Remove item from six.moves."""
    try:
        delattr(_MovedItems, name)
    except AttributeError:
        try:
            del moves.__dict__[name]
        except KeyError:
            raise AttributeError("no such move, %r" % (name,))


if PY3:
    _meth_func = "__func__"
    _meth_self = "__self__"

    _func_closure = "__closure__"
    _func_code = "__code__"
    _func_defaults = "__defaults__"
    _func_globals = "__globals__"
else:
    _meth_func = "im_func"
    _meth_self = "im_self"

    _func_closure = "func_closure"
    _func_code = "func_code"
    _func_defaults = "func_defaults"
    _func_globals = "func_globals"


try:
    advance_iterator = next
except NameError:
    def advance_iterator(it):
        return it.next()
next = advance_iterator


try:
    callable = callable
except NameError:
    def callable(obj):
        return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)


if PY3:
    def get_unbound_function(unbound):
        return unbound

    create_bound_method = types.MethodType

    def create_unbound_method(func, cls):
        return func

    Iterator = object
else:
    def get_unbound_function(unbound):
        return unbound.im_func

    def create_bound_method(func, obj):
        return types.MethodType(func, obj, obj.__class__)

    def create_unbound_method(func, cls):
        return types.MethodType(func, None, cls)

    class Iterator(object):

        def next(self):
            return type(self).__next__(self)

    callable = callable
_add_doc(get_unbound_function,
         """Get the function out of a possibly unbound function""")


get_method_function = operator.attrgetter(_meth_func)
get_method_self = operator.attrgetter(_meth_self)
get_function_closure = operator.attrgetter(_func_closure)
get_function_code = operator.attrgetter(_func_code)
get_function_defaults = operator.attrgetter(_func_defaults)
get_function_globals = operator.attrgetter(_func_globals)


if PY3:
    def iterkeys(d, **kw):
        return iter(d.keys(**kw))

    def itervalues(d, **kw):
        return iter(d.values(**kw))

    def iteritems(d, **kw):
        return iter(d.items(**kw))

    def iterlists(d, **kw):
        return iter(d.lists(**kw))

    viewkeys = operator.methodcaller("keys")

    viewvalues = operator.methodcaller("values")

    viewitems = operator.methodcaller("items")
else:
    def iterkeys(d, **kw):
        return d.iterkeys(**kw)

    def itervalues(d, **kw):
        return d.itervalues(**kw)

    def iteritems(d, **kw):
        return d.iteritems(**kw)

    def iterlists(d, **kw):
        return d.iterlists(**kw)

    viewkeys = operator.methodcaller("viewkeys")

    viewvalues = operator.methodcaller("viewvalues")

    viewitems = operator.methodcaller("viewitems")

_add_doc(iterkeys, "Return an iterator over the keys of a dictionary.")
_add_doc(itervalues, "Return an iterator over the values of a dictionary.")
_add_doc(iteritems,
         "Return an iterator over the (key, value) pairs of a dictionary.")
_add_doc(iterlists,
         "Return an iterator over the (key, [values]) pairs of a dictionary.")


if PY3:
    def b(s):
        return s.encode("latin-1")

    def u(s):
        return s
    unichr = chr
    import struct
    int2byte = struct.Struct(">B").pack
    del struct
    byte2int = operator.itemgetter(0)
    indexbytes = operator.getitem
    iterbytes = iter
    import io
    StringIO = io.StringIO
    BytesIO = io.BytesIO
    _assertCountEqual = "assertCountEqual"
    if sys.version_info[1] <= 1:
        _assertRaisesRegex = "assertRaisesRegexp"
        _assertRegex = "assertRegexpMatches"
    else:
        _assertRaisesRegex = "assertRaisesRegex"
        _assertRegex = "assertRegex"
else:
    def b(s):
        return s
    # Workaround for standalone backslash

    def u(s):
        return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
    unichr = unichr
    int2byte = chr

    def byte2int(bs):
        return ord(bs[0])

    def indexbytes(buf, i):
        return ord(buf[i])
    iterbytes = functools.partial(itertools.imap, ord)
    import StringIO
    StringIO = BytesIO = StringIO.StringIO
    _assertCountEqual = "assertItemsEqual"
    _assertRaisesRegex = "assertRaisesRegexp"
    _assertRegex = "assertRegexpMatches"
_add_doc(b, """Byte literal""")
_add_doc(u, """Text literal""")


def assertCountEqual(self, *args, **kwargs):
    return getattr(self, _assertCountEqual)(*args, **kwargs)


def assertRaisesRegex(self, *args, **kwargs):
    return getattr(self, _assertRaisesRegex)(*args, **kwargs)


def assertRegex(self, *args, **kwargs):
    return getattr(self, _assertRegex)(*args, **kwargs)


if PY3:
    exec_ = getattr(moves.builtins, "exec")

    def reraise(tp, value, tb=None):
        if value is None:
            value = tp()
        if value.__traceback__ is not tb:
            raise value.with_traceback(tb)
        raise value

else:
    def exec_(_code_, _globs_=None, _locs_=None):
        """Execute code in a namespace."""
        if _globs_ is None:
            frame = sys._getframe(1)
            _globs_ = frame.f_globals
            if _locs_ is None:
                _locs_ = frame.f_locals
            del frame
        elif _locs_ is None:
            _locs_ = _globs_
        exec("""exec _code_ in _globs_, _locs_""")

    exec_("""def reraise(tp, value, tb=None):
    raise tp, value, tb
""")


if sys.version_info[:2] == (3, 2):
    exec_("""def raise_from(value, from_value):
    if from_value is None:
        raise value
    raise value from from_value
""")
elif sys.version_info[:2] > (3, 2):
    exec_("""def raise_from(value, from_value):
    raise value from from_value
""")
else:
    def raise_from(value, from_value):
        raise value


print_ = getattr(moves.builtins, "print", None)
if print_ is None:
    def print_(*args, **kwargs):
        """The new-style print function for Python 2.4 and 2.5."""
        fp = kwargs.pop("file", sys.stdout)
        if fp is None:
            return

        def write(data):
            if not isinstance(data, basestring):
                data = str(data)
            # If the file has an encoding, encode unicode with it.
            if (isinstance(fp, file) and
                    isinstance(data, unicode) and
                    fp.encoding is not None):
                errors = getattr(fp, "errors", None)
                if errors is None:
                    errors = "strict"
                data = data.encode(fp.encoding, errors)
            fp.write(data)
        want_unicode = False
        sep = kwargs.pop("sep", None)
        if sep is not None:
            if isinstance(sep, unicode):
                want_unicode = True
            elif not isinstance(sep, str):
                raise TypeError("sep must be None or a string")
        end = kwargs.pop("end", None)
        if end is not None:
            if isinstance(end, unicode):
                want_unicode = True
            elif not isinstance(end, str):
                raise TypeError("end must be None or a string")
        if kwargs:
            raise TypeError("invalid keyword arguments to print()")
        if not want_unicode:
            for arg in args:
                if isinstance(arg, unicode):
                    want_unicode = True
                    break
        if want_unicode:
            newline = unicode("\n")
            space = unicode(" ")
        else:
            newline = "\n"
            space = " "
        if sep is None:
            sep = space
        if end is None:
            end = newline
        for i, arg in enumerate(args):
            if i:
                write(sep)
            write(arg)
        write(end)
if sys.version_info[:2] < (3, 3):
    _print = print_

    def print_(*args, **kwargs):
        fp = kwargs.get("file", sys.stdout)
        flush = kwargs.pop("flush", False)
        _print(*args, **kwargs)
        if flush and fp is not None:
            fp.flush()

_add_doc(reraise, """Reraise an exception.""")

if sys.version_info[0:2] < (3, 4):
    def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
              updated=functools.WRAPPER_UPDATES):
        def wrapper(f):
            f = functools.wraps(wrapped, assigned, updated)(f)
            f.__wrapped__ = wrapped
            return f
        return wrapper
else:
    wraps = functools.wraps


def with_metaclass(meta, *bases):
    """Create a base class with a metaclass."""
    # This requires a bit of explanation: the basic idea is to make a dummy
    # metaclass for one level of class instantiation that replaces itself with
    # the actual metaclass.
    class metaclass(meta):

        def __new__(cls, name, this_bases, d):
            return meta(name, bases, d)
    return type.__new__(metaclass, 'temporary_class', (), {})


def add_metaclass(metaclass):
    """Class decorator for creating a class with a metaclass."""
    def wrapper(cls):
        orig_vars = cls.__dict__.copy()
        slots = orig_vars.get('__slots__')
        if slots is not None:
            if isinstance(slots, str):
                slots = [slots]
            for slots_var in slots:
                orig_vars.pop(slots_var)
        orig_vars.pop('__dict__', None)
        orig_vars.pop('__weakref__', None)
        return metaclass(cls.__name__, cls.__bases__, orig_vars)
    return wrapper


def python_2_unicode_compatible(klass):
    """
    A decorator that defines __unicode__ and __str__ methods under Python 2.
    Under Python 3 it does nothing.

    To support Python 2 and 3 with a single code base, define a __str__ method
    returning text and apply this decorator to the class.
    """
    if PY2:
        if '__str__' not in klass.__dict__:
            raise ValueError("@python_2_unicode_compatible cannot be applied "
                             "to %s because it doesn't define __str__()." %
                             klass.__name__)
        klass.__unicode__ = klass.__str__
        klass.__str__ = lambda self: self.__unicode__().encode('utf-8')
    return klass


# Complete the moves implementation.
# This code is at the end of this module to speed up module loading.
# Turn this module into a package.
__path__ = []  # required for PEP 302 and PEP 451
__package__ = __name__  # see PEP 366 @ReservedAssignment
if globals().get("__spec__") is not None:
    __spec__.submodule_search_locations = []  # PEP 451 @UndefinedVariable
# Remove other six meta path importers, since they cause problems. This can
# happen if six is removed from sys.modules and then reloaded. (Setuptools does
# this for some reason.)
if sys.meta_path:
    for i, importer in enumerate(sys.meta_path):
        # Here's some real nastiness: Another "instance" of the six module might
        # be floating around. Therefore, we can't use isinstance() to check for
        # the six meta path importer, since the other six instance will have
        # inserted an importer with different class.
        if (type(importer).__name__ == "_SixMetaPathImporter" and
                importer.name == __name__):
            del sys.meta_path[i]
            break
    del i, importer
# Finally, add the importer to the meta path import hook.
sys.meta_path.append(_importer)
PK!NB21_vendor/__pycache__/__init__.cpython-38.opt-1.pycnu[U

Qab@sdS)Nrrr?/usr/lib/python3.8/site-packages/setuptools/_vendor/__init__.pyPK!L_k_k_&_vendor/__pycache__/six.cpython-38.pycnu[U

QabuA@sRdZddlmZddlZddlZddlZddlZddlZdZdZ	ej
ddkZej
ddkZej
dddkZ
erefZefZefZeZeZejZn~efZeefZeejfZeZeZejd	red
ZnHGdddeZ ze!e Wne"k
red
ZYn
Xed
Z[ ddZ#ddZ$GdddeZ%Gddde%Z&Gdddej'Z(Gddde%Z)GdddeZ*e*e+Z,Gddde(Z-e)dddd e)d!d"d#d$d!e)d%d"d"d&d%e)d'd(d#d)d'e)d*d(d+e)d,d"d#d-d,e)d.d/d/d0d.e)d1d/d/d.d1e)d2d(d#d3d2e)d4d(e
rd5nd6d7e)d8d(d9e)d:d;dd>d?e)d@d@d?e)dAdAd?e)d3d(d#d3d2e)dBd"d#dCdBe)dDd"d"dEdDe&d#d(e&dFdGe&dHdIe&dJdKdLe&dMdNdMe&dOdPdQe&dRdSdTe&dUdVdWe&dXdYdZe&d[d\d]e&d^d_d`e&dadbdce&dddedfe&dgdhdie&djdjdke&dldldke&dmdmdke&dndndoe&dpdqe&drdse&dtdue&dvdwdve&dxdye&dzd{d|e&d}d~de&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkrRe.e&ddg7Z.e.D]2Z/e0e-e/j1e/e2e/e&rVe,3e/de/j1qV[/e.e-_.e-e+dZ4e,3e4dGddde(Z5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d=dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6e6D]Z/e0e5e/j1e/q[/e6e5_.e,3e5e+dddҡGddԄde(Z7e)ddde)ddde)dddgZ8e8D]Z/e0e7e/j1e/q[/e8e7_.e,3e7e+dddۡGdd݄de(Z9e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃g!Z:e:D]Z/e0e9e/j1e/q[/e:e9_.e,3e9e+dddGddde(Z;e)ddde)ddde)ddde)d	ddgZe>D]Z/e0e=e/j1e/q[/e>e=_.e,3e=e+dddGdddej'Z?e,3e?e+ddddZ@ddZAe	rHdZBdZCdZDdZEdZFdZGn$d ZBd!ZCd"ZDd#ZEd$ZFd%ZGzeHZIWn"eJk
	rd&d'ZIYnXeIZHzeKZKWn"eJk
	rd(d)ZKYnXe	rd*d+ZLejMZNd,d-ZOeZPn>d.d+ZLd/d0ZNd1d-ZOGd2d3d3eZPeKZKe#eLd4eQeBZReQeCZSeQeDZTeQeEZUeQeFZVeQeGZWe
rԐd5d6ZXd7d8ZYd9d:ZZd;d<Z[e\d=Z]e\d>Z^e\d?Z_nTd@d6ZXdAd8ZYdBd:ZZdCd<Z[e\dDZ]e\dEZ^e\dFZ_e#eXdGe#eYdHe#eZdIe#e[dJerdKdLZ`dMdNZaebZcddldZdededOjfZg[dehdZiejjZkelZmddlnZnenjoZoenjpZpdPZqej
dQdQkrdRZrdSZsndTZrdUZsnjdVdLZ`dWdNZaecZcebZgdXdYZidZd[ZketejuevZmddloZoeojoZoZpd\ZqdRZrdSZse#e`d]e#ead^d_dPZwd`dTZxdadUZyereze4j{dbZ|d|dcddZ}nd}dedfZ|e|dgej
dddhkre|din.ej
dddhk
re|djndkdlZ~eze4j{dmdZedk
rLdndoZej
dddpk
rreZdqdoZe#e}drej
dddk
rejejfdsdtZnejZdudvZdwdxZdydzZgZe+Zed{dk	
rge_ejrBeejD]4\ZZeej+dkrej1e+kreje=q>q[[eje,dS(~z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.10.0)rjavaic@seZdZddZdS)XcCsdS)Nlselfrr:/usr/lib/python3.8/site-packages/setuptools/_vendor/six.py__len__>sz	X.__len__N)__name__
__module____qualname__rrrrrr<srlcCs
||_dS)z Add documentation to a function.N)__doc__)funcdocrrr_add_docKsrcCst|tj|S)z7Import module, returning the module after the last dot.)
__import__sysmodulesnamerrr_import_modulePsrc@seZdZddZddZdS)
_LazyDescrcCs
||_dSNrr
rrrr__init__Xsz_LazyDescr.__init__cCsB|}t||j|zt|j|jWntk
r<YnX|Sr)_resolvesetattrrdelattr	__class__AttributeError)r
objtpresultrrr__get__[sz_LazyDescr.__get__N)r
rrrr&rrrrrVsrcs.eZdZdfdd	ZddZddZZS)	MovedModuleNcs2tt||tr(|dkr |}||_n||_dSr)superr'rPY3mod)r
roldnewr!rrriszMovedModule.__init__cCs
t|jSr)rr*r	rrrrrszMovedModule._resolvecCs"|}t||}t||||Sr)rgetattrr)r
attr_modulevaluerrr__getattr__us
zMovedModule.__getattr__)N)r
rrrrr2
__classcell__rrr-rr'gs	r'cs(eZdZfddZddZgZZS)_LazyModulecstt|||jj|_dSr)r(r4rr!rrr-rrr~sz_LazyModule.__init__cCs ddg}|dd|jD7}|S)Nrr
cSsg|]
}|jqSrr).0r/rrr
sz'_LazyModule.__dir__..)_moved_attributes)r
Zattrsrrr__dir__sz_LazyModule.__dir__)r
rrrr8r7r3rrr-rr4|sr4cs&eZdZdfdd	ZddZZS)MovedAttributeNcsdtt||trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dSr)r(r9rr)r*r/)r
rZold_modZnew_modZold_attrZnew_attrr-rrrszMovedAttribute.__init__cCst|j}t||jSr)rr*r.r/)r
modulerrrrs
zMovedAttribute._resolve)NN)r
rrrrr3rrr-rr9sr9c@sVeZdZdZddZddZddZdd	d
ZddZd
dZ	ddZ
ddZeZdS)_SixMetaPathImporterz
    A meta path importer to import six.moves and its submodules.

    This class implements a PEP302 finder and loader. It should be compatible
    with Python 2.5 and all existing versions of Python3
    cCs||_i|_dSr)r
known_modules)r
Zsix_module_namerrrrsz_SixMetaPathImporter.__init__cGs"|D]}||j|jd|<qdSN.r<r)r
r*Z	fullnamesfullnamerrr_add_modulesz _SixMetaPathImporter._add_modulecCs|j|jd|Sr=r?r
r@rrr_get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdSr)r<)r
r@pathrrrfind_modules
z _SixMetaPathImporter.find_modulecCs2z|j|WStk
r,td|YnXdS)Nz!This loader does not know module )r<KeyErrorImportErrorrBrrrZ__get_modulesz!_SixMetaPathImporter.__get_modulecCsTztj|WStk
r YnX||}t|tr@|}n||_|tj|<|Sr)rrrF _SixMetaPathImporter__get_module
isinstancer'r
__loader__)r
r@r*rrrload_modules



z _SixMetaPathImporter.load_modulecCst||dS)z
        Return true, if the named module is a package.

        We need this method to get correct spec objects with
        Python 3.4 (see PEP451)
        __path__)hasattrrHrBrrr
is_packagesz_SixMetaPathImporter.is_packagecCs||dS)z;Return None

        Required, if is_package is implementedN)rHrBrrrget_codes
z_SixMetaPathImporter.get_code)N)
r
rrrrrArCrErHrKrNrO
get_sourcerrrrr;s
	r;c@seZdZdZgZdS)_MovedItemszLazy loading of moved objectsN)r
rrrrLrrrrrQsrQZ	cStringIOioStringIOfilter	itertoolsbuiltinsZifilterfilterfalseZifilterfalseinputZ__builtin__Z	raw_inputinternrmapimapgetcwdosZgetcwdugetcwdbrangeZxrangeZ
reload_module	importlibZimpreloadreduce	functoolsZshlex_quoteZpipesZshlexZquoteUserDictcollectionsUserList
UserStringzipZizipzip_longestZizip_longestZconfigparserZConfigParsercopyregZcopy_regZdbm_gnuZgdbmzdbm.gnuZ
_dummy_threadZdummy_threadZhttp_cookiejarZ	cookielibzhttp.cookiejarZhttp_cookiesZCookiezhttp.cookiesZ
html_entitiesZhtmlentitydefsz
html.entitiesZhtml_parserZ
HTMLParserzhtml.parserZhttp_clientZhttplibzhttp.clientZemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartZemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartZemail_mime_textzemail.MIMETextzemail.mime.textZemail_mime_basezemail.MIMEBasezemail.mime.baseZBaseHTTPServerzhttp.serverZ
CGIHTTPServerZSimpleHTTPServerZcPicklepickleZqueueZQueuereprlibreprZsocketserverZSocketServer_threadthreadZtkinterZTkinterZtkinter_dialogZDialogztkinter.dialogZtkinter_filedialogZ
FileDialogztkinter.filedialogZtkinter_scrolledtextZScrolledTextztkinter.scrolledtextZtkinter_simpledialogZSimpleDialogztkinter.simpledialogZtkinter_tixZTixztkinter.tixZtkinter_ttkZttkztkinter.ttkZtkinter_constantsZTkconstantsztkinter.constantsZtkinter_dndZTkdndztkinter.dndZtkinter_colorchooserZtkColorChooserztkinter.colorchooserZtkinter_commondialogZtkCommonDialogztkinter.commondialogZtkinter_tkfiledialogZtkFileDialogZtkinter_fontZtkFontztkinter.fontZtkinter_messageboxZtkMessageBoxztkinter.messageboxZtkinter_tksimpledialogZtkSimpleDialogZurllib_parsez.moves.urllib_parsezurllib.parseZurllib_errorz.moves.urllib_errorzurllib.errorZurllibz
.moves.urllibZurllib_robotparserrobotparserzurllib.robotparserZ
xmlrpc_clientZ	xmlrpclibz
xmlrpc.clientZ
xmlrpc_serverZSimpleXMLRPCServerz
xmlrpc.serverZwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseNr
rrrrrrrrt@srtZParseResultZurlparseZSplitResultZparse_qsZ	parse_qslZ	urldefragZurljoinZurlsplitZ
urlunparseZ
urlunsplitZ
quote_plusZunquoteZunquote_plusZ	urlencodeZ
splitqueryZsplittagZ	splituserZ
uses_fragmentZuses_netlocZuses_paramsZ
uses_queryZ
uses_relativemoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorNrurrrrrwhsrwZURLErrorZurllib2Z	HTTPErrorZContentTooShortErrorz.moves.urllib.errormoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestNrurrrrry|sryZurlopenzurllib.requestZinstall_openerZbuild_openerZpathname2urlZurl2pathnameZ
getproxiesZRequestZOpenerDirectorZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZBaseHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerZFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerZHTTPErrorProcessorZurlretrieveZ
urlcleanupZ	URLopenerZFancyURLopenerZproxy_bypassz.moves.urllib.requestmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseNrurrrrr{sr{Zaddbasezurllib.responseZaddclosehookZaddinfoZ
addinfourlz.moves.urllib.responsemoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserNrurrrrr}sr}ZRobotFileParserz.moves.urllib.robotparsermoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZedZedZedZ	edZ
edZddZd	S)
Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacervrxrzr|r~cCsdddddgS)Nparseerrorrequestresponserprr	rrrr8szModule_six_moves_urllib.__dir__N)
r
rrrrL	_importerrCrrrrrpr8rrrrrs




rzmoves.urllibcCstt|j|dS)zAdd an item to six.moves.N)rrQr)Zmoverrradd_movesrcCsXztt|WnDtk
rRztj|=Wn"tk
rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)r rQr"rs__dict__rFrrrrremove_movesr__func____self____closure____code____defaults____globals__im_funcZim_selfZfunc_closureZ	func_codeZ
func_defaultsZfunc_globalscCs|Sr)next)itrrradvance_iteratorsrcCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)r)r5klassrrr	szcallable..)anytype__mro__)r#rrrcallablesrcCs|SrrZunboundrrrget_unbound_functionsrcCs|Srrrclsrrrcreate_unbound_methodsrcCs|jSr)rrrrrr"scCst|||jSr)types
MethodTyper!)rr#rrrcreate_bound_method%srcCst|d|Sr)rrrrrrr(sc@seZdZddZdS)IteratorcCst||Sr)r__next__r	rrrr-sz
Iterator.nextN)r
rrrrrrrr+srz3Get the function out of a possibly unbound functioncKst|jf|Sr)iterkeysdkwrrriterkeys>srcKst|jf|Sr)rvaluesrrrr
itervaluesAsrcKst|jf|Sr)ritemsrrrr	iteritemsDsrcKst|jf|Sr)rZlistsrrrr	iterlistsGsrrrrcKs|jf|Sr)rrrrrrPscKs|jf|Sr)rrrrrrSscKs|jf|Sr)rrrrrrVscKs|jf|Sr)rrrrrrYsviewkeys
viewvalues	viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs
|dS)Nzlatin-1)encodesrrrbksrcCs|Srrrrrrunsrz>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesassertRaisesRegexassertRegexcCs|SrrrrrrrscCst|dddS)Nz\\z\\\\Zunicode_escape)unicodereplacerrrrrscCst|dS)Nrord)Zbsrrrbyte2intsrcCst||Srr)Zbufirrr
indexbytessrZassertItemsEqualzByte literalzText literalcOst|t||Sr)r._assertCountEqualr
argskwargsrrrrscOst|t||Sr)r._assertRaisesRegexrrrrrscOst|t||Sr)r._assertRegexrrrrrsexeccCs*|dkr|}|j|k	r"|||dSr)
__traceback__with_traceback)r$r1tbrrrreraises


rcCsB|dkr*td}|j}|dkr&|j}~n|dkr6|}tddS)zExecute code in a namespace.Nrzexec _code_ in _globs_, _locs_)r	_getframe	f_globalsf_localsr)Z_code_Z_globs_Z_locs_framerrrexec_s
rz9def reraise(tp, value, tb=None):
    raise tp, value, tb
)rrzrdef raise_from(value, from_value):
    if from_value is None:
        raise value
    raise value from from_value
zCdef raise_from(value, from_value):
    raise value from from_value
cCs|dSrr)r1Z
from_valuerrr
raise_fromsrprintc
s.|dtjdkrdSfdd}d}|dd}|dk	r`t|trNd}nt|ts`td|d	d}|dk	rt|trd}nt|tstd
|rtd|s|D]}t|trd}qq|rtd}td
}nd}d
}|dkr|}|dkr|}t|D] \}	}|	r||||q||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk	rVtdd}|dkrHd}|j|}|dS)Nerrorsstrict)	rI
basestringstrrrencodingr.rwrite)datarfprrrs

zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()
 )poprstdoutrIrr	TypeError	enumerate)
rrrZwant_unicoderrargnewlineZspacerrrrprint_sL





r)rrcOs<|dtj}|dd}t|||r8|dk	r8|dS)NrflushF)getrrr_printr)rrrrrrrrs

zReraise an exception.csfdd}|S)Ncst|}|_|Sr)rcwraps__wrapped__)fassignedupdatedwrappedrrwrapperszwraps..wrapperr)rrrrrrrrsrcs&Gfddd}t|ddiS)z%Create a base class with a metaclass.cseZdZfddZdS)z!with_metaclass..metaclasscs||Srr)rrZ
this_basesrbasesmetarr__new__'sz)with_metaclass..metaclass.__new__N)r
rrrrrrr	metaclass%srZtemporary_classr)rr)rrrrrrwith_metaclass srcsfdd}|S)z6Class decorator for creating a class with a metaclass.csh|j}|d}|dk	r@t|tr,|g}|D]}||q0|dd|dd|j|j|S)N	__slots__r__weakref__)rcopyrrIrrr
	__bases__)rZ	orig_varsslotsZ	slots_varrrrr.s


zadd_metaclass..wrapperr)rrrrr
add_metaclass,srcCs2tr.d|jkrtd|j|j|_dd|_|S)a
    A decorator that defines __unicode__ and __str__ methods under Python 2.
    Under Python 3 it does nothing.

    To support Python 2 and 3 with a single code base, define a __str__ method
    returning text and apply this decorator to the class.
    __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|dS)Nzutf-8)__unicode__rr	rrrJz-python_2_unicode_compatible..)PY2r
ValueErrorr
rr)rrrrpython_2_unicode_compatible<s

r__spec__)N)NN)rZ
__future__rrcrUoperatorrr
__author____version__version_inforr)ZPY34rZstring_typesintZ
integer_typesrZclass_typesZ	text_typebytesZbinary_typemaxsizeZMAXSIZErZlongZ	ClassTyperplatform
startswithobjectrlen
OverflowErrorrrrr'
ModuleTyper4r9r;r
rrQr7r/rrrIrArsrtZ_urllib_parse_moved_attributesrwZ_urllib_error_moved_attributesryZ _urllib_request_moved_attributesr{Z!_urllib_response_moved_attributesr}Z$_urllib_robotparser_moved_attributesrrrZ
_meth_funcZ
_meth_selfZ
_func_closureZ
_func_codeZ_func_defaultsZ
_func_globalsrr	NameErrorrrrrrr
attrgetterZget_method_functionZget_method_selfZget_function_closureZget_function_codeZget_function_defaultsZget_function_globalsrrrrmethodcallerrrrrrchrZunichrstructStructpackZint2byte
itemgetterrgetitemrrZ	iterbytesrRrSBytesIOrrrpartialr[rrrrr.rVrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrrrrrL__package__globalsrrsubmodule_search_locations	meta_pathrrZimporterappendrrrrs

>



































D


























































#










5
PK!3"@@._vendor/__pycache__/ordered_set.cpython-38.pycnu[U

Qab;@s|dZddlZddlmZzddlmZmZWn$ek
rPddlmZmZYnXe	dZ
dZddZGdd	d	eeZ
dS)
z
An OrderedSet is a custom MutableSet that remembers its order, so that every
entry has an index that can be looked up.

Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger,
and released under the MIT license.
N)deque)
MutableSetSequencez3.1cCs"t|do t|to t|tS)a

    Are we being asked to look up a list of things, instead of a single thing?
    We check for the `__iter__` attribute so that this can cover types that
    don't have to be known by this module, such as NumPy arrays.

    Strings, however, should be considered as atomic values to look up, not
    iterables. The same goes for tuples, since they are immutable and therefore
    valid entries.

    We don't need to check for the Python 2 `unicode` type, because it doesn't
    have an `__iter__` attribute anyway.
    __iter__)hasattr
isinstancestrtuple)objrB/usr/lib/python3.8/site-packages/setuptools/_vendor/ordered_set.pyis_iterables



r
c@seZdZdZd;ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeZddZ
ddZeZeZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)<
OrderedSetz
    An OrderedSet is a custom MutableSet that remembers its order, so that
    every entry has an index that can be looked up.

    Example:
        >>> OrderedSet([1, 1, 2, 3, 2])
        OrderedSet([1, 2, 3])
    NcCs g|_i|_|dk	r||O}dSN)itemsmap)selfiterablerrr__init__4szOrderedSet.__init__cCs
t|jS)z
        Returns the number of unique elements in the ordered set

        Example:
            >>> len(OrderedSet([]))
            0
            >>> len(OrderedSet([1, 2]))
            2
        )lenrrrrr__len__:s
zOrderedSet.__len__cs|t|tr|tkrSt|r4fdd|DSt|dsHt|trlj|}t|trf|S|Snt	d|dS)aQ
        Get the item at a given index.

        If `index` is a slice, you will get back that slice of items, as a
        new OrderedSet.

        If `index` is a list or a similar iterable, you'll get a list of
        items corresponding to those indices. This is similar to NumPy's
        "fancy indexing". The result is not an OrderedSet because you may ask
        for duplicate indices, and the number of elements returned should be
        the number of elements asked for.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset[1]
            2
        csg|]}j|qSr)r).0irrr
[sz*OrderedSet.__getitem__..	__index__z+Don't know how to index an OrderedSet by %rN)
rslice	SLICE_ALLcopyr
rrlist	__class__	TypeError)rindexresultrrr__getitem__Fs


zOrderedSet.__getitem__cCs
||S)z
        Return a shallow copy of this object.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> other = this.copy()
            >>> this == other
            True
            >>> this is other
            False
        )r rrrrreszOrderedSet.copycCst|dkrdSt|SdS)Nrr)rrrrrr__getstate__sszOrderedSet.__getstate__cCs"|dkr|gn
||dS)Nr)r)rstaterrr__setstate__szOrderedSet.__setstate__cCs
||jkS)z
        Test if the item is in this ordered set

        Example:
            >>> 1 in OrderedSet([1, 3, 2])
            True
            >>> 5 in OrderedSet([1, 3, 2])
            False
        )rrkeyrrr__contains__s
zOrderedSet.__contains__cCs0||jkr&t|j|j|<|j||j|S)aE
        Add `key` as an item to this OrderedSet, then return its index.

        If `key` is already in the OrderedSet, return the index it already
        had.

        Example:
            >>> oset = OrderedSet()
            >>> oset.append(3)
            0
            >>> print(oset)
            OrderedSet([3])
        )rrrappendr(rrradds
zOrderedSet.addcCsFd}z|D]}||}q
Wn$tk
r@tdt|YnX|S)a<
        Update the set with the given iterable sequence, then return the index
        of the last element inserted.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.update([3, 1, 5, 1, 4])
            4
            >>> print(oset)
            OrderedSet([1, 2, 3, 5, 4])
        Nz(Argument needs to be an iterable, got %s)r,r!
ValueErrortype)rZsequenceZ
item_indexitemrrrupdates

zOrderedSet.updatecs$t|rfdd|DSj|S)aH
        Get the index of a given entry, raising an IndexError if it's not
        present.

        `key` can be an iterable of entries that is not a string, in which case
        this returns a list of indices.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.index(2)
            1
        csg|]}|qSr)r")rZsubkeyrrrrsz$OrderedSet.index..)r
rr(rrrr"s
zOrderedSet.indexcCs,|jstd|jd}|jd=|j|=|S)z
        Remove and return the last element from the set.

        Raises KeyError if the set is empty.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.pop()
            3
        zSet is empty)rKeyErrorr)relemrrrpops
zOrderedSet.popcCsP||krL|j|}|j|=|j|=|jD]\}}||kr,|d|j|<q,dS)a
        Remove an element.  Do not raise an exception if absent.

        The MutableSet mixin uses this to implement the .remove() method, which
        *does* raise an error when asked to remove a non-existent item.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
        N)rr)rr)rkvrrrdiscards
zOrderedSet.discardcCs|jdd=|jdS)z8
        Remove all items from this OrderedSet.
        N)rrclearrrrrr9szOrderedSet.clearcCs
t|jS)zb
        Example:
            >>> list(iter(OrderedSet([1, 2, 3])))
            [1, 2, 3]
        )iterrrrrrrszOrderedSet.__iter__cCs
t|jS)zf
        Example:
            >>> list(reversed(OrderedSet([1, 2, 3])))
            [3, 2, 1]
        )reversedrrrrr__reversed__szOrderedSet.__reversed__cCs&|sd|jjfSd|jjt|fS)Nz%s()z%s(%r))r __name__rrrrr__repr__szOrderedSet.__repr__cCsRt|ttfrt|t|kSzt|}Wntk
r@YdSXt||kSdS)a
        Returns true if the containers have the same items. If `other` is a
        Sequence, then order is checked, otherwise it is ignored.

        Example:
            >>> oset = OrderedSet([1, 3, 2])
            >>> oset == [1, 3, 2]
            True
            >>> oset == [1, 2, 3]
            False
            >>> oset == [2, 3]
            False
            >>> oset == OrderedSet([3, 2, 1])
            False
        FN)rrrrsetr!)rotherZother_as_setrrr__eq__szOrderedSet.__eq__cGs<t|tr|jnt}ttt|g|}tj|}||S)a
        Combines all unique items.
        Each items order is defined by its first appearance.

        Example:
            >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
            >>> print(oset)
            OrderedSet([3, 1, 4, 5, 2, 0])
            >>> oset.union([8, 9])
            OrderedSet([3, 1, 4, 5, 2, 0, 8, 9])
            >>> oset | {10}
            OrderedSet([3, 1, 4, 5, 2, 0, 10])
        )rrr rritchain
from_iterable)rsetsclsZ
containersrrrrunion6szOrderedSet.unioncCs
||Sr)intersectionrr@rrr__and__IszOrderedSet.__and__csHt|tr|jnt}|r>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3])
            >>> print(oset)
            OrderedSet([1, 2, 3])
            >>> oset.intersection([2, 4, 5], [1, 2, 3, 4])
            OrderedSet([2])
            >>> oset.intersection()
            OrderedSet([1, 2, 3])
        c3s|]}|kr|VqdSrrrr/commonrr	^sz*OrderedSet.intersection..)rrr r?rHrrrErFrrrLrrHMszOrderedSet.intersectioncs:|j}|r.tjtt|fdd|D}n|}||S)a
        Returns all elements that are in this set but not the others.

        Example:
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
            OrderedSet([1])
            >>> OrderedSet([1, 2, 3]) - OrderedSet([2])
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference()
            OrderedSet([1, 2, 3])
        c3s|]}|kr|VqdSrrrKr@rrrNtsz(OrderedSet.difference..)r r?rGrrOrrPr
differencecszOrderedSet.differencecs*t|tkrdStfdd|DS)a7
        Report whether another set contains this set.

        Example:
            >>> OrderedSet([1, 2, 3]).issubset({1, 2})
            False
            >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4})
            True
            >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5})
            False
        Fc3s|]}|kVqdSrrrKrPrrrNsz&OrderedSet.issubset..rallrIrrPrissubsetyszOrderedSet.issubsetcs*tt|krdStfdd|DS)a=
        Report whether this set contains another set.

        Example:
            >>> OrderedSet([1, 2]).issuperset([1, 2, 3])
            False
            >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3})
            True
            >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3})
            False
        Fc3s|]}|kVqdSrrrKrrrrNsz(OrderedSet.issuperset..rRrIrrr
issupersetszOrderedSet.issupersetcCs:t|tr|jnt}|||}|||}||S)a
        Return the symmetric difference of two OrderedSets as a new set.
        That is, the new set will contain all elements that are in exactly
        one of the sets.

        Their order will be preserved, with elements from `self` preceding
        elements from `other`.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference(other)
            OrderedSet([4, 5, 9, 2])
        )rrr rQrG)rr@rFZdiff1Zdiff2rrrsymmetric_differenceszOrderedSet.symmetric_differencecCs||_ddt|D|_dS)zt
        Replace the 'items' list of this OrderedSet with a new one, updating
        self.map accordingly.
        cSsi|]\}}||qSrr)ridxr/rrr
sz,OrderedSet._update_items..N)r	enumerater)rrrrr
_update_itemsszOrderedSet._update_itemscs:t|D]}t|Oq
|fdd|jDdS)a
        Update this OrderedSet to remove items from one or more other sets.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> this.difference_update(OrderedSet([2, 4]))
            >>> print(this)
            OrderedSet([1, 3])

            >>> this = OrderedSet([1, 2, 3, 4, 5])
            >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6]))
            >>> print(this)
            OrderedSet([3, 5])
        csg|]}|kr|qSrrrKitems_to_removerrrsz0OrderedSet.difference_update..Nr?rZr)rrEr@rr[rdifference_updateszOrderedSet.difference_updatecs&t|fdd|jDdS)a^
        Update this OrderedSet to keep only items in another set, preserving
        their order in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.intersection_update(other)
            >>> print(this)
            OrderedSet([1, 3, 7])
        csg|]}|kr|qSrrrKrPrrrsz2OrderedSet.intersection_update..Nr]rIrrPrintersection_updateszOrderedSet.intersection_updatecs<fdd|D}t|fddjD|dS)a
        Update this OrderedSet to remove items from another set, then
        add items from the other set that were not present in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference_update(other)
            >>> print(this)
            OrderedSet([4, 5, 9, 2])
        csg|]}|kr|qSrrrKrrrrsz:OrderedSet.symmetric_difference_update..csg|]}|kr|qSrrrKr[rrrsNr])rr@Zitems_to_addr)r\rrsymmetric_difference_updates
z&OrderedSet.symmetric_difference_update)N)#r=
__module____qualname____doc__rrr$rr%r'r*r,r+r0r"Zget_locZget_indexerr4r8r9rr<r>rArGrJrHrQrTrUrVrZr^r_r`rrrrr*s@	
r)rc	itertoolsrBcollectionsrZcollections.abcrrImportErrorrr__version__r
rrrrrsPK!,_vendor/__pycache__/pyparsing.cpython-38.pycnu[U

Qabwi@sdZdZdZdZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZzddlmZWn ek
rddlmZYnXzdd	lmZdd
lmZWn,ek
rdd	l
mZdd
l
mZYnXzddl
mZWnBek
rFzddlmZWnek
r@dZYnXYnXdd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtgiZee	jdduZeddukZ e rpe	j!Z"e#Z$e%Z&e#Z'e(e)e*e+e,ee-e.e/e0e1gZ2n`e	j3Z"e4Z5dvdwZ'gZ2ddl6Z6dx7D]8Z8ze29e:e6e8Wne;k
rYqYnXqeGd~dde?Z@ejAejBZCdZDeDdZEeCeDZFe%dZGdHddzejIDZJGdd#d#eKZLGdd%d%eLZMGdd'd'eLZNGdd)d)eNZOGdd,d,eKZPGddde?ZQGdd(d(e?ZReSeRdd?ZTddPZUddMZVddZWddZXddZYddWZZd/ddZ[Gdd*d*e?Z\Gdd2d2e\Z]Gddde]Z^Gddde]Z_Gddde]Z`e`Zae`e\_bGddde]ZcGddde`ZdGdd
d
ecZeGddrdre]ZfGdd5d5e]ZgGdd-d-e]ZhGdd+d+e]ZiGddde]ZjGdd4d4e]ZkGddde]ZlGdddelZmGdddelZnGdddelZoGdd0d0elZpGdd/d/elZqGdd7d7elZrGdd6d6elZsGdd&d&e\ZtGdddetZuGdd"d"etZvGdddetZwGdddetZxGdd$d$e\ZyGdddeyZzGdddeyZ{GdddeyZ|Gddde|Z}Gdd8d8e|Z~Gddde?ZeZGdd!d!eyZGdd.d.eyZGdddeyZGddÄdeZGdd3d3eyZGdddeZGdddeZGdddeZGdd1d1eZGdd d e?ZddhZd0ddFZd1ddBZddЄZddUZddTZddԄZd2ddYZddGZd3ddmZddnZddpZe^dIZendOZeodNZepdgZeqdfZegeGddd܍ddބZehd߃ddބZehdddބZeeBeBejdd{d܍BZeeedeZe`deddee}eeBddZddeZddSZddbZdd`ZddsZeddބZeddބZddZddQZddRZddkZe?e_d4ddqZe@Ze?e_e?e_ededfddoZeZeehdddZeehdddZeehddehddBdZeeadedZdddefddVZd5ddlZedZedZeegeCeFdd\ZZeed	7d
ZehddHeàġd
dZŐddaZeehdddZehddZehdɡdZehddZeehddeBdZeZehddZee}egeJdːdeegde`d˃eoϡdZeeeeBddd@ZGd dtdtZeӐd!kredd"Zedd#ZegeCeFd$Zee֐d%dՐd&eZeee׃d'Zؐd(eBZee֐d%dՐd&eZeeeڃd)ZeԐd*eِd'eeېd)Zeܠݐd+ejޠݐd,ejߠݐd,ejݐd-ddlZej᠝eejejݐd.dS(6a	
pyparsing module - Classes and methods to define and execute parsing grammars
=============================================================================

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments


Getting Started -
-----------------
Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:
 - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes
 - construct character word-group expressions using the L{Word} class
 - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes
 - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones
 - associate names with your parsed results using L{ParserElement.setResultsName}
 - find some helpful expression short-cuts like L{delimitedList} and L{oneOf}
 - find more useful common expressions in the L{pyparsing_common} namespace class
z2.2.1z18 Sep 2018 00:49 UTCz*Paul McGuire N)ref)datetime)RLock)Iterable)MutableMapping)OrderedDictAndCaselessKeywordCaselessLiteral
CharsNotInCombineDictEachEmpty
FollowedByForward
GoToColumnGroupKeywordLineEnd	LineStartLiteral
MatchFirstNoMatchNotAny	OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalExceptionParseResultsParseSyntaxException
ParserElementQuotedStringRecursiveGrammarExceptionRegexSkipTo	StringEndStringStartSuppressTokenTokenConverterWhiteWordWordEnd	WordStart
ZeroOrMore	alphanumsalphas
alphas8bitanyCloseTag
anyOpenTag
cStyleCommentcolcommaSeparatedListcommonHTMLEntitycountedArraycppStyleCommentdblQuotedStringdblSlashComment
delimitedListdictOfdowncaseTokensemptyhexnumshtmlCommentjavaStyleCommentlinelineEnd	lineStartlinenomakeHTMLTagsmakeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral
nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence
printablespunc8bitpythonStyleCommentquotedStringremoveQuotesreplaceHTMLEntityreplaceWith
restOfLinesglQuotedStringsrange	stringEndstringStarttraceParseAction
unicodeStringupcaseTokens
withAttribute
indentedBlockoriginalTextForungroup
infixNotationlocatedExpr	withClass
CloseMatchtokenMappyparsing_commoncCsft|tr|Sz
t|WStk
r`t|td}td}|dd|	|YSXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttry@/usr/lib/python3.8/site-packages/setuptools/_vendor/pyparsing.pyz_ustr..N)

isinstanceZunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr)setParseActiontransformString)objretZ
xmlcharrefryryrz_ustrs

rz6sum len sorted reversed list tuple set any all min maxccs|]
}|VqdSNry).0yryryrz	srcCs:d}dddD}t||D]\}}|||}q |S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nry)rsryryrzrsz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZfrom_symbolsZ
to_symbolsZfrom_Zto_ryryrz_xml_escapes
rc@seZdZdS)
_ConstantsN)__name__
__module____qualname__ryryryrzrsr
0123456789ZABCDEFabcdef\ccs|]}|tjkr|VqdSr)stringZ
whitespacercryryrzrs
c@sPeZdZdZdddZeddZdd	Zd
dZdd
Z	dddZ
ddZdS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n||_||_||_|||f|_dSNr)locmsgpstr
parserElementargs)selfrrrelemryryrz__init__szParseBaseException.__init__cCs||j|j|j|jS)z
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)clsperyryrz_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        rL)r;columnrIN)rLrrr;rIAttributeError)rZanameryryrz__getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrLrrryryrz__str__szParseBaseException.__str__cCst|Srrrryryrz__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been foundNrryryryrzr%sc@s eZdZdZddZddZdS)r(zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs
||_dSrZparseElementTracerparseElementListryryrzr4sz"RecursiveGrammarException.__init__cCs
d|jS)NzRecursiveGrammarException: %srrryryrzr7sz!RecursiveGrammarException.__str__N)rrrrrrryryryrzr(2sc@s,eZdZddZddZddZddZd	S)
_ParseResultsWithOffsetcCs||f|_dSrtup)rZp1Zp2ryryrzr;sz _ParseResultsWithOffset.__init__cCs
|j|Srrriryryrz__getitem__=sz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrryryrzr?sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrryryrz	setOffsetAsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrryryryrzr:src@seZdZdZd[ddZddddefddZdd	Zefd
dZdd
Z	ddZ
ddZddZeZ
ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName})

    Example::
        integer = Word(nums)
        date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))
        # equivalent form:
        # date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

        # parseString returns a ParseResults object
        result = date_str.parseString("1999/12/31")

        def test(s, fn=repr):
            print("%s -> %s" % (s, fn(eval(s))))
        test("list(result)")
        test("result[0]")
        test("result['month']")
        test("result.day")
        test("'month' in result")
        test("'minutes' in result")
        test("result.dump()", str)
    prints::
        list(result) -> ['1999', '/', '12', '/', '31']
        result[0] -> '1999'
        result['month'] -> '12'
        result.day -> '31'
        'month' in result -> True
        'minutes' in result -> False
        result.dump() -> ['1999', '/', '12', '/', '31']
        - day: 31
        - month: 12
        - year: 1999
    NTcCs"t||r|St|}d|_|SNT)r}object__new___ParseResults__doinit)rtoklistnameasListmodalZretobjryryrzrks


zParseResults.__new__c
Csb|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t	|_
|dk	r^|r^|sd|j|<||trt|}||_||t
dttfr|ddgfks^||tr|g}|r(||trt|d||<ntt|dd||<|||_n6z|d||<Wn$tttfk
r\|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrvrr
basestringr$rcopyKeyError	TypeError
IndexError)rrrrrr}ryryrzrtsB



$
zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrtrcSsg|]}|dqSrryrvryryrz
sz,ParseResults.__getitem__..)r}rvslicerrrr$rryryrzrs


zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_	dSr)
rrgetrrvrrr$wkrefr)rkrr}subryryrz__setitem__s


"
zParseResults.__setitem__c
Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}||j	
D]>\}}|D]0}t|D]"\}\}}	t||	|	|k||<qqxqln|j	|=dSNrr)
r}rvrlenrrrangeindicesreverseritems	enumerater)
rrZmylenZremovedroccurrencesjrvaluepositionryryrz__delitem__s

zParseResults.__delitem__cCs
||jkSr)r)rrryryrz__contains__szParseResults.__contains__cCs
t|jSr)rrrryryrz__len__r|zParseResults.__len__cCs
|jSrrrryryrz__bool__r|zParseResults.__bool__cCs
t|jSriterrrryryrz__iter__r|zParseResults.__iter__cCst|jdddSNrtrrryryrz__reversed__r|zParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrrrrryryrz	_iterkeyss
zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdSrryrrrryrzrsz+ParseResults._itervalues..rrryrrz_itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdSrryrrryrzrsz*ParseResults._iteritems..rrryrrz
_iteritemsszParseResults._iteritemscCst|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rrrryryrzkeysszParseResults.keyscCst|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r
itervaluesrryryrzvaluesszParseResults.valuescCst|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r	iteritemsrryryrzrszParseResults.itemscCs
t|jS)zSince keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names.)boolrrryryrzhaskeysszParseResults.haskeyscOs|s
dg}|D]*\}}|dkr0|d|f}qtd|qt|dtsdt|dksd|d|kr~|d}||}||=|S|d}|SdS)a
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # Use pop() in a parse action to remove named result (note that corresponding value is not
            # removed from list form of results)
            def remove_LABEL(tokens):
                tokens.pop("LABEL")
                return tokens
            patt.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        rtdefaultrz-pop() got an unexpected keyword argument '%s'rN)rrr}rvr)rrkwargsrrindexrZdefaultvalueryryrzpops""

zParseResults.popcCs||kr||S|SdS)ai
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        Nry)rkeydefaultValueryryrzr3szParseResults.getcCsR|j|||jD]4\}}t|D]"\}\}}t||||k||<q(qdS)a
        Inserts new element at location index in the list of parsed tokens.
        
        Similar to C{list.insert()}.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']

            # use a parse action to insert the parse location in the front of the parsed results
            def insert_locn(locn, tokens):
                tokens.insert(0, locn)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        N)rinsertrrrr)rr
ZinsStrrrrrrryryrzrIszParseResults.insertcCs|j|dS)a
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            
            # use a parse action to compute the sum of the parsed integers, and add it to the end
            def append_sum(tokens):
                tokens.append(sum(map(int, tokens)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        N)rappend)ritemryryrzr]szParseResults.appendcCs$t|tr||7}n|j|dS)a
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # use a parse action to append the reverse of the matched strings, to make a palindrome
            def make_palindrome(tokens):
                tokens.extend(reversed([t[::-1] for t in tokens]))
                return ''.join(tokens)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        N)r}r$rextend)rZitemseqryryrzrks

zParseResults.extendcCs|jdd=|jdS)z7
        Clear all elements and results names.
        N)rrclearrryryrzr}szParseResults.clearcCsjz
||WStk
r YdSX||jkrb||jkrH|j|ddStdd|j|DSndSdS)NrrtrcSsg|]}|dqSrryrryryrzrsz,ParseResults.__getattr__..)rrrr$rrryryrzrs


zParseResults.__getattr__cCs|}||7}|Srr)rotherrryryrz__add__szParseResults.__add__cs|jrjt|jfdd|j}fdd|D}|D],\}}|||<t|dtr.c	s4g|],\}}|D]}|t|d|dfqqSrr)rrrvlistr)	addoffsetryrzrsz)ParseResults.__iadd__..r)
rrrrr}r$rrrupdate)rrZ
otheritemsZotherdictitemsrrry)rrrz__iadd__s


zParseResults.__iadd__cCs&t|tr|dkr|S||SdSr)r}rvrrrryryrz__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrrrryryrzrszParseResults.__repr__cCsdddd|jDdS)N[, css(|] }t|trt|nt|VqdSr)r}r$rrrrryryrzrsz'ParseResults.__str__..])rrrryryrzrszParseResults.__str__rcCsLg}|jD]<}|r |r ||t|tr8||7}q
|t|q
|Sr)rrr}r$
_asStringListr)rsepoutrryryrzr(s


zParseResults._asStringListcCsdd|jDS)a
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # ->  ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # ->  ['sldkj', 'lsdkj', 'sldkj']
        cSs"g|]}t|tr|n|qSry)r}r$r)rresryryrzrsz'ParseResults.asList..rrryryrzrszParseResults.asListcs6tr|j}n|j}fddtfdd|DS)a
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # ->  (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # ->  {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|]}|qSryryrtoItemryrzrsz7ParseResults.asDict..toItem..)r}r$r
asDict)rr,ryrzr-s

z#ParseResults.asDict..toItemc3s|]\}}||fVqdSrryrrrr,ryrzrsz&ParseResults.asDict..)PY_3rrr)rZitem_fnryr,rzr.s
	zParseResults.asDictcCs8t|j}|j|_|j|_|j|j|j|_|S)zA
        Returns a new copy of a C{ParseResults} object.
        )r$rrrrrr rrrryryrzrs
zParseResults.copyFcCsLd}g}tdd|jD}|d}|s8d}d}d}d}	|dk	rJ|}	n|jrV|j}	|	sf|rbdSd}	|||d|	d	g7}t|jD]\}
}t|tr|
|kr||||
|o|dk||g7}n||d|o|dk||g7}qd}|
|kr||
}|s|rqnd}t	t
|}
|||d|d	|
d
|d	g	7}q|||d
|	d	g7}d|S)z
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        
css(|] \}}|D]}|d|fVqqdSrNryrryryrzrsz%ParseResults.asXML..  rNZITEM<>.z
%s%s- %s: r4rcss|]}t|tVqdSr)r}r$)rvvryryrzrsz
%s%s[%d]:
%s%s%sr)
rrrr
sortedrr}r$dumpranyrr)rr9depthfullr*NLrrrrr?ryryrzrAgs,

4,zParseResults.dumpcOstj|f||dS)a
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        N)pprintrrrrryryrzrFszParseResults.pprintcCs.|j|j|jdk	r|p d|j|jffSr)rrrrrrrryryrz__getstate__szParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||dk	rDt||_nd|_dSr)rrrrr rr)rstater=ZinAccumNamesryryrz__setstate__s
zParseResults.__setstate__cCs|j|j|j|jfSr)rrrrrryryrz__getnewargs__szParseResults.__getnewargs__cCstt|t|Sr)rrrrrryryrzrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrr}rrrrrrr__nonzero__rrrrrr0rrrrrrr
rrrrrrrrr!r#rrr(rr.rr8r;r>rArFrHrJrKrryryryrzr$Dsh&
	'	
4

#
=%
-
cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   rrr2)rrfind)rstrgrryryrzr;s
cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   r2rr)count)rrNryryrzrLs
cCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators.
       r2rrN)rMfind)rrNZlastCRZnextCRryryrzrIs
cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrLr;)instringrexprryryrz_defaultStartDebugActionsrTcCs$tdt|dt|dS)NzMatched z -> )rQrr~r)rRstartlocZendlocrStoksryryrz_defaultSuccessDebugActionsrWcCstdt|dS)NzException raised:)rQr)rRrrSexcryryrz_defaultExceptionDebugActionsrYcGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nry)rryryrzrSsrscstkrfddSdgdgtdddkrFddd}dd	d
ntj}tjd}|ddd
}|d|d|ffdd}d}ztdtdj}Wntk
rt}YnX||_|S)Ncs|Srryrlrx)funcryrzr{r|z_trim_arity..rFrs)rqcSs8tdkrdnd}tj||dd|}|ddgS)N)rqr]rrlimitrs)system_version	traceback
extract_stack)rar
frame_summaryryryrzrdsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nr`rtrs)rc
extract_tb)tbraZframesreryryrzrfsz_trim_arity..extract_tbr`rtrc	sz"|dd}dd<|WStk
rdr>n4z.td}|dddddksjW5~Xdkrdd7<YqYqXqdS)NrTrtrsr`r)rrexc_info)rrrgrfZ
foundArityr\ramaxargsZpa_call_line_synthryrzwrapper-s z_trim_arity..wrapperzr	__class__)r)r)	singleArgBuiltinsrbrcrdrfgetattrr	Exceptionr~)r\rkrdZ	LINE_DIFFZ	this_linerl	func_nameryrjrz_trim_aritys,

rrcseZdZdZdZdZeddZeddZddd	Z	d
dZ
dd
ZdddZdddZ
ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+k	rGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r&z)Abstract base level parser element class.z 
	
FcCs
|t_dS)a
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space,  and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        N)r&DEFAULT_WHITE_CHARScharsryryrzsetDefaultWhitespaceCharsTs
z'ParserElement.setDefaultWhitespaceCharscCs
|t_dS)a
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        N)r&_literalStringClass)rryryrzinlineLiteralsUsingcsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_	d|_
d|_d|_t|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)rparseAction
failActionstrReprresultsName
saveAsListskipWhitespacer&rs
whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabsignoreExprsdebugstreamlined
mayIndexErrorerrmsgmodalResultsdebugActionsrecallPreparse
callDuringTry)rsavelistryryrzrxs(zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a$
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        N)rryrrr&rsr)rZcpyryryrzrs
zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        	Expected 	exception)rrrrrrryryrzsetNames


zParserElement.setNamecCs4|}|dr"|dd}d}||_||_|S)aP
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        *NrtT)rendswithr|r)rrlistAllMatchesZnewselfryryrzsetResultsNames
zParserElement.setResultsNameTcs@|r&|jdfdd	}|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        Tcsddl}|||||Sr)pdbZ	set_trace)rRr	doActionscallPreParserZ_parseMethodryrzbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr)rZ	breakFlagrryrrzsetBreaks
zParserElement.setBreakcOs&tttt||_|dd|_|S)a
        Define one or more actions to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}} for more information
        on parsing strings containing C{}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        rF)rmaprrryrrrfnsrryryrzrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z
        Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}.
        
        See examples in L{I{copy}}.
        rF)ryrrrrrrrryryrzaddParseActionszParserElement.addParseActioncs^|dd|ddrtnt|D] fdd}|j|q$|jpV|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        messagezfailed user-defined conditionfatalFcs$tt|||s ||dSr)r	rrrZexc_typefnrryrzpa&sz&ParserElement.addCondition..par)rr#r!ryrr)rrrrryrrzaddConditionszParserElement.addConditioncCs
||_|S)aDefine action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately.)rz)rrryryrz
setFailAction-s
zParserElement.setFailActionc	CsNd}|rJd}|jD]4}z|||\}}d}qWqtk
rDYqXqq|SNTF)rrr!)rrRrZ
exprsFoundeZdummyryryrz_skipIgnorables:s


zParserElement._skipIgnorablescCsH|jr|||}|jrD|j}t|}||krD|||krD|d7}q&|SNr)rrr~rr)rrRrZwtinstrlenryryrzpreParseGs
zParserElement.preParsecCs|gfSrryrrRrrryryrz	parseImplSszParserElement.parseImplcCs|SrryrrRr	tokenlistryryrz	postParseVszParserElement.postParsec
Cs|j}|s|jr|jdr,|jd||||rD|jrD|||}n|}|}zDz||||\}}Wn(tk
rt|t||j	|YnXWnXt
k
r}	z:|jdr|jd||||	|jr|||||	W5d}	~	XYnXn|r|jr|||}n|}|}|js&|t|krjz||||\}}Wn*tk
rft|t||j	|YnXn||||\}}||||}t
||j|j|jd}
|jr|s|jr|rTzN|jD]B}||||
}|dk	rt
||j|jot|t
tf|jd}
qWnFt
k
rP}	z&|jdr>|jd||||	W5d}	~	XYnXnJ|jD]B}||||
}|dk	rZt
||j|jot|t
tf|jd}
qZ|r|jdr|jd|||||
||
fS)Nrrs)rrr)rrzrrrrrr!rrrrrr$r|r}rryrr}r)rrRrrrZ	debuggingprelocZtokensStarttokenserrZ	retTokensrryryrz
_parseNoCacheZst








zParserElement._parseNoCachecCs@z|j||dddWStk
r:t|||j|YnXdS)NF)rr)rr#r!rrrRrryryrztryParseszParserElement.tryParsec	Cs4z|||Wnttfk
r*YdSXdSdS)NFT)rr!rrryryrzcanParseNexts
zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Ncs|Srrrrcachenot_in_cacheryrzrsz3ParserElement._UnboundedCache.__init__..getcs||<dSrryrrrrryrzsetsz3ParserElement._UnboundedCache.__init__..setcsdSrrrrryrzrsz5ParserElement._UnboundedCache.__init__..clearcstSrrrrryrz	cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes
MethodTyperrrr)rrrrrryrrzrsz&ParserElement._UnboundedCache.__init__Nrrrrryryryrz_UnboundedCachesrNc@seZdZddZdS)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Ncs|Srrrrryrzrs.ParserElement._FifoCache.__init__..getcs>||<tkr:zdWqtk
r6YqXqdSNF)rpopitemrr)rsizeryrzrs.ParserElement._FifoCache.__init__..setcsdSrrrrryrzrs0ParserElement._FifoCache.__init__..clearcstSrrrrryrzrs4ParserElement._FifoCache.__init__..cache_len)	rr_OrderedDictrrrrrrrrrrrrry)rrrrzrs!ParserElement._FifoCache.__init__Nrryryryrz
_FifoCachesrc@seZdZddZdS)rcst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_	dS)	Ncs|Srrrrryrzrsrcs4||<tkr&dq|dSr)rrpopleftrr)rkey_fiforryrzrsrcsdSrrr)rrryrzrsrcstSrrrrryrzrsr)
rrcollectionsdequerrrrrrrry)rrrrrzrsrNrryryryrzrsrcCsd\}}|||||f}tjtj}||}	|	|jkrtj|d7<z|||||}	Wn8tk
r}
z|||
j	|
j
W5d}
~
XYn.X|||	d|	df|	W5QRSn@tj|d7<t|	t
r|	|	d|	dfW5QRSW5QRXdS)Nrrr)r&packrat_cache_lock
packrat_cacherrpackrat_cache_statsrrrrmrrr}rp)rrRrrrZHITZMISSlookuprrrryryrz_parseCaches$


zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r&rrrrryryryrz
resetCaches
zParserElement.resetCachecCs8tjs4dt_|dkr tt_nt|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic.
           Repeated parse attempts at the same string location (which happens
           often in many complex grammars) can immediately return a cached value,
           instead of re-executing parsing/validating code.  Memoizing is done of
           both valid results and parsing exceptions.
           
           Parameters:
            - cache_size_limit - (default=C{128}) - if an integer value is provided
              will limit the size of the packrat cache; if None is passed, then
              the cache size will be unbounded; if 0 is passed, the cache will
              be effectively disabled.
            
           This speedup may break existing programs that use parse actions that
           have side-effects.  For this reason, packrat parsing is disabled when
           you first import pyparsing.  To activate the packrat feature, your
           program must call the class method C{ParserElement.enablePackrat()}.  If
           your program uses C{psyco} to "compile as you go", you must call
           C{enablePackrat} before calling C{psyco.full()}.  If you do not do this,
           Python will crash.  For best results, call C{enablePackrat()} immediately
           after importing pyparsing.
           
           Example::
               import pyparsing
               pyparsing.ParserElement.enablePackrat()
        TN)r&_packratEnabledrrrrr)Zcache_size_limitryryrz
enablePackrat%szParserElement.enablePackratc
Cst|js||jD]}|q|js8|}z<||d\}}|rr|||}t	t
}|||Wn0tk
r}ztjrn|W5d}~XYnX|SdS)aB
        Execute the parse expression with the given string.
        This is the main interface to the client code, once the complete
        expression has been built.

        If you want the grammar to require that the entire input string be
        successfully parsed, then set C{parseAll} to True (equivalent to ending
        the grammar with C{L{StringEnd()}}).

        Note: C{parseString} implicitly calls C{expandtabs()} on the input string,
        in order to report proper column numbers in parse actions.
        If the input string contains tabs and
        the grammar uses parse actions that use the C{loc} argument to index into the
        string being parsed, you can ensure you have a consistent view of the input
        string by:
         - calling C{parseWithTabs} on your grammar before calling C{parseString}
           (see L{I{parseWithTabs}})
         - define your parse action using the full C{(s,loc,toks)} signature, and
           reference the input string using the parse action's C{s} argument
         - explictly expand the tabs in your input string before calling
           C{parseString}
        
        Example::
            Word('a').parseString('aaaaabaaa')  # -> ['aaaaa']
            Word('a').parseString('aaaaabaaa', parseAll=True)  # -> Exception: Expected end of text
        rN)
r&rr
streamlinerr
expandtabsrrrr+rverbose_stacktrace)rrRparseAllrrrZserXryryrzparseStringHs$

zParserElement.parseStringc
cs6|js||jD]}|q|js4t|}t|}d}|j}|j}t	
d}	z||kr|	|krz |||}
|||
dd\}}Wntk
r|
d}YqZX||kr|	d7}	||
|fV|r|||}
|
|kr|}q|d7}q|}qZ|
d}qZWn4tk
r0}zt	j
rn|W5d}~XYnXdS)a
        Scan the input string for expression matches.  Each match will return the
        matching tokens, start location, and end location.  May be called with optional
        C{maxMatches} argument, to clip scanning after 'n' matches are found.  If
        C{overlap} is specified, then overlapping matches will be reported.

        Note that the start and end locations are reported relative to the string
        being parsed.  See L{I{parseString}} for more information on parsing
        strings with embedded tabs.

        Example::
            source = "sldjf123lsdjjkf345sldkjf879lkjsfd987"
            print(source)
            for tokens,start,end in Word(alphas).scanString(source):
                print(' '*start + '^'*(end-start))
                print(' '*start + tokens[0])
        
        prints::
        
            sldjf123lsdjjkf345sldkjf879lkjsfd987
            ^^^^^
            sldjf
                    ^^^^^^^
                    lsdjjkf
                              ^^^^^^
                              sldkjf
                                       ^^^^^^
                                       lkjsfd
        rFrrN)rrrrrrrrrr&rr!rr)rrR
maxMatchesZoverlaprrrZ
preparseFnZparseFnmatchesrZnextLocrZnextlocrXryryrz
scanStringzsB




zParserElement.scanStringc
Csg}d}d|_z||D]Z\}}}|||||rpt|trR||7}nt|trf||7}n
|||}q|||ddd|D}dtt	t
|WStk
r}ztj
rƂn|W5d}~XYnXdS)af
        Extension to C{L{scanString}}, to modify matching text with modified tokens that may
        be returned from a parse action.  To use C{transformString}, define a grammar and
        attach a parse action to it that modifies the returned token list.
        Invoking C{transformString()} on a target string will then scan for matches,
        and replace the matched text patterns according to the logic in the parse
        action.  C{transformString()} returns the resulting transformed string.
        
        Example::
            wd = Word(alphas)
            wd.setParseAction(lambda toks: toks[0].title())
            
            print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york."))
        Prints::
            Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York.
        rTNcSsg|]}|r|qSryry)roryryrzrsz1ParserElement.transformString..r)rrrr}r$rrrrr_flattenrr&r)rrRr*ZlastErxrrrXryryrzrs(



zParserElement.transformStringc
CsRztdd|||DWStk
rL}ztjr8n|W5d}~XYnXdS)a
        Another extension to C{L{scanString}}, simplifying the access to the tokens found
        to match the given parse expression.  May be called with optional
        C{maxMatches} argument, to clip searching after 'n' matches are found.
        
        Example::
            # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters
            cap_word = Word(alphas.upper(), alphas.lower())
            
            print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))

            # the sum() builtin can be used to merge results into a single ParseResults object
            print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")))
        prints::
            [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']]
            ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity']
        cSsg|]\}}}|qSryry)rrxrrryryrzrsz.ParserElement.searchString..N)r$rrr&r)rrRrrXryryrzsearchStringszParserElement.searchStringc	csTd}d}|j||dD]*\}}}|||V|r<|dV|}q||dVdS)a[
        Generator method to split a string using the given expression as a separator.
        May be called with optional C{maxsplit} argument, to limit the number of splits;
        and the optional C{includeSeparators} argument (default=C{False}), if the separating
        matching text should be included in the split results.
        
        Example::        
            punc = oneOf(list(".,;:/-!?"))
            print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
        prints::
            ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
        r)rN)r)	rrRmaxsplitZincludeSeparatorsZsplitsZlastrxrrryryrzrs

zParserElement.splitcCsFt|trt|}t|ts:tjdt|tdddSt||gS)a
        Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
        converts them to L{Literal}s by default.
        
        Example::
            greet = Word(alphas) + "," + Word(alphas) + "!"
            hello = "Hello, World!"
            print (hello, "->", greet.parseString(hello))
        Prints::
            Hello, World! -> ['Hello', ',', 'World', '!']
        4Cannot combine element of type %s with ParserElementrs
stacklevelN)	r}rr&rwwarningswarnr
SyntaxWarningrr"ryryrzrs


zParserElement.__add__cCsBt|trt|}t|ts:tjdt|tdddS||S)z]
        Implementation of + operator when left operand is not a C{L{ParserElement}}
        rrsrNr}rr&rwrrrrr"ryryrzr#1s


zParserElement.__radd__cCsJt|trt|}t|ts:tjdt|tdddS|t	|S)zQ
        Implementation of - operator, returns C{L{And}} with error stop
        rrsrN)
r}rr&rwrrrrr
_ErrorStopr"ryryrz__sub__=s


zParserElement.__sub__cCsBt|trt|}t|ts:tjdt|tdddS||S)z]
        Implementation of - operator when left operand is not a C{L{ParserElement}}
        rrsrNrr"ryryrz__rsub__Is


zParserElement.__rsub__cst|tr|d}}nt|tr|ddd}|ddkrHd|df}t|dtr|ddkr|ddkrvtS|ddkrtS|dtSqt|dtrt|dtr|\}}||8}qtdt|dt|dntdt||dkrtd|dkrtd	||kr6dkrBnntd
|rfdd|r|dkrt|}ntg||}n|}n|dkr}ntg|}|S)
a
        Implementation of * operator, allows use of C{expr * 3} in place of
        C{expr + expr + expr}.  Expressions may also me multiplied by a 2-integer
        tuple, similar to C{{min,max}} multipliers in regular expressions.  Tuples
        may also include C{None} as in:
         - C{expr*(n,None)} or C{expr*(n,)} is equivalent
              to C{expr*n + L{ZeroOrMore}(expr)}
              (read as "at least n instances of C{expr}")
         - C{expr*(None,n)} is equivalent to C{expr*(0,n)}
              (read as "0 to n instances of C{expr}")
         - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)}
         - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)}

        Note that C{expr*(None,n)} does not raise an exception if
        more than n exprs exist in the input stream; that is,
        C{expr*(None,n)} does not enforce a maximum number of expr
        occurrences.  If this behavior is desired, then write
        C{expr*(None,n) + ~expr}
        r)NNNrsrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdSr)rnmakeOptionalListrryrzrsz/ParserElement.__mul__..makeOptionalList)	r}rvtupler4rrr
ValueErrorr)rrZminElementsZoptElementsrryrrz__mul__UsD







zParserElement.__mul__cCs
||Sr)rr"ryryrz__rmul__szParserElement.__rmul__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zI
        Implementation of | operator - returns C{L{MatchFirst}}
        rrsrN)	r}rr&rwrrrrrr"ryryrz__or__s


zParserElement.__or__cCsBt|trt|}t|ts:tjdt|tdddS||BS)z]
        Implementation of | operator when left operand is not a C{L{ParserElement}}
        rrsrNrr"ryryrz__ror__s


zParserElement.__ror__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zA
        Implementation of ^ operator - returns C{L{Or}}
        rrsrN)	r}rr&rwrrrrrr"ryryrz__xor__s


zParserElement.__xor__cCsBt|trt|}t|ts:tjdt|tdddS||AS)z]
        Implementation of ^ operator when left operand is not a C{L{ParserElement}}
        rrsrNrr"ryryrz__rxor__s


zParserElement.__rxor__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zC
        Implementation of & operator - returns C{L{Each}}
        rrsrN)	r}rr&rwrrrrrr"ryryrz__and__s


zParserElement.__and__cCsBt|trt|}t|ts:tjdt|tdddS||@S)z]
        Implementation of & operator when left operand is not a C{L{ParserElement}}
        rrsrNrr"ryryrz__rand__s


zParserElement.__rand__cCst|S)zE
        Implementation of ~ operator - returns C{L{NotAny}}
        )rrryryrz
__invert__szParserElement.__invert__cCs|dk	r||S|SdS)a

        Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}.
        
        If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be
        passed as C{True}.
           
        If C{name} is omitted, same as calling C{L{copy}}.

        Example::
            # these are equivalent
            userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
            userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")             
        N)rrrryryrz__call__s
zParserElement.__call__cCst|S)z
        Suppresses the output of this C{ParserElement}; useful to keep punctuation from
        cluttering up returned output.
        )r-rryryrzsuppressszParserElement.suppresscCs
d|_|S)a
        Disables the skipping of whitespace before matching the characters in the
        C{ParserElement}'s defined pattern.  This is normally only used internally by
        the pyparsing module, but may be needed in some whitespace-sensitive grammars.
        Fr~rryryrzleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8
        Overrides the default whitespace chars
        TF)r~rr)rruryryrzsetWhitespaceChars
sz ParserElement.setWhitespaceCharscCs
d|_|S)z
        Overrides default behavior to expand C{}s to spaces before parsing the input string.
        Must be called before C{parseString} when the input grammar contains elements that
        match C{} characters.
        T)rrryryrz
parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|j|n|jt||S)a
        Define expression to be ignored (e.g., comments) while doing pattern
        matching; may be called repeatedly, to define multiple comment or other
        ignorable patterns.
        
        Example::
            patt = OneOrMore(Word(alphas))
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
            
            patt.ignore(cStyleComment)
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd']
        )r}rr-rrrr"ryryrzignores


zParserElement.ignorecCs"|pt|pt|ptf|_d|_|S)zT
        Enable display of debugging messages while doing pattern matching.
        T)rTrWrYrr)rZstartActionZ
successActionZexceptionActionryryrzsetDebugActions6szParserElement.setDebugActionscCs|r|tttnd|_|S)a
        Enable display of debugging messages while doing pattern matching.
        Set C{flag} to True to enable, False to disable.

        Example::
            wd = Word(alphas).setName("alphaword")
            integer = Word(nums).setName("numword")
            term = wd | integer
            
            # turn on debugging for wd
            wd.setDebug()

            OneOrMore(term).parseString("abc 123 xyz 890")
        
        prints::
            Match alphaword at loc 0(1,1)
            Matched alphaword -> ['abc']
            Match alphaword at loc 3(1,4)
            Exception raised:Expected alphaword (at char 4), (line:1, col:5)
            Match alphaword at loc 7(1,8)
            Matched alphaword -> ['xyz']
            Match alphaword at loc 11(1,12)
            Exception raised:Expected alphaword (at char 12), (line:1, col:13)
            Match alphaword at loc 15(1,16)
            Exception raised:Expected alphaword (at char 15), (line:1, col:16)

        The output shown is that produced by the default debug actions - custom debug actions can be
        specified using L{setDebugActions}. Prior to attempting
        to match the C{wd} expression, the debugging message C{"Match  at loc (,)"}
        is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"}
        message is shown. Also note the use of L{setName} to assign a human-readable name to the expression,
        which makes debugging and exception messages easier to understand - for instance, the default
        name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}.
        F)rrTrWrYr)rflagryryrzsetDebug@s#zParserElement.setDebugcCs|jSr)rrryryrzriszParserElement.__str__cCst|SrrrryryrzrlszParserElement.__repr__cCsd|_d|_|Sr)rr{rryryrzroszParserElement.streamlinecCsdSrryrryryrzcheckRecursiontszParserElement.checkRecursioncCs|gdS)zj
        Check defined expressions for valid structure, check for infinite recursive definitions.
        N)r)r
validateTraceryryrzvalidatewszParserElement.validatecCsz|}Wn2tk
r>t|d}|}W5QRXYnXz|||WStk
r~}ztjrjn|W5d}~XYnXdS)z
        Execute the parse expression on the given file or filename.
        If a filename is specified (instead of a file object),
        the entire file is opened, read, and closed before parsing.
        rN)readropenrrr&r)rZfile_or_filenamerZ
file_contentsfrXryryrz	parseFile}szParserElement.parseFilecsHt|tr"||kp t|t|kSt|tr6||Stt||kSdSr)r}r&varsrrsuperr"rmryrz__eq__s



zParserElement.__eq__cCs
||kSrryr"ryryrz__ne__szParserElement.__ne__cCstt|Sr)hashidrryryrz__hash__szParserElement.__hash__cCs||kSrryr"ryryrz__req__szParserElement.__req__cCs
||kSrryr"ryryrz__rne__szParserElement.__rne__cCs4z|jt||dWdStk
r.YdSXdS)a
        Method for quick testing of a parser against a test string. Good for simple 
        inline microtests of sub expressions while building up larger parser.
           
        Parameters:
         - testString - to test against this expression for a match
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests
            
        Example::
            expr = Word(nums)
            assert expr.matches("100")
        rTFN)rrr)rZ
testStringrryryrzrs

zParserElement.matches#cCst|tr"tttj|}t|tr4t|}g}g}d}	|D]}
|dk	r^|	|
dsf|rr|
sr|
|
qD|
sxqDd||
g}g}z:|
dd}
|j
|
|d}|
|j|d|	o|}	Wntk
rr}
zt|
trdnd	}d|
kr*|
t|
j|
|
d
t|
j|
dd|n|
d
|
jd||
d
t|
|	o\|}	|
}W5d}
~
XYnDtk
r}z$|
dt||	o|}	|}W5d}~XYnX|r|r|
d	td||
|
|fqD|	|fS)a3
        Execute the parse expression on a series of test strings, showing each
        test, the parsed results or where the parse failed. Quick and easy way to
        run a parse expression against a list of sample strings.
           
        Parameters:
         - tests - a list of separate test strings, or a multiline string of test strings
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests           
         - comment - (default=C{'#'}) - expression for indicating embedded comments in the test 
              string; pass None to disable comment filtering
         - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline;
              if False, only dump nested list
         - printResults - (default=C{True}) prints test output to stdout
         - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing

        Returns: a (success, results) tuple, where success indicates that all tests succeeded
        (or failed if C{failureTests} is True), and the results contain a list of lines of each 
        test's output
        
        Example::
            number_expr = pyparsing_common.number.copy()

            result = number_expr.runTests('''
                # unsigned integer
                100
                # negative integer
                -100
                # float with scientific notation
                6.02e23
                # integer with scientific notation
                1e-12
                ''')
            print("Success" if result[0] else "Failed!")

            result = number_expr.runTests('''
                # stray character
                100Z
                # missing leading digit before '.'
                -.100
                # too many '.'
                3.14.159
                ''', failureTests=True)
            print("Success" if result[0] else "Failed!")
        prints::
            # unsigned integer
            100
            [100]

            # negative integer
            -100
            [-100]

            # float with scientific notation
            6.02e23
            [6.02e+23]

            # integer with scientific notation
            1e-12
            [1e-12]

            Success
            
            # stray character
            100Z
               ^
            FAIL: Expected end of text (at char 3), (line:1, col:4)

            # missing leading digit before '.'
            -.100
            ^
            FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1)

            # too many '.'
            3.14.159
                ^
            FAIL: Expected end of text (at char 4), (line:1, col:5)

            Success

        Each test string must be on a single line. If you want to test a string that spans multiple
        lines, create a test like this::

            expr.runTest(r"this is a test\n of strings that spans \n 3 lines")
        
        (Note that this is a raw string literal, you must include the leading 'r'.)
        TNFr2\nr%)rDz(FATAL)r r^zFAIL: zFAIL-EXCEPTION: )r}rrrr~rrstrip
splitlinesrrrrrrrArr#rIrr;rprQ)rZtestsrZcommentZfullDumpZprintResultsZfailureTestsZ
allResultsZcommentssuccessrxr*resultrrrXryryrzrunTestssNW




$


zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)Tr&TTF)Orrrrrsrstaticmethodrvrxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr_MAX_INTrrrrrr#rrrrrrrrrrrr	r
rr
rrrrrrrrrrrrr"r#r$rr.
__classcell__ryryrrzr&Os




&




G

"
2G+D
			

)

cs eZdZdZfddZZS)r.zT
    Abstract C{ParserElement} subclass, for defining atomic matching patterns.
    cstt|jdddSNFr)rr.rrrryrzr@	szToken.__init__rrrrrr1ryryrrzr.<	scs eZdZdZfddZZS)rz,
    An empty token, will always match.
    cs$tt|d|_d|_d|_dS)NrTF)rrrrrrrrryrzrH	szEmpty.__init__r4ryryrrzrD	scs*eZdZdZfddZdddZZS)rz(
    A token that will never match.
    cs*tt|d|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrrrrrrryrzrS	s
zNoMatch.__init__TcCst|||j|dSr)r!rrryryrzrZ	szNoMatch.parseImpl)Trrrrrrr1ryryrrzrO	scs*eZdZdZfddZdddZZS)ra
    Token to exactly match a specified string.
    
    Example::
        Literal('blah').parseString('blah')  # -> ['blah']
        Literal('blah').parseString('blahfooblah')  # -> ['blah']
        Literal('blah').parseString('bla')  # -> Exception: Expected "blah"
    
    For case-insensitive matching, use L{CaselessLiteral}.
    
    For keyword matching (force word break before and after the matched string),
    use L{Keyword} or L{CaselessKeyword}.
    cstt|||_t||_z|d|_Wn*tk
rVtj	dt
ddt|_YnXdt
|j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrsr"%s"rF)rrrmatchrmatchLenfirstMatchCharrrrrrrmrrrrrrmatchStringrryrzrl	s
zLiteral.__init__TcCsJ|||jkr6|jdks&||j|r6||j|jfSt|||j|dSr)r9r8
startswithr7r!rrryryrzr	szLiteral.parseImpl)Tr5ryryrrzr^	s
csLeZdZdZedZdfdd	Zddd	Zfd
dZe	dd
Z
ZS)ra\
    Token to exactly match a specified string as a keyword, that is, it must be
    immediately followed by a non-keyword character.  Compare with C{L{Literal}}:
     - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}.
     - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'}
    Accepts two optional constructor arguments in addition to the keyword string:
     - C{identChars} is a string of characters that would be valid identifier characters,
          defaulting to all alphanumerics + "_" and "$"
     - C{caseless} allows case-insensitive matching, default is C{False}.
       
    Example::
        Keyword("start").parseString("start")  # -> ['start']
        Keyword("start").parseString("starting")  # -> Exception

    For case-insensitive matching, use L{CaselessKeyword}.
    _$NFcstt||dkrtj}||_t||_z|d|_Wn$tk
r^t	j
dtddYnXd|j|_d|j|_
d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrsrr6rF)rrrDEFAULT_KEYWORD_CHARSr7rr8r9rrrrrrrrcaselessupper
caselessmatchr
identChars)rr;rBr?rryrzr	s*

zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jkr|dksj||d|jkr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt	|||j
|dSr)r?r8r@rArrBr7r9r<r!rrryryrzr	s4zKeyword.parseImplcstt|}tj|_|Sr)rrrr>rB)rrrryrzr	szKeyword.copycCs
|t_dS)z,Overrides the default Keyword chars
        N)rr>rtryryrzsetDefaultKeywordChars	szKeyword.setDefaultKeywordChars)NF)T)rrrrr5r>rrrr/rCr1ryryrrzr	s
cs*eZdZdZfddZdddZZS)r
al
    Token to match a specified string, ignoring case of letters.
    Note: the matched results will always be in the case of the given
    match string, NOT the case of the input text.

    Example::
        OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD']
        
    (Contrast with example for L{CaselessKeyword}.)
    cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rr
rr@returnStringrrr:rryrzr	szCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dSr)r8r@r7rDr!rrryryrzr	szCaselessLiteral.parseImpl)Tr5ryryrrzr
	s
cs,eZdZdZdfdd	Zd	ddZZS)
r	z
    Caseless version of L{Keyword}.

    Example::
        OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD']
        
    (Contrast with example for L{CaselessLiteral}.)
    Ncstt|j||dddS)NTr?)rr	r)rr;rBrryrzr	szCaselessKeyword.__init__TcCsj||||j|jkrV|t||jksF|||j|jkrV||j|jfSt|||j|dSr)r8r@rArrBr7r!rrryryrzr	szCaselessKeyword.parseImpl)N)Tr5ryryrrzr		scs,eZdZdZdfdd	Zd	ddZZS)
rnax
    A variation on L{Literal} which matches "close" matches, that is, 
    strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters:
     - C{match_string} - string to be matched
     - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match
    
    The results from a successful parse will contain the matched text from the input string and the following named results:
     - C{mismatches} - a list of the positions within the match_string where mismatches were found
     - C{original} - the original match_string used to compare against the input string
    
    If C{mismatches} is an empty list, then the match was an exact match.
    
    Example::
        patt = CloseMatch("ATCATCGAATGGA")
        patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']})
        patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1)

        # exact match
        patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']})

        # close match allowing up to 2 mismatches
        patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2)
        patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']})
    rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F)	rrnrrmatch_string
maxMismatchesrrr)rrFrGrryrzr

szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g}	|j}
tt||||jD]2\}}|\}}
||
krN|	|t|	|
krNqqN|d}t|||g}|j|d<|	|d<||fSt|||j|dS)Nrroriginal
mismatches)	rrFrGrrrr$r!r)rrRrrstartrmaxlocrFZmatch_stringlocrIrGZs_msrcmatresultsryryrzr
s( 

zCloseMatch.parseImpl)r)Tr5ryryrrzrn	s	cs8eZdZdZd
fdd	Zdd	d
ZfddZZS)r1a	
    Token for matching words composed of allowed character sets.
    Defined with string containing all allowed initial characters,
    an optional string containing allowed body characters (if omitted,
    defaults to the initial character set), and an optional minimum,
    maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction. An optional
    C{excludeChars} parameter can list characters that might be found in 
    the input C{bodyChars} string; useful to define a word of all printables
    except for one or two characters, for instance.
    
    L{srange} is useful for defining custom character set strings for defining 
    C{Word} expressions, using range notation from regular expression character sets.
    
    A common mistake is to use C{Word} to match a specific literal string, as in 
    C{Word("Address")}. Remember that C{Word} uses the string argument to define
    I{sets} of matchable characters. This expression would match "Add", "AAA",
    "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'.
    To match an exact literal string, use L{Literal} or L{Keyword}.

    pyparsing includes helper strings for building Words:
     - L{alphas}
     - L{nums}
     - L{alphanums}
     - L{hexnums}
     - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.)
     - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.)
     - L{printables} (any non-whitespace character)

    Example::
        # a word composed of digits
        integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9"))
        
        # a word with a leading capital, and zero or more lowercase
        capital_word = Word(alphas.upper(), alphas.lower())

        # hostnames are alphanumeric, with leading alpha, and '-'
        hostname = Word(alphas, alphanums+'-')
        
        # roman numeral (not a strict parser, accepts invalid mix of characters)
        roman = Word("IVXLCDM")
        
        # any string of non-whitespace characters, except for ','
        csv_value = Word(printables, excludeChars=",")
    NrrFcstt|rFdfdd|D}|rFdfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_	|dkrt
d||_|dkr||_nt
|_|dkr||_||_t||_d|j|_d	|_||_d
|j|jkr|dkr|dkr|dkr|j|jkr8dt|j|_nHt|jdkrfdt|jt|jf|_nd
t|jt|jf|_|jrd|jd|_zt|j|_Wntk
rd|_YnXdS)Nrc3s|]}|kr|VqdSrryrexcludeCharsryrzr`
sz Word.__init__..c3s|]}|kr|VqdSrryrrOryrzrb
srrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFr(z[%s]+z%s[%s]*z	[%s][%s]*z\b)rr1rr
initCharsOrigr	initChars
bodyCharsOrig	bodyCharsmaxSpecifiedrminLenmaxLenr0rrrr	asKeyword_escapeRegexRangeCharsreStringrrescapecompilerp)rrRrTminmaxexactrXrPrrOrzr]
s\



0
z
Word.__init__Tc
Cs>|jr<|j||}|s(t|||j||}||fS|||jkrZt|||j||}|d7}t|}|j}||j	}t
||}||kr|||kr|d7}qd}	|||jkrd}	|jr||kr|||krd}	|j
r|dkr||d|ks||kr|||krd}	|	r.t|||j|||||fS)NrFTr)rr7r!rendgrouprRrrTrWr]rVrUrX)
rrRrrr-rJrZ	bodycharsrKZthrowExceptionryryrzr
s6


2zWord.parseImplcsvztt|WStk
r$YnX|jdkrpdd}|j|jkr`d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)N...rrryryrz
charsAsStr
sz Word.__str__..charsAsStrz	W:(%s,%s)zW:(%s))rr1rrpr{rQrS)rrerryrzr
s
zWord.__str__)NrrrFN)Trrrrrrrr1ryryrrzr1.
s.6
#csFeZdZdZeedZdfdd	ZdddZ	fd	d
Z
ZS)
r)a
    Token for matching strings that match a given regular expression.
    Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.
    If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as 
    named parse results.

    Example::
        realnum = Regex(r"[+-]?\d+\.\d*")
        date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)')
        # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression
        roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})")
    z[A-Z]rcstt|t|tr|s,tjdtdd||_||_	zt
|j|j	|_
|j|_Wqt
jk
rtjd|tddYqXn2t|tjr||_
t||_|_||_	ntdt||_d|j|_d|_d|_d	S)
zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrsr$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rr)rr}rrrrpatternflagsrr\rZ
sre_constantserrorcompiledREtyper~rrrrrr)rrhrirryrzr
s:



zRegex.__init__TcCs`|j||}|s"t|||j||}|}t|}|rX|D]}||||<qF||fSr)rr7r!rr`	groupdictr$ra)rrRrrr-drrryryrzr
szRegex.parseImplcsFztt|WStk
r$YnX|jdkr@dt|j|_|jS)NzRe:(%s))rr)rrpr{rrhrrryrzr
s
z
Regex.__str__)r)T)rrrrrrr\rlrrrr1ryryrrzr)
s
"

cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
r'a
    Token for matching strings that are delimited by quoting characters.
    
    Defined with the following parameters:
        - quoteChar - string of one or more characters defining the quote delimiting string
        - escChar - character to escape quotes, typically backslash (default=C{None})
        - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None})
        - multiline - boolean indicating whether quotes can span multiple lines (default=C{False})
        - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True})
        - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar)
        - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True})

    Example::
        qs = QuotedString('"')
        print(qs.searchString('lsjdf "This is the quote" sldjf'))
        complex_qs = QuotedString('{{', endQuoteChar='}}')
        print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf'))
        sql_qs = QuotedString('"', escQuote='""')
        print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf'))
    prints::
        [['This is the quote']]
        [['This is the "quote"']]
        [['This is the quote with "embedded" quotes']]
    NFTc
sNtt|}|s0tjdtddt|dkr>|}n"|}|s`tjdtddt|_t	|_
|d_|_t	|_
|_|_|_|_|rtjtjB_dtjtjd|dk	rt|pdf_n.rt)z|(?:%s)z|(?:%s.)z(.)z)*%srgrFT)%rr'rrrrrSyntaxError	quoteCharrquoteCharLenfirstQuoteCharroendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr	MULTILINEDOTALLrir[rYrhrrescCharReplacePatternr\rZrjrkrrrrr)rrrrvrwZ	multilinerxroryrrrzr/s|





zQuotedString.__init__c	Cs|||jkr|j||pd}|s4t|||j||}|}|jr||j|j	}t
|trd|kr|jrddddd}|
D]\}}|||}q|jrt|jd|}|jr||j|j}||fS)N\	r2
)\tr'z\fz\rz\g<1>)rtrr7r!rr`rarxrsrur}rryrrrvrr|rwro)	rrRrrr-rZws_mapZwslitZwscharryryrzrps* 
zQuotedString.parseImplcsHztt|WStk
r$YnX|jdkrBd|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr'rrpr{rrrorrryrzrs
zQuotedString.__str__)NNFTNT)Trfryryrrzr'sA
#cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
ra
    Token for matching words composed of characters I{not} in a given set (will
    include whitespace in matched characters if not listed in the provided exclusion set - see example).
    Defined with string containing all disallowed characters, and an optional
    minimum, maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction.

    Example::
        # define a comma-separated-value as anything that is not a ','
        csv_value = CharsNotIn(',')
        print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213"))
    prints::
        ['dkls', 'lsdkjf', 's12 34', '@!#', '213']
    rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t	||_
d|j
|_|jdk|_d|_
dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rrrr~notCharsrrVrWr0rrrrr)rrr]r^r_rryrzrs 
zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}||krb|||krb|d7}qD|||jkrt|||j|||||fSr)rr!rr]rWrrV)rrRrrrJZnotcharsmaxlenryryrzrs

zCharsNotIn.parseImplcsfztt|WStk
r$YnX|jdkr`t|jdkrTd|jdd|_nd|j|_|jS)Nrbz
!W:(%s...)z!W:(%s))rrrrpr{rrrrryrzrs
zCharsNotIn.__str__)rrr)Trfryryrrzrs
cs<eZdZdZddddddZdfdd	ZdddZZS)r0a
    Special matching class for matching whitespace.  Normally, whitespace is ignored
    by pyparsing grammars.  This class is included when some whitespace structures
    are significant.  Define with a string containing the whitespace characters to be
    matched; default is C{" \t\r\n"}.  Also takes optional C{min}, C{max}, and C{exact} arguments,
    as defined for the C{L{Word}} class.
    zzzzz)r(r~r2rr 	
rrcstt|_dfddjDdddjD_d_dj_	|_
|dkrt|_nt_|dkr|_|_
dS)Nrc3s|]}|jkr|VqdSr)
matchWhiterrryrzrs
z!White.__init__..css|]}tj|VqdSr)r0	whiteStrsrryryrzrsTrr)
rr0rrr
rrrrrrVrWr0)rZwsr]r^r_rrrzrs zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}||krb|||jkrb|d7}qB|||jkrt|||j|||||fSr)rr!rrWr]rrV)rrRrrrJrKryryrzr	s

zWhite.parseImpl)rrrr)T)rrrrrrrr1ryryrrzr0scseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rrrrmrrrrrrryrzrs
z_PositionToken.__init__rrrrr1ryryrrzrsrcs2eZdZdZfddZddZd	ddZZS)
rzb
    Token to advance to a specific column of input text; useful for tabular report scraping.
    cstt|||_dSr)rrrr;)rcolnorryrzr$szGoToColumn.__init__cCs\t|||jkrXt|}|jr*|||}||krX||rXt|||jkrX|d7}q*|Sr)r;rrrisspace)rrRrrryryrzr(s$
zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected columnr;r!)rrRrrZthiscolZnewlocrryryrzr1s

zGoToColumn.parseImpl)T)rrrrrrrr1ryryrrzr s	cs*eZdZdZfddZdddZZS)ra
    Matches if current position is at the beginning of a line within the parse string
    
    Example::
    
        test = '''        AAA this line
        AAA and this line
          AAA but not this one
        B AAA and definitely not this one
        '''

        for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
            print(t)
    
    Prints::
        ['AAA', ' this line']
        ['AAA', ' and this line']    

    cstt|d|_dS)NzExpected start of line)rrrrrrryrzrOszLineStart.__init__TcCs*t||dkr|gfSt|||j|dSr)r;r!rrryryrzrSszLineStart.parseImpl)Tr5ryryrrzr:scs*eZdZdZfddZdddZZS)rzU
    Matches if current position is at the end of a line within the parse string
    cs,tt||tjddd|_dS)Nr2rzExpected end of line)rrrr
r&rsrrrrryrzr\szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nr2rrr!rrryryrzraszLineEnd.parseImpl)Tr5ryryrrzrXscs*eZdZdZfddZdddZZS)r,zM
    Matches if current position is at the beginning of the parse string
    cstt|d|_dS)NzExpected start of text)rr,rrrrryrzrpszStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfSr)rr!rrryryrzrtszStringStart.parseImpl)Tr5ryryrrzr,lscs*eZdZdZfddZdddZZS)r+zG
    Matches if current position is at the end of the parse string
    cstt|d|_dS)NzExpected end of text)rr+rrrrryrzrszStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dSrrrryryrzrszStringEnd.parseImpl)Tr5ryryrrzr+{scs.eZdZdZeffdd	ZdddZZS)r3ap
    Matches if the current position is at the beginning of a Word, and
    is not preceded by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of
    the string being parsed, or at the beginning of a line.
    cs"tt|t||_d|_dS)NzNot at the start of a word)rr3rr	wordCharsrrrrryrzrs
zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfSr)rr!rrryryrzrszWordStart.parseImpl)TrrrrrXrrr1ryryrrzr3scs.eZdZdZeffdd	ZdddZZS)r2aZ
    Matches if the current position is at the end of a Word, and
    is not followed by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of
    the string being parsed, or at the end of a line.
    cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rr2rrrr~rrrryrzrs
zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfSr)rrr!r)rrRrrrryryrzrszWordEnd.parseImpl)Trryryrrzr2scseZdZdZdfdd	ZddZddZd	d
ZfddZfd
dZ	fddZ
dfdd	ZgfddZfddZ
ZS)r"z^
    Abstract subclass of ParserElement, for combining and post-processing parsed tokens.
    Fcstt||t|tr"t|}t|tr.F)rr"rr}rrrr&rwexprsrallrrrrrrrryrzrs


zParseExpression.__init__cCs
|j|Sr)rrryryrzrszParseExpression.__getitem__cCs|j|d|_|Sr)rrr{r"ryryrzrszParseExpression.appendcCs0d|_dd|jD|_|jD]}|q|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on
           all contained expressions.FcSsg|]}|qSryrrrryryrzrsz3ParseExpression.leaveWhitespace..)r~rr)rrryryrzrs


zParseExpression.leaveWhitespacecsrt|trB||jkrntt|||jD]}||jdq*n,tt|||jD]}||jdqX|Sr)r}r-rrr"rr)rrrrryrzrs



zParseExpression.ignorecsNztt|WStk
r$YnX|jdkrHd|jjt|jf|_|jSNz%s:(%s))	rr"rrpr{rmrrrrrryrzrs
zParseExpression.__str__cs*tt||jD]}|qt|jdkr|jd}t||jr|js|jdkr|j	s|jdd|jdg|_d|_
|j|jO_|j|jO_|jd}t||jr|js|jdkr|j	s|jdd|jdd|_d|_
|j|jO_|j|jO_dt
||_|S)Nrsrrrtr)rr"rrrr}rmryr|rr{rrrr)rrrrryrzrs<



zParseExpression.streamlinecstt|||}|Sr)rr"r)rrrrrryrzr
szParseExpression.setResultsNamecCs6|dd|g}|jD]}||q|gdSr)rrr)rrtmprryryrzr
s
zParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|]}|qSryrrryryrzr%
sz(ParseExpression.copy..)rr"rrr1rryrzr#
szParseExpression.copy)F)F)rrrrrrrrrrrrrrr1ryryrrzr"s	
"csTeZdZdZGdddeZdfdd	ZdddZd	d
ZddZ	d
dZ
ZS)ra

    Requires all given C{ParseExpression}s to be found in the given order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'+'} operator.
    May also be constructed using the C{'-'} operator, which will suppress backtracking.

    Example::
        integer = Word(nums)
        name_expr = OneOrMore(Word(alphas))

        expr = And([integer("id"),name_expr("name"),integer("age")])
        # more easily written as:
        expr = integer("id") + name_expr("name") + integer("age")
    cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|dS)N-)rrrrrrrGrryrzr9
szAnd._ErrorStop.__init__rryryrrzr8
srTcsRtt|||tdd|jD|_||jdj|jdj|_d|_	dS)Ncss|]}|jVqdSrrrryryrzr@
szAnd.__init__..rT)
rrrrrrr
rr~rrrryrzr>
s
zAnd.__init__c	Cs|jdj|||dd\}}d}|jddD]}t|tjrDd}q.|rz||||\}}Wqtk
rtYqtk
r}zd|_t|W5d}~XYqt	k
rt|t
||j|YqXn||||\}}|s|r.||7}q.||fS)NrFrrT)
rrr}rrr%r
__traceback__rrrrr
)	rrRrr
resultlistZ	errorStoprZ
exprtokensrryryrzrE
s(
z
And.parseImplcCst|trt|}||Srr}rr&rwrr"ryryrzr!^
s

zAnd.__iadd__cCs6|dd|g}|jD]}|||jsq2qdSr)rrrrrsubRecCheckListrryryrzrc
s


zAnd.checkRecursioncCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nr{r(css|]}t|VqdSrrrryryrzro
szAnd.__str__..}rrr{rrrryryrzrj
s


 zAnd.__str__)T)T)rrrrrrrrr!rrr1ryryrrzr(
s
csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the expression that matches the longest string will be used.
    May be constructed using the C{'^'} operator.

    Example::
        # construct Or using '^' operator
        
        number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789"))
    prints::
        [['123'], ['3.1416'], ['789']]
    Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdSrrrryryrzr
szOr.__init__..T)rrrrrBrrrryrzr
szOr.__init__TcCsRd}d}g}|jD]}z|||}Wnvtk
rb}	zd|	_|	j|krR|	}|	j}W5d}	~	XYqtk
rt||krt|t||j|}t|}YqX|||fq|r(|j	ddd|D]^\}
}z|
|||WStk
r$}	z d|	_|	j|kr|	}|	j}W5d}	~	XYqXq|dk	r@|j|_|nt||d|dS)NrtcSs
|dSrry)xryryrzr{
r|zOr.parseImpl..)r no defined alternatives to match)rrr!rrrrrrsortrr)rrRrr	maxExcLocmaxExceptionrrZloc2r_ryryrzr
s<


zOr.parseImplcCst|trt|}||Srrr"ryryrz__ixor__
s

zOr.__ixor__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdSrrrryryrzr
szOr.__str__..rrrryryrzr
s


 z
Or.__str__cCs,|dd|g}|jD]}||qdSrrrrryryrzr
s
zOr.checkRecursion)F)T)
rrrrrrrrrr1ryryrrzrt
s

&	csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the first one listed is the one that will match.
    May be constructed using the C{'|'} operator.

    Example::
        # construct MatchFirst using '|' operator
        
        # watch the order of expressions to match
        number = Word(nums) | Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789")) #  Fail! -> [['123'], ['3'], ['1416'], ['789']]

        # put more selective expression first
        number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums)
        print(number.searchString("123 3.1416 789")) #  Better -> [['123'], ['3.1416'], ['789']]
    Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdSrrrryryrzr
sz&MatchFirst.__init__..T)rrrrrBrrrryrzr
szMatchFirst.__init__Tc	Csd}d}|jD]}z||||}|WStk
r`}z|j|krP|}|j}W5d}~XYqtk
rt||krt|t||j|}t|}YqXq|dk	r|j|_|nt||d|dS)Nrtr)rrr!rrrrr)	rrRrrrrrrrryryrzr
s$


zMatchFirst.parseImplcCst|trt|}||Srrr"ryryrz__ior__
s

zMatchFirst.__ior__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrr | css|]}t|VqdSrrrryryrzr
sz%MatchFirst.__str__..rrrryryrzr
s


 zMatchFirst.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzrs
zMatchFirst.checkRecursion)F)T)
rrrrrrrrrr1ryryrrzr
s
	cs<eZdZdZdfdd	ZdddZddZd	d
ZZS)
ram
    Requires all given C{ParseExpression}s to be found, but in any order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'&'} operator.

    Example::
        color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN")
        shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON")
        integer = Word(nums)
        shape_attr = "shape:" + shape_type("shape")
        posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn")
        color_attr = "color:" + color("color")
        size_attr = "size:" + integer("size")

        # use Each (using operator '&') to accept attributes in any order 
        # (shape and posn are required, color and size are optional)
        shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr)

        shape_spec.runTests('''
            shape: SQUARE color: BLACK posn: 100, 120
            shape: CIRCLE size: 50 color: BLUE posn: 50,80
            color:GREEN size:20 shape:TRIANGLE posn:20,40
            '''
            )
    prints::
        shape: SQUARE color: BLACK posn: 100, 120
        ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']]
        - color: BLACK
        - posn: ['100', ',', '120']
          - x: 100
          - y: 120
        - shape: SQUARE


        shape: CIRCLE size: 50 color: BLUE posn: 50,80
        ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']]
        - color: BLUE
        - posn: ['50', ',', '80']
          - x: 50
          - y: 80
        - shape: CIRCLE
        - size: 50


        color: GREEN size: 20 shape: TRIANGLE posn: 20,40
        ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']]
        - color: GREEN
        - posn: ['20', ',', '40']
          - x: 20
          - y: 40
        - shape: TRIANGLE
        - size: 20
    Tcs8tt|||tdd|jD|_d|_d|_dS)Ncss|]}|jVqdSrrrryryrzr?sz Each.__init__..T)rrrrrrr~initExprGroupsrrryrzr=sz
Each.__init__c	s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d	|_|}|jdd}|jddg}d
}	|	rj||j|j}
g}|
D]v}z|||}Wn t	k
r|
|YqX|
|jt||||kr@|
|q|kr܈
|qt|t|
krd	}	q|rddd|D}
t	||d
|
|fdd|jD7}g}|D]"}||||\}}|
|qt|tg}||fS)Ncss&|]}t|trt|j|fVqdSr)r}rr!rSrryryrzrEs
z!Each.parseImpl..cSsg|]}t|tr|jqSryr}rrSrryryrzrFs
z"Each.parseImpl..cSs g|]}|jrt|ts|qSry)rr}rrryryrzrGs
cSsg|]}t|tr|jqSry)r}r4rSrryryrzrIs
cSsg|]}t|tr|jqSry)r}rrSrryryrzrJs
cSs g|]}t|tttfs|qSry)r}rr4rrryryrzrKsFTr%css|]}t|VqdSrrrryryrzrfsz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSryrrZtmpOptryrzrjs

)rrrZopt1mapZ	optionalsZmultioptionalsZ
multirequiredZrequiredrr!rrr!removerrrsumr$)rrRrrZopt1Zopt2ZtmpLocZtmpReqdZ
matchOrderZkeepMatchingZtmpExprsZfailedrZmissingrrNZfinalResultsryrrzrCsP

zEach.parseImplcCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz & css|]}t|VqdSrrrryryrzryszEach.__str__..rrrryryrzrts


 zEach.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzr}s
zEach.checkRecursion)T)T)	rrrrrrrrr1ryryrrzrs
5
1	csleZdZdZdfdd	ZdddZdd	Zfd
dZfdd
ZddZ	gfddZ
fddZZS)r za
    Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens.
    Fcstt||t|tr@ttjtr2t|}ntt	|}||_
d|_|dk	r|j|_|j
|_
||j|j|_|j|_|j|_|j|jdSr)rr rr}r
issubclassr&rwr.rrSr{rrr
rr~r}rrrrrSrrryrzrs
zParseElementEnhance.__init__TcCs2|jdk	r|jj|||ddStd||j|dS)NFrr)rSrr!rrryryrzrs
zParseElementEnhance.parseImplcCs*d|_|j|_|jdk	r&|j|Sr)r~rSrrrryryrzrs


z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|||jdk	rn|j|jdn,tt|||jdk	rn|j|jd|Sr)r}r-rrr rrSr"rryrzrs



zParseElementEnhance.ignorecs&tt||jdk	r"|j|Sr)rr rrSrrryrzrs

zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk	r>|j|dSr)r(rSr)rrrryryrzrs

z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdk	r(|j||gdSrrSrrrrrryryrzrs
zParseElementEnhance.validatecsXztt|WStk
r$YnX|jdkrR|jdk	rRd|jjt|jf|_|jSr)	rr rrpr{rSrmrrrrryrzrszParseElementEnhance.__str__)F)T)
rrrrrrrrrrrrr1ryryrrzr s
cs*eZdZdZfddZdddZZS)ra
    Lookahead matching of the given parse expression.  C{FollowedBy}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression matches at the current
    position.  C{FollowedBy} always returns a null token list.

    Example::
        # use FollowedBy to match a label only if it is followed by a ':'
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint()
    prints::
        [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']]
    cstt||d|_dSr)rrrrrrSrryrzrszFollowedBy.__init__TcCs|j|||gfSr)rSrrryryrzrszFollowedBy.parseImpl)Tr5ryryrrzrscs2eZdZdZfddZd	ddZddZZS)
ra
    Lookahead to disallow matching with the given parse expression.  C{NotAny}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression does I{not} match at the current
    position.  Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny}
    always returns a null token list.  May be constructed using the '~' operator.

    Example::
        
    cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrr~rrrSrrrryrzrszNotAny.__init__TcCs&|j||rt|||j||gfSr)rSrr!rrryryrzrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{rrrr{rrSrryryrzrs


zNotAny.__str__)Trfryryrrzrs

cs(eZdZdfdd	ZdddZZS)	_MultipleMatchNcsFtt||d|_|}t|tr.t|}|dk	r<|nd|_dSr)	rrrr}r}rr&rw	not_ender)rrSstopOnZenderrryrzrs

z_MultipleMatch.__init__Tc	Cs|jj}|j}|jdk	}|r$|jj}|r2|||||||dd\}}zV|j}	|r`||||	rp|||}
n|}
|||
|\}}|s|rR||7}qRWnttfk
rYnX||fSNFr)	rSrrrrrr
r!r)rrRrrZself_expr_parseZself_skip_ignorablesZcheck_enderZ
try_not_enderrZhasIgnoreExprsrZ	tmptokensryryrzrs*



z_MultipleMatch.parseImpl)N)T)rrrrrr1ryryrrzr
src@seZdZdZddZdS)ra
    Repetition of one or more of the given expression.
    
    Parameters:
     - expr - expression that must match one or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: BLACK"
        OneOrMore(attr_expr).parseString(text).pprint()  # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']]

        # use stopOn attribute for OneOrMore to avoid reading label string as part of the data
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']]
        
        # could also be written as
        (attr_expr * (1,)).parseString(text).pprint()
    cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz}...rrryryrzrJs


zOneOrMore.__str__N)rrrrrryryryrzr0scs8eZdZdZd
fdd	Zdfdd	Zdd	ZZS)r4aw
    Optional repetition of zero or more of the given expression.
    
    Parameters:
     - expr - expression that must match zero or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example: similar to L{OneOrMore}
    Ncstt|j||dd|_dS)N)rT)rr4rr)rrSrrryrzr_szZeroOrMore.__init__Tc	s<ztt||||WSttfk
r6|gfYSXdSr)rr4rr!rrrryrzrcszZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr$]...rrryryrzris


zZeroOrMore.__str__)N)Trfryryrrzr4Ssc@s eZdZddZeZddZdS)
_NullTokencCsdSrryrryryrzrssz_NullToken.__bool__cCsdSrryrryryrzrvsz_NullToken.__str__N)rrrrrLrryryryrzrrsrcs6eZdZdZeffdd	Zd	ddZddZZS)
raa
    Optional matching of the given expression.

    Parameters:
     - expr - expression that must match zero or more times
     - default (optional) - value to be returned if the optional expression is not found.

    Example::
        # US postal code can be a 5-digit zip, plus optional 4-digit qualifier
        zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4)))
        zip.runTests('''
            # traditional ZIP code
            12345
            
            # ZIP+4 form
            12101-0001
            
            # invalid ZIP
            98765-
            ''')
    prints::
        # traditional ZIP code
        12345
        ['12345']

        # ZIP+4 form
        12101-0001
        ['12101-0001']

        # invalid ZIP
        98765-
             ^
        FAIL: Expected end of text (at char 5), (line:1, col:6)
    cs.tt|j|dd|jj|_||_d|_dS)NFr3T)rrrrSr}rr)rrSrrryrzrs
zOptional.__init__Tc	Cszz|jj|||dd\}}WnTttfk
rp|jtk	rh|jjr^t|jg}|j||jj<ql|jg}ng}YnX||fSr)rSrr!rr_optionalNotMatchedr|r$)rrRrrrryryrzrs


zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr$r'rrryryrzrs


zOptional.__str__)T)	rrrrrrrrr1ryryrrzrzs"
cs,eZdZdZd	fdd	Zd
ddZZS)r*a	
    Token for skipping over all undefined text until the matched expression is found.

    Parameters:
     - expr - target expression marking the end of the data to be skipped
     - include - (default=C{False}) if True, the target expression is also parsed 
          (the skipped text and target expression are returned as a 2-element list).
     - ignore - (default=C{None}) used to define grammars (typically quoted strings and 
          comments) that might contain false matches to the target expression
     - failOn - (default=C{None}) define expressions that are not allowed to be 
          included in the skipped test; if found before the target expression is found, 
          the SkipTo is not a match

    Example::
        report = '''
            Outstanding Issues Report - 1 Jan 2000

               # | Severity | Description                               |  Days Open
            -----+----------+-------------------------------------------+-----------
             101 | Critical | Intermittent system crash                 |          6
              94 | Cosmetic | Spelling error on Login ('log|n')         |         14
              79 | Minor    | System slow when running too many reports |         47
            '''
        integer = Word(nums)
        SEP = Suppress('|')
        # use SkipTo to simply match everything up until the next SEP
        # - ignore quoted strings, so that a '|' character inside a quoted string does not match
        # - parse action will call token.strip() for each matched token, i.e., the description body
        string_data = SkipTo(SEP, ignore=quotedString)
        string_data.setParseAction(tokenMap(str.strip))
        ticket_expr = (integer("issue_num") + SEP 
                      + string_data("sev") + SEP 
                      + string_data("desc") + SEP 
                      + integer("days_open"))
        
        for tkt in ticket_expr.searchString(report):
            print tkt.dump()
    prints::
        ['101', 'Critical', 'Intermittent system crash', '6']
        - days_open: 6
        - desc: Intermittent system crash
        - issue_num: 101
        - sev: Critical
        ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14']
        - days_open: 14
        - desc: Spelling error on Login ('log|n')
        - issue_num: 94
        - sev: Cosmetic
        ['79', 'Minor', 'System slow when running too many reports', '47']
        - days_open: 47
        - desc: System slow when running too many reports
        - issue_num: 79
        - sev: Minor
    FNcs`tt||||_d|_d|_||_d|_t|t	rFt
||_n||_dt
|j|_dS)NTFzNo match found for )rr*r
ignoreExprrrincludeMatchrr}rr&rwfailOnrrSr)rrZincluderrrryrzrs
zSkipTo.__init__Tc	Cs&|}t|}|j}|jj}|jdk	r,|jjnd}|jdk	rB|jjnd}	|}
|
|kr|dk	rf|||
rfq|	dk	rz|	||
}
Wqntk
rYqYqnXqnz|||
dddWqtt	fk
r|
d7}
YqJXqqJt|||j
||
}|||}t|}|jr||||dd\}}
||
7}||fS)NF)rrrr)
rrSrrrrrrr!rrr$r)rrRrrrUrrSZ
expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ
skipresultrMryryrzrs:
zSkipTo.parseImpl)FNN)Tr5ryryrrzr*s6
csbeZdZdZdfdd	ZddZddZd	d
ZddZgfd
dZ	ddZ
fddZZS)raK
    Forward declaration of an expression to be defined later -
    used for recursive grammars, such as algebraic infix notation.
    When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator.

    Note: take care when assigning to C{Forward} not to overlook precedence of operators.
    Specifically, '|' has a lower precedence than '<<', so that::
        fwdExpr << a | b | c
    will actually be evaluated as::
        (fwdExpr << a) | b | c
    thereby leaving b and c out as parseable alternatives.  It is recommended that you
    explicitly group the values inserted into the C{Forward}::
        fwdExpr << (a | b | c)
    Converting to use the '<<=' operator instead will avoid this problem.

    See L{ParseResults.pprint} for an example of a recursive parser created using
    C{Forward}.
    Ncstt|j|dddSr2)rrrr"rryrzr@szForward.__init__cCsjt|trt|}||_d|_|jj|_|jj|_||jj	|jj
|_
|jj|_|j
|jj|Sr)r}rr&rwrSr{rrr
rr~r}rrr"ryryrz
__lshift__Cs





zForward.__lshift__cCs||>Srryr"ryryrz__ilshift__PszForward.__ilshift__cCs
d|_|SrrrryryrzrSszForward.leaveWhitespacecCs$|js d|_|jdk	r |j|Sr)rrSrrryryrzrWs


zForward.streamlinecCs>||kr0|dd|g}|jdk	r0|j||gdSrrrryryrzr^s

zForward.validatecCsVt|dr|jS|jjdSz|jdk	r4t|j}nd}W5|j|_X|jjd|S)Nrz: ...Nonez: )rrrmrZ_revertClass_ForwardNoRecurserSr)rZ	retStringryryrzres


zForward.__str__cs.|jdk	rtt|St}||K}|SdSr)rSrrrr1rryrzrvs

zForward.copy)N)
rrrrrrrrrrrrr1ryryrrzr-s
c@seZdZddZdS)rcCsdS)Nrcryrryryrzrsz_ForwardNoRecurse.__str__N)rrrrryryryrzr~srcs"eZdZdZdfdd	ZZS)r/zQ
    Abstract subclass of C{ParseExpression}, for converting parsed results.
    Fcstt||d|_dSr)rr/rr}rrryrzrszTokenConverter.__init__)Fr4ryryrrzr/scs6eZdZdZd
fdd	ZfddZdd	ZZS)ra
    Converter to concatenate all matching tokens to a single string.
    By default, the matching patterns must also be contiguous in the input string;
    this can be disabled by specifying C{'adjacent=False'} in the constructor.

    Example::
        real = Word(nums) + '.' + Word(nums)
        print(real.parseString('3.1416')) # -> ['3', '.', '1416']
        # will also erroneously match the following
        print(real.parseString('3. 1416')) # -> ['3', '.', '1416']

        real = Combine(Word(nums) + '.' + Word(nums))
        print(real.parseString('3.1416')) # -> ['3.1416']
        # no match when there are internal spaces
        print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...)
    rTcs8tt|||r|||_d|_||_d|_dSr)rrrradjacentr~
joinStringr)rrSrrrryrzrszCombine.__init__cs(|jrt||ntt|||Sr)rr&rrrr"rryrzrszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rr$rr(rrr|r
)rrRrrZretToksryryrzrs
"zCombine.postParse)rT)rrrrrrrr1ryryrrzrs
cs(eZdZdZfddZddZZS)ra
    Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions.

    Example::
        ident = Word(alphas)
        num = Word(nums)
        term = ident | num
        func = ident + Optional(delimitedList(term))
        print(func.parseString("fn a,b,100"))  # -> ['fn', 'a', 'b', '100']

        func = ident + Group(Optional(delimitedList(term)))
        print(func.parseString("fn a,b,100"))  # -> ['fn', ['a', 'b', '100']]
    cstt||d|_dSr)rrrr}rrryrzrszGroup.__init__cCs|gSrryrryryrzrszGroup.postParserrrrrrr1ryryrrzrs
cs(eZdZdZfddZddZZS)r
aW
    Converter to return a repetitive expression as a list, but also as a dictionary.
    Each element can also be referenced using the first token in the expression as its key.
    Useful for tabular report scraping when the first column can be used as a item key.

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        # print attributes as plain groups
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names
        result = Dict(OneOrMore(Group(attr_expr))).parseString(text)
        print(result.dump())
        
        # access named fields as dict entries, or output as dict
        print(result['shape'])        
        print(result.asDict())
    prints::
        ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap']

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'}
    See more examples at L{ParseResults} of accessing fields by results name.
    cstt||d|_dSr)rr
rr}rrryrzrsz
Dict.__init__cCst|D]\}}t|dkrq|d}t|tr@t|d}t|dkr\td|||<qt|dkrt|dtst|d|||<q|}|d=t|dkst|tr|	rt||||<qt|d|||<q|j
r|gS|SdS)Nrrrrs)rrr}rvrrrr$rr
r|)rrRrrrtokZikeyZ	dictvalueryryrzrs$
zDict.postParserryryrrzr
s#c@s eZdZdZddZddZdS)r-aV
    Converter for ignoring the results of a parsed expression.

    Example::
        source = "a, b, c,d"
        wd = Word(alphas)
        wd_list1 = wd + ZeroOrMore(',' + wd)
        print(wd_list1.parseString(source))

        # often, delimiters that are useful during parsing are just in the
        # way afterward - use Suppress to keep them out of the parsed output
        wd_list2 = wd + ZeroOrMore(Suppress(',') + wd)
        print(wd_list2.parseString(source))
    prints::
        ['a', ',', 'b', ',', 'c', ',', 'd']
        ['a', 'b', 'c', 'd']
    (See also L{delimitedList}.)
    cCsgSrryrryryrzrszSuppress.postParsecCs|Srryrryryrzr
"szSuppress.suppressN)rrrrrr
ryryryrzr-sc@s(eZdZdZddZddZddZdS)	rzI
    Wrapper for parse actions, to ensure they are only called once.
    cCst||_d|_dSr)rrcallablecalled)rZ
methodCallryryrzr*s
zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rrr!)rrr[rxrNryryrzr	-s
zOnlyOnce.__call__cCs
d|_dSr)rrryryrzreset3szOnlyOnce.resetN)rrrrrr	rryryryrzr&scs:tfdd}zj|_Wntk
r4YnX|S)at
    Decorator for debugging parse actions. 
    
    When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
    When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised.

    Example::
        wd = Word(alphas)

        @traceParseAction
        def remove_duplicate_chars(tokens):
            return ''.join(sorted(set(''.join(tokens))))

        wds = OneOrMore(wd).setParseAction(remove_duplicate_chars)
        print(wds.parseString("slkdjs sld sldd sdlf sdljf"))
    prints::
        >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {}))
        <>entering %s(line: '%s', %d, %r)
z<.z)rrrr)rrryrrzrd6s
,FcCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)a
    Helper to define a delimited list of expressions - the delimiter defaults to ','.
    By default, the list elements and delimiters can have intervening whitespace, and
    comments, but this can be overridden by passing C{combine=True} in the constructor.
    If C{combine} is set to C{True}, the matching tokens are returned as a single token
    string, with the delimiters included; otherwise, the matching tokens are returned
    as a list of tokens, with the delimiters suppressed.

    Example::
        delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc']
        delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    z [r(rN)rrr4rr-)rSZdelimcombineZdlNameryryrzrBbs
$csjtfdd}|dkr0ttdd}n|}|d|j|dd|d	td
S)a:
    Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
        integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    
    If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value.

    Example::
        countedArray(Word(alphas)).parseString('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2))
        countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef')  # -> ['ab', 'cd']
    cs.|d}|r ttg|p&tt>gSr)rrrE)rr[rxrZ	arrayExprrSryrzcountFieldParseActions"z+countedArray..countFieldParseActionNcSst|dSr)rvrwryryrzr{r|zcountedArray..ZarrayLenTrz(len) rc)rr1rTrrrrr)rSZintExprrryrrzr>us
cCs6g}|D](}t|tr&|t|q||q|Sr)r}rrrr)Lrrryryrzrs
rcs6tfdd}|j|dddt|S)a*
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousLiteral(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches a
    previous literal, will also match the leading C{"1:1"} in C{"1:10"}.
    If this is not desired, use C{matchPreviousExpr}.
    Do I{not} use with packrat parsing enabled.
    csP|rBt|dkr|d>qLt|}tdd|D>n
t>dS)Nrrcss|]}t|VqdSr)rrZttryryrzrszDmatchPreviousLiteral..copyTokenToRepeater..)rrrrr)rr[rxZtflatZrepryrzcopyTokenToRepeatersz1matchPreviousLiteral..copyTokenToRepeaterTr(prev) )rrrr)rSrryrrzrQs


csFt|}|Kfdd}|j|dddt|S)aS
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousExpr(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches by
    expressions, will I{not} match the leading C{"1:1"} in C{"1:10"};
    the expressions are evaluated first, and then compared, so
    C{"1"} is compared with C{"10"}.
    Do I{not} use with packrat parsing enabled.
    cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)rrr!)rr[rxZtheseTokensZmatchTokensryrzmustMatchTheseTokensszLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr)rrr)rr[rxrrrrzrsz.matchPreviousExpr..copyTokenToRepeaterTrr)rrrrr)rSZe2rryrrzrPscCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-]r2r'r~r)r_bslashr)rrryryrzrYs
rYTc
s|rdd}dd}tndd}dd}tg}t|trF|}n$t|trZt|}ntjdt	dd|stt
Sd	}|t|d
kr||}t||d
dD]R\}}	||	|r|||d
=qxq|||	r|||d
=|
||	|	}qxq|d
7}qx|s|rzlt|td|krTtd
ddd|Dd|WStddd|Dd|WSWn&tk
rtjdt	ddYnXtfdd|Dd|S)a
    Helper to quickly define a set of alternative Literals, and makes sure to do
    longest-first testing when there is a conflict, regardless of the input order,
    but returns a C{L{MatchFirst}} for best performance.

    Parameters:
     - strs - a string of space-delimited literals, or a collection of string literals
     - caseless - (default=C{False}) - treat all literals as caseless
     - useRegex - (default=C{True}) - as an optimization, will generate a Regex
          object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or
          if creating a C{Regex} raises an exception)

    Example::
        comp_oper = oneOf("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.searchString("B = 12  AA=23 B<=AA AA>12"))
    prints::
        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    cSs||kSr)r@rbryryrzr{r|zoneOf..cSs||Sr)r@r<rryryrzr{r|cSs||kSrryrryryrzr{r|cSs
||Sr)r<rryryrzr{r|z6Invalid argument to oneOf, expected string or iterablersrrrNrz[%s]css|]}t|VqdSr)rYrZsymryryrzrszoneOf..r|css|]}t|VqdSr)rr[rryryrzrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdSrryrZparseElementClassryrzr$s)r
rr}rrrrrrrrrrrrr)rrpr)
Zstrsr?ZuseRegexZisequalZmasksZsymbolsrZcurrrryrrzrUsT






**cCsttt||S)a
    Helper to easily and clearly define a dictionary by specifying the respective patterns
    for the key and value.  Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
    in the proper order.  The key pattern can include delimiting markers or punctuation,
    as long as they are suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the C{Dict} results can include named token
    fields.

    Example::
        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)

        # similar to Dict, but simpler call format
        result = dictOf(attr_label, attr_value).parseString(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.asDict())
    prints::
        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    )r
r4r)rrryryrzrC&s!cCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S)	a
    Helper to return the original, untokenized text for a given expression.  Useful to
    restore the parsed fields of an HTML start tag into the raw tag text itself, or to
    revert separate tokens with intervening whitespace back to the original matching
    input text. By default, returns astring containing the original parsed text.  
       
    If the optional C{asString} argument is passed as C{False}, then the return value is a 
    C{L{ParseResults}} containing any results names that were originally matched, and a 
    single token containing the original matched text from the input string.  So if 
    the expression passed to C{L{originalTextFor}} contains expressions with defined
    results names, you must set C{asString} to C{False} if you want to preserve those
    results name values.

    Example::
        src = "this is test  bold text  normal text "
        for tag in ("b","i"):
            opener,closer = makeHTMLTags(tag)
            patt = originalTextFor(opener + SkipTo(closer) + closer)
            print(patt.searchString(src)[0])
    prints::
        [' bold text ']
        ['text']
    cSs|Srry)rrrxryryrzr{ar|z!originalTextFor..F_original_start
_original_endcSs||j|jSr)rrrZryryrzr{fr|cSs&||d|dg|dd<dS)Nrr)rrZryryrzextractTexthsz$originalTextFor..extractText)rrrrr)rSZasStringZ	locMarkerZendlocMarker	matchExprrryryrzriIs

cCst|ddS)zp
    Helper to undo pyparsing's default grouping of And expressions, even
    if all but one are non-empty.
    cSs|dSrryrwryryrzr{sr|zungroup..)r/r)rSryryrzrjnscCs4tdd}t|d|d|dS)a
    Helper to decorate a returned token with its starting and ending locations in the input string.
    This helper adds the following results names:
     - locn_start = location where matched expression begins
     - locn_end = location where matched expression ends
     - value = the actual parsed results

    Be careful if the input text contains C{} characters, you may want to call
    C{L{ParserElement.parseWithTabs}}

    Example::
        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)
    prints::
        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSs|SrryrZryryrzr{r|zlocatedExpr..Z
locn_startrZlocn_end)rrrrr)rSZlocatorryryrzrlusz\[]-*.$+^?()~ r_cCs|ddSrryrZryryrzr{r|r{z\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0x)unichrrvlstriprZryryrzr{r|z	\\0[0-7]+cCstt|ddddS)Nrr)rrvrZryryrzr{r|z\]rr$r)negatebodyr'csFddz"dfddt|jDWStk
r@YdSXdS)a
    Helper to easily define string ranges for use in Word construction.  Borrows
    syntax from regexp '[]' string range definitions::
        srange("[0-9]")   -> "0123456789"
        srange("[a-z]")   -> "abcdefghijklmnopqrstuvwxyz"
        srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
    The input string must be enclosed in []'s, and the returned string is the expanded
    character set joined into a single string.
    The values enclosed in the []'s may be:
     - a single character
     - an escaped character with a leading backslash (such as C{\-} or C{\]})
     - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) 
         (C{\0x##} is also supported for backwards compatibility) 
     - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
     - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
     - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
    cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdSr)rrryryrzrsz+srange....rr)r}r$rrord)pryryrzr{r|zsrange..rc3s|]}|VqdSrry)rpartZ	_expandedryrzrszsrange..N)r_reBracketExprrrrprdryrrzras
"csfdd}|S)zt
    Helper method for defining parse actions that require matching at a specific
    column in the input text.
    cs"t||krt||ddS)Nzmatched token not at column %dr)rNZlocnrVrryrz	verifyColsz!matchOnlyAtCol..verifyColry)rrryrrzrOscsfddS)a
    Helper method for common parse actions that simply return a literal value.  Especially
    useful when used with C{L{transformString}()}.

    Example::
        num = Word(nums).setParseAction(lambda toks: int(toks[0]))
        na = oneOf("N/A NA").setParseAction(replaceWith(math.nan))
        term = na | num
        
        OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234]
    csgSrryrZZreplStrryrzr{r|zreplaceWith..ryrryrrzr^scCs|dddS)a
    Helper parse action for removing quotation marks from parsed quoted strings.

    Example::
        # by default, quotation marks are included in parsed results
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]

        # use removeQuotes to strip quotation marks from parsed results
        quotedString.setParseAction(removeQuotes)
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
    rrrtryrZryryrzr\scsNfdd}ztdtdj}Wntk
rBt}YnX||_|S)aG
    Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional 
    args are passed, they are forwarded to the given function as additional arguments after
    the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
    parsed data to an integer using base 16.

    Example (compare the last to example in L{ParserElement.transformString}::
        hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16))
        hex_ints.runTests('''
            00 11 22 aa FF 0a 0d 1a
            ''')
        
        upperword = Word(alphas).setParseAction(tokenMap(str.upper))
        OneOrMore(upperword).runTests('''
            my kingdom for a horse
            ''')

        wd = Word(alphas).setParseAction(tokenMap(str.title))
        OneOrMore(wd).setParseAction(' '.join).runTests('''
            now is the winter of our discontent made glorious summer by this sun of york
            ''')
    prints::
        00 11 22 aa FF 0a 0d 1a
        [0, 17, 34, 170, 255, 10, 13, 26]

        my kingdom for a horse
        ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE']

        now is the winter of our discontent made glorious summer by this sun of york
        ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York']
    csfdd|DS)Ncsg|]}|fqSryry)rZtoknrr\ryrzrsz(tokenMap..pa..ryrZrryrzrsztokenMap..parrm)rorrpr~)r\rrrqryrrzros 
cCst|Srrr@rwryryrzr{r|cCst|Srrlowerrwryryrzr{r|c	Cst|tr|}t||d}n|j}tttd}|rt	t
}td|dtt
t|td|tddgdd		d
dtd}nd
ddtD}t	t
t|B}td|dtt
t|	tttd|tddgdd		ddtd}ttd|d}|dd
|ddd|}|dd
|ddd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerEz_-:r5tag=/FrrEcSs|ddkSNrrryrZryryrzr{r|z_makeTags..r6rcss|]}|dkr|VqdS)r6Nryrryryrzrsz_makeTags..cSs|ddkSrryrZryryrzr{r|r7rJ:r(z<%s>r`z)r}rrrr1r6r5r@rrr\r-r
r4rrrrrXr[rDr_Lrtitlerrr)tagStrZxmlZresnameZtagAttrNameZtagAttrValueZopenTagZprintablesLessRAbrackZcloseTagryryrz	_makeTagss>
..rcCs
t|dS)a 
    Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches
    tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.

    Example::
        text = 'More info at the pyparsing wiki page'
        # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple
        a,a_end = makeHTMLTags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end
        
        for link in link_expr.searchString(text):
            # attributes in the  tag (like "href" shown here) are also accessible as named results
            print(link.link_text, '->', link.href)
    prints::
        pyparsing -> http://pyparsing.wikispaces.com
    FrrryryrzrM(scCs
t|dS)z
    Helper to construct opening and closing tag expressions for XML, given a tag name. Matches
    tags only in the given upper/lower case.

    Example: similar to L{makeHTMLTags}
    TrrryryrzrN;scs8|r|ddn|ddDfdd}|S)a<
    Helper to create a validating parse action to be used with start tags created
    with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
    with a required attribute value, to avoid false matches on common tags such as
    C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSryryr/ryryrzrzsz!withAttribute..csZD]P\}}||kr$t||d||tjkr|||krt||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r!rg ANY_VALUE)rr[rZattrNameZ attrValueZattrsryrzr{s  zwithAttribute..pa)r)rZattrDictrryrrzrgDs 2 cCs|r d|nd}tf||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)rg)Z classname namespaceZ classattrryryrzrms (rpcCst}||||B}t|D]l\}}|ddd\}} } } | dkrPd|nd|} | dkr|dkstt|dkr|td|\} }t| }| tjkr^| d krt||t|t |}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkrTt|| |||t|| |||}ntd n| tj krB| d krt |t st |}t|j |t||}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkr8t|| |||t|| |||}ntd ntd | rvt | ttfrl|j| n || ||| |BK}|}q||K}|S) aD Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] rNrbrqz%s termz %s%s termrsz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)rrrrrrVLEFTrrrRIGHTr}rrSrrr)ZbaseExprZopListZlparZrparrZlastExprrZoperDefZopExprZarityZrightLeftAssocrZtermNameZopExpr1ZopExpr2ZthisExprrryryrzrksZ=   &       &    z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr*t|tr"t|tr"t|dkrt|dkr|dk rtt|t||tjdd dd}n$t t||tj dd}nx|dk rtt|t |t |ttjdd dd}n4ttt |t |ttjdd d d}ntd t }|dk rd|tt|t||B|Bt|K}n$|tt|t||Bt|K}|d ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrrcSs |dSrrrwryryrzr{gr|znestedExpr..cSs |dSrr rwryryrzr{jr|cSs |dSrr rwryryrzr{pr|cSs |dSrr rwryryrzr{tr|zOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rr}rrr rr r&rsrrErrrrr-r4r)ZopenerZcloserZcontentrrryryrzrR%sH:    *$c sfdd}fdd}fdd}ttd}tt|d}t|d }t|d } |rtt||t|t|t|| } n$tt|t|t|t|} | t t| d S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrtzillegal nestingznot a peer entry)rr;r#r!rr[rxZcurCol indentStackryrzcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrtznot a subentry)r;rr!rrryrzcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}r6|dkr6|dksBt||ddS)Nrtr_znot an unindent)rr;r!rrrryrz checkUnindents    z$indentedBlock..checkUnindentz INDENTrZUNINDENTzindented block) rrr r rrrrrrr) ZblockStatementExprrr9rrrrErZPEERZUNDENTZsmExprryrrzrhs(N   z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prz);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentityrwryryrzr]sz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentrO commaItemrc@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrtryrwryryrzr{r|zpyparsing_common.rz"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 address)rrhz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdSr3)rp _ipv6_partrrryryrzrs z,pyparsing_common...r)rrwryryrzr{r|z::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sNzt|dWStk rH}zt||t|W5d}~XYnXdSr)rstrptimedaterr!r~rr[rxZvefmtryrzcvt_fnsz.pyparsing_common.convertToDate..cvt_fnryr$r%ryr#rz convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sJzt|dWStk rD}zt||t|W5d}~XYnXdSr)rr rr!r~r"r#ryrzr%sz2pyparsing_common.convertToDatetime..cvt_fnryr&ryr#rzconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rp_html_stripperr)rr[rryryrz stripHTMLTagss zpyparsing_common.stripHTMLTagsrrOrrrrzcomma separated listcCs t|Srrrwryryrzr{"r|cCs t|Srrrwryryrzr{%r|N)r)r()?rrrrrorvZconvertToIntegerfloatZconvertToFloatr1rTrrrrFrr)Zsigned_integerrrrr Z mixed_integerrrealZsci_realrnumberrr6r5rZ ipv4_addressrZ_full_ipv6_addressZ_short_ipv6_addressrZ_mixed_ipv6_addressr Z ipv6_addressZ mac_addressr/r'r)Z iso8601_dateZiso8601_datetimeuuidr9r8r+r,rrrrXr0 _commasepitemrBr[rZcomma_separated_listrfrDryryryrzrpsV"" 2     __main__Zselectfromr=r)rcolumnsrZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rs)rF)N)FT)T)r)T)r __version__Z__versionTime__ __author__rweakrefrrrrrrrjrrFrcrr_threadr ImportErrorZ threadingZcollections.abcrrrrZ ordereddict__all__r version_inforbr0maxsizer0r~rchrrrrrr@reversedrrrBrr]r^rnZmaxintZxrangerZ __builtin__rZfnamerrorrrrrrZascii_uppercaseZascii_lowercaser6rTrFr5rrZ printablerXrprr!r#r%r(rr$registerr;rLrIrTrWrYrSrrr&r.rrrrrwrr r rnr1r)r'r r0rrrrr,r+r3r2r"rrrrr rrrrr4rrrr*rrr/r rr r-rrdrBr>rrQrPrYrUrCrirjrlrrErKrJrcrbrZ _escapedPuncZ_escapedHexCharZ_escapedOctCharZ _singleCharZ _charRangerrrarOr^r\rorfrDrrMrNrgrrmrVrr rkrWr@r`r[rerRrhr7rYr9r8rrrrr=r]r:rGr r_rAr?rHrZrr1r<rprZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLr.r/rrr0r*ryryryrzs4        8      @v &A= I G3pLOD|M &#@sQ,A,    I# %     0 ,   ? #p  Zr   (         "   PK!3"@@4_vendor/__pycache__/ordered_set.cpython-38.opt-1.pycnu[U Qab;@s|dZddlZddlmZzddlmZmZWn$ek rPddlmZmZYnXe dZ dZ ddZ Gdd d eeZ dS) z An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, and released under the MIT license. N)deque) MutableSetSequencez3.1cCs"t|do t|t o t|t S)a  Are we being asked to look up a list of things, instead of a single thing? We check for the `__iter__` attribute so that this can cover types that don't have to be known by this module, such as NumPy arrays. Strings, however, should be considered as atomic values to look up, not iterables. The same goes for tuples, since they are immutable and therefore valid entries. We don't need to check for the Python 2 `unicode` type, because it doesn't have an `__iter__` attribute anyway. __iter__)hasattr isinstancestrtuple)objr B/usr/lib/python3.8/site-packages/setuptools/_vendor/ordered_set.py is_iterables    r c@seZdZdZd;ddZddZddZd d Zd d Zd dZ ddZ ddZ e Z ddZ ddZeZeZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)< OrderedSetz An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Example: >>> OrderedSet([1, 1, 2, 3, 2]) OrderedSet([1, 2, 3]) NcCs g|_i|_|dk r||O}dSN)itemsmap)selfiterabler r r __init__4szOrderedSet.__init__cCs t|jS)z Returns the number of unique elements in the ordered set Example: >>> len(OrderedSet([])) 0 >>> len(OrderedSet([1, 2])) 2 )lenrrr r r __len__:s zOrderedSet.__len__cs|t|tr|tkrSt|r4fdd|DSt|dsHt|trlj|}t|trf|S|Sn t d|dS)aQ Get the item at a given index. If `index` is a slice, you will get back that slice of items, as a new OrderedSet. If `index` is a list or a similar iterable, you'll get a list of items corresponding to those indices. This is similar to NumPy's "fancy indexing". The result is not an OrderedSet because you may ask for duplicate indices, and the number of elements returned should be the number of elements asked for. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset[1] 2 csg|]}j|qSr )r).0irr r [sz*OrderedSet.__getitem__.. __index__z+Don't know how to index an OrderedSet by %rN) rslice SLICE_ALLcopyr rrlist __class__ TypeError)rindexresultr rr __getitem__Fs   zOrderedSet.__getitem__cCs ||S)z Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False )r rr r r res zOrderedSet.copycCst|dkrdSt|SdS)Nrr)rrrr r r __getstate__ss zOrderedSet.__getstate__cCs"|dkr|gn ||dS)Nr)r)rstater r r __setstate__s zOrderedSet.__setstate__cCs ||jkS)z Test if the item is in this ordered set Example: >>> 1 in OrderedSet([1, 3, 2]) True >>> 5 in OrderedSet([1, 3, 2]) False )rrkeyr r r __contains__s zOrderedSet.__contains__cCs0||jkr&t|j|j|<|j||j|S)aE Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) OrderedSet([3]) )rrrappendr(r r r adds  zOrderedSet.addcCsFd}z|D]}||}q Wn$tk r@tdt|YnX|S)a< Update the set with the given iterable sequence, then return the index of the last element inserted. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.update([3, 1, 5, 1, 4]) 4 >>> print(oset) OrderedSet([1, 2, 3, 5, 4]) Nz(Argument needs to be an iterable, got %s)r,r! ValueErrortype)rZsequenceZ item_indexitemr r r updates  zOrderedSet.updatecs$t|rfdd|DSj|S)aH Get the index of a given entry, raising an IndexError if it's not present. `key` can be an iterable of entries that is not a string, in which case this returns a list of indices. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.index(2) 1 csg|]}|qSr )r")rZsubkeyrr r rsz$OrderedSet.index..)r rr(r rr r"s zOrderedSet.indexcCs,|jstd|jd}|jd=|j|=|S)z Remove and return the last element from the set. Raises KeyError if the set is empty. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.pop() 3 z Set is empty)rKeyErrorr)relemr r r pops  zOrderedSet.popcCsP||krL|j|}|j|=|j|=|jD]\}}||kr,|d|j|<q,dS)a Remove an element. Do not raise an exception if absent. The MutableSet mixin uses this to implement the .remove() method, which *does* raise an error when asked to remove a non-existent item. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) N)rr)rr)rkvr r r discards zOrderedSet.discardcCs|jdd=|jdS)z8 Remove all items from this OrderedSet. N)rrclearrr r r r9s zOrderedSet.clearcCs t|jS)zb Example: >>> list(iter(OrderedSet([1, 2, 3]))) [1, 2, 3] )iterrrr r r rszOrderedSet.__iter__cCs t|jS)zf Example: >>> list(reversed(OrderedSet([1, 2, 3]))) [3, 2, 1] )reversedrrr r r __reversed__ szOrderedSet.__reversed__cCs&|sd|jjfSd|jjt|fS)Nz%s()z%s(%r))r __name__rrr r r __repr__szOrderedSet.__repr__cCsRt|ttfrt|t|kSz t|}Wntk r@YdSXt||kSdS)a Returns true if the containers have the same items. If `other` is a Sequence, then order is checked, otherwise it is ignored. Example: >>> oset = OrderedSet([1, 3, 2]) >>> oset == [1, 3, 2] True >>> oset == [1, 2, 3] False >>> oset == [2, 3] False >>> oset == OrderedSet([3, 2, 1]) False FN)rrrrsetr!)rotherZ other_as_setr r r __eq__s zOrderedSet.__eq__cGs<t|tr|jnt}ttt|g|}tj|}||S)a Combines all unique items. Each items order is defined by its first appearance. Example: >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0]) >>> print(oset) OrderedSet([3, 1, 4, 5, 2, 0]) >>> oset.union([8, 9]) OrderedSet([3, 1, 4, 5, 2, 0, 8, 9]) >>> oset | {10} OrderedSet([3, 1, 4, 5, 2, 0, 10]) )rrr rritchain from_iterable)rsetsclsZ containersrr r r union6s zOrderedSet.unioncCs ||Sr) intersectionrr@r r r __and__IszOrderedSet.__and__csHt|tr|jnt}|r>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3]) >>> print(oset) OrderedSet([1, 2, 3]) >>> oset.intersection([2, 4, 5], [1, 2, 3, 4]) OrderedSet([2]) >>> oset.intersection() OrderedSet([1, 2, 3]) c3s|]}|kr|VqdSrr rr/commonr r ^sz*OrderedSet.intersection..)rrr r?rHrrrErFrr rLr rHMs zOrderedSet.intersectioncs:|j}|r.tjtt|fdd|D}n|}||S)a Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) OrderedSet([1]) >>> OrderedSet([1, 2, 3]) - OrderedSet([2]) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference() OrderedSet([1, 2, 3]) c3s|]}|kr|VqdSrr rKr@r r rNtsz(OrderedSet.difference..)r r?rGrrOr rPr differencecs zOrderedSet.differencecs*t|tkrdStfdd|DS)a7 Report whether another set contains this set. Example: >>> OrderedSet([1, 2, 3]).issubset({1, 2}) False >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4}) True >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5}) False Fc3s|]}|kVqdSrr rKrPr r rNsz&OrderedSet.issubset..rallrIr rPr issubsetys zOrderedSet.issubsetcs*tt|krdStfdd|DS)a= Report whether this set contains another set. Example: >>> OrderedSet([1, 2]).issuperset([1, 2, 3]) False >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3}) True >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3}) False Fc3s|]}|kVqdSrr rKrr r rNsz(OrderedSet.issuperset..rRrIr rr issupersets zOrderedSet.issupersetcCs:t|tr|jnt}|||}|||}||S)a Return the symmetric difference of two OrderedSets as a new set. That is, the new set will contain all elements that are in exactly one of the sets. Their order will be preserved, with elements from `self` preceding elements from `other`. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference(other) OrderedSet([4, 5, 9, 2]) )rrr rQrG)rr@rFZdiff1Zdiff2r r r symmetric_differenceszOrderedSet.symmetric_differencecCs||_ddt|D|_dS)zt Replace the 'items' list of this OrderedSet with a new one, updating self.map accordingly. cSsi|]\}}||qSr r )ridxr/r r r sz,OrderedSet._update_items..N)r enumerater)rrr r r _update_itemsszOrderedSet._update_itemscs:t|D]}t|Oq |fdd|jDdS)a Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>> this = OrderedSet([1, 2, 3, 4, 5]) >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6])) >>> print(this) OrderedSet([3, 5]) csg|]}|kr|qSr r rKitems_to_remover r rsz0OrderedSet.difference_update..Nr?rZr)rrEr@r r[r difference_updateszOrderedSet.difference_updatecs&t|fdd|jDdS)a^ Update this OrderedSet to keep only items in another set, preserving their order in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.intersection_update(other) >>> print(this) OrderedSet([1, 3, 7]) csg|]}|kr|qSr r rKrPr r rsz2OrderedSet.intersection_update..Nr]rIr rPr intersection_updates zOrderedSet.intersection_updatecs<fdd|D}t|fddjD|dS)a Update this OrderedSet to remove items from another set, then add items from the other set that were not present in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference_update(other) >>> print(this) OrderedSet([4, 5, 9, 2]) csg|]}|kr|qSr r rKrr r rsz:OrderedSet.symmetric_difference_update..csg|]}|kr|qSr r rKr[r r rsNr])rr@Z items_to_addr )r\rr symmetric_difference_updates z&OrderedSet.symmetric_difference_update)N)#r= __module__ __qualname____doc__rrr$rr%r'r*r,r+r0r"Zget_locZ get_indexerr4r8r9rr<r>rArGrJrHrQrTrUrVrZr^r_r`r r r r r*s@    r)rc itertoolsrB collectionsrZcollections.abcrr ImportErrorrr __version__r rr r r r s PK!L_k_k_,_vendor/__pycache__/six.cpython-38.opt-1.pycnu[U QabuA@sRdZddlmZddlZddlZddlZddlZddlZdZdZ ej ddkZ ej ddkZ ej dddkZ e refZefZefZeZeZejZn~efZeefZeejfZeZeZejd red ZnHGd d d eZ ze!e Wne"k red ZYn Xed Z[ ddZ#ddZ$GdddeZ%Gddde%Z&Gdddej'Z(Gddde%Z)GdddeZ*e*e+Z,Gddde(Z-e)dddd e)d!d"d#d$d!e)d%d"d"d&d%e)d'd(d#d)d'e)d*d(d+e)d,d"d#d-d,e)d.d/d/d0d.e)d1d/d/d.d1e)d2d(d#d3d2e)d4d(e rd5nd6d7e)d8d(d9e)d:d;dd>d?e)d@d@d?e)dAdAd?e)d3d(d#d3d2e)dBd"d#dCdBe)dDd"d"dEdDe&d#d(e&dFdGe&dHdIe&dJdKdLe&dMdNdMe&dOdPdQe&dRdSdTe&dUdVdWe&dXdYdZe&d[d\d]e&d^d_d`e&dadbdce&dddedfe&dgdhdie&djdjdke&dldldke&dmdmdke&dndndoe&dpdqe&drdse&dtdue&dvdwdve&dxdye&dzd{d|e&d}d~de&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkrRe.e&ddg7Z.e.D]2Z/e0e-e/j1e/e2e/e&rVe,3e/de/j1qV[/e.e-_.e-e+dZ4e,3e4dGddde(Z5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d=dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6e6D]Z/e0e5e/j1e/q[/e6e5_.e,3e5e+dddҡGddԄde(Z7e)ddde)ddde)dddgZ8e8D]Z/e0e7e/j1e/q[/e8e7_.e,3e7e+dddۡGdd݄de(Z9e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃e)ddd߃g!Z:e:D]Z/e0e9e/j1e/q[/e:e9_.e,3e9e+dddGddde(Z;e)ddde)ddde)ddde)d ddgZe>D]Z/e0e=e/j1e/q[/e>e=_.e,3e=e+dddGdddej'Z?e,3e?e+ddddZ@ddZAe rHdZBdZCdZDdZEdZFdZGn$d ZBd!ZCd"ZDd#ZEd$ZFd%ZGzeHZIWn"eJk rd&d'ZIYnXeIZHzeKZKWn"eJk rd(d)ZKYnXe rd*d+ZLejMZNd,d-ZOeZPn>d.d+ZLd/d0ZNd1d-ZOGd2d3d3eZPeKZKe#eLd4eQeBZReQeCZSeQeDZTeQeEZUeQeFZVeQeGZWe rԐd5d6ZXd7d8ZYd9d:ZZd;d<Z[e\d=Z]e\d>Z^e\d?Z_nTd@d6ZXdAd8ZYdBd:ZZdCd<Z[e\dDZ]e\dEZ^e\dFZ_e#eXdGe#eYdHe#eZdIe#e[dJe rdKdLZ`dMdNZaebZcddldZdededOjfZg[dehdZiejjZkelZmddlnZnenjoZoenjpZpdPZqej dQdQk rdRZrdSZsn dTZrdUZsnjdVdLZ`dWdNZaecZcebZgdXdYZidZd[ZketejuevZmddloZoeojoZoZpd\ZqdRZrdSZse#e`d]e#ead^d_dPZwd`dTZxdadUZye reze4j{dbZ|d|dcddZ}nd}dedfZ|e|dgej dddhk re|din.ej dddhk re|djn dkdlZ~eze4j{dmdZedk rLdndoZej dddpk rreZdqdoZe#e}drej dddk rejejfdsdtZnejZdudvZdwdxZdydzZgZe+Zed{dk rge_ejrBeejD]4\ZZeej+dkrej1e+kreje=q>q[[eje,dS(~z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.10.0)rjavaic@seZdZddZdS)XcCsdS)Nlselfrr:/usr/lib/python3.8/site-packages/setuptools/_vendor/six.py__len__>sz X.__len__N)__name__ __module__ __qualname__r rrrr r<srlcCs ||_dS)z Add documentation to a function.N)__doc__)funcdocrrr _add_docKsrcCst|tj|S)z7Import module, returning the module after the last dot.) __import__sysmodulesnamerrr _import_modulePsrc@seZdZddZddZdS) _LazyDescrcCs ||_dSNrr rrrr __init__Xsz_LazyDescr.__init__cCsB|}t||j|zt|j|jWntk r<YnX|Sr)_resolvesetattrrdelattr __class__AttributeError)r objtpresultrrr __get__[sz_LazyDescr.__get__N)r rrrr&rrrr rVsrcs.eZdZdfdd ZddZddZZS) MovedModuleNcs2tt||tr(|dkr |}||_n||_dSr)superr'rPY3mod)r roldnewr!rr ris zMovedModule.__init__cCs t|jSr)rr*r rrr rrszMovedModule._resolvecCs"|}t||}t||||Sr)rgetattrr)r attr_modulevaluerrr __getattr__us  zMovedModule.__getattr__)N)r rrrrr2 __classcell__rrr-r r'gs r'cs(eZdZfddZddZgZZS) _LazyModulecstt|||jj|_dSr)r(r4rr!rrr-rr r~sz_LazyModule.__init__cCs ddg}|dd|jD7}|S)Nrr cSsg|] }|jqSrr).0r/rrr sz'_LazyModule.__dir__..)_moved_attributes)r Zattrsrrr __dir__sz_LazyModule.__dir__)r rrrr8r7r3rrr-r r4|s r4cs&eZdZdfdd ZddZZS)MovedAttributeNcsdtt||trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dSr)r(r9rr)r*r/)r rZold_modZnew_modZold_attrZnew_attrr-rr rszMovedAttribute.__init__cCst|j}t||jSr)rr*r.r/)r modulerrr rs zMovedAttribute._resolve)NN)r rrrrr3rrr-r r9sr9c@sVeZdZdZddZddZddZdd d Zd d Zd dZ ddZ ddZ e Z dS)_SixMetaPathImporterz A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 cCs||_i|_dSr)r known_modules)r Zsix_module_namerrr rsz_SixMetaPathImporter.__init__cGs"|D]}||j|jd|<qdSN.r<r)r r*Z fullnamesfullnamerrr _add_modulesz _SixMetaPathImporter._add_modulecCs|j|jd|Sr=r?r r@rrr _get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdSr)r<)r r@pathrrr find_modules z _SixMetaPathImporter.find_modulecCs2z |j|WStk r,td|YnXdS)Nz!This loader does not know module )r<KeyError ImportErrorrBrrr Z __get_modules z!_SixMetaPathImporter.__get_modulecCsTz tj|WStk r YnX||}t|tr@|}n||_|tj|<|Sr)rrrF _SixMetaPathImporter__get_module isinstancer'r __loader__)r r@r*rrr load_modules     z _SixMetaPathImporter.load_modulecCst||dS)z Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) __path__)hasattrrHrBrrr is_packagesz_SixMetaPathImporter.is_packagecCs||dS)z;Return None Required, if is_package is implementedN)rHrBrrr get_codes z_SixMetaPathImporter.get_code)N) r rrrrrArCrErHrKrNrO get_sourcerrrr r;s  r;c@seZdZdZgZdS) _MovedItemszLazy loading of moved objectsN)r rrrrLrrrr rQsrQZ cStringIOioStringIOfilter itertoolsbuiltinsZifilter filterfalseZ ifilterfalseinputZ __builtin__Z raw_inputinternrmapimapgetcwdosZgetcwdugetcwdbrangeZxrangeZ reload_module importlibZimpreloadreduce functoolsZ shlex_quoteZpipesZshlexZquoteUserDict collectionsUserList UserStringzipZizip zip_longestZ izip_longestZ configparserZ ConfigParsercopyregZcopy_regZdbm_gnuZgdbmzdbm.gnuZ _dummy_threadZ dummy_threadZhttp_cookiejarZ cookielibzhttp.cookiejarZ http_cookiesZCookiez http.cookiesZ html_entitiesZhtmlentitydefsz html.entitiesZ html_parserZ HTMLParserz html.parserZ http_clientZhttplibz http.clientZemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartZemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartZemail_mime_textzemail.MIMETextzemail.mime.textZemail_mime_basezemail.MIMEBasezemail.mime.baseZBaseHTTPServerz http.serverZ CGIHTTPServerZSimpleHTTPServerZcPicklepickleZqueueZQueuereprlibreprZ socketserverZ SocketServer_threadthreadZtkinterZTkinterZtkinter_dialogZDialogztkinter.dialogZtkinter_filedialogZ FileDialogztkinter.filedialogZtkinter_scrolledtextZ ScrolledTextztkinter.scrolledtextZtkinter_simpledialogZ SimpleDialogztkinter.simpledialogZ tkinter_tixZTixz tkinter.tixZ tkinter_ttkZttkz tkinter.ttkZtkinter_constantsZ Tkconstantsztkinter.constantsZ tkinter_dndZTkdndz tkinter.dndZtkinter_colorchooserZtkColorChooserztkinter.colorchooserZtkinter_commondialogZtkCommonDialogztkinter.commondialogZtkinter_tkfiledialogZ tkFileDialogZ tkinter_fontZtkFontz tkinter.fontZtkinter_messageboxZ tkMessageBoxztkinter.messageboxZtkinter_tksimpledialogZtkSimpleDialogZ urllib_parsez.moves.urllib_parsez urllib.parseZ urllib_errorz.moves.urllib_errorz urllib.errorZurllibz .moves.urllibZurllib_robotparser robotparserzurllib.robotparserZ xmlrpc_clientZ xmlrpclibz xmlrpc.clientZ xmlrpc_serverZSimpleXMLRPCServerz xmlrpc.serverZwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseNr rrrrrrr rt@srtZ ParseResultZurlparseZ SplitResultZparse_qsZ parse_qslZ urldefragZurljoinZurlsplitZ urlunparseZ urlunsplitZ quote_plusZunquoteZ unquote_plusZ urlencodeZ splitqueryZsplittagZ splituserZ uses_fragmentZ uses_netlocZ uses_paramsZ uses_queryZ uses_relativemoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorNrurrrr rwhsrwZURLErrorZurllib2Z HTTPErrorZContentTooShortErrorz.moves.urllib.errormoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestNrurrrr ry|sryZurlopenzurllib.requestZinstall_openerZ build_openerZ pathname2urlZ url2pathnameZ getproxiesZRequestZOpenerDirectorZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZ ProxyHandlerZ BaseHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZ HTTPHandlerZ HTTPSHandlerZ FileHandlerZ FTPHandlerZCacheFTPHandlerZUnknownHandlerZHTTPErrorProcessorZ urlretrieveZ urlcleanupZ URLopenerZFancyURLopenerZ proxy_bypassz.moves.urllib.requestmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseNrurrrr r{sr{Zaddbasezurllib.responseZ addclosehookZaddinfoZ addinfourlz.moves.urllib.responsemoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserNrurrrr r}sr}ZRobotFileParserz.moves.urllib.robotparsermoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZedZedZedZ edZ edZ ddZ d S) Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacervrxrzr|r~cCsdddddgS)Nparseerrorrequestresponserprr rrr r8szModule_six_moves_urllib.__dir__N) r rrrrL _importerrCrrrrrpr8rrrr rs     rz moves.urllibcCstt|j|dS)zAdd an item to six.moves.N)rrQr)Zmoverrr add_movesrc CsXztt|WnDtk rRz tj|=Wn"tk rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)r rQr"rs__dict__rFrrrr remove_moves r__func____self__ __closure____code__ __defaults__ __globals__im_funcZim_selfZ func_closureZ func_codeZ func_defaultsZ func_globalscCs|Sr)next)itrrr advance_iterator srcCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)r)r5klassrrr szcallable..)anytype__mro__)r#rrr callablesrcCs|SrrZunboundrrr get_unbound_functionsrcCs|Srrrclsrrr create_unbound_methodsrcCs|jSr)rrrrr r"scCst|||jSr)types MethodTyper!)rr#rrr create_bound_method%srcCst|d|Sr)rrrrrr r(sc@seZdZddZdS)IteratorcCst||Sr)r__next__r rrr r-sz Iterator.nextN)r rrrrrrr r+srz3Get the function out of a possibly unbound functioncKst|jf|Sr)iterkeysdkwrrr iterkeys>srcKst|jf|Sr)rvaluesrrrr itervaluesAsrcKst|jf|Sr)ritemsrrrr iteritemsDsrcKst|jf|Sr)rZlistsrrrr iterlistsGsrrrrcKs |jf|Sr)rrrrr rPscKs |jf|Sr)rrrrr rSscKs |jf|Sr)rrrrr rVscKs |jf|Sr)rrrrr rYsviewkeys viewvalues viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs |dS)Nzlatin-1)encodesrrr bksrcCs|Srrrrrr unsrz>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesassertRaisesRegex assertRegexcCs|Srrrrrr rscCst|dddS)Nz\\z\\\\Zunicode_escape)unicodereplacerrrr rscCs t|dS)Nrord)Zbsrrr byte2intsrcCs t||Srr)Zbufirrr indexbytessrZassertItemsEqualz Byte literalz Text literalcOst|t||Sr)r._assertCountEqualr argskwargsrrr rscOst|t||Sr)r._assertRaisesRegexrrrr rscOst|t||Sr)r. _assertRegexrrrr rsexeccCs*|dkr|}|j|k r"|||dSr) __traceback__with_traceback)r$r1tbrrr reraises   rcCsB|dkr*td}|j}|dkr&|j}~n |dkr6|}tddS)zExecute code in a namespace.Nrzexec _code_ in _globs_, _locs_)r _getframe f_globalsf_localsr)Z_code_Z_globs_Z_locs_framerrr exec_s rz9def reraise(tp, value, tb=None): raise tp, value, tb )rrzrdef raise_from(value, from_value): if from_value is None: raise value raise value from from_value zCdef raise_from(value, from_value): raise value from from_value cCs|dSrr)r1Z from_valuerrr raise_fromsrprintc s.|dtjdkrdSfdd}d}|dd}|dk r`t|trNd}nt|ts`td|d d}|dk rt|trd}nt|tstd |rtd |s|D]}t|trd}qq|rtd }td }nd }d }|dkr|}|dkr|}t|D] \} }| r||||q||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk rVtdd}|dkrHd}|j|}|dS)Nerrorsstrict) rI basestringstrrrencodingr.rwrite)datarfprr rs   zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()  )poprstdoutrIrr TypeError enumerate) rrrZ want_unicoderrargnewlineZspacerrrr print_sL          r)rrcOs<|dtj}|dd}t|||r8|dk r8|dS)NrflushF)getrrr_printr)rrrrrrr r s    zReraise an exception.csfdd}|S)Ncst|}|_|Sr)rcwraps __wrapped__)fassignedupdatedwrappedrr wrapperszwraps..wrapperr)rrrrrrr rsrcs&Gfddd}t|ddiS)z%Create a base class with a metaclass.cseZdZfddZdS)z!with_metaclass..metaclasscs ||Srr)rrZ this_basesrbasesmetarr __new__'sz)with_metaclass..metaclass.__new__N)r rrrrrrr metaclass%srZtemporary_classr)rr)rrrrrr with_metaclass srcsfdd}|S)z6Class decorator for creating a class with a metaclass.csh|j}|d}|dk r@t|tr,|g}|D]}||q0|dd|dd|j|j|S)N __slots__r __weakref__)rcopyrrIrrr __bases__)rZ orig_varsslotsZ slots_varrrr r.s      zadd_metaclass..wrapperr)rrrrr add_metaclass,s rcCs2tr.d|jkrtd|j|j|_dd|_|S)a A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|dS)Nzutf-8) __unicode__rr rrr Jz-python_2_unicode_compatible..)PY2r ValueErrorr rr)rrrr python_2_unicode_compatible<s  r__spec__)N)NN)rZ __future__rrcrUoperatorrr __author__ __version__ version_inforr)ZPY34rZ string_typesintZ integer_typesrZ class_typesZ text_typebytesZ binary_typemaxsizeZMAXSIZErZlongZ ClassTyperplatform startswithobjectrlen OverflowErrorrrrr' ModuleTyper4r9r;r rrQr7r/rrrIrArsrtZ_urllib_parse_moved_attributesrwZ_urllib_error_moved_attributesryZ _urllib_request_moved_attributesr{Z!_urllib_response_moved_attributesr}Z$_urllib_robotparser_moved_attributesrrrZ _meth_funcZ _meth_selfZ _func_closureZ _func_codeZ_func_defaultsZ _func_globalsrr NameErrorrrrrrr attrgetterZget_method_functionZget_method_selfZget_function_closureZget_function_codeZget_function_defaultsZget_function_globalsrrrr methodcallerrrrrrchrZunichrstructStructpackZint2byte itemgetterrgetitemrrZ iterbytesrRrSBytesIOrrrpartialr[rrrrr.rVrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrrrrrL __package__globalsrrsubmodule_search_locations meta_pathrrZimporterappendrrrr s    >                                      D                                                               #                                                 5     PK!~2_vendor/__pycache__/pyparsing.cpython-38.opt-1.pycnu[U Qabwi@s dZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZzddlmZWn ek rddlmZYnXzdd lmZdd lmZWn,ek rdd l mZdd l mZYnXzdd l mZWnBek rFzdd lmZWnek r@dZYnXYnXd d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtgiZee jdduZeddukZ e rpe j!Z"e#Z$e%Z&e#Z'e(e)e*e+e,ee-e.e/e0e1g Z2n`e j3Z"e4Z5dvdwZ'gZ2ddl6Z6dx7D]8Z8ze29e:e6e8Wne;k rYqYnXqeGd~dde?Z@ejAejBZCdZDeDdZEeCeDZFe%dZGdHddzejIDZJGdd#d#eKZLGdd%d%eLZMGdd'd'eLZNGdd)d)eNZOGdd,d,eKZPGddde?ZQGdd(d(e?ZReSeRdd?ZTddPZUddMZVddZWddZXddZYddWZZd/ddZ[Gdd*d*e?Z\Gdd2d2e\Z]Gddde]Z^Gddde]Z_Gddde]Z`e`Zae`e\_bGddde]ZcGddde`ZdGdd d ecZeGddrdre]ZfGdd5d5e]ZgGdd-d-e]ZhGdd+d+e]ZiGddde]ZjGdd4d4e]ZkGddde]ZlGdddelZmGdddelZnGdddelZoGdd0d0elZpGdd/d/elZqGdd7d7elZrGdd6d6elZsGdd&d&e\ZtGdd d etZuGdd"d"etZvGdddetZwGdddetZxGdd$d$e\ZyGdddeyZzGdddeyZ{GdddeyZ|Gddde|Z}Gdd8d8e|Z~Gddde?ZeZGdd!d!eyZGdd.d.eyZGdddeyZGddÄdeZGdd3d3eyZGdddeZGdddeZGdddeZGdd1d1eZGdd d e?ZddhZd0ddFZd1ddBZddЄZddUZddTZddԄZd2ddYZddGZd3ddmZddnZddpZe^dIZendOZeodNZepdgZeqdfZegeGddd܍ddބZehd߃ddބZehdddބZeeBeBejdd{d܍BZeeedeZe`deddee}eeBddZddeZddSZddbZdd`ZddsZeddބZeddބZddZddQZddRZddkZe?e_d4ddqZe@Ze?e_e?e_ededfddoZeZeehdddZeehdddZeehddehddBdZeeadedZdddefddVZd5ddlZedZedZeegeCeFdd\ZZeed 7d Zehd d Heàġd dZŐddaZeehdddZehddZehdɡdZehddZeehddeBdZeZehddZee}egeJdːdeegde`d˃eoϡdZeeeeBddd@ZGd dtdtZeӐd!k redd"Zedd#ZegeCeFd$Zee֐d%dՐd&eZeee׃d'Zؐd(eBZee֐d%dՐd&eZeeeڃd)ZeԐd*eِd'eeېd)Zeܠݐd+ejޠݐd,ejߠݐd,ejݐd-ddlZej᠝eejejݐd.dS(6a pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements (L{'+'} operator gives L{And} expressions, strings are auto-converted to L{Literal} expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes - construct character word-group expressions using the L{Word} class - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones - associate names with your parsed results using L{ParserElement.setResultsName} - find some helpful expression short-cuts like L{delimitedList} and L{oneOf} - find more useful common expressions in the L{pyparsing_common} namespace class z2.2.1z18 Sep 2018 00:49 UTCz*Paul McGuire N)ref)datetime)RLock)Iterable)MutableMapping) OrderedDictAndCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroupKeywordLineEnd LineStartLiteral MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMore alphanumsalphas alphas8bit anyCloseTag anyOpenTag cStyleCommentcolcommaSeparatedListcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOfdowncaseTokensemptyhexnums htmlCommentjavaStyleCommentlinelineEnd lineStartlineno makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence printablespunc8bitpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedStringsrange stringEnd stringStarttraceParseAction unicodeString upcaseTokens withAttribute indentedBlockoriginalTextForungroup infixNotation locatedExpr withClass CloseMatchtokenMappyparsing_commoncCsft|tr|Sz t|WStk r`t|td}td}|dd| |YSXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttry@/usr/lib/python3.8/site-packages/setuptools/_vendor/pyparsing.pyz_ustr..N) isinstanceZunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr)setParseActiontransformString)objretZ xmlcharrefryryrz_ustrs  rz6sum len sorted reversed list tuple set any all min maxccs|] }|VqdSNry).0yryryrz srcCs:d}dddD}t||D]\}}|||}q |S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nry)rsryryrzrsz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZ from_symbolsZ to_symbolsZfrom_Zto_ryryrz _xml_escapes rc@s eZdZdS) _ConstantsN)__name__ __module__ __qualname__ryryryrzrsr 0123456789Z ABCDEFabcdef\ccs|]}|tjkr|VqdSr)stringZ whitespacercryryrzrs c@sPeZdZdZdddZeddZdd Zd d Zd d Z dddZ ddZ dS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n ||_||_||_|||f|_dSNr)locmsgpstr parserElementargs)selfrrrelemryryrz__init__szParseBaseException.__init__cCs||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clsperyryrz_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text rL)r;columnrIN)rLrrr;rIAttributeError)rZanameryryrz __getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrLrrryryrz__str__szParseBaseException.__str__cCst|Srrrryryrz__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been foundNrryryryrzr%sc@s eZdZdZddZddZdS)r(zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs ||_dSrZparseElementTracerparseElementListryryrzr4sz"RecursiveGrammarException.__init__cCs d|jS)NzRecursiveGrammarException: %srrryryrzr7sz!RecursiveGrammarException.__str__N)rrrrrrryryryrzr(2sc@s,eZdZddZddZddZddZd S) _ParseResultsWithOffsetcCs||f|_dSrtup)rZp1Zp2ryryrzr;sz _ParseResultsWithOffset.__init__cCs |j|Srrriryryrz __getitem__=sz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrryryrzr?sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrryryrz setOffsetAsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrryryryrzr:src@seZdZdZd[ddZddddefddZdd Zefd d Zd d Z ddZ ddZ ddZ e Z ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName}) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 NTcCs"t||r|St|}d|_|SNT)r}object__new___ParseResults__doinit)rtoklistnameasListmodalZretobjryryrzrks   zParseResults.__new__c Csb|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t |_ |dk r^|r^|sd|j|<||t rt |}||_||t dttfr|ddgfks^||tr|g}|r(||trt|d||<ntt|dd||<|||_n6z|d||<Wn$tttfk r\|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrvrr basestringr$rcopyKeyError TypeError IndexError)rrrrrr}ryryrzrtsB     $   zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrtrcSsg|] }|dqSrryrvryryrz sz,ParseResults.__getitem__..)r}rvslicerrrr$rryryrzrs   zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_ dSr) rrgetrrvrrr$wkrefr)rkrr}subryryrz __setitem__s   " zParseResults.__setitem__c Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}||j D]>\}}|D]0}t |D]"\}\}} t || | |k||<qqxqln|j |=dSNrr) r}rvrlenrrrangeindicesreverseritems enumerater) rrZmylenZremovedr occurrencesjrvaluepositionryryrz __delitem__s  zParseResults.__delitem__cCs ||jkSr)r)rrryryrz __contains__szParseResults.__contains__cCs t|jSr)rrrryryrz__len__r|zParseResults.__len__cCs |j Srrrryryrz__bool__r|zParseResults.__bool__cCs t|jSriterrrryryrz__iter__r|zParseResults.__iter__cCst|jdddSNrtrrryryrz __reversed__r|zParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrrrrryryrz _iterkeyss  zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdSrryrrrryrzrsz+ParseResults._itervalues..rrryrrz _itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdSrryrrryrzrsz*ParseResults._iteritems..rrryrrz _iteritemsszParseResults._iteritemscCs t|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rrrryryrzkeysszParseResults.keyscCs t|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r itervaluesrryryrzvaluesszParseResults.valuescCs t|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r iteritemsrryryrzrszParseResults.itemscCs t|jS)zSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)boolrrryryrzhaskeysszParseResults.haskeyscOs|s dg}|D]*\}}|dkr0|d|f}qtd|qt|dtsdt|dksd|d|kr~|d}||}||=|S|d}|SdS)a Removes and returns item at specified index (default=C{last}). Supports both C{list} and C{dict} semantics for C{pop()}. If passed no argument or an integer argument, it will use C{list} semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use C{dict} semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in C{dict.pop()}. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] rtdefaultrz-pop() got an unexpected keyword argument '%s'rN)rrr}rvr)rrkwargsrrindexrZ defaultvalueryryrzpops""  zParseResults.popcCs||kr||S|SdS)ai Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None Nry)rkey defaultValueryryrzr3szParseResults.getcCsR|j|||jD]4\}}t|D]"\}\}}t||||k||<q(qdS)a Inserts new element at location index in the list of parsed tokens. Similar to C{list.insert()}. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N)rinsertrrrr)rr ZinsStrrrrrrryryrzrIszParseResults.insertcCs|j|dS)a Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N)rappend)ritemryryrzr]s zParseResults.appendcCs$t|tr||7}n |j|dS)a Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)r}r$rextend)rZitemseqryryrzrks  zParseResults.extendcCs|jdd=|jdS)z7 Clear all elements and results names. N)rrclearrryryrzr}s zParseResults.clearcCsjz ||WStk r YdSX||jkrb||jkrH|j|ddStdd|j|DSndSdS)NrrtrcSsg|] }|dqSrryrryryrzrsz,ParseResults.__getattr__..)rrrr$rrryryrzrs   zParseResults.__getattr__cCs|}||7}|Srr)rotherrryryrz__add__szParseResults.__add__cs|jrjt|jfdd|j}fdd|D}|D],\}}|||<t|dtr.c s4g|],\}}|D]}|t|d|dfqqSrr)rrrvlistr) addoffsetryrzrsz)ParseResults.__iadd__..r) rrrrr}r$rrrupdate)rrZ otheritemsZotherdictitemsrrry)rrrz__iadd__s     zParseResults.__iadd__cCs&t|tr|dkr|S||SdSr)r}rvrrrryryrz__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrrrryryrzrszParseResults.__repr__cCsdddd|jDdS)N[, css(|] }t|trt|nt|VqdSr)r}r$rrrrryryrzrsz'ParseResults.__str__..])rrrryryrzrszParseResults.__str__rcCsLg}|jD]<}|r |r ||t|tr8||7}q |t|q |Sr)rrr}r$ _asStringListr)rsepoutrryryrzr(s   zParseResults._asStringListcCsdd|jDS)a Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cSs"g|]}t|tr|n|qSry)r}r$r)rresryryrzrsz'ParseResults.asList..rrryryrzrszParseResults.asListcs6tr |j}n|j}fddtfdd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|] }|qSryryrtoItemryrzrsz7ParseResults.asDict..toItem..)r}r$r asDict)rr,ryrzr-s  z#ParseResults.asDict..toItemc3s|]\}}||fVqdSrryrrrr,ryrzrsz&ParseResults.asDict..)PY_3rrr)rZitem_fnryr,rzr.s  zParseResults.asDictcCs8t|j}|j|_|j|_|j|j|j|_|S)zA Returns a new copy of a C{ParseResults} object. )r$rrrrrr rrrryryrzrs   zParseResults.copyFc CsLd}g}tdd|jD}|d}|s8d}d}d}d} |dk rJ|} n |jrV|j} | sf|rbdSd} |||d| d g7}t|jD]\} } t| tr| |kr|| || |o|dk||g7}n|| d|o|dk||g7}qd} | |kr|| } | s|rqnd} t t | } |||d| d | d | d g 7}q|||d | d g7}d |S) z (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.  css(|] \}}|D]}|d|fVqqdSrNryrryryrzrsz%ParseResults.asXML.. rNZITEM<>.z %s%s- %s: r4rcss|]}t|tVqdSr)r}r$)rvvryryrzrsz %s%s[%d]: %s%s%sr) rrrr sortedrr}r$dumpranyrr) rr9depthfullr*NLrrrrr?ryryrzrAgs,    4,zParseResults.dumpcOstj|f||dS)a Pretty-printer for parsed results as a list, using the C{pprint} module. Accepts additional positional or keyword args as defined for the C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintrrrr ryryrzrFszParseResults.pprintcCs.|j|j|jdk r|p d|j|jffSr)rrrrrrrryryrz __getstate__szParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||dk rDt||_nd|_dSr)rrrrr rr)rstater=Z inAccumNamesryryrz __setstate__s   zParseResults.__setstate__cCs|j|j|j|jfSr)rrrrrryryrz__getnewargs__szParseResults.__getnewargs__cCstt|t|Sr)rrrrrryryrzrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrr}rrrrrrr __nonzero__rrrrrr0rrrrrrr rrrrrrrrr!r#rrr(rr.rr8r;r>rArFrHrJrKrryryryrzr$Dsh& ' 4  # =% - cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrr2)rrfind)rstrgrryryrzr;s cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. r2rr)count)rrNryryrzrLs cCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators. r2rrN)rMfind)rrNZlastCRZnextCRryryrzrIs  cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrLr;)instringrexprryryrz_defaultStartDebugActionsrTcCs$tdt|dt|dS)NzMatched z -> )rQrr~r)rRstartlocZendlocrStoksryryrz_defaultSuccessDebugActionsrWcCstdt|dS)NzException raised:)rQr)rRrrSexcryryrz_defaultExceptionDebugActionsrYcGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nry)rryryrzrSsrscstkrfddSdgdgtdddkrFddd}dd d n tj}tjd }|dd d }|d|d|ffdd}d}ztdtdj}Wntk rt}YnX||_|S)Ncs|Srryrlrx)funcryrzr{r|z_trim_arity..rFrs)rqcSs8tdkr dnd}tj| |dd|}|ddgS)N)rqr]rrlimitrs)system_version traceback extract_stack)rar frame_summaryryryrzrdsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nr`rtrs)rc extract_tb)tbraZframesreryryrzrfsz_trim_arity..extract_tbr`rtrc sz"|dd}dd<|WStk rdr>n4z.td}|dddddksjW5~Xdkrdd7<YqYqXqdS)NrTrtrsr`r)rrexc_info)rrrgrfZ foundArityr\ramaxargsZpa_call_line_synthryrzwrapper-s   z_trim_arity..wrapperzr __class__)r)r) singleArgBuiltinsrbrcrdrfgetattrr Exceptionr~)r\rkrdZ LINE_DIFFZ this_linerl func_nameryrjrz _trim_aritys,    rrcseZdZdZdZdZeddZeddZddd Z d d Z d d Z dddZ dddZ ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+k rGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r&z)Abstract base level parser element class.z FcCs |t_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N)r&DEFAULT_WHITE_CHARScharsryryrzsetDefaultWhitespaceCharsTs z'ParserElement.setDefaultWhitespaceCharscCs |t_dS)a Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N)r&_literalStringClass)rryryrzinlineLiteralsUsingcsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_ d|_ d|_ d|_ t|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)r parseAction failActionstrRepr resultsName saveAsListskipWhitespacer&rs whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResults debugActionsre callPreparse callDuringTry)rsavelistryryrzrxs(zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a$ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of C{expr.copy()} is just C{expr()}:: integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") N)rryrrr&rsr)rZcpyryryrzrs  zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) Expected exception)rrrrrrryryrzsetNames    zParserElement.setNamecCs4|}|dr"|dd}d}||_| |_|S)aP Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, C{expr("name")} in place of C{expr.setResultsName("name")} - see L{I{__call__}<__call__>}. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") *NrtT)rendswithr|r)rrlistAllMatchesZnewselfryryrzsetResultsNames  zParserElement.setResultsNameTcs@|r&|jdfdd }|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is about to be parsed. Set C{breakFlag} to True to enable, False to disable. Tcsddl}|||||Sr)pdbZ set_trace)rRr doActions callPreParserZ _parseMethodryrzbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr)rZ breakFlagrryrrzsetBreaks  zParserElement.setBreakcOs&tttt||_|dd|_|S)a Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] rF)rmaprrryrrrfnsr ryryrzrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}. See examples in L{I{copy}}. rF)ryrrrrrrrryryrzaddParseActionszParserElement.addParseActioncs^|dd|ddrtnt|D] fdd}|j|q$|jpV|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, functions passed to C{addCondition} need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) messagezfailed user-defined conditionfatalFcs$tt|||s ||dSr)r rrrZexc_typefnrryrzpa&sz&ParserElement.addCondition..par)rr#r!ryrr)rrr rryrrz addConditions zParserElement.addConditioncCs ||_|S)a Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments C{fn(s,loc,expr,err)} where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw C{L{ParseFatalException}} if it is desired to stop parsing immediately.)rz)rrryryrz setFailAction-s zParserElement.setFailActionc CsNd}|rJd}|jD]4}z|||\}}d}qWqtk rDYqXqq|SNTF)rrr!)rrRrZ exprsFoundeZdummyryryrz_skipIgnorables:s   zParserElement._skipIgnorablescCsH|jr|||}|jrD|j}t|}||krD|||krD|d7}q&|SNr)rrr~rr)rrRrZwtinstrlenryryrzpreParseGs  zParserElement.preParsecCs|gfSrryrrRrrryryrz parseImplSszParserElement.parseImplcCs|SrryrrRr tokenlistryryrz postParseVszParserElement.postParsec Cs|j}|s|jr|jdr,|jd||||rD|jrD|||}n|}|}zDz||||\}}Wn(tk rt|t||j |YnXWnXt k r} z:|jdr|jd|||| |jr||||| W5d} ~ XYnXn|r|jr|||}n|}|}|j s&|t|krjz||||\}}Wn*tk rft|t||j |YnXn||||\}}| |||}t ||j|j|jd} |jr|s|jr|rTzN|jD]B} | ||| }|dk rt ||j|jot|t tf|jd} qWnFt k rP} z&|jdr>|jd|||| W5d} ~ XYnXnJ|jD]B} | ||| }|dk rZt ||j|jot|t tf|jd} qZ|r|jdr|jd||||| || fS)Nrrs)rrr)rrzrrrrrr!rrrrrr$r|r}rryrr}r) rrRrrrZ debuggingprelocZ tokensStarttokenserrZ retTokensrryryrz _parseNoCacheZst             zParserElement._parseNoCachecCs@z|j||dddWStk r:t|||j|YnXdS)NF)rr)rr#r!rrrRrryryrztryParseszParserElement.tryParsec Cs4z|||Wnttfk r*YdSXdSdS)NFT)rr!rrryryrz canParseNexts zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrrcache not_in_cacheryrzrsz3ParserElement._UnboundedCache.__init__..getcs ||<dSrryrrrrryrzsetsz3ParserElement._UnboundedCache.__init__..setcs dSrrrrryrzrsz5ParserElement._UnboundedCache.__init__..clearcstSrrrrryrz cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes MethodTyperrrr)rrrrrryrrzrs    z&ParserElement._UnboundedCache.__init__Nrrrrryryryrz_UnboundedCachesrNc@seZdZddZdS)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrrryrzrs.ParserElement._FifoCache.__init__..getcs>||<tkr:zdWqtk r6YqXqdSNF)rpopitemrr)rsizeryrzrs  .ParserElement._FifoCache.__init__..setcs dSrrrrryrzrs0ParserElement._FifoCache.__init__..clearcstSrrrrryrzrs4ParserElement._FifoCache.__init__..cache_len) rr _OrderedDictrrrrrrrrrrrrry)rrrrzrs   !ParserElement._FifoCache.__init__Nrryryryrz _FifoCachesrc@seZdZddZdS)rcst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_ dS) Ncs |Srrrrryrzrsrcs4||<tkr&dq|dSr)rrpopleftrr)rkey_fiforryrzrs rcsdSrrr)rrryrzrsrcstSrrrrryrzrsr) rr collectionsdequerrrrrrrry)rrrrrzrs   rNrryryryrzrsrc Csd\}}|||||f}tjtj}||} | |jkrtj|d7<z|||||} Wn8tk r} z||| j | j W5d} ~ XYn.X||| d| d f| W5QRSn@tj|d7<t | t r| | d| d fW5QRSW5QRXdS)Nrrr)r&packrat_cache_lock packrat_cacherrpackrat_cache_statsrrrrmrrr}rp) rrRrrrZHITZMISSlookuprrrryryrz _parseCaches$   zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r&rrrrryryryrz resetCaches zParserElement.resetCachecCs8tjs4dt_|dkr tt_n t|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default=C{128}) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method C{ParserElement.enablePackrat()}. If your program uses C{psyco} to "compile as you go", you must call C{enablePackrat} before calling C{psyco.full()}. If you do not do this, Python will crash. For best results, call C{enablePackrat()} immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enablePackrat() TN)r&_packratEnabledrrrrr)Zcache_size_limitryryrz enablePackrat%s   zParserElement.enablePackratc Cst|js||jD] }|q|js8|}z<||d\}}|rr|||}t t }|||Wn0t k r}ztj rn|W5d}~XYnX|SdS)aB Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. If you want the grammar to require that the entire input string be successfully parsed, then set C{parseAll} to True (equivalent to ending the grammar with C{L{StringEnd()}}). Note: C{parseString} implicitly calls C{expandtabs()} on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the C{loc} argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling C{parseWithTabs} on your grammar before calling C{parseString} (see L{I{parseWithTabs}}) - define your parse action using the full C{(s,loc,toks)} signature, and reference the input string using the parse action's C{s} argument - explictly expand the tabs in your input string before calling C{parseString} Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text rN) r&rr streamlinerr expandtabsrrrr+rverbose_stacktrace)rrRparseAllrrrZserXryryrz parseStringHs$    zParserElement.parseStringc cs6|js||jD] }|q|js4t|}t|}d}|j}|j}t d} z||kr| |krz |||} ||| dd\} } Wnt k r| d}YqZX| |kr| d7} | | | fV|r|||} | |kr| }q|d7}q| }qZ| d}qZWn4t k r0}zt j rn|W5d}~XYnXdS)a Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See L{I{parseString}} for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rFrrN)rrrrrrrrrr&rr!rr)rrR maxMatchesZoverlaprrrZ preparseFnZparseFnmatchesrZnextLocrZnextlocrXryryrz scanStringzsB       zParserElement.scanStringc Csg}d}d|_z||D]Z\}}}|||||rpt|trR||7}nt|trf||7}n |||}q|||ddd|D}dtt t |WSt k r}zt j rƂn|W5d}~XYnXdS)af Extension to C{L{scanString}}, to modify matching text with modified tokens that may be returned from a parse action. To use C{transformString}, define a grammar and attach a parse action to it that modifies the returned token list. Invoking C{transformString()} on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. C{transformString()} returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) Prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTNcSsg|] }|r|qSryry)roryryrzrsz1ParserElement.transformString..r)rrrr}r$rrrrr_flattenrr&r)rrRr*ZlastErxrrrXryryrzrs(    zParserElement.transformStringc CsRztdd|||DWStk rL}ztjr8n|W5d}~XYnXdS)a Another extension to C{L{scanString}}, simplifying the access to the tokens found to match the given parse expression. May be called with optional C{maxMatches} argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] cSsg|]\}}}|qSryry)rrxrrryryrzrsz.ParserElement.searchString..N)r$rrr&r)rrRrrXryryrz searchStrings zParserElement.searchStringc csTd}d}|j||dD]*\}}}|||V|r<|dV|}q||dVdS)a[ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)rN)r) rrRmaxsplitZincludeSeparatorsZsplitsZlastrxrrryryrzrs  zParserElement.splitcCsFt|trt|}t|ts:tjdt|tdddSt||gS)a Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement converts them to L{Literal}s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) Prints:: Hello, World! -> ['Hello', ',', 'World', '!'] 4Cannot combine element of type %s with ParserElementrs stacklevelN) r}rr&rwwarningswarnr SyntaxWarningrr"ryryrzrs   zParserElement.__add__cCsBt|trt|}t|ts:tjdt|tdddS||S)z] Implementation of + operator when left operand is not a C{L{ParserElement}} rrsrNr}rr&rwrrrrr"ryryrzr#1s   zParserElement.__radd__cCsJt|trt|}t|ts:tjdt|tdddS|t |S)zQ Implementation of - operator, returns C{L{And}} with error stop rrsrN) r}rr&rwrrrrr _ErrorStopr"ryryrz__sub__=s   zParserElement.__sub__cCsBt|trt|}t|ts:tjdt|tdddS||S)z] Implementation of - operator when left operand is not a C{L{ParserElement}} rrsrNrr"ryryrz__rsub__Is   zParserElement.__rsub__cst|tr|d}}nt|tr|ddd}|ddkrHd|df}t|dtr|ddkr|ddkrvtS|ddkrtS|dtSqt|dtrt|dtr|\}}||8}qtdt|dt|dntdt||dkr td|dkrtd ||kr6dkrBnntd |rfd d |r|dkrt|}ntg||}n|}n|dkr}ntg|}|S) a Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is equivalent to C{expr*n + L{ZeroOrMore}(expr)} (read as "at least n instances of C{expr}") - C{expr*(None,n)} is equivalent to C{expr*(0,n)} (read as "0 to n instances of C{expr}") - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} Note that C{expr*(None,n)} does not raise an exception if more than n exprs exist in the input stream; that is, C{expr*(None,n)} does not enforce a maximum number of expr occurrences. If this behavior is desired, then write C{expr*(None,n) + ~expr} r)NNNrsrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdSr)rnmakeOptionalListrryrzrsz/ParserElement.__mul__..makeOptionalList) r}rvtupler4rrr ValueErrorr)rrZ minElementsZ optElementsrryrrz__mul__UsD             zParserElement.__mul__cCs ||Sr)rr"ryryrz__rmul__szParserElement.__rmul__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zI Implementation of | operator - returns C{L{MatchFirst}} rrsrN) r}rr&rwrrrrrr"ryryrz__or__s   zParserElement.__or__cCsBt|trt|}t|ts:tjdt|tdddS||BS)z] Implementation of | operator when left operand is not a C{L{ParserElement}} rrsrNrr"ryryrz__ror__s   zParserElement.__ror__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zA Implementation of ^ operator - returns C{L{Or}} rrsrN) r}rr&rwrrrrrr"ryryrz__xor__s   zParserElement.__xor__cCsBt|trt|}t|ts:tjdt|tdddS||AS)z] Implementation of ^ operator when left operand is not a C{L{ParserElement}} rrsrNrr"ryryrz__rxor__s   zParserElement.__rxor__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zC Implementation of & operator - returns C{L{Each}} rrsrN) r}rr&rwrrrrrr"ryryrz__and__s   zParserElement.__and__cCsBt|trt|}t|ts:tjdt|tdddS||@S)z] Implementation of & operator when left operand is not a C{L{ParserElement}} rrsrNrr"ryryrz__rand__s   zParserElement.__rand__cCst|S)zE Implementation of ~ operator - returns C{L{NotAny}} )rrryryrz __invert__szParserElement.__invert__cCs|dk r||S|SdS)a  Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be passed as C{True}. If C{name} is omitted, same as calling C{L{copy}}. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") N)rrrryryrz__call__s zParserElement.__call__cCst|S)z Suppresses the output of this C{ParserElement}; useful to keep punctuation from cluttering up returned output. )r-rryryrzsuppressszParserElement.suppresscCs d|_|S)a Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. Fr~rryryrzleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8 Overrides the default whitespace chars TF)r~rr)rruryryrzsetWhitespaceChars sz ParserElement.setWhitespaceCharscCs d|_|S)z Overrides default behavior to expand C{}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{} characters. T)rrryryrz parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|j|n|jt||S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] )r}rr-rrrr"ryryrzignores   zParserElement.ignorecCs"|pt|p t|ptf|_d|_|S)zT Enable display of debugging messages while doing pattern matching. T)rTrWrYrr)rZ startActionZ successActionZexceptionActionryryrzsetDebugActions6s zParserElement.setDebugActionscCs|r|tttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set C{flag} to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using L{setDebugActions}. Prior to attempting to match the C{wd} expression, the debugging message C{"Match at loc (,)"} is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. F)rrTrWrYr)rflagryryrzsetDebug@s#zParserElement.setDebugcCs|jSr)rrryryrzriszParserElement.__str__cCst|SrrrryryrzrlszParserElement.__repr__cCsd|_d|_|Sr)rr{rryryrzroszParserElement.streamlinecCsdSrryrryryrzcheckRecursiontszParserElement.checkRecursioncCs|gdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)r)r validateTraceryryrzvalidatewszParserElement.validatec Csz |}Wn2tk r>t|d}|}W5QRXYnXz|||WStk r~}ztjrjn|W5d}~XYnXdS)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rN)readropenrrr&r)rZfile_or_filenamerZ file_contentsfrXryryrz parseFile}s  zParserElement.parseFilecsHt|tr"||kp t|t|kSt|tr6||Stt||kSdSr)r}r&varsrrsuperr"rmryrz__eq__s    zParserElement.__eq__cCs ||k Srryr"ryryrz__ne__szParserElement.__ne__cCs tt|Sr)hashidrryryrz__hash__szParserElement.__hash__cCs||kSrryr"ryryrz__req__szParserElement.__req__cCs ||k Srryr"ryryrz__rne__szParserElement.__rne__cCs4z|jt||dWdStk r.YdSXdS)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests Example:: expr = Word(nums) assert expr.matches("100") rTFN)rrr)rZ testStringrryryrzrs zParserElement.matches#c Cst|tr"tttj|}t|tr4t|}g}g}d} |D]} |dk r^| | dsf|rr| sr| | qD| sxqDd || g} g}z:| dd} |j | |d} | | j|d| o| } Wntk rr} zt| trdnd }d| kr*| t| j| | d t| j| d d |n| d | jd || d t| | o\|} | } W5d} ~ XYnDtk r}z$| dt|| o|} |} W5d}~XYnX|r|r| d td | | | | fqD| |fS)a3 Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - comment - (default=C{'#'}) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default=C{True}) prints test output to stdout - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if C{failureTests} is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) TNFr2\nr%)rDz(FATAL)r r^zFAIL: zFAIL-EXCEPTION: )r}rrrr~rrstrip splitlinesrrrrrrrArr#rIrr;rprQ)rZtestsrZcommentZfullDumpZ printResultsZ failureTestsZ allResultsZcommentssuccessrxr*resultrrrXryryrzrunTestssNW      $   zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)Tr&TTF)Orrrrrsr staticmethodrvrxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr_MAX_INTrrrrrr#rrrrrrrrrrrr r r r rrrrrrrrrrrrr"r#r$rr. __classcell__ryryrrzr&Os     &     G   " 2G+    D           )    cs eZdZdZfddZZS)r.zT Abstract C{ParserElement} subclass, for defining atomic matching patterns. cstt|jdddSNFr)rr.rrrryrzr@ szToken.__init__rrrrrr1ryryrrzr.< scs eZdZdZfddZZS)rz, An empty token, will always match. cs$tt|d|_d|_d|_dS)NrTF)rrrrrrrrryrzrH szEmpty.__init__r4ryryrrzrD scs*eZdZdZfddZdddZZS)rz( A token that will never match. cs*tt|d|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrrrrrrryrzrS s zNoMatch.__init__TcCst|||j|dSr)r!rrryryrzrZ szNoMatch.parseImpl)Trrrrrrr1ryryrrzrO s cs*eZdZdZfddZdddZZS)ra Token to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use L{CaselessLiteral}. For keyword matching (force word break before and after the matched string), use L{Keyword} or L{CaselessKeyword}. cstt|||_t||_z|d|_Wn*tk rVtj dt ddt |_ YnXdt |j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrsr"%s"rF)rrrmatchrmatchLenfirstMatchCharrrrrrrmrrrrrr matchStringrryrzrl s   zLiteral.__init__TcCsJ|||jkr6|jdks&||j|r6||j|jfSt|||j|dSr)r9r8 startswithr7r!rrryryrzr s zLiteral.parseImpl)Tr5ryryrrzr^ s csLeZdZdZedZdfdd Zddd Zfd d Ze d d Z Z S)ra\ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with C{L{Literal}}: - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} Accepts two optional constructor arguments in addition to the keyword string: - C{identChars} is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - C{caseless} allows case-insensitive matching, default is C{False}. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use L{CaselessKeyword}. _$NFcstt||dkrtj}||_t||_z|d|_Wn$tk r^t j dt ddYnXd|j|_ d|j |_ d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrsrr6rF)rrrDEFAULT_KEYWORD_CHARSr7rr8r9rrrrrrrrcaselessupper caselessmatchr identChars)rr;rBr?rryrzr s*     zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jkr|dksj||d|jkr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt |||j |dSr) r?r8r@rArrBr7r9r<r!rrryryrzr s4 zKeyword.parseImplcstt|}tj|_|Sr)rrrr>rB)rrrryrzr sz Keyword.copycCs |t_dS)z,Overrides the default Keyword chars N)rr>rtryryrzsetDefaultKeywordChars szKeyword.setDefaultKeywordChars)NF)T) rrrrr5r>rrrr/rCr1ryryrrzr s  cs*eZdZdZfddZdddZZS)r al Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for L{CaselessKeyword}.) cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rr rr@ returnStringrrr:rryrzr s zCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dSr)r8r@r7rDr!rrryryrzr szCaselessLiteral.parseImpl)Tr5ryryrrzr s cs,eZdZdZdfdd Zd ddZZS) r z Caseless version of L{Keyword}. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for L{CaselessLiteral}.) Ncstt|j||dddS)NTr?)rr r)rr;rBrryrzr szCaselessKeyword.__init__TcCsj||||j|jkrV|t||jksF|||j|jkrV||j|jfSt|||j|dSr)r8r@rArrBr7r!rrryryrzr szCaselessKeyword.parseImpl)N)Tr5ryryrrzr scs,eZdZdZdfdd Zd ddZZS) rnax A variation on L{Literal} which matches "close" matches, that is, strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - C{match_string} - string to be matched - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - C{mismatches} - a list of the positions within the match_string where mismatches were found - C{original} - the original match_string used to compare against the input string If C{mismatches} is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F) rrnrr match_string maxMismatchesrrr)rrFrGrryrzr szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g} |j} tt||||jD]2\}} | \} } | | krN| |t| | krNqqN|d}t|||g}|j|d<| |d<||fSt|||j|dS)Nrroriginal mismatches) rrFrGrrrr$r!r)rrRrrstartrmaxlocrFZmatch_stringlocrIrGZs_msrcmatresultsryryrzr s(    zCloseMatch.parseImpl)r)Tr5ryryrrzrn s cs8eZdZdZd fdd Zdd d Zfd d ZZS)r1a Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. An optional C{excludeChars} parameter can list characters that might be found in the input C{bodyChars} string; useful to define a word of all printables except for one or two characters, for instance. L{srange} is useful for defining custom character set strings for defining C{Word} expressions, using range notation from regular expression character sets. A common mistake is to use C{Word} to match a specific literal string, as in C{Word("Address")}. Remember that C{Word} uses the string argument to define I{sets} of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use L{Literal} or L{Keyword}. pyparsing includes helper strings for building Words: - L{alphas} - L{nums} - L{alphanums} - L{hexnums} - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - L{printables} (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") NrrFcstt|rFdfdd|D}|rFdfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_ |dkrt d||_ |dkr||_ nt |_ |dkr||_ ||_ t||_d|j|_d |_||_d |j|jkr|dkr|dkr|dkr|j|jkr8d t|j|_nHt|jdkrfd t|jt|jf|_nd t|jt|jf|_|jrd|jd|_zt|j|_Wntk rd|_YnXdS)Nrc3s|]}|kr|VqdSrryr excludeCharsryrzr` sz Word.__init__..c3s|]}|kr|VqdSrryrrOryrzrb srrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFr(z[%s]+z%s[%s]*z [%s][%s]*z\b)rr1rr initCharsOrigr initChars bodyCharsOrig bodyChars maxSpecifiedrminLenmaxLenr0rrrr asKeyword_escapeRegexRangeCharsreStringrrescapecompilerp)rrRrTminmaxexactrXrPrrOrzr] s\      0 z Word.__init__Tc Cs>|jr<|j||}|s(t|||j||}||fS|||jkrZt|||j||}|d7}t|}|j}||j }t ||}||kr|||kr|d7}qd} |||j krd} |j r||kr|||krd} |j r|dkr||d|ks||kr|||krd} | r.t|||j|||||fS)NrFTr)rr7r!rendgrouprRrrTrWr]rVrUrX) rrRrrr-rJrZ bodycharsrKZthrowExceptionryryrzr s6    2zWord.parseImplcsvztt|WStk r$YnX|jdkrpdd}|j|jkr`d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)N...rrryryrz charsAsStr s z Word.__str__..charsAsStrz W:(%s,%s)zW:(%s))rr1rrpr{rQrS)rrerryrzr s  z Word.__str__)NrrrFN)Trrrrrrrr1ryryrrzr1. s.6 #csFeZdZdZeedZd fdd Zd ddZ fd d Z Z S) r)a Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module. If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") z[A-Z]rcstt|t|tr|s,tjdtdd||_||_ zt |j|j |_ |j|_ Wqt jk rtjd|tddYqXn2t|tjr||_ t||_|_ ||_ ntdt||_d|j|_d|_d|_d S) zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrsr$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rr)rr}rrrrpatternflagsrr\rZ sre_constantserrorcompiledREtyper~rrrrrr)rrhrirryrzr s:       zRegex.__init__TcCs`|j||}|s"t|||j||}|}t|}|rX|D]}||||<qF||fSr)rr7r!rr` groupdictr$ra)rrRrrr-drrryryrzr s zRegex.parseImplcsFztt|WStk r$YnX|jdkr@dt|j|_|jS)NzRe:(%s))rr)rrpr{rrhrrryrzr s z Regex.__str__)r)T) rrrrrrr\rlrrrr1ryryrrzr) s  " cs8eZdZdZd fdd Zd ddZfd d ZZS) r'a Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=C{None}) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] NFTc sNtt|}|s0tjdtddt|dkr>|}n"|}|s`tjdtddt|_t |_ |d_ |_ t |_ |_|_|_|_|rtjtjB_dtjtj d|dk rt|pdf_n.rt)z|(?:%s)z|(?:%s.)z(.)z)*%srgrFT)%rr'rrrrr SyntaxError quoteCharr quoteCharLenfirstQuoteCharroendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr MULTILINEDOTALLrir[rYrhrrescCharReplacePatternr\rZrjrkrrrrr)rrrrvrwZ multilinerxroryrrrzr/ s|           zQuotedString.__init__c Cs|||jkr|j||pd}|s4t|||j||}|}|jr||j|j }t |t rd|kr|j rddddd}| D]\}}|||}q|jrt|jd|}|jr||j|j}||fS)N\ r2  )\tr'z\fz\rz\g<1>)rtrr7r!rr`rarxrsrur}rryrrrvrr|rwro) rrRrrr-rZws_mapZwslitZwscharryryrzrp s*  zQuotedString.parseImplcsHztt|WStk r$YnX|jdkrBd|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr'rrpr{rrrorrryrzr s zQuotedString.__str__)NNFTNT)Trfryryrrzr' sA #cs8eZdZdZd fdd Zd ddZfd d ZZS) r a Token for matching words composed of characters I{not} in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t ||_ d|j |_ |jdk|_ d|_ dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rr rr~notCharsrrVrWr0rrrrr)rrr]r^r_rryrzr s    zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}||krb|||krb|d7}qD|||jkrt|||j|||||fSr)rr!rr]rWrrV)rrRrrrJZnotcharsmaxlenryryrzr s  zCharsNotIn.parseImplcsfztt|WStk r$YnX|jdkr`t|jdkrTd|jdd|_n d|j|_|jS)Nrbz !W:(%s...)z!W:(%s))rr rrpr{rrrrryrzr s  zCharsNotIn.__str__)rrr)Trfryryrrzr s cs<eZdZdZddddddZdfd d ZdddZZS)r0a Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is C{" \t\r\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, as defined for the C{L{Word}} class. zzzzz)r(r~r2rr rrcstt|_dfddjDdddjD_d_dj_ |_ |dkrt|_ nt _ |dkr|_ |_ dS)Nrc3s|]}|jkr|VqdSr) matchWhiterrryrzr s z!White.__init__..css|]}tj|VqdSr)r0 whiteStrsrryryrzr sTrr) rr0rrr rrrrrrVrWr0)rZwsr]r^r_rrrzr s  zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}||krb|||jkrb|d7}qB|||jkrt|||j|||||fSr)rr!rrWr]rrV)rrRrrrJrKryryrzr s  zWhite.parseImpl)rrrr)T)rrrrrrrr1ryryrrzr0 scseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rrrrmrrrrrrryrzr s z_PositionToken.__init__rrrrr1ryryrrzr srcs2eZdZdZfddZddZd ddZZS) rzb Token to advance to a specific column of input text; useful for tabular report scraping. cstt|||_dSr)rrrr;)rcolnorryrzr$ szGoToColumn.__init__cCs\t|||jkrXt|}|jr*|||}||krX||rXt|||jkrX|d7}q*|Sr)r;rrrisspace)rrRrrryryrzr( s $ zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected columnr;r!)rrRrrZthiscolZnewlocrryryrzr1 s    zGoToColumn.parseImpl)T)rrrrrrrr1ryryrrzr s  cs*eZdZdZfddZdddZZS)ra Matches if current position is at the beginning of a line within the parse string Example:: test = ''' AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) Prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cstt|d|_dS)NzExpected start of line)rrrrrrryrzrO szLineStart.__init__TcCs*t||dkr|gfSt|||j|dSr)r;r!rrryryrzrS szLineStart.parseImpl)Tr5ryryrrzr: s cs*eZdZdZfddZdddZZS)rzU Matches if current position is at the end of a line within the parse string cs,tt||tjddd|_dS)Nr2rzExpected end of line)rrrr r&rsrrrrryrzr\ szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nr2rrr!rrryryrzra s     zLineEnd.parseImpl)Tr5ryryrrzrX s cs*eZdZdZfddZdddZZS)r,zM Matches if current position is at the beginning of the parse string cstt|d|_dS)NzExpected start of text)rr,rrrrryrzrp szStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfSr)rr!rrryryrzrt szStringStart.parseImpl)Tr5ryryrrzr,l s cs*eZdZdZfddZdddZZS)r+zG Matches if current position is at the end of the parse string cstt|d|_dS)NzExpected end of text)rr+rrrrryrzr szStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dSrrrryryrzr s    zStringEnd.parseImpl)Tr5ryryrrzr+{ s cs.eZdZdZeffdd ZdddZZS)r3ap Matches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of the string being parsed, or at the beginning of a line. cs"tt|t||_d|_dS)NzNot at the start of a word)rr3rr wordCharsrrrrryrzr s zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfSr)rr!rrryryrzr s  zWordStart.parseImpl)TrrrrrXrrr1ryryrrzr3 scs.eZdZdZeffdd ZdddZZS)r2aZ Matches if the current position is at the end of a Word, and is not followed by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of the string being parsed, or at the end of a line. cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rr2rrrr~rrrryrzr s zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfSr)rrr!r)rrRrrrryryrzr szWordEnd.parseImpl)Trryryrrzr2 scseZdZdZdfdd ZddZddZd d Zfd d Zfd dZ fddZ dfdd Z gfddZ fddZ ZS)r"z^ Abstract subclass of ParserElement, for combining and post-processing parsed tokens. Fcstt||t|tr"t|}t|tr.F)rr"rr}rrrr&rwexprsrallrrrrrrrryrzr s     zParseExpression.__init__cCs |j|Sr)rrryryrzr szParseExpression.__getitem__cCs|j|d|_|Sr)rrr{r"ryryrzr s zParseExpression.appendcCs0d|_dd|jD|_|jD] }|q|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on all contained expressions.FcSsg|] }|qSryrrrryryrzr sz3ParseExpression.leaveWhitespace..)r~rr )rrryryrzr  s   zParseExpression.leaveWhitespacecsrt|trB||jkrntt|||jD]}||jdq*n,tt|||jD]}||jdqX|Sr)r}r-rrr"rr)rrrrryrzr s    zParseExpression.ignorecsNztt|WStk r$YnX|jdkrHd|jjt|jf|_|jSNz%s:(%s)) rr"rrpr{rmrrrrrryrzr s zParseExpression.__str__cs*tt||jD] }|qt|jdkr|jd}t||jr|js|jdkr|j s|jdd|jdg|_d|_ |j |j O_ |j |j O_ |jd}t||jr|js|jdkr|j s|jdd|jdd|_d|_ |j |j O_ |j |j O_ dt ||_|S)Nrsrrrtr)rr"rrrr}rmryr|rr{rrrr)rrrrryrzr s<     zParseExpression.streamlinecstt|||}|Sr)rr"r)rrrrrryrzr szParseExpression.setResultsNamecCs6|dd|g}|jD]}||q|gdSr)rrr)rrtmprryryrzr s  zParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|] }|qSryrrryryrzr% sz(ParseExpression.copy..)rr"rrr1rryrzr# szParseExpression.copy)F)F)rrrrrrrr rrrrrrr1ryryrrzr" s " csTeZdZdZGdddeZdfdd ZdddZd d Zd d Z d dZ Z S)ra  Requires all given C{ParseExpression}s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the C{'+'} operator. May also be constructed using the C{'-'} operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"),name_expr("name"),integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|dS)N-)rrrrrr rGrryrzr9 szAnd._ErrorStop.__init__rryryrrzr8 srTcsRtt|||tdd|jD|_||jdj|jdj|_d|_ dS)Ncss|] }|jVqdSrrrryryrzr@ szAnd.__init__..rT) rrrrrrr rr~rrrryrzr> s z And.__init__c Cs|jdj|||dd\}}d}|jddD]}t|tjrDd}q.|rz||||\}}Wqtk rtYqtk r}zd|_t|W5d}~XYqt k rt|t ||j |YqXn||||\}}|s| r.||7}q.||fS)NrFrrT) rrr}rrr%r __traceback__rrrrr ) rrRrr resultlistZ errorStoprZ exprtokensrryryrzrE s(   z And.parseImplcCst|trt|}||Srr}rr&rwrr"ryryrzr!^ s  z And.__iadd__cCs6|dd|g}|jD]}|||jsq2qdSr)rrrrrsubRecCheckListrryryrzrc s   zAnd.checkRecursioncCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nr{r(css|]}t|VqdSrrrryryrzro szAnd.__str__..}rrr{rrrryryrzrj s    z And.__str__)T)T) rrrrrrrrr!rrr1ryryrrzr( s csDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the C{'^'} operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrryryrzr szOr.__init__..T)rrrrrBrrrryrzr sz Or.__init__Tc CsRd}d}g}|jD]}z|||}Wnvtk rb} zd| _| j|krR| }| j}W5d} ~ XYqtk rt||krt|t||j|}t|}YqX|||fq|r(|j ddd|D]^\} }z| |||WStk r$} z d| _| j|kr| }| j}W5d} ~ XYqXq|dk r@|j|_ |nt||d|dS)NrtcSs |d Srry)xryryrzr{ r|zOr.parseImpl..)r no defined alternatives to match) rrr!rrrrrrsortrr) rrRrr maxExcLoc maxExceptionrrZloc2r_ryryrzr s<      z Or.parseImplcCst|trt|}||Srrr"ryryrz__ixor__ s  z Or.__ixor__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdSrrrryryrzr szOr.__str__..rrrryryrzr s    z Or.__str__cCs,|dd|g}|jD]}||qdSrrrrryryrzr s zOr.checkRecursion)F)T) rrrrrrrrrr1ryryrrzrt s   & csDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrryryrzr sz&MatchFirst.__init__..T)rrrrrBrrrryrzr szMatchFirst.__init__Tc Csd}d}|jD]}z||||}|WStk r`}z|j|krP|}|j}W5d}~XYqtk rt||krt|t||j|}t|}YqXq|dk r|j|_|nt||d|dS)Nrtr)rrr!rrrrr) rrRrrrrrrrryryrzr s$    zMatchFirst.parseImplcCst|trt|}||Srrr"ryryrz__ior__ s  zMatchFirst.__ior__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrr | css|]}t|VqdSrrrryryrzr sz%MatchFirst.__str__..rrrryryrzr s    zMatchFirst.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzrs zMatchFirst.checkRecursion)F)T) rrrrrrrrrr1ryryrrzr s   cs<eZdZdZd fdd Zd ddZddZd d ZZS) ram Requires all given C{ParseExpression}s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the C{'&'} operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Tcs8tt|||tdd|jD|_d|_d|_dS)Ncss|] }|jVqdSrrrryryrzr?sz Each.__init__..T)rrrrrrr~initExprGroupsrrryrzr=sz Each.__init__c s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d |_|}|jdd}|jddg}d } | rj||j|j} g} | D]v} z| ||}Wn t k r| | YqX| |j t | | | |kr@| | q| kr܈ | qt| t| krd } q|rd d d|D} t ||d | |fdd|jD7}g}|D]"} | |||\}}| |qt|tg}||fS)Ncss&|]}t|trt|j|fVqdSr)r}rr!rSrryryrzrEs z!Each.parseImpl..cSsg|]}t|tr|jqSryr}rrSrryryrzrFs z"Each.parseImpl..cSs g|]}|jrt|ts|qSry)rr}rrryryrzrGs cSsg|]}t|tr|jqSry)r}r4rSrryryrzrIs cSsg|]}t|tr|jqSry)r}rrSrryryrzrJs cSs g|]}t|tttfs|qSry)r}rr4rrryryrzrKsFTr%css|]}t|VqdSrrrryryrzrfsz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSryrrZtmpOptryrzrjs )rrrZopt1mapZ optionalsZmultioptionalsZ multirequiredZrequiredrr!rrr!removerrrsumr$)rrRrrZopt1Zopt2ZtmpLocZtmpReqdZ matchOrderZ keepMatchingZtmpExprsZfailedrZmissingrrNZ finalResultsryrrzrCsP    zEach.parseImplcCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz & css|]}t|VqdSrrrryryrzryszEach.__str__..rrrryryrzrts    z Each.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzr}s zEach.checkRecursion)T)T) rrrrrrrrr1ryryrrzrs 5 1 csleZdZdZdfdd ZdddZdd Zfd d Zfd d ZddZ gfddZ fddZ Z S)r za Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. Fcstt||t|tr@ttjtr2t|}ntt |}||_ d|_ |dk r|j |_ |j |_ ||j|j|_|j|_|j|_|j|jdSr)rr rr}r issubclassr&rwr.rrSr{rrr rr~r}rrrrrSrrryrzrs    zParseElementEnhance.__init__TcCs2|jdk r|jj|||ddStd||j|dS)NFrr)rSrr!rrryryrzrs zParseElementEnhance.parseImplcCs*d|_|j|_|jdk r&|j|Sr)r~rSrr rryryrzr s    z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|||jdk rn|j|jdn,tt|||jdk rn|j|jd|Sr)r}r-rrr rrSr"rryrzrs    zParseElementEnhance.ignorecs&tt||jdk r"|j|Sr)rr rrSrrryrzrs  zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk r>|j|dSr)r(rSr)rrrryryrzrs  z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdk r(|j||gdSrrSrrrrrryryrzrs  zParseElementEnhance.validatecsXztt|WStk r$YnX|jdkrR|jdk rRd|jjt|jf|_|jSr) rr rrpr{rSrmrrrrryrzrszParseElementEnhance.__str__)F)T) rrrrrrr rrrrrr1ryryrrzr s   cs*eZdZdZfddZdddZZS)ra Lookahead matching of the given parse expression. C{FollowedBy} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. C{FollowedBy} always returns a null token list. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cstt||d|_dSr)rrrrrrSrryrzrszFollowedBy.__init__TcCs|j|||gfSr)rSrrryryrzrszFollowedBy.parseImpl)Tr5ryryrrzrs cs2eZdZdZfddZd ddZddZZS) ra Lookahead to disallow matching with the given parse expression. C{NotAny} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression does I{not} match at the current position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} always returns a null token list. May be constructed using the '~' operator. Example:: cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrr~rrrSrrrryrzrszNotAny.__init__TcCs&|j||rt|||j||gfSr)rSrr!rrryryrzrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{rrrr{rrSrryryrzrs   zNotAny.__str__)Trfryryrrzrs  cs(eZdZdfdd ZdddZZS) _MultipleMatchNcsFtt||d|_|}t|tr.t|}|dk r<|nd|_dSr) rrrr}r}rr&rw not_ender)rrSstopOnZenderrryrzr s   z_MultipleMatch.__init__Tc Cs|jj}|j}|jdk }|r$|jj}|r2|||||||dd\}}zV|j } |r`|||| rp|||} n|} ||| |\}} | s| rR|| 7}qRWnttfk rYnX||fSNFr) rSrrrrrr r!r) rrRrrZself_expr_parseZself_skip_ignorablesZ check_enderZ try_not_enderrZhasIgnoreExprsrZ tmptokensryryrzrs*      z_MultipleMatch.parseImpl)N)T)rrrrrr1ryryrrzr src@seZdZdZddZdS)ra Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz}...rrryryrzrJs   zOneOrMore.__str__N)rrrrrryryryrzr0scs8eZdZdZd fdd Zd fdd Zdd ZZS) r4aw Optional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to L{OneOrMore} Ncstt|j||dd|_dS)N)rT)rr4rr)rrSrrryrzr_szZeroOrMore.__init__Tc s<ztt||||WSttfk r6|gfYSXdSr)rr4rr!rrrryrzrcszZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr$]...rrryryrzris   zZeroOrMore.__str__)N)Trfryryrrzr4Ss c@s eZdZddZeZddZdS) _NullTokencCsdSrryrryryrzrssz_NullToken.__bool__cCsdSrryrryryrzrvsz_NullToken.__str__N)rrrrrLrryryryrzrrsrcs6eZdZdZeffdd Zd ddZddZZS) raa Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cs.tt|j|dd|jj|_||_d|_dS)NFr3T)rrrrSr}rr)rrSr rryrzrs zOptional.__init__Tc Cszz|jj|||dd\}}WnTttfk rp|jtk rh|jjr^t|jg}|j||jj<ql|jg}ng}YnX||fSr)rSrr!rr_optionalNotMatchedr|r$)rrRrrrryryrzrs    zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr$r'rrryryrzrs   zOptional.__str__)T) rrrrrrrrr1ryryrrzrzs" cs,eZdZdZd fdd Zd ddZZS) r*a Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default=C{False}) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default=C{None}) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default=C{None}) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor FNcs`tt||||_d|_d|_||_d|_t|t rFt ||_ n||_ dt |j|_dS)NTFzNo match found for )rr*r ignoreExprrr includeMatchrr}rr&rwfailOnrrSr)rrZincluderrrryrzrs zSkipTo.__init__Tc Cs&|}t|}|j}|jj}|jdk r,|jjnd}|jdk rB|jjnd} |} | |kr|dk rf||| rfq| dk rz| || } Wqntk rYqYqnXqnz||| dddWqtt fk r| d7} YqJXqqJt|||j || }|||} t | } |j r||||dd\}} | | 7} || fS)NF)rrrr) rrSrrrrrrr!rrr$r)rrRrrrUrrSZ expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ skipresultrMryryrzrs:   zSkipTo.parseImpl)FNN)Tr5ryryrrzr*s6 csbeZdZdZdfdd ZddZddZd d Zd d Zgfd dZ ddZ fddZ Z S)raK Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator. Note: take care when assigning to C{Forward} not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the C{Forward}:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See L{ParseResults.pprint} for an example of a recursive parser created using C{Forward}. Ncstt|j|dddSr2)rrrr"rryrzr@szForward.__init__cCsjt|trt|}||_d|_|jj|_|jj|_||jj |jj |_ |jj |_ |j |jj |Sr)r}rr&rwrSr{rrr rr~r}rrr"ryryrz __lshift__Cs      zForward.__lshift__cCs||>Srryr"ryryrz __ilshift__PszForward.__ilshift__cCs d|_|Srr rryryrzr SszForward.leaveWhitespacecCs$|js d|_|jdk r |j|Sr)rrSrrryryrzrWs   zForward.streamlinecCs>||kr0|dd|g}|jdk r0|j||gdSrrrryryrzr^s   zForward.validatecCsVt|dr|jS|jjdSz|jdk r4t|j}nd}W5|j|_X|jjd|S)Nrz: ...Nonez: )rrrmrZ _revertClass_ForwardNoRecurserSr)rZ retStringryryrzres     zForward.__str__cs.|jdk rtt|St}||K}|SdSr)rSrrrr1rryrzrvs  z Forward.copy)N) rrrrrrrr rrrrr1ryryrrzr-s  c@seZdZddZdS)rcCsdS)Nrcryrryryrzrsz_ForwardNoRecurse.__str__N)rrrrryryryrzr~srcs"eZdZdZdfdd ZZS)r/zQ Abstract subclass of C{ParseExpression}, for converting parsed results. Fcstt||d|_dSr)rr/rr}rrryrzrszTokenConverter.__init__)Fr4ryryrrzr/scs6eZdZdZd fdd ZfddZdd ZZS) r a Converter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying C{'adjacent=False'} in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) rTcs8tt|||r|||_d|_||_d|_dSr)rr rr adjacentr~ joinStringr)rrSrrrryrzrszCombine.__init__cs(|jrt||ntt|||Sr)rr&rrr r"rryrzrszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rr$rr(rrr|r )rrRrrZretToksryryrzrs  "zCombine.postParse)rT)rrrrrrrr1ryryrrzr s cs(eZdZdZfddZddZZS)ra Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a,b,100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a,b,100")) # -> ['fn', ['a', 'b', '100']] cstt||d|_dSr)rrrr}rrryrzrszGroup.__init__cCs|gSrryrryryrzrszGroup.postParserrrrrrr1ryryrrzrs cs(eZdZdZfddZddZZS)r aW Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at L{ParseResults} of accessing fields by results name. cstt||d|_dSr)rr rr}rrryrzrsz Dict.__init__cCst|D]\}}t|dkrq|d}t|tr@t|d}t|dkr\td|||<qt|dkrt|dtst|d|||<q|}|d=t|dkst|tr| rt||||<qt|d|||<q|j r|gS|SdS)Nrrrrs) rrr}rvrrrr$rr r|)rrRrrrtokZikeyZ dictvalueryryrzrs$   zDict.postParserryryrrzr s# c@s eZdZdZddZddZdS)r-aV Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also L{delimitedList}.) cCsgSrryrryryrzrszSuppress.postParsecCs|Srryrryryrzr "szSuppress.suppressN)rrrrrr ryryryrzr- sc@s(eZdZdZddZddZddZdS) rzI Wrapper for parse actions, to ensure they are only called once. cCst||_d|_dSr)rrcallablecalled)rZ methodCallryryrzr*s zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rrr!)rrr[rxrNryryrzr -s zOnlyOnce.__call__cCs d|_dSr)rrryryrzreset3szOnlyOnce.resetN)rrrrrr rryryryrzr&scs:tfdd}z j|_Wntk r4YnX|S)at Decorator for debugging parse actions. When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) z<.z)rrrr)rrryrrzrd6s  ,FcCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)a Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing C{combine=True} in the constructor. If C{combine} is set to C{True}, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. Example:: delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z [r(rN)rr r4rr-)rSZdelimcombineZdlNameryryrzrBbs $csjtfdd}|dkr0ttdd}n|}|d|j|dd|d td S) a: Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs.|d}|r ttg|p&tt>gSr)rrrE)rr[rxrZ arrayExprrSryrzcountFieldParseActions"z+countedArray..countFieldParseActionNcSs t|dSr)rvrwryryrzr{r|zcountedArray..ZarrayLenTrz(len) rc)rr1rTrrrrr)rSZintExprrryrrzr>us cCs6g}|D](}t|tr&|t|q||q|Sr)r}rrrr)Lrrryryrzrs   rcs6tfdd}|j|dddt|S)a* Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches a previous literal, will also match the leading C{"1:1"} in C{"1:10"}. If this is not desired, use C{matchPreviousExpr}. Do I{not} use with packrat parsing enabled. csP|rBt|dkr|d>qLt|}tdd|D>n t>dS)Nrrcss|]}t|VqdSr)rrZttryryrzrszDmatchPreviousLiteral..copyTokenToRepeater..)rrrrr)rr[rxZtflatZrepryrzcopyTokenToRepeaters   z1matchPreviousLiteral..copyTokenToRepeaterTr(prev) )rrrr)rSrryrrzrQs  csFt|}|Kfdd}|j|dddt|S)aS Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches by expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; the expressions are evaluated first, and then compared, so C{"1"} is compared with C{"10"}. Do I{not} use with packrat parsing enabled. cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)rrr!)rr[rxZ theseTokensZ matchTokensryrzmustMatchTheseTokenss zLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr)rrr)rr[rxrrrrzrs  z.matchPreviousExpr..copyTokenToRepeaterTrr)rrrrr)rSZe2rryrrzrPs cCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-]r2r'r~r)r_bslashr)rrryryrzrYs   rYTc s|rdd}dd}tndd}dd}tg}t|trF|}n$t|trZt|}ntjdt dd|stt Sd }|t |d kr||}t ||d d D]R\}} || |r|||d =qxq||| r|||d =| || | }qxq|d 7}qx|s|rzlt |t d |krTtd d dd|Dd|WStddd|Dd|WSWn&tk rtjdt ddYnXtfdd|Dd|S)a Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a C{L{MatchFirst}} for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default=C{False}) - treat all literals as caseless - useRegex - (default=C{True}) - as an optimization, will generate a Regex object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or if creating a C{Regex} raises an exception) Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] cSs||kSr)r@rbryryrzr{r|zoneOf..cSs||Sr)r@r<rryryrzr{r|cSs||kSrryrryryrzr{r|cSs ||Sr)r<rryryrzr{r|z6Invalid argument to oneOf, expected string or iterablersrrrNrz[%s]css|]}t|VqdSr)rYrZsymryryrzrszoneOf..r|css|]}t|VqdSr)rr[rryryrzrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdSrryrZparseElementClassryrzr$s)r rr}rrrrrrrrrrrrr)rrpr) Zstrsr?ZuseRegexZisequalZmasksZsymbolsrZcurrrryrrzrUsT         ** cCsttt||S)a Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the C{Dict} results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )r r4r)rrryryrzrC&s!cCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S) a Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional C{asString} argument is passed as C{False}, then the return value is a C{L{ParseResults}} containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to C{L{originalTextFor}} contains expressions with defined results names, you must set C{asString} to C{False} if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|Srry)rrrxryryrzr{ar|z!originalTextFor..F_original_start _original_endcSs||j|jSr)rrrZryryrzr{fr|cSs&||d|dg|dd<dS)Nrr)rrZryryrz extractTexthsz$originalTextFor..extractText)rrrrr)rSZasStringZ locMarkerZ endlocMarker matchExprrryryrzriIs  cCst|ddS)zp Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dSrryrwryryrzr{sr|zungroup..)r/r)rSryryrzrjnscCs4tdd}t|d|d|dS)a Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains C{} characters, you may want to call C{L{ParserElement.parseWithTabs}} Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|SrryrZryryrzr{r|zlocatedExpr..Z locn_startrZlocn_end)rrrrr )rSZlocatorryryrzrlusz\[]-*.$+^?()~ r_cCs |ddSrryrZryryrzr{r|r{z\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0x)unichrrvlstriprZryryrzr{r|z \\0[0-7]+cCstt|ddddS)Nrr)rrvrZryryrzr{r|z\]rr$r)negatebodyr'csFddz"dfddt|jDWStk r@YdSXdS)a Helper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as C{\-} or C{\]}) - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) (C{\0x##} is also supported for backwards compatibility) - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdSr)rrryryrzrsz+srange....rr)r}r$rrord)pryryrzr{r|zsrange..rc3s|]}|VqdSrry)rpartZ _expandedryrzrszsrange..N)r_reBracketExprrrrprdryrrzras "csfdd}|S)zt Helper method for defining parse actions that require matching at a specific column in the input text. cs"t||krt||ddS)Nzmatched token not at column %dr)rNZlocnrVrryrz verifyColsz!matchOnlyAtCol..verifyColry)rrryrrzrOs cs fddS)a Helper method for common parse actions that simply return a literal value. Especially useful when used with C{L{transformString}()}. Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgSrryrZZreplStrryrzr{r|zreplaceWith..ryrryrrzr^s cCs|dddS)a Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rrrtryrZryryrzr\s csNfdd}ztdtdj}Wntk rBt}YnX||_|S)aG Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the parsed data to an integer using base 16. Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] csfdd|DS)Ncsg|]}|fqSryry)rZtoknrr\ryrzrsz(tokenMap..pa..ryrZrryrzrsztokenMap..parrm)rorrpr~)r\rrrqryrrzros  cCs t|Srrr@rwryryrzr{r|cCs t|Srrlowerrwryryrzr{r|c Cst|tr|}t|| d}n|j}tttd}|rt t }t d|dt t t|t d|tddgdd  d d t d }nd ddtD}t t t|B}t d|dt t t| ttt d|tddgdd  dd t d }ttd|d }|dd |ddd|}|dd |ddd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerEz_-:r5tag=/Fr rEcSs |ddkSNrrryrZryryrzr{r|z_makeTags..r6rcss|]}|dkr|VqdS)r6Nryrryryrzrsz_makeTags..cSs |ddkSrryrZryryrzr{r|r7rJ:r(z<%s>r`z)r}rrrr1r6r5r@rrr\r-r r4rrrrrXr[rDr _Lrtitlerrr)tagStrZxmlZresnameZ tagAttrNameZ tagAttrValueZopenTagZprintablesLessRAbrackZcloseTagryryrz _makeTags s> ..rcCs t|dS)a  Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> http://pyparsing.wikispaces.com FrrryryrzrM(scCs t|dS)z Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to L{makeHTMLTags} TrrryryrzrN;scs8|r|ddn|ddDfdd}|S)a< Helper to create a validating parse action to be used with start tags created with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSryryr/ryryrzrzsz!withAttribute..csZD]P\}}||kr$t||d||tjkr|||krt||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r!rg ANY_VALUE)rr[rZattrNameZ attrValueZattrsryrzr{s  zwithAttribute..pa)r)rZattrDictrryrrzrgDs 2 cCs|r d|nd}tf||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)rg)Z classname namespaceZ classattrryryrzrms (rpcCst}||||B}t|D]l\}}|ddd\}} } } | dkrPd|nd|} | dkr|dkstt|dkr|td|\} }t| }| tjkr^| d krt||t|t |}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkrTt|| |||t|| |||}ntd n| tj krB| d krt |t st |}t|j |t||}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkr8t|| |||t|| |||}ntd ntd | rvt | ttfrl|j| n || ||| |BK}|}q||K}|S) aD Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] rNrbrqz%s termz %s%s termrsz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)rrrrrrVLEFTrrrRIGHTr}rrSrrr)ZbaseExprZopListZlparZrparrZlastExprrZoperDefZopExprZarityZrightLeftAssocrZtermNameZopExpr1ZopExpr2ZthisExprrryryrzrksZ=   &       &    z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr*t|tr"t|tr"t|dkrt|dkr|dk rtt|t||tjdd dd}n$t t||tj dd}nx|dk rtt|t |t |ttjdd dd}n4ttt |t |ttjdd d d}ntd t }|dk rd|tt|t||B|Bt|K}n$|tt|t||Bt|K}|d ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrrcSs |dSrrrwryryrzr{gr|znestedExpr..cSs |dSrr rwryryrzr{jr|cSs |dSrr rwryryrzr{pr|cSs |dSrr rwryryrzr{tr|zOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rr}rrr rr r&rsrrErrrrr-r4r)ZopenerZcloserZcontentrrryryrzrR%sH:    *$c sfdd}fdd}fdd}ttd}tt|d}t|d }t|d } |rtt||t|t|t|| } n$tt|t|t|t|} | t t| d S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrtzillegal nestingznot a peer entry)rr;r#r!rr[rxZcurCol indentStackryrzcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrtznot a subentry)r;rr!rrryrzcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}r6|dkr6|dksBt||ddS)Nrtr_znot an unindent)rr;r!rrrryrz checkUnindents    z$indentedBlock..checkUnindentz INDENTrZUNINDENTzindented block) rrr r rrrrrrr) ZblockStatementExprrr9rrrrErZPEERZUNDENTZsmExprryrrzrhs(N   z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prz);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentityrwryryrzr]sz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentrO commaItemrc@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrtryrwryryrzr{r|zpyparsing_common.rz"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 address)rrhz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdSr3)rp _ipv6_partrrryryrzrs z,pyparsing_common...r)rrwryryrzr{r|z::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sNzt|dWStk rH}zt||t|W5d}~XYnXdSr)rstrptimedaterr!r~rr[rxZvefmtryrzcvt_fnsz.pyparsing_common.convertToDate..cvt_fnryr$r%ryr#rz convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sJzt|dWStk rD}zt||t|W5d}~XYnXdSr)rr rr!r~r"r#ryrzr%sz2pyparsing_common.convertToDatetime..cvt_fnryr&ryr#rzconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rp_html_stripperr)rr[rryryrz stripHTMLTagss zpyparsing_common.stripHTMLTagsrrOrrrrzcomma separated listcCs t|Srrrwryryrzr{"r|cCs t|Srrrwryryrzr{%r|N)r)r()?rrrrrorvZconvertToIntegerfloatZconvertToFloatr1rTrrrrFrr)Zsigned_integerrrrr Z mixed_integerrrealZsci_realrnumberrr6r5rZ ipv4_addressrZ_full_ipv6_addressZ_short_ipv6_addressrZ_mixed_ipv6_addressr Z ipv6_addressZ mac_addressr/r'r)Z iso8601_dateZiso8601_datetimeuuidr9r8r+r,rrrrXr0 _commasepitemrBr[rZcomma_separated_listrfrDryryryrzrpsV"" 2     __main__Zselectfromr=r)rcolumnsrZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rs)rF)N)FT)T)r)T)r __version__Z__versionTime__ __author__rweakrefrrrrrrrjrrFrcrr_threadr ImportErrorZ threadingZcollections.abcrrrrZ ordereddict__all__r version_inforbr0maxsizer0r~rchrrrrrr@reversedrrrBrr]r^rnZmaxintZxrangerZ __builtin__rZfnamerrorrrrrrZascii_uppercaseZascii_lowercaser6rTrFr5rrZ printablerXrprr!r#r%r(rr$registerr;rLrIrTrWrYrSrrr&r.rrrrrwrr r rnr1r)r'r r0rrrrr,r+r3r2r"rrrrr rrrrr4rrrr*rrr/r rr r-rrdrBr>rrQrPrYrUrCrirjrlrrErKrJrcrbrZ _escapedPuncZ_escapedHexCharZ_escapedOctCharZ _singleCharZ _charRangerrrarOr^r\rorfrDrrMrNrgrrmrVrr rkrWr@r`r[rerRrhr7rYr9r8rrrrr=r]r:rGr r_rAr?rHrZrr1r<rprZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLr.r/rrr0r*ryryryrzs4        8      @v &A= I G3pLOD|M &#@sQ,A,    I# %     0 ,   ? #p  Zr   (         "   PK!NB2+_vendor/__pycache__/__init__.cpython-38.pycnu[U Qab@sdS)Nrrr?/usr/lib/python3.8/site-packages/setuptools/_vendor/__init__.pyPK!D*;;_vendor/ordered_set.pynu[""" An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, and released under the MIT license. """ import itertools as it from collections import deque try: # Python 3 from collections.abc import MutableSet, Sequence except ImportError: # Python 2.7 from collections import MutableSet, Sequence SLICE_ALL = slice(None) __version__ = "3.1" def is_iterable(obj): """ Are we being asked to look up a list of things, instead of a single thing? We check for the `__iter__` attribute so that this can cover types that don't have to be known by this module, such as NumPy arrays. Strings, however, should be considered as atomic values to look up, not iterables. The same goes for tuples, since they are immutable and therefore valid entries. We don't need to check for the Python 2 `unicode` type, because it doesn't have an `__iter__` attribute anyway. """ return ( hasattr(obj, "__iter__") and not isinstance(obj, str) and not isinstance(obj, tuple) ) class OrderedSet(MutableSet, Sequence): """ An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Example: >>> OrderedSet([1, 1, 2, 3, 2]) OrderedSet([1, 2, 3]) """ def __init__(self, iterable=None): self.items = [] self.map = {} if iterable is not None: self |= iterable def __len__(self): """ Returns the number of unique elements in the ordered set Example: >>> len(OrderedSet([])) 0 >>> len(OrderedSet([1, 2])) 2 """ return len(self.items) def __getitem__(self, index): """ Get the item at a given index. If `index` is a slice, you will get back that slice of items, as a new OrderedSet. If `index` is a list or a similar iterable, you'll get a list of items corresponding to those indices. This is similar to NumPy's "fancy indexing". The result is not an OrderedSet because you may ask for duplicate indices, and the number of elements returned should be the number of elements asked for. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset[1] 2 """ if isinstance(index, slice) and index == SLICE_ALL: return self.copy() elif is_iterable(index): return [self.items[i] for i in index] elif hasattr(index, "__index__") or isinstance(index, slice): result = self.items[index] if isinstance(result, list): return self.__class__(result) else: return result else: raise TypeError("Don't know how to index an OrderedSet by %r" % index) def copy(self): """ Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False """ return self.__class__(self) def __getstate__(self): if len(self) == 0: # The state can't be an empty list. # We need to return a truthy value, or else __setstate__ won't be run. # # This could have been done more gracefully by always putting the state # in a tuple, but this way is backwards- and forwards- compatible with # previous versions of OrderedSet. return (None,) else: return list(self) def __setstate__(self, state): if state == (None,): self.__init__([]) else: self.__init__(state) def __contains__(self, key): """ Test if the item is in this ordered set Example: >>> 1 in OrderedSet([1, 3, 2]) True >>> 5 in OrderedSet([1, 3, 2]) False """ return key in self.map def add(self, key): """ Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) OrderedSet([3]) """ if key not in self.map: self.map[key] = len(self.items) self.items.append(key) return self.map[key] append = add def update(self, sequence): """ Update the set with the given iterable sequence, then return the index of the last element inserted. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.update([3, 1, 5, 1, 4]) 4 >>> print(oset) OrderedSet([1, 2, 3, 5, 4]) """ item_index = None try: for item in sequence: item_index = self.add(item) except TypeError: raise ValueError( "Argument needs to be an iterable, got %s" % type(sequence) ) return item_index def index(self, key): """ Get the index of a given entry, raising an IndexError if it's not present. `key` can be an iterable of entries that is not a string, in which case this returns a list of indices. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.index(2) 1 """ if is_iterable(key): return [self.index(subkey) for subkey in key] return self.map[key] # Provide some compatibility with pd.Index get_loc = index get_indexer = index def pop(self): """ Remove and return the last element from the set. Raises KeyError if the set is empty. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.pop() 3 """ if not self.items: raise KeyError("Set is empty") elem = self.items[-1] del self.items[-1] del self.map[elem] return elem def discard(self, key): """ Remove an element. Do not raise an exception if absent. The MutableSet mixin uses this to implement the .remove() method, which *does* raise an error when asked to remove a non-existent item. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) """ if key in self: i = self.map[key] del self.items[i] del self.map[key] for k, v in self.map.items(): if v >= i: self.map[k] = v - 1 def clear(self): """ Remove all items from this OrderedSet. """ del self.items[:] self.map.clear() def __iter__(self): """ Example: >>> list(iter(OrderedSet([1, 2, 3]))) [1, 2, 3] """ return iter(self.items) def __reversed__(self): """ Example: >>> list(reversed(OrderedSet([1, 2, 3]))) [3, 2, 1] """ return reversed(self.items) def __repr__(self): if not self: return "%s()" % (self.__class__.__name__,) return "%s(%r)" % (self.__class__.__name__, list(self)) def __eq__(self, other): """ Returns true if the containers have the same items. If `other` is a Sequence, then order is checked, otherwise it is ignored. Example: >>> oset = OrderedSet([1, 3, 2]) >>> oset == [1, 3, 2] True >>> oset == [1, 2, 3] False >>> oset == [2, 3] False >>> oset == OrderedSet([3, 2, 1]) False """ # In Python 2 deque is not a Sequence, so treat it as one for # consistent behavior with Python 3. if isinstance(other, (Sequence, deque)): # Check that this OrderedSet contains the same elements, in the # same order, as the other object. return list(self) == list(other) try: other_as_set = set(other) except TypeError: # If `other` can't be converted into a set, it's not equal. return False else: return set(self) == other_as_set def union(self, *sets): """ Combines all unique items. Each items order is defined by its first appearance. Example: >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0]) >>> print(oset) OrderedSet([3, 1, 4, 5, 2, 0]) >>> oset.union([8, 9]) OrderedSet([3, 1, 4, 5, 2, 0, 8, 9]) >>> oset | {10} OrderedSet([3, 1, 4, 5, 2, 0, 10]) """ cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet containers = map(list, it.chain([self], sets)) items = it.chain.from_iterable(containers) return cls(items) def __and__(self, other): # the parent implementation of this is backwards return self.intersection(other) def intersection(self, *sets): """ Returns elements in common between all sets. Order is defined only by the first set. Example: >>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3]) >>> print(oset) OrderedSet([1, 2, 3]) >>> oset.intersection([2, 4, 5], [1, 2, 3, 4]) OrderedSet([2]) >>> oset.intersection() OrderedSet([1, 2, 3]) """ cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet if sets: common = set.intersection(*map(set, sets)) items = (item for item in self if item in common) else: items = self return cls(items) def difference(self, *sets): """ Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) OrderedSet([1]) >>> OrderedSet([1, 2, 3]) - OrderedSet([2]) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference() OrderedSet([1, 2, 3]) """ cls = self.__class__ if sets: other = set.union(*map(set, sets)) items = (item for item in self if item not in other) else: items = self return cls(items) def issubset(self, other): """ Report whether another set contains this set. Example: >>> OrderedSet([1, 2, 3]).issubset({1, 2}) False >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4}) True >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5}) False """ if len(self) > len(other): # Fast check for obvious cases return False return all(item in other for item in self) def issuperset(self, other): """ Report whether this set contains another set. Example: >>> OrderedSet([1, 2]).issuperset([1, 2, 3]) False >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3}) True >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3}) False """ if len(self) < len(other): # Fast check for obvious cases return False return all(item in self for item in other) def symmetric_difference(self, other): """ Return the symmetric difference of two OrderedSets as a new set. That is, the new set will contain all elements that are in exactly one of the sets. Their order will be preserved, with elements from `self` preceding elements from `other`. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference(other) OrderedSet([4, 5, 9, 2]) """ cls = self.__class__ if isinstance(self, OrderedSet) else OrderedSet diff1 = cls(self).difference(other) diff2 = cls(other).difference(self) return diff1.union(diff2) def _update_items(self, items): """ Replace the 'items' list of this OrderedSet with a new one, updating self.map accordingly. """ self.items = items self.map = {item: idx for (idx, item) in enumerate(items)} def difference_update(self, *sets): """ Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>> this = OrderedSet([1, 2, 3, 4, 5]) >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6])) >>> print(this) OrderedSet([3, 5]) """ items_to_remove = set() for other in sets: items_to_remove |= set(other) self._update_items([item for item in self.items if item not in items_to_remove]) def intersection_update(self, other): """ Update this OrderedSet to keep only items in another set, preserving their order in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.intersection_update(other) >>> print(this) OrderedSet([1, 3, 7]) """ other = set(other) self._update_items([item for item in self.items if item in other]) def symmetric_difference_update(self, other): """ Update this OrderedSet to remove items from another set, then add items from the other set that were not present in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference_update(other) >>> print(this) OrderedSet([4, 5, 9, 2]) """ items_to_add = [item for item in other if item not in self] items_to_remove = set(other) self._update_items( [item for item in self.items if item not in items_to_remove] + items_to_add ) PK!fww_vendor/pyparsing.pynu[# module pyparsing.py # # Copyright (c) 2003-2018 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __doc__ = \ """ pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements (L{'+'} operator gives L{And} expressions, strings are auto-converted to L{Literal} expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes - construct character word-group expressions using the L{Word} class - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones - associate names with your parsed results using L{ParserElement.setResultsName} - find some helpful expression short-cuts like L{delimitedList} and L{oneOf} - find more useful common expressions in the L{pyparsing_common} namespace class """ __version__ = "2.2.1" __versionTime__ = "18 Sep 2018 00:49 UTC" __author__ = "Paul McGuire " import string from weakref import ref as wkref import copy import sys import warnings import re import sre_constants import collections import pprint import traceback import types from datetime import datetime try: from _thread import RLock except ImportError: from threading import RLock try: # Python 3 from collections.abc import Iterable from collections.abc import MutableMapping except ImportError: # Python 2.7 from collections import Iterable from collections import MutableMapping try: from collections import OrderedDict as _OrderedDict except ImportError: try: from ordereddict import OrderedDict as _OrderedDict except ImportError: _OrderedDict = None #~ sys.stderr.write( "testing pyparsing module, version %s, %s\n" % (__version__,__versionTime__ ) ) __all__ = [ 'And', 'CaselessKeyword', 'CaselessLiteral', 'CharsNotIn', 'Combine', 'Dict', 'Each', 'Empty', 'FollowedBy', 'Forward', 'GoToColumn', 'Group', 'Keyword', 'LineEnd', 'LineStart', 'Literal', 'MatchFirst', 'NoMatch', 'NotAny', 'OneOrMore', 'OnlyOnce', 'Optional', 'Or', 'ParseBaseException', 'ParseElementEnhance', 'ParseException', 'ParseExpression', 'ParseFatalException', 'ParseResults', 'ParseSyntaxException', 'ParserElement', 'QuotedString', 'RecursiveGrammarException', 'Regex', 'SkipTo', 'StringEnd', 'StringStart', 'Suppress', 'Token', 'TokenConverter', 'White', 'Word', 'WordEnd', 'WordStart', 'ZeroOrMore', 'alphanums', 'alphas', 'alphas8bit', 'anyCloseTag', 'anyOpenTag', 'cStyleComment', 'col', 'commaSeparatedList', 'commonHTMLEntity', 'countedArray', 'cppStyleComment', 'dblQuotedString', 'dblSlashComment', 'delimitedList', 'dictOf', 'downcaseTokens', 'empty', 'hexnums', 'htmlComment', 'javaStyleComment', 'line', 'lineEnd', 'lineStart', 'lineno', 'makeHTMLTags', 'makeXMLTags', 'matchOnlyAtCol', 'matchPreviousExpr', 'matchPreviousLiteral', 'nestedExpr', 'nullDebugAction', 'nums', 'oneOf', 'opAssoc', 'operatorPrecedence', 'printables', 'punc8bit', 'pythonStyleComment', 'quotedString', 'removeQuotes', 'replaceHTMLEntity', 'replaceWith', 'restOfLine', 'sglQuotedString', 'srange', 'stringEnd', 'stringStart', 'traceParseAction', 'unicodeString', 'upcaseTokens', 'withAttribute', 'indentedBlock', 'originalTextFor', 'ungroup', 'infixNotation','locatedExpr', 'withClass', 'CloseMatch', 'tokenMap', 'pyparsing_common', ] system_version = tuple(sys.version_info)[:3] PY_3 = system_version[0] == 3 if PY_3: _MAX_INT = sys.maxsize basestring = str unichr = chr _ustr = str # build list of single arg builtins, that can be used as parse actions singleArgBuiltins = [sum, len, sorted, reversed, list, tuple, set, any, all, min, max] else: _MAX_INT = sys.maxint range = xrange def _ustr(obj): """Drop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. """ if isinstance(obj,unicode): return obj try: # If this works, then _ustr(obj) has the same behaviour as str(obj), so # it won't break any existing code. return str(obj) except UnicodeEncodeError: # Else encode it ret = unicode(obj).encode(sys.getdefaultencoding(), 'xmlcharrefreplace') xmlcharref = Regex(r'&#\d+;') xmlcharref.setParseAction(lambda t: '\\u' + hex(int(t[0][2:-1]))[2:]) return xmlcharref.transformString(ret) # build list of single arg builtins, tolerant of Python version, that can be used as parse actions singleArgBuiltins = [] import __builtin__ for fname in "sum len sorted reversed list tuple set any all min max".split(): try: singleArgBuiltins.append(getattr(__builtin__,fname)) except AttributeError: continue _generatorType = type((y for y in range(1))) def _xml_escape(data): """Escape &, <, >, ", ', etc. in a string of data.""" # ampersand must be replaced first from_symbols = '&><"\'' to_symbols = ('&'+s+';' for s in "amp gt lt quot apos".split()) for from_,to_ in zip(from_symbols, to_symbols): data = data.replace(from_, to_) return data class _Constants(object): pass alphas = string.ascii_uppercase + string.ascii_lowercase nums = "0123456789" hexnums = nums + "ABCDEFabcdef" alphanums = alphas + nums _bslash = chr(92) printables = "".join(c for c in string.printable if c not in string.whitespace) class ParseBaseException(Exception): """base exception class for all parsing runtime exceptions""" # Performance tuning: we construct a *lot* of these, so keep this # constructor as small and fast as possible def __init__( self, pstr, loc=0, msg=None, elem=None ): self.loc = loc if msg is None: self.msg = pstr self.pstr = "" else: self.msg = msg self.pstr = pstr self.parserElement = elem self.args = (pstr, loc, msg) @classmethod def _from_exception(cls, pe): """ internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses """ return cls(pe.pstr, pe.loc, pe.msg, pe.parserElement) def __getattr__( self, aname ): """supported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text """ if( aname == "lineno" ): return lineno( self.loc, self.pstr ) elif( aname in ("col", "column") ): return col( self.loc, self.pstr ) elif( aname == "line" ): return line( self.loc, self.pstr ) else: raise AttributeError(aname) def __str__( self ): return "%s (at char %d), (line:%d, col:%d)" % \ ( self.msg, self.loc, self.lineno, self.column ) def __repr__( self ): return _ustr(self) def markInputline( self, markerString = ">!<" ): """Extracts the exception line from the input string, and marks the location of the exception with a special symbol. """ line_str = self.line line_column = self.column - 1 if markerString: line_str = "".join((line_str[:line_column], markerString, line_str[line_column:])) return line_str.strip() def __dir__(self): return "lineno col line".split() + dir(type(self)) class ParseException(ParseBaseException): """ Exception thrown when parse expressions don't match class; supported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text Example:: try: Word(nums).setName("integer").parseString("ABC") except ParseException as pe: print(pe) print("column: {}".format(pe.col)) prints:: Expected integer (at char 0), (line:1, col:1) column: 1 """ pass class ParseFatalException(ParseBaseException): """user-throwable exception thrown when inconsistent parse content is found; stops all parsing immediately""" pass class ParseSyntaxException(ParseFatalException): """just like L{ParseFatalException}, but thrown internally when an L{ErrorStop} ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found""" pass #~ class ReparseException(ParseBaseException): #~ """Experimental class - parse actions can raise this exception to cause #~ pyparsing to reparse the input string: #~ - with a modified input string, and/or #~ - with a modified start location #~ Set the values of the ReparseException in the constructor, and raise the #~ exception in a parse action to cause pyparsing to use the new string/location. #~ Setting the values as None causes no change to be made. #~ """ #~ def __init_( self, newstring, restartLoc ): #~ self.newParseText = newstring #~ self.reparseLoc = restartLoc class RecursiveGrammarException(Exception): """exception thrown by L{ParserElement.validate} if the grammar could be improperly recursive""" def __init__( self, parseElementList ): self.parseElementTrace = parseElementList def __str__( self ): return "RecursiveGrammarException: %s" % self.parseElementTrace class _ParseResultsWithOffset(object): def __init__(self,p1,p2): self.tup = (p1,p2) def __getitem__(self,i): return self.tup[i] def __repr__(self): return repr(self.tup[0]) def setOffset(self,i): self.tup = (self.tup[0],i) class ParseResults(object): """ Structured parse results, to provide multiple means of access to the parsed data: - as a list (C{len(results)}) - by list index (C{results[0], results[1]}, etc.) - by attribute (C{results.} - see L{ParserElement.setResultsName}) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 """ def __new__(cls, toklist=None, name=None, asList=True, modal=True ): if isinstance(toklist, cls): return toklist retobj = object.__new__(cls) retobj.__doinit = True return retobj # Performance tuning: we construct a *lot* of these, so keep this # constructor as small and fast as possible def __init__( self, toklist=None, name=None, asList=True, modal=True, isinstance=isinstance ): if self.__doinit: self.__doinit = False self.__name = None self.__parent = None self.__accumNames = {} self.__asList = asList self.__modal = modal if toklist is None: toklist = [] if isinstance(toklist, list): self.__toklist = toklist[:] elif isinstance(toklist, _generatorType): self.__toklist = list(toklist) else: self.__toklist = [toklist] self.__tokdict = dict() if name is not None and name: if not modal: self.__accumNames[name] = 0 if isinstance(name,int): name = _ustr(name) # will always return a str, but use _ustr for consistency self.__name = name if not (isinstance(toklist, (type(None), basestring, list)) and toklist in (None,'',[])): if isinstance(toklist,basestring): toklist = [ toklist ] if asList: if isinstance(toklist,ParseResults): self[name] = _ParseResultsWithOffset(toklist.copy(),0) else: self[name] = _ParseResultsWithOffset(ParseResults(toklist[0]),0) self[name].__name = name else: try: self[name] = toklist[0] except (KeyError,TypeError,IndexError): self[name] = toklist def __getitem__( self, i ): if isinstance( i, (int,slice) ): return self.__toklist[i] else: if i not in self.__accumNames: return self.__tokdict[i][-1][0] else: return ParseResults([ v[0] for v in self.__tokdict[i] ]) def __setitem__( self, k, v, isinstance=isinstance ): if isinstance(v,_ParseResultsWithOffset): self.__tokdict[k] = self.__tokdict.get(k,list()) + [v] sub = v[0] elif isinstance(k,(int,slice)): self.__toklist[k] = v sub = v else: self.__tokdict[k] = self.__tokdict.get(k,list()) + [_ParseResultsWithOffset(v,0)] sub = v if isinstance(sub,ParseResults): sub.__parent = wkref(self) def __delitem__( self, i ): if isinstance(i,(int,slice)): mylen = len( self.__toklist ) del self.__toklist[i] # convert int to slice if isinstance(i, int): if i < 0: i += mylen i = slice(i, i+1) # get removed indices removed = list(range(*i.indices(mylen))) removed.reverse() # fixup indices in token dictionary for name,occurrences in self.__tokdict.items(): for j in removed: for k, (value, position) in enumerate(occurrences): occurrences[k] = _ParseResultsWithOffset(value, position - (position > j)) else: del self.__tokdict[i] def __contains__( self, k ): return k in self.__tokdict def __len__( self ): return len( self.__toklist ) def __bool__(self): return ( not not self.__toklist ) __nonzero__ = __bool__ def __iter__( self ): return iter( self.__toklist ) def __reversed__( self ): return iter( self.__toklist[::-1] ) def _iterkeys( self ): if hasattr(self.__tokdict, "iterkeys"): return self.__tokdict.iterkeys() else: return iter(self.__tokdict) def _itervalues( self ): return (self[k] for k in self._iterkeys()) def _iteritems( self ): return ((k, self[k]) for k in self._iterkeys()) if PY_3: keys = _iterkeys """Returns an iterator of all named result keys (Python 3.x only).""" values = _itervalues """Returns an iterator of all named result values (Python 3.x only).""" items = _iteritems """Returns an iterator of all named result key-value tuples (Python 3.x only).""" else: iterkeys = _iterkeys """Returns an iterator of all named result keys (Python 2.x only).""" itervalues = _itervalues """Returns an iterator of all named result values (Python 2.x only).""" iteritems = _iteritems """Returns an iterator of all named result key-value tuples (Python 2.x only).""" def keys( self ): """Returns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).""" return list(self.iterkeys()) def values( self ): """Returns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).""" return list(self.itervalues()) def items( self ): """Returns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).""" return list(self.iteritems()) def haskeys( self ): """Since keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.""" return bool(self.__tokdict) def pop( self, *args, **kwargs): """ Removes and returns item at specified index (default=C{last}). Supports both C{list} and C{dict} semantics for C{pop()}. If passed no argument or an integer argument, it will use C{list} semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use C{dict} semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in C{dict.pop()}. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] """ if not args: args = [-1] for k,v in kwargs.items(): if k == 'default': args = (args[0], v) else: raise TypeError("pop() got an unexpected keyword argument '%s'" % k) if (isinstance(args[0], int) or len(args) == 1 or args[0] in self): index = args[0] ret = self[index] del self[index] return ret else: defaultvalue = args[1] return defaultvalue def get(self, key, defaultValue=None): """ Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None """ if key in self: return self[key] else: return defaultValue def insert( self, index, insStr ): """ Inserts new element at location index in the list of parsed tokens. Similar to C{list.insert()}. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] """ self.__toklist.insert(index, insStr) # fixup indices in token dictionary for name,occurrences in self.__tokdict.items(): for k, (value, position) in enumerate(occurrences): occurrences[k] = _ParseResultsWithOffset(value, position + (position > index)) def append( self, item ): """ Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] """ self.__toklist.append(item) def extend( self, itemseq ): """ Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' """ if isinstance(itemseq, ParseResults): self += itemseq else: self.__toklist.extend(itemseq) def clear( self ): """ Clear all elements and results names. """ del self.__toklist[:] self.__tokdict.clear() def __getattr__( self, name ): try: return self[name] except KeyError: return "" if name in self.__tokdict: if name not in self.__accumNames: return self.__tokdict[name][-1][0] else: return ParseResults([ v[0] for v in self.__tokdict[name] ]) else: return "" def __add__( self, other ): ret = self.copy() ret += other return ret def __iadd__( self, other ): if other.__tokdict: offset = len(self.__toklist) addoffset = lambda a: offset if a<0 else a+offset otheritems = other.__tokdict.items() otherdictitems = [(k, _ParseResultsWithOffset(v[0],addoffset(v[1])) ) for (k,vlist) in otheritems for v in vlist] for k,v in otherdictitems: self[k] = v if isinstance(v[0],ParseResults): v[0].__parent = wkref(self) self.__toklist += other.__toklist self.__accumNames.update( other.__accumNames ) return self def __radd__(self, other): if isinstance(other,int) and other == 0: # useful for merging many ParseResults using sum() builtin return self.copy() else: # this may raise a TypeError - so be it return other + self def __repr__( self ): return "(%s, %s)" % ( repr( self.__toklist ), repr( self.__tokdict ) ) def __str__( self ): return '[' + ', '.join(_ustr(i) if isinstance(i, ParseResults) else repr(i) for i in self.__toklist) + ']' def _asStringList( self, sep='' ): out = [] for item in self.__toklist: if out and sep: out.append(sep) if isinstance( item, ParseResults ): out += item._asStringList() else: out.append( _ustr(item) ) return out def asList( self ): """ Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] """ return [res.asList() if isinstance(res,ParseResults) else res for res in self.__toklist] def asDict( self ): """ Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} """ if PY_3: item_fn = self.items else: item_fn = self.iteritems def toItem(obj): if isinstance(obj, ParseResults): if obj.haskeys(): return obj.asDict() else: return [toItem(v) for v in obj] else: return obj return dict((k,toItem(v)) for k,v in item_fn()) def copy( self ): """ Returns a new copy of a C{ParseResults} object. """ ret = ParseResults( self.__toklist ) ret.__tokdict = self.__tokdict.copy() ret.__parent = self.__parent ret.__accumNames.update( self.__accumNames ) ret.__name = self.__name return ret def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ): """ (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. """ nl = "\n" out = [] namedItems = dict((v[1],k) for (k,vlist) in self.__tokdict.items() for v in vlist) nextLevelIndent = indent + " " # collapse out indents if formatting is not desired if not formatted: indent = "" nextLevelIndent = "" nl = "" selfTag = None if doctag is not None: selfTag = doctag else: if self.__name: selfTag = self.__name if not selfTag: if namedItemsOnly: return "" else: selfTag = "ITEM" out += [ nl, indent, "<", selfTag, ">" ] for i,res in enumerate(self.__toklist): if isinstance(res,ParseResults): if i in namedItems: out += [ res.asXML(namedItems[i], namedItemsOnly and doctag is None, nextLevelIndent, formatted)] else: out += [ res.asXML(None, namedItemsOnly and doctag is None, nextLevelIndent, formatted)] else: # individual token, see if there is a name for it resTag = None if i in namedItems: resTag = namedItems[i] if not resTag: if namedItemsOnly: continue else: resTag = "ITEM" xmlBodyText = _xml_escape(_ustr(res)) out += [ nl, nextLevelIndent, "<", resTag, ">", xmlBodyText, "" ] out += [ nl, indent, "" ] return "".join(out) def __lookup(self,sub): for k,vlist in self.__tokdict.items(): for v,loc in vlist: if sub is v: return k return None def getName(self): r""" Returns the results name for this token expression. Useful when several different expressions might match at a particular location. Example:: integer = Word(nums) ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d") house_number_expr = Suppress('#') + Word(nums, alphanums) user_data = (Group(house_number_expr)("house_number") | Group(ssn_expr)("ssn") | Group(integer)("age")) user_info = OneOrMore(user_data) result = user_info.parseString("22 111-22-3333 #221B") for item in result: print(item.getName(), ':', item[0]) prints:: age : 22 ssn : 111-22-3333 house_number : 221B """ if self.__name: return self.__name elif self.__parent: par = self.__parent() if par: return par.__lookup(self) else: return None elif (len(self) == 1 and len(self.__tokdict) == 1 and next(iter(self.__tokdict.values()))[0][1] in (0,-1)): return next(iter(self.__tokdict.keys())) else: return None def dump(self, indent='', depth=0, full=True): """ Diagnostic method for listing out the contents of a C{ParseResults}. Accepts an optional C{indent} argument so that this string can be embedded in a nested display of other data. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(result.dump()) prints:: ['12', '/', '31', '/', '1999'] - day: 1999 - month: 31 - year: 12 """ out = [] NL = '\n' out.append( indent+_ustr(self.asList()) ) if full: if self.haskeys(): items = sorted((str(k), v) for k,v in self.items()) for k,v in items: if out: out.append(NL) out.append( "%s%s- %s: " % (indent,(' '*depth), k) ) if isinstance(v,ParseResults): if v: out.append( v.dump(indent,depth+1) ) else: out.append(_ustr(v)) else: out.append(repr(v)) elif any(isinstance(vv,ParseResults) for vv in self): v = self for i,vv in enumerate(v): if isinstance(vv,ParseResults): out.append("\n%s%s[%d]:\n%s%s%s" % (indent,(' '*(depth)),i,indent,(' '*(depth+1)),vv.dump(indent,depth+1) )) else: out.append("\n%s%s[%d]:\n%s%s%s" % (indent,(' '*(depth)),i,indent,(' '*(depth+1)),_ustr(vv))) return "".join(out) def pprint(self, *args, **kwargs): """ Pretty-printer for parsed results as a list, using the C{pprint} module. Accepts additional positional or keyword args as defined for the C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] """ pprint.pprint(self.asList(), *args, **kwargs) # add support for pickle protocol def __getstate__(self): return ( self.__toklist, ( self.__tokdict.copy(), self.__parent is not None and self.__parent() or None, self.__accumNames, self.__name ) ) def __setstate__(self,state): self.__toklist = state[0] (self.__tokdict, par, inAccumNames, self.__name) = state[1] self.__accumNames = {} self.__accumNames.update(inAccumNames) if par is not None: self.__parent = wkref(par) else: self.__parent = None def __getnewargs__(self): return self.__toklist, self.__name, self.__asList, self.__modal def __dir__(self): return (dir(type(self)) + list(self.keys())) MutableMapping.register(ParseResults) def col (loc,strg): """Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. """ s = strg return 1 if 0} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. """ return strg.count("\n",0,loc) + 1 def line( loc, strg ): """Returns the line of text containing loc within a string, counting newlines as line separators. """ lastCR = strg.rfind("\n", 0, loc) nextCR = strg.find("\n", loc) if nextCR >= 0: return strg[lastCR+1:nextCR] else: return strg[lastCR+1:] def _defaultStartDebugAction( instring, loc, expr ): print (("Match " + _ustr(expr) + " at loc " + _ustr(loc) + "(%d,%d)" % ( lineno(loc,instring), col(loc,instring) ))) def _defaultSuccessDebugAction( instring, startloc, endloc, expr, toks ): print ("Matched " + _ustr(expr) + " -> " + str(toks.asList())) def _defaultExceptionDebugAction( instring, loc, expr, exc ): print ("Exception raised:" + _ustr(exc)) def nullDebugAction(*args): """'Do-nothing' debug action, to suppress debugging output during parsing.""" pass # Only works on Python 3.x - nonlocal is toxic to Python 2 installs #~ 'decorator to trim function calls to match the arity of the target' #~ def _trim_arity(func, maxargs=3): #~ if func in singleArgBuiltins: #~ return lambda s,l,t: func(t) #~ limit = 0 #~ foundArity = False #~ def wrapper(*args): #~ nonlocal limit,foundArity #~ while 1: #~ try: #~ ret = func(*args[limit:]) #~ foundArity = True #~ return ret #~ except TypeError: #~ if limit == maxargs or foundArity: #~ raise #~ limit += 1 #~ continue #~ return wrapper # this version is Python 2.x-3.x cross-compatible 'decorator to trim function calls to match the arity of the target' def _trim_arity(func, maxargs=2): if func in singleArgBuiltins: return lambda s,l,t: func(t) limit = [0] foundArity = [False] # traceback return data structure changed in Py3.5 - normalize back to plain tuples if system_version[:2] >= (3,5): def extract_stack(limit=0): # special handling for Python 3.5.0 - extra deep call stack by 1 offset = -3 if system_version == (3,5,0) else -2 frame_summary = traceback.extract_stack(limit=-offset+limit-1)[offset] return [frame_summary[:2]] def extract_tb(tb, limit=0): frames = traceback.extract_tb(tb, limit=limit) frame_summary = frames[-1] return [frame_summary[:2]] else: extract_stack = traceback.extract_stack extract_tb = traceback.extract_tb # synthesize what would be returned by traceback.extract_stack at the call to # user's parse action 'func', so that we don't incur call penalty at parse time LINE_DIFF = 6 # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!! this_line = extract_stack(limit=2)[-1] pa_call_line_synth = (this_line[0], this_line[1]+LINE_DIFF) def wrapper(*args): while 1: try: ret = func(*args[limit[0]:]) foundArity[0] = True return ret except TypeError: # re-raise TypeErrors if they did not come from our arity testing if foundArity[0]: raise else: try: tb = sys.exc_info()[-1] if not extract_tb(tb, limit=2)[-1][:2] == pa_call_line_synth: raise finally: del tb if limit[0] <= maxargs: limit[0] += 1 continue raise # copy func name to wrapper for sensible debug output func_name = "" try: func_name = getattr(func, '__name__', getattr(func, '__class__').__name__) except Exception: func_name = str(func) wrapper.__name__ = func_name return wrapper class ParserElement(object): """Abstract base level parser element class.""" DEFAULT_WHITE_CHARS = " \n\t\r" verbose_stacktrace = False @staticmethod def setDefaultWhitespaceChars( chars ): r""" Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] """ ParserElement.DEFAULT_WHITE_CHARS = chars @staticmethod def inlineLiteralsUsing(cls): """ Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] """ ParserElement._literalStringClass = cls def __init__( self, savelist=False ): self.parseAction = list() self.failAction = None #~ self.name = "" # don't define self.name, let subclasses try/except upcall self.strRepr = None self.resultsName = None self.saveAsList = savelist self.skipWhitespace = True self.whiteChars = ParserElement.DEFAULT_WHITE_CHARS self.copyDefaultWhiteChars = True self.mayReturnEmpty = False # used when checking for left-recursion self.keepTabs = False self.ignoreExprs = list() self.debug = False self.streamlined = False self.mayIndexError = True # used to optimize exception handling for subclasses that don't advance parse index self.errmsg = "" self.modalResults = True # used to mark results names as modal (report only last) or cumulative (list all) self.debugActions = ( None, None, None ) #custom debug actions self.re = None self.callPreparse = True # used to avoid redundant calls to preParse self.callDuringTry = False def copy( self ): """ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of C{expr.copy()} is just C{expr()}:: integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") """ cpy = copy.copy( self ) cpy.parseAction = self.parseAction[:] cpy.ignoreExprs = self.ignoreExprs[:] if self.copyDefaultWhiteChars: cpy.whiteChars = ParserElement.DEFAULT_WHITE_CHARS return cpy def setName( self, name ): """ Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) """ self.name = name self.errmsg = "Expected " + self.name if hasattr(self,"exception"): self.exception.msg = self.errmsg return self def setResultsName( self, name, listAllMatches=False ): """ Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, C{expr("name")} in place of C{expr.setResultsName("name")} - see L{I{__call__}<__call__>}. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") """ newself = self.copy() if name.endswith("*"): name = name[:-1] listAllMatches=True newself.resultsName = name newself.modalResults = not listAllMatches return newself def setBreak(self,breakFlag = True): """Method to invoke the Python pdb debugger when this element is about to be parsed. Set C{breakFlag} to True to enable, False to disable. """ if breakFlag: _parseMethod = self._parse def breaker(instring, loc, doActions=True, callPreParse=True): import pdb pdb.set_trace() return _parseMethod( instring, loc, doActions, callPreParse ) breaker._originalParseMethod = _parseMethod self._parse = breaker else: if hasattr(self._parse,"_originalParseMethod"): self._parse = self._parse._originalParseMethod return self def setParseAction( self, *fns, **kwargs ): """ Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] """ self.parseAction = list(map(_trim_arity, list(fns))) self.callDuringTry = kwargs.get("callDuringTry", False) return self def addParseAction( self, *fns, **kwargs ): """ Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}. See examples in L{I{copy}}. """ self.parseAction += list(map(_trim_arity, list(fns))) self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False) return self def addCondition(self, *fns, **kwargs): """Add a boolean predicate function to expression's list of parse actions. See L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, functions passed to C{addCondition} need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) """ msg = kwargs.get("message", "failed user-defined condition") exc_type = ParseFatalException if kwargs.get("fatal", False) else ParseException for fn in fns: def pa(s,l,t): if not bool(_trim_arity(fn)(s,l,t)): raise exc_type(s,l,msg) self.parseAction.append(pa) self.callDuringTry = self.callDuringTry or kwargs.get("callDuringTry", False) return self def setFailAction( self, fn ): """Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments C{fn(s,loc,expr,err)} where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw C{L{ParseFatalException}} if it is desired to stop parsing immediately.""" self.failAction = fn return self def _skipIgnorables( self, instring, loc ): exprsFound = True while exprsFound: exprsFound = False for e in self.ignoreExprs: try: while 1: loc,dummy = e._parse( instring, loc ) exprsFound = True except ParseException: pass return loc def preParse( self, instring, loc ): if self.ignoreExprs: loc = self._skipIgnorables( instring, loc ) if self.skipWhitespace: wt = self.whiteChars instrlen = len(instring) while loc < instrlen and instring[loc] in wt: loc += 1 return loc def parseImpl( self, instring, loc, doActions=True ): return loc, [] def postParse( self, instring, loc, tokenlist ): return tokenlist #~ @profile def _parseNoCache( self, instring, loc, doActions=True, callPreParse=True ): debugging = ( self.debug ) #and doActions ) if debugging or self.failAction: #~ print ("Match",self,"at loc",loc,"(%d,%d)" % ( lineno(loc,instring), col(loc,instring) )) if (self.debugActions[0] ): self.debugActions[0]( instring, loc, self ) if callPreParse and self.callPreparse: preloc = self.preParse( instring, loc ) else: preloc = loc tokensStart = preloc try: try: loc,tokens = self.parseImpl( instring, preloc, doActions ) except IndexError: raise ParseException( instring, len(instring), self.errmsg, self ) except ParseBaseException as err: #~ print ("Exception raised:", err) if self.debugActions[2]: self.debugActions[2]( instring, tokensStart, self, err ) if self.failAction: self.failAction( instring, tokensStart, self, err ) raise else: if callPreParse and self.callPreparse: preloc = self.preParse( instring, loc ) else: preloc = loc tokensStart = preloc if self.mayIndexError or preloc >= len(instring): try: loc,tokens = self.parseImpl( instring, preloc, doActions ) except IndexError: raise ParseException( instring, len(instring), self.errmsg, self ) else: loc,tokens = self.parseImpl( instring, preloc, doActions ) tokens = self.postParse( instring, loc, tokens ) retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList, modal=self.modalResults ) if self.parseAction and (doActions or self.callDuringTry): if debugging: try: for fn in self.parseAction: tokens = fn( instring, tokensStart, retTokens ) if tokens is not None: retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), modal=self.modalResults ) except ParseBaseException as err: #~ print "Exception raised in user parse action:", err if (self.debugActions[2] ): self.debugActions[2]( instring, tokensStart, self, err ) raise else: for fn in self.parseAction: tokens = fn( instring, tokensStart, retTokens ) if tokens is not None: retTokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens,(ParseResults,list)), modal=self.modalResults ) if debugging: #~ print ("Matched",self,"->",retTokens.asList()) if (self.debugActions[1] ): self.debugActions[1]( instring, tokensStart, loc, self, retTokens ) return loc, retTokens def tryParse( self, instring, loc ): try: return self._parse( instring, loc, doActions=False )[0] except ParseFatalException: raise ParseException( instring, loc, self.errmsg, self) def canParseNext(self, instring, loc): try: self.tryParse(instring, loc) except (ParseException, IndexError): return False else: return True class _UnboundedCache(object): def __init__(self): cache = {} self.not_in_cache = not_in_cache = object() def get(self, key): return cache.get(key, not_in_cache) def set(self, key, value): cache[key] = value def clear(self): cache.clear() def cache_len(self): return len(cache) self.get = types.MethodType(get, self) self.set = types.MethodType(set, self) self.clear = types.MethodType(clear, self) self.__len__ = types.MethodType(cache_len, self) if _OrderedDict is not None: class _FifoCache(object): def __init__(self, size): self.not_in_cache = not_in_cache = object() cache = _OrderedDict() def get(self, key): return cache.get(key, not_in_cache) def set(self, key, value): cache[key] = value while len(cache) > size: try: cache.popitem(False) except KeyError: pass def clear(self): cache.clear() def cache_len(self): return len(cache) self.get = types.MethodType(get, self) self.set = types.MethodType(set, self) self.clear = types.MethodType(clear, self) self.__len__ = types.MethodType(cache_len, self) else: class _FifoCache(object): def __init__(self, size): self.not_in_cache = not_in_cache = object() cache = {} key_fifo = collections.deque([], size) def get(self, key): return cache.get(key, not_in_cache) def set(self, key, value): cache[key] = value while len(key_fifo) > size: cache.pop(key_fifo.popleft(), None) key_fifo.append(key) def clear(self): cache.clear() key_fifo.clear() def cache_len(self): return len(cache) self.get = types.MethodType(get, self) self.set = types.MethodType(set, self) self.clear = types.MethodType(clear, self) self.__len__ = types.MethodType(cache_len, self) # argument cache for optimizing repeated calls when backtracking through recursive expressions packrat_cache = {} # this is set later by enabledPackrat(); this is here so that resetCache() doesn't fail packrat_cache_lock = RLock() packrat_cache_stats = [0, 0] # this method gets repeatedly called during backtracking with the same arguments - # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression def _parseCache( self, instring, loc, doActions=True, callPreParse=True ): HIT, MISS = 0, 1 lookup = (self, instring, loc, callPreParse, doActions) with ParserElement.packrat_cache_lock: cache = ParserElement.packrat_cache value = cache.get(lookup) if value is cache.not_in_cache: ParserElement.packrat_cache_stats[MISS] += 1 try: value = self._parseNoCache(instring, loc, doActions, callPreParse) except ParseBaseException as pe: # cache a copy of the exception, without the traceback cache.set(lookup, pe.__class__(*pe.args)) raise else: cache.set(lookup, (value[0], value[1].copy())) return value else: ParserElement.packrat_cache_stats[HIT] += 1 if isinstance(value, Exception): raise value return (value[0], value[1].copy()) _parse = _parseNoCache @staticmethod def resetCache(): ParserElement.packrat_cache.clear() ParserElement.packrat_cache_stats[:] = [0] * len(ParserElement.packrat_cache_stats) _packratEnabled = False @staticmethod def enablePackrat(cache_size_limit=128): """Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default=C{128}) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method C{ParserElement.enablePackrat()}. If your program uses C{psyco} to "compile as you go", you must call C{enablePackrat} before calling C{psyco.full()}. If you do not do this, Python will crash. For best results, call C{enablePackrat()} immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enablePackrat() """ if not ParserElement._packratEnabled: ParserElement._packratEnabled = True if cache_size_limit is None: ParserElement.packrat_cache = ParserElement._UnboundedCache() else: ParserElement.packrat_cache = ParserElement._FifoCache(cache_size_limit) ParserElement._parse = ParserElement._parseCache def parseString( self, instring, parseAll=False ): """ Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. If you want the grammar to require that the entire input string be successfully parsed, then set C{parseAll} to True (equivalent to ending the grammar with C{L{StringEnd()}}). Note: C{parseString} implicitly calls C{expandtabs()} on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the C{loc} argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling C{parseWithTabs} on your grammar before calling C{parseString} (see L{I{parseWithTabs}}) - define your parse action using the full C{(s,loc,toks)} signature, and reference the input string using the parse action's C{s} argument - explictly expand the tabs in your input string before calling C{parseString} Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text """ ParserElement.resetCache() if not self.streamlined: self.streamline() #~ self.saveAsList = True for e in self.ignoreExprs: e.streamline() if not self.keepTabs: instring = instring.expandtabs() try: loc, tokens = self._parse( instring, 0 ) if parseAll: loc = self.preParse( instring, loc ) se = Empty() + StringEnd() se._parse( instring, loc ) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc else: return tokens def scanString( self, instring, maxMatches=_MAX_INT, overlap=False ): """ Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See L{I{parseString}} for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd """ if not self.streamlined: self.streamline() for e in self.ignoreExprs: e.streamline() if not self.keepTabs: instring = _ustr(instring).expandtabs() instrlen = len(instring) loc = 0 preparseFn = self.preParse parseFn = self._parse ParserElement.resetCache() matches = 0 try: while loc <= instrlen and matches < maxMatches: try: preloc = preparseFn( instring, loc ) nextLoc,tokens = parseFn( instring, preloc, callPreParse=False ) except ParseException: loc = preloc+1 else: if nextLoc > loc: matches += 1 yield tokens, preloc, nextLoc if overlap: nextloc = preparseFn( instring, loc ) if nextloc > loc: loc = nextLoc else: loc += 1 else: loc = nextLoc else: loc = preloc+1 except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc def transformString( self, instring ): """ Extension to C{L{scanString}}, to modify matching text with modified tokens that may be returned from a parse action. To use C{transformString}, define a grammar and attach a parse action to it that modifies the returned token list. Invoking C{transformString()} on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. C{transformString()} returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) Prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. """ out = [] lastE = 0 # force preservation of s, to minimize unwanted transformation of string, and to # keep string locs straight between transformString and scanString self.keepTabs = True try: for t,s,e in self.scanString( instring ): out.append( instring[lastE:s] ) if t: if isinstance(t,ParseResults): out += t.asList() elif isinstance(t,list): out += t else: out.append(t) lastE = e out.append(instring[lastE:]) out = [o for o in out if o] return "".join(map(_ustr,_flatten(out))) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc def searchString( self, instring, maxMatches=_MAX_INT ): """ Another extension to C{L{scanString}}, simplifying the access to the tokens found to match the given parse expression. May be called with optional C{maxMatches} argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] """ try: return ParseResults([ t for t,s,e in self.scanString( instring, maxMatches ) ]) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False): """ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] """ splits = 0 last = 0 for t,s,e in self.scanString(instring, maxMatches=maxsplit): yield instring[last:s] if includeSeparators: yield t[0] last = e yield instring[last:] def __add__(self, other ): """ Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement converts them to L{Literal}s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) Prints:: Hello, World! -> ['Hello', ',', 'World', '!'] """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return And( [ self, other ] ) def __radd__(self, other ): """ Implementation of + operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return other + self def __sub__(self, other): """ Implementation of - operator, returns C{L{And}} with error stop """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return self + And._ErrorStop() + other def __rsub__(self, other ): """ Implementation of - operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return other - self def __mul__(self,other): """ Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is equivalent to C{expr*n + L{ZeroOrMore}(expr)} (read as "at least n instances of C{expr}") - C{expr*(None,n)} is equivalent to C{expr*(0,n)} (read as "0 to n instances of C{expr}") - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} Note that C{expr*(None,n)} does not raise an exception if more than n exprs exist in the input stream; that is, C{expr*(None,n)} does not enforce a maximum number of expr occurrences. If this behavior is desired, then write C{expr*(None,n) + ~expr} """ if isinstance(other,int): minElements, optElements = other,0 elif isinstance(other,tuple): other = (other + (None, None))[:2] if other[0] is None: other = (0, other[1]) if isinstance(other[0],int) and other[1] is None: if other[0] == 0: return ZeroOrMore(self) if other[0] == 1: return OneOrMore(self) else: return self*other[0] + ZeroOrMore(self) elif isinstance(other[0],int) and isinstance(other[1],int): minElements, optElements = other optElements -= minElements else: raise TypeError("cannot multiply 'ParserElement' and ('%s','%s') objects", type(other[0]),type(other[1])) else: raise TypeError("cannot multiply 'ParserElement' and '%s' objects", type(other)) if minElements < 0: raise ValueError("cannot multiply ParserElement by negative value") if optElements < 0: raise ValueError("second tuple value must be greater or equal to first tuple value") if minElements == optElements == 0: raise ValueError("cannot multiply ParserElement by 0 or (0,0)") if (optElements): def makeOptionalList(n): if n>1: return Optional(self + makeOptionalList(n-1)) else: return Optional(self) if minElements: if minElements == 1: ret = self + makeOptionalList(optElements) else: ret = And([self]*minElements) + makeOptionalList(optElements) else: ret = makeOptionalList(optElements) else: if minElements == 1: ret = self else: ret = And([self]*minElements) return ret def __rmul__(self, other): return self.__mul__(other) def __or__(self, other ): """ Implementation of | operator - returns C{L{MatchFirst}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return MatchFirst( [ self, other ] ) def __ror__(self, other ): """ Implementation of | operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return other | self def __xor__(self, other ): """ Implementation of ^ operator - returns C{L{Or}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return Or( [ self, other ] ) def __rxor__(self, other ): """ Implementation of ^ operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return other ^ self def __and__(self, other ): """ Implementation of & operator - returns C{L{Each}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return Each( [ self, other ] ) def __rand__(self, other ): """ Implementation of & operator when left operand is not a C{L{ParserElement}} """ if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) if not isinstance( other, ParserElement ): warnings.warn("Cannot combine element of type %s with ParserElement" % type(other), SyntaxWarning, stacklevel=2) return None return other & self def __invert__( self ): """ Implementation of ~ operator - returns C{L{NotAny}} """ return NotAny( self ) def __call__(self, name=None): """ Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be passed as C{True}. If C{name} is omitted, same as calling C{L{copy}}. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") """ if name is not None: return self.setResultsName(name) else: return self.copy() def suppress( self ): """ Suppresses the output of this C{ParserElement}; useful to keep punctuation from cluttering up returned output. """ return Suppress( self ) def leaveWhitespace( self ): """ Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. """ self.skipWhitespace = False return self def setWhitespaceChars( self, chars ): """ Overrides the default whitespace chars """ self.skipWhitespace = True self.whiteChars = chars self.copyDefaultWhiteChars = False return self def parseWithTabs( self ): """ Overrides default behavior to expand C{}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{} characters. """ self.keepTabs = True return self def ignore( self, other ): """ Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] """ if isinstance(other, basestring): other = Suppress(other) if isinstance( other, Suppress ): if other not in self.ignoreExprs: self.ignoreExprs.append(other) else: self.ignoreExprs.append( Suppress( other.copy() ) ) return self def setDebugActions( self, startAction, successAction, exceptionAction ): """ Enable display of debugging messages while doing pattern matching. """ self.debugActions = (startAction or _defaultStartDebugAction, successAction or _defaultSuccessDebugAction, exceptionAction or _defaultExceptionDebugAction) self.debug = True return self def setDebug( self, flag=True ): """ Enable display of debugging messages while doing pattern matching. Set C{flag} to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using L{setDebugActions}. Prior to attempting to match the C{wd} expression, the debugging message C{"Match at loc (,)"} is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. """ if flag: self.setDebugActions( _defaultStartDebugAction, _defaultSuccessDebugAction, _defaultExceptionDebugAction ) else: self.debug = False return self def __str__( self ): return self.name def __repr__( self ): return _ustr(self) def streamline( self ): self.streamlined = True self.strRepr = None return self def checkRecursion( self, parseElementList ): pass def validate( self, validateTrace=[] ): """ Check defined expressions for valid structure, check for infinite recursive definitions. """ self.checkRecursion( [] ) def parseFile( self, file_or_filename, parseAll=False ): """ Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. """ try: file_contents = file_or_filename.read() except AttributeError: with open(file_or_filename, "r") as f: file_contents = f.read() try: return self.parseString(file_contents, parseAll) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc def __eq__(self,other): if isinstance(other, ParserElement): return self is other or vars(self) == vars(other) elif isinstance(other, basestring): return self.matches(other) else: return super(ParserElement,self)==other def __ne__(self,other): return not (self == other) def __hash__(self): return hash(id(self)) def __req__(self,other): return self == other def __rne__(self,other): return not (self == other) def matches(self, testString, parseAll=True): """ Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests Example:: expr = Word(nums) assert expr.matches("100") """ try: self.parseString(_ustr(testString), parseAll=parseAll) return True except ParseBaseException: return False def runTests(self, tests, parseAll=True, comment='#', fullDump=True, printResults=True, failureTests=False): """ Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - comment - (default=C{'#'}) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default=C{True}) prints test output to stdout - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if C{failureTests} is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\\n of strings that spans \\n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) """ if isinstance(tests, basestring): tests = list(map(str.strip, tests.rstrip().splitlines())) if isinstance(comment, basestring): comment = Literal(comment) allResults = [] comments = [] success = True for t in tests: if comment is not None and comment.matches(t, False) or comments and not t: comments.append(t) continue if not t: continue out = ['\n'.join(comments), t] comments = [] try: t = t.replace(r'\n','\n') result = self.parseString(t, parseAll=parseAll) out.append(result.dump(full=fullDump)) success = success and not failureTests except ParseBaseException as pe: fatal = "(FATAL)" if isinstance(pe, ParseFatalException) else "" if '\n' in t: out.append(line(pe.loc, t)) out.append(' '*(col(pe.loc,t)-1) + '^' + fatal) else: out.append(' '*pe.loc + '^' + fatal) out.append("FAIL: " + str(pe)) success = success and failureTests result = pe except Exception as exc: out.append("FAIL-EXCEPTION: " + str(exc)) success = success and failureTests result = exc if printResults: if fullDump: out.append('') print('\n'.join(out)) allResults.append((t, result)) return success, allResults class Token(ParserElement): """ Abstract C{ParserElement} subclass, for defining atomic matching patterns. """ def __init__( self ): super(Token,self).__init__( savelist=False ) class Empty(Token): """ An empty token, will always match. """ def __init__( self ): super(Empty,self).__init__() self.name = "Empty" self.mayReturnEmpty = True self.mayIndexError = False class NoMatch(Token): """ A token that will never match. """ def __init__( self ): super(NoMatch,self).__init__() self.name = "NoMatch" self.mayReturnEmpty = True self.mayIndexError = False self.errmsg = "Unmatchable token" def parseImpl( self, instring, loc, doActions=True ): raise ParseException(instring, loc, self.errmsg, self) class Literal(Token): """ Token to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use L{CaselessLiteral}. For keyword matching (force word break before and after the matched string), use L{Keyword} or L{CaselessKeyword}. """ def __init__( self, matchString ): super(Literal,self).__init__() self.match = matchString self.matchLen = len(matchString) try: self.firstMatchChar = matchString[0] except IndexError: warnings.warn("null string passed to Literal; use Empty() instead", SyntaxWarning, stacklevel=2) self.__class__ = Empty self.name = '"%s"' % _ustr(self.match) self.errmsg = "Expected " + self.name self.mayReturnEmpty = False self.mayIndexError = False # Performance tuning: this routine gets called a *lot* # if this is a single character match string and the first character matches, # short-circuit as quickly as possible, and avoid calling startswith #~ @profile def parseImpl( self, instring, loc, doActions=True ): if (instring[loc] == self.firstMatchChar and (self.matchLen==1 or instring.startswith(self.match,loc)) ): return loc+self.matchLen, self.match raise ParseException(instring, loc, self.errmsg, self) _L = Literal ParserElement._literalStringClass = Literal class Keyword(Token): """ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with C{L{Literal}}: - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} Accepts two optional constructor arguments in addition to the keyword string: - C{identChars} is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - C{caseless} allows case-insensitive matching, default is C{False}. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use L{CaselessKeyword}. """ DEFAULT_KEYWORD_CHARS = alphanums+"_$" def __init__( self, matchString, identChars=None, caseless=False ): super(Keyword,self).__init__() if identChars is None: identChars = Keyword.DEFAULT_KEYWORD_CHARS self.match = matchString self.matchLen = len(matchString) try: self.firstMatchChar = matchString[0] except IndexError: warnings.warn("null string passed to Keyword; use Empty() instead", SyntaxWarning, stacklevel=2) self.name = '"%s"' % self.match self.errmsg = "Expected " + self.name self.mayReturnEmpty = False self.mayIndexError = False self.caseless = caseless if caseless: self.caselessmatch = matchString.upper() identChars = identChars.upper() self.identChars = set(identChars) def parseImpl( self, instring, loc, doActions=True ): if self.caseless: if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) and (loc == 0 or instring[loc-1].upper() not in self.identChars) ): return loc+self.matchLen, self.match else: if (instring[loc] == self.firstMatchChar and (self.matchLen==1 or instring.startswith(self.match,loc)) and (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen] not in self.identChars) and (loc == 0 or instring[loc-1] not in self.identChars) ): return loc+self.matchLen, self.match raise ParseException(instring, loc, self.errmsg, self) def copy(self): c = super(Keyword,self).copy() c.identChars = Keyword.DEFAULT_KEYWORD_CHARS return c @staticmethod def setDefaultKeywordChars( chars ): """Overrides the default Keyword chars """ Keyword.DEFAULT_KEYWORD_CHARS = chars class CaselessLiteral(Literal): """ Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for L{CaselessKeyword}.) """ def __init__( self, matchString ): super(CaselessLiteral,self).__init__( matchString.upper() ) # Preserve the defining literal. self.returnString = matchString self.name = "'%s'" % self.returnString self.errmsg = "Expected " + self.name def parseImpl( self, instring, loc, doActions=True ): if instring[ loc:loc+self.matchLen ].upper() == self.match: return loc+self.matchLen, self.returnString raise ParseException(instring, loc, self.errmsg, self) class CaselessKeyword(Keyword): """ Caseless version of L{Keyword}. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for L{CaselessLiteral}.) """ def __init__( self, matchString, identChars=None ): super(CaselessKeyword,self).__init__( matchString, identChars, caseless=True ) def parseImpl( self, instring, loc, doActions=True ): if ( (instring[ loc:loc+self.matchLen ].upper() == self.caselessmatch) and (loc >= len(instring)-self.matchLen or instring[loc+self.matchLen].upper() not in self.identChars) ): return loc+self.matchLen, self.match raise ParseException(instring, loc, self.errmsg, self) class CloseMatch(Token): """ A variation on L{Literal} which matches "close" matches, that is, strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - C{match_string} - string to be matched - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - C{mismatches} - a list of the positions within the match_string where mismatches were found - C{original} - the original match_string used to compare against the input string If C{mismatches} is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) """ def __init__(self, match_string, maxMismatches=1): super(CloseMatch,self).__init__() self.name = match_string self.match_string = match_string self.maxMismatches = maxMismatches self.errmsg = "Expected %r (with up to %d mismatches)" % (self.match_string, self.maxMismatches) self.mayIndexError = False self.mayReturnEmpty = False def parseImpl( self, instring, loc, doActions=True ): start = loc instrlen = len(instring) maxloc = start + len(self.match_string) if maxloc <= instrlen: match_string = self.match_string match_stringloc = 0 mismatches = [] maxMismatches = self.maxMismatches for match_stringloc,s_m in enumerate(zip(instring[loc:maxloc], self.match_string)): src,mat = s_m if src != mat: mismatches.append(match_stringloc) if len(mismatches) > maxMismatches: break else: loc = match_stringloc + 1 results = ParseResults([instring[start:loc]]) results['original'] = self.match_string results['mismatches'] = mismatches return loc, results raise ParseException(instring, loc, self.errmsg, self) class Word(Token): """ Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. An optional C{excludeChars} parameter can list characters that might be found in the input C{bodyChars} string; useful to define a word of all printables except for one or two characters, for instance. L{srange} is useful for defining custom character set strings for defining C{Word} expressions, using range notation from regular expression character sets. A common mistake is to use C{Word} to match a specific literal string, as in C{Word("Address")}. Remember that C{Word} uses the string argument to define I{sets} of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use L{Literal} or L{Keyword}. pyparsing includes helper strings for building Words: - L{alphas} - L{nums} - L{alphanums} - L{hexnums} - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - L{printables} (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") """ def __init__( self, initChars, bodyChars=None, min=1, max=0, exact=0, asKeyword=False, excludeChars=None ): super(Word,self).__init__() if excludeChars: initChars = ''.join(c for c in initChars if c not in excludeChars) if bodyChars: bodyChars = ''.join(c for c in bodyChars if c not in excludeChars) self.initCharsOrig = initChars self.initChars = set(initChars) if bodyChars : self.bodyCharsOrig = bodyChars self.bodyChars = set(bodyChars) else: self.bodyCharsOrig = initChars self.bodyChars = set(initChars) self.maxSpecified = max > 0 if min < 1: raise ValueError("cannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permitted") self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact self.name = _ustr(self) self.errmsg = "Expected " + self.name self.mayIndexError = False self.asKeyword = asKeyword if ' ' not in self.initCharsOrig+self.bodyCharsOrig and (min==1 and max==0 and exact==0): if self.bodyCharsOrig == self.initCharsOrig: self.reString = "[%s]+" % _escapeRegexRangeChars(self.initCharsOrig) elif len(self.initCharsOrig) == 1: self.reString = "%s[%s]*" % \ (re.escape(self.initCharsOrig), _escapeRegexRangeChars(self.bodyCharsOrig),) else: self.reString = "[%s][%s]*" % \ (_escapeRegexRangeChars(self.initCharsOrig), _escapeRegexRangeChars(self.bodyCharsOrig),) if self.asKeyword: self.reString = r"\b"+self.reString+r"\b" try: self.re = re.compile( self.reString ) except Exception: self.re = None def parseImpl( self, instring, loc, doActions=True ): if self.re: result = self.re.match(instring,loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() return loc, result.group() if not(instring[ loc ] in self.initChars): raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 instrlen = len(instring) bodychars = self.bodyChars maxloc = start + self.maxLen maxloc = min( maxloc, instrlen ) while loc < maxloc and instring[loc] in bodychars: loc += 1 throwException = False if loc - start < self.minLen: throwException = True if self.maxSpecified and loc < instrlen and instring[loc] in bodychars: throwException = True if self.asKeyword: if (start>0 and instring[start-1] in bodychars) or (loc4: return s[:4]+"..." else: return s if ( self.initCharsOrig != self.bodyCharsOrig ): self.strRepr = "W:(%s,%s)" % ( charsAsStr(self.initCharsOrig), charsAsStr(self.bodyCharsOrig) ) else: self.strRepr = "W:(%s)" % charsAsStr(self.initCharsOrig) return self.strRepr class Regex(Token): r""" Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module. If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") """ compiledREtype = type(re.compile("[A-Z]")) def __init__( self, pattern, flags=0): """The parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.""" super(Regex,self).__init__() if isinstance(pattern, basestring): if not pattern: warnings.warn("null string passed to Regex; use Empty() instead", SyntaxWarning, stacklevel=2) self.pattern = pattern self.flags = flags try: self.re = re.compile(self.pattern, self.flags) self.reString = self.pattern except sre_constants.error: warnings.warn("invalid pattern (%s) passed to Regex" % pattern, SyntaxWarning, stacklevel=2) raise elif isinstance(pattern, Regex.compiledREtype): self.re = pattern self.pattern = \ self.reString = str(pattern) self.flags = flags else: raise ValueError("Regex may only be constructed with a string or a compiled RE object") self.name = _ustr(self) self.errmsg = "Expected " + self.name self.mayIndexError = False self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): result = self.re.match(instring,loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() d = result.groupdict() ret = ParseResults(result.group()) if d: for k in d: ret[k] = d[k] return loc,ret def __str__( self ): try: return super(Regex,self).__str__() except Exception: pass if self.strRepr is None: self.strRepr = "Re:(%s)" % repr(self.pattern) return self.strRepr class QuotedString(Token): r""" Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=C{None}) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] """ def __init__( self, quoteChar, escChar=None, escQuote=None, multiline=False, unquoteResults=True, endQuoteChar=None, convertWhitespaceEscapes=True): super(QuotedString,self).__init__() # remove white space from quote chars - wont work anyway quoteChar = quoteChar.strip() if not quoteChar: warnings.warn("quoteChar cannot be the empty string",SyntaxWarning,stacklevel=2) raise SyntaxError() if endQuoteChar is None: endQuoteChar = quoteChar else: endQuoteChar = endQuoteChar.strip() if not endQuoteChar: warnings.warn("endQuoteChar cannot be the empty string",SyntaxWarning,stacklevel=2) raise SyntaxError() self.quoteChar = quoteChar self.quoteCharLen = len(quoteChar) self.firstQuoteChar = quoteChar[0] self.endQuoteChar = endQuoteChar self.endQuoteCharLen = len(endQuoteChar) self.escChar = escChar self.escQuote = escQuote self.unquoteResults = unquoteResults self.convertWhitespaceEscapes = convertWhitespaceEscapes if multiline: self.flags = re.MULTILINE | re.DOTALL self.pattern = r'%s(?:[^%s%s]' % \ ( re.escape(self.quoteChar), _escapeRegexRangeChars(self.endQuoteChar[0]), (escChar is not None and _escapeRegexRangeChars(escChar) or '') ) else: self.flags = 0 self.pattern = r'%s(?:[^%s\n\r%s]' % \ ( re.escape(self.quoteChar), _escapeRegexRangeChars(self.endQuoteChar[0]), (escChar is not None and _escapeRegexRangeChars(escChar) or '') ) if len(self.endQuoteChar) > 1: self.pattern += ( '|(?:' + ')|(?:'.join("%s[^%s]" % (re.escape(self.endQuoteChar[:i]), _escapeRegexRangeChars(self.endQuoteChar[i])) for i in range(len(self.endQuoteChar)-1,0,-1)) + ')' ) if escQuote: self.pattern += (r'|(?:%s)' % re.escape(escQuote)) if escChar: self.pattern += (r'|(?:%s.)' % re.escape(escChar)) self.escCharReplacePattern = re.escape(self.escChar)+"(.)" self.pattern += (r')*%s' % re.escape(self.endQuoteChar)) try: self.re = re.compile(self.pattern, self.flags) self.reString = self.pattern except sre_constants.error: warnings.warn("invalid pattern (%s) passed to Regex" % self.pattern, SyntaxWarning, stacklevel=2) raise self.name = _ustr(self) self.errmsg = "Expected " + self.name self.mayIndexError = False self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): result = instring[loc] == self.firstQuoteChar and self.re.match(instring,loc) or None if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() ret = result.group() if self.unquoteResults: # strip off quotes ret = ret[self.quoteCharLen:-self.endQuoteCharLen] if isinstance(ret,basestring): # replace escaped whitespace if '\\' in ret and self.convertWhitespaceEscapes: ws_map = { r'\t' : '\t', r'\n' : '\n', r'\f' : '\f', r'\r' : '\r', } for wslit,wschar in ws_map.items(): ret = ret.replace(wslit, wschar) # replace escaped characters if self.escChar: ret = re.sub(self.escCharReplacePattern, r"\g<1>", ret) # replace escaped quotes if self.escQuote: ret = ret.replace(self.escQuote, self.endQuoteChar) return loc, ret def __str__( self ): try: return super(QuotedString,self).__str__() except Exception: pass if self.strRepr is None: self.strRepr = "quoted string, starting with %s ending with %s" % (self.quoteChar, self.endQuoteChar) return self.strRepr class CharsNotIn(Token): """ Token for matching words composed of characters I{not} in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] """ def __init__( self, notChars, min=1, max=0, exact=0 ): super(CharsNotIn,self).__init__() self.skipWhitespace = False self.notChars = notChars if min < 1: raise ValueError("cannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permitted") self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact self.name = _ustr(self) self.errmsg = "Expected " + self.name self.mayReturnEmpty = ( self.minLen == 0 ) self.mayIndexError = False def parseImpl( self, instring, loc, doActions=True ): if instring[loc] in self.notChars: raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 notchars = self.notChars maxlen = min( start+self.maxLen, len(instring) ) while loc < maxlen and \ (instring[loc] not in notchars): loc += 1 if loc - start < self.minLen: raise ParseException(instring, loc, self.errmsg, self) return loc, instring[start:loc] def __str__( self ): try: return super(CharsNotIn, self).__str__() except Exception: pass if self.strRepr is None: if len(self.notChars) > 4: self.strRepr = "!W:(%s...)" % self.notChars[:4] else: self.strRepr = "!W:(%s)" % self.notChars return self.strRepr class White(Token): """ Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is C{" \\t\\r\\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, as defined for the C{L{Word}} class. """ whiteStrs = { " " : "", "\t": "", "\n": "", "\r": "", "\f": "", } def __init__(self, ws=" \t\r\n", min=1, max=0, exact=0): super(White,self).__init__() self.matchWhite = ws self.setWhitespaceChars( "".join(c for c in self.whiteChars if c not in self.matchWhite) ) #~ self.leaveWhitespace() self.name = ("".join(White.whiteStrs[c] for c in self.matchWhite)) self.mayReturnEmpty = True self.errmsg = "Expected " + self.name self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact def parseImpl( self, instring, loc, doActions=True ): if not(instring[ loc ] in self.matchWhite): raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 maxloc = start + self.maxLen maxloc = min( maxloc, len(instring) ) while loc < maxloc and instring[loc] in self.matchWhite: loc += 1 if loc - start < self.minLen: raise ParseException(instring, loc, self.errmsg, self) return loc, instring[start:loc] class _PositionToken(Token): def __init__( self ): super(_PositionToken,self).__init__() self.name=self.__class__.__name__ self.mayReturnEmpty = True self.mayIndexError = False class GoToColumn(_PositionToken): """ Token to advance to a specific column of input text; useful for tabular report scraping. """ def __init__( self, colno ): super(GoToColumn,self).__init__() self.col = colno def preParse( self, instring, loc ): if col(loc,instring) != self.col: instrlen = len(instring) if self.ignoreExprs: loc = self._skipIgnorables( instring, loc ) while loc < instrlen and instring[loc].isspace() and col( loc, instring ) != self.col : loc += 1 return loc def parseImpl( self, instring, loc, doActions=True ): thiscol = col( loc, instring ) if thiscol > self.col: raise ParseException( instring, loc, "Text not in expected column", self ) newloc = loc + self.col - thiscol ret = instring[ loc: newloc ] return newloc, ret class LineStart(_PositionToken): """ Matches if current position is at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) Prints:: ['AAA', ' this line'] ['AAA', ' and this line'] """ def __init__( self ): super(LineStart,self).__init__() self.errmsg = "Expected start of line" def parseImpl( self, instring, loc, doActions=True ): if col(loc, instring) == 1: return loc, [] raise ParseException(instring, loc, self.errmsg, self) class LineEnd(_PositionToken): """ Matches if current position is at the end of a line within the parse string """ def __init__( self ): super(LineEnd,self).__init__() self.setWhitespaceChars( ParserElement.DEFAULT_WHITE_CHARS.replace("\n","") ) self.errmsg = "Expected end of line" def parseImpl( self, instring, loc, doActions=True ): if loc len(instring): return loc, [] else: raise ParseException(instring, loc, self.errmsg, self) class WordStart(_PositionToken): """ Matches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{\b} behavior of regular expressions, use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of the string being parsed, or at the beginning of a line. """ def __init__(self, wordChars = printables): super(WordStart,self).__init__() self.wordChars = set(wordChars) self.errmsg = "Not at the start of a word" def parseImpl(self, instring, loc, doActions=True ): if loc != 0: if (instring[loc-1] in self.wordChars or instring[loc] not in self.wordChars): raise ParseException(instring, loc, self.errmsg, self) return loc, [] class WordEnd(_PositionToken): """ Matches if the current position is at the end of a Word, and is not followed by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{\b} behavior of regular expressions, use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of the string being parsed, or at the end of a line. """ def __init__(self, wordChars = printables): super(WordEnd,self).__init__() self.wordChars = set(wordChars) self.skipWhitespace = False self.errmsg = "Not at the end of a word" def parseImpl(self, instring, loc, doActions=True ): instrlen = len(instring) if instrlen>0 and loc maxExcLoc: maxException = err maxExcLoc = err.loc except IndexError: if len(instring) > maxExcLoc: maxException = ParseException(instring,len(instring),e.errmsg,self) maxExcLoc = len(instring) else: # save match among all matches, to retry longest to shortest matches.append((loc2, e)) if matches: matches.sort(key=lambda x: -x[0]) for _,e in matches: try: return e._parse( instring, loc, doActions ) except ParseException as err: err.__traceback__ = None if err.loc > maxExcLoc: maxException = err maxExcLoc = err.loc if maxException is not None: maxException.msg = self.errmsg raise maxException else: raise ParseException(instring, loc, "no defined alternatives to match", self) def __ixor__(self, other ): if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) return self.append( other ) #Or( [ self, other ] ) def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "{" + " ^ ".join(_ustr(e) for e in self.exprs) + "}" return self.strRepr def checkRecursion( self, parseElementList ): subRecCheckList = parseElementList[:] + [ self ] for e in self.exprs: e.checkRecursion( subRecCheckList ) class MatchFirst(ParseExpression): """ Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] """ def __init__( self, exprs, savelist = False ): super(MatchFirst,self).__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) else: self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): maxExcLoc = -1 maxException = None for e in self.exprs: try: ret = e._parse( instring, loc, doActions ) return ret except ParseException as err: if err.loc > maxExcLoc: maxException = err maxExcLoc = err.loc except IndexError: if len(instring) > maxExcLoc: maxException = ParseException(instring,len(instring),e.errmsg,self) maxExcLoc = len(instring) # only got here if no expression matched, raise exception for match that made it the furthest else: if maxException is not None: maxException.msg = self.errmsg raise maxException else: raise ParseException(instring, loc, "no defined alternatives to match", self) def __ior__(self, other ): if isinstance( other, basestring ): other = ParserElement._literalStringClass( other ) return self.append( other ) #MatchFirst( [ self, other ] ) def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "{" + " | ".join(_ustr(e) for e in self.exprs) + "}" return self.strRepr def checkRecursion( self, parseElementList ): subRecCheckList = parseElementList[:] + [ self ] for e in self.exprs: e.checkRecursion( subRecCheckList ) class Each(ParseExpression): """ Requires all given C{ParseExpression}s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the C{'&'} operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 """ def __init__( self, exprs, savelist = True ): super(Each,self).__init__(exprs, savelist) self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = True self.initExprGroups = True def parseImpl( self, instring, loc, doActions=True ): if self.initExprGroups: self.opt1map = dict((id(e.expr),e) for e in self.exprs if isinstance(e,Optional)) opt1 = [ e.expr for e in self.exprs if isinstance(e,Optional) ] opt2 = [ e for e in self.exprs if e.mayReturnEmpty and not isinstance(e,Optional)] self.optionals = opt1 + opt2 self.multioptionals = [ e.expr for e in self.exprs if isinstance(e,ZeroOrMore) ] self.multirequired = [ e.expr for e in self.exprs if isinstance(e,OneOrMore) ] self.required = [ e for e in self.exprs if not isinstance(e,(Optional,ZeroOrMore,OneOrMore)) ] self.required += self.multirequired self.initExprGroups = False tmpLoc = loc tmpReqd = self.required[:] tmpOpt = self.optionals[:] matchOrder = [] keepMatching = True while keepMatching: tmpExprs = tmpReqd + tmpOpt + self.multioptionals + self.multirequired failed = [] for e in tmpExprs: try: tmpLoc = e.tryParse( instring, tmpLoc ) except ParseException: failed.append(e) else: matchOrder.append(self.opt1map.get(id(e),e)) if e in tmpReqd: tmpReqd.remove(e) elif e in tmpOpt: tmpOpt.remove(e) if len(failed) == len(tmpExprs): keepMatching = False if tmpReqd: missing = ", ".join(_ustr(e) for e in tmpReqd) raise ParseException(instring,loc,"Missing one or more required elements (%s)" % missing ) # add any unmatched Optionals, in case they have default values defined matchOrder += [e for e in self.exprs if isinstance(e,Optional) and e.expr in tmpOpt] resultlist = [] for e in matchOrder: loc,results = e._parse(instring,loc,doActions) resultlist.append(results) finalResults = sum(resultlist, ParseResults([])) return loc, finalResults def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "{" + " & ".join(_ustr(e) for e in self.exprs) + "}" return self.strRepr def checkRecursion( self, parseElementList ): subRecCheckList = parseElementList[:] + [ self ] for e in self.exprs: e.checkRecursion( subRecCheckList ) class ParseElementEnhance(ParserElement): """ Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. """ def __init__( self, expr, savelist=False ): super(ParseElementEnhance,self).__init__(savelist) if isinstance( expr, basestring ): if issubclass(ParserElement._literalStringClass, Token): expr = ParserElement._literalStringClass(expr) else: expr = ParserElement._literalStringClass(Literal(expr)) self.expr = expr self.strRepr = None if expr is not None: self.mayIndexError = expr.mayIndexError self.mayReturnEmpty = expr.mayReturnEmpty self.setWhitespaceChars( expr.whiteChars ) self.skipWhitespace = expr.skipWhitespace self.saveAsList = expr.saveAsList self.callPreparse = expr.callPreparse self.ignoreExprs.extend(expr.ignoreExprs) def parseImpl( self, instring, loc, doActions=True ): if self.expr is not None: return self.expr._parse( instring, loc, doActions, callPreParse=False ) else: raise ParseException("",loc,self.errmsg,self) def leaveWhitespace( self ): self.skipWhitespace = False self.expr = self.expr.copy() if self.expr is not None: self.expr.leaveWhitespace() return self def ignore( self, other ): if isinstance( other, Suppress ): if other not in self.ignoreExprs: super( ParseElementEnhance, self).ignore( other ) if self.expr is not None: self.expr.ignore( self.ignoreExprs[-1] ) else: super( ParseElementEnhance, self).ignore( other ) if self.expr is not None: self.expr.ignore( self.ignoreExprs[-1] ) return self def streamline( self ): super(ParseElementEnhance,self).streamline() if self.expr is not None: self.expr.streamline() return self def checkRecursion( self, parseElementList ): if self in parseElementList: raise RecursiveGrammarException( parseElementList+[self] ) subRecCheckList = parseElementList[:] + [ self ] if self.expr is not None: self.expr.checkRecursion( subRecCheckList ) def validate( self, validateTrace=[] ): tmp = validateTrace[:]+[self] if self.expr is not None: self.expr.validate(tmp) self.checkRecursion( [] ) def __str__( self ): try: return super(ParseElementEnhance,self).__str__() except Exception: pass if self.strRepr is None and self.expr is not None: self.strRepr = "%s:(%s)" % ( self.__class__.__name__, _ustr(self.expr) ) return self.strRepr class FollowedBy(ParseElementEnhance): """ Lookahead matching of the given parse expression. C{FollowedBy} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. C{FollowedBy} always returns a null token list. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] """ def __init__( self, expr ): super(FollowedBy,self).__init__(expr) self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): self.expr.tryParse( instring, loc ) return loc, [] class NotAny(ParseElementEnhance): """ Lookahead to disallow matching with the given parse expression. C{NotAny} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression does I{not} match at the current position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} always returns a null token list. May be constructed using the '~' operator. Example:: """ def __init__( self, expr ): super(NotAny,self).__init__(expr) #~ self.leaveWhitespace() self.skipWhitespace = False # do NOT use self.leaveWhitespace(), don't want to propagate to exprs self.mayReturnEmpty = True self.errmsg = "Found unwanted token, "+_ustr(self.expr) def parseImpl( self, instring, loc, doActions=True ): if self.expr.canParseNext(instring, loc): raise ParseException(instring, loc, self.errmsg, self) return loc, [] def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "~{" + _ustr(self.expr) + "}" return self.strRepr class _MultipleMatch(ParseElementEnhance): def __init__( self, expr, stopOn=None): super(_MultipleMatch, self).__init__(expr) self.saveAsList = True ender = stopOn if isinstance(ender, basestring): ender = ParserElement._literalStringClass(ender) self.not_ender = ~ender if ender is not None else None def parseImpl( self, instring, loc, doActions=True ): self_expr_parse = self.expr._parse self_skip_ignorables = self._skipIgnorables check_ender = self.not_ender is not None if check_ender: try_not_ender = self.not_ender.tryParse # must be at least one (but first see if we are the stopOn sentinel; # if so, fail) if check_ender: try_not_ender(instring, loc) loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False ) try: hasIgnoreExprs = (not not self.ignoreExprs) while 1: if check_ender: try_not_ender(instring, loc) if hasIgnoreExprs: preloc = self_skip_ignorables( instring, loc ) else: preloc = loc loc, tmptokens = self_expr_parse( instring, preloc, doActions ) if tmptokens or tmptokens.haskeys(): tokens += tmptokens except (ParseException,IndexError): pass return loc, tokens class OneOrMore(_MultipleMatch): """ Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() """ def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "{" + _ustr(self.expr) + "}..." return self.strRepr class ZeroOrMore(_MultipleMatch): """ Optional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to L{OneOrMore} """ def __init__( self, expr, stopOn=None): super(ZeroOrMore,self).__init__(expr, stopOn=stopOn) self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): try: return super(ZeroOrMore, self).parseImpl(instring, loc, doActions) except (ParseException,IndexError): return loc, [] def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "[" + _ustr(self.expr) + "]..." return self.strRepr class _NullToken(object): def __bool__(self): return False __nonzero__ = __bool__ def __str__(self): return "" _optionalNotMatched = _NullToken() class Optional(ParseElementEnhance): """ Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) """ def __init__( self, expr, default=_optionalNotMatched ): super(Optional,self).__init__( expr, savelist=False ) self.saveAsList = self.expr.saveAsList self.defaultValue = default self.mayReturnEmpty = True def parseImpl( self, instring, loc, doActions=True ): try: loc, tokens = self.expr._parse( instring, loc, doActions, callPreParse=False ) except (ParseException,IndexError): if self.defaultValue is not _optionalNotMatched: if self.expr.resultsName: tokens = ParseResults([ self.defaultValue ]) tokens[self.expr.resultsName] = self.defaultValue else: tokens = [ self.defaultValue ] else: tokens = [] return loc, tokens def __str__( self ): if hasattr(self,"name"): return self.name if self.strRepr is None: self.strRepr = "[" + _ustr(self.expr) + "]" return self.strRepr class SkipTo(ParseElementEnhance): """ Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default=C{False}) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default=C{None}) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default=C{None}) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor """ def __init__( self, other, include=False, ignore=None, failOn=None ): super( SkipTo, self ).__init__( other ) self.ignoreExpr = ignore self.mayReturnEmpty = True self.mayIndexError = False self.includeMatch = include self.asList = False if isinstance(failOn, basestring): self.failOn = ParserElement._literalStringClass(failOn) else: self.failOn = failOn self.errmsg = "No match found for "+_ustr(self.expr) def parseImpl( self, instring, loc, doActions=True ): startloc = loc instrlen = len(instring) expr = self.expr expr_parse = self.expr._parse self_failOn_canParseNext = self.failOn.canParseNext if self.failOn is not None else None self_ignoreExpr_tryParse = self.ignoreExpr.tryParse if self.ignoreExpr is not None else None tmploc = loc while tmploc <= instrlen: if self_failOn_canParseNext is not None: # break if failOn expression matches if self_failOn_canParseNext(instring, tmploc): break if self_ignoreExpr_tryParse is not None: # advance past ignore expressions while 1: try: tmploc = self_ignoreExpr_tryParse(instring, tmploc) except ParseBaseException: break try: expr_parse(instring, tmploc, doActions=False, callPreParse=False) except (ParseException, IndexError): # no match, advance loc in string tmploc += 1 else: # matched skipto expr, done break else: # ran off the end of the input string without matching skipto expr, fail raise ParseException(instring, loc, self.errmsg, self) # build up return values loc = tmploc skiptext = instring[startloc:loc] skipresult = ParseResults(skiptext) if self.includeMatch: loc, mat = expr_parse(instring,loc,doActions,callPreParse=False) skipresult += mat return loc, skipresult class Forward(ParseElementEnhance): """ Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator. Note: take care when assigning to C{Forward} not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the C{Forward}:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See L{ParseResults.pprint} for an example of a recursive parser created using C{Forward}. """ def __init__( self, other=None ): super(Forward,self).__init__( other, savelist=False ) def __lshift__( self, other ): if isinstance( other, basestring ): other = ParserElement._literalStringClass(other) self.expr = other self.strRepr = None self.mayIndexError = self.expr.mayIndexError self.mayReturnEmpty = self.expr.mayReturnEmpty self.setWhitespaceChars( self.expr.whiteChars ) self.skipWhitespace = self.expr.skipWhitespace self.saveAsList = self.expr.saveAsList self.ignoreExprs.extend(self.expr.ignoreExprs) return self def __ilshift__(self, other): return self << other def leaveWhitespace( self ): self.skipWhitespace = False return self def streamline( self ): if not self.streamlined: self.streamlined = True if self.expr is not None: self.expr.streamline() return self def validate( self, validateTrace=[] ): if self not in validateTrace: tmp = validateTrace[:]+[self] if self.expr is not None: self.expr.validate(tmp) self.checkRecursion([]) def __str__( self ): if hasattr(self,"name"): return self.name return self.__class__.__name__ + ": ..." # stubbed out for now - creates awful memory and perf issues self._revertClass = self.__class__ self.__class__ = _ForwardNoRecurse try: if self.expr is not None: retString = _ustr(self.expr) else: retString = "None" finally: self.__class__ = self._revertClass return self.__class__.__name__ + ": " + retString def copy(self): if self.expr is not None: return super(Forward,self).copy() else: ret = Forward() ret <<= self return ret class _ForwardNoRecurse(Forward): def __str__( self ): return "..." class TokenConverter(ParseElementEnhance): """ Abstract subclass of C{ParseExpression}, for converting parsed results. """ def __init__( self, expr, savelist=False ): super(TokenConverter,self).__init__( expr )#, savelist ) self.saveAsList = False class Combine(TokenConverter): """ Converter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying C{'adjacent=False'} in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) """ def __init__( self, expr, joinString="", adjacent=True ): super(Combine,self).__init__( expr ) # suppress whitespace-stripping in contained parse expressions, but re-enable it on the Combine itself if adjacent: self.leaveWhitespace() self.adjacent = adjacent self.skipWhitespace = True self.joinString = joinString self.callPreparse = True def ignore( self, other ): if self.adjacent: ParserElement.ignore(self, other) else: super( Combine, self).ignore( other ) return self def postParse( self, instring, loc, tokenlist ): retToks = tokenlist.copy() del retToks[:] retToks += ParseResults([ "".join(tokenlist._asStringList(self.joinString)) ], modal=self.modalResults) if self.resultsName and retToks.haskeys(): return [ retToks ] else: return retToks class Group(TokenConverter): """ Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a,b,100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a,b,100")) # -> ['fn', ['a', 'b', '100']] """ def __init__( self, expr ): super(Group,self).__init__( expr ) self.saveAsList = True def postParse( self, instring, loc, tokenlist ): return [ tokenlist ] class Dict(TokenConverter): """ Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at L{ParseResults} of accessing fields by results name. """ def __init__( self, expr ): super(Dict,self).__init__( expr ) self.saveAsList = True def postParse( self, instring, loc, tokenlist ): for i,tok in enumerate(tokenlist): if len(tok) == 0: continue ikey = tok[0] if isinstance(ikey,int): ikey = _ustr(tok[0]).strip() if len(tok)==1: tokenlist[ikey] = _ParseResultsWithOffset("",i) elif len(tok)==2 and not isinstance(tok[1],ParseResults): tokenlist[ikey] = _ParseResultsWithOffset(tok[1],i) else: dictvalue = tok.copy() #ParseResults(i) del dictvalue[0] if len(dictvalue)!= 1 or (isinstance(dictvalue,ParseResults) and dictvalue.haskeys()): tokenlist[ikey] = _ParseResultsWithOffset(dictvalue,i) else: tokenlist[ikey] = _ParseResultsWithOffset(dictvalue[0],i) if self.resultsName: return [ tokenlist ] else: return tokenlist class Suppress(TokenConverter): """ Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also L{delimitedList}.) """ def postParse( self, instring, loc, tokenlist ): return [] def suppress( self ): return self class OnlyOnce(object): """ Wrapper for parse actions, to ensure they are only called once. """ def __init__(self, methodCall): self.callable = _trim_arity(methodCall) self.called = False def __call__(self,s,l,t): if not self.called: results = self.callable(s,l,t) self.called = True return results raise ParseException(s,l,"") def reset(self): self.called = False def traceParseAction(f): """ Decorator for debugging parse actions. When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <3: thisFunc = paArgs[0].__class__.__name__ + '.' + thisFunc sys.stderr.write( ">>entering %s(line: '%s', %d, %r)\n" % (thisFunc,line(l,s),l,t) ) try: ret = f(*paArgs) except Exception as exc: sys.stderr.write( "< ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] """ dlName = _ustr(expr)+" ["+_ustr(delim)+" "+_ustr(expr)+"]..." if combine: return Combine( expr + ZeroOrMore( delim + expr ) ).setName(dlName) else: return ( expr + ZeroOrMore( Suppress( delim ) + expr ) ).setName(dlName) def countedArray( expr, intExpr=None ): """ Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] """ arrayExpr = Forward() def countFieldParseAction(s,l,t): n = t[0] arrayExpr << (n and Group(And([expr]*n)) or Group(empty)) return [] if intExpr is None: intExpr = Word(nums).setParseAction(lambda t:int(t[0])) else: intExpr = intExpr.copy() intExpr.setName("arrayLen") intExpr.addParseAction(countFieldParseAction, callDuringTry=True) return ( intExpr + arrayExpr ).setName('(len) ' + _ustr(expr) + '...') def _flatten(L): ret = [] for i in L: if isinstance(i,list): ret.extend(_flatten(i)) else: ret.append(i) return ret def matchPreviousLiteral(expr): """ Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches a previous literal, will also match the leading C{"1:1"} in C{"1:10"}. If this is not desired, use C{matchPreviousExpr}. Do I{not} use with packrat parsing enabled. """ rep = Forward() def copyTokenToRepeater(s,l,t): if t: if len(t) == 1: rep << t[0] else: # flatten t tokens tflat = _flatten(t.asList()) rep << And(Literal(tt) for tt in tflat) else: rep << Empty() expr.addParseAction(copyTokenToRepeater, callDuringTry=True) rep.setName('(prev) ' + _ustr(expr)) return rep def matchPreviousExpr(expr): """ Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches by expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; the expressions are evaluated first, and then compared, so C{"1"} is compared with C{"10"}. Do I{not} use with packrat parsing enabled. """ rep = Forward() e2 = expr.copy() rep <<= e2 def copyTokenToRepeater(s,l,t): matchTokens = _flatten(t.asList()) def mustMatchTheseTokens(s,l,t): theseTokens = _flatten(t.asList()) if theseTokens != matchTokens: raise ParseException("",0,"") rep.setParseAction( mustMatchTheseTokens, callDuringTry=True ) expr.addParseAction(copyTokenToRepeater, callDuringTry=True) rep.setName('(prev) ' + _ustr(expr)) return rep def _escapeRegexRangeChars(s): #~ escape these chars: ^-] for c in r"\^-]": s = s.replace(c,_bslash+c) s = s.replace("\n",r"\n") s = s.replace("\t",r"\t") return _ustr(s) def oneOf( strs, caseless=False, useRegex=True ): """ Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a C{L{MatchFirst}} for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default=C{False}) - treat all literals as caseless - useRegex - (default=C{True}) - as an optimization, will generate a Regex object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or if creating a C{Regex} raises an exception) Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] """ if caseless: isequal = ( lambda a,b: a.upper() == b.upper() ) masks = ( lambda a,b: b.upper().startswith(a.upper()) ) parseElementClass = CaselessLiteral else: isequal = ( lambda a,b: a == b ) masks = ( lambda a,b: b.startswith(a) ) parseElementClass = Literal symbols = [] if isinstance(strs,basestring): symbols = strs.split() elif isinstance(strs, Iterable): symbols = list(strs) else: warnings.warn("Invalid argument to oneOf, expected string or iterable", SyntaxWarning, stacklevel=2) if not symbols: return NoMatch() i = 0 while i < len(symbols)-1: cur = symbols[i] for j,other in enumerate(symbols[i+1:]): if ( isequal(other, cur) ): del symbols[i+j+1] break elif ( masks(cur, other) ): del symbols[i+j+1] symbols.insert(i,other) cur = other break else: i += 1 if not caseless and useRegex: #~ print (strs,"->", "|".join( [ _escapeRegexChars(sym) for sym in symbols] )) try: if len(symbols)==len("".join(symbols)): return Regex( "[%s]" % "".join(_escapeRegexRangeChars(sym) for sym in symbols) ).setName(' | '.join(symbols)) else: return Regex( "|".join(re.escape(sym) for sym in symbols) ).setName(' | '.join(symbols)) except Exception: warnings.warn("Exception creating Regex for oneOf, building MatchFirst", SyntaxWarning, stacklevel=2) # last resort, just use MatchFirst return MatchFirst(parseElementClass(sym) for sym in symbols).setName(' | '.join(symbols)) def dictOf( key, value ): """ Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the C{Dict} results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} """ return Dict( ZeroOrMore( Group ( key + value ) ) ) def originalTextFor(expr, asString=True): """ Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional C{asString} argument is passed as C{False}, then the return value is a C{L{ParseResults}} containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to C{L{originalTextFor}} contains expressions with defined results names, you must set C{asString} to C{False} if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] """ locMarker = Empty().setParseAction(lambda s,loc,t: loc) endlocMarker = locMarker.copy() endlocMarker.callPreparse = False matchExpr = locMarker("_original_start") + expr + endlocMarker("_original_end") if asString: extractText = lambda s,l,t: s[t._original_start:t._original_end] else: def extractText(s,l,t): t[:] = [s[t.pop('_original_start'):t.pop('_original_end')]] matchExpr.setParseAction(extractText) matchExpr.ignoreExprs = expr.ignoreExprs return matchExpr def ungroup(expr): """ Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. """ return TokenConverter(expr).setParseAction(lambda t:t[0]) def locatedExpr(expr): """ Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains C{} characters, you may want to call C{L{ParserElement.parseWithTabs}} Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] """ locator = Empty().setParseAction(lambda s,l,t: l) return Group(locator("locn_start") + expr("value") + locator.copy().leaveWhitespace()("locn_end")) # convenience constants for positional expressions empty = Empty().setName("empty") lineStart = LineStart().setName("lineStart") lineEnd = LineEnd().setName("lineEnd") stringStart = StringStart().setName("stringStart") stringEnd = StringEnd().setName("stringEnd") _escapedPunc = Word( _bslash, r"\[]-*.$+^?()~ ", exact=2 ).setParseAction(lambda s,l,t:t[0][1]) _escapedHexChar = Regex(r"\\0?[xX][0-9a-fA-F]+").setParseAction(lambda s,l,t:unichr(int(t[0].lstrip(r'\0x'),16))) _escapedOctChar = Regex(r"\\0[0-7]+").setParseAction(lambda s,l,t:unichr(int(t[0][1:],8))) _singleChar = _escapedPunc | _escapedHexChar | _escapedOctChar | CharsNotIn(r'\]', exact=1) _charRange = Group(_singleChar + Suppress("-") + _singleChar) _reBracketExpr = Literal("[") + Optional("^").setResultsName("negate") + Group( OneOrMore( _charRange | _singleChar ) ).setResultsName("body") + "]" def srange(s): r""" Helper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as C{\-} or C{\]}) - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) (C{\0x##} is also supported for backwards compatibility) - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) """ _expanded = lambda p: p if not isinstance(p,ParseResults) else ''.join(unichr(c) for c in range(ord(p[0]),ord(p[1])+1)) try: return "".join(_expanded(part) for part in _reBracketExpr.parseString(s).body) except Exception: return "" def matchOnlyAtCol(n): """ Helper method for defining parse actions that require matching at a specific column in the input text. """ def verifyCol(strg,locn,toks): if col(locn,strg) != n: raise ParseException(strg,locn,"matched token not at column %d" % n) return verifyCol def replaceWith(replStr): """ Helper method for common parse actions that simply return a literal value. Especially useful when used with C{L{transformString}()}. Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] """ return lambda s,l,t: [replStr] def removeQuotes(s,l,t): """ Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] """ return t[0][1:-1] def tokenMap(func, *args): """ Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the parsed data to an integer using base 16. Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] """ def pa(s,l,t): return [func(tokn, *args) for tokn in t] try: func_name = getattr(func, '__name__', getattr(func, '__class__').__name__) except Exception: func_name = str(func) pa.__name__ = func_name return pa upcaseTokens = tokenMap(lambda t: _ustr(t).upper()) """(Deprecated) Helper parse action to convert tokens to upper case. Deprecated in favor of L{pyparsing_common.upcaseTokens}""" downcaseTokens = tokenMap(lambda t: _ustr(t).lower()) """(Deprecated) Helper parse action to convert tokens to lower case. Deprecated in favor of L{pyparsing_common.downcaseTokens}""" def _makeTags(tagStr, xml): """Internal helper to construct opening and closing tag expressions, given a tag name""" if isinstance(tagStr,basestring): resname = tagStr tagStr = Keyword(tagStr, caseless=not xml) else: resname = tagStr.name tagAttrName = Word(alphas,alphanums+"_-:") if (xml): tagAttrValue = dblQuotedString.copy().setParseAction( removeQuotes ) openTag = Suppress("<") + tagStr("tag") + \ Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") else: printablesLessRAbrack = "".join(c for c in printables if c not in ">") tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) openTag = Suppress("<") + tagStr("tag") + \ Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ Optional( Suppress("=") + tagAttrValue ) ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") closeTag = Combine(_L("") openTag = openTag.setResultsName("start"+"".join(resname.replace(":"," ").title().split())).setName("<%s>" % resname) closeTag = closeTag.setResultsName("end"+"".join(resname.replace(":"," ").title().split())).setName("" % resname) openTag.tag = resname closeTag.tag = resname return openTag, closeTag def makeHTMLTags(tagStr): """ Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> http://pyparsing.wikispaces.com """ return _makeTags( tagStr, False ) def makeXMLTags(tagStr): """ Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to L{makeHTMLTags} """ return _makeTags( tagStr, True ) def withAttribute(*args,**attrDict): """ Helper to create a validating parse action to be used with start tags created with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 """ if args: attrs = args[:] else: attrs = attrDict.items() attrs = [(k,v) for k,v in attrs] def pa(s,l,tokens): for attrName,attrValue in attrs: if attrName not in tokens: raise ParseException(s,l,"no matching attribute " + attrName) if attrValue != withAttribute.ANY_VALUE and tokens[attrName] != attrValue: raise ParseException(s,l,"attribute '%s' has value '%s', must be '%s'" % (attrName, tokens[attrName], attrValue)) return pa withAttribute.ANY_VALUE = object() def withClass(classname, namespace=''): """ Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 """ classattr = "%s:class" % namespace if namespace else "class" return withAttribute(**{classattr : classname}) opAssoc = _Constants() opAssoc.LEFT = object() opAssoc.RIGHT = object() def infixNotation( baseExpr, opList, lpar=Suppress('('), rpar=Suppress(')') ): """ Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] """ ret = Forward() lastExpr = baseExpr | ( lpar + ret + rpar ) for i,operDef in enumerate(opList): opExpr,arity,rightLeftAssoc,pa = (operDef + (None,))[:4] termName = "%s term" % opExpr if arity < 3 else "%s%s term" % opExpr if arity == 3: if opExpr is None or len(opExpr) != 2: raise ValueError("if numterms=3, opExpr must be a tuple or list of two expressions") opExpr1, opExpr2 = opExpr thisExpr = Forward().setName(termName) if rightLeftAssoc == opAssoc.LEFT: if arity == 1: matchExpr = FollowedBy(lastExpr + opExpr) + Group( lastExpr + OneOrMore( opExpr ) ) elif arity == 2: if opExpr is not None: matchExpr = FollowedBy(lastExpr + opExpr + lastExpr) + Group( lastExpr + OneOrMore( opExpr + lastExpr ) ) else: matchExpr = FollowedBy(lastExpr+lastExpr) + Group( lastExpr + OneOrMore(lastExpr) ) elif arity == 3: matchExpr = FollowedBy(lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr) + \ Group( lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr ) else: raise ValueError("operator must be unary (1), binary (2), or ternary (3)") elif rightLeftAssoc == opAssoc.RIGHT: if arity == 1: # try to avoid LR with this extra test if not isinstance(opExpr, Optional): opExpr = Optional(opExpr) matchExpr = FollowedBy(opExpr.expr + thisExpr) + Group( opExpr + thisExpr ) elif arity == 2: if opExpr is not None: matchExpr = FollowedBy(lastExpr + opExpr + thisExpr) + Group( lastExpr + OneOrMore( opExpr + thisExpr ) ) else: matchExpr = FollowedBy(lastExpr + thisExpr) + Group( lastExpr + OneOrMore( thisExpr ) ) elif arity == 3: matchExpr = FollowedBy(lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr) + \ Group( lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr ) else: raise ValueError("operator must be unary (1), binary (2), or ternary (3)") else: raise ValueError("operator must indicate right or left associativity") if pa: if isinstance(pa, (tuple, list)): matchExpr.setParseAction(*pa) else: matchExpr.setParseAction(pa) thisExpr <<= ( matchExpr.setName(termName) | lastExpr ) lastExpr = thisExpr ret <<= lastExpr return ret operatorPrecedence = infixNotation """(Deprecated) Former name of C{L{infixNotation}}, will be dropped in a future release.""" dblQuotedString = Combine(Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*')+'"').setName("string enclosed in double quotes") sglQuotedString = Combine(Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*")+"'").setName("string enclosed in single quotes") quotedString = Combine(Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*')+'"'| Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*")+"'").setName("quotedString using single or double quotes") unicodeString = Combine(_L('u') + quotedString.copy()).setName("unicode string literal") def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.copy()): """ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] """ if opener == closer: raise ValueError("opening and closing strings cannot be the same") if content is None: if isinstance(opener,basestring) and isinstance(closer,basestring): if len(opener) == 1 and len(closer)==1: if ignoreExpr is not None: content = (Combine(OneOrMore(~ignoreExpr + CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS,exact=1)) ).setParseAction(lambda t:t[0].strip())) else: content = (empty.copy()+CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS ).setParseAction(lambda t:t[0].strip())) else: if ignoreExpr is not None: content = (Combine(OneOrMore(~ignoreExpr + ~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=1)) ).setParseAction(lambda t:t[0].strip())) else: content = (Combine(OneOrMore(~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=1)) ).setParseAction(lambda t:t[0].strip())) else: raise ValueError("opening and closing arguments must be strings if no content expression is given") ret = Forward() if ignoreExpr is not None: ret <<= Group( Suppress(opener) + ZeroOrMore( ignoreExpr | ret | content ) + Suppress(closer) ) else: ret <<= Group( Suppress(opener) + ZeroOrMore( ret | content ) + Suppress(closer) ) ret.setName('nested %s%s expression' % (opener,closer)) return ret def indentedBlock(blockStatementExpr, indentStack, indent=True): """ Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] """ def checkPeerIndent(s,l,t): if l >= len(s): return curCol = col(l,s) if curCol != indentStack[-1]: if curCol > indentStack[-1]: raise ParseFatalException(s,l,"illegal nesting") raise ParseException(s,l,"not a peer entry") def checkSubIndent(s,l,t): curCol = col(l,s) if curCol > indentStack[-1]: indentStack.append( curCol ) else: raise ParseException(s,l,"not a subentry") def checkUnindent(s,l,t): if l >= len(s): return curCol = col(l,s) if not(indentStack and curCol < indentStack[-1] and curCol <= indentStack[-2]): raise ParseException(s,l,"not an unindent") indentStack.pop() NL = OneOrMore(LineEnd().setWhitespaceChars("\t ").suppress()) INDENT = (Empty() + Empty().setParseAction(checkSubIndent)).setName('INDENT') PEER = Empty().setParseAction(checkPeerIndent).setName('') UNDENT = Empty().setParseAction(checkUnindent).setName('UNINDENT') if indent: smExpr = Group( Optional(NL) + #~ FollowedBy(blockStatementExpr) + INDENT + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) + UNDENT) else: smExpr = Group( Optional(NL) + (OneOrMore( PEER + Group(blockStatementExpr) + Optional(NL) )) ) blockStatementExpr.ignore(_bslash + LineEnd()) return smExpr.setName('indented block') alphas8bit = srange(r"[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]") punc8bit = srange(r"[\0xa1-\0xbf\0xd7\0xf7]") anyOpenTag,anyCloseTag = makeHTMLTags(Word(alphas,alphanums+"_:").setName('any tag')) _htmlEntityMap = dict(zip("gt lt amp nbsp quot apos".split(),'><& "\'')) commonHTMLEntity = Regex('&(?P' + '|'.join(_htmlEntityMap.keys()) +");").setName("common HTML entity") def replaceHTMLEntity(t): """Helper parser action to replace common HTML entities with their special characters""" return _htmlEntityMap.get(t.entity) # it's easy to get these comment structures wrong - they're very common, so may as well make them available cStyleComment = Combine(Regex(r"/\*(?:[^*]|\*(?!/))*") + '*/').setName("C style comment") "Comment of the form C{/* ... */}" htmlComment = Regex(r"").setName("HTML comment") "Comment of the form C{}" restOfLine = Regex(r".*").leaveWhitespace().setName("rest of line") dblSlashComment = Regex(r"//(?:\\\n|[^\n])*").setName("// comment") "Comment of the form C{// ... (to end of line)}" cppStyleComment = Combine(Regex(r"/\*(?:[^*]|\*(?!/))*") + '*/'| dblSlashComment).setName("C++ style comment") "Comment of either form C{L{cStyleComment}} or C{L{dblSlashComment}}" javaStyleComment = cppStyleComment "Same as C{L{cppStyleComment}}" pythonStyleComment = Regex(r"#.*").setName("Python style comment") "Comment of the form C{# ... (to end of line)}" _commasepitem = Combine(OneOrMore(Word(printables, excludeChars=',') + Optional( Word(" \t") + ~Literal(",") + ~LineEnd() ) ) ).streamline().setName("commaItem") commaSeparatedList = delimitedList( Optional( quotedString.copy() | _commasepitem, default="") ).setName("commaSeparatedList") """(Deprecated) Predefined expression of 1 or more printable words or quoted strings, separated by commas. This expression is deprecated in favor of L{pyparsing_common.comma_separated_list}.""" # some other useful expressions - using lower-case class name since we are really using this as a namespace class pyparsing_common: """ Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (L{integers}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] """ convertToInteger = tokenMap(int) """ Parse action for converting parsed integers to Python int """ convertToFloat = tokenMap(float) """ Parse action for converting parsed numbers to Python float """ integer = Word(nums).setName("integer").setParseAction(convertToInteger) """expression that parses an unsigned integer, returns an int""" hex_integer = Word(hexnums).setName("hex integer").setParseAction(tokenMap(int,16)) """expression that parses a hexadecimal integer, returns an int""" signed_integer = Regex(r'[+-]?\d+').setName("signed integer").setParseAction(convertToInteger) """expression that parses an integer with optional leading sign, returns an int""" fraction = (signed_integer().setParseAction(convertToFloat) + '/' + signed_integer().setParseAction(convertToFloat)).setName("fraction") """fractional expression of an integer divided by an integer, returns a float""" fraction.addParseAction(lambda t: t[0]/t[-1]) mixed_integer = (fraction | signed_integer + Optional(Optional('-').suppress() + fraction)).setName("fraction or mixed integer-fraction") """mixed integer of the form 'integer - fraction', with optional leading integer, returns float""" mixed_integer.addParseAction(sum) real = Regex(r'[+-]?\d+\.\d*').setName("real number").setParseAction(convertToFloat) """expression that parses a floating point number and returns a float""" sci_real = Regex(r'[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)').setName("real number with scientific notation").setParseAction(convertToFloat) """expression that parses a floating point number with optional scientific notation and returns a float""" # streamlining this expression makes the docs nicer-looking number = (sci_real | real | signed_integer).streamline() """any numeric expression, returns the corresponding Python type""" fnumber = Regex(r'[+-]?\d+\.?\d*([eE][+-]?\d+)?').setName("fnumber").setParseAction(convertToFloat) """any int or real number, returned as float""" identifier = Word(alphas+'_', alphanums+'_').setName("identifier") """typical code identifier (leading alpha or '_', followed by 0 or more alphas, nums, or '_')""" ipv4_address = Regex(r'(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}').setName("IPv4 address") "IPv4 address (C{0.0.0.0 - 255.255.255.255})" _ipv6_part = Regex(r'[0-9a-fA-F]{1,4}').setName("hex_integer") _full_ipv6_address = (_ipv6_part + (':' + _ipv6_part)*7).setName("full IPv6 address") _short_ipv6_address = (Optional(_ipv6_part + (':' + _ipv6_part)*(0,6)) + "::" + Optional(_ipv6_part + (':' + _ipv6_part)*(0,6))).setName("short IPv6 address") _short_ipv6_address.addCondition(lambda t: sum(1 for tt in t if pyparsing_common._ipv6_part.matches(tt)) < 8) _mixed_ipv6_address = ("::ffff:" + ipv4_address).setName("mixed IPv6 address") ipv6_address = Combine((_full_ipv6_address | _mixed_ipv6_address | _short_ipv6_address).setName("IPv6 address")).setName("IPv6 address") "IPv6 address (long, short, or mixed form)" mac_address = Regex(r'[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}').setName("MAC address") "MAC address xx:xx:xx:xx:xx (may also have '-' or '.' delimiters)" @staticmethod def convertToDate(fmt="%Y-%m-%d"): """ Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] """ def cvt_fn(s,l,t): try: return datetime.strptime(t[0], fmt).date() except ValueError as ve: raise ParseException(s, l, str(ve)) return cvt_fn @staticmethod def convertToDatetime(fmt="%Y-%m-%dT%H:%M:%S.%f"): """ Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] """ def cvt_fn(s,l,t): try: return datetime.strptime(t[0], fmt) except ValueError as ve: raise ParseException(s, l, str(ve)) return cvt_fn iso8601_date = Regex(r'(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?').setName("ISO8601 date") "ISO8601 date (C{yyyy-mm-dd})" iso8601_datetime = Regex(r'(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?').setName("ISO8601 datetime") "ISO8601 datetime (C{yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)}) - trailing seconds, milliseconds, and timezone optional; accepts separating C{'T'} or C{' '}" uuid = Regex(r'[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}').setName("UUID") "UUID (C{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx})" _html_stripper = anyOpenTag.suppress() | anyCloseTag.suppress() @staticmethod def stripHTMLTags(s, l, tokens): """ Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' """ return pyparsing_common._html_stripper.transformString(tokens[0]) _commasepitem = Combine(OneOrMore(~Literal(",") + ~LineEnd() + Word(printables, excludeChars=',') + Optional( White(" \t") ) ) ).streamline().setName("commaItem") comma_separated_list = delimitedList( Optional( quotedString.copy() | _commasepitem, default="") ).setName("comma separated list") """Predefined expression of 1 or more printable words or quoted strings, separated by commas.""" upcaseTokens = staticmethod(tokenMap(lambda t: _ustr(t).upper())) """Parse action to convert tokens to upper case.""" downcaseTokens = staticmethod(tokenMap(lambda t: _ustr(t).lower())) """Parse action to convert tokens to lower case.""" if __name__ == "__main__": selectToken = CaselessLiteral("select") fromToken = CaselessLiteral("from") ident = Word(alphas, alphanums + "_$") columnName = delimitedList(ident, ".", combine=True).setParseAction(upcaseTokens) columnNameList = Group(delimitedList(columnName)).setName("columns") columnSpec = ('*' | columnNameList) tableName = delimitedList(ident, ".", combine=True).setParseAction(upcaseTokens) tableNameList = Group(delimitedList(tableName)).setName("tables") simpleSQL = selectToken("command") + columnSpec("columns") + fromToken + tableNameList("tables") # demo runTests method, including embedded comments in test string simpleSQL.runTests(""" # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual """) pyparsing_common.number.runTests(""" 100 -100 +100 3.14159 6.02e23 1e-12 """) # any int or real number, returned as float pyparsing_common.fnumber.runTests(""" 100 -100 +100 3.14159 6.02e23 1e-12 """) pyparsing_common.hex_integer.runTests(""" 100 FF """) import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(""" 12345678-1234-5678-1234-567812345678 """) PK![D_imp.pynu[""" Re-implementation of find_module and get_frozen_object from the deprecated imp module. """ import os import importlib.util import importlib.machinery from .py34compat import module_from_spec PY_SOURCE = 1 PY_COMPILED = 2 C_EXTENSION = 3 C_BUILTIN = 6 PY_FROZEN = 7 def find_module(module, paths=None): """Just like 'imp.find_module()', but with package support""" spec = importlib.util.find_spec(module, paths) if spec is None: raise ImportError("Can't find %s" % module) if not spec.has_location and hasattr(spec, 'submodule_search_locations'): spec = importlib.util.spec_from_loader('__init__.py', spec.loader) kind = -1 file = None static = isinstance(spec.loader, type) if spec.origin == 'frozen' or static and issubclass( spec.loader, importlib.machinery.FrozenImporter): kind = PY_FROZEN path = None # imp compabilty suffix = mode = '' # imp compability elif spec.origin == 'built-in' or static and issubclass( spec.loader, importlib.machinery.BuiltinImporter): kind = C_BUILTIN path = None # imp compabilty suffix = mode = '' # imp compability elif spec.has_location: path = spec.origin suffix = os.path.splitext(path)[1] mode = 'r' if suffix in importlib.machinery.SOURCE_SUFFIXES else 'rb' if suffix in importlib.machinery.SOURCE_SUFFIXES: kind = PY_SOURCE elif suffix in importlib.machinery.BYTECODE_SUFFIXES: kind = PY_COMPILED elif suffix in importlib.machinery.EXTENSION_SUFFIXES: kind = C_EXTENSION if kind in {PY_SOURCE, PY_COMPILED}: file = open(path, mode) else: path = None suffix = mode = '' return file, path, (suffix, mode, kind) def get_frozen_object(module, paths=None): spec = importlib.util.find_spec(module, paths) if not spec: raise ImportError("Can't find %s" % module) return spec.loader.get_code(module) def get_module(module, paths, info): spec = importlib.util.find_spec(module, paths) if not spec: raise ImportError("Can't find %s" % module) return module_from_spec(spec) PK!cHː monkey.pynu[""" Monkey patching of distutils. """ import sys import distutils.filelist import platform import types import functools from importlib import import_module import inspect from setuptools.extern import six import setuptools __all__ = [] """ Everything is private. Contact the project team if you think you need this functionality. """ def _get_mro(cls): """ Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. """ if platform.python_implementation() == "Jython": return (cls,) + cls.__bases__ return inspect.getmro(cls) def get_unpatched(item): lookup = ( get_unpatched_class if isinstance(item, six.class_types) else get_unpatched_function if isinstance(item, types.FunctionType) else lambda item: None ) return lookup(item) def get_unpatched_class(cls): """Protect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. """ external_bases = ( cls for cls in _get_mro(cls) if not cls.__module__.startswith('setuptools') ) base = next(external_bases) if not base.__module__.startswith('distutils'): msg = "distutils has already been patched by %r" % cls raise AssertionError(msg) return base def patch_all(): # we can't patch distutils.cmd, alas distutils.core.Command = setuptools.Command has_issue_12885 = sys.version_info <= (3, 5, 3) if has_issue_12885: # fix findall bug in distutils (http://bugs.python.org/issue12885) distutils.filelist.findall = setuptools.findall needs_warehouse = ( sys.version_info < (2, 7, 13) or (3, 4) < sys.version_info < (3, 4, 6) or (3, 5) < sys.version_info <= (3, 5, 3) ) if needs_warehouse: warehouse = 'https://upload.pypi.org/legacy/' distutils.config.PyPIRCCommand.DEFAULT_REPOSITORY = warehouse _patch_distribution_metadata() # Install Distribution throughout the distutils for module in distutils.dist, distutils.core, distutils.cmd: module.Distribution = setuptools.dist.Distribution # Install the patched Extension distutils.core.Extension = setuptools.extension.Extension distutils.extension.Extension = setuptools.extension.Extension if 'distutils.command.build_ext' in sys.modules: sys.modules['distutils.command.build_ext'].Extension = ( setuptools.extension.Extension ) patch_for_msvc_specialized_compiler() def _patch_distribution_metadata(): """Patch write_pkg_file and read_pkg_file for higher metadata standards""" for attr in ('write_pkg_file', 'read_pkg_file', 'get_metadata_version'): new_val = getattr(setuptools.dist, attr) setattr(distutils.dist.DistributionMetadata, attr, new_val) def patch_func(replacement, target_mod, func_name): """ Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. """ original = getattr(target_mod, func_name) # set the 'unpatched' attribute on the replacement to # point to the original. vars(replacement).setdefault('unpatched', original) # replace the function in the original module setattr(target_mod, func_name, replacement) def get_unpatched_function(candidate): return getattr(candidate, 'unpatched') def patch_for_msvc_specialized_compiler(): """ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. """ # import late to avoid circular imports on Python < 3.5 msvc = import_module('setuptools.msvc') if platform.system() != 'Windows': # Compilers only availables on Microsoft Windows return def patch_params(mod_name, func_name): """ Prepare the parameters for patch_func to patch indicated function. """ repl_prefix = 'msvc9_' if 'msvc9' in mod_name else 'msvc14_' repl_name = repl_prefix + func_name.lstrip('_') repl = getattr(msvc, repl_name) mod = import_module(mod_name) if not hasattr(mod, func_name): raise ImportError(func_name) return repl, mod, func_name # Python 2.7 to 3.4 msvc9 = functools.partial(patch_params, 'distutils.msvc9compiler') # Python 3.5+ msvc14 = functools.partial(patch_params, 'distutils._msvccompiler') try: # Patch distutils.msvc9compiler patch_func(*msvc9('find_vcvarsall')) patch_func(*msvc9('query_vcvarsall')) except ImportError: pass try: # Patch distutils._msvccompiler._get_vc_env patch_func(*msvc14('_get_vc_env')) except ImportError: pass try: # Patch distutils._msvccompiler.gen_lib_options for Numpy patch_func(*msvc14('gen_lib_options')) except ImportError: pass PK!Ƶc}%}% build_meta.pynu["""A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. """ import io import os import sys import tokenize import shutil import contextlib import setuptools import distutils from setuptools.py31compat import TemporaryDirectory from pkg_resources import parse_requirements from pkg_resources.py31compat import makedirs __all__ = ['get_requires_for_build_sdist', 'get_requires_for_build_wheel', 'prepare_metadata_for_build_wheel', 'build_wheel', 'build_sdist', '__legacy__', 'SetupRequirementsError'] class SetupRequirementsError(BaseException): def __init__(self, specifiers): self.specifiers = specifiers class Distribution(setuptools.dist.Distribution): def fetch_build_eggs(self, specifiers): specifier_list = list(map(str, parse_requirements(specifiers))) raise SetupRequirementsError(specifier_list) @classmethod @contextlib.contextmanager def patch(cls): """ Replace distutils.dist.Distribution with this class for the duration of this context. """ orig = distutils.core.Distribution distutils.core.Distribution = cls try: yield finally: distutils.core.Distribution = orig def _to_str(s): """ Convert a filename to a string (on Python 2, explicitly a byte string, not Unicode) as distutils checks for the exact type str. """ if sys.version_info[0] == 2 and not isinstance(s, str): # Assume it's Unicode, as that's what the PEP says # should be provided. return s.encode(sys.getfilesystemencoding()) return s def _get_immediate_subdirectories(a_dir): return [name for name in os.listdir(a_dir) if os.path.isdir(os.path.join(a_dir, name))] def _file_with_extension(directory, extension): matching = ( f for f in os.listdir(directory) if f.endswith(extension) ) file, = matching return file def _open_setup_script(setup_script): if not os.path.exists(setup_script): # Supply a default setup.py return io.StringIO(u"from setuptools import setup; setup()") return getattr(tokenize, 'open', open)(setup_script) class _BuildMetaBackend(object): def _fix_config(self, config_settings): config_settings = config_settings or {} config_settings.setdefault('--global-option', []) return config_settings def _get_build_requires(self, config_settings, requirements): config_settings = self._fix_config(config_settings) sys.argv = sys.argv[:1] + ['egg_info'] + \ config_settings["--global-option"] try: with Distribution.patch(): self.run_setup() except SetupRequirementsError as e: requirements += e.specifiers return requirements def run_setup(self, setup_script='setup.py'): # Note that we can reuse our build directory between calls # Correctness comes first, then optimization later __file__ = setup_script __name__ = '__main__' with _open_setup_script(__file__) as f: code = f.read().replace(r'\r\n', r'\n') exec(compile(code, __file__, 'exec'), locals()) def get_requires_for_build_wheel(self, config_settings=None): config_settings = self._fix_config(config_settings) return self._get_build_requires(config_settings, requirements=['wheel']) def get_requires_for_build_sdist(self, config_settings=None): config_settings = self._fix_config(config_settings) return self._get_build_requires(config_settings, requirements=[]) def prepare_metadata_for_build_wheel(self, metadata_directory, config_settings=None): sys.argv = sys.argv[:1] + ['dist_info', '--egg-base', _to_str(metadata_directory)] self.run_setup() dist_info_directory = metadata_directory while True: dist_infos = [f for f in os.listdir(dist_info_directory) if f.endswith('.dist-info')] if (len(dist_infos) == 0 and len(_get_immediate_subdirectories(dist_info_directory)) == 1): dist_info_directory = os.path.join( dist_info_directory, os.listdir(dist_info_directory)[0]) continue assert len(dist_infos) == 1 break # PEP 517 requires that the .dist-info directory be placed in the # metadata_directory. To comply, we MUST copy the directory to the root if dist_info_directory != metadata_directory: shutil.move( os.path.join(dist_info_directory, dist_infos[0]), metadata_directory) shutil.rmtree(dist_info_directory, ignore_errors=True) return dist_infos[0] def _build_with_temp_dir(self, setup_command, result_extension, result_directory, config_settings): config_settings = self._fix_config(config_settings) result_directory = os.path.abspath(result_directory) # Build in a temporary directory, then copy to the target. makedirs(result_directory, exist_ok=True) with TemporaryDirectory(dir=result_directory) as tmp_dist_dir: sys.argv = (sys.argv[:1] + setup_command + ['--dist-dir', tmp_dist_dir] + config_settings["--global-option"]) self.run_setup() result_basename = _file_with_extension(tmp_dist_dir, result_extension) result_path = os.path.join(result_directory, result_basename) if os.path.exists(result_path): # os.rename will fail overwriting on non-Unix. os.remove(result_path) os.rename(os.path.join(tmp_dist_dir, result_basename), result_path) return result_basename def build_wheel(self, wheel_directory, config_settings=None, metadata_directory=None): return self._build_with_temp_dir(['bdist_wheel'], '.whl', wheel_directory, config_settings) def build_sdist(self, sdist_directory, config_settings=None): return self._build_with_temp_dir(['sdist', '--formats', 'gztar'], '.tar.gz', sdist_directory, config_settings) class _BuildMetaLegacyBackend(_BuildMetaBackend): """Compatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. """ def run_setup(self, setup_script='setup.py'): # In order to maintain compatibility with scripts assuming that # the setup.py script is in a directory on the PYTHONPATH, inject # '' into sys.path. (pypa/setuptools#1642) sys_path = list(sys.path) # Save the original path script_dir = os.path.dirname(os.path.abspath(setup_script)) if script_dir not in sys.path: sys.path.insert(0, script_dir) try: super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) finally: # While PEP 517 frontends should be calling each hook in a fresh # subprocess according to the standard (and thus it should not be # strictly necessary to restore the old sys.path), we'll restore # the original path so that the path manipulation does not persist # within the hook after run_setup is called. sys.path[:] = sys_path # The primary backend _BACKEND = _BuildMetaBackend() get_requires_for_build_wheel = _BACKEND.get_requires_for_build_wheel get_requires_for_build_sdist = _BACKEND.get_requires_for_build_sdist prepare_metadata_for_build_wheel = _BACKEND.prepare_metadata_for_build_wheel build_wheel = _BACKEND.build_wheel build_sdist = _BACKEND.build_sdist # The legacy backend __legacy__ = _BuildMetaLegacyBackend() PK!}s`zzcommand/py36compat.pynu[import os from glob import glob from distutils.util import convert_path from distutils.command import sdist from setuptools.extern.six.moves import filter class sdist_add_defaults: """ Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. """ def add_defaults(self): """Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. """ self._add_defaults_standards() self._add_defaults_optional() self._add_defaults_python() self._add_defaults_data_files() self._add_defaults_ext() self._add_defaults_c_libs() self._add_defaults_scripts() @staticmethod def _cs_path_exists(fspath): """ Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False """ if not os.path.exists(fspath): return False # make absolute so we always have a directory abspath = os.path.abspath(fspath) directory, filename = os.path.split(abspath) return filename in os.listdir(directory) def _add_defaults_standards(self): standards = [self.READMES, self.distribution.script_name] for fn in standards: if isinstance(fn, tuple): alts = fn got_it = False for fn in alts: if self._cs_path_exists(fn): got_it = True self.filelist.append(fn) break if not got_it: self.warn("standard file not found: should have one of " + ', '.join(alts)) else: if self._cs_path_exists(fn): self.filelist.append(fn) else: self.warn("standard file '%s' not found" % fn) def _add_defaults_optional(self): optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: files = filter(os.path.isfile, glob(pattern)) self.filelist.extend(files) def _add_defaults_python(self): # build_py is used to get: # - python modules # - files defined in package_data build_py = self.get_finalized_command('build_py') # getting python files if self.distribution.has_pure_modules(): self.filelist.extend(build_py.get_source_files()) # getting package_data files # (computed in build_py.data_files by build_py.finalize_options) for pkg, src_dir, build_dir, filenames in build_py.data_files: for filename in filenames: self.filelist.append(os.path.join(src_dir, filename)) def _add_defaults_data_files(self): # getting distribution.data_files if self.distribution.has_data_files(): for item in self.distribution.data_files: if isinstance(item, str): # plain file item = convert_path(item) if os.path.isfile(item): self.filelist.append(item) else: # a (dirname, filenames) tuple dirname, filenames = item for f in filenames: f = convert_path(f) if os.path.isfile(f): self.filelist.append(f) def _add_defaults_ext(self): if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) def _add_defaults_c_libs(self): if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command('build_clib') self.filelist.extend(build_clib.get_source_files()) def _add_defaults_scripts(self): if self.distribution.has_scripts(): build_scripts = self.get_finalized_command('build_scripts') self.filelist.extend(build_scripts.get_source_files()) if hasattr(sdist.sdist, '_add_defaults_standards'): # disable the functionality already available upstream class sdist_add_defaults: pass PK!ARRRcommand/__init__.pynu[__all__ = [ 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts', 'register', 'bdist_wininst', 'upload_docs', 'upload', 'build_clib', 'dist_info', ] from distutils.command.bdist import bdist import sys from setuptools.command import install_scripts if 'egg' not in bdist.format_commands: bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") bdist.format_commands.append('egg') del bdist, sys PK!P#z z command/alias.pynu[from distutils.errors import DistutilsOptionError from setuptools.extern.six.moves import map from setuptools.command.setopt import edit_config, option_base, config_file def shquote(arg): """Quote an argument for later parsing by shlex.split()""" for c in '"', "'", "\\", "#": if c in arg: return repr(arg) if arg.split() != [arg]: return repr(arg) return arg class alias(option_base): """Define a shortcut that invokes one or more commands""" description = "define a shortcut to invoke one or more commands" command_consumes_arguments = True user_options = [ ('remove', 'r', 'remove (unset) the alias'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] def initialize_options(self): option_base.initialize_options(self) self.args = None self.remove = None def finalize_options(self): option_base.finalize_options(self) if self.remove and len(self.args) != 1: raise DistutilsOptionError( "Must specify exactly one argument (the alias name) when " "using --remove" ) def run(self): aliases = self.distribution.get_option_dict('aliases') if not self.args: print("Command Aliases") print("---------------") for alias in aliases: print("setup.py alias", format_alias(alias, aliases)) return elif len(self.args) == 1: alias, = self.args if self.remove: command = None elif alias in aliases: print("setup.py alias", format_alias(alias, aliases)) return else: print("No alias definition found for %r" % alias) return else: alias = self.args[0] command = ' '.join(map(shquote, self.args[1:])) edit_config(self.filename, {'aliases': {alias: command}}, self.dry_run) def format_alias(name, aliases): source, command = aliases[name] if source == config_file('global'): source = '--global-config ' elif source == config_file('user'): source = '--user-config ' elif source == config_file('local'): source = '' else: source = '--filename=%r' % source return source + name + ' ' + command PK!۵?KKcommand/install.pynu[from distutils.errors import DistutilsArgError import inspect import glob import warnings import platform import distutils.command.install as orig import setuptools # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://github.com/pypa/setuptools/issues/199/ _install = orig.install class install(orig.install): """Use easy_install to install the package, w/dependencies""" user_options = orig.install.user_options + [ ('old-and-unmanageable', None, "Try not to use this!"), ('single-version-externally-managed', None, "used by system package builders to create 'flat' eggs"), ] boolean_options = orig.install.boolean_options + [ 'old-and-unmanageable', 'single-version-externally-managed', ] new_commands = [ ('install_egg_info', lambda self: True), ('install_scripts', lambda self: True), ] _nc = dict(new_commands) def initialize_options(self): orig.install.initialize_options(self) self.old_and_unmanageable = None self.single_version_externally_managed = None def finalize_options(self): orig.install.finalize_options(self) if self.root: self.single_version_externally_managed = True elif self.single_version_externally_managed: if not self.root and not self.record: raise DistutilsArgError( "You must specify --record or --root when building system" " packages" ) def handle_extra_path(self): if self.root or self.single_version_externally_managed: # explicit backward-compatibility mode, allow extra_path to work return orig.install.handle_extra_path(self) # Ignore extra_path when installing an egg (or being run by another # command without --root or --single-version-externally-managed self.path_file = None self.extra_dirs = '' def run(self): # Explicit request for old-style install? Just do it if self.old_and_unmanageable or self.single_version_externally_managed: return orig.install.run(self) if not self._called_from_setup(inspect.currentframe()): # Run in backward-compatibility mode to support bdist_* commands. orig.install.run(self) else: self.do_egg_install() @staticmethod def _called_from_setup(run_frame): """ Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. """ if run_frame is None: msg = "Call stack not available. bdist_* commands may fail." warnings.warn(msg) if platform.python_implementation() == 'IronPython': msg = "For best results, pass -X:Frames to enable call stack." warnings.warn(msg) return True res = inspect.getouterframes(run_frame)[2] caller, = res[:1] info = inspect.getframeinfo(caller) caller_module = caller.f_globals.get('__name__', '') return ( caller_module == 'distutils.dist' and info.function == 'run_commands' ) def do_egg_install(self): easy_install = self.distribution.get_command_class('easy_install') cmd = easy_install( self.distribution, args="x", root=self.root, record=self.record, ) cmd.ensure_finalized() # finalize before bdist_egg munges install cmd cmd.always_copy_from = '.' # make sure local-dir eggs get installed # pick up setup-dir .egg files only: no .egg-info cmd.package_index.scan(glob.glob('*.egg')) self.run_command('bdist_egg') args = [self.distribution.get_command_obj('bdist_egg').egg_output] if setuptools.bootstrap_install_from: # Bootstrap self-installation of setuptools args.insert(0, setuptools.bootstrap_install_from) cmd.args = args cmd.run() setuptools.bootstrap_install_from = None # XXX Python 3.1 doesn't see _nc if this is inside the class install.sub_commands = ( [cmd for cmd in orig.install.sub_commands if cmd[0] not in install._nc] + install.new_commands ) PK!\Ҩcommand/install_egg_info.pynu[from distutils import log, dir_util import os from setuptools import Command from setuptools import namespaces from setuptools.archive_util import unpack_archive import pkg_resources class install_egg_info(namespaces.Installer, Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_options = [ ('install-dir=', 'd', "directory to install to"), ] def initialize_options(self): self.install_dir = None def finalize_options(self): self.set_undefined_options('install_lib', ('install_dir', 'install_dir')) ei_cmd = self.get_finalized_command("egg_info") basename = pkg_resources.Distribution( None, None, ei_cmd.egg_name, ei_cmd.egg_version ).egg_name() + '.egg-info' self.source = ei_cmd.egg_info self.target = os.path.join(self.install_dir, basename) self.outputs = [] def run(self): self.run_command('egg_info') if os.path.isdir(self.target) and not os.path.islink(self.target): dir_util.remove_tree(self.target, dry_run=self.dry_run) elif os.path.exists(self.target): self.execute(os.unlink, (self.target,), "Removing " + self.target) if not self.dry_run: pkg_resources.ensure_directory(self.target) self.execute( self.copytree, (), "Copying %s to %s" % (self.source, self.target) ) self.install_namespaces() def get_outputs(self): return self.outputs def copytree(self): # Copy the .egg-info tree to site-packages def skimmer(src, dst): # filter out source-control directories; note that 'src' is always # a '/'-separated path, regardless of platform. 'dst' is a # platform-specific path. for skip in '.svn/', 'CVS/': if src.startswith(skip) or '/' + skip in src: return None self.outputs.append(dst) log.debug("Copying %s to %s", src, dst) return dst unpack_archive(self.source, self.target, skimmer) PK!pcommand/setopt.pynu[from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils import os from setuptools.extern.six.moves import configparser from setuptools import Command __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" """ if kind == 'local': return 'setup.cfg' if kind == 'global': return os.path.join( os.path.dirname(distutils.__file__), 'distutils.cfg' ) if kind == 'user': dot = os.name == 'posix' and '.' or '' return os.path.expanduser(convert_path("~/%spydistutils.cfg" % dot)) raise ValueError( "config_file() type must be 'local', 'global', or 'user'", kind ) def edit_config(filename, settings, dry_run=False): """Edit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. """ log.debug("Reading configuration from %s", filename) opts = configparser.RawConfigParser() opts.read([filename]) for section, options in settings.items(): if options is None: log.info("Deleting section [%s] from %s", section, filename) opts.remove_section(section) else: if not opts.has_section(section): log.debug("Adding new section [%s] to %s", section, filename) opts.add_section(section) for option, value in options.items(): if value is None: log.debug( "Deleting %s.%s from %s", section, option, filename ) opts.remove_option(section, option) if not opts.options(section): log.info("Deleting empty [%s] section from %s", section, filename) opts.remove_section(section) else: log.debug( "Setting %s.%s to %r in %s", section, option, value, filename ) opts.set(section, option, value) log.info("Writing %s", filename) if not dry_run: with open(filename, 'w') as f: opts.write(f) class option_base(Command): """Abstract base class for commands that mess with config files""" user_options = [ ('global-config', 'g', "save options to the site-wide distutils.cfg file"), ('user-config', 'u', "save options to the current user's pydistutils.cfg file"), ('filename=', 'f', "configuration file to use (default=setup.cfg)"), ] boolean_options = [ 'global-config', 'user-config', ] def initialize_options(self): self.global_config = None self.user_config = None self.filename = None def finalize_options(self): filenames = [] if self.global_config: filenames.append(config_file('global')) if self.user_config: filenames.append(config_file('user')) if self.filename is not None: filenames.append(self.filename) if not filenames: filenames.append(config_file('local')) if len(filenames) > 1: raise DistutilsOptionError( "Must specify only one configuration file option", filenames ) self.filename, = filenames class setopt(option_base): """Save command-line options to a file""" description = "set an option in setup.cfg or another config file" user_options = [ ('command=', 'c', 'command to set an option for'), ('option=', 'o', 'option to set'), ('set-value=', 's', 'value of the option'), ('remove', 'r', 'remove (unset) the value'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] def initialize_options(self): option_base.initialize_options(self) self.command = None self.option = None self.set_value = None self.remove = None def finalize_options(self): option_base.finalize_options(self) if self.command is None or self.option is None: raise DistutilsOptionError("Must specify --command *and* --option") if self.set_value is None and not self.remove: raise DistutilsOptionError("Must specify --set-value or --remove") def run(self): edit_config( self.filename, { self.command: {self.option.replace('-', '_'): self.set_value} }, self.dry_run ) PK!l90 G Gcommand/bdist_egg.pynu["""setuptools.command.bdist_egg Build .egg distributions""" from distutils.errors import DistutilsSetupError from distutils.dir_util import remove_tree, mkpath from distutils import log from types import CodeType import sys import os import re import textwrap import marshal from setuptools.extern import six from pkg_resources import get_build_platform, Distribution, ensure_directory from pkg_resources import EntryPoint from setuptools.extension import Library from setuptools import Command try: # Python 2.7 or >=3.2 from sysconfig import get_path, get_python_version def _get_purelib(): return get_path("purelib") except ImportError: from distutils.sysconfig import get_python_lib, get_python_version def _get_purelib(): return get_python_lib(False) def strip_module(filename): if '.' in filename: filename = os.path.splitext(filename)[0] if filename.endswith('module'): filename = filename[:-6] return filename def sorted_walk(dir): """Do os.walk in a reproducible way, independent of indeterministic filesystem readdir order """ for base, dirs, files in os.walk(dir): dirs.sort() files.sort() yield base, dirs, files def write_stub(resource, pyfile): _stub_template = textwrap.dedent(""" def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() """).lstrip() with open(pyfile, 'w') as f: f.write(_stub_template % resource) class bdist_egg(Command): description = "create an \"egg\" distribution" user_options = [ ('bdist-dir=', 'b', "temporary directory for creating the distribution"), ('plat-name=', 'p', "platform name to embed in generated filenames " "(default: %s)" % get_build_platform()), ('exclude-source-files', None, "remove all .py files from the generated egg"), ('keep-temp', 'k', "keep the pseudo-installation tree around after " + "creating the distribution archive"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ] boolean_options = [ 'keep-temp', 'skip-build', 'exclude-source-files' ] def initialize_options(self): self.bdist_dir = None self.plat_name = None self.keep_temp = 0 self.dist_dir = None self.skip_build = 0 self.egg_output = None self.exclude_source_files = None def finalize_options(self): ei_cmd = self.ei_cmd = self.get_finalized_command("egg_info") self.egg_info = ei_cmd.egg_info if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'egg') if self.plat_name is None: self.plat_name = get_build_platform() self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) if self.egg_output is None: # Compute filename of the output egg basename = Distribution( None, None, ei_cmd.egg_name, ei_cmd.egg_version, get_python_version(), self.distribution.has_ext_modules() and self.plat_name ).egg_name() self.egg_output = os.path.join(self.dist_dir, basename + '.egg') def do_install_data(self): # Hack for packages that install data to install's --install-lib self.get_finalized_command('install').install_lib = self.bdist_dir site_packages = os.path.normcase(os.path.realpath(_get_purelib())) old, self.distribution.data_files = self.distribution.data_files, [] for item in old: if isinstance(item, tuple) and len(item) == 2: if os.path.isabs(item[0]): realpath = os.path.realpath(item[0]) normalized = os.path.normcase(realpath) if normalized == site_packages or normalized.startswith( site_packages + os.sep ): item = realpath[len(site_packages) + 1:], item[1] # XXX else: raise ??? self.distribution.data_files.append(item) try: log.info("installing package data to %s", self.bdist_dir) self.call_command('install_data', force=0, root=None) finally: self.distribution.data_files = old def get_outputs(self): return [self.egg_output] def call_command(self, cmdname, **kw): """Invoke reinitialized command `cmdname` with keyword args""" for dirname in INSTALL_DIRECTORY_ATTRS: kw.setdefault(dirname, self.bdist_dir) kw.setdefault('skip_build', self.skip_build) kw.setdefault('dry_run', self.dry_run) cmd = self.reinitialize_command(cmdname, **kw) self.run_command(cmdname) return cmd def run(self): # Generate metadata first self.run_command("egg_info") # We run install_lib before install_data, because some data hacks # pull their data path from the install_lib command. log.info("installing library code to %s", self.bdist_dir) instcmd = self.get_finalized_command('install') old_root = instcmd.root instcmd.root = None if self.distribution.has_c_libraries() and not self.skip_build: self.run_command('build_clib') cmd = self.call_command('install_lib', warn_dir=0) instcmd.root = old_root all_outputs, ext_outputs = self.get_ext_outputs() self.stubs = [] to_compile = [] for (p, ext_name) in enumerate(ext_outputs): filename, ext = os.path.splitext(ext_name) pyfile = os.path.join(self.bdist_dir, strip_module(filename) + '.py') self.stubs.append(pyfile) log.info("creating stub loader for %s", ext_name) if not self.dry_run: write_stub(os.path.basename(ext_name), pyfile) to_compile.append(pyfile) ext_outputs[p] = ext_name.replace(os.sep, '/') if to_compile: cmd.byte_compile(to_compile) if self.distribution.data_files: self.do_install_data() # Make the EGG-INFO directory archive_root = self.bdist_dir egg_info = os.path.join(archive_root, 'EGG-INFO') self.mkpath(egg_info) if self.distribution.scripts: script_dir = os.path.join(egg_info, 'scripts') log.info("installing scripts to %s", script_dir) self.call_command('install_scripts', install_dir=script_dir, no_ep=1) self.copy_metadata_to(egg_info) native_libs = os.path.join(egg_info, "native_libs.txt") if all_outputs: log.info("writing %s", native_libs) if not self.dry_run: ensure_directory(native_libs) libs_file = open(native_libs, 'wt') libs_file.write('\n'.join(all_outputs)) libs_file.write('\n') libs_file.close() elif os.path.isfile(native_libs): log.info("removing %s", native_libs) if not self.dry_run: os.unlink(native_libs) write_safety_flag( os.path.join(archive_root, 'EGG-INFO'), self.zip_safe() ) if os.path.exists(os.path.join(self.egg_info, 'depends.txt')): log.warn( "WARNING: 'depends.txt' will not be used by setuptools 0.6!\n" "Use the install_requires/extras_require setup() args instead." ) if self.exclude_source_files: self.zap_pyfiles() # Make the archive make_zipfile(self.egg_output, archive_root, verbose=self.verbose, dry_run=self.dry_run, mode=self.gen_header()) if not self.keep_temp: remove_tree(self.bdist_dir, dry_run=self.dry_run) # Add to 'Distribution.dist_files' so that the "upload" command works getattr(self.distribution, 'dist_files', []).append( ('bdist_egg', get_python_version(), self.egg_output)) def zap_pyfiles(self): log.info("Removing .py files from temporary directory") for base, dirs, files in walk_egg(self.bdist_dir): for name in files: path = os.path.join(base, name) if name.endswith('.py'): log.debug("Deleting %s", path) os.unlink(path) if base.endswith('__pycache__'): path_old = path pattern = r'(?P.+)\.(?P[^.]+)\.pyc' m = re.match(pattern, name) path_new = os.path.join( base, os.pardir, m.group('name') + '.pyc') log.info( "Renaming file from [%s] to [%s]" % (path_old, path_new)) try: os.remove(path_new) except OSError: pass os.rename(path_old, path_new) def zip_safe(self): safe = getattr(self.distribution, 'zip_safe', None) if safe is not None: return safe log.warn("zip_safe flag not set; analyzing archive contents...") return analyze_egg(self.bdist_dir, self.stubs) def gen_header(self): epm = EntryPoint.parse_map(self.distribution.entry_points or '') ep = epm.get('setuptools.installation', {}).get('eggsecutable') if ep is None: return 'w' # not an eggsecutable, do it the usual way. if not ep.attrs or ep.extras: raise DistutilsSetupError( "eggsecutable entry point (%r) cannot have 'extras' " "or refer to a module" % (ep,) ) pyver = '{}.{}'.format(*sys.version_info) pkg = ep.module_name full = '.'.join(ep.attrs) base = ep.attrs[0] basename = os.path.basename(self.egg_output) header = ( "#!/bin/sh\n" 'if [ `basename $0` = "%(basename)s" ]\n' 'then exec python%(pyver)s -c "' "import sys, os; sys.path.insert(0, os.path.abspath('$0')); " "from %(pkg)s import %(base)s; sys.exit(%(full)s())" '" "$@"\n' 'else\n' ' echo $0 is not the correct name for this egg file.\n' ' echo Please rename it back to %(basename)s and try again.\n' ' exec false\n' 'fi\n' ) % locals() if not self.dry_run: mkpath(os.path.dirname(self.egg_output), dry_run=self.dry_run) f = open(self.egg_output, 'w') f.write(header) f.close() return 'a' def copy_metadata_to(self, target_dir): "Copy metadata (egg info) to the target_dir" # normalize the path (so that a forward-slash in egg_info will # match using startswith below) norm_egg_info = os.path.normpath(self.egg_info) prefix = os.path.join(norm_egg_info, '') for path in self.ei_cmd.filelist.files: if path.startswith(prefix): target = os.path.join(target_dir, path[len(prefix):]) ensure_directory(target) self.copy_file(path, target) def get_ext_outputs(self): """Get a list of relative paths to C extensions in the output distro""" all_outputs = [] ext_outputs = [] paths = {self.bdist_dir: ''} for base, dirs, files in sorted_walk(self.bdist_dir): for filename in files: if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS: all_outputs.append(paths[base] + filename) for filename in dirs: paths[os.path.join(base, filename)] = (paths[base] + filename + '/') if self.distribution.has_ext_modules(): build_cmd = self.get_finalized_command('build_ext') for ext in build_cmd.extensions: if isinstance(ext, Library): continue fullname = build_cmd.get_ext_fullname(ext.name) filename = build_cmd.get_ext_filename(fullname) if not os.path.basename(filename).startswith('dl-'): if os.path.exists(os.path.join(self.bdist_dir, filename)): ext_outputs.append(filename) return all_outputs, ext_outputs NATIVE_EXTENSIONS = dict.fromkeys('.dll .so .dylib .pyd'.split()) def walk_egg(egg_dir): """Walk an unpacked egg's contents, skipping the metadata directory""" walker = sorted_walk(egg_dir) base, dirs, files = next(walker) if 'EGG-INFO' in dirs: dirs.remove('EGG-INFO') yield base, dirs, files for bdf in walker: yield bdf def analyze_egg(egg_dir, stubs): # check for existing flag in EGG-INFO for flag, fn in safety_flags.items(): if os.path.exists(os.path.join(egg_dir, 'EGG-INFO', fn)): return flag if not can_scan(): return False safe = True for base, dirs, files in walk_egg(egg_dir): for name in files: if name.endswith('.py') or name.endswith('.pyw'): continue elif name.endswith('.pyc') or name.endswith('.pyo'): # always scan, even if we already know we're not safe safe = scan_module(egg_dir, base, name, stubs) and safe return safe def write_safety_flag(egg_dir, safe): # Write or remove zip safety flag file(s) for flag, fn in safety_flags.items(): fn = os.path.join(egg_dir, fn) if os.path.exists(fn): if safe is None or bool(safe) != flag: os.unlink(fn) elif safe is not None and bool(safe) == flag: f = open(fn, 'wt') f.write('\n') f.close() safety_flags = { True: 'zip-safe', False: 'not-zip-safe', } def scan_module(egg_dir, base, name, stubs): """Check whether module possibly uses unsafe-for-zipfile stuff""" filename = os.path.join(base, name) if filename[:-1] in stubs: return True # Extension module pkg = base[len(egg_dir) + 1:].replace(os.sep, '.') module = pkg + (pkg and '.' or '') + os.path.splitext(name)[0] if six.PY2: skip = 8 # skip magic & date elif sys.version_info < (3, 7): skip = 12 # skip magic & date & file size else: skip = 16 # skip magic & reserved? & date & file size f = open(filename, 'rb') f.read(skip) code = marshal.load(f) f.close() safe = True symbols = dict.fromkeys(iter_symbols(code)) for bad in ['__file__', '__path__']: if bad in symbols: log.warn("%s: module references %s", module, bad) safe = False if 'inspect' in symbols: for bad in [ 'getsource', 'getabsfile', 'getsourcefile', 'getfile' 'getsourcelines', 'findsource', 'getcomments', 'getframeinfo', 'getinnerframes', 'getouterframes', 'stack', 'trace' ]: if bad in symbols: log.warn("%s: module MAY be using inspect.%s", module, bad) safe = False return safe def iter_symbols(code): """Yield names and strings used by `code` and its nested code objects""" for name in code.co_names: yield name for const in code.co_consts: if isinstance(const, six.string_types): yield const elif isinstance(const, CodeType): for name in iter_symbols(const): yield name def can_scan(): if not sys.platform.startswith('java') and sys.platform != 'cli': # CPython, PyPy, etc. return True log.warn("Unable to analyze compiled code on this platform.") log.warn("Please ask the author to include a 'zip_safe'" " setting (either True or False) in the package's setup.py") # Attribute names of options for commands that might need to be convinced to # install to the egg build directory INSTALL_DIRECTORY_ATTRS = [ 'install_lib', 'install_dir', 'install_data', 'install_base' ] def make_zipfile(zip_filename, base_dir, verbose=0, dry_run=0, compress=True, mode='w'): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. """ import zipfile mkpath(os.path.dirname(zip_filename), dry_run=dry_run) log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) def visit(z, dirname, names): for name in names: path = os.path.normpath(os.path.join(dirname, name)) if os.path.isfile(path): p = path[len(base_dir) + 1:] if not dry_run: z.write(path, p) log.debug("adding '%s'", p) compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED if not dry_run: z = zipfile.ZipFile(zip_filename, mode, compression=compression) for dirname, dirs, files in sorted_walk(base_dir): visit(z, dirname, files) z.close() else: for dirname, dirs, files in sorted_walk(base_dir): visit(None, dirname, files) return zip_filename PK!4command/saveopts.pynu[from setuptools.command.setopt import edit_config, option_base class saveopts(option_base): """Save command-line options to a file""" description = "save supplied options to setup.cfg or other config file" def run(self): dist = self.distribution settings = {} for cmd in dist.command_options: if cmd == 'saveopts': continue # don't save our own options! for opt, (src, val) in dist.get_option_dict(cmd).items(): if src == "command line": settings.setdefault(cmd, {})[opt] = val edit_config(self.filename, settings, self.dry_run) PK!F? command/install_scripts.pynu[from distutils import log import distutils.command.install_scripts as orig import os import sys from pkg_resources import Distribution, PathMetadata, ensure_directory class install_scripts(orig.install_scripts): """Do normal script install, plus any egg_info wrapper scripts""" def initialize_options(self): orig.install_scripts.initialize_options(self) self.no_ep = False def run(self): import setuptools.command.easy_install as ei self.run_command("egg_info") if self.distribution.scripts: orig.install_scripts.run(self) # run first to set up self.outfiles else: self.outfiles = [] if self.no_ep: # don't install entry point scripts into .egg file! return ei_cmd = self.get_finalized_command("egg_info") dist = Distribution( ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), ei_cmd.egg_name, ei_cmd.egg_version, ) bs_cmd = self.get_finalized_command('build_scripts') exec_param = getattr(bs_cmd, 'executable', None) bw_cmd = self.get_finalized_command("bdist_wininst") is_wininst = getattr(bw_cmd, '_is_running', False) writer = ei.ScriptWriter if is_wininst: exec_param = "python.exe" writer = ei.WindowsScriptWriter if exec_param == sys.executable: # In case the path to the Python executable contains a space, wrap # it so it's not split up. exec_param = [exec_param] # resolve the writer to the environment writer = writer.best() cmd = writer.command_spec_class.best().from_param(exec_param) for args in writer.get_args(dist, cmd.as_header()): self.write_script(*args) def write_script(self, script_name, contents, mode="t", *ignored): """Write an executable file to the scripts directory""" from setuptools.command.easy_install import chmod, current_umask log.info("Installing %s script to %s", script_name, self.install_dir) target = os.path.join(self.install_dir, script_name) self.outfiles.append(target) mask = current_umask() if not self.dry_run: ensure_directory(target) f = open(target, "w" + mode) f.write(contents) f.close() chmod(target, 0o777 - mask) PK! u}}command/bdist_wininst.pynu[import distutils.command.bdist_wininst as orig class bdist_wininst(orig.bdist_wininst): def reinitialize_command(self, command, reinit_subcommands=0): """ Supplement reinitialize_command to work around http://bugs.python.org/issue20819 """ cmd = self.distribution.reinitialize_command( command, reinit_subcommands) if command in ('install', 'install_lib'): cmd.install_lib = None return cmd def run(self): self._is_running = True try: orig.bdist_wininst.run(self) finally: self._is_running = False PK!Əcommand/upload_docs.pynu[# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import shutil import itertools import functools from setuptools.extern import six from setuptools.extern.six.moves import http_client, urllib from pkg_resources import iter_entry_points from .upload import upload def _encode(s): errors = 'surrogateescape' if six.PY3 else 'strict' return s.encode('utf-8', errors) class upload_docs(upload): # override the default repository as upload_docs isn't # supported by Warehouse (and won't be). DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi/' description = 'Upload documentation to PyPI' user_options = [ ('repository=', 'r', "url of repository [default: %s]" % upload.DEFAULT_REPOSITORY), ('show-response', None, 'display full response text from server'), ('upload-dir=', None, 'directory to upload'), ] boolean_options = upload.boolean_options def has_sphinx(self): if self.upload_dir is None: for ep in iter_entry_points('distutils.commands', 'build_sphinx'): return True sub_commands = [('build_sphinx', has_sphinx)] def initialize_options(self): upload.initialize_options(self) self.upload_dir = None self.target_dir = None def finalize_options(self): upload.finalize_options(self) if self.upload_dir is None: if self.has_sphinx(): build_sphinx = self.get_finalized_command('build_sphinx') self.target_dir = build_sphinx.builder_target_dir else: build = self.get_finalized_command('build') self.target_dir = os.path.join(build.build_base, 'docs') else: self.ensure_dirname('upload_dir') self.target_dir = self.upload_dir if 'pypi.python.org' in self.repository: log.warn("Upload_docs command is deprecated. Use RTD instead.") self.announce('Using upload directory %s' % self.target_dir) def create_zipfile(self, filename): zip_file = zipfile.ZipFile(filename, "w") try: self.mkpath(self.target_dir) # just in case for root, dirs, files in os.walk(self.target_dir): if root == self.target_dir and not files: tmpl = "no files found in upload directory '%s'" raise DistutilsOptionError(tmpl % self.target_dir) for name in files: full = os.path.join(root, name) relative = root[len(self.target_dir):].lstrip(os.path.sep) dest = os.path.join(relative, name) zip_file.write(full, dest) finally: zip_file.close() def run(self): # Run sub commands for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) tmp_dir = tempfile.mkdtemp() name = self.distribution.metadata.get_name() zip_file = os.path.join(tmp_dir, "%s.zip" % name) try: self.create_zipfile(zip_file) self.upload_file(zip_file) finally: shutil.rmtree(tmp_dir) @staticmethod def _build_part(item, sep_boundary): key, values = item title = '\nContent-Disposition: form-data; name="%s"' % key # handle multiple entries for the same name if not isinstance(values, list): values = [values] for value in values: if isinstance(value, tuple): title += '; filename="%s"' % value[0] value = value[1] else: value = _encode(value) yield sep_boundary yield _encode(title) yield b"\n\n" yield value if value and value[-1:] == b'\r': yield b'\n' # write an extra newline (lurve Macs) @classmethod def _build_multipart(cls, data): """ Build up the MIME payload for the POST data """ boundary = b'--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = b'\n--' + boundary end_boundary = sep_boundary + b'--' end_items = end_boundary, b"\n", builder = functools.partial( cls._build_part, sep_boundary=sep_boundary, ) part_groups = map(builder, data.items()) parts = itertools.chain.from_iterable(part_groups) body_items = itertools.chain(parts, end_items) content_type = 'multipart/form-data; boundary=%s' % boundary.decode('ascii') return b''.join(body_items), content_type def upload_file(self, filename): with open(filename, 'rb') as f: content = f.read() meta = self.distribution.metadata data = { ':action': 'doc_upload', 'name': meta.get_name(), 'content': (os.path.basename(filename), content), } # set up the authentication credentials = _encode(self.username + ':' + self.password) credentials = standard_b64encode(credentials) if six.PY3: credentials = credentials.decode('ascii') auth = "Basic " + credentials body, ct = self._build_multipart(data) msg = "Submitting documentation to %s" % (self.repository) self.announce(msg, log.INFO) # build the Request # We can't use urllib2 since we need to send the Basic # auth right with the first request schema, netloc, url, params, query, fragments = \ urllib.parse.urlparse(self.repository) assert not params and not query and not fragments if schema == 'http': conn = http_client.HTTPConnection(netloc) elif schema == 'https': conn = http_client.HTTPSConnection(netloc) else: raise AssertionError("unsupported schema " + schema) data = '' try: conn.connect() conn.putrequest("POST", url) content_type = ct conn.putheader('Content-type', content_type) conn.putheader('Content-length', str(len(body))) conn.putheader('Authorization', auth) conn.endheaders() conn.send(body) except socket.error as e: self.announce(str(e), log.ERROR) return r = conn.getresponse() if r.status == 200: msg = 'Server response (%s): %s' % (r.status, r.reason) self.announce(msg, log.INFO) elif r.status == 301: location = r.getheader('Location') if location is None: location = 'https://pythonhosted.org/%s/' % meta.get_name() msg = 'Upload successful. Visit %s' % location self.announce(msg, log.INFO) else: msg = 'Upload failed (%s): %s' % (r.status, r.reason) self.announce(msg, log.ERROR) if self.show_response: print('-' * 75, r.read(), '-' * 75) PK!Zqcommand/upload.pynu[import io import os import hashlib import getpass from base64 import standard_b64encode from distutils import log from distutils.command import upload as orig from distutils.spawn import spawn from distutils.errors import DistutilsError from setuptools.extern.six.moves.urllib.request import urlopen, Request from setuptools.extern.six.moves.urllib.error import HTTPError from setuptools.extern.six.moves.urllib.parse import urlparse class upload(orig.upload): """ Override default upload behavior to obtain password in a variety of different ways. """ def run(self): try: orig.upload.run(self) finally: self.announce( "WARNING: Uploading via this command is deprecated, use twine " "to upload instead (https://pypi.org/p/twine/)", log.WARN ) def finalize_options(self): orig.upload.finalize_options(self) self.username = ( self.username or getpass.getuser() ) # Attempt to obtain password. Short circuit evaluation at the first # sign of success. self.password = ( self.password or self._load_password_from_keyring() or self._prompt_for_password() ) def upload_file(self, command, pyversion, filename): # Makes sure the repository URL is compliant schema, netloc, url, params, query, fragments = \ urlparse(self.repository) if params or query or fragments: raise AssertionError("Incompatible url %s" % self.repository) if schema not in ('http', 'https'): raise AssertionError("unsupported schema " + schema) # Sign if requested if self.sign: gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, dry_run=self.dry_run) # Fill in the data - send all the meta-data in case we need to # register a new release with open(filename, 'rb') as f: content = f.read() meta = self.distribution.metadata data = { # action ':action': 'file_upload', 'protocol_version': '1', # identify release 'name': meta.get_name(), 'version': meta.get_version(), # file content 'content': (os.path.basename(filename), content), 'filetype': command, 'pyversion': pyversion, 'md5_digest': hashlib.md5(content).hexdigest(), # additional meta-data 'metadata_version': str(meta.get_metadata_version()), 'summary': meta.get_description(), 'home_page': meta.get_url(), 'author': meta.get_contact(), 'author_email': meta.get_contact_email(), 'license': meta.get_licence(), 'description': meta.get_long_description(), 'keywords': meta.get_keywords(), 'platform': meta.get_platforms(), 'classifiers': meta.get_classifiers(), 'download_url': meta.get_download_url(), # PEP 314 'provides': meta.get_provides(), 'requires': meta.get_requires(), 'obsoletes': meta.get_obsoletes(), } data['comment'] = '' if self.sign: data['gpg_signature'] = (os.path.basename(filename) + ".asc", open(filename+".asc", "rb").read()) # set up the authentication user_pass = (self.username + ":" + self.password).encode('ascii') # The exact encoding of the authentication string is debated. # Anyway PyPI only accepts ascii for both username or password. auth = "Basic " + standard_b64encode(user_pass).decode('ascii') # Build up the MIME payload for the POST data boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = b'\r\n--' + boundary.encode('ascii') end_boundary = sep_boundary + b'--\r\n' body = io.BytesIO() for key, value in data.items(): title = '\r\nContent-Disposition: form-data; name="%s"' % key # handle multiple entries for the same name if not isinstance(value, list): value = [value] for value in value: if type(value) is tuple: title += '; filename="%s"' % value[0] value = value[1] else: value = str(value).encode('utf-8') body.write(sep_boundary) body.write(title.encode('utf-8')) body.write(b"\r\n\r\n") body.write(value) body.write(end_boundary) body = body.getvalue() msg = "Submitting %s to %s" % (filename, self.repository) self.announce(msg, log.INFO) # build the Request headers = { 'Content-type': 'multipart/form-data; boundary=%s' % boundary, 'Content-length': str(len(body)), 'Authorization': auth, } request = Request(self.repository, data=body, headers=headers) # send the data try: result = urlopen(request) status = result.getcode() reason = result.msg except HTTPError as e: status = e.code reason = e.msg except OSError as e: self.announce(str(e), log.ERROR) raise if status == 200: self.announce('Server response (%s): %s' % (status, reason), log.INFO) if self.show_response: text = getattr(self, '_read_pypi_response', lambda x: None)(result) if text is not None: msg = '\n'.join(('-' * 75, text, '-' * 75)) self.announce(msg, log.INFO) else: msg = 'Upload failed (%s): %s' % (status, reason) self.announce(msg, log.ERROR) raise DistutilsError(msg) def _load_password_from_keyring(self): """ Attempt to load password from keyring. Suppress Exceptions. """ try: keyring = __import__('keyring') return keyring.get_password(self.repository, self.username) except Exception: pass def _prompt_for_password(self): """ Prompt for a password on the tty. Suppress Exceptions. """ try: return getpass.getpass() except (Exception, KeyboardInterrupt): pass PK!command/dist_info.pynu[""" Create a dist_info directory As defined in the wheel specification """ import os from distutils.core import Command from distutils import log class dist_info(Command): description = 'create a .dist-info directory' user_options = [ ('egg-base=', 'e', "directory containing .egg-info directories" " (default: top of the source tree)"), ] def initialize_options(self): self.egg_base = None def finalize_options(self): pass def run(self): egg_info = self.get_finalized_command('egg_info') egg_info.egg_base = self.egg_base egg_info.finalize_options() egg_info.run() dist_info_dir = egg_info.egg_info[:-len('.egg-info')] + '.dist-info' log.info("creating '{}'".format(os.path.abspath(dist_info_dir))) bdist_wheel = self.get_finalized_command('bdist_wheel') bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir) PK!tcommand/bdist_rpm.pynu[import distutils.command.bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. """ def run(self): # ensure distro name is up-to-date self.run_command('egg_info') orig.bdist_rpm.run(self) def _make_spec_file(self): version = self.distribution.get_version() rpmversion = version.replace('-', '_') spec = orig.bdist_rpm._make_spec_file(self) line23 = '%define version ' + version line24 = '%define version ' + rpmversion spec = [ line.replace( "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" ).replace( "setup.py install ", "setup.py install --single-version-externally-managed " ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" ).replace(line23, line24) for line in spec ] insert_loc = spec.index(line24) + 1 unmangled_version = "%define unmangled_version " + version spec.insert(insert_loc, unmangled_version) return spec PK!Ԥttcommand/rotate.pynu[from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os import shutil from setuptools.extern import six from setuptools import Command class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N newest files" user_options = [ ('match=', 'm', "patterns to match (required)"), ('dist-dir=', 'd', "directory where the distributions are"), ('keep=', 'k', "number of matching distributions to keep"), ] boolean_options = [] def initialize_options(self): self.match = None self.dist_dir = None self.keep = None def finalize_options(self): if self.match is None: raise DistutilsOptionError( "Must specify one or more (comma-separated) match patterns " "(e.g. '.zip' or '.egg')" ) if self.keep is None: raise DistutilsOptionError("Must specify number of files to keep") try: self.keep = int(self.keep) except ValueError: raise DistutilsOptionError("--keep must be an integer") if isinstance(self.match, six.string_types): self.match = [ convert_path(p.strip()) for p in self.match.split(',') ] self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) def run(self): self.run_command("egg_info") from glob import glob for pattern in self.match: pattern = self.distribution.get_name() + '*' + pattern files = glob(os.path.join(self.dist_dir, pattern)) files = [(os.path.getmtime(f), f) for f in files] files.sort() files.reverse() log.info("%d file(s) matching %s", len(files), pattern) files = files[self.keep:] for (t, f) in files: log.info("Deleting %s", f) if not self.dry_run: if os.path.isdir(f): shutil.rmtree(f) else: os.unlink(f) PK!dMGG/command/__pycache__/easy_install.cpython-38.pycnu[U QabU@s4dZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'm(Z(dd l)m*Z*dd l+m,Z,ddl-m.Z.m/Z/ddl)m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>ddl?m@Z@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPdd lQZAeRZSejTdeAjUdddddddgZVd d!ZWd"dZXe,jYrBd#d$ZZd%d&Z[nd'd$ZZd(d&Z[d)d*Z\Gd+dde0Z]d,d-Z^d.d/Z_d0d1Z`d2dZad3dZbGd4ddeHZcGd5d6d6ecZdejefd7d8d9kredZcd:d;Zgdd?Zid@dAZjdsdBdCZkdDdEZldFdGZmdHejnkremZondIdJZodtdLdMZpdNdOZqdPdQZrdRdSZszddTlmtZuWnevk rndUdVZuYnXdWdXZtGdYdZdZewZxexyZzGd[d\d\exZ{Gd]d^d^Z|Gd_d`d`e|Z}Gdadbdbe}Z~e|jZe|jZdcddZdedfZdgehfdhdiZdjdkZdldmZdudndZe"jdodpZGdqdrdre*Zd S)va% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html )glob) get_platform) convert_path subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMES SCHEME_KEYS)logdir_util) first_line_re)find_executableN)get_config_varsget_path)SetuptoolsDeprecationWarning)six) configparsermap)Command) run_setup) rmtree_safe)setopt)unpack_archive) PackageIndexparse_requirement_arg URL_SCHEME) bdist_eggegg_info)Wheel) yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributions Environment Requirement Distribution PathMetadata EggMetadata WorkingSetDistributionNotFoundVersionConflict DEVELOP_DISTdefault)categorysamefile easy_installPthDistributionsextract_wininst_cfgmainget_exe_prefixescCstddkS)NP)structcalcsizer<r<C/usr/lib/python3.8/site-packages/setuptools/command/easy_install.pyis_64bitOsr>cCsjtj|otj|}ttjdo&|}|r:tj||Stjtj|}tjtj|}||kS)z Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r2)ospathexistshasattrr2normpathnormcase)Zp1Zp2Z both_existZ use_samefileZnorm_p1Znorm_p2r<r<r=r2SscCs|SNr<sr<r<r= _to_bytesesrHcCs.zt|dWdStk r(YdSXdSNasciiTF)rZ text_type UnicodeErrorrFr<r<r=isasciihs  rLcCs |dS)Nutf8)encoderFr<r<r=rHpscCs,z|dWdStk r&YdSXdSrI)rNrKrFr<r<r=rLss  cCst|ddS)N z; )textwrapdedentstripreplace)textr<r<r={rUc@seZdZdZdZdZdddddd d d d d dddddddddddgZdddddddd d!g Zej rd"ej Z e d#d$e fe d#d%diZ eZd&d'Zd(d)Zd*d+Zed,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zed@ Z!edA Z"edB Z#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)e*j+dOdPZ,ddRdSZ-ddTdUZ.dVdWZ/ddXdYZ0dZd[Z1d\d]Z2d^d_Z3dd`daZ4edbdcZ5ddfdgZ6dhdiZ7djdkZ8dldmZ9dndoZ:dpdqZ;drdsZddwdxZ?edy Z@dzd{ZAd|d}ZBd~dZCddZDddZEddZFddZGddZHed ZIddZJddZKddZLeMeMddddZNeMdddZOddZPd$S)r3z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zip-okzzinstall package as a zipfile) multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))z install-dir=dzinstall package to DIR)z script-dir=rGzinstall scripts to DIR)exclude-scriptsxzDon't install scripts) always-copyaz'Copy all needed packages to install dir)z index-url=iz base URL of Python Package Index)z find-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files) always-unzipZz*don't install as a zipfile, no matter what)z site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)no-depsNzdon't install dependencies)z allow-hosts=Hz$pattern(s) that hostnames must match)local-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installedrWrYr^r[r`rirkrnrpz!install in user site-package '%s'userNrfcCs,d|_d|_|_d|_|_|_d|_d|_d|_d|_ d|_ |_ d|_ |_ |_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrtj |_!tj"|_#n d|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*d|_+|j,j-|_-|j,.||j,/ddS)NrFr3)0rqzip_oklocal_snapshots_ok install_dir script_direxclude_scripts index_url find_linksbuild_directoryargsoptimizerecordr[ always_copy multi_versionrino_deps allow_hostsrootprefix no_reportrpinstall_purelibinstall_platlibinstall_headers install_libinstall_scripts install_data install_baseinstall_platbasesiteENABLE_USER_SITE USER_BASEinstall_userbase USER_SITEinstall_usersite no_find_links package_indexpth_filealways_copy_from site_dirsinstalled_projectssitepy_installedZ_dry_run distributionverboseZ_set_command_optionsget_option_dictselfr<r<r=initialize_optionssJ      zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tj|stj|r|VqdSrE)r?r@rAislink).0filenamer<r<r= s z/easy_install.delete_blockers..)listr _delete_path)rblockersZextant_blockersr<r<r=delete_blockersszeasy_install.delete_blockerscCsJtd||jrdStj|o.tj| }|r8tntj}||dS)Nz Deleting %s) r infodry_runr?r@isdirrrmtreeunlink)rr@Zis_treeZremoverr<r<r=rs  zeasy_install._delete_pathcCs4djtj}td}d}t|jfttdS)zT Render the Setuptools version and installation details, then exit. {}.{} setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)formatsys version_infor%printlocals SystemExit)Zverdisttmplr<r<r=_render_versions  zeasy_install._render_versionc Csh|jo |tjd}tdd\}}|j|j|j||dd|d|d||||t tddd |_ t j r|j |j d <|j|j d <||||d d d d|jdkr|j|_|jdkrd|_|dd|dd|jr|jr|j|_|j|_|ddtttj}t|_|jdk rdd|jdD}|D]N}t j!|s|t"#d|n,t||krt$|dn|j%t|q\|j&s|'|j(pd|_(|jdd|_)|jt|jfD] }||j)kr|j)*d|q|j+dk r0dd|j+dD}ndg}|j,dkrX|j-|j(|j)|d|_,t.|j)tj|_/|j0dk rt1|j0t2j3r|j0|_0ng|_0|j4r|j,5|j)tj|js|j,6|j0|ddt1|j7t8s6z0t8|j7|_7d|j7krdksnt9Wnt9k r4t$d YnX|j&rN|j:sNt;d!|j<s^t;d"g|_=dS)#Nrr exec_prefixabiflags) Z dist_nameZ dist_versionZ dist_fullname py_versionZpy_version_shortZpy_version_nodotZ sys_prefixrZsys_exec_prefixrruserbaseZusersitertruryrFr)rtrtrrtruinstall)r|r|cSsg|]}tj|qSr<)r?r@ expanduserrRrrGr<r<r= 8sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }|qSr<)rRrr<r<r=rNs*)Z search_pathhosts)r{r{z--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))>rprrsplitrrZget_nameZ get_versionZ get_fullnamegetattr config_varsrrrr_fix_install_dir_for_user_siteexpand_basedirs expand_dirs_expandrurtrZset_undefined_optionsrqrrrr"r@ get_site_dirs all_site_dirsrr?rr warnrappendricheck_site_dirrw shadow_pathinsertrr create_indexr' local_indexrx isinstancerZ string_typesrsZscan_egg_linksadd_find_linksr{int ValueErrorryrrzoutputs) rrrrrCrr]Z path_itemrr<r<r=finalize_optionss                zeasy_install.finalize_optionscCs\|jr tjsdS||jdkr.d}t||j|_|_tj ddd}| |dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedposixZunixZ_user) rqrrcreate_home_pathrr rrr?namerS select_scheme)rmsgZ scheme_namer<r<r=rss  z+easy_install._fix_install_dir_for_user_sitecCsX|D]N}t||}|dk rtjdks.tjdkr:tj|}t||j}t|||qdS)Nrnt)rr?rr@rrrsetattr)rattrsattrvalr<r<r= _expand_attrss   zeasy_install._expand_attrscCs|dddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rrrNrrr<r<r=rszeasy_install.expand_basedirscCsddddddg}||dS)z+Calls `os.path.expanduser` on install dirs.rrrrrrNr)rdirsr<r<r=rszeasy_install.expand_dirsc Cs|j|jjkrt|jz|jD]}|||j q"|jr|j}|j rzt |j }t t |D]}|||d||<q`ddl m }||j|j|fd|j|W5t|jjXdS)Nr) file_utilz'writing list of installed files to '%s')rrr set_verbosityrzr3rr|rrlenrange distutilsrexecuteZ write_filewarn_deprecated_options)rspecrZroot_lenZcounterrr<r<r=runs*     zeasy_install.runcCsDz t}Wn"tk r.tdtj}YnXtj|j d|S)zReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r?getpid ExceptionrandomZrandintrmaxsizer@joinrt)rpidr<r<r=pseudo_tempnames  zeasy_install.pseudo_tempnamecCsdSrEr<rr<r<r=rsz$easy_install.warn_deprecated_optionsc CsZt|j}tj|d}tj|sTzt|Wn ttfk rR| YnX||j k}|sr|j sr| }nd| d}tj|}z*|rt|t|dt|Wn ttfk r| YnX|s|j st||r|jdkrt||j |_nd|_|tttkr.d|_n"|j rPtj|sPd|_d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededeasy-install.pthz .write-testwNT)r"rtr?r@rrAmakedirsOSErrorIOErrorcant_write_to_targetrr~check_pth_processingrropencloserno_default_version_msgrr4r _pythonpathr)rinstdirrZ is_site_dirZtestfileZ test_existsr<r<r=rs>           zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/easy_install.html Please make the appropriate changes for your system and try again. cCsP|jtd|jf}tj|js6|d|j7}n|d|j7}t |dS)NrO) _easy_install__cant_write_msgrexc_infortr?r@rA_easy_install__not_exists_id_easy_install__access_msgr)rrr<r<r=rs z!easy_install.cant_write_to_targetc Cs|j}td||d}|d}tj|}tdd}z8|rNt|tj |}t j j |ddt |d}Wn ttfk r|YnXz||jft|d }tj}tjd krtj|\}} tj|d } | d kotj| } | r| }d dlm} | |dddgd tj|rNtd|WdSW5|r`|tj|rxt|tj|rt|X|jstd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rOT)exist_okrNr pythonw.exe python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rtr rrr?r@rA _one_linerrdirname pkg_resourcesZ py31compatrrrrrrwriterrr executablerrrlowerdistutils.spawnrr~r) rrrZok_fileZ ok_existsrrrcrbasenameZaltZuse_altrr<r<r=rs\            z!easy_install.check_pth_processingc CsV|jsH|drH|dD],}|d|r.q||||d|q||dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rvZmetadata_isdirZmetadata_listdirinstall_scriptZ get_metadatainstall_wrapper_scripts)rr script_namer<r<r=install_egg_scriptsYs z easy_install.install_egg_scriptscCsTtj|rDt|D]*\}}}|D]}|jtj||q$qn |j|dSrE)r?r@rwalkrrr)rr@baserfilesrr<r<r= add_outputgs  zeasy_install.add_outputcCs|jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rirrrr<r<r= not_editableos zeasy_install.not_editablecCs<|js dStjtj|j|jr8td|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)rir?r@rArrykeyrr!r<r<r=check_editablews zeasy_install.check_editablec cs:tjdd}zt|VW5tj|o2tt|XdS)Nz easy_install-)r)tempfilemkdtempr?r@rArrstr)rtmpdirr<r<r=_tmpdirs zeasy_install._tmpdirFc CsH|js||&}t|tst|rb|||j||}| d|||dW5QRSt j |r||| d|||dW5QRSt |}|||j|||j|j|j |j}|dkrd|}|jr|d7}t|nJ|jtkr||||d|W5QRS| ||j||W5QRSW5QRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)riinstall_site_pyr)rr(rr"rdownload install_itemr?r@rArr$Zfetch_distributionr[r}rrZ precedencer/process_distributionlocation)rrdepsr(dlrrr<r<r=r3s<        zeasy_install.easy_installcCs |p|j}|ptj||k}|p,|d }|pT|jdk oTtjt|t|jk}|r|s|j|jD]}|j |krjqqjd}t dtj ||r| |||}|D]}||||qn ||g}|||d|d|dk r|D]}||kr|SqdS)N.eggTz Processing %srr*)r}r?r@rendswithrr"r project_namer/r rr install_eggsr.egg_distribution)rrr,r(r0Zinstall_neededrZdistsr<r<r=r-s2     zeasy_install.install_itemcCs<t|}tD]*}d|}t||dkr t||||q dS)z=Sets the install directories by applying the install schemes.Zinstall_N)r r rr)rrschemer#attrnamer<r<r=rs zeasy_install.select_schemec Gs|||j|||j|jkr2|j||j|||||j|j<t |j ||f|| dr|j s|j |d|s|jsdS|dk r|j|jkrtd|dS|dks||kr|}tt|}t d|ztg|g|j|j}Wn^tk r<}ztt|W5d}~XYn0tk rj}zt|W5d}~XYnX|js||jr|D]"}|j|jkr||qt d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s) update_pthraddrr#removerrr rinstallation_report has_metadatarrZget_metadata_linesr}ras_requirementr(r'r,Zresolver3r-rr.Zreportr)rZ requirementrr0rZdistreqZdistrosrjr<r<r=r.sL           z!easy_install.process_distributioncCs2|jdk r|j S|dr dS|ds.dSdS)Nz not-zip-safeTzzip-safeF)rrr=rrr<r<r= should_unzips   zeasy_install.should_unzipcCstj|j|j}tj|r:d}t||j|j||Stj|rL|}nRtj ||krft |t |}t |dkrtj||d}tj|r|}t |t|||S)Nz<%r already exists in %s; build directory %s will not be keptrr)r?r@rryr#rAr rrrrlistdirrr$shutilmove)rr dist_filename setup_basedstrcontentsr<r<r= maybe_move s$       zeasy_install.maybe_movecCs,|jr dSt|D]}|j|qdSrE)rv ScriptWriterbestget_args write_script)rrrzr<r<r=r"sz$easy_install.install_wrapper_scriptscCsNt|}t||}|r8||t}t||}||t|ddS)z/Generate a legacy script wrapper and install itrdN) r'r>is_python_script_load_templaterrI get_headerrLrH)rrr script_textdev_pathrZ is_scriptZbodyr<r<r=r(s   zeasy_install.install_scriptcCs(d}|r|dd}td|}|dS)z There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplrutf-8)rSr#decode)rQrZ raw_bytesr<r<r=rN2s   zeasy_install._load_templatetr<c sfdd|Dtd|jtjj|}|jrLdSt }t |tj |rpt |t |d|}||W5QRXt|d|dS)z1Write an executable file to the scripts directorycsg|]}tjj|qSr<)r?r@rrurr_rr<r=rDsz-easy_install.write_script..zInstalling %s script to %sNri)rr rrur?r@rr r current_umaskr$rArrrchmod)rrrGmodertargetmaskrcr<rr=rLAs   zeasy_install.write_scriptcCs^|dr|||gS|dr8|||gS|drT|||gS|}tj|r~|ds~t|||j ntj |rtj |}| |r|j r|dk r||||}tj|d}tj|s0ttj|dd}|stdtj |t|dkr(td tj ||d }|jrNt|||gS|||SdS) Nr2.exez.whl.pyzsetup.pyrz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)rr3 install_egg install_exe install_wheelr?r@isfilerunpack_progressrabspath startswithryrHrrArrrrir rreport_editablebuild_and_install)rrrDr(rE setup_scriptZsetupsr<r<r=r5UsJ     zeasy_install.install_eggscCs>tj|r"t|tj|d}ntt|}tj ||dS)NEGG-INFO)metadata) r?r@rr*rr+ zipimport zipimporterr)Z from_filename)regg_pathrhr<r<r=r6s   zeasy_install.egg_distributionc Cstj|jtj|}tj|}|js2t|||}t ||sztj |rrtj |srt j ||jdn"tj|r|tj|fd|zd}tj |r||rtjd}}n tjd}}nL||r|||jd}}n*d}||r tjd}}n tjd}}||||f|dtj|tj|ft||d Wn$tk rxt|dd YnX||||S) Nr Removing FZMovingZCopyingZ ExtractingTz %s to %sfix_zipimporter_caches)r?r@rrtrrbrr$r6r2rrr remove_treerArrrcrBrCZcopytreer@Zmkpathunpack_and_compileZcopy2rupdate_dist_cachesrr )rrkr( destinationrZnew_dist_is_zippedrcrZr<r<r=r]s^                zeasy_install.install_eggc sPt|}|dkrtd|td|dd|ddtd}tj||d}||_ |d}tj|d}tj|d }t |t |||_ | ||tj|st|d } | d |dD].\} } | d kr| d | dd| fq| tj|d|fddt|Dtj|||j|jd|||S)Nz(%s is not a valid distutils Windows .exerhrrp)r4rpplatformr2z.tmprgPKG-INFOrzMetadata-Version: 1.0 target_versionz%s: %s _-rcsg|]}tj|dqS)r)r?r@r)rrzrur<r=rsz,easy_install.install_exe..)rr)r5rr)getrr?r@regg_namer/r$r*Z _provider exe_to_eggrArritemsrStitlerrrIrKrZ make_zipfilerrr]) rrDr(cfgrrkegg_tmpZ _egg_infoZpkg_infrckvr<ryr=r^sJ       zeasy_install.install_exec s6t|ggifdd}t||g}D]l}|dr<|d}|d}t|dd|d<tjj f|} || |t ||q<| t tj dt|dD]Z} t| rtj d| d } tj| st| d } | d t| d | qd S) z;Extract a bdist_wininst to the directories an egg would usecs|}D]\}}||r ||t|d}|d}tjjf|}|}|dsj|drt |d|d<dtj |dd< |n4|dr|dkrdtj |dd< ||Sq |d st d |dS) N/.pyd.dllrrr\SCRIPTS/r zWARNING: can't process %s)rrcrrr?r@rr3r strip_modulesplitextrr r)srcrFrGoldnewpartsr1r native_libsprefixes to_compile top_levelr<r=processs$        z(easy_install.exe_to_egg..processrrrr\rg)rrz.txtrrON)r7rrr3rrrr?r@rrZ write_stub byte_compileZwrite_safety_flagZ analyze_eggrrArrr) rrDrrZstubsresrresourceZpyfilerZtxtrcr<rr=r|s8          zeasy_install.exe_to_eggc Cst|}|sttj|j|}tj|}|j sBt |tj |rltj |slt j||j dn"tj|r|tj|fd|z.||j|fdtj|tj|fW5t|ddX||||S)NrlrmFrnzInstalling %s to %s)r Z is_compatibleAssertionErrorr?r@rrtr{rbrr$rrr rprArrrrZinstall_as_eggrrr r6)rZ wheel_pathr(Zwheelrsr<r<r=r_!s4       zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Installedc Cs^d}|jr>|js>|d|j7}|jtttjkr>|d|j7}|j }|j }|j }d}|t S)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srOr) r~r_easy_install__mv_warningrtrr"rr@_easy_install__id_warningr/r4rpr) rZreqrZwhatrZegglocrrpZextrasr<r<r=r<Os z easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tj|}tj}d|jtS)NrO)r?r@rrr_easy_install__editable_msgr)rrrfrpythonr<r<r=rdhs zeasy_install.report_editablec Cstjdttjdtt|}|jdkrNd|jd}|dd|n|jdkrd|dd|jrv|dd t d |t |ddd |zt ||Wn6tk r}ztd |jdfW5d}~XYnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrrrrx-qz-nz Running %s %s zSetup script exited with %s)rmodules setdefaultrrrrrrr rrrrrrrz)rrfrErzrr<r<r=rms&    zeasy_install.run_setupc Csddg}tjdtj|d}z| tj|| || |||t |g}g}|D]&}||D]}| | |j|qhq\|s|jstd||WSt|t|jXdS)Nrz --dist-dirz egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))r%r&r?r@rrr rr_set_fetcher_optionsrrr'r]r/rr) rrfrErzZdist_dirZall_eggsZeggsr#rr<r<r=res*     zeasy_install.build_and_installc Csp|jd}d}i}|D]&\}}||kr2q |d||dd<q t|d}tj|d}t ||dS) a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r3)rxrrwr{rrrwrx)r3z setup.cfgN) rrcopyr}rSdictr?r@rrZ edit_config) rrZei_optsZfetch_directivesZ fetch_optionsr#rZsettingsZ cfg_filenamer<r<r=rs  z!easy_install._set_fetcher_optionscCs*|jdkrdS|j|jD]H}|js0|j|jkrtd||j||j|jkr|j|jq|js|j|jjkrtd|n2td||j ||j|jkr|j |j|j s&|j |jdkr&t j|jd}t j|rt |t|d}||j|jd|dS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filersetuptools.pthwtrO)rr#r~r/r rr;rpathsr:rrsaver?r@rrtrrrr make_relativer)rrr]rrcr<r<r=r9s6            zeasy_install.update_pthcCstd|||S)NzUnpacking %s to %s)r debug)rrrFr<r<r=raszeasy_install.unpack_progresscsdggfdd}t|||js`D]&}t|tjdBd@}t||q8dS)NcsZ|dr |ds |n|ds4|dr>|||j rV|pXdS)Nr\ EGG-INFO/rz.so)r3rcrrar)rrFrZto_chmodrr<r=pfs    z+easy_install.unpack_and_compile..pfimi)rrrr?statST_MODErW)rrkrsrrcrXr<rr=rqs  zeasy_install.unpack_and_compilec Csjtjr dSddlm}z@t|jd||dd|jd|jrT|||jd|jdW5t|jXdS)Nr)rr)r{forcer) rdont_write_bytecodedistutils.utilrr rrrr{)rrrr<r<r=rs  zeasy_install.byte_compilea bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.cCs|j}||jtjddfSNZ PYTHONPATHr)_easy_install__no_default_msgrtr?environrz)rtemplater<r<r=rsz#easy_install.no_default_version_msgc Cs|jr dStj|jd}tdd}|d}d}tj|rt d|jt |}| }W5QRX| dstd |||krtd ||jst|t j |d dd }||W5QRX||gd |_dS)z8Make sure there's a site.py in the target dir, if neededNzsite.pyrz site-patch.pyrRrzChecking existing site.py in %sz def __boot():z;%s is not a setuptools-generated site.py; please remove it.z Creating %srencodingT)rr?r@rrtr#rSrAr riorreadrcrrrr$rr)rZsitepysourceZcurrentZstrmr<r<r=r+#s0       zeasy_install.install_site_pycCsd|js dSttjd}t|jD]8\}}||r&tj |s&| d|t |dq&dS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) rqrr?r@rrZ iteritemsrrcrZ debug_printr)rhomerr@r<r<r=rCszeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/binrrz$base/Lib/site-packagesz $base/ScriptscGs|dj}|jrd|}|j|d<|jtj|j}| D]$\}}t ||ddkr>t |||q>ddl m }|D]B}t ||}|dk rt|||}tjdkrtj|}t |||qtdS)Nrrr)rr)Zget_finalized_commandrrrr rzr?rDEFAULT_SCHEMEr}rrrrr@r)rrrr7rrrr<r<r=rYs        zeasy_install._expand)F)F)T)N)rTr<)r)Q__name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsZ user_optionsZboolean_optionsrrrZhelp_msgrZ negative_optrrrrr staticmethodrrrrrrrrrrrPrQlstriprrr rrrr r"r$ contextlibcontextmanagerr)r3r-rr.r@rHrrrNrLr5r6r]r^r|r_rrr<rrdrrerr9rarqrrrr+rrr rrr<r<r<r=r3~s  0  z   0 ;   $ $ '    ,6-5   %  cCs tjddtj}td|Sr)r?rrzrpathsepfilter)r}r<r<r=rpsrc Cs~g}|ttjg}tjtjkr0|tj|D]}|r4tjdkr^|tj |ddnVtj dkr|tj |ddj tj dtj |ddgn||tj |ddgtjdkr4d |kr4tj d }|r4tj |d d d j tj d}||q4tdtdf}|D]}||kr||qtjrB|tjz|tWntk rjYnXttt|}|S)z& Return a list of 'site' dirs )Zos2emxZriscosZLibz site-packagesrlibz python{}.{}z site-pythondarwinzPython.frameworkHOMELibraryPythonrZpurelibZplatlib)extendrrrrrrtr?r@rseprrrrzrrrrgetsitepackagesAttributeErrorrrr")sitedirsrrrZhome_spZ lib_pathsZsite_libr<r<r=rus^             rccsi}|D]}t|}||krqd||<tj|s4qt|}||fV|D]}|ds\qL|dkrfqLttj||}tt |}| |D]H}| dst| }||krd||<tj|sq|t|fVqqLqdS)zBYield sys.path directories that might contain "old-style" packagesrr )rrimportN) r"r?r@rrAr3rrrr!rrcrstrip)Zinputsseenrrrrclinesliner<r<r= expand_pathss4        rc Cs@t|d}z$t|}|dkr*W dS|d|d|d}|dkrRWdS||dtd|d\}}}|dkrWdS||d|d d d }t |}z<||} | d d d } | t } |t| Wntjk rYW.dSX|dr"|ds*W dS|WS|XdS)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None rbN  zegg path translations for a given .exe file)zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)rzEGG-INFO/scripts/)zDATA/lib/site-packagesrrrrrurz .egg-inforNrr z -nspkg.pth)ZPURELIBZPLATLIB\rz%s/%s/rcSsg|]\}}||fqSr<)r)rr_yr<r<r=r)sz$get_exe_prefixes..)rZZipFilerZinfolistrrrr3rrupperrrZPY3rSr!rRrSrcrsortreverse)Z exe_filenamerrXrrrrGZpthr<r<r=r7s@       " c@sReZdZdZdZdddZddZdd Zed d Z d d Z ddZ ddZ dS)r4z)A .pth file with Distribution paths in itFr<cCsl||_ttt||_ttj|j|_| t |gddt |j D]}tt|jt|dqLdS)NT)rrrr"rr?r@rbasedir_loadr'__init__r!rr:r&)rrrr@r<r<r=r4szPthDistributions.__init__cCsg|_d}t|j}tj|jrt|jd}|D]}| drHd}q4| }|j || r4| drtq4t tj|j|}|jd<tj|r||kr|jd|_q4d||<q4||jr|sd|_|jr|jd s|jqdS)NFZrtrT#rr)rrfromkeysrr?r@r`rrrcrrrRr"rrrApopdirtyr)rZ saw_importrrcrr@r<r<r=r=s4       zPthDistributions._loadc Cs|js dStt|j|j}|rtd|j||}d |d}t j |jr`t |jt|jd}||W5QRXn(t j |jrtd|jt |jd|_dS)z$Write changed .pth file back to diskNz Saving %srOrzDeleting empty %sF)rrrrrr rr _wrap_linesrr?r@rrrrrA)rZ rel_pathsrdatarcr<r<r=r\s   zPthDistributions.savecCs|SrEr<)rr<r<r=rrszPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jtk}|r>|j|jd|_t||dS)z"Add `dist` to the distribution mapTN) r/rrr?getcwdrrr'r:)rrnew_pathr<r<r=r:vs   zPthDistributions.addcCs2|j|jkr"|j|jd|_qt||dS)z'Remove `dist` from the distribution mapTN)r/rr;rr'r?r<r<r=r;s zPthDistributions.removecCstjt|\}}t|j}|g}tjdkr2dp6tj}t||kr||jkrl|tj | | |Stj|\}}||q8|S)Nr) r?r@rr"rraltseprrcurdirrr)rr@ZnpathZlastZbaselenrrr<r<r=rs      zPthDistributions.make_relativeN)r<) rrrrrrrrrrr:r;rr<r<r<r=r4/s  c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs$|jV|D] }|Vq |jVdSrE)preludepostlude)clsrrr<r<r=rsz#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) z import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)rrr classmethodrrrrr<r<r<r=rs rZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtSttjS)z_ Return a regular expression based on first_line_re suitable for matching strings. )rrpatternr'recompilerSr<r<r<r=_first_line_res rcCsd|tjtjfkr.tjdkr.t|tj||St\}}}t ||d|dd||ffdS)Nrrrz %s %s) r?rr;rrWrS_IWRITErrrZreraise)funcargexcZetZevrwr<r<r= auto_chmods  r cCs.t|}t|tj|r"t|nt|dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r"_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)Z dist_pathronormalized_pathr<r<r=rrs <  rrcCsPg}t|}|D]:}t|}||r|||dtjdfkr||q|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rr)rr"rcr?rr)rcacheresult prefix_lenpZnpr<r<r="_collect_zipimporter_cache_entriess   rcCs@t||D]0}||}||=|o(|||}|dk r |||<q dS)a Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r)rrupdaterr old_entryZ new_entryr<r<r=_update_zipimporter_cache/s  rcCst||dSrE)r)rrr<r<r=r Osr cCsdd}t|tj|ddS)NcSs |dSrE)clearr@rr<r<r=2clear_and_remove_cached_zip_archive_directory_dataTszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_datarrri_zip_directory_cache)rrr<r<r=r Ss r Z__pypy__cCsdd}t|tj|ddS)NcSs&|t||tj||SrE)rrirjupdaterrr<r<r=)replace_cached_zip_archive_directory_datajs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarr)rrr<r<r=r is  r c Cs4zt||dWnttfk r*YdSXdSdS)z%Is this string a valid Python script?execFTN)r SyntaxError TypeError)rTrr<r<r= is_python|s r#c CsNz(tj|dd}|d}W5QRXWnttfk rD|YSX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1rr#!)rrrrr)rfpmagicr<r<r=is_shs  r'cCs t|gS)z@Quote a command line argument according to Windows parsing rules subprocess list2cmdline)rr<r<r= nt_quote_argsr+cCsH|ds|drdSt||r&dS|drDd|dkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. r\.pywTr$rrF)r3r#rc splitlinesr)rPrr<r<r=rMs  rM)rWcGsdSrEr<)rzr<r<r=_chmodsr.c CsRtd||zt||Wn0tjk rL}ztd|W5d}~XYnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r rr.r?error)r@rXrjr<r<r=rWs rWc@seZdZdZgZeZeddZeddZ eddZ edd Z ed d Z d d Z eddZddZeddZeddZdS) CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S)zV Choose the best CommandSpec class based on environmental conditions. r<rr<r<r=rJszCommandSpec.bestcCstjtj}tjd|S)N__PYVENV_LAUNCHER__)r?r@rCrrrrz)rZ_defaultr<r<r=_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dkr0|S||S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rrfrom_environment from_string)rZparamr<r<r= from_params  zCommandSpec.from_paramcCs||gSrE)r3r1r<r<r=r4szCommandSpec.from_environmentcCstj|f|j}||S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )shlexr split_args)rstringr}r<r<r=r5szCommandSpec.from_stringcCs8t|||_t|}t|s4dg|jdd<dS)Nz-xr)r7r_extract_optionsoptionsr)r*rL)rrPcmdliner<r<r=install_optionss zCommandSpec.install_optionscCs:|dd}t|}|r.|dp0dnd}|S)zH Extract any options from the first line of the script. rOrrr)r-rmatchgrouprR)Z orig_scriptfirstr>r;r<r<r=r:s zCommandSpec._extract_optionscCs||t|jSrE)_renderrr;rr<r<r= as_headerszCommandSpec.as_headercCs6d}|D](}||r||r|ddSq|S)Nz"'rr)rcr3)itemZ_QUOTESqr<r<r= _strip_quotess zCommandSpec._strip_quotescCs tdd|D}d|dS)Ncss|]}t|VqdSrE)r0rErR)rrCr<r<r=rsz&CommandSpec._render..r$rOr()r}r<r<r<r=rAs zCommandSpec._renderN)rrrrr;rr8rrJr3r6r4r5r=rr:rBrErAr<r<r<r=r0s*       r0c@seZdZeddZdS)WindowsCommandSpecFrN)rrrrr8r<r<r<r=rF srFc@seZdZdZedZeZ e dddZ e dddZ e dd d Z ed d Ze d dZe ddZe ddZe dddZdS)rIz` Encapsulates behavior around writing entry point scripts for console and gui apps. a # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) NFcCs6tdt|rtnt}|d||}|||S)Nz Use get_argsr)warningsrEasyInstallDeprecationWarningWindowsScriptWriterrIrJget_script_headerrK)rrrwininstwriterheaderr<r<r=get_script_args$s zScriptWriter.get_script_argscCs$tjdtdd|rd}|||S)NzUse get_headerr) stacklevelr )rGrrHrO)rrPrrKr<r<r=rJ,szScriptWriter.get_script_headerc cs|dkr|}t|}dD]Z}|d}||D]>\}}|||jt}|||||} | D] } | Vqlq:q dS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. NZconsoleguiZ_scripts) rOr'r>Z get_entry_mapr}_ensure_safe_namerr_get_script_args) rrrMrtype_r?rZeprPrzrr<r<r=rK4s   zScriptWriter.get_argscCstd|}|rtddS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rsearchr)rZ has_path_sepr<r<r=rRFs zScriptWriter._ensure_safe_namecCs tdt|rtS|SNzUse best)rGrrHrIrJ)rZ force_windowsr<r<r= get_writerOs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tS|SdS)zD Select the best ScriptWriter for this environment. win32javarN)rrtr?r_namerIrJr1r<r<r=rJUszScriptWriter.bestccs|||fVdSrEr<)rrTrrMrPr<r<r=rS_szScriptWriter._get_script_argsrcCs"|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrJr6r=rB)rrPrcmdr<r<r=rOds zScriptWriter.get_header)NF)NF)N)rN)rrrrrPrQrrr0r[rrNrJrKrrRrWrJrSrOr<r<r<r=rIs&       rIc@sLeZdZeZeddZeddZeddZeddZ e d d Z d S) rIcCstdt|SrV)rGrrHrJr1r<r<r=rWos zWindowsScriptWriter.get_writercCs"tt|d}tjdd}||S)zC Select the best ScriptWriter suitable for Windows )rZnaturalZSETUPTOOLS_LAUNCHERr)rWindowsExecutableLauncherWriterr?rrz)rZ writer_lookupZlauncherr<r<r=rJus zWindowsScriptWriter.bestc #stddd|}|tjddkrBdjft}t|t dddd d dd g}| || ||}fd d |D}|||d|fVdS)z For Windows, add a .py extensionz.pyar,rPZPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.r\ -script.py.pyc.pyor[csg|] }|qSr<r<rUrr<r=rsz8WindowsScriptWriter._get_script_args..rTN) rr?rrrrrrGr UserWarningr;_adjust_header) rrTrrMrPextrrrr<rbr=rSs   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tt|tj}|j||d}||rJ|S|S)z Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). r r rQ)r9repl)rrescape IGNORECASEsub _use_header)rrTZ orig_headerrrfZ pattern_ob new_headerr<r<r=rds z"WindowsScriptWriter._adjust_headercCs$|ddd}tjdkp"t|S)z Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. rr"rX)rRrrtr)rkZ clean_headerr<r<r=rjs zWindowsScriptWriter._use_headerN) rrrrFr[rrWrJrSrdrrjr<r<r<r=rIls    rIc@seZdZeddZdS)r]c #s|dkrd}d}dg}nd}d}dddg}|||}fd d |D} |||d | fVd t|d fVtsd} | td fVdS)zG For Windows, add a .py extension and an .exe launcher rQz -script.pywr,Zclir_r\r`racsg|] }|qSr<r<rUrbr<r=rszDWindowsExecutableLauncherWriter._get_script_args..rTr[rdz .exe.manifestN)rdget_win_launcherr>load_launcher_manifest) rrTrrMrPZ launcher_typererZhdrrZm_namer<rbr=rSs"  z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrrSr<r<r<r=r]sr]cCs2d|}tr|dd}n |dd}td|S)z Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exe.z-64.z-32.r)r>rSr#)typeZ launcher_fnr<r<r=rms  rmcCs0ttd}tjr|tS|dtSdS)Nzlauncher manifest.xmlrR)rr#rrPY2varsrS)rZmanifestr<r<r=rns  rnFcCst|||SrE)rBr)r@ ignore_errorsonerrorr<r<r=rsrcCstd}t||S)N)r?umask)Ztmpr<r<r=rVs  rVcCs:ddl}tj|jd}|tjd<tj|tdS)Nr) rr?r@r__path__rargvrr6)rZargv0r<r<r= bootstraps   ryc sddlm}ddlmGfddd}|dkrBtjdd}t0|fddd g|tjdpfd|d |W5QRXdS) Nr)setupr)cseZdZdZfddZdS)z-main..DistributionWithoutHelpCommandsrc s(tj|f||W5QRXdSrE) _patch_usage _show_help)rrzkwr{r<r=r} sz8main..DistributionWithoutHelpCommands._show_helpN)rrrZ common_usager}r<r{r<r=DistributionWithoutHelpCommands srrrr3z-v)Z script_argsrZ distclass)rrzZsetuptools.distr)rrxr|)rxr~rzrr<r{r=r6s    c#sLddl}tdfdd}|jj}||j_z dVW5||j_XdS)Nrze usage: %(script)s [options] requirement_or_url ... or: %(script)s --help csttj|dS)N)Zscript)rr?r@r)rZUSAGEr<r= gen_usage s z_patch_usage..gen_usage)Zdistutils.corerPrQrZcorer)rrZsavedr<rr=r| s  r|c@seZdZdZdS)rHzuClass for warning about deprecations in EasyInstall in SetupTools. Not ignored by default, unlike DeprecationWarning.N)rrrrr<r<r<r=rH( srH)N)r)N)rrrrrrZdistutils.errorsrrrr Zdistutils.command.installr r rr r Zdistutils.command.build_scriptsrrrrr?rirBr%rrrrrPrGrr:rr)r7rZ sysconfigrrrrZsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.sandboxrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelr rr!r"r#r$r%r&r'r(r)r*r+r,r-r.r/Zpkg_resources.py31compatrpZ __metaclass__filterwarningsZ PEP440Warning__all__r>r2rqrHrLrr3rrrr5r7r4rrrzrr rrrrr r builtin_module_namesr r#r'r+rMrWr. ImportErrorrr0r3Zsys_executablerFrIrIr]rNrJrmrnrrVryr6rr|rHr<r<r<r=s            D {A))'l R    T^A   PK!e4command/__pycache__/install_lib.cpython-38.opt-1.pycnu[U Qab@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs&||}|dk r"||dSN)ZbuildinstallZ byte_compile)selfoutfilesr B/usr/lib/python3.8/site-packages/setuptools/command/install_lib.pyrun szinstall_lib.runcs4fddD}t|}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s"|]}|D] }|VqqdSr) _all_packages).0Zns_pkgpkgrr r s z-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZ all_packagesZ excl_specsr rr get_exclusionss  zinstall_lib.get_exclusionscCs$|d|g}tjj|jf|S)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)rrZexclusion_pathpartsr r r rszinstall_lib._exclude_pkg_pathccs |r|V|d\}}}qdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)Zpkg_namesepZchildr r r r 'szinstall_lib._all_packagescCs,|jjs gS|d}|j}|r(|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r)Z distributionZnamespace_packagesZget_finalized_commandZ!single_version_externally_managed)rZ install_cmdZsvemr r r r1s  zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjddtjj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoimplementationN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrsysrrrr cache_tag)baser r r rAs    z install_lib._gen_exclusion_pathsrc sX|stj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|krd|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcZdstexcluder&rr r pfgs z!install_lib.copy_tree..pf)rorigr copy_treeZsetuptools.archive_utilr%Z distutilsr&) rZinfileZoutfileZ preserve_modeZpreserve_timesZpreserve_symlinkslevelr%r.r r,r r0Vs   zinstall_lib.copy_treecs.tj|}|r*fdd|DS|S)Ncsg|]}|kr|qSr r )r fr-r r xsz+install_lib.get_outputs..)r/r get_outputsr)rZoutputsr r3r r5ts  zinstall_lib.get_outputsN)r$r$rr$) __name__ __module__ __qualname____doc__r rr staticmethodr rrr0r5r r r r rs   r) rr! itertoolsrrZdistutils.command.install_libZcommandrr/r r r r sPK!C5command/__pycache__/easy_install.cpython-38.opt-1.pycnu[U QabU@s4dZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'm(Z(dd l)m*Z*dd l+m,Z,ddl-m.Z.m/Z/ddl)m0Z0ddl1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>ddl?m@Z@ddlAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPdd lQZAeRZSejTdeAjUdddddddgZVd d!ZWd"dZXe,jYrBd#d$ZZd%d&Z[nd'd$ZZd(d&Z[d)d*Z\Gd+dde0Z]d,d-Z^d.d/Z_d0d1Z`d2dZad3dZbGd4ddeHZcGd5d6d6ecZdejefd7d8d9kredZcd:d;Zgdd?Zid@dAZjdsdBdCZkdDdEZldFdGZmdHejnkremZondIdJZodtdLdMZpdNdOZqdPdQZrdRdSZszddTlmtZuWnevk rndUdVZuYnXdWdXZtGdYdZdZewZxexyZzGd[d\d\exZ{Gd]d^d^Z|Gd_d`d`e|Z}Gdadbdbe}Z~e|jZe|jZdcddZdedfZdgehfdhdiZdjdkZdldmZdudndZe"jdodpZGdqdrdre*Zd S)va% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html )glob) get_platform) convert_path subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMES SCHEME_KEYS)logdir_util) first_line_re)find_executableN)get_config_varsget_path)SetuptoolsDeprecationWarning)six) configparsermap)Command) run_setup) rmtree_safe)setopt)unpack_archive) PackageIndexparse_requirement_arg URL_SCHEME) bdist_eggegg_info)Wheel) yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributions Environment Requirement Distribution PathMetadata EggMetadata WorkingSetDistributionNotFoundVersionConflict DEVELOP_DISTdefault)categorysamefile easy_installPthDistributionsextract_wininst_cfgmainget_exe_prefixescCstddkS)NP)structcalcsizer<r<C/usr/lib/python3.8/site-packages/setuptools/command/easy_install.pyis_64bitOsr>cCsjtj|otj|}ttjdo&|}|r:tj||Stjtj|}tjtj|}||kS)z Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r2)ospathexistshasattrr2normpathnormcase)Zp1Zp2Z both_existZ use_samefileZnorm_p1Znorm_p2r<r<r=r2SscCs|SNr<sr<r<r= _to_bytesesrHcCs.zt|dWdStk r(YdSXdSNasciiTF)rZ text_type UnicodeErrorrFr<r<r=isasciihs  rLcCs |dS)Nutf8)encoderFr<r<r=rHpscCs,z|dWdStk r&YdSXdSrI)rNrKrFr<r<r=rLss  cCst|ddS)N z; )textwrapdedentstripreplace)textr<r<r={rUc@seZdZdZdZdZdddddd d d d d dddddddddddgZdddddddd d!g Zej rd"ej Z e d#d$e fe d#d%diZ eZd&d'Zd(d)Zd*d+Zed,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zed@ Z!edA Z"edB Z#dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)e*j+dOdPZ,ddRdSZ-ddTdUZ.dVdWZ/ddXdYZ0dZd[Z1d\d]Z2d^d_Z3dd`daZ4edbdcZ5ddfdgZ6dhdiZ7djdkZ8dldmZ9dndoZ:dpdqZ;drdsZddwdxZ?edy Z@dzd{ZAd|d}ZBd~dZCddZDddZEddZFddZGddZHed ZIddZJddZKddZLeMeMddddZNeMdddZOddZPd$S)r3z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zip-okzzinstall package as a zipfile) multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))z install-dir=dzinstall package to DIR)z script-dir=rGzinstall scripts to DIR)exclude-scriptsxzDon't install scripts) always-copyaz'Copy all needed packages to install dir)z index-url=iz base URL of Python Package Index)z find-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files) always-unzipZz*don't install as a zipfile, no matter what)z site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)no-depsNzdon't install dependencies)z allow-hosts=Hz$pattern(s) that hostnames must match)local-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installedrWrYr^r[r`rirkrnrpz!install in user site-package '%s'userNrfcCs,d|_d|_|_d|_|_|_d|_d|_d|_d|_ d|_ |_ d|_ |_ |_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrtj |_!tj"|_#n d|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*d|_+|j,j-|_-|j,.||j,/ddS)NrFr3)0rqzip_oklocal_snapshots_ok install_dir script_direxclude_scripts index_url find_linksbuild_directoryargsoptimizerecordr[ always_copy multi_versionrino_deps allow_hostsrootprefix no_reportrpinstall_purelibinstall_platlibinstall_headers install_libinstall_scripts install_data install_baseinstall_platbasesiteENABLE_USER_SITE USER_BASEinstall_userbase USER_SITEinstall_usersite no_find_links package_indexpth_filealways_copy_from site_dirsinstalled_projectssitepy_installedZ_dry_run distributionverboseZ_set_command_optionsget_option_dictselfr<r<r=initialize_optionssJ      zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tj|stj|r|VqdSrE)r?r@rAislink).0filenamer<r<r= s z/easy_install.delete_blockers..)listr _delete_path)rblockersZextant_blockersr<r<r=delete_blockersszeasy_install.delete_blockerscCsJtd||jrdStj|o.tj| }|r8tntj}||dS)Nz Deleting %s) r infodry_runr?r@isdirrrmtreeunlink)rr@Zis_treeZremoverr<r<r=rs  zeasy_install._delete_pathcCs4djtj}td}d}t|jfttdS)zT Render the Setuptools version and installation details, then exit. {}.{} setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)formatsys version_infor%printlocals SystemExit)Zverdisttmplr<r<r=_render_versions  zeasy_install._render_versionc Csh|jo |tjd}tdd\}}|j|j|j||dd|d|d||||t tddd |_ t j r|j |j d <|j|j d <||||d d d d|jdkr|j|_|jdkrd|_|dd|dd|jr|jr|j|_|j|_|ddtttj}t|_|jdk rdd|jdD}|D]N}t j!|s|t"#d|n,t||krt$|dn|j%t|q\|j&s|'|j(pd|_(|jdd|_)|jt|jfD] }||j)kr|j)*d|q|j+dk r0dd|j+dD}ndg}|j,dkrX|j-|j(|j)|d|_,t.|j)tj|_/|j0dk rt1|j0t2j3r|j0|_0ng|_0|j4r|j,5|j)tj|js|j,6|j0|ddt1|j7t8s6z0t8|j7|_7d|j7krdksnt9Wnt9k r4t$d YnX|j&rN|j:sNt;d!|j<s^t;d"g|_=dS)#Nrr exec_prefixabiflags) Z dist_nameZ dist_versionZ dist_fullname py_versionZpy_version_shortZpy_version_nodotZ sys_prefixrZsys_exec_prefixrruserbaseZusersitertruryrFr)rtrtrrtruinstall)r|r|cSsg|]}tj|qSr<)r?r@ expanduserrRrrGr<r<r= 8sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }|qSr<)rRrr<r<r=rNs*)Z search_pathhosts)r{r{z--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))>rprrsplitrrZget_nameZ get_versionZ get_fullnamegetattr config_varsrrrr_fix_install_dir_for_user_siteexpand_basedirs expand_dirs_expandrurtrZset_undefined_optionsrqrrrr"r@ get_site_dirs all_site_dirsrr?rr warnrappendricheck_site_dirrw shadow_pathinsertrr create_indexr' local_indexrx isinstancerZ string_typesrsZscan_egg_linksadd_find_linksr{int ValueErrorryrrzoutputs) rrrrrCrr]Z path_itemrr<r<r=finalize_optionss                zeasy_install.finalize_optionscCs\|jr tjsdS||jdkr.d}t||j|_|_tj ddd}| |dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedposixZunixZ_user) rqrrcreate_home_pathrr rrr?namerS select_scheme)rmsgZ scheme_namer<r<r=rss  z+easy_install._fix_install_dir_for_user_sitecCsX|D]N}t||}|dk rtjdks.tjdkr:tj|}t||j}t|||qdS)Nrnt)rr?rr@rrrsetattr)rattrsattrvalr<r<r= _expand_attrss   zeasy_install._expand_attrscCs|dddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rrrNrrr<r<r=rszeasy_install.expand_basedirscCsddddddg}||dS)z+Calls `os.path.expanduser` on install dirs.rrrrrrNr)rdirsr<r<r=rszeasy_install.expand_dirsc Cs|j|jjkrt|jz|jD]}|||j q"|jr|j}|j rzt |j }t t |D]}|||d||<q`ddl m }||j|j|fd|j|W5t|jjXdS)Nr) file_utilz'writing list of installed files to '%s')rrr set_verbosityrzr3rr|rrlenrange distutilsrexecuteZ write_filewarn_deprecated_options)rspecrZroot_lenZcounterrr<r<r=runs*     zeasy_install.runcCsDz t}Wn"tk r.tdtj}YnXtj|j d|S)zReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r?getpid ExceptionrandomZrandintrmaxsizer@joinrt)rpidr<r<r=pseudo_tempnames  zeasy_install.pseudo_tempnamecCsdSrEr<rr<r<r=rsz$easy_install.warn_deprecated_optionsc CsZt|j}tj|d}tj|sTzt|Wn ttfk rR| YnX||j k}|sr|j sr| }nd| d}tj|}z*|rt|t|dt|Wn ttfk r| YnX|s|j st||r|jdkrt||j |_nd|_|tttkr.d|_n"|j rPtj|sPd|_d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededeasy-install.pthz .write-testwNT)r"rtr?r@rrAmakedirsOSErrorIOErrorcant_write_to_targetrr~check_pth_processingrropencloserno_default_version_msgrr4r _pythonpathr)rinstdirrZ is_site_dirZtestfileZ test_existsr<r<r=rs>           zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/easy_install.html Please make the appropriate changes for your system and try again. cCsP|jtd|jf}tj|js6|d|j7}n|d|j7}t |dS)NrO) _easy_install__cant_write_msgrexc_infortr?r@rA_easy_install__not_exists_id_easy_install__access_msgr)rrr<r<r=rs z!easy_install.cant_write_to_targetc Cs|j}td||d}|d}tj|}tdd}z8|rNt|tj |}t j j |ddt |d}Wn ttfk r|YnXz||jft|d }tj}tjd krtj|\}} tj|d } | d kotj| } | r| }d dlm} | |dddgd tj|rNtd|WdSW5|r`|tj|rxt|tj|rt|X|jstd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rOT)exist_okrNr pythonw.exe python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rtr rrr?r@rA _one_linerrdirname pkg_resourcesZ py31compatrrrrrrwriterrr executablerrrlowerdistutils.spawnrr~r) rrrZok_fileZ ok_existsrrrcrbasenameZaltZuse_altrr<r<r=rs\            z!easy_install.check_pth_processingc CsV|jsH|drH|dD],}|d|r.q||||d|q||dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rvZmetadata_isdirZmetadata_listdirinstall_scriptZ get_metadatainstall_wrapper_scripts)rr script_namer<r<r=install_egg_scriptsYs z easy_install.install_egg_scriptscCsTtj|rDt|D]*\}}}|D]}|jtj||q$qn |j|dSrE)r?r@rwalkrrr)rr@baserfilesrr<r<r= add_outputgs  zeasy_install.add_outputcCs|jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rirrrr<r<r= not_editableos zeasy_install.not_editablecCs<|js dStjtj|j|jr8td|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)rir?r@rArrykeyrr!r<r<r=check_editablews zeasy_install.check_editablec cs:tjdd}zt|VW5tj|o2tt|XdS)Nz easy_install-)r)tempfilemkdtempr?r@rArrstr)rtmpdirr<r<r=_tmpdirs zeasy_install._tmpdirFc CsH|js||&}t|tst|rb|||j||}| d|||dW5QRSt j |r||| d|||dW5QRSt |}|||j|||j|j|j |j}|dkrd|}|jr|d7}t|nJ|jtkr||||d|W5QRS| ||j||W5QRSW5QRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)riinstall_site_pyr)rr(rr"rdownload install_itemr?r@rArr$Zfetch_distributionr[r}rrZ precedencer/process_distributionlocation)rrdepsr(dlrrr<r<r=r3s<        zeasy_install.easy_installcCs |p|j}|ptj||k}|p,|d }|pT|jdk oTtjt|t|jk}|r|s|j|jD]}|j |krjqqjd}t dtj ||r| |||}|D]}||||qn ||g}|||d|d|dk r|D]}||kr|SqdS)N.eggTz Processing %srr*)r}r?r@rendswithrr"r project_namer/r rr install_eggsr.egg_distribution)rrr,r(r0Zinstall_neededrZdistsr<r<r=r-s2     zeasy_install.install_itemcCs<t|}tD]*}d|}t||dkr t||||q dS)z=Sets the install directories by applying the install schemes.Zinstall_N)r r rr)rrschemer#attrnamer<r<r=rs zeasy_install.select_schemec Gs|||j|||j|jkr2|j||j|||||j|j<t |j ||f|| dr|j s|j |d|s|jsdS|dk r|j|jkrtd|dS|dks||kr|}tt|}t d|ztg|g|j|j}Wn^tk r<}ztt|W5d}~XYn0tk rj}zt|W5d}~XYnX|js||jr|D]"}|j|jkr||qt d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s) update_pthraddrr#removerrr rinstallation_report has_metadatarrZget_metadata_linesr}ras_requirementr(r'r,Zresolver3r-rr.Zreportr)rZ requirementrr0rZdistreqZdistrosrjr<r<r=r.sL           z!easy_install.process_distributioncCs2|jdk r|j S|dr dS|ds.dSdS)Nz not-zip-safeTzzip-safeF)rrr=rrr<r<r= should_unzips   zeasy_install.should_unzipcCstj|j|j}tj|r:d}t||j|j||Stj|rL|}nRtj ||krft |t |}t |dkrtj||d}tj|r|}t |t|||S)Nz<%r already exists in %s; build directory %s will not be keptrr)r?r@rryr#rAr rrrrlistdirrr$shutilmove)rr dist_filename setup_basedstrcontentsr<r<r= maybe_move s$       zeasy_install.maybe_movecCs,|jr dSt|D]}|j|qdSrE)rv ScriptWriterbestget_args write_script)rrrzr<r<r=r"sz$easy_install.install_wrapper_scriptscCsNt|}t||}|r8||t}t||}||t|ddS)z/Generate a legacy script wrapper and install itrdN) r'r>is_python_script_load_templaterrI get_headerrLrH)rrr script_textdev_pathrZ is_scriptZbodyr<r<r=r(s   zeasy_install.install_scriptcCs(d}|r|dd}td|}|dS)z There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplrutf-8)rSr#decode)rQrZ raw_bytesr<r<r=rN2s   zeasy_install._load_templatetr<c sfdd|Dtd|jtjj|}|jrLdSt }t |tj |rpt |t |d|}||W5QRXt|d|dS)z1Write an executable file to the scripts directorycsg|]}tjj|qSr<)r?r@rrurr_rr<r=rDsz-easy_install.write_script..zInstalling %s script to %sNri)rr rrur?r@rr r current_umaskr$rArrrchmod)rrrGmodertargetmaskrcr<rr=rLAs   zeasy_install.write_scriptcCs^|dr|||gS|dr8|||gS|drT|||gS|}tj|r~|ds~t|||j ntj |rtj |}| |r|j r|dk r||||}tj|d}tj|s0ttj|dd}|stdtj |t|dkr(td tj ||d }|jrNt|||gS|||SdS) Nr2.exez.whl.pyzsetup.pyrz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)rr3 install_egg install_exe install_wheelr?r@isfilerunpack_progressrabspath startswithryrHrrArrrrir rreport_editablebuild_and_install)rrrDr(rE setup_scriptZsetupsr<r<r=r5UsJ     zeasy_install.install_eggscCs>tj|r"t|tj|d}ntt|}tj ||dS)NEGG-INFO)metadata) r?r@rr*rr+ zipimport zipimporterr)Z from_filename)regg_pathrhr<r<r=r6s   zeasy_install.egg_distributionc Cstj|jtj|}tj|}|js2t|||}t ||sztj |rrtj |srt j ||jdn"tj|r|tj|fd|zd}tj |r||rtjd}}n tjd}}nL||r|||jd}}n*d}||r tjd}}n tjd}}||||f|dtj|tj|ft||d Wn$tk rxt|dd YnX||||S) Nr Removing FZMovingZCopyingZ ExtractingTz %s to %sfix_zipimporter_caches)r?r@rrtrrbrr$r6r2rrr remove_treerArrrcrBrCZcopytreer@Zmkpathunpack_and_compileZcopy2rupdate_dist_cachesrr )rrkr( destinationrZnew_dist_is_zippedrcrZr<r<r=r]s^                zeasy_install.install_eggc sPt|}|dkrtd|td|dd|ddtd}tj||d}||_ |d}tj|d}tj|d }t |t |||_ | ||tj|st|d } | d |dD].\} } | d kr| d | dd| fq| tj|d|fddt|Dtj|||j|jd|||S)Nz(%s is not a valid distutils Windows .exerhrrp)r4rpplatformr2z.tmprgPKG-INFOrzMetadata-Version: 1.0 target_versionz%s: %s _-rcsg|]}tj|dqS)r)r?r@r)rrzrur<r=rsz,easy_install.install_exe..)rr)r5rr)getrr?r@regg_namer/r$r*Z _provider exe_to_eggrArritemsrStitlerrrIrKrZ make_zipfilerrr]) rrDr(cfgrrkegg_tmpZ _egg_infoZpkg_infrckvr<ryr=r^sJ       zeasy_install.install_exec s6t|ggifdd}t||g}D]l}|dr<|d}|d}t|dd|d<tjj f|} || |t ||q<| t tj dt|dD]Z} t| rtj d| d } tj| st| d } | d t| d | qd S) z;Extract a bdist_wininst to the directories an egg would usecs|}D]\}}||r ||t|d}|d}tjjf|}|}|dsj|drt |d|d<dtj |dd< |n4|dr|dkrdtj |dd< ||Sq |d st d |dS) N/.pyd.dllrrr\SCRIPTS/r zWARNING: can't process %s)rrcrrr?r@rr3r strip_modulesplitextrr r)srcrFrGoldnewpartsr1r native_libsprefixes to_compile top_levelr<r=processs$        z(easy_install.exe_to_egg..processrrrr\rg)rrz.txtrrON)r7rrr3rrrr?r@rrZ write_stub byte_compileZwrite_safety_flagZ analyze_eggrrArrr) rrDrrZstubsresrresourceZpyfilerZtxtrcr<rr=r|s8          zeasy_install.exe_to_eggc Cst|}tj|j|}tj|}|js6t|tj |r`tj |s`t j ||jdn"tj |r|tj|fd|z.||j|fdtj|tj|fW5t|ddX||||S)NrlrmFrnzInstalling %s to %s)r r?r@rrtr{rbrr$rrr rprArrrrZinstall_as_eggrrr r6)rZ wheel_pathr(Zwheelrsr<r<r=r_!s2      zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Installedc Cs^d}|jr>|js>|d|j7}|jtttjkr>|d|j7}|j }|j }|j }d}|t S)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srOr) r~r_easy_install__mv_warningrtrr"rr@_easy_install__id_warningr/r4rpr) rZreqrZwhatrZegglocrrpZextrasr<r<r=r<Os z easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tj|}tj}d|jtS)NrO)r?r@rrr_easy_install__editable_msgr)rrrfrpythonr<r<r=rdhs zeasy_install.report_editablec Cstjdttjdtt|}|jdkrNd|jd}|dd|n|jdkrd|dd|jrv|dd t d |t |ddd |zt ||Wn6tk r}ztd |jdfW5d}~XYnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrrrrx-qz-nz Running %s %s zSetup script exited with %s)rmodules setdefaultrrrrrrr rrrrrrrz)rrfrErzrr<r<r=rms&    zeasy_install.run_setupc Csddg}tjdtj|d}z| tj|| || |||t |g}g}|D]&}||D]}| | |j|qhq\|s|jstd||WSt|t|jXdS)Nrz --dist-dirz egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))r%r&r?r@rrr rr_set_fetcher_optionsrrr'r]r/rr) rrfrErzZdist_dirZall_eggsZeggsr#rr<r<r=res*     zeasy_install.build_and_installc Csp|jd}d}i}|D]&\}}||kr2q |d||dd<q t|d}tj|d}t ||dS) a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r3)rxrrwr{rrrwrx)r3z setup.cfgN) rrcopyr}rSdictr?r@rrZ edit_config) rrZei_optsZfetch_directivesZ fetch_optionsr#rZsettingsZ cfg_filenamer<r<r=rs  z!easy_install._set_fetcher_optionscCs*|jdkrdS|j|jD]H}|js0|j|jkrtd||j||j|jkr|j|jq|js|j|jjkrtd|n2td||j ||j|jkr|j |j|j s&|j |jdkr&t j|jd}t j|rt |t|d}||j|jd|dS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filersetuptools.pthwtrO)rr#r~r/r rr;rpathsr:rrsaver?r@rrtrrrr make_relativer)rrr]rrcr<r<r=r9s6            zeasy_install.update_pthcCstd|||S)NzUnpacking %s to %s)r debug)rrrFr<r<r=raszeasy_install.unpack_progresscsdggfdd}t|||js`D]&}t|tjdBd@}t||q8dS)NcsZ|dr |ds |n|ds4|dr>|||j rV|pXdS)Nr\ EGG-INFO/rz.so)r3rcrrar)rrFrZto_chmodrr<r=pfs    z+easy_install.unpack_and_compile..pfimi)rrrr?statST_MODErW)rrkrsrrcrXr<rr=rqs  zeasy_install.unpack_and_compilec Csjtjr dSddlm}z@t|jd||dd|jd|jrT|||jd|jdW5t|jXdS)Nr)rr)r{forcer) rdont_write_bytecodedistutils.utilrr rrrr{)rrrr<r<r=rs  zeasy_install.byte_compilea bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.cCs|j}||jtjddfSNZ PYTHONPATHr)_easy_install__no_default_msgrtr?environrz)rtemplater<r<r=rsz#easy_install.no_default_version_msgc Cs|jr dStj|jd}tdd}|d}d}tj|rt d|jt |}| }W5QRX| dstd |||krtd ||jst|t j |d dd }||W5QRX||gd |_dS)z8Make sure there's a site.py in the target dir, if neededNzsite.pyrz site-patch.pyrRrzChecking existing site.py in %sz def __boot():z;%s is not a setuptools-generated site.py; please remove it.z Creating %srencodingT)rr?r@rrtr#rSrAr riorreadrcrrrr$rr)rZsitepysourceZcurrentZstrmr<r<r=r+#s0       zeasy_install.install_site_pycCsd|js dSttjd}t|jD]8\}}||r&tj |s&| d|t |dq&dS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) rqrr?r@rrZ iteritemsrrcrZ debug_printr)rhomerr@r<r<r=rCszeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/binrrz$base/Lib/site-packagesz $base/ScriptscGs|dj}|jrd|}|j|d<|jtj|j}| D]$\}}t ||ddkr>t |||q>ddl m }|D]B}t ||}|dk rt|||}tjdkrtj|}t |||qtdS)Nrrr)rr)Zget_finalized_commandrrrr rzr?rDEFAULT_SCHEMEr}rrrrr@r)rrrr7rrrr<r<r=rYs        zeasy_install._expand)F)F)T)N)rTr<)r)Q__name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsZ user_optionsZboolean_optionsrrrZhelp_msgrZ negative_optrrrrr staticmethodrrrrrrrrrrrPrQlstriprrr rrrr r"r$ contextlibcontextmanagerr)r3r-rr.r@rHrrrNrLr5r6r]r^r|r_rrr<rrdrrerr9rarqrrrr+rrr rrr<r<r<r=r3~s  0  z   0 ;   $ $ '    ,6-5   %  cCs tjddtj}td|Sr)r?rrzrpathsepfilter)r}r<r<r=rpsrc Cs~g}|ttjg}tjtjkr0|tj|D]}|r4tjdkr^|tj |ddnVtj dkr|tj |ddj tj dtj |ddgn||tj |ddgtjdkr4d |kr4tj d }|r4tj |d d d j tj d}||q4tdtdf}|D]}||kr||qtjrB|tjz|tWntk rjYnXttt|}|S)z& Return a list of 'site' dirs )Zos2emxZriscosZLibz site-packagesrlibz python{}.{}z site-pythondarwinzPython.frameworkHOMELibraryPythonrZpurelibZplatlib)extendrrrrrrtr?r@rseprrrrzrrrrgetsitepackagesAttributeErrorrrr")sitedirsrrrZhome_spZ lib_pathsZsite_libr<r<r=rus^             rccsi}|D]}t|}||krqd||<tj|s4qt|}||fV|D]}|ds\qL|dkrfqLttj||}tt |}| |D]H}| dst| }||krd||<tj|sq|t|fVqqLqdS)zBYield sys.path directories that might contain "old-style" packagesrr )rrimportN) r"r?r@rrAr3rrrr!rrcrstrip)Zinputsseenrrrrclinesliner<r<r= expand_pathss4        rc Cs@t|d}z$t|}|dkr*W dS|d|d|d}|dkrRWdS||dtd|d\}}}|dkrWdS||d|d d d }t |}z<||} | d d d } | t } |t| Wntjk rYW.dSX|dr"|ds*W dS|WS|XdS)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None rbN  zegg path translations for a given .exe file)zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)rzEGG-INFO/scripts/)zDATA/lib/site-packagesrrrrrurz .egg-inforNrr z -nspkg.pth)ZPURELIBZPLATLIB\rz%s/%s/rcSsg|]\}}||fqSr<)r)rr_yr<r<r=r)sz$get_exe_prefixes..)rZZipFilerZinfolistrrrr3rrupperrrZPY3rSr!rRrSrcrsortreverse)Z exe_filenamerrXrrrrGZpthr<r<r=r7s@       " c@sReZdZdZdZdddZddZdd Zed d Z d d Z ddZ ddZ dS)r4z)A .pth file with Distribution paths in itFr<cCsl||_ttt||_ttj|j|_| t |gddt |j D]}tt|jt|dqLdS)NT)rrrr"rr?r@rbasedir_loadr'__init__r!rr:r&)rrrr@r<r<r=r4szPthDistributions.__init__cCsg|_d}t|j}tj|jrt|jd}|D]}| drHd}q4| }|j || r4| drtq4t tj|j|}|jd<tj|r||kr|jd|_q4d||<q4||jr|sd|_|jr|jd s|jqdS)NFZrtrT#rr)rrfromkeysrr?r@r`rrrcrrrRr"rrrApopdirtyr)rZ saw_importrrcrr@r<r<r=r=s4       zPthDistributions._loadc Cs|js dStt|j|j}|rtd|j||}d |d}t j |jr`t |jt|jd}||W5QRXn(t j |jrtd|jt |jd|_dS)z$Write changed .pth file back to diskNz Saving %srOrzDeleting empty %sF)rrrrrr rr _wrap_linesrr?r@rrrrrA)rZ rel_pathsrdatarcr<r<r=r\s   zPthDistributions.savecCs|SrEr<)rr<r<r=rrszPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jtk}|r>|j|jd|_t||dS)z"Add `dist` to the distribution mapTN) r/rrr?getcwdrrr'r:)rrnew_pathr<r<r=r:vs   zPthDistributions.addcCs2|j|jkr"|j|jd|_qt||dS)z'Remove `dist` from the distribution mapTN)r/rr;rr'r?r<r<r=r;s zPthDistributions.removecCstjt|\}}t|j}|g}tjdkr2dp6tj}t||kr||jkrl|tj | | |Stj|\}}||q8|S)Nr) r?r@rr"rraltseprrcurdirrr)rr@ZnpathZlastZbaselenrrr<r<r=rs      zPthDistributions.make_relativeN)r<) rrrrrrrrrrr:r;rr<r<r<r=r4/s  c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs$|jV|D] }|Vq |jVdSrE)preludepostlude)clsrrr<r<r=rsz#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) z import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)rrr classmethodrrrrr<r<r<r=rs rZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtSttjS)z_ Return a regular expression based on first_line_re suitable for matching strings. )rrpatternr'recompilerSr<r<r<r=_first_line_res rcCsd|tjtjfkr.tjdkr.t|tj||St\}}}t ||d|dd||ffdS)Nrrrz %s %s) r?rr;rrWrS_IWRITErrrZreraise)funcargexcZetZevrwr<r<r= auto_chmods  rcCs.t|}t|tj|r"t|nt|dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r"_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)Z dist_pathronormalized_pathr<r<r=rrs <  rrcCsPg}t|}|D]:}t|}||r|||dtjdfkr||q|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rr)rr"rcr?rr)r cacheresult prefix_lenpZnpr<r<r="_collect_zipimporter_cache_entriess   rcCs@t||D]0}||}||=|o(|||}|dk r |||<q dS)a Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r)r rupdaterr old_entryZ new_entryr<r<r=_update_zipimporter_cache/s  rcCst||dSrE)r)r rr<r<r=r Osr cCsdd}t|tj|ddS)NcSs |dSrE)clearr@rr<r<r=2clear_and_remove_cached_zip_archive_directory_dataTszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_datarrri_zip_directory_cache)r rr<r<r=r Ss r Z__pypy__cCsdd}t|tj|ddS)NcSs&|t||tj||SrE)rrirjupdaterrr<r<r=)replace_cached_zip_archive_directory_datajs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarr)r rr<r<r=r is  r c Cs4zt||dWnttfk r*YdSXdSdS)z%Is this string a valid Python script?execFTN)r SyntaxError TypeError)rTrr<r<r= is_python|s r"c CsNz(tj|dd}|d}W5QRXWnttfk rD|YSX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1rr#!)rrrrr)rfpmagicr<r<r=is_shs  r&cCs t|gS)z@Quote a command line argument according to Windows parsing rules subprocess list2cmdline)rr<r<r= nt_quote_argsr*cCsH|ds|drdSt||r&dS|drDd|dkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. r\.pywTr#rrF)r3r"rc splitlinesr)rPrr<r<r=rMs  rM)rWcGsdSrEr<)rzr<r<r=_chmodsr-c CsRtd||zt||Wn0tjk rL}ztd|W5d}~XYnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r rr-r?error)r@rXrjr<r<r=rWs rWc@seZdZdZgZeZeddZeddZ eddZ edd Z ed d Z d d Z eddZddZeddZeddZdS) CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S)zV Choose the best CommandSpec class based on environmental conditions. r<rr<r<r=rJszCommandSpec.bestcCstjtj}tjd|S)N__PYVENV_LAUNCHER__)r?r@rCrrrrz)rZ_defaultr<r<r=_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dkr0|S||S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rrfrom_environment from_string)rZparamr<r<r= from_params  zCommandSpec.from_paramcCs||gSrE)r2r0r<r<r=r3szCommandSpec.from_environmentcCstj|f|j}||S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )shlexr split_args)rstringr}r<r<r=r4szCommandSpec.from_stringcCs8t|||_t|}t|s4dg|jdd<dS)Nz-xr)r6r_extract_optionsoptionsr(r)rL)rrPcmdliner<r<r=install_optionss zCommandSpec.install_optionscCs:|dd}t|}|r.|dp0dnd}|S)zH Extract any options from the first line of the script. rOrrr)r,rmatchgrouprR)Z orig_scriptfirstr=r:r<r<r=r9s zCommandSpec._extract_optionscCs||t|jSrE)_renderrr:rr<r<r= as_headerszCommandSpec.as_headercCs6d}|D](}||r||r|ddSq|S)Nz"'rr)rcr3)itemZ_QUOTESqr<r<r= _strip_quotess zCommandSpec._strip_quotescCs tdd|D}d|dS)Ncss|]}t|VqdSrE)r/rDrR)rrBr<r<r=rsz&CommandSpec._render..r#rOr')r}r;r<r<r=r@s zCommandSpec._renderN)rrrrr:rr7rrJr2r5r3r4r<rr9rArDr@r<r<r<r=r/s*       r/c@seZdZeddZdS)WindowsCommandSpecFrN)rrrrr7r<r<r<r=rE srEc@seZdZdZedZeZ e dddZ e dddZ e dd d Z ed d Ze d dZe ddZe ddZe dddZdS)rIz` Encapsulates behavior around writing entry point scripts for console and gui apps. a # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) NFcCs6tdt|rtnt}|d||}|||S)Nz Use get_argsr)warningsrEasyInstallDeprecationWarningWindowsScriptWriterrIrJget_script_headerrK)rrrwininstwriterheaderr<r<r=get_script_args$s zScriptWriter.get_script_argscCs$tjdtdd|rd}|||S)NzUse get_headerr) stacklevelr )rFrrGrO)rrPrrJr<r<r=rI,szScriptWriter.get_script_headerc cs|dkr|}t|}dD]Z}|d}||D]>\}}|||jt}|||||} | D] } | Vqlq:q dS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. NZconsoleguiZ_scripts) rOr'r>Z get_entry_mapr}_ensure_safe_namerr_get_script_args) rrrLrtype_r>rZeprPrzrr<r<r=rK4s   zScriptWriter.get_argscCstd|}|rtddS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rsearchr)rZ has_path_sepr<r<r=rQFs zScriptWriter._ensure_safe_namecCs tdt|rtS|SNzUse best)rFrrGrHrJ)rZ force_windowsr<r<r= get_writerOs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tS|SdS)zD Select the best ScriptWriter for this environment. win32javarN)rrtr?r_namerHrJr0r<r<r=rJUszScriptWriter.bestccs|||fVdSrEr<)rrSrrLrPr<r<r=rR_szScriptWriter._get_script_argsrcCs"|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrJr5r<rA)rrPrcmdr<r<r=rOds zScriptWriter.get_header)NF)NF)N)rN)rrrrrPrQrrr/rZrrMrIrKrrQrVrJrRrOr<r<r<r=rIs&       rIc@sLeZdZeZeddZeddZeddZeddZ e d d Z d S) rHcCstdt|SrU)rFrrGrJr0r<r<r=rVos zWindowsScriptWriter.get_writercCs"tt|d}tjdd}||S)zC Select the best ScriptWriter suitable for Windows )rZnaturalZSETUPTOOLS_LAUNCHERr)rWindowsExecutableLauncherWriterr?rrz)rZ writer_lookupZlauncherr<r<r=rJus zWindowsScriptWriter.bestc #stddd|}|tjddkrBdjft}t|t dddd d dd g}| || ||}fd d |D}|||d|fVdS)z For Windows, add a .py extensionz.pyar+rOZPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.r\ -script.py.pyc.pyor[csg|] }|qSr<r<rUrr<r=rsz8WindowsScriptWriter._get_script_args..rTN) rr?rrrrrrFr UserWarningr;_adjust_header) rrSrrLrPextrrrr<rar=rRs   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tt|tj}|j||d}||rJ|S|S)z Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). r r rP)r8repl)rrescape IGNORECASEsub _use_header)rrSZ orig_headerrreZ pattern_ob new_headerr<r<r=rcs z"WindowsScriptWriter._adjust_headercCs$|ddd}tjdkp"t|S)z Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. rr"rW)rRrrtr)rjZ clean_headerr<r<r=ris zWindowsScriptWriter._use_headerN) rrrrErZrrVrJrRrcrrir<r<r<r=rHls    rHc@seZdZeddZdS)r\c #s|dkrd}d}dg}nd}d}dddg}|||}fd d |D} |||d | fVd t|d fVtsd} | td fVdS)zG For Windows, add a .py extension and an .exe launcher rPz -script.pywr+Zclir^r\r_r`csg|] }|qSr<r<rUrar<r=rszDWindowsExecutableLauncherWriter._get_script_args..rTr[rdz .exe.manifestN)rcget_win_launcherr>load_launcher_manifest) rrSrrLrPZ launcher_typerdrZhdrrZm_namer<rar=rRs"  z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrrRr<r<r<r=r\sr\cCs2d|}tr|dd}n |dd}td|S)z Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exe.z-64.z-32.r)r>rSr#)typeZ launcher_fnr<r<r=rls  rlcCs0ttd}tjr|tS|dtSdS)Nzlauncher manifest.xmlrR)rr#rrPY2varsrS)rZmanifestr<r<r=rms  rmFcCst|||SrE)rBr)r@ ignore_errorsonerrorr<r<r=rsrcCstd}t||S)N)r?umask)Ztmpr<r<r=rVs  rVcCs:ddl}tj|jd}|tjd<tj|tdS)Nr) rr?r@r__path__rargvrr6)rZargv0r<r<r= bootstraps   rxc sddlm}ddlmGfddd}|dkrBtjdd}t0|fddd g|tjdpfd|d |W5QRXdS) Nr)setupr)cseZdZdZfddZdS)z-main..DistributionWithoutHelpCommandsrc s(tj|f||W5QRXdSrE) _patch_usage _show_help)rrzkwrzr<r=r| sz8main..DistributionWithoutHelpCommands._show_helpN)rrrZ common_usager|r<rzr<r=DistributionWithoutHelpCommands sr~rrr3z-v)Z script_argsrZ distclass)rryZsetuptools.distr)rrwr{)rwr}ryr~r<rzr=r6s    c#sLddl}tdfdd}|jj}||j_z dVW5||j_XdS)Nrze usage: %(script)s [options] requirement_or_url ... or: %(script)s --help csttj|dS)N)Zscript)rr?r@r)rZUSAGEr<r= gen_usage s z_patch_usage..gen_usage)Zdistutils.corerPrQrZcorer)rrZsavedr<rr=r{ s  r{c@seZdZdZdS)rGzuClass for warning about deprecations in EasyInstall in SetupTools. Not ignored by default, unlike DeprecationWarning.N)rrrrr<r<r<r=rG( srG)N)r)N)rrrrrrZdistutils.errorsrrrr Zdistutils.command.installr r rr r Zdistutils.command.build_scriptsrrrrr?rirBr%rrrrrPrFrr:rr(r6rZ sysconfigrrrrZsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.sandboxrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelr rr!r"r#r$r%r&r'r(r)r*r+r,r-r.r/Zpkg_resources.py31compatroZ __metaclass__filterwarningsZ PEP440Warning__all__r>r2rprHrLrr3rrrr5r7r4rrrzrrrrrrr r builtin_module_namesr r"r&r*rMrWr- ImportErrorrr/r2Zsys_executablerErIrHr\rMrIrlrmrrVrxr6rr{rGr<r<r<r=s            D {A))'l R    T^A   PK!" 6command/__pycache__/bdist_wininst.cpython-38.opt-1.pycnu[U Qab}@s(ddlmmZGdddejZdS)Nc@seZdZdddZddZdS) bdist_wininstrcCs |j||}|dkrd|_|S)zj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 )Zinstall install_libN)Z distributionreinitialize_commandr)selfcommandZreinit_subcommandscmdrD/usr/lib/python3.8/site-packages/setuptools/command/bdist_wininst.pyrsz"bdist_wininst.reinitialize_commandcCs$d|_ztj|W5d|_XdS)NTF)Z _is_runningorigrrun)rrrr r szbdist_wininst.runN)r)__name__ __module__ __qualname__rr rrrr rs r)Zdistutils.command.bdist_wininstrrr rrrr sPK!U3.command/__pycache__/install_lib.cpython-38.pycnu[U Qab@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs&||}|dk r"||dSN)ZbuildinstallZ byte_compile)selfoutfilesr B/usr/lib/python3.8/site-packages/setuptools/command/install_lib.pyrun szinstall_lib.runcs4fddD}t|}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s"|]}|D] }|VqqdSr) _all_packages).0Zns_pkgpkgrr r s z-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZ all_packagesZ excl_specsr rr get_exclusionss  zinstall_lib.get_exclusionscCs$|d|g}tjj|jf|S)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)rrZexclusion_pathpartsr r r rszinstall_lib._exclude_pkg_pathccs |r|V|d\}}}qdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)Zpkg_namesepZchildr r r r 'szinstall_lib._all_packagescCs,|jjs gS|d}|j}|r(|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r)Z distributionZnamespace_packagesZget_finalized_commandZ!single_version_externally_managed)rZ install_cmdZsvemr r r r1s  zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjddtjj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoimplementationN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrsysrrrr cache_tag)baser r r rAs    z install_lib._gen_exclusion_pathsrc sh|r |r |rt|s,tj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|krd|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcZdstexcluder&rr r pfgs z!install_lib.copy_tree..pf) AssertionErrorrorigr copy_treeZsetuptools.archive_utilr%Z distutilsr&) rZinfileZoutfileZ preserve_modeZpreserve_timesZpreserve_symlinkslevelr%r.r r,r r1Vs   zinstall_lib.copy_treecs.tj|}|r*fdd|DS|S)Ncsg|]}|kr|qSr r )r fr-r r xsz+install_lib.get_outputs..)r0r get_outputsr)rZoutputsr r4r r6ts  zinstall_lib.get_outputsN)r$r$rr$) __name__ __module__ __qualname____doc__r rr staticmethodr rrr1r6r r r r rs   r) rr! itertoolsrrZdistutils.command.install_libZcommandrr0r r r r sPK!4#n)c c 9command/__pycache__/install_egg_info.cpython-38.opt-1.pycnu[U Qab@s\ddlmZmZddlZddlmZddlmZddlmZddl Z Gdddej eZ dS))logdir_utilN)Command) namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZddZd d Z d d Z d S)install_egg_infoz.Install an .egg-info directory for the package)z install-dir=dzdirectory to install tocCs d|_dSN) install_dirselfr G/usr/lib/python3.8/site-packages/setuptools/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|dd|d}tdd|j|jd}|j|_tj |j ||_ g|_ dS)NZ install_lib)r r egg_infoz .egg-info)Zset_undefined_optionsZget_finalized_command pkg_resourcesZ DistributionZegg_nameZ egg_versionrsourceospathjoinr targetoutputs)r Zei_cmdbasenamer r rfinalize_optionss z!install_egg_info.finalize_optionscCs|dtj|jr:tj|js:tj|j|jdn(tj |jrb| tj |jfd|j|jstt |j| |jdd|j|jf|dS)Nr)dry_runz Removing r Copying %s to %s)Z run_commandrrisdirrislinkrZ remove_treerexistsZexecuteunlinkrZensure_directorycopytreerZinstall_namespacesr r r rrun!s  zinstall_egg_info.runcCs|jSr )rr r r r get_outputs.szinstall_egg_info.get_outputscs fdd}tjj|dS)NcsDdD] }||sd||krdSqj|td|||S)N)z.svn/zCVS//r) startswithrappendrdebug)srcZdstskipr r rskimmer3s  z*install_egg_info.copytree..skimmer)rrr)r r)r r rr 1s zinstall_egg_info.copytreeN) __name__ __module__ __qualname____doc__ descriptionZ user_optionsrrr!r"r r r r rr s  r) Z distutilsrrrZ setuptoolsrrZsetuptools.archive_utilrrZ Installerrr r r rs    PK!j7 /command/__pycache__/rotate.cpython-38.opt-1.pycnu[U Qabt@s`ddlmZddlmZddlmZddlZddlZddlm Z ddl m Z Gddde Z dS) ) convert_path)log)DistutilsOptionErrorN)six)Commandc@s:eZdZdZdZdddgZgZddZdd Zd d Z d S) rotatezDelete older distributionsz2delete older distributions, keeping N newest files)zmatch=mzpatterns to match (required))z dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeepselfr=/usr/lib/python3.8/site-packages/setuptools/command/rotate.pyinitialize_optionsszrotate.initialize_optionscCs|jdkrtd|jdkr$tdzt|j|_Wntk rPtdYnXt|jtjrxdd|jdD|_| dddS) NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|qSr)rstrip).0prrr *sz+rotate.finalize_options..,Zbdist)r r ) r rr int ValueError isinstancerZ string_typessplitZset_undefined_optionsrrrrfinalize_optionss   zrotate.finalize_optionscCs|dddlm}|jD]}|jd|}|tj|j|}dd|D}| | t dt ||||jd}|D]<\}}t d||jstj|rt|qt|qqdS) NZegg_infor)glob*cSsg|]}tj||fqSr)ospathgetmtime)rfrrrr6szrotate.run..z%d file(s) matching %sz Deleting %s)Z run_commandrr Z distributionZget_namerr joinr sortreverserinfolenr Zdry_runisdirshutilZrmtreeunlink)rrpatternfilestr"rrrrun/s        z rotate.runN) __name__ __module__ __qualname____doc__ descriptionZ user_optionsZboolean_optionsrrr.rrrrr sr) Zdistutils.utilrZ distutilsrZdistutils.errorsrrr)Zsetuptools.externrZ setuptoolsrrrrrrs     PK!1q.command/__pycache__/sdist.cpython-38.opt-1.pycnu[U Qab@sddlmZddlmmZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZd ddZGd d d e ejZdS) )logN)six)sdist_add_defaultsccs,tdD]}||D] }|Vqq dS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesZiter_entry_pointsload)dirnameZepitemr )szsdist.cCs|d|d}|j|_|jtj|jd|| D]}||qD| t |j dg}|j D] }dd|f}||krp||qpdS)Negg_infoz SOURCES.txt dist_filesrr)Z run_commandget_finalized_commandfilelistappendospathjoinr check_readmeZget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdZcmd_namerfiledatar r r run+s      z sdist.runcCstj||dS)N)origrinitialize_options_default_to_gztarr r r r r%>s zsdist.initialize_optionscCstjdkrdSdg|_dS)N)rZbetarZgztar)sys version_infoZformatsr'r r r r&Cs zsdist._default_to_gztarc Cs$|tj|W5QRXdS)z% Workaround for #516 N)_remove_os_linkr$rrr'r r r rIs zsdist.make_distributionc cs^Gddd}ttd|}zt`Wntk r6YnXz dVW5||k rXttd|XdS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r r NoValueWsr0linkN)rrr1 Exceptionsetattr)r0Zorig_valr r r r,Ps  zsdist._remove_os_linkcCsLztj|Wn6tk rFt\}}}|jjjd YnXdS)Ntemplate) r$r read_templater2r*exc_infotb_nexttb_framef_localsclose)r _tbr r r Z__read_template_hackes zsdist.__read_template_hack)r=)r(r)r(r)r(r=)r(r=rcs^|jrZ|d}|j||jjsZ|jD]&\}}}|jfdd|Dq2dS)zgetting python filesbuild_pycsg|]}tj|qSr )rrr)rfilenameZsrc_dirr r sz.sdist._add_defaults_python..N)rZhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ data_files)r r@r; filenamesr rBr _add_defaults_python|s  zsdist._add_defaults_pythoncsDz tjrt|n tWntk r>tdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper TypeErrorrwarnr' __class__r r rGs  zsdist._add_defaults_data_filescCs8|jD]}tj|rdSq|dd|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrJr)r fr r r rs   zsdist.check_readmecCs^tj|||tj|d}ttdrJtj|rJt|| d|| d |dS)Nz setup.cfgr1r) r$rmake_release_treerrrhasattrrNunlinkZ copy_filerZsave_version_info)r Zbase_dirfilesdestr r r rPs   zsdist.make_release_treec Cs@tj|jsdSt|jd}|}W5QRX|dkS)NFrbz+# file GENERATED by distutils, do NOT edit )rrisfilemanifestioopenreadlineencode)r fpZ first_liner r r _manifest_is_not_generatedsz sdist._manifest_is_not_generatedc Cstd|jt|jd}|D]d}tjr^z|d}Wn&tk r\td|YqYnX| }| ds|svq|j |q| dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'rUzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforWrYrZPY3decodeUnicodeDecodeErrorrJstrip startswithrrr:)r rWliner r r read_manifests  zsdist.read_manifestcCs^|jd}|dd\}}|dkr2tddStj|sNtd|dS|j |dS)zyChecks if license_file' is configured and adds it to 'self.filelist' if the value contains a valid path. Zmetadata license_file)NNNz''license_file' option was not specifiedz8warning: Failed to find the configured license file '%s') rZget_option_dictgetrdebugrrrNrJrr)r Zoptsr;rfr r r check_licenses   zsdist.check_license)r-r.r/__doc__Z user_optionsZ negative_optZREADME_EXTENSIONStuplerMr#r%r&r staticmethod contextlibcontextmanagerr,Z_sdist__read_template_hackr*r+Zhas_leaky_handler5rFrGrrPr]reri __classcell__r r rKr rs<        r)r)Z distutilsrZdistutils.command.sdistZcommandrr$rr*rXrmZsetuptools.externrZ py36compatrrlistZ_default_revctrlr r r r r s    PK!" 0command/__pycache__/bdist_wininst.cpython-38.pycnu[U Qab}@s(ddlmmZGdddejZdS)Nc@seZdZdddZddZdS) bdist_wininstrcCs |j||}|dkrd|_|S)zj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 )Zinstall install_libN)Z distributionreinitialize_commandr)selfcommandZreinit_subcommandscmdrD/usr/lib/python3.8/site-packages/setuptools/command/bdist_wininst.pyrsz"bdist_wininst.reinitialize_commandcCs$d|_ztj|W5d|_XdS)NTF)Z _is_runningorigrrun)rrrr r szbdist_wininst.runN)r)__name__ __module__ __qualname__rr rrrr rs r)Zdistutils.command.bdist_wininstrrr rrrr sPK!IG/command/__pycache__/setopt.cpython-38.opt-1.pycnu[U Qab@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd dZ dddZ Gdd d e ZGdd d eZdS)) convert_path)log)DistutilsOptionErrorN) configparser)Command config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjtjtjdS|dkrZtjdkrBdpDd}tjtd |St d |d S) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)Zkinddotr=/usr/lib/python3.8/site-packages/setuptools/command/setopt.pyrs Fc Cs&td|t}||g|D]\}}|dkrRtd||||q(||sttd||| ||D]p\}}|dkrtd|||| ||| |std||||q|td||||| |||q|q(td||s"t |d }||W5QRXdS) aYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sw)rdebugrZRawConfigParserreaditemsinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionoptionssetopenwrite) filenameZsettingsdry_runZoptsZsectionr"optionvaluefrrrr!sJ          c@s2eZdZdZdddgZddgZddZd d Zd S) r z|js>tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r r9rEr(rrFrCr2rrrr9s  zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr&rEr(replacerFr'r2rrrrunsz setopt.runN) r:r;r<r= descriptionr r>r?r4r9rJrrrrr ss )r )F)Zdistutils.utilrrrZdistutils.errorsrrZsetuptools.extern.six.movesrZ setuptoolsr__all__rrr r rrrrs        +'PK!Ilee0command/__pycache__/develop.cpython-38.opt-1.pycnu[U Qab@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl Z ddl mZddlmZddlZeZGdd d ejeZGd d d ZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN)six) easy_install) namespacesc@sveZdZdZdZejddgZejdgZdZddZ d d Z d d Z e d dZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode') uninstalluzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer FcCs2|jrd|_||n||dS)NT)r Z multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_optionsselfr>/usr/lib/python3.8/site-packages/setuptools/command/develop.pyrun s  z develop.runcCs&d|_d|_t|d|_d|_dS)N.)r egg_pathrinitialize_options setup_pathZalways_copy_fromrrrrr)s  zdevelop.initialize_optionscCs|d}|jr,d}|j|jf}t|||jg|_t||| |j t d|jd}t j|j||_|j|_|jdkrt j|j|_t|j}tt j|j|j}||krtd|tj|t|t j|j|jd|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to Z project_name)get_finalized_commandZbroken_egg_inforrZegg_nameargsrfinalize_optionsZexpand_basedirsZ expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspath pkg_resourcesnormalize_pathrZ Distribution PathMetadatadist_resolve_setup_pathr)rZeitemplaterZ egg_link_fntargetrrrrr0sF        zdevelop.finalize_optionscCsn|tjdd}|tjkr0d|dd}ttj |||}|ttjkrjt d|ttj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacerseprstripcurdircountr%r&rr r)r#r!rZ path_to_setupZresolvedrrrr)Zs  zdevelop._resolve_setup_pathc CsHtjrt|jddr|jddd|d|d}t|j }|jd|d|d|jddd|d|d}||_ ||j _ t ||j|j _n"|d|jdd d|d|tjr|tjdt_|td |j|j|js0t|jd }||j d |jW5QRX|d|j |j dS) NZuse_2to3FZbuild_pyr)Zinplacer)r#Z build_extr-zCreating %s (link to %s)w )rZPY3getattr distributionZreinitialize_commandZ run_commandrr%r&Z build_librr(locationr'rZ _providerZinstall_site_py setuptoolsZbootstrap_install_fromrZinstall_namespacesrinfor"r#dry_runopenwriterZprocess_distributionZno_deps)rZbpy_cmdZ build_pathZei_cmdfrrrr ns:           zdevelop.install_for_developmentcCstj|jrztd|j|jt|j}dd|D}|||j g|j |j gfkrht d|dS|j szt |j|j s||j|jjrt ddS)NzRemoving %s (link to %s)cSsg|] }|qSr)r0).0linerrr sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)rrexistsr"rr9r#r;closerrwarnr:unlinkZ update_pthr(r6scripts)rZ egg_link_filecontentsrrrr s      zdevelop.uninstall_linkc Cs||jk rt||S|||jjp*gD]N}tjt |}tj |}t |}| }W5QRX|||||q,dSN)r(rinstall_egg_scriptsinstall_wrapper_scriptsr6rErrr$rbasenameior;readZinstall_script)rr(Z script_nameZ script_pathZstrmZ script_textrrrrHs     zdevelop.install_egg_scriptscCst|}t||SrG)VersionlessRequirementrrIrr(rrrrIszdevelop.install_wrapper_scriptsN)__name__ __module__ __qualname____doc__ descriptionrZ user_optionsZboolean_optionsZcommand_consumes_argumentsrrr staticmethodr)r r rHrIrrrrr s"  * 0r c@s(eZdZdZddZddZddZdS) rMa Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dSrG)_VersionlessRequirement__distrNrrr__init__szVersionlessRequirement.__init__cCs t|j|SrG)r5rU)rnamerrr __getattr__sz"VersionlessRequirement.__getattr__cCs|jSrGrrrrras_requirementsz%VersionlessRequirement.as_requirementN)rOrPrQrRrVrXrYrrrrrMsrM)Zdistutils.utilrZ distutilsrZdistutils.errorsrrrrrKZsetuptools.externrr%Zsetuptools.command.easy_installrr8rtypeZ __metaclass__ZDevelopInstallerr rMrrrrs     6PK!ɀX X .command/__pycache__/alias.cpython-38.opt-1.pycnu[U Qabz @sPddlmZddlmZddlmZmZmZddZGdddeZ dd Z d S) )DistutilsOptionError)map) edit_config option_base config_filecCs8dD]}||krt|Sq||gkr4t|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcrs   4PK!4#n)c c 3command/__pycache__/install_egg_info.cpython-38.pycnu[U Qab@s\ddlmZmZddlZddlmZddlmZddlmZddl Z Gdddej eZ dS))logdir_utilN)Command) namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZddZd d Z d d Z d S)install_egg_infoz.Install an .egg-info directory for the package)z install-dir=dzdirectory to install tocCs d|_dSN) install_dirselfr G/usr/lib/python3.8/site-packages/setuptools/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|dd|d}tdd|j|jd}|j|_tj |j ||_ g|_ dS)NZ install_lib)r r egg_infoz .egg-info)Zset_undefined_optionsZget_finalized_command pkg_resourcesZ DistributionZegg_nameZ egg_versionrsourceospathjoinr targetoutputs)r Zei_cmdbasenamer r rfinalize_optionss z!install_egg_info.finalize_optionscCs|dtj|jr:tj|js:tj|j|jdn(tj |jrb| tj |jfd|j|jstt |j| |jdd|j|jf|dS)Nr)dry_runz Removing r Copying %s to %s)Z run_commandrrisdirrislinkrZ remove_treerexistsZexecuteunlinkrZensure_directorycopytreerZinstall_namespacesr r r rrun!s  zinstall_egg_info.runcCs|jSr )rr r r r get_outputs.szinstall_egg_info.get_outputscs fdd}tjj|dS)NcsDdD] }||sd||krdSqj|td|||S)N)z.svn/zCVS//r) startswithrappendrdebug)srcZdstskipr r rskimmer3s  z*install_egg_info.copytree..skimmer)rrr)r r)r r rr 1s zinstall_egg_info.copytreeN) __name__ __module__ __qualname____doc__ descriptionZ user_optionsrrr!r"r r r r rr s  r) Z distutilsrrrZ setuptoolsrrZsetuptools.archive_utilrrZ Installerrr r r rs    PK!~hyy+command/__pycache__/saveopts.cpython-38.pycnu[U Qab@s$ddlmZmZGdddeZdS)) edit_config option_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsh|j}i}|jD]B}|dkrq||D]$\}\}}|dkr,|||i|<q,qt|j||jdS)Nrz command line)Z distributionZcommand_optionsZget_option_dictitems setdefaultrfilenameZdry_run)selfZdistZsettingscmdoptsrcvalr ?/usr/lib/python3.8/site-packages/setuptools/command/saveopts.pyrun s z saveopts.runN)__name__ __module__ __qualname____doc__ descriptionrr r r rrsrN)Zsetuptools.command.setoptrrrr r r rsPK!Th!!'command/__pycache__/test.cpython-38.pycnu[U Qab%@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd d lmZeZ Gd d d e Z!Gd ddZ"GdddeZ#dS)N)DistutilsErrorDistutilsOptionError)log) TestLoader)six)mapfilter) resource_listdirresource_existsnormalize_path working_set_namespace_packagesevaluate_markeradd_activation_listenerrequire EntryPoint)Command)_unique_everseenc@seZdZddZdddZdS)ScanningLoadercCst|t|_dSN)r__init__set_visitedselfr;/usr/lib/python3.8/site-packages/setuptools/command/test.pyrs zScanningLoader.__init__NcCs||jkrdS|j|g}|t||t|drH||t|drt|jdD]`}| dr|dkr|jd|dd}n"t |j|d r^|jd|}nq^|| |q^t |d kr| |S|d SdS) aReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. Nadditional_tests__path__z.pyz __init__.py.z /__init__.pyrr)raddappendrloadTestsFromModulehasattrrr __name__endswithr ZloadTestsFromNamelenZ suiteClass)rmodulepatternZtestsfileZ submodulerrrr%s$      z"ScanningLoader.loadTestsFromModule)N)r' __module__ __qualname__rr%rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs ||_dSrfget)rr1rrrrAszNonDataProperty.__init__NcCs|dkr |S||Srr0)robjZobjtyperrr__get__DszNonDataProperty.__get__)N)r'r-r.rr3rrrrr/@sr/c@seZdZdZdZdddgZddZdd Zed d Z d d Z ddZ e j gfddZee j ddZeddZddZddZeddZeddZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated))z test-module=mz$Run 'test_suite' in specified module)z test-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))z test-runner=rzTest runner to usecCsd|_d|_d|_d|_dSr) test_suite test_module test_loader test_runnerrrrrinitialize_optionsVsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n |jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz .test_suiter:z&setuptools.command.test:ScanningLoaderr;)r8r9r distributionr:getattrr;)rmsgrrrfinalize_options\s        ztest.finalize_optionscCs t|Sr)list _test_argsrrrr test_argsosztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)Zdiscoverz --verbose)r8sys version_infoverboserrrrrBss ztest._test_argsc Cs| |W5QRXdS)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncrrrwith_project_on_sys_path{s ztest.with_project_on_sys_pathc csPtjot|jdd}|rv|jddd|d|d}t|j}|jd|d|d|jddd|dn"|d|jdd d|d|d}t j dd}t j }zbt|j}t j d|ttd d td |j|jf||g dVW5QRXW5|t j dd<t j t j |tXdS) Nuse_2to3Fbuild_pyr)ZinplaceZegg_info)egg_baseZ build_extrcSs|Sr)Zactivate)distrrrz*test.project_on_sys_path..z%s==%s)rPY3r>r=Zreinitialize_commandZ run_commandZget_finalized_commandr Z build_librFpathmodulescopyclearupdater rrNinsertrrZegg_nameZ egg_versionpaths_on_pythonpath) rZ include_distsZ with_2to3Zbpy_cmdZ build_pathZei_cmdZold_pathZ old_modulesZ project_pathrrrrIs8             ztest.project_on_sys_pathc cst}tjd|}tjdd}zBtjt|}td||g}tj|}|r\|tjd<dVW5||kr~tjddn |tjd<XdS)z Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. Z PYTHONPATHr N) objectosenvirongetpoppathsepjoinrr)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrYs    ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css0|](\}}|drt|ddr|VqdS):rN) startswithr).0kvrrr s z%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ tests_requireZextras_requireitems itertoolschain)rOZir_dZtr_dZer_drrr install_distss   ztest.install_distsc Cs|dtj||j}d|j}|jr>|d|dS|d|tt d|}| |"| | W5QRXW5QRXdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)z running "%s"location)announcerZWARNrmr=r`_argvZdry_runroperator attrgetterrYrI run_tests)rZinstalled_distscmdrarrrruns    ztest.runcCstjr~t|jddr~|jdd}|tkr~g}|tjkrD| ||d7}tjD]}| |rR| |qRt t tjj |tjdd|j||j||jdd}|jsd|j}||tjt|dS)NrLFr!r)Z testLoaderZ testRunnerexitzTest failed: %s)rrRr>r=r8splitr rFrTr$rerAr __delitem__unittestmainrq_resolve_as_epr:r;resultZ wasSuccessfulrprZERRORr)rr*Z del_modulesnamer4r?rrrrts.         ztest.run_testscCs dg|jS)Nrz)rCrrrrrq sz test._argvcCs$|dkr dStd|}|S)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. Nzx=)rparseZresolve)valZparsedrrrr|sztest._resolve_as_epN)r'r-r.__doc__ descriptionZ user_optionsr<r@r/rCrBrK contextlibcontextmanagerrI staticmethodrYrmrvrtpropertyrqr|rrrrr4Js2 -   r4)$r[rrrFrrkrzZdistutils.errorsrrZ distutilsrrZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesr r r r r rrrrZ setuptoolsrrMrtypeZ __metaclass__rr/r4rrrrs"   ,  ) PK!$8command/__pycache__/install_scripts.cpython-38.opt-1.pycnu[U Qab @sXddlmZddlmmZddlZddlZddlm Z m Z m Z GdddejZdS))logN) Distribution PathMetadataensure_directoryc@s*eZdZdZddZddZd ddZd S) install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj|d|_dS)NF)origrinitialize_optionsno_ep)selfr F/usr/lib/python3.8/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddlmm}|d|jjr2tj|ng|_ |j rBdS| d}t |j t|j |j|j|j}| d}t|dd}| d}t|dd}|j}|rd}|j}|tjkr|g}|}|j|} ||| D]} |j| qdS) Nregg_infoZ build_scripts executableZ bdist_wininstZ _is_runningFz python.exe)setuptools.command.easy_installcommandZ easy_installZ run_commandZ distributionZscriptsrrrunoutfilesr Zget_finalized_commandrZegg_baserr Zegg_nameZ egg_versiongetattrZ ScriptWriterZWindowsScriptWritersysrZbestZcommand_spec_classZ from_paramZget_argsZ as_header write_script) r ZeiZei_cmdZdistZbs_cmdZ exec_paramZbw_cmdZ is_wininstwritercmdargsr r r rs8        zinstall_scripts.runtc Gsddlm}m}td||jtj|j|}|j ||}|j s~t |t |d|} | || ||d|dS)z1Write an executable file to the scripts directoryr)chmod current_umaskzInstalling %s script to %swiN)rrrrinfoZ install_dirospathjoinrappendZdry_runropenwriteclose) r Z script_namecontentsmodeZignoredrrtargetmaskfr r r r3s  zinstall_scripts.write_scriptN)r)__name__ __module__ __qualname____doc__rrrr r r r r s#r) Z distutilsrZ!distutils.command.install_scriptsrrrrrZ pkg_resourcesrrrr r r r s PK!e0command/__pycache__/install.cpython-38.opt-1.pycnu[U QabK@s|ddlmZddlZddlZddlZddlZddlmmZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd d dfgZe eZ d d Z d dZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrZinstall_egg_infocCsdSNTselfrr>/usr/lib/python3.8/site-packages/setuptools/command/install.pyzinstall.Zinstall_scriptscCsdSrrrrrr r r cCstj|d|_d|_dSN)origrinitialize_optionsold_and_unmanageable!single_version_externally_managedrrrr r s zinstall.initialize_optionscCs8tj||jrd|_n|jr4|js4|js4tddS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrrrrr r%s  zinstall.finalize_optionscCs(|js |jrtj|Sd|_d|_dS)N)rrrrhandle_extra_pathZ path_fileZ extra_dirsrrrr r0s  zinstall.handle_extra_pathcCs@|js |jrtj|S|ts4tj|n|dSr ) rrrrrun_called_from_setupinspectZ currentframedo_egg_installrrrr r:s   z install.runcCsz|dkr4d}t|tdkr0d}t|dSt|d}|dd\}t|}|jdd }|d kox|j d kS) a Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail.Z IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distZ run_commands) warningswarnplatformZpython_implementationrZgetouterframesZ getframeinfo f_globalsgetZfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rEs     zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd| d|j dj g}t j rp|dt j ||_|dt _ dS)N easy_installx)argsrr.z*.eggZ bdist_eggr)Z distributionZget_command_classrrZensure_finalizedZalways_copy_fromZ package_indexscanglobZ run_commandZget_command_objZ egg_output setuptoolsZbootstrap_install_frominsertr(r)r r&cmdr(rrr r`s"  zinstall.do_egg_installN)r __module__ __qualname____doc__rrZ user_optionsZboolean_options new_commandsdict_ncrrrr staticmethodrrrrrr rs(      rcCsg|]}|dtjkr|qS)r)rr4).0r.rrr {sr7)Zdistutils.errorsrrr+rr Zdistutils.command.installZcommandrrr,_installZ sub_commandsr2rrrr s lPK!HH3command/__pycache__/py36compat.cpython-38.opt-1.pycnu[U Qabz@sdddlZddlmZddlmZddlmZddlmZGdddZe ejdr`Gd ddZdS) N)glob) convert_path)sdist)filterc@s\eZdZdZddZeddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)sdist_add_defaultsz Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<|||||||dS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfrA/usr/lib/python3.8/site-packages/setuptools/command/py36compat.py add_defaultsszsdist_add_defaults.add_defaultscCs:tj|sdStj|}tj|\}}|t|kS)z Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ospathexistsabspathsplitlistdir)fspathrZ directoryfilenamerrr_cs_path_exists(s  z"sdist_add_defaults._cs_path_existscCs|j|jjg}|D]~}t|trj|}d}|D]"}||r,d}|j|qPq,|s|dd |q||r|j|q|d|qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMES distributionZ script_name isinstancetuplerfilelistappendwarnjoin)rZ standardsfnZaltsZgot_itrrrr9s"    z*sdist_add_defaults._add_defaults_standardscCs4ddg}|D]"}ttjjt|}|j|q dS)Nz test/test*.pyz setup.cfg)rrrisfilerrextend)rZoptionalpatternfilesrrrrNsz)sdist_add_defaults._add_defaults_optionalcCs\|d}|jr$|j||jD],\}}}}|D]}|jtj ||q:q*dS)Nbuild_py) get_finalized_commandrZhas_pure_modulesrr$get_source_files data_filesrrrr!)rr'ZpkgZsrc_dirZ build_dir filenamesrrrrr Ts   z'sdist_add_defaults._add_defaults_pythoncCsz|jrv|jjD]b}t|trBt|}tj|rt|j |q|\}}|D]$}t|}tj|rN|j |qNqdS)N) rZhas_data_filesr*rstrrrrr#rr)ritemdirnamer+frrrr ds     z+sdist_add_defaults._add_defaults_data_filescCs(|jr$|d}|j|dS)N build_ext)rZhas_ext_modulesr(rr$r))rr0rrrr us  z$sdist_add_defaults._add_defaults_extcCs(|jr$|d}|j|dS)N build_clib)rZhas_c_librariesr(rr$r))rr1rrrr zs  z'sdist_add_defaults._add_defaults_c_libscCs(|jr$|d}|j|dS)N build_scripts)rZ has_scriptsr(rr$r))rr2rrrr s  z(sdist_add_defaults._add_defaults_scriptsN)__name__ __module__ __qualname____doc__r staticmethodrrrr r r r r rrrrr s rrc@s eZdZdS)rN)r3r4r5rrrrrs) rrZdistutils.utilrZdistutils.commandrZsetuptools.extern.six.movesrrhasattrrrrrs    | PK!j7 )command/__pycache__/rotate.cpython-38.pycnu[U Qabt@s`ddlmZddlmZddlmZddlZddlZddlm Z ddl m Z Gddde Z dS) ) convert_path)log)DistutilsOptionErrorN)six)Commandc@s:eZdZdZdZdddgZgZddZdd Zd d Z d S) rotatezDelete older distributionsz2delete older distributions, keeping N newest files)zmatch=mzpatterns to match (required))z dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeepselfr=/usr/lib/python3.8/site-packages/setuptools/command/rotate.pyinitialize_optionsszrotate.initialize_optionscCs|jdkrtd|jdkr$tdzt|j|_Wntk rPtdYnXt|jtjrxdd|jdD|_| dddS) NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|qSr)rstrip).0prrr *sz+rotate.finalize_options..,Zbdist)r r ) r rr int ValueError isinstancerZ string_typessplitZset_undefined_optionsrrrrfinalize_optionss   zrotate.finalize_optionscCs|dddlm}|jD]}|jd|}|tj|j|}dd|D}| | t dt ||||jd}|D]<\}}t d||jstj|rt|qt|qqdS) NZegg_infor)glob*cSsg|]}tj||fqSr)ospathgetmtime)rfrrrr6szrotate.run..z%d file(s) matching %sz Deleting %s)Z run_commandrr Z distributionZget_namerr joinr sortreverserinfolenr Zdry_runisdirshutilZrmtreeunlink)rrpatternfilestr"rrrrun/s        z rotate.runN) __name__ __module__ __qualname____doc__ descriptionZ user_optionsZboolean_optionsrrr.rrrrr sr) Zdistutils.utilrZ distutilsrZdistutils.errorsrrr)Zsetuptools.externrZ setuptoolsrrrrrrs     PK!k1command/__pycache__/__init__.cpython-38.opt-1.pycnu[U QabR@szdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrrdejd<ejd[[dS)alias bdist_eggZ bdist_rpmZ build_extZbuild_pyZdevelopZ easy_installZegg_infoZinstallZ install_librotateZsaveoptsZsdistZsetoptZtestZinstall_egg_infoinstall_scriptsregisterZ bdist_wininstZ upload_docsZuploadZ build_clibZ dist_info)bdistN)rZegg)rzPython .egg file) __all__Zdistutils.command.bdistrsysZsetuptools.commandrZformat_commandsZformat_commandappendr r ?/usr/lib/python3.8/site-packages/setuptools/command/__init__.pys<     PK!e|&&,command/__pycache__/build_ext.cpython-38.pycnu[U Qab2 @sddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z ddl mZddlmZddlmZdd lmZejrddlZd d eDZn dd lmZzddlmZed Wnek reZYnXe dddl mZddZ dZ!dZ"dZ#ej$dkrdZ"n>ej%dkrTzddl&Z&e'e&dZ"Z!Wnek rRYnXddZ(ddZ)GdddeZe"sej%dkrd"ddZ*nd Z#d#d!dZ*dS)$N) build_ext) copy_file) new_compiler)customize_compilerget_config_var)DistutilsError)log)Library)sixcCs g|]\}}}|tjkr|qS)impZ C_EXTENSION).0s_tpr r @/usr/lib/python3.8/site-packages/setuptools/command/build_ext.py s rEXTENSION_SUFFIXESzCython.Compiler.MainLDSHARED) _config_varsc CsZtjdkrNt}z$dtd<dtd<dtd<t|W5tt|Xnt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclibZCCSHAREDz.dylibZSO)sysplatform _CONFIG_VARScopyclearupdater)compilerZtmpr r r_customize_compiler_for_shlib#s  rFZsharedrTntRTLD_NOWcCs tr|SdS)N) have_rtld)rr r rDr$cCs.tD]$}d|kr|S|dkr|SqdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)suffixr r rget_abi3_suffixGs r'c@sveZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddZdS)rcCs.|jd}|_t|||_|r*|dS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace _build_extruncopy_extensions_to_source)selfZ old_inplacer r rr)Qs  z build_ext.runc Cs|d}|jD]}||j}||}|d}d|dd}||}tj |tj |}tj |j |} t | ||j |jd|jr||ptj|dqdS)Nbuild_py.)verbosedry_runT)get_finalized_command extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename build_librr/r0 _needs_stub write_stubcurdir) r+r,extfullnamefilenamemodpathpackageZ package_dirZ dest_filenameZ src_filenamer r rr*Ys&       z#build_ext.copy_extensions_to_sourcecCst||}||jkr|j|}tjo4t|do4t}|r^td}|dt| }|t}t |t rt j |\}}|j|tStr|jrt j |\}}t j |d|S|S)NZpy_limited_apiZ EXT_SUFFIXzdl-)r(r5ext_mapr ZPY3getattrr'rlen isinstancer r8r9splitextshlib_compilerlibrary_filenamelibtype use_stubs_links_to_dynamicr6r7)r+r@rAr?Zuse_abi3Zso_extfndr r rr5os&      zbuild_ext.get_ext_filenamecCs t|d|_g|_i|_dSN)r(initialize_optionsrIshlibsrDr+r r rrQs zbuild_ext.initialize_optionscCs,t||jpg|_||jdd|jD|_|jrB||jD]}||j|_qH|jD]}|j}||j |<||j | dd<|jr| |pd}|ot ot |t }||_||_||}|_tjtj|j|}|r||jkr|j||rbt rbtj|jkrb|jtjqbdS)NcSsg|]}t|tr|qSr )rGr r r?r r rrs z.build_ext.finalize_options..r-r.F)r(finalize_optionsr2Zcheck_extensions_listrRsetup_shlib_compilerr3r4 _full_namerDr6links_to_dynamicrLrGr rMr<r5 _file_namer8r9dirnamer7r; library_dirsappendr>runtime_library_dirs)r+r?r@ZltdnsrAZlibdirr r rrUs,       zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdk r8||j|jdk r^|jD]\}}| ||qH|j dk r~|j D]}| |qn|j dk r| |j |jdk r||j|jdk r||j|jdk r||jt||_dS)N)rr0force)rrr0r_rIrZ include_dirsZset_include_dirsZdefineZ define_macroZundefZundefine_macro librariesZ set_librariesr[Zset_library_dirsZrpathZset_runtime_library_dirsZ link_objectsZset_link_objectslink_shared_object__get__)r+rr4valueZmacror r rrVs.               zbuild_ext.setup_shlib_compilercCst|tr|jSt||SrP)rGr export_symbolsr(get_export_symbolsr+r?r r rres zbuild_ext.get_export_symbolscCs\||j}z@t|tr"|j|_t|||jrL|dj }| ||W5||_XdS)Nr,) Z_convert_pyx_sources_to_langrrGr rIr(build_extensionr<r1r;r=)r+r?Z _compilercmdr r rrgs   zbuild_ext.build_extensioncsPtdd|jDd|jddddgtfdd|jDS) z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|] }|jqSr )rW)r libr r rrsz.build_ext.links_to_dynamic..r-Nr.r"c3s|]}|kVqdSrPr )r ZlibnameZlibnamesZpkgr r sz-build_ext.links_to_dynamic..)dictfromkeysrRr7rWr6anyr`rfr rjrrXs zbuild_ext.links_to_dynamiccCst||SrP)r( get_outputs_build_ext__get_stubs_outputsrSr r rroszbuild_ext.get_outputscs6fddjD}t|}tdd|DS)Nc3s0|](}|jrtjjjf|jdVqdS)r-N)r<r8r9r7r;rWr6rTrSr rrksz0build_ext.__get_stubs_outputs..css|]\}}||VqdSrPr )r baseZfnextr r rrks)r2 itertoolsproduct!_build_ext__get_output_extensionslist)r+Z ns_ext_basesZpairsr rSrZ__get_stubs_outputss  zbuild_ext.__get_stubs_outputsccs"dVdV|djrdVdS)N.pyz.pycr,z.pyo)r1optimizerSr r rZ__get_output_extensionss z!build_ext.__get_output_extensionsFcCs,td|j|tjj|f|jdd}|rJtj|rJt|d|j st |d}| dddd t d d tj |jd d dt ddddt dddt ddddg||r(ddlm}||gdd|j d|dj}|dkr||g|d|j dtj|r(|j s(t|dS)Nz writing stub loader for %s to %sr-rvz already exists! Please delete.w zdef __bootstrap__():z- global __bootstrap__, __file__, __loader__z% import sys, os, pkg_resources, impz, dlz: __file__ = pkg_resources.resource_filename(__name__,%r)z del __bootstrap__z if '__loader__' in globals():z del __loader__z# old_flags = sys.getdlopenflags()z old_dir = os.getcwd()z try:z( os.chdir(os.path.dirname(__file__))z$ sys.setdlopenflags(dl.RTLD_NOW)z( imp.load_dynamic(__name__,__file__)z finally:z" sys.setdlopenflags(old_flags)z os.chdir(old_dir)z__bootstrap__()r"r) byte_compileT)rwr_r0Z install_lib)rinforWr8r9r7r6existsrr0openwriteif_dlr:rYcloseZdistutils.utilrzr1rwunlink)r+ output_dirr?compileZ stub_filefrzrwr r rr=sb        zbuild_ext.write_stubN)F)__name__ __module__ __qualname__r)r*r5rQrUrVrergrXrorprtr=r r r rrPs   rc Cs(||j||||||||| | | | dSrP)linkZSHARED_LIBRARY) r+objectsoutput_libnamerr`r[r]rddebug extra_preargsextra_postargs build_temp target_langr r rra#sraZstaticc Cs^|dks ttj|\}} tj| \}}|ddrH|dd}|||||| dS)Nxri)AssertionErrorr8r9r6rHrJ startswithZcreate_static_lib)r+rrrr`r[r]rdrrrrrrAr:r?r r rra2s  ) NNNNNrNNNN) NNNNNrNNNN)+r8rrrZdistutils.command.build_extrZ _du_build_extZdistutils.file_utilrZdistutils.ccompilerrZdistutils.sysconfigrrZdistutils.errorsrZ distutilsrZsetuptools.extensionr Zsetuptools.externr ZPY2r Z get_suffixesrZimportlib.machineryZCython.Distutils.build_extr( __import__ ImportErrorrrrr#rLrKrr4Zdlhasattrrr'rar r r rsz               Q PK!I&&2command/__pycache__/build_ext.cpython-38.opt-1.pycnu[U Qab2 @sddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z ddl mZddlmZddlmZdd lmZejrddlZd d eDZn dd lmZzddlmZed Wnek reZYnXe dddl mZddZ dZ!dZ"dZ#ej$dkrdZ"n>ej%dkrTzddl&Z&e'e&dZ"Z!Wnek rRYnXddZ(ddZ)GdddeZe"sej%dkrd"ddZ*nd Z#d#d!dZ*dS)$N) build_ext) copy_file) new_compiler)customize_compilerget_config_var)DistutilsError)log)Library)sixcCs g|]\}}}|tjkr|qS)impZ C_EXTENSION).0s_tpr r @/usr/lib/python3.8/site-packages/setuptools/command/build_ext.py s rEXTENSION_SUFFIXESzCython.Compiler.MainLDSHARED) _config_varsc CsZtjdkrNt}z$dtd<dtd<dtd<t|W5tt|Xnt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclibZCCSHAREDz.dylibZSO)sysplatform _CONFIG_VARScopyclearupdater)compilerZtmpr r r_customize_compiler_for_shlib#s  rFZsharedrTntRTLD_NOWcCs tr|SdS)N) have_rtld)rr r rDr$cCs.tD]$}d|kr|S|dkr|SqdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)suffixr r rget_abi3_suffixGs r'c@sveZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddZdS)rcCs.|jd}|_t|||_|r*|dS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace _build_extruncopy_extensions_to_source)selfZ old_inplacer r rr)Qs  z build_ext.runc Cs|d}|jD]}||j}||}|d}d|dd}||}tj |tj |}tj |j |} t | ||j |jd|jr||ptj|dqdS)Nbuild_py.)verbosedry_runT)get_finalized_command extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename build_librr/r0 _needs_stub write_stubcurdir) r+r,extfullnamefilenamemodpathpackageZ package_dirZ dest_filenameZ src_filenamer r rr*Ys&       z#build_ext.copy_extensions_to_sourcecCst||}||jkr|j|}tjo4t|do4t}|r^td}|dt| }|t}t |t rt j |\}}|j|tStr|jrt j |\}}t j |d|S|S)NZpy_limited_apiZ EXT_SUFFIXzdl-)r(r5ext_mapr ZPY3getattrr'rlen isinstancer r8r9splitextshlib_compilerlibrary_filenamelibtype use_stubs_links_to_dynamicr6r7)r+r@rAr?Zuse_abi3Zso_extfndr r rr5os&      zbuild_ext.get_ext_filenamecCs t|d|_g|_i|_dSN)r(initialize_optionsrIshlibsrDr+r r rrQs zbuild_ext.initialize_optionscCs,t||jpg|_||jdd|jD|_|jrB||jD]}||j|_qH|jD]}|j}||j |<||j | dd<|jr| |pd}|ot ot |t }||_||_||}|_tjtj|j|}|r||jkr|j||rbt rbtj|jkrb|jtjqbdS)NcSsg|]}t|tr|qSr )rGr r r?r r rrs z.build_ext.finalize_options..r-r.F)r(finalize_optionsr2Zcheck_extensions_listrRsetup_shlib_compilerr3r4 _full_namerDr6links_to_dynamicrLrGr rMr<r5 _file_namer8r9dirnamer7r; library_dirsappendr>runtime_library_dirs)r+r?r@ZltdnsrAZlibdirr r rrUs,       zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdk r8||j|jdk r^|jD]\}}| ||qH|j dk r~|j D]}| |qn|j dk r| |j |jdk r||j|jdk r||j|jdk r||jt||_dS)N)rr0force)rrr0r_rIrZ include_dirsZset_include_dirsZdefineZ define_macroZundefZundefine_macro librariesZ set_librariesr[Zset_library_dirsZrpathZset_runtime_library_dirsZ link_objectsZset_link_objectslink_shared_object__get__)r+rr4valueZmacror r rrVs.               zbuild_ext.setup_shlib_compilercCst|tr|jSt||SrP)rGr export_symbolsr(get_export_symbolsr+r?r r rres zbuild_ext.get_export_symbolscCs\||j}z@t|tr"|j|_t|||jrL|dj }| ||W5||_XdS)Nr,) Z_convert_pyx_sources_to_langrrGr rIr(build_extensionr<r1r;r=)r+r?Z _compilercmdr r rrgs   zbuild_ext.build_extensioncsPtdd|jDd|jddddgtfdd|jDS) z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|] }|jqSr )rW)r libr r rrsz.build_ext.links_to_dynamic..r-Nr.r"c3s|]}|kVqdSrPr )r ZlibnameZlibnamesZpkgr r sz-build_ext.links_to_dynamic..)dictfromkeysrRr7rWr6anyr`rfr rjrrXs zbuild_ext.links_to_dynamiccCst||SrP)r( get_outputs_build_ext__get_stubs_outputsrSr r rroszbuild_ext.get_outputscs6fddjD}t|}tdd|DS)Nc3s0|](}|jrtjjjf|jdVqdS)r-N)r<r8r9r7r;rWr6rTrSr rrksz0build_ext.__get_stubs_outputs..css|]\}}||VqdSrPr )r baseZfnextr r rrks)r2 itertoolsproduct!_build_ext__get_output_extensionslist)r+Z ns_ext_basesZpairsr rSrZ__get_stubs_outputss  zbuild_ext.__get_stubs_outputsccs"dVdV|djrdVdS)N.pyz.pycr,z.pyo)r1optimizerSr r rZ__get_output_extensionss z!build_ext.__get_output_extensionsFcCs,td|j|tjj|f|jdd}|rJtj|rJt|d|j st |d}| dddd t d d tj |jd d dt ddddt dddt ddddg||r(ddlm}||gdd|j d|dj}|dkr||g|d|j dtj|r(|j s(t|dS)Nz writing stub loader for %s to %sr-rvz already exists! Please delete.w zdef __bootstrap__():z- global __bootstrap__, __file__, __loader__z% import sys, os, pkg_resources, impz, dlz: __file__ = pkg_resources.resource_filename(__name__,%r)z del __bootstrap__z if '__loader__' in globals():z del __loader__z# old_flags = sys.getdlopenflags()z old_dir = os.getcwd()z try:z( os.chdir(os.path.dirname(__file__))z$ sys.setdlopenflags(dl.RTLD_NOW)z( imp.load_dynamic(__name__,__file__)z finally:z" sys.setdlopenflags(old_flags)z os.chdir(old_dir)z__bootstrap__()r"r) byte_compileT)rwr_r0Z install_lib)rinforWr8r9r7r6existsrr0openwriteif_dlr:rYcloseZdistutils.utilrzr1rwunlink)r+ output_dirr?compileZ stub_filefrzrwr r rr=sb        zbuild_ext.write_stubN)F)__name__ __module__ __qualname__r)r*r5rQrUrVrergrXrorprtr=r r r rrPs   rc Cs(||j||||||||| | | | dSrP)linkZSHARED_LIBRARY) r+objectsoutput_libnamerr`r[r]rddebug extra_preargsextra_postargs build_temp target_langr r rra#sraZstaticc CsRtj|\}} tj| \}}|ddr<|dd}|||||| dS)Nxri)r8r9r6rHrJ startswithZcreate_static_lib)r+rrrr`r[r]rdrrrrrrAr:r?r r rra2s  ) NNNNNrNNNN) NNNNNrNNNN)+r8rrrZdistutils.command.build_extrZ _du_build_extZdistutils.file_utilrZdistutils.ccompilerrZdistutils.sysconfigrrZdistutils.errorsrZ distutilsrZsetuptools.extensionr Zsetuptools.externr ZPY2r Z get_suffixesrZimportlib.machineryZCython.Distutils.build_extr( __import__ ImportErrorrrrr#rLrKrr4Zdlhasattrrr'rar r r rsz               Q PK! QQ2command/__pycache__/dist_info.cpython-38.opt-1.pycnu[U Qab@s8dZddlZddlmZddlmZGdddeZdS)zD Create a dist_info directory As defined in the wheel specification N)Command)logc@s.eZdZdZdgZddZddZddZd S) dist_infozcreate a .dist-info directory)z egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dSN)egg_baseselfr @/usr/lib/python3.8/site-packages/setuptools/command/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdSrr rr r r finalize_optionsszdist_info.finalize_optionscCsn|d}|j|_|||jdtd d}tdt j ||d}| |j|dS)Negg_infoz .egg-infoz .dist-infoz creating '{}' bdist_wheel) Zget_finalized_commandrr runrlenrinfoformatospathabspathZegg2dist)r rZ dist_info_dirrr r r rs  z dist_info.runN)__name__ __module__ __qualname__ descriptionZ user_optionsr r rr r r r r s r)__doc__rZdistutils.corerZ distutilsrrr r r r s  PK! L4command/__pycache__/upload_docs.cpython-38.opt-1.pycnu[U Qab@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd d ZGd ddeZdS)zpupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). )standard_b64encode)log)DistutilsOptionErrorN)six) http_clienturllib)iter_entry_points)uploadcCstjr dnd}|d|S)Nsurrogateescapestrictzutf-8)rPY3encode)serrorsrB/usr/lib/python3.8/site-packages/setuptools/command/upload_docs.py_encodesrc@seZdZdZdZdddejfddgZejZdd Zd efgZ d d Z d dZ ddZ ddZ eddZeddZddZdS) upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIz repository=rzurl of repository [default: %s])z show-responseNz&display full response text from server)z upload-dir=Nzdirectory to uploadcCs"|jdkrtddD]}dSdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfZeprrr has_sphinx/s zupload_docs.has_sphinxrcCst|d|_d|_dS)N)r initialize_optionsr target_dir)rrrrr6s zupload_docs.initialize_optionscCst||jdkrN|r0|d}|j|_q`|d}tj |j d|_n| d|j|_d|j krtt d|d|jdS)NrbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r finalize_optionsrrZget_finalized_commandZbuilder_target_dirrospathjoinZ build_baseZensure_dirname repositoryrwarnannounce)rrrrrrr;s        zupload_docs.finalize_optionsc Cst|d}z||jt|jD]x\}}}||jkrP|sPd}t||j|D]H}tj ||}|t |jd tjj } tj | |} | || qTq&W5|XdS)Nwz'no files found in upload directory '%s')zipfileZZipFilecloseZmkpathrrwalkrrr lenlstripsepwrite) rfilenamezip_filerootdirsfilesZtmplnameZfullrelativedestrrrcreate_zipfileKs  zupload_docs.create_zipfilec Csh|D]}||qt}|jj}tj |d|}z| || |W5t |XdS)Nz%s.zip)Zget_sub_commandsZ run_commandtempfileZmkdtemp distributionmetadataget_namerrr shutilZrmtreer4 upload_file)rZcmd_nameZtmp_dirr1r-rrrrun[s    zupload_docs.runccs|\}}d|}t|ts |g}|D]f}t|trL|d|d7}|d}nt|}|Vt|VdV|V|r$|dddkr$dVq$dS) Nz* Content-Disposition: form-data; name="%s"z; filename="%s"rr s   ) isinstancelisttupler)item sep_boundarykeyvaluestitlevaluerrr _build_partis    zupload_docs._build_partc Csnd}d|}|d}|df}tj|j|d}t||}tj|}t||} d|d} d | | fS) z= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--r>)rCz multipart/form-data; boundary=%sascii) functoolspartialrHmapitems itertoolschain from_iterabledecoder ) clsdataboundaryrCZ end_boundaryZ end_itemsZbuilderZ part_groupspartsZ body_items content_typerrr_build_multipart}s  zupload_docs._build_multipartc Cs:t|d}|}W5QRX|jj}d|tj||fd}t|j d|j }t |}t j rn|d}d|}||\}} d|j} || tjtj|j\} } } }}}| dkrt| }n | d krt| }n td | d }zZ||d | | }|d ||dtt||d|| |!|Wn>t"j#k r}z|t|tj$WYdSd}~XYnX|%}|j&dkrd|j&|j'f} || tjnb|j&dkr|(d}|dkrd|}d|} || tjnd|j&|j'f} || tj$|j)r6t*d|ddS)NrbZ doc_upload)z:actionr1content:rIzBasic zSubmitting documentation to %sZhttpZhttpszunsupported schema ZPOSTz Content-typezContent-lengthZ AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %szK---------------------------------------------------------------------------)+openreadr6r7r8rrbasenamerZusernameZpasswordrrr rRrXr!r#rINFOrparseZurlparserZHTTPConnectionZHTTPSConnectionAssertionErrorZconnectZ putrequestZ putheaderstrr(Z endheaderssendsocketerrorZERRORZ getresponseZstatusreasonZ getheaderZ show_responseprint)rr,frZmetarTZ credentialsZauthZbodyZctmsgZschemaZnetlocZurlZparamsZqueryZ fragmentsZconnrWerlocationrrrr:sb               zupload_docs.upload_fileN)__name__ __module__ __qualname__ZDEFAULT_REPOSITORY descriptionr Z user_optionsZboolean_optionsrZ sub_commandsrrr4r; staticmethodrH classmethodrXr:rrrrrs(   r)__doc__base64rZ distutilsrZdistutils.errorsrrrfr%r5r9rOrKZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesrr rrrrrrs       PK!1q(command/__pycache__/sdist.cpython-38.pycnu[U Qab@sddlmZddlmmZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZd ddZGd d d e ejZdS) )logN)six)sdist_add_defaultsccs,tdD]}||D] }|Vqq dS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesZiter_entry_pointsload)dirnameZepitemr )szsdist.cCs|d|d}|j|_|jtj|jd|| D]}||qD| t |j dg}|j D] }dd|f}||krp||qpdS)Negg_infoz SOURCES.txt dist_filesrr)Z run_commandget_finalized_commandfilelistappendospathjoinr check_readmeZget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdZcmd_namerfiledatar r r run+s      z sdist.runcCstj||dS)N)origrinitialize_options_default_to_gztarr r r r r%>s zsdist.initialize_optionscCstjdkrdSdg|_dS)N)rZbetarZgztar)sys version_infoZformatsr'r r r r&Cs zsdist._default_to_gztarc Cs$|tj|W5QRXdS)z% Workaround for #516 N)_remove_os_linkr$rrr'r r r rIs zsdist.make_distributionc cs^Gddd}ttd|}zt`Wntk r6YnXz dVW5||k rXttd|XdS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r r NoValueWsr0linkN)rrr1 Exceptionsetattr)r0Zorig_valr r r r,Ps  zsdist._remove_os_linkcCsLztj|Wn6tk rFt\}}}|jjjd YnXdS)Ntemplate) r$r read_templater2r*exc_infotb_nexttb_framef_localsclose)r _tbr r r Z__read_template_hackes zsdist.__read_template_hack)r=)r(r)r(r)r(r=)r(r=rcs^|jrZ|d}|j||jjsZ|jD]&\}}}|jfdd|Dq2dS)zgetting python filesbuild_pycsg|]}tj|qSr )rrr)rfilenameZsrc_dirr r sz.sdist._add_defaults_python..N)rZhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ data_files)r r@r; filenamesr rBr _add_defaults_python|s  zsdist._add_defaults_pythoncsDz tjrt|n tWntk r>tdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper TypeErrorrwarnr' __class__r r rGs  zsdist._add_defaults_data_filescCs8|jD]}tj|rdSq|dd|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrJr)r fr r r rs   zsdist.check_readmecCs^tj|||tj|d}ttdrJtj|rJt|| d|| d |dS)Nz setup.cfgr1r) r$rmake_release_treerrrhasattrrNunlinkZ copy_filerZsave_version_info)r Zbase_dirfilesdestr r r rPs   zsdist.make_release_treec Cs@tj|jsdSt|jd}|}W5QRX|dkS)NFrbz+# file GENERATED by distutils, do NOT edit )rrisfilemanifestioopenreadlineencode)r fpZ first_liner r r _manifest_is_not_generatedsz sdist._manifest_is_not_generatedc Cstd|jt|jd}|D]d}tjr^z|d}Wn&tk r\td|YqYnX| }| ds|svq|j |q| dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'rUzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforWrYrZPY3decodeUnicodeDecodeErrorrJstrip startswithrrr:)r rWliner r r read_manifests  zsdist.read_manifestcCs^|jd}|dd\}}|dkr2tddStj|sNtd|dS|j |dS)zyChecks if license_file' is configured and adds it to 'self.filelist' if the value contains a valid path. Zmetadata license_file)NNNz''license_file' option was not specifiedz8warning: Failed to find the configured license file '%s') rZget_option_dictgetrdebugrrrNrJrr)r Zoptsr;rfr r r check_licenses   zsdist.check_license)r-r.r/__doc__Z user_optionsZ negative_optZREADME_EXTENSIONStuplerMr#r%r&r staticmethod contextlibcontextmanagerr,Z_sdist__read_template_hackr*r+Zhas_leaky_handler5rFrGrrPr]reri __classcell__r r rKr rs<        r)r)Z distutilsrZdistutils.command.sdistZcommandrr$rr*rXrmZsetuptools.externrZ py36compatrrlistZ_default_revctrlr r r r r s    PK!ɀX X (command/__pycache__/alias.cpython-38.pycnu[U Qabz @sPddlmZddlmZddlmZmZmZddZGdddeZ dd Z d S) )DistutilsOptionError)map) edit_config option_base config_filecCs8dD]}||krt|Sq||gkr4t|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcrs   4PK!M2 f7f72command/__pycache__/bdist_egg.cpython-38.opt-1.pycnu[U Qab G@sxdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZzdd lmZmZd dZWn,ek rddlm Z mZddZYnXddZ!ddZ"ddZ#GdddeZ$e%&d'Z(ddZ)ddZ*ddZ+d d!d"Z,d#d$Z-d%d&Z.d'd(Z/d)d*d+d,gZ0d1d/d0Z1dS)2z6setuptools.command.bdist_egg Build .egg distributions)DistutilsSetupError) remove_treemkpath)log)CodeTypeN)six)get_build_platform Distributionensure_directory) EntryPoint)Library)Command)get_pathget_python_versioncCstdS)NZpurelib)rrr@/usr/lib/python3.8/site-packages/setuptools/command/bdist_egg.py _get_purelibsr)get_python_librcCstdS)NF)rrrrrrscCs2d|krtj|d}|dr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrr strip_module#s   rccs6t|D]&\}}}|||||fVq dS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfilesrrr sorted_walk+sr"c Cs6td}t|d}|||W5QRXdS)NaR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr write_stub5s r,c@seZdZdZddddefdddd gZd d d gZd dZddZddZ ddZ ddZ ddZ ddZ ddZddZdd Zd!d"Zd#S)$ bdist_eggzcreate an "egg" distribution)z bdist-dir=bz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s))exclude-source-filesNz+remove all .py files from the generated egg) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z dist-dir=dz-directory to put final built distributions in) skip-buildNz2skip rebuilding everything (for testing/debugging)r1r4r0cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_filesselfrrrinitialize_optionsZszbdist_egg.initialize_optionscCs|d}|_|j|_|jdkr>|dj}tj|d|_|jdkrPt |_| dd|j dkrt dd|j |jt|jo|j }tj|j|d|_ dS)Negg_infoZbdistZegg)r8r8z.egg)get_finalized_commandei_cmdr?r5 bdist_baserrjoinr6rZset_undefined_optionsr:r Zegg_nameZ egg_versionr distributionhas_ext_modulesr8)r=rArBbasenamerrrfinalize_optionscs$     zbdist_egg.finalize_optionscCs|j|d_tjtjt}|jj g}|j_ |D]}t |t rt |dkrtj |drtj|d}tj|}||ks||tjr|t |dd|df}|jj |q:z"td|j|jddddW5||j_ XdS)Ninstallrzinstalling package data to %s install_data)forceroot)r5r@ install_librrnormcaserealpathrrD data_files isinstancetuplelenisabs startswithsepappendrinfo call_command)r=Z site_packagesolditemrPZ normalizedrrrdo_install_data{s"  zbdist_egg.do_install_datacCs|jgS)N)r:r<rrr get_outputsszbdist_egg.get_outputscKsPtD]}|||jq|d|j|d|j|j|f|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr9dry_run)INSTALL_DIRECTORY_ATTRS setdefaultr5r9r_Zreinitialize_command run_command)r=ZcmdnamekwdirnamecmdrrrrZs zbdist_egg.call_commandcCs|dtd|j|d}|j}d|_|jrH|jsH|d|j ddd}||_| \}}g|_ g}t |D]|\}}t j|\} } t j|jt| d} |j | td ||jstt j|| || |t jd ||<qz|r|||jjr||j} t j| d } || |jjrlt j| d }td ||j d|dd|| t j| d}|rtd||jst|t|d}| d|| d|!n,t j"|rtd||jst #|t$t j| d |%t j&t j|j'dr.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [%s] to [%s])rrYwalk_eggr5rrrCrdebugrwrematchpardirgroupremoveOSErrorrename) r=rr r!rrZpath_oldpatternmZpath_newrrrr|s4       zbdist_egg.zap_pyfilescCs2t|jdd}|dk r|Stdt|j|jS)Nryz4zip_safe flag not set; analyzing archive contents...)rrDrr{ analyze_eggr5rq)r=saferrrry s  zbdist_egg.zip_safec Cst|jjpd}|did}|dkr0dS|jr<|jrJtd|fdjt j }|j }d |j}|jd}t j|j}d t}|jstt j|j|jd t|jd} | || d S) Nzsetuptools.installationZ eggsecutabler#zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulez{}.{}rraH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi roa)r Z parse_maprDZ entry_pointsgetZattrsZextrasrformatsys version_infoZ module_namerCrrrFr:localsr_rrdr'r(ru) r=ZepmZepZpyverpkgZfullrrFheaderr+rrrr~s0       zbdist_egg.gen_headercCshtj|j}tj|d}|jjjD]<}||r&tj||t |d}t || ||q&dS)z*Copy metadata (egg info) to the target_dirrN) rrnormpathr?rCrAZfilelistr!rVrTr Z copy_file)r=Z target_dirZ norm_egg_infoprefixrtargetrrrrt:s zbdist_egg.copy_metadata_toc Csg}g}|jdi}t|jD]f\}}}|D].}tj|dtkr*||||q*|D]"}|||d|tj||<q^q|j r| d}|j D]Z} t | trq|| j} || }tj|dstjtj|j|r||q||fS)zAGet a list of relative paths to C extensions in the output distrorrJrgZ build_extzdl-)r5r"rrrlowerNATIVE_EXTENSIONSrXrCrDrEr@ extensionsrRr Zget_ext_fullnamerZget_ext_filenamerFrVrz) r=rrpathsrr r!rZ build_cmdrfullnamerrrrpFs0        zbdist_egg.get_ext_outputsN)__name__ __module__ __qualname__ descriptionrZ user_optionsZboolean_optionsr>rGr]r^rZrr|ryr~rtrprrrrr-Cs2  Q' r-z.dll .so .dylib .pydccsHt|}t|\}}}d|kr(|d|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrhN)r"nextr)egg_dirZwalkerrr r!Zbdfrrrrfs  rc CstD](\}}tjtj|d|r|Sqtst||krzt|q|dk rt||krt|d}| d| qdS)Nrkrl) rrrrrCrzboolrwr'r(ru)rrrrr+rrrrxs    rxzzip-safez not-zip-safe)TFc Cstj||}|dd|kr"dS|t|ddtjd}||rJdpLdtj|d}tjrld}nt j d kr|d }nd }t |d }| |t |} |d} tt| } d D]} | | krtd|| d} qd| kr dD]} | | krtd|| d} q| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrJrrr) rb)__file____path__z%s: module references %sFinspect) Z getsourceZ getabsfileZ getsourcefileZgetfilegetsourcelinesZ findsourceZ getcommentsZ getframeinfoZgetinnerframesZgetouterframesstackZtracez"%s: module MAY be using inspect.%s)rrrCrTrsrWrrZPY2rrr'readmarshalloadrudictfromkeys iter_symbolsrr{) rrrrqrrrskipr+coderZsymbolsZbadrrrrs4      rccsT|jD] }|Vq|jD]6}t|tjr0|Vqt|trt|D] }|VqBqdS)zBYield names and strings used by `code` and its nested code objectsN)co_names co_constsrRrZ string_typesrr)rrconstrrrrs     rcCs2tjdstjdkrdStdtddS)NjavaZcliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py)rplatformrVrr{rrrrrs rrNrjrKZ install_baseTr#c sddl}ttj|dtd|fdd}|rB|jn|j}s|j |||d} t D]\} } } || | | qd| n t D]\} } } |d| | q|S)aqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. rNroz#creating '%s' and adding '%s' to itcs`|D]V}tjtj||}tj|r|tdd}sN|||td|qdS)NrJz adding '%s') rrrrCrvrTr(rr)zrdnamesrrr/base_dirr_rrvisits  zmake_zipfile..visit) compression) zipfilerrrrdrrYZ ZIP_DEFLATEDZ ZIP_STOREDZZipFiler"ru) Z zip_filenamerrmr_compressrnrrrrrdr r!rrrr}s  r})rrTr#)2__doc__Zdistutils.errorsrZdistutils.dir_utilrrZ distutilsrtypesrrrrr$rZsetuptools.externrZ pkg_resourcesrr r r Zsetuptools.extensionr Z setuptoolsr Z sysconfigrrr ImportErrorZdistutils.sysconfigrrr"r,r-rrsplitrrrrxrrrrr`r}rrrrsX         " $  PK!/X1command/__pycache__/register.cpython-38.opt-1.pycnu[U Qab@s4ddlmZddlmmZGdddejZdS))logNc@seZdZejjZddZdS)registerc Cs0z|dtj|W5|dtjXdS)Nz[WARNING: Registering is deprecated, use twine to upload instead (https://pypi.org/p/twine/)Zegg_info)ZannouncerZWARNZ run_commandorigrrun)selfr?/usr/lib/python3.8/site-packages/setuptools/command/register.pyrs z register.runN)__name__ __module__ __qualname__rr__doc__rrrrrrsr)Z distutilsrZdistutils.command.registerZcommandrrrrrrs PK!/X+command/__pycache__/register.cpython-38.pycnu[U Qab@s4ddlmZddlmmZGdddejZdS))logNc@seZdZejjZddZdS)registerc Cs0z|dtj|W5|dtjXdS)Nz[WARNING: Registering is deprecated, use twine to upload instead (https://pypi.org/p/twine/)Zegg_info)ZannouncerZWARNZ run_commandorigrrun)selfr?/usr/lib/python3.8/site-packages/setuptools/command/register.pyrs z register.runN)__name__ __module__ __qualname__rr__doc__rrrrrrsr)Z distutilsrZdistutils.command.registerZcommandrrrrrrs PK! QQ,command/__pycache__/dist_info.cpython-38.pycnu[U Qab@s8dZddlZddlmZddlmZGdddeZdS)zD Create a dist_info directory As defined in the wheel specification N)Command)logc@s.eZdZdZdgZddZddZddZd S) dist_infozcreate a .dist-info directory)z egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dSN)egg_baseselfr @/usr/lib/python3.8/site-packages/setuptools/command/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdSrr rr r r finalize_optionsszdist_info.finalize_optionscCsn|d}|j|_|||jdtd d}tdt j ||d}| |j|dS)Negg_infoz .egg-infoz .dist-infoz creating '{}' bdist_wheel) Zget_finalized_commandrr runrlenrinfoformatospathabspathZegg2dist)r rZ dist_info_dirrr r r rs  z dist_info.runN)__name__ __module__ __qualname__ descriptionZ user_optionsr r rr r r r r s r)__doc__rZdistutils.corerZ distutilsrrr r r r s  PK!~hyy1command/__pycache__/saveopts.cpython-38.opt-1.pycnu[U Qab@s$ddlmZmZGdddeZdS)) edit_config option_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsh|j}i}|jD]B}|dkrq||D]$\}\}}|dkr,|||i|<q,qt|j||jdS)Nrz command line)Z distributionZcommand_optionsZget_option_dictitems setdefaultrfilenameZdry_run)selfZdistZsettingscmdoptsrcvalr ?/usr/lib/python3.8/site-packages/setuptools/command/saveopts.pyrun s z saveopts.runN)__name__ __module__ __qualname____doc__ descriptionrr r r rrsrN)Zsetuptools.command.setoptrrrr r r rsPK!.?UU+command/__pycache__/egg_info.cpython-38.pycnu[U Qabc@sdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddlm+Z+ddlm,Z,ddZ-GdddZ.Gddde.eZ/GdddeZGdddeZ0ddZ1ddZ2d d!Z3d"d#Z4d$d%Z5d&d'Z6d(d)Z7d*d+Z8d5d-d.Z9d/d0Z:d1d2Z;Gd3d4d4e,Z|j|jkr>|j|_t|j|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrP .egg-info-)!r:rQr?rRr isinstancerr>ZVersionlistr ValueError distutilserrorsZDistutilsOptionErrorrPr7Z package_dirgetr#curdirZensure_dirnamerrIr$joincheck_broken_egg_infometadataZ _patched_distkeylowerZ_versionZ_parsed_version)r9Zparsed_versionZ is_versionspecdirsZpdr2r2r3finalize_optionss>           zegg_info.finalize_optionsFcCsL|r||||n4tj|rH|dkr>|s>td||dS||dS)aWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists) write_filer#r$existsrwarn delete_file)r9whatrZdataforcer2r2r3write_or_delete_files   zegg_info.write_or_delete_filecCsDtd||tjr|d}|js@t|d}|||dS)zWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %sutf-8wbN) rinforZPY3encodedry_runopenwriteclose)r9rqrZrrfr2r2r3rms   zegg_info.write_filecCs td||jst|dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrwryr#unlink)r9rZr2r2r3rps zegg_info.delete_filecCs||jt|jd|jj}tdD]4}|j|d|}|||j tj |j|j q*tj |jd}tj |r| ||dS)Nzegg_info.writers) installerznative_libs.txt)ZmkpathrIr#utimer7Zfetch_build_eggrZrequireZresolver:r$rernrp find_sources)r9repwriternlr2r2r3runs     z egg_info.runcCs4tj|jd}t|j}||_||j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r#r$rerImanifest_makerr7manifestrfilelist)r9Zmanifest_filenameZmmr2r2r3r*s  zegg_info.find_sourcescCsT|jd}|jtjkr&tj|j|}tj|rPtd||j |j |_ ||_ dS)Nr\aB------------------------------------------------------------------------------ Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ------------------------------------------------------------------------------) rQrPr#rdr$rernrrorIrS)r9Zbeir2r2r3rf2s   zegg_info.check_broken_egg_infoN)F)rErFrG descriptionZ user_optionsZboolean_optionsZ negative_optrTrHrUsetterr[rlrtrmrprrrfr2r2r2r3rIs.    1 rIc@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rcCs ||\}}}}|dkrR|dd||D]}||s2td|q2n|dkr|dd||D]}||srtd|qrn|dkr|d d||D]}||std |qnJ|d kr|d d||D]}||std |qn|dkr`|d|d|f|D]"}| ||s:td||q:n|dkr|d|d|f|D]"}| ||std||qnp|dkr|d|| |std|n>|dkr|d|| |std|n t d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_line debug_printrerrrorglobal_includeglobal_excluderecursive_includerecursive_excluderrr)r9lineactionZpatternsdirZ dir_patternpatternr2r2r3process_template_lineEs|                  zFileList.process_template_linecCsRd}tt|jdddD]2}||j|r|d|j||j|=d}q|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing T)ranger)filesr)r9Z predicatefoundr/r2r2r3 _remove_filesszFileList._remove_filescCs$ddt|D}||t|S)z#Include files that match 'pattern'.cSsg|]}tj|s|qSr2r#r$isdir.0r}r2r2r3 s z$FileList.include..rextendboolr9rrr2r2r3rs zFileList.includecCst|}||jS)z#Exclude files that match 'pattern'.)r4rmatchr9rrr2r2r3rszFileList.excludecCs8tj|d|}ddt|ddD}||t|S)zN Include all files anywhere in 'dir/' that match the pattern. rcSsg|]}tj|s|qSr2rrr2r2r3rs z.FileList.recursive_include..T) recursive)r#r$rerrr)r9rrZ full_patternrr2r2r3rs zFileList.recursive_includecCs ttj|d|}||jS)zM Exclude any file anywhere in 'dir/' that match the pattern. rr4r#r$rerr)r9rrrr2r2r3rszFileList.recursive_excludecCs$ddt|D}||t|S)zInclude all files from 'dir/'.cSs"g|]}tj|D]}|qqSr2)rarfindall)rZ match_diritemr2r2r3rsz"FileList.graft..r)r9rrr2r2r3rs  zFileList.graftcCsttj|d}||jS)zFilter out files from 'dir/'.rr)r9rrr2r2r3rszFileList.prunecsJ|jdkr|ttjd|fdd|jD}||t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nrcsg|]}|r|qSr2rrrr2r3rs z+FileList.global_include..)Zallfilesrr4r#r$rerrrr2rr3rs   zFileList.global_includecCsttjd|}||jS)zD Exclude all files anywhere that match the pattern. rrrr2r2r3rszFileList.global_excludecCs8|dr|dd}t|}||r4|j|dS)N r)r<r _safe_pathrappend)r9rr$r2r2r3rs    zFileList.appendcCs|jt|j|dSr6)rrfilterr)r9pathsr2r2r3rszFileList.extendcCstt|j|j|_dS)z Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)r_rrrr8r2r2r3_repairszFileList._repairc Csd}t|}|dkr(td|dSt|d}|dkrNt||ddSz"tj|shtj|rnWdSWn&tk rt||t YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFruT) unicode_utilsfilesys_decoderroZ try_encoder#r$rnUnicodeEncodeErrorsysgetfilesystemencoding)r9r$Zenc_warnZu_pathZ utf8_pathr2r2r3rs   zFileList._safe_pathN)rErFrGrrrrrrrrrrrrrrr2r2r2r3rBsI     rc@s\eZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ dS)rz MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifestr8r2r2r3rT sz!manifest_maker.initialize_optionscCsdSr6r2r8r2r2r3rlszmanifest_maker.finalize_optionscCsdt|_tj|js||tj|jr<| | |j |j |dSr6) rrr#r$rnrwrite_manifest add_defaultstemplateZ read_templateprune_file_listsortZremove_duplicatesr8r2r2r3rs  zmanifest_maker.runcCst|}|tjdS)N/)rrreplacer#r%)r9r$r2r2r3_manifest_normalizes z"manifest_maker._manifest_normalizecsBjfddjjD}dj}tj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}|qSr2)rrr8r2r3r*sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrZexecuterm)r9rmsgr2r8r3r"s  zmanifest_maker.write_manifestcCs||st||dSr6)_should_suppress_warningr ro)r9rr2r2r3ro.s zmanifest_maker.warncCs td|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r&r)rr2r2r3r2sz'manifest_maker._should_suppress_warningcCst|||j|j|j|jtt}|rJ|j |nt j |jr`| t j drx|jd|d}|j|jdS)Nzsetup.pyrI)r rZ check_licenserrrrr_r rr#r$rnZ read_manifestget_finalized_commandrrI)r9ZrcfilesZei_cmdr2r2r3r9s     zmanifest_maker.add_defaultscCsZ|d}|j}|j|j|j|ttj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rr7Z get_fullnamerrZ build_baser&r'r#r%Zexclude_pattern)r9rZbase_dirr%r2r2r3rLs    zmanifest_maker.prune_file_listN)rErFrGrrTrlrrrro staticmethodrrrr2r2r2r3rs   rc Cs8d|}|d}t|d}||W5QRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  rurvN)rerxrzr{)rZcontentsr}r2r2r3rmVs   rmc Cs|td||jsx|jj}|j|j|_}|j|j|_}z| |j W5|||_|_Xt |jdd}t |j |dS)Nz writing %sZzip_safe)rrwryr7rgrRr>rQr:write_pkg_inforIgetattrr Zwrite_safety_flag)cmdbasenamerZrgZoldverZoldnameZsafer2r2r3rcs rcCstj|rtddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r#r$rnrrorrrZr2r2r3warn_depends_obsoletevs rcCs,t|pd}dd}t||}||dS)Nr2cSs|dS)Nrr2)rr2r2r3z%_write_requirements..)rr writelines)streamZreqslinesZ append_crr2r2r3_write_requirements~s  rcCsj|j}t}t||j|jp"i}t|D]&}|djft t|||q,| d|| dS)Nz [{extra}] Z requirements) r7rStringIOrZinstall_requiresextras_requiresortedr{formatvarsrtgetvalue)rrrZZdistrrrZextrar2r2r3write_requirementss   rcCs,t}t||jj|d||dS)Nzsetup-requirements)iorrr7Zsetup_requiresrtr)rrrZrrr2r2r3write_setup_requirementssrcCs:tdd|jD}|d|dt|ddS)NcSsg|]}|dddqS).rr)r")rkr2r2r3rsz(write_toplevel_names..ztop-level namesr)rYfromkeysr7Ziter_distribution_namesrmrer)rrrZZpkgsr2r2r3write_toplevel_namess rcCst|||ddS)NT) write_argrr2r2r3 overwrite_argsrFcCsHtj|d}t|j|d}|dk r4d|d}|||||dS)Nrr)r#r$splitextrr7rert)rrrZrsargnamerVr2r2r3rs rcCs|jj}t|tjs|dkr"|}nn|dk rg}t|D]J\}}t|tjsrt||}d tt t | }| d||fq:d |}|d||ddS)Nrz [%s] %s rz entry pointsT)r7Z entry_pointsr^rZ string_typesritemsrZ parse_grouprerstrvaluesrrt)rrrZrrrZsectionrr2r2r3 write_entriess   rc Csjtdttjdrftd>}|D]2}t d|}|r(t | dW5QRSq(W5QRXdS)zd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rr) warningsroEggInfoDeprecationWarningr#r$rnrrzr&rintgroup)r}rrr2r2r3get_pkg_info_revisions    *rc@seZdZdZdS)rzqClass for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.N)rErFrG__doc__r2r2r2r3rsr)F)=rZdistutils.filelistrZ _FileListZdistutils.errorsrZdistutils.utilrrarr#r&rrrrBrWZsetuptools.externrZsetuptools.extern.six.movesrZ setuptoolsrZsetuptools.command.sdistr r Zsetuptools.command.setoptr Zsetuptools.commandr Z pkg_resourcesr rrrrrrrZsetuptools.unicode_utilsrZsetuptools.globrrrr4r5rIrrmrrrrrrrrrrrr2r2r2r3sX           (    S2EP    PK!e*command/__pycache__/install.cpython-38.pycnu[U QabK@s|ddlmZddlZddlZddlZddlZddlmmZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd d dfgZe eZ d d Z d dZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrZinstall_egg_infocCsdSNTselfrr>/usr/lib/python3.8/site-packages/setuptools/command/install.pyzinstall.Zinstall_scriptscCsdSrrrrrr r r cCstj|d|_d|_dSN)origrinitialize_optionsold_and_unmanageable!single_version_externally_managedrrrr r s zinstall.initialize_optionscCs8tj||jrd|_n|jr4|js4|js4tddS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrrrrr r%s  zinstall.finalize_optionscCs(|js |jrtj|Sd|_d|_dS)N)rrrrhandle_extra_pathZ path_fileZ extra_dirsrrrr r0s  zinstall.handle_extra_pathcCs@|js |jrtj|S|ts4tj|n|dSr ) rrrrrun_called_from_setupinspectZ currentframedo_egg_installrrrr r:s   z install.runcCsz|dkr4d}t|tdkr0d}t|dSt|d}|dd\}t|}|jdd }|d kox|j d kS) a Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail.Z IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distZ run_commands) warningswarnplatformZpython_implementationrZgetouterframesZ getframeinfo f_globalsgetZfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rEs     zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd| d|j dj g}t j rp|dt j ||_|dt _ dS)N easy_installx)argsrr.z*.eggZ bdist_eggr)Z distributionZget_command_classrrZensure_finalizedZalways_copy_fromZ package_indexscanglobZ run_commandZget_command_objZ egg_output setuptoolsZbootstrap_install_frominsertr(r)r r&cmdr(rrr r`s"  zinstall.do_egg_installN)r __module__ __qualname____doc__rrZ user_optionsZboolean_options new_commandsdict_ncrrrr staticmethodrrrrrr rs(      rcCsg|]}|dtjkr|qS)r)rr4).0r.rrr {sr7)Zdistutils.errorsrrr+rr Zdistutils.command.installZcommandrrr,_installZ sub_commandsr2rrrr s lPK!UTSS)command/__pycache__/upload.cpython-38.pycnu[U Qab@sddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZddlmZmZddlmZdd lmZGd d d e j Z dS) N)standard_b64encode)log)upload)spawn)DistutilsError)urlopenRequest) HTTPError)urlparsec@s8eZdZdZddZddZddZdd Zd d Zd S) rza Override default upload behavior to obtain password in a variety of different ways. c Cs&ztj|W5|dtjXdS)NzjWARNING: Uploading via this command is deprecated, use twine to upload instead (https://pypi.org/p/twine/))announcerZWARNorigrrunselfr=/usr/lib/python3.8/site-packages/setuptools/command/upload.pyr s z upload.runcCs8tj||jpt|_|jp0|p0||_dSN) r rfinalize_optionsusernamegetpassZgetuserpassword_load_password_from_keyring_prompt_for_passwordrrrrr"s zupload.finalize_optionsc Cst|j\}}}}}} |s"|s"| r0td|j|dkrDtd||jr|ddd|g} |jrnd|jg| dd<t| |jd t|d } | } W5QRX|j j } d d | | t j|| f||t| t| | | | | | | | | | | | | | !d }d|d<|jrdt j|dt|dd f|d<|j"d|j#$d}dt%|&d}d}d|$d}|d}t'(}|)D]\}}d|}t*|t+s|g}|D]j}t,|t-kr|d|d7}|d}nt|$d}|.||.|$d|.d|.|qܐq|.||/}d||jf}|0|t1j2d|tt3||d }t4|j||d!}zt5|}|6}|j7}Wnft8k r}z|j9}|j7}W5d}~XYn8t:k r"}z|0t|t1j;W5d}~XYnX|d"kr|0d#||ft1j2|j<rt=|d$d%d&|}|dk rd'>d(|d(f}|0|t1j2n"d)||f}|0|t1j;t?|dS)*NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz --detach-signz-az --local-user)dry_runrbZ file_upload1)z:actionZprotocol_versionnameversioncontentZfiletype pyversionZ md5_digestZmetadata_versionZsummaryZ home_pageZauthorZ author_emaillicense descriptionkeywordsplatformZ classifiersZ download_urlZprovidesZrequiresZ obsoletesZcommentz.ascZ gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s-- z+ Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s zSubmitting %s to %sz multipart/form-data; boundary=%s)z Content-typezContent-lengthZ Authorization)dataheaderszServer response (%s): %sZ_read_pypi_responsecSsdSrr)xrrrz$upload.upload_file.. zK---------------------------------------------------------------------------zUpload failed (%s): %s)@r repositoryAssertionErrorZsignZidentityrropenreadZ distributionZmetadataZget_nameZ get_versionospathbasenamehashlibZmd5Z hexdigeststrZget_metadata_versionZget_descriptionZget_urlZ get_contactZget_contact_emailZ get_licenceZget_long_descriptionZ get_keywordsZ get_platformsZget_classifiersZget_download_urlZ get_providesZ get_requiresZ get_obsoletesrrencoderdecodeioBytesIOitems isinstancelisttypetuplewritegetvaluer rINFOlenrrZgetcodemsgr codeOSErrorZERRORZ show_responsegetattrjoinr) rZcommandr filenameZschemaZnetlocZurlZparamsZqueryZ fragmentsZgpg_argsfrmetar)Z user_passZauthboundaryZ sep_boundaryZ end_boundaryZbodykeyvaluetitlerFr*ZrequestresultZstatusreasonetextrrr upload_file0s      !          zupload.upload_filecCs4ztd}||j|jWStk r.YnXdS)zM Attempt to load password from keyring. Suppress Exceptions. keyringN) __import__Z get_passwordr0r Exception)rrWrrrrs z"upload._load_password_from_keyringc Cs(z tWSttfk r"YnXdS)zH Prompt for a password on the tty. Suppress Exceptions. N)rrYKeyboardInterruptrrrrrs zupload._prompt_for_passwordN) __name__ __module__ __qualname____doc__r rrVrrrrrrrs  r)r;r4r7rbase64rZ distutilsrZdistutils.commandrr Zdistutils.spawnrZdistutils.errorsrZ*setuptools.extern.six.moves.urllib.requestrrZ(setuptools.extern.six.moves.urllib.errorr Z(setuptools.extern.six.moves.urllib.parser rrrrs       PK!EP2command/__pycache__/bdist_rpm.cpython-38.opt-1.pycnu[U Qab@s(ddlmmZGdddejZdS)Nc@s eZdZdZddZddZdS) bdist_rpmaf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs|dtj|dS)NZegg_info)Z run_commandorigrrun)selfr@/usr/lib/python3.8/site-packages/setuptools/command/bdist_rpm.pyrs z bdist_rpm.runcsl|j}|dd}tj|}d|d|fdd|D}|d}d|}||||S)N-_z%define version cs0g|](}|ddddddqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0lineZline23Zline24rr s  z-bdist_rpm._make_spec_file..z%define unmangled_version )Z distributionZ get_versionr rr_make_spec_fileindexinsert)rversionZ rpmversionspecZ insert_locZunmangled_versionrr rrs      zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__rrrrrrrs r)Zdistutils.command.bdist_rpmZcommandrrrrrrsPK!.?UU1command/__pycache__/egg_info.cpython-38.opt-1.pycnu[U Qabc@sdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddlm+Z+ddlm,Z,ddZ-GdddZ.Gddde.eZ/GdddeZGdddeZ0ddZ1ddZ2d d!Z3d"d#Z4d$d%Z5d&d'Z6d(d)Z7d*d+Z8d5d-d.Z9d/d0Z:d1d2Z;Gd3d4d4e,Z|j|jkr>|j|_t|j|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrP .egg-info-)!r:rQr?rRr isinstancerr>ZVersionlistr ValueError distutilserrorsZDistutilsOptionErrorrPr7Z package_dirgetr#curdirZensure_dirnamerrIr$joincheck_broken_egg_infometadataZ _patched_distkeylowerZ_versionZ_parsed_version)r9Zparsed_versionZ is_versionspecdirsZpdr2r2r3finalize_optionss>           zegg_info.finalize_optionsFcCsL|r||||n4tj|rH|dkr>|s>td||dS||dS)aWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists) write_filer#r$existsrwarn delete_file)r9whatrZdataforcer2r2r3write_or_delete_files   zegg_info.write_or_delete_filecCsDtd||tjr|d}|js@t|d}|||dS)zWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %sutf-8wbN) rinforZPY3encodedry_runopenwriteclose)r9rqrZrrfr2r2r3rms   zegg_info.write_filecCs td||jst|dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrwryr#unlink)r9rZr2r2r3rps zegg_info.delete_filecCs||jt|jd|jj}tdD]4}|j|d|}|||j tj |j|j q*tj |jd}tj |r| ||dS)Nzegg_info.writers) installerznative_libs.txt)ZmkpathrIr#utimer7Zfetch_build_eggrZrequireZresolver:r$rernrp find_sources)r9repwriternlr2r2r3runs     z egg_info.runcCs4tj|jd}t|j}||_||j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r#r$rerImanifest_makerr7manifestrfilelist)r9Zmanifest_filenameZmmr2r2r3r*s  zegg_info.find_sourcescCsT|jd}|jtjkr&tj|j|}tj|rPtd||j |j |_ ||_ dS)Nr\aB------------------------------------------------------------------------------ Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ------------------------------------------------------------------------------) rQrPr#rdr$rernrrorIrS)r9Zbeir2r2r3rf2s   zegg_info.check_broken_egg_infoN)F)rErFrG descriptionZ user_optionsZboolean_optionsZ negative_optrTrHrUsetterr[rlrtrmrprrrfr2r2r2r3rIs.    1 rIc@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rcCs ||\}}}}|dkrR|dd||D]}||s2td|q2n|dkr|dd||D]}||srtd|qrn|dkr|d d||D]}||std |qnJ|d kr|d d||D]}||std |qn|dkr`|d|d|f|D]"}| ||s:td||q:n|dkr|d|d|f|D]"}| ||std||qnp|dkr|d|| |std|n>|dkr|d|| |std|n t d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_line debug_printrerrrorglobal_includeglobal_excluderecursive_includerecursive_excluderrr)r9lineactionZpatternsdirZ dir_patternpatternr2r2r3process_template_lineEs|                  zFileList.process_template_linecCsRd}tt|jdddD]2}||j|r|d|j||j|=d}q|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing T)ranger)filesr)r9Z predicatefoundr/r2r2r3 _remove_filesszFileList._remove_filescCs$ddt|D}||t|S)z#Include files that match 'pattern'.cSsg|]}tj|s|qSr2r#r$isdir.0r}r2r2r3 s z$FileList.include..rextendboolr9rrr2r2r3rs zFileList.includecCst|}||jS)z#Exclude files that match 'pattern'.)r4rmatchr9rrr2r2r3rszFileList.excludecCs8tj|d|}ddt|ddD}||t|S)zN Include all files anywhere in 'dir/' that match the pattern. rcSsg|]}tj|s|qSr2rrr2r2r3rs z.FileList.recursive_include..T) recursive)r#r$rerrr)r9rrZ full_patternrr2r2r3rs zFileList.recursive_includecCs ttj|d|}||jS)zM Exclude any file anywhere in 'dir/' that match the pattern. rr4r#r$rerr)r9rrrr2r2r3rszFileList.recursive_excludecCs$ddt|D}||t|S)zInclude all files from 'dir/'.cSs"g|]}tj|D]}|qqSr2)rarfindall)rZ match_diritemr2r2r3rsz"FileList.graft..r)r9rrr2r2r3rs  zFileList.graftcCsttj|d}||jS)zFilter out files from 'dir/'.rr)r9rrr2r2r3rszFileList.prunecsJ|jdkr|ttjd|fdd|jD}||t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nrcsg|]}|r|qSr2rrrr2r3rs z+FileList.global_include..)Zallfilesrr4r#r$rerrrr2rr3rs   zFileList.global_includecCsttjd|}||jS)zD Exclude all files anywhere that match the pattern. rrrr2r2r3rszFileList.global_excludecCs8|dr|dd}t|}||r4|j|dS)N r)r<r _safe_pathrappend)r9rr$r2r2r3rs    zFileList.appendcCs|jt|j|dSr6)rrfilterr)r9pathsr2r2r3rszFileList.extendcCstt|j|j|_dS)z Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)r_rrrr8r2r2r3_repairszFileList._repairc Csd}t|}|dkr(td|dSt|d}|dkrNt||ddSz"tj|shtj|rnWdSWn&tk rt||t YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFruT) unicode_utilsfilesys_decoderroZ try_encoder#r$rnUnicodeEncodeErrorsysgetfilesystemencoding)r9r$Zenc_warnZu_pathZ utf8_pathr2r2r3rs   zFileList._safe_pathN)rErFrGrrrrrrrrrrrrrrr2r2r2r3rBsI     rc@s\eZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ dS)rz MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifestr8r2r2r3rT sz!manifest_maker.initialize_optionscCsdSr6r2r8r2r2r3rlszmanifest_maker.finalize_optionscCsdt|_tj|js||tj|jr<| | |j |j |dSr6) rrr#r$rnrwrite_manifest add_defaultstemplateZ read_templateprune_file_listsortZremove_duplicatesr8r2r2r3rs  zmanifest_maker.runcCst|}|tjdS)N/)rrreplacer#r%)r9r$r2r2r3_manifest_normalizes z"manifest_maker._manifest_normalizecsBjfddjjD}dj}tj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}|qSr2)rrr8r2r3r*sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrZexecuterm)r9rmsgr2r8r3r"s  zmanifest_maker.write_manifestcCs||st||dSr6)_should_suppress_warningr ro)r9rr2r2r3ro.s zmanifest_maker.warncCs td|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r&r)rr2r2r3r2sz'manifest_maker._should_suppress_warningcCst|||j|j|j|jtt}|rJ|j |nt j |jr`| t j drx|jd|d}|j|jdS)Nzsetup.pyrI)r rZ check_licenserrrrr_r rr#r$rnZ read_manifestget_finalized_commandrrI)r9ZrcfilesZei_cmdr2r2r3r9s     zmanifest_maker.add_defaultscCsZ|d}|j}|j|j|j|ttj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rr7Z get_fullnamerrZ build_baser&r'r#r%Zexclude_pattern)r9rZbase_dirr%r2r2r3rLs    zmanifest_maker.prune_file_listN)rErFrGrrTrlrrrro staticmethodrrrr2r2r2r3rs   rc Cs8d|}|d}t|d}||W5QRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  rurvN)rerxrzr{)rZcontentsr}r2r2r3rmVs   rmc Cs|td||jsx|jj}|j|j|_}|j|j|_}z| |j W5|||_|_Xt |jdd}t |j |dS)Nz writing %sZzip_safe)rrwryr7rgrRr>rQr:write_pkg_inforIgetattrr Zwrite_safety_flag)cmdbasenamerZrgZoldverZoldnameZsafer2r2r3rcs rcCstj|rtddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r#r$rnrrorrrZr2r2r3warn_depends_obsoletevs rcCs,t|pd}dd}t||}||dS)Nr2cSs|dS)Nrr2)rr2r2r3z%_write_requirements..)rr writelines)streamZreqslinesZ append_crr2r2r3_write_requirements~s  rcCsj|j}t}t||j|jp"i}t|D]&}|djft t|||q,| d|| dS)Nz [{extra}] Z requirements) r7rStringIOrZinstall_requiresextras_requiresortedr{formatvarsrtgetvalue)rrrZZdistrrrZextrar2r2r3write_requirementss   rcCs,t}t||jj|d||dS)Nzsetup-requirements)iorrr7Zsetup_requiresrtr)rrrZrrr2r2r3write_setup_requirementssrcCs:tdd|jD}|d|dt|ddS)NcSsg|]}|dddqS).rr)r")rkr2r2r3rsz(write_toplevel_names..ztop-level namesr)rYfromkeysr7Ziter_distribution_namesrmrer)rrrZZpkgsr2r2r3write_toplevel_namess rcCst|||ddS)NT) write_argrr2r2r3 overwrite_argsrFcCsHtj|d}t|j|d}|dk r4d|d}|||||dS)Nrr)r#r$splitextrr7rert)rrrZrsargnamerVr2r2r3rs rcCs|jj}t|tjs|dkr"|}nn|dk rg}t|D]J\}}t|tjsrt||}d tt t | }| d||fq:d |}|d||ddS)Nrz [%s] %s rz entry pointsT)r7Z entry_pointsr^rZ string_typesritemsrZ parse_grouprerstrvaluesrrt)rrrZrrrZsectionrr2r2r3 write_entriess   rc Csjtdttjdrftd>}|D]2}t d|}|r(t | dW5QRSq(W5QRXdS)zd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rr) warningsroEggInfoDeprecationWarningr#r$rnrrzr&rintgroup)r}rrr2r2r3get_pkg_info_revisions    *rc@seZdZdZdS)rzqClass for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.N)rErFrG__doc__r2r2r2r3rsr)F)=rZdistutils.filelistrZ _FileListZdistutils.errorsrZdistutils.utilrrarr#r&rrrrBrWZsetuptools.externrZsetuptools.extern.six.movesrZ setuptoolsrZsetuptools.command.sdistr r Zsetuptools.command.setoptr Zsetuptools.commandr Z pkg_resourcesr rrrrrrrZsetuptools.unicode_utilsrZsetuptools.globrrrr4r5rIrrmrrrrrrrrrrrr2r2r2r3sX           (    S2EP    PK!Ilee*command/__pycache__/develop.cpython-38.pycnu[U Qab@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl Z ddl mZddlmZddlZeZGdd d ejeZGd d d ZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN)six) easy_install) namespacesc@sveZdZdZdZejddgZejdgZdZddZ d d Z d d Z e d dZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode') uninstalluzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer FcCs2|jrd|_||n||dS)NT)r Z multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_optionsselfr>/usr/lib/python3.8/site-packages/setuptools/command/develop.pyrun s  z develop.runcCs&d|_d|_t|d|_d|_dS)N.)r egg_pathrinitialize_options setup_pathZalways_copy_fromrrrrr)s  zdevelop.initialize_optionscCs|d}|jr,d}|j|jf}t|||jg|_t||| |j t d|jd}t j|j||_|j|_|jdkrt j|j|_t|j}tt j|j|j}||krtd|tj|t|t j|j|jd|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to Z project_name)get_finalized_commandZbroken_egg_inforrZegg_nameargsrfinalize_optionsZexpand_basedirsZ expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspath pkg_resourcesnormalize_pathrZ Distribution PathMetadatadist_resolve_setup_pathr)rZeitemplaterZ egg_link_fntargetrrrrr0sF        zdevelop.finalize_optionscCsn|tjdd}|tjkr0d|dd}ttj |||}|ttjkrjt d|ttj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacerseprstripcurdircountr%r&rr r)r#r!rZ path_to_setupZresolvedrrrr)Zs  zdevelop._resolve_setup_pathc CsHtjrt|jddr|jddd|d|d}t|j }|jd|d|d|jddd|d|d}||_ ||j _ t ||j|j _n"|d|jdd d|d|tjr|tjdt_|td |j|j|js0t|jd }||j d |jW5QRX|d|j |j dS) NZuse_2to3FZbuild_pyr)Zinplacer)r#Z build_extr-zCreating %s (link to %s)w )rZPY3getattr distributionZreinitialize_commandZ run_commandrr%r&Z build_librr(locationr'rZ _providerZinstall_site_py setuptoolsZbootstrap_install_fromrZinstall_namespacesrinfor"r#dry_runopenwriterZprocess_distributionZno_deps)rZbpy_cmdZ build_pathZei_cmdfrrrr ns:           zdevelop.install_for_developmentcCstj|jrztd|j|jt|j}dd|D}|||j g|j |j gfkrht d|dS|j szt |j|j s||j|jjrt ddS)NzRemoving %s (link to %s)cSsg|] }|qSr)r0).0linerrr sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)rrexistsr"rr9r#r;closerrwarnr:unlinkZ update_pthr(r6scripts)rZ egg_link_filecontentsrrrr s      zdevelop.uninstall_linkc Cs||jk rt||S|||jjp*gD]N}tjt |}tj |}t |}| }W5QRX|||||q,dSN)r(rinstall_egg_scriptsinstall_wrapper_scriptsr6rErrr$rbasenameior;readZinstall_script)rr(Z script_nameZ script_pathZstrmZ script_textrrrrHs     zdevelop.install_egg_scriptscCst|}t||SrG)VersionlessRequirementrrIrr(rrrrIszdevelop.install_wrapper_scriptsN)__name__ __module__ __qualname____doc__ descriptionrZ user_optionsZboolean_optionsZcommand_consumes_argumentsrrr staticmethodr)r r rHrIrrrrr s"  * 0r c@s(eZdZdZddZddZddZdS) rMa Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dSrG)_VersionlessRequirement__distrNrrr__init__szVersionlessRequirement.__init__cCs t|j|SrG)r5rU)rnamerrr __getattr__sz"VersionlessRequirement.__getattr__cCs|jSrGrrrrras_requirementsz%VersionlessRequirement.as_requirementN)rOrPrQrRrVrXrYrrrrrMsrM)Zdistutils.utilrZ distutilsrZdistutils.errorsrrrrrKZsetuptools.externrr%Zsetuptools.command.easy_installrr8rtypeZ __metaclass__ZDevelopInstallerr rMrrrrs     6PK!Ėką -command/__pycache__/build_clib.cpython-38.pycnu[U Qab@sLddlmmZddlmZddlmZddlm Z GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS) build_clibav Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Csr|D]f\}}|d}|dks.t|ttfs:td|t|}td||dt}t|tsrtd|g}|dt}t|ttfstd||D]P}|g} | |||t} t| ttfstd|| | | | q|j j ||j d} t || ggfkrT|d} |d } |d }|j j||j | | ||jd }|j j| ||j|jd qdS) Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list') output_dirmacros include_dirscflags)r r r Zextra_postargsdebug)r r )get isinstancelisttuplerrinfodictextendappendZcompilerZobject_filenamesZ build_temprcompiler Zcreate_static_libr)selfZ librariesZlib_nameZ build_inforrZ dependenciesZ global_depssourceZsrc_depsZ extra_depsZexpected_objectsr r r ZobjectsrA/usr/lib/python3.8/site-packages/setuptools/command/build_clib.pybuild_librariessv          zbuild_clib.build_librariesN)__name__ __module__ __qualname____doc__rrrrrrsr) Zdistutils.command.build_clibZcommandrZorigZdistutils.errorsrZ distutilsrZsetuptools.dep_utilrrrrrs   PK!IG)command/__pycache__/setopt.cpython-38.pycnu[U Qab@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd dZ dddZ Gdd d e ZGdd d eZdS)) convert_path)log)DistutilsOptionErrorN) configparser)Command config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjtjtjdS|dkrZtjdkrBdpDd}tjtd |St d |d S) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)Zkinddotr=/usr/lib/python3.8/site-packages/setuptools/command/setopt.pyrs Fc Cs&td|t}||g|D]\}}|dkrRtd||||q(||sttd||| ||D]p\}}|dkrtd|||| ||| |std||||q|td||||| |||q|q(td||s"t |d }||W5QRXdS) aYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sw)rdebugrZRawConfigParserreaditemsinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionoptionssetopenwrite) filenameZsettingsdry_runZoptsZsectionr"optionvaluefrrrr!sJ          c@s2eZdZdZdddgZddgZddZd d Zd S) r z|js>tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r r9rEr(rrFrCr2rrrr9s  zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr&rEr(replacerFr'r2rrrrunsz setopt.runN) r:r;r<r= descriptionr r>r?r4r9rJrrrrr ss )r )F)Zdistutils.utilrrrZdistutils.errorsrrZsetuptools.extern.six.movesrZ setuptoolsr__all__rrr r rrrrs        +'PK!EP,command/__pycache__/bdist_rpm.cpython-38.pycnu[U Qab@s(ddlmmZGdddejZdS)Nc@s eZdZdZddZddZdS) bdist_rpmaf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs|dtj|dS)NZegg_info)Z run_commandorigrrun)selfr@/usr/lib/python3.8/site-packages/setuptools/command/bdist_rpm.pyrs z bdist_rpm.runcsl|j}|dd}tj|}d|d|fdd|D}|d}d|}||||S)N-_z%define version cs0g|](}|ddddddqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0lineZline23Zline24rr s  z-bdist_rpm._make_spec_file..z%define unmangled_version )Z distributionZ get_versionr rr_make_spec_fileindexinsert)rversionZ rpmversionspecZ insert_locZunmangled_versionrr rrs      zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__rrrrrrrs r)Zdistutils.command.bdist_rpmZcommandrrrrrrsPK!Ėką 3command/__pycache__/build_clib.cpython-38.opt-1.pycnu[U Qab@sLddlmmZddlmZddlmZddlm Z GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS) build_clibav Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Csr|D]f\}}|d}|dks.t|ttfs:td|t|}td||dt}t|tsrtd|g}|dt}t|ttfstd||D]P}|g} | |||t} t| ttfstd|| | | | q|j j ||j d} t || ggfkrT|d} |d } |d }|j j||j | | ||jd }|j j| ||j|jd qdS) Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list') output_dirmacros include_dirscflags)r r r Zextra_postargsdebug)r r )get isinstancelisttuplerrinfodictextendappendZcompilerZobject_filenamesZ build_temprcompiler Zcreate_static_libr)selfZ librariesZlib_nameZ build_inforrZ dependenciesZ global_depssourceZsrc_depsZ extra_depsZexpected_objectsr r r ZobjectsrA/usr/lib/python3.8/site-packages/setuptools/command/build_clib.pybuild_librariessv          zbuild_clib.build_librariesN)__name__ __module__ __qualname____doc__rrrrrrsr) Zdistutils.command.build_clibZcommandrZorigZdistutils.errorsrZ distutilsrZsetuptools.dep_utilrrrrrs   PK!UTSS/command/__pycache__/upload.cpython-38.opt-1.pycnu[U Qab@sddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZddlmZmZddlmZdd lmZGd d d e j Z dS) N)standard_b64encode)log)upload)spawn)DistutilsError)urlopenRequest) HTTPError)urlparsec@s8eZdZdZddZddZddZdd Zd d Zd S) rza Override default upload behavior to obtain password in a variety of different ways. c Cs&ztj|W5|dtjXdS)NzjWARNING: Uploading via this command is deprecated, use twine to upload instead (https://pypi.org/p/twine/))announcerZWARNorigrrunselfr=/usr/lib/python3.8/site-packages/setuptools/command/upload.pyr s z upload.runcCs8tj||jpt|_|jp0|p0||_dSN) r rfinalize_optionsusernamegetpassZgetuserpassword_load_password_from_keyring_prompt_for_passwordrrrrr"s zupload.finalize_optionsc Cst|j\}}}}}} |s"|s"| r0td|j|dkrDtd||jr|ddd|g} |jrnd|jg| dd<t| |jd t|d } | } W5QRX|j j } d d | | t j|| f||t| t| | | | | | | | | | | | | | !d }d|d<|jrdt j|dt|dd f|d<|j"d|j#$d}dt%|&d}d}d|$d}|d}t'(}|)D]\}}d|}t*|t+s|g}|D]j}t,|t-kr|d|d7}|d}nt|$d}|.||.|$d|.d|.|qܐq|.||/}d||jf}|0|t1j2d|tt3||d }t4|j||d!}zt5|}|6}|j7}Wnft8k r}z|j9}|j7}W5d}~XYn8t:k r"}z|0t|t1j;W5d}~XYnX|d"kr|0d#||ft1j2|j<rt=|d$d%d&|}|dk rd'>d(|d(f}|0|t1j2n"d)||f}|0|t1j;t?|dS)*NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz --detach-signz-az --local-user)dry_runrbZ file_upload1)z:actionZprotocol_versionnameversioncontentZfiletype pyversionZ md5_digestZmetadata_versionZsummaryZ home_pageZauthorZ author_emaillicense descriptionkeywordsplatformZ classifiersZ download_urlZprovidesZrequiresZ obsoletesZcommentz.ascZ gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s-- z+ Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s zSubmitting %s to %sz multipart/form-data; boundary=%s)z Content-typezContent-lengthZ Authorization)dataheaderszServer response (%s): %sZ_read_pypi_responsecSsdSrr)xrrrz$upload.upload_file.. zK---------------------------------------------------------------------------zUpload failed (%s): %s)@r repositoryAssertionErrorZsignZidentityrropenreadZ distributionZmetadataZget_nameZ get_versionospathbasenamehashlibZmd5Z hexdigeststrZget_metadata_versionZget_descriptionZget_urlZ get_contactZget_contact_emailZ get_licenceZget_long_descriptionZ get_keywordsZ get_platformsZget_classifiersZget_download_urlZ get_providesZ get_requiresZ get_obsoletesrrencoderdecodeioBytesIOitems isinstancelisttypetuplewritegetvaluer rINFOlenrrZgetcodemsgr codeOSErrorZERRORZ show_responsegetattrjoinr) rZcommandr filenameZschemaZnetlocZurlZparamsZqueryZ fragmentsZgpg_argsfrmetar)Z user_passZauthboundaryZ sep_boundaryZ end_boundaryZbodykeyvaluetitlerFr*ZrequestresultZstatusreasonetextrrr upload_file0s      !          zupload.upload_filecCs4ztd}||j|jWStk r.YnXdS)zM Attempt to load password from keyring. Suppress Exceptions. keyringN) __import__Z get_passwordr0r Exception)rrWrrrrs z"upload._load_password_from_keyringc Cs(z tWSttfk r"YnXdS)zH Prompt for a password on the tty. Suppress Exceptions. N)rrYKeyboardInterruptrrrrrs zupload._prompt_for_passwordN) __name__ __module__ __qualname____doc__r rrVrrrrrrrs  r)r;r4r7rbase64rZ distutilsrZdistutils.commandrr Zdistutils.spawnrZdistutils.errorsrZ*setuptools.extern.six.moves.urllib.requestrrZ(setuptools.extern.six.moves.urllib.errorr Z(setuptools.extern.six.moves.urllib.parser rrrrs       PK!$2command/__pycache__/install_scripts.cpython-38.pycnu[U Qab @sXddlmZddlmmZddlZddlZddlm Z m Z m Z GdddejZdS))logN) Distribution PathMetadataensure_directoryc@s*eZdZdZddZddZd ddZd S) install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj|d|_dS)NF)origrinitialize_optionsno_ep)selfr F/usr/lib/python3.8/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddlmm}|d|jjr2tj|ng|_ |j rBdS| d}t |j t|j |j|j|j}| d}t|dd}| d}t|dd}|j}|rd}|j}|tjkr|g}|}|j|} ||| D]} |j| qdS) Nregg_infoZ build_scripts executableZ bdist_wininstZ _is_runningFz python.exe)setuptools.command.easy_installcommandZ easy_installZ run_commandZ distributionZscriptsrrrunoutfilesr Zget_finalized_commandrZegg_baserr Zegg_nameZ egg_versiongetattrZ ScriptWriterZWindowsScriptWritersysrZbestZcommand_spec_classZ from_paramZget_argsZ as_header write_script) r ZeiZei_cmdZdistZbs_cmdZ exec_paramZbw_cmdZ is_wininstwritercmdargsr r r rs8        zinstall_scripts.runtc Gsddlm}m}td||jtj|j|}|j ||}|j s~t |t |d|} | || ||d|dS)z1Write an executable file to the scripts directoryr)chmod current_umaskzInstalling %s script to %swiN)rrrrinfoZ install_dirospathjoinrappendZdry_runropenwriteclose) r Z script_namecontentsmodeZignoredrrtargetmaskfr r r r3s  zinstall_scripts.write_scriptN)r)__name__ __module__ __qualname____doc__rrrr r r r r s#r) Z distutilsrZ!distutils.command.install_scriptsrrrrrZ pkg_resourcesrrrr r r r s PK!M2 f7f7,command/__pycache__/bdist_egg.cpython-38.pycnu[U Qab G@sxdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZzdd lmZmZd dZWn,ek rddlm Z mZddZYnXddZ!ddZ"ddZ#GdddeZ$e%&d'Z(ddZ)ddZ*ddZ+d d!d"Z,d#d$Z-d%d&Z.d'd(Z/d)d*d+d,gZ0d1d/d0Z1dS)2z6setuptools.command.bdist_egg Build .egg distributions)DistutilsSetupError) remove_treemkpath)log)CodeTypeN)six)get_build_platform Distributionensure_directory) EntryPoint)Library)Command)get_pathget_python_versioncCstdS)NZpurelib)rrr@/usr/lib/python3.8/site-packages/setuptools/command/bdist_egg.py _get_purelibsr)get_python_librcCstdS)NF)rrrrrrscCs2d|krtj|d}|dr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrr strip_module#s   rccs6t|D]&\}}}|||||fVq dS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfilesrrr sorted_walk+sr"c Cs6td}t|d}|||W5QRXdS)NaR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr write_stub5s r,c@seZdZdZddddefdddd gZd d d gZd dZddZddZ ddZ ddZ ddZ ddZ ddZddZdd Zd!d"Zd#S)$ bdist_eggzcreate an "egg" distribution)z bdist-dir=bz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s))exclude-source-filesNz+remove all .py files from the generated egg) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z dist-dir=dz-directory to put final built distributions in) skip-buildNz2skip rebuilding everything (for testing/debugging)r1r4r0cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_filesselfrrrinitialize_optionsZszbdist_egg.initialize_optionscCs|d}|_|j|_|jdkr>|dj}tj|d|_|jdkrPt |_| dd|j dkrt dd|j |jt|jo|j }tj|j|d|_ dS)Negg_infoZbdistZegg)r8r8z.egg)get_finalized_commandei_cmdr?r5 bdist_baserrjoinr6rZset_undefined_optionsr:r Zegg_nameZ egg_versionr distributionhas_ext_modulesr8)r=rArBbasenamerrrfinalize_optionscs$     zbdist_egg.finalize_optionscCs|j|d_tjtjt}|jj g}|j_ |D]}t |t rt |dkrtj |drtj|d}tj|}||ks||tjr|t |dd|df}|jj |q:z"td|j|jddddW5||j_ XdS)Ninstallrzinstalling package data to %s install_data)forceroot)r5r@ install_librrnormcaserealpathrrD data_files isinstancetuplelenisabs startswithsepappendrinfo call_command)r=Z site_packagesolditemrPZ normalizedrrrdo_install_data{s"  zbdist_egg.do_install_datacCs|jgS)N)r:r<rrr get_outputsszbdist_egg.get_outputscKsPtD]}|||jq|d|j|d|j|j|f|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr9dry_run)INSTALL_DIRECTORY_ATTRS setdefaultr5r9r_Zreinitialize_command run_command)r=ZcmdnamekwdirnamecmdrrrrZs zbdist_egg.call_commandcCs|dtd|j|d}|j}d|_|jrH|jsH|d|j ddd}||_| \}}g|_ g}t |D]|\}}t j|\} } t j|jt| d} |j | td ||jstt j|| || |t jd ||<qz|r|||jjr||j} t j| d } || |jjrlt j| d }td ||j d|dd|| t j| d}|rtd||jst|t|d}| d|| d|!n,t j"|rtd||jst #|t$t j| d |%t j&t j|j'dr.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [%s] to [%s])rrYwalk_eggr5rrrCrdebugrwrematchpardirgroupremoveOSErrorrename) r=rr r!rrZpath_oldpatternmZpath_newrrrr|s4       zbdist_egg.zap_pyfilescCs2t|jdd}|dk r|Stdt|j|jS)Nryz4zip_safe flag not set; analyzing archive contents...)rrDrr{ analyze_eggr5rq)r=saferrrry s  zbdist_egg.zip_safec Cst|jjpd}|did}|dkr0dS|jr<|jrJtd|fdjt j }|j }d |j}|jd}t j|j}d t}|jstt j|j|jd t|jd} | || d S) Nzsetuptools.installationZ eggsecutabler#zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulez{}.{}rraH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi roa)r Z parse_maprDZ entry_pointsgetZattrsZextrasrformatsys version_infoZ module_namerCrrrFr:localsr_rrdr'r(ru) r=ZepmZepZpyverpkgZfullrrFheaderr+rrrr~s0       zbdist_egg.gen_headercCshtj|j}tj|d}|jjjD]<}||r&tj||t |d}t || ||q&dS)z*Copy metadata (egg info) to the target_dirrN) rrnormpathr?rCrAZfilelistr!rVrTr Z copy_file)r=Z target_dirZ norm_egg_infoprefixrtargetrrrrt:s zbdist_egg.copy_metadata_toc Csg}g}|jdi}t|jD]f\}}}|D].}tj|dtkr*||||q*|D]"}|||d|tj||<q^q|j r| d}|j D]Z} t | trq|| j} || }tj|dstjtj|j|r||q||fS)zAGet a list of relative paths to C extensions in the output distrorrJrgZ build_extzdl-)r5r"rrrlowerNATIVE_EXTENSIONSrXrCrDrEr@ extensionsrRr Zget_ext_fullnamerZget_ext_filenamerFrVrz) r=rrpathsrr r!rZ build_cmdrfullnamerrrrpFs0        zbdist_egg.get_ext_outputsN)__name__ __module__ __qualname__ descriptionrZ user_optionsZboolean_optionsr>rGr]r^rZrr|ryr~rtrprrrrr-Cs2  Q' r-z.dll .so .dylib .pydccsHt|}t|\}}}d|kr(|d|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrhN)r"nextr)egg_dirZwalkerrr r!Zbdfrrrrfs  rc CstD](\}}tjtj|d|r|Sqtst||krzt|q|dk rt||krt|d}| d| qdS)Nrkrl) rrrrrCrzboolrwr'r(ru)rrrrr+rrrrxs    rxzzip-safez not-zip-safe)TFc Cstj||}|dd|kr"dS|t|ddtjd}||rJdpLdtj|d}tjrld}nt j d kr|d }nd }t |d }| |t |} |d} tt| } d D]} | | krtd|| d} qd| kr dD]} | | krtd|| d} q| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrJrrr) rb)__file____path__z%s: module references %sFinspect) Z getsourceZ getabsfileZ getsourcefileZgetfilegetsourcelinesZ findsourceZ getcommentsZ getframeinfoZgetinnerframesZgetouterframesstackZtracez"%s: module MAY be using inspect.%s)rrrCrTrsrWrrZPY2rrr'readmarshalloadrudictfromkeys iter_symbolsrr{) rrrrqrrrskipr+coderZsymbolsZbadrrrrs4      rccsT|jD] }|Vq|jD]6}t|tjr0|Vqt|trt|D] }|VqBqdS)zBYield names and strings used by `code` and its nested code objectsN)co_names co_constsrRrZ string_typesrr)rrconstrrrrs     rcCs2tjdstjdkrdStdtddS)NjavaZcliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py)rplatformrVrr{rrrrrs rrNrjrKZ install_baseTr#c sddl}ttj|dtd|fdd}|rB|jn|j}s|j |||d} t D]\} } } || | | qd| n t D]\} } } |d| | q|S)aqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. rNroz#creating '%s' and adding '%s' to itcs`|D]V}tjtj||}tj|r|tdd}sN|||td|qdS)NrJz adding '%s') rrrrCrvrTr(rr)zrdnamesrrr/base_dirr_rrvisits  zmake_zipfile..visit) compression) zipfilerrrrdrrYZ ZIP_DEFLATEDZ ZIP_STOREDZZipFiler"ru) Z zip_filenamerrmr_compressrnrrrrrdr r!rrrr}s  r})rrTr#)2__doc__Zdistutils.errorsrZdistutils.dir_utilrrZ distutilsrtypesrrrrr$rZsetuptools.externrZ pkg_resourcesrr r r Zsetuptools.extensionr Z setuptoolsr Z sysconfigrrr ImportErrorZdistutils.sysconfigrrr"r,r-rrsplitrrrrxrrrrr`r}rrrrsX         " $  PK!Xr!!+command/__pycache__/build_py.cpython-38.pycnu[U Qab|%@sddlmZddlmZddlmmZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZzddlmZWn"ek rGdddZYnXGd d d ejeZdd d Zd dZdS))glob) convert_pathN)six)mapfilter filterfalse) Mixin2to3c@seZdZdddZdS)rTcCsdS)z do nothingN)selffilesZdoctestsr r ?/usr/lib/python3.8/site-packages/setuptools/command/build_py.pyrun_2to3szMixin2to3.run_2to3N)T)__name__ __module__ __qualname__r r r r r rsrc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsFtj||jj|_|jjp i|_d|jkr6|jd=g|_g|_dS)N data_files) origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_files_build_py__doctests_2to3r r r r r!s   zbuild_py.finalize_optionscCsx|js|jsdS|jr||jr4||||jd||jd||jd|t j j |dddS)z?Build modules, packages, and copy data files to build directoryNFTr)Zinclude_bytecode) Z py_modulespackagesZ build_modulesZbuild_packagesbuild_package_datar rrZ byte_compilerrZ get_outputsrr r r run+s z build_py.runcCs&|dkr||_|jStj||S)zlazily compute data filesr)_get_data_filesrrr __getattr__)r attrr r r r ?s zbuild_py.__getattr__cCsJtjrt|tjr|d}tj||||\}}|rB|j |||fS)N.) rZPY2 isinstanceZ string_typessplitrr build_modulerappend)r moduleZ module_filepackageZoutfilecopiedr r r r%Fs   zbuild_py.build_modulecCs|tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr )analyze_manifestlistr_get_pkg_data_filesrrr r r rPszbuild_py._get_data_filescsJ||tjj|jg|d}fdd||D}|||fS)Nr"csg|]}tj|qSr )ospathrelpath).0filesrc_dirr r ]sz0build_py._get_pkg_data_files..)get_package_dirr-r.joinZ build_libr$find_data_files)r r( build_dir filenamesr r2r r,Us    zbuild_py._get_pkg_data_filescCsX||j||}tt|}tj|}ttj j |}t|j |g|}| |||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrrr itertoolschain from_iterablerr-r.isfilemanifest_filesgetexclude_data_files)r r(r3patternsZglobs_expandedZ globs_matchesZ glob_filesr r r r r7cs   zbuild_py.find_data_filesc Cs|jD]|\}}}}|D]j}tj||}|tj|tj||}|||\}} tj|}| r||jj kr|j |qqdS)z$Copy data files into build directoryN) rr-r.r6ZmkpathdirnameZ copy_fileabspathrZconvert_2to3_doctestsrr&) r r(r3r8r9filenametargetZsrcfileZoutfr)r r r rts  zbuild_py.build_package_datac Csi|_}|jjsdSi}|jp"dD]}||t||<q$|d|d}|jj D]}t j t|\}}d}|} |r||kr||kr|}t j |\}} t j | |}qx||krX|dr|| krqX|||g|qXdS)Nr Zegg_infoz.py)r?rZinclude_package_datarassert_relativer5Z run_commandZget_finalized_commandZfilelistr r-r.r$r6endswith setdefaultr&) r ZmfZsrc_dirsr(Zei_cmdr.dfprevZoldfZdfr r r r*s(    zbuild_py.analyze_manifestcCsdSNr rr r r get_data_filesszbuild_py.get_data_filesc Csz |j|WStk r YnXtj|||}||j|<|rH|jjsL|S|jjD]}||ksn||drTqxqT|St |d}| }W5QRXd|krt j d|f|S)z8Check namespace packages' __init__ for declare_namespacer"rbsdeclare_namespacezNamespace package problem: %s is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorrr check_packagerZnamespace_packages startswithioopenread distutilserrorsZDistutilsError)r r(Z package_dirZinit_pyZpkgrKcontentsr r r rRs*    zbuild_py.check_packagecCsi|_tj|dSrM)rPrrinitialize_optionsrr r r rZszbuild_py.initialize_optionscCs0tj||}|jjdk r,tj|jj|S|SrM)rrr5rZsrc_rootr-r.r6)r r(resr r r r5s zbuild_py.get_package_dircs\t||j||}fdd|D}tj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}t|VqdSrM)fnmatchrr0pattern)r r r sz.build_py.exclude_data_files..c3s|]}|kr|VqdSrMr )r0fn)badr r r_s)r+r:rr;r<r=set_unique_everseen)r r(r3r rBZ match_groupsZmatchesZkeepersr )rar r rAs   zbuild_py.exclude_data_filescs.t|dg||g}fdd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3s |]}tjt|VqdSrM)r-r.r6rr]r2r r r_sz2build_py._get_platform_patterns..)r;r<r@)specr(r3Z raw_patternsr r2r r:s   zbuild_py._get_platform_patternsN)rrr__doc__rrr r%rr,r7rr*rNrRrZr5rA staticmethodr:r r r r rs"    rccsbt}|j}|dkr6t|j|D]}|||Vq n(|D]"}||}||kr:|||Vq:dS)zHList unique elements, preserving order. Remember all elements ever seen.N)rbaddr __contains__)iterablekeyseenZseen_addZelementkr r r rcs rccCs:tj|s|Sddlm}td|}||dS)Nr)DistutilsSetupErrorz Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )r-r.isabsdistutils.errorsrntextwrapdedentlstrip)r.rnmsgr r r rGs   rG)N)rZdistutils.utilrZdistutils.command.build_pyZcommandrrr-r\rqrTrprWr;Zsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.lib2to3_exr ImportErrorrcrGr r r r s$   Y PK!Dѳ.command/__pycache__/upload_docs.cpython-38.pycnu[U Qab@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd d ZGd ddeZdS)zpupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). )standard_b64encode)log)DistutilsOptionErrorN)six) http_clienturllib)iter_entry_points)uploadcCstjr dnd}|d|S)Nsurrogateescapestrictzutf-8)rPY3encode)serrorsrB/usr/lib/python3.8/site-packages/setuptools/command/upload_docs.py_encodesrc@seZdZdZdZdddejfddgZejZdd Zd efgZ d d Z d dZ ddZ ddZ eddZeddZddZdS) upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIz repository=rzurl of repository [default: %s])z show-responseNz&display full response text from server)z upload-dir=Nzdirectory to uploadcCs"|jdkrtddD]}dSdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfZeprrr has_sphinx/s zupload_docs.has_sphinxrcCst|d|_d|_dS)N)r initialize_optionsr target_dir)rrrrr6s zupload_docs.initialize_optionscCst||jdkrN|r0|d}|j|_q`|d}tj |j d|_n| d|j|_d|j krtt d|d|jdS)NrbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r finalize_optionsrrZget_finalized_commandZbuilder_target_dirrospathjoinZ build_baseZensure_dirname repositoryrwarnannounce)rrrrrrr;s        zupload_docs.finalize_optionsc Cst|d}z||jt|jD]x\}}}||jkrP|sPd}t||j|D]H}tj ||}|t |jd tjj } tj | |} | || qTq&W5|XdS)Nwz'no files found in upload directory '%s')zipfileZZipFilecloseZmkpathrrwalkrrr lenlstripsepwrite) rfilenamezip_filerootdirsfilesZtmplnameZfullrelativedestrrrcreate_zipfileKs  zupload_docs.create_zipfilec Csh|D]}||qt}|jj}tj |d|}z| || |W5t |XdS)Nz%s.zip)Zget_sub_commandsZ run_commandtempfileZmkdtemp distributionmetadataget_namerrr shutilZrmtreer4 upload_file)rZcmd_nameZtmp_dirr1r-rrrrun[s    zupload_docs.runccs|\}}d|}t|ts |g}|D]f}t|trL|d|d7}|d}nt|}|Vt|VdV|V|r$|dddkr$dVq$dS) Nz* Content-Disposition: form-data; name="%s"z; filename="%s"rr s   ) isinstancelisttupler)item sep_boundarykeyvaluestitlevaluerrr _build_partis    zupload_docs._build_partc Csnd}d|}|d}|df}tj|j|d}t||}tj|}t||} d|d} d | | fS) z= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--r>)rCz multipart/form-data; boundary=%sascii) functoolspartialrHmapitems itertoolschain from_iterabledecoder ) clsdataboundaryrCZ end_boundaryZ end_itemsZbuilderZ part_groupspartsZ body_items content_typerrr_build_multipart}s  zupload_docs._build_multipartc CsJt|d}|}W5QRX|jj}d|tj||fd}t|j d|j }t |}t j rn|d}d|}||\}} d|j} || tjtj|j\} } } }}}|s|s|rt| dkrt| }n | d krt| }n td | d }zZ||d | | }|d ||dtt||d|| |!|Wn>t"j#k r}z|t|tj$WYdSd}~XYnX|%}|j&dkrd|j&|j'f} || tjnb|j&dkr|(d}|dkrd|}d|} || tjnd|j&|j'f} || tj$|j)rFt*d|ddS)NrbZ doc_upload)z:actionr1content:rIzBasic zSubmitting documentation to %sZhttpZhttpszunsupported schema ZPOSTz Content-typezContent-lengthZ AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %szK---------------------------------------------------------------------------)+openreadr6r7r8rrbasenamerZusernameZpasswordrrr rRrXr!r#rINFOrparseZurlparseAssertionErrorrZHTTPConnectionZHTTPSConnectionZconnectZ putrequestZ putheaderstrr(Z endheaderssendsocketerrorZERRORZ getresponseZstatusreasonZ getheaderZ show_responseprint)rr,frZmetarTZ credentialsZauthZbodyZctmsgZschemaZnetlocZurlZparamsZqueryZ fragmentsZconnrWerlocationrrrr:sd               zupload_docs.upload_fileN)__name__ __module__ __qualname__ZDEFAULT_REPOSITORY descriptionr Z user_optionsZboolean_optionsrZ sub_commandsrrr4r; staticmethodrH classmethodrXr:rrrrrs(   r)__doc__base64rZ distutilsrZdistutils.errorsrrrfr%r5r9rOrKZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesrr rrrrrrs       PK!Xr!!1command/__pycache__/build_py.cpython-38.opt-1.pycnu[U Qab|%@sddlmZddlmZddlmmZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZzddlmZWn"ek rGdddZYnXGd d d ejeZdd d Zd dZdS))glob) convert_pathN)six)mapfilter filterfalse) Mixin2to3c@seZdZdddZdS)rTcCsdS)z do nothingN)selffilesZdoctestsr r ?/usr/lib/python3.8/site-packages/setuptools/command/build_py.pyrun_2to3szMixin2to3.run_2to3N)T)__name__ __module__ __qualname__r r r r r rsrc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsFtj||jj|_|jjp i|_d|jkr6|jd=g|_g|_dS)N data_files) origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_files_build_py__doctests_2to3r r r r r!s   zbuild_py.finalize_optionscCsx|js|jsdS|jr||jr4||||jd||jd||jd|t j j |dddS)z?Build modules, packages, and copy data files to build directoryNFTr)Zinclude_bytecode) Z py_modulespackagesZ build_modulesZbuild_packagesbuild_package_datar rrZ byte_compilerrZ get_outputsrr r r run+s z build_py.runcCs&|dkr||_|jStj||S)zlazily compute data filesr)_get_data_filesrrr __getattr__)r attrr r r r ?s zbuild_py.__getattr__cCsJtjrt|tjr|d}tj||||\}}|rB|j |||fS)N.) rZPY2 isinstanceZ string_typessplitrr build_modulerappend)r moduleZ module_filepackageZoutfilecopiedr r r r%Fs   zbuild_py.build_modulecCs|tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr )analyze_manifestlistr_get_pkg_data_filesrrr r r rPszbuild_py._get_data_filescsJ||tjj|jg|d}fdd||D}|||fS)Nr"csg|]}tj|qSr )ospathrelpath).0filesrc_dirr r ]sz0build_py._get_pkg_data_files..)get_package_dirr-r.joinZ build_libr$find_data_files)r r( build_dir filenamesr r2r r,Us    zbuild_py._get_pkg_data_filescCsX||j||}tt|}tj|}ttj j |}t|j |g|}| |||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrrr itertoolschain from_iterablerr-r.isfilemanifest_filesgetexclude_data_files)r r(r3patternsZglobs_expandedZ globs_matchesZ glob_filesr r r r r7cs   zbuild_py.find_data_filesc Cs|jD]|\}}}}|D]j}tj||}|tj|tj||}|||\}} tj|}| r||jj kr|j |qqdS)z$Copy data files into build directoryN) rr-r.r6ZmkpathdirnameZ copy_fileabspathrZconvert_2to3_doctestsrr&) r r(r3r8r9filenametargetZsrcfileZoutfr)r r r rts  zbuild_py.build_package_datac Csi|_}|jjsdSi}|jp"dD]}||t||<q$|d|d}|jj D]}t j t|\}}d}|} |r||kr||kr|}t j |\}} t j | |}qx||krX|dr|| krqX|||g|qXdS)Nr Zegg_infoz.py)r?rZinclude_package_datarassert_relativer5Z run_commandZget_finalized_commandZfilelistr r-r.r$r6endswith setdefaultr&) r ZmfZsrc_dirsr(Zei_cmdr.dfprevZoldfZdfr r r r*s(    zbuild_py.analyze_manifestcCsdSNr rr r r get_data_filesszbuild_py.get_data_filesc Csz |j|WStk r YnXtj|||}||j|<|rH|jjsL|S|jjD]}||ksn||drTqxqT|St |d}| }W5QRXd|krt j d|f|S)z8Check namespace packages' __init__ for declare_namespacer"rbsdeclare_namespacezNamespace package problem: %s is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorrr check_packagerZnamespace_packages startswithioopenread distutilserrorsZDistutilsError)r r(Z package_dirZinit_pyZpkgrKcontentsr r r rRs*    zbuild_py.check_packagecCsi|_tj|dSrM)rPrrinitialize_optionsrr r r rZszbuild_py.initialize_optionscCs0tj||}|jjdk r,tj|jj|S|SrM)rrr5rZsrc_rootr-r.r6)r r(resr r r r5s zbuild_py.get_package_dircs\t||j||}fdd|D}tj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}t|VqdSrM)fnmatchrr0pattern)r r r sz.build_py.exclude_data_files..c3s|]}|kr|VqdSrMr )r0fn)badr r r_s)r+r:rr;r<r=set_unique_everseen)r r(r3r rBZ match_groupsZmatchesZkeepersr )rar r rAs   zbuild_py.exclude_data_filescs.t|dg||g}fdd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3s |]}tjt|VqdSrM)r-r.r6rr]r2r r r_sz2build_py._get_platform_patterns..)r;r<r@)specr(r3Z raw_patternsr r2r r:s   zbuild_py._get_platform_patternsN)rrr__doc__rrr r%rr,r7rr*rNrRrZr5rA staticmethodr:r r r r rs"    rccsbt}|j}|dkr6t|j|D]}|||Vq n(|D]"}||}||kr:|||Vq:dS)zHList unique elements, preserving order. Remember all elements ever seen.N)rbaddr __contains__)iterablekeyseenZseen_addZelementkr r r rcs rccCs:tj|s|Sddlm}td|}||dS)Nr)DistutilsSetupErrorz Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )r-r.isabsdistutils.errorsrntextwrapdedentlstrip)r.rnmsgr r r rGs   rG)N)rZdistutils.utilrZdistutils.command.build_pyZcommandrrr-r\rqrTrprWr;Zsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.lib2to3_exr ImportErrorrcrGr r r r s$   Y PK!HH-command/__pycache__/py36compat.cpython-38.pycnu[U Qabz@sdddlZddlmZddlmZddlmZddlmZGdddZe ejdr`Gd ddZdS) N)glob) convert_path)sdist)filterc@s\eZdZdZddZeddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)sdist_add_defaultsz Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<|||||||dS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfrA/usr/lib/python3.8/site-packages/setuptools/command/py36compat.py add_defaultsszsdist_add_defaults.add_defaultscCs:tj|sdStj|}tj|\}}|t|kS)z Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ospathexistsabspathsplitlistdir)fspathrZ directoryfilenamerrr_cs_path_exists(s  z"sdist_add_defaults._cs_path_existscCs|j|jjg}|D]~}t|trj|}d}|D]"}||r,d}|j|qPq,|s|dd |q||r|j|q|d|qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMES distributionZ script_name isinstancetuplerfilelistappendwarnjoin)rZ standardsfnZaltsZgot_itrrrr9s"    z*sdist_add_defaults._add_defaults_standardscCs4ddg}|D]"}ttjjt|}|j|q dS)Nz test/test*.pyz setup.cfg)rrrisfilerrextend)rZoptionalpatternfilesrrrrNsz)sdist_add_defaults._add_defaults_optionalcCs\|d}|jr$|j||jD],\}}}}|D]}|jtj ||q:q*dS)Nbuild_py) get_finalized_commandrZhas_pure_modulesrr$get_source_files data_filesrrrr!)rr'ZpkgZsrc_dirZ build_dir filenamesrrrrr Ts   z'sdist_add_defaults._add_defaults_pythoncCsz|jrv|jjD]b}t|trBt|}tj|rt|j |q|\}}|D]$}t|}tj|rN|j |qNqdS)N) rZhas_data_filesr*rstrrrrr#rr)ritemdirnamer+frrrr ds     z+sdist_add_defaults._add_defaults_data_filescCs(|jr$|d}|j|dS)N build_ext)rZhas_ext_modulesr(rr$r))rr0rrrr us  z$sdist_add_defaults._add_defaults_extcCs(|jr$|d}|j|dS)N build_clib)rZhas_c_librariesr(rr$r))rr1rrrr zs  z'sdist_add_defaults._add_defaults_c_libscCs(|jr$|d}|j|dS)N build_scripts)rZ has_scriptsr(rr$r))rr2rrrr s  z(sdist_add_defaults._add_defaults_scriptsN)__name__ __module__ __qualname____doc__r staticmethodrrrr r r r r rrrrr s rrc@s eZdZdS)rN)r3r4r5rrrrrs) rrZdistutils.utilrZdistutils.commandrZsetuptools.extern.six.movesrrhasattrrrrrs    | PK!k+command/__pycache__/__init__.cpython-38.pycnu[U QabR@szdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrrdejd<ejd[[dS)alias bdist_eggZ bdist_rpmZ build_extZbuild_pyZdevelopZ easy_installZegg_infoZinstallZ install_librotateZsaveoptsZsdistZsetoptZtestZinstall_egg_infoinstall_scriptsregisterZ bdist_wininstZ upload_docsZuploadZ build_clibZ dist_info)bdistN)rZegg)rzPython .egg file) __all__Zdistutils.command.bdistrsysZsetuptools.commandrZformat_commandsZformat_commandappendr r ?/usr/lib/python3.8/site-packages/setuptools/command/__init__.pys<     PK!Th!!-command/__pycache__/test.cpython-38.opt-1.pycnu[U Qab%@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd d lmZeZ Gd d d e Z!Gd ddZ"GdddeZ#dS)N)DistutilsErrorDistutilsOptionError)log) TestLoader)six)mapfilter) resource_listdirresource_existsnormalize_path working_set_namespace_packagesevaluate_markeradd_activation_listenerrequire EntryPoint)Command)_unique_everseenc@seZdZddZdddZdS)ScanningLoadercCst|t|_dSN)r__init__set_visitedselfr;/usr/lib/python3.8/site-packages/setuptools/command/test.pyrs zScanningLoader.__init__NcCs||jkrdS|j|g}|t||t|drH||t|drt|jdD]`}| dr|dkr|jd|dd}n"t |j|d r^|jd|}nq^|| |q^t |d kr| |S|d SdS) aReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. Nadditional_tests__path__z.pyz __init__.py.z /__init__.pyrr)raddappendrloadTestsFromModulehasattrrr __name__endswithr ZloadTestsFromNamelenZ suiteClass)rmodulepatternZtestsfileZ submodulerrrr%s$      z"ScanningLoader.loadTestsFromModule)N)r' __module__ __qualname__rr%rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs ||_dSrfget)rr1rrrrAszNonDataProperty.__init__NcCs|dkr |S||Srr0)robjZobjtyperrr__get__DszNonDataProperty.__get__)N)r'r-r.rr3rrrrr/@sr/c@seZdZdZdZdddgZddZdd Zed d Z d d Z ddZ e j gfddZee j ddZeddZddZddZeddZeddZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated))z test-module=mz$Run 'test_suite' in specified module)z test-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))z test-runner=rzTest runner to usecCsd|_d|_d|_d|_dSr) test_suite test_module test_loader test_runnerrrrrinitialize_optionsVsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n |jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz .test_suiter:z&setuptools.command.test:ScanningLoaderr;)r8r9r distributionr:getattrr;)rmsgrrrfinalize_options\s        ztest.finalize_optionscCs t|Sr)list _test_argsrrrr test_argsosztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)Zdiscoverz --verbose)r8sys version_infoverboserrrrrBss ztest._test_argsc Cs| |W5QRXdS)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncrrrwith_project_on_sys_path{s ztest.with_project_on_sys_pathc csPtjot|jdd}|rv|jddd|d|d}t|j}|jd|d|d|jddd|dn"|d|jdd d|d|d}t j dd}t j }zbt|j}t j d|ttd d td |j|jf||g dVW5QRXW5|t j dd<t j t j |tXdS) Nuse_2to3Fbuild_pyr)ZinplaceZegg_info)egg_baseZ build_extrcSs|Sr)Zactivate)distrrrz*test.project_on_sys_path..z%s==%s)rPY3r>r=Zreinitialize_commandZ run_commandZget_finalized_commandr Z build_librFpathmodulescopyclearupdater rrNinsertrrZegg_nameZ egg_versionpaths_on_pythonpath) rZ include_distsZ with_2to3Zbpy_cmdZ build_pathZei_cmdZold_pathZ old_modulesZ project_pathrrrrIs8             ztest.project_on_sys_pathc cst}tjd|}tjdd}zBtjt|}td||g}tj|}|r\|tjd<dVW5||kr~tjddn |tjd<XdS)z Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. Z PYTHONPATHr N) objectosenvirongetpoppathsepjoinrr)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrYs    ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css0|](\}}|drt|ddr|VqdS):rN) startswithr).0kvrrr s z%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ tests_requireZextras_requireitems itertoolschain)rOZir_dZtr_dZer_drrr install_distss   ztest.install_distsc Cs|dtj||j}d|j}|jr>|d|dS|d|tt d|}| |"| | W5QRXW5QRXdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)z running "%s"location)announcerZWARNrmr=r`_argvZdry_runroperator attrgetterrYrI run_tests)rZinstalled_distscmdrarrrruns    ztest.runcCstjr~t|jddr~|jdd}|tkr~g}|tjkrD| ||d7}tjD]}| |rR| |qRt t tjj |tjdd|j||j||jdd}|jsd|j}||tjt|dS)NrLFr!r)Z testLoaderZ testRunnerexitzTest failed: %s)rrRr>r=r8splitr rFrTr$rerAr __delitem__unittestmainrq_resolve_as_epr:r;resultZ wasSuccessfulrprZERRORr)rr*Z del_modulesnamer4r?rrrrts.         ztest.run_testscCs dg|jS)Nrz)rCrrrrrq sz test._argvcCs$|dkr dStd|}|S)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. Nzx=)rparseZresolve)valZparsedrrrr|sztest._resolve_as_epN)r'r-r.__doc__ descriptionZ user_optionsr<r@r/rCrBrK contextlibcontextmanagerrI staticmethodrYrmrvrtpropertyrqr|rrrrr4Js2 -   r4)$r[rrrFrrkrzZdistutils.errorsrrZ distutilsrrZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesr r r r r rrrrZ setuptoolsrrMrtypeZ __metaclass__rr/r4rrrrs"   ,  ) PK!])Bttcommand/launcher manifest.xmlnu[ PK!ݖς%%command/test.pynu[import os import operator import sys import contextlib import itertools import unittest from distutils.errors import DistutilsError, DistutilsOptionError from distutils import log from unittest import TestLoader from setuptools.extern import six from setuptools.extern.six.moves import map, filter from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, evaluate_marker, add_activation_listener, require, EntryPoint) from setuptools import Command from .build_py import _unique_everseen __metaclass__ = type class ScanningLoader(TestLoader): def __init__(self): TestLoader.__init__(self) self._visited = set() def loadTestsFromModule(self, module, pattern=None): """Return a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. """ if module in self._visited: return None self._visited.add(module) tests = [] tests.append(TestLoader.loadTestsFromModule(self, module)) if hasattr(module, "additional_tests"): tests.append(module.additional_tests()) if hasattr(module, '__path__'): for file in resource_listdir(module.__name__, ''): if file.endswith('.py') and file != '__init__.py': submodule = module.__name__ + '.' + file[:-3] else: if resource_exists(module.__name__, file + '/__init__.py'): submodule = module.__name__ + '.' + file else: continue tests.append(self.loadTestsFromName(submodule)) if len(tests) != 1: return self.suiteClass(tests) else: return tests[0] # don't create a nested suite for only one return # adapted from jaraco.classes.properties:NonDataProperty class NonDataProperty: def __init__(self, fget): self.fget = fget def __get__(self, obj, objtype=None): if obj is None: return self return self.fget(obj) class test(Command): """Command to run unit tests after in-place build""" description = "run unit tests after in-place build (deprecated)" user_options = [ ('test-module=', 'm', "Run 'test_suite' in specified module"), ('test-suite=', 's', "Run single test, case or suite (e.g. 'module.test_suite')"), ('test-runner=', 'r', "Test runner to use"), ] def initialize_options(self): self.test_suite = None self.test_module = None self.test_loader = None self.test_runner = None def finalize_options(self): if self.test_suite and self.test_module: msg = "You may specify a module or a suite, but not both" raise DistutilsOptionError(msg) if self.test_suite is None: if self.test_module is None: self.test_suite = self.distribution.test_suite else: self.test_suite = self.test_module + ".test_suite" if self.test_loader is None: self.test_loader = getattr(self.distribution, 'test_loader', None) if self.test_loader is None: self.test_loader = "setuptools.command.test:ScanningLoader" if self.test_runner is None: self.test_runner = getattr(self.distribution, 'test_runner', None) @NonDataProperty def test_args(self): return list(self._test_args()) def _test_args(self): if not self.test_suite and sys.version_info >= (2, 7): yield 'discover' if self.verbose: yield '--verbose' if self.test_suite: yield self.test_suite def with_project_on_sys_path(self, func): """ Backward compatibility for project_on_sys_path context. """ with self.project_on_sys_path(): func() @contextlib.contextmanager def project_on_sys_path(self, include_dists=[]): with_2to3 = six.PY3 and getattr(self.distribution, 'use_2to3', False) if with_2to3: # If we run 2to3 we can not do this inplace: # Ensure metadata is up-to-date self.reinitialize_command('build_py', inplace=0) self.run_command('build_py') bpy_cmd = self.get_finalized_command("build_py") build_path = normalize_path(bpy_cmd.build_lib) # Build extensions self.reinitialize_command('egg_info', egg_base=build_path) self.run_command('egg_info') self.reinitialize_command('build_ext', inplace=0) self.run_command('build_ext') else: # Without 2to3 inplace works fine: self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') ei_cmd = self.get_finalized_command("egg_info") old_path = sys.path[:] old_modules = sys.modules.copy() try: project_path = normalize_path(ei_cmd.egg_base) sys.path.insert(0, project_path) working_set.__init__() add_activation_listener(lambda dist: dist.activate()) require('%s==%s' % (ei_cmd.egg_name, ei_cmd.egg_version)) with self.paths_on_pythonpath([project_path]): yield finally: sys.path[:] = old_path sys.modules.clear() sys.modules.update(old_modules) working_set.__init__() @staticmethod @contextlib.contextmanager def paths_on_pythonpath(paths): """ Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. """ nothing = object() orig_pythonpath = os.environ.get('PYTHONPATH', nothing) current_pythonpath = os.environ.get('PYTHONPATH', '') try: prefix = os.pathsep.join(_unique_everseen(paths)) to_join = filter(None, [prefix, current_pythonpath]) new_path = os.pathsep.join(to_join) if new_path: os.environ['PYTHONPATH'] = new_path yield finally: if orig_pythonpath is nothing: os.environ.pop('PYTHONPATH', None) else: os.environ['PYTHONPATH'] = orig_pythonpath @staticmethod def install_dists(dist): """ Install the requirements indicated by self.distribution and return an iterable of the dists that were built. """ ir_d = dist.fetch_build_eggs(dist.install_requires) tr_d = dist.fetch_build_eggs(dist.tests_require or []) er_d = dist.fetch_build_eggs( v for k, v in dist.extras_require.items() if k.startswith(':') and evaluate_marker(k[1:]) ) return itertools.chain(ir_d, tr_d, er_d) def run(self): self.announce( "WARNING: Testing via this command is deprecated and will be " "removed in a future version. Users looking for a generic test " "entry point independent of test runner are encouraged to use " "tox.", log.WARN, ) installed_dists = self.install_dists(self.distribution) cmd = ' '.join(self._argv) if self.dry_run: self.announce('skipping "%s" (dry run)' % cmd) return self.announce('running "%s"' % cmd) paths = map(operator.attrgetter('location'), installed_dists) with self.paths_on_pythonpath(paths): with self.project_on_sys_path(): self.run_tests() def run_tests(self): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. if six.PY3 and getattr(self.distribution, 'use_2to3', False): module = self.test_suite.split('.')[0] if module in _namespace_packages: del_modules = [] if module in sys.modules: del_modules.append(module) module += '.' for name in sys.modules: if name.startswith(module): del_modules.append(name) list(map(sys.modules.__delitem__, del_modules)) test = unittest.main( None, None, self._argv, testLoader=self._resolve_as_ep(self.test_loader), testRunner=self._resolve_as_ep(self.test_runner), exit=False, ) if not test.result.wasSuccessful(): msg = 'Test failed: %s' % test.result self.announce(msg, log.ERROR) raise DistutilsError(msg) @property def _argv(self): return ['unittest'] + self.test_args @staticmethod def _resolve_as_ep(val): """ Load the indicated attribute value, called, as a as if it were specified as an entry point. """ if val is None: return parsed = EntryPoint.parse("x=" + val) return parsed.resolve()() PK!=command/develop.pynu[from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os import glob import io from setuptools.extern import six import pkg_resources from setuptools.command.easy_install import easy_install from setuptools import namespaces import setuptools __metaclass__ = type class develop(namespaces.DevelopInstaller, easy_install): """Set up package for development""" description = "install package in 'development mode'" user_options = easy_install.user_options + [ ("uninstall", "u", "Uninstall this source package"), ("egg-path=", None, "Set the path to be used in the .egg-link file"), ] boolean_options = easy_install.boolean_options + ['uninstall'] command_consumes_arguments = False # override base def run(self): if self.uninstall: self.multi_version = True self.uninstall_link() self.uninstall_namespaces() else: self.install_for_development() self.warn_deprecated_options() def initialize_options(self): self.uninstall = None self.egg_path = None easy_install.initialize_options(self) self.setup_path = None self.always_copy_from = '.' # always copy eggs installed in curdir def finalize_options(self): ei = self.get_finalized_command("egg_info") if ei.broken_egg_info: template = "Please rename %r to %r before using 'develop'" args = ei.egg_info, ei.broken_egg_info raise DistutilsError(template % args) self.args = [ei.egg_name] easy_install.finalize_options(self) self.expand_basedirs() self.expand_dirs() # pick up setup-dir .egg files only: no .egg-info self.package_index.scan(glob.glob('*.egg')) egg_link_fn = ei.egg_name + '.egg-link' self.egg_link = os.path.join(self.install_dir, egg_link_fn) self.egg_base = ei.egg_base if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) target = pkg_resources.normalize_path(self.egg_base) egg_path = pkg_resources.normalize_path( os.path.join(self.install_dir, self.egg_path)) if egg_path != target: raise DistutilsOptionError( "--egg-path must be a relative path from the install" " directory to " + target ) # Make a distribution for the package's source self.dist = pkg_resources.Distribution( target, pkg_resources.PathMetadata(target, os.path.abspath(ei.egg_info)), project_name=ei.egg_name ) self.setup_path = self._resolve_setup_path( self.egg_base, self.install_dir, self.egg_path, ) @staticmethod def _resolve_setup_path(egg_base, install_dir, egg_path): """ Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. """ path_to_setup = egg_base.replace(os.sep, '/').rstrip('/') if path_to_setup != os.curdir: path_to_setup = '../' * (path_to_setup.count('/') + 1) resolved = pkg_resources.normalize_path( os.path.join(install_dir, egg_path, path_to_setup) ) if resolved != pkg_resources.normalize_path(os.curdir): raise DistutilsOptionError( "Can't get a consistent path to setup script from" " installation directory", resolved, pkg_resources.normalize_path(os.curdir)) return path_to_setup def install_for_development(self): if six.PY3 and getattr(self.distribution, 'use_2to3', False): # If we run 2to3 we can not do this inplace: # Ensure metadata is up-to-date self.reinitialize_command('build_py', inplace=0) self.run_command('build_py') bpy_cmd = self.get_finalized_command("build_py") build_path = pkg_resources.normalize_path(bpy_cmd.build_lib) # Build extensions self.reinitialize_command('egg_info', egg_base=build_path) self.run_command('egg_info') self.reinitialize_command('build_ext', inplace=0) self.run_command('build_ext') # Fixup egg-link and easy-install.pth ei_cmd = self.get_finalized_command("egg_info") self.egg_path = build_path self.dist.location = build_path # XXX self.dist._provider = pkg_resources.PathMetadata( build_path, ei_cmd.egg_info) else: # Without 2to3 inplace works fine: self.run_command('egg_info') # Build extensions in-place self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') self.install_site_py() # ensure that target dir is site-safe if setuptools.bootstrap_install_from: self.easy_install(setuptools.bootstrap_install_from) setuptools.bootstrap_install_from = None self.install_namespaces() # create an .egg-link in the installation dir, pointing to our egg log.info("Creating %s (link to %s)", self.egg_link, self.egg_base) if not self.dry_run: with open(self.egg_link, "w") as f: f.write(self.egg_path + "\n" + self.setup_path) # postprocess the installed distro, fixing up .pth, installing scripts, # and handling requirements self.process_distribution(None, self.dist, not self.no_deps) def uninstall_link(self): if os.path.exists(self.egg_link): log.info("Removing %s (link to %s)", self.egg_link, self.egg_base) egg_link_file = open(self.egg_link) contents = [line.rstrip() for line in egg_link_file] egg_link_file.close() if contents not in ([self.egg_path], [self.egg_path, self.setup_path]): log.warn("Link points to %s: uninstall aborted", contents) return if not self.dry_run: os.unlink(self.egg_link) if not self.dry_run: self.update_pth(self.dist) # remove any .pth link to us if self.distribution.scripts: # XXX should also check for entry point scripts! log.warn("Note: you must uninstall or replace scripts manually!") def install_egg_scripts(self, dist): if dist is not self.dist: # Installing a dependency, so fall back to normal behavior return easy_install.install_egg_scripts(self, dist) # create wrapper scripts in the script dir, pointing to dist.scripts # new-style... self.install_wrapper_scripts(dist) # ...and old-style for script_name in self.distribution.scripts or []: script_path = os.path.abspath(convert_path(script_name)) script_name = os.path.basename(script_path) with io.open(script_path) as strm: script_text = strm.read() self.install_script(dist, script_name, script_text, script_path) def install_wrapper_scripts(self, dist): dist = VersionlessRequirement(dist) return easy_install.install_wrapper_scripts(self, dist) class VersionlessRequirement: """ Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' """ def __init__(self, dist): self.__dist = dist def __getattr__(self, name): return getattr(self.__dist, name) def as_requirement(self): return self.project_name PK!/ 1: raise DistutilsError( "Multiple setup scripts in %s" % os.path.abspath(dist_filename) ) setup_script = setups[0] # Now run it, and return the result if self.editable: log.info(self.report_editable(spec, setup_script)) return [] else: return self.build_and_install(setup_script, setup_base) def egg_distribution(self, egg_path): if os.path.isdir(egg_path): metadata = PathMetadata(egg_path, os.path.join(egg_path, 'EGG-INFO')) else: metadata = EggMetadata(zipimport.zipimporter(egg_path)) return Distribution.from_filename(egg_path, metadata=metadata) def install_egg(self, egg_path, tmpdir): destination = os.path.join( self.install_dir, os.path.basename(egg_path), ) destination = os.path.abspath(destination) if not self.dry_run: ensure_directory(destination) dist = self.egg_distribution(egg_path) if not samefile(egg_path, destination): if os.path.isdir(destination) and not os.path.islink(destination): dir_util.remove_tree(destination, dry_run=self.dry_run) elif os.path.exists(destination): self.execute( os.unlink, (destination,), "Removing " + destination, ) try: new_dist_is_zipped = False if os.path.isdir(egg_path): if egg_path.startswith(tmpdir): f, m = shutil.move, "Moving" else: f, m = shutil.copytree, "Copying" elif self.should_unzip(dist): self.mkpath(destination) f, m = self.unpack_and_compile, "Extracting" else: new_dist_is_zipped = True if egg_path.startswith(tmpdir): f, m = shutil.move, "Moving" else: f, m = shutil.copy2, "Copying" self.execute( f, (egg_path, destination), (m + " %s to %s") % ( os.path.basename(egg_path), os.path.dirname(destination) ), ) update_dist_caches( destination, fix_zipimporter_caches=new_dist_is_zipped, ) except Exception: update_dist_caches(destination, fix_zipimporter_caches=False) raise self.add_output(destination) return self.egg_distribution(destination) def install_exe(self, dist_filename, tmpdir): # See if it's valid, get data cfg = extract_wininst_cfg(dist_filename) if cfg is None: raise DistutilsError( "%s is not a valid distutils Windows .exe" % dist_filename ) # Create a dummy distribution object until we build the real distro dist = Distribution( None, project_name=cfg.get('metadata', 'name'), version=cfg.get('metadata', 'version'), platform=get_platform(), ) # Convert the .exe to an unpacked egg egg_path = os.path.join(tmpdir, dist.egg_name() + '.egg') dist.location = egg_path egg_tmp = egg_path + '.tmp' _egg_info = os.path.join(egg_tmp, 'EGG-INFO') pkg_inf = os.path.join(_egg_info, 'PKG-INFO') ensure_directory(pkg_inf) # make sure EGG-INFO dir exists dist._provider = PathMetadata(egg_tmp, _egg_info) # XXX self.exe_to_egg(dist_filename, egg_tmp) # Write EGG-INFO/PKG-INFO if not os.path.exists(pkg_inf): f = open(pkg_inf, 'w') f.write('Metadata-Version: 1.0\n') for k, v in cfg.items('metadata'): if k != 'target_version': f.write('%s: %s\n' % (k.replace('_', '-').title(), v)) f.close() script_dir = os.path.join(_egg_info, 'scripts') # delete entry-point scripts to avoid duping self.delete_blockers([ os.path.join(script_dir, args[0]) for args in ScriptWriter.get_args(dist) ]) # Build .egg file from tmpdir bdist_egg.make_zipfile( egg_path, egg_tmp, verbose=self.verbose, dry_run=self.dry_run, ) # install the .egg return self.install_egg(egg_path, tmpdir) def exe_to_egg(self, dist_filename, egg_tmp): """Extract a bdist_wininst to the directories an egg would use""" # Check for .pth file and set up prefix translations prefixes = get_exe_prefixes(dist_filename) to_compile = [] native_libs = [] top_level = {} def process(src, dst): s = src.lower() for old, new in prefixes: if s.startswith(old): src = new + src[len(old):] parts = src.split('/') dst = os.path.join(egg_tmp, *parts) dl = dst.lower() if dl.endswith('.pyd') or dl.endswith('.dll'): parts[-1] = bdist_egg.strip_module(parts[-1]) top_level[os.path.splitext(parts[0])[0]] = 1 native_libs.append(src) elif dl.endswith('.py') and old != 'SCRIPTS/': top_level[os.path.splitext(parts[0])[0]] = 1 to_compile.append(dst) return dst if not src.endswith('.pth'): log.warn("WARNING: can't process %s", src) return None # extract, tracking .pyd/.dll->native_libs and .py -> to_compile unpack_archive(dist_filename, egg_tmp, process) stubs = [] for res in native_libs: if res.lower().endswith('.pyd'): # create stubs for .pyd's parts = res.split('/') resource = parts[-1] parts[-1] = bdist_egg.strip_module(parts[-1]) + '.py' pyfile = os.path.join(egg_tmp, *parts) to_compile.append(pyfile) stubs.append(pyfile) bdist_egg.write_stub(resource, pyfile) self.byte_compile(to_compile) # compile .py's bdist_egg.write_safety_flag( os.path.join(egg_tmp, 'EGG-INFO'), bdist_egg.analyze_egg(egg_tmp, stubs)) # write zip-safety flag for name in 'top_level', 'native_libs': if locals()[name]: txt = os.path.join(egg_tmp, 'EGG-INFO', name + '.txt') if not os.path.exists(txt): f = open(txt, 'w') f.write('\n'.join(locals()[name]) + '\n') f.close() def install_wheel(self, wheel_path, tmpdir): wheel = Wheel(wheel_path) assert wheel.is_compatible() destination = os.path.join(self.install_dir, wheel.egg_name()) destination = os.path.abspath(destination) if not self.dry_run: ensure_directory(destination) if os.path.isdir(destination) and not os.path.islink(destination): dir_util.remove_tree(destination, dry_run=self.dry_run) elif os.path.exists(destination): self.execute( os.unlink, (destination,), "Removing " + destination, ) try: self.execute( wheel.install_as_egg, (destination,), ("Installing %s to %s") % ( os.path.basename(wheel_path), os.path.dirname(destination) ), ) finally: update_dist_caches(destination, fix_zipimporter_caches=False) self.add_output(destination) return self.egg_distribution(destination) __mv_warning = textwrap.dedent(""" Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher """).lstrip() __id_warning = textwrap.dedent(""" Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) """) def installation_report(self, req, dist, what="Installed"): """Helpful installation message for display to package users""" msg = "\n%(what)s %(eggloc)s%(extras)s" if self.multi_version and not self.no_report: msg += '\n' + self.__mv_warning if self.install_dir not in map(normalize_path, sys.path): msg += '\n' + self.__id_warning eggloc = dist.location name = dist.project_name version = dist.version extras = '' # TODO: self.report_extras(req, dist) return msg % locals() __editable_msg = textwrap.dedent(""" Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. """).lstrip() def report_editable(self, spec, setup_script): dirname = os.path.dirname(setup_script) python = sys.executable return '\n' + self.__editable_msg % locals() def run_setup(self, setup_script, setup_base, args): sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg) sys.modules.setdefault('distutils.command.egg_info', egg_info) args = list(args) if self.verbose > 2: v = 'v' * (self.verbose - 1) args.insert(0, '-' + v) elif self.verbose < 2: args.insert(0, '-q') if self.dry_run: args.insert(0, '-n') log.info( "Running %s %s", setup_script[len(setup_base) + 1:], ' '.join(args) ) try: run_setup(setup_script, args) except SystemExit as v: raise DistutilsError("Setup script exited with %s" % (v.args[0],)) def build_and_install(self, setup_script, setup_base): args = ['bdist_egg', '--dist-dir'] dist_dir = tempfile.mkdtemp( prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script) ) try: self._set_fetcher_options(os.path.dirname(setup_script)) args.append(dist_dir) self.run_setup(setup_script, setup_base, args) all_eggs = Environment([dist_dir]) eggs = [] for key in all_eggs: for dist in all_eggs[key]: eggs.append(self.install_egg(dist.location, setup_base)) if not eggs and not self.dry_run: log.warn("No eggs found in %s (setup script problem?)", dist_dir) return eggs finally: rmtree(dist_dir) log.set_verbosity(self.verbose) # restore our log verbosity def _set_fetcher_options(self, base): """ When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. """ # find the fetch options from easy_install and write them out # to the setup.cfg file. ei_opts = self.distribution.get_option_dict('easy_install').copy() fetch_directives = ( 'find_links', 'site_dirs', 'index_url', 'optimize', 'allow_hosts', ) fetch_options = {} for key, val in ei_opts.items(): if key not in fetch_directives: continue fetch_options[key.replace('_', '-')] = val[1] # create a settings dictionary suitable for `edit_config` settings = dict(easy_install=fetch_options) cfg_filename = os.path.join(base, 'setup.cfg') setopt.edit_config(cfg_filename, settings) def update_pth(self, dist): if self.pth_file is None: return for d in self.pth_file[dist.key]: # drop old entries if self.multi_version or d.location != dist.location: log.info("Removing %s from easy-install.pth file", d) self.pth_file.remove(d) if d.location in self.shadow_path: self.shadow_path.remove(d.location) if not self.multi_version: if dist.location in self.pth_file.paths: log.info( "%s is already the active version in easy-install.pth", dist, ) else: log.info("Adding %s to easy-install.pth file", dist) self.pth_file.add(dist) # add new entry if dist.location not in self.shadow_path: self.shadow_path.append(dist.location) if not self.dry_run: self.pth_file.save() if dist.key == 'setuptools': # Ensure that setuptools itself never becomes unavailable! # XXX should this check for latest version? filename = os.path.join(self.install_dir, 'setuptools.pth') if os.path.islink(filename): os.unlink(filename) f = open(filename, 'wt') f.write(self.pth_file.make_relative(dist.location) + '\n') f.close() def unpack_progress(self, src, dst): # Progress filter for unpacking log.debug("Unpacking %s to %s", src, dst) return dst # only unpack-and-compile skips files for dry run def unpack_and_compile(self, egg_path, destination): to_compile = [] to_chmod = [] def pf(src, dst): if dst.endswith('.py') and not src.startswith('EGG-INFO/'): to_compile.append(dst) elif dst.endswith('.dll') or dst.endswith('.so'): to_chmod.append(dst) self.unpack_progress(src, dst) return not self.dry_run and dst or None unpack_archive(egg_path, destination, pf) self.byte_compile(to_compile) if not self.dry_run: for f in to_chmod: mode = ((os.stat(f)[stat.ST_MODE]) | 0o555) & 0o7755 chmod(f, mode) def byte_compile(self, to_compile): if sys.dont_write_bytecode: return from distutils.util import byte_compile try: # try to make the byte compile messages quieter log.set_verbosity(self.verbose - 1) byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run) if self.optimize: byte_compile( to_compile, optimize=self.optimize, force=1, dry_run=self.dry_run, ) finally: log.set_verbosity(self.verbose) # restore original verbosity __no_default_msg = textwrap.dedent(""" bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.""").lstrip() def no_default_version_msg(self): template = self.__no_default_msg return template % (self.install_dir, os.environ.get('PYTHONPATH', '')) def install_site_py(self): """Make sure there's a site.py in the target dir, if needed""" if self.sitepy_installed: return # already did it, or don't need to sitepy = os.path.join(self.install_dir, "site.py") source = resource_string("setuptools", "site-patch.py") source = source.decode('utf-8') current = "" if os.path.exists(sitepy): log.debug("Checking existing site.py in %s", self.install_dir) with io.open(sitepy) as strm: current = strm.read() if not current.startswith('def __boot():'): raise DistutilsError( "%s is not a setuptools-generated site.py; please" " remove it." % sitepy ) if current != source: log.info("Creating %s", sitepy) if not self.dry_run: ensure_directory(sitepy) with io.open(sitepy, 'w', encoding='utf-8') as strm: strm.write(source) self.byte_compile([sitepy]) self.sitepy_installed = True def create_home_path(self): """Create directories under ~.""" if not self.user: return home = convert_path(os.path.expanduser("~")) for name, path in six.iteritems(self.config_vars): if path.startswith(home) and not os.path.isdir(path): self.debug_print("os.makedirs('%s', 0o700)" % path) os.makedirs(path, 0o700) INSTALL_SCHEMES = dict( posix=dict( install_dir='$base/lib/python$py_version_short/site-packages', script_dir='$base/bin', ), ) DEFAULT_SCHEME = dict( install_dir='$base/Lib/site-packages', script_dir='$base/Scripts', ) def _expand(self, *attrs): config_vars = self.get_finalized_command('install').config_vars if self.prefix: # Set default install_dir/scripts from --prefix config_vars = config_vars.copy() config_vars['base'] = self.prefix scheme = self.INSTALL_SCHEMES.get(os.name, self.DEFAULT_SCHEME) for attr, val in scheme.items(): if getattr(self, attr, None) is None: setattr(self, attr, val) from distutils.util import subst_vars for attr in attrs: val = getattr(self, attr) if val is not None: val = subst_vars(val, config_vars) if os.name == 'posix': val = os.path.expanduser(val) setattr(self, attr, val) def _pythonpath(): items = os.environ.get('PYTHONPATH', '').split(os.pathsep) return filter(None, items) def get_site_dirs(): """ Return a list of 'site' dirs """ sitedirs = [] # start with PYTHONPATH sitedirs.extend(_pythonpath()) prefixes = [sys.prefix] if sys.exec_prefix != sys.prefix: prefixes.append(sys.exec_prefix) for prefix in prefixes: if prefix: if sys.platform in ('os2emx', 'riscos'): sitedirs.append(os.path.join(prefix, "Lib", "site-packages")) elif os.sep == '/': sitedirs.extend([ os.path.join( prefix, "lib", "python{}.{}".format(*sys.version_info), "site-packages", ), os.path.join(prefix, "lib", "site-python"), ]) else: sitedirs.extend([ prefix, os.path.join(prefix, "lib", "site-packages"), ]) if sys.platform == 'darwin': # for framework builds *only* we add the standard Apple # locations. Currently only per-user, but /Library and # /Network/Library could be added too if 'Python.framework' in prefix: home = os.environ.get('HOME') if home: home_sp = os.path.join( home, 'Library', 'Python', '{}.{}'.format(*sys.version_info), 'site-packages', ) sitedirs.append(home_sp) lib_paths = get_path('purelib'), get_path('platlib') for site_lib in lib_paths: if site_lib not in sitedirs: sitedirs.append(site_lib) if site.ENABLE_USER_SITE: sitedirs.append(site.USER_SITE) try: sitedirs.extend(site.getsitepackages()) except AttributeError: pass sitedirs = list(map(normalize_path, sitedirs)) return sitedirs def expand_paths(inputs): """Yield sys.path directories that might contain "old-style" packages""" seen = {} for dirname in inputs: dirname = normalize_path(dirname) if dirname in seen: continue seen[dirname] = 1 if not os.path.isdir(dirname): continue files = os.listdir(dirname) yield dirname, files for name in files: if not name.endswith('.pth'): # We only care about the .pth files continue if name in ('easy-install.pth', 'setuptools.pth'): # Ignore .pth files that we control continue # Read the .pth file f = open(os.path.join(dirname, name)) lines = list(yield_lines(f)) f.close() # Yield existing non-dupe, non-import directory lines from it for line in lines: if not line.startswith("import"): line = normalize_path(line.rstrip()) if line not in seen: seen[line] = 1 if not os.path.isdir(line): continue yield line, os.listdir(line) def extract_wininst_cfg(dist_filename): """Extract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None """ f = open(dist_filename, 'rb') try: endrec = zipfile._EndRecData(f) if endrec is None: return None prepended = (endrec[9] - endrec[5]) - endrec[6] if prepended < 12: # no wininst data here return None f.seek(prepended - 12) tag, cfglen, bmlen = struct.unpack("egg path translations for a given .exe file""" prefixes = [ ('PURELIB/', ''), ('PLATLIB/pywin32_system32', ''), ('PLATLIB/', ''), ('SCRIPTS/', 'EGG-INFO/scripts/'), ('DATA/lib/site-packages', ''), ] z = zipfile.ZipFile(exe_filename) try: for info in z.infolist(): name = info.filename parts = name.split('/') if len(parts) == 3 and parts[2] == 'PKG-INFO': if parts[1].endswith('.egg-info'): prefixes.insert(0, ('/'.join(parts[:2]), 'EGG-INFO/')) break if len(parts) != 2 or not name.endswith('.pth'): continue if name.endswith('-nspkg.pth'): continue if parts[0].upper() in ('PURELIB', 'PLATLIB'): contents = z.read(name) if six.PY3: contents = contents.decode() for pth in yield_lines(contents): pth = pth.strip().replace('\\', '/') if not pth.startswith('import'): prefixes.append((('%s/%s/' % (parts[0], pth)), '')) finally: z.close() prefixes = [(x.lower(), y) for x, y in prefixes] prefixes.sort() prefixes.reverse() return prefixes class PthDistributions(Environment): """A .pth file with Distribution paths in it""" dirty = False def __init__(self, filename, sitedirs=()): self.filename = filename self.sitedirs = list(map(normalize_path, sitedirs)) self.basedir = normalize_path(os.path.dirname(self.filename)) self._load() Environment.__init__(self, [], None, None) for path in yield_lines(self.paths): list(map(self.add, find_distributions(path, True))) def _load(self): self.paths = [] saw_import = False seen = dict.fromkeys(self.sitedirs) if os.path.isfile(self.filename): f = open(self.filename, 'rt') for line in f: if line.startswith('import'): saw_import = True continue path = line.rstrip() self.paths.append(path) if not path.strip() or path.strip().startswith('#'): continue # skip non-existent paths, in case somebody deleted a package # manually, and duplicate paths as well path = self.paths[-1] = normalize_path( os.path.join(self.basedir, path) ) if not os.path.exists(path) or path in seen: self.paths.pop() # skip it self.dirty = True # we cleaned up, so we're dirty now :) continue seen[path] = 1 f.close() if self.paths and not saw_import: self.dirty = True # ensure anything we touch has import wrappers while self.paths and not self.paths[-1].strip(): self.paths.pop() def save(self): """Write changed .pth file back to disk""" if not self.dirty: return rel_paths = list(map(self.make_relative, self.paths)) if rel_paths: log.debug("Saving %s", self.filename) lines = self._wrap_lines(rel_paths) data = '\n'.join(lines) + '\n' if os.path.islink(self.filename): os.unlink(self.filename) with open(self.filename, 'wt') as f: f.write(data) elif os.path.exists(self.filename): log.debug("Deleting empty %s", self.filename) os.unlink(self.filename) self.dirty = False @staticmethod def _wrap_lines(lines): return lines def add(self, dist): """Add `dist` to the distribution map""" new_path = ( dist.location not in self.paths and ( dist.location not in self.sitedirs or # account for '.' being in PYTHONPATH dist.location == os.getcwd() ) ) if new_path: self.paths.append(dist.location) self.dirty = True Environment.add(self, dist) def remove(self, dist): """Remove `dist` from the distribution map""" while dist.location in self.paths: self.paths.remove(dist.location) self.dirty = True Environment.remove(self, dist) def make_relative(self, path): npath, last = os.path.split(normalize_path(path)) baselen = len(self.basedir) parts = [last] sep = os.altsep == '/' and '/' or os.sep while len(npath) >= baselen: if npath == self.basedir: parts.append(os.curdir) parts.reverse() return sep.join(parts) npath, last = os.path.split(npath) parts.append(last) else: return path class RewritePthDistributions(PthDistributions): @classmethod def _wrap_lines(cls, lines): yield cls.prelude for line in lines: yield line yield cls.postlude prelude = _one_liner(""" import sys sys.__plen = len(sys.path) """) postlude = _one_liner(""" import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) """) if os.environ.get('SETUPTOOLS_SYS_PATH_TECHNIQUE', 'raw') == 'rewrite': PthDistributions = RewritePthDistributions def _first_line_re(): """ Return a regular expression based on first_line_re suitable for matching strings. """ if isinstance(first_line_re.pattern, str): return first_line_re # first_line_re in Python >=3.1.4 and >=3.2.1 is a bytes pattern. return re.compile(first_line_re.pattern.decode()) def auto_chmod(func, arg, exc): if func in [os.unlink, os.remove] and os.name == 'nt': chmod(arg, stat.S_IWRITE) return func(arg) et, ev, _ = sys.exc_info() six.reraise(et, (ev[0], ev[1] + (" %s %s" % (func, arg)))) def update_dist_caches(dist_path, fix_zipimporter_caches): """ Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. """ # There are several other known sources of stale zipimport.zipimporter # instances that we do not clear here, but might if ever given a reason to # do so: # * Global setuptools pkg_resources.working_set (a.k.a. 'master working # set') may contain distributions which may in turn contain their # zipimport.zipimporter loaders. # * Several zipimport.zipimporter loaders held by local variables further # up the function call stack when running the setuptools installation. # * Already loaded modules may have their __loader__ attribute set to the # exact loader instance used when importing them. Python 3.4 docs state # that this information is intended mostly for introspection and so is # not expected to cause us problems. normalized_path = normalize_path(dist_path) _uncache(normalized_path, sys.path_importer_cache) if fix_zipimporter_caches: _replace_zip_directory_cache_data(normalized_path) else: # Here, even though we do not want to fix existing and now stale # zipimporter cache information, we still want to remove it. Related to # Python's zip archive directory information cache, we clear each of # its stale entries in two phases: # 1. Clear the entry so attempting to access zip archive information # via any existing stale zipimport.zipimporter instances fails. # 2. Remove the entry from the cache so any newly constructed # zipimport.zipimporter instances do not end up using old stale # zip archive directory information. # This whole stale data removal step does not seem strictly necessary, # but has been left in because it was done before we started replacing # the zip archive directory information cache content if possible, and # there are no relevant unit tests that we can depend on to tell us if # this is really needed. _remove_and_clear_zip_directory_cache_data(normalized_path) def _collect_zipimporter_cache_entries(normalized_path, cache): """ Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. """ result = [] prefix_len = len(normalized_path) for p in cache: np = normalize_path(p) if (np.startswith(normalized_path) and np[prefix_len:prefix_len + 1] in (os.sep, '')): result.append(p) return result def _update_zipimporter_cache(normalized_path, cache, updater=None): """ Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. """ for p in _collect_zipimporter_cache_entries(normalized_path, cache): # N.B. pypy's custom zipimport._zip_directory_cache implementation does # not support the complete dict interface: # * Does not support item assignment, thus not allowing this function # to be used only for removing existing cache entries. # * Does not support the dict.pop() method, forcing us to use the # get/del patterns instead. For more detailed information see the # following links: # https://github.com/pypa/setuptools/issues/202#issuecomment-202913420 # http://bit.ly/2h9itJX old_entry = cache[p] del cache[p] new_entry = updater and updater(p, old_entry) if new_entry is not None: cache[p] = new_entry def _uncache(normalized_path, cache): _update_zipimporter_cache(normalized_path, cache) def _remove_and_clear_zip_directory_cache_data(normalized_path): def clear_and_remove_cached_zip_archive_directory_data(path, old_entry): old_entry.clear() _update_zipimporter_cache( normalized_path, zipimport._zip_directory_cache, updater=clear_and_remove_cached_zip_archive_directory_data) # PyPy Python implementation does not allow directly writing to the # zipimport._zip_directory_cache and so prevents us from attempting to correct # its content. The best we can do there is clear the problematic cache content # and have PyPy repopulate it as needed. The downside is that if there are any # stale zipimport.zipimporter instances laying around, attempting to use them # will fail due to not having its zip archive directory information available # instead of being automatically corrected to use the new correct zip archive # directory information. if '__pypy__' in sys.builtin_module_names: _replace_zip_directory_cache_data = \ _remove_and_clear_zip_directory_cache_data else: def _replace_zip_directory_cache_data(normalized_path): def replace_cached_zip_archive_directory_data(path, old_entry): # N.B. In theory, we could load the zip directory information just # once for all updated path spellings, and then copy it locally and # update its contained path strings to contain the correct # spelling, but that seems like a way too invasive move (this cache # structure is not officially documented anywhere and could in # theory change with new Python releases) for no significant # benefit. old_entry.clear() zipimport.zipimporter(path) old_entry.update(zipimport._zip_directory_cache[path]) return old_entry _update_zipimporter_cache( normalized_path, zipimport._zip_directory_cache, updater=replace_cached_zip_archive_directory_data) def is_python(text, filename=''): "Is this string a valid Python script?" try: compile(text, filename, 'exec') except (SyntaxError, TypeError): return False else: return True def is_sh(executable): """Determine if the specified executable is a .sh (contains a #! line)""" try: with io.open(executable, encoding='latin-1') as fp: magic = fp.read(2) except (OSError, IOError): return executable return magic == '#!' def nt_quote_arg(arg): """Quote a command line argument according to Windows parsing rules""" return subprocess.list2cmdline([arg]) def is_python_script(script_text, filename): """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. """ if filename.endswith('.py') or filename.endswith('.pyw'): return True # extension says it's Python if is_python(script_text, filename): return True # it's syntactically valid Python if script_text.startswith('#!'): # It begins with a '#!' line, so check if 'python' is in it somewhere return 'python' in script_text.splitlines()[0].lower() return False # Not any Python I can recognize try: from os import chmod as _chmod except ImportError: # Jython compatibility def _chmod(*args): pass def chmod(path, mode): log.debug("changing mode of %s to %o", path, mode) try: _chmod(path, mode) except os.error as e: log.debug("chmod failed: %s", e) class CommandSpec(list): """ A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. """ options = [] split_args = dict() @classmethod def best(cls): """ Choose the best CommandSpec class based on environmental conditions. """ return cls @classmethod def _sys_executable(cls): _default = os.path.normpath(sys.executable) return os.environ.get('__PYVENV_LAUNCHER__', _default) @classmethod def from_param(cls, param): """ Construct a CommandSpec from a parameter to build_scripts, which may be None. """ if isinstance(param, cls): return param if isinstance(param, list): return cls(param) if param is None: return cls.from_environment() # otherwise, assume it's a string. return cls.from_string(param) @classmethod def from_environment(cls): return cls([cls._sys_executable()]) @classmethod def from_string(cls, string): """ Construct a command spec from a simple string representing a command line parseable by shlex.split. """ items = shlex.split(string, **cls.split_args) return cls(items) def install_options(self, script_text): self.options = shlex.split(self._extract_options(script_text)) cmdline = subprocess.list2cmdline(self) if not isascii(cmdline): self.options[:0] = ['-x'] @staticmethod def _extract_options(orig_script): """ Extract any options from the first line of the script. """ first = (orig_script + '\n').splitlines()[0] match = _first_line_re().match(first) options = match.group(1) or '' if match else '' return options.strip() def as_header(self): return self._render(self + list(self.options)) @staticmethod def _strip_quotes(item): _QUOTES = '"\'' for q in _QUOTES: if item.startswith(q) and item.endswith(q): return item[1:-1] return item @staticmethod def _render(items): cmdline = subprocess.list2cmdline( CommandSpec._strip_quotes(item.strip()) for item in items) return '#!' + cmdline + '\n' # For pbr compat; will be removed in a future version. sys_executable = CommandSpec._sys_executable() class WindowsCommandSpec(CommandSpec): split_args = dict(posix=False) class ScriptWriter: """ Encapsulates behavior around writing entry point scripts for console and gui apps. """ template = textwrap.dedent(r""" # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) """).lstrip() command_spec_class = CommandSpec @classmethod def get_script_args(cls, dist, executable=None, wininst=False): # for backward compatibility warnings.warn("Use get_args", EasyInstallDeprecationWarning) writer = (WindowsScriptWriter if wininst else ScriptWriter).best() header = cls.get_script_header("", executable, wininst) return writer.get_args(dist, header) @classmethod def get_script_header(cls, script_text, executable=None, wininst=False): # for backward compatibility warnings.warn("Use get_header", EasyInstallDeprecationWarning, stacklevel=2) if wininst: executable = "python.exe" return cls.get_header(script_text, executable) @classmethod def get_args(cls, dist, header=None): """ Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. """ if header is None: header = cls.get_header() spec = str(dist.as_requirement()) for type_ in 'console', 'gui': group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): cls._ensure_safe_name(name) script_text = cls.template % locals() args = cls._get_script_args(type_, name, header, script_text) for res in args: yield res @staticmethod def _ensure_safe_name(name): """ Prevent paths in *_scripts entry point names. """ has_path_sep = re.search(r'[\\/]', name) if has_path_sep: raise ValueError("Path separators not allowed in script names") @classmethod def get_writer(cls, force_windows): # for backward compatibility warnings.warn("Use best", EasyInstallDeprecationWarning) return WindowsScriptWriter.best() if force_windows else cls.best() @classmethod def best(cls): """ Select the best ScriptWriter for this environment. """ if sys.platform == 'win32' or (os.name == 'java' and os._name == 'nt'): return WindowsScriptWriter.best() else: return cls @classmethod def _get_script_args(cls, type_, name, header, script_text): # Simply write the stub with no extension. yield (name, header + script_text) @classmethod def get_header(cls, script_text="", executable=None): """Create a #! line, getting options (if any) from script_text""" cmd = cls.command_spec_class.best().from_param(executable) cmd.install_options(script_text) return cmd.as_header() class WindowsScriptWriter(ScriptWriter): command_spec_class = WindowsCommandSpec @classmethod def get_writer(cls): # for backward compatibility warnings.warn("Use best", EasyInstallDeprecationWarning) return cls.best() @classmethod def best(cls): """ Select the best ScriptWriter suitable for Windows """ writer_lookup = dict( executable=WindowsExecutableLauncherWriter, natural=cls, ) # for compatibility, use the executable launcher by default launcher = os.environ.get('SETUPTOOLS_LAUNCHER', 'executable') return writer_lookup[launcher] @classmethod def _get_script_args(cls, type_, name, header, script_text): "For Windows, add a .py extension" ext = dict(console='.pya', gui='.pyw')[type_] if ext not in os.environ['PATHEXT'].lower().split(';'): msg = ( "{ext} not listed in PATHEXT; scripts will not be " "recognized as executables." ).format(**locals()) warnings.warn(msg, UserWarning) old = ['.pya', '.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe'] old.remove(ext) header = cls._adjust_header(type_, header) blockers = [name + x for x in old] yield name + ext, header + script_text, 't', blockers @classmethod def _adjust_header(cls, type_, orig_header): """ Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). """ pattern = 'pythonw.exe' repl = 'python.exe' if type_ == 'gui': pattern, repl = repl, pattern pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE) new_header = pattern_ob.sub(string=orig_header, repl=repl) return new_header if cls._use_header(new_header) else orig_header @staticmethod def _use_header(new_header): """ Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. """ clean_header = new_header[2:-1].strip('"') return sys.platform != 'win32' or find_executable(clean_header) class WindowsExecutableLauncherWriter(WindowsScriptWriter): @classmethod def _get_script_args(cls, type_, name, header, script_text): """ For Windows, add a .py extension and an .exe launcher """ if type_ == 'gui': launcher_type = 'gui' ext = '-script.pyw' old = ['.pyw'] else: launcher_type = 'cli' ext = '-script.py' old = ['.py', '.pyc', '.pyo'] hdr = cls._adjust_header(type_, header) blockers = [name + x for x in old] yield (name + ext, hdr + script_text, 't', blockers) yield ( name + '.exe', get_win_launcher(launcher_type), 'b' # write in binary mode ) if not is_64bit(): # install a manifest for the launcher to prevent Windows # from detecting it as an installer (which it will for # launchers like easy_install.exe). Consider only # adding a manifest for launchers detected as installers. # See Distribute #143 for details. m_name = name + '.exe.manifest' yield (m_name, load_launcher_manifest(name), 't') # for backward-compatibility get_script_args = ScriptWriter.get_script_args get_script_header = ScriptWriter.get_script_header def get_win_launcher(type): """ Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. """ launcher_fn = '%s.exe' % type if is_64bit(): launcher_fn = launcher_fn.replace(".", "-64.") else: launcher_fn = launcher_fn.replace(".", "-32.") return resource_string('setuptools', launcher_fn) def load_launcher_manifest(name): manifest = pkg_resources.resource_string(__name__, 'launcher manifest.xml') if six.PY2: return manifest % vars() else: return manifest.decode('utf-8') % vars() def rmtree(path, ignore_errors=False, onerror=auto_chmod): return shutil.rmtree(path, ignore_errors, onerror) def current_umask(): tmp = os.umask(0o022) os.umask(tmp) return tmp def bootstrap(): # This function is called when setuptools*.egg is run using /bin/sh import setuptools argv0 = os.path.dirname(setuptools.__path__[0]) sys.argv[0] = argv0 sys.argv.append(argv0) main() def main(argv=None, **kw): from setuptools import setup from setuptools.dist import Distribution class DistributionWithoutHelpCommands(Distribution): common_usage = "" def _show_help(self, *args, **kw): with _patch_usage(): Distribution._show_help(self, *args, **kw) if argv is None: argv = sys.argv[1:] with _patch_usage(): setup( script_args=['-q', 'easy_install', '-v'] + argv, script_name=sys.argv[0] or 'easy_install', distclass=DistributionWithoutHelpCommands, **kw ) @contextlib.contextmanager def _patch_usage(): import distutils.core USAGE = textwrap.dedent(""" usage: %(script)s [options] requirement_or_url ... or: %(script)s --help """).lstrip() def gen_usage(script_name): return USAGE % dict( script=os.path.basename(script_name), ) saved = distutils.core.gen_usage distutils.core.gen_usage = gen_usage try: yield finally: distutils.core.gen_usage = saved class EasyInstallDeprecationWarning(SetuptoolsDeprecationWarning): """Class for warning about deprecations in EasyInstall in SetupTools. Not ignored by default, unlike DeprecationWarning.""" PK!l command/sdist.pynu[from distutils import log import distutils.command.sdist as orig import os import sys import io import contextlib from setuptools.extern import six from .py36compat import sdist_add_defaults import pkg_resources _default_revctrl = list def walk_revctrl(dirname=''): """Find all files under revision control""" for ep in pkg_resources.iter_entry_points('setuptools.file_finders'): for item in ep.load()(dirname): yield item class sdist(sdist_add_defaults, orig.sdist): """Smart sdist that finds anything supported by revision control""" user_options = [ ('formats=', None, "formats for source distribution (comma-separated list)"), ('keep-temp', 'k', "keep the distribution tree around after creating " + "archive file(s)"), ('dist-dir=', 'd', "directory to put the source distribution archive(s) in " "[default: dist]"), ] negative_opt = {} README_EXTENSIONS = ['', '.rst', '.txt', '.md'] READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS) def run(self): self.run_command('egg_info') ei_cmd = self.get_finalized_command('egg_info') self.filelist = ei_cmd.filelist self.filelist.append(os.path.join(ei_cmd.egg_info, 'SOURCES.txt')) self.check_readme() # Run sub commands for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) self.make_distribution() dist_files = getattr(self.distribution, 'dist_files', []) for file in self.archive_files: data = ('sdist', '', file) if data not in dist_files: dist_files.append(data) def initialize_options(self): orig.sdist.initialize_options(self) self._default_to_gztar() def _default_to_gztar(self): # only needed on Python prior to 3.6. if sys.version_info >= (3, 6, 0, 'beta', 1): return self.formats = ['gztar'] def make_distribution(self): """ Workaround for #516 """ with self._remove_os_link(): orig.sdist.make_distribution(self) @staticmethod @contextlib.contextmanager def _remove_os_link(): """ In a context, remove and restore os.link if it exists """ class NoValue: pass orig_val = getattr(os, 'link', NoValue) try: del os.link except Exception: pass try: yield finally: if orig_val is not NoValue: setattr(os, 'link', orig_val) def __read_template_hack(self): # This grody hack closes the template file (MANIFEST.in) if an # exception occurs during read_template. # Doing so prevents an error when easy_install attempts to delete the # file. try: orig.sdist.read_template(self) except Exception: _, _, tb = sys.exc_info() tb.tb_next.tb_frame.f_locals['template'].close() raise # Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle # has been fixed, so only override the method if we're using an earlier # Python. has_leaky_handle = ( sys.version_info < (2, 7, 2) or (3, 0) <= sys.version_info < (3, 1, 4) or (3, 2) <= sys.version_info < (3, 2, 1) ) if has_leaky_handle: read_template = __read_template_hack def _add_defaults_python(self): """getting python files""" if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) # This functionality is incompatible with include_package_data, and # will in fact create an infinite recursion if include_package_data # is True. Use of include_package_data will imply that # distutils-style automatic handling of package_data is disabled if not self.distribution.include_package_data: for _, src_dir, _, filenames in build_py.data_files: self.filelist.extend([os.path.join(src_dir, filename) for filename in filenames]) def _add_defaults_data_files(self): try: if six.PY2: sdist_add_defaults._add_defaults_data_files(self) else: super()._add_defaults_data_files() except TypeError: log.warn("data_files contains unexpected objects") def check_readme(self): for f in self.READMES: if os.path.exists(f): return else: self.warn( "standard file not found: should have one of " + ', '.join(self.READMES) ) def make_release_tree(self, base_dir, files): orig.sdist.make_release_tree(self, base_dir, files) # Save any egg_info command line options used to create this sdist dest = os.path.join(base_dir, 'setup.cfg') if hasattr(os, 'link') and os.path.exists(dest): # unlink and re-copy, since it might be hard-linked, and # we don't want to change the source version os.unlink(dest) self.copy_file('setup.cfg', dest) self.get_finalized_command('egg_info').save_version_info(dest) def _manifest_is_not_generated(self): # check for special comment used in 2.7.1 and higher if not os.path.isfile(self.manifest): return False with io.open(self.manifest, 'rb') as fp: first_line = fp.readline() return (first_line != '# file GENERATED by distutils, do NOT edit\n'.encode()) def read_manifest(self): """Read the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. """ log.info("reading manifest file '%s'", self.manifest) manifest = open(self.manifest, 'rb') for line in manifest: # The manifest must contain UTF-8. See #303. if six.PY3: try: line = line.decode('UTF-8') except UnicodeDecodeError: log.warn("%r not UTF-8 decodable -- skipping" % line) continue # ignore comments and blank lines line = line.strip() if line.startswith('#') or not line: continue self.filelist.append(line) manifest.close() def check_license(self): """Checks if license_file' is configured and adds it to 'self.filelist' if the value contains a valid path. """ opts = self.distribution.get_option_dict('metadata') # ignore the source of the value _, license_file = opts.get('license_file', (None, None)) if license_file is None: log.debug("'license_file' option was not specified") return if not os.path.exists(license_file): log.warn("warning: Failed to find the configured license file '%s'", license_file) return self.filelist.append(license_file) PK!@FB|%|%command/build_py.pynu[from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import fnmatch import textwrap import io import distutils.errors import itertools from setuptools.extern import six from setuptools.extern.six.moves import map, filter, filterfalse try: from setuptools.lib2to3_ex import Mixin2to3 except ImportError: class Mixin2to3: def run_2to3(self, files, doctests=True): "do nothing" class build_py(orig.build_py, Mixin2to3): """Enhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. """ def finalize_options(self): orig.build_py.finalize_options(self) self.package_data = self.distribution.package_data self.exclude_package_data = (self.distribution.exclude_package_data or {}) if 'data_files' in self.__dict__: del self.__dict__['data_files'] self.__updated_files = [] self.__doctests_2to3 = [] def run(self): """Build modules, packages, and copy data files to build directory""" if not self.py_modules and not self.packages: return if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.run_2to3(self.__updated_files, False) self.run_2to3(self.__updated_files, True) self.run_2to3(self.__doctests_2to3, True) # Only compile actual .py files, using our base class' idea of what our # output files are. self.byte_compile(orig.build_py.get_outputs(self, include_bytecode=0)) def __getattr__(self, attr): "lazily compute data files" if attr == 'data_files': self.data_files = self._get_data_files() return self.data_files return orig.build_py.__getattr__(self, attr) def build_module(self, module, module_file, package): if six.PY2 and isinstance(package, six.string_types): # avoid errors on Python 2 when unicode is passed (#190) package = package.split('.') outfile, copied = orig.build_py.build_module(self, module, module_file, package) if copied: self.__updated_files.append(outfile) return outfile, copied def _get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" self.analyze_manifest() return list(map(self._get_pkg_data_files, self.packages or ())) def _get_pkg_data_files(self, package): # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Strip directory from globbed filenames filenames = [ os.path.relpath(file, src_dir) for file in self.find_data_files(package, src_dir) ] return package, src_dir, build_dir, filenames def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" patterns = self._get_platform_patterns( self.package_data, package, src_dir, ) globs_expanded = map(glob, patterns) # flatten the expanded globs into an iterable of matches globs_matches = itertools.chain.from_iterable(globs_expanded) glob_files = filter(os.path.isfile, globs_matches) files = itertools.chain( self.manifest_files.get(package, []), glob_files, ) return self.exclude_data_files(package, src_dir, files) def build_package_data(self): """Copy data files into build directory""" for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) srcfile = os.path.join(src_dir, filename) outf, copied = self.copy_file(srcfile, target) srcfile = os.path.abspath(srcfile) if (copied and srcfile in self.distribution.convert_2to3_doctests): self.__doctests_2to3.append(outf) def analyze_manifest(self): self.manifest_files = mf = {} if not self.distribution.include_package_data: return src_dirs = {} for package in self.packages or (): # Locate package source directory src_dirs[assert_relative(self.get_package_dir(package))] = package self.run_command('egg_info') ei_cmd = self.get_finalized_command('egg_info') for path in ei_cmd.filelist.files: d, f = os.path.split(assert_relative(path)) prev = None oldf = f while d and d != prev and d not in src_dirs: prev = d d, df = os.path.split(d) f = os.path.join(df, f) if d in src_dirs: if path.endswith('.py') and f == oldf: continue # it's a module, not data mf.setdefault(src_dirs[d], []).append(path) def get_data_files(self): pass # Lazily compute data files in _get_data_files() function. def check_package(self, package, package_dir): """Check namespace packages' __init__ for declare_namespace""" try: return self.packages_checked[package] except KeyError: pass init_py = orig.build_py.check_package(self, package, package_dir) self.packages_checked[package] = init_py if not init_py or not self.distribution.namespace_packages: return init_py for pkg in self.distribution.namespace_packages: if pkg == package or pkg.startswith(package + '.'): break else: return init_py with io.open(init_py, 'rb') as f: contents = f.read() if b'declare_namespace' not in contents: raise distutils.errors.DistutilsError( "Namespace package problem: %s is a namespace package, but " "its\n__init__.py does not call declare_namespace()! Please " 'fix it.\n(See the setuptools manual under ' '"Namespace Packages" for details.)\n"' % (package,) ) return init_py def initialize_options(self): self.packages_checked = {} orig.build_py.initialize_options(self) def get_package_dir(self, package): res = orig.build_py.get_package_dir(self, package) if self.distribution.src_root is not None: return os.path.join(self.distribution.src_root, res) return res def exclude_data_files(self, package, src_dir, files): """Filter filenames for package's data files in 'src_dir'""" files = list(files) patterns = self._get_platform_patterns( self.exclude_package_data, package, src_dir, ) match_groups = ( fnmatch.filter(files, pattern) for pattern in patterns ) # flatten the groups of matches into an iterable of matches matches = itertools.chain.from_iterable(match_groups) bad = set(matches) keepers = ( fn for fn in files if fn not in bad ) # ditch dupes return list(_unique_everseen(keepers)) @staticmethod def _get_platform_patterns(spec, package, src_dir): """ yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. """ raw_patterns = itertools.chain( spec.get('', []), spec.get(package, []), ) return ( # Each pattern has to be converted to a platform-specific path os.path.join(src_dir, convert_path(pattern)) for pattern in raw_patterns ) # from Python docs def _unique_everseen(iterable, key=None): "List unique elements, preserving order. Remember all elements ever seen." # unique_everseen('AAAABBBCCDAABBB') --> A B C D # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: for element in filterfalse(seen.__contains__, iterable): seen_add(element) yield element else: for element in iterable: k = key(element) if k not in seen: seen_add(k) yield element def assert_relative(path): if not os.path.isabs(path): return path from distutils.errors import DistutilsSetupError msg = textwrap.dedent(""" Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. """).lstrip() % path raise DistutilsSetupError(msg) PK!(p22command/build_ext.pynu[import os import sys import itertools from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from distutils import log from setuptools.extension import Library from setuptools.extern import six if six.PY2: import imp EXTENSION_SUFFIXES = [s for s, _, tp in imp.get_suffixes() if tp == imp.C_EXTENSION] else: from importlib.machinery import EXTENSION_SUFFIXES try: # Attempt to use Cython for building extensions, if available from Cython.Distutils.build_ext import build_ext as _build_ext # Additionally, assert that the compiler module will load # also. Ref #1229. __import__('Cython.Compiler.Main') except ImportError: _build_ext = _du_build_ext # make sure _config_vars is initialized get_config_var("LDSHARED") from distutils.sysconfig import _config_vars as _CONFIG_VARS def _customize_compiler_for_shlib(compiler): if sys.platform == "darwin": # building .dylib requires additional compiler flags on OSX; here we # temporarily substitute the pyconfig.h variables so that distutils' # 'customize_compiler' uses them before we build the shared libraries. tmp = _CONFIG_VARS.copy() try: # XXX Help! I don't have any idea whether these are right... _CONFIG_VARS['LDSHARED'] = ( "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup") _CONFIG_VARS['CCSHARED'] = " -dynamiclib" _CONFIG_VARS['SO'] = ".dylib" customize_compiler(compiler) finally: _CONFIG_VARS.clear() _CONFIG_VARS.update(tmp) else: customize_compiler(compiler) have_rtld = False use_stubs = False libtype = 'shared' if sys.platform == "darwin": use_stubs = True elif os.name != 'nt': try: import dl use_stubs = have_rtld = hasattr(dl, 'RTLD_NOW') except ImportError: pass if_dl = lambda s: s if have_rtld else '' def get_abi3_suffix(): """Return the file extension for an abi3-compliant Extension()""" for suffix in EXTENSION_SUFFIXES: if '.abi3' in suffix: # Unix return suffix elif suffix == '.pyd': # Windows return suffix class build_ext(_build_ext): def run(self): """Build extensions in build directory, then copy if --inplace""" old_inplace, self.inplace = self.inplace, 0 _build_ext.run(self) self.inplace = old_inplace if old_inplace: self.copy_extensions_to_source() def copy_extensions_to_source(self): build_py = self.get_finalized_command('build_py') for ext in self.extensions: fullname = self.get_ext_fullname(ext.name) filename = self.get_ext_filename(fullname) modpath = fullname.split('.') package = '.'.join(modpath[:-1]) package_dir = build_py.get_package_dir(package) dest_filename = os.path.join(package_dir, os.path.basename(filename)) src_filename = os.path.join(self.build_lib, filename) # Always copy, even if source is older than destination, to ensure # that the right extensions for the current Python/platform are # used. copy_file( src_filename, dest_filename, verbose=self.verbose, dry_run=self.dry_run ) if ext._needs_stub: self.write_stub(package_dir or os.curdir, ext, True) def get_ext_filename(self, fullname): filename = _build_ext.get_ext_filename(self, fullname) if fullname in self.ext_map: ext = self.ext_map[fullname] use_abi3 = ( six.PY3 and getattr(ext, 'py_limited_api') and get_abi3_suffix() ) if use_abi3: so_ext = get_config_var('EXT_SUFFIX') filename = filename[:-len(so_ext)] filename = filename + get_abi3_suffix() if isinstance(ext, Library): fn, ext = os.path.splitext(filename) return self.shlib_compiler.library_filename(fn, libtype) elif use_stubs and ext._links_to_dynamic: d, fn = os.path.split(filename) return os.path.join(d, 'dl-' + fn) return filename def initialize_options(self): _build_ext.initialize_options(self) self.shlib_compiler = None self.shlibs = [] self.ext_map = {} def finalize_options(self): _build_ext.finalize_options(self) self.extensions = self.extensions or [] self.check_extensions_list(self.extensions) self.shlibs = [ext for ext in self.extensions if isinstance(ext, Library)] if self.shlibs: self.setup_shlib_compiler() for ext in self.extensions: ext._full_name = self.get_ext_fullname(ext.name) for ext in self.extensions: fullname = ext._full_name self.ext_map[fullname] = ext # distutils 3.1 will also ask for module names # XXX what to do with conflicts? self.ext_map[fullname.split('.')[-1]] = ext ltd = self.shlibs and self.links_to_dynamic(ext) or False ns = ltd and use_stubs and not isinstance(ext, Library) ext._links_to_dynamic = ltd ext._needs_stub = ns filename = ext._file_name = self.get_ext_filename(fullname) libdir = os.path.dirname(os.path.join(self.build_lib, filename)) if ltd and libdir not in ext.library_dirs: ext.library_dirs.append(libdir) if ltd and use_stubs and os.curdir not in ext.runtime_library_dirs: ext.runtime_library_dirs.append(os.curdir) def setup_shlib_compiler(self): compiler = self.shlib_compiler = new_compiler( compiler=self.compiler, dry_run=self.dry_run, force=self.force ) _customize_compiler_for_shlib(compiler) if self.include_dirs is not None: compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: compiler.undefine_macro(macro) if self.libraries is not None: compiler.set_libraries(self.libraries) if self.library_dirs is not None: compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: compiler.set_link_objects(self.link_objects) # hack so distutils' build_extension() builds a library instead compiler.link_shared_object = link_shared_object.__get__(compiler) def get_export_symbols(self, ext): if isinstance(ext, Library): return ext.export_symbols return _build_ext.get_export_symbols(self, ext) def build_extension(self, ext): ext._convert_pyx_sources_to_lang() _compiler = self.compiler try: if isinstance(ext, Library): self.compiler = self.shlib_compiler _build_ext.build_extension(self, ext) if ext._needs_stub: cmd = self.get_finalized_command('build_py').build_lib self.write_stub(cmd, ext) finally: self.compiler = _compiler def links_to_dynamic(self, ext): """Return true if 'ext' links to a dynamic lib in the same package""" # XXX this should check to ensure the lib is actually being built # XXX as dynamic, and not just using a locally-found version or a # XXX static-compiled version libnames = dict.fromkeys([lib._full_name for lib in self.shlibs]) pkg = '.'.join(ext._full_name.split('.')[:-1] + ['']) return any(pkg + libname in libnames for libname in ext.libraries) def get_outputs(self): return _build_ext.get_outputs(self) + self.__get_stubs_outputs() def __get_stubs_outputs(self): # assemble the base name for each extension that needs a stub ns_ext_bases = ( os.path.join(self.build_lib, *ext._full_name.split('.')) for ext in self.extensions if ext._needs_stub ) # pair each base with the extension pairs = itertools.product(ns_ext_bases, self.__get_output_extensions()) return list(base + fnext for base, fnext in pairs) def __get_output_extensions(self): yield '.py' yield '.pyc' if self.get_finalized_command('build_py').optimize: yield '.pyo' def write_stub(self, output_dir, ext, compile=False): log.info("writing stub loader for %s to %s", ext._full_name, output_dir) stub_file = (os.path.join(output_dir, *ext._full_name.split('.')) + '.py') if compile and os.path.exists(stub_file): raise DistutilsError(stub_file + " already exists! Please delete.") if not self.dry_run: f = open(stub_file, 'w') f.write( '\n'.join([ "def __bootstrap__():", " global __bootstrap__, __file__, __loader__", " import sys, os, pkg_resources, imp" + if_dl(", dl"), " __file__ = pkg_resources.resource_filename" "(__name__,%r)" % os.path.basename(ext._file_name), " del __bootstrap__", " if '__loader__' in globals():", " del __loader__", if_dl(" old_flags = sys.getdlopenflags()"), " old_dir = os.getcwd()", " try:", " os.chdir(os.path.dirname(__file__))", if_dl(" sys.setdlopenflags(dl.RTLD_NOW)"), " imp.load_dynamic(__name__,__file__)", " finally:", if_dl(" sys.setdlopenflags(old_flags)"), " os.chdir(old_dir)", "__bootstrap__()", "" # terminal \n ]) ) f.close() if compile: from distutils.util import byte_compile byte_compile([stub_file], optimize=0, force=True, dry_run=self.dry_run) optimize = self.get_finalized_command('install_lib').optimize if optimize > 0: byte_compile([stub_file], optimize=optimize, force=True, dry_run=self.dry_run) if os.path.exists(stub_file) and not self.dry_run: os.unlink(stub_file) if use_stubs or os.name == 'nt': # Build shared libraries # def link_shared_object( self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): self.link( self.SHARED_LIBRARY, objects, output_libname, output_dir, libraries, library_dirs, runtime_library_dirs, export_symbols, debug, extra_preargs, extra_postargs, build_temp, target_lang ) else: # Build static libraries everywhere else libtype = 'static' def link_shared_object( self, objects, output_libname, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): # XXX we need to either disallow these attrs on Library instances, # or warn/abort here if set, or something... # libraries=None, library_dirs=None, runtime_library_dirs=None, # export_symbols=None, extra_preargs=None, extra_postargs=None, # build_temp=None assert output_dir is None # distutils build_ext doesn't pass this output_dir, filename = os.path.split(output_libname) basename, ext = os.path.splitext(filename) if self.library_filename("x").startswith('lib'): # strip 'lib' prefix; this is kludgy if some platform uses # a different prefix basename = basename[3:] self.create_static_lib( objects, basename, output_dir, debug, target_lang ) PK!ӌ*command/install_lib.pynu[import os import sys from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: # always compile, in case we have any extension stubs to deal with self.byte_compile(outfiles) def get_exclusions(self): """ Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. """ all_packages = ( pkg for ns_pkg in self._get_SVEM_NSPs() for pkg in self._all_packages(ns_pkg) ) excl_specs = product(all_packages, self._gen_exclusion_paths()) return set(starmap(self._exclude_pkg_path, excl_specs)) def _exclude_pkg_path(self, pkg, exclusion_path): """ Given a package name and exclusion path within that package, compute the full exclusion path. """ parts = pkg.split('.') + [exclusion_path] return os.path.join(self.install_dir, *parts) @staticmethod def _all_packages(pkg_name): """ >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] """ while pkg_name: yield pkg_name pkg_name, sep, child = pkg_name.rpartition('.') def _get_SVEM_NSPs(self): """ Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. """ # TODO: is it necessary to short-circuit here? i.e. what's the cost # if get_finalized_command is called even when namespace_packages is # False? if not self.distribution.namespace_packages: return [] install_cmd = self.get_finalized_command('install') svem = install_cmd.single_version_externally_managed return self.distribution.namespace_packages if svem else [] @staticmethod def _gen_exclusion_paths(): """ Generate file paths to be excluded for namespace packages (bytecode cache files). """ # always exclude the package module itself yield '__init__.py' yield '__init__.pyc' yield '__init__.pyo' if not hasattr(sys, 'implementation'): return base = os.path.join('__pycache__', '__init__.' + sys.implementation.cache_tag) yield base + '.pyc' yield base + '.pyo' yield base + '.opt-1.pyc' yield base + '.opt-2.pyc' def copy_tree( self, infile, outfile, preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1 ): assert preserve_mode and preserve_times and not preserve_symlinks exclude = self.get_exclusions() if not exclude: return orig.install_lib.copy_tree(self, infile, outfile) # Exclude namespace package __init__.py* files from the output from setuptools.archive_util import unpack_directory from distutils import log outfiles = [] def pf(src, dst): if dst in exclude: log.warn("Skipping installation of %s (namespace package)", dst) return False log.info("copying %s -> %s", src, os.path.dirname(dst)) outfiles.append(dst) return dst unpack_directory(infile, outfile, pf) return outfiles def get_outputs(self): outputs = orig.install_lib.get_outputs(self) exclude = self.get_exclusions() if exclude: return [f for f in outputs if f not in exclude] return outputs PK!ӭcommand/register.pynu[from distutils import log import distutils.command.register as orig class register(orig.register): __doc__ = orig.register.__doc__ def run(self): try: # Make sure that we are using valid current name/version info self.run_command('egg_info') orig.register.run(self) finally: self.announce( "WARNING: Registering is deprecated, use twine to " "upload instead (https://pypi.org/p/twine/)", log.WARN ) PK!1cccommand/egg_info.pynu["""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.errors import DistutilsInternalError from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys import io import warnings import time import collections from setuptools.extern import six from setuptools.extern.six.moves import map from setuptools import Command from setuptools.command.sdist import sdist from setuptools.command.sdist import walk_revctrl from setuptools.command.setopt import edit_config from setuptools.command import bdist_egg from pkg_resources import ( parse_requirements, safe_name, parse_version, safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename) import setuptools.unicode_utils as unicode_utils from setuptools.glob import glob from setuptools.extern import packaging from setuptools import SetuptoolsDeprecationWarning def translate_pattern(glob): """ Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. """ pat = '' # This will split on '/' within [character classes]. This is deliberate. chunks = glob.split(os.path.sep) sep = re.escape(os.sep) valid_char = '[^%s]' % (sep,) for c, chunk in enumerate(chunks): last_chunk = c == len(chunks) - 1 # Chunks that are a literal ** are globstars. They match anything. if chunk == '**': if last_chunk: # Match anything if this is the last component pat += '.*' else: # Match '(name/)*' pat += '(?:%s+%s)*' % (valid_char, sep) continue # Break here as the whole path component has been handled # Find any special characters in the remainder i = 0 chunk_len = len(chunk) while i < chunk_len: char = chunk[i] if char == '*': # Match any number of name characters pat += valid_char + '*' elif char == '?': # Match a name character pat += valid_char elif char == '[': # Character class inner_i = i + 1 # Skip initial !/] chars if inner_i < chunk_len and chunk[inner_i] == '!': inner_i = inner_i + 1 if inner_i < chunk_len and chunk[inner_i] == ']': inner_i = inner_i + 1 # Loop till the closing ] is found while inner_i < chunk_len and chunk[inner_i] != ']': inner_i = inner_i + 1 if inner_i >= chunk_len: # Got to the end of the string without finding a closing ] # Do not treat this as a matching group, but as a literal [ pat += re.escape(char) else: # Grab the insides of the [brackets] inner = chunk[i + 1:inner_i] char_class = '' # Class negation if inner[0] == '!': char_class = '^' inner = inner[1:] char_class += re.escape(inner) pat += '[%s]' % (char_class,) # Skip to the end ] i = inner_i else: pat += re.escape(char) i += 1 # Join each chunk with the dir separator if not last_chunk: pat += sep pat += r'\Z' return re.compile(pat, flags=re.MULTILINE|re.DOTALL) class InfoCommon: tag_build = None tag_date = None @property def name(self): return safe_name(self.distribution.get_name()) def tagged_version(self): version = self.distribution.get_version() # egg_info may be called more than once for a distribution, # in which case the version string already contains all tags. if self.vtags and version.endswith(self.vtags): return safe_version(version) return safe_version(version + self.vtags) def tags(self): version = '' if self.tag_build: version += self.tag_build if self.tag_date: version += time.strftime("-%Y%m%d") return version vtags = property(tags) class egg_info(InfoCommon, Command): description = "create a distribution's .egg-info directory" user_options = [ ('egg-base=', 'e', "directory containing .egg-info directories" " (default: top of the source tree)"), ('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"), ('tag-build=', 'b', "Specify explicit tag to add to version number"), ('no-date', 'D', "Don't include date stamp [default]"), ] boolean_options = ['tag-date'] negative_opt = { 'no-date': 'tag-date', } def initialize_options(self): self.egg_base = None self.egg_name = None self.egg_info = None self.egg_version = None self.broken_egg_info = False #################################### # allow the 'tag_svn_revision' to be detected and # set, supporting sdists built on older Setuptools. @property def tag_svn_revision(self): pass @tag_svn_revision.setter def tag_svn_revision(self, value): pass #################################### def save_version_info(self, filename): """ Materialize the value of date into the build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. """ egg_info = collections.OrderedDict() # follow the order these keys would have been added # when PYTHONHASHSEED=0 egg_info['tag_build'] = self.tags() egg_info['tag_date'] = 0 edit_config(filename, dict(egg_info=egg_info)) def finalize_options(self): # Note: we need to capture the current value returned # by `self.tagged_version()`, so we can later update # `self.distribution.metadata.version` without # repercussions. self.egg_name = self.name self.egg_version = self.tagged_version() parsed_version = parse_version(self.egg_version) try: is_version = isinstance(parsed_version, packaging.version.Version) spec = ( "%s==%s" if is_version else "%s===%s" ) list( parse_requirements(spec % (self.egg_name, self.egg_version)) ) except ValueError: raise distutils.errors.DistutilsOptionError( "Invalid distribution name or version syntax: %s-%s" % (self.egg_name, self.egg_version) ) if self.egg_base is None: dirs = self.distribution.package_dir self.egg_base = (dirs or {}).get('', os.curdir) self.ensure_dirname('egg_base') self.egg_info = to_filename(self.egg_name) + '.egg-info' if self.egg_base != os.curdir: self.egg_info = os.path.join(self.egg_base, self.egg_info) if '-' in self.egg_name: self.check_broken_egg_info() # Set package version for the benefit of dumber commands # (e.g. sdist, bdist_wininst, etc.) # self.distribution.metadata.version = self.egg_version # If we bootstrapped around the lack of a PKG-INFO, as might be the # case in a fresh checkout, make sure that any special tags get added # to the version info # pd = self.distribution._patched_dist if pd is not None and pd.key == self.egg_name.lower(): pd._version = self.egg_version pd._parsed_version = parse_version(self.egg_version) self.distribution._patched_dist = None def write_or_delete_file(self, what, filename, data, force=False): """Write `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). """ if data: self.write_file(what, filename, data) elif os.path.exists(filename): if data is None and not force: log.warn( "%s not set in setup(), but %s exists", what, filename ) return else: self.delete_file(filename) def write_file(self, what, filename, data): """Write `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. """ log.info("writing %s to %s", what, filename) if six.PY3: data = data.encode("utf-8") if not self.dry_run: f = open(filename, 'wb') f.write(data) f.close() def delete_file(self, filename): """Delete `filename` (if not a dry run) after announcing it""" log.info("deleting %s", filename) if not self.dry_run: os.unlink(filename) def run(self): self.mkpath(self.egg_info) os.utime(self.egg_info, None) installer = self.distribution.fetch_build_egg for ep in iter_entry_points('egg_info.writers'): ep.require(installer=installer) writer = ep.resolve() writer(self, ep.name, os.path.join(self.egg_info, ep.name)) # Get rid of native_libs.txt if it was put there by older bdist_egg nl = os.path.join(self.egg_info, "native_libs.txt") if os.path.exists(nl): self.delete_file(nl) self.find_sources() def find_sources(self): """Generate SOURCES.txt manifest file""" manifest_filename = os.path.join(self.egg_info, "SOURCES.txt") mm = manifest_maker(self.distribution) mm.manifest = manifest_filename mm.run() self.filelist = mm.filelist def check_broken_egg_info(self): bei = self.egg_name + '.egg-info' if self.egg_base != os.curdir: bei = os.path.join(self.egg_base, bei) if os.path.exists(bei): log.warn( "-" * 78 + '\n' "Note: Your current .egg-info directory has a '-' in its name;" '\nthis will not work correctly with "setup.py develop".\n\n' 'Please rename %s to %s to correct this problem.\n' + '-' * 78, bei, self.egg_info ) self.broken_egg_info = self.egg_info self.egg_info = bei # make it work for now class FileList(_FileList): # Implementations of the various MANIFEST.in commands def process_template_line(self, line): # Parse the line: split it up, make sure the right number of words # is there, and return the relevant words. 'action' is always # defined: it's the first word of the line. Which of the other # three are defined depends on the action; it'll be either # patterns, (dir and patterns), or (dir_pattern). (action, patterns, dir, dir_pattern) = self._parse_template_line(line) # OK, now we know that the action is valid and we have the # right number of words on the line for that action -- so we # can proceed with minimal error-checking. if action == 'include': self.debug_print("include " + ' '.join(patterns)) for pattern in patterns: if not self.include(pattern): log.warn("warning: no files found matching '%s'", pattern) elif action == 'exclude': self.debug_print("exclude " + ' '.join(patterns)) for pattern in patterns: if not self.exclude(pattern): log.warn(("warning: no previously-included files " "found matching '%s'"), pattern) elif action == 'global-include': self.debug_print("global-include " + ' '.join(patterns)) for pattern in patterns: if not self.global_include(pattern): log.warn(("warning: no files found matching '%s' " "anywhere in distribution"), pattern) elif action == 'global-exclude': self.debug_print("global-exclude " + ' '.join(patterns)) for pattern in patterns: if not self.global_exclude(pattern): log.warn(("warning: no previously-included files matching " "'%s' found anywhere in distribution"), pattern) elif action == 'recursive-include': self.debug_print("recursive-include %s %s" % (dir, ' '.join(patterns))) for pattern in patterns: if not self.recursive_include(dir, pattern): log.warn(("warning: no files found matching '%s' " "under directory '%s'"), pattern, dir) elif action == 'recursive-exclude': self.debug_print("recursive-exclude %s %s" % (dir, ' '.join(patterns))) for pattern in patterns: if not self.recursive_exclude(dir, pattern): log.warn(("warning: no previously-included files matching " "'%s' found under directory '%s'"), pattern, dir) elif action == 'graft': self.debug_print("graft " + dir_pattern) if not self.graft(dir_pattern): log.warn("warning: no directories found matching '%s'", dir_pattern) elif action == 'prune': self.debug_print("prune " + dir_pattern) if not self.prune(dir_pattern): log.warn(("no previously-included directories found " "matching '%s'"), dir_pattern) else: raise DistutilsInternalError( "this cannot happen: invalid action '%s'" % action) def _remove_files(self, predicate): """ Remove all files from the file list that match the predicate. Return True if any matching files were removed """ found = False for i in range(len(self.files) - 1, -1, -1): if predicate(self.files[i]): self.debug_print(" removing " + self.files[i]) del self.files[i] found = True return found def include(self, pattern): """Include files that match 'pattern'.""" found = [f for f in glob(pattern) if not os.path.isdir(f)] self.extend(found) return bool(found) def exclude(self, pattern): """Exclude files that match 'pattern'.""" match = translate_pattern(pattern) return self._remove_files(match.match) def recursive_include(self, dir, pattern): """ Include all files anywhere in 'dir/' that match the pattern. """ full_pattern = os.path.join(dir, '**', pattern) found = [f for f in glob(full_pattern, recursive=True) if not os.path.isdir(f)] self.extend(found) return bool(found) def recursive_exclude(self, dir, pattern): """ Exclude any file anywhere in 'dir/' that match the pattern. """ match = translate_pattern(os.path.join(dir, '**', pattern)) return self._remove_files(match.match) def graft(self, dir): """Include all files from 'dir/'.""" found = [ item for match_dir in glob(dir) for item in distutils.filelist.findall(match_dir) ] self.extend(found) return bool(found) def prune(self, dir): """Filter out files from 'dir/'.""" match = translate_pattern(os.path.join(dir, '**')) return self._remove_files(match.match) def global_include(self, pattern): """ Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. """ if self.allfiles is None: self.findall() match = translate_pattern(os.path.join('**', pattern)) found = [f for f in self.allfiles if match.match(f)] self.extend(found) return bool(found) def global_exclude(self, pattern): """ Exclude all files anywhere that match the pattern. """ match = translate_pattern(os.path.join('**', pattern)) return self._remove_files(match.match) def append(self, item): if item.endswith('\r'): # Fix older sdists built on Windows item = item[:-1] path = convert_path(item) if self._safe_path(path): self.files.append(path) def extend(self, paths): self.files.extend(filter(self._safe_path, paths)) def _repair(self): """ Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. """ self.files = list(filter(self._safe_path, self.files)) def _safe_path(self, path): enc_warn = "'%s' not %s encodable -- skipping" # To avoid accidental trans-codings errors, first to unicode u_path = unicode_utils.filesys_decode(path) if u_path is None: log.warn("'%s' in unexpected encoding -- skipping" % path) return False # Must ensure utf-8 encodability utf8_path = unicode_utils.try_encode(u_path, "utf-8") if utf8_path is None: log.warn(enc_warn, path, 'utf-8') return False try: # accept is either way checks out if os.path.exists(u_path) or os.path.exists(utf8_path): return True # this will catch any encode errors decoding u_path except UnicodeEncodeError: log.warn(enc_warn, path, sys.getfilesystemencoding()) class manifest_maker(sdist): template = "MANIFEST.in" def initialize_options(self): self.use_defaults = 1 self.prune = 1 self.manifest_only = 1 self.force_manifest = 1 def finalize_options(self): pass def run(self): self.filelist = FileList() if not os.path.exists(self.manifest): self.write_manifest() # it must exist so it'll get in the list self.add_defaults() if os.path.exists(self.template): self.read_template() self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() self.write_manifest() def _manifest_normalize(self, path): path = unicode_utils.filesys_decode(path) return path.replace(os.sep, '/') def write_manifest(self): """ Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. """ self.filelist._repair() # Now _repairs should encodability, but not unicode files = [self._manifest_normalize(f) for f in self.filelist.files] msg = "writing manifest file '%s'" % self.manifest self.execute(write_file, (self.manifest, files), msg) def warn(self, msg): if not self._should_suppress_warning(msg): sdist.warn(self, msg) @staticmethod def _should_suppress_warning(msg): """ suppress missing-file warnings from sdist """ return re.match(r"standard file .*not found", msg) def add_defaults(self): sdist.add_defaults(self) self.check_license() self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) elif os.path.exists(self.manifest): self.read_manifest() if os.path.exists("setup.py"): # setup.py should be included by default, even if it's not # the script called to create the sdist self.filelist.append("setup.py") ei_cmd = self.get_finalized_command('egg_info') self.filelist.graft(ei_cmd.egg_info) def prune_file_list(self): build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() self.filelist.prune(build.build_base) self.filelist.prune(base_dir) sep = re.escape(os.sep) self.filelist.exclude_pattern(r'(^|' + sep + r')(RCS|CVS|\.svn)' + sep, is_regex=1) def write_file(filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ contents = "\n".join(contents) # assuming the contents has been vetted for utf-8 encoding contents = contents.encode("utf-8") with open(filename, "wb") as f: # always write POSIX-style manifest f.write(contents) def write_pkg_info(cmd, basename, filename): log.info("writing %s", filename) if not cmd.dry_run: metadata = cmd.distribution.metadata metadata.version, oldver = cmd.egg_version, metadata.version metadata.name, oldname = cmd.egg_name, metadata.name try: # write unescaped data to PKG-INFO, so older pkg_resources # can still parse it metadata.write_pkg_info(cmd.egg_info) finally: metadata.name, metadata.version = oldname, oldver safe = getattr(cmd.distribution, 'zip_safe', None) bdist_egg.write_safety_flag(cmd.egg_info, safe) def warn_depends_obsolete(cmd, basename, filename): if os.path.exists(filename): log.warn( "WARNING: 'depends.txt' is not used by setuptools 0.6!\n" "Use the install_requires/extras_require setup() args instead." ) def _write_requirements(stream, reqs): lines = yield_lines(reqs or ()) append_cr = lambda line: line + '\n' lines = map(append_cr, lines) stream.writelines(lines) def write_requirements(cmd, basename, filename): dist = cmd.distribution data = six.StringIO() _write_requirements(data, dist.install_requires) extras_require = dist.extras_require or {} for extra in sorted(extras_require): data.write('\n[{extra}]\n'.format(**vars())) _write_requirements(data, extras_require[extra]) cmd.write_or_delete_file("requirements", filename, data.getvalue()) def write_setup_requirements(cmd, basename, filename): data = io.StringIO() _write_requirements(data, cmd.distribution.setup_requires) cmd.write_or_delete_file("setup-requirements", filename, data.getvalue()) def write_toplevel_names(cmd, basename, filename): pkgs = dict.fromkeys( [ k.split('.', 1)[0] for k in cmd.distribution.iter_distribution_names() ] ) cmd.write_file("top-level names", filename, '\n'.join(sorted(pkgs)) + '\n') def overwrite_arg(cmd, basename, filename): write_arg(cmd, basename, filename, True) def write_arg(cmd, basename, filename, force=False): argname = os.path.splitext(basename)[0] value = getattr(cmd.distribution, argname, None) if value is not None: value = '\n'.join(value) + '\n' cmd.write_or_delete_file(argname, filename, value, force) def write_entries(cmd, basename, filename): ep = cmd.distribution.entry_points if isinstance(ep, six.string_types) or ep is None: data = ep elif ep is not None: data = [] for section, contents in sorted(ep.items()): if not isinstance(contents, six.string_types): contents = EntryPoint.parse_group(section, contents) contents = '\n'.join(sorted(map(str, contents.values()))) data.append('[%s]\n%s\n\n' % (section, contents)) data = ''.join(data) cmd.write_or_delete_file('entry points', filename, data, True) def get_pkg_info_revision(): """ Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. """ warnings.warn("get_pkg_info_revision is deprecated.", EggInfoDeprecationWarning) if os.path.exists('PKG-INFO'): with io.open('PKG-INFO') as f: for line in f: match = re.match(r"Version:.*-r(\d+)\s*$", line) if match: return int(match.group(1)) return 0 class EggInfoDeprecationWarning(SetuptoolsDeprecationWarning): """Class for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning.""" PK!'command/build_clib.pynu[import distutils.command.build_clib as orig from distutils.errors import DistutilsSetupError from distutils import log from setuptools.dep_util import newer_pairwise_group class build_clib(orig.build_clib): """ Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. """ def build_libraries(self, libraries): for (lib_name, build_info) in libraries: sources = build_info.get('sources') if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'sources' must be present and must be " "a list of source filenames" % lib_name) sources = list(sources) log.info("building '%s' library", lib_name) # Make sure everything is the correct type. # obj_deps should be a dictionary of keys as sources # and a list/tuple of files that are its dependencies. obj_deps = build_info.get('obj_deps', dict()) if not isinstance(obj_deps, dict): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'obj_deps' must be a dictionary of " "type 'source: list'" % lib_name) dependencies = [] # Get the global dependencies that are specified by the '' key. # These will go into every source's dependency list. global_deps = obj_deps.get('', list()) if not isinstance(global_deps, (list, tuple)): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'obj_deps' must be a dictionary of " "type 'source: list'" % lib_name) # Build the list to be used by newer_pairwise_group # each source will be auto-added to its dependencies. for source in sources: src_deps = [source] src_deps.extend(global_deps) extra_deps = obj_deps.get(source, list()) if not isinstance(extra_deps, (list, tuple)): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'obj_deps' must be a dictionary of " "type 'source: list'" % lib_name) src_deps.extend(extra_deps) dependencies.append(src_deps) expected_objects = self.compiler.object_filenames( sources, output_dir=self.build_temp ) if newer_pairwise_group(dependencies, expected_objects) != ([], []): # First, compile the source code to object files in the library # directory. (This should probably change to putting object # files in a temporary build directory.) macros = build_info.get('macros') include_dirs = build_info.get('include_dirs') cflags = build_info.get('cflags') objects = self.compiler.compile( sources, output_dir=self.build_temp, macros=macros, include_dirs=include_dirs, extra_postargs=cflags, debug=self.debug ) # Now "link" the object files together into a static library. # (On Unix at least, this isn't really linking -- it just # builds an archive. Whatever.) self.compiler.create_static_lib( expected_objects, lib_name, output_dir=self.build_clib, debug=self.debug ) PK!d~ launch.pynu[""" Launch the Python script on the command line after setuptools is bootstrapped via import. """ # Note that setuptools gets imported implicitly by the # invocation of this script using python -m setuptools.launch import tokenize import sys def run(): """ Run the script in sys.argv[1] as if it had been invoked naturally. """ __builtins__ script_name = sys.argv[1] namespace = dict( __file__=script_name, __name__='__main__', __doc__=None, ) sys.argv[:] = sys.argv[1:] open_ = getattr(tokenize, 'open', open) script = open_(script_name).read() norm_script = script.replace('\\r\\n', '\\n') code = compile(norm_script, script_name, 'exec') exec(code, namespace) if __name__ == '__main__': run() PK!3 script.tmplnu[# EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r __requires__ = %(spec)r __import__('pkg_resources').run_script(%(spec)r, %(script_name)r) PK!ٓ6P6P config.pynu[from __future__ import absolute_import, unicode_literals import io import os import sys import warnings import functools from collections import defaultdict from functools import partial from functools import wraps from importlib import import_module from distutils.errors import DistutilsOptionError, DistutilsFileError from setuptools.extern.packaging.version import LegacyVersion, parse from setuptools.extern.packaging.specifiers import SpecifierSet from setuptools.extern.six import string_types, PY3 __metaclass__ = type def read_configuration( filepath, find_others=False, ignore_option_errors=False): """Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict """ from setuptools.dist import Distribution, _Distribution filepath = os.path.abspath(filepath) if not os.path.isfile(filepath): raise DistutilsFileError( 'Configuration file %s does not exist.' % filepath) current_directory = os.getcwd() os.chdir(os.path.dirname(filepath)) try: dist = Distribution() filenames = dist.find_config_files() if find_others else [] if filepath not in filenames: filenames.append(filepath) _Distribution.parse_config_files(dist, filenames=filenames) handlers = parse_configuration( dist, dist.command_options, ignore_option_errors=ignore_option_errors) finally: os.chdir(current_directory) return configuration_to_dict(handlers) def _get_option(target_obj, key): """ Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. """ getter_name = 'get_{key}'.format(**locals()) by_attribute = functools.partial(getattr, target_obj, key) getter = getattr(target_obj, getter_name, by_attribute) return getter() def configuration_to_dict(handlers): """Returns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict """ config_dict = defaultdict(dict) for handler in handlers: for option in handler.set_options: value = _get_option(handler.target_obj, option) config_dict[handler.section_prefix][option] = value return config_dict def parse_configuration( distribution, command_options, ignore_option_errors=False): """Performs additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list """ options = ConfigOptionsHandler( distribution, command_options, ignore_option_errors) options.parse() meta = ConfigMetadataHandler( distribution.metadata, command_options, ignore_option_errors, distribution.package_dir) meta.parse() return meta, options class ConfigHandler: """Handles metadata supplied in configuration files.""" section_prefix = None """Prefix for config sections handled by this handler. Must be provided by class heirs. """ aliases = {} """Options aliases. For compatibility with various packages. E.g.: d2to1 and pbr. Note: `-` in keys is replaced with `_` by config parser. """ def __init__(self, target_obj, options, ignore_option_errors=False): sections = {} section_prefix = self.section_prefix for section_name, section_options in options.items(): if not section_name.startswith(section_prefix): continue section_name = section_name.replace(section_prefix, '').strip('.') sections[section_name] = section_options self.ignore_option_errors = ignore_option_errors self.target_obj = target_obj self.sections = sections self.set_options = [] @property def parsers(self): """Metadata item name to parser function mapping.""" raise NotImplementedError( '%s must provide .parsers property' % self.__class__.__name__) def __setitem__(self, option_name, value): unknown = tuple() target_obj = self.target_obj # Translate alias into real name. option_name = self.aliases.get(option_name, option_name) current_value = getattr(target_obj, option_name, unknown) if current_value is unknown: raise KeyError(option_name) if current_value: # Already inhabited. Skipping. return skip_option = False parser = self.parsers.get(option_name) if parser: try: value = parser(value) except Exception: skip_option = True if not self.ignore_option_errors: raise if skip_option: return setter = getattr(target_obj, 'set_%s' % option_name, None) if setter is None: setattr(target_obj, option_name, value) else: setter(value) self.set_options.append(option_name) @classmethod def _parse_list(cls, value, separator=','): """Represents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list """ if isinstance(value, list): # _get_parser_compound case return value if '\n' in value: value = value.splitlines() else: value = value.split(separator) return [chunk.strip() for chunk in value if chunk.strip()] @classmethod def _parse_dict(cls, value): """Represents value as a dict. :param value: :rtype: dict """ separator = '=' result = {} for line in cls._parse_list(value): key, sep, val = line.partition(separator) if sep != separator: raise DistutilsOptionError( 'Unable to parse option value to dict: %s' % value) result[key.strip()] = val.strip() return result @classmethod def _parse_bool(cls, value): """Represents value as boolean. :param value: :rtype: bool """ value = value.lower() return value in ('1', 'true', 'yes') @classmethod def _exclude_files_parser(cls, key): """Returns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable """ def parser(value): exclude_directive = 'file:' if value.startswith(exclude_directive): raise ValueError( 'Only strings are accepted for the {0} field, ' 'files are not accepted'.format(key)) return value return parser @classmethod def _parse_file(cls, value): """Represents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtype: str """ include_directive = 'file:' if not isinstance(value, string_types): return value if not value.startswith(include_directive): return value spec = value[len(include_directive):] filepaths = (os.path.abspath(path.strip()) for path in spec.split(',')) return '\n'.join( cls._read_file(path) for path in filepaths if (cls._assert_local(path) or True) and os.path.isfile(path) ) @staticmethod def _assert_local(filepath): if not filepath.startswith(os.getcwd()): raise DistutilsOptionError( '`file:` directive can not access %s' % filepath) @staticmethod def _read_file(filepath): with io.open(filepath, encoding='utf-8') as f: return f.read() @classmethod def _parse_attr(cls, value, package_dir=None): """Represents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str """ attr_directive = 'attr:' if not value.startswith(attr_directive): return value attrs_path = value.replace(attr_directive, '').strip().split('.') attr_name = attrs_path.pop() module_name = '.'.join(attrs_path) module_name = module_name or '__init__' parent_path = os.getcwd() if package_dir: if attrs_path[0] in package_dir: # A custom path was specified for the module we want to import custom_path = package_dir[attrs_path[0]] parts = custom_path.rsplit('/', 1) if len(parts) > 1: parent_path = os.path.join(os.getcwd(), parts[0]) module_name = parts[1] else: module_name = custom_path elif '' in package_dir: # A custom parent directory was specified for all root modules parent_path = os.path.join(os.getcwd(), package_dir['']) sys.path.insert(0, parent_path) try: module = import_module(module_name) value = getattr(module, attr_name) finally: sys.path = sys.path[1:] return value @classmethod def _get_parser_compound(cls, *parse_methods): """Returns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable """ def parse(value): parsed = value for method in parse_methods: parsed = method(parsed) return parsed return parse @classmethod def _parse_section_to_dict(cls, section_options, values_parser=None): """Parses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict """ value = {} values_parser = values_parser or (lambda val: val) for key, (_, val) in section_options.items(): value[key] = values_parser(val) return value def parse_section(self, section_options): """Parses configuration file section. :param dict section_options: """ for (name, (_, value)) in section_options.items(): try: self[name] = value except KeyError: pass # Keep silent for a new option may appear anytime. def parse(self): """Parses configuration file items from one or more related sections. """ for section_name, section_options in self.sections.items(): method_postfix = '' if section_name: # [section.option] variant method_postfix = '_%s' % section_name section_parser_method = getattr( self, # Dots in section names are translated into dunderscores. ('parse_section%s' % method_postfix).replace('.', '__'), None) if section_parser_method is None: raise DistutilsOptionError( 'Unsupported distribution option section: [%s.%s]' % ( self.section_prefix, section_name)) section_parser_method(section_options) def _deprecated_config_handler(self, func, msg, warning_class): """ this function will wrap around parameters that are deprecated :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around """ @wraps(func) def config_handler(*args, **kwargs): warnings.warn(msg, warning_class) return func(*args, **kwargs) return config_handler class ConfigMetadataHandler(ConfigHandler): section_prefix = 'metadata' aliases = { 'home_page': 'url', 'summary': 'description', 'classifier': 'classifiers', 'platform': 'platforms', } strict_mode = False """We need to keep it loose, to be partially compatible with `pbr` and `d2to1` packages which also uses `metadata` section. """ def __init__(self, target_obj, options, ignore_option_errors=False, package_dir=None): super(ConfigMetadataHandler, self).__init__(target_obj, options, ignore_option_errors) self.package_dir = package_dir @property def parsers(self): """Metadata item name to parser function mapping.""" parse_list = self._parse_list parse_file = self._parse_file parse_dict = self._parse_dict exclude_files_parser = self._exclude_files_parser return { 'platforms': parse_list, 'keywords': parse_list, 'provides': parse_list, 'requires': self._deprecated_config_handler( parse_list, "The requires parameter is deprecated, please use " "install_requires for runtime dependencies.", DeprecationWarning), 'obsoletes': parse_list, 'classifiers': self._get_parser_compound(parse_file, parse_list), 'license': exclude_files_parser('license'), 'description': parse_file, 'long_description': parse_file, 'version': self._parse_version, 'project_urls': parse_dict, } def _parse_version(self, value): """Parses `version` option value. :param value: :rtype: str """ version = self._parse_file(value) if version != value: version = version.strip() # Be strict about versions loaded from file because it's easy to # accidentally include newlines and other unintended content if isinstance(parse(version), LegacyVersion): tmpl = ( 'Version loaded from {value} does not ' 'comply with PEP 440: {version}' ) raise DistutilsOptionError(tmpl.format(**locals())) return version version = self._parse_attr(value, self.package_dir) if callable(version): version = version() if not isinstance(version, string_types): if hasattr(version, '__iter__'): version = '.'.join(map(str, version)) else: version = '%s' % version return version class ConfigOptionsHandler(ConfigHandler): section_prefix = 'options' @property def parsers(self): """Metadata item name to parser function mapping.""" parse_list = self._parse_list parse_list_semicolon = partial(self._parse_list, separator=';') parse_bool = self._parse_bool parse_dict = self._parse_dict return { 'zip_safe': parse_bool, 'use_2to3': parse_bool, 'include_package_data': parse_bool, 'package_dir': parse_dict, 'use_2to3_fixers': parse_list, 'use_2to3_exclude_fixers': parse_list, 'convert_2to3_doctests': parse_list, 'scripts': parse_list, 'eager_resources': parse_list, 'dependency_links': parse_list, 'namespace_packages': parse_list, 'install_requires': parse_list_semicolon, 'setup_requires': parse_list_semicolon, 'tests_require': parse_list_semicolon, 'packages': self._parse_packages, 'entry_points': self._parse_file, 'py_modules': parse_list, 'python_requires': SpecifierSet, } def _parse_packages(self, value): """Parses `packages` option value. :param value: :rtype: list """ find_directives = ['find:', 'find_namespace:'] trimmed_value = value.strip() if trimmed_value not in find_directives: return self._parse_list(value) findns = trimmed_value == find_directives[1] if findns and not PY3: raise DistutilsOptionError( 'find_namespace: directive is unsupported on Python < 3.3') # Read function arguments from a dedicated section. find_kwargs = self.parse_section_packages__find( self.sections.get('packages.find', {})) if findns: from setuptools import find_namespace_packages as find_packages else: from setuptools import find_packages return find_packages(**find_kwargs) def parse_section_packages__find(self, section_options): """Parses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: """ section_data = self._parse_section_to_dict( section_options, self._parse_list) valid_keys = ['where', 'include', 'exclude'] find_kwargs = dict( [(k, v) for k, v in section_data.items() if k in valid_keys and v]) where = find_kwargs.get('where') if where is not None: find_kwargs['where'] = where[0] # cast list to single val return find_kwargs def parse_section_entry_points(self, section_options): """Parses `entry_points` configuration file section. :param dict section_options: """ parsed = self._parse_section_to_dict(section_options, self._parse_list) self['entry_points'] = parsed def _parse_package_data(self, section_options): parsed = self._parse_section_to_dict(section_options, self._parse_list) root = parsed.get('*') if root: parsed[''] = root del parsed['*'] return parsed def parse_section_package_data(self, section_options): """Parses `package_data` configuration file section. :param dict section_options: """ self['package_data'] = self._parse_package_data(section_options) def parse_section_exclude_package_data(self, section_options): """Parses `exclude_package_data` configuration file section. :param dict section_options: """ self['exclude_package_data'] = self._parse_package_data( section_options) def parse_section_extras_require(self, section_options): """Parses `extras_require` configuration file section. :param dict section_options: """ parse_list = partial(self._parse_list, separator=';') self['extras_require'] = self._parse_section_to_dict( section_options, parse_list) def parse_section_data_files(self, section_options): """Parses `data_files` configuration file section. :param dict section_options: """ parsed = self._parse_section_to_dict(section_options, self._parse_list) self['data_files'] = [(k, v) for k, v in parsed.items()] PK!m*m* pep425tags.pynu[# This file originally from pip: # https://github.com/pypa/pip/blob/8f4f15a5a95d7d5b511ceaee9ed261176c181970/src/pip/_internal/pep425tags.py """Generate and work with PEP 425 Compatibility Tags.""" from __future__ import absolute_import import distutils.util from distutils import log import platform import re import sys import sysconfig import warnings from collections import OrderedDict from .extern import six from . import glibc _osx_arch_pat = re.compile(r'(.+)_(\d+)_(\d+)_(.+)') def get_config_var(var): try: return sysconfig.get_config_var(var) except IOError as e: # Issue #1074 warnings.warn("{}".format(e), RuntimeWarning) return None def get_abbr_impl(): """Return abbreviated implementation name.""" if hasattr(sys, 'pypy_version_info'): pyimpl = 'pp' elif sys.platform.startswith('java'): pyimpl = 'jy' elif sys.platform == 'cli': pyimpl = 'ip' else: pyimpl = 'cp' return pyimpl def get_impl_ver(): """Return implementation version.""" impl_ver = get_config_var("py_version_nodot") if not impl_ver or get_abbr_impl() == 'pp': impl_ver = ''.join(map(str, get_impl_version_info())) return impl_ver def get_impl_version_info(): """Return sys.version_info-like tuple for use in decrementing the minor version.""" if get_abbr_impl() == 'pp': # as per https://github.com/pypa/pip/issues/2882 return (sys.version_info[0], sys.pypy_version_info.major, sys.pypy_version_info.minor) else: return sys.version_info[0], sys.version_info[1] def get_impl_tag(): """ Returns the Tag for this specific implementation. """ return "{}{}".format(get_abbr_impl(), get_impl_ver()) def get_flag(var, fallback, expected=True, warn=True): """Use a fallback method for determining SOABI flags if the needed config var is unset or unavailable.""" val = get_config_var(var) if val is None: if warn: log.debug("Config variable '%s' is unset, Python ABI tag may " "be incorrect", var) return fallback() return val == expected def get_abi_tag(): """Return the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).""" soabi = get_config_var('SOABI') impl = get_abbr_impl() if not soabi and impl in {'cp', 'pp'} and hasattr(sys, 'maxunicode'): d = '' m = '' u = '' if get_flag('Py_DEBUG', lambda: hasattr(sys, 'gettotalrefcount'), warn=(impl == 'cp')): d = 'd' if get_flag('WITH_PYMALLOC', lambda: impl == 'cp', warn=(impl == 'cp')): m = 'm' if get_flag('Py_UNICODE_SIZE', lambda: sys.maxunicode == 0x10ffff, expected=4, warn=(impl == 'cp' and six.PY2)) \ and six.PY2: u = 'u' abi = '%s%s%s%s%s' % (impl, get_impl_ver(), d, m, u) elif soabi and soabi.startswith('cpython-'): abi = 'cp' + soabi.split('-')[1] elif soabi: abi = soabi.replace('.', '_').replace('-', '_') else: abi = None return abi def _is_running_32bit(): return sys.maxsize == 2147483647 def get_platform(): """Return our platform name 'win32', 'linux_x86_64'""" if sys.platform == 'darwin': # distutils.util.get_platform() returns the release based on the value # of MACOSX_DEPLOYMENT_TARGET on which Python was built, which may # be significantly older than the user's current machine. release, _, machine = platform.mac_ver() split_ver = release.split('.') if machine == "x86_64" and _is_running_32bit(): machine = "i386" elif machine == "ppc64" and _is_running_32bit(): machine = "ppc" return 'macosx_{}_{}_{}'.format(split_ver[0], split_ver[1], machine) # XXX remove distutils dependency result = distutils.util.get_platform().replace('.', '_').replace('-', '_') if result == "linux_x86_64" and _is_running_32bit(): # 32 bit Python program (running on a 64 bit Linux): pip should only # install and run 32 bit compiled extensions in that case. result = "linux_i686" return result def is_manylinux1_compatible(): # Only Linux, and only x86-64 / i686 if get_platform() not in {"linux_x86_64", "linux_i686"}: return False # Check for presence of _manylinux module try: import _manylinux return bool(_manylinux.manylinux1_compatible) except (ImportError, AttributeError): # Fall through to heuristic check below pass # Check glibc version. CentOS 5 uses glibc 2.5. return glibc.have_compatible_glibc(2, 5) def get_darwin_arches(major, minor, machine): """Return a list of supported arches (including group arches) for the given major, minor and machine architecture of a macOS machine. """ arches = [] def _supports_arch(major, minor, arch): # Looking at the application support for macOS versions in the chart # provided by https://en.wikipedia.org/wiki/OS_X#Versions it appears # our timeline looks roughly like: # # 10.0 - Introduces ppc support. # 10.4 - Introduces ppc64, i386, and x86_64 support, however the ppc64 # and x86_64 support is CLI only, and cannot be used for GUI # applications. # 10.5 - Extends ppc64 and x86_64 support to cover GUI applications. # 10.6 - Drops support for ppc64 # 10.7 - Drops support for ppc # # Given that we do not know if we're installing a CLI or a GUI # application, we must be conservative and assume it might be a GUI # application and behave as if ppc64 and x86_64 support did not occur # until 10.5. # # Note: The above information is taken from the "Application support" # column in the chart not the "Processor support" since I believe # that we care about what instruction sets an application can use # not which processors the OS supports. if arch == 'ppc': return (major, minor) <= (10, 5) if arch == 'ppc64': return (major, minor) == (10, 5) if arch == 'i386': return (major, minor) >= (10, 4) if arch == 'x86_64': return (major, minor) >= (10, 5) if arch in groups: for garch in groups[arch]: if _supports_arch(major, minor, garch): return True return False groups = OrderedDict([ ("fat", ("i386", "ppc")), ("intel", ("x86_64", "i386")), ("fat64", ("x86_64", "ppc64")), ("fat32", ("x86_64", "i386", "ppc")), ]) if _supports_arch(major, minor, machine): arches.append(machine) for garch in groups: if machine in groups[garch] and _supports_arch(major, minor, garch): arches.append(garch) arches.append('universal') return arches def get_supported(versions=None, noarch=False, platform=None, impl=None, abi=None): """Return a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. """ supported = [] # Versions must be given with respect to the preference if versions is None: versions = [] version_info = get_impl_version_info() major = version_info[:-1] # Support all previous minor Python versions. for minor in range(version_info[-1], -1, -1): versions.append(''.join(map(str, major + (minor,)))) impl = impl or get_abbr_impl() abis = [] abi = abi or get_abi_tag() if abi: abis[0:0] = [abi] abi3s = set() import imp for suffix in imp.get_suffixes(): if suffix[0].startswith('.abi'): abi3s.add(suffix[0].split('.', 2)[1]) abis.extend(sorted(list(abi3s))) abis.append('none') if not noarch: arch = platform or get_platform() if arch.startswith('macosx'): # support macosx-10.6-intel on macosx-10.9-x86_64 match = _osx_arch_pat.match(arch) if match: name, major, minor, actual_arch = match.groups() tpl = '{}_{}_%i_%s'.format(name, major) arches = [] for m in reversed(range(int(minor) + 1)): for a in get_darwin_arches(int(major), m, actual_arch): arches.append(tpl % (m, a)) else: # arch pattern didn't match (?!) arches = [arch] elif platform is None and is_manylinux1_compatible(): arches = [arch.replace('linux', 'manylinux1'), arch] else: arches = [arch] # Current version, current API (built specifically for our Python): for abi in abis: for arch in arches: supported.append(('%s%s' % (impl, versions[0]), abi, arch)) # abi3 modules compatible with older version of Python for version in versions[1:]: # abi3 was introduced in Python 3.2 if version in {'31', '30'}: break for abi in abi3s: # empty set if not Python 3 for arch in arches: supported.append(("%s%s" % (impl, version), abi, arch)) # Has binaries, does not use the Python API: for arch in arches: supported.append(('py%s' % (versions[0][0]), 'none', arch)) # No abi / arch, but requires our implementation: supported.append(('%s%s' % (impl, versions[0]), 'none', 'any')) # Tagged specifically as being cross-version compatible # (with just the major version specified) supported.append(('%s%s' % (impl, versions[0][0]), 'none', 'any')) # No abi / arch, generic Python for i, version in enumerate(versions): supported.append(('py%s' % (version,), 'none', 'any')) if i == 0: supported.append(('py%s' % (version[0]), 'none', 'any')) return supported implementation_tag = get_impl_tag() PK!Q lib2to3_ex.pynu[""" Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. """ from distutils.util import Mixin2to3 as _Mixin2to3 from distutils import log from lib2to3.refactor import RefactoringTool, get_fixers_from_package import setuptools class DistutilsRefactoringTool(RefactoringTool): def log_error(self, msg, *args, **kw): log.error(msg, *args) def log_message(self, msg, *args): log.info(msg, *args) def log_debug(self, msg, *args): log.debug(msg, *args) class Mixin2to3(_Mixin2to3): def run_2to3(self, files, doctests=False): # See of the distribution option has been set, otherwise check the # setuptools default. if self.distribution.use_2to3 is not True: return if not files: return log.info("Fixing " + " ".join(files)) self.__build_fixer_names() self.__exclude_fixers() if doctests: if setuptools.run_2to3_on_doctests: r = DistutilsRefactoringTool(self.fixer_names) r.refactor(files, write=True, doctests_only=True) else: _Mixin2to3.run_2to3(self, files) def __build_fixer_names(self): if self.fixer_names: return self.fixer_names = [] for p in setuptools.lib2to3_fixer_packages: self.fixer_names.extend(get_fixers_from_package(p)) if self.distribution.use_2to3_fixers is not None: for p in self.distribution.use_2to3_fixers: self.fixer_names.extend(get_fixers_from_package(p)) def __exclude_fixers(self): excluded_fixers = getattr(self, 'exclude_fixers', []) if self.distribution.use_2to3_exclude_fixers is not None: excluded_fixers.extend(self.distribution.use_2to3_exclude_fixers) for fixer_name in excluded_fixers: if fixer_name in self.fixer_names: self.fixer_names.remove(fixer_name) PK!Sc77 sandbox.pynu[import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle import textwrap from setuptools.extern import six from setuptools.extern.six.moves import builtins, map import pkg_resources.py31compat if sys.platform.startswith('java'): import org.python.modules.posix.PosixModule as _os else: _os = sys.modules[os.name] try: _file = file except NameError: _file = None _open = open from distutils.errors import DistutilsError from pkg_resources import working_set __all__ = [ "AbstractSandbox", "DirectorySandbox", "SandboxViolation", "run_setup", ] def _execfile(filename, globals, locals=None): """ Python 3 implementation of execfile. """ mode = 'rb' with open(filename, mode) as stream: script = stream.read() if locals is None: locals = globals code = compile(script, filename, 'exec') exec(code, globals, locals) @contextlib.contextmanager def save_argv(repl=None): saved = sys.argv[:] if repl is not None: sys.argv[:] = repl try: yield saved finally: sys.argv[:] = saved @contextlib.contextmanager def save_path(): saved = sys.path[:] try: yield saved finally: sys.path[:] = saved @contextlib.contextmanager def override_temp(replacement): """ Monkey-patch tempfile.tempdir with replacement, ensuring it exists """ pkg_resources.py31compat.makedirs(replacement, exist_ok=True) saved = tempfile.tempdir tempfile.tempdir = replacement try: yield finally: tempfile.tempdir = saved @contextlib.contextmanager def pushd(target): saved = os.getcwd() os.chdir(target) try: yield saved finally: os.chdir(saved) class UnpickleableException(Exception): """ An exception representing another Exception that could not be pickled. """ @staticmethod def dump(type, exc): """ Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. """ try: return pickle.dumps(type), pickle.dumps(exc) except Exception: # get UnpickleableException inside the sandbox from setuptools.sandbox import UnpickleableException as cls return cls.dump(cls, cls(repr(exc))) class ExceptionSaver: """ A Context Manager that will save an exception, serialized, and restore it later. """ def __enter__(self): return self def __exit__(self, type, exc, tb): if not exc: return # dump the exception self._saved = UnpickleableException.dump(type, exc) self._tb = tb # suppress the exception return True def resume(self): "restore and re-raise any exception" if '_saved' not in vars(self): return type, exc = map(pickle.loads, self._saved) six.reraise(type, exc, self._tb) @contextlib.contextmanager def save_modules(): """ Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. """ saved = sys.modules.copy() with ExceptionSaver() as saved_exc: yield saved sys.modules.update(saved) # remove any modules imported since del_modules = ( mod_name for mod_name in sys.modules if mod_name not in saved # exclude any encodings modules. See #285 and not mod_name.startswith('encodings.') ) _clear_modules(del_modules) saved_exc.resume() def _clear_modules(module_names): for mod_name in list(module_names): del sys.modules[mod_name] @contextlib.contextmanager def save_pkg_resources_state(): saved = pkg_resources.__getstate__() try: yield saved finally: pkg_resources.__setstate__(saved) @contextlib.contextmanager def setup_context(setup_dir): temp_dir = os.path.join(setup_dir, 'temp') with save_pkg_resources_state(): with save_modules(): hide_setuptools() with save_path(): with save_argv(): with override_temp(temp_dir): with pushd(setup_dir): # ensure setuptools commands are available __import__('setuptools') yield def _needs_hiding(mod_name): """ >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True """ pattern = re.compile(r'(setuptools|pkg_resources|distutils|Cython)(\.|$)') return bool(pattern.match(mod_name)) def hide_setuptools(): """ Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. """ modules = filter(_needs_hiding, sys.modules) _clear_modules(modules) def run_setup(setup_script, args): """Run a distutils setup script, sandboxed in its directory""" setup_dir = os.path.abspath(os.path.dirname(setup_script)) with setup_context(setup_dir): try: sys.argv[:] = [setup_script] + list(args) sys.path.insert(0, setup_dir) # reset to include setup dir, w/clean callback list working_set.__init__() working_set.callbacks.append(lambda dist: dist.activate()) # __file__ should be a byte string on Python 2 (#712) dunder_file = ( setup_script if isinstance(setup_script, str) else setup_script.encode(sys.getfilesystemencoding()) ) with DirectorySandbox(setup_dir): ns = dict(__file__=dunder_file, __name__='__main__') _execfile(setup_script, ns) except SystemExit as v: if v.args and v.args[0]: raise # Normal exit, just return class AbstractSandbox: """Wrap 'os' module and 'open()' builtin for virtualizing setup scripts""" _active = False def __init__(self): self._attrs = [ name for name in dir(_os) if not name.startswith('_') and hasattr(self, name) ] def _copy(self, source): for name in self._attrs: setattr(os, name, getattr(source, name)) def __enter__(self): self._copy(self) if _file: builtins.file = self._file builtins.open = self._open self._active = True def __exit__(self, exc_type, exc_value, traceback): self._active = False if _file: builtins.file = _file builtins.open = _open self._copy(_os) def run(self, func): """Run 'func' under os sandboxing""" with self: return func() def _mk_dual_path_wrapper(name): original = getattr(_os, name) def wrap(self, src, dst, *args, **kw): if self._active: src, dst = self._remap_pair(name, src, dst, *args, **kw) return original(src, dst, *args, **kw) return wrap for name in ["rename", "link", "symlink"]: if hasattr(_os, name): locals()[name] = _mk_dual_path_wrapper(name) def _mk_single_path_wrapper(name, original=None): original = original or getattr(_os, name) def wrap(self, path, *args, **kw): if self._active: path = self._remap_input(name, path, *args, **kw) return original(path, *args, **kw) return wrap if _file: _file = _mk_single_path_wrapper('file', _file) _open = _mk_single_path_wrapper('open', _open) for name in [ "stat", "listdir", "chdir", "open", "chmod", "chown", "mkdir", "remove", "unlink", "rmdir", "utime", "lchown", "chroot", "lstat", "startfile", "mkfifo", "mknod", "pathconf", "access" ]: if hasattr(_os, name): locals()[name] = _mk_single_path_wrapper(name) def _mk_single_with_return(name): original = getattr(_os, name) def wrap(self, path, *args, **kw): if self._active: path = self._remap_input(name, path, *args, **kw) return self._remap_output(name, original(path, *args, **kw)) return original(path, *args, **kw) return wrap for name in ['readlink', 'tempnam']: if hasattr(_os, name): locals()[name] = _mk_single_with_return(name) def _mk_query(name): original = getattr(_os, name) def wrap(self, *args, **kw): retval = original(*args, **kw) if self._active: return self._remap_output(name, retval) return retval return wrap for name in ['getcwd', 'tmpnam']: if hasattr(_os, name): locals()[name] = _mk_query(name) def _validate_path(self, path): """Called to remap or validate any path, whether input or output""" return path def _remap_input(self, operation, path, *args, **kw): """Called for path inputs""" return self._validate_path(path) def _remap_output(self, operation, path): """Called for path outputs""" return self._validate_path(path) def _remap_pair(self, operation, src, dst, *args, **kw): """Called for path pairs like rename, link, and symlink operations""" return ( self._remap_input(operation + '-from', src, *args, **kw), self._remap_input(operation + '-to', dst, *args, **kw) ) if hasattr(os, 'devnull'): _EXCEPTIONS = [os.devnull,] else: _EXCEPTIONS = [] class DirectorySandbox(AbstractSandbox): """Restrict operations to a single subdirectory - pseudo-chroot""" write_ops = dict.fromkeys([ "open", "chmod", "chown", "mkdir", "remove", "unlink", "rmdir", "utime", "lchown", "chroot", "mkfifo", "mknod", "tempnam", ]) _exception_patterns = [ # Allow lib2to3 to attempt to save a pickled grammar object (#121) r'.*lib2to3.*\.pickle$', ] "exempt writing to paths that match the pattern" def __init__(self, sandbox, exceptions=_EXCEPTIONS): self._sandbox = os.path.normcase(os.path.realpath(sandbox)) self._prefix = os.path.join(self._sandbox, '') self._exceptions = [ os.path.normcase(os.path.realpath(path)) for path in exceptions ] AbstractSandbox.__init__(self) def _violation(self, operation, *args, **kw): from setuptools.sandbox import SandboxViolation raise SandboxViolation(operation, args, kw) if _file: def _file(self, path, mode='r', *args, **kw): if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path): self._violation("file", path, mode, *args, **kw) return _file(path, mode, *args, **kw) def _open(self, path, mode='r', *args, **kw): if mode not in ('r', 'rt', 'rb', 'rU', 'U') and not self._ok(path): self._violation("open", path, mode, *args, **kw) return _open(path, mode, *args, **kw) def tmpnam(self): self._violation("tmpnam") def _ok(self, path): active = self._active try: self._active = False realpath = os.path.normcase(os.path.realpath(path)) return ( self._exempted(realpath) or realpath == self._sandbox or realpath.startswith(self._prefix) ) finally: self._active = active def _exempted(self, filepath): start_matches = ( filepath.startswith(exception) for exception in self._exceptions ) pattern_matches = ( re.match(pattern, filepath) for pattern in self._exception_patterns ) candidates = itertools.chain(start_matches, pattern_matches) return any(candidates) def _remap_input(self, operation, path, *args, **kw): """Called for path inputs""" if operation in self.write_ops and not self._ok(path): self._violation(operation, os.path.realpath(path), *args, **kw) return path def _remap_pair(self, operation, src, dst, *args, **kw): """Called for path pairs like rename, link, and symlink operations""" if not self._ok(src) or not self._ok(dst): self._violation(operation, src, dst, *args, **kw) return (src, dst) def open(self, file, flags, mode=0o777, *args, **kw): """Called for low-level os.open()""" if flags & WRITE_FLAGS and not self._ok(file): self._violation("os.open", file, flags, mode, *args, **kw) return _os.open(file, flags, mode, *args, **kw) WRITE_FLAGS = functools.reduce( operator.or_, [getattr(_os, a, 0) for a in "O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARY".split()] ) class SandboxViolation(DistutilsError): """A setup script attempted to modify the filesystem outside the sandbox""" tmpl = textwrap.dedent(""" SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. """).lstrip() def __str__(self): cmd, args, kwargs = self.args return self.tmpl.format(**locals()) PK!HLb version.pynu[import pkg_resources try: __version__ = pkg_resources.get_distribution('setuptools').version except Exception: __version__ = 'unknown' PK!J J glibc.pynu[# This file originally from pip: # https://github.com/pypa/pip/blob/8f4f15a5a95d7d5b511ceaee9ed261176c181970/src/pip/_internal/utils/glibc.py from __future__ import absolute_import import ctypes import re import warnings def glibc_version_string(): "Returns glibc version string, or None if not using glibc." # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen # manpage says, "If filename is NULL, then the returned handle is for the # main program". This way we can let the linker do the work to figure out # which libc our process is actually using. process_namespace = ctypes.CDLL(None) try: gnu_get_libc_version = process_namespace.gnu_get_libc_version except AttributeError: # Symbol doesn't exist -> therefore, we are not linked to # glibc. return None # Call gnu_get_libc_version, which returns a string like "2.5" gnu_get_libc_version.restype = ctypes.c_char_p version_str = gnu_get_libc_version() # py2 / py3 compatibility: if not isinstance(version_str, str): version_str = version_str.decode("ascii") return version_str # Separated out from have_compatible_glibc for easier unit testing def check_glibc_version(version_str, required_major, minimum_minor): # Parse string and check against requested version. # # We use a regexp instead of str.split because we want to discard any # random junk that might come after the minor version -- this might happen # in patched/forked versions of glibc (e.g. Linaro's version of glibc # uses version strings like "2.20-2014.11"). See gh-3588. m = re.match(r"(?P[0-9]+)\.(?P[0-9]+)", version_str) if not m: warnings.warn("Expected glibc version with 2 components major.minor," " got: %s" % version_str, RuntimeWarning) return False return (int(m.group("major")) == required_major and int(m.group("minor")) >= minimum_minor) def have_compatible_glibc(required_major, minimum_minor): version_str = glibc_version_string() if version_str is None: return False return check_glibc_version(version_str, required_major, minimum_minor) # platform.libc_ver regularly returns completely nonsensical glibc # versions. E.g. on my computer, platform says: # # ~$ python2.7 -c 'import platform; print(platform.libc_ver())' # ('glibc', '2.7') # ~$ python3.5 -c 'import platform; print(platform.libc_ver())' # ('glibc', '2.9') # # But the truth is: # # ~$ ldd --version # ldd (Debian GLIBC 2.22-11) 2.22 # # This is unfortunate, because it means that the linehaul data on libc # versions that was generated by pip 8.1.2 and earlier is useless and # misleading. Solution: instead of using platform, use our code that actually # works. def libc_ver(): """Try to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. """ glibc_version = glibc_version_string() if glibc_version is None: return ("", "") else: return ("glibc", glibc_version) PK!؍package_index.pynu["""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib import itertools import warnings from functools import wraps from setuptools.extern import six from setuptools.extern.six.moves import urllib, http_client, configparser, map import setuptools from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, Environment, find_distributions, safe_name, safe_version, to_filename, Requirement, DEVELOP_DIST, EGG_DIST, ) from setuptools import ssl_support from distutils import log from distutils.errors import DistutilsError from fnmatch import translate from setuptools.py27compat import get_all_headers from setuptools.py33compat import unescape from setuptools.wheel import Wheel __metaclass__ = type EGG_FRAGMENT = re.compile(r'^egg=([-A-Za-z0-9_.+!]+)$') HREF = re.compile(r"""href\s*=\s*['"]?([^'"> ]+)""", re.I) PYPI_MD5 = re.compile( r'([^<]+)\n\s+\(md5\)' ) URL_SCHEME = re.compile('([-+.a-z0-9]{2,}):', re.I).match EXTENSIONS = ".tar.gz .tar.bz2 .tar .zip .tgz".split() __all__ = [ 'PackageIndex', 'distros_for_url', 'parse_bdist_wininst', 'interpret_distro_name', ] _SOCKET_TIMEOUT = 15 _tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}" user_agent = _tmpl.format(py_major='{}.{}'.format(*sys.version_info), setuptools=setuptools) def parse_requirement_arg(spec): try: return Requirement.parse(spec) except ValueError: raise DistutilsError( "Not a URL, existing file, or requirement spec: %r" % (spec,) ) def parse_bdist_wininst(name): """Return (base,pyversion) or (None,None) for possible .exe name""" lower = name.lower() base, py_ver, plat = None, None, None if lower.endswith('.exe'): if lower.endswith('.win32.exe'): base = name[:-10] plat = 'win32' elif lower.startswith('.win32-py', -16): py_ver = name[-7:-4] base = name[:-16] plat = 'win32' elif lower.endswith('.win-amd64.exe'): base = name[:-14] plat = 'win-amd64' elif lower.startswith('.win-amd64-py', -20): py_ver = name[-7:-4] base = name[:-20] plat = 'win-amd64' return base, py_ver, plat def egg_info_for_url(url): parts = urllib.parse.urlparse(url) scheme, server, path, parameters, query, fragment = parts base = urllib.parse.unquote(path.split('/')[-1]) if server == 'sourceforge.net' and base == 'download': # XXX Yuck base = urllib.parse.unquote(path.split('/')[-2]) if '#' in base: base, fragment = base.split('#', 1) return base, fragment def distros_for_url(url, metadata=None): """Yield egg or source distribution objects that might be found at a URL""" base, fragment = egg_info_for_url(url) for dist in distros_for_location(url, base, metadata): yield dist if fragment: match = EGG_FRAGMENT.match(fragment) if match: for dist in interpret_distro_name( url, match.group(1), metadata, precedence=CHECKOUT_DIST ): yield dist def distros_for_location(location, basename, metadata=None): """Yield egg or source distribution objects based on basename""" if basename.endswith('.egg.zip'): basename = basename[:-4] # strip the .zip if basename.endswith('.egg') and '-' in basename: # only one, unambiguous interpretation return [Distribution.from_location(location, basename, metadata)] if basename.endswith('.whl') and '-' in basename: wheel = Wheel(basename) if not wheel.is_compatible(): return [] return [Distribution( location=location, project_name=wheel.project_name, version=wheel.version, # Increase priority over eggs. precedence=EGG_DIST + 1, )] if basename.endswith('.exe'): win_base, py_ver, platform = parse_bdist_wininst(basename) if win_base is not None: return interpret_distro_name( location, win_base, metadata, py_ver, BINARY_DIST, platform ) # Try source distro extensions (.zip, .tgz, etc.) # for ext in EXTENSIONS: if basename.endswith(ext): basename = basename[:-len(ext)] return interpret_distro_name(location, basename, metadata) return [] # no extension matched def distros_for_filename(filename, metadata=None): """Yield possible egg or source distribution objects based on a filename""" return distros_for_location( normalize_path(filename), os.path.basename(filename), metadata ) def interpret_distro_name( location, basename, metadata, py_version=None, precedence=SOURCE_DIST, platform=None ): """Generate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! """ # Generate alternative interpretations of a source distro name # Because some packages are ambiguous as to name/versions split # e.g. "adns-python-1.1.0", "egenix-mx-commercial", etc. # So, we generate each possible interepretation (e.g. "adns, python-1.1.0" # "adns-python, 1.1.0", and "adns-python-1.1.0, no version"). In practice, # the spurious interpretations should be ignored, because in the event # there's also an "adns" package, the spurious "python-1.1.0" version will # compare lower than any numeric version number, and is therefore unlikely # to match a request for it. It's still a potential problem, though, and # in the long run PyPI and the distutils should go for "safe" names and # versions in distribution archive names (sdist and bdist). parts = basename.split('-') if not py_version and any(re.match(r'py\d\.\d$', p) for p in parts[2:]): # it is a bdist_dumb, not an sdist -- bail out return for p in range(1, len(parts) + 1): yield Distribution( location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]), py_version=py_version, precedence=precedence, platform=platform ) # From Python 2.7 docs def unique_everseen(iterable, key=None): "List unique elements, preserving order. Remember all elements ever seen." # unique_everseen('AAAABBBCCDAABBB') --> A B C D # unique_everseen('ABBCcAD', str.lower) --> A B C D seen = set() seen_add = seen.add if key is None: for element in six.moves.filterfalse(seen.__contains__, iterable): seen_add(element) yield element else: for element in iterable: k = key(element) if k not in seen: seen_add(k) yield element def unique_values(func): """ Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. """ @wraps(func) def wrapper(*args, **kwargs): return unique_everseen(func(*args, **kwargs)) return wrapper REL = re.compile(r"""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I) # this line is here to fix emacs' cruddy broken syntax highlighting @unique_values def find_external_links(url, page): """Find rel="homepage" and rel="download" links in `page`, yielding URLs""" for match in REL.finditer(page): tag, rel = match.groups() rels = set(map(str.strip, rel.lower().split(','))) if 'homepage' in rels or 'download' in rels: for match in HREF.finditer(tag): yield urllib.parse.urljoin(url, htmldecode(match.group(1))) for tag in ("Home Page", "Download URL"): pos = page.find(tag) if pos != -1: match = HREF.search(page, pos) if match: yield urllib.parse.urljoin(url, htmldecode(match.group(1))) class ContentChecker: """ A null content checker that defines the interface for checking content """ def feed(self, block): """ Feed a block of data to the hash. """ return def is_valid(self): """ Check the hash. Return False if validation fails. """ return True def report(self, reporter, template): """ Call reporter with information about the checker (hash name) substituted into the template. """ return class HashChecker(ContentChecker): pattern = re.compile( r'(?Psha1|sha224|sha384|sha256|sha512|md5)=' r'(?P[a-f0-9]+)' ) def __init__(self, hash_name, expected): self.hash_name = hash_name self.hash = hashlib.new(hash_name) self.expected = expected @classmethod def from_url(cls, url): "Construct a (possibly null) ContentChecker from a URL" fragment = urllib.parse.urlparse(url)[-1] if not fragment: return ContentChecker() match = cls.pattern.search(fragment) if not match: return ContentChecker() return cls(**match.groupdict()) def feed(self, block): self.hash.update(block) def is_valid(self): return self.hash.hexdigest() == self.expected def report(self, reporter, template): msg = template % self.hash_name return reporter(msg) class PackageIndex(Environment): """A distribution index that scans web pages for download URLs""" def __init__( self, index_url="https://pypi.org/simple/", hosts=('*',), ca_bundle=None, verify_ssl=True, *args, **kw ): Environment.__init__(self, *args, **kw) self.index_url = index_url + "/" [:not index_url.endswith('/')] self.scanned_urls = {} self.fetched_urls = {} self.package_pages = {} self.allows = re.compile('|'.join(map(translate, hosts))).match self.to_scan = [] use_ssl = ( verify_ssl and ssl_support.is_available and (ca_bundle or ssl_support.find_ca_bundle()) ) if use_ssl: self.opener = ssl_support.opener_for(ca_bundle) else: self.opener = urllib.request.urlopen def process_url(self, url, retrieve=False): """Evaluate a URL as a possible download, and maybe retrieve it""" if url in self.scanned_urls and not retrieve: return self.scanned_urls[url] = True if not URL_SCHEME(url): self.process_filename(url) return else: dists = list(distros_for_url(url)) if dists: if not self.url_ok(url): return self.debug("Found link: %s", url) if dists or not retrieve or url in self.fetched_urls: list(map(self.add, dists)) return # don't need the actual page if not self.url_ok(url): self.fetched_urls[url] = True return self.info("Reading %s", url) self.fetched_urls[url] = True # prevent multiple fetch attempts tmpl = "Download error on %s: %%s -- Some packages may not be found!" f = self.open_url(url, tmpl % url) if f is None: return self.fetched_urls[f.url] = True if 'html' not in f.headers.get('content-type', '').lower(): f.close() # not html, we can't process it return base = f.url # handle redirects page = f.read() if not isinstance(page, str): # In Python 3 and got bytes but want str. if isinstance(f, urllib.error.HTTPError): # Errors have no charset, assume latin1: charset = 'latin-1' else: charset = f.headers.get_param('charset') or 'latin-1' page = page.decode(charset, "ignore") f.close() for match in HREF.finditer(page): link = urllib.parse.urljoin(base, htmldecode(match.group(1))) self.process_url(link) if url.startswith(self.index_url) and getattr(f, 'code', None) != 404: page = self.process_index(url, page) def process_filename(self, fn, nested=False): # process filenames or directories if not os.path.exists(fn): self.warn("Not found: %s", fn) return if os.path.isdir(fn) and not nested: path = os.path.realpath(fn) for item in os.listdir(path): self.process_filename(os.path.join(path, item), True) dists = distros_for_filename(fn) if dists: self.debug("Found: %s", fn) list(map(self.add, dists)) def url_ok(self, url, fatal=False): s = URL_SCHEME(url) is_file = s and s.group(1).lower() == 'file' if is_file or self.allows(urllib.parse.urlparse(url)[1]): return True msg = ( "\nNote: Bypassing %s (disallowed host; see " "http://bit.ly/2hrImnY for details).\n") if fatal: raise DistutilsError(msg % url) else: self.warn(msg, url) def scan_egg_links(self, search_path): dirs = filter(os.path.isdir, search_path) egg_links = ( (path, entry) for path in dirs for entry in os.listdir(path) if entry.endswith('.egg-link') ) list(itertools.starmap(self.scan_egg_link, egg_links)) def scan_egg_link(self, path, entry): with open(os.path.join(path, entry)) as raw_lines: # filter non-empty lines lines = list(filter(None, map(str.strip, raw_lines))) if len(lines) != 2: # format is not recognized; punt return egg_path, setup_path = lines for dist in find_distributions(os.path.join(path, egg_path)): dist.location = os.path.join(path, *lines) dist.precedence = SOURCE_DIST self.add(dist) def process_index(self, url, page): """Process the contents of a PyPI page""" def scan(link): # Process a URL to see if it's for a package page if link.startswith(self.index_url): parts = list(map( urllib.parse.unquote, link[len(self.index_url):].split('/') )) if len(parts) == 2 and '#' not in parts[1]: # it's a package page, sanitize and index it pkg = safe_name(parts[0]) ver = safe_version(parts[1]) self.package_pages.setdefault(pkg.lower(), {})[link] = True return to_filename(pkg), to_filename(ver) return None, None # process an index page into the package-page index for match in HREF.finditer(page): try: scan(urllib.parse.urljoin(url, htmldecode(match.group(1)))) except ValueError: pass pkg, ver = scan(url) # ensure this page is in the page index if pkg: # process individual package page for new_url in find_external_links(url, page): # Process the found URL base, frag = egg_info_for_url(new_url) if base.endswith('.py') and not frag: if ver: new_url += '#egg=%s-%s' % (pkg, ver) else: self.need_version_info(url) self.scan_url(new_url) return PYPI_MD5.sub( lambda m: '%s' % m.group(1, 3, 2), page ) else: return "" # no sense double-scanning non-package pages def need_version_info(self, url): self.scan_all( "Page at %s links to .py file(s) without version info; an index " "scan is required.", url ) def scan_all(self, msg=None, *args): if self.index_url not in self.fetched_urls: if msg: self.warn(msg, *args) self.info( "Scanning index of all packages (this may take a while)" ) self.scan_url(self.index_url) def find_packages(self, requirement): self.scan_url(self.index_url + requirement.unsafe_name + '/') if not self.package_pages.get(requirement.key): # Fall back to safe version of the name self.scan_url(self.index_url + requirement.project_name + '/') if not self.package_pages.get(requirement.key): # We couldn't find the target package, so search the index page too self.not_found_in_index(requirement) for url in list(self.package_pages.get(requirement.key, ())): # scan each page that might be related to the desired package self.scan_url(url) def obtain(self, requirement, installer=None): self.prescan() self.find_packages(requirement) for dist in self[requirement.key]: if dist in requirement: return dist self.debug("%s does not match %s", requirement, dist) return super(PackageIndex, self).obtain(requirement, installer) def check_hash(self, checker, filename, tfp): """ checker is a ContentChecker """ checker.report( self.debug, "Validating %%s checksum for %s" % filename) if not checker.is_valid(): tfp.close() os.unlink(filename) raise DistutilsError( "%s validation failed for %s; " "possible download problem?" % (checker.hash.name, os.path.basename(filename)) ) def add_find_links(self, urls): """Add `urls` to the list that will be prescanned for searches""" for url in urls: if ( self.to_scan is None # if we have already "gone online" or not URL_SCHEME(url) # or it's a local file/directory or url.startswith('file:') or list(distros_for_url(url)) # or a direct package link ): # then go ahead and process it now self.scan_url(url) else: # otherwise, defer retrieval till later self.to_scan.append(url) def prescan(self): """Scan urls scheduled for prescanning (e.g. --find-links)""" if self.to_scan: list(map(self.scan_url, self.to_scan)) self.to_scan = None # from now on, go ahead and process immediately def not_found_in_index(self, requirement): if self[requirement.key]: # we've seen at least one distro meth, msg = self.info, "Couldn't retrieve index page for %r" else: # no distros seen for this name, might be misspelled meth, msg = ( self.warn, "Couldn't find index page for %r (maybe misspelled?)") meth(msg, requirement.unsafe_name) self.scan_all() def download(self, spec, tmpdir): """Locate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. """ if not isinstance(spec, Requirement): scheme = URL_SCHEME(spec) if scheme: # It's a url, download it to tmpdir found = self._download_url(scheme.group(1), spec, tmpdir) base, fragment = egg_info_for_url(spec) if base.endswith('.py'): found = self.gen_setup(found, fragment, tmpdir) return found elif os.path.exists(spec): # Existing file or directory, just return it return spec else: spec = parse_requirement_arg(spec) return getattr(self.fetch_distribution(spec, tmpdir), 'location', None) def fetch_distribution( self, requirement, tmpdir, force_scan=False, source=False, develop_ok=False, local_index=None): """Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. """ # process a Requirement self.info("Searching for %s", requirement) skipped = {} dist = None def find(req, env=None): if env is None: env = self # Find a matching distribution; may be called more than once for dist in env[req.key]: if dist.precedence == DEVELOP_DIST and not develop_ok: if dist not in skipped: self.warn( "Skipping development or system egg: %s", dist, ) skipped[dist] = 1 continue test = ( dist in req and (dist.precedence <= SOURCE_DIST or not source) ) if test: loc = self.download(dist.location, tmpdir) dist.download_location = loc if os.path.exists(dist.download_location): return dist if force_scan: self.prescan() self.find_packages(requirement) dist = find(requirement) if not dist and local_index is not None: dist = find(requirement, local_index) if dist is None: if self.to_scan is not None: self.prescan() dist = find(requirement) if dist is None and not force_scan: self.find_packages(requirement) dist = find(requirement) if dist is None: self.warn( "No local packages or working download links found for %s%s", (source and "a source distribution of " or ""), requirement, ) else: self.info("Best match: %s", dist) return dist.clone(location=dist.download_location) def fetch(self, requirement, tmpdir, force_scan=False, source=False): """Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. """ dist = self.fetch_distribution(requirement, tmpdir, force_scan, source) if dist is not None: return dist.location return None def gen_setup(self, filename, fragment, tmpdir): match = EGG_FRAGMENT.match(fragment) dists = match and [ d for d in interpret_distro_name(filename, match.group(1), None) if d.version ] or [] if len(dists) == 1: # unambiguous ``#egg`` fragment basename = os.path.basename(filename) # Make sure the file has been downloaded to the temp dir. if os.path.dirname(filename) != tmpdir: dst = os.path.join(tmpdir, basename) from setuptools.command.easy_install import samefile if not samefile(filename, dst): shutil.copy2(filename, dst) filename = dst with open(os.path.join(tmpdir, 'setup.py'), 'w') as file: file.write( "from setuptools import setup\n" "setup(name=%r, version=%r, py_modules=[%r])\n" % ( dists[0].project_name, dists[0].version, os.path.splitext(basename)[0] ) ) return filename elif match: raise DistutilsError( "Can't unambiguously interpret project/version identifier %r; " "any dashes in the name or version should be escaped using " "underscores. %r" % (fragment, dists) ) else: raise DistutilsError( "Can't process plain .py files without an '#egg=name-version'" " suffix to enable automatic setup script generation." ) dl_blocksize = 8192 def _download_to(self, url, filename): self.info("Downloading %s", url) # Download the file fp = None try: checker = HashChecker.from_url(url) fp = self.open_url(url) if isinstance(fp, urllib.error.HTTPError): raise DistutilsError( "Can't download %s: %s %s" % (url, fp.code, fp.msg) ) headers = fp.info() blocknum = 0 bs = self.dl_blocksize size = -1 if "content-length" in headers: # Some servers return multiple Content-Length headers :( sizes = get_all_headers(headers, 'Content-Length') size = max(map(int, sizes)) self.reporthook(url, filename, blocknum, bs, size) with open(filename, 'wb') as tfp: while True: block = fp.read(bs) if block: checker.feed(block) tfp.write(block) blocknum += 1 self.reporthook(url, filename, blocknum, bs, size) else: break self.check_hash(checker, filename, tfp) return headers finally: if fp: fp.close() def reporthook(self, url, filename, blocknum, blksize, size): pass # no-op def open_url(self, url, warning=None): if url.startswith('file:'): return local_open(url) try: return open_with_auth(url, self.opener) except (ValueError, http_client.InvalidURL) as v: msg = ' '.join([str(arg) for arg in v.args]) if warning: self.warn(warning, msg) else: raise DistutilsError('%s %s' % (url, msg)) except urllib.error.HTTPError as v: return v except urllib.error.URLError as v: if warning: self.warn(warning, v.reason) else: raise DistutilsError("Download error for %s: %s" % (url, v.reason)) except http_client.BadStatusLine as v: if warning: self.warn(warning, v.line) else: raise DistutilsError( '%s returned a bad status line. The server might be ' 'down, %s' % (url, v.line) ) except (http_client.HTTPException, socket.error) as v: if warning: self.warn(warning, v) else: raise DistutilsError("Download error for %s: %s" % (url, v)) def _download_url(self, scheme, url, tmpdir): # Determine download filename # name, fragment = egg_info_for_url(url) if name: while '..' in name: name = name.replace('..', '.').replace('\\', '_') else: name = "__downloaded__" # default if URL has no path contents if name.endswith('.egg.zip'): name = name[:-4] # strip the extra .zip before download filename = os.path.join(tmpdir, name) # Download the file # if scheme == 'svn' or scheme.startswith('svn+'): return self._download_svn(url, filename) elif scheme == 'git' or scheme.startswith('git+'): return self._download_git(url, filename) elif scheme.startswith('hg+'): return self._download_hg(url, filename) elif scheme == 'file': return urllib.request.url2pathname(urllib.parse.urlparse(url)[2]) else: self.url_ok(url, True) # raises error if not allowed return self._attempt_download(url, filename) def scan_url(self, url): self.process_url(url, True) def _attempt_download(self, url, filename): headers = self._download_to(url, filename) if 'html' in headers.get('content-type', '').lower(): return self._download_html(url, headers, filename) else: return filename def _download_html(self, url, headers, filename): file = open(filename) for line in file: if line.strip(): # Check for a subversion index page if re.search(r'([^- ]+ - )?Revision \d+:', line): # it's a subversion index page: file.close() os.unlink(filename) return self._download_svn(url, filename) break # not an index page file.close() os.unlink(filename) raise DistutilsError("Unexpected HTML page found at " + url) def _download_svn(self, url, filename): warnings.warn("SVN download support is deprecated", UserWarning) url = url.split('#', 1)[0] # remove any fragment for svn's sake creds = '' if url.lower().startswith('svn:') and '@' in url: scheme, netloc, path, p, q, f = urllib.parse.urlparse(url) if not netloc and path.startswith('//') and '/' in path[2:]: netloc, path = path[2:].split('/', 1) auth, host = _splituser(netloc) if auth: if ':' in auth: user, pw = auth.split(':', 1) creds = " --username=%s --password=%s" % (user, pw) else: creds = " --username=" + auth netloc = host parts = scheme, netloc, url, p, q, f url = urllib.parse.urlunparse(parts) self.info("Doing subversion checkout from %s to %s", url, filename) os.system("svn checkout%s -q %s %s" % (creds, url, filename)) return filename @staticmethod def _vcs_split_rev_from_url(url, pop_prefix=False): scheme, netloc, path, query, frag = urllib.parse.urlsplit(url) scheme = scheme.split('+', 1)[-1] # Some fragment identification fails path = path.split('#', 1)[0] rev = None if '@' in path: path, rev = path.rsplit('@', 1) # Also, discard fragment url = urllib.parse.urlunsplit((scheme, netloc, path, query, '')) return url, rev def _download_git(self, url, filename): filename = filename.split('#', 1)[0] url, rev = self._vcs_split_rev_from_url(url, pop_prefix=True) self.info("Doing git clone from %s to %s", url, filename) os.system("git clone --quiet %s %s" % (url, filename)) if rev is not None: self.info("Checking out %s", rev) os.system("git -C %s checkout --quiet %s" % ( filename, rev, )) return filename def _download_hg(self, url, filename): filename = filename.split('#', 1)[0] url, rev = self._vcs_split_rev_from_url(url, pop_prefix=True) self.info("Doing hg clone from %s to %s", url, filename) os.system("hg clone --quiet %s %s" % (url, filename)) if rev is not None: self.info("Updating to %s", rev) os.system("hg --cwd %s up -C -r %s -q" % ( filename, rev, )) return filename def debug(self, msg, *args): log.debug(msg, *args) def info(self, msg, *args): log.info(msg, *args) def warn(self, msg, *args): log.warn(msg, *args) # This pattern matches a character entity reference (a decimal numeric # references, a hexadecimal numeric reference, or a named reference). entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub def decode_entity(match): what = match.group(0) return unescape(what) def htmldecode(text): """ Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz') 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz' """ return entity_sub(decode_entity, text) def socket_timeout(timeout=15): def _socket_timeout(func): def _socket_timeout(*args, **kwargs): old_timeout = socket.getdefaulttimeout() socket.setdefaulttimeout(timeout) try: return func(*args, **kwargs) finally: socket.setdefaulttimeout(old_timeout) return _socket_timeout return _socket_timeout def _encode_auth(auth): """ A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False """ auth_s = urllib.parse.unquote(auth) # convert to bytes auth_bytes = auth_s.encode() encoded_bytes = base64.b64encode(auth_bytes) # convert back to a string encoded = encoded_bytes.decode() # strip the trailing carriage return return encoded.replace('\n', '') class Credential: """ A username/password pair. Use like a namedtuple. """ def __init__(self, username, password): self.username = username self.password = password def __iter__(self): yield self.username yield self.password def __str__(self): return '%(username)s:%(password)s' % vars(self) class PyPIConfig(configparser.RawConfigParser): def __init__(self): """ Load from ~/.pypirc """ defaults = dict.fromkeys(['username', 'password', 'repository'], '') configparser.RawConfigParser.__init__(self, defaults) rc = os.path.join(os.path.expanduser('~'), '.pypirc') if os.path.exists(rc): self.read(rc) @property def creds_by_repository(self): sections_with_repositories = [ section for section in self.sections() if self.get(section, 'repository').strip() ] return dict(map(self._get_repo_cred, sections_with_repositories)) def _get_repo_cred(self, section): repo = self.get(section, 'repository').strip() return repo, Credential( self.get(section, 'username').strip(), self.get(section, 'password').strip(), ) def find_credential(self, url): """ If the URL indicated appears to be a repository defined in this config, return the credential for that repository. """ for repository, cred in self.creds_by_repository.items(): if url.startswith(repository): return cred def open_with_auth(url, opener=urllib.request.urlopen): """Open a urllib2 request, handling HTTP authentication""" parsed = urllib.parse.urlparse(url) scheme, netloc, path, params, query, frag = parsed # Double scheme does not raise on Mac OS X as revealed by a # failing test. We would expect "nonnumeric port". Refs #20. if netloc.endswith(':'): raise http_client.InvalidURL("nonnumeric port: ''") if scheme in ('http', 'https'): auth, address = _splituser(netloc) else: auth = None if not auth: cred = PyPIConfig().find_credential(url) if cred: auth = str(cred) info = cred.username, url log.info('Authenticating as %s for %s (from .pypirc)', *info) if auth: auth = "Basic " + _encode_auth(auth) parts = scheme, address, path, params, query, frag new_url = urllib.parse.urlunparse(parts) request = urllib.request.Request(new_url) request.add_header("Authorization", auth) else: request = urllib.request.Request(url) request.add_header('User-Agent', user_agent) fp = opener(request) if auth: # Put authentication info back into request URL if same host, # so that links found on the page will work s2, h2, path2, param2, query2, frag2 = urllib.parse.urlparse(fp.url) if s2 == scheme and h2 == address: parts = s2, netloc, path2, param2, query2, frag2 fp.url = urllib.parse.urlunparse(parts) return fp # copy of urllib.parse._splituser from Python 3.8 def _splituser(host): """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" user, delim, host = host.rpartition('@') return (user if delim else None), host # adding a timeout to avoid freezing package_index open_with_auth = socket_timeout(_SOCKET_TIMEOUT)(open_with_auth) def fix_sf_url(url): return url # backward compatibility def local_open(url): """Read a local path, with special support for directories""" scheme, server, path, param, query, frag = urllib.parse.urlparse(url) filename = urllib.request.url2pathname(path) if os.path.isfile(filename): return urllib.request.urlopen(url) elif path.endswith('/') and os.path.isdir(filename): files = [] for f in os.listdir(filename): filepath = os.path.join(filename, f) if f == 'index.html': with open(filepath, 'r') as fp: body = fp.read() break elif os.path.isdir(filepath): f += '/' files.append('<a href="{name}">{name}</a>'.format(name=f)) else: tmpl = ( "<html><head><title>{url}" "{files}") body = tmpl.format(url=url, files='\n'.join(files)) status, message = 200, "OK" else: status, message, body = 404, "Path not found", "Not found" headers = {'content-type': 'text/html'} body_stream = six.StringIO(body) return urllib.error.HTTPError(url, status, message, headers, body_stream) PK!Ε4-!-!ssl_support.pynu[import os import socket import atexit import re import functools from setuptools.extern.six.moves import urllib, http_client, map, filter from pkg_resources import ResolutionError, ExtractionError try: import ssl except ImportError: ssl = None __all__ = [ 'VerifyingHTTPSHandler', 'find_ca_bundle', 'is_available', 'cert_paths', 'opener_for' ] cert_paths = """ /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem """.strip().split() try: HTTPSHandler = urllib.request.HTTPSHandler HTTPSConnection = http_client.HTTPSConnection except AttributeError: HTTPSHandler = HTTPSConnection = object is_available = ssl is not None and object not in (HTTPSHandler, HTTPSConnection) try: from ssl import CertificateError, match_hostname except ImportError: try: from backports.ssl_match_hostname import CertificateError from backports.ssl_match_hostname import match_hostname except ImportError: CertificateError = None match_hostname = None if not CertificateError: class CertificateError(ValueError): pass if not match_hostname: def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 https://tools.ietf.org/html/rfc6125#section-6.4.3 """ pats = [] if not dn: return False # Ported from python3-syntax: # leftmost, *remainder = dn.split(r'.') parts = dn.split(r'.') leftmost = parts[0] remainder = parts[1:] wildcards = leftmost.count('*') if wildcards > max_wildcards: # Issue #17980: avoid denials of service by refusing more # than one wildcard per fragment. A survey of established # policy among SSL implementations showed it to be a # reasonable choice. raise CertificateError( "too many wildcards in certificate DNS name: " + repr(dn)) # speed up common case w/o wildcards if not wildcards: return dn.lower() == hostname.lower() # RFC 6125, section 6.4.3, subitem 1. # The client SHOULD NOT attempt to match a presented identifier in which # the wildcard character comprises a label other than the left-most label. if leftmost == '*': # When '*' is a fragment by itself, it matches a non-empty dotless # fragment. pats.append('[^.]+') elif leftmost.startswith('xn--') or hostname.startswith('xn--'): # RFC 6125, section 6.4.3, subitem 3. # The client SHOULD NOT attempt to match a presented identifier # where the wildcard character is embedded within an A-label or # U-label of an internationalized domain name. pats.append(re.escape(leftmost)) else: # Otherwise, '*' matches any dotless string, e.g. www* pats.append(re.escape(leftmost).replace(r'\*', '[^.]*')) # add the remaining fragments, ignore any wildcards for frag in remainder: pats.append(re.escape(frag)) pat = re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) return pat.match(hostname) def match_hostname(cert, hostname): """Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. """ if not cert: raise ValueError("empty or no certificate") dnsnames = [] san = cert.get('subjectAltName', ()) for key, value in san: if key == 'DNS': if _dnsname_match(value, hostname): return dnsnames.append(value) if not dnsnames: # The subject is only checked when there is no dNSName entry # in subjectAltName for sub in cert.get('subject', ()): for key, value in sub: # XXX according to RFC 2818, the most specific Common Name # must be used. if key == 'commonName': if _dnsname_match(value, hostname): return dnsnames.append(value) if len(dnsnames) > 1: raise CertificateError("hostname %r " "doesn't match either of %s" % (hostname, ', '.join(map(repr, dnsnames)))) elif len(dnsnames) == 1: raise CertificateError("hostname %r " "doesn't match %r" % (hostname, dnsnames[0])) else: raise CertificateError("no appropriate commonName or " "subjectAltName fields were found") class VerifyingHTTPSHandler(HTTPSHandler): """Simple verifying handler: no auth, subclasses, timeouts, etc.""" def __init__(self, ca_bundle): self.ca_bundle = ca_bundle HTTPSHandler.__init__(self) def https_open(self, req): return self.do_open( lambda host, **kw: VerifyingHTTPSConn(host, self.ca_bundle, **kw), req ) class VerifyingHTTPSConn(HTTPSConnection): """Simple verifying connection: no auth, subclasses, timeouts, etc.""" def __init__(self, host, ca_bundle, **kw): HTTPSConnection.__init__(self, host, **kw) self.ca_bundle = ca_bundle def connect(self): sock = socket.create_connection( (self.host, self.port), getattr(self, 'source_address', None) ) # Handle the socket if a (proxy) tunnel is present if hasattr(self, '_tunnel') and getattr(self, '_tunnel_host', None): self.sock = sock self._tunnel() # http://bugs.python.org/issue7776: Python>=3.4.1 and >=2.7.7 # change self.host to mean the proxy server host when tunneling is # being used. Adapt, since we are interested in the destination # host for the match_hostname() comparison. actual_host = self._tunnel_host else: actual_host = self.host if hasattr(ssl, 'create_default_context'): ctx = ssl.create_default_context(cafile=self.ca_bundle) self.sock = ctx.wrap_socket(sock, server_hostname=actual_host) else: # This is for python < 2.7.9 and < 3.4? self.sock = ssl.wrap_socket( sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=self.ca_bundle ) try: match_hostname(self.sock.getpeercert(), actual_host) except CertificateError: self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() raise def opener_for(ca_bundle=None): """Get a urlopen() replacement that uses ca_bundle for verification""" return urllib.request.build_opener( VerifyingHTTPSHandler(ca_bundle or find_ca_bundle()) ).open # from jaraco.functools def once(func): @functools.wraps(func) def wrapper(*args, **kwargs): if not hasattr(func, 'always_returns'): func.always_returns = func(*args, **kwargs) return func.always_returns return wrapper @once def get_win_certfile(): try: import wincertstore except ImportError: return None class CertFile(wincertstore.CertFile): def __init__(self): super(CertFile, self).__init__() atexit.register(self.close) def close(self): try: super(CertFile, self).close() except OSError: pass _wincerts = CertFile() _wincerts.addstore('CA') _wincerts.addstore('ROOT') return _wincerts.name def find_ca_bundle(): """Return an existing CA bundle path, or None""" extant_cert_paths = filter(os.path.isfile, cert_paths) return ( get_win_certfile() or next(extant_cert_paths, None) or _certifi_where() ) def _certifi_where(): try: return __import__('certifi').where() except (ImportError, ResolutionError, ExtractionError): pass PK!"2 dep_util.pynu[from distutils.dep_util import newer_group # yes, this is was almost entirely copy-pasted from # 'newer_pairwise()', this is just another convenience # function. def newer_pairwise_group(sources_groups, targets): """Walk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. """ if len(sources_groups) != len(targets): raise ValueError("'sources_group' and 'targets' must be the same length") # build a pair of lists (sources_groups, targets) where source is newer n_sources = [] n_targets = [] for i in range(len(sources_groups)): if newer_group(sources_groups[i], targets[i]): n_sources.append(sources_groups[i]) n_targets.append(targets[i]) return n_sources, n_targets PK!*6 site-patch.pynu[def __boot(): import sys import os PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys, 'path_importer_cache', {}) stdpath = sys.path[len(PYTHONPATH):] mydir = os.path.dirname(__file__) for item in stdpath: if item == mydir or not item: continue # skip if current dir. on Windows, or my own directory importer = pic.get(item) if importer is not None: loader = importer.find_module('site') if loader is not None: # This should actually reload the current module loader.load_module('site') break else: try: import imp # Avoid import loop in Python 3 stream, path, descr = imp.find_module('site', [item]) except ImportError: continue if stream is None: continue try: # This should actually reload the current module imp.load_module('site', stream, path, descr) finally: stream.close() break else: raise ImportError("Couldn't find the real 'site' module") known_paths = dict([(makepath(item)[1], 1) for item in sys.path]) # 2.2 comp oldpos = getattr(sys, '__egginsert', 0) # save old insertion position sys.__egginsert = 0 # and reset the current one for item in PYTHONPATH: addsitedir(item) sys.__egginsert += oldpos # restore effective old position d, nd = makepath(stdpath[0]) insert_at = None new_path = [] for item in sys.path: p, np = makepath(item) if np == nd and insert_at is None: # We've hit the first 'system' path entry, so added entries go here insert_at = len(new_path) if np in known_paths or insert_at is None: new_path.append(item) else: # new path after the insert point, back-insert it new_path.insert(insert_at, item) insert_at += 1 sys.path[:] = new_path if __name__ == 'site': __boot() del __boot PK!D py27compat.pynu[""" Compatibility Support for Python 2.7 and earlier """ import sys import platform from setuptools.extern import six def get_all_headers(message, key): """ Given an HTTPMessage, return all headers matching a given key. """ return message.get_all(key) if six.PY2: def get_all_headers(message, key): return message.getheaders(key) linux_py2_ascii = ( platform.system() == 'Linux' and six.PY2 ) rmtree_safe = str if linux_py2_ascii else lambda x: x """Workaround for http://bugs.python.org/issue24672""" try: from ._imp import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE from ._imp import get_frozen_object, get_module except ImportError: import imp from imp import PY_COMPILED, PY_FROZEN, PY_SOURCE # noqa def find_module(module, paths=None): """Just like 'imp.find_module()', but with package support""" parts = module.split('.') while parts: part = parts.pop(0) f, path, (suffix, mode, kind) = info = imp.find_module(part, paths) if kind == imp.PKG_DIRECTORY: parts = parts or ['__init__'] paths = [path] elif parts: raise ImportError("Can't find %r in %s" % (parts, module)) return info def get_frozen_object(module, paths): return imp.get_frozen_object(module) def get_module(module, paths, info): imp.load_module(module, *info) return sys.modules[module] PK!aآ22 py33compat.pynu[import dis import array import collections try: import html except ImportError: html = None from setuptools.extern import six from setuptools.extern.six.moves import html_parser __metaclass__ = type OpArg = collections.namedtuple('OpArg', 'opcode arg') class Bytecode_compat: def __init__(self, code): self.code = code def __iter__(self): """Yield '(op,arg)' pair for each operation in code object 'code'""" bytes = array.array('b', self.code.co_code) eof = len(self.code.co_code) ptr = 0 extended_arg = 0 while ptr < eof: op = bytes[ptr] if op >= dis.HAVE_ARGUMENT: arg = bytes[ptr + 1] + bytes[ptr + 2] * 256 + extended_arg ptr += 3 if op == dis.EXTENDED_ARG: long_type = six.integer_types[-1] extended_arg = arg * long_type(65536) continue else: arg = None ptr += 1 yield OpArg(op, arg) Bytecode = getattr(dis, 'Bytecode', Bytecode_compat) unescape = getattr(html, 'unescape', None) if unescape is None: # HTMLParser.unescape is deprecated since Python 3.4, and will be removed # from 3.9. unescape = html_parser.HTMLParser().unescape PK!J_deprecation_warning.pynu[class SetuptoolsDeprecationWarning(Warning): """ Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. """ PK!T_path.pynu[import os from typing import Union _Path = Union[str, os.PathLike] def ensure_directory(path): """Ensure that the parent directory of `path` exists""" dirname = os.path.dirname(path) os.makedirs(dirname, exist_ok=True) def same_path(p1: _Path, p2: _Path) -> bool: """Differs from os.path.samefile because it does not require paths to exist. Purely string based (no comparison between i-nodes). >>> same_path("a/b", "./a/b") True >>> same_path("a/b", "a/./b") True >>> same_path("a/b", "././a/b") True >>> same_path("a/b", "./a/b/c/..") True >>> same_path("a/b", "../a/b/c") False >>> same_path("a", "a/b") False """ return os.path.normpath(p1) == os.path.normpath(p2) PK!|U logging.pynu[import sys import inspect import logging import distutils.log from . import monkey def _not_warning(record): return record.levelno < logging.WARNING def configure(): """ Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibility with distutils.log but may change in the future. """ err_handler = logging.StreamHandler() err_handler.setLevel(logging.WARNING) out_handler = logging.StreamHandler(sys.stdout) out_handler.addFilter(_not_warning) handlers = err_handler, out_handler logging.basicConfig( format="{message}", style='{', handlers=handlers, level=logging.DEBUG) if inspect.ismodule(distutils.dist.log): monkey.patch_func(set_threshold, distutils.log, 'set_threshold') # For some reason `distutils.log` module is getting cached in `distutils.dist` # and then loaded again when patched, # implying: id(distutils.log) != id(distutils.dist.log). # Make sure the same module object is used everywhere: distutils.dist.log = distutils.log def set_threshold(level): logging.root.setLevel(level*10) return set_threshold.unpatched(level) PK!_ installer.pynu[import glob import os import subprocess import sys import tempfile from distutils import log from distutils.errors import DistutilsError import pkg_resources from setuptools.wheel import Wheel def _fixup_find_links(find_links): """Ensure find-links option end-up being a list of strings.""" if isinstance(find_links, str): return find_links.split() assert isinstance(find_links, (tuple, list)) return find_links def fetch_build_egg(dist, req): # noqa: C901 # is too complex (16) # FIXME """Fetch an egg needed for building. Use pip/wheel to fetch/build a wheel.""" # Warn if wheel is not available try: pkg_resources.get_distribution('wheel') except pkg_resources.DistributionNotFound: dist.announce('WARNING: The wheel package is not available.', log.WARN) # Ignore environment markers; if supplied, it is required. req = strip_marker(req) # Take easy_install options into account, but do not override relevant # pip environment variables (like PIP_INDEX_URL or PIP_QUIET); they'll # take precedence. opts = dist.get_option_dict('easy_install') if 'allow_hosts' in opts: raise DistutilsError('the `allow-hosts` option is not supported ' 'when using pip to install requirements.') quiet = 'PIP_QUIET' not in os.environ and 'PIP_VERBOSE' not in os.environ if 'PIP_INDEX_URL' in os.environ: index_url = None elif 'index_url' in opts: index_url = opts['index_url'][1] else: index_url = None find_links = ( _fixup_find_links(opts['find_links'][1])[:] if 'find_links' in opts else [] ) if dist.dependency_links: find_links.extend(dist.dependency_links) eggs_dir = os.path.realpath(dist.get_egg_cache_dir()) environment = pkg_resources.Environment() for egg_dist in pkg_resources.find_distributions(eggs_dir): if egg_dist in req and environment.can_add(egg_dist): return egg_dist with tempfile.TemporaryDirectory() as tmpdir: cmd = [ sys.executable, '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', tmpdir, ] if quiet: cmd.append('--quiet') if index_url is not None: cmd.extend(('--index-url', index_url)) for link in find_links or []: cmd.extend(('--find-links', link)) # If requirement is a PEP 508 direct URL, directly pass # the URL to pip, as `req @ url` does not work on the # command line. cmd.append(req.url or str(req)) try: subprocess.check_call(cmd) except subprocess.CalledProcessError as e: raise DistutilsError(str(e)) from e wheel = Wheel(glob.glob(os.path.join(tmpdir, '*.whl'))[0]) dist_location = os.path.join(eggs_dir, wheel.egg_name()) wheel.install_as_egg(dist_location) dist_metadata = pkg_resources.PathMetadata( dist_location, os.path.join(dist_location, 'EGG-INFO')) dist = pkg_resources.Distribution.from_filename( dist_location, metadata=dist_metadata) return dist def strip_marker(req): """ Return a new requirement without the environment marker to avoid calling pip with something like `babel; extra == "i18n"`, which would always be ignored. """ # create a copy to avoid mutating the input req = pkg_resources.Requirement.parse(str(req)) req.marker = None return req PK!&l_entry_points.pynu[import functools import operator import itertools from .errors import OptionError from .extern.jaraco.text import yield_lines from .extern.jaraco.functools import pass_none from ._importlib import metadata from ._itertools import ensure_unique from .extern.more_itertools import consume def ensure_valid(ep): """ Exercise one of the dynamic properties to trigger the pattern match. """ try: ep.extras except AttributeError as ex: msg = ( f"Problems to parse {ep}.\nPlease ensure entry-point follows the spec: " "https://packaging.python.org/en/latest/specifications/entry-points/" ) raise OptionError(msg) from ex def load_group(value, group): """ Given a value of an entry point or series of entry points, return each as an EntryPoint. """ # normalize to a single sequence of lines lines = yield_lines(value) text = f'[{group}]\n' + '\n'.join(lines) return metadata.EntryPoints._from_text(text) def by_group_and_name(ep): return ep.group, ep.name def validate(eps: metadata.EntryPoints): """ Ensure entry points are unique by group and name and validate each. """ consume(map(ensure_valid, ensure_unique(eps, key=by_group_and_name))) return eps @functools.singledispatch def load(eps): """ Given a Distribution.entry_points, produce EntryPoints. """ groups = itertools.chain.from_iterable( load_group(value, group) for group, value in eps.items()) return validate(metadata.EntryPoints(groups)) @load.register(str) def _(eps): r""" >>> ep, = load('[console_scripts]\nfoo=bar') >>> ep.group 'console_scripts' >>> ep.name 'foo' >>> ep.value 'bar' """ return validate(metadata.EntryPoints(metadata.EntryPoints._from_text(eps))) load.register(type(None), lambda x: x) @pass_none def render(eps: metadata.EntryPoints): by_group = operator.attrgetter('group') groups = itertools.groupby(sorted(eps, key=by_group), by_group) return '\n'.join( f'[{group}]\n{render_items(items)}\n' for group, items in groups ) def render_items(eps): return '\n'.join( f'{ep.name} = {ep.value}' for ep in sorted(eps) ) PK!D Âoo#__pycache__/logging.cpython-311.pycnu[ ,ReDddlZddlZddlZddlZddlmZdZdZdZ dS)N)monkeyc,|jtjkS)N)levelnologgingWARNING)records /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/logging.py _not_warningr s >GO ++ctj}|tjtjtj}|t||f}tjdd|tj tj tj jrBtjt"tjdtjtj _dSdS)z Configure logging to emit warning and above to stderr and everything else to stdout. This behavior is provided for compatibility with distutils.log but may change in the future. z {message}{)formatstylehandlerslevel set_thresholdN)r StreamHandlersetLevelrsysstdout addFilterr basicConfigDEBUGinspectismodule distutilsdistlogr patch_funcr) err_handler out_handlerrs r configurer# s'))K)))' 33K,'''K'H # OOOO *+++-HHH ']  ++r cztj|dzt|S)N )rrootrr unpatched)rs r rr#s0 L%(###  " "5 ) ))r ) rrr distutils.logrrr r#rr r r+su ,,,+++.*****r PK!*q٥"__pycache__/monkey.cpython-311.pycnu[ ,RedZddlZddlZddlZddlZddlZddlmZddl Z ddl Z gZ dZ dZ dZdZdZd Zd Zd ZdS) z Monkey patching of distutils. N) import_modulecntjdkr |f|jzStj|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. Jython)platformpython_implementation __bases__inspectgetmro)clss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/monkey.py_get_mror s7%''833v %% >#  ct|trtn#t|tjrt nd}||S)NcdS)N)items r zget_unpatched..(sTr) isinstancetypeget_unpatched_classtypes FunctionTypeget_unpatched_function)rlookups r get_unpatchedr$sP)$55 ",T53E"F"F  6$<<rcdt|D}t|}|jdsd|z}t ||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. c3NK|] }|jd|V!dS) setuptoolsN) __module__ startswith).0r s r z&get_unpatched_class..3sL ~((66 r distutilsz(distutils has already been patched by %r)r nextrr AssertionError)r external_basesbasemsgs r rr-sj C==N   D ? % %k 2 2"83>S!!! Krctjtj_tjdk}|rtjtj_dtjcxkodkncpdtjcxkodknc}|rd}|tjj _ ttj tjtj fD]}tj j|_tjjtj_tjjtj_dtjvr&tjjtjd_t%dS)N)r*)r*)r*r,)r*r+zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rCommandr#coresys version_infofindallfilelistconfig PyPIRCCommandDEFAULT_REPOSITORY_patch_distribution_metadatadistcmd Distribution extension Extensionmodules#patch_for_msvc_specialized_compiler)has_issue_12885needs_warehouse warehousemodules r patch_allrC?s7'/IN&)3O8%/%7 " !----I---- /!....Y.... F5 .patch_paramssk )"2"23"7"77 tY''H%%sI&& )i(( (S)##rzdistutils._msvccompiler _get_vc_envgen_lib_options)rrsystem functoolspartialrUr_)rfmsvc14res @r r>r>s * + +DI%% $ $ $ $ $ |-F G GF FF=))***       FF,--....      s$A A%$A%)A== B  B )__doc__r0distutils.filelistr#rrrj importlibrr r__all__r rrrCr7rUrr>rrr rqs  ######    $"*"*"*JDDD000"+++% % % % % rPK!=O) "__pycache__/errors.cpython-311.pycnu[ ,Re @dZddlmZejZejZejZej Z ej Z ej Z ejZejZejZejZejZejZejZejZejZejZejZGddee Z!Gddee Z"dS)zCsetuptools.errors Provides exceptions used by setuptools modules. )errorsceZdZdZdS)RemovedCommandErroraOError used for commands that have been removed in setuptools. Since ``setuptools`` is built on ``distutils``, simply removing a command from ``setuptools`` will make the behavior fall back to ``distutils``; this error is raised if a command exists in ``distutils`` but has been actively removed in ``setuptools``. N__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/errors.pyrr sr rceZdZdZdS)PackageDiscoveryErrora{Impossible to perform automatic discovery of packages and/or modules. The current project layout or given discovery options can lead to problems when scanning the project directory. Setuptools might also refuse to complete auto-discovery if an error prone condition is detected (e.g. when a project is organised as a flat-layout but contains multiple directories that can be taken as top-level packages inside a single distribution [*]_). In these situations the users are encouraged to be explicit about which packages to include or to make the discovery parameters more specific. .. [*] Since multi-package distributions are uncommon it is very likely that the developers did not intend for all the directories to be packaged, and are just leaving auxiliary code in the repository top-level, such as maintenance-related scripts. Nrr r r rr*sr rN)#r distutilsr_distutils_errorsDistutilsByteCompileErrorByteCompileErrorCCompilerErrorDistutilsClassError ClassError CompileErrorDistutilsExecError ExecErrorDistutilsFileError FileErrorDistutilsInternalError InternalErrorLibError LinkErrorDistutilsModuleError ModuleErrorDistutilsOptionError OptionErrorDistutilsPlatformError PlatformErrorPreprocessErrorDistutilsSetupError SetupErrorDistutilsTemplateError TemplateErrorUnknownFileErrorDistutilsError BaseError RuntimeErrorrrr r r r/s 211111 %>"1  2  -  0  0 !8  %  ' 4 4 !8 #3  2 !8 $5  , )\I|r PK!fGYY)__pycache__/unicode_utils.cpython-311.pycnu[ ,Re(ddlZddlZdZdZdZdS)Nct|trtjd|S |d}tjd|}|d}n#t $rYnwxYw|S)NNFDutf-8) isinstancestr unicodedata normalizedecodeencode UnicodeError)paths /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/unicode_utils.py decomposers$2$UD111 {{7##$UD11{{7##      Ks?A,, A98A9ct|tr|Stjpd}|df}|D])} ||cS#t $rY&wxYwdS)zY Ensure that the given path is decoded, NONE when no expected encoding works rN)rrsysgetfilesystemencodingr UnicodeDecodeError)r fs_enc candidatesencs rfilesys_decoders $  & ( ( 3GFJ ;;s## # # #!    H sA  AAcP ||S#t$rYdSwxYw)z/turn unicode encoding into a functional routineN)r UnicodeEncodeError)stringrs r try_encoder%s;}}S!!! tts  %%)rrrrrrrsQ    &rPK!Q0__pycache__/_deprecation_warning.cpython-311.pycnu[ ,Re"GddeZdS)ceZdZdZdS)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. N)__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_deprecation_warning.pyrrsr rN)Warningrrr r r s97r PK!22$__pycache__/__init__.cpython-311.pycnu[ ,Re dZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddlmZddlZddlmZddlmZdd lmZdd lmZmZdd lmZdd lmZgd Zejj Z dZ!ej"Z#ej"Z$dZ%dZ&ej'j&je&_ej(ej'j)Z*Gdde*Z)dZ+ej,fdZ-ej.e dZ Gdde/Z0ej1dS)z@Extensions to the 'distutils' for large or complex distributionsN)DistutilsOptionError) convert_path)SetuptoolsDeprecationWarning) Extension) Distribution)Require) PackageFinderPEP420PackageFinder)monkey)logging)setuprCommandrr r find_packagesfind_namespace_packagescGddtjj}||}|d|jr||jdSdS)Nc4eZdZdZfdZdfd ZdZxZS)4_install_setup_requires..MinimalDistributionzl A minimal version of a distribution for supporting the fetch_build_eggs interface. cd}fdt|tzD}t||jdS)N)dependency_linkssetup_requiresc"i|] }|| Sr).0kattrss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/__init__.py zQ_install_setup_requires..MinimalDistribution.__init__..8sEEE58EEE)setsuper__init__ set_defaults_disable)selfr_inclfiltered __class__s ` rr"z=_install_setup_requires..MinimalDistribution.__init__6sf8EEEEESZZ#e**-DEEEH GG  X & & &   & & ( ( ( ( (rNc~ t|\}}|dfS#t$r|dfcYSwxYw)zAIgnore ``pyproject.toml``, they are not related to setup_requiresr)r! _split_standard_project_metadata Exception)r% filenamescfgtomlr(s r_get_project_config_fileszN_install_setup_requires..MinimalDistribution._get_project_config_files=sW %!GGDDYOO TBw % % % "}$$$ %s '+<<cdS)zl Disable finalize_options to avoid building the working set. Ref #2158. Nr)r%s rfinalize_optionszE_install_setup_requires..MinimalDistribution.finalize_optionsEsrN)__name__ __module__ __qualname____doc__r"r/r1 __classcell__r(s@rMinimalDistributionr0so   ) ) ) ) ) % % % % % %       rr9T)ignore_option_errors) distutilscorerparse_config_filesrfetch_build_eggs)rr9dists r_install_setup_requiresr@-sin96  u % %D 666 3 d12222233rc rtjt|tjjdi|S)Nr)r configurer@r;r<r)rs rrrSs8 E""" >  ( (% ( ((rc<eZdZdZdZfdZd dZdZd dZxZ S) ra Setuptools internal actions are organized using a *command design pattern*. This means that each action (or group of closely related actions) executed during the build should be implemented as a ``Command`` subclass. These commands are abstractions and do not necessarily correspond to a command that can (or should) be executed via a terminal, in a CLI fashion (although historically they would). When creating a new command from scratch, custom defined classes **SHOULD** inherit from ``setuptools.Command`` and implement a few mandatory methods. Between these mandatory methods, are listed: .. method:: initialize_options(self) Set or (reset) all options/attributes/caches used by the command to their default values. Note that these values may be overwritten during the build. .. method:: finalize_options(self) Set final values for all options/attributes used by the command. Most of the time, each option/attribute/cache should only be set if it does not have any value yet (e.g. ``if self.attr is None: self.attr = val``). .. method:: run(self) Execute the actions intended by the command. (Side effects **SHOULD** only take place when ``run`` is executed, for example, creating new files or writing to the terminal output). A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options are "declared" in ``initialize_options()`` and "defined" (given their final values, aka "finalized") in ``finalize_options()``, both of which must be defined by every command class. The "body" of the subroutine, (where it does all the work) is the ``run()`` method. Between ``initialize_options()`` and ``finalize_options()``, ``setuptools`` may set the values for options/attributes based on user's input (or circumstance), which means that the implementation should be careful to not overwrite values in ``finalize_options`` unless necessary. Please note that other commands (or other parts of setuptools) may also overwrite the values of the command's options/attributes multiple times during the build process. Therefore it is important to consistently implement ``initialize_options()`` and ``finalize_options()``. For example, all derived attributes (or attributes that depend on the value of other attributes) **SHOULD** be recomputed in ``finalize_options``. When overwriting existing commands, custom defined classes **MUST** abide by the same APIs implemented by the original class. They also **SHOULD** inherit from the original class. Fc t|t||dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)r!r"varsupdate)r%r?kwr(s rr"zCommand.__init__s=  T "rNc t||}|t||||St|tst d|d|d|d|S)N'z ' must be a z (got `z`))getattrsetattr isinstancestrr)r%optionwhatdefaultvals r_ensure_stringlikezCommand._ensure_stringlikesqdF## ; D&' * * *NC%% &&28&&$$$D  rc6t||}|dSt|tr&t||t jd|dSt|t rtd|D}nd}|std|d|ddS)aEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. .. TODO: This method seems to be similar to the one in ``distutils.cmd`` Probably it is just here for backward compatibility with old Python versions? :meta private: Nz,\s*|\s+c3@K|]}t|tVdSr2)rLrM)rvs r z-Command.ensure_string_list..s,99As++999999rFrIz!' must be a list of strings (got )) rJrLrMrKresplitlistallr)r%rNrQoks rensure_string_listzCommand.ensure_string_listsdF## ; F S ! !  D&"(;"<"< = = = = =#t$$ 99S99999 **AGM  rrc t|||}t|||Sr2)_Commandreinitialize_commandrErF)r%commandreinit_subcommandsrGcmds rr`zCommand.reinitialize_commands9++D';MNN S  rr2)r) r3r4r5r6command_consumes_argumentsr"rRr]r`r7r8s@rrr`s44l"'    6rrcdtj|dD}ttjj|S)z% Find all files under 'path' c3hK|]-\}}}|D]$}tj||V%.dSr2)ospathjoin)rbasedirsfilesfiles rrVz#_find_all_simple..sc D$   T4  rT) followlinks)rgwalkfilterrhisfile)rhresultss r_find_all_simplerssE!#4!@!@!@G "'.' * **rct|}|tjkr5tjtjj|}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rsrgcurdir functoolspartialrhrelpathmaprZ)dirrlmake_rels rfindallr}sR S ! !E bi$RW_C@@@He$$ ;;rcvddlm}d}tj||tt |S)Nr)cleandocz The function `convert_path` is considered internal and not part of the public API. Its direct usage by 3rd-party packages is considered deprecated and the function may be removed in the future. )inspectrwarningswarnr _convert_path)pathnamermsgs rrrsF       C  M((3--!=>>>  " ""rceZdZdZdS)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r3r4r5r6rrrrrsEEEErr)2r6rwrgrXr_distutils_hack.override_distutils_hackdistutils.corer;distutils.errorsrdistutils.utilrr_deprecation_warningrsetuptools.version setuptoolssetuptools.extensionrsetuptools.distrsetuptools.dependsr setuptools.discoveryr r r r __all__version __version__bootstrap_install_fromfindrrr@rr< get_unpatchedrr_rsrvr}wrapsrMr patch_allrrrrsNFF 111111888888>>>>>>******((((((&&&&&&CCCCCCCC    , " -2#3#3#3L)))$,  6   6 7 7jjjjjhjjjZ + + +     # #  #FFFFF#FFF rPK!J<<!__pycache__/wheel.cpython-311.pycnu[ ,Re dZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl Z ddl Z ddl m Z ddl mZddlmZddlmZddlmZejd ejjZd Zd Zejd ZGd dZdS)zWheels support.N) get_platform) parse_version)sys_tags)canonicalize_name)write_requirements)_unpack_zipfile_objz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$z8__import__('pkg_resources').declare_namespace(__name__) ctj|D])\}}}tj||}|D]X}tj||}tj|||}tj||Yt tt|D]}\} } tj|| }tj||| }tj |stj|||| =~+tj|dD]\}}}|rJtj |dS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsrmdir) src_dirdst_dirdirpathdirnames filenamessubdirfsrcdstnds /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/wheel.pyunpackr" se(*(8(8   $9'22 ! !A',,w**C',,w22C JsC T)H"5"56677  DAq',,w**C',,w22C7>>#&&  3$$$QK )+(F(F(F$9 c#Kddlm}||j} dV||dS#||wxYw)z* Temporarily disable info traces. r)logN) distutilsr% set_thresholdWARN)r%saveds r!disable_info_tracesr*6sq    ch ' 'E!  %     %    s ?AczeZdZdZdZdZdZdZdZdZ e dZ e d Z e d Z d S) Wheelcttj|}|t d|z||_|D]\}}t|||dS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr1matchkvs r!__init__zWheel.__init__Es27++H5566 =5@AA A  OO%%++--  DAq D!Q      r#ctj|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproduct py_versionsplitabiplatformr5s r!tagsz Wheel.tagsMsN O ! !# & & HNN3   M   $ $   r#ctdtDtfd|DdS)z5Is the wheel is compatible with the current platform?c3>K|]}|j|j|jfVdSN) interpreterr@rA).0ts r! z&Wheel.is_compatible..WsHDD34Q]AE1: .DDDDDDr#c3$K|] }|vdV dS)TN)rHrIsupported_tagss r!rJz&Wheel.is_compatible..Ys-FFa!~2E2ET2E2E2E2EFFr#F)setrnextrC)r5rMs @r! is_compatiblezWheel.is_compatibleUsfDD8@ DDDDDFFFF499;;FFFNNNr#ctj|j|j|jdkrdn t dzS)Nany) project_nameversionrAz.egg) pkg_resources DistributionrSrTrAregg_namerBs r!rWzWheel.egg_name[sO)*DL"mu44dd,..    (**v r#c|D]c}tj|}|dr8t |t |jr|cSdtd)Nz .dist-infoz.unsupported wheel format. .dist-info not found)namelist posixpathdirnameendswithr startswithrSr0)r5zfmemberr[s r! get_dist_infozWheel.get_dist_infoaskkmm  F'//G  .. %g..99)$*;<<>> IJJJr#ctj|j5}|||ddddS#1swxYwYdS)z"Install wheel as an egg directory.N)zipfileZipFiler1_install_as_egg)r5destination_eggdirr^s r!install_as_eggzWheel.install_as_eggks _T] + + 9r  !3R 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9s>AAc$|jd|j}||}d|z}tj|d}|||||||||||dS)N-z%s.dataEGG-INFO) rSrTr`r r r_convert_metadata_move_data_entries_fix_namespace_packages)r5rer^ dist_basename dist_info dist_dataegg_infos r!rdzWheel._install_as_eggps#'#4#4#4dllC &&r**  - 7<< 2J?? r#5y(KKK  2I>>> $$X/ABBBBBr#c 0 fd}|d}t|d}td|cxkotdknc}|std|zt|tj|tj |tj | d tt  fd  jD}t j|t jtj|d tj|d t!jt# |  } t%5t'| ddtj|dddddS#1swxYwYdS)Nc8tj|5}|d}t j|cdddS#1swxYwYdS)Nzutf-8) openrZrreaddecodeemailparserParserparsestr)namefpvaluernr^s r! get_metadataz-Wheel._convert_metadata..get_metadata|s 48899 =R ((11|**,,55e<< = = = = = = = = = = = = = = = = = =sABBBWHEELz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)metadatac.d|_t|SrF)markerstr)reqs r!raw_reqz(Wheel._convert_metadata..raw_reqsCJs88Or#c ri|]3}|fdt|fD4S)cg|]}|v| SrLrL)rHrinstall_requiress r! z6Wheel._convert_metadata...s/......r#)maprequires)rHextradistrrs r! z+Wheel._convert_metadata..si    w uh(?(?@@   r#METADATAzPKG-INFO)rextras_require)attrsrpz requires.txt)rgetr0rr r rrUrV from_location PathMetadatarrrextrasrename setuptoolsdictr*rget_command_obj) r^rernrpr}wheel_metadata wheel_versionwheel_v1r setup_distrrrs ` ` @@@r!rjzWheel._convert_metadatazs = = = = = = &g..%n&8&8&I&IJJ % M L L L LM)4L4L L L L L  H6FHH H B 2333GLL!3Y?? )77  "/0BINN8      GT]]__ = =>>           )X&&& GLL: . . GLL: . .    ,!1-   ! " "   **:66 X~66                     s;AH  HHctj|tjd}tj|rtj|dd}tj|tj|D]}|dr3tjtj||Jtjtj||tj||tj |ttjjfddDD]}t||tjrtj dSdS)z,Move data entries to their correct location.scriptsriz.pycc3XK|]$}tj|V%dSrF)r r r)rHr ros r!rJz+Wheel._move_data_entries..sG. .  GLLA & &. . . . . . r#)dataheaderspurelibplatlibN) r r rrmkdirlistdirr\unlinkrrfilterr")rerodist_data_scriptsegg_info_scriptsentryrs ` r!rkzWheel._move_data_entriessGLL!3Y?? GLLI>> 7>>+ , , (!w||"J  ; ;  H% & & &$566  >>&))Ibgll+> %5u== H& ' ' 'RW^. . . . >. . .    / /F 6- . . . . 7>>) $ $ HY       r#ctj|d}tj|r0t |5}|}dddn #1swxYwY|D]}tjj|g|dR}tj|d}tj|stj|tj|sBt |d5}|tdddn #1swxYwYdSdS)Nznamespace_packages.txtr;z __init__.pyw) r r rrrsrtr?rwriteNAMESPACE_PACKAGE_INIT)rprenamespace_packagesr{modmod_dirmod_inits r!rlzWheel._fix_namespace_packagessW\\ .00 7>>, - - 9()) 7R%'WWYY__%6%6" 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7) 9 9','9KCIIcNNKKK7<<??w~~g..&HW%%%w~~h//9h,,9!7888999999999999999 9 9 9 9s$'BB B>E%%E) ,E) N)__name__ __module__ __qualname__r9rCrPrWr`rfrd staticmethodrjrkrlrLr#r!r,r,Cs      OOO  KKK999 CCC77\7r  \ 6 9 9\ 9 9 9r#r,)__doc__rvr<r rZrerb contextlibdistutils.utilrrUrr setuptools.extern.packaging.tagsr!setuptools.extern.packaging.utilsrsetuptools.command.egg_inforsetuptools.archive_utilrcompileVERBOSEr6r.rr"contextmanagerr*r,rLr#r!rsu   ''''''''''''555555??????::::::777777RZJ   @,  ! ! ![9[9[9[9[9[9[9[9[9[9r#PK!`:)__pycache__/package_index.cpython-311.pycnu[ ,RedZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,dd l-m.Z.ej/d Z0ej/d ej1Z2ej/d Z3ej/d ej1j4Z5d6Z7gdZ8dZ9dZ:e:;dj;ej<eZ=dZ>dZ?dZ@d1dZAd1dZBd1dZCdedfdZDdZEej/dej1ZF eEdZGGddZHGd d!eHZIGd"d#eZJej/d$jKZLd%ZMd&ZNd2d'ZOd(ZPGd)d*ZQGd+d,e jRZSejTjUfd-ZVd.ZWeOe9eVZVd/ZXd0ZYdS)3z$PyPI and direct package downloading.Nwraps) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST parse_version)log)DistutilsError) translate)Wheelunique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz) PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namez>, ' ' :DDD   k3 / / "R%[F:DDD ^^, - - :DDD   os 3 3 "R%[F:DD  ctj|}|\}}}}}}tj|dd}|dkr>|dkr8tj|dd}d|vr|dd\}}||fS)N/zsourceforge.netdownload#)urllibr!urlparseunquotesplit) urlpartsschemeserverpath parametersqueryfragmentr/s r%egg_info_for_urlrFfs L ! !# & &E8=5FFD*eX <   3 3 4 4D """tz'9'9|##DJJsOOB$788 d{{C++h >r2c#Kt|\}}t|||D]}|V|rNt|}|r4t ||d|t D] }|VdSdSdS)zEYield egg or source distribution objects that might be found at a URLr9) precedenceN)rFdistros_for_location EGG_FRAGMENTmatchrgroupr)r>metadatar/rEdistrKs r%rrqs%c**ND($S$99 ""8,,  -U[[^^X-       r2c|dr |dd}|drd|vrtj|||gS|drOd|vrKt|}|sgSt||j|jtdzgS|d r.t|\}}}|t||||t|StD]B}||r+|dt| }t|||cSCgS) z:Yield egg or source distribution objects based on basename.egg.zipNr*z.egg-z.whlr9)location project_nameversionrHr() r,r from_locationr is_compatiblerSrTrrrr EXTENSIONSlen)rRbasenamerMwheelwin_baser0platformexts r%rIrIs$$!CRC=  JSH__*8XxHHII   SH__h""$$ I !"/ #a<        %8%B%B"&(  ((Hfk8  GG   S ! ! G 3s88) ,H(8XFF F F F G Ir2cxtt|tj||S)zEYield possible egg or source distribution objects based on a filename)rIrosrBrY)filenamerMs r%distros_for_filenameras3 x  "'"2"28"<"z(interpret_distro_name..s.KKAbh|Q77KKKKKKr2Nr9) py_versionrHr\)r=anyrangerXrjoin)rRrYrMrirHr\r?rfs r%rrs* NN3  E #KKqrrKKKKK 1c%jj1n % %      HHU2A2Y   HHU122Y  !!          r2c<tfd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. c.t|i|SNr)argskwargsfuncs r%wrapperzunique_values..wrappers ttT4V44555r2r)rrrss` r% unique_valuesrts5  4[[6666[6 Nr2z3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>c #Kt|D]}|\}}tt t j|d}d|vsd|vr_t|D]D}tj |t|dVEdD]|}||}|dkr_t||}|rBtj |t|dV}dS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,homepager6r9)z Home PagezDownload URLr5N)RELfinditergroupssetmapstrstripr+r=HREFr:r!urljoin htmldecoderLfindsearch)r>pagerKtagrelrelsposs r%find_external_linksrsMd##LL<<>>S3sy#))++"3"3C"8"899::   t!3!3s++ L Ll**3 5;;q>>0J0JKKKKKK4LLiinn "99KKc**E Ll**3 5;;q>>0J0JKKKKK LLr2c$eZdZdZdZdZdZdS)ContentCheckerzP A null content checker that defines the interface for checking content cdS)z3 Feed a block of data to the hash. Nselfblocks r%feedzContentChecker.feeds  r2cdS)zC Check the hash. Return False if validation fails. Trrs r%is_validzContentChecker.is_valids tr2cdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr)rreportertemplates r%reportzContentChecker.reports r2N)__name__ __module__ __qualname____doc__rrrrr2r%rrsK  r2rc\eZdZejdZdZedZdZ dZ dZ dS) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cT||_tj||_||_dSro) hash_namehashlibnewhashexpected)rrrs r%__init__zHashChecker.__init__s%"K **   r2ctj|d}|stS|j|}|stS|di|S)z5Construct a (possibly null) ContentChecker from a URLr5r)r:r!r;rpatternr groupdict)clsr>rErKs r%from_urlzHashChecker.from_urls{<((--b1 $!## # ""8,, $!## #s''U__&&'''r2c:|j|dSro)rupdaters r%rzHashChecker.feed$s r2cF|j|jkSro)r hexdigestrrs r%rzHashChecker.is_valid'sy""$$ 55r2c,||jz}||Sro)r)rrrmsgs r%rzHashChecker.report*s'x}}r2N) rrrrdcompilerr classmethodrrrrrr2r%rrsbj #G !!! (([(   666r2rc.eZdZdZ d+fd ZfdZd,d Zd,d Zd,d Zd Z d Z dZ dZ dZ d-dZdZd-fd ZdZdZdZdZdZ d.dZd/dZdZdZdZdZd-dZd Zd!Zd"Zd#Z d$Z!e"d,d%Z#d&Z$d'Z%d(Z&d)Z'd*Z(xZ)S)0rz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcrtj|i||dd|d z|_i|_i|_i|_tjd tt|j |_ g|_tjj|_dS)Nr4|)superrr, index_url scanned_urls fetched_urls package_pagesrdrrlr|rrKallowsto_scanr:requesturlopenopener)rrhosts ca_bundle verify_sslrpkw __class__s r%rzPackageIndex.__init__2s $%"%%%"S)Fy/A/A#/F/F+F)F%GGj#i*?*?!@!@AAG  n, r2c t|jn#t$rYdSwxYwt|Sro)rrT Exceptionradd)rrNrs r%rzPackageIndex.addDsS  $, ' ' ' '    FF ww{{4   s  &&Fc ||jvr|sdSd|j|<t|s||dStt |}|r-||sdS|d||s |r ||jvr$tt|j |dS||s d|j|<dS| d|d|j|<d}| |||z}|dSt|tjjr(|jdkr| d|jzd|j|j<d|jd d vr|dS|j}|}t|t0sTt|tjjrd }n|jd pd }||d }|t6|D]W} tj|t?| d} |!| X|"|j#r-tI|dddkr|%||}dSdSdS)zheadersgetr+closereadr} get_paramdecoderryr!rrrL process_urlr-rgetattr process_index) rr>retrievediststmplfr/rrrKlinks r%rzPackageIndex.process_urlMs $# # #H # F!%## 2  ! !# & & & F--..E 2{{3''F +S111   C4+<$<$< TXu%% & & & F{{3 %)D c " F ,$$$!%#M MM#tcz * * 9 F a/ 0 0 :QVs]] II0158 9 9 9#'!% ~r::@@BB B B GGIII Fuvvxx$$$ 2!V\344 F#)--i88EI;;w11D  ]]4(( # #E<''jQ.H.HIID   T " " " " >>$. ) ) 1ga.F.F#.M.M%%c400DDD 1 1.M.Mr2c tj|s|d|dStj|rl|sjtj|}tj|D]6}|tj||d7t|}|r:| d|tt|j |dSdS)Nz Not found: %sTz Found: %s)r_rBexistswarnisdirrealpathlistdirrrlrarrr|r)rfnnestedrBitemrs r%rzPackageIndex.process_filenamesw~~b!!  IIor * * * F 7==   FV F7##B''D 4(( F F%%bgll4&>&>EEEE$R((  ' JJ{B ' ' ' TXu%% & & & & & ' 'r2cNt|}|o*|ddk}|s8|tj|drdSd}|rt||z|||dS)Nr9fileTzN Note: Bypassing %s (disallowed host; see http://bit.ly/2hrImnY for details). ) rrLr+rr:r!r;rr)rr>fatalsis_filers r%rzPackageIndex.url_oks sOO4 ((**f4  dkk&,"7"7"<".sm  D))  ~~k**  5M       r2)filterr_rBrr itertoolsstarmap scan_egg_link)r search_pathdirs egg_linkss r%scan_egg_linkszPackageIndex.scan_egg_linkssYbgm[11     Y t19 = =>>>>>r2c ttj||5}t t dt tj|}dddn #1swxYwYt|dkrdS|\}}ttj||D]?}tjj|g|R|_ t|_ ||@dS)Nrh)openr_rBrlrrr|r}r~rXr rRr rHr)rrBr raw_lineslinesegg_path setup_pathrNs r%rzPackageIndex.scan_egg_links) "',,tU++ , , B c#)Y&?&?@@AAE B B B B B B B B B B B B B B B u::?? F$*&rw||D('C'CDD  DGL6666DM)DO HHTNNNN  s6A00A47A4c d}||js|Stttjj|t|jdd}t|dks d|dvr|St|d}t|d}d|j | i|<t|t|fS)N)NNr4rhr8r9rT)r-rrr|r:r!r<rXr=r r r setdefaultr+r)rrNO_MATCH_SENTINELr?pkgvers r%_scanzPackageIndex._scans&t~.. %$ $S-tC4G4G4I4I/J/P/PQT/U/UVVWW u::??cU1Xoo$ $a!!58$$?C%%ciikk266t<3S!1!111r2c \t|D]f} |tj|t |dW#t$rYcwxYw||\}}|sdSt||D]c}t|\}}| dr%|s#|r |d|d|z }n| || |dtd|S)z#Process the contents of a PyPI pager9r.pyz#egg=rQc6d|dddzS)Nz%sr9rh)rL)ms r%z,PackageIndex.process_index..s2QWWQ15E5EEr2)rryrr:r!rrrLr"rrFr,need_version_infoscan_urlPYPI_MD5sub) rr>rrKr rnew_urlr/frags r%rzPackageIndex.process_indexsN]]4((  E  6<//Z A5O5OPPQQQQ    ::c??S 2+355 # #G)'22JD$}}U## 0D 00GsssCC88GG**3/// MM' " " " "|| E Et   sAA22 A?>A?c2|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_allrr>s r%rzPackageIndex.need_version_infos*       r2c|j|jvr%|r|j|g|R|d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrrrrrps r%rzPackageIndex.scan_allsa >!2 2 2 & #%%%%% IIN O O O dn%%%%%r2c||j|jzdz|j|js%||j|jzdz|j|js||t|j|jdD]}||dS)Nr4r) rr unsafe_namerrkeyrSnot_found_in_indexr)r requirementr>s r% find_packageszPackageIndex.find_packagess dn{'>>DEEE!%%ko66 K MM$.;+CCcI J J J!%%ko66 1  # #K 0 0 0*..{CCDD  C MM#      r2c|||||jD]!}||vr|cS|d||"t t |||S)Nz%s does not match %s)prescanr&r#rrrobtain)rr% installerrNrs r%r)zPackageIndex.obtains  ;''') B BD{"" JJ-{D A A A A\4((// YGGGr2c2||jd|z|sd|t j|t |jjdtj |ddS)z- checker is a ContentChecker zValidating %%s checksum for %sz validation failed for z; possible download problem?N) rrrrr_unlinkrrr.rBrY)rcheckerr`tfps r% check_hashzPackageIndex.check_hash s tz#Ch#NOOO!!  IIKKK Ih    <$$$bg&6&6x&@&@&@&@B   r2c|D]y}|j@t|r1|dstt |r||_|j|zdS)z;Add `urls` to the list that will be prescanned for searchesNfile:)rrr-rrrappend)rurlsr>s r%add_find_linkszPackageIndex.add_find_linkss ) )C $!#%>>'**%,,--%  c"""" ##C(((( ) )r2cp|jr'tt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrr|rrs r%r(zPackageIndex.prescan*s3 < 3 T]DL11 2 2 2 r2c||jr |jd}}n |jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))r#rrr"r)rr%methrs r%r$zPackageIndex.not_found_in_index0sX     #H#DD ED S+)*** r2ct|tst|}|rj||d||}t |\}}|dr||||}|Stj |r|St|}t| ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r9rrRN)rrr _download_urlrLrFr, gen_setupr_rBrr&rfetch_distribution)rr#tmpdirr@foundr/rEs r%r6zPackageIndex.download;s$$ ,, 3%%F 3**6<<??D&II!1$!7!7h==''D NN5(FCCE %% 3 ,T22t..tV<.find{s{CG  $ $?l22:27** D )* s{U;(F(Tf*$-- v>>C-0D*w~~d&<==$# ! $ $r2z:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rRro)rr(r&rrcloner@) rr%r< force_scanrGrE local_indexrNrrFs ` ` `` @r%r;zPackageIndex.fetch_distribution]sn4 $k222 $ $ $ $ $ $ $ $ $ $.  % LLNNN   { + + +4 $$D 2 /4 [11D <|' 4 $$D < <   { + + +4 $$D < IIL77=2      II& - - -::t'=:>> >r2cH|||||}||jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)r;rR)rr%r<rIrGrNs r%fetchzPackageIndex.fetchs0&&{FJOO  = tr2c t|}|r.dt||ddDpg}t |dkrXt j|}t j||krvt j ||}t j |r t j ||stj |||}tt j |dd5}|d|djd|djdt j|dd dddn #1swxYwY|S|rt'd |d |t'd ) Nc g|] }|j | Sr)rT)reds r% z*PackageIndex.gen_setup..s09r2r9zsetup.pywz(from setuptools import setup setup(name=rz , version=z, py_modules=[z]) z9Can't unambiguously interpret project/version identifier zI; any dashes in the name or version should be escaped using underscores. zpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rJrKrrLrXr_rBrYdirnamerlrsamefileshutilcopy2rwriterSrTsplitextr) rr`rEr<rKrrYdstrs r%r:zPackageIndex.gen_setups""8,,  .xQNN    u::??w''11Hwx((F22gll6844s++#0@0@30O0O#L3///"Hbgll6:66<<  a---a(((((221555                O   .&.XXuu6  !G sAF,,F03F0i c|d|d} t|}||}t |t jjr"td|d|j d|j |}d}|j }d}d|vrP| d} ttt| }||||||t#|d 5} ||} | rI|| | | |d z }||||||nnb|||| dddn #1swxYwY||r|SS#|r|wwxYw) NzDownloading %szCan't download :  rr5zcontent-lengthzContent-LengthwbTr9)rrrrrr:rrrrr dl_blocksizeget_allmaxr|int reporthookrrrrVr/r) rr>r`fpr-rblocknumbssizesizesr.rs r% _download_tozPackageIndex._download_tos "C(((  !**3//Gs##B"fl455 $n25##rwwwGggiiGH"BD7**(8993sE??++XxTBBBh%% 8GGBKKE U+++ %((( A XxTJJJJ3777 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8   r   s1C3F8 A;F F8FF8FF88GcdSror)rr>r`rcblksizeres r%razPackageIndex.reporthooks r2c|drt|S t||jS#tt jjf$r]}dd|j D}|r| ||nt|d||Yd}~dSd}~wtj j$r }|cYd}~Sd}~wtj j$rD}|r| ||jntd|d|j|Yd}~dSd}~wt jj$rC}|r| ||jnt|d|j|Yd}~dSd}~wt jjt(j f$r:}|r| ||ntd|d||Yd}~dSd}~wwxYw)Nr1r[c,g|]}t|Sr)r})reargs r%rPz)PackageIndex.open_url..s777CHH777r2zDownload error for rZz7 returned a bad status line. The server might be down, )r- local_openopen_with_authrr"httpclient InvalidURLrlrprrr:rrURLErrorreason BadStatusLineline HTTPExceptionsocket)rr>warningvrs r%rzPackageIndex.open_urlso >>' " " #c?? " T!#t{33 3DK23 B B B((7777788C B '3''''$SS%9::A('''''|%   HHHHHH|$     '18,,,,$n3633A-,,,,, {(     '16****$"%##qvv/+*****  )6<8 T T T T '1%%%%$nCCC%KLLRSS&%%%%% TsL;GAB..GC G G#9D""G98E77#G/GGct|\}}|r3d|vr.|dddd}d|v.nd}|dr |dd}tj||}|dks|d r|||S|d ks|d r|||S|d r| ||S|d krBtj tj |dS||d|||S)Nz...\___downloaded__rPr*svnzsvn+gitzgit+zhg+rrhT)rFreplacer,r_rBrlr- _download_svn _download_git _download_hgr:r url2pathnamer!r;r_attempt_download)rr@r>r<r.rEr`s r%r9zPackageIndex._download_url4s*#..h  $$,,||D#..66tSAA$,,$D == $ $ 9D7<<-- U??f//77?%%c844 4 u__ 1 1& 9 9_%%c844 4   u % % 9$$S(33 3 v  >..v|/D/DS/I/I!/LMM M KKT " " "))#x88 8r2c2||ddS)NT)rrs r%rzPackageIndex.scan_urlQs d#####r2c|||}d|ddvr||||S|S)Nrrr)rgrr+_download_html)rr>r`rs r%rzPackageIndex._attempt_downloadTsY##C22 W[[44::<< < <&&sGX>> >Or2ctt|}|D]m}|rWtjd|r@|t j||||cSnn|t j|td|z)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r��r~���rd���r���r���r_���r,��r��r���)r���r>���r���r`���r���ru��s��� r%���r��zPackageIndex._download_html[��s����H~~� � Dzz||� 9@$GG�=JJLLLIh'''--c8<<<<< �  (=CDDDr2���c��������������������t����������j��������dt���������������������|��������������������dd����������d���������}d}|����������������������������������������������������d����������rd|v�rt ����������j����������������������������|����������\��}}}}}} |s|��������������������d����������rd |d d����������v�r|d d������������������������������d d����������\��}}t����������|����������\��} } | rTd | v�r"| ��������������������d d����������\��} } d | d | }nd | z���}| }|||||| f}t ����������j�������� ��������������������|����������}|� ��������������������d||�����������t����������j ��������d|d|d|�����������|S�)Nz"SVN download support is deprecatedr8���r9���r���r���zsvn:@z//r4���rh���:z --username=z --password=z'Doing subversion checkout from %s to %sz svn checkoutz -q r[��)warningsr��� UserWarningr=���r+���r-���r:���r!���r;��� _splituser urlunparser���r_���system)r���r>���r`���credsr@���netlocrB���rf���qr���authhostuserpwr?���s��� r%���r��zPackageIndex._download_svnj��s��� :KHHHiiQ" 99;; ! !& ) )� 9cSjj,2L,A,A#,F,F )FFD!Q� 9dood33� 9tABBx#ABBx~~c155 '// d�9d{{#'::c1#5#5bbBF$$ K . 5!F"FCAq8E ,11%88C ;S(KKK uuuccc88DEEEr2���c�����������������J���t�����������j����������������������������|�����������\��}}}}}|��������������������dd����������d���������}|��������������������dd����������d���������}d�}d|v�r|��������������������dd����������\��}}t�����������j����������������������������||||df����������}�|�|fS�)N+r9���r5���r8���r���r��r���)r:���r!���urlsplitr=���rsplit urlunsplit)r>��� pop_prefixr@���r��rB���rD���r��revs��� r%���_vcs_split_rev_from_urlz$PackageIndex._vcs_split_rev_from_url��s����,2L,A,A#,F,F)eTc1%%b)�zz#q!!!$ $;; C++ID#�l%%vvtUB&GHHCxr2���c�����������������8���|���������������������dd����������d���������}|���������������������|d����������\��}}|���������������������d||�����������t����������j��������d|d|�����������|0|���������������������d |�����������t����������j��������d |d |�����������|S�) Nr8���r9���r���Tr��zDoing git clone from %s to %szgit clone --quiet r[��zChecking out %szgit -C z checkout --quiet r=���r��r���r_���r��r���r>���r`���r��s��� r%���r��zPackageIndex._download_git��s����>>#q))!,///EES 13AAA sssHH=>>> ? II' - - - II�HHC � � �r2���c�����������������:���|���������������������dd����������d���������}|���������������������|d����������\��}}|���������������������d||�����������t����������j��������d|d|�����������|1|���������������������d |�����������t����������j��������d |d |d �����������|S�) Nr8���r9���r���Tr��zDoing hg clone from %s to %szhg clone --quiet r[��zUpdating to %sz hg --cwd z up -C -r z -qr��r��s��� r%���r��zPackageIndex._download_hg��s����>>#q))!,///EES 0#x@@@ ccc88<=== ? II& , , , II�HHCC � � �r2���c�����������������*����t����������j��������|g|R���d�S�ro���)r���r���r ��s��� r%���r���zPackageIndex.debug��s ���� #r2���c�����������������*����t����������j��������|g|R���d�S�ro���)r���r���r ��s��� r%���r���zPackageIndex.info�� ���� tr2���c�����������������*����t����������j��������|g|R���d�S�ro���)r���r���r ��s��� r%���r���zPackageIndex.warn��r��r2���)r���r���NT)Fro���)FFFN)FF)*r���r���r���r���r���r���r���r���r���r��r���r��r���r��r��r&��r)��r/��r4��r(��r$��r6���r;��rL��r:��r]��rg��ra��r���r9��r��r��r��r�� staticmethodr��r��r��r���r���r��� __classcell__r���s���@r%���r���r���/��s�������EE�- -�-�-�-�-�-$!�!�!�!�!31�31�31�31j'�'�'�'  �  �  �  ?�?�?�� 2�2�2  � � : � � &�&�&�& � � H�H�H�H�H�H � �  )� )� )�� � �  P� P� PL�N?�N?�N?�N?` � � � ,�,�,\�L"�"�"H � �  T� T� T� TD9�9�9:$�$�$�� E� E� E��,����\"��&��&����������r2���r���z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������T����|����������������������d����������}t����������j��������|����������S�)Nr���)rL���r���unescape)rK���whats��� r%��� decode_entityr����s!���� ;;q>>D =  r2���c�����������������,����t����������t����������|�����������S�)a�� Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz') 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz' ) entity_subr��)texts��� r%���r���r�����s����� mT * **r2���c�����������������������fd}|S�)Nc�����������������������fd}|S�)Nc����������������������t����������j��������������������}t����������j������������������� ��|�i�|t����������j��������|�����������S�#�t����������j��������|�����������w�xY�wro���)rw��getdefaulttimeoutsetdefaulttimeout)rp���rq��� old_timeoutrr���timeouts��� r%���_socket_timeoutz@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeout��sd���� 244K  $W - - - 6tT,V,,(5555(5555s ���A�Ar���)rr���r��r��s���` r%���r��z'socket_timeout.<locals>._socket_timeout��s*���� 6� 6� 6� 6� 6� 6�r2���r���)r��r��s���` r%���socket_timeoutr����s$���� � � � � � r2���c���������������������t�����������j����������������������������|�����������}|��������������������������������}t ����������j��������|����������}|��������������������������������}|��������������������dd����������S�)a9�� Encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r:���r!���r<���encodebase64 b64encoder���r��)r��auth_s auth_bytes encoded_bytesencodeds��� r%��� _encode_authr����s[�����\ ! !$ ' 'FJ$Z00M""$$G ??4 $ $$r2���c�������������������$����e�Zd�ZdZd�Zd�Zd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�����������������"����||�_���������||�_��������d�S�ro���usernamepassword)r���r��r��s��� r%���r���zCredential.__init__��s����    r2���c��������������#���.���K���|�j���������V��|�j��������V��d�S�ro���r��r���s��� r%���__iter__zCredential.__iter__��s(������mmr2���c�����������������&����dt����������|�����������z��S�)Nz%(username)s:%(password)s)varsr���s��� r%���__str__zCredential.__str__ ��s����*T$ZZ77r2���N)r���r���r���r���r���r��r��r���r2���r%���r��r����sK���������!�!�!��8�8�8�8�8r2���r��c�������������������@�����e�Zd�Z�fdZed�������������Zd�Zd�Z�xZS�) PyPIConfigc�����������������j���t�������������������������������g�dd����������}t������������������������������������������|�����������t����������j����������������������������t����������j����������������������������d����������d����������}t����������j����������������������������|����������r|� ��������������������|�����������dS�dS�)z% Load from ~/.pypirc )r��r�� repositoryr���~z.pypircN) dictfromkeysr���r���r_���rB���rl��� expanduserr���r���)r���defaultsrcr���s��� r%���r���zPyPIConfig.__init__��s�����==!G!G!GLL """ W\\"',,S119 = = 7>>"  �  IIbMMMMM � r2���c�����������������������fd����������������������������������D�������������}t����������t�����������j��������|��������������������S�)Nc�����������������d����g�|�],}���������������������|d�������������������������������������������*|-S�)r��)r���r~���)re���sectionr���s��� r%���rP��z2PyPIConfig.creds_by_repository.<locals>.<listcomp>��sI�����& �& �& xx..4466& & �& �& r2���)sectionsr��r|���_get_repo_cred)r���sections_with_repositoriess���` r%���creds_by_repositoryzPyPIConfig.creds_by_repository��sR����& �& �& �& ==??& �& �& " �C+-GHHIIIr2���c��������������������|����������������������|d������������������������������������������}|t����������|����������������������|d������������������������������������������|����������������������|d����������������������������������������������������fS�)Nr��r��r��)r���r~���r��)r���r��repos��� r%���r��zPyPIConfig._get_repo_cred#��st����xx..4466Z HHWj ) ) / / 1 1 HHWj ) ) / / 1 1 � � � r2���c�����������������v����|�j�����������������������������������������D�]\��}}|��������������������|����������r|c�S�dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r��itemsr-���)r���r>���r��creds��� r%���find_credentialzPyPIConfig.find_credential*��sS���� �!% 8 > > @ @� �  J~~j))�    � r2���) r���r���r���r���propertyr��r��r��r��r��s���@r%���r��r�� ��st�������� � � � � �J�J�XJ � � ������r2���r��c��������������������t�����������j����������������������������|�����������}|\��}}}}}}|��������������������d����������rt����������j����������������������������d����������|dv�rt����������|����������\��} } nd} | sMt���������������������� ��������������������|�����������} | r*t����������| ����������} | j ��������|�f} t����������j ��������dg| R���| rodt����������| ����������z���} || ||||f} t�����������j����������������������������| ����������}t�����������j����������������������������|����������}|��������������������d| �����������nt�����������j����������������������������|�����������}|��������������������dt&����������������������||����������}| rct�����������j����������������������������|j������������������\��}}}}}}||k����r2|| k����r,||||||f} t�����������j����������������������������| ����������|_��������|S�) z4Open a urllib2 request, handling HTTP authenticationr��znonnumeric port: '')ro��httpsNz*Authenticating as %s for %s (from .pypirc)zBasic Authorizationz User-Agent)r:���r!���r;���r,���ro��rp��rq��r��r��r��r}���r��r���r���r��r��r���Request add_header user_agentr>���)r>���r���parsedr@���r��rB���paramsrD���r��r��addressr��r���r?���r��r���rb��s2h2path2param2query2frag2s��� r%���rn��rn��4��s����\ " "3 ' 'F06-FFD&%�s�<k$$%:;;; """"6** gg �J||++C00 � Jt99D=#%D HA ID I I I I �.,t,,,vud:,))%00.((11?D1111.((-- |Z000 B �4�06|/D/DRV/L/L,Bvvu <<B'MMvvu<E\,,U33BF Ir2���c�����������������D����|����������������������d����������\��}}}�|r|nd|�fS�)zNsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r��N) rpartition)r��r��delims��� r%���r��r��c��s0�����,,D% #DDtd **r2���c���������������������|�S�ro���r���)r>���s��� r%��� fix_sf_urlr��n��s���� Jr2���c��������������������t�����������j����������������������������|�����������\��}}}}}}t�����������j����������������������������|����������}t ����������j����������������������������|����������rt�����������j����������������������������|�����������S�| ��������������������d����������rt ����������j�������� ��������������������|����������rg�}t ����������j ��������|����������D�]} t ����������j�������� ��������������������|| ����������} | dk����r>t����������| d����������5�} | ��������������������������������} ddd�����������n #�1�swxY�w�Y����nzt ����������j�������� ��������������������| ����������r| dz ��} |��������������������d��������������������| ���������������������d} | ��������������������|�d ��������������������|���������� ����������} d \��}}nd \��}}} d d i}t#����������j��������| ����������}t�����������j����������������������������|�||||����������S�)z7Read a local path, with special support for directoriesr4���z index.htmlrNz<a href="{name}">{name}</a>)r.���zB<html><head><title>{url}{files}r)r>files)OK)rzPath not foundz Not foundrz text/html)r:r!r;rrr_rBisfilerr,rrrlrrr2formatioStringIOrr)r>r@rArBparamrDrr`rrfilepathrbbodyrstatusmessager body_streams r%rmrmrs/5|/D/DS/I/I,FFD%~**400H w~~hC~%%c*** s  C h 7 7CH%% @ @Aw||Ha00HL  (C((%B7799D%%%%%%%%%%%%%%%x(( S LL6==1=EE F F F FX ;;3dii.>.>;??D# B{+G+d##K < ! !#vw M MMsD((D, /D, ro)r)Zrsysr_rdrrTrwrrrr configparserr http.clientro urllib.parser:urllib.request urllib.error functoolsrr pkg_resourcesrrrrr r r r r rrrrr distutilsrdistutils.errorsrfnmatchrsetuptools.wheelr setuptools.extern.more_itertoolsrrrJIrrrKrr=rW__all___SOCKET_TIMEOUT_tmplr version_inforr&rrFrrIrarrtrxrrrrrrrrrrrRawConfigParserrrrrnrrrmrr2r%r!s**   ++++++""""""<<<<<<rz677 rz3RT:: 2:J  RZ,bd 3 3 9 . 4 4 6 6    F \\ W^S- .: 0        F.2kTX# # # # L   bjKRTRR LLL$2.BP P P P P ;P P P jRZ< = = A  + + +    %%%*88888888"$$$$$-$$$N &~5++++^+++100@@NNNNNr2PK!O^+__pycache__/windows_support.cpython-311.pycnu[ ,Re*ddlZdZedZdS)Nc:tjdkrdS|S)NWindowscdS)N)argskwargss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/windows_support.pyzwindows_only..st)platformsystem)funcs r windows_onlyrs#I%%+++ Kr cddl}td|jjj}|jj|jjf|_|jj |_ d}|||}|s| dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. rNzctypes.wintypes) ctypes __import__windllkernel32SetFileAttributesWwintypesLPWSTRDWORDargtypesBOOLrestypeWinError)pathrSetFileAttributesFILE_ATTRIBUTE_HIDDENrets r hide_filer" sMMM !!! .A!'!79N!N & 4   D"7 8 8C  oo  r )r rr"rr r r#sB      r PK!;kk#__pycache__/sandbox.cpython-311.pycnu[ ,Re 8HddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddl mZejdrddlmcmcmcmZnejejZ eZn #e$rdZYnwxYweZgdZd dZejd dZ ejdZ!ejd Z"ejd Z#Gd d e$Z%Gd dZ&ejdZ'dZ(ejdZ)ejdZ*hdZ+dZ,dZ-dZ.GddZ/e0edr ej1gZ2ngZ2Gdde/Z3ej4ej5dd6DZ7Gdde Z8dS)!N)DistutilsError) working_setjava)AbstractSandboxDirectorySandboxSandboxViolation run_setupcd}t||5}|}dddn #1swxYwY||}t||d}t|||dS)z. Python 3 implementation of execfile. rbNexec)openreadcompiler )filenameglobalslocalsmodestreamscriptcodes /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/sandbox.py _execfiler$s D h   ~ 68V , ,Dws 488c#Ktjdd}||tjdd< |V|tjdd<dS#|tjdd<wxYwN)sysargv)replsaveds r save_argvr1sf HQQQKE    e s AAc#Ktjdd} |V|tjdd<dS#|tjdd<wxYwr)rpathrs r save_pathr#<sQ HQQQKE  e s /Ac#Ktj|dtj}|t_ dV|t_dS#|t_wxYw)zL Monkey-patch tempfile.tempdir with replacement, ensuring it exists T)exist_okN)osmakedirstempfiletempdir) replacementrs r override_tempr+Es] K d++++  E"H!  5    s AAc#Ktj}tj| |Vtj|dS#tj|wxYwr)r&getcwdchdir)targetrs rpushdr0VsR IKKEHV  s AAc(eZdZdZedZdS)UnpickleableExceptionzP An exception representing another Exception that could not be pickled. c  tj|tj|fS#t$r5ddlm}|||t |cYSwxYw)z Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. r)r2)pickledumps Exceptionsetuptools.sandboxr2dumprepr)typeexcclss rr8zUnpickleableException.dumpes{  1<%%v|C'8'88 8 1 1 1 G G G G G G88CT#YY00 0 0 0  1s'*r?r@rIrOrUrBrCrrErEtsK    +++++rCrEc#PKtjt5}Vdddn #1swxYwYtjfdtjD}t ||dS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3NK|]}|v|d|V dS)z encodings.N startswith).0mod_namers r zsave_modules..sP  5 ##L11 !  rC)rmodulescopyrEupdate_clear_modulesrU) saved_exc del_modulesrs @r save_modulesrcs K    E   Y Ku K; sAAAcDt|D]}tj|=dSr)listrr]) module_namesr[s rr`r`s0&&"" K ! !""rCc#Ktj} |Vtj|dS#tj|wxYwr) pkg_resources __getstate__ __setstate__r"s rsave_pkg_resources_staterksP  & ( (E* "5))))) "5))))s 1Ac #ZKtj|d}t5t 5t 5t t5t|5t|5tddVdddn #1swxYwYdddn #1swxYwYdddn #1swxYwYdddn #1swxYwYdddn #1swxYwYddddS#1swxYwYdS)Ntemp setuptools) r&r!joinrkrcr#hide_setuptoolsrr+r0 __import__) setup_dirtemp_dirs r setup_contextrtsw||Iv..H ! # # " " ^^ " " " "!!![[""&x00"""9--""&|444!EEE""""""""""""""""""""""""""""""""""""""""""""" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "sD DC1,C <C B, C ,B00C 3B04C 7 C CC C C  C1C C1!C "C1% D1C5 5D8C5 9D< D D D D D  D$'D$>Cython distutilsrnrh_distutils_hackcL|ddd}|tvS)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True .r)split_MODULES_TO_HIDE)r[ base_modules r _needs_hidingr~s("..a((+K * **rCctjdd}||t t tj}t |dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. rwN)rr]get remove_shimfilterr~r`)rwr]s rrprpsWkoo&7>>O"##%%%]CK00G7rCctjtj|}t |5 |gt |zt jdd<t jd|tj tj dt|5t|d}t||dddn #1swxYwYn,#t $r}|jr|jdrYd}~nd}~wwxYwddddS#1swxYwYdS)z8Run a distutils setup script, sandboxed in its directoryNrc*|Sr)activate)dists rzrun_setup..sdmmoorC__main__)__file__r=)r&r!abspathdirnamertrerrinsertr__init__ callbacksappendrdictr SystemExitargs) setup_scriptrrrnsvs rr r s = =>>I y ! !   '.4::5CHQQQK HOOAy ) ) )  " " "  ! ( ()E)E F F F!),, , ,<*EEE,+++ , , , , , , , , , , , , , , ,   v !&)                    sa EBD "D4 D D D D D  E D5D0+E0D55EE  E ceZdZdZdZdZdZdZdZdZ dZ d D]$Z e e e re e ee <%dd Zer ed eZed eZdD]$Z e e e ree ee <%dZdD]$Z e e e ree ee <%dZdD]$Z e e e ree ee <%dZdZdZdZd S)rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcRfdttD_dS)Nc^g|])}|dt|'|*S)_)rYhasattr)rZnamerHs r z,AbstractSandbox.__init__..sO   ??3'' -4D$,?,?    rC)dir_os_attrsrGs`rrzAbstractSandbox.__init__s7    C    rCc b|jD]&}tt|t||'dSr)rsetattrr&getattr)rHsourcers r_copyzAbstractSandbox._copys<K 5 5D Bgfd33 4 4 4 4 5 5rCc||tr|jt_|jt_d|_dSrK)r_filebuiltinsfile_openr _activerGs rrIzAbstractSandbox.__enter__s9 4  ' JHM   rCcd|_trtt_tt_|tdSNF)rrrrrr rr)rHexc_type exc_value tracebacks rrOzAbstractSandbox.__exit__!s2  "!HM  3rCcN|5|cdddS#1swxYwYdS)zRun 'func' under os sandboxingNrB)rHfuncs rrunzAbstractSandbox.run(su   466                  s c@ttfd}|S)NcX|jr|j||g|Ri|\}}||g|Ri|Sr)r _remap_pair)rHsrcdstrkwroriginals rwrapz3AbstractSandbox._mk_dual_path_wrapper..wrap0sZ| I+4+D#sHTHHHRHHS8C2t222r22 2rCrrrrrs` @r_mk_dual_path_wrapperz%AbstractSandbox._mk_dual_path_wrapper-s83%% 3 3 3 3 3 3  rC)renamelinksymlinkNcDpttfd}|S)NcN|jr|j|g|Ri|}|g|Ri|Sr)r _remap_inputrHr!rrrrs rrz5AbstractSandbox._mk_single_path_wrapper..wrap>sR| B(t(tAdAAAbAA8D.4...2.. .rCr)rrrs`` r_mk_single_path_wrapperz'AbstractSandbox._mk_single_path_wrapper;s=1wsD11 / / / / / /  rCrr )statlistdirr.r chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstat startfilemkfifomknodpathconfaccessc@ttfd}|S)Nc|jr2|j|g|Ri|}||g|Ri|S|g|Ri|Sr)rr _remap_outputrs rrz4AbstractSandbox._mk_single_with_return..wrapcs| M(t(tAdAAAbAA))$0K0K0K0K0K0KLLL8D.4...2.. .rCrrs` @r_mk_single_with_returnz&AbstractSandbox._mk_single_with_return`s83%% / / / / / /  rC)readlinktempnamc@ttfd}|S)NcR|i|}|jr||S|Sr)rr)rHrrretvalrrs rrz'AbstractSandbox._mk_query..wraprs<Xt*r**F| 8))$777MrCrrs` @r _mk_queryzAbstractSandbox._mk_queryos83%%        rC)r-tmpnamc|S)z=Called to remap or validate any path, whether input or outputrB)rHr!s r_validate_pathzAbstractSandbox._validate_path~s rCc,||SzCalled for path inputsrrH operationr!rrs rrzAbstractSandbox._remap_input""4(((rCc,||S)zCalled for path outputsr)rHrr!s rrzAbstractSandbox._remap_outputrrCcV|j|dz|g|Ri||j|dz|g|Ri|fS)?Called for path pairs like rename, link, and symlink operationsz-fromz-to)rrHrrrrrs rrzAbstractSandbox._remap_pairs\ D i'13 D D D D D D D i%/ Bt B B Br B B  rCr)r=r>r?r@rrrrIrOrrrrrrrrrrrrrrrrBrCrrr sNNG   555 .99 73   922488FFHHTN 7''66 # #FE 2 2E;;* 73   ;44T::FFHHTN   (:: 73   :33D99FFHHTN   %-- 73   -&Yt__FFHHTN))))))     rCrdevnullceZdZdZegdZgZ efdZ dZ e rddZ ddZ dZ d Zd Zd Zd ZddZdS)rz}tjtj|?SrB)r&r!normcaserealpath)rZr!s rrz-DirectorySandbox.__init__..sE   9=BG  RW--d33 4 4   rC) r&r!rr_sandboxro_prefix _exceptionsrr)rHsandbox exceptionss rrzDirectorySandbox.__init__s(()9)9')B)BCC w||DM266   AK      &&&&&rCc(ddlm}||||)Nr)r)r7r)rHrrrrs r _violationzDirectorySandbox._violations)777777y$333rCrc||dvr(||s|jd||g|Ri|t||g|Ri|S)Nrrtr rUUr)_okrrrHr!rrrs rrzDirectorySandbox._filesc7777d@T@@@R@@@t1d111b11 1rCc||dvr(||s|jd||g|Ri|t||g|Ri|S)Nrr )rrrrs rrzDirectorySandbox._opensc 3 3 3DHHTNN 3 DOFD$ < < < < < < <T4-$---"---rCc0|ddS)Nr)rrGs rrzDirectorySandbox.tmpnams !!!!!rCc4|j} d|_tjtj|}||p$||jkp||j ||_S#||_wxYwr) rr&r!rr _exemptedrrYr)rHr!activers rrzDirectorySandbox._oks " DLw''(8(8(>(>??Hx((5t},5&&t|44  "DLL6DL ! ! ! !s A.sB  /8H   * *      rCc3BK|]}tj|VdSr)rematch)rZpatternr s rr\z-DirectorySandbox._exempted..s@  ,3BHWh ' '      rC)r_exception_patterns itertoolschainany)rHr  start_matchespattern_matches candidatess ` rrzDirectorySandbox._exemptedsx    <@r?r@textwrapdedentlstripr%r)rBrCrrrsOOO 8?    fhh ,,,,,rCrr)9r&rr(operator functoolsrr contextlibr4r*rrhdistutils.errorsrrplatformrY$org.python.modules.posix.PosixModulepythonr]posix PosixModulerrrr NameErrorr r__all__rcontextmanagerrr#r+r0r6r2rErcr`rkrtr|r~rpr rrrr rreduceor_r{rrrBrCrr;s   ++++++%%%%%%<6""6666666666666666 +bg C EE EEE             ! ! !  11111I111(++++++++< 2"""  ***  " " "+++*   (E E E E E E E E P 72y:,KKK[8[8[8[8[8[8[8[8|i LGMMOO ,,,,,~,,,,,s:A==BBPK!1SA\\&__pycache__/namespaces.cpython-311.pycnu[ ,Re pddlZddlmZddlZejjZGddZGddeZdS)N)logcXeZdZdZdZdZdZdZ dZ dZ dZ d Z e d Z d S) Installerz -nspkg.pthc|}|sdStj|\}}||jz }|j|tj d|t|j |}|j rt|dSt|d5}||ddddS#1swxYwYdS)Nz Installing %swt)_get_all_ns_packagesospathsplitext _get_target nspkg_extoutputsappendrinfomap_gen_nspkg_linedry_runlistopen writelines)selfnspfilenameextlinesfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/namespaces.pyinstall_namespaceszInstaller.install_namespaces s(''))  F(()9)9););<< #DN" H%%% (+++D(#.. <  KKK F (D ! ! Q LL                     sC&&C*-C*ctj|\}}||jz }tj|sdSt jd|tj|dS)Nz Removing %s) r r r r r existsrrremove)rrrs runinstall_namespaceszInstaller.uninstall_namespacessv(()9)9););<< #DN"w~~h''  F ))) (c|jSN)targetrs rr zInstaller._get_target's {r#) zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cdS)Nz$sys._getframe(1).f_locals['sitedir']r's r _get_rootzInstaller._get_rootEs55r#ct|d}|}|j}|d\}}}|r ||jz }d|tzdzS)N.; )tuplesplitr* _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgpthroot tmpl_linesparentsepchilds rrzInstaller._gen_nspkg_lineHs}CIIcNN##~~%  ^^C00U  1 $0 0Jxx ##fhh.55r#c||jjpg}ttt |j|S)z,Return sorted list of all package namespaces) distributionnamespace_packagessortedflattenr _pkg_names)rpkgss rrzInstaller._get_all_ns_packagesQs4 39rgc$/48899:::r#c#K|d}|r/d|V||-dSdS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r,N)r0r4pop)r6partss rrBzInstaller._pkg_namesVs` # ((5// ! ! ! IIKKK     r#N)__name__ __module__ __qualname__r rr"r r1r3r*rr staticmethodrBr)r#rrr sI   $K((<666666;;;   \   r#rceZdZdZdZdS)DevelopInstallercDtt|jSr%)reprstregg_pathr's rr*zDevelopInstaller._get_rootgsC &&'''r#c|jSr%)egg_linkr's rr zDevelopInstaller._get_targetjs }r#N)rGrHrIr*r r)r#rrLrLfs2(((r#rL) r distutilsr itertoolschain from_iterablerArrLr)r#rrWs  / 'ZZZZZZZZzyr#PK!W __pycache__/dist.cpython-311.pycnu[ ,ReİRdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl Zddl mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd lmZdd lm Z dd l!m"Z"m#Z#dd l m$Z$dd l%m&Z&ddl%m'Z'ddl(m)Z)m*Z*ddl+m,Z,ddl-m.Z.ddl/Z/ddl0Z/ddl/m1Z1ddl2m3Z3ddl4m5Z5m6Z6ddl7m8Z8ddl9Z9ddl:m;Z;ddl-mm?Z?e@de@ddZAdZBdeCd eCfd!ZDd"d#d$eCd eeCfd%ZEd"d#d$eCd eeCfd&ZFd"d#d$eCd eeeCfd'ZGd"d#d eeCfd(ZHd)ZId*ZJd+ZKeLeMfZNd,ZOd-ZPd.ZQd/ZRd0ZSd1ZTd2ZUd3ZVd4ZWd5ZXd6ZYd7ZZd8Z[e3ej\j]Z^Gd9de^Z]Gd:d;e.Z_dS)< DistributionN) strtobool)DEBUGtranslate_longopt)iglob)ListOptional TYPE_CHECKING)Path) defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError) rfc822_escape) packaging) ordered_set)unique_everseen partition)metadata)SetuptoolsDeprecationWarning)windows_support) get_unpatched)setupcfg pyprojecttoml)ConfigDiscoveryversion)_reqs) _entry_points)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncTtjdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/dist.py_get_unpatchedr)8s$ M-/EFFF   cbt|dd}|tjd}||_|S)Nmetadata_version2.1)getattrrVersionr,)selfmvs r(get_metadata_versionr2=s5 )4 0 0B z _U # # " Ir*contentreturnc <|}t|dkr|dSd|dt jd|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr N) splitlineslenlstripjointextwrapdedent)r3liness r(rfc822_unescaper>Esy    E 5zzQQx   99eAhoo''599M9M)N)NO P PPr*msgr"fieldc&||}|dkrdS|S)zRead Message header field.UNKNOWNNr?r@values r(_read_field_from_msgrFMs JE t Lr*cHt||}||St|S)z4Read Message header field and apply rfc822_unescape.)rFr>rDs r(_read_field_unescaped_from_msgrHUs) e , ,E } 5 ! !!r*cB||d}|gkrdS|S)z9Read Message header field and return all results as list.N)get_all)r?r@valuess r(_read_list_from_msgrL]s( [[ % %F ||t Mr*cf|}|dks|sdS|S)NrB) get_payloadstrip)r?rEs r(_read_payload_from_msgrPes7 OO   # # % %E t Lr*cLt|}tj|d|_t |d|_t |d|_t |d|_t |d|_d|_t |d|_ d|_ t |d|_ t |d |_ t|d |_t|d |_|j1|jtjd krt!||_t |d|_d |vr(t |d d|_t'|d|_t'|d|_|jtjdkr@t'|d|_t'|d|_t'|d|_nd|_d|_d|_t'|d|_dS)z-Reads the metadata values from a file object.zmetadata-versionnamersummaryauthorNz author-emailz home-pagez download-urllicense descriptionr-keywords,platform classifierz1.1requiresprovides obsoletesz license-file)rrr/r,rFrRrVrT maintainer author_emailmaintainer_emailurl download_urlrHrUlong_descriptionrPsplitrWrL platforms classifiersr[r\r] license_files)r0filer?s r( read_pkg_filerils D ! !C#OC0B,CDDD$S&11DI'Y77DL+C;;D&sH55DKDO,S.AAD D#C55DH,S.AAD1#yAADL:3 NND % !7!777 6s ; ;+C;;DS,S*==CCCHH (j99DN*3 ==D  6 666+C<< +C<< ,S+>>  ,S.AADr*cd|vrAtjd|dd}|S)zF Quick and dirty validation for Summary pypa/setuptools#1390. r6z1newlines not allowed and will break in the futurer)r$r%rOrd)vals r( single_linerlsE s{{  IJJJiikk%%a( Jr*c|}fd}|dt||d||d||}|r|dt |d}|D]$\}}t ||d}| |||%|} | r|dt| |j D]} |d d | zd | } | r |d | | pg} | D]} |d | |d||d||d||d|t'|dr|d|j|jr|d|j|jr|jD]}|d||d|jpg|}|rDd|z|dsddSdSdS)z0Write the PKG-INFO format data to a file object.c>|d|ddS)Nz: r6)write)keyrErhs r( write_fieldz#write_pkg_file..write_fields( eee,-----r*zMetadata-VersionNamer/Summary))z Home-pagera)z Download-URLrb)AuthorrT)z Author-emailr_) Maintainerr^)zMaintainer-emailr`NLicensez Project-URLz%s, %srXKeywordsPlatform ClassifierRequiresProvides Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-Extraz License-Filez %sr6)r2strget_name get_versionget_descriptionrlr. get_licenser project_urlsitemsr: get_keywords get_platforms _write_listget_classifiers get_requires get_provides get_obsoleteshasattrr}long_description_content_typeprovides_extrasrgget_long_descriptionroendswith)r0rhrrqrSoptional_fieldsr@attrattr_valrU project_urlrWrerYextrarcs ` r(write_pkg_filers}''))G.....K"CLL111K (((K 4++--...""$$G5 I{733444O')) t4t,,   Kx ( ( (  G7 I}W55666(..00;;  M8k#9::::xx))++,,H* J)))""$$*I** J))))T<)=)=)?)?@@@ T:t'8'8':':;;;T:t'8'8':':;;;T;(:(:(<(<===t&''= %t';<<< )T .0RSSS 1) 1 1E K(% 0 0 0 0T>4+=+CDDD0022 6,,---((..  JJt       r*c tj|dd}|jrJdS#ttt t f$r}t|d|d|d}~wwxYw)N)rErRgroupz/ must be importable 'module:attrs' string (got ))r EntryPointextras TypeError ValueErrorAttributeErrorAssertionErrorr)distrrEepes r(check_importablers  u4t D D D9 z>> B!FJddEEE R   s $AAAc t|ttfsJd||ksJdS#tt t tf$r}t|d|d|d}~wwxYw)z"Verify that value is a string listz must be a list of strings (got rN) isinstancelisttupler:rrrrrrrrErs r(assert_string_listrs %$/////wwu~~&&&&&& z>> B!7;ttUUU C   s9=A5A00A5cB|}t||||D]}||stdd|zz|d\}}}|r%||vr!tjd||d}tj|tdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyzeThe namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).N) rhas_contents_forr rpartition distutilslogr%r$r) rrrE ns_packagesnspparentsepchildr?s r( check_nsprsKtT;///99$$S)) %C(3./ !^^C00U  fK// M  ;     D   c78888%99r*c ttjt|dS#t t tf$r}td|d}~wwxYw)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N) r itertoolsstarmap _check_extrarrrrrrs r( check_extrasr sr Y |U[[]] ; ;<<<<< z> 2! &    s9=A)A$$A)c|d\}}}|r&tj|rtd|zt t j|dS)N:zInvalid environment marker: )r pkg_resourcesinvalid_markerrrr parse)rreqsrRrmarkers r(rr,sh,,D#v K-.v66K!"@6"IJJJT  r*cxt||kr&d}t|||dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rrEN)boolrformat)rrrEtmpls r( assert_boolr3s> E{{eA!$++4u+"E"EFFFr*ch|stj|dtdSt|d)Nz is ignored.z is invalid.)r$r%r&rrrrEs r(invalid_unless_falser:sB  +++-CDDD 333 4 44r*c  ttj|t|tt frt ddS#t tf$r,}d}t| |||d}~wwxYw)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rerrorN) rr rrdictsetrrrrrrrErrs r(check_requirementsrAs R U[     edC[ ) ) ?=>> > ? ? z "RRR O "$++4u+"E"EFFEQ RsA AB !'BB c tj|dS#tjjtf$r,}d}t ||||d}~wwxYw)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rN)r specifiers SpecifierSetInvalidSpecifierrrrrs r(check_specifierrOs}R))%00000  1> BRRR W "$++4u+"E"EFFEQ Rs#A*'A%%A*ct tj|dS#t$r}t||d}~wwxYw)z)Verify that entry_points map is parseableN)r!load Exceptionrrs r(check_entry_pointsrZsM,5!!!!! ,,,!!$$!+,s 727cNt|tstddS)Nztest_suite must be a string)rr~rrs r(check_test_suiterbs0 eS ! !A!"?@@@AAr*c`t|ts"td||D]a\}}t|t s#td||t |d||bdS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rrrrrr~r)rrrEkvs r(check_package_datargs eT " " ! ''-vd||    HH1!S!! %>EEdANN  4!6!=!=d!C!CQGGGG HHr*cz|D]7}tjd|s tjd|8dS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr%)rrrEpkgnames r(check_packagesrvsRx00  M  8   r*ceZdZdZdeejdddZdZdZ d1dZ d Z d Z e d Ze d Zd ZdZe dZdZdZdZe dZd1dZdZdZdZd1dZdZd2dZdZdZe dZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1fd0Z2xZ3S)3raG Distribution with support for tests and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. cdSNrCrCr*r(zDistribution.sr*cdSrrCrCr*r(rzDistribution.sr*cdSrrCrCr*r(rzDistribution.sr*)rrr license_filergNct|rd|vsd|vrdStjt|d}tjj|}|J|ds7tjt|d|_ ||_ dSdSdS)NrRrzPKG-INFO) r safe_namer~lower working_setby_keyget has_metadata safe_version_version _patched_dist)r0attrsrprs r(patch_missing_pkg_infoz#Distribution.patch_missing_pkg_infos  e++y/E/E F%c%-&8&899??AA(/33C88  D$5$5j$A$A )6s5;K7L7LMMDM!%D       r*cXtd}|si_|pi}g_|dd_||dg_|dg_tj dD]*}t |j d+tfd|Di_g_t%t&j_t-_|jjj_dS)N package_datasrc_rootdependency_linkssetup_requiresdistutils.setup_keywordsrc.i|]\}}|jv||SrC)_DISTUTILS_UNSUPPORTED_METADATA.0rrr0s r( z)Distribution.__init__..s7   AqD@@@1@@@r*)rr dist_filespoprrrrr entry_pointsvars setdefaultrR _Distribution__init__r_orig_extras_require_orig_install_requiresr r OrderedSet_tmp_extras_requirer set_defaults_set_metadata_defaults_normalize_version_validate_versionr_finalize_requires)r0rhave_package_datars` r(r zDistribution.__init__s#D.99  # "D   *d33  ##E*** % *z2Distribution._validate_metadata..s7   t}c400< <<D M+$+1111 2 2 2 r*c6t|tjrt|}|m tj|nL#tjjtf$r.tj d|ztj |cYSwxYw|S)NzThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.) rnumbersNumberr~rrr/InvalidVersionrr$r%r!r"rs r(rzDistribution._validate_versions gw~ . . #'llG   /!))'2222%4i@ / / / ")) "~g..... /sA ABBct|ddr|j|j_t|ddrk|jp|j|_|jD]>}|dd}|r|jj|?t|ddr|j s |j |_ | | dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. r}Nextras_requirerrinstall_requires) r.r}rr r*keysrdraddr r+_convert_extras_requirements"_move_install_requirements_markers)r0rs r(rzDistribution._finalize_requires(s 4*D 1 1 A,0,@DM ) 4)4 0 0 =(,(A(XTEXD %,1133 = = C((+=M155e<<< 4+T 2 2 @4;V @*.*?D ' ))+++ //11111r*cvt|ddpi}ttj}t|d||_|D]a\}}|j|t j|D]:}||}|j||z |;bdS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. r*Nr) r.r rrrrr r _suffix_forappend)r0 spec_ext_reqstmpsectionrrsuffixs r(r.z)Distribution._convert_extras_requirementsBs  &6==C +011#*41F#L#L '--// E EJGQ  $W - -[^^ E E))!,,(6)9:AA!DDDD E E Er*cB|jrdt|jzndS)ze For a requirement, return the 'extras_require' suffix for that requirement. rr)rr~reqs r(r1zDistribution._suffix_forRs# ), :sS__$$:r*cd}tddpd}ttj|}t ||}t j||}ttt|_ |D]7}j dt|j z |8tfdj D_dS)zv Move requirements in `install_requires` that are using environment markers `extras_require`. c|j Srrr9s r( is_simple_reqzFDistribution._move_install_requirements_markers..is_simple_reqds z> !r*r+NrCrc 3K|]M\}}|ttdtj|DfVNdS)c34K|]}t|VdSr)r~)rr6s r( zLDistribution._move_install_requirements_markers...qs("K"Ka3q66"K"K"K"K"K"Kr*N)rrfromkeysmap _clean_reqrs r(rAzBDistribution._move_install_requirements_markers..osq# # 1T]]"K"K3t3J3J"K"K"KKKLL M# # # # # # r*)r.rr rfilterr filterfalserCr~r+rrr2rrr*)r0r>spec_inst_reqs inst_reqs simple_reqs complex_reqsr6s` r(r/z/Distribution._move_install_requirements_markersZs  " " "!'94@@FB^4455 ]I66  ,]IFF $Sk%:%: ; ; D DA  $S3qx==%8 9 @ @ C C C C"# # # # 06688# # #   r*cd|_|S)zP Given a Requirement, remove environment markers and return it. Nr=)r0r:s r(rDzDistribution._clean_requs  r*c|jj}|r|ng}|jj}|r||vr||||d}t t |||j_dS)z>> list(Distribution._expand_patterns(['LICENSE'])) ['LICENSE'] >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*'])) ['setup.cfg', 'LICENSE'] c3K|]Y}tt|D]:}|dtj|6|V;ZdS)~N)sortedrrospathisfile)rpatternrUs r(rAz0Distribution._expand_patterns..s  uW~~..  ==%%  +-'..*>*>         r*rC)rNs r(rMzDistribution._expand_patternss#  #    r*c ddlm}tjtjkrgngd}t |}||}tr|d|}t|_ |D]'}tj |d5}tr,|dj d it||dddn #1swxYwY|D]}||}||} |D]V} | d ks| |vr ||| } || |} || |} || f| | <W|)d |jvrdS|jd D]~\} \} } |j| } | rt5|  } n| d vrt5| } t7|| p| | ]#t8$r}t;||d}~wwxYwdS) z Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8encodingz reading {filename}__name__global)verbosedry_runrC) configparserrYsysrZ base_prefix frozensetfind_config_filesrannouncer~ optionxformioopenrr# read_filesectionsoptionsget_option_dictrwarn_dash_deprecationmake_option_lowercaser command_optionsr negative_optrsetattrrr)r0 filenamesrYignore_optionsparserfilenamereaderr5rpopt_dictoptrksrcaliasrs r(_parse_config_filesz Distribution._parse_config_filess .----- zS_,, B (#>22  ..00I  @ MM> ? ? ? !  HG444 )MMM"?"8"?"K"K&(("K"KLLL  ((( ) ) ) ) ) ) ) ) ) ) ) ) ) ) )"??,, 4 4 ..11//88"44Cj((C>,A,A  **Wc22C44S'BBC44S'BBC%-sOHSMM4 OO     4/ / / F "&!5h!?!E!E!G!G 5 5 S*3%))#..E %#C..(...nn 5elsC0000 5 5 5*1--14 5 5 5s+A C..C2 5C2 H00 I:I  IcD|dvr|S|dd}ttjtjj|}|ds |dkr||vr|Sd|vrtj d|d|d|S) N)zoptions.extras_requirezoptions.data_files-_rprzUsage of dash-separated 'zL' will not be supported in future versions. Please use the underscore name ' ' instead) replacerrchainrcommand__all___setuptools_commands startswithr$r%)r0r}r5underscore_optcommandss r(rrz"Distribution.warn_dash_deprecations    JS#..    %  % % ' '     ""9-- ":%%x''! ! #:: MM33(    r*cn tjdjjS#tj$rgcYSwxYw)Nr!)r distributionrnamesPackageNotFoundError)r0s r(rz!Distribution._setuptools_commands sE (66CI I,   III s  44c |dks|r|S|}tjd|d|d|d|S)NrzUsage of uppercase key 'z' in 'z?' will be deprecated in future versions. Please use lowercase 'r)islowerrr$r%)r0r}r5 lowercase_opts r(rsz"Distribution.make_option_lowercasesd j CKKMM J  ssGGG]]] ,   r*c ,|}|||}tr|d|z|D]3\}\}}tr|d|d|d|d d|jD}n#t $rg}YnwxYw |j}n#t $ri}YnwxYw t|t} ||vr(| r&t|||t| n`||vr!| rt||t|n;t||rt|||ntd|d |d |d #t$r} t| | d} ~ wwxYwdS) a Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) Nz# setting options for '%s' command:z z = z (from rc,g|]}t|SrCr)ros r( z5Distribution._set_command_options..3s!WWWa.q11WWWr*z error in z : command 'z' has no such option '')get_command_namerqrrjrboolean_optionsrrurr~rvrrrr) r0 command_obj option_dict command_namersourcerE bool_optsneg_opt is_stringrs r(_set_command_optionsz!Distribution._set_command_optionss#3355  ..|<N>N:NOOOOy((Y(K51A1ABBBB[&11K7777..!66<<<9 5 5 5*1--14 53 5 5s=B!! B0/B04B<< C  C B!E22 F<F  Fcg}t|jp tjd}|.PsQ'(Ar*rr)r rrTcurdirrrexists)r0rw tomlfilesstandard_project_metadatapartss r(_get_project_config_filesz&Distribution._get_project_config_filesKs $()C")EU$V$V!  AA9MMEU1XIU1XII & - - / / 423I)##r*Fc ||\}}||tj||j||D]}t j|||||dS)zXParses configuration files from various levels and loads configuration. )rw)ignore_option_errorsN) rrrparse_configurationrtrapply_configurationrrO)r0rwrinifilesrrzs r(parse_config_fileszDistribution.parse_config_filesWs#<R S S S S !!! $$&&&&&r*ctjtj||jd}|D]#}tj|d$|S)zResolve pre-setup requirementsT) installerreplace_conflicting)r)rrresolver rfetch_build_eggr-)r0r[resolved_distsrs r(fetch_build_eggszDistribution.fetch_build_eggshsk&2:: K ! !* $;   # > >D  % ) )$ ) = = = =r*cd}d}tj|}tj|j|}t d|}t ||D] }||dS)z Allow plugins to apply arbitrary operations to the distribution. Each hook may optionally define a 'order' to influence the order of execution. Smaller numbers go first and the default is 0. z(setuptools.finalize_distribution_optionsc$t|ddS)Norderr)r.)hooks r(by_orderz/Distribution.finalize_options..by_order|s4!,, ,r*rc*|Sr)r)rs r(rz/Distribution.finalize_options..sqvvxxr*)rpN)rrrrF_removedrCrS)r0rrdefinedfilteredloadedrs r(finalize_optionszDistribution.finalize_optionsss; - - -'e444(@@''22X...  B BtHHHH  r*cdh}|j|vS)z When removing an entry point, if metadata is loaded from an older version of Setuptools, that removed entry point will attempt to be loaded and will fail. See #2765 for more details. 2to3_doctests)rR)rremoveds r(rzDistribution._removeds  w'!!r*ctjdD]>}t||jd}|$|||j|?dS)Nrr)rrr.rRr)r0rrEs r(_finalize_setup_keywordsz%Distribution._finalize_setup_keywordssb'.HIII 0 0BD"'400E  $/// 0 0r*ctjtjd}tj|stj|t j|tj|d}t|d5}| d| d| ddddn #1swxYwY|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) rTrUr:rrmkdirr hide_filermro)r0 egg_cache_dirreadme_txt_filenamers r(get_egg_cache_dirzDistribution.get_egg_cache_dirs0 RY88 w~~m,, M H] # # #  %m 4 4 4"$',,}l"K"K )3// M1J.KLLL M M M M M M M M M M M M M M Ms"AC..C25C2c&ddlm}|||S)z Fetch an egg needed for buildingr)r)setuptools.installerr)r0r:rs r(rzDistribution.fetch_build_eggs&888888tS)))r*c||jvr |j|Stjd|}|D]#}|x|j|<}|cSt||S)z(Pluggable version of get_command_class()distutils.commands)rrR)cmdclassrrrr get_command_class)r0repsrrs r(rzDistribution.get_command_classs{ dm # #=) )#*>WMMM B BB02 9DM' "XOOO 224AA Ar*ctjdD]3}|j|jvr#|}||j|j<4t |SNrr)rrrRrrr print_commandsr0rrs r(rzDistribution.print_commandss_'.BCCC 2 2Bwdm++7799)1 bg&++D111r*ctjdD]3}|j|jvr#|}||j|j<4t |Sr)rrrRrrr get_command_listrs r(rzDistribution.get_command_lists_'.BCCC 2 2Bwdm++7799)1 bg&--d333r*c |D]=\}}t|d|zd}|r ||'|||>dS)aAdd items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. _include_N)rr. _include_misc)r0rrrincludes r(rzDistribution.includesnKKMM ) )DAqdK!OT::G ) ""1a((((  ) )r*cdz|jrfd|jD|_|jrfd|jD|_|jrfd|jD|_dSdS)z9Remove packages, modules, and extensions in named packagercJg|]}|k|| SrCrrppackagepfxs r(rz0Distribution.exclude_package..s5ALLcARARLLLLr*cJg|]}|k|| SrCrrs r(rz0Distribution.exclude_package..s6a7ll1<.sE   6W$$QV->->s-C-C$$$$r*N)packages py_modules ext_modules)r0rrs `@r(exclude_packagezDistribution.exclude_packagesm = =DM ? ?DO        )   D     r*cz|dz}|D] }||ks||rdS!dS)z.s# K K K$U9J9J9J9J9Jr*rsequencerr.rrv)r0rRrEoldrs ` r( _exclude_misczDistribution._exclude_miscs%** %>BddEEEJ  X$%%CC X X X%&H4&OPPVW W X ?:c8#<# A AA ct|tst|d|d t||n%#t$r}td|z|d}~wwxYwt |||dSttst|dzfd|D}t |||zdS)zAHandle 'include()' for list/tuple attrs without a special handlerz: setting must be a list (rrNrcg|]}|v| SrCrC)rrrs r(rz.Distribution._include_misc..!s===DT__4___r*r)r0rRrErnewrs @r(rzDistribution._include_miscs%** Y%444QVQVQV&WXX X X$%%CC X X X%&H4&OPPVW W X ; D$ & & & & &C** +%MM >===E===C D$c * * * * *rc |D]=\}}t|d|zd}|r ||'|||>dS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. _exclude_N)rr.r)r0rrrexcludes r(rzDistribution.exclude$sn KKMM ) )DAqdK!OT::G ) ""1a((((  ) )r*ct|tstd|dtt |j|dS)Nz+packages: setting must be a list or tuple (r)rrrrrCr)r0rs r(_exclude_packageszDistribution._exclude_packages;sV(H-- %%DLHHN  S%x 0 011111r*c|jj|_|jj|_|d}|d}||vr9||\}}||=ddl}||d|dd<|d}||v9t |||}||} t| ddrd|f||d<|gS|S)NraliasesTrcommand_consumes_arguments command lineargs) __class__global_optionsrurqshlexrdr _parse_command_optsrr.) r0ryrrrr~rr nargs cmd_classs r(r z Distribution._parse_command_optsBs"n; N7q'&&y11   )JC LLL{{5$//D!H1gG   11$EE**733 9:D A A 5CU4KD  ) )& 1   r*c i}|jD]\}}|D]\}\}}|dkr|dd}|dkr||}|j}|t|di|D]\} } | |kr| }d}ntdn|dkrd}|| |i|<Ռ|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. rrrrruNzShouldn't be able to get herer) rtrrget_command_objrucopyupdater.rr ) r0dcmdoptsr}r~rkcmdobjrnegposs r(get_cmdline_optionsz Distribution.get_cmdline_options]s@ -3355 1 1IC#'::<< 1 1Zc3.((kk#s++!88!11#66F"/4466GNN76>2#F#FGGG$+MMOONNS#::"%C"&C!E& --LMMM"AXXC-0 S"%%c**- 10r*c#K|jpdD]}|V|jpdD]}|V|jpdD]G}t|tr|\}}n|j}|dr |dd}|VHdS)z@Yield all packages, modules, and extension names in distributionrCmoduleNi)rrrrrrRr)r0pkgrextrR buildinfos r(rz$Distribution.iter_distribution_namess=&B  CIIIIo+  FLLLL#)r  C#u%% "%iix}}X&& !CRCyJJJJ  r*c4ddl}|jrt||St |jt jst||S|jj dvrt||S|jj}|j d t|||j |S#|j |wxYw)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rN)r^utf8r^r_) rf help_commandsr handle_display_optionsrstdoutrl TextIOWrapperr`r reconfigure)r0 option_orderrfr`s r(r z#Distribution.handle_display_optionss     L 77lKK K#*b&677 L 77lKK K :  $ $ & &*; ; ; 77lKK K:& 000 6 77lKK J " "H " 5 5 5 5CJ " "H " 5 5 5 5s C::Dcr|t|dSr)rsuper run_command)r0rrs r(r'zDistribution.run_commands5  G$$$$$r*r)NF)4ra __module__ __qualname____doc__rrrrrrr rr staticmethodrrrr.r1r/rDrOrMrrrrrsrrrrrrrrrrrrrrrrrrrr rrr r' __classcell__)rs@r(rrs-11h*6&1$ % ''#M & & &""""""""H + + +QQQ  \ \$2224EEE ;;\;   6   &   \  M5M5M5M5^6   ,5,5,5,5\ $ $ $''''"   $ " "\ "000 &*** B B B222444))),*MMM"+++&))).2226&&&P$6668%%%%%%%%%r*ceZdZdZdS)r&zrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rar(r)r*rCr*r(r&r&s"FFFFr*r&)`rrlrfrrTr$r& distutils.logrdistutils.core distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr;typingr r r pathlibr collectionsr emailrdistutils.errorsrrrsetuptools.externrr setuptools.extern.more_itertoolsrr _importlibrrrr!setuptools.commandrsetuptools.monkeyrsetuptools.configrrsetuptools.discoveryrrsetuptools.extern.packagingrr r! email.messager" __import__r)r2r~r>rFrHrLrPrirlrrrrrrrrrrrrrrrrrcorerr r&rCr*r(rGs0   $$$$$$!!!!!!4444440000000000############FFFFFFFF((((((''''''))))))GGGGGGGG ******&&&&&&++++++55555555000000//////&%%%%%% 3444 0111 QSQSQQQQi " "#"(3-""""YsxS 7J hsm)B)B)BX   DDDN $;   9992   GGG555 R R RRRR,,,AAA H H H in9:: u %u %u %u %u %=u %u %u %pFFFFF9FFFFFr*PK!]  __pycache__/glob.cpython-311.pycnu[ ,Re dZddlZddlZddlZgdZddZddZdZdZd Z d Z d Z ej d Z ej d ZdZdZdZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. N)globiglobescapeFc>tt||S)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamers /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/glob.pyrrs h)444 5 55cnt||}|r"t|rt|}|rJ|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenext)r ritss r rrsC ) $ $B\(++ HH Ir c#VKtj|\}}|rt|rtnt }t |sK|r$tj|r|Vn#tj|r|VdS|s|||Ed{VdS||kr t |rt||}n|g}t |st}|D]3}|||D]$}tj ||V%4dSN) ospathsplitrglob2glob1 has_magiclexistsisdirr glob0join)r rdirnamebasename glob_in_dirdirsnames r r r 0sg h//GX$Jh)?)?J%%UK X    wx(( w}}W%%  ;w111111111(y11gy))y X   ..K22 . .D',,w-- - - - - ...r c|sAt|tr tjd}n tj} tj|}n#t $rgcYSwxYwtj||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamess r rrTs  gu % % i&&w//GGiG 7##   >% ) ))sA A)(A)c|s#tj|r|gSn@tjtj||r|gSgSr)rrrrr)rrs r rrasd  7== ! ! :   7??27<<:: ; ; :  Ir c#pKt|sJ|ddVt|D]}|VdS)Nr)r _rlistdir)rr.xs r rrqsZ     "1"+ w  r c#K|sAt|tr tjd}n tj} tj|}n#tj$rYdSwxYw|D]^}|V|r tj||n|}t|D]$}tj||V%_dSr$) r&r'rr(r)r*errorrrr2)rr/r3rys r r2r2ys  gu % % i&&w//GGiG 7## 8 %%+29rw||GQ'''4 % %A',,q!$$ $ $ $ $ %%%sAA/.A/z([*?[])s([*?[])ct|trt|}nt|}|duSr)r&r'magic_check_bytessearch magic_check)rmatchs r rrsG!U&!((++""1%%  r cDt|tr|dkS|dkS)Ns**z**)r&r')r.s r rrs)'5!!%$r ctj|\}}t|trt d|}ntd|}||zS)z#Escape all special characters. s[\1]z[\1])rr splitdriver&r'r8subr:)r drives r rrsd g((22OE8(E""6$((8<<??7H55 8 r )F)__doc__rrer,__all__rrr rrrr2compiler:r8rrrr r rFs  % % % 6 6 6 6$...H * * *    %%%"bj## BJz**     r PK![,,%__pycache__/installer.cpython-311.pycnu[ ,ReddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl Z ddl m Z ddl mZdZdZd ZdS) N)log)DistutilsError)Wheel)SetuptoolsDeprecationWarningct|tr|St|ttfsJ|S)z8Ensure find-links option end-up being a list of strings.) isinstancestrsplittuplelist) find_linkss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/installer.py_fixup_find_linksrsF*c"""!!! j5$- 0 0000 c  tjdt tjdn5#tj$r#|dtjYnwxYwt|}| d}d|vrtddtj vo dtj v}d tj vrd }nd |vr|d d }nd }d |vr#t|d d d d ng}|jr||jtj|}tj}tj|D]}||vr||r|cS t/j5} t2jdddddd| g} |r| d|| d|f|pgD]} | d| f| |jpt;| t=j| n4#t<j $r"} tt;| | d } ~ wwxYwtCtEj"tj#| dd} tj#|| $}| %|tj&|tj#|d}tj'(||}|cd d d S#1swxYwYd S)zLFetch an egg needed for building. Use pip/wheel to fetch/build a wheel.z\setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.wheelz,WARNING: The wheel package is not available. easy_install allow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements. PIP_QUIET PIP_VERBOSE PIP_INDEX_URLN index_urlrrz-mpipz--disable-pip-version-checkz --no-depsz-wz--quietz --index-urlz --find-linksz*.whlrzEGG-INFO)metadata))warningswarnr pkg_resourcesget_distributionDistributionNotFoundannouncerWARN strip_markerget_option_dictrosenvironrdependency_linksextendpathrealpathget_egg_cache_dir Environmentfind_distributionscan_addtempfileTemporaryDirectorysys executableappendurlr subprocess check_callCalledProcessErrorrglobjoinegg_nameinstall_as_egg PathMetadata Distribution from_filename)distreqoptsquietrreggs_dir environmentegg_disttmpdircmdlinker dist_location dist_metadatas rfetch_build_eggrLs M /$ P&w////  -PPP DchOOOOOP s  C    / /DGHH H rz ) Mm2:.ME"*$$   %a(  7Ct7K7K$|,Q/0033  1$/000w 6 6 8 899H+--K!4X>> s??{228<>qABB Xu~~/?/?@@  ]+++%2 27<< zBBDD )77 M8339sG1/A#"A#4B M8IM8J%JJC$M88M<?M<cltjt|}d|_|S)z Return a new requirement without the environment marker to avoid calling pip with something like `babel; extra == "i18n"`, which would always be ignored. N)r Requirementparser marker)r@s rr#r#_s,  # ) )#c(( 3 3CCJ Jr)r8r%r5r1r/r distutilsrdistutils.errorsrrsetuptools.wheelr_deprecation_warningrrrLr#rrrVs  ++++++"""""">>>>>>EEEP     rPK!2\<!__pycache__/_reqs.cpython-311.pycnu[ ,Re6ddlmcmcmZddlmZdZdZdS)N) Requirementc~tjttjtj|S)z Yield requirement strings for each specification in `strs`. `strs` must be a string, or a (possibly-nested) iterable thereof. )textjoin_continuationmap drop_comment yield_linesstrss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_reqs.py parse_stringsr s-  !#d&79I$9O9O"P"P Q QQcFttt|S)zN Deprecated drop-in replacement for pkg_resources.parse_requirements. )rrr r s r parsers {M$// 0 00r)setuptools.extern.jaraco.textexternjaracor pkg_resourcesrr rrr rsf,,,,,,,,,,,,%%%%%%RRR11111rPK!&__pycache__/_importlib.cpython-311.pycnu[ ,ReddlZdZejdkrddlmZeenddlmZejdkrddlmZdSddl mZdS)Nc ddln6#t$rYdSt$rddl}d}||wxYw|urdSfdt jD}|D]!}t j|"dS)zu Ensure importlib_metadata doesn't provide older, incompatible Distributions. Workaround for #3102. rNz`importlib-metadata` version is incompatible with `setuptools`. This problem is likely to be solved by installing an updated version of `importlib-metadata`.c>g|]}t|j|S) isinstanceMetadataPathFinder).0obimportlib_metadatas /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_importlib.py z5disable_importlib_metadata_finder..s=  b,? @ @ )r ImportErrorAttributeErrorwarningswarnsys meta_pathremove)metadatarmsg to_removeitemr s @r !disable_importlib_metadata_finderrs !!!!!      $  c  X%%-I ## T""""##s  ;&;) )r )r )importlib_resources) rr version_infosetuptools.externr rimportlib.metadatar resourcesimportlib.resourcesrr r r#s ###Bg@@@@@@%%h////))))))fBBBBBBBB++++++++r PK!_xyy%__pycache__/discovery.cpython-311.pycnu[ ,Re?Q dZddlZddlZddlmZddlmZddlmZddlm Z m Z m Z m Z m Z mZmZmZmZmZddlZddlmZddlmZeeejfZe egefZe eZejj Z!e rdd l"m#Z#d ed efd Z$Gd dZ%Gdde%Z&Gdde&Z'Gdde%Z(Gdde'Z)Gdde(Z*deded eefdZ+GddZ,deed eefdZ-deed eefd Z.deed!eeefd"ed eefd#Z/d$ed!eeefd"ed efd%Z0deed&ed e eeffd'Z1dS)(u_Automatic discovery of Python modules and packages (for inclusion in the distribution) and other config values. For the purposes of this module, the following nomenclature is used: - "src-layout": a directory representing a Python project that contains a "src" folder. Everything under the "src" folder is meant to be included in the distribution when packaging the project. Example:: . ├── tox.ini ├── pyproject.toml └── src/ └── mypkg/ ├── __init__.py ├── mymodule.py └── my_data_file.txt - "flat-layout": a Python project that does not use "src-layout" but instead have a directory under the project root for each package:: . ├── tox.ini ├── pyproject.toml └── mypkg/ ├── __init__.py ├── mymodule.py └── my_data_file.txt - "single-module": a project that contains a single Python script direct under the project root (no directory used):: . ├── tox.ini ├── pyproject.toml └── mymodule.py N fnmatchcase)glob)Path) TYPE_CHECKINGCallableDictIterableIteratorListMappingOptionalTupleUnion)log) convert_path) Distributionpathreturncdtj|SN)osrbasename isidentifier)rs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/discovery.py _valid_namerIs$ 7  D ! ! . . 0 00c eZdZUdZdZeedfed<dZeedfed<e dde d e ed e ed e efd Z e de d ed ed efd Zeded efdZdS)_Finderz@Base class that exposes functionality for module/package finders.ALWAYS_EXCLUDEDEFAULT_EXCLUDE.*whereexcludeincluderc |p|j}t|tt ||jg|j|R|j|S)aFReturn a list of all Python items (packages or modules, depending on the finder implementation) found within directory 'where'. 'where' is the root directory which will be searched. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of names to exclude; '*' can be used as a wildcard in the names. When finding packages, 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of names to include. If it's specified, only the named items will be included. If it's not specified, all found items will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. )r"list _find_iterrstr _build_filterr!clsr&r'r(s rfindz _Finder.findTsp40S0 NNSZZ((!!@3#5@@@@!!7+     rctr)NotImplementedErrorr.s rr+z_Finder._find_iterws!!rpatternscfdS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. c<tfdDS)Nc38K|]}t|VdSrr).0patnames r z:_Finder._build_filter....s-KK3 D# 6 6KKKKKKr)any)r9r3s`rz'_Finder._build_filter..s%CKKKK(KKKKKrr )r3s`rr-z_Finder._build_filter{s LKKKKrN)r#r r$)__name__ __module__ __qualname____doc__r!rr,__annotations__r" classmethod_Pathr r r0_FilterStrIterr+ staticmethodr-r rrrrNsJJ&(NE#s(O(((')OU38_)))!#!'     #  #  c    [  D"u"w""W"""["LLLLL\LLLrrc beZdZdZdZededededefdZ e ded e de fd Z d S) PackageFinderzI Generate a list of all Python packages found within a directory )ez_setupz *__pycache__r&r'r(rc#Ktjt|dD]\}}}|dd}g|dd<|D]}tj||} tj| |} | tjjd} d|vs|| | s|| r|| s| V| |dS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T) followlinksNr#) rwalkr,rjoinrelpathreplacesep_looks_like_packageappend) r/r&r'r(rootdirsfilesall_dirsdir full_pathrel_pathpackages rr+zPackageFinder._find_iters "$U!F!F!F ! ! D$AAAwHDG ! !GLLs33 7??9e<<"**27;<<#::S%<%r?r@r!rBrCrDrEr+rFr,boolrQr rrrHrHs2N!u!w!!W!!![!6A%AAAAA\AAArrHc2eZdZedededefdZdS)PEP420PackageFinder_pathr[rcdS)NTr )rbr[s rrQz'PEP420PackageFinder._looks_like_packagestrN)r=r>r?rFrCr,r_rQr rrrarasG5\rrac PeZdZdZededededefdZe e Z dS) ModuleFinderzYFind isolated Python modules. This function will **not** recurse subdirectories. r&r'r(rc#HKttj|dD]q}tjtj|\}}||sW||r||s|VrdS)Nz*.py)rrrrMsplitextr_looks_like_module)r/r&r'r(filemodule_exts rr+zModuleFinder._find_iterseV4455  D7++BG,<,r?r@rBrCrDrEr+rFrrhr rrrereshuwW[&k22rrecteZdZdZeedeDZ edede de fdZ dS)FlatLayoutPackageFinder) cibindocdocs documentationmanpagesnews changelogtesttests unit_test unit_testsexampleexamplesscriptstoolsutilutilspythonbuilddistvenvenv requirementstasksfabfile site_scons benchmark benchmarksexercise exercises[._]*c#$K|] }||dfV dS)z.*Nr )r7ps rr:z!FlatLayoutPackageFinder.s,&G&Ga888}&G&G&G&G&G&Grrb package_namerc|d}|dp|dd}|o td|ddDS)Nr#r-stubsc3>K|]}|VdSr)r)r7r9s rr:z>FlatLayoutPackageFinder._looks_like_package..s.(S(S):):)<)<(S(S(S(S(S(Sr)splitrendswithall)rbrnamesroot_pkg_is_valids rrQz+FlatLayoutPackageFinder._looks_like_packagesl""3''!!H1133RuQx7H7H7R7R SS(S(Sqrr(S(S(S%S%SSrN) r=r>r?_EXCLUDEtuple chain_iterr"rFrCr,r_rQr rrrmrms$HLeJJ&G&Gh&G&G&GGGHHO T5TTTTT\TTTrrmceZdZdZdS)FlatLayoutModuleFinder)setupconftestrvrwrzr{rtoxfilenoxfilepavementdodorrz[Ss][Cc]onstruct conanfilemanagerrrrrN)r=r>r?r"r rrrrsO4*)rrroot_pkgpkg_dirc\t|}gfd|DzS)Nc>g|]}d|fS)r#)rM)r7nrs r z)_find_packages_within..s)AAAQ8Q-00AAAr)rar0)rrnesteds` r_find_packages_withinrs8 % %g . .F :AAAA&AAA AArc$eZdZdZddZdZdZedefdZ ede e e ffd Z dd Z d edefdZd edefdZdefdZdefdZdefdZdefdZdefdZdee de fdZdZdee fdZdee fdZdS)ConfigDiscoveryzFill-in metadata and options that can be automatically derived (from other metadata/options, the file system or conventions) distributionrc>||_d|_d|_d|_dS)NF)r_called _disabled_skip_ext_modules)selfrs r__init__zConfigDiscovery.__init__$s%   !&rcd|_dS)z+Internal API to disable automatic discoveryTN)rrs r_disablezConfigDiscovery._disable*s rcd|_dS)aInternal API to disregard ext_modules. Normally auto-discovery would not be triggered if ``ext_modules`` are set (this is done for backward compatibility with existing packages relying on ``setup.py`` or ``setup.cfg``). However, ``setuptools`` can call this function to ignore given ``ext_modules`` and proceed with the auto-discovery if ``packages`` and ``py_modules`` are not given (e.g. when using pyproject.toml metadata). TN)rrs r_ignore_ext_modulesz#ConfigDiscovery._ignore_ext_modules.s"&rrc2|jjp tjSr)rsrc_rootrcurdirrs r _root_dirzConfigDiscovery._root_dir:sy!.RY.rc6|jjiS|jjSr)r package_dirrs r _package_dirzConfigDiscovery._package_dir?s 9 (Iy$$rFTc|dur|js|jrdS|||r|d|_dS)aAutomatically discover missing configuration fields and modifies the given ``distribution`` object in-place. Note that by default this will only have an effect the first time the ``ConfigDiscovery`` object is called. To repeatedly invoke automatic discovery (e.g. when the project directory changes), please use ``force=True`` (or create a new ``ConfigDiscovery`` instance). FNT)rr_analyse_package_layout analyse_name)rforcer9ignore_ext_moduless r__call__zConfigDiscovery.__call__EsX E>>t|>t~> F $$%7888        rrc|p|j}|jjdup| }|jjdup0|jjdup"|p t |jdo |jjS)zF``True`` if the user has specified some form of package/module listingN configuration)rr ext_modulespackages py_moduleshasattrr)rrrs r_explicitly_specifiedz%ConfigDiscovery._explicitly_specifiedZsw/I43I90D8N.sU  Z "#rw||Hj'I'I J J      rdiscovered packages -- T) rcopypoprrrritemsr*rr)rrpkgsrs @rrz(ConfigDiscovery._analyse_explicit_layoutxs',,.. D!!!> 5 J[JJKKK    #.#4#4#6#6     "$ZZ  @DI,>@@AAAtrc|j}tj|j|dd}tj|sdStjd|| dtj |||j _ t||j _t ||j _tjd|j jtjd|j jdS)aTry to find all packages or modules under the ``src`` directory (or anything pointed by ``package_dir[""]``). The "src-layout" is relatively safe for automatic discovery. We assume that everything within is meant to be included in the distribution. If ``package_dir[""]`` is not given, but the ``src`` directory exists, this function will set ``package_dir[""] = "src"``. rsrcFz#`src-layout` detected -- analysing rdiscovered py_modules -- T)rrrrMrgetisdirrr setdefaultrrrrar0rrer)rrsrc_dirs rrz#ConfigDiscovery._analyse_src_layouts' ',,t~{r5/I/IJJw}}W%% 5 AAABBBr27#3#3G#<#<=== + 055g>> +0099  @DI,>@@AAA Ddi.BDDEEEtrctjd|j|p|S)aTry to find all packages and modules under the project root. Since the ``flat-layout`` is more dangerous in terms of accidentally including extra files/directories, this function is more conservative and will raise an error if multiple packages or modules are found. This assumes that multi-package dists are uncommon and refuse to support that use case in order to be able to prevent unintended errors. z$`flat-layout` detected -- analysing )rrr_analyse_flat_packages_analyse_flat_modulesrs rrz$ConfigDiscovery._analyse_flat_layoutsB IIIJJJ**,,L0J0J0L0LLrc,t|j|j_t t |jj}tjd|jj| |dt|S)Nrr) rmr0rrrremove_nested_packages remove_stubsrr_ensure_no_accidental_inclusionr_)r top_levels rrz&ConfigDiscovery._analyse_flat_packagessv499$.II *< 8J+K+KLL  @DI,>@@AAA ,,Y CCCIrct|j|j_t jd|jj||jjdt|jjS)Nrmodules) rr0rrrrrrr_rs rrz%ConfigDiscovery._analyse_flat_modulessh5::4>JJ  Ddi.BDDEEE ,,TY-A9MMMDI()))rdetectedkindct|dkr,ddlm}ddlm}d|d|d|d}|||dS) Nrr)cleandoc)PackageDiscoveryErrorzMultiple top-level z discovered in a flat-layout: z. To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build. If you are trying to create a single distribution with multiple a on purpose, you should not rely on automatic discovery. Instead, consider the following options: 1. set up custom discovery (`find` directive with `include` or `exclude`) 2. use a `src-layout` 3. explicitly set `py_modules` or `packages` with a list of names To find more information, look for "package discovery" on setuptools docs. )leninspectrsetuptools.errorsr)rrrrrmsgs rrz/ConfigDiscovery._ensure_no_accidental_inclusions x==1   ( ( ( ( ( ( ? ? ? ? ? ?$h NR C(' 66 6)  rc|jjjs |jjrdStjd|p|}|r||jj_dSdS)zThe packages/modules are the essential contribution of the author. Therefore the name of the distribution can be derived from them. Nz7No `name` configuration, performing automatic discovery)rmetadatar9rr#_find_name_single_package_or_module_find_name_from_packages)rr9s rrzConfigDiscovery.analyse_names 9  " din 4 KLLL  4 4 6 6 /,,..   +&*DI  # # # + +rcdD]V}t|j|dpg}|r:t|dkr'tjd|d|dcSWdS)zExactly one module or package)rrNrz&Single module/package detected, name: r)getattrrrrr)rfieldrs rrz3ConfigDiscovery._find_name_single_package_or_moduleso/  EDIud339rE Uq M58MMNNNQxtrc"|jjsdStt|jjt}|jjpi}t |||j}|rtj d||Stj ddS)zr?r@rrrpropertyrCrr r,rrr_rrrrrrrr rrrrrr rrrrs''''  & & &/5///X/%d38n%%%X% *          $ 4    $$$T2 Md M M M M*t**** 7S 77777.+++"Xc](3-rrrct|t}|dd}t|}tt|D];\}t fd|Dr|||z dz <|S)zRemove nested packages from a list of packages. >>> remove_nested_packages(["a", "a.b1", "a.b2", "a.b1.c1"]) ['a'] >>> remove_nested_packages(["a", "b", "c.d", "c.d.e.f", "g.h", "a.a1"]) ['a', 'b', 'c.d', 'g.h'] rNc3HK|]}|dVdSr#N startswith)r7otherr9s rr:z)remove_nested_packages.. s5CCt%{{{++CCCCCCrr)rr enumeratereversedr;r)rrrsizeir9s @rrrs ( $ $ $DQQQI t99DXd^^,,((4 CCCCCCC C C ( MM$(Q, ' ' ' rcd|DS)zRemove type stubs (:pep:`561`) from a list of packages. >>> remove_stubs(["a", "a.b", "a-stubs", "a-stubs.b.c", "b", "c-stubs"]) ['a', 'a.b', 'b'] cng|]2}|ddd0|3S)r#rr)rr)r7rs rrz remove_stubs..s: P P PC399S>>!+<+E+Eh+O+O PC P P Prr )rs rrrs Q P8 P P PPrrrct|t}g}t|D]B\}tfd||dzdDsn|C|D]Vt ||}t j|d}t j |rcSWdS)z0Find the parent package that is not a namespace.rc3HK|]}|dVdSr r )r7rr9s rr:z&find_parent_package.."s5DD1<<4 ++DDDDDDrrNr]) rrrrrRfind_package_pathrrrMr^)rrrcommon_ancestorsrpkg_pathinitr9s @rrrshC(((HX&&&&4DDDDXacdd^DDDDD  E%%%% $T;AAw||Hm44 7>>$   KKK  4rr9c|d}tt|ddD]M}d|d|}||vr*||}t jj||g||dRcSN|dpd}t jj|g|d|RS)aGiven a package name, return the path where it should be found on disk, considering the ``package_dir`` option. >>> path = find_package_path("my.pkg", {"": "root/is/nested"}, ".") >>> path.replace(os.sep, "/") './root/is/nested/my/pkg' >>> path = find_package_path("my.pkg", {"my": "root/is/nested"}, ".") >>> path.replace(os.sep, "/") './root/is/nested/pkg' >>> path = find_package_path("my.pkg", {"my.pkg": "root/is/nested"}, ".") >>> path.replace(os.sep, "/") './root/is/nested' >>> path = find_package_path("other.pkg", {"my.pkg": "root/is/nested"}, ".") >>> path.replace(os.sep, "/") './other/pkg' r#rNr/)rrangerrMrrr)r9rrpartsr partial_nameparents rrr3s, JJsOOE 3u::q" % %>>xxbqb ** ; & & .F7<&=59=== = = = '__R &BF 7< =6<<#4#4 =u = = ==r package_pathcft|}t|jfd|DS)Nc ji|]/}|dg|d0S)rr#)rMr)r7rprefixs r z)construct_package_dir..Xs< M M M#C4F4SYYs^^455 M M Mr)rrr )rr# parent_pkgsr&s @rconstruct_package_dirr)Us:(22K ,   %F M M M M M M MMr)2r@ itertoolsrfnmatchrrpathlibrtypingrrr r r r r rrr_distutils_hack.override_distutils_hack distutilsrdistutils.utilrr,PathLikerCr_rDrEchain from_iterabler setuptoolsrrrrHrarermrrrrrrrr)r rrr6s%%N                          '''''' c2; C5$;  3- _ * (''''''1e11111 3L3L3L3L3L3L3L3Ll&A&A&A&A&AG&A&A&AR- 333337333./T/T/T/T/T1/T/T/Td*****\***<BCB%BDIBBBB ^^^^^^^^BT#Y49$Q49QcQQQQ3i&-c3h&7CH c]0> >#CH->9>>>>>>DNDINUNtCQTH~NNNNNNrPK!/ee#__pycache__/depends.cpython-311.pycnu[ ,Re{ddlZddlZddlZddlZddlmZddlmZmZm Z m Z ddl mZgdZ GddZ d Zdd Zdd Zd ZedS)N)version) find_module PY_COMPILED PY_FROZEN PY_SOURCE)_imp)Requirerget_module_constantextract_constantcBeZdZdZ d dZdZdZd dZd d Zd d Z dS)r z7A prerequisite to building or installing a distributionNc|| tj}|||}|d}|jt |`dS)N __version__)rVersion__dict__updatelocalsself)rnamerequested_versionmodulehomepage attributeformats /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/depends.py__init__zRequire.__init__s[ >/;_F   &'8 9 9  )  VXX&&& IIIc@|j|jd|jS|jS)z0Return full package/distribution name, w/versionN-)rr)rs r full_namezRequire.full_name#s*  ! -"iii)?)?@ @yrc|jdup9|jdup0t|dko|||jkS)z%Is 'version' sufficiently up-to-date?Nunknown)rrstrr)rrs r version_okzRequire.version_ok)sN~%Y)<Y LLI % X$++g*>*>$BX*X Yrr#c|jC t|j|\}}}|r||S#t$rYdSwxYwt |j|j||}| ||ur|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)rrrclose ImportErrorr r)rpathsdefaultfpivs r get_versionzRequire.get_version.s > ! %dk5991aGGIII   tt   T^We L L =Qg--$+2I;;q>> !s0: AAc0||duS)z/Return true if dependency is present on 'paths'N)r/)rr)s r is_presentzRequire.is_presentIs&&d22rcx||}|dS|t|S)z>Return true if dependency is present and up-to-date on 'paths'NF)r/r%r$)rr)rs r is_currentzRequire.is_currentMs7""5)) ?5s7||,,,r)rNN)Nr#N) __name__ __module__ __qualname____doc__rr!r%r/r1r3rrr r sAA=?#'     YYY 63333------rr cltjd}|s |Stj|S)Nc3KdVdSr4r9r9rremptyzmaybe_close..emptyVs r) contextlibcontextmanagerclosing)r+r<s r maybe_closer@UsE uww  a  rc< t||x\}}\}}}} n#t$rYdSwxYwt|5|tkr*|dt j|} n|tkrtj ||} nb|tkr$t||d} n3tj ||| } t| |dcdddSdddn #1swxYwYt| ||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)rr(r@rreadmarshalloadrr get_frozen_objectrcompile get_modulegetattrr ) rsymbolr*r)r+pathsuffixmodekindinfocodeimporteds rr r `s~/:65/I/II%4%&$ tt Q 3 3 ;   FF1III<??DD Y  )&%88DD Y  16688T622DDvud;;H8VT22 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 22s ++B,DD Dc||jvrdSt|j|}d}d}d}|}tj|D]<}|j} |j} | |kr|j| }$| |kr| |ks| |kr|cS|}=dS)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_nameslistindexdisBytecodeopcodearg co_consts) rRrLr*name_idx STORE_NAME STORE_GLOBAL LOAD_CONSTconst byte_codeopr^s rr r }sT]""tDM""((00HJLJ E\$''    m   N3'EE H__" "2"2bL6H6HLLLEE  rctjdstjdkrdSd}|D]+}t|=t|,dS)z Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. javacliN)r r )sysplatform startswithglobals__all__remove) incompatiblers r_update_globalsrqsk < " "6 * *s|u/D/Drss  //////@@@@@@@@@@@@    A-A-A-A-A-A-A-A-H!!!3333:!!!!H   rPK!Y __pycache__/msvc.cpython-311.pycnu[ ,ReldZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlmZdd lmZejd kr ddlZdd lmZnGd d ZeZdZdZdddddZdZ dZ!dZ"dZ#d#dZ$GddZ%GddZ&Gdd Z'Gd!d"Z(dS)$a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname) LegacyVersion)unique_everseen) get_unpatchedWindows)environceZdZdZdZdZdZdS)winregN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOT/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/msvc.pyrr#s'  ! rrc, tjtjddtjtjz}n#t $rYdSwxYwd}d}|5t jD]} tj||\}}}n#t $rYnkwxYw|rd|tj krTt|rE tt|}n#ttf$rYwxYw|dkr ||kr||}}dddn #1swxYwY||fS)0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7rNNN)rOpenKeyrKEY_READKEY_WOW64_32KEYOSError itertoolscount EnumValueREG_SZrintfloat ValueError TypeError)key best_versionbest_dirivvc_dirvtversions r_msvc14_find_vc2015r4,sn  % 6 Of4 4    zzLH = ="" = =A  & 0a 8 8 622     =R6=((U6]](!%((mmGG"I.Hb==W|%;%;-4f(L = = = = = = = = = = = = = = =  !!si8; A A D)BD B DB$D6CDC'$D&C''DD D ctjdptjd}|sdS tjt |dddddd d d d d d dddg dd}n##tjttf$rYdSwxYwt |ddd}t|rd|fSdS)aPython 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. ProgramFiles(x86) ProgramFilesrzMicrosoft Visual Studio Installerz vswhere.exez-latestz -prereleasez -requiresAnyz -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuild) rget subprocess check_outputrdecodestripCalledProcessErrorr#UnicodeDecodeErrorr)rootpaths r_msvc14_find_vc2017rLJs ;* + + Jw{>/J/JD z & 0+} M M    L D +  (    66(6 3 3EEGG   )74F Gzz dK 1 1D T{{4x :sABB&%B&x86x64armarm64)rM x86_amd64x86_arm x86_arm64c t\}}d}|tvrt|}nd|vrdnd}|rYt|ddddd|d d } d dl}||d d}n#tt t f$rd}YnwxYw|s&t\}}|rt|d|dd }|sdSt|d}t|sdS|rt|sd}||fS)rNamd64rNrMz..redistMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT) recursivezMicrosoft.VC140.CRTrz vcvarsall.bat) rLPLAT_SPEC_TO_RUNTIMErglob ImportErrorr# LookupErrorr4r) plat_spec_r. vcruntimevcruntime_platvcredistr[r- vcvarsalls r_msvc14_find_vcvarsallrdws]%''KAxI(((-i8")Y"6"6E$h&(=*,,  KKK (d ;;B?IIWk2   III  H!4!6!6 h  HXx24FHHI zX//I )  z F9-- i s !A//B  B cJdtvrdtjDSt|\}}|stjd t jd||t j  dd}nO#t j $r=}tjd |j |d }~wwxYwd d | DD}|r||d <|S)rDISTUTILS_USE_SDKc>i|]\}}||Srlower).0r,values r z&_msvc14_get_vc_env..s6   U IIKK   rzUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r>zError executing {}NcHi|]\}}}|| || Srrh)rjr,r_rks rrlz&_msvc14_get_vc_env..sH    CE      U   rc3@K|]}|dVdS)=N) partition)rjlines r z%_msvc14_get_vc_env..s.::  ::::::rpy_vcruntime_redist)ritemsrd distutilsr>DistutilsPlatformErrorrDrEformatSTDOUTrFrHcmd splitlines)r^rcr`outexcenvs r_msvc14_get_vc_envrsbg%%  %moo    2)<<Iy  55 *   % & - -i C C$    &I& . .   (55 ' ' 0 0       ;:)9)9:::   C/%. !" JsA B%%C148C,,C1c| t|S#tjj$r}t |dd}~wwxYw)a* Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment ,@N)rrwr>rx_augment_exception)r^r~s rmsvc14_get_vc_envrsM&!),,,   23%%% s;6;cdtjvr@ddl}t|jtdkr|jjj|i|Stt|i|S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesnumpyr __version__rw ccompilergen_lib_optionsr msvc14_gen_lib_options)argskwargsnps rrrsu CK''  ( (=+B+B B B92<)94J6JJ J 0=/ 0 0$ A& A AArcz|jd}d|vsd|vryd}|jdit}d}|dkr7|ddkr|d z }n%|d z }n|d kr|d z }||d zz }n |dkr|dz }|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rrczvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d"@ia64rYz( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW rzd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/Nr)rrirylocalsfind)r~r3archmessagetmpl msdownloads rrrs hqkGgmmoo%%w}})F)FL$+))))D c>>zz||  ((2--EE BB __ C CG zD( (GG __ 4 5G{CHHHrceZdZdZejddZdZe dZ dZ dZ d d Z d d Zdd Zd S) PlatformInfoz Current and Target Architectures information. Parameters ---------- arch: str Target architecture. processor_architecturerc`|dd|_dS)NrNrU)rirnr)selfrs r__init__zPlatformInfo.__init__s%JJLL((88 rcV|j|jddzdS)zs Return Target CPU architecture. Return ------ str Target CPU r_r N)rrrs r target_cpuzPlatformInfo.target_cpus*y,,q01122rc|jdkS)z Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits rMrrs r target_is_x86zPlatformInfo.target_is_x86(s%''rc|jdkS)z Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits rM current_cpurs rcurrent_is_x86zPlatformInfo.current_is_x863s5((rFcR|jdkr|rdn|jdkr|rdn d|jzS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ str subfolder: ' arget', or '' (see hidex86 parameter) rMrrU\x64\%srrhidex86rNs r current_dirzPlatformInfo.current_dir>sB"#u,,,BB(G333GG T% % rcR|jdkr|rdn|jdkr|rdn d|jzS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) rMrrUrrrrs r target_dirzPlatformInfo.target_dirTs?"?e+++BB722s2GG T_ $ rc|rdn|j}|j|krdn*|dd|zS)ap Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. rMr\z\%s_)rrrrn)rforcex86currents r cross_dirzPlatformInfo.cross_dirjsM $9%%)9/W,,BB OO   % %dGg,= > > rN)FFF)rrr__doc__rrCrirrpropertyrrrrrrrrrrrs'+6;;AACCK999 3 3X 3 ( ( ( ) ) )    ,    ,      rrc eZdZdZejejejejfZ dZ e dZ e dZ e dZe dZe dZe dZe d Ze d Ze d Zdd ZdZdS) RegistryInfoz Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. c||_dSN)pi)r platform_infos rrzRegistryInfo.__init__s rcdS)z Microsoft Visual Studio root registry key. Return ------ str Registry key VisualStudiorrs r visualstudiozRegistryInfo.visualstudios ~rc,t|jdS)z Microsoft Visual Studio SxS registry key. Return ------ str Registry key SxS)rrrs rsxszRegistryInfo.sxssD%u---rc,t|jdS)z| Microsoft Visual C++ VC7 registry key. Return ------ str Registry key VC7rrrs rvczRegistryInfo.vcDHe$$$rc,t|jdS)z Microsoft Visual Studio VS7 registry key. Return ------ str Registry key VS7rrs rvszRegistryInfo.vsrrcdS)z Microsoft Visual C++ for Python registry key. Return ------ str Registry key zDevDiv\VCForPythonrrs r vc_for_pythonzRegistryInfo.vc_for_pythons %$rcdS)zq Microsoft SDK registry key. Return ------ str Registry key zMicrosoft SDKsrrs r microsoft_sdkzRegistryInfo.microsoft_sdks  rc,t|jdS)z Microsoft Windows/Platform SDK registry key. Return ------ str Registry key rrrrs r windows_sdkzRegistryInfo.windows_sdksD& 222rc,t|jdS)z Microsoft .NET Framework SDK registry key. Return ------ str Registry key NETFXSDKrrs r netfx_sdkzRegistryInfo.netfx_sdksD& 333rcdS)z Microsoft Windows Kits Roots registry key. Return ------ str Registry key zWindows Kits\Installed Rootsrrs rwindows_kits_rootszRegistryInfo.windows_kits_rootss /.rFcd|js|rdnd}td|d|S)a Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key r Wow6432NodeSoftware Microsoft)rrr)rr,rMnode64s r microsoftzRegistryInfo.microsofts9 w--//I3IMJ S999rc :tj}tj}tj}|j}|jD]}d} ||||d|}nd#t tf$rP|j s2 ||||dd|}n#t tf$rYYuwxYwY{YnwxYw tj ||d|r||cScS#t tf$rYnwxYw |r ||#|r ||wwxYwdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value NrT) rr!r CloseKeyrHKEYSr#IOErrorrr QueryValueEx) rr,namekey_readopenkeyclosekeymshkeybkeys rlookupzRegistryInfo.lookups ?.? ^J # #DD wtRRWWa::W%   w--//!&wtRRT]]AxHH#W-!!! !H   #*466q9#HTNNNNNN###W%    #HTNNN#HTNNNN## # #sYA*B1;BB1B)%B1(B))B10B15C""C63D5C66DDNr)rrrrrrrrrrrrrrrrrrrrrrrrrrrrsd   %  &  % 'E      X  . .X . % %X % % %X % % %X %   X   3 3X 3 4 4X 4 / /X /::::&&#&#&#&#&#rrceZdZdZejddZejddZejdeZddZ dZ d Z d Z e d Zed Zed ZdZdZedZedZedZedZedZedZedZedZedZedZedZedZedZ dZ!e d dZ"dS)! SystemInfoz Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirrr7r6Nc||_|jj|_||_|p|x|_|_dSr)rirfind_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)r registry_infors rrzSystemInfo.__init__LsO'*";;==  :d88:: < dkkkrc|}|s&|jstjdt |}||jt|dS)zm Find the latest VC version Return ------ float version z%No Microsoft Visual C++ version foundrY)find_reg_vs_versrrwr>rxsetupdatesorted)r reg_vc_versvc_verss rrz(SystemInfo._find_latest_available_vs_verVsz++--  9t2 9"99799 9k""t*+++gr""rc |jj}|jj|jj|jjf}g}t j|jj|D]~\}} tj |||dtj }n#ttf$rYEwxYw|5tj |\}}} t|D]t} tjt"5t%tj|| d} | |vr|| dddn #1swxYwYut|D]n} tjt"5t%tj|| } | |vr|| dddn #1swxYwYo dddn #1swxYwYt-|S)z Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions rN)rrrrrr$productrrr r!r#r QueryInfoKeyrange contextlibsuppressr*r)r&appendEnumKeyr) rrvckeysvs_versrr,rsubkeysvaluesr_r/vers rrzSystemInfo.find_reg_vs_versisW '*dg3TWZ@"*47=&AA 0 0ID# ~dBBsGGQHHW%     0 0%+%8%>%>"v00A#,Z8800#F$4T1$=$=a$@AAg--#NN3///000000000000000w00A#,Z8800#FN4$;$;<<g--#NN3///0000000000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0gsn*BBBAGAD- ! G-D1 1G4D1 5.G#rx)rrKmsgs r VCInstallDirzSystemInfo.VCInstallDirsS~~:4#8#8#:#:T{{ ?> > rcN|jdkrdS |j|j}n#t$r |j}YnwxYwt |d} t |d}|||_t ||S#tttf$rYdSwxYw)zl Locate Visual C++ for VS2017+. Return ------ str path rrrrY) rrrr$rrrrr#r IndexError)rvs_dirguess_vcrs rr&zSystemInfo._guess_vcs ;$  2 '(5FF ' ' '&FFF ' 011 X&&r*F0088DK&)) )*-   22 s"66 >B B$#B$c<t|jd|jz}t|jjd|jz}|j|d}|rt|dn|}|j|jjd|jzp|S)z{ Locate Visual C++ for versions prior to 2017. Return ------ str path z Microsoft Visual Studio %0.1f\VCr! installdirr?)rr"rrrrr)rr#reg_path python_vc default_vcs rr'zSystemInfo._guess_vc_legacyst+:T[HJJ-w/DEEGNN8\:: .7DT)T***W w~~dgj'DK*?@@NJNrc|jdkrdS|jdkrdS|jdkrdS|jdkrdS|jd krd Sd S) z Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions r)z7.0z6.1z6.0ar)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar)z10.0r6Nrrs rWindowsSdkVersionzSystemInfo.WindowsSdkVersionsg ;#  '' [D  = [D  = [D  = [D  =! rcR|t|jdS)zt Microsoft Windows SDK last version. Return ------ str version lib)_use_last_dir_namer WindowsSdkDirrs rWindowsSdkLastVersionz SystemInfo.WindowsSdkLastVersion-s%&&tD,>'F'FGGGrcd}|jD]>}t|jjd|z}|j|d}|rn?|rt |sOt|jjd|jz}|j|d}|rt|d}|rt |sR|jD]J}|d|d}d |z}t|j |}t |r|}K|rt |s5|jD]-}d |z}t|j |}t |r|}.|st|j d }|S) zn Microsoft Windows SDK directory. Return ------ str path rzv%sinstallationfolderr!r/WinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%s PlatformSDK) r8rrrrrrrrfindr7r))rsdkdirr locrK install_baseintverds rr<zSystemInfo.WindowsSdkDir9s)  Ctw*ECK88CW^^C)=>>F   6U6]] 6-w/DEED7>>$ ==L 6lH55 U6]] -  _ciinn_-86A*D1188F U6]] -  4s:*D1188F <$+];;F rc|jdkrd}d}n-d}|jdkrdnd}|jd|}d ||d d fz}g}|jd kr)|jD]!}|t |jj||gz }"|jD]$}|t |jj d |z|gz }%|D]#}|j |d}|r|cS$dS)zy Microsoft Windows SDK executable directory. Return ------ str path r4#r(r5TF)rNrzWinSDK-NetFx%dTools%sr-rzv%sAr?N) rrrrnNetFxSdkVersionrrrr8rr) rnetfxverrrfxregpathsr rKexecpaths rWindowsSDKExecutablePathz#SystemInfo.WindowsSDKExecutablePathds3 ;$  HDDH"kT11dduG7&&4&AAD $$,,tS2I2I'J J ;$  + ? ?T$'"3S"==>>) F FC dg16C<DDE EHH  Dw~~d,@AAH    rct|jjd|jz}|j|dpdS)zl Microsoft Visual F# directory. Return ------ str path z%0.1f\Setup\F# productdirr)rrrrr)rrKs rFSharpInstallDirzSystemInfo.FSharpInstallDirs;DG(*;dk*IJJw~~dL117R7rc|jdkrdnd}|D]2}|j|jjd|z}|r|pdcS3dS)zt Microsoft Universal CRT SDK directory. Return ------ str path r)1081rz kitsroot%srN)rrrr)rversr rCs rUniversalCRTSdkDirzSystemInfo.UniversalCRTSdkDirsu ${d22|| $ $CW^^DG$>$03$688F $|### $ $ $rcR|t|jdS)z Microsoft Universal C Runtime SDK last version. Return ------ str version r:)r;rrYrs rUniversalCRTSdkLastVersionz%SystemInfo.UniversalCRTSdkLastVersions%&&tD,CU'K'KLLLrc |jdkrdndS)z Microsoft .NET Framework SDK versions. Return ------ tuple of str versions r) z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rr7rs rrLzSystemInfo.NetFxSdkVersions%;$&&**-/ 0rcd}|jD];}t|jj|}|j|d}|rn<|S)zu Microsoft .NET Framework SDK directory. Return ------ str path rkitsinstallationfolder)rLrrrr)rrCr rDs r NetFxSdkDirzSystemInfo.NetFxSdkDirs\'  Ctw(#..CW^^C)ABBF   rczt|jd}|j|jjdp|S)zw Microsoft .NET Framework 32bit directory. Return ------ str path zMicrosoft.NET\Frameworkframeworkdir32rrrrrrguess_fws rFrameworkDir32zSystemInfo.FrameworkDir32s8 %?@@w~~dgj*:;;GxGrczt|jd}|j|jjdp|S)zw Microsoft .NET Framework 64bit directory. Return ------ str path zMicrosoft.NET\Framework64frameworkdir64rbrcs rFrameworkDir64zSystemInfo.FrameworkDir64s8 %ABBw~~dgj*:;;GxGrc,|dS)z Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions _find_dot_net_versionsrs rFrameworkVersion32zSystemInfo.FrameworkVersion32**2...rc,|dS)z Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions @rkrs rFrameworkVersion64zSystemInfo.FrameworkVersion64rnrcd|j|jjd|z}t|d|z}|p||dpd}|jdkr|dfS|jdkr&|dd d krd n|d fS|jd krdS|jdkrdSdS)z Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions zframeworkver%dzFrameworkDir%dr0rr5zv4.0rNrv4z v4.0.30319v3.5r)rt v2.0.50727g @)zv3.0ru)rrrgetattrr;rri)rbitsreg_ver dot_net_dirr s rrlz!SystemInfo._find_dot_net_versionss'..-=-DEEd$4t$;<< H00cBBHb ;$  ;  [D #&99;;rr?d#:#:<<VK K [C  '' [C  '' rc|fdttD}t|dpdS)a) Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name c3K|]8}tt||4|V9dSr)rr startswith)rjdir_namerKprefixs rrtz0SystemInfo._use_last_dir_name..<sg  T$))**     ' '        rNr)reversedrnext)rKr~ matching_dirss`` rr;zSystemInfo._use_last_dir_name+sV"     $WT]]33   M4((.B.rrr)#rrrrrrCrr7r"rrrr staticmethodrrr$r)r&r'r8r=r<rQrTrYr[rLr_rerhrmrqrlr;rrrrr:s  W[2 & &F7;~r22L!gk"5|DDO<<<<###&>(((T77\7 LLXL X"<OOO(!!X!( H HX H((X(T   X  D 8 8X 8$$X$& M MX M 0 0X 0X" H HX H H HX H / /X / / /X /(((:///\///rrc>eZdZdZd!dZedZedZedZedZ ed Z ed Z ed Z ed Z ed ZedZedZdZedZedZedZedZedZedZedZedZedZedZedZedZedZd"dZd Z dS)#EnvironmentInfoaY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. Nrct||_t|j|_t |j||_|j|kr!d}tj |dS)Nz.No suitable Microsoft Visual C++ version found) rrrrrsirrwr>rx)rrr vc_min_vererrs rrzEnvironmentInfo.__init__]sft$$tw''TWf-- ; # #BC"99#>> > $ #rc|jjS)zk Microsoft Visual Studio. Return ------ float version )rrrs rrzEnvironmentInfo.vs_verfw~rc|jjS)zp Microsoft Visual C++ version. Return ------ float version )rrrs rrzEnvironmentInfo.vc_verrrrcddg}jdkr1jdd}|dgz }|dgz }|d|zgz }fd |DS) zu Microsoft Visual Studio Tools. Return ------ list of str paths z Common7\IDEz Common7\ToolsrTrrNz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scDg|]}tjj|Srrrr$rjrKrs r z+EnvironmentInfo.VSTools..(CCCTTW)400CCCr)rrr)rpaths arch_subdirs` rVSToolszEnvironmentInfo.VSTools~s !12 ;$  '--d-EEK JK KE 56 6E 7+EF FECCCCUCCCCrcjt|jjdt|jjdgS)z Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths IncludezATLMFC\Includerrr)rs r VCIncludeszEnvironmentInfo.VCIncludess3TW)955TW)+<==? ?rcjdkrjd}njd}d|zd|zg}jdkr |d|zgz }fd |DS) z Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths .@TrNrLib%sz ATLMFC\Lib%srz Lib\store%scDg|]}tjj|Srrrs rrz/EnvironmentInfo.VCLibraries..rr)rrr)rrrs` r VCLibrarieszEnvironmentInfo.VCLibrariess ;$  ',,,66KK',,T,::K;&+(EF ;$   n{23 3ECCCCUCCCCrcR|jdkrgSt|jjdgS)z Microsoft Visual C++ store references Libraries. Return ------ list of str paths rzLib\store\references)rrrr)rs r VCStoreRefszEnvironmentInfo.VCStoreRefss/ ;  ITW)+BCCDDrc|j}t|jdg}|jdkrdnd}|j|}|r|t|jd|zgz }|jdkr8d|jdz}|t|j|gz }n|jdkr|jrd nd }|t|j||jd zgz }|jj |jj kr5|t|j||jd zgz }n|t|jd gz }|S) zr Microsoft Visual C++ Tools. Return ------ list of str paths VCPackagesrTFBin%srrrz bin\HostX86%sz bin\HostX64%srBin) rrr)rrrrrrrr)rrtoolsrrrKhost_dirs rVCToolszEnvironmentInfo.VCToolssWbo|445;$..44Eg''11  D d2?Gk,ABBC CE ;$  TW000>>>D d2?D112 2EE [D ,0G,B,B,D,D)(((  dDG,>,>4,>,H,H!HJJK KEw"dg&888$OX0C0C0C0M0M%MOOPP d2?E223 3E rc0|jdkr:|jdd}t|jjd|zgS|jd}t|jjd}|j}t||d|gS)zw Microsoft Windows SDK Libraries. Return ------ list of str paths rTrrrr:um)rrrrrr< _sdk_subdir)rrr:libvers r OSLibrarieszEnvironmentInfo.OSLibrariess ;$  ',,Tt,DDK.+0EFFG G',,,66Ktw,e44C%F&&&++>??@ @rc t|jjd}|jdkr|t|dgS|jdkr|j}nd}t|d|zt|d|zt|d|zgS) zu Microsoft Windows SDK Include. Return ------ list of str paths includerglrrz%ssharedz%sumz%swinrt)rrr<rr)rrsdkvers r OSIncludeszEnvironmentInfo.OSIncludesstw,i88 ;$  T'4001 1{d"")*v"566&6/22)f"4557 7rct|jjd}g}|jdkr ||jz }|jdkr|t|dgz }|jdkru||t|jjdt|ddt|d dt|d dt|jjd d d |jzdddgz }|S)z} Microsoft Windows SDK Libraries Paths. Return ------ list of str paths Referencesrr4zCommonConfiguration\Neutralr UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContract ExtensionSDKszMicrosoft.VCLibsr!CommonConfigurationneutral)rrr<rr)rreflibpaths r OSLibpathzEnvironmentInfo.OSLibpaths47(,77 ;#   t' 'G ;$   S"@AAB BG ;$   TW*O<<BIOOSA9MMGG)?|p|}|jdkp |jdk}g}|r|fdjDz }|r|fdjDz }|S)zv Microsoft .NET Framework Tools. Return ------ list of str paths rTrUc:g|]}tj|Sr)rrerjr rs rrz+EnvironmentInfo.FxTools..68882,c22888rc:g|]}tj|Sr)rrhrs rrz+EnvironmentInfo.FxTools..rr) rrrrrrrrmrq)rr include32 include64rrs @rFxToolszEnvironmentInfo.FxToolss W W ;$  I,,...Jr7H7H7J7J3JII((**Ab.?.?.A.AI'1MR]g5MI  8 8888!#!6888 8E  8 8888!#!6888 8E rc|jdks |jjsgS|jd}t |jjd|zgS)z~ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths rTrzlib\um%s)rrr_rrr)rrs rNetFxSDKLibrariesz!EnvironmentInfo.NetFxSDKLibrariessU ;  TW%8 Ig((T(22 TW(+ *CDDEErcj|jdks |jjsgSt|jjdgS)z} Microsoft .Net Framework SDK Includes. Return ------ list of str paths rz include\um)rrr_rrs rNetFxSDKIncludesz EnvironmentInfo.NetFxSDKIncludess8 ;  TW%8 ITW(-8899rc8t|jjdgS)z Microsoft Visual Studio Team System Database. Return ------ list of str paths z VSTSDB\Deployrrs rVsTDbzEnvironmentInfo.VsTDbsTW)+;<<==rc|jdkrgS|jdkr(|jj}|jd}n|jj}d}d|j|fz}t ||g}|jdkr|t ||dgz }|S)zn Microsoft Build Engine. Return ------ list of str paths r5rTrrzMSBuild\%0.1f\bin%sRoslyn)rrr"rrr$r)r base_pathrrKbuilds rMSBuildzEnvironmentInfo.MSBuilds ;  I [4  /I'--d-;;KK,IK%k(BBi&&' ;$   d9dH556 6E rcR|jdkrgSt|jjdgS)zt Microsoft HTML Help Workshop. Return ------ list of str paths r4zHTML Help Workshop)rrrr"rs rHTMLHelpWorkshopz EnvironmentInfo.HTMLHelpWorkshops/ ;  ITW,.BCCDDrc|jdkrgS|jd}t|jjd}|j}t||d|gS)z Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths rTrr:ucrt)rrrrrrY _ucrt_subdir)rrr:rs r UCRTLibrarieszEnvironmentInfo.UCRTLibrariessh ;  Ig((T(22 47-u55#S=>>??rc|jdkrgSt|jjd}t|d|jzgS)z Microsoft Universal C Runtime SDK Include. Return ------ list of str paths rrz%sucrt)rrrrYr)rrs r UCRTIncludeszEnvironmentInfo.UCRTIncludessE ;  Itw19==Wh)::;;<> W) j00JGGHH    D{GK,@,@,DEEK d; &B&BC CHT*h//00)DK",<=(C ,<,'- .. !!%#'#3#'#3#'<#'#5#'#9 #; #) **%%i'+'7'+|'+'7'+~'7'- .. ""6$(L$(L$(J$(M$(M$(L$(L$($9$(K$1$* + +)   @ ;"  (rxr r) rrspec_path_listsr spec_paths env_pathsr extant_pathsr( unique_pathss rrzEnvironmentInfo._build_pathss._22?CC Kb))//88  I665;FtF5%00111  ?4tzz||CC"99#>> >&|44 |L)))r)Nr)T)!rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrEs.????  X   X DDXD& ? ?X ?DDXD( E EX E""X"HAAXA&77X7.!!X!F ' 'X '!3!3!3F 5 5X 5 6 6X 6X8 F FX F : :X : > >X >X6 E EX E@@X@" = =X = 5 5X 5 * *X *  X D0000d*****rrr))rriorosrros.pathrrrr rrplatformr$rDdistutils.errorsrw#setuptools.extern.packaging.versionr setuptools.extern.more_itertoolsr monkeyr systemrrrr4rLrZrdrrrrrrrrrrrr s   000000000000 ======<<<<<<!!!!!!8? !!MMM!!!!!!!! dffG"""<"""L  $ $ $ N!!!H4 B B B""""Jp p p p p p p p fv#v#v#v#v#v#v#v#rH/H/H/H/H/H/H/H/Vb *b *b *b *b *b *b *b *b *b *rPK!''(__pycache__/archive_util.cpython-311.pycnu[ ,RedZddlZddlZddlZddlZddlZddlZddlmZddl m Z gdZ GddeZ d Z e dfd Ze fd Ze fd Ze fd ZdZdZe fdZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directory)unpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryceZdZdZdS)r z#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/archive_util.pyr r s----rr c|S)z@The default progress/filter callback; returns True for all filesr)srcdsts rr r s Jrc~|ptD]"} ||||dS#t$rYwxYwtd|z)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r )filename extract_dirprogress_filterdriversdrivers rrrsy.//     F8[/ : : : FF"    H  ! /( :   s  **c|tj|std|z|d|fi}tj|D]\}}}||\}}|D]K} || zdztj|| f|tj|| <L|D]} tj|| } ||| z| } | s4t | tj|| } tj| | tj | | dS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirr walkjoinrshutilcopyfilecopystat) rrrpathsbasedirsfilesrrdftargets rr r @sY 7== " "E !88!CDDD 2{# E WX.. ' 'dE;S O OA+.7S="',,sA:N:N+NE"',,tQ'' ( ( ' 'AW\\#q))F$_S1Wf55F  V $ $ $ T1%%A OAv & & & OAv & & & & ' ' 'rctj|st|dtj|5}t |||ddddS#1swxYwYdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z is not a zip fileN)zipfile is_zipfiler ZipFile_unpack_zipfile_obj)rrrzs rrr[s  h ' 'G 888!EFFF  " "=aA{O<<<==================sAA!Acj|D]}|j}|dsd|dvr7t jj|g|dR}|||}|sp|drt|nft|| |j}t|d5}| |dddn #1swxYwY|j dz }|rt j ||dS)zInternal/private API used by other parts of setuptools. Similar to ``unpack_zipfile``, but receives an already opened :obj:`zipfile.ZipFile` object instead of a filename. r ..wbN)infolistr startswithsplitr!r"r%endswithrreadopenwrite external_attrchmod) zipfile_objrrinfonamer/datar.unix_attributess rr4r4js $$&&..} ??3   44::c??#:#: kz _iter_open_tar..s$rr r7N) chown contextlibclosingrEr;r<r!r"r%rVrQr=sep)rRrrmemberrE prelim_dst final_dsts r_iter_open_tarrcs}'&GM  G $ $$$ $ $F;Ds## ttzz#'>'>kDDJJsOODDDJ 1'6BB    (j99I !!"&)) +%crcN )# # # # #) $$$$$$$$$$$$$$$$$$$s7A#C1BC1 B!C1 B!!AC11C58C5c  tj|}n*#tj$r}t|d|d}~wwxYwt |||D]1\}} |||#tj$rY.wxYwdS)zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z- is not a compressed or uncompressed tar fileNT)tarfiler?TarErrorr rc_extract_member ExtractError)rrrtarobjer`rbs rrrsh''   AI K    , K    " "69 5 5 5 5#    D  4s">9>A//BB)rr1rer!r&rLr]distutils.errorsr_pathr__all__r r rr rr4rVrcrr rrrrnsn55 ++++++######    ........ 0>! ! ! ! H=K''''6;I = = = =CQ....<///*$$$:;I6&~~ErPK!Ը1n1n&__pycache__/build_meta.cpython-311.pycnu[ ,ReLdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZmZmZddlZddlZddlmZddlmZddlmZdd lmZdd lmZgd Zejd d  Z!de!"ddvZ#Gdde$Z%Gddej&j'Z'ej(dZ)dZ*dZ+dZ,ej(dZ-ee e.ee.ee.dffZ/ GddZ0Gdde0Z1Gdde1Z2e1Z3e3j4Z4e3j5Z5e3j6Z6e3j7Z7e3j8Z8e#se3j9Z9e3j:Z:e3j;Z;e2Zz+no_install_setup_requires..estr$N) setuptools_install_setup_requires)r3s r"no_install_setup_requiresr>\sK  -D););J&2 -1 ***T *1111s/=cDfdtjDS)Ncg|]A}tjtj|?|BSr()ospathisdirjoin).0namea_dirs r" z1_get_immediate_subdirectories..msK 9 9 9Tw}}RW\\%6677 9D 9 9 9r$)rAlistdir)rGs`r"_get_immediate_subdirectoriesrJls7 9 9 9 9RZ.. 9 9 99r$cfdtj|D} |\}n#t$rtdwxYw|S)Nc3FK|]}||VdSrendswith)rEf extensions r" z'_file_with_extension..rsI ::i  r$z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)rArI ValueError) directoryrPmatchingfiles ` r"_file_with_extensionrVqs|:i((H9 999 899 99 Ks (Actj|stjdSt t dt|S)Nz%from setuptools import setup; setup()open)rArBexistsioStringIOgetattrtokenizerX setup_scripts r"_open_setup_scriptr`sF 7>>, ' 'E{CDDD *78VT * *< 8 88r$c#Ktj5tjdddVddddS#1swxYwYdS)Nignorezsetup.py install is deprecated)warningscatch_warningsfilterwarningsr(r$r"suppress_known_deprecationrfs  " "*JKKK s=AAceZdZdZdededeefdZdZdede efdZ dede efdZ dede efd Z dede efd Z d S) _ConfigSettingsTranslatorzTranslate ``config_settings`` into distutils-style command arguments. Only a limited number of options is currently supported. keyconfig_settingsreturnc|pi}||pg}t|trtj|n|S)aA Get the value of a specific key in ``config_settings`` as a list of strings. >>> fn = _ConfigSettingsTranslator()._get_config >>> fn("--global-option", None) [] >>> fn("--global-option", {}) [] >>> fn("--global-option", {'--global-option': 'foo'}) ['foo'] >>> fn("--global-option", {'--global-option': ['foo']}) ['foo'] >>> fn("--global-option", {'--global-option': 'foo'}) ['foo'] >>> fn("--global-option", {'--global-option': 'foo bar'}) ['foo', 'bar'] )get isinstancestrshlexsplit)r!rirjcfgoptss r" _get_configz%_ConfigSettingsTranslator._get_configsF$#wws||!r$.tS$9$9Cu{4   tCr$cZdtjjjD}d|DS)z>Global options accepted by setuptools (e.g. quiet or verbose).c3*K|]}|ddVdS)Nr()rEopts r"rQzB_ConfigSettingsTranslator._valid_global_options..s*RRs3rr7RRRRRRr$c h|] }|D]}|| Sr(r()rElong_and_shortflags r" zB_ConfigSettingsTranslator._valid_global_options..s+VVV~VVtQUVVVVVr$)r<distr*global_options)r!optionss r"_valid_global_optionsz/_ConfigSettingsTranslator._valid_global_optionss1RRjo&B&QRRRVV7VVVVr$c# K|pi}hd}d|vsd|vrUt|dp|dpd}||vrdndVd|vsd|vrUt|dp|dpd}||vrdndV||d |}fd |DEd {Vd S) a Let the user specify ``verbose`` or ``quiet`` + escape hatch via ``--global-option``. Note: ``-v``, ``-vv``, ``-vvv`` have similar effects in setuptools, so we just have to cover the basic scenario ``-v``. >>> fn = _ConfigSettingsTranslator()._global_args >>> list(fn(None)) [] >>> list(fn({"verbose": "False"})) ['-q'] >>> list(fn({"verbose": "1"})) ['-v'] >>> list(fn({"--verbose": None})) ['-v'] >>> list(fn({"verbose": "true", "--global-option": "-q --no-user-cfg"})) ['-v', '-q', '--no-user-cfg'] >>> list(fn({"--quiet": None})) ['-q'] >0noofffalseverbosez --verbose1z-qz-vquietz--quiet--global-optionc3JK|]}|dv|VdS)rN)strip)rEargvalids r"rQz9_ConfigSettingsTranslator._global_args..s7CCC399S>>U+B+BC+B+B+B+BCCr$N)rormlowerrrt)r!rjrrfalseylevelargsrs @r" _global_argsz&_ConfigSettingsTranslator._global_argssA*#,,,   {c11 **Icggk.B.BIcJJE ;;==F2244 = = = c>>Y#--((ECGGI,>,>E#FFE ;;==F2244 = = =**,, 1?CCCCCC4CCCCCCCCCCCCr$c#K|pi}d|vr,tt|dpd}|rdndVd|vrdt|dgEd{VdSdS)a The ``dist_info`` command accepts ``tag-date`` and ``tag-build``. .. warning:: We cannot use this yet as it requires the ``sdist`` and ``bdist_wheel`` commands run in ``build_sdist`` and ``build_wheel`` to re-use the egg-info directory created in ``prepare_metadata_for_build_wheel``. >>> fn = _ConfigSettingsTranslator()._ConfigSettingsTranslator__dist_info_args >>> list(fn(None)) [] >>> list(fn({"tag-date": "False"})) ['--no-date'] >>> list(fn({"tag-date": None})) ['--no-date'] >>> list(fn({"tag-date": "true", "tag-build": ".a"})) ['--tag-date', '--tag-build', '.a'] ztag-daterz --tag-datez --no-datez tag-buildz --tag-buildN)rro)r!rjrrvals r"__dist_info_argsz*_ConfigSettingsTranslator.__dist_info_argss&#   CJ :7;;<>> fn = _ConfigSettingsTranslator()._editable_args >>> list(fn(None)) [] >>> list(fn({"editable-mode": "strict"})) ['--mode', 'strict'] z editable-mode editable_modeNz--mode)rmro)r!rjrrmodes r"_editable_argsz(_ConfigSettingsTranslator._editable_argssj#ww''C377?+C+C  Fc$ii((((((((((r$c#LK|d|}|}g}|D]2}|d|vr|||V3|d|Ed{V|r"d|d}t j|t dSdS)aV Users may expect to pass arbitrary lists of arguments to a command via "--global-option" (example provided in PEP 517 of a "escape hatch"). >>> fn = _ConfigSettingsTranslator()._arbitrary_args >>> list(fn(None)) [] >>> list(fn({})) [] >>> list(fn({'--build-option': 'foo'})) ['foo'] >>> list(fn({'--build-option': ['foo']})) ['foo'] >>> list(fn({'--build-option': 'foo'})) ['foo'] >>> list(fn({'--build-option': 'foo bar'})) ['foo', 'bar'] >>> warnings.simplefilter('error', SetuptoolsDeprecationWarning) >>> list(fn({'--global-option': 'foo'})) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): SetuptoolsDeprecationWarning: ...arguments given via `--global-option`... rrz--build-optionNz The arguments z were given via `--global-option`. Please use `--build-option` instead, `--global-option` is reserved to flags like `--verbose` or `--quiet`. )rtrrappendrcwarnr )r!rjr global_optsbad_argsrmsgs r"_arbitrary_argsz)_ConfigSettingsTranslator._arbitrary_args s. 1?CC0022   Cyy~~[00$$$ ##$4oFFFFFFFFF  =#C M#; < < < < <  = =r$N)r%r&r'__doc__ro_ConfigSettingsrrtrrr)_ConfigSettingsTranslator__dist_info_argsrrr(r$r"rhrhs DsD_DcDDDD,WWW DO D D D D DD>>HSM>>>>4)o)(3-)))) (=(=8C=(=(=(=(=(=(=r$rhceZdZdZddZddZddZdeded efd Zdeded e fd Z dd Z d Z ddZ ddZdeed eefdZes ddZddZ ddZdSdS)_BuildMetaBackendcngtjdd||d||t_ t5|dddn #1swxYwYn!#t$r}||jz }Yd}~nd}~wwxYw|S)Nr egg_info) sysargvrrr*r4 run_setuprr )r!rj requirementses r"_get_build_requiresz%_BuildMetaBackend._get_build_requires7s Xbqb\    / /    ! !/ 2 2    )##%% ! !    ! ! ! ! ! ! ! ! ! ! ! ! ! ! !% ) ) ) AL (LLLLLL )s<B'B< BB  BB B B2 B--B2setup.pyc|}d}t|5}|dd}dddn #1swxYwYt|t dS)N__main__z\r\nz\n)r`readreplaceexeclocals)r!r___file__r%rOcodes r"rz_BuildMetaBackend.run_setupFs   ) ) 4Q6688##GU33D 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 T688s)A  A A Nc2||dgS)Nwheelrrr!rjs r"rz._BuildMetaBackend.get_requires_for_build_wheelQs''wi'PPPr$c0||gS)Nrrrs r"rz._BuildMetaBackend.get_requires_for_build_sdistTs''b'IIIr$metadata_directorysuffixrkc|||}t|j|s"tjt |||jS)z PEP 517 requires that the .dist-info directory be placed in the metadata_directory. To comply, we MUST copy the directory to the root. Returns the basename of the info directory, e.g. `proj-0.0.0.dist-info`. )_find_info_directoryr parentshutilmoverorF)r!rrinfo_dirs r"_bubble_up_info_directoryz+_BuildMetaBackend._bubble_up_info_directoryWsP,,-?HH*<== ; KH '9 : : :}r$cLtj|D]s\}}}fd|D}t|dkst|dkr9t|dksJddt||dcStdd|}t j|)Nc>g|]}||Sr(rM)rErOrs r"rHz:_BuildMetaBackend._find_info_directory..fs*@@@QZZ-?-?@!@@@r$rr z Multiple z directories foundzNo z directory found in )rAwalklenrr InternalError)r!rrrdirsr candidatesrs ` r"rz&_BuildMetaBackend._find_info_directoryds!w'9:: 3 3OFD!@@@@T@@@J:!##s4yyA~~:!+++-S-S-S-S+++FJqM22222(6EFDD0BDD"3'''r$cHgtjdd||dd|dt_t5|dddn #1swxYwY||d||dS)Nr dist_infoz --output-dirz--keep-egg-infoz .egg-infoz .dist-info)rrrr>rrr!rrjs r"rz2_BuildMetaBackend.prepare_metadata_for_build_wheelos Xbqb\    / /      /    ' ( (   NN                   &&'9;GGG--.@,OOOs A--A14A1c tj|}tj|dd|d}t jdi|5}gt jdd|||d|| |t _t5| dddn #1swxYwYt||}tj ||}tj|rtj|tjtj |||dddn #1swxYwY|S)NT)exist_okz.tmp-)prefixdirr z --dist-dirr()rArBabspathmakedirstempfileTemporaryDirectoryrrrrr>rrVrDrYremoverename) r! setup_commandresult_extensionresult_directoryrj temp_opts tmp_dist_dirresult_basename result_paths r"_build_with_temp_dirz&_BuildMetaBackend._build_with_temp_dir~s 7??+;<< $t4444&/?@@  ( 5 59 5 5 P"1"""?33 +  %%o66 CH+,, ! !    ! ! ! ! ! ! ! ! ! ! ! ! ! ! !3.00O',,'7IIKw~~k** ' +&&& Ibgll<AA; O O O# P P P P P P P P P P P P P P P&s8 AE9+C  E9 C E9C BE99E=E=ct5|dgd||cdddS#1swxYwYdS)N bdist_wheel.whl)rfr)r!wheel_directoryrjrs r"rz_BuildMetaBackend.build_wheels ' ) ) O O,,m_f- P P P P8<@'+OOOO :::: NXc]NxPS}NNNN MQ     F F F FAE      +r$rc$eZdZdZdfd ZxZS)_BuildMetaLegacyBackendaOCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. rc.ttj}tjtj|}|tjvr tjd|tjd}|tjd< tt| ||tjdd<|tjd<dS#|tjdd<|tjd<wxYw)Nrr^) r,rrBrAdirnamerinsertrsuperrr)r!r_sys_path script_dir sys_argv_0 __class__s r"rz!_BuildMetaLegacyBackend.run_setups>>W__RW__\%B%BCC SX % % HOOAz * * * Xa[ "  % )  ! | <<<#CHQQQK$CHQKKK#CHQQQK$CHQK $ $ $ $s ')C22"Dr)r%r&r'rr __classcell__)rs@r"rrsG  %%%%%%%%%%r$r)=rrZrArprr]rr6rrcpathlibrtypingrrrrrr<r0rr _pathr _reqsr _deprecation_warningr distutils.utilr__all__getenvrrrr BaseExceptionrr}r*r7r>rJrVr`rfrorrhrr_BACKENDrrrrrrrrrr(r$r"r sS8  88888888888888 >>>>>>$$$$$$ % % %'RY'CRHHNNPP#'A'I'I#s'S'SS%%%%%]%%% /////:?////,  2 2 2999   999  4U3S 4+?%@ @AB U=U=U=U=U=U=U=U=pOOOOO1OOOd%%%%%%%%%%/%%%%%%R    'D'D#+#L " " -&.&N#*2*V',N% $ & & r$PK!HeS&__pycache__/_itertools.cpython-311.pycnu[ ,ReddlmZdfdZdS))consumec|S)N)xs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_itertools.pyrs!c#Kt}|j}|D]3}||}||vrtd|d|||V4dS)a Wrap an iterable to raise a ValueError if non-unique values are encountered. >>> list(ensure_unique('abc')) ['a', 'b', 'c'] >>> consume(ensure_unique('abca')) Traceback (most recent call last): ... ValueError: Duplicate element 'a' encountered. zDuplicate element z encountered.N)setadd ValueError)iterablekeyseenseen_addelementks r ensure_uniquersy 55DxH CLL 99J'JJJKK K  r N) setuptools.extern.more_itertoolsrrrr rrs<444444!, r PK!(HH$__pycache__/dep_util.cpython-311.pycnu[ ,ReddlmZdZdS)) newer_groupcRt|t|krtdg}g}tt|D]T}t||||r6||||||U||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)sources_groupstargets n_sources n_targetsis /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/dep_util.pynewer_pairwise_grouprs  >c'll** CEE EII 3~&& ' ')) ~a('!* 5 5 )   ^A. / / /   WQZ ( ( ( i N)distutils.dep_utilrrrrrs0******      rPK!l  &__pycache__/py34compat.cpython-311.pycnu[ ,RehddlZ ddlZn #e$rYnwxYw ejjZdS#e$rdZYdSwxYw)Nc@|j|jS)N)loader load_modulename)specs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/py34compat.pymodule_from_specr s{&&ty111) importlibimportlib.util ImportErrorutilr AttributeErrorr rrs    D 2 ~62222222222s  %11PK!88"__pycache__/launch.cpython-311.pycnu[ ,Re,DdZddlZddlZdZedkr edSdS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. Ncttjd}t|dd}tjddtjdd<t t dt }||5}|}dddn #1swxYwY|dd}t||d}t||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizer readreplacecompiler ) script_name namespaceopen_fidscript norm_scriptcodes /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/launch.pyrunr s L(1+KI (122,CHQQQK Hfd + +E {  s..511K ; V 4 4Dys5BBBr)rrr rrrrsV , zCEEEEErPK!|%__pycache__/extension.cpython-311.pycnu[ ,ReddlZddlZddlZddlZddlZddlmZdZeZ eej j Z Gdde Z Gdde Z dS) N) get_unpatchedc^d} t|dgjdS#t$rYnwxYwdS)z0 Return True if Cython can be imported. zCython.Distutils.build_ext build_ext)fromlistTF) __import__r Exception) cython_impls /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/extension.py _have_cythonr sP/K ;+777AAt      5s  **c(eZdZdZfdZdZxZS) Extensiona Describes a single extension module. This means that all source files will be compiled into a single binary file ``.`` (with ```` derived from ``name`` and ```` defined by one of the values in ``importlib.machinery.EXTENSION_SUFFIXES``). In the case ``.pyx`` files are passed as ``sources and`` ``Cython`` is **not** installed in the build environment, ``setuptools`` may also try to look for the equivalent ``.cpp`` or ``.c`` files. :arg str name: the full name of the extension, including any packages -- ie. *not* a filename or pathname, but Python dotted name :arg list[str] sources: list of source filenames, relative to the distribution root (where the setup script lives), in Unix form (slash-separated) for portability. Source files may be C, C++, SWIG (.i), platform-specific resource files, or whatever else is recognized by the "build_ext" command as source for a Python extension. :keyword list[str] include_dirs: list of directories to search for C/C++ header files (in Unix form for portability) :keyword list[tuple[str, str|None]] define_macros: list of macros to define; each macro is defined using a 2-tuple: the first item corresponding to the name of the macro and the second item either a string with its value or None to define it without a particular value (equivalent of "#define FOO" in source or -DFOO on Unix C compiler command line) :keyword list[str] undef_macros: list of macros to undefine explicitly :keyword list[str] library_dirs: list of directories to search for C/C++ libraries at link time :keyword list[str] libraries: list of library names (not filenames or paths) to link against :keyword list[str] runtime_library_dirs: list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is loaded). Setting this will cause an exception during build on Windows platforms. :keyword list[str] extra_objects: list of extra files to link with (eg. object files not implied by 'sources', static library that must be explicitly specified, binary resource files, etc.) :keyword list[str] extra_compile_args: any extra platform- and compiler-specific information to use when compiling the source files in 'sources'. For platforms and compilers where "command line" makes sense, this is typically a list of command-line arguments, but for other platforms it could be anything. :keyword list[str] extra_link_args: any extra platform- and compiler-specific information to use when linking object files together to create the extension (or to create a new static Python interpreter). Similar interpretation as for 'extra_compile_args'. :keyword list[str] export_symbols: list of symbols to be exported from a shared extension. Not used on all platforms, and not generally necessary for Python extensions, which typically export exactly one symbol: "init" + extension_name. :keyword list[str] swig_opts: any extra options to pass to SWIG if a source file has the .i extension. :keyword list[str] depends: list of files that the extension depends on :keyword str language: extension language (i.e. "c", "c++", "objc"). Will be detected from the source extensions if not provided. :keyword bool optional: specifies that a build failure in the extension should not abort the build process, but simply not install the failing extension. :keyword bool py_limited_api: opt-in flag for the usage of :doc:`Python's limited API `. :raises setuptools.errors.PlatformError: if 'runtime_library_dirs' is specified on Windows. (since v63) cz|dd|_tj||g|Ri|dS)Npy_limited_apiF)poprsuper__init__)selfnamesourcesargskw __class__s r rzExtension.__init__~sK!ff%5u==w444444444ctrdS|jpd}|dkrdnd}tjt jd|}tt||j |_ dS)z Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Nzc++z.cppz.cz.pyx$) r languagelower functoolspartialresublistmapr)rlang target_extr"s r _convert_pyx_sources_to_langz&Extension._convert_pyx_sources_to_langsq >>  F}"#zz||u44VV$ <<CT\2233 r)__name__ __module__ __qualname____doc__rr' __classcell__)rs@r rrsT]]~55555 4 4 4 4 4 4 4rrceZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r(r)r*r+rr r.r.sGGGGrr.)r!rdistutils.core distutilsdistutils.errorsdistutils.extensionmonkeyrr have_pyrexcorer _Extensionr.r/rr r8s !!!!!!    ]9>3 4 4 r4r4r4r4r4 r4r4r4jHHHHHiHHHHHrPK!!__pycache__/_path.cpython-311.pycnu[ ,ReRddlZddlmZeeejfZdZdededefdZdS)N)Unioncptj|}tj|ddS)z1Ensure that the parent directory of `path` existsT)exist_okN)ospathdirnamemakedirs)rrs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_path.pyensure_directoryr s0good##GK$''''''p1p2returnctj|tj|kS)aDiffers from os.path.samefile because it does not require paths to exist. Purely string based (no comparison between i-nodes). >>> same_path("a/b", "./a/b") True >>> same_path("a/b", "a/./b") True >>> same_path("a/b", "././a/b") True >>> same_path("a/b", "./a/b/c/..") True >>> same_path("a/b", "../a/b/c") False >>> same_path("a", "a/b") False )rrnormpath)r rs r same_pathr s/ 7  B  27#3#3B#7#7 77r ) rtypingrstrPathLike_Pathr boolrr r rss  c2;((( 8%8U8t888888r PK!|Pw __pycache__/_imp.cpython-311.pycnu[ ,ReX ^dZddlZddlZddlZddlmZdZdZdZ dZ dZ d Z d d Z d d Zd ZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. N)module_from_specct|tr#tjjntjj}|||SN) isinstancelist importlib machinery PathFinder find_specutil)modulepathsfinders /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_imp.pyrrsN eT " " ! &&((22  6&%  ct||}|td|z|js5t|dr%tjd|j}d}d}t|jt}|j dks&|r3t|jtj j rt}d}dx}}n|j dks&|r2t|jtj jrt }d}dx}}n|jr|j }t"j|d }|tj jvrd nd }|tj jvrt*}n5|tj jvrt.}n|tj jvrt2}|t*t.hvrt5||}nd}dx}}|||||ffS) z7Just like 'imp.find_module()', but with package supportN Can't find %ssubmodule_search_locationsz __init__.pyfrozenzbuilt-inrrrb)r ImportError has_locationhasattrr rspec_from_loaderloaderr typeorigin issubclassrFrozenImporter PY_FROZENBuiltinImporter C_BUILTINospathsplitextSOURCE_SUFFIXES PY_SOURCEBYTECODE_SUFFIXES PY_COMPILEDEXTENSION_SUFFIXES C_EXTENSIONopen) rrspeckindfilestaticr,suffixmodes r find_moduler;s VU # #D |/F2333  K/K!L!LK~..}dkJJ D D  T * *F {h&Z K,;.=.=  " "f " K,<2>2> " {!!$''* 3 CCCss Y(8 8 8DD y*< < <DD y*= = =D I{+ + +d##D d+ ++rc~t||}|std|z|j|SNr)rrr#get_code)rrr5s rget_frozen_objectr?GsB VU # #D 4/F2333 ;   ' ''rcht||}|std|zt|Sr=)rrr)rrinfor5s r get_modulerBNs: VU # #D 4/F2333 D ! !!rr )__doc__r+importlib.utilr importlib.machinery py34compatrr/r1r3r*r(rr;r?rBrrrHs  ((((((    !!!',',',',T(((("""""rPK!SLj #__pycache__/version.cpython-311.pycnu[ ,ReVddlZ ejdjZdS#e$rdZYdSwxYw)N setuptoolsunknown) pkg_resourcesget_distributionversion __version__ Exception/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/version.pyr sU0-0>>FKKKKKKKs ((PK!i])__pycache__/_entry_points.cpython-311.pycnu[ ,ReVddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZd Zd Zd Zd e jfd ZejdZeedZeedded e jfdZdZdS)N) OptionError) yield_lines) pass_none)metadata) ensure_unique)consumecf |jdS#t$r}d|d}t||d}~wwxYw)zR Exercise one of the dynamic properties to trigger the pattern match. zProblems to parse zq. Please ensure entry-point follows the spec: https://packaging.python.org/en/latest/specifications/entry-points/N)extrasAttributeErrorr)epexmsgs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_entry_points.py ensure_validr sb ' ''' R R R R #B& 's 0+0ct|}d|dd|z}tj|S)zf Given a value of an entry point or series of entry points, return each as an EntryPoint. []  )rjoinr EntryPoints _from_text)valuegrouplinestexts r load_grouprsF   E u>>>DIIe,, ,D   * *4 0 00c|j|jfSN)rname)r s rby_group_and_namer"'s 8RW repsc rtttt|t|S)zM Ensure entry points are unique by group and name and validate each. key)r maprrr"r#s rvalidater)+s/ C mC5FGGG H HIII Jrctjd|D}t t j|S)zA Given a Distribution.entry_points, produce EntryPoints. c3<K|]\}}t||VdSr )r).0rrs r zload..8sD+)+) E5 5%  +)+)+)+)+)+)r) itertoolschain from_iterableitemsr)rr)r#groupss rloadr33sZ _ * *+)+)IIKK+)+)+)))F H(00 1 11rc~ttjtj|S)z >>> ep, = load('[console_scripts]\nfoo=bar') >>> ep.group 'console_scripts' >>> ep.name 'foo' >>> ep.value 'bar' )r)rrrr(s r_r5>s. H()=)H)H)M)MNN O OOrc|Sr )xs rr9LsArctjd}tjt |||}dd|DS)Nrr%rc3HK|]\}}d|dt|dVdS)rrrN) render_items)r,rr1s rr-zrender..TsU E5 .E--l5))---r)operator attrgetterr.groupbysortedr)r#by_groupr2s rrenderrBOsc"7++H  vcx888( C CF 99"  rcZddt|DS)Nrc38K|]}|jd|jVdS)z = N)r!r)r,r s rr-zrender_items..[sH  7!!rx!!r)rr@r(s rr<r<Zs: 99++  r) functoolsr=r.errorsrextern.jaraco.textrextern.jaraco.functoolsr _importlibr _itertoolsrextern.more_itertoolsr rrr"rr)singledispatchr3registerstrr5typerBr<r7rrrPs++++++...... %%%%%%****** ' ' '111(& 222s P P P dd4jj++&&& $ rPK!{ " "%config/_validate_pyproject/formats.pynu[import logging import os import re import string import typing from itertools import chain as _chain _logger = logging.getLogger(__name__) # ------------------------------------------------------------------------------------- # PEP 440 VERSION_PATTERN = r""" v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
"""

VERSION_REGEX = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.X | re.I)


def pep440(version: str) -> bool:
    return VERSION_REGEX.match(version) is not None


# -------------------------------------------------------------------------------------
# PEP 508

PEP508_IDENTIFIER_PATTERN = r"([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])"
PEP508_IDENTIFIER_REGEX = re.compile(f"^{PEP508_IDENTIFIER_PATTERN}$", re.I)


def pep508_identifier(name: str) -> bool:
    return PEP508_IDENTIFIER_REGEX.match(name) is not None


try:
    try:
        from packaging import requirements as _req
    except ImportError:  # pragma: no cover
        # let's try setuptools vendored version
        from setuptools._vendor.packaging import requirements as _req  # type: ignore

    def pep508(value: str) -> bool:
        try:
            _req.Requirement(value)
            return True
        except _req.InvalidRequirement:
            return False

except ImportError:  # pragma: no cover
    _logger.warning(
        "Could not find an installation of `packaging`. Requirements, dependencies and "
        "versions might not be validated. "
        "To enforce validation, please install `packaging`."
    )

    def pep508(value: str) -> bool:
        return True


def pep508_versionspec(value: str) -> bool:
    """Expression that can be used to specify/lock versions (including ranges)"""
    if any(c in value for c in (";", "]", "@")):
        # In PEP 508:
        # conditional markers, extras and URL specs are not included in the
        # versionspec
        return False
    # Let's pretend we have a dependency called `requirement` with the given
    # version spec, then we can re-use the pep508 function for validation:
    return pep508(f"requirement{value}")


# -------------------------------------------------------------------------------------
# PEP 517


def pep517_backend_reference(value: str) -> bool:
    module, _, obj = value.partition(":")
    identifiers = (i.strip() for i in _chain(module.split("."), obj.split(".")))
    return all(python_identifier(i) for i in identifiers if i)


# -------------------------------------------------------------------------------------
# Classifiers - PEP 301


def _download_classifiers() -> str:
    import ssl
    from email.message import Message
    from urllib.request import urlopen

    url = "https://pypi.org/pypi?:action=list_classifiers"
    context = ssl.create_default_context()
    with urlopen(url, context=context) as response:
        headers = Message()
        headers["content_type"] = response.getheader("content-type", "text/plain")
        return response.read().decode(headers.get_param("charset", "utf-8"))


class _TroveClassifier:
    """The ``trove_classifiers`` package is the official way of validating classifiers,
    however this package might not be always available.
    As a workaround we can still download a list from PyPI.
    We also don't want to be over strict about it, so simply skipping silently is an
    option (classifiers will be validated anyway during the upload to PyPI).
    """

    def __init__(self):
        self.downloaded: typing.Union[None, False, typing.Set[str]] = None
        self._skip_download = False
        # None => not cached yet
        # False => cache not available
        self.__name__ = "trove_classifier"  # Emulate a public function

    def _disable_download(self):
        # This is a private API. Only setuptools has the consent of using it.
        self._skip_download = True

    def __call__(self, value: str) -> bool:
        if self.downloaded is False or self._skip_download is True:
            return True

        if os.getenv("NO_NETWORK") or os.getenv("VALIDATE_PYPROJECT_NO_NETWORK"):
            self.downloaded = False
            msg = (
                "Install ``trove-classifiers`` to ensure proper validation. "
                "Skipping download of classifiers list from PyPI (NO_NETWORK)."
            )
            _logger.debug(msg)
            return True

        if self.downloaded is None:
            msg = (
                "Install ``trove-classifiers`` to ensure proper validation. "
                "Meanwhile a list of classifiers will be downloaded from PyPI."
            )
            _logger.debug(msg)
            try:
                self.downloaded = set(_download_classifiers().splitlines())
            except Exception:
                self.downloaded = False
                _logger.debug("Problem with download, skipping validation")
                return True

        return value in self.downloaded or value.lower().startswith("private ::")


try:
    from trove_classifiers import classifiers as _trove_classifiers

    def trove_classifier(value: str) -> bool:
        return value in _trove_classifiers or value.lower().startswith("private ::")

except ImportError:  # pragma: no cover
    trove_classifier = _TroveClassifier()


# -------------------------------------------------------------------------------------
# Non-PEP related


def url(value: str) -> bool:
    from urllib.parse import urlparse

    try:
        parts = urlparse(value)
        if not parts.scheme:
            _logger.warning(
                "For maximum compatibility please make sure to include a "
                "`scheme` prefix in your URL (e.g. 'http://'). "
                f"Given value: {value}"
            )
            if not (value.startswith("/") or value.startswith("\\") or "@" in value):
                parts = urlparse(f"http://{value}")

        return bool(parts.scheme and parts.netloc)
    except Exception:
        return False


# https://packaging.python.org/specifications/entry-points/
ENTRYPOINT_PATTERN = r"[^\[\s=]([^=]*[^\s=])?"
ENTRYPOINT_REGEX = re.compile(f"^{ENTRYPOINT_PATTERN}$", re.I)
RECOMMEDED_ENTRYPOINT_PATTERN = r"[\w.-]+"
RECOMMEDED_ENTRYPOINT_REGEX = re.compile(f"^{RECOMMEDED_ENTRYPOINT_PATTERN}$", re.I)
ENTRYPOINT_GROUP_PATTERN = r"\w+(\.\w+)*"
ENTRYPOINT_GROUP_REGEX = re.compile(f"^{ENTRYPOINT_GROUP_PATTERN}$", re.I)


def python_identifier(value: str) -> bool:
    return value.isidentifier()


def python_qualified_identifier(value: str) -> bool:
    if value.startswith(".") or value.endswith("."):
        return False
    return all(python_identifier(m) for m in value.split("."))


def python_module_name(value: str) -> bool:
    return python_qualified_identifier(value)


def python_entrypoint_group(value: str) -> bool:
    return ENTRYPOINT_GROUP_REGEX.match(value) is not None


def python_entrypoint_name(value: str) -> bool:
    if not ENTRYPOINT_REGEX.match(value):
        return False
    if not RECOMMEDED_ENTRYPOINT_REGEX.match(value):
        msg = f"Entry point `{value}` does not follow recommended pattern: "
        msg += RECOMMEDED_ENTRYPOINT_PATTERN
        _logger.warning(msg)
    return True


def python_entrypoint_reference(value: str) -> bool:
    module, _, rest = value.partition(":")
    if "[" in rest:
        obj, _, extras_ = rest.partition("[")
        if extras_.strip()[-1] != "]":
            return False
        extras = (x.strip() for x in extras_.strip(string.whitespace + "[]").split(","))
        if not all(pep508_identifier(e) for e in extras):
            return False
        _logger.warning(f"`{value}` - using extras for entry points is not recommended")
    else:
        obj = rest

    module_parts = module.split(".")
    identifiers = _chain(module_parts, obj.split(".")) if rest else module_parts
    return all(python_identifier(i.strip()) for i in identifiers)
PK!%KHT8T8>config/_validate_pyproject/__pycache__/formats.cpython-311.pycnu[

,Re "<ddlZddlZddlZddlZddlZddlmZeje	Z
dZejdezdzej
ejzZdedefdZd	Zejd
edejZdedefd
Z		ddlmZn#e$r	ddlmZYnwxYwdedefdZn(#e$r e
ddedefdZYnwxYwdedefdZdedefdZdefdZGddZ 	ddl!m"Z#dedefdZ$n#e$r
e Z$YnwxYwdedefdZ%dZ&ejd
e&dejZ'dZ(ejd
e(dejZ)dZ*ejd
e*dejZ+dedefdZ,dedefdZ-dedefd Z.dedefd!Z/dedefd"Z0dedefd#Z1dS)$N)chaina
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
z^\s*z\s*$versionreturnc:t|duSN)
VERSION_REGEXmatch)rs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/formats.pypep440r/sw''t33z'([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])^$namec:t|duSr)PEP508_IDENTIFIER_REGEXr	)rs r
pep508_identifierr:s"((..d::r)requirementsvaluec\	tj|dS#tj$rYdSwxYw)NTF)_reqRequirementInvalidRequirementrs r
pep508rEsB	U###4&			55	s++zCould not find an installation of `packaging`. Requirements, dependencies and versions might not be validated. To enforce validation, please install `packaging`.cdSNTrs r
rrSstrcbtfddDrdStdS)zGExpression that can be used to specify/lock versions (including ranges)c3 K|]}|vV	dSrr).0crs  r
	z%pep508_versionspec..Ys'
/
/!1:
/
/
/
/
/
/r);]@Frequirement)anyrrs`r
pep508_versionspecr(WsH

/
/
/
/
/
/
///u'''(((rc|d\}}}dt|d|dD}td|DS)N:c3>K|]}|VdSrstripr is  r
r"z+pep517_backend_reference..is*PP17799PPPPPPr.c38K|]}|t|VdSrpython_identifierr.s  r
r"z+pep517_backend_reference..js0>>A> ##>>>>>>r)	partition_chainsplitall)rmodule_objidentifierss     r
pep517_backend_referencer<gsi__S))NFAsPPfV\\#->->		#&O&OPPPK>>[>>>>>>rcXddl}ddlm}ddlm}d}|}|||5}|}|dd|d<||	d	d
cdddS#1swxYwYdS)Nr)Message)urlopenz.https://pypi.org/pypi?:action=list_classifiers)contextzcontent-typez
text/plaincontent_typecharsetzutf-8)
ssl
email.messager>urllib.requestr?create_default_context	getheaderreaddecode	get_param)rCr>r?urlr@responseheaderss       r
_download_classifiersrNqsJJJ%%%%%%&&&&&&
:C((**G	g	&	&	&M('))"*"4"4^\"R"R}}%%g&7&7	7&K&KLLMMMMMMMMMMMMMMMMMMsABB#&B#c.eZdZdZdZdZdedefdZdS)_TroveClassifierakThe ``trove_classifiers`` package is the official way of validating classifiers,
    however this package might not be always available.
    As a workaround we can still download a list from PyPI.
    We also don't want to be over strict about it, so simply skipping silently is an
    option (classifiers will be validated anyway during the upload to PyPI).
    c0d|_d|_d|_dS)NFtrove_classifier)
downloaded_skip_download__name__selfs r
__init__z_TroveClassifier.__init__sFJ#+


rcd|_dSr)rTrVs r
_disable_downloadz"_TroveClassifier._disable_downloads"rrrc6|jdus	|jdurdStjdstjdr%d|_d}t|dS|jd}t|	t
t|_n2#t$r%d|_tdYdSwxYw||jvp&|
dS)	NFT
NO_NETWORKVALIDATE_PYPROJECT_NO_NETWORKzxInstall ``trove-classifiers`` to ensure proper validation. Skipping download of classifiers list from PyPI (NO_NETWORK).zxInstall ``trove-classifiers`` to ensure proper validation. Meanwhile a list of classifiers will be downloaded from PyPI.z*Problem with download, skipping validation
private ::)rSrTosgetenv_loggerdebugsetrN
splitlines	Exceptionlower
startswith)rWrmsgs   r
__call__z_TroveClassifier.__call__s&?e##t':d'B'B4
9\""	bi0O&P&P	#DOP

MM#4?"P

MM#
"%&;&=&=&H&H&J&J"K"K


"'

JKKKtt

'Q5;;==+C+CL+Q+QQs2B99+C('C(N)	rU
__module____qualname____doc__rXrZstrboolrirrr
rPrP~sf+++###RcRdRRRRRRrrP)classifierscb|tvp&|dS)Nr^)_trove_classifiersrfrgrs r
rRrRs)**Tekkmm.F.F|.T.TTrc>ddlm}	||}|jsYtd||ds'|dsd|vs|d|}t
|jo|jS#t$rYdSwxYw)	Nr)urlparsezsFor maximum compatibility please make sure to include a `scheme` prefix in your URL (e.g. 'http://'). Given value: /\r%zhttp://F)	urllib.parsersschemerawarningrgrnnetlocre)rrspartss   r
rKrKs%%%%%%
|	4OO( %((



$$S))
4U-=-=d-C-C
4se|| !25!2!233EL1U\222uusBB
BBz[^\[\s=]([^=]*[^\s=])?z[\w.-]+z\w+(\.\w+)*c*|Sr)isidentifierrs r
r3r3src|ds|drdStd|dDS)Nr0Fc34K|]}t|VdSrr2)r ms  r
r"z.python_qualified_identifier..s+>> ##>>>>>>r)rgendswithr7r6rs r
python_qualified_identifierrsYs 3 3u>>U[[-=-=>>>>>>rc t|Sr)rrs r
python_module_namers&u---rc:t|duSr)ENTRYPOINT_GROUP_REGEXr	rs r
python_entrypoint_grouprs!''..d::rct|sdSt|s*d|d}|tz
}t|dS)NFz
Entry point `z'` does not follow recommended pattern: T)ENTRYPOINT_REGEXr	RECOMMEDED_ENTRYPOINT_REGEXRECOMMEDED_ENTRYPOINT_PATTERNrarx)rrhs  r
python_entrypoint_namerse!!%((u&,,U33LeLLL,,4rcN|d\}}}d|vr|d\}}}|ddkrdSd|tjdzdD}td	|DsdStd
|dn|}|d}|r#t||dn|}td
|DS)Nr*[r$Fc3>K|]}|VdSrr,)r xs  r
r"z.python_entrypoint_reference..s*XX!''))XXXXXXrz[],c34K|]}t|VdSr)r)r es  r
r"z.python_entrypoint_reference..s+88A$Q''888888r`z4` - using extras for entry points is not recommendedr0c3XK|]%}t|V&dSr)r3r-r.s  r
r"z.python_entrypoint_reference..s3AA ++AAAAAAr)	r4r-string
whitespacer6r7rarxr5)	rr8r9restr:extras_extrasmodule_partsr;s	         r
python_entrypoint_referencers'ooc**OFAt
d{{..--Q==??2#%%5XXW]]63Dt3K%L%L%R%RSV%W%WXXX8888888	5WEWWWXXXX<<$$L:>P&syy~~666LKAA[AAAAAAr)2loggingr_rertyping	itertoolsrr5	getLoggerrUraVERSION_PATTERNcompileXIrrmrnrPEP508_IDENTIFIER_PATTERNrr	packagingrrImportErrorsetuptools._vendor.packagingrrxr(r<rNrPtrove_classifiersrorqrRrKENTRYPOINT_PATTERNrrrENTRYPOINT_GROUP_PATTERNrr3rrrrrrrr
rs_								







%%%%%%
'
H
%
%
>
7_4w>rtLL
4C4D4444G$"*%E)B%E%E%ErtLL;C;D;;;;F2222222FFFEEEEEEEEFcdOO	=cd	)c	)d	)	)	)	) ?C?D????
Ms
M
M
M
M-R-R-R-R-R-R-R-R`*CCCCCCUUUUUUU***''))*st(/2:7"4777>> *(bj)M-J)M)M)MrtTT)#$C(@$C$C$CRTJJ S T    ?s?t????.c.d....;3;4;;;;#$BsBtBBBBBBsB?BB BB BB  "CC,C;;D
D
PK!"rhM	M	?config/_validate_pyproject/__pycache__/__init__.cpython-311.pycnu[

,ReUddlmZddlmZmZmZddlmZddlm	Z	m
Z
ddlmZddl
mZmZddlmZgd	Zd
ejDZeeeegeffed<ded
efdZdS))reduce)AnyCallableDict)formats)detailed_errorsValidationError)EXTRA_VALIDATIONS)JsonSchemaExceptionJsonSchemaValueException)validate)rFORMAT_FUNCTIONSrr
rr
ci|]G}t||jd+|jdd|HS)_-)callable__name__
startswithreplace).0fns  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/__init__.py
rsb666
||6K223776KS!!2666rdatareturnct5t|tdddn#1swxYwYtdt|dS)z~Validate the given ``data`` object using JSON Schema
    This function raises ``ValidationError`` if ``data`` is invalid.
    )custom_formatsNc||S)N)accrs  rzvalidate..!s22c77rT)r		_validaterrr)rs rrrs
		99$'78888999999999999999
""$5t<<<4s266N)	functoolsrtypingrrrrerror_reportingr	r
extra_validationsrfastjsonschema_exceptionsrr
fastjsonschema_validationsrr$__all____dict__valuesrstrbool__annotations__r!rrr2s/&&&&&&&&&&========000000TTTTTTTT======66%%''666$sHcUD[11234rPK!
rPconfig/_validate_pyproject/__pycache__/fastjsonschema_exceptions.cpython-311.pycnu[

,ReLddlZejdZGddeZGddeZGddeZdS)	Nz	[\.\[\]]+ceZdZdZdS)JsonSchemaExceptionz7
    Base exception of ``fastjsonschema`` library.
    N__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.pyrrrrcPeZdZdZdfd	ZedZedZxZS)JsonSchemaValueExceptiona
    Exception raised by validation function. Available properties:

     * ``message`` containing human-readable information what is wrong (e.g. ``data.property[index] must be smaller than or equal to 42``),
     * invalid ``value`` (e.g. ``60``),
     * ``name`` of a path in the data structure (e.g. ``data.property[index]``),
     * ``path`` as an array in the data structure (e.g. ``['data', 'property', 'index']``),
     * the whole ``definition`` which the ``value`` has to fulfil (e.g. ``{'type': 'number', 'maximum': 42}``),
     * ``rule`` which the ``value`` is breaking (e.g. ``maximum``)
     * and ``rule_definition`` (e.g. ``42``).

    .. versionchanged:: 2.14.0
        Added all extra properties.
    Nct|||_||_||_||_||_dSN)super__init__messagevaluename
definitionrule)selfrrrrr	__class__s      rrz!JsonSchemaValueException.__init__sB
!!!
	$			rcTdt|jDS)Ncg|]
}|dk|S)r
).0items  r
z1JsonSchemaValueException.path..'sIIIdbjjjjjr)SPLIT_REsplitrrs rpathzJsonSchemaValueException.path%s$II	!:!:IIIIrc`|jr|jsdS|j|jSr)rrgetr#s rrule_definitionz(JsonSchemaValueException.rule_definition)s2y		4""49---r)NNNN)	rrrr	rpropertyr$r'
__classcell__)rs@rrr
s

JJXJ..X.....rrceZdZdZdS)JsonSchemaDefinitionExceptionz?
    Exception raised by generator of validation function.
    Nrr
rrr+r+0r
rr+)recompiler!
ValueErrorrrr+r
rrr/s				2:l##* . . . . .2 . . .F$7rPK!ֿQconfig/_validate_pyproject/__pycache__/fastjsonschema_validations.cpython-311.pycnu[

,ReL6dZddlZddlmZejdejdejdejdd	ZedZidfd
ZidfdZ	idfdZ
idfd
ZidfdZidfdZ
idfdZidfdZidfdZidfdZidfdZdS)z2.15.3N)JsonSchemaValueException^.*$.+^.+$z^[^@]+@[^@]+\.[^@]+\Z)rrridn-email_re_patternc2t|||pddz|S)Ndata)[validate_https___packaging_python_org_en_latest_specifications_declaring_build_dependenciesr
custom_formatsname_prefixs   /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.pyvalidatersE_`dftxCxMGMQSwSTTTKc&!t|tstd|pdzdz|d|pdzdzdddgddd	dd
d	dgdd
diddddddddgddddddgddddddgdidddd dd!dd"d#dd$dd%d&gd'd(gd)dgd*d'dd+d,dd-d.gd'id,gd/d0dd1d2id0gd/gid3dgd4d5d6id3gd/gd7gd8d9dd:d;dd?d,dd@dAgd'id,gd/d0dgdBd'id0gd/gdCdDddEdFigdGdHdIddEdFidJdKgdHdLdd
didMdNdOdddPdQdRdSdTgdHdUddVd	dWddXdYidZd[d\d]d^gd_d`d\gdad_dbgdcdddeid	dWdEd\iidfdgddhdEdiidjdkddlddd id	dWddEdiidmidndoddpdqgdrgdsiddgd	dogdodtd!idugdvidwgdxdyd!gdzgd{dFd|d}ddd~dgd'ddddRddd\ddgddddid	dWdddgdddiddidddddddddddgdddddd2idd
diidddddgddd	iddd
didmdddgddd dYddddgddd dYddddddddd
didddddgdd
diddgddddddYddEdigd8dgddd	ddddidtdigidd
diiddgddd	ddddidtdigiddd
didmiddgddddgd¢dd	ddddidtdigiddd
didmiddddddYddŜddddddYdddgdʢdddd
didmid˜dgd͢dddddYid˜ddd
diddggdҢddԜdoddd	ddgdEdidEdigd8dEdidEdidEdidEdiddddid	ddEdiidۜdEdidd3d
diiigd,gdݜdޜdߜddddd	d,dd
didd
didmgiid,gdddddgdd	dd
diidgddddd	ddddgd	ddd
diddddgd
diddddgd
diddddgd'ddidddddddddddgdidddd dd!dd"d#dd$dd%d&gd'd(gd)dgd*d'dd+d,dd-d.gd'id,gd/d0dd1d2id0gd/gid3dgd4d5d6id3gd/gd7gd8d9dd:d;dd?d,dd@dAgd'id,gd/d0dgdBd'id0gd/gdCdDddEdFigdGdHdIddEdFidJdKgdHdLdd
didMdNdOdddPdQdRdSdTgdHdUddVd	dWddXdYidZd[d\d]d^gd_d`d\gdad_dbgdcdddeid	dWdEd\iidfdgddhdEdiidjdkddlddd id	dWddEdiidmidndoddpdqgdrgdsiddgd	dogdodtd!idugdvidwgdxdyd!gdzgd{dFd|d}ddd~dgd'ddddRddd\ddgddddid	dWdddgdddiddiddddddddd
t|t}|r%t|}d|vry|d|dttsDtd|pdzdzd|pdzdzdd
d	dgdd
diddddddddgddddddgdd
tt}|rt
}tfddDsFtd|pdzdzd|pdzdzdd
d	dgdd
diddddddddgddddddgddt}d|vr|dd}t|ttfs.td|pdzdz|d|pdzdzdgdd
didd
t|ttf}	|	rt
|}
t|D]y\}}t|ts_td|pdzdjditzdz|d|pdzdjditzdzd
did
zd|vr|dd}
t|
ts*td|pdzd	z|
d|pdzd
zddddd
t|
tr;|d|
s*td|pdzdz|
d|pdzd
zddddddd|vr!|dd}t|ttfs/td|pdzd
z|d|pdzdzdddgddddd
t|ttf}|rt
|}t|D]z\}}t|ts`td|pdzdjditzdz|d|pdzdjditzdzdddd
{|rZtd|pdzdzt|zdzd|pdzdzdd
d	dgdd
diddddddddgddddddgddd|vr6|d|d}t|||pddzd|vr|d|d}t|tstd|pdzdz|d|pdzdzddddgdddddd2idd
diidddddgddd	iddd
didmdddgddd dYddddgddd dYddddddddd
didddddgdd
diddgddddddYddEdigd8dgddd	ddddidtdigidd
diiddgddd	ddddidtdigiddd
didmiddgddddgd¢dd	ddddidtdigiddd
didmiddddddYddŜddddddYdddgdʢdddd
didmid˜dgd͢dddddYid˜ddd
diddggdҢddԜdoddd	ddgdEdidEdigd8dEdidEdidEdidEdiddddid	ddEdiidۜdEdidd3d
diiigd,gdݜdޜdߜddddd	d,dd
didd
didmgiid,gdddddgdd	dd
diidgddddd	ddddgd	ddd
diddddgd
diddddgd
diddddgd'ddidddddd
t|t}|rt|}d|vr6|d|d}t|||pddzd|vr6|d|d}t!|||pddz|rtd|pdzdzt|zdz|d|pdzdzdddgddd	dd
d	dgdd
diddddddddgddddddgddddddgdidddd dd!dd"d#dd$dd%d&gd'd(gd)dgd*d'dd+d,dd-d.gd'id,gd/d0dd1d2id0gd/gid3dgd4d5d6id3gd/gd7gd8d9dd:d;dd?d,dd@dAgd'id,gd/d0dgdBd'id0gd/gdCdDddEdFigdGdHdIddEdFidJdKgdHdLdd
didMdNdOdddPdQdRdSdTgdHdUddVd	dWddXdYidZd[d\d]d^gd_d`d\gdad_dbgdcdddeid	dWdEd\iidfdgddhdEdiidjdkddlddd id	dWddEdiidmidndoddpdqgdrgdsiddgd	dogdodtd!idugdvidwgdxdyd!gdzgd{dFd|d}ddd~dgd'ddddRddd\ddgddddid	dWdddgdddiddidddddddddddgdddddd2idd
diidddddgddd	iddd
didmdddgddd dYddddgddd dYddddddddd
didddddgdd
diddgddddddYddEdigd8dgddd	ddddidtdigidd
diiddgddd	ddddidtdigiddd
didmiddgddddgd¢dd	ddddidtdigiddd
didmiddddddYddŜddddddYdddgdʢdddd
didmid˜dgd͢dddddYid˜ddd
diddggdҢddԜdoddd	ddgdEdidEdigd8dEdidEdidEdidEdiddddid	ddEdiidۜdEdidd3d
diiigd,gdݜdޜdߜddddd	d,dd
didd
didmgiid,gdddddgdd	dd
diidgddddd	ddddgd	ddd
diddddgd
diddddgd
diddddgd'ddidddddddddddgdidddd dd!dd"d#dd$dd%d&gd'd(gd)dgd*d'dd+d,dd-d.gd'id,gd/d0dd1d2id0gd/gid3dgd4d5d6id3gd/gd7gd8d9dd:d;dd?d,dd@dAgd'id,gd/d0dgdBd'id0gd/gdCdDddEdFigdGdHdIddEdFidJdKgdHdLdd
didMdNdOdddPdQdRdSdTgdHdUddVd	dWddXdYidZd[d\d]d^gd_d`d\gdad_dbgdcdddeid	dWdEd\iidfdgddhdEdiidjdkddlddd id	dWddEdiidmidndoddpdqgdrgdsiddgd	dogdodtd!idugdvidwgdxdyd!gdzgd{dFd|d}ddd~dgd'ddddRddd\ddgddddid	dWdddgdddiddiddddddddd|S(Nrr
 must be object&http://json-schema.org/draft-07/schemazShttps://packaging.python.org/en/latest/specifications/declaring-build-dependencies/z+Data structure for ``pyproject.toml`` files)zKFile format containing build-time configurations for the Python ecosystem. zO:pep:`517` initially defined a build-system independent format for source treeszQwhich was complemented by :pep:`518` to provide a way of specifying dependencies zfor building Python projects.zYPlease notice the ``project`` table (as initially defined in  :pep:`621`) is not includedz3in this schema and should be considered separately.objectFz&Table used to store build-related dataarray)zKList of dependencies in the :pep:`508` format required to execute the buildz9system. Please notice that the resulting dependency graphz**MUST NOT contain cycles**typestringr
$$descriptionitemszLPython object that will be used to perform the build according to :pep:`517`zpep517-backend-referencerdescriptionformatzDList of directories to be prepended to ``sys.path`` when loading thezback-end, and running its hooksz0Should be a path (TODO: enforce it with format?))r$comment)requires
build-backendbackend-pathr!)rradditionalProperties
propertiesrequiredQhttps://packaging.python.org/en/latest/specifications/declaring-project-metadata/0Package metadata stored in the ``project`` tableBData structure for the **project** table inside ``pyproject.toml``$(as initially defined in :pep:`621`)nameIThe name (primary identifier) of the project. MUST be statically defined.pep508-identifierversion6The version of the project as supported by :pep:`440`.pep440r'The `summary description of the projectF`_rrreadmezA`Full/detailed description of the project in the form of a READMEz4`_zGwith meaning similar to the one defined in `core metadata's DescriptionzJ`_zDRelative path to a text file (UTF-8) containing the full descriptionzDof the project. If the file path ends in case-insensitive ``.md`` orz8``.rst`` suffixes, then the content-type is respectivelyz#``text/markdown`` or ``text/x-rst``anyOffile(e.g. ``text/markdown``). The ``charset`` parameter is assumedzUTF-8 when not present."TODO: add regex pattern or format?rrr rallOfroneOfrequires-pythonpep508-versionspec/`The Python version requirements of the projectO`_.rrrlicenseG`Project license `_.DRelative path to the file (UTF-8) which contains the license for theproject.z7The license of the project whose meaning is that of thez%`License field from the core metadatazG`_.rrFauthors$ref#/definitions/authorzJThe people or organizations considered to be the 'authors' of the project.zNThe exact meaning is open to interpretation (e.g. original or primary authors,z/current maintainers, or owners of the package).rrrmaintainersNThe people or organizations considered to be the 'maintainers' of the project.FSimilarly to ``authors``, the exact meaning is open to interpretation.keywordsNList of keywords to assist searching for the distribution in a larger catalog.rrrclassifierstrove-classifier3`PyPI classifier `_.rrr4`Trove classifiers `_which apply to the project.urls@URLs associated with the project in the form ``label => value``.rurlrrrrr$patternPropertiesscripts#/definitions/entry-point-groupzDInstruct the installer to create command-line wrappers for the givenL`entry points `_.)rSrgui-scripts)z;Instruct the installer to create GUI wrappers for the givenrkzJThe difference between ``scripts`` and ``gui-scripts`` is only relevant inzWindows.entry-pointsz@Instruct the installer to expose the given modules/functions viaz9``entry-point`` discovery mechanism (useful for plugins).z9More information available in the `Python packaging guidez>`_.rpython-entrypoint-groupr
propertyNamesr$rhdependencies!Project (mandatory) dependencies.#/definitions/dependencyrrroptional-dependencies#Optional dependency for the projectrrrrrqr$rhdynamicGSpecifies which fields are intentionally unspecified and expected to be#dynamically provided by build toolsenumr.rr4rGrLrRrWrZr]rcrirlrmrrrvconst version is listed in ``dynamic``containsrr&r%	zAccording to :pep:`621`:zH    If the core metadata specification lists a field as "Required", thenzH    the metadata MUST specify the field statically or list it in dynamicz"In turn, `core metadata`_ defines:z=    The required fields are: Metadata-Version, Name, Version.z&    All the other fields are optional.zISince ``Metadata-Version`` is defined by the build back-end, ``name`` andzE``version`` are the only mandatory information in ``pyproject.toml``.zM.. _core metadata: https://packaging.python.org/specifications/core-metadata/notz	$$comment=version should be statically defined in the ``version`` fieldr&rAuthor or Maintainer=https://www.python.org/dev/peps/pep-0621/#authors-maintainersIMUST be a valid email name, i.e. whatever can be put as a name, before anemail, in :rfc:`822`.	idn-emailMUST be a valid email addressr+email$idtitler rr%Entry-pointszLEntry-points are grouped together to indicate what sort of capabilities theyzprovide.zSee the `packaging guidesz=`_zand `setuptools docszC`_zfor more information.python-entrypoint-name6Reference to a Python object. It is either in the form<``importable.module``, or ``importable.module:object.attr``.python-entrypoint-reference9https://packaging.python.org/specifications/entry-points/rrrr rrrrrqr$rh
Dependency5Project dependency specification according to PEP 508pep508rrrrrauthorzentry-point-group
dependency$schemarrrrr%r&r$ifthendefinitions"https://docs.python.org/3/install/``tool.distutils`` tablezGOriginally, ``distutils`` allowed developers to configure arguments forz7``setup.py`` scripts via `distutils configuration fileszE`_.z@``tool.distutils`` subtables could be used with the same purposez(NOT CURRENTLY IMPLEMENTED).global4Global options applied to all ``distutils`` commandsrCTODO: Is there a practical way of making this schema more specific?rrrrrr%rhr =https://setuptools.pypa.io/en/latest/references/keywords.html``tool.setuptools`` tablezLPlease notice for the time being the ``setuptools`` project does not specifyz3a way of configuring builds via ``pyproject.toml``.zMTherefore this schema should be taken just as a *"thought experiment"* on howz@this *might be done*, by following the principles established inzO`ini2toml `_.z,It considers only ``setuptools`` `parameterszJ`_zTthat can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`zGbut intentionally excludes ``dependency_links`` and ``setup_requires``.zINOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion withz2entry-point based scripts (defined in :pep:`621`).	platformsprovides?Package and virtual package names contained within this package**(not supported by pip)**rrr	obsoletes,Packages which this package renders obsoletezip-safeDWhether the project can be safely installed and run from a zip file.booleanrrscript-files`_.*include-package-datazCAutomatically include any data files inside the package directoriesz%that are specified by ``MANIFEST.in``rrrrexclude-package-datazLMapping from package names to lists of glob patterns that should be excludedrrnamespace-packagesEhttps://setuptools.pypa.io/en/latest/userguide/package_discovery.htmlrrr 
py-modules'Modules that setuptools will manipulate0TODO: clarify the relationship with ``packages``
data-fileszM**DEPRECATED**: dict-like structure where each key represents a directory andzFthe value is a list of glob patterns that should be installed in them.zBPlease notice this don't work with wheels. See `data files supportzA`_rrrhcmdclasszMMapping of distutils-style command names to ``setuptools.Command`` subclasseszJwhich in turn should be represented by strings with a qualified class namez+(i.e., "dotted" form with module), e.g.::

z;    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}

zFThe command class should be a directly defined at the top-level of thez%containing module (no class nesting).python-qualified-identifier
license-filesKPROVISIONAL: List of glob patterns for all license files being distributed.%(might become standard with PEP 639).zLICEN[CS]E*z	 COPYING*z NOTICE*zAUTHORS*HTODO: revise if PEP 639 is accepted. Probably ``project.license-files``?rrrdefaultr @Instructions for loading :pep:`621`-related metadata dynamicallyBA version dynamically loaded via either the ``attr:`` or ``file:``Mdirectives. Please make sure the given file or attribute respects :pep:`440`.#/definitions/attr-directive#/definitions/file-directivepython-identifierrrqr$rhr%r7r&r.r]rrrrmrvr4rrr$r%'file:' directiveBValue is read from a file (or list of files and then concatenated)rrrrr$r%r&'attr:' directiveHValue is read from a module attribute. Supports callables and iterables;(unsupported types are cast via ``str()``attrrrrrr$r%r&'find:' directivefindDynamic `package discoveryJ`_.BDirectories to be searched for packages (Unix-style relative path)rrrznvalidate_https___packaging_python_org_en_latest_specifications_declaring_build_dependencies..-s)NN4#44NNNNNNr)r!z2.build-system must contain ['requires'] propertiesr&z$.build-system.requires must be arrayz.build-system.requiresz7.build-system.requires[{data__buildsystem__requires_x}] must be stringr"z*.build-system.build-backend must be stringz.build-system.build-backendz<.build-system.build-backend must be pep517-backend-referencer#z(.build-system.backend-path must be arrayz.build-system.backend-pathz>.build-system.backend-path[{data__buildsystem__backendpath_x}]z.build-system must not contain  propertiesr$rz.projectrz.tool must be objectz.toolrz.tool.distutilsrz.tool.setuptools must not contain r)
isinstancedictrsetkeysremovelenalllisttuple	enumeratestrrlocalsYvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata*validate_https___docs_python_org_3_installFvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html)r
rrdata_is_dict	data_keysdata__buildsystem_is_dictdata__buildsystem_lendata__buildsystem_keysdata__buildsystem__requires#data__buildsystem__requires_is_listdata__buildsystem__requires_lendata__buildsystem__requires_x data__buildsystem__requires_itemdata__buildsystem__buildbackenddata__buildsystem__backendpath&data__buildsystem__backendpath_is_list"data__buildsystem__backendpath_len data__buildsystem__backendpath_x#data__buildsystem__backendpath_item
data__project
data__tooldata__tool_is_dictdata__tool_keysdata__tool__distutilsdata__tool__setuptoolsrs                         @rrrs;idT##Hu&r[-BF'CFW'W_cjlp{qF@FkGJLkLeMVkvcvbvbvbltN
S
}
EV~X]CJ]H]H]HTZ\dSezfzfBJ[iuOyPyPkrFLNoEpDLZL{M{MbNbNmOmO^h]it
jt
jCktGRDX\^D WE O W g kuh n y A!R!]"i"|"p }"p }"g ku"H#S#[#l#d$p$x$J#y$J#y$g ku{$H%S%[%o%X&Z&b'n%c'J%d'J%d'g kuf'n'B(X,B(X,B(X,m,u,H-{0H-{0H-{0d,|0d,|0G1O1\1c1v1|1G2O2c2a3c3t3b2u3~1v3~1v3u1w3F4L4E4M4f1N4f1N4`4f4q4y4J5m5h4n5h4n5_4o5~5D6}5E6P4F6P4F6e1G6[1H6Z6h6s6{6N7a9N7a9N7a9o9S:j6T:j6T:Y6U:d:r:c:s:J6t:J6t:Z1u:~0v:~0v:c,w:p'x:p'x:g kuz:K;V;^;j;~;RQM;X>M;X>g kuZ>c>u>~?Z@`@k@s@GAMBOBYBFAZBb@[Bb@[BY@\BkBqBjBrBJ@sBJ@sBECKCVC^CqC`FqC`FqC`FMCaFMCaFDCbFqFwFpFxFuByFuByFI@zFe>{Fe>{Fg ku}FFGQGXGdGjGlGBHcGCHVHiKVHiKVHiKHGjKHGjKg kulKyKDLKLWL]L_LuLVLvLJMZN\NdOIMeO{KfO{KfOg kuhOrO}ODPPPVPXP`POPaPrPBRtOCRtOCRg kuERRR]RdRxR@SLS^SoSdToReToReTyToUqUNVxTOVTRPVTRPVg kuRVXVcVkV|V~WXX]XuX{XFYNYZY_Y}X`Y}X`YtXaYZVbYZVbYg kudYmYxYYZmZs[u[C]lZD]oYE]oYE]g kuG]T]_]@^S^|aS^|aS^|aV]}aV]}ag kuaMbabafabafabafuf}ffXgtfYgsgxgPhVhYh_hahBiXhCiOhDiObEiObEig kuGiUi`igixi[jgjmjojIkfjJkWiKkWiKkg kuMkdkokwkHlmlAmImKm^m@m_mym~mVn\ngnnnzn@oBo\oyn]o^n^o^n^oUn_ofk`ofk`og kubokovo}oQpZq\qArPpBrNrTrVrhuVrhuVrhuMriumojumojug kuzu@vyuAv[v`v~vGw}vHwYwbwrwyw{wDxqwExYx{xXx|xdw}xdw}xXw~xpvxpvxNyzANyzANyzAhv{Ahv{ASB\BRB]BqBpCpBqCEBrCEBrCVDlDwDME[EZFdFlFNGVGjGuHwHNIiGOIEGPIEGPIdIlIxICJTJsJ[ItJ[ItJ|FuJ|FuJNDvJNDvJUKvKALOLYLaLtLfQtLfQtLfQzQBRDR\RyQ]RwR|RTSZSeSmSATyT{TyU@TzUFVcVqVlW\SmW\SmWSSnWMKoWMKoWGXaXlXxXBYJY[YRZ^ZfZWgZWgZCDhZCDhZwiZwiZ|ZD[n[V\_\C]N]h]{]nb{]nb{]nbxb@cQcYcdclc}csd[ctd[ctdPcudMeQeTeZe\edeSeeeLefeteyfb[zfb[zfVg~gGhFiQiliiRviRviRv\vdv~vCwSwtXTw_wjwqw}wCxExMx|wNxawOxawOxSwtXQx[xpxqysyOzoxPzZzazuz}zI{\{lz]{lz]{]x^{]x^{SwtX`{k{@|n|p|L}{M}W}^}r}z}F~Y~i}Z~i}Z~m{[~m{[~SwtX]~g~y~I@R@i~S@i~S@SwtXU@c@u@sA}ADBPBVBXB`BOBaBoBbCe@cCe@cCSwtXeCvCKDSEUESFJDTF^FeFqFwFyFAGpFBGxCCGxCCGSwtXEGOGcGOOcGOOcGOOeOJPTP[PoPwPCQWQfPXQfPXQ[OYQ[OYQ\QbQdQBR[QCRZODRQGERQGERSwtXGRTRhR[VhR[VhR[VeVmVGWLW`WgWkWsWuWIXjWJXMXTXVXXXLXYXiWZX_W[XsXyX|XBYDYLY{XMYrXNYVROYVROYSwtXQY_YsYS^sYS^sYS^]^e^^D_X___c_k_m_A`b_B`E`L`N`Q`D`R`a_S`W_T`l`r`}`DaPaVaXa`aOaaat`bat`bak`caaYdaaYdaSwtXfa|aPbWfPbWfPbWfafjf~akf~akfSwtXmfCgWg~jWg~jWg~jHkPkjkokClJlNlVlXlllMlmlplwlyl|lol}lLl~lBllWm]mhmom{mAnCnKnzmLn_mMn_mMnVmNnEgOnEgOnSwtXQnenpnwnKoSo_osoBotoBotoBpIqgnJqgnJqSwtXLqXqjqSr]rdrxr@sLs`sorasorasosatZqbtZqbtSwtXdtptDujyDujyDujyty|yTzZzezlzxz~z@{H{wzI{\zJ{\zJ{SzK{rtL{rtL{SwtXN{X{l{pAl{pAl{pAzABBZB`BkBsBB\CbB]CbB]CYB^CZ{_CZ{_CSwtXaCpC{CBDNDTDVD^DMD_DsD@FBFiFrDjFwFkGwFkGwFkGyGCIrCDIrCDISwtXFIOIZIbIsIuJOKTKCLGMIMXNBLYNfNlNnNLOeNMOPOVOXOvOOOwOdNxOpKyOpKyOKPQPSPqPJPrPDQJQLQjQCQkQ~QDRFRdR}QeRxR~R@S^SwR_SCTKT_TgTiT|T^T}TWU\UtUxU{UAVCVaVzUbVsUcVzSdVzSdV|VBWDWbW{VcWfWrWuWCXFXLXNXVXEXWXtWXXeWYXzVZXiXoXhXpXpVqXpVqXdKrXdKrXQIsXQIsXSwtX`Y~YIZ\ZmZq[{[C\]\b\s\y\|\C]G]M]O]W]F]X]c]j]v]|]~]F^u]G^Z]H^Z]H^E]I^{\J^r\K^Z^`^Y^a^XYb^XYb^@_S_\_z_N`XaZaDbM`EbObWbqbvbGcMcPcVcXc`cOcacFcbcqcwcpcxcv^ycv^ycUdsd~dQe[ece}eBfSfYfdflf@g\g^gjhfkhEiJitixjBkIkUk[k]kekTkfkdigkdigk}kDlXlVmXmPnWlQn]ncnenmn\nnntkontkonEoLo`odpfp^q_o_qkqqqsq{qjq|q|n}q|n}qVr_rsrxszsotrrptMrqtMrqtZirtZirt[fst[fstRfttMdutMdutEYvtEYvtJgwtJgwtT[xtT[xtsZytsZytc
ztc
ztSu{uDvWwbwTxhxlynyTzgxUz_zgzwz{Oxz~zI{Q{b{m|y|L}@{M}@{M}wz{OO}X}c}k}|}t~@HZ}IZ}Iwz{OKXckh@j@rA~sAZtAZtAwz{OvA~ARBhFRBhFRBhF}FEGXGKKXGKKXGKKtFLKtFLKWK_KlKsKFLLLWL_LsLqMsMDNrLENNLFNNLFNELGNVN\NUN]NvK^NvK^NpNvNAOIOZO}OxN~OxN~OoNONPTPMPUP`NVP`NVPuKWPkKXPjPxPCQKQ^QqS^QqS^QqSScTzPdTzPdTiPeTtTBUsTCUZPDUZPDUjKEUNKFUNKFUsFGU@BHU@BHUwz{OJU[UfUnUzUNVbVSWUWfXaVgX]UhX]UhXwz{OjXsXEYNZjZpZ{ZC[W[]\_\i\V[j\rZk\rZk\iZl\{\A]z\B]ZZC]ZZC]U][]f]n]A^p`A^p`A^p`]]q`]]q`T]r`AaGa@aHaE]IaE]IaYZJauXKauXKawz{OMaVaaahataza|aRbsaSbfbyefbyefbyeXazeXazewz{O|eIfTf[fgfmfofEgffFgZgjhlhtiYguiKfviKfviwz{OxiBjMjTj`jfjhjpj_jqjBkRlDjSlDjSlwz{OUlblmltlHmPm\mnmmtnlunlunIooAp^pHo_pdl`pdl`pwz{Obphpsp{pLqNrhrmrEsKsVs^sjsosMspsMspsDsqsjprsjprswz{Ots}sHtit}tCvEvSw|tTwsUwsUwwz{OWwdwowPxcxL|cxL|cxL|fwM|fwM|wz{OO|]|q|q@q|q@q|q@EAMAOAhADAiACBHB`BfBiBoBqBRChBSC_BTC_|UC_|UCwz{OWCeCpCwCHDkDwD}DDYEvDZEgC[EgC[Ewz{O]EtEEGFXF}FQGYG[GnGPGoGIHNHfHlHwH~HJIPIRIlIIImInHnInHnIeHoIvEpIvEpIwz{OrI{IFJMJaJjKlKQL`JRL^LdLfLxOfLxOfLxO]LyO}IzO}IzOwz{OJPPPIPQPkPpPNQWQMQXQiQrQBRIRKRTRARURiRKShRLStQMStQMShQNS@QOS@QOS^SJ\^SJ\^SJ\xPK\xPK\c\l\b\m\A]@^@]A^U\B^U\B^f^|^G_]_k_j`t`|`^afazaEcGc^cya_cUa`cUa`ctc|cHdSdddCekcDekcDeLaEeLaEe^^Fe^^FeeeFfQf_fifqfDgvkDgvkDgvkJlRlTlllIlmlGmLmdmjmum}mQnIoKoIpPnJpVpspAq|qlm}qlm}qcm~q]eq]eqWrqr|rHsRsZsksbtntvtOrwtOrwtS^xtS^xtGuytGuytYztYztAuGuHuHuHu	HudD))LB|u		$$	Y&&^,,, $^ 4/$88
L.r[5JF/KNl/luFMOS^ShbhMil{M{QYjRlqW^q\q\q\hnpxgyNzNzV	^	o	}
IcM	dM	dFZ`
b
CYDX`n`OaOavbvbAcAcr|q}H~H~EKLLLL(23Dd(K(K%($
M(+,=(>(>%NNNNNNNNNj229N3OSG4GO`gimxmB|BgCFUgUksDlFKqxKvKvKvB	H	J	R	A	S	hT	hT	p	x	I
Wc}g	~g	~Y`tz
|
]s^rzHzi{i{P|P|[}[}LVKWbXbX_ijjjj),->-C-C-E-E)F)F&!777*11*===2CJ2O/%&AD%=QQe6r[=RF7SV|7|E`gimxmB|BgCF^g^t{NyNyNyEKMUDVkWkW^deeee:DE`cginbo:p:p7:K:=>Y:Z:Z7_hjE`F`FKK[9;[#-.NQT#V#VK&>r[EZTZ?[___X___k_kbhbjbj_k_k@kn@GgnpttICInJMMMFMMMYMYPVPXPXMYMYnY\^n^lrt|k}DJ'K'K'K!KK"&<<<*11/BBB6G6X3%&EMM_6r[=RF7SWC8CKjqswBwLFLqMPmqmCK\jvPzQzQX^____!"A3GGwI~.HIJijjw":2AVPV;W[Ya#-.QTW#Y#Y\&>r[EZTZ?[_f___f_r_rioiqiq_r_r@ruF@FNqxz~I~SMSxTW^WWW^WjWjagaiaiWjWjxjmoxoEM[M|N|NU['\'\'\!\\)M229N3ORs3stwyOuPuP4PQ^4^fw~@DODYSY~Z]l~lBJ[C]bHObM	bM	bM	Y	_	a	i	X	j	k	k	G
O
`
nzT~	U~	UpwK
QStJ
uIQ_Q@R@RgSgSrTrTcmbnyoyovLMMMM	!!Y''' OMefsvDGRG\V\`jFj
k
k
kYV$$$fJj411
E].r[5JF/KNd/dlv}DODYSY~Z]d~dzBlT]ALfyl
yl
yl
v
~
OWbj{qYrYrNsK
O
R
X
Z
b
Q
c
J
d
r
w`x`xT|EDOj}P}P}PZb|AQr@R]ho{A C K zL _M _M Qr@O Y n o!q!M"m N"X"_"s"{"G#Z#j"[#j"[#[ \#[ \#Qr@^#i#~#l$n$J%}#K%U%\%p%x%D&W&g%X&g%X&k#Y&k#Y&Qr@[&e&w&}'G(P(g&Q(g&Q(Qr@S(a(s(q){)B*N*T*V*^*M*_*m*`+c(a+c(a+Qr@c+t+I,Q-S-Q.H,R.\.c.o.u.w..n.@/v+A/v+A/Qr@C/M/a/M7a/M7a/M7c7H8R8Y8m8u8A9U9d8V9d8V9Y7W9Y7W9Z9`9b9@:Y9A:X7B:O/C:O/C:Qr@E:R:f:Y>f:Y>f:Y>c>k>E?J?^?e?i?q?s?G@h?H@K@R@T@V@J@W@g?X@]?Y@q@w@z@@ABAJAy@KAp@LAT:MAT:MAQr@OA]AqAQFqAQFqAQF[FcF}FBGVG]GaGiGkGG`G@HCHJHLHOHBHPH_GQHUGRHjHpH{HBINITIVI^IMI_IrH`IrH`IiHaI_AbI_AbIQr@dIzINJUNNJUNNJUN_NhN|IiN|IiNQr@kNAOUO|RUO|RUO|RFSNShSmSATHTLTTTVTjTKTkTnTuTwTzTmT{TJT|T@T}TUU[UfUmUyUUAVIVxUJV]UKV]UKVTULVCOMVCOMVQr@OVcVnVuVIWQW]WqW@WrW@WrW@XGYeVHYeVHYQr@JYVYhYQZ[ZbZvZ~ZJ[^[mZ_[mZ_[m[_\XY`\XY`\Qr@b\n\B]haB]haB]harazaRbXbcbjbvb|b~bFcubGcZbHcZbHcQbIcp\Jcp\JcQr@LcVcjcnijcnijcnixi@jXj^jijqj}jZk`j[k`j[kWj\kXc]kXc]kQr@_knkyk@lLlRlTl\lKl]lql~m@ngnplhnuniouniouniowoAqpkBqpkBqQr@DqMqXq`qqqsrMsRsAtEuGuVv@tWvdvjvlvJwcvKwNwTwVwtwMwuwbvvwnswwnswwIxOxQxoxHxpxByHyJyhyAyiy|yBzDzbz{yczvz|z~z\{uz]{A|I|]|e|g|z|\|{|U}Z}r}v}y}}A~_~x}`~q}a~x{b~x{b~z~@B`y~adpsA@D@J@L@T@C@U@rV@cW@x~X@g@m@f@n@n~o@n~o@bsp@bsp@Oqq@Oqq@Qr@^A|AGBZBkBoCyCAD[D`DqDwDzDAEEEKEMEUEDEVEaEhEtEzE|EDFsEEFXEFFXEFFCEGFyDHFpDIFXF^FWF_FVA`FVA`F~FQGZGxGLHVIXIBJKHCJMJUJoJtJEKKKNKTKVK^KMK_KDK`KoKuKnKvKtFwKtFwKSLqL|LOMYMaM{M@NQNWNbNjN~NZO\OhP}NiPCQHQrQvR@SGSSSYS[ScSRSdSbQeSbQeS{SBTVTTUVUNVUTOV[VaVcVkVZVlVrSmVrSmVCWJW^WbXdX\Y]W]YiYoYqYyYhYzYzV{YzV{YTZ]ZqZv[x[m\pZn\KZo\KZo\XQp\XQp\YNq\YNq\PNr\KLs\KLs\CAt\CAt\Hu\Hu\Rv\Rv\qw\qw\~\D]E]E]E]E]!+J!=!=!	
q"%joo&7&7"8"8/11#**;777,6{,C)>?TVdgrg|v|ARgRSSS?22#**<888-7-E*Z[qtBEPEZTZ^pDpqqq	|u*21F+GJ^+^_bcl_m_m+mn{+{DHOQU`UjdjOknpOpIqzOZGZF
ZF
ZF
P
X
r
w
aizb|AgnAlAlAlx~@HwI^J^JfnMYs]t]tOVjprSiThp~p_q_qFrFrQsQsBLAMXNXNgOXkvh|@ B h {i s { K!OvL!R!]!e!v!A#M#`#T!a#T!a#K!Ovc#l#w##P$H%T%\%n#]%n#]%K!Ov_%l%w%%S&|&~&F(R&G(n%H(n%H(K!OvJ(R(f(|,f(|,f(|,Q-Y-l-_1l-_1l-_1H-`1H-`1k1s1@2G2Z2`2k2s2G3E4G4X4F3Y4b2Z4b2Z4Y2[4j4p4i4q4J2r4J2r4D5J5U5]5n5Q6L5R6L5R6C5S6b6h6a6i6t4j6t4j6I2k61l6~6L7W7_7r7E:r7E:r7E:S:w:N7x:N7x:}6y:H;V;G;W;n6X;n6X;~1Y;b1Z;b1Z;G-[;T(\;T(\;K!Ov^;o;z;B<Nu<{>q;|>q;|>K!Ov~>G?Y?b@~@DAOAWAkAqBsB}BjA~BFABFAB}@@COCUCNCVCn@WCn@WCiCoCzCBDUDDGUDDGUDDGqCEGqCEGhCFGUG[GTG\GYC]GYC]Gm@^GI?_GI?_GK!OvaGjGuG|GHHNHPHfHGHgHzHMLzHMLzHMLlGNLlGNLK!OvPL]LhLoL{LAMCMYMzLZMnM~N@OHPmMIP_LJP_LJPK!OvLPVPaPhPtPzP|PDQsPEQVQfRXPgRXPgRK!OviRvRASHS\SdSpSBTSTHUSSIUSSIU]USVUVrV\UsVxRtVxRtVK!OvvV|VGWOW`WbX|XAYYY_YjYrY~YCZaYDZaYDZXYEZ~VFZ~VFZK!OvHZQZ\Z}ZQ[W\Y\g]P[h]SZi]SZi]K!Ovk]x]C^d^w^`bw^`bw^`bz]abz]abK!OvcbqbEcEgEcEgEcEgYgagcg|gXg}gWh\hthzh}hCiEifi|hgishhisbiisbiiK!OvkiyiDjKj\jjKkQkSkmkJknk{iok{iokK!OvqkHlSl[lllQmemmmomBndmCn]nbnzn@oKoRo^odofo@p]oApBoBpBoBpynCpJlDpJlDpK!OvFpOpZpapup~q@rertpfrrrxrzrLvzrLvzrLvqrMvQpNvQpNvK!Ov^vdv]vevvDwbwkwawlw}wFxVx]x_xhxUxix}x_y|x`yHxayHxay|wbyTwcyTwcyry^Bry^Bry^BLw_BLw_BwB@CvBACUCTDTCUDiBVDiBVDzDPE[EqEE~FHGPGrGzGNHYI[IrIMHsIiGtIiGtIHJPJ\JgJxJWKIXKIXK`GYK`GYKrDZKrDZKyKZLeLsL}LEMXMJRXMJRXMJR^RfRhR@S]RAS[S`SxS~SITQTeT]U_U]VdT^VjVGWUWPX@TQX@TQXwSRXqKSXqKSXkXEYPY\YfYnYYvZB[J[cXK[cXK[gDL[gDL[[M[[M[`[h[R\z\C]g]r]L^_^Rc_^Rc_^Rc\cdcuc}cHdPdadWecXecXetcYeqeuexe~e@fHfweIfpeJfXf]gF\^gF\^gzgbhkhjiuiPjcjvvcjvvcjvv@wHwbwgwwwXYxwCxNxUxaxgxixqx`xrxExsxExsxwwXYuxxTyUzWzszSytz~zE{Y{a{m{@|P{A|P{A|AyB|AyB|wwXYD|O|d|R}T}p}c|q}{}B~V~^~j~}~M~~~M~~~Q|~Q|~wwXYAK]c@m@v@Mw@Mw@wwXYy@GAYAWBaBhBtBzB|BDCsBECSCFDIAGDIAGDwwXYIDZDoDwEyEwFnDxFBGIGUG[G]GeGTGfG\DgG\DgGwwXYiGsGGHsOGHsOGHsOIPnPxPPSQ[QgQ{QJQ|QJQ|QO}QO}Q@RFRHRfRQgR~OhRuGiRuGiRwwXYkRxRLSVLSVLSVIWQWkWpWDXKXOXWXYXmXNXnXqXxXzX|XpX}XMX~XCXXWY]Y`YfYhYpY_YqYVYrYzRsYzRsYwwXYuYCZWZw^WZw^WZw^A_I_c_h_|_C`G`O`Q`e`F`f`i`p`r`u`h`v`E`w`{_x`PaVaaahataza|aDbsaEbXaFbXaFbOaGbEZHbEZHbwwXYJb`btb{ftb{ftb{fEgNgbbOgbbOgwwXYQggg{gbk{gbk{gbklktkNlSlglnlrlzl|lPmqlQmTm[m]m`mSmamplbmflcm{mAnLnSn_nengnon^npnCnqnCnqnzmrnigsnigsnwwXYunIoTo[ooowoCpWpfoXpfoXpfpmqKonqKonqwwXYpq|qNrwrAsHs\sdspsDtSsEtSsEtStEu~qFu~qFuwwXYHuTuhuNzhuNzhuNzXz`zxz~zI{P{\{b{d{l{[{m{@{n{@{n{wzo{Vup{Vup{wwXYr{|{P|TBP|TBP|TB^BfB~BDCOCWCcC@DFCADFCAD}BBD~{CD~{CDwwXYEDTD_DfDrDxDzDBEqDCEWEdFfFMGVENG[GOH[GOH[GOH]HgIVDhIVDhIwwXYjIsI~IFJWJYKsKxKgLkMmM|NfL}NJOPOROpOIOqOtOzO|OZPsO[PHO\PTL]PTL]PoPuPwPUQnPVQhQnQpQNRgQORbRhRjRHSaRIS\SbSdSBT[SCTgToTCUKUMU`UBUaU{U@VXV\V_VeVgVEW^VFWWVGW^THW^THW`WfWhWFX_WGXJXVXYXgXjXpXrXzXiX{XXX|XIX}X^W~XMYSYLYTYTWUYTWUYHLVYHLVYuIWYuIWYwwXYDZbZmZ@[Q[U\_\g\A]F]W]]]`]g]k]q]s]{]j]|]G^N^Z^`^b^j^Y^k^~]l^~]l^i]m^_]n^V]o^~^D_}^E_|YF_|YF_d_w_@`^`r`|a~ahbq`ibsb{bUcZckcqctczc|cDdscEdjcFdUd[dTd\dZ_]dZ_]dydWebeueeGfafffwf}fHgPgdg@hBhNicgOiiiniXj\kfkmkykkAlIlxkJlHjKlHjKlalhl|lzm|mtn{lunAoGoIoQo@oRoXlSoXlSoiopoDpHqJqBrCpCrOrUrWr_rNr`r`oar`oarzrCsWs\t^tSuVsTuqrUuqrUu~iVu~iVufWufWuvfXuqdYuqdYuiYZuiYZung[ung[ux[\ux[\uW[]uW[]uG^uG^uwu_vhv{wFxxxLyPzRzxzKyyzC{K{[{_P\{b{m{u{F|Q}]}p}d{q}d{q}[{_Ps}|}G~O~`~Xdl~}m~}m[{_Po|G@O@c@LANAVBb@WB~XB~XB[{_PZBbBvBLGvBLGvBLGaGiG|GoK|GoK|GoKXGpKXGpK{KCLPLWLjLpL{LCMWMUNWNhNVMiNrLjNrLjNiLkNzN@OyNAOZLBOZLBOTOZOeOmO~OaP\ObP\ObPSOcPrPxPqPyPDOzPDOzPYL{POL|PNQ\QgQoQBRUTBRUTBRUTcTGU^QHU^QHUMQIUXUfUWUgU~PhU~PhUNLiUrKjUrKjUWGkUdBlUdBlU[{_PnUUJVRV^VrVFWwWyWJYEWKYAVLYAVLY[{_PNYWYiYrZN[T[_[g[{[A]C]M]z[N]V[O]V[O]M[P]_]e]^]f]~Zg]~Zg]y]]J^R^e^Tae^Tae^TaA^UaA^Uax]Vaeakadalai]mai]ma}ZnaYYoaYYoa[{_PqazaEbLbXb^b`bvbWbwbJc]fJc]fJc]f|a^f|a^f[{_P`fmfxffKgQgSgigJgjg~gNiPiXj}gYjofZjofZj[{_P\jfjqjxjDkJkLkTkCkUkfkvlhjwlhjwl[{_PylFmQmXmlmtm@nRncnXocmYocmYomocpepBqloCqHmDqHmDq[{_PFqLqWq_qpqrrLsQsisoszsBtNtStqsTtqsTthsUtNqVtNqVt[{_PXtatltMuaugvivww`uxwctywctyw[{_P{wHxSxtxGyp|Gyp|Gyp|Jxq|Jxq|[{_Ps|A}U}UAU}UAU}UAiAqAsALBhAMBgBlBDCJCMCSCUCvCLCwCCCxCC}yCC}yC[{_P{CIDTD[DlDOE[EaEcE}EZE~EKDEKDE[{_PAFXFcFkF|FaGuG}GGRHtGSHmHrHJIPI[IbInItIvIPJmIQJRIRJRIRJIISJZFTJZFTJ[{_PVJ_JjJqJEKNLPLuLDKvLBMHMJM\PJM\PJM\PAM]PaJ^PaJ^P[{_PnPtPmPuPOQTQrQ{QqQ|QMRVRfRmRoRxReRyRMSoSLSpSXRqSXRqSLRrSdQsSdQsSBTn\BTn\BTn\\Qo\\Qo\G]P]F]Q]e]d^d]e^y\f^y\f^J_`_k_A`O`NaXa`aBbJb^bickcBd]bCdyaDdyaDdXd`dldwdHegeOdheOdhepaiepaieB_jeB_jeIfjfufCgMgUghgZlhgZlhgZlnlvlxlPmmlQmkmpmHnNnYnanunmooomptnnpzpWqeq`rPnarPnarGnbrAfcrAfcr{rUs`slsvs~sOtFuRuZusr[usr[uw^\uw^\uku]uku]u}^u}^ueu{u|u|u|u
|uKrc$$Uxt|tsltd|pdzdz|d|pdzdzdddgddd	id
ddd
iddddgdd
ddddddgdd
dddddddddddd
idddd d!gddd
idd"gd#d$dd
d%dd&d'd(dd	d)dd*d+gd	d,ddd
id-dd.d/gdd
id0dd1d/gdd
id0dd2d3gd4d5d6id7gd8d9gd:dd	d;ddd
iid?d@gdAdd	d;dddd
idid?dCgdDddEdFgdGdd	d;dddd
idid?dHdd
d%ddIdJdKdLdd
d%ddMddNgdOdd>ddd
ididPdQgdRdd>d
dSdidPdTddd
idUdVggdWdXdYdZdd[d	d\d]gd^d_d`dagdd	dbdd
iidbgdcdddedfdd	dgd;dd
iddd
idgiidggdhgd8dddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdddd
iid?dst|%t}&|&rt|%}'|%D]\}(})t d>|(r|(|'vr|'|(t|)tsZtd|pdzdjditzdwz|)d|pdzdjditzdzdd
ids|'rKtd|pdzdzt|'zdz|%d|pdzdzgd:dd	d;ddd
iid?dst|%}*|*dkrSd}+|%D]}(	d},|,dkrc	t|(tr7|d%|(s&td|pdzdz|(d|pdzdzddd
iid?dsd@|vr|d@|d@}-t|-ts;td|pdzdz|-d|pdzdzgdAdd	d;dddd
idid?dst|-t}.|.r]t|-}/|-D]j\}0}1t d>|0rC|0|/vr|/|0t|1ttfs]td|pdzdjditzdz|1d|pdzdjditzdzddd
iddst|1ttf}2|2rt|1}3t|1D]t\}4}5t|5tsZtd|pdzdjditzdwz|5d|pdzdjditzdzdd
idsul|/rNtd|pdzdzt|/zdz|-d|pdzdzgdAdd	d;dddd
idid?dst|-}6|6dkrVd}7|-D]}0	d}8|8dkrc	t|0tr7|d%|0s&td|pdzdz|0d|pdzdzdddd
idid?dsdC|vr[|dC|dC}9t|9ts)td|pdzdz|9d|pdzdzgdDddEdsdF|vr|dF|dF}:t|:ts;td|pdzdz|:d|pdzdzgdGdd	d;dddd
idid?dst|:t};|;r]t|:}<|:D]j\}=}>t d>|=rC|=|ttfs]td|pdzdjditzdz|>d|pdzdjditzdzddd
iddst|>ttf}?|?rt|>}@t|>D]t\}A}Bt|BtsZtd|pdzdjditzdwz|Bd|pdzdjditzdzdd
idsul|ddd
idid?dst|:}C|CdkrVd}D|:D]}=	d}E|Edkrc	t|=tr7|d%|=s&td|pdzdz|=d|pdzdzdddd
idid?dsdH|vr|dH|dH}Ft|Fttfs+td|pdzdz|Fd|pdzdzdd
d%ddIdJdst|Fttf}G|Grt|F}Ht|FD]\}I}Jt|Jts[td|pdzdjditzdwz|Jd|pdzdjditzdzd
d%ddst|Jtrl|d%|Js[td|pdzdjditzdz|Jd|pdzdjditzdzd
d%ddddd
ididPdst|Pt}Q|Qrt|P}R|PD]j\}S}Tt d>|SrC|S|Rvr|R|St|Tttfs]td|pdzdjditzdz|Td|pdzdjditzdzddd
iddst|Tttf}U|Urt|T}Vt|TD]t\}W}Xt|XtsZtd|pdzdjditzdwz|Xd|pdzdjditzdzdd
idsuldQ|vr|dQ|dQ}Yt|Yts/td|pdzdz|Yd|pdzdzgdRdd>d
dSdidPdst|Yt}Z|Zrht|Y}[|YD]1\}\}]t d>|\r
|\|[vr|[|\t|]ts[td|pdzdjditzdwz|]d|pdzdjditzdzd
dSddst|]trl|dS|]s[td|pdzdjditzdz|]d|pdzdjditzdzd
dSdddd
iid?d@gdAdd	d;dddd
idid?dCgdDddEdFgdGdd	d;dddd
idid?dHdd
d%ddIdJdKdLdd
d%ddMddNgdOdd>ddd
ididPdQgdRdd>d
dSdidPdTddd
idUdVggdWdXdYdZdd[d	d\d]gd^d_d`dagdd	dbdd
iidbgdcdddedfdd	dgd;dd
iddd
idgiidggdhgd8dddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdddedfdd	dgd;dd
iddd
idgiidggdhdd.exclude-package-data must be named by propertyName definitionz!.namespace-packages must be arrayz.namespace-packagesz0.namespace-packages[{data__namespacepackages_x}]z.py-modules must be arrayz.py-modulesz .py-modules[{data__pymodules_x}]z.data-files must be objectz.data-filesz!.data-files.{data__datafiles_key}z:.data-files.{data__datafiles_key}[{data__datafiles_val_x}]z.cmdclass must be objectz	.cmdclassz.cmdclass.{data__cmdclass_key}z$ must be python-qualified-identifierz.license-files must be arrayz.license-filesz&.license-files[{data__licensefiles_x}]z.dynamic must be object.dynamicr.z.dynamic.versionz8.dynamic.version must be valid exactly by one definitionr]z.dynamic.classifiersrz.dynamic.descriptionrrz.dynamic.dependenciesrmz.dynamic.entry-pointsrvz-.dynamic.optional-dependencies must be objectz.dynamic.optional-dependencieszH.dynamic.optional-dependencies.{data__dynamic__optionaldependencies_key}z0.dynamic.optional-dependencies must not contain z8.dynamic.optional-dependencies must be python-identifierzG.dynamic.optional-dependencies must be named by propertyName definitionr4z.dynamic.readmez+.dynamic.readme.content-type must be stringz.dynamic.readme.content-typez5.dynamic.readme cannot be validated by any definitionr7c3 K|]}|vV	dSrr)rrdata__dynamic__readmes  rr zYvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html..s)"V"VT4+@#@"V"V"V"V"V"Vrr8z0.dynamic.readme must contain ['file'] propertiesr&z.dynamic must not contain r#r)r$r%rr&r'r(r+r,r)r-r.rr/boolbvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_find_directiverREGEX_PATTERNSsearchbvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_attr_directivebvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directiver*)yr
rrr3r4data__platformsdata__platforms_is_listdata__platforms_lendata__platforms_xdata__platforms_itemdata__providesdata__provides_is_listdata__provides_lendata__provides_xdata__provides_itemdata__obsoletesdata__obsoletes_is_listdata__obsoletes_lendata__obsoletes_xdata__obsoletes_item
data__zipsafedata__scriptfilesdata__scriptfiles_is_listdata__scriptfiles_lendata__scriptfiles_xdata__scriptfiles_itemdata__eagerresourcesdata__eagerresources_is_listdata__eagerresources_lendata__eagerresources_xdata__eagerresources_itemdata__packagesdata__packages_one_of_count1data__packages_is_listdata__packages_lendata__packages_xdata__packages_itemdata__packagedirdata__packagedir_is_dictdata__packagedir_keysdata__packagedir_keydata__packagedir_valdata__packagedir_lendata__packagedir_property_names"data__packagedir_key_one_of_count2data__packagedatadata__packagedata_is_dictdata__packagedata_keysdata__packagedata_keydata__packagedata_valdata__packagedata_val_is_listdata__packagedata_val_lendata__packagedata_val_xdata__packagedata_val_itemdata__packagedata_len data__packagedata_property_names#data__packagedata_key_one_of_count3data__includepackagedatadata__excludepackagedata data__excludepackagedata_is_dictdata__excludepackagedata_keysdata__excludepackagedata_keydata__excludepackagedata_val$data__excludepackagedata_val_is_list data__excludepackagedata_val_lendata__excludepackagedata_val_x!data__excludepackagedata_val_itemdata__excludepackagedata_len'data__excludepackagedata_property_names*data__excludepackagedata_key_one_of_count4data__namespacepackagesdata__namespacepackages_is_listdata__namespacepackages_lendata__namespacepackages_xdata__namespacepackages_itemdata__pymodulesdata__pymodules_is_listdata__pymodules_lendata__pymodules_xdata__pymodules_itemdata__datafilesdata__datafiles_is_dictdata__datafiles_keysdata__datafiles_keydata__datafiles_valdata__datafiles_val_is_listdata__datafiles_val_lendata__datafiles_val_xdata__datafiles_val_itemdata__cmdclassdata__cmdclass_is_dictdata__cmdclass_keysdata__cmdclass_keydata__cmdclass_valdata__licensefilesdata__licensefiles_is_listdata__licensefiles_lendata__licensefiles_xdata__licensefiles_item
data__dynamicdata__dynamic_is_dictdata__dynamic_keysdata__dynamic__version$data__dynamic__version_one_of_count5data__dynamic__classifiersdata__dynamic__descriptiondata__dynamic__dependenciesdata__dynamic__entrypoints#data__dynamic__optionaldependencies+data__dynamic__optionaldependencies_is_dict(data__dynamic__optionaldependencies_keys'data__dynamic__optionaldependencies_key'data__dynamic__optionaldependencies_val'data__dynamic__optionaldependencies_len2data__dynamic__optionaldependencies_property_names#data__dynamic__readme_any_of_count6data__dynamic__readme_is_dictdata__dynamic__readme_keys"data__dynamic__readme__contenttypedata__dynamic__readme_lenrPsy                                                                                                                        @rr2r2hs֌dT##]D&r[-BF'CFW'W_cjlp{qF@FkGJLkLeMVU`{NaNaNaksMRbLhcny@LRT\K]p^p^bLh`j@B^~_ipDLXk{l{llmlmbLhozO}[N\fmAIUhxixi|j|jbLhlvHNXaxbxbbLhdrDBLS_ego^p~qtrtrbLhtEZb d b!Yc!m!t!@"F"H"P"!Q"GR"GR"bLhT"^"r"^*r"^*r"^*t*Y+c+j+~+F,R,f,u+g,u+g,j*h,j*h,r,P-[-n-x-@.Z._.p.v.A/I/]/y/{/G1\/H1b1g1Q2U3_3f3r3x3z3B4q3C4A2D4A2D4Z4a4u4s5u5m6t4n6z6@7B7J7y6K7Q4L7Q4L7b7i7}7A9C9{9|7|9H:N:P:X:G:Y:Y7Z:Y7Z:s:|:P;U<W(>%CLM^C_C_SS?')?%&r[EZTZ?[_E^}_E_Q_QHNHPHP_Q_Q@QTe@em@GIMXMb\bGcfLfEfLfXfXOUOWOWfXfXGX[]G]s{G[j\j\ci'j'j'j!j)*=sCC|'K~6J'KL_'`'`!|*B2I^X^C_cIcBcIcUcULRLTLTcUcUDUXuDu}PWY]h]rlrWsv\vUv\vhvh_e_g_gvhvhWhkmWmCKWkzlzls{+|+|+|%|0A500/5555+a//6vxFHVYdYnhnr}X}~~~0A500/5555+q00.r[5JF/KOB0BFJMPQmMnMnFnqBFB0CKY`bfqf{u{`|J`JiUiUiUkP
Z
a
u
}
I]l
^l
^a_a_iGReowQVgmx@Tpr~SY^HLV]ioqyhzx{x{QXljldkeqwyApBHCHCY`txzrssEGO~PPQPQjsGLNCFDaEaEnFnFoGoGfHaIaI`JWKWKRYZZZZI%%]+++#M2.77
L
.r[5JF/KNk/ktDKMQ\Qf`fKgjxKxWJWJWJT\v{OVZbdxYy|C	E	G	{H	XI	NJ	b	h	k	q	s	{	j	|	a	}	E~	E~	E
K
L
L
L
L
'12BD'I'I$'"
w
(+,<,A,A,C,C(D(D%BRBXBXBZBZSS>(*>%f-445IJJS/3HHH1889MNNN)*>FFS":2AVPV;W[GZ[G[S[SJPJRJR[S[SAAEE!F'12F'L'L%a/S~>R/STh/i/i)a2J2Q\Qf`fKgkTLT\pwy}H}RLRwSVdwdrz|PqQX`3a3a3a-a$F!$K$F$F'? E E E EAAEE!F';r'A'A.Fr[Mb\bGcgXHX`t{}ALAVPV{WZh{hv}AuBIP/Q/Q/Q)Q$F!$K$F$F'? E E E EAQFF&>r[EZTZ?[_U@UY]`cdF`G`GYGJ[Y[@\dxAEPEZTZ[^llzAEMOcDdgnprfsCtyu|C'D'D'D!D G7DDD>C;;;D:w
6r[=RF7SWN8NVfmos~sHBHmILZmZylylylv~X]qx|D	F	Z	{[	^	e	g	i	]	j	zk	pl	D
J
M
S
U
]
L
^
C
_
g`
g`
g
v
w
w
w
w
Y&&^,,, $^ 4/$88
Y.r[5JF/KNl/luFMOS^ShbhMil{M{ZzZzZzDLfkF	J	R	T	h	I	i	l	s	u	x	k	y	H	z	~{	S
Y
d
k
w
}

Gv
H[
I[
IR
JHKHKRXYYYY(23Dd(K(K%((
D),->-C-C-E-E)F)F&DUD[D[D]D][[@)+@%f-445JKK
[04JJJ299:OPPP)*?$OOs":2AVPV;W[I[B[I[U[ULRLTLT[U[U(>%(A--7;41BEE-EBC?BQFF!F'12G'M'M%d/S~>R/STi/j/j)d2J2Q\Qf`fKgkULU]ry{JTNTyUXgygu}StT[c3d3d3d-d$G1$L$G$G'? E E E EBQFF!F'<'C'C.Fr[Mb\bGcgZHZbw~@DODYSY~Z]l~lzACFyGNU/V/V/V)V$G1$L$G$G'? E E E EBaGG&>r[EZTZ?[_V@VZ^adeHaIaIZIL]Z]@^f{BDHSH]W]B^apBp~EIQSgHhkrtwjxGy}zAH'I'I'I!I H7EEE?D<<<E;D6r[=RF7SWO8OWhoqu@uJDJoKN]o]|\|\|\fnH	M	a	h	l	t	v	J
k	K
N
U
W
Z
M
[
j	\
`	]
u
{
FMY_aiXj}
k}
kt
ljmjmtCDDDD!Y..3444'+,B'C$6??
[.r[5JF/KNu/u~V]_cncxrx]y|S]SryryryCL`M`MTZ[[[[!Y..3444'+,B'C$6??
w
.r[5JF/KNt/t}U\^bmbwqw\x{R\RqXqXqXbjDI]dhprF	gG	J	Q	S	V	I	W	fX	\Y	q	w	B
I
U
[
]
e
T
f
y	g
y	g
p	h
_i
_i
p
v
w
w
w
w
/9:RTX/Y/Y,/(
b034L4Q4Q4S4S0T0T-RjRpRpRrRrNNN02N%f-445QRR
N7;XXX9@@A]^^^)*Fu
VVX":2AVPV;W[X[Q[X[d[d[a[c[c[d[d@a'12SVY'['[!N*B2I^X^C_cBc{cBcNcNEKEMEMcNcNDNQbDbjKRTXcXmgmRnqPqIqPq\q\SYS[S[q\q\R\_aRaouwn@GM+N+N+N%N!N0229N3OR{3{|A^}_}_4_`m4muMTVZeZoioTpsJTJiPiPiPZb|A	U	\	`	h	j	~	_		B
I
K
N
A
O
^	P
T	Q
i
o
z
AMSU]L^q
_q
_h
`WaWah~/23K/L/L,/144>B;8PLL4LIJFIAMM!F'12NPS'T'T%{/S~>R/STp/q/q){2J2Q\Qf`fKgk]L]eAHJNYNc]cHdg~H~LTVjKkrz3{3{3{-{$NRS$S$N$N'? E E E EIAMM!F'Cs'J'J.Fr[Mb\bGcgbHbjFMOS^ShbhMilCMCQXZ]P^el/m/m/m)m$NRS$S$N$N'? E E E EIQNN&>r[EZTZ?[_^@^bfilmWiXiXbX[lbl@muQXZ^i^smsXtwNXN\cgoqEfFIPRUHVeW[X_f'g'g'g!g O7LLLFKCCCLBb6r[=RF7SWW8W_w~@DODYSY~Z]t~tSzSzSzDLfkF	J	R	T	h	I	i	l	s	u	x	k	y	H	z	~{	S
Y
d
k
w
}

Gv
H[
I[
IR
JAKAKRabbbb9,,1222&*+?&@#5e}EE
J.r[5JF/KNq/qzQXZ^i^smsXtwLXLbi}EQetftft{Y|Y|CIJJJJ.89PSWY^R_.`.`+.
c.12I.J.J+OXYpOqOqccK-/K%&BSJJQ6r[=RF7SWPWIWPW\W\SYS[S[W\W\8\_p8pxT[]alavpv[wzszlzszzv|v~v~zz[BD[DZbnBQCQCJPQQQQ!">DDcC~.BCD`aac":2AVPV;W[T[M[T[`[`W]W_W_[`[`<`c@<@Hdkmq|qF@FkGJCJ|JCJOJOFLFNFNJOJOkORTkTjr~RaSaSZb#c#c#cc9$$\***"<0Ooe}==
W.r[5JF/KNi/irAHJNYNc]cHdgtHtQzDK_gsGVHVHVHAIAIPVWWWW&04-&P&P#&
{&)/&:&:#?H?Y?Y{{;%';%&:SBBi6r[=RF7SVVxVWLWLCICKCKWLWL8LO`8`h|CEITI^X^C_bKbDbKbWbWNTNVNVbWbWCWZ\C\rzFZi[i[bhiiii!"6<<{C~.BCDXYY{":2AVPV;W[DZ|[D[P[PGMGOGO[P[PL>R>R>T>TKK:&(:%f-445GHHK-1DDD/667IJJJ)*>K#P>2O#PQc#d#dK&>r[EZTZ?[_F^~_F_R_RIOIQIQ_R_R@RU{@{CU\^bmbwqw\x{b{[{b{n{nekemem{n{n\nqs\sIQ]z@{@{BJ'K'K'K!Ki''_---!%o!604-@@
j.r[5JF/KNl/luGNPT_TiciNjm}N}SZflnvewKXZAJBOCOCOCQ[J\J\cijjjj)34Fu
)V)V&)
X),-?)@)@&ENOaEbEbXXA(*A%&=EEX6r[=RF7SWFV~WFWRWRIOIQIQWRWR8RUf8fnELNR]RgagLhkZkSkZkfkf]c]e]ekfkfLfikLkyAIxJQWXXXXX&Z&Z&Zd?#	!!Y''' OMmd44
s6.r[5JF/KNg/go|DFJUJ_Y_D`cmDmCK\^x}lprAkBXktR	f	p
r
\e	]goIN_ehnpxgy^zI
O
H
P
NQ
NQ
[
y
DWhlv~X]ntw~BHJRAS^eqwyApBUCUC@DvEmFU[T\S
]S
]M^Y_Y_xVatEIS[uzKQT[_ego^p{BNTV^M_r`r`]aSbJcrxqypzpzSq|O`dnvPUflovz@BJyKV]ioqyhzM{M{x|n}e~MSLTKUKUoMXk|@ J R l q B!H!K!R!V!\!^!f!U!g!r!y!E"K"M"U"D"V"i!W"i!W"T!X"J!Y"A!Z"i"o"h"p"gq"gq"K#i#t#G$X$\%f%n%H&M&^&d&g&n&r&x&z&B'q&C'N'U'a'g'i'q'`'r'E's'E's'p&t'f&u']&v'E(K(D(L(C#M(C#M(q(y(M)U)W)j)L)k)E*J*b*f*p*N+Y+l+}+A-K-S-m-r-C.I.L.S.W.]._.g.V.h.s.z.F/L/N/V/E/W/j.X/j.X/U.Y/K.Z/B.[/j/p/i/q/h*r/h*r/a*s/h(t/h(t/S0q0|0O1`1d2n2v2P3U3f3l3o3v3z3@4B4J4y3K4V4]4i4o4q4y4h4z4M4{4M4{4x3|4n3}4e3~4M5S5L5T5K0U5K0U5X5d5g5u5x5~5@6H6w5I6f5J6W5K6J0L6[6a6Z6b6@0c6@0c6Md6Md6ze6ze6l6r6s6s6s6s6$.}d$C$C!$Z
p7%(););)=)=%>%>" 222&--i888-:9-E*;<8;a??>~@VXfiti~x~BThTUUU@AE@@7====;a??>~@VXfiti~x~BThTUUU@AE@@7====;q@@6r[=RF7SWQ8QUY\_`D\E\EUEHYUY8ZbxAEPEZTZ[^ppPTVeOf|OXvJ	T
V
@I	AKSmrCILRT\K]B^msltruru]
h
{
LPZb|ARX[bflnvewBIU[]eTfygygdhZiQjyx@wAwAqB}C}CJQRRRR $666&--m<<<1>}1M.vxRTbepeztz~TdTUUU $666&--m<<<1>}1M.vxRTbepeztz~TdTUUU!%777&--n===2?2O/vxSUcfqf{u{VeVWWW!%777&--n===1>~1N.vxRTbepeztz~UdUVVV*.@@@&--.EFFF:GH_:`7%&IDRR^6r[=RF7SWF8FNqxz~I~SMSxTWwxwMUiqsFhGaf~BLjuHY]goI	N	_	e	h	o	s	y	{	C
r	D
O
V
b
h
j
r
a
s
F
t
F
t
q	u
g	v
^	w
FLEMDNDN}ODPDPW]^^^^BLMprvBwBw?BICFGjGoGoGqGqCrCr@qTqZqZq\q\bblCEl-d3::;bccb#JNv#v#v$L$S$ST{$|$|$|!CDkm{~I~SMSWa}a!b!b!bCq":2AVPV;W[MQ/RSz/{/{)V2J2Q\Qf`fKgkeLemT[]alavpv[wzZ[ZhprEgFMU3V3V3V-V'?!_!_!_Y^$V$V$V!_#UI&>r[EZTZ?[_h@hpSZ\`k`uouZvyYZYowKSUhJiCH`dnLWj{I	Q	k	p	A
G
J
Q
U
[
]
e
T
f
q
x
DJLTCUh
Vh
VS
WI
X@
Yhngofpfp_qfrfryH'I'I'I!I111&--h777,9(,C):;7>>>~@UWehsh}w}ARgRSSS?1D??7====>>
>$E$En$U$U$UI^_mIn$F+56X[^+`+`%o.Fr[Mb\bGcgTHT\~EGKVK`Z`EadBEBPVX`Oahn/o/o/o)o?1D??7====>a
6r[=RF7SWN8NVkrtxCxMGMrNQbrbB`k~OS]eDU[^eioqyhzELX^`hWi|j|jgk]lTm|B	{C	zD	zD	G	S	V	d	g	m	o	w	f	x	U	y	F	z	y{	J
P
I
Q
oR
oR
Y
`
a
a
a
a
4>?TVZ4[4[14c
478M4N4N1""V"V"V"VX"V"V"VVVc
":2AVPV;W[M[>NB[>NB[>NBXB`BzBBSCZC^CfChC|C]C}C@DGDIDKDCLD\CMDRCNDfDlDoDuDwDDnD@EeDAEI>BEI>BEFphDEREfEFJfEFJfEFJPJXJrJwJKKRKVK^K`KtKUKuKxKKALDLwKELTKFLJKGL_LeLpLwLCMIMKMSMBMTMgLUMgLUM^LVMTEWMTEWMFphYMoMCNJRCNJRCNJRTR]RqM^RqM^RFph`RvRJSqVJSqVJSqV{VCW]WbWvW}WAXIXKX_X@X`XcXjXlXoXbXpXWqXuWrXJYPY[YbYnYtYvY~YmYYRY@ZRY@ZIYAZxRBZxRBZFphDZXZcZjZ~ZF[R[f[uZg[uZg[u[|\ZZ}\ZZ}\Fph\K]]]F^P^W^k^s^^S_b^T_b^T_b_T`M]U`M]U`FphW`c`w`]ew`]ew`]egeoeGfMfXf_fkfqfsf{fjf|fOf}fOf}fFf~fe`fe`fFphAgKg_gcm_gcm_gcmmmumMnSn^nfnrnOoUnPoUnPoLnQoMgRoMgRoFphToconouoApGpIpQp@pRpfpsquq\rep]rjr^sjr^sjr^slsvteowteowtFphytBuMuUufuhvBwGwvwzx|xKzuwLzbzuz~z\{p{z|||f}o{g}q}y}S~X~i~o~r~x~z~Bq~Ch~DSYRZXz[Xz[eC@N@a@r@vA@BHBbBgBxB~BACHCLCRCTC\CKC]ChCoC{CADCDKDzCLD_CMD_CMDJCND@CODwBPD_DeD^DfD]gD]gDWzhDcwiDcwiDBE`EkE~EOFSG]GeGGDHUH[H^HeHiHoHqHyHhHzHEILIXI^I`IhIWIiI|HjI|HjIgHkI]HlITHmI|IBJ{ICJzDDJzDDJ]J{JFKYKjKnLxL@MZM_MpMvMyM@NDNJNLNTNCNUN`NgNsNyN{NCOrNDOWNEOWNEOBNFOxMGOoMHOWO]OVO^OUJ_OUJ_OyOWPbPuPFQJRTR\RvR{RLSRSUS\S`SfShSpS_SqS|SCTOTUTWT_TNT`TsSaTsSaT^SbTTScTKSdTsTyTrTzTqO{TqO{TUUsU~UQVbVfWpWxWRXWXhXnXqXxX|XBYDYLY{XMYXY_YkYqYsY{YjY|YOY}YOY}YzX~YpXYgX@ZOZUZNZVZMUWZMUWZ{ZC[W[_[a[t[V[u[O\T\l\p\z\X]c]v]G^K_U_]_w_|_M`S`V`]`a`g`i`q```r`}`DaPaVaXa`aOaaat`bat`ba_`caU`daL`eatazasa{ar\|ar\|ak\}arZ~arZ~a]b{bFcYcjcndxd@eZe_epeveye@fDfJfLfTfCfUf`fgfsfyf{fCgrfDgWfEgWfEgBfFgxeGgoeHgWg]gVg^gUb_gUb_gbgngqggBhHhJhRhAhShpgThagUhTbVhehkhdhlhJbmhJbmhWwnhWwnhDuohDuohFph\iziEjXjijmkwkkYl^lolulxllCmImKmSmBmTm_mfmrmxmzmBnqmCnVmDnVmDnAmEnwlFnnlGnVn\nUn]nTi^nTi^n|nOoXovoJpTqVq@rIpArKrSrmrrrCsIsLsRsTs\sKs]sBs^smssslstsrnusrnusQtotztMuWu_uyu~uOvUv`vhv|vXwZwfx{vgxAyFypytz~zE{Q{W{Y{a{P{b{`yc{`yc{y{@|T|R}T}L~S|M~Y~_~a~i~X~j~p{k~p{k~AH\`@b@ZA[[AgAmAoAwAfAxAx~yAx~yARB[BoBtCvCkDnBlDIBmDIBmDVynDVynDWvoDWvoDNvpDItqDItqDAirDAirD}sD}sDzDPEQEQEQE
QEKsFm
mm)n
nn'{%0Ay{%
y{%y	{%1z
{%
z{%zA{%%{54{5GAK	GAAH&H%AK	H&
AH3H0AK	H2AH3H3	AK	H=1AI/I.AK	I/
AI<I9AK	I;AI<I.'55D44<555555rrQz! must contain ['file'] propertiesr&rrJz.file must be stringz.filerz.file must be arrayz.file[{data__file_x}]r!z-.file must be valid exactly by one definitionrKrLr#r"r$r)r$r%rr)r*r&r'r(r.r+r,r-rr/)r
rrr3data_lenr4
data__filedata__file_one_of_count7data__file_is_listdata__file_lendata__file_xdata__file_items`           rrWrWsdT##q&r[-BF'CFW'W_cjlp{qF@FkGJLkLaJ]nr|D^ctz}DHNPXGYdkw}GvH[I[IFJ|KsL[aZbYcYcjpqqq	qdD))Let995555H55555	K*21F+GJm+muyACGRG\V\A]`bAbwU`sDHRZtyJPSZ^dfn]ozAMSU]L^q_q_\`RaIbqwpxoyoy@JKKK
K		$$	YV$$$fJ'($'!++6%j388Y6r[=RF7SVl7lt~FHLWLa[aFbelFlz@BJyKRXYYYY,1,,/5555'!++
6%j4-@@t6r[=RF7SVk7ks}EGKVK`Z`EadkEkAHTZ\dSexfxfmstttt)3Ju
)N)N&)v),Z=Fz=R=Rvv9L/#-o#E#Ev&>r[EZTZ?[^|^u^|_I_I@F@H@H_I_I@IL]@]et{}ALAVPV{WZxZqZxZDZD{A{C{CZDZD{DGI{IW]_gVhou'v'v'v!vv,1,,/5555'1,,.r[5JF/KN}/}BFILMeIfIfBfizBz0{CMTVZeZoioTpszTzHOSY[cRdovBHJRASfTfTQUGV]deeee	e*21F+GJ^+^_bcl_m_m+mn{+{DHOQU`UjdjOknpOpEcnARV`hBGX^ahlrt|k}HO[ackZlmmjn`oWpE~F}G}GNdeee
eKs&AE
E'&E'2C;I..
I;:I;c
tts3td|pdzdzd|pdzdzddddgdd	d
ddiid
gd
dtt}|r"t}t	fddDs3td|pdzdzd|pdzdzddddgdd	d
ddiid
gd
dt}d
|vrX|d
d
}t|ts&td|pdzdz|d|pdzdzddid|rFtd|pdzdzt|zdzd|pdzdzddddgdd	d
ddiid
gd
dS)Nrr
rrrrrrFrrrrrc3 K|]}|vV	dSrrrs  rr zuvalidate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_attr_directive..3rr)rz! must contain ['attr'] propertiesr&z.attr must be stringz.attrr#r"r$)	r$r%rr)r*r&r'r(r.)r
rrr3rr4
data__attrs`      rrVrV-sdT##j&r[-BF'CFW'W_cjlp{qF@FkGJLkLcv]q{}gphrzTYjpsy{CrDiETZS[Y\Y\cijjj	jdD))L^t995555H55555	D*21F+GJm+muyACGRG\V\A]`bAbyLUsGQS}F~HPjo@FIOQYHZ[jpiqororyCDDD
D		$$	YV$$$fJj300
Q.r[5JF/KNd/dlv}DODYSY~Z]d~drxzBqCJPQQQQ	^*21F+GJ^+^_bcl_m_m+mn{+{DHOQU`UjdjOknpOpGZcAU_aKTLV^x}NTW]_gVhMix~w}@}@G]^^^
^Krct|tsStd|pdzdz|d|pdzdzddddddd	d
gdddd
diddddgd
diddddgd
diddddgdddidd
t|t}|rRt|}d|vr|d|d}t|tsKtd|pdzdz|d|pdzdzdd	d
gdddd
diddddgd
diddddgd
diddddgdddd
t|t}|r/t|}d|vr|d|d}t|ttfs*td|pdzdz|d|pdzd zddd
didd
t|ttf}	|	rt|}
t|D]t\}}t|tsZtd|pdzd!jd2itzd"z|d|pdzd!jd2itzdzd
did
ud#|vr|d#|d#}
t|
ttfs,td|pdzd$z|
d|pdzd%zdddgd
didd
t|
ttf}|rt|
}t|
D]t\}}t|tsZtd|pdzd&jd2itzd"z|d|pdzd&jd2itzdzd
did
ud'|vr|d'|d'}t|ttfs,td|pdzd(z|d|pdzd)zdddgd
didd
t|ttf}|rt|}t|D]t\}}t|tsZtd|pdzd*jd2itzd"z|d|pdzd*jd2itzdzd
did
ud+|vr[|d+|d+}t|ts)td|pdzd,z|d|pdzd-zdddgdd
|r^td|pdzd.zt|zd/z|d|pdzdzdd	d
gdddd
diddddgd
diddddgd
diddddgdddd0|rftd|pdzd1zt|zd/z|d|pdzdzddddddd	d
gdddd
diddddgd
diddddgd
diddddgdddidd0|S)3Nrr
rrrrFrrrrrrrrrrrrrrrr3rr
rrz.find must be objectz.findr	z.find.where must be arrayz.find.wherez".find.where[{data__find__where_x}]r!r
z.find.exclude must be arrayz
.find.excludez&.find.exclude[{data__find__exclude_x}]rz.find.include must be arrayz
.find.includez&.find.include[{data__find__include_x}]rz .find.namespaces must be booleanz.find.namespacesz.find must not contain r"r$r#r)r$r%rr&r'r(r+r,r)r-r.rr/rR)r
rrr3r4
data__finddata__find_is_dictdata__find_keysdata__find__wheredata__find__where_is_listdata__find__where_lendata__find__where_xdata__find__where_itemdata__find__excludedata__find__exclude_is_listdata__find__exclude_lendata__find__exclude_xdata__find__exclude_itemdata__find__includedata__find__include_is_listdata__find__include_lendata__find__include_xdata__find__include_itemdata__find__namespacess                        rrSrS?sdT##O&r[-BF'CFW'W_cjlp{qF@FkGJLkLaJ]goIN_epxLhjvKwQV@D	N	U	a	g	i	q	`	r	ps	ps	I
P
d
bd\c
]ioqyhz@
{@
{Q
X
l
prjk
kw}GvHH
IH
IbkDF{~|Y}Y}f~f~gg^@YAYAHNOOO	OdD))L3C		$$	YV$$$fJj411
W.r[5JF/KNd/dlv}DODYSY~Z]d~dzBVrt@UA[`JNX_kqs{j|z}z}SZnl	n	f
mg
s
y
{
Cr
DJEJE[bvz|t
uu
AGIQ@RRSRSluINPEHFcGcGpHpHqIqIPVWWWW!+J!=!=!)
Q"%joo&7&7"8"8o--#**7333(27(;%%&7$GG\6r[=RF7SVq7qzKRTXcXmgmRnq~R~[_ip|BDL{MKNKNU[\\\\0:;LtUZm0\0\-0W034E0F0F-KTUfKgKgWWG/1G#-.Ds#L#LW&>r[EZTZ?[_J_C_J_V_VMSMUMU_V_V@VYj@jrHOQU`UjdjOknYnRnYnene\b\d\dneneOehjOjx~@HwIPV'W'W'W!WW//#**9555*4Y*?'%&9D%=IIZ6r[=RF7SVs7s|OVX\g\qkqVruDVDZausumtnz@BJyKQLQLSYZZZZ2<=PSWY^R_2`2`/2a256I2J2J/OXYlOmOmaaK13K#-.F#N#Na&>r[EZTZ?[_N_G_N_Z_ZQWQYQY_Z_Z@Z]n@nvNUW[f[pjpUqtct\tctotoflfnfntotoUortUtBHJRASZ`'a'a'a!aa//#**9555*4Y*?'%&9D%=II`6r[=RF7SVs7s|OVX\g\qkqVruDVDZauy{stt@FHPQQRQRY_````2<=PSWY^R_2`2`/2a256I2J2J/OXYlOmOmaaK13K#-.F#N#Na&>r[EZTZ?[_N_G_N_Z_ZQWQYQY_Z_Z@Z]n@nvNUW[f[pjpUqtct\tctotoflfnfntotoUortUtBHJRASZ`'a'a'a!aa?22#**<888-7-E*%&rrrrrz.global must be objectz.global.{data_key}r)r$r%rr&r'r(rrTrUrr/)r
rrr3r4data__globaldata_keydata_vals        rr1r1ys\dT##
&r[-BF'CFW'W_cjlp{qF@FkGJLkLeMVzE_re	re	re	o	w	H
P
[
c
t
jR
kR
kG
lDHKQS[J\C]kp
Yq
Yq
x
~



	
dD))LO		$$	y  X&&&>LlT33
^.r[5JF/KNf/fnzBDHSH]W]B^ajBj@HYOwPwPW]^^^^"&**,,	O	OHhd#**844
Oy(($$X...!(T33O229N3ORfR_RfRrRrioiqiqRrRr3rvG4GOW^`dodysy^z}Q}J}Q}]}]TZT\T\}]}]^]`b^bpvx@oAHNOOOOKrcT>QRttstd|pdzdzd|pdzdzdddddgd	id
ddd
ddddddddddgddgddgddd	dddddgdidgddddd idgdgid!dgd"d#d$id!gdgd%gd&d'dd(d)d*gd+d,d-ddd.d/gdidgdddgd0didgdgd1d2d3d4d5d6d	dd7d8gddd9d:d;d<d=gd>d?d@d3d4d5d6d	dd7d8gddd9d:d;d<d=dAdBgd?dCd3dDdidEdFdGd3ddHdId;dJdKgd?dLd	dMdNdOddPdQidRdSdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d_dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d`gdadWdbidNdOdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^idcddd3dedfdgddhdidjdkdld	dmdWd
idNdOd3dfdgddhdidjdnidodpd3dqdrgdsgdtidud
gdNdpgdpdvdidwgdxidygdzd{dgd|gd}d4d5d6d	dd7d8gddd9d:d;d<d=dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^dfdgddhdidjd~ddDtt}|r#t}t	fddDstd|pdzdzd|pdzdzdddddgd	id
ddd
ddddddddddgddgddgddd	dddddgdidgddddd idgdgid!dgd"d#d$id!gdgd%gd&d'dd(d)d*gd+d,d-ddd.d/gdidgdddgd0didgdgd1d2d3d4d5d6d	dd7d8gddd9d:d;d<d=gd>d?d@d3d4d5d6d	dd7d8gddd9d:d;d<d=dAdBgd?dCd3dDdidEdFdGd3ddHdId;dJdKgd?dLd	dMdNdOddPdQidRdSdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d_dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d`gdadWdbidNdOdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^idcddd3dedfdgddhdidjdkdld	dmdWd
idNdOd3dfdgddhdidjdnidodpd3dqdrgdsgdtidud
gdNdpgdpdvdidwgdxidygdzd{dgd|gd}d4d5d6d	dd7d8gddd9d:d;d<d=dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^dfdgddhdidjd~ddt}d
|vr|d
d
}t|ts(td|pdzdz|d|pdzdzddd
ddDt|tr9|d
|s(td|pdzdz|d|pdzdzddd
ddWd|vr|dd}t|ts(td|pdzdz|d|pdzdzdddddDt|tr9|d|s(td|pdzdz|d|pdzdzdddddWd|vr[|dd}t|ts)td|pdzdz|d|pdzdzdddgddDd|vr|ddRd}	|	dkrU	tRts)td|pdzdzRd|pdzdzdgdddD|	dz
}	n#t$rYnwxYw|	dkr	tRtsMtd|pdzdzRd|pdzdzd	dddddgdidgddddd idgdgid!dgd"d#d$id!gdgd%dDd}
|
s	tRt}|rtR}t	RfddDs/td|pdzdzRd|pdzdzddddgdidgddtR}
d|
vr[|
dRd}t|ts)td|pdzdz|d|pdzdzdddgddD|
dz
}
n#t$rYnwxYw|
s	tRt}|rtR}t	RfddDs-td|pdzdzRd|pdzdzdddd idgddtR}
d|
vrY|
dRd}t|ts'td|pdzdz|d|pdzdzddd dD|
dz
}
n#t$rYnwxYw|
sd?dDt|ttf}|r:t|}t|D]\}}t|||pddzd@|vr|d@d@}t|ttfst'|>||pddzdl|vr|dldl}?t|?ts7td|pdzdz|?d|pdzdzd	dmdWd
idNdOd3dfdgddhdidjdnidodDt|?t}@|@rKt|?}A|?D]\}B}Ct dO|Br|B|Avr|A|Bt|Cttfsatd|pdzdj
ditzdz|Cd|pdzdj
ditzdzd3dfdgddhdidjdndDt|Cttf}D|Dr:t|C}Et|CD]\}F}Gt'|G||pddz|ArJtd|pdzdzt|Azdz|?d|pdzdzd	dmdWd
idNdOd3dfdgddhdidjdnidodȬt|?}H|Hdkrd}I|?D]a}B	t|Btr7|d
|Bs&td|pdzdz|Bd|pdzdzdWd
idWP#t$rdN}IY^wxYw|Is7td|pdzdz|?d|pdzdzd	dmdWd
idNdOd3dfdgddhdidjdnidodѬdp|vr	|dpdp}Jt|Jttfs.td|pdzdz|Jd|pdzdzd3dqdrgdsgdtidudDt|Jttf}K|Krt|J}Lt|JD]e\}M}N|Ndtvr\td|pdzdj
ditzdz|Nd|pdzdj
ditzdzdsgdtidsf|rtd|pdzdzt|zdzd|pdzdzdddddgd	id
ddd
ddddddddddgddgddgddd	dddddgdidgddddd idgdgid!dgd"d#d$id!gdgd%gd&d'dd(d)d*gd+d,d-ddd.d/gdidgdddgd0didgdgd1d2d3d4d5d6d	dd7d8gddd9d:d;d<d=gd>d?d@d3d4d5d6d	dd7d8gddd9d:d;d<d=dAdBgd?dCd3dDdidEdFdGd3ddHdId;dJdKgd?dLd	dMdNdOddPdQidRdSdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d_dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^d`gdadWdbidNdOdTdUd	gdVdWdXidNdOddYdZgd[d\d]id^idcddd3dedfdgddhdidjdkdld	dmdWd
idNdOd3dfdgddhdidjdnidodpd3dqdrgdsgdtidud
gdNdpgdpdvdidwgdxidygdzd{dgd|gd}d4d5d6d	dd7d8gddd9d:d;d<d=dTdUd	gdVdWdXidNdOddYdZgd[d\d]id^dfdgddhdidjd~ddȬ		tt}|r-t}t	fddDs0td|pdzdzd|pdzdzdpgdpdvdidwgdxidydt}dp|vr|dpdp}Jt|Jttf}K|KrsdN}O|JD]B}P	|Pdkr&td|pdzdz|Pd|pdzdzdvdidvd}On#t$rY?wxYw|Os*td|pdzdz|Jd|pdzdzdvdidwgdxd笀td|pdzdzd|pdzdzdpgdpdvdidwgdxidygdzd{d鬀#t$rYnwxYw	tt}|rSt}t	fddDs)td|pdzdzd|pdzdzdgd|gd}dn#t$rYnwxYwS)Nrr
rrr'r(r)r*rr+rr,r-rr.r/r0rr1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrErGrHrIrJrKrLrMrNrOrPrQrRrrTrrrrrrr`rrrUrVrWrXrYrZrr[r\r]r^r_rarbrcrdFrrerfrgrirjrrrrrrrrrrrlrmrnrorprrrsrtrrrrrurvrwrxryrzr{r|r}r~rrrrrrrrrrrrc3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..rr)r+z! must contain ['name'] propertiesr&.name must be string.namez.name must be pep508-identifierz.version must be stringz.versionz.version must be pep440z.description must be stringz.descriptionrrJz.readme must be stringz.readmerz.readme must be objectc3 K|]}|vV	dSrrrrdata__readmes  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..(*U*UD4<+?*U*U*U*U*U*UrrQz(.readme must contain ['file'] propertiesz.readme.file must be stringz.readme.filec3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..rr)r<z(.readme must contain ['text'] propertiesz.readme.text must be stringz.readme.textz-.readme cannot be validated by any definitionc3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..s("U"UD4<#7"U"U"U"U"U"Ur)r?z0.readme must contain ['content-type'] propertiesz#.readme.content-type must be stringz.readme.content-typez/.readme must be valid exactly by one definitionrKrLrFz.requires-python must be stringz.requires-pythonz+.requires-python must be pep508-versionspecc3 K|]}|vV	dSrrrr
data__licenses  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..("N"NT4=#8"N"N"N"N"N"Nrz).license must contain ['file'] propertiesz.licensez.license.file must be stringz
.license.filec3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..rrz).license must contain ['text'] propertiesz.license.text must be stringz
.license.textz0.license must be valid exactly by one definitionz.authors must be arrayz.authorsz.authors[{data__authors_x}]z.maintainers must be arrayz.maintainersz#.maintainers[{data__maintainers_x}]z.keywords must be arrayz	.keywordsz.keywords[{data__keywords_x}]r!z.classifiers must be arrayz.classifiersz#.classifiers[{data__classifiers_x}]z must be trove-classifierz.urls must be objectz.urlsz.urls.{data__urls_key}z must be urlz.urls must not contain r"r$z.scriptsz.gui-scriptsz%.entry-points.{data__entrypoints_key}z.entry-points must not contain z
.entry-pointsTz-.entry-points must be python-entrypoint-groupz6.entry-points must be named by propertyName definitionrqz.dependencies must be arrayz
.dependenciesz%.dependencies[{data__dependencies_x}]z%.optional-dependencies must be objectz.optional-dependenciesz7.optional-dependencies.{data__optionaldependencies_key}rMz[.optional-dependencies.{data__optionaldependencies_key}[{data__optionaldependencies_val_x}]z(.optional-dependencies must not contain z0.optional-dependencies must be pep508-identifierz?.optional-dependencies must be named by propertyName definitionz.dynamic must be arrayrNz.dynamic[{data__dynamic_x}]z must be one of ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']r#c3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..s'@@D44<@@@@@@r)rzz$ must contain ['dynamic'] propertiesz2.dynamic must be same as const definition: versionz0.dynamic must contain one of contains definitionrz' must NOT match a disallowed definitionrc3 K|]}|vV	dSrrrs  rr zlvalidate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata..s'<<tt|<<<<<hdT##oo&r[-BF'CFW'W_cjlp{qF@FkGJLkLeMVitfz~@fygqyIcJJP[ct	K
^
R_
R_
IcJa
j
u
}
NFRZl
[l
[IcJ]ju}Q
z
|
DP
ElFlFIcJHPdzdzdzOWj]j]j]F^F^iq~EX^iqECEVDW`X`XWYhngoHpHpBHS[lOJPJPAQ`f_grhrhGi}j|JU]pC!pC!pC!Q!u!Lv!Lv!{w!F"T"E"U"lV"lV"|W"`X"`X"EY"RZ"RZ"IcJ\"m"x"@#L#`#t#e$g$x%s#y%o"z%o"z%IcJ|%E&W&`'|'B(M(U(i(o)q){)h(|)D(})D(}){'~)M*S*L*T*l'U*l'U*g*m*x*@+S+B.S+B.S+B.o*C.o*C.f*D.S.Y.R.Z.W*[.W*[.k'\.G&].G&].IcJ_.h.s.z.M/c/n/D0R0Q1[1c1E2M2a2l3n3E4`2F4|1G4|1G4[4c4o4z4K5j5R4k5R4k5s1l5s1l5E/m5E/m5@6S9@6S9@6S9j.T9j.T9IcJV9c9n9u9H:^:i::M;L<V<^<@=H=\=g>i>@?[=A?w>V?q=W?M=X?M=X?l?t?@@K@\@{@c?|@c?|@D=}@D=}@V:~@V:~@RAbBdBlCQAmC{9nC{9nC_yJpCzCEDLDXD^D`DhDWDiDzDJF|CKF|CKF_yJMFZFeFlF@GHGTGfGwGlHwFmHwFmHAIwIyIVJ@IWJ\FXJ\FXJ_yJZJ`JkJsJDKFL`LeL}LCMNMVMbMgMEMhMEMhM|LiMbJjMbJjM_yJlMuMM`NkNyNCOKO^OPT^OPT^OPTdTlTnTFUcTGUaUfU~UDVOVWVkVcWeWcXjVdXpXMY[YVZFVWZFVWZ}UXZwMYZwMYZ_yJ[ZhZrZS[^[l[v[~[Q\CaQ\CaQ\CaWa_aaayaVazaTbYbqbwbBcJc^cVdXdVe]cWece@fNfIgybJgybJgpbKgjZLgjZLg_yJNg\gpgpkpgpkpgpkDlLlNlglClhlBmGm_memomPn[ninsn{nNo@tNo@tNo@tTt\t^tvtStwtQuVunutuuGv[vSwUwSxZvTx`x}xKyFzvuGzvuGzmuHzgmIzgmIz^mJz^gKz^gKz_yJMz[zfzmz~za{t{N|Y|e|o|w|H}}K~S~l{T~l{T~]zU~]zU~_yJW~n~y~ARwK@S@U@h@J@i@CAHA`AfAqAxAKBeBpB|BFCNC_CVDbDjDCBkDCBkDhAlDhAlD_AmDp~nDp~nD_yJpDyDDEKE_EhFjFOG^EPG\GbGdGvJdGvJdGvJ[GwJ{DxJ{DxJ_yJHKNKGKOKiKnKLLULKLVLgLpL@MGMIMRMLSMgMINfMJNrLKNrLKNfLLN~KMN~KMN\NHW\NHW\NHWvKIWvKIWaWjW`WkWW~X~WXSW@YSW@YdYzYEZ[ZiZh[r[z[\\d\x\C^E^\^w\]^S\^^S\^^r^z^F_Q_b_A`i^B`i^B`J\C`J\C`\YD`\YD`c`DaOa]agaoaBbtfBbtfBbtfHgPgRgjgGgkgEhJhbhhhsh{hOiGjIjGkNiHkTkqkkzljh{ljh{lah|l[`}l[`}lUmomzmFnPnXnin`olotoMmuoMmuoQYvoQYvoowoowo~oHpIpIpIp
Ip		$$	YV$$$fJj300
L.r[5JF/KNd/dlv}DODYSY~Z]d~dzBS^j}q~q~EKLLLL*c**
]:~&9::FF]229N3ORs3s|FMOS^ShbhMilsMsIQbmyL@M@MT\]]]]	!!Y''' OMmc33
w.r[5JF/KNg/go|DFJUJ_Y_D`cmDmCK\T`hzizipvwwww---
}/~h/
>>}229N3ORk3ktAHJNYNc]cHdgqHqGO`Xdl~m~mt|}}}}I%%]+++ $] 3/#77
n.r[5JF/KNk/ktELNR]RgagLhkyLyOWkTV^j_F`F`gmnnnny  X&&&>L)*&)A--6%lS::e6r[=RF7SVn7nwCJLP[Pe_eJfirJrHPcVcVcVWW^deeee.!3../5555)A--06%lT;;E
6r[=RF7SVn7nwCJLP[Pe_eJfirJrHP]dw}HPdbducvwwvxGMFNgOgOagrzKnioio`pE~FQGQGfH\I[it|O	bO	bO	bpTkUkUZVesdtKuKu[vww~D
E
E
E
E
12.5>
>3=lD3Q3Q03	e36|3D3D 0'**U*U*U*UH*U*U*U'U'U!W*B2I^X^C_cMDMUahjnynC}ChDGPhPms~FZXZkYlumumln}C|D]E]ELV+W+W+W%W478I8I8K8K4L4L 1#)->#>#>$5$<$
>3=lD3Q3Q03	s36|3D3D 0'**U*U*U*UH*U*U*U'U'U!e*B2I^X^C_cMDMUahjnynC}ChDGPhPms~FWzu{u{l|KQJR]S]SZd+e+e+e%e478I8I8K8K4L4L 1#)->#>#>$5$<$>>-44^DDD8D^8T5#-.G##O#Of&>r[EZTZ?[_D@DLelnr}rGAGlHKalawReReResWnXnX_e'f'f'f!f.!3../5555)Q...r[5JF/KN/DHKNOiKjKjDjm~D~0GSZ\`k`uouZvyBZBawawawL	T	g	Z
g	Z
g	Z
C	[
C	[
f
n
{
BU[fnB@BSAT]U]UTVekdlEmEmEPXiLGMGM~N]c\doeoeDfz
gyGRZm@m@m@NrIsIsxtCQBRiSiSy
T]
U]
UB	VOWOW^effff	)).///#'(9#: 2S::
j.r[5JF/KNo/oxLSUYdYnhnSorDSDZbnBVGIZU[Q\Q\cijjjj.44
|;~&:;,>)""N"N"N"NX"N"N"NNNS":2AVPV;W[Fr[EZTZ?[^|?|EX_aepeztz_{~M_MckEGQ~RZSZSZ`'a'a'a!a0A500/5555+a//
6,6}d,K,K),	|,/
,>,>)""N"N"N"NX"N"N"NNNn":2AVPV;W[Fr[EZTZ?[^|?|EX_aepeztz_{~M_Mck~m~m~mZnZnu{'|'|'|!|0A500/5555+q00.r[5JF/KOA0AEILOPlLmLmEmpAEA0BJW^`dodysy^z}G^GdmIOZbv|~HuIQJQJHKZ`YaybybtzE	M	`	O`	O`	O|P|PsQ`f_gdhdhxiTjTjqxyyyy	!!Y''' OMmdE];;
q
.r[5JF/KNf/fn{CEITI^X^C_blClBI\r}Sa`jrT\p{}ToUKVKVjr~I	Z	y	az	az	B{	B{	T|	T|	O
b
O
b
O
b
yc
yc
j
p
q
q
q
q
$.}tUm$L$L!$
`$'
$6$6!;D];S;S``7O%7CDVXfiti~x~B_h_````I%%]+++ $] 3/$??
F
.r[5JF/KNj/jsDKMQ\Qf`fKgjxKxNUh~I_mlv~`h|GI`{aWbWbv~J	U	f	E
mF
mF
NG
NG
`H
`H
\
lnv[
wExExE
F
F
F
F
(23DtUm(T(T%(
l(+,=(>(>%CLM^C_C_ll?')?CDZ\jmxmB|BFklkllll""Z(((!*-NntUm<<
Y.r[5JF/KNg/go}EGKVK`Z`EadoEoELX^`hWizJ|K|KRXYYYY%/u
%N%N"%
B%(%8%8"=F~=V=VBB9$&9%&9CAAB6r[=RF7SV|VuV|WIWI@F@H@HWIWI8IL]8]exAEPEZTZ[^D^}^D^P^PGMGOGO^P^PPSUUciksbt{ABBBBBI%%]+++ $] 3/$??
O.r[5JF/KNj/jsDKMQ\Qf`fKgjxKxNUiq}O`U`V`Vj`bi@EAEAHNOOOO(23DtUm(T(T%(
E(+,=(>(>%CLM^C_C_EE?')?%&>EA~.@ABXYYE":2AVPV;W[GZ[G[S[SJPJRJR[S[SBBB).3@@D":2AVPV;WZyZrZy[F[F}C}E}E[F[F%#8#H#HG&>r[EZTZ?[^}^v^}_J_JAGAIAI_J_J@JM[@[cqxz~I~SMSxTWvWoWvWBWByyAyAWBWBxBEGxG]eqvTwTw~F'G'G'G!G"A229N3ORk3klopmAmA4ABO4OWahjnynC}ChDGNhNdl}Y^v|GO[`~a~aub[c[cj@AAAA	!!Y''' OM
FGTVdgrg|v|@JfJ
K
K
KI%%]+++#M2
FGWYgjujyCQiQ
R
R
RY&&^,,, $^ 4(23Dd(K(K%(
n),->-C-C-E-E)F)F&DUD[D[D]D]||@)+@%f-445JKK|04JJJ299:OPPPRShjx{F{PJPT{z{|||)D229N3ORs3stwyOuPuP4PQ^4^fw~@DODYSY~Z]l~lKKKKKK_giB	^C	]	b	z	@
J
k
v
DNVi[i[i[owyQnRlqIOZbvnpnuo{XfaQbQbHcB
dB
dy	eyfyfmCDDDD(+,=(>(>%(A--7;41BEE-E)*?EEf'P~6O'PQf'g'g!f*B2I^X^C_cRDRZovx|G|QKQvRUdvdrz|UqV]e+f+f+f%f7EEE?D<<<E;n6r[=RF7SWO8OWhoqu@uJDJoKN]o]||||||PXZsOtN	S	k	q	{	\
g
u

GZLZLZL`hjB_C]bz@KSg_a_f`lIWRBSBSyTs	Us	Uj	VjWjW^mnnnnY&&^,,,!%n!504-@@
N.r[5JF/KNk/ktFMOS^ShbhMil{M{QXiL_yDPZbsjv~WWH@H@GMNNNN)34Fu
)V)V&)
s),-?)@)@&ENOaEbEbssA(*AGH_aor}rGAGKrqrssss"i//4555)-.E)F&84AA
o	.r[5JF/KNu/u~X_aepeztz_{~V_VltEj~FH[}\v{SYdk~XcoyARI	U	]	v^	v^	[_	[_	R`	ca	ca	h	n	o	o	o	o	1;AAADEcAdAd>irtRjSjSAA e @Be!STwyGJUJ_Y_c@I@!A!A!A!A2y
229N3OR|3|~ABa~b~b4bcp4pxRY[_j_tntYuxPYPfndx@BUwVpuMS^exR]is{L	C
O
W
pX
pX
UY
UY
LZ
][
][
b
x
y
y
y
y
145O1P1P.1Q66@D=:TNN6N)*H#NNu'J~6I'JKi'j'j!u*B2I^X^C_cUDU]{BDHSH]W]B^ayByGOQdFelt+u+u+u%u7NNNHMEEENDZ
6r[=RF7SWX8X`zACGRG\V\A]`xAxNVgL`hj}_~X]u{FM`zEQ[ctk	w		X@
X@
}A
}A
tB
EC
EC
J
Y
Z
Z
Z
Z
	!!Y''' OMmdE];;
D	.r[5JF/KNf/fn{CEITI^X^C_blClBI]fhM\NZ`btbtbtYuyvyv}C	D	D	D	D	$.}tUm$L$L!$
Z$'
$6$6!;D];S;SZZ7O%7)2DDD6r[=RF7SVzVsVzWGWG~D~F~FWGWG8GJn8nvHOQU`UjdjOknRnKnRn^n^U[U]U]n^n^O^acOcqwyKyKyKpLSYZZZZD	cp*21F+GJ^+^_bcl_m_m+mn{+{DHOQU`UjdjOknpOpIqzMXJ^bdJ]KU]mGKntG	X	c
o
BvCvCmGKENYarjv~PPmGKA
N
Y
a
u
^`ht
iP
jP
jmGKltH^H^H^s{NANANAjBjBMUbi|BMUigizh{D|D|{}LRKSlTlTflwPsntnteuDJCKVLVLkMaN`nyATg!Tg!Tg!u!Y"pZ"pZ"_["j"x"i"y"Pz"Pz"`{"D|"D|"i}"v~"v~"mGK@#Q#\#d#p#D$X$I%K%\&W$]&S#^&S#^&mGK`&i&{&D(`(f(q(y(M)S*U*_*L)`*h(a*h(a*_(b*q*w*p*x*P(y*P(y*K+Q+\+d+w+f.w+f.w+f.S+g.S+g.J+h.w.}.v.~.{*.{*.O(@/k&A/k&A/mGKC/L/W/^/q/G0R0h0v0u11G2i2q2E3P4R4i4D3j4`2k4`2k44G5S5^5o5N6v4O6v4O6W2P6W2P6i/Q6i/Q6d6w9d6w9d6w9N/x9N/x9mGKz9G:R:Y:l:B;M;c;q;p<zK?M?d?=e?[=f?[=f?z?B@N@Y@j@IAq?JAq?JAR=KAR=KAd:LAd:LA`ApBrBzC_A{CI:|CI:|CmGK~CHDSDZDfDlDnDvDeDwDHEXFJDYFJDYFmGK[FhFsFzFNGVGbGtGEHzHEG{HEG{HOIEJGJdJNIeJjFfJjFfJmGKhJnJyJAKRKTLnLsLKMQM\MdMpMuMSMvMSMvMJMwMpJxMpJxMmGKzMCNMNnNyNGOQOYOlO^TlO^TlO^TrTzT|TTUqTUUoUtULVRV]VeVyVqWsWqXxVrX~X[YiYdZTVeZTVeZKVfZENgZENgZmGKiZvZ@[a[l[z[D\L\_\Qa_\Qa_\QaeamaoaGbdaHbbbgbbEcPcXclcddfddekceeqeNf\fWgGcXgGcXg~bYgxZZgxZZgmGK\gjg~g~k~g~k~g~kRlZl\lulQlvlPmUmmmsm}m^ninwnAoIo\oNt\oNt\oNtbtjtltDuatEu_udu|uBvMvUvivawcwaxhvbxnxKyYyTzDvUzDvUz{uVzumWzumWzlmXzlgYzlgYzmGK[ziztz{zL{o{B|\|g|s|}|E}V}M~Y~a~z{b~z{b~kzc~kzc~mGKe~|~GO`E@Y@a@c@v@X@w@QAVAnAtAAFBYBsB~BJCTC\CmCdDpDxDQByDQByDvAzDvAzDmA{D~~|D~~|DmGK~DGEREYEmEvFxF]GlE^GjGpGrGDKrGDKrGDKiGEKIEFKIEFKmGKVK\KUK]KwK|KZLcLYLdLuL~LNMUMWM`MMMaMuMWNtMXN@MYN@MYNtLZNLL[NLL[NjNVWjNVWjNVWDLWWDLWWoWxWnWyWMXLYLXMYaWNYaWNYrYHZSZiZwZv[@\H\j\r\F]Q^S^j^E]k^a\l^a\l^@_H_T___p_O`w^P`w^P`X\Q`X\Q`jYR`jYR`q`Ra]akaua}aPbBgPbBgPbBgVg^g`gxgUgygShXhphvhAiIi]iUjWjUk\iVkbkkMlHmxhImxhImohJmi`Kmi`Kmcm}mHnTn^nfnwnnozoBp[mCp[mCp_YDp_YDp}Ep}EpLpbpcpcpcp
cp!u	U%dD11L
Jt99@@@@K@@@@@[229N3ORx3xAELNR]RgagLhkmLmHQGRcl|CEN{OcEbFnGnGbHzIzIPZ[[[[		,,		))$$Y///$(OM,6}tUm,T,T),
J16.1>BB-B#4	#A#A*B2I^X^C_cWDW_pwy}H}RLRwSV`w`nuw@mAHO+P+P+P%P9= 6 %#;AAATTA5J":2AVPV;W[M*GHRRi6r[=RF7SVjVcVjVvVvmsmumuVvVv7vz`8`hpwy}H}RLRwSVjVcVjVvVvmsmumuVvVvwvy{w{QYmegelfrO]XHYHY`hiiii	}*21F+GJ^+^_bcl_m_m+mn{+{DHOQU`UjdjOknpOpEfqIQdV	dV	dV	j	r	t	L
i	M
g
l
DJU]qiki
pj
v
Sa\L]L]C^}_}_f|}}}
}t99q=="& 
0
00!(C00uG~.FGQQu":2AVPV;WZ{;{DLSUYdYnhnSortStBJLdAelt#u#u#uu/000*/'''0&
t.r[5JF/KNy/yBFMOS^ShbhMilnMnCdo}GObT	bT	bT	h	p	r	J
g	K
e
j
BHS[ogig
nh
t
Q_ZJ[J[A\{]{]dsttttKsAJJJcBt|ts6td|pdzdz|d|pdzdzdddddd	d
gdddd
ddddt|t}|r;t|}d|vr[|d|d}t|ts)td|pdzdz|d|pdzdzdd	d
gddd|vr|d|d}t|ts(td|pdzdz|d|pdzdzddd
ddt|trHtd|s(td|pdzdz|d|pdzdzddd
dd|S)Nrr
rrTrrrrrrr3rrr`rrrrr+rrrz.email must be stringz.emailrz.email must be idn-emailr)	r$r%rr&r'r(r.rTmatch)r
rrr3r4rdata__emails       rrrsvdT##O	&r[-BF'CFW'W_cjlp{qF@FkGJLkLawBXfeowYau@BYtZP[P[owCN_~ffG@	G@	YA	YA	H	N	O	O	O		O	dD))Ld		$$	YV$$$fJj300
J.r[5JF/KNd/dlv}DODYSY~Z]d~dzBVaczU{q|q|CIJJJJiW%%%w-KkC11
[.r[5JF/KNe/emx@BFQF[U[@\_g@g}EQ\mLtMtMTZ[[[[+s++
d%&<=CCKPPd229N3ORl3ltGIMXMb\bGcfnGnDLXctS{T{T[cddddKr)VERSIONrefastjsonschema_exceptionsrcompilerTrNoneTyperrr2rWrVrSr1r0rrrrrrr[s				??????
BJv
"*T

BJv&BJ'@AA	4::"$$vxFJGGGGRacpt^^^^@
}MQ####J}MQ$}MQ8888tEGTX&tvDHCCCCJ
MO]aTVdh>IKY]rPK!Hconfig/_validate_pyproject/__pycache__/extra_validations.cpython-311.pycnu[

,RerdZddlmZmZddlmZedeZGddeZd	ed
efdZefZ	dS)
zThe purpose of this module is implement PEP 621 validations that are
difficult to express as a JSON Schema (or that are not supported by the current
JSON Schema library).
)MappingTypeVar)ValidationErrorT)boundceZdZdZdS)RedefiningStaticFieldAsDynamiczAccording to PEP 621:

    Build back-ends MUST raise an error if the metadata specifies a field
    statically as well as being listed in dynamic.
    N)__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/extra_validations.pyr
r

srr
	pyprojectreturnc|di}|dg}|D]7}||vr1d|d}|dz
}d|}|||ddd|i}t|||d	
8|S)Nprojectdynamicz(You cannot provide a value for `project.z` and z0list it under `project.dynamic` at the same timez
data.project.z...z # ...zPEP 621)rule)getr
)r
project_tablerfieldmsgnamevalues       rvalidate_project_dynamicrsMM)R00M	2..GSSM!!JUJJJCEEC*5**DM%0%9gVE0eT	RRRR"rN)
rtypingrrerror_reportingrrr
rEXTRA_VALIDATIONSrrrr"s
$#######,,,,,,GCw_a./rPK!V@0O0OFconfig/_validate_pyproject/__pycache__/error_reporting.cpython-311.pycnu[

,Re,ddlZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZmZmZddlmZejeZddd	d
dZdZhd
ZejdZejdejZdddddZGddeZ edZ!GddZ"GddZ#de$dee$fdZ%dS)N)contextmanager)indentwrap)AnyDictIteratorListOptionalSequenceUnioncast)JsonSchemaValueExceptionzkeys must be named byzat least one item that matchesz"only items matching the definition)z(must be named by propertyName definitionzone of contains definitionz same as const definition:zonly specified items)zmust not be emptyzis always invalidzmust not be there>notanyOfitemsoneOfcontains
propertyNamesz\W+|([A-Z][^A-Z\W]*)z^[\w_]+$tablekeykeys)objectproperty
propertiesproperty namesc:eZdZdZdZdZdZedefdZ	dS)ValidationErroraReport violations of a given JSON schema.

    This class extends :exc:`~fastjsonschema.JsonSchemaValueException`
    by adding the following properties:

    - ``summary``: an improved version of the ``JsonSchemaValueException`` error message
      with only the necessary information)

    - ``details``: more contextual information about the error like the failing schema
      itself and the value that violates the schema.

    Depending on the level of the verbosity of the ``logging`` configuration
    the exception message will be only ``summary`` (default) or a combination of
    ``summary`` and ``details`` (when the logging level is set to :obj:`logging.DEBUG`).
    rexcXt|}|t||j|j|j|j}t
jdd}|dkr|j	|j
c|_	|_
|j|_|j
|_
|j|_|S)N JSONSCHEMA_DEBUG_CODE_GENERATIONfalse)_ErrorFormattingstrvaluename
definitionruleosgetenvlower	__cause__
__traceback__message_original_messagesummarydetails)clsr 	formatterobj
debug_codes     /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_validate_pyproject/error_reporting.py_from_jsonschemaz ValidationError._from_jsonschema=s$R((	c#i.."(INBM27SSYA7KKQQSS
  /1|R=M,CM3, "
''
N)
__name__
__module____qualname____doc__r1r2r0classmethodrr8r9r7rr(sV GG	":			[			r9rc#nK	dVdS#t$r }t|dd}~wwxYwN)rrr8)r s r7detailed_errorsrBJsM=
#===..r22<=s

4/4cveZdZdefdZdefdZedefdZedefdZ	dZ
dZdefd	Zd
S)r$r c||_d||jd|_|jj|j|j|_d|_d|_dS)N`r)r _simplify_namer'r/replacer0_summary_details)selfr s  r7__init__z_ErrorFormatting.__init__Ss]7++BG44777	!%!8!8$)!L!L



r9returncttjkr|jr|jd|jS|jS)N

)_loggergetEffectiveLevelloggingDEBUGr2r1rJs r7__str__z_ErrorFormatting.__str__ZsB$$&&'-77DL7l66666|r9cP|js||_|jSrA)rH_expand_summaryrSs r7r1z_ErrorFormatting.summary`'}	3 0022DM}r9cP|js||_|jSrA)rI_expand_detailsrSs r7r2z_ErrorFormatting.detailsgrWr9cbtd}|dr
||dn|S)Nzdata.)len
startswith)rJr'xs   r7rFz_ErrorFormatting._simplify_namens0LL??733=tABBxx=r9cj|jtD]\}}||t	fdt
DrS|jj}|jjtvr4|r2tt}dt||dSS)Nc3 K|]}|vV	dSrAr?).0	substringmsgs  r7	z3_ErrorFormatting._expand_summary..xs(??IyC??????r9z:

    )
r0_MESSAGE_REPLACEMENTSrrGany
_SKIP_DETAILSr rule_definitionr)
_NEED_DETAILS_SummaryWriter_TOML_JARGONr)rJbadreplschemar1rbs     @r7rVz _ErrorFormatting._expand_summaryrs$.4466	)	)IC++c4((CC?????????	J(7<=((V($\22GAAwwv ? ?AAA
r9c	Jg}|jjdg}|jjddpd|}|r?dt	|dddd}|d	|t
j|jjd
}t
j|jjd
}dt|dd
|jj
dt|dg}d||zS)Nz
$$descriptiondescription 
PrdF)widthinitial_indentsubsequent_indentbreak_long_wordsz
DESCRIPTION:
)rz
GIVEN VALUE:
zOFFENDING RULE: zDEFINITION:
rN)r r(popjoinrappendjsondumpsr&rr))rJoptional
desc_linesdescrprnr&defaultss        r7rYz _ErrorFormatting._expand_detailss/W'++OR@@
w!%%mT::Rchhz>R>R
	<))#)&,%*K
OO:[::;;;DG.q999
47=3334VE62244/tw|//4F662244

{{8h.///r9N)
r:r;r<rrKr%rTrr1r2rFrVrYr?r9r7r$r$Rs3XX>>> 0000000r9r$c
eZdZhdZddeeeeffdZdeee	efdeee	effdZ
	dd	d
deee	efded
eedefdZ
deedefdZdedeefdZdedeedeefdZ	ddededeedefdZdeefdZdeedefdZdedeedefdZdedeedeefdZdededefdZdS) rj>titledefaultexamplesrpNjargonc|pi|_dddd|ddddd|d	|d
ddd
d|_gd|_dS)Nzat least one of the followingzexactly one of the followingzall of the followingz(*NOT* the following)rz (in order)zcontains at least one ofznon-predefined acceptable rrz named via patternzpredefined valuezone of)rrallOfrprefixItemsrrrpatternPropertiesconstenum)rr	maxLength	minLengthpatternformatminimummaximumexclusiveMinimumexclusiveMaximum
multipleOf)r_jargon_terms_guess_inline_defs)rJrs  r7rKz_SummaryWriter.__init__s&,l53+*"ll733@@@2MT\\:J-K-KMM$(LL$>$>!R!R!R'

"#
#
#
r9termrLct|trfd|DSj||S)NcFg|]}j||Sr?)rget)r`trJs  r7
z*_SummaryWriter._jargon..s)888aDKOOAq))888r9)
isinstancelistrr)rJrs` r7rz_SummaryWriter._jargonsEdD!!	9888848888{tT***r9rr?_pathrnprefixrc
t|tr||||S|||}|||}|r||S||d}||d}t
|dz}tj5}	t|
D][\}
\}}g||}
|
dkr|n|}|	|||
dt|trX|||
}|||
}|	|rd|nd||||
t|trf|dks||
rK||||
}|d	rdnd}|	||.|	d|||
d]|	cdddS#1swxYwYdS)
Nz  - rqr:rrrtype[)rr_handle_list_filter_unecessary_handle_simple_dict
_child_prefixr[ioStringIO	enumeraterwrite_labeldict_is_propertyr\_valuegetvalue)rJrnrrfilteredsimplechild_prefixitem_prefixrbufferirr&
child_pathline_prefixchildrenseps                 r7__call__z_SummaryWriter.__call__sfd##	<$$VVU;;;**6599))(E::	'&f&&&))&$77((66Vs"
[]]	%f#,X^^-=-=#>#>
I
I.s/333>>!$$333333r9z$_)rrf_IGNORE)rJrrs  @r7_is_unecessaryz_SummaryWriter._is_unecessarys]T""	$	52h3333d33333Jsdl7JJr9cHfd|DS)NcNi|]!\}}g|||"Sr?)r)r`rr&rrJs   r7
z5_SummaryWriter._filter_unecessary..sK


U&&||s|44



r9)r)rJrnrs` `r7rz!_SummaryWriter._filter_unecessarys<




$llnn


	
r9r&ctfd|jD}tdD}|s|r-dd||dSdS)Nc3 K|]}|vV	dSrAr?)r`pr&s  r7rcz5_SummaryWriter._handle_simple_dict..s'AAAQ%ZAAAAAAr9c3NK|] }t|ttfV!dSrA)rrr)r`vs  r7rcz5_SummaryWriter._handle_simple_dict..s0MMAd|44MMMMMMr9{, z}
)rfrvaluesrz
_inline_attrs)rJr&rinliners `   r7rz"_SummaryWriter._handle_simple_dictsAAAA)@AAAAAMMellnnMMMMMM	IV	IH		$"4"4UD"A"ABBHHHHtr9schemascBrdSt|}td|Drt|dkr|dS|ddfdt
|DS)Nrc3PK|]!}t|ttfV"dSrA)rrr)r`es  r7rcz._SummaryWriter._handle_list..
s3@@1:a$...@@@@@@r9<rrrc	3JK|]\}}|gd|dVdS)r]rNr?)r`rrrrrJs   r7rcz._SummaryWriter._handle_list..s\

>BaDDK'8'8x1xxx'8999





r9)rreprallr[rrzr)rJrrrrepr_rs`  ` @r7rz_SummaryWriter._handle_listst$$	2W

@@@@@@@	 SZZRT__<<<((66ww





FOPWFXFX




	
r9cJd}|dddD]
}|dvrn|dz
}|dzdkS)zGCheck if the given path can correspond to an arbitrarily named propertyrNr>rrrr?)rJrcounterrs    r7rz_SummaryWriter._is_propertysMB<		C===qLGG{ar9c|^}}||sQt|}|j|p'd||S|ddkrd|dSt
|S)Nrqrrz(regex ))r_separate_termsrrrzrr)rJrparentsrnorm_keys     r7rz_SummaryWriter._labels
#  &&	L&s++H;??3''K388DLL4J4J+K+KK2;---%S%%%%Cyyr9c|ddkrm||sX||}t|trdd|dntt|St|S)Nrrrrr)rrrrrzr
r%r)rJr&rtype_s    r7rz_SummaryWriter._value(s8vd&7&7&=&=LL''E+5eT+B+BX'DIIe$$''''SRWHXHX
E{{r9c#K|D];\}}g||}||d|||V>> _separate_terms("FooBar-foo")
    ['foo', 'bar', 'foo']
    c:g|]}||Sr?)r,)r`ws  r7rz#_separate_terms..>s%EEE!1EAGGIIEEEr9)_CAMEL_CASE_SPLITTERsplit)rs r7rr9s(
FE399$??EEEEr9)&rr|rQr*re
contextlibrtextwraprrtypingrrrr	r
rrr
fastjsonschema_exceptionsr	getLoggerr:rOrergricompilerI_IDENTIFIERrkrrBr$rjr%rr?r9r7rs												%%%%%%!!!!!!!!MMMMMMMMMMMMMMMMMMMM??????
'
H
%
%1H"B"$@	
YXX
!rz"9::bjbd++	.D===F0F0F0F0F0F0F0F0R[7[7[7[7[7[7[7[7|F#F$s)FFFFFFr9PK!G/config/_validate_pyproject/extra_validations.pynu["""The purpose of this module is implement PEP 621 validations that are
difficult to express as a JSON Schema (or that are not supported by the current
JSON Schema library).
"""

from typing import Mapping, TypeVar

from .error_reporting import ValidationError

T = TypeVar("T", bound=Mapping)


class RedefiningStaticFieldAsDynamic(ValidationError):
    """According to PEP 621:

    Build back-ends MUST raise an error if the metadata specifies a field
    statically as well as being listed in dynamic.
    """


def validate_project_dynamic(pyproject: T) -> T:
    project_table = pyproject.get("project", {})
    dynamic = project_table.get("dynamic", [])

    for field in dynamic:
        if field in project_table:
            msg = f"You cannot provide a value for `project.{field}` and "
            msg += "list it under `project.dynamic` at the same time"
            name = f"data.project.{field}"
            value = {field: project_table[field], "...": " # ...", "dynamic": dynamic}
            raise RedefiningStaticFieldAsDynamic(msg, value, name, rule="PEP 621")

    return pyproject


EXTRA_VALIDATIONS = (validate_project_dynamic,)
PK!o^7LL7config/_validate_pyproject/fastjsonschema_exceptions.pynu[import re


SPLIT_RE = re.compile(r'[\.\[\]]+')


class JsonSchemaException(ValueError):
    """
    Base exception of ``fastjsonschema`` library.
    """


class JsonSchemaValueException(JsonSchemaException):
    """
    Exception raised by validation function. Available properties:

     * ``message`` containing human-readable information what is wrong (e.g. ``data.property[index] must be smaller than or equal to 42``),
     * invalid ``value`` (e.g. ``60``),
     * ``name`` of a path in the data structure (e.g. ``data.property[index]``),
     * ``path`` as an array in the data structure (e.g. ``['data', 'property', 'index']``),
     * the whole ``definition`` which the ``value`` has to fulfil (e.g. ``{'type': 'number', 'maximum': 42}``),
     * ``rule`` which the ``value`` is breaking (e.g. ``maximum``)
     * and ``rule_definition`` (e.g. ``42``).

    .. versionchanged:: 2.14.0
        Added all extra properties.
    """

    def __init__(self, message, value=None, name=None, definition=None, rule=None):
        super().__init__(message)
        self.message = message
        self.value = value
        self.name = name
        self.definition = definition
        self.rule = rule

    @property
    def path(self):
        return [item for item in SPLIT_RE.split(self.name) if item != '']

    @property
    def rule_definition(self):
        if not self.rule or not self.definition:
            return None
        return self.definition.get(self.rule)


class JsonSchemaDefinitionException(JsonSchemaException):
    """
    Exception raised by generator of validation function.
    """
PK!N,,-config/_validate_pyproject/error_reporting.pynu[import io
import json
import logging
import os
import re
from contextlib import contextmanager
from textwrap import indent, wrap
from typing import Any, Dict, Iterator, List, Optional, Sequence, Union, cast

from .fastjsonschema_exceptions import JsonSchemaValueException

_logger = logging.getLogger(__name__)

_MESSAGE_REPLACEMENTS = {
    "must be named by propertyName definition": "keys must be named by",
    "one of contains definition": "at least one item that matches",
    " same as const definition:": "",
    "only specified items": "only items matching the definition",
}

_SKIP_DETAILS = (
    "must not be empty",
    "is always invalid",
    "must not be there",
)

_NEED_DETAILS = {"anyOf", "oneOf", "anyOf", "contains", "propertyNames", "not", "items"}

_CAMEL_CASE_SPLITTER = re.compile(r"\W+|([A-Z][^A-Z\W]*)")
_IDENTIFIER = re.compile(r"^[\w_]+$", re.I)

_TOML_JARGON = {
    "object": "table",
    "property": "key",
    "properties": "keys",
    "property names": "keys",
}


class ValidationError(JsonSchemaValueException):
    """Report violations of a given JSON schema.

    This class extends :exc:`~fastjsonschema.JsonSchemaValueException`
    by adding the following properties:

    - ``summary``: an improved version of the ``JsonSchemaValueException`` error message
      with only the necessary information)

    - ``details``: more contextual information about the error like the failing schema
      itself and the value that violates the schema.

    Depending on the level of the verbosity of the ``logging`` configuration
    the exception message will be only ``summary`` (default) or a combination of
    ``summary`` and ``details`` (when the logging level is set to :obj:`logging.DEBUG`).
    """

    summary = ""
    details = ""
    _original_message = ""

    @classmethod
    def _from_jsonschema(cls, ex: JsonSchemaValueException):
        formatter = _ErrorFormatting(ex)
        obj = cls(str(formatter), ex.value, formatter.name, ex.definition, ex.rule)
        debug_code = os.getenv("JSONSCHEMA_DEBUG_CODE_GENERATION", "false").lower()
        if debug_code != "false":  # pragma: no cover
            obj.__cause__, obj.__traceback__ = ex.__cause__, ex.__traceback__
        obj._original_message = ex.message
        obj.summary = formatter.summary
        obj.details = formatter.details
        return obj


@contextmanager
def detailed_errors():
    try:
        yield
    except JsonSchemaValueException as ex:
        raise ValidationError._from_jsonschema(ex) from None


class _ErrorFormatting:
    def __init__(self, ex: JsonSchemaValueException):
        self.ex = ex
        self.name = f"`{self._simplify_name(ex.name)}`"
        self._original_message = self.ex.message.replace(ex.name, self.name)
        self._summary = ""
        self._details = ""

    def __str__(self) -> str:
        if _logger.getEffectiveLevel() <= logging.DEBUG and self.details:
            return f"{self.summary}\n\n{self.details}"

        return self.summary

    @property
    def summary(self) -> str:
        if not self._summary:
            self._summary = self._expand_summary()

        return self._summary

    @property
    def details(self) -> str:
        if not self._details:
            self._details = self._expand_details()

        return self._details

    def _simplify_name(self, name):
        x = len("data.")
        return name[x:] if name.startswith("data.") else name

    def _expand_summary(self):
        msg = self._original_message

        for bad, repl in _MESSAGE_REPLACEMENTS.items():
            msg = msg.replace(bad, repl)

        if any(substring in msg for substring in _SKIP_DETAILS):
            return msg

        schema = self.ex.rule_definition
        if self.ex.rule in _NEED_DETAILS and schema:
            summary = _SummaryWriter(_TOML_JARGON)
            return f"{msg}:\n\n{indent(summary(schema), '    ')}"

        return msg

    def _expand_details(self) -> str:
        optional = []
        desc_lines = self.ex.definition.pop("$$description", [])
        desc = self.ex.definition.pop("description", None) or " ".join(desc_lines)
        if desc:
            description = "\n".join(
                wrap(
                    desc,
                    width=80,
                    initial_indent="    ",
                    subsequent_indent="    ",
                    break_long_words=False,
                )
            )
            optional.append(f"DESCRIPTION:\n{description}")
        schema = json.dumps(self.ex.definition, indent=4)
        value = json.dumps(self.ex.value, indent=4)
        defaults = [
            f"GIVEN VALUE:\n{indent(value, '    ')}",
            f"OFFENDING RULE: {self.ex.rule!r}",
            f"DEFINITION:\n{indent(schema, '    ')}",
        ]
        return "\n\n".join(optional + defaults)


class _SummaryWriter:
    _IGNORE = {"description", "default", "title", "examples"}

    def __init__(self, jargon: Optional[Dict[str, str]] = None):
        self.jargon: Dict[str, str] = jargon or {}
        # Clarify confusing terms
        self._terms = {
            "anyOf": "at least one of the following",
            "oneOf": "exactly one of the following",
            "allOf": "all of the following",
            "not": "(*NOT* the following)",
            "prefixItems": f"{self._jargon('items')} (in order)",
            "items": "items",
            "contains": "contains at least one of",
            "propertyNames": (
                f"non-predefined acceptable {self._jargon('property names')}"
            ),
            "patternProperties": f"{self._jargon('properties')} named via pattern",
            "const": "predefined value",
            "enum": "one of",
        }
        # Attributes that indicate that the definition is easy and can be done
        # inline (e.g. string and number)
        self._guess_inline_defs = [
            "enum",
            "const",
            "maxLength",
            "minLength",
            "pattern",
            "format",
            "minimum",
            "maximum",
            "exclusiveMinimum",
            "exclusiveMaximum",
            "multipleOf",
        ]

    def _jargon(self, term: Union[str, List[str]]) -> Union[str, List[str]]:
        if isinstance(term, list):
            return [self.jargon.get(t, t) for t in term]
        return self.jargon.get(term, term)

    def __call__(
        self,
        schema: Union[dict, List[dict]],
        prefix: str = "",
        *,
        _path: Sequence[str] = (),
    ) -> str:
        if isinstance(schema, list):
            return self._handle_list(schema, prefix, _path)

        filtered = self._filter_unecessary(schema, _path)
        simple = self._handle_simple_dict(filtered, _path)
        if simple:
            return f"{prefix}{simple}"

        child_prefix = self._child_prefix(prefix, "  ")
        item_prefix = self._child_prefix(prefix, "- ")
        indent = len(prefix) * " "
        with io.StringIO() as buffer:
            for i, (key, value) in enumerate(filtered.items()):
                child_path = [*_path, key]
                line_prefix = prefix if i == 0 else indent
                buffer.write(f"{line_prefix}{self._label(child_path)}:")
                # ^  just the first item should receive the complete prefix
                if isinstance(value, dict):
                    filtered = self._filter_unecessary(value, child_path)
                    simple = self._handle_simple_dict(filtered, child_path)
                    buffer.write(
                        f" {simple}"
                        if simple
                        else f"\n{self(value, child_prefix, _path=child_path)}"
                    )
                elif isinstance(value, list) and (
                    key != "type" or self._is_property(child_path)
                ):
                    children = self._handle_list(value, item_prefix, child_path)
                    sep = " " if children.startswith("[") else "\n"
                    buffer.write(f"{sep}{children}")
                else:
                    buffer.write(f" {self._value(value, child_path)}\n")
            return buffer.getvalue()

    def _is_unecessary(self, path: Sequence[str]) -> bool:
        if self._is_property(path) or not path:  # empty path => instruction @ root
            return False
        key = path[-1]
        return any(key.startswith(k) for k in "$_") or key in self._IGNORE

    def _filter_unecessary(self, schema: dict, path: Sequence[str]):
        return {
            key: value
            for key, value in schema.items()
            if not self._is_unecessary([*path, key])
        }

    def _handle_simple_dict(self, value: dict, path: Sequence[str]) -> Optional[str]:
        inline = any(p in value for p in self._guess_inline_defs)
        simple = not any(isinstance(v, (list, dict)) for v in value.values())
        if inline or simple:
            return f"{{{', '.join(self._inline_attrs(value, path))}}}\n"
        return None

    def _handle_list(
        self, schemas: list, prefix: str = "", path: Sequence[str] = ()
    ) -> str:
        if self._is_unecessary(path):
            return ""

        repr_ = repr(schemas)
        if all(not isinstance(e, (dict, list)) for e in schemas) and len(repr_) < 60:
            return f"{repr_}\n"

        item_prefix = self._child_prefix(prefix, "- ")
        return "".join(
            self(v, item_prefix, _path=[*path, f"[{i}]"]) for i, v in enumerate(schemas)
        )

    def _is_property(self, path: Sequence[str]):
        """Check if the given path can correspond to an arbitrarily named property"""
        counter = 0
        for key in path[-2::-1]:
            if key not in {"properties", "patternProperties"}:
                break
            counter += 1

        # If the counter if even, the path correspond to a JSON Schema keyword
        # otherwise it can be any arbitrary string naming a property
        return counter % 2 == 1

    def _label(self, path: Sequence[str]) -> str:
        *parents, key = path
        if not self._is_property(path):
            norm_key = _separate_terms(key)
            return self._terms.get(key) or " ".join(self._jargon(norm_key))

        if parents[-1] == "patternProperties":
            return f"(regex {key!r})"
        return repr(key)  # property name

    def _value(self, value: Any, path: Sequence[str]) -> str:
        if path[-1] == "type" and not self._is_property(path):
            type_ = self._jargon(value)
            return (
                f"[{', '.join(type_)}]" if isinstance(value, list) else cast(str, type_)
            )
        return repr(value)

    def _inline_attrs(self, schema: dict, path: Sequence[str]) -> Iterator[str]:
        for key, value in schema.items():
            child_path = [*path, key]
            yield f"{self._label(child_path)}: {self._value(value, child_path)}"

    def _child_prefix(self, parent_prefix: str, child_prefix: str) -> str:
        return len(parent_prefix) * " " + child_prefix


def _separate_terms(word: str) -> List[str]:
    """
    >>> _separate_terms("FooBar-foo")
    ['foo', 'bar', 'foo']
    """
    return [w.lower() for w in _CAMEL_CASE_SPLITTER.split(word) if w]
PK!fLL8config/_validate_pyproject/fastjsonschema_validations.pynu[# noqa
# type: ignore
# flake8: noqa
# pylint: skip-file
# mypy: ignore-errors
# yapf: disable
# pylama:skip=1


# *** PLEASE DO NOT MODIFY DIRECTLY: Automatically generated code *** 


VERSION = "2.15.3"
import re
from .fastjsonschema_exceptions import JsonSchemaValueException


REGEX_PATTERNS = {
    '^.*$': re.compile('^.*$'),
    '.+': re.compile('.+'),
    '^.+$': re.compile('^.+$'),
    'idn-email_re_pattern': re.compile('^[^@]+@[^@]+\\.[^@]+\\Z')
}

NoneType = type(None)

def validate(data, custom_formats={}, name_prefix=None):
    validate_https___packaging_python_org_en_latest_specifications_declaring_build_dependencies(data, custom_formats, (name_prefix or "data") + "")
    return data

def validate_https___packaging_python_org_en_latest_specifications_declaring_build_dependencies(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-build-dependencies/', 'title': 'Data structure for ``pyproject.toml`` files', '$$description': ['File format containing build-time configurations for the Python ecosystem. ', ':pep:`517` initially defined a build-system independent format for source trees', 'which was complemented by :pep:`518` to provide a way of specifying dependencies ', 'for building Python projects.', 'Please notice the ``project`` table (as initially defined in  :pep:`621`) is not included', 'in this schema and should be considered separately.'], 'type': 'object', 'additionalProperties': False, 'properties': {'build-system': {'type': 'object', 'description': 'Table used to store build-related data', 'additionalProperties': False, 'properties': {'requires': {'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, 'build-backend': {'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, 'backend-path': {'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}}, 'required': ['requires']}, 'project': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create command-line wrappers for the given', '`entry points `_.']}, 'gui-scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create GUI wrappers for the given', '`entry points `_.', 'The difference between ``scripts`` and ``gui-scripts`` is only relevant in', 'Windows.']}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$ref': '#/definitions/entry-point-group'}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$ref': '#/definitions/dependency'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$ref': '#/definitions/dependency'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}, 'tool': {'type': 'object', 'properties': {'distutils': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://docs.python.org/3/install/', 'title': '``tool.distutils`` table', '$$description': ['Originally, ``distutils`` allowed developers to configure arguments for', '``setup.py`` scripts via `distutils configuration files', '`_.', '``tool.distutils`` subtables could be used with the same purpose', '(NOT CURRENTLY IMPLEMENTED).'], 'type': 'object', 'properties': {'global': {'type': 'object', 'description': 'Global options applied to all ``distutils`` commands'}}, 'patternProperties': {'.+': {'type': 'object'}}, '$comment': 'TODO: Is there a practical way of making this schema more specific?'}, 'setuptools': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://setuptools.pypa.io/en/latest/references/keywords.html', 'title': '``tool.setuptools`` table', '$$description': ['Please notice for the time being the ``setuptools`` project does not specify', 'a way of configuring builds via ``pyproject.toml``.', 'Therefore this schema should be taken just as a *"thought experiment"* on how', 'this *might be done*, by following the principles established in', '`ini2toml `_.', 'It considers only ``setuptools`` `parameters', '`_', 'that can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`', 'but intentionally excludes ``dependency_links`` and ``setup_requires``.', 'NOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion with', 'entry-point based scripts (defined in :pep:`621`).'], 'type': 'object', 'additionalProperties': False, 'properties': {'platforms': {'type': 'array', 'items': {'type': 'string'}}, 'provides': {'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'obsoletes': {'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'zip-safe': {'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, 'script-files': {'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, 'eager-resources': {'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, 'packages': {'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$ref': '#/definitions/find-directive'}]}, 'package-dir': {'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, 'package-data': {'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'include-package-data': {'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, 'exclude-package-data': {'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'namespace-packages': {'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, 'py-modules': {'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, 'data-files': {'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'cmdclass': {'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, 'license-files': {'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, 'dynamic': {'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'$ref': '#/definitions/attr-directive'}, {'$ref': '#/definitions/file-directive'}]}, 'classifiers': {'$ref': '#/definitions/file-directive'}, 'description': {'$ref': '#/definitions/file-directive'}, 'dependencies': {'$ref': '#/definitions/file-directive'}, 'entry-points': {'$ref': '#/definitions/file-directive'}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$ref': '#/definitions/file-directive'}}}, 'readme': {'anyOf': [{'$ref': '#/definitions/file-directive'}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}}, 'definitions': {'file-directive': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'attr-directive': {'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, 'find-directive': {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}}}}}}, 'project': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create command-line wrappers for the given', '`entry points `_.']}, 'gui-scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create GUI wrappers for the given', '`entry points `_.', 'The difference between ``scripts`` and ``gui-scripts`` is only relevant in', 'Windows.']}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$ref': '#/definitions/entry-point-group'}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$ref': '#/definitions/dependency'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$ref': '#/definitions/dependency'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        if "build-system" in data_keys:
            data_keys.remove("build-system")
            data__buildsystem = data["build-system"]
            if not isinstance(data__buildsystem, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system must be object", value=data__buildsystem, name="" + (name_prefix or "data") + ".build-system", definition={'type': 'object', 'description': 'Table used to store build-related data', 'additionalProperties': False, 'properties': {'requires': {'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, 'build-backend': {'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, 'backend-path': {'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}}, 'required': ['requires']}, rule='type')
            data__buildsystem_is_dict = isinstance(data__buildsystem, dict)
            if data__buildsystem_is_dict:
                data__buildsystem_len = len(data__buildsystem)
                if not all(prop in data__buildsystem for prop in ['requires']):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system must contain ['requires'] properties", value=data__buildsystem, name="" + (name_prefix or "data") + ".build-system", definition={'type': 'object', 'description': 'Table used to store build-related data', 'additionalProperties': False, 'properties': {'requires': {'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, 'build-backend': {'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, 'backend-path': {'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}}, 'required': ['requires']}, rule='required')
                data__buildsystem_keys = set(data__buildsystem.keys())
                if "requires" in data__buildsystem_keys:
                    data__buildsystem_keys.remove("requires")
                    data__buildsystem__requires = data__buildsystem["requires"]
                    if not isinstance(data__buildsystem__requires, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.requires must be array", value=data__buildsystem__requires, name="" + (name_prefix or "data") + ".build-system.requires", definition={'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, rule='type')
                    data__buildsystem__requires_is_list = isinstance(data__buildsystem__requires, (list, tuple))
                    if data__buildsystem__requires_is_list:
                        data__buildsystem__requires_len = len(data__buildsystem__requires)
                        for data__buildsystem__requires_x, data__buildsystem__requires_item in enumerate(data__buildsystem__requires):
                            if not isinstance(data__buildsystem__requires_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.requires[{data__buildsystem__requires_x}]".format(**locals()) + " must be string", value=data__buildsystem__requires_item, name="" + (name_prefix or "data") + ".build-system.requires[{data__buildsystem__requires_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if "build-backend" in data__buildsystem_keys:
                    data__buildsystem_keys.remove("build-backend")
                    data__buildsystem__buildbackend = data__buildsystem["build-backend"]
                    if not isinstance(data__buildsystem__buildbackend, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.build-backend must be string", value=data__buildsystem__buildbackend, name="" + (name_prefix or "data") + ".build-system.build-backend", definition={'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, rule='type')
                    if isinstance(data__buildsystem__buildbackend, str):
                        if not custom_formats["pep517-backend-reference"](data__buildsystem__buildbackend):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.build-backend must be pep517-backend-reference", value=data__buildsystem__buildbackend, name="" + (name_prefix or "data") + ".build-system.build-backend", definition={'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, rule='format')
                if "backend-path" in data__buildsystem_keys:
                    data__buildsystem_keys.remove("backend-path")
                    data__buildsystem__backendpath = data__buildsystem["backend-path"]
                    if not isinstance(data__buildsystem__backendpath, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.backend-path must be array", value=data__buildsystem__backendpath, name="" + (name_prefix or "data") + ".build-system.backend-path", definition={'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}, rule='type')
                    data__buildsystem__backendpath_is_list = isinstance(data__buildsystem__backendpath, (list, tuple))
                    if data__buildsystem__backendpath_is_list:
                        data__buildsystem__backendpath_len = len(data__buildsystem__backendpath)
                        for data__buildsystem__backendpath_x, data__buildsystem__backendpath_item in enumerate(data__buildsystem__backendpath):
                            if not isinstance(data__buildsystem__backendpath_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system.backend-path[{data__buildsystem__backendpath_x}]".format(**locals()) + " must be string", value=data__buildsystem__backendpath_item, name="" + (name_prefix or "data") + ".build-system.backend-path[{data__buildsystem__backendpath_x}]".format(**locals()) + "", definition={'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}, rule='type')
                if data__buildsystem_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".build-system must not contain "+str(data__buildsystem_keys)+" properties", value=data__buildsystem, name="" + (name_prefix or "data") + ".build-system", definition={'type': 'object', 'description': 'Table used to store build-related data', 'additionalProperties': False, 'properties': {'requires': {'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, 'build-backend': {'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, 'backend-path': {'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}}, 'required': ['requires']}, rule='additionalProperties')
        if "project" in data_keys:
            data_keys.remove("project")
            data__project = data["project"]
            validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata(data__project, custom_formats, (name_prefix or "data") + ".project")
        if "tool" in data_keys:
            data_keys.remove("tool")
            data__tool = data["tool"]
            if not isinstance(data__tool, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".tool must be object", value=data__tool, name="" + (name_prefix or "data") + ".tool", definition={'type': 'object', 'properties': {'distutils': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://docs.python.org/3/install/', 'title': '``tool.distutils`` table', '$$description': ['Originally, ``distutils`` allowed developers to configure arguments for', '``setup.py`` scripts via `distutils configuration files', '`_.', '``tool.distutils`` subtables could be used with the same purpose', '(NOT CURRENTLY IMPLEMENTED).'], 'type': 'object', 'properties': {'global': {'type': 'object', 'description': 'Global options applied to all ``distutils`` commands'}}, 'patternProperties': {'.+': {'type': 'object'}}, '$comment': 'TODO: Is there a practical way of making this schema more specific?'}, 'setuptools': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://setuptools.pypa.io/en/latest/references/keywords.html', 'title': '``tool.setuptools`` table', '$$description': ['Please notice for the time being the ``setuptools`` project does not specify', 'a way of configuring builds via ``pyproject.toml``.', 'Therefore this schema should be taken just as a *"thought experiment"* on how', 'this *might be done*, by following the principles established in', '`ini2toml `_.', 'It considers only ``setuptools`` `parameters', '`_', 'that can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`', 'but intentionally excludes ``dependency_links`` and ``setup_requires``.', 'NOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion with', 'entry-point based scripts (defined in :pep:`621`).'], 'type': 'object', 'additionalProperties': False, 'properties': {'platforms': {'type': 'array', 'items': {'type': 'string'}}, 'provides': {'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'obsoletes': {'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'zip-safe': {'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, 'script-files': {'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, 'eager-resources': {'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, 'packages': {'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$ref': '#/definitions/find-directive'}]}, 'package-dir': {'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, 'package-data': {'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'include-package-data': {'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, 'exclude-package-data': {'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'namespace-packages': {'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, 'py-modules': {'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, 'data-files': {'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'cmdclass': {'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, 'license-files': {'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, 'dynamic': {'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'$ref': '#/definitions/attr-directive'}, {'$ref': '#/definitions/file-directive'}]}, 'classifiers': {'$ref': '#/definitions/file-directive'}, 'description': {'$ref': '#/definitions/file-directive'}, 'dependencies': {'$ref': '#/definitions/file-directive'}, 'entry-points': {'$ref': '#/definitions/file-directive'}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$ref': '#/definitions/file-directive'}}}, 'readme': {'anyOf': [{'$ref': '#/definitions/file-directive'}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}}, 'definitions': {'file-directive': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'attr-directive': {'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, 'find-directive': {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}}}}}, rule='type')
            data__tool_is_dict = isinstance(data__tool, dict)
            if data__tool_is_dict:
                data__tool_keys = set(data__tool.keys())
                if "distutils" in data__tool_keys:
                    data__tool_keys.remove("distutils")
                    data__tool__distutils = data__tool["distutils"]
                    validate_https___docs_python_org_3_install(data__tool__distutils, custom_formats, (name_prefix or "data") + ".tool.distutils")
                if "setuptools" in data__tool_keys:
                    data__tool_keys.remove("setuptools")
                    data__tool__setuptools = data__tool["setuptools"]
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html(data__tool__setuptools, custom_formats, (name_prefix or "data") + ".tool.setuptools")
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-build-dependencies/', 'title': 'Data structure for ``pyproject.toml`` files', '$$description': ['File format containing build-time configurations for the Python ecosystem. ', ':pep:`517` initially defined a build-system independent format for source trees', 'which was complemented by :pep:`518` to provide a way of specifying dependencies ', 'for building Python projects.', 'Please notice the ``project`` table (as initially defined in  :pep:`621`) is not included', 'in this schema and should be considered separately.'], 'type': 'object', 'additionalProperties': False, 'properties': {'build-system': {'type': 'object', 'description': 'Table used to store build-related data', 'additionalProperties': False, 'properties': {'requires': {'type': 'array', '$$description': ['List of dependencies in the :pep:`508` format required to execute the build', 'system. Please notice that the resulting dependency graph', '**MUST NOT contain cycles**'], 'items': {'type': 'string'}}, 'build-backend': {'type': 'string', 'description': 'Python object that will be used to perform the build according to :pep:`517`', 'format': 'pep517-backend-reference'}, 'backend-path': {'type': 'array', '$$description': ['List of directories to be prepended to ``sys.path`` when loading the', 'back-end, and running its hooks'], 'items': {'type': 'string', '$comment': 'Should be a path (TODO: enforce it with format?)'}}}, 'required': ['requires']}, 'project': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create command-line wrappers for the given', '`entry points `_.']}, 'gui-scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create GUI wrappers for the given', '`entry points `_.', 'The difference between ``scripts`` and ``gui-scripts`` is only relevant in', 'Windows.']}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$ref': '#/definitions/entry-point-group'}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$ref': '#/definitions/dependency'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$ref': '#/definitions/dependency'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}, 'tool': {'type': 'object', 'properties': {'distutils': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://docs.python.org/3/install/', 'title': '``tool.distutils`` table', '$$description': ['Originally, ``distutils`` allowed developers to configure arguments for', '``setup.py`` scripts via `distutils configuration files', '`_.', '``tool.distutils`` subtables could be used with the same purpose', '(NOT CURRENTLY IMPLEMENTED).'], 'type': 'object', 'properties': {'global': {'type': 'object', 'description': 'Global options applied to all ``distutils`` commands'}}, 'patternProperties': {'.+': {'type': 'object'}}, '$comment': 'TODO: Is there a practical way of making this schema more specific?'}, 'setuptools': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://setuptools.pypa.io/en/latest/references/keywords.html', 'title': '``tool.setuptools`` table', '$$description': ['Please notice for the time being the ``setuptools`` project does not specify', 'a way of configuring builds via ``pyproject.toml``.', 'Therefore this schema should be taken just as a *"thought experiment"* on how', 'this *might be done*, by following the principles established in', '`ini2toml `_.', 'It considers only ``setuptools`` `parameters', '`_', 'that can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`', 'but intentionally excludes ``dependency_links`` and ``setup_requires``.', 'NOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion with', 'entry-point based scripts (defined in :pep:`621`).'], 'type': 'object', 'additionalProperties': False, 'properties': {'platforms': {'type': 'array', 'items': {'type': 'string'}}, 'provides': {'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'obsoletes': {'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'zip-safe': {'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, 'script-files': {'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, 'eager-resources': {'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, 'packages': {'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$ref': '#/definitions/find-directive'}]}, 'package-dir': {'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, 'package-data': {'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'include-package-data': {'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, 'exclude-package-data': {'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'namespace-packages': {'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, 'py-modules': {'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, 'data-files': {'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'cmdclass': {'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, 'license-files': {'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, 'dynamic': {'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'$ref': '#/definitions/attr-directive'}, {'$ref': '#/definitions/file-directive'}]}, 'classifiers': {'$ref': '#/definitions/file-directive'}, 'description': {'$ref': '#/definitions/file-directive'}, 'dependencies': {'$ref': '#/definitions/file-directive'}, 'entry-points': {'$ref': '#/definitions/file-directive'}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$ref': '#/definitions/file-directive'}}}, 'readme': {'anyOf': [{'$ref': '#/definitions/file-directive'}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}}, 'definitions': {'file-directive': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'attr-directive': {'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, 'find-directive': {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}}}}}}, 'project': {'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$ref': '#/definitions/author'}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create command-line wrappers for the given', '`entry points `_.']}, 'gui-scripts': {'$ref': '#/definitions/entry-point-group', '$$description': ['Instruct the installer to create GUI wrappers for the given', '`entry points `_.', 'The difference between ``scripts`` and ``gui-scripts`` is only relevant in', 'Windows.']}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$ref': '#/definitions/entry-point-group'}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$ref': '#/definitions/dependency'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$ref': '#/definitions/dependency'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, rule='additionalProperties')
    return data

def validate_https___setuptools_pypa_io_en_latest_references_keywords_html(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://setuptools.pypa.io/en/latest/references/keywords.html', 'title': '``tool.setuptools`` table', '$$description': ['Please notice for the time being the ``setuptools`` project does not specify', 'a way of configuring builds via ``pyproject.toml``.', 'Therefore this schema should be taken just as a *"thought experiment"* on how', 'this *might be done*, by following the principles established in', '`ini2toml `_.', 'It considers only ``setuptools`` `parameters', '`_', 'that can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`', 'but intentionally excludes ``dependency_links`` and ``setup_requires``.', 'NOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion with', 'entry-point based scripts (defined in :pep:`621`).'], 'type': 'object', 'additionalProperties': False, 'properties': {'platforms': {'type': 'array', 'items': {'type': 'string'}}, 'provides': {'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'obsoletes': {'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'zip-safe': {'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, 'script-files': {'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, 'eager-resources': {'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, 'packages': {'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}]}, 'package-dir': {'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, 'package-data': {'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'include-package-data': {'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, 'exclude-package-data': {'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'namespace-packages': {'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, 'py-modules': {'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, 'data-files': {'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'cmdclass': {'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, 'license-files': {'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, 'dynamic': {'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}]}, 'classifiers': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'description': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'dependencies': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'entry-points': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, 'readme': {'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}}, 'definitions': {'file-directive': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'attr-directive': {'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, 'find-directive': {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        if "platforms" in data_keys:
            data_keys.remove("platforms")
            data__platforms = data["platforms"]
            if not isinstance(data__platforms, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".platforms must be array", value=data__platforms, name="" + (name_prefix or "data") + ".platforms", definition={'type': 'array', 'items': {'type': 'string'}}, rule='type')
            data__platforms_is_list = isinstance(data__platforms, (list, tuple))
            if data__platforms_is_list:
                data__platforms_len = len(data__platforms)
                for data__platforms_x, data__platforms_item in enumerate(data__platforms):
                    if not isinstance(data__platforms_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".platforms[{data__platforms_x}]".format(**locals()) + " must be string", value=data__platforms_item, name="" + (name_prefix or "data") + ".platforms[{data__platforms_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        if "provides" in data_keys:
            data_keys.remove("provides")
            data__provides = data["provides"]
            if not isinstance(data__provides, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".provides must be array", value=data__provides, name="" + (name_prefix or "data") + ".provides", definition={'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, rule='type')
            data__provides_is_list = isinstance(data__provides, (list, tuple))
            if data__provides_is_list:
                data__provides_len = len(data__provides)
                for data__provides_x, data__provides_item in enumerate(data__provides):
                    if not isinstance(data__provides_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".provides[{data__provides_x}]".format(**locals()) + " must be string", value=data__provides_item, name="" + (name_prefix or "data") + ".provides[{data__provides_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'pep508-identifier'}, rule='type')
                    if isinstance(data__provides_item, str):
                        if not custom_formats["pep508-identifier"](data__provides_item):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".provides[{data__provides_x}]".format(**locals()) + " must be pep508-identifier", value=data__provides_item, name="" + (name_prefix or "data") + ".provides[{data__provides_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'pep508-identifier'}, rule='format')
        if "obsoletes" in data_keys:
            data_keys.remove("obsoletes")
            data__obsoletes = data["obsoletes"]
            if not isinstance(data__obsoletes, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".obsoletes must be array", value=data__obsoletes, name="" + (name_prefix or "data") + ".obsoletes", definition={'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, rule='type')
            data__obsoletes_is_list = isinstance(data__obsoletes, (list, tuple))
            if data__obsoletes_is_list:
                data__obsoletes_len = len(data__obsoletes)
                for data__obsoletes_x, data__obsoletes_item in enumerate(data__obsoletes):
                    if not isinstance(data__obsoletes_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".obsoletes[{data__obsoletes_x}]".format(**locals()) + " must be string", value=data__obsoletes_item, name="" + (name_prefix or "data") + ".obsoletes[{data__obsoletes_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'pep508-identifier'}, rule='type')
                    if isinstance(data__obsoletes_item, str):
                        if not custom_formats["pep508-identifier"](data__obsoletes_item):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".obsoletes[{data__obsoletes_x}]".format(**locals()) + " must be pep508-identifier", value=data__obsoletes_item, name="" + (name_prefix or "data") + ".obsoletes[{data__obsoletes_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'pep508-identifier'}, rule='format')
        if "zip-safe" in data_keys:
            data_keys.remove("zip-safe")
            data__zipsafe = data["zip-safe"]
            if not isinstance(data__zipsafe, (bool)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".zip-safe must be boolean", value=data__zipsafe, name="" + (name_prefix or "data") + ".zip-safe", definition={'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, rule='type')
        if "script-files" in data_keys:
            data_keys.remove("script-files")
            data__scriptfiles = data["script-files"]
            if not isinstance(data__scriptfiles, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".script-files must be array", value=data__scriptfiles, name="" + (name_prefix or "data") + ".script-files", definition={'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, rule='type')
            data__scriptfiles_is_list = isinstance(data__scriptfiles, (list, tuple))
            if data__scriptfiles_is_list:
                data__scriptfiles_len = len(data__scriptfiles)
                for data__scriptfiles_x, data__scriptfiles_item in enumerate(data__scriptfiles):
                    if not isinstance(data__scriptfiles_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".script-files[{data__scriptfiles_x}]".format(**locals()) + " must be string", value=data__scriptfiles_item, name="" + (name_prefix or "data") + ".script-files[{data__scriptfiles_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        if "eager-resources" in data_keys:
            data_keys.remove("eager-resources")
            data__eagerresources = data["eager-resources"]
            if not isinstance(data__eagerresources, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".eager-resources must be array", value=data__eagerresources, name="" + (name_prefix or "data") + ".eager-resources", definition={'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, rule='type')
            data__eagerresources_is_list = isinstance(data__eagerresources, (list, tuple))
            if data__eagerresources_is_list:
                data__eagerresources_len = len(data__eagerresources)
                for data__eagerresources_x, data__eagerresources_item in enumerate(data__eagerresources):
                    if not isinstance(data__eagerresources_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".eager-resources[{data__eagerresources_x}]".format(**locals()) + " must be string", value=data__eagerresources_item, name="" + (name_prefix or "data") + ".eager-resources[{data__eagerresources_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        if "packages" in data_keys:
            data_keys.remove("packages")
            data__packages = data["packages"]
            data__packages_one_of_count1 = 0
            if data__packages_one_of_count1 < 2:
                try:
                    if not isinstance(data__packages, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".packages must be array", value=data__packages, name="" + (name_prefix or "data") + ".packages", definition={'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, rule='type')
                    data__packages_is_list = isinstance(data__packages, (list, tuple))
                    if data__packages_is_list:
                        data__packages_len = len(data__packages)
                        for data__packages_x, data__packages_item in enumerate(data__packages):
                            if not isinstance(data__packages_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".packages[{data__packages_x}]".format(**locals()) + " must be string", value=data__packages_item, name="" + (name_prefix or "data") + ".packages[{data__packages_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='type')
                            if isinstance(data__packages_item, str):
                                if not custom_formats["python-module-name"](data__packages_item):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".packages[{data__packages_x}]".format(**locals()) + " must be python-module-name", value=data__packages_item, name="" + (name_prefix or "data") + ".packages[{data__packages_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='format')
                    data__packages_one_of_count1 += 1
                except JsonSchemaValueException: pass
            if data__packages_one_of_count1 < 2:
                try:
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_find_directive(data__packages, custom_formats, (name_prefix or "data") + ".packages")
                    data__packages_one_of_count1 += 1
                except JsonSchemaValueException: pass
            if data__packages_one_of_count1 != 1:
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".packages must be valid exactly by one definition" + (" (" + str(data__packages_one_of_count1) + " matches found)"), value=data__packages, name="" + (name_prefix or "data") + ".packages", definition={'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}]}, rule='oneOf')
        if "package-dir" in data_keys:
            data_keys.remove("package-dir")
            data__packagedir = data["package-dir"]
            if not isinstance(data__packagedir, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must be object", value=data__packagedir, name="" + (name_prefix or "data") + ".package-dir", definition={'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, rule='type')
            data__packagedir_is_dict = isinstance(data__packagedir, dict)
            if data__packagedir_is_dict:
                data__packagedir_keys = set(data__packagedir.keys())
                for data__packagedir_key, data__packagedir_val in data__packagedir.items():
                    if REGEX_PATTERNS['^.*$'].search(data__packagedir_key):
                        if data__packagedir_key in data__packagedir_keys:
                            data__packagedir_keys.remove(data__packagedir_key)
                        if not isinstance(data__packagedir_val, (str)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir.{data__packagedir_key}".format(**locals()) + " must be string", value=data__packagedir_val, name="" + (name_prefix or "data") + ".package-dir.{data__packagedir_key}".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if data__packagedir_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must not contain "+str(data__packagedir_keys)+" properties", value=data__packagedir, name="" + (name_prefix or "data") + ".package-dir", definition={'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, rule='additionalProperties')
                data__packagedir_len = len(data__packagedir)
                if data__packagedir_len != 0:
                    data__packagedir_property_names = True
                    for data__packagedir_key in data__packagedir:
                        try:
                            data__packagedir_key_one_of_count2 = 0
                            if data__packagedir_key_one_of_count2 < 2:
                                try:
                                    if isinstance(data__packagedir_key, str):
                                        if not custom_formats["python-module-name"](data__packagedir_key):
                                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must be python-module-name", value=data__packagedir_key, name="" + (name_prefix or "data") + ".package-dir", definition={'format': 'python-module-name'}, rule='format')
                                    data__packagedir_key_one_of_count2 += 1
                                except JsonSchemaValueException: pass
                            if data__packagedir_key_one_of_count2 < 2:
                                try:
                                    if data__packagedir_key != "":
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must be same as const definition: ", value=data__packagedir_key, name="" + (name_prefix or "data") + ".package-dir", definition={'const': ''}, rule='const')
                                    data__packagedir_key_one_of_count2 += 1
                                except JsonSchemaValueException: pass
                            if data__packagedir_key_one_of_count2 != 1:
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must be valid exactly by one definition" + (" (" + str(data__packagedir_key_one_of_count2) + " matches found)"), value=data__packagedir_key, name="" + (name_prefix or "data") + ".package-dir", definition={'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, rule='oneOf')
                        except JsonSchemaValueException:
                            data__packagedir_property_names = False
                    if not data__packagedir_property_names:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-dir must be named by propertyName definition", value=data__packagedir, name="" + (name_prefix or "data") + ".package-dir", definition={'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, rule='propertyNames')
        if "package-data" in data_keys:
            data_keys.remove("package-data")
            data__packagedata = data["package-data"]
            if not isinstance(data__packagedata, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must be object", value=data__packagedata, name="" + (name_prefix or "data") + ".package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='type')
            data__packagedata_is_dict = isinstance(data__packagedata, dict)
            if data__packagedata_is_dict:
                data__packagedata_keys = set(data__packagedata.keys())
                for data__packagedata_key, data__packagedata_val in data__packagedata.items():
                    if REGEX_PATTERNS['^.*$'].search(data__packagedata_key):
                        if data__packagedata_key in data__packagedata_keys:
                            data__packagedata_keys.remove(data__packagedata_key)
                        if not isinstance(data__packagedata_val, (list, tuple)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data.{data__packagedata_key}".format(**locals()) + " must be array", value=data__packagedata_val, name="" + (name_prefix or "data") + ".package-data.{data__packagedata_key}".format(**locals()) + "", definition={'type': 'array', 'items': {'type': 'string'}}, rule='type')
                        data__packagedata_val_is_list = isinstance(data__packagedata_val, (list, tuple))
                        if data__packagedata_val_is_list:
                            data__packagedata_val_len = len(data__packagedata_val)
                            for data__packagedata_val_x, data__packagedata_val_item in enumerate(data__packagedata_val):
                                if not isinstance(data__packagedata_val_item, (str)):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data.{data__packagedata_key}[{data__packagedata_val_x}]".format(**locals()) + " must be string", value=data__packagedata_val_item, name="" + (name_prefix or "data") + ".package-data.{data__packagedata_key}[{data__packagedata_val_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if data__packagedata_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must not contain "+str(data__packagedata_keys)+" properties", value=data__packagedata, name="" + (name_prefix or "data") + ".package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='additionalProperties')
                data__packagedata_len = len(data__packagedata)
                if data__packagedata_len != 0:
                    data__packagedata_property_names = True
                    for data__packagedata_key in data__packagedata:
                        try:
                            data__packagedata_key_one_of_count3 = 0
                            if data__packagedata_key_one_of_count3 < 2:
                                try:
                                    if isinstance(data__packagedata_key, str):
                                        if not custom_formats["python-module-name"](data__packagedata_key):
                                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must be python-module-name", value=data__packagedata_key, name="" + (name_prefix or "data") + ".package-data", definition={'format': 'python-module-name'}, rule='format')
                                    data__packagedata_key_one_of_count3 += 1
                                except JsonSchemaValueException: pass
                            if data__packagedata_key_one_of_count3 < 2:
                                try:
                                    if data__packagedata_key != "*":
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must be same as const definition: *", value=data__packagedata_key, name="" + (name_prefix or "data") + ".package-data", definition={'const': '*'}, rule='const')
                                    data__packagedata_key_one_of_count3 += 1
                                except JsonSchemaValueException: pass
                            if data__packagedata_key_one_of_count3 != 1:
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must be valid exactly by one definition" + (" (" + str(data__packagedata_key_one_of_count3) + " matches found)"), value=data__packagedata_key, name="" + (name_prefix or "data") + ".package-data", definition={'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, rule='oneOf')
                        except JsonSchemaValueException:
                            data__packagedata_property_names = False
                    if not data__packagedata_property_names:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".package-data must be named by propertyName definition", value=data__packagedata, name="" + (name_prefix or "data") + ".package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='propertyNames')
        if "include-package-data" in data_keys:
            data_keys.remove("include-package-data")
            data__includepackagedata = data["include-package-data"]
            if not isinstance(data__includepackagedata, (bool)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".include-package-data must be boolean", value=data__includepackagedata, name="" + (name_prefix or "data") + ".include-package-data", definition={'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, rule='type')
        if "exclude-package-data" in data_keys:
            data_keys.remove("exclude-package-data")
            data__excludepackagedata = data["exclude-package-data"]
            if not isinstance(data__excludepackagedata, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must be object", value=data__excludepackagedata, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='type')
            data__excludepackagedata_is_dict = isinstance(data__excludepackagedata, dict)
            if data__excludepackagedata_is_dict:
                data__excludepackagedata_keys = set(data__excludepackagedata.keys())
                for data__excludepackagedata_key, data__excludepackagedata_val in data__excludepackagedata.items():
                    if REGEX_PATTERNS['^.*$'].search(data__excludepackagedata_key):
                        if data__excludepackagedata_key in data__excludepackagedata_keys:
                            data__excludepackagedata_keys.remove(data__excludepackagedata_key)
                        if not isinstance(data__excludepackagedata_val, (list, tuple)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data.{data__excludepackagedata_key}".format(**locals()) + " must be array", value=data__excludepackagedata_val, name="" + (name_prefix or "data") + ".exclude-package-data.{data__excludepackagedata_key}".format(**locals()) + "", definition={'type': 'array', 'items': {'type': 'string'}}, rule='type')
                        data__excludepackagedata_val_is_list = isinstance(data__excludepackagedata_val, (list, tuple))
                        if data__excludepackagedata_val_is_list:
                            data__excludepackagedata_val_len = len(data__excludepackagedata_val)
                            for data__excludepackagedata_val_x, data__excludepackagedata_val_item in enumerate(data__excludepackagedata_val):
                                if not isinstance(data__excludepackagedata_val_item, (str)):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data.{data__excludepackagedata_key}[{data__excludepackagedata_val_x}]".format(**locals()) + " must be string", value=data__excludepackagedata_val_item, name="" + (name_prefix or "data") + ".exclude-package-data.{data__excludepackagedata_key}[{data__excludepackagedata_val_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if data__excludepackagedata_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must not contain "+str(data__excludepackagedata_keys)+" properties", value=data__excludepackagedata, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='additionalProperties')
                data__excludepackagedata_len = len(data__excludepackagedata)
                if data__excludepackagedata_len != 0:
                    data__excludepackagedata_property_names = True
                    for data__excludepackagedata_key in data__excludepackagedata:
                        try:
                            data__excludepackagedata_key_one_of_count4 = 0
                            if data__excludepackagedata_key_one_of_count4 < 2:
                                try:
                                    if isinstance(data__excludepackagedata_key, str):
                                        if not custom_formats["python-module-name"](data__excludepackagedata_key):
                                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must be python-module-name", value=data__excludepackagedata_key, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'format': 'python-module-name'}, rule='format')
                                    data__excludepackagedata_key_one_of_count4 += 1
                                except JsonSchemaValueException: pass
                            if data__excludepackagedata_key_one_of_count4 < 2:
                                try:
                                    if data__excludepackagedata_key != "*":
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must be same as const definition: *", value=data__excludepackagedata_key, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'const': '*'}, rule='const')
                                    data__excludepackagedata_key_one_of_count4 += 1
                                except JsonSchemaValueException: pass
                            if data__excludepackagedata_key_one_of_count4 != 1:
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must be valid exactly by one definition" + (" (" + str(data__excludepackagedata_key_one_of_count4) + " matches found)"), value=data__excludepackagedata_key, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, rule='oneOf')
                        except JsonSchemaValueException:
                            data__excludepackagedata_property_names = False
                    if not data__excludepackagedata_property_names:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".exclude-package-data must be named by propertyName definition", value=data__excludepackagedata, name="" + (name_prefix or "data") + ".exclude-package-data", definition={'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='propertyNames')
        if "namespace-packages" in data_keys:
            data_keys.remove("namespace-packages")
            data__namespacepackages = data["namespace-packages"]
            if not isinstance(data__namespacepackages, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".namespace-packages must be array", value=data__namespacepackages, name="" + (name_prefix or "data") + ".namespace-packages", definition={'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, rule='type')
            data__namespacepackages_is_list = isinstance(data__namespacepackages, (list, tuple))
            if data__namespacepackages_is_list:
                data__namespacepackages_len = len(data__namespacepackages)
                for data__namespacepackages_x, data__namespacepackages_item in enumerate(data__namespacepackages):
                    if not isinstance(data__namespacepackages_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".namespace-packages[{data__namespacepackages_x}]".format(**locals()) + " must be string", value=data__namespacepackages_item, name="" + (name_prefix or "data") + ".namespace-packages[{data__namespacepackages_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='type')
                    if isinstance(data__namespacepackages_item, str):
                        if not custom_formats["python-module-name"](data__namespacepackages_item):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".namespace-packages[{data__namespacepackages_x}]".format(**locals()) + " must be python-module-name", value=data__namespacepackages_item, name="" + (name_prefix or "data") + ".namespace-packages[{data__namespacepackages_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='format')
        if "py-modules" in data_keys:
            data_keys.remove("py-modules")
            data__pymodules = data["py-modules"]
            if not isinstance(data__pymodules, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".py-modules must be array", value=data__pymodules, name="" + (name_prefix or "data") + ".py-modules", definition={'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, rule='type')
            data__pymodules_is_list = isinstance(data__pymodules, (list, tuple))
            if data__pymodules_is_list:
                data__pymodules_len = len(data__pymodules)
                for data__pymodules_x, data__pymodules_item in enumerate(data__pymodules):
                    if not isinstance(data__pymodules_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".py-modules[{data__pymodules_x}]".format(**locals()) + " must be string", value=data__pymodules_item, name="" + (name_prefix or "data") + ".py-modules[{data__pymodules_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='type')
                    if isinstance(data__pymodules_item, str):
                        if not custom_formats["python-module-name"](data__pymodules_item):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".py-modules[{data__pymodules_x}]".format(**locals()) + " must be python-module-name", value=data__pymodules_item, name="" + (name_prefix or "data") + ".py-modules[{data__pymodules_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'python-module-name'}, rule='format')
        if "data-files" in data_keys:
            data_keys.remove("data-files")
            data__datafiles = data["data-files"]
            if not isinstance(data__datafiles, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".data-files must be object", value=data__datafiles, name="" + (name_prefix or "data") + ".data-files", definition={'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, rule='type')
            data__datafiles_is_dict = isinstance(data__datafiles, dict)
            if data__datafiles_is_dict:
                data__datafiles_keys = set(data__datafiles.keys())
                for data__datafiles_key, data__datafiles_val in data__datafiles.items():
                    if REGEX_PATTERNS['^.*$'].search(data__datafiles_key):
                        if data__datafiles_key in data__datafiles_keys:
                            data__datafiles_keys.remove(data__datafiles_key)
                        if not isinstance(data__datafiles_val, (list, tuple)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".data-files.{data__datafiles_key}".format(**locals()) + " must be array", value=data__datafiles_val, name="" + (name_prefix or "data") + ".data-files.{data__datafiles_key}".format(**locals()) + "", definition={'type': 'array', 'items': {'type': 'string'}}, rule='type')
                        data__datafiles_val_is_list = isinstance(data__datafiles_val, (list, tuple))
                        if data__datafiles_val_is_list:
                            data__datafiles_val_len = len(data__datafiles_val)
                            for data__datafiles_val_x, data__datafiles_val_item in enumerate(data__datafiles_val):
                                if not isinstance(data__datafiles_val_item, (str)):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".data-files.{data__datafiles_key}[{data__datafiles_val_x}]".format(**locals()) + " must be string", value=data__datafiles_val_item, name="" + (name_prefix or "data") + ".data-files.{data__datafiles_key}[{data__datafiles_val_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        if "cmdclass" in data_keys:
            data_keys.remove("cmdclass")
            data__cmdclass = data["cmdclass"]
            if not isinstance(data__cmdclass, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".cmdclass must be object", value=data__cmdclass, name="" + (name_prefix or "data") + ".cmdclass", definition={'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, rule='type')
            data__cmdclass_is_dict = isinstance(data__cmdclass, dict)
            if data__cmdclass_is_dict:
                data__cmdclass_keys = set(data__cmdclass.keys())
                for data__cmdclass_key, data__cmdclass_val in data__cmdclass.items():
                    if REGEX_PATTERNS['^.*$'].search(data__cmdclass_key):
                        if data__cmdclass_key in data__cmdclass_keys:
                            data__cmdclass_keys.remove(data__cmdclass_key)
                        if not isinstance(data__cmdclass_val, (str)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".cmdclass.{data__cmdclass_key}".format(**locals()) + " must be string", value=data__cmdclass_val, name="" + (name_prefix or "data") + ".cmdclass.{data__cmdclass_key}".format(**locals()) + "", definition={'type': 'string', 'format': 'python-qualified-identifier'}, rule='type')
                        if isinstance(data__cmdclass_val, str):
                            if not custom_formats["python-qualified-identifier"](data__cmdclass_val):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".cmdclass.{data__cmdclass_key}".format(**locals()) + " must be python-qualified-identifier", value=data__cmdclass_val, name="" + (name_prefix or "data") + ".cmdclass.{data__cmdclass_key}".format(**locals()) + "", definition={'type': 'string', 'format': 'python-qualified-identifier'}, rule='format')
        if "license-files" in data_keys:
            data_keys.remove("license-files")
            data__licensefiles = data["license-files"]
            if not isinstance(data__licensefiles, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".license-files must be array", value=data__licensefiles, name="" + (name_prefix or "data") + ".license-files", definition={'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, rule='type')
            data__licensefiles_is_list = isinstance(data__licensefiles, (list, tuple))
            if data__licensefiles_is_list:
                data__licensefiles_len = len(data__licensefiles)
                for data__licensefiles_x, data__licensefiles_item in enumerate(data__licensefiles):
                    if not isinstance(data__licensefiles_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".license-files[{data__licensefiles_x}]".format(**locals()) + " must be string", value=data__licensefiles_item, name="" + (name_prefix or "data") + ".license-files[{data__licensefiles_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        else: data["license-files"] = ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*']
        if "dynamic" in data_keys:
            data_keys.remove("dynamic")
            data__dynamic = data["dynamic"]
            if not isinstance(data__dynamic, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic must be object", value=data__dynamic, name="" + (name_prefix or "data") + ".dynamic", definition={'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}]}, 'classifiers': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'description': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'dependencies': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'entry-points': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, 'readme': {'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}, rule='type')
            data__dynamic_is_dict = isinstance(data__dynamic, dict)
            if data__dynamic_is_dict:
                data__dynamic_keys = set(data__dynamic.keys())
                if "version" in data__dynamic_keys:
                    data__dynamic_keys.remove("version")
                    data__dynamic__version = data__dynamic["version"]
                    data__dynamic__version_one_of_count5 = 0
                    if data__dynamic__version_one_of_count5 < 2:
                        try:
                            validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_attr_directive(data__dynamic__version, custom_formats, (name_prefix or "data") + ".dynamic.version")
                            data__dynamic__version_one_of_count5 += 1
                        except JsonSchemaValueException: pass
                    if data__dynamic__version_one_of_count5 < 2:
                        try:
                            validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__version, custom_formats, (name_prefix or "data") + ".dynamic.version")
                            data__dynamic__version_one_of_count5 += 1
                        except JsonSchemaValueException: pass
                    if data__dynamic__version_one_of_count5 != 1:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.version must be valid exactly by one definition" + (" (" + str(data__dynamic__version_one_of_count5) + " matches found)"), value=data__dynamic__version, name="" + (name_prefix or "data") + ".dynamic.version", definition={'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}]}, rule='oneOf')
                if "classifiers" in data__dynamic_keys:
                    data__dynamic_keys.remove("classifiers")
                    data__dynamic__classifiers = data__dynamic["classifiers"]
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__classifiers, custom_formats, (name_prefix or "data") + ".dynamic.classifiers")
                if "description" in data__dynamic_keys:
                    data__dynamic_keys.remove("description")
                    data__dynamic__description = data__dynamic["description"]
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__description, custom_formats, (name_prefix or "data") + ".dynamic.description")
                if "dependencies" in data__dynamic_keys:
                    data__dynamic_keys.remove("dependencies")
                    data__dynamic__dependencies = data__dynamic["dependencies"]
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__dependencies, custom_formats, (name_prefix or "data") + ".dynamic.dependencies")
                if "entry-points" in data__dynamic_keys:
                    data__dynamic_keys.remove("entry-points")
                    data__dynamic__entrypoints = data__dynamic["entry-points"]
                    validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__entrypoints, custom_formats, (name_prefix or "data") + ".dynamic.entry-points")
                if "optional-dependencies" in data__dynamic_keys:
                    data__dynamic_keys.remove("optional-dependencies")
                    data__dynamic__optionaldependencies = data__dynamic["optional-dependencies"]
                    if not isinstance(data__dynamic__optionaldependencies, (dict)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.optional-dependencies must be object", value=data__dynamic__optionaldependencies, name="" + (name_prefix or "data") + ".dynamic.optional-dependencies", definition={'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, rule='type')
                    data__dynamic__optionaldependencies_is_dict = isinstance(data__dynamic__optionaldependencies, dict)
                    if data__dynamic__optionaldependencies_is_dict:
                        data__dynamic__optionaldependencies_keys = set(data__dynamic__optionaldependencies.keys())
                        for data__dynamic__optionaldependencies_key, data__dynamic__optionaldependencies_val in data__dynamic__optionaldependencies.items():
                            if REGEX_PATTERNS['.+'].search(data__dynamic__optionaldependencies_key):
                                if data__dynamic__optionaldependencies_key in data__dynamic__optionaldependencies_keys:
                                    data__dynamic__optionaldependencies_keys.remove(data__dynamic__optionaldependencies_key)
                                validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__optionaldependencies_val, custom_formats, (name_prefix or "data") + ".dynamic.optional-dependencies.{data__dynamic__optionaldependencies_key}")
                        if data__dynamic__optionaldependencies_keys:
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.optional-dependencies must not contain "+str(data__dynamic__optionaldependencies_keys)+" properties", value=data__dynamic__optionaldependencies, name="" + (name_prefix or "data") + ".dynamic.optional-dependencies", definition={'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, rule='additionalProperties')
                        data__dynamic__optionaldependencies_len = len(data__dynamic__optionaldependencies)
                        if data__dynamic__optionaldependencies_len != 0:
                            data__dynamic__optionaldependencies_property_names = True
                            for data__dynamic__optionaldependencies_key in data__dynamic__optionaldependencies:
                                try:
                                    if isinstance(data__dynamic__optionaldependencies_key, str):
                                        if not custom_formats["python-identifier"](data__dynamic__optionaldependencies_key):
                                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.optional-dependencies must be python-identifier", value=data__dynamic__optionaldependencies_key, name="" + (name_prefix or "data") + ".dynamic.optional-dependencies", definition={'format': 'python-identifier'}, rule='format')
                                except JsonSchemaValueException:
                                    data__dynamic__optionaldependencies_property_names = False
                            if not data__dynamic__optionaldependencies_property_names:
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.optional-dependencies must be named by propertyName definition", value=data__dynamic__optionaldependencies, name="" + (name_prefix or "data") + ".dynamic.optional-dependencies", definition={'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, rule='propertyNames')
                if "readme" in data__dynamic_keys:
                    data__dynamic_keys.remove("readme")
                    data__dynamic__readme = data__dynamic["readme"]
                    data__dynamic__readme_any_of_count6 = 0
                    if not data__dynamic__readme_any_of_count6:
                        try:
                            validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data__dynamic__readme, custom_formats, (name_prefix or "data") + ".dynamic.readme")
                            data__dynamic__readme_any_of_count6 += 1
                        except JsonSchemaValueException: pass
                    if not data__dynamic__readme_any_of_count6:
                        try:
                            data__dynamic__readme_is_dict = isinstance(data__dynamic__readme, dict)
                            if data__dynamic__readme_is_dict:
                                data__dynamic__readme_keys = set(data__dynamic__readme.keys())
                                if "content-type" in data__dynamic__readme_keys:
                                    data__dynamic__readme_keys.remove("content-type")
                                    data__dynamic__readme__contenttype = data__dynamic__readme["content-type"]
                                    if not isinstance(data__dynamic__readme__contenttype, (str)):
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.readme.content-type must be string", value=data__dynamic__readme__contenttype, name="" + (name_prefix or "data") + ".dynamic.readme.content-type", definition={'type': 'string'}, rule='type')
                            data__dynamic__readme_any_of_count6 += 1
                        except JsonSchemaValueException: pass
                    if not data__dynamic__readme_any_of_count6:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.readme cannot be validated by any definition", value=data__dynamic__readme, name="" + (name_prefix or "data") + ".dynamic.readme", definition={'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}, rule='anyOf')
                    data__dynamic__readme_is_dict = isinstance(data__dynamic__readme, dict)
                    if data__dynamic__readme_is_dict:
                        data__dynamic__readme_len = len(data__dynamic__readme)
                        if not all(prop in data__dynamic__readme for prop in ['file']):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic.readme must contain ['file'] properties", value=data__dynamic__readme, name="" + (name_prefix or "data") + ".dynamic.readme", definition={'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}, rule='required')
                if data__dynamic_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic must not contain "+str(data__dynamic_keys)+" properties", value=data__dynamic, name="" + (name_prefix or "data") + ".dynamic", definition={'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}]}, 'classifiers': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'description': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'dependencies': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'entry-points': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, 'readme': {'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}, rule='additionalProperties')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://setuptools.pypa.io/en/latest/references/keywords.html', 'title': '``tool.setuptools`` table', '$$description': ['Please notice for the time being the ``setuptools`` project does not specify', 'a way of configuring builds via ``pyproject.toml``.', 'Therefore this schema should be taken just as a *"thought experiment"* on how', 'this *might be done*, by following the principles established in', '`ini2toml `_.', 'It considers only ``setuptools`` `parameters', '`_', 'that can currently be configured via ``setup.cfg`` and are not covered by :pep:`621`', 'but intentionally excludes ``dependency_links`` and ``setup_requires``.', 'NOTE: ``scripts`` was renamed to ``script-files`` to avoid confusion with', 'entry-point based scripts (defined in :pep:`621`).'], 'type': 'object', 'additionalProperties': False, 'properties': {'platforms': {'type': 'array', 'items': {'type': 'string'}}, 'provides': {'$$description': ['Package and virtual package names contained within this package', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'obsoletes': {'$$description': ['Packages which this package renders obsolete', '**(not supported by pip)**'], 'type': 'array', 'items': {'type': 'string', 'format': 'pep508-identifier'}}, 'zip-safe': {'description': 'Whether the project can be safely installed and run from a zip file.', 'type': 'boolean'}, 'script-files': {'description': 'Legacy way of defining scripts (entry-points are preferred).', 'type': 'array', 'items': {'type': 'string'}, '$comment': 'TODO: is this field deprecated/should be removed?'}, 'eager-resources': {'$$description': ['Resources that should be extracted together, if any of them is needed,', 'or if any C extensions included in the project are imported.'], 'type': 'array', 'items': {'type': 'string'}}, 'packages': {'$$description': ['Packages that should be included in the distribution.', 'It can be given either as a list of package identifiers', 'or as a ``dict``-like structure with a single key ``find``', 'which corresponds to a dynamic call to', '``setuptools.config.expand.find_packages`` function.', 'The ``find`` key is associated with a nested ``dict``-like structure that can', 'contain ``where``, ``include``, ``exclude`` and ``namespaces`` keys,', 'mimicking the keyword arguments of the associated function.'], 'oneOf': [{'title': 'Array of Python package identifiers', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}}, {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}]}, 'package-dir': {'$$description': [':class:`dict`-like structure mapping from package names to directories where their', 'code can be found.', 'The empty string (as key) means that all packages are contained inside', 'the given directory will be included in the distribution.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': ''}]}, 'patternProperties': {'^.*$': {'type': 'string'}}}, 'package-data': {'$$description': ['Mapping from package names to lists of glob patterns.', 'Usually this option is not needed when using ``include-package-data = true``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'include-package-data': {'$$description': ['Automatically include any data files inside the package directories', 'that are specified by ``MANIFEST.in``', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'boolean'}, 'exclude-package-data': {'$$description': ['Mapping from package names to lists of glob patterns that should be excluded', 'For more information on how to include data files, check ``setuptools`` `docs', '`_.'], 'type': 'object', 'additionalProperties': False, 'propertyNames': {'oneOf': [{'format': 'python-module-name'}, {'const': '*'}]}, 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'namespace-packages': {'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'https://setuptools.pypa.io/en/latest/userguide/package_discovery.html'}, 'py-modules': {'description': 'Modules that setuptools will manipulate', 'type': 'array', 'items': {'type': 'string', 'format': 'python-module-name'}, '$comment': 'TODO: clarify the relationship with ``packages``'}, 'data-files': {'$$description': ['**DEPRECATED**: dict-like structure where each key represents a directory and', 'the value is a list of glob patterns that should be installed in them.', "Please notice this don't work with wheels. See `data files support", '`_'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'array', 'items': {'type': 'string'}}}}, 'cmdclass': {'$$description': ['Mapping of distutils-style command names to ``setuptools.Command`` subclasses', 'which in turn should be represented by strings with a qualified class name', '(i.e., "dotted" form with module), e.g.::\n\n', '    cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}\n\n', 'The command class should be a directly defined at the top-level of the', 'containing module (no class nesting).'], 'type': 'object', 'patternProperties': {'^.*$': {'type': 'string', 'format': 'python-qualified-identifier'}}}, 'license-files': {'type': 'array', 'items': {'type': 'string'}, '$$description': ['PROVISIONAL: List of glob patterns for all license files being distributed.', '(might become standard with PEP 639).'], 'default': ['LICEN[CS]E*', ' COPYING*', ' NOTICE*', 'AUTHORS*'], '$comment': 'TODO: revise if PEP 639 is accepted. Probably ``project.license-files``?'}, 'dynamic': {'type': 'object', 'description': 'Instructions for loading :pep:`621`-related metadata dynamically', 'additionalProperties': False, 'properties': {'version': {'$$description': ['A version dynamically loaded via either the ``attr:`` or ``file:``', 'directives. Please make sure the given file or attribute respects :pep:`440`.'], 'oneOf': [{'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}]}, 'classifiers': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'description': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'dependencies': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'entry-points': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'optional-dependencies': {'type': 'object', 'propertyNames': {'format': 'python-identifier'}, 'additionalProperties': False, 'patternProperties': {'.+': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}}}, 'readme': {'anyOf': [{'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, {'properties': {'content-type': {'type': 'string'}}}], 'required': ['file']}}}}, 'definitions': {'file-directive': {'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, 'attr-directive': {'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, 'find-directive': {'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}}}, rule='additionalProperties')
    return data

def validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_file_directive(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_len = len(data)
        if not all(prop in data for prop in ['file']):
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must contain ['file'] properties", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, rule='required')
        data_keys = set(data.keys())
        if "file" in data_keys:
            data_keys.remove("file")
            data__file = data["file"]
            data__file_one_of_count7 = 0
            if data__file_one_of_count7 < 2:
                try:
                    if not isinstance(data__file, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".file must be string", value=data__file, name="" + (name_prefix or "data") + ".file", definition={'type': 'string'}, rule='type')
                    data__file_one_of_count7 += 1
                except JsonSchemaValueException: pass
            if data__file_one_of_count7 < 2:
                try:
                    if not isinstance(data__file, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".file must be array", value=data__file, name="" + (name_prefix or "data") + ".file", definition={'type': 'array', 'items': {'type': 'string'}}, rule='type')
                    data__file_is_list = isinstance(data__file, (list, tuple))
                    if data__file_is_list:
                        data__file_len = len(data__file)
                        for data__file_x, data__file_item in enumerate(data__file):
                            if not isinstance(data__file_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".file[{data__file_x}]".format(**locals()) + " must be string", value=data__file_item, name="" + (name_prefix or "data") + ".file[{data__file_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                    data__file_one_of_count7 += 1
                except JsonSchemaValueException: pass
            if data__file_one_of_count7 != 1:
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".file must be valid exactly by one definition" + (" (" + str(data__file_one_of_count7) + " matches found)"), value=data__file, name="" + (name_prefix or "data") + ".file", definition={'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}, rule='oneOf')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/file-directive', 'title': "'file:' directive", 'description': 'Value is read from a file (or list of files and then concatenated)', 'type': 'object', 'additionalProperties': False, 'properties': {'file': {'oneOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}}]}}, 'required': ['file']}, rule='additionalProperties')
    return data

def validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_attr_directive(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_len = len(data)
        if not all(prop in data for prop in ['attr']):
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must contain ['attr'] properties", value=data, name="" + (name_prefix or "data") + "", definition={'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, rule='required')
        data_keys = set(data.keys())
        if "attr" in data_keys:
            data_keys.remove("attr")
            data__attr = data["attr"]
            if not isinstance(data__attr, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".attr must be string", value=data__attr, name="" + (name_prefix or "data") + ".attr", definition={'type': 'string'}, rule='type')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'title': "'attr:' directive", '$id': '#/definitions/attr-directive', '$$description': ['Value is read from a module attribute. Supports callables and iterables;', 'unsupported types are cast via ``str()``'], 'type': 'object', 'additionalProperties': False, 'properties': {'attr': {'type': 'string'}}, 'required': ['attr']}, rule='additionalProperties')
    return data

def validate_https___setuptools_pypa_io_en_latest_references_keywords_html__definitions_find_directive(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        if "find" in data_keys:
            data_keys.remove("find")
            data__find = data["find"]
            if not isinstance(data__find, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".find must be object", value=data__find, name="" + (name_prefix or "data") + ".find", definition={'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}, rule='type')
            data__find_is_dict = isinstance(data__find, dict)
            if data__find_is_dict:
                data__find_keys = set(data__find.keys())
                if "where" in data__find_keys:
                    data__find_keys.remove("where")
                    data__find__where = data__find["where"]
                    if not isinstance(data__find__where, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.where must be array", value=data__find__where, name="" + (name_prefix or "data") + ".find.where", definition={'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, rule='type')
                    data__find__where_is_list = isinstance(data__find__where, (list, tuple))
                    if data__find__where_is_list:
                        data__find__where_len = len(data__find__where)
                        for data__find__where_x, data__find__where_item in enumerate(data__find__where):
                            if not isinstance(data__find__where_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.where[{data__find__where_x}]".format(**locals()) + " must be string", value=data__find__where_item, name="" + (name_prefix or "data") + ".find.where[{data__find__where_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if "exclude" in data__find_keys:
                    data__find_keys.remove("exclude")
                    data__find__exclude = data__find["exclude"]
                    if not isinstance(data__find__exclude, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.exclude must be array", value=data__find__exclude, name="" + (name_prefix or "data") + ".find.exclude", definition={'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, rule='type')
                    data__find__exclude_is_list = isinstance(data__find__exclude, (list, tuple))
                    if data__find__exclude_is_list:
                        data__find__exclude_len = len(data__find__exclude)
                        for data__find__exclude_x, data__find__exclude_item in enumerate(data__find__exclude):
                            if not isinstance(data__find__exclude_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.exclude[{data__find__exclude_x}]".format(**locals()) + " must be string", value=data__find__exclude_item, name="" + (name_prefix or "data") + ".find.exclude[{data__find__exclude_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if "include" in data__find_keys:
                    data__find_keys.remove("include")
                    data__find__include = data__find["include"]
                    if not isinstance(data__find__include, (list, tuple)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.include must be array", value=data__find__include, name="" + (name_prefix or "data") + ".find.include", definition={'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, rule='type')
                    data__find__include_is_list = isinstance(data__find__include, (list, tuple))
                    if data__find__include_is_list:
                        data__find__include_len = len(data__find__include)
                        for data__find__include_x, data__find__include_item in enumerate(data__find__include):
                            if not isinstance(data__find__include_item, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.include[{data__find__include_x}]".format(**locals()) + " must be string", value=data__find__include_item, name="" + (name_prefix or "data") + ".find.include[{data__find__include_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
                if "namespaces" in data__find_keys:
                    data__find_keys.remove("namespaces")
                    data__find__namespaces = data__find["namespaces"]
                    if not isinstance(data__find__namespaces, (bool)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".find.namespaces must be boolean", value=data__find__namespaces, name="" + (name_prefix or "data") + ".find.namespaces", definition={'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}, rule='type')
                if data__find_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".find must not contain "+str(data__find_keys)+" properties", value=data__find, name="" + (name_prefix or "data") + ".find", definition={'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}, rule='additionalProperties')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/find-directive', 'title': "'find:' directive", 'type': 'object', 'additionalProperties': False, 'properties': {'find': {'type': 'object', '$$description': ['Dynamic `package discovery', '`_.'], 'additionalProperties': False, 'properties': {'where': {'description': 'Directories to be searched for packages (Unix-style relative path)', 'type': 'array', 'items': {'type': 'string'}}, 'exclude': {'type': 'array', '$$description': ['Exclude packages that match the values listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'include': {'type': 'array', '$$description': ['Restrict the found packages to just the ones listed in this field.', "Can container shell-style wildcards (e.g. ``'pkg.*'``)"], 'items': {'type': 'string'}}, 'namespaces': {'type': 'boolean', '$$description': ['When ``True``, directories without a ``__init__.py`` file will also', 'be scanned for :pep:`420`-style implicit namespaces']}}}}}, rule='additionalProperties')
    return data

def validate_https___docs_python_org_3_install(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://docs.python.org/3/install/', 'title': '``tool.distutils`` table', '$$description': ['Originally, ``distutils`` allowed developers to configure arguments for', '``setup.py`` scripts via `distutils configuration files', '`_.', '``tool.distutils`` subtables could be used with the same purpose', '(NOT CURRENTLY IMPLEMENTED).'], 'type': 'object', 'properties': {'global': {'type': 'object', 'description': 'Global options applied to all ``distutils`` commands'}}, 'patternProperties': {'.+': {'type': 'object'}}, '$comment': 'TODO: Is there a practical way of making this schema more specific?'}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        if "global" in data_keys:
            data_keys.remove("global")
            data__global = data["global"]
            if not isinstance(data__global, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".global must be object", value=data__global, name="" + (name_prefix or "data") + ".global", definition={'type': 'object', 'description': 'Global options applied to all ``distutils`` commands'}, rule='type')
        for data_key, data_val in data.items():
            if REGEX_PATTERNS['.+'].search(data_key):
                if data_key in data_keys:
                    data_keys.remove(data_key)
                if not isinstance(data_val, (dict)):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".{data_key}".format(**locals()) + " must be object", value=data_val, name="" + (name_prefix or "data") + ".{data_key}".format(**locals()) + "", definition={'type': 'object'}, rule='type')
    return data

def validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'gui-scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_len = len(data)
        if not all(prop in data for prop in ['name']):
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must contain ['name'] properties", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'gui-scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}, rule='required')
        data_keys = set(data.keys())
        if "name" in data_keys:
            data_keys.remove("name")
            data__name = data["name"]
            if not isinstance(data__name, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".name must be string", value=data__name, name="" + (name_prefix or "data") + ".name", definition={'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, rule='type')
            if isinstance(data__name, str):
                if not custom_formats["pep508-identifier"](data__name):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".name must be pep508-identifier", value=data__name, name="" + (name_prefix or "data") + ".name", definition={'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, rule='format')
        if "version" in data_keys:
            data_keys.remove("version")
            data__version = data["version"]
            if not isinstance(data__version, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".version must be string", value=data__version, name="" + (name_prefix or "data") + ".version", definition={'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, rule='type')
            if isinstance(data__version, str):
                if not custom_formats["pep440"](data__version):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".version must be pep440", value=data__version, name="" + (name_prefix or "data") + ".version", definition={'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, rule='format')
        if "description" in data_keys:
            data_keys.remove("description")
            data__description = data["description"]
            if not isinstance(data__description, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".description must be string", value=data__description, name="" + (name_prefix or "data") + ".description", definition={'type': 'string', '$$description': ['The `summary description of the project', '`_']}, rule='type')
        if "readme" in data_keys:
            data_keys.remove("readme")
            data__readme = data["readme"]
            data__readme_one_of_count8 = 0
            if data__readme_one_of_count8 < 2:
                try:
                    if not isinstance(data__readme, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must be string", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, rule='type')
                    data__readme_one_of_count8 += 1
                except JsonSchemaValueException: pass
            if data__readme_one_of_count8 < 2:
                try:
                    if not isinstance(data__readme, (dict)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must be object", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}, rule='type')
                    data__readme_any_of_count9 = 0
                    if not data__readme_any_of_count9:
                        try:
                            data__readme_is_dict = isinstance(data__readme, dict)
                            if data__readme_is_dict:
                                data__readme_len = len(data__readme)
                                if not all(prop in data__readme for prop in ['file']):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must contain ['file'] properties", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, rule='required')
                                data__readme_keys = set(data__readme.keys())
                                if "file" in data__readme_keys:
                                    data__readme_keys.remove("file")
                                    data__readme__file = data__readme["file"]
                                    if not isinstance(data__readme__file, (str)):
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme.file must be string", value=data__readme__file, name="" + (name_prefix or "data") + ".readme.file", definition={'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}, rule='type')
                            data__readme_any_of_count9 += 1
                        except JsonSchemaValueException: pass
                    if not data__readme_any_of_count9:
                        try:
                            data__readme_is_dict = isinstance(data__readme, dict)
                            if data__readme_is_dict:
                                data__readme_len = len(data__readme)
                                if not all(prop in data__readme for prop in ['text']):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must contain ['text'] properties", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}, rule='required')
                                data__readme_keys = set(data__readme.keys())
                                if "text" in data__readme_keys:
                                    data__readme_keys.remove("text")
                                    data__readme__text = data__readme["text"]
                                    if not isinstance(data__readme__text, (str)):
                                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme.text must be string", value=data__readme__text, name="" + (name_prefix or "data") + ".readme.text", definition={'type': 'string', 'description': 'Full text describing the project.'}, rule='type')
                            data__readme_any_of_count9 += 1
                        except JsonSchemaValueException: pass
                    if not data__readme_any_of_count9:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme cannot be validated by any definition", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, rule='anyOf')
                    data__readme_is_dict = isinstance(data__readme, dict)
                    if data__readme_is_dict:
                        data__readme_len = len(data__readme)
                        if not all(prop in data__readme for prop in ['content-type']):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must contain ['content-type'] properties", value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}, rule='required')
                        data__readme_keys = set(data__readme.keys())
                        if "content-type" in data__readme_keys:
                            data__readme_keys.remove("content-type")
                            data__readme__contenttype = data__readme["content-type"]
                            if not isinstance(data__readme__contenttype, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme.content-type must be string", value=data__readme__contenttype, name="" + (name_prefix or "data") + ".readme.content-type", definition={'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}, rule='type')
                    data__readme_one_of_count8 += 1
                except JsonSchemaValueException: pass
            if data__readme_one_of_count8 != 1:
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".readme must be valid exactly by one definition" + (" (" + str(data__readme_one_of_count8) + " matches found)"), value=data__readme, name="" + (name_prefix or "data") + ".readme", definition={'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, rule='oneOf')
        if "requires-python" in data_keys:
            data_keys.remove("requires-python")
            data__requirespython = data["requires-python"]
            if not isinstance(data__requirespython, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".requires-python must be string", value=data__requirespython, name="" + (name_prefix or "data") + ".requires-python", definition={'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, rule='type')
            if isinstance(data__requirespython, str):
                if not custom_formats["pep508-versionspec"](data__requirespython):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".requires-python must be pep508-versionspec", value=data__requirespython, name="" + (name_prefix or "data") + ".requires-python", definition={'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, rule='format')
        if "license" in data_keys:
            data_keys.remove("license")
            data__license = data["license"]
            data__license_one_of_count10 = 0
            if data__license_one_of_count10 < 2:
                try:
                    data__license_is_dict = isinstance(data__license, dict)
                    if data__license_is_dict:
                        data__license_len = len(data__license)
                        if not all(prop in data__license for prop in ['file']):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".license must contain ['file'] properties", value=data__license, name="" + (name_prefix or "data") + ".license", definition={'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, rule='required')
                        data__license_keys = set(data__license.keys())
                        if "file" in data__license_keys:
                            data__license_keys.remove("file")
                            data__license__file = data__license["file"]
                            if not isinstance(data__license__file, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".license.file must be string", value=data__license__file, name="" + (name_prefix or "data") + ".license.file", definition={'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}, rule='type')
                    data__license_one_of_count10 += 1
                except JsonSchemaValueException: pass
            if data__license_one_of_count10 < 2:
                try:
                    data__license_is_dict = isinstance(data__license, dict)
                    if data__license_is_dict:
                        data__license_len = len(data__license)
                        if not all(prop in data__license for prop in ['text']):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".license must contain ['text'] properties", value=data__license, name="" + (name_prefix or "data") + ".license", definition={'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}, rule='required')
                        data__license_keys = set(data__license.keys())
                        if "text" in data__license_keys:
                            data__license_keys.remove("text")
                            data__license__text = data__license["text"]
                            if not isinstance(data__license__text, (str)):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".license.text must be string", value=data__license__text, name="" + (name_prefix or "data") + ".license.text", definition={'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}, rule='type')
                    data__license_one_of_count10 += 1
                except JsonSchemaValueException: pass
            if data__license_one_of_count10 != 1:
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".license must be valid exactly by one definition" + (" (" + str(data__license_one_of_count10) + " matches found)"), value=data__license, name="" + (name_prefix or "data") + ".license", definition={'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, rule='oneOf')
        if "authors" in data_keys:
            data_keys.remove("authors")
            data__authors = data["authors"]
            if not isinstance(data__authors, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".authors must be array", value=data__authors, name="" + (name_prefix or "data") + ".authors", definition={'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, rule='type')
            data__authors_is_list = isinstance(data__authors, (list, tuple))
            if data__authors_is_list:
                data__authors_len = len(data__authors)
                for data__authors_x, data__authors_item in enumerate(data__authors):
                    validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_author(data__authors_item, custom_formats, (name_prefix or "data") + ".authors[{data__authors_x}]")
        if "maintainers" in data_keys:
            data_keys.remove("maintainers")
            data__maintainers = data["maintainers"]
            if not isinstance(data__maintainers, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".maintainers must be array", value=data__maintainers, name="" + (name_prefix or "data") + ".maintainers", definition={'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, rule='type')
            data__maintainers_is_list = isinstance(data__maintainers, (list, tuple))
            if data__maintainers_is_list:
                data__maintainers_len = len(data__maintainers)
                for data__maintainers_x, data__maintainers_item in enumerate(data__maintainers):
                    validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_author(data__maintainers_item, custom_formats, (name_prefix or "data") + ".maintainers[{data__maintainers_x}]")
        if "keywords" in data_keys:
            data_keys.remove("keywords")
            data__keywords = data["keywords"]
            if not isinstance(data__keywords, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".keywords must be array", value=data__keywords, name="" + (name_prefix or "data") + ".keywords", definition={'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, rule='type')
            data__keywords_is_list = isinstance(data__keywords, (list, tuple))
            if data__keywords_is_list:
                data__keywords_len = len(data__keywords)
                for data__keywords_x, data__keywords_item in enumerate(data__keywords):
                    if not isinstance(data__keywords_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".keywords[{data__keywords_x}]".format(**locals()) + " must be string", value=data__keywords_item, name="" + (name_prefix or "data") + ".keywords[{data__keywords_x}]".format(**locals()) + "", definition={'type': 'string'}, rule='type')
        if "classifiers" in data_keys:
            data_keys.remove("classifiers")
            data__classifiers = data["classifiers"]
            if not isinstance(data__classifiers, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".classifiers must be array", value=data__classifiers, name="" + (name_prefix or "data") + ".classifiers", definition={'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, rule='type')
            data__classifiers_is_list = isinstance(data__classifiers, (list, tuple))
            if data__classifiers_is_list:
                data__classifiers_len = len(data__classifiers)
                for data__classifiers_x, data__classifiers_item in enumerate(data__classifiers):
                    if not isinstance(data__classifiers_item, (str)):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".classifiers[{data__classifiers_x}]".format(**locals()) + " must be string", value=data__classifiers_item, name="" + (name_prefix or "data") + ".classifiers[{data__classifiers_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, rule='type')
                    if isinstance(data__classifiers_item, str):
                        if not custom_formats["trove-classifier"](data__classifiers_item):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".classifiers[{data__classifiers_x}]".format(**locals()) + " must be trove-classifier", value=data__classifiers_item, name="" + (name_prefix or "data") + ".classifiers[{data__classifiers_x}]".format(**locals()) + "", definition={'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, rule='format')
        if "urls" in data_keys:
            data_keys.remove("urls")
            data__urls = data["urls"]
            if not isinstance(data__urls, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".urls must be object", value=data__urls, name="" + (name_prefix or "data") + ".urls", definition={'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, rule='type')
            data__urls_is_dict = isinstance(data__urls, dict)
            if data__urls_is_dict:
                data__urls_keys = set(data__urls.keys())
                for data__urls_key, data__urls_val in data__urls.items():
                    if REGEX_PATTERNS['^.+$'].search(data__urls_key):
                        if data__urls_key in data__urls_keys:
                            data__urls_keys.remove(data__urls_key)
                        if not isinstance(data__urls_val, (str)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".urls.{data__urls_key}".format(**locals()) + " must be string", value=data__urls_val, name="" + (name_prefix or "data") + ".urls.{data__urls_key}".format(**locals()) + "", definition={'type': 'string', 'format': 'url'}, rule='type')
                        if isinstance(data__urls_val, str):
                            if not custom_formats["url"](data__urls_val):
                                raise JsonSchemaValueException("" + (name_prefix or "data") + ".urls.{data__urls_key}".format(**locals()) + " must be url", value=data__urls_val, name="" + (name_prefix or "data") + ".urls.{data__urls_key}".format(**locals()) + "", definition={'type': 'string', 'format': 'url'}, rule='format')
                if data__urls_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".urls must not contain "+str(data__urls_keys)+" properties", value=data__urls, name="" + (name_prefix or "data") + ".urls", definition={'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, rule='additionalProperties')
        if "scripts" in data_keys:
            data_keys.remove("scripts")
            data__scripts = data["scripts"]
            validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_entry_point_group(data__scripts, custom_formats, (name_prefix or "data") + ".scripts")
        if "gui-scripts" in data_keys:
            data_keys.remove("gui-scripts")
            data__guiscripts = data["gui-scripts"]
            validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_entry_point_group(data__guiscripts, custom_formats, (name_prefix or "data") + ".gui-scripts")
        if "entry-points" in data_keys:
            data_keys.remove("entry-points")
            data__entrypoints = data["entry-points"]
            data__entrypoints_is_dict = isinstance(data__entrypoints, dict)
            if data__entrypoints_is_dict:
                data__entrypoints_keys = set(data__entrypoints.keys())
                for data__entrypoints_key, data__entrypoints_val in data__entrypoints.items():
                    if REGEX_PATTERNS['^.+$'].search(data__entrypoints_key):
                        if data__entrypoints_key in data__entrypoints_keys:
                            data__entrypoints_keys.remove(data__entrypoints_key)
                        validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_entry_point_group(data__entrypoints_val, custom_formats, (name_prefix or "data") + ".entry-points.{data__entrypoints_key}")
                if data__entrypoints_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".entry-points must not contain "+str(data__entrypoints_keys)+" properties", value=data__entrypoints, name="" + (name_prefix or "data") + ".entry-points", definition={'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}}}, rule='additionalProperties')
                data__entrypoints_len = len(data__entrypoints)
                if data__entrypoints_len != 0:
                    data__entrypoints_property_names = True
                    for data__entrypoints_key in data__entrypoints:
                        try:
                            if isinstance(data__entrypoints_key, str):
                                if not custom_formats["python-entrypoint-group"](data__entrypoints_key):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".entry-points must be python-entrypoint-group", value=data__entrypoints_key, name="" + (name_prefix or "data") + ".entry-points", definition={'format': 'python-entrypoint-group'}, rule='format')
                        except JsonSchemaValueException:
                            data__entrypoints_property_names = False
                    if not data__entrypoints_property_names:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".entry-points must be named by propertyName definition", value=data__entrypoints, name="" + (name_prefix or "data") + ".entry-points", definition={'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}}}, rule='propertyNames')
        if "dependencies" in data_keys:
            data_keys.remove("dependencies")
            data__dependencies = data["dependencies"]
            if not isinstance(data__dependencies, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".dependencies must be array", value=data__dependencies, name="" + (name_prefix or "data") + ".dependencies", definition={'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}, rule='type')
            data__dependencies_is_list = isinstance(data__dependencies, (list, tuple))
            if data__dependencies_is_list:
                data__dependencies_len = len(data__dependencies)
                for data__dependencies_x, data__dependencies_item in enumerate(data__dependencies):
                    validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_dependency(data__dependencies_item, custom_formats, (name_prefix or "data") + ".dependencies[{data__dependencies_x}]")
        if "optional-dependencies" in data_keys:
            data_keys.remove("optional-dependencies")
            data__optionaldependencies = data["optional-dependencies"]
            if not isinstance(data__optionaldependencies, (dict)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".optional-dependencies must be object", value=data__optionaldependencies, name="" + (name_prefix or "data") + ".optional-dependencies", definition={'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, rule='type')
            data__optionaldependencies_is_dict = isinstance(data__optionaldependencies, dict)
            if data__optionaldependencies_is_dict:
                data__optionaldependencies_keys = set(data__optionaldependencies.keys())
                for data__optionaldependencies_key, data__optionaldependencies_val in data__optionaldependencies.items():
                    if REGEX_PATTERNS['^.+$'].search(data__optionaldependencies_key):
                        if data__optionaldependencies_key in data__optionaldependencies_keys:
                            data__optionaldependencies_keys.remove(data__optionaldependencies_key)
                        if not isinstance(data__optionaldependencies_val, (list, tuple)):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".optional-dependencies.{data__optionaldependencies_key}".format(**locals()) + " must be array", value=data__optionaldependencies_val, name="" + (name_prefix or "data") + ".optional-dependencies.{data__optionaldependencies_key}".format(**locals()) + "", definition={'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}, rule='type')
                        data__optionaldependencies_val_is_list = isinstance(data__optionaldependencies_val, (list, tuple))
                        if data__optionaldependencies_val_is_list:
                            data__optionaldependencies_val_len = len(data__optionaldependencies_val)
                            for data__optionaldependencies_val_x, data__optionaldependencies_val_item in enumerate(data__optionaldependencies_val):
                                validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_dependency(data__optionaldependencies_val_item, custom_formats, (name_prefix or "data") + ".optional-dependencies.{data__optionaldependencies_key}[{data__optionaldependencies_val_x}]")
                if data__optionaldependencies_keys:
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".optional-dependencies must not contain "+str(data__optionaldependencies_keys)+" properties", value=data__optionaldependencies, name="" + (name_prefix or "data") + ".optional-dependencies", definition={'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, rule='additionalProperties')
                data__optionaldependencies_len = len(data__optionaldependencies)
                if data__optionaldependencies_len != 0:
                    data__optionaldependencies_property_names = True
                    for data__optionaldependencies_key in data__optionaldependencies:
                        try:
                            if isinstance(data__optionaldependencies_key, str):
                                if not custom_formats["pep508-identifier"](data__optionaldependencies_key):
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".optional-dependencies must be pep508-identifier", value=data__optionaldependencies_key, name="" + (name_prefix or "data") + ".optional-dependencies", definition={'format': 'pep508-identifier'}, rule='format')
                        except JsonSchemaValueException:
                            data__optionaldependencies_property_names = False
                    if not data__optionaldependencies_property_names:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".optional-dependencies must be named by propertyName definition", value=data__optionaldependencies, name="" + (name_prefix or "data") + ".optional-dependencies", definition={'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, rule='propertyNames')
        if "dynamic" in data_keys:
            data_keys.remove("dynamic")
            data__dynamic = data["dynamic"]
            if not isinstance(data__dynamic, (list, tuple)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic must be array", value=data__dynamic, name="" + (name_prefix or "data") + ".dynamic", definition={'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}, rule='type')
            data__dynamic_is_list = isinstance(data__dynamic, (list, tuple))
            if data__dynamic_is_list:
                data__dynamic_len = len(data__dynamic)
                for data__dynamic_x, data__dynamic_item in enumerate(data__dynamic):
                    if data__dynamic_item not in ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']:
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic[{data__dynamic_x}]".format(**locals()) + " must be one of ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']", value=data__dynamic_item, name="" + (name_prefix or "data") + ".dynamic[{data__dynamic_x}]".format(**locals()) + "", definition={'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}, rule='enum')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$schema': 'http://json-schema.org/draft-07/schema', '$id': 'https://packaging.python.org/en/latest/specifications/declaring-project-metadata/', 'title': 'Package metadata stored in the ``project`` table', '$$description': ['Data structure for the **project** table inside ``pyproject.toml``', '(as initially defined in :pep:`621`)'], 'type': 'object', 'properties': {'name': {'type': 'string', 'description': 'The name (primary identifier) of the project. MUST be statically defined.', 'format': 'pep508-identifier'}, 'version': {'type': 'string', 'description': 'The version of the project as supported by :pep:`440`.', 'format': 'pep440'}, 'description': {'type': 'string', '$$description': ['The `summary description of the project', '`_']}, 'readme': {'$$description': ['`Full/detailed description of the project in the form of a README', '`_', "with meaning similar to the one defined in `core metadata's Description", '`_'], 'oneOf': [{'type': 'string', '$$description': ['Relative path to a text file (UTF-8) containing the full description', 'of the project. If the file path ends in case-insensitive ``.md`` or', '``.rst`` suffixes, then the content-type is respectively', '``text/markdown`` or ``text/x-rst``']}, {'type': 'object', 'allOf': [{'anyOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to a text file containing the full description', 'of the project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', 'description': 'Full text describing the project.'}}, 'required': ['text']}]}, {'properties': {'content-type': {'type': 'string', '$$description': ['Content-type (:rfc:`1341`) of the full description', '(e.g. ``text/markdown``). The ``charset`` parameter is assumed', 'UTF-8 when not present.'], '$comment': 'TODO: add regex pattern or format?'}}, 'required': ['content-type']}]}]}, 'requires-python': {'type': 'string', 'format': 'pep508-versionspec', '$$description': ['`The Python version requirements of the project', '`_.']}, 'license': {'description': '`Project license `_.', 'oneOf': [{'properties': {'file': {'type': 'string', '$$description': ['Relative path to the file (UTF-8) which contains the license for the', 'project.']}}, 'required': ['file']}, {'properties': {'text': {'type': 'string', '$$description': ['The license of the project whose meaning is that of the', '`License field from the core metadata', '`_.']}}, 'required': ['text']}]}, 'authors': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'authors' of the project.", 'The exact meaning is open to interpretation (e.g. original or primary authors,', 'current maintainers, or owners of the package).']}, 'maintainers': {'type': 'array', 'items': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, '$$description': ["The people or organizations considered to be the 'maintainers' of the project.", 'Similarly to ``authors``, the exact meaning is open to interpretation.']}, 'keywords': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of keywords to assist searching for the distribution in a larger catalog.'}, 'classifiers': {'type': 'array', 'items': {'type': 'string', 'format': 'trove-classifier', 'description': '`PyPI classifier `_.'}, '$$description': ['`Trove classifiers `_', 'which apply to the project.']}, 'urls': {'type': 'object', 'description': 'URLs associated with the project in the form ``label => value``.', 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', 'format': 'url'}}}, 'scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'gui-scripts': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'entry-points': {'$$description': ['Instruct the installer to expose the given modules/functions via', '``entry-point`` discovery mechanism (useful for plugins).', 'More information available in the `Python packaging guide', '`_.'], 'propertyNames': {'format': 'python-entrypoint-group'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}}}, 'dependencies': {'type': 'array', 'description': 'Project (mandatory) dependencies.', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}, 'optional-dependencies': {'type': 'object', 'description': 'Optional dependency for the project', 'propertyNames': {'format': 'pep508-identifier'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'array', 'items': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}}, 'dynamic': {'type': 'array', '$$description': ['Specifies which fields are intentionally unspecified and expected to be', 'dynamically provided by build tools'], 'items': {'enum': ['version', 'description', 'readme', 'requires-python', 'license', 'authors', 'maintainers', 'keywords', 'classifiers', 'urls', 'scripts', 'gui-scripts', 'entry-points', 'dependencies', 'optional-dependencies']}}}, 'required': ['name'], 'additionalProperties': False, 'if': {'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, 'then': {'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, 'definitions': {'author': {'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, 'entry-point-group': {'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, 'dependency': {'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}}}, rule='additionalProperties')
    try:
        try:
            data_is_dict = isinstance(data, dict)
            if data_is_dict:
                data_len = len(data)
                if not all(prop in data for prop in ['dynamic']):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + " must contain ['dynamic'] properties", value=data, name="" + (name_prefix or "data") + "", definition={'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, rule='required')
                data_keys = set(data.keys())
                if "dynamic" in data_keys:
                    data_keys.remove("dynamic")
                    data__dynamic = data["dynamic"]
                    data__dynamic_is_list = isinstance(data__dynamic, (list, tuple))
                    if data__dynamic_is_list:
                        data__dynamic_contains = False
                        for data__dynamic_key in data__dynamic:
                            try:
                                if data__dynamic_key != "version":
                                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic must be same as const definition: version", value=data__dynamic_key, name="" + (name_prefix or "data") + ".dynamic", definition={'const': 'version'}, rule='const')
                                data__dynamic_contains = True
                                break
                            except JsonSchemaValueException: pass
                        if not data__dynamic_contains:
                            raise JsonSchemaValueException("" + (name_prefix or "data") + ".dynamic must contain one of contains definition", value=data__dynamic, name="" + (name_prefix or "data") + ".dynamic", definition={'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}, rule='contains')
        except JsonSchemaValueException: pass
        else:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must NOT match a disallowed definition", value=data, name="" + (name_prefix or "data") + "", definition={'not': {'required': ['dynamic'], 'properties': {'dynamic': {'contains': {'const': 'version'}, '$$description': ['version is listed in ``dynamic``']}}}, '$$comment': ['According to :pep:`621`:', '    If the core metadata specification lists a field as "Required", then', '    the metadata MUST specify the field statically or list it in dynamic', 'In turn, `core metadata`_ defines:', '    The required fields are: Metadata-Version, Name, Version.', '    All the other fields are optional.', 'Since ``Metadata-Version`` is defined by the build back-end, ``name`` and', '``version`` are the only mandatory information in ``pyproject.toml``.', '.. _core metadata: https://packaging.python.org/specifications/core-metadata/']}, rule='not')
    except JsonSchemaValueException:
        pass
    else:
        data_is_dict = isinstance(data, dict)
        if data_is_dict:
            data_len = len(data)
            if not all(prop in data for prop in ['version']):
                raise JsonSchemaValueException("" + (name_prefix or "data") + " must contain ['version'] properties", value=data, name="" + (name_prefix or "data") + "", definition={'required': ['version'], '$$description': ['version should be statically defined in the ``version`` field']}, rule='required')
    return data

def validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_dependency(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (str)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be string", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}, rule='type')
    if isinstance(data, str):
        if not custom_formats["pep508"](data):
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must be pep508", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/dependency', 'title': 'Dependency', 'type': 'string', 'description': 'Project dependency specification according to PEP 508', 'format': 'pep508'}, rule='format')
    return data

def validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_entry_point_group(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        for data_key, data_val in data.items():
            if REGEX_PATTERNS['^.+$'].search(data_key):
                if data_key in data_keys:
                    data_keys.remove(data_key)
                if not isinstance(data_val, (str)):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".{data_key}".format(**locals()) + " must be string", value=data_val, name="" + (name_prefix or "data") + ".{data_key}".format(**locals()) + "", definition={'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}, rule='type')
                if isinstance(data_val, str):
                    if not custom_formats["python-entrypoint-reference"](data_val):
                        raise JsonSchemaValueException("" + (name_prefix or "data") + ".{data_key}".format(**locals()) + " must be python-entrypoint-reference", value=data_val, name="" + (name_prefix or "data") + ".{data_key}".format(**locals()) + "", definition={'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}, rule='format')
        if data_keys:
            raise JsonSchemaValueException("" + (name_prefix or "data") + " must not contain "+str(data_keys)+" properties", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, rule='additionalProperties')
        data_len = len(data)
        if data_len != 0:
            data_property_names = True
            for data_key in data:
                try:
                    if isinstance(data_key, str):
                        if not custom_formats["python-entrypoint-name"](data_key):
                            raise JsonSchemaValueException("" + (name_prefix or "data") + " must be python-entrypoint-name", value=data_key, name="" + (name_prefix or "data") + "", definition={'format': 'python-entrypoint-name'}, rule='format')
                except JsonSchemaValueException:
                    data_property_names = False
            if not data_property_names:
                raise JsonSchemaValueException("" + (name_prefix or "data") + " must be named by propertyName definition", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/entry-point-group', 'title': 'Entry-points', 'type': 'object', '$$description': ['Entry-points are grouped together to indicate what sort of capabilities they', 'provide.', 'See the `packaging guides', '`_', 'and `setuptools docs', '`_', 'for more information.'], 'propertyNames': {'format': 'python-entrypoint-name'}, 'additionalProperties': False, 'patternProperties': {'^.+$': {'type': 'string', '$$description': ['Reference to a Python object. It is either in the form', '``importable.module``, or ``importable.module:object.attr``.'], 'format': 'python-entrypoint-reference', '$comment': 'https://packaging.python.org/specifications/entry-points/'}}}, rule='propertyNames')
    return data

def validate_https___packaging_python_org_en_latest_specifications_declaring_project_metadata___definitions_author(data, custom_formats={}, name_prefix=None):
    if not isinstance(data, (dict)):
        raise JsonSchemaValueException("" + (name_prefix or "data") + " must be object", value=data, name="" + (name_prefix or "data") + "", definition={'$id': '#/definitions/author', 'title': 'Author or Maintainer', '$comment': 'https://www.python.org/dev/peps/pep-0621/#authors-maintainers', 'type': 'object', 'properties': {'name': {'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, 'email': {'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}}}, rule='type')
    data_is_dict = isinstance(data, dict)
    if data_is_dict:
        data_keys = set(data.keys())
        if "name" in data_keys:
            data_keys.remove("name")
            data__name = data["name"]
            if not isinstance(data__name, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".name must be string", value=data__name, name="" + (name_prefix or "data") + ".name", definition={'type': 'string', '$$description': ['MUST be a valid email name, i.e. whatever can be put as a name, before an', 'email, in :rfc:`822`.']}, rule='type')
        if "email" in data_keys:
            data_keys.remove("email")
            data__email = data["email"]
            if not isinstance(data__email, (str)):
                raise JsonSchemaValueException("" + (name_prefix or "data") + ".email must be string", value=data__email, name="" + (name_prefix or "data") + ".email", definition={'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}, rule='type')
            if isinstance(data__email, str):
                if not REGEX_PATTERNS["idn-email_re_pattern"].match(data__email):
                    raise JsonSchemaValueException("" + (name_prefix or "data") + ".email must be idn-email", value=data__email, name="" + (name_prefix or "data") + ".email", definition={'type': 'string', 'format': 'idn-email', 'description': 'MUST be a valid email address'}, rule='format')
    return dataPK![&config/_validate_pyproject/__init__.pynu[from functools import reduce
from typing import Any, Callable, Dict

from . import formats
from .error_reporting import detailed_errors, ValidationError
from .extra_validations import EXTRA_VALIDATIONS
from .fastjsonschema_exceptions import JsonSchemaException, JsonSchemaValueException
from .fastjsonschema_validations import validate as _validate

__all__ = [
    "validate",
    "FORMAT_FUNCTIONS",
    "EXTRA_VALIDATIONS",
    "ValidationError",
    "JsonSchemaException",
    "JsonSchemaValueException",
]


FORMAT_FUNCTIONS: Dict[str, Callable[[str], bool]] = {
    fn.__name__.replace("_", "-"): fn
    for fn in formats.__dict__.values()
    if callable(fn) and not fn.__name__.startswith("_")
}


def validate(data: Any) -> bool:
    """Validate the given ``data`` object using JSON Schema
    This function raises ``ValidationError`` if ``data`` is invalid.
    """
    with detailed_errors():
        _validate(data, custom_formats=FORMAT_FUNCTIONS)
    reduce(lambda acc, fn: fn(acc), EXTRA_VALIDATIONS, data)
    return True
PK!aAA+config/__pycache__/setupcfg.cpython-311.pycnu[

,RenbdZddlZddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZmZddlmZmZddlmZmZdd	lmZmZdd
lmZddl m!Z!dd
l"m#Z#e
rddl$m%Z%ddl&m'Z'ee(ej)fZ*e
dedeffZ+	e
de+fZ,ededZ-		d4de*de.fdZ/ddde*ddfdZ0		d5ddde*dee*de1dedf
dZ2d e-d!e(fd"Z3d#edde.fd$Z4	d6d%dd&e,ded'fd(Z5d)e(d*e(d+e6fd,Z7Gd-d.ee-Z8Gd/d0e8d1Z9Gd2d3e8dZ:dS)7ze
Load setuptools configuration from ``setup.cfg`` files.

**API will be made private in the future**
N)defaultdict)partialwraps)
TYPE_CHECKINGCallableAnyDictGenericIterableListOptionalTupleTypeVarUnion)DistutilsOptionErrorDistutilsFileError)RequirementInvalidRequirement)VersionInvalidVersion)SpecifierSet)SetuptoolsDeprecationWarning)expandDistribution)DistributionMetadatastrTarget)rr)boundFfilepathreturncddlm}|}|r|ng}t||||}t	|S)a,Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file
        to get options from.

    :param bool find_others: Whether to search for other configuration files
        which could be on in various places.

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :rtype: dict
    rr)setuptools.distrfind_config_files_applyconfiguration_to_dict)r"find_othersignore_option_errorsrdist	filenameshandlerss       /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/setupcfg.pyread_configurationr/(s^(-,,,,,<>>D,7?&&(((RIdHi1EFFH ***r+rcNt||||S)z`Apply the configuration from a ``setup.cfg`` file into an existing
    distribution object.
    )r'_finalize_requires)r+r"s  r.apply_configurationr3Ds+4Kr0other_filesr*)
ConfigHandler.c(ddlm}tj|}tj|st
d|ztj}tjtj	|g||}	|
||t||j|}|
tj|n#tj|wxYw|S)zHRead configuration from ``filepath`` and applies to the ``dist`` object.r)
_Distributionz%Configuration file %s does not exist.)r,)r*)r%r8ospathabspathisfilergetcwdchdirdirnameparse_config_filesparse_configurationcommand_options_finalize_license_files)r+r"r5r*r8current_directoryr,r-s        r.r'r'Ms.-----wx((H
7>>(##U !H8!STTT	HRW__X
&
&'''(+(x(I$(((CCC&$&=Q


	
$$&&&
"####"####Os
"AC99D
target_objkeycdjdit}tjt||}t	|||}|S)z
    Given a target object and option key, get that option from
    the target object, either through a get_{key} method or
    from an attribute directly.
    z	get_{key}r4)formatlocals	functoolsrgetattr)rErFgetter_nameby_attributegetters     r._get_optionrOjsP%+$00vxx00K$Wj#>>L
Zl
;
;F688Or0r-ctt}|D]1}|jD]'}t|j|}|||j|<(2|S)zReturns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    )rdictset_optionsrOrEsection_prefix)r-config_dicthandleroptionvalues     r.r(r(vsk$D))K@@)	@	@F 2F;;E:?K./77	@r0distributionrB)ConfigMetadataHandlerConfigOptionsHandlerc	Btj|5}t||||}||js|j|_t|j||||j|j}|dddn#1swxYwY||fS)aPerforms additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    N)rEnsurePackagesDiscoveredrZparsepackage_dirrYmetadatasrc_root)rXrBr*ensure_discoveredoptionsmetas      r.rArAs$
	(	6	6:K& 	

	

'	;'.':L$$! $!


	

),=sA1BBBlabel
orig_valueparsedcDd|vst|dkrdStjt5d|}t|}|j)d|d|dd}tj|tddddS#1swxYwYdS)	amBecause users sometimes misinterpret this configuration:

    [options.extras_require]
    foo = bar;python_version<"4"

    It looks like one requirement with an environment marker
    but because there is no newline, it's parsed as two requirements
    with a semicolon as separator.

    Therefore, if:
        * input string does not contain a newline AND
        * parsed result contains two requirements AND
        * parsing of the two parts from the result (";")
        leads in a valid Requirement with a valid marker
    a UserWarning is shown to inform the user about the possible problem.
    
N;z#One of the parsed requirements in `z*` looks like a valid environment marker: 'rz}'
Make sure that the config is correct and check https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#opt-2)
len
contextlibsuppressrjoinrmarkerwarningswarnUserWarning)rdrerforiginal_requirements_strreqmsgs      r.%_warn_accidental_env_marker_misconfigrvs"zS[[A--		/	0	0
,
,$'HHV$4$4!344:!_e__;A!9___

M#{+++
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,sABBBcReZdZUdZeed<	iZeeefed<	dede	de
jfdZe
dZd	ZeddZedZed
ZedZedefdZdefdZedZedZeddZdZdZdZdS)r6z1Handles metadata supplied in configuration files.rSaliasesrErbraci}|j}|D]I\}}||s||dd}|||<J||_||_||_g|_||_	dS)N.)
rSitems
startswithreplacestripr*rEsectionsrRra)	selfrErbr*rarrSsection_namesection_optionss	         r.__init__zConfigHandler.__init__s'),-4]]__	5	5)L/**>::
'//CCII#NNL%4H\""$8!$ 
&(!2r0c:td|jjz).Metadata item name to parser function mapping.z!%s must provide .parsers property)NotImplementedError	__class____name__)rs r.parserszConfigHandler.parserss#"/$.2II

	
r0ct}|j}|j||}t	|||}||urt||rdSd}|j|}|r'	||}n#t$r
d}|jsYnwxYw|rdSt	|d|zd}|t|||n|||j
|dS)NFTzset_%s)tuplerErxgetrKKeyErrorr	Exceptionr*setattrrRappend)	roption_namerWunknownrE
current_valueskip_optionparsersetters	         r.__setitem__zConfigHandler.__setitem__s9''_
l&&{K@@
KAA
G##;'''	F!!+..	
u




"0

	FX%;TBB>JU3333F5MMM,,,,,s8BBB,ct|tr|Sd|vr|}n||}d|DS)zRepresents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        rhc^g|]*}||+Sr4r).0chunks  r.
z-ConfigHandler._parse_list..:s-BBB%EKKMMB

BBBr0)
isinstancelist
splitlinessplit)clsrW	separators   r._parse_listzConfigHandler._parse_list(s\eT""	L5==$$&&EEKK	**EBB5BBBBr0cd}i}||D]\}||\}}}||krtd|z|||<]|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        =z(Unable to parse option value to dict: %s)r	partitionrr)rrWrresultlinerFsepvals        r._parse_dictzConfigHandler._parse_dict<s	OOE**	.	.D NN955MCci*>F#&))++F399;;
r0c2|}|dvS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )1trueyes)lowerrrWs  r._parse_boolzConfigHandler._parse_boolOs

,,,r0cfd}|S)zReturns a parser function to make sure field inputs
        are not files.

        Parses a value after getting the key so error messages are
        more informative.

        :param key:
        :rtype: callable
        czd}||r"td|S)Nfile:zCOnly strings are accepted for the {0} field, files are not accepted)r}
ValueErrorrH)rWexclude_directiverFs  r.rz3ConfigHandler._exclude_files_parser..parseresI ' 122
 --3VC[[Lr0r4)rrFrs ` r._exclude_files_parserz#ConfigHandler._exclude_files_parserYs#					
r0root_dircd}t|ts|S||s|S|t|d}d|dD}tj||S)aORepresents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        rNc3>K|]}|VdSNr)rr:s  r.	z,ConfigHandler._parse_file..s*>>dTZZ\\>>>>>>r0r)rrr}rkrr
read_files)rrWrinclude_directivespec	filepathss      r._parse_filezConfigHandler._parse_fileps$%%%	L 122	LS*++--.>>djjoo>>>	 H555r0cd}||s|S||d}||jjtj|||S)zRepresents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:rz)r}r~updaterar^r	read_attr)rrWr^rattr_directive	attr_descs      r._parse_attrzConfigHandler._parse_attrsh!//	LMM."55		41=>>>	;AAAr0cfd}|S)zReturns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        c,|}D]
}||}|Srr4)rWrfmethod
parse_methodss   r.r]z1ConfigHandler._get_parser_compound..parses+F'
(
(Mr0r4)rrr]s ` r._get_parser_compoundz"ConfigHandler._get_parser_compounds#					r0cbi}|D]\}\}}|||||<|S)aParses section options into a dictionary.

        Applies a given parser to each option in a section.

        :param dict section_options:
        :param callable values_parser: function with 2 args corresponding to key, value
        :rtype: dict
        )r|)rr
values_parserrWrF_rs       r._parse_section_to_dict_with_keyz-ConfigHandler._parse_section_to_dict_with_keysH,2244	1	1MC!S&sC00E#JJr0NcDrfdnd}|||S)aParses section options into a dictionary.

        Optionally applies a given parser to each value.

        :param dict section_options:
        :param callable values_parser: function with 1 arg corresponding to option value
        :rtype: dict
        c|Srr4)rvrs  r.z6ConfigHandler._parse_section_to_dict..s}}Q//r0c|Srr4)rrs  r.rz6ConfigHandler._parse_section_to_dict..sUVr0r)rrrrs  ` r._parse_section_to_dictz$ConfigHandler._parse_section_to_dicts75BW/////22?FKKKr0c|D]>\}\}}tjt5|||<dddn#1swxYwY?dS)zQParses configuration file section.

        :param dict section_options:
        N)r|rlrmr)rrnamerrWs     r.
parse_sectionzConfigHandler.parse_sections
#2"7"7"9"9	#	#T:Au$X..
#
#"T

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#	#	#sAA	A	c|jD]^\}}d}|rd|z}t|d|zddd}|t	d|jd|d||_dS)	zTParses configuration file items from one
        or more related sections.

        rzz_%szparse_section%sr{__Nz*Unsupported distribution option section: [])rr|rKr~rrS)rrrmethod_postfixsection_parser_methods     r.r]zConfigHandler.parses
.2]-@-@-B-B	3	3)L/N
6!&!58?"^3<tj|i|Sr)rprq)argskwargsfuncru
warning_classs  r.config_handlerz@ConfigHandler._deprecated_config_handler..config_handlers*M#}---4((((r0r)rrrurrs ``` r._deprecated_config_handlerz(ConfigHandler._deprecated_config_handlersB
t	)	)	)	)	)	)
	)r0)rr)r
__module____qualname____doc__r__annotations__rxr
r AllCommandOptionsrr\rpropertyrrclassmethodrrrr_Pathrrrrrrr]rr4r0r.r6r6s;;
!GT#s(^   33#3
":3333.

X
$-$-$-LCCC[C&[$--[-[,6%666[62BBBBB([&[
L
L
L[
L###3334




r0r6c
eZdZdZdddddZdZ	dejfd	d
dede	d
e
jdee
deffd
ZedZdZxZS)rYr_urldescriptionclassifiers	platforms)	home_pagesummary
classifierplatformFNrErrbr*rar^rclt||||||_||_dSr)superrr^r)rrErbr*rar^rrs       r.rzConfigMetadataHandler.__init__s8	W.BDUVVV& 


r0c@|j}t|j|j}|j}|j}|||||dt|||||d||ddt||||j	|d
S)rrz[The requires parameter is deprecated, please use install_requires for runtime dependencies.licenselicense_filezDThe license_file parameter is deprecated, use license_files instead.)
rkeywordsprovidesrequires	obsoletesrrr
license_filesrlong_descriptionversionproject_urls)
rrrrrrrrr_parse_version)r
parse_list
parse_file
parse_dictexclude_files_parsers     r.rzConfigMetadataHandler.parsers s%
T-
FFF
%
#9$""77=,	$44ZLL++I66 ;;$$^44-,	(% **&/

	
r0c	d|||j}||kr]|}	t|n6#t$r)d}t|jditwxYw|Stj	|
||j|jS)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}r4)rrrrrrrHrIrr	rr^)rrWr	tmpls    r.rz$ConfigMetadataHandler._parse_versionBs""5$-88emmooG
D    !
D
D
D5+;4;+B+B+B+BCCC
DN~d..ud6F
VVWWWsA3A:)rrrrSrxstrict_moder9curdirrboolrr\rrQrrrrr
__classcell__rs@r.rYrYsN #	GK'+)!!*!#!#	!
":!d^
!!!!!!!

X
BXXXXXXXr0rYrceZdZdZdddededejffdZe	dZ
dZd	ed
efdZ
edZd
ZdZdZdZdZdZdZdZdZxZS)rZrbrErr*racvt|||||j|_i|_dSr)rrr`rr^)rrErbr*rars     r.rzConfigOptionsHandler.__init__as=	W.BDUVVV"+
+-r0c0||dS)Nrj)r)rrs  r._parse_list_semicolonz*ConfigOptionsHandler._parse_list_semicolonlsu444r0c:|||jS)Nr)rr)rrWs  r._parse_file_in_rootz(ConfigOptionsHandler._parse_file_in_rootps
>>>r0rdrWc|||}t|||d|DS)Nc<g|]}|d|S)#)r})rrs  r.rzAConfigOptionsHandler._parse_requirements_list..ys)DDDts/C/CDDDDr0)rrrv)rrdrWrfs    r._parse_requirements_listz-ConfigOptionsHandler._parse_requirements_listssL++D,D,DU,K,KLL-eUFCCCEDDDDDr0c|j}|j}|j}|j}||||||||dt
t
|jd|j|j|j	|j
|t|dS)rzeThe namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).install_requires)zip_safeinclude_package_datar^scriptseager_resourcesdependency_linksnamespace_packagesr"setup_requires
tests_requirepackagesentry_points
py_modulespython_requirescmdclass)rrr_parse_cmdclassrrrr r_parse_packagesrr)rr
parse_boolrparse_cmdclasss     r.rzConfigOptionsHandler.parsers{s%
%
%
-#$.%!) *"&"A"AH,	##!(-/A!!#8!7, 4$+&-

	
r0cv|jj}tj||||jSr)rar^rr/rr)rrWr^s   r.r0z$ConfigOptionsHandler._parse_cmdclasss1,8t//66T]SSSr0c:ddg}|}||vr||S||jdi}|||dk|j|jtj	di|S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:z
packages.findr)
namespacesrfill_package_dirr4)
rrparse_section_packages__findrrrrr^r
find_packages)rrWfind_directives
trimmed_valuefind_kwargss     r.r1z$ConfigOptionsHandler._parse_packagess#$56


//##E***77Mor22

	%);;]!-		
	
	
#22k222r0c|||j}gdtfd|D}|d}||d|d<|S)zParses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        )whereincludeexcludec*g|]\}}|v	|||fSr4r4)rkr
valid_keyss   r.rzEConfigOptionsHandler.parse_section_packages__find..s*NNN1ZAaVr0r>Nr)rrrQr|r)rrsection_datar<r>rCs     @r.r8z1ConfigOptionsHandler.parse_section_packages__finds22?DDTUU444
NNNN 2 2 4 4NNN

((#(8K r0cF|||j}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        r,N)rrrrrfs   r.parse_section_entry_pointsz/ConfigOptionsHandler.parse_section_entry_pointss,
,,_d>NOO%^r0c`|||j}tj|Sr)rrrcanonic_package_data)rrpackage_datas   r._parse_package_dataz(ConfigOptionsHandler._parse_package_datas+22?DDTUU*<888r0c6|||d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        rJNrKrrs  r.parse_section_package_dataz/ConfigOptionsHandler.parse_section_package_datas"
 $77HH^r0c6|||d<dS)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        exclude_package_dataNrMrNs  r."parse_section_exclude_package_dataz7ConfigOptionsHandler.parse_section_exclude_package_datas#
(,'?'?'P'P
#$$$r0cD|fd}|d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        c8d|d|S)Nzextras_require[r)r )rBrrs  r.rzCConfigOptionsHandler.parse_section_extras_require..s#667M7M7M7MqQQr0extras_requireNrrFs`  r.parse_section_extras_requirez1ConfigOptionsHandler.parse_section_extras_requires<
55QQQQ


"(
r0cv|||j}tj||j|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        
data_filesN)rrrcanonic_data_filesrrFs   r.parse_section_data_filesz-ConfigOptionsHandler.parse_section_data_filess;
,,_d>NOO#6vt}MM\r0)rrrrSrrrr\rrrrrr rrr0r1r8rGrKrOrRrVrZrrs@r.rZrZ]spN	."	.#	.#		.
":	.	.	.	.	.	.55[5???EcE#EEEE

X
@TTT3332*&&&999IIIQQQ
(
(
(NNNNNNNr0rZ)FF)r4F)F);rr9rlrJrpcollectionsrrrtypingrrr	r
rrr
rrrrdistutils.errorsrr(setuptools.extern.packaging.requirementsrr#setuptools.extern.packaging.versionrr&setuptools.extern.packaging.specifiersrsetuptools._deprecation_warningrrzrr%rdistutils.distrrPathLikerSingleCommandOptionsrr rQr/r3rr'rOr(rArrvr6rYrZr4r0r.res'

			######55555555555555555555555555FEEEEEEETTTTTTTTGGGGGGGG??????HHHHHH4,,,,,,333333
c2;E5#445
 445	'M!N	O	O	O
+++
	++++8n.$&!&
$)% 	:	F					E*>$?D*(( (&(:;	((((V,,#,t,,,,BkkkkkGFOkkk\	XXXXXXXXXXM*@AXXXXXXv]N]N]N]N]N=8]N]N]N]N]Nr0PK!Ɠnn)config/__pycache__/expand.cpython-311.pycnu[

,Re?(dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZddlmZdd	lmZdd
l m!Z!ddl"m#Z$erdd
l%m&Z&ddl'm(Z(ddl)m*Z*ej+Z,ee-ej.fZ/edZ0eddZ1GddZ2	d@dee-dee/dee-fdZ3d@dee-e4ee/fde-fdZ5dee/dee/fdZ6dee4e/fde-fdZ7de/de-fdZ8		dAd e-d!eee-e-fdee/fd"Z9d#e-d$ee/de
fd%Z:d&e
d#e-defd'Z;d#e-d!eee-e-fde/dee/ee-e-ffd(Z<		dAd)e-d!eee-e-fdee/defd*Z=		dAd+ee-e-fd!eee-e-fdee/dee-effd,Z>dddd-d.eee-e-fdee/dee-fd/Z?d0e/d1e/de-fd2Z@d3eeeee-eAfe-fde-fd4ZBd5eCdeCfd6ZD	d@d7eeEeCfdee/deee-ee-ffd8ZFdBd:e-dee-eCffd;ZGGd<d=ZHGd>d?ee0e1fZIdS)CaiUtility functions to expand configuration directives or special values
(such glob patterns).

We can split the process of interpreting configuration files into 2 steps:

1. The parsing the file contents from strings to value objects
   that can be understand by Python (for example a string with a comma
   separated list of keywords into an actual Python list of strings).

2. The expansion (or post-processing) of these values according to the
   semantics ``setuptools`` assign to them (for example a configuration field
   with the ``file:`` directive should be expanded from a list of file paths to
   a single string with the contents of those files concatenated)

This module focus on the second step, and therefore allow sharing the expansion
functions among several configuration file formats.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
N)iglob)ConfigParser)
ModuleSpec)chain)
TYPE_CHECKINGCallableDictIterableIteratorListMappingOptionalTupleTypeVarUnioncast)Path)
ModuleType)DistutilsOptionError)	same_path)Distribution)ConfigDiscovery)DistributionMetadata_K_VT)	covariantcdeZdZdZdedefdZdeee	j
e	j
ffdZdZdS)	StaticModulez>Proxy to a module object that avoids executing arbitrary code.namespecctjtj|j}t
|t|`	dSN)
astparsepathlibrorigin
read_bytesvarsupdatelocalsself)r,r r!modules    /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/expand.py__init__zStaticModule.__init__BsP7<44??AABBT

&((###IIIreturnc#K|jjD]gttjrfdjDEd{V6ttjrjrjjfVhdS)Nc3*K|]
}|jfVdSr#value).0target	statements  r.	z1StaticModule._find_assignments..Js*VV&VY_5VVVVVVr0)	r-body
isinstancer$Assigntargets	AnnAssignr5r7)r,r8s @r._find_assignmentszStaticModule._find_assignmentsGs)	:	:I)SZ00
:VVVVIDUVVVVVVVVVVVIs}55
:)/
: '9999		:	:r0c	tfd|DS#t$r}t|jd|d}~wwxYw)zHAttempt to load an attribute "statically", via :func:`ast.literal_eval`.c3K|]@\}}t|tjr!|jk*tj|VAdSr#)r;r$Nameidliteral_eval)r6r7r5attrs   r.r9z+StaticModule.__getattr__..Qsa!FEfch//5;I4E4E ''4E4E4E4Er0z has no attribute N)nextr?	ExceptionAttributeErrorr )r,rEes ` r.__getattr__zStaticModule.__getattr__Ns	P%)%;%;%=%=

	P	P	P DI!G!G!G!GHHaO	Ps,0
AAAN)
__name__
__module____qualname____doc__strrr/rrr$ASTr?rJr0r.rr?s~HHS

:8E#'372B,C#D::::	P	P	P	P	Pr0rpatternsroot_dirr1c
hd}g}ptj|D]tfd|Dr{tjtj}|tfdt|dDtj	
tjd}|||S)aExpand the list of glob patterns, but preserving relative paths.

    :param list[str] patterns: List of glob patterns
    :param str root_dir: Path to which globs should be relative
                         (current directory by default)
    :rtype: list
    >*{}?[]c3 K|]}|vV	dSr#rQ)r6charr5s  r.r9z glob_relative..js'99tu}999999r0c3K|]B}tj|tjdVCdS)/N)ospathrelpathreplacesepr6r`rSs  r.r9z glob_relative..msY*>*>h//77DD*>*>*>*>*>*>r0T)	recursiver^)
r_getcwdanyr`abspathjoinextendsortedrrarbrcappend)rRrSglob_charactersexpanded_values	glob_pathr`r5s `    @r.
glob_relativerpZs!544OO&29;;H
)
)999999999
	)Xu(E(EFFI""6*>*>*>*>!)t<<<*>*>*>$>$>
?
?
?
?7??5(33;;BFCHHD""4((((r0	filepathscddlm}tjptjfd||D}dfdt|DS)zReturn the content of the files concatenated using ``
`` as str

    This function is sandboxed and won't reach anything outside ``root_dir``

    (By default ``root_dir`` is the current directory).
    r)always_iterablec3XK|]$}tj|V%dSr#)r_r`rirds  r.r9zread_files..s3VV4"',,x..VVVVVVr0
c3VK|]#}t|t|V$dSr#)
_assert_local
_read_filerds  r.r9zread_files..sOx((4r0) setuptools.extern.more_itertoolsrsr_r`rhrfri_filter_existing_files)rqrSrs
_filepathss `  r.
read_filesr|ysA@@@@@wx629;;77HVVVV??9;U;UVVVJ99*:66r0c#K|D]>}tj|r|V&tjd|d?dS)NzFile z cannot be found)r_r`isfilewarningswarn)rqr`s  r.rzrzs_<<
7>>$	<JJJJM:$:::;;;;	<11+{KKD89>++K88D|!+...Kr0r!ct|d|}|tjvrtj|Stj|}|tj|<|j||S)NrK)rsysmodulesrrmodule_from_specloaderexec_module)r!rr r-s    r.rrsi4[11Ds{{4  
^
,
,T
2
2FCKKF###Mr0c|}|d}|r|d|vr||d}|dd}t|dkr/tj||d}|d}n|}d|g|dd}n*d|vr&tj||d}tjj|g|dR}t
|dtj|dft|d	}	td
|	Dd}
||
|fS)a0Given a module (that could normally be imported by ``module_name``
    after the build is complete), find the path to the parent directory where
    it is contained and the canonical name that could be used to import it
    considering the ``package_dir`` in the build configuration and ``root_dir``
    rrr^Nz.pyz__init__.pyz.*c3XK|]%}tj|!|V&dSr#)r_r`r~)r6xs  r.r9z_find_module..s5CCa1B1BCCCCCCCr0)	rrsplitlenr_r`rirrrF)rrrSparent_pathmodule_partscustom_pathparts
parent_module
path_start
candidatesrs           r.rrsoK$$S))L
B?k))%l1o6K&&sA..E5zzA~~ gll8U1X>> %a

 +
((M#EL4D#EFFKK
;

',,xRAAKkCK,=,=c,B,BCCCJ			RW\\*mDDE
  JCC:CCCTJJK[00r0qualified_class_namec
|ptj}|d}||dzd}|d|}t|||\}}}t	t|||}	t
|	|S)z@Given a qualified class name, return the associated class objectrrN)r_rfrfindrrrr)
rrrSidx
class_namepkg_namerr`rr-s
          r.
resolve_classrs&29;;H

$
$S
)
)C%cAgii0J#DSD)H&28[(&S&S#L$

;55{
C
CF6:&&&r0valuescHfd|DS)zGiven a dictionary mapping command names to strings for qualified class
    names, apply :func:`resolve_class` to the dict values.
    c:i|]\}}|t|SrQ)r)r6kvrrSs   r.
zcmdclass..s+RRR41aA}QX66RRRr0)items)rrrSs ``r.cmdclassrs,SRRRR6<<>>RRRRr0)
namespacesfill_package_dirrSrc
ddlm}ddlm}m}|rddlm}nddlm}|ptj}|	ddg}g}	|in|}t|||
t
d	kr9t
fd
d|fDr|
d
d
D]}
t||
}|j|fi|}|	||rX|d|
ks?tj||s||||
|	S)aWorks similarly to :func:`setuptools.find_packages`, but with all
    arguments given as keyword arguments. Moreover, ``where`` can be given
    as a list (the results will be simply concatenated).

    When the additional keyword argument ``namespaces`` is ``True``, it will
    behave like :func:`setuptools.find_namespace_packages`` (i.e. include
    implicit namespaces as per :pep:`420`).

    The ``where`` argument will be considered relative to ``root_dir`` (or the current
    working directory when ``root_dir`` is not given).

    If the ``fill_package_dir`` argument is passed, this function will consider it as a
    similar data structure to the ``package_dir`` configuration parameter add fill-in
    any missing package location.

    :rtype: list
    r)construct_package_dir)unique_everseenrs)PEP420PackageFinder)
PackageFinderwhererNrc3FK|]}td|VdS)rN)
_same_path)r6rsearchs  r.r9z find_packages..=s4VVJvay!$<$< <VVVVVVr0r)setuptools.discoveryrryrrsrrr_curdirrlistrall
setdefault
_nest_pathfindrjgetr`samefiler*)rrrSkwargsrrrsrrpackagesr`package_pathpkgsrs             @r.
find_packagesrs0;:::::QQQQQQQQ7MMMMMMM666666$29HJJw&&EH-5rr;K
////%"8"899
:
:F
6{{aCVVVVsHoVVVVV##Bq	222GG!(D11!}!,99&99	G  $$,,wh77
-
##$9$9$$E$EFFFOr0parentr`c|dvr|ntj||}tj|S)N>rr)r_r`rinormpath)rr`s  r.rrMs;Y&&66BGLL,F,FD
7D!!!r0r5cBt|r
|}ttttt
f|}t
|ts>t|dr)dtt|}nd|z}|S)z`When getting the version directly from an attribute,
    it should be normalised to string.
    __iter__rz%s)
callablerr
rrOintr;hasattrrimapr4s r.versionrRs%S/*E22EeS!!!5*%%	!HHSe__--EE5LELr0package_datac>d|vr|d|d<|S)NrUr)r)rs r.canonic_package_datards+
l'++C00Rr0
data_filescrt|tr|Sfd|DS)zFor compatibility with ``setup.py``, ``data_files`` should be a list
    of pairs instead of a dict.

    This function also expands glob patterns.
    c:g|]\}}|t|fSrQ)rp)r6destrRrSs   r.
z&canonic_data_files..us<D(
}Xx001r0)r;rr)rrSs `r.canonic_data_filesrjsT*d##(..00r0entry-pointstextctdd}t|_|||d|D}||jd|S)a?Given the contents of entry-points file,
    process it into a 2-level dictionary (``dict[str, dict[str, str]]``).
    The first level keys are entry-point groups, the second level keys are
    entry-point names, and the second level values are references to objects
    (that correspond to the entry-point value).
    N)=)default_section
delimiterscXi|]'\}}|t|(SrQ)dictr)r6rrs   r.rz entry_points..s,
<
<
>> def obtain_mapping():
    ...     print("Running expensive function!")
    ...     return {"key": "value", "other key": "other value"}
    >>> mapping = LazyMappingProxy(obtain_mapping)
    >>> mapping["key"]
    Running expensive function!
    'value'
    >>> mapping["other key"]
    'other value'
    obtain_mapping_valuec"||_d|_dSr#)_obtain_value)r,rs  r.r/zLazyMappingProxy.__init__s+15r0r1cP|j||_|jSr#)rrrs r._targetzLazyMappingProxy._targets!;,,..DK{r0keyc6||Sr#)r)r,rs  r.__getitem__zLazyMappingProxy.__getitem__s||~~c""r0cDt|Sr#)rrrs r.__len__zLazyMappingProxy.__len__s4<<>>"""r0cDt|Sr#)iterrrs r.rzLazyMappingProxy.__iter__sDLLNN###r0N)rKrLrMrNrr
rrr/rr!rr#rrrQr0r.rrs6Xb'"b&/6I-J6666R
#r#b#########$(2,$$$$$$r0rr#)NN)r)JrNr$rrr_r&rrglobrconfigparserrimportlib.machineryr	itertoolsrtypingrrr	r
rrr
rrrrrrtypesrdistutils.errorsr_pathrrsetuptools.distrrrdistutils.distr
from_iterable
chain_iterrOPathLike_Pathrrrrpbytesr|rzrxrwrrrrrrrrrrrrrrrrrrQr0r.r5s&


								



%%%%%%******



























111111++++++4,,,,,,444444333333

 

c2;WT]]WTT"""PPPPPPPP8:>sm'/	#Y>%UHUO ;<PS$1JO1
5(3-$%1111H04 $
'
'
''#s(+,
'uo
'	
'
'
'
'$04 $SScNS'#s(+,SuoS
#x-	SSSS15 $	333tCH~.3uo	3
#Y
3333l"u"E"c""""
58E#s(O#._wrappersr
[/7.?		
fSkk#?ANNNNr4"6""")rrr)rrs` r_deprecation_noticers>
2YY
#
#
#
#Y
#Hr)__doc__r	functoolsrtextwraprtypingrrr_deprecation_warningr	rr__all__rrrrrr(s**********??????WT"""
7B2")()DEE))(*FGGrPK!'	qkqk0config/__pycache__/pyprojecttoml.cpython-311.pycnu[

,RehK:dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZddlmZmZddlmZdd	lmZdd
lmZmZe	rddlmZeeejfZeje Z!ded
e"fdZ#de"ded
e$fdZ%	d'ddded
dfdZ&			d(dededfdZ'de"de"dedd
e$fdZ(			d)de"deede$dedd
e"f
dZ)GddZ*dZ+ede$fd Z,Gd!d"ej-Z.Gd#d$e/Z0Gd%d&e/Z1dS)*z
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
N)contextmanager)partial)
TYPE_CHECKINGCallableDictOptionalMappingUnion)	FileErrorOptionError)expand)apply)_PREVIOUSLY_DEFINED_WouldIgnoreFieldDistributionfilepathreturncddlm}t|d5}||cdddS#1swxYwYdS)Nr)tomlirb)setuptools.externropenload)rrfiles   /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py	load_filers''''''	
h		 zz$                  s
9==configcddlm}|jd}t	|dr|	||S#|j$r}d|j}|j	
ddkr9t|t|j
d|j	d	}t|d
|dd}~wwxYw)Nr
)_validate_pyprojectztrove-classifier_disable_downloadzconfiguration error: `projectzinvalid pyproject.toml config: .
)r!FORMAT_FUNCTIONSgethasattrr"validateValidationErrorsummarynamestrip_loggerdebugdetails
ValueError)rr	validatortrove_classifierexr-errors       rr+r+!s222222 1556HII!455-**,,,
:!!&)))$:::6"*66
7==**MM'"""MM"*%%%<"'<<<E..W..//T9:sA
C+%BC&&C+FdistrcHt|d||}t|||S)zeApply the configuration from a ``pyproject.toml`` file into an existing
    distribution object.
    T)read_configuration_apply)r8rignore_option_errorsrs    rapply_configurationr=6s* $0Dd
K
KF$)))Tctj|}tj|st	d|dt|pi}|di}|di}|di}|r|s|siS|rd}tj|t|
}	|r,t|d|d	|j
n|d	d
||d<||d<	|d|id}
t|
|n]#t$rP}t!||	|ricYd}~S|r+t"d|jjd
|nYd}~nd}~wwxYw|r1tj|}t-||||S|S)aRead given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file in the ``pyproject.toml``
        format.

    :param bool expand: Whether to expand directives and other computed values
        (i.e. post-process the given configuration)

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. This is used for auto-discovery of packages in the case
        a dynamic configuration (e.g. ``attr`` or ``cmdclass``) is expanded.
        When ``expand=False`` this object is simply ignored.

    :rtype: dict
    zConfiguration file z does not exist.r$tool
setuptoolszDSupport for `[tool.setuptools]` in `pyproject.toml` is still *beta*.include_package_dataNzinclude-package-dataT)r$r@ignored error:  - )ospathabspathisfilerrr)warningswarn_BetaConfigurationcopygetattr
setdefaultrBr+	Exception_skip_bad_configr0r1	__class____name__dirnameexpand_configuration)
rrr<r8asdict
project_table
tool_tablesetuptools_tablemsgorig_setuptools_tablesubsetr6root_dirs
             rr:r:Bs46wx((H
7>>(##LJhJJJKKK
x
 
 
&BFJJy"--MFB''J!~~lB77-+;	/T
c-...-1133B455A##$:Drequires-pythonr.versionpython_requires)
stacklevelT)
metadatar.rainstall_requiressetkeysrIrJ_InvalidFilemessage)r]r^r8given_configpopular_subsets     rrPrPs|
"M!)!)uu{''))**LNNNN~%%	
l**,,lqIIIIt5r>r\r<cJt||||S)aGiven a configuration with unresolved fields (e.g. dynamic, cmdclass, ...)
    find their final values.

    :param dict config: Dict containing the configuration for the distribution
    :param str root_dir: Top-level directory for the distribution/project
        (the same directory where ``pyproject.toml`` is place)
    :param bool ignore_option_errors: see :func:`read_configuration`
    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. Used in the case a dynamic configuration
        (e.g. ``attr`` or ``cmdclass``).

    :rtype: dict
    )_ConfigExpanderr)rr\r<r8s    rrTrTs%(68-A4HHOOQQQr>c
eZdZ			d!dedeedededfdZd"d
Zdede	d
e
fdZd#dZdZ
dZdZdee	e	ffdZdddee	e	ffdZddde	fdZde	dee	e	ffdZddde	dee	e	ffdZdddee	e	ffdZddd	eee	e	ffdZdddee	e	fd	eee	effdZd$dZd$dZd$d ZdS)%rnNFrr\r<r8rcx||_|ptj|_|di|_|jdg|_|didi|_|jdi|_||_	||_
dS)Nr$dynamicr@rA)rrEgetcwdr\r)r]rqr^dynamic_cfgr<_dist)selfrr\r<r8s     r__init__z_ConfigExpander.__init__s /BIKK
!::i44'++Ir::$jj4488rJJ.229bAA$8!


r>rcxddlm}|j|jddd}|jp
||S)Nrrr.)src_rootr.)setuptools.distrr\r]r)rt)rurattrss   r_ensure_distz_ConfigExpander._ensure_distsN000000!]D4D4H4HQU4V4VWWz0\\%000r>	containerfieldfnc||vrCt|j5|||||<ddddS#1swxYwYdSdSN)_ignore_errorsr<)rur|r}r~s    r_process_fieldz_ConfigExpander._process_fieldsI 9::
8
8#%2i&6#7#7	% 
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8s
;??package-datac`|j|i}tj|Sr)r^r)_expandcanonic_package_data)rur}package_datas   r_canonic_package_dataz%_ConfigExpander._canonic_package_datas+*..ub99+L999r>c|||d|}t||j|j}|5}|j}||||	||dddn#1swxYwY|j
S)Nzexclude-package-data)_expand_packagesrr{_EnsurePackagesDiscoveredr]r^package_dir_expand_data_files_expand_cmdclass_expand_all_dynamicr)rur8ctxensure_discoveredrs     rrz_ConfigExpander.expands""$$$""#9:::  ""'d.>@STT
	8%+7K##%%%!!+...$$T;777		8	8	8	8	8	8	8	8	8	8	8	8	8	8	8{s/ACC	Cc|jd}|t|ttfrdS|d}t|t
rp|j|d<|jdi|d<t|j	5tjdi||jd<ddddS#1swxYwYdSdS)Npackagesfindr\package-dirfill_package_dir)r^r)
isinstancelisttupledictr\rNrr<r
find_packages)rurrs   rrz _ConfigExpander._expand_packagess8&**:66z(T5MBBF||F##dD!!	P#}D'+':'E'EmUW'X'XD#$ 9::
P
P292G2O2O$2O2O#J/
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P	P	Ps!CCCc~ttj|j}||jd|dS)N)r\z
data-files)rrcanonic_data_filesr\rr^)ru
data_filess  rrz"_ConfigExpander._expand_data_filess:W7$-PPP
D/zJJJJJr>rc|j}ttj||}||jd|dS)N)rr\cmdclass)r\rrrrr^)rurr\rs    rrz _ConfigExpander._expand_cmdclasssA=7+xXXXD/XFFFFFr>c
dfdjD}|pid|D}j	|dS)N)rareadmeentry-pointsscriptsgui-scriptsclassifiersdependenciesoptional-dependenciescHi|]}|v||Sr)_obtain).0r}r8rruspecials  r
z7_ConfigExpander._expand_all_dynamic..s@


G##
4<<e[99###r>)rarrroptional_dependenciesci|]
\}}|||Srr)rkvs   rrz7_ConfigExpander._expand_all_dynamic..&sNNNDAq
1a


r>)
rqupdate_obtain_entry_points_obtain_version_obtain_readme_obtain_classifiers_obtain_dependencies_obtain_optional_dependenciesitemsr])rur8robtained_dynamicupdatesrs```  @rrz#_ConfigExpander._expand_all_dynamics	











	%%dK88>B(({;;&&t,,006622488"&"D"DT"J"J
	 	
	
	
ON$4$:$:$<$<NNN(((((r>cpt||}||jsd|d}t|dSdS)Nz#No configuration found for dynamic z.
Some dynamic fields need to be specified via `tool.setuptools.dynamic`
others must be specified via the equivalent attribute in `setup.py`.)rr<r)rur8r}previousrYs     r_ensure_previously_setz&_ConfigExpander._ensure_previously_set)s_&u-d33D$=YeYYY

c"""
r>	specifierc,t|j5|j}d|vr'tj|d|cdddSd|vr(tj|d||cdddSt
d|d|#1swxYwYdS)Nrattrz	invalid `z`: )rr<r\r
read_files	read_attrr3)rur	directiverr\s     r_expand_directivez!_ConfigExpander._expand_directive3s$D5
6
6	F	F}H""))F*;XFF	F	F	F	F	F	F	F	F""(6):KRR	F	F	F	F	F	F	F	FDDDyDDEEE
	F	F	F	F	F	F	F	Fts&B	B	4B		B
B
c||jvr%|d||j||S|||dS)Nztool.setuptools.dynamic.)rsrr)rur8r}rs    rrz_ConfigExpander._obtain?s^D$$$))2522 '

	
##D%000tr>c|d|jvr2d|jvr)tj||d|SdS)Nra)rqrsrrar)rur8rs   rrz_ConfigExpander._obtain_versionIsA$$d6F)F)F?4<<i#M#MNNNtr>cd|jvrdS|j}d|vr4||di|ddddS||ddS)Nrcontent-typez
text/x-rst)textr)rqrsrr)r)rur8rss   rrz_ConfigExpander._obtain_readmeOs~4<''4&{""T8R88 +H 5 9 9., W W

	
##D(333tr>cd}tfd|DsdS|d|}|dStj|didtdtffd}|dd|d	d
S)N)rrrc3*K|]
}|jvVdSr)rq)rr}rus  r	z7_ConfigExpander._obtain_entry_points..as*==U5DL(======r>rr}groupc|vrT|}|jvr/tj||}t	j|t||<dSdSr)poprqrrjrIrJ)r}rvaluerYexpandedgroupsrus    r_set_scriptsz:_ConfigExpander._obtain_entry_points.._set_scriptskse

5)),,+3E5AACM#'8999#(r>rconsole_scriptsrgui_scripts)anyrrentry_pointsstr)rur8rfieldsrrrrs`     @@rrz$_ConfigExpander._obtain_entry_points]s<====f=====	4||D.+>><4%d++"F+	(	(C	(	(	(	(	(	(	(	(	Y 1222]M222r>crd|jvr-||di}|r|SdS)Nr)rqr
splitlinesrur8rs   rrz#_ConfigExpander._obtain_classifierszsCDL((LL}b99E
*'')))tr>chd|jvr(||di}|rt|SdS)Nr)rqr_parse_requirements_listrs   rrz$_ConfigExpander._obtain_dependenciess?T\))LL~r::E
7/666tr>cdjvrdSdjvrDjd}t|tsJfd|DS|ddS)Nrc
fi|]-\}}|td||i.S)z.tool.setuptools.dynamic.optional-dependencies.)rr)rrrrus   rrzA_ConfigExpander._obtain_optional_dependencies..s_%E9/0F0FLULL11r>)rqrsrrrr)rur8optional_dependencies_maps`  rrz-_ConfigExpander._obtain_optional_dependenciess"$,664"d&666(,(89P(Q%7>>>>>)B(G(G(I(I

	
##D*ABBBtr>NFN)rr)r)r8r)rR
__module____qualname__rr_Pathboolrvr{rrrrrrrr	rrrrrrrrrrrrrr>rrnrns%)%*)-5/#	
~& 111188S8h8888
:::: 
P
P
PKKKGGCH,=GGGG
))WSRUXEV))))<#>######

6=c3h6G



N3WSRUXEVNcAR>htCH~6N"18c1B	$sDy/	":r>rnc>d|DS)Ncg|]?}||d=|@S)#)r/
startswith)rlines  r
z,_parse_requirements_list..sV::<<!%

 7 7 < <r>)r)rs rrrs/$$&&r>c#K|sdVdS	dVdS#t$r5}td|jjd|Yd}~dSd}~wwxYw)NrCrD)rOr0r1rQrR)r<r6s  rrrs
H
HHH

F(=FF"FFGGGGGGGGGHs
A*AAc@eZdZdddedeffdZfdZfdZxZS)rdistributionrr]r^cft|||_||_dSr)superrv_project_cfg_setuptools_cfg)rurr]r^rQs    rrvz"_EnsurePackagesDiscovered.__init__s3	&&&'-r>c|j|j}}|di}||jpi||_|j|jj$|j	
d|j_|j|
d|_|j|
d|_tS)zWhen entering the context, the values of ``packages``, ``py_modules`` and
        ``package_dir`` that are missing in ``dist`` are copied from ``setuptools_cfg``.
        rNr.
py-modulesr)rtrrNrrset_defaults_ignore_ext_modulesrer.rr)
py_modulesrr	__enter__)rur8cfgrrQs    rrz#_EnsurePackagesDiscovered.__enter__sJ 4c&)nn]B&G&G4+1r222&--///=%!%!2!6!6v!>!>DM?"!ggl33DO= GGJ//DMww  """r>c|jd|jj|jd|jjt|||S)zWhen exiting the context, if values of ``packages``, ``py_modules`` and
        ``package_dir`` are missing in ``setuptools_cfg``, copy from ``dist``.
        rr)rrNrtrrr__exit__)ruexc_type	exc_value	tracebackrQs    rrz"_EnsurePackagesDiscovered.__exit__s]
	
''
DJ4GHHH''dj6KLLLww)Y???r>)rRrrrrvrr
__classcell__)rQs@rrrs.*.9=.OS......#####,@@@@@@@@@r>rceZdZdZdS)rKzJExplicitly inform users that some `pyproject.toml` configuration is *beta*N)rRrr__doc__rr>rrKrKsTTTTr>rKc(eZdZdZedZdS)riaThe given `pyproject.toml` file is invalid and would be ignored.
    !!


    ############################
    # Invalid `pyproject.toml` #
    ############################

    Any configurations in `pyproject.toml` will be ignored.
    Please note that future releases of setuptools will halt the build process
    if an invalid file is given.

    To prevent setuptools from considering `pyproject.toml` please
    DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.
    

!!
    c.ddlm}||jS)Nr)cleandoc)inspectrr)clsrs  rrjz_InvalidFile.messages&$$$$$$x$$$r>N)rRrrrclassmethodrjrr>rriris9

%%[%%%r>ri)F)TFNr)2rloggingrErI
contextlibr	functoolsrtypingrrrrr	r
setuptools.errorsrrr'rr_apply_pyprojecttomlrr;rrryrrPathLiker	getLoggerrRr0rrrr+r=r:rPrTrnrrEnsurePackagesDiscoveredrUserWarningrKrirr>rrs~
				%%%%%%JJJJJJJJJJJJJJJJ44444444111111HHHHHHHH-,,,,,,
c2;
'
H
%
%  $    :T:U:t::::0	*	*
	*	*		*	*	*	*%)	LLL>
"	LLLL^'+3;N3K	@!%!&%)	RRRuoRR>
"	R

RRRR.QQQQQQQQhHHHHH%@%@%@%@%@ @%@%@%@PUUUUUUUU%%%%%;%%%%%r>PK!ԽDXDX7config/__pycache__/_apply_pyprojecttoml.cpython-311.pycnu[

,ReV4UdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZmZmZmZmZmZmZmZdd	lmZerdd
lmZddlmZeiZ ee!d<eej"e#fZ$ee%e#fZ&ed
ee$gdfZ'ee#e'fZ(ej)e*Z+dd
de%de$dd
fdZ,dd
de%de$fdZ-dd
de%de$fdZ.dd
de%fdZ/de#de#fdZ0dd
de#defdZ1dddd Z2d!e#dee#fd"Z3dd
d#e&de$fd$Z4dd
d#e%de$fd%Z5dd
d#ee%d&e$d'e#fd(Z6dd
d#e%fd)Z7dd
d#e%fd*Z8dd
d#e9fd+Z:dd
d#e%fd,Z;de%fd-Zd2d3deee#effd4Z?d5e#de#fd6Z@d7eee#ee#e#fdee#fd8ZAd9ZBd:ZCe4e5e	e6d;<e	e6d=<e7e:e;e8d>ZDee#e(fe!d?<d@dAiZEdBdCiZFhdDZGeBdEeBdFeBdGeBdHeCdIdJeBdKeCdLdMeCdNdOeBdPeBdQeBdReBdSeCdTdUeCdVdWdXZHGdYdZeIZJdS)[akTranslation layer between pyproject config and setuptools distribution and
metadata objects.

The distribution and metadata objects are modeled after (an old version of)
core metadata, therefore configs in the format specified for ``pyproject.toml``
need to be processed before being applied.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
N)Mapping)Address)partialreduce)chain)MappingProxyType)

TYPE_CHECKINGAnyCallableDictListOptionalSetTupleTypeUnion)SetuptoolsDeprecationWarningmetadataDistributionEMPTYrdistconfigfilenamereturnc|s|Stj|pd}t|||t	|||tj}tj|	||tj|n#tj|wxYw|S)z=Apply configuration dict read with :func:`read_configuration`.)	ospathdirname_apply_project_table_apply_tool_tablegetcwdchdir_finalize_requires_finalize_license_files)rrrroot_dircurrent_directorys     /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.pyapplyr+$swx((/CHvx000dFH---	HX$!!!$$&&&
"####"####Ks0(B--Cr(c|di}|sdSt||t||D]]\}}t|}t||}t|r||||Lt|||^dS)Nproject)	getcopy_handle_missing_dynamic_unify_entry_pointsitemsjson_compatible_keyPYPROJECT_CORRESPONDENCEcallable_set_config)rrr(
project_tablefieldvaluenorm_keycorresps        r*r"r":sJJy"--2244MD-000
&&&%++--..u&u--*..xBBG	.GD%****gu----
..c|didi}|sdS|D]x\}}t|}|tvr/t|}d|d|}t	j|tt||}t|||yt|||dS)Ntool
setuptoolszThe parameter `z` is deprecated, )
r.r2r3TOOL_TABLE_DEPRECATIONSwarningswarnrTOOL_TABLE_RENAMESr6_copy_command_options)	rrr
tool_tabler8r9r:
suggestionmsgs	         r*r#r#KsFB''++L"==J"((**	+	+u&u--...0:JKHKKzKKCM#;<<<%))(H==D(E****&$11111r<r7ct|dg}tD]O\}}||vsF||vsB||}|r5t||}t
j|tPdS)zJBe temporarily forgiving with ``dynamic`` fields not listed in ``dynamic``dynamicN)setr._PREVIOUSLY_DEFINEDr2_WouldIgnoreFieldmessagerArB)rr7rIr8getterr9rGs       r*r0r0^s-##Ir2233G,224466
v&&%7*:*:F4LLE
6'//u==
c#455566r<keycR|ddS)z1As defined in :pep:`566#json-compatible-metadata`-_)lowerreplace)rOs r*r3r3js 99;;sC(((r<r8r9ct|jd|d}|r
||dSt|j|s	|tvrt	|j||dSt	|||dS)Nset_)getattrrhasattrSETUPTOOLS_PATCHESsetattr)rr8r9setters    r*r6r6os
T]N5NND
9
9F
$u




		&	&$%3E*E*E
ue,,,,,eU#####r<z
text/markdownz
text/x-rstz
text/plain)z.mdz.rstz.txtfilec@tj|\}}|sdS|tvr
t|SddtD}d|d}td|d|)N, c3,K|]\}}|d|dVdS)z ()N.0kvs   r*	z&_guess_content_type..s2FFtq!llalllFFFFFFr<z3only the following file extensions are recognized: rzUndefined content type for )rr splitextrS_CONTENT_TYPESjoinr2
ValueError)r\rRextvalidrGs     r*_guess_content_typerms
W

djjll
+
+FAst
nc""IIFF~/C/C/E/EFFFFFE
H
H
H
HC
@4@@3@@
A
AAr<valcbddlm}t|tr&|||}t|}nG|dp)||dg|}|d}t|d||rt|d|dSdS)Nrexpandtextr\zcontent-typelong_descriptionlong_description_content_type)setuptools.configrq
isinstancestr
read_filesrmr.r6)rrnr(rqrrctypes      r*_long_descriptionrzs((((((#s$  h//#C((wwvR&"3"3CGGFB4G4G"R"RN#($///BD95AAAAABBr<cddlm}d|vr.t|d||dg|dSt|d|ddS)Nrrpr\licenserr)rurqr6rx)rrnr(rqs    r*_licenser}sg((((((
}}D)V%6%6F}h%O%OPPPPPD)S[11111r<	_root_dirkindcg}g}|D]}d|vr||d"d|vr||dBt|d|d}|t||r$t||d||r)t||dd|dSdS)Nnameemail)display_name	addr_specr^_email)appendrrwr6ri)rrnr~rr8email_fieldpersonaddrs        r*_peoplersEK**vg////
F
"
"LL((((v&/RRRDs4yy))))2D$		% 0 0111CDT///499[+A+ABBBBBCCr<c(t|d|dS)Nproject_urls)r6)rrnr~s   r*
_project_urlsrsnc*****r<cFddlm}t|d||dS)Nr)SpecifierSetpython_requires)&setuptools.extern.packaging.specifiersrr6)rrnr~rs    r*_python_requiresrs7CCCCCC'c):):;;;;;r<cvt|dgrd}tj|t|d|dS)Ninstall_requireszA`install_requires` overwritten in `pyproject.toml` (dependencies))rWrArBr6)rrnr~rGs    r*
_dependenciesrsEt',,Q
c(#.....r<cRt|di}t|di||dS)Nextras_require)rWr6)rrnr~existings    r*_optional_dependenciesrs8t-r22H&(;8(;s(;<<<<z2_unify_entry_points...s&:::DAqa<z'_unify_entry_points..sE#
#
#
e
::EKKMM:::#
#
#
r<)poplistr2r3)r7r-rrenamingrOr9r:s       r*r1r1sG;;~w{{>2/N/NOOL,]KKH7==??++@@
U&s++xE/6{{3/?/?L(+,
#
#
+1133#
#
#


r<	pyprojectc	|di}|didi}t|}|j}|didiD]\}}t	|}||t}	||i|D]S\}
}t	|
}
t||f|||
<|
|	vr!t	d|d|
dTdS)Nr>r?cmdclass	distutilszCommand option rz is not defined)
r._valid_command_optionscommand_optionsr2r3rJ
setdefaultrw_loggerwarning)rrrrEr
valid_optionscmd_optscmdrrlrOr9s            r*rDrDsQvr**J~~lB//33JCCH*844M#H }}VR0044["EEKKMM
N
NV!#&&!!#suu--C$$$ ,,..	N	NJC%c**C"%h--!7HSM#% L# L L L L LMMM
	N	
N
Nr<rc	|ddlm}ddlm}dt	|ji}|jd}d|D}d	|D}t||D]M\}}|	|t}	|	t	t|d
gz}	|	||<N|S)Nrrrglobalzdistutils.commands)rc34K|]}t|VdSN)_load_eprceps  r*rfz)_valid_command_options..s(HHB8B<<HHHHHHr<c3K|]}||V	dSrrars  r*rfz)_valid_command_options..s';;2;B;;;;;;r<user_options)
_importlibrsetuptools.distr_normalise_cmd_optionsglobal_optionsrrr2r.rJrW)
rrrrunloaded_entry_pointsloaded_entry_pointsrr	cmd_classoptss
          r*rrs%%%%%%,,,,,,5l6QRRSM1H18LMMMHH2GHHH;;!4;;;Lhnn.>.>??""Y  cee,,,WYPR-S-STTT!
cr<rzmetadata.EntryPointc	|j|fS#t$r@}|jjd|j}t
|d|Yd}~dSd}~wwxYw)Nz" while trying to load entry-point z: )rload	Exception	__class____name__rr)rexrGs   r*rrs~##&SS"'SS3"'''ttttts
A'5A""A'rcFt|dS)Nz_=)r3strip)rs r*_normalise_cmd_option_keyrst$$**4000r<desccd|DS)Nc8h|]}t|dS)r)r)rcfancy_options  r*	z)_normalise_cmd_options..s%PPP<%l1o66PPPr<ra)rs r*rrsPP4PPPPr<cVttd|dS)a8
    Similar to ``operator.attrgetter`` but returns None if ``attr`` is not found
    >>> from types import SimpleNamespace
    >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13))
    >>> _attrgetter("a")(obj)
    42
    >>> _attrgetter("b.c")(obj)
    13
    >>> _attrgetter("d")(obj) is None
    True
    c$t||dSr)rW)accxs  r*z_attrgetter..s'#q$*?*?r<r)rrsplit)attrs r*_attrgetterrs$6??CQQQr<cfd}|S)aL
    Return the first "truth-y" attribute or None
    >>> from types import SimpleNamespace
    >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13))
    >>> _some_attrgetter("d", "a", "b.c")(obj)
    42
    >>> _some_attrgetter("d", "e", "b.c", "a")(obj)
    13
    >>> _some_attrgetter("d", "e", "f")(obj) is None
    True
    cVfdD}td|DdS)Nc3HK|]}t|VdSr)r)rciobjs  r*rfz5_some_attrgetter.._acessor../s355!.+a..%%555555r<c3K|]}||V	dSrra)rcrs  r*rfz5_some_attrgetter.._acessor..0s"881!-Q----88r<)next)rvaluesr2s` r*_acessorz"_some_attrgetter.._acessor.s<5555u55588888$???r<ra)r2rs` r*_some_attrgetterr"s(@@@@@Or<author)r
maintainer)readmer|authorsmaintainersurlsdependenciesoptional_dependenciesrequires_pythonr4script_filesrnamespace_packagesz5consider using implicit namespaces instead (PEP 420).>license_filer
license_filesprovides_extrasrtz
metadata.namezmetadata.versionzmetadata.descriptionzmetadata.long_descriptionrzmetadata.python_requireszmetadata.licensezmetadata.authorzmetadata.author_emailzmetadata.maintainerzmetadata.maintainer_emailzmetadata.keywordszmetadata.classifierszmetadata.project_urlsr_orig_install_requiresr_orig_extras_requirer)rversiondescriptionrzrequires-pythonr|rrkeywordsclassifiersrrrzoptional-dependenciesc,eZdZdZdZedZdS)rLzGInform users that ``pyproject.toml`` would overwrite previous metadata.a    {field!r} defined outside of `pyproject.toml` would be ignored.
    !!


    ##########################################################################
    # configuration would be ignored/result in error due to `pyproject.toml` #
    ##########################################################################

    The following seems to be defined outside of `pyproject.toml`:

    `{field} = {value!r}`

    According to the spec (see the link below), however, setuptools CANNOT
    consider this value unless {field!r} is listed as `dynamic`.

    https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

    For the time being, `setuptools` will still consider the given value (as a
    **transitional** measure), but please note that future releases of setuptools will
    follow strictly the standard.

    To prevent this warning, you can list {field!r} under `dynamic` or alternatively
    remove the `[project]` table from your file and rely entirely on other means of
    configuration.
    

!!
    cXddlm}||j||S)Nr)cleandoc)r8r9)inspectrMESSAGEformat)clsr8r9rs    r*rMz_WouldIgnoreField.messagevs9$$$$$$x**e*DDEEEr<N)r
__module____qualname____doc__rclassmethodrMrar<r*rLrLYsAQQG4FF[FFFr<rL)KrloggingrrAcollections.abcremail.headerregistryr	functoolsrr	itertoolsrtypesrtypingr	r
rrr
rrrrrsetuptools._deprecation_warningrsetuptools._importlibrrrr__annotations__PathLikerw_Pathdict
_DictOrStr
_CorrespFn_Correspondence	getLoggerrrr+r"r#r0r3r6rhrmrzr}rrrrrrr1rDrrrrrrr4rCr@rYrKUserWarningrLrar<r*rs				######((((((%%%%%%%%""""""!!!!!!!!!!!!!!!!!!!!!!!!IHHHHH-......,,,,,,!!"%%w%%%
bk3
49


~sE2D8
9
Z(
'
H
%
%.,.~.t.u...."2N2D2E2222&	6.	6	6	6	6	6)S)S))))
$n$S$$$$$
Bc
Bhsm
B
B
B
BBNBBuBBBB2>222222C.CtDzCeC3CCCC$++T++++<><<<<<//T////==d====


t







 NTNN5NNNN&05Wc3s8m9L"&8E#t)4D+E1C1C1111QeC#,C&D!EQ#c(QQQQRRR& wwX...77666!3'	8	8$sO34			%i0QJJJ
K(({-..;566k566''(9;UVV{-.. 13JKK##$9;VWW/00;566K/00K//$$%=?QRR--.DFVWW$ F F F F F F F F F Fr<PK!v??config/expand.pynu["""Utility functions to expand configuration directives or special values
(such glob patterns).

We can split the process of interpreting configuration files into 2 steps:

1. The parsing the file contents from strings to value objects
   that can be understand by Python (for example a string with a comma
   separated list of keywords into an actual Python list of strings).

2. The expansion (or post-processing) of these values according to the
   semantics ``setuptools`` assign to them (for example a configuration field
   with the ``file:`` directive should be expanded from a list of file paths to
   a single string with the contents of those files concatenated)

This module focus on the second step, and therefore allow sharing the expansion
functions among several configuration file formats.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
"""
import ast
import importlib
import io
import os
import pathlib
import sys
import warnings
from glob import iglob
from configparser import ConfigParser
from importlib.machinery import ModuleSpec
from itertools import chain
from typing import (
    TYPE_CHECKING,
    Callable,
    Dict,
    Iterable,
    Iterator,
    List,
    Mapping,
    Optional,
    Tuple,
    TypeVar,
    Union,
    cast
)
from pathlib import Path
from types import ModuleType

from distutils.errors import DistutilsOptionError

from .._path import same_path as _same_path

if TYPE_CHECKING:
    from setuptools.dist import Distribution  # noqa
    from setuptools.discovery import ConfigDiscovery  # noqa
    from distutils.dist import DistributionMetadata  # noqa

chain_iter = chain.from_iterable
_Path = Union[str, os.PathLike]
_K = TypeVar("_K")
_V = TypeVar("_V", covariant=True)


class StaticModule:
    """Proxy to a module object that avoids executing arbitrary code."""

    def __init__(self, name: str, spec: ModuleSpec):
        module = ast.parse(pathlib.Path(spec.origin).read_bytes())
        vars(self).update(locals())
        del self.self

    def _find_assignments(self) -> Iterator[Tuple[ast.AST, ast.AST]]:
        for statement in self.module.body:
            if isinstance(statement, ast.Assign):
                yield from ((target, statement.value) for target in statement.targets)
            elif isinstance(statement, ast.AnnAssign) and statement.value:
                yield (statement.target, statement.value)

    def __getattr__(self, attr):
        """Attempt to load an attribute "statically", via :func:`ast.literal_eval`."""
        try:
            return next(
                ast.literal_eval(value)
                for target, value in self._find_assignments()
                if isinstance(target, ast.Name) and target.id == attr
            )
        except Exception as e:
            raise AttributeError(f"{self.name} has no attribute {attr}") from e


def glob_relative(
    patterns: Iterable[str], root_dir: Optional[_Path] = None
) -> List[str]:
    """Expand the list of glob patterns, but preserving relative paths.

    :param list[str] patterns: List of glob patterns
    :param str root_dir: Path to which globs should be relative
                         (current directory by default)
    :rtype: list
    """
    glob_characters = {'*', '?', '[', ']', '{', '}'}
    expanded_values = []
    root_dir = root_dir or os.getcwd()
    for value in patterns:

        # Has globby characters?
        if any(char in value for char in glob_characters):
            # then expand the glob pattern while keeping paths *relative*:
            glob_path = os.path.abspath(os.path.join(root_dir, value))
            expanded_values.extend(sorted(
                os.path.relpath(path, root_dir).replace(os.sep, "/")
                for path in iglob(glob_path, recursive=True)))

        else:
            # take the value as-is
            path = os.path.relpath(value, root_dir).replace(os.sep, "/")
            expanded_values.append(path)

    return expanded_values


def read_files(filepaths: Union[str, bytes, Iterable[_Path]], root_dir=None) -> str:
    """Return the content of the files concatenated using ``\n`` as str

    This function is sandboxed and won't reach anything outside ``root_dir``

    (By default ``root_dir`` is the current directory).
    """
    from setuptools.extern.more_itertools import always_iterable

    root_dir = os.path.abspath(root_dir or os.getcwd())
    _filepaths = (os.path.join(root_dir, path) for path in always_iterable(filepaths))
    return '\n'.join(
        _read_file(path)
        for path in _filter_existing_files(_filepaths)
        if _assert_local(path, root_dir)
    )


def _filter_existing_files(filepaths: Iterable[_Path]) -> Iterator[_Path]:
    for path in filepaths:
        if os.path.isfile(path):
            yield path
        else:
            warnings.warn(f"File {path!r} cannot be found")


def _read_file(filepath: Union[bytes, _Path]) -> str:
    with io.open(filepath, encoding='utf-8') as f:
        return f.read()


def _assert_local(filepath: _Path, root_dir: str):
    if Path(os.path.abspath(root_dir)) not in Path(os.path.abspath(filepath)).parents:
        msg = f"Cannot access {filepath!r} (or anything outside {root_dir!r})"
        raise DistutilsOptionError(msg)

    return True


def read_attr(
    attr_desc: str,
    package_dir: Optional[Mapping[str, str]] = None,
    root_dir: Optional[_Path] = None
):
    """Reads the value of an attribute from a module.

    This function will try to read the attributed statically first
    (via :func:`ast.literal_eval`), and only evaluate the module if it fails.

    Examples:
        read_attr("package.attr")
        read_attr("package.module.attr")

    :param str attr_desc: Dot-separated string describing how to reach the
        attribute (see examples above)
    :param dict[str, str] package_dir: Mapping of package names to their
        location in disk (represented by paths relative to ``root_dir``).
    :param str root_dir: Path to directory containing all the packages in
        ``package_dir`` (current directory by default).
    :rtype: str
    """
    root_dir = root_dir or os.getcwd()
    attrs_path = attr_desc.strip().split('.')
    attr_name = attrs_path.pop()
    module_name = '.'.join(attrs_path)
    module_name = module_name or '__init__'
    _parent_path, path, module_name = _find_module(module_name, package_dir, root_dir)
    spec = _find_spec(module_name, path)

    try:
        return getattr(StaticModule(module_name, spec), attr_name)
    except Exception:
        # fallback to evaluate module
        module = _load_spec(spec, module_name)
        return getattr(module, attr_name)


def _find_spec(module_name: str, module_path: Optional[_Path]) -> ModuleSpec:
    spec = importlib.util.spec_from_file_location(module_name, module_path)
    spec = spec or importlib.util.find_spec(module_name)

    if spec is None:
        raise ModuleNotFoundError(module_name)

    return spec


def _load_spec(spec: ModuleSpec, module_name: str) -> ModuleType:
    name = getattr(spec, "__name__", module_name)
    if name in sys.modules:
        return sys.modules[name]
    module = importlib.util.module_from_spec(spec)
    sys.modules[name] = module  # cache (it also ensures `==` works on loaded items)
    spec.loader.exec_module(module)  # type: ignore
    return module


def _find_module(
    module_name: str, package_dir: Optional[Mapping[str, str]], root_dir: _Path
) -> Tuple[_Path, Optional[str], str]:
    """Given a module (that could normally be imported by ``module_name``
    after the build is complete), find the path to the parent directory where
    it is contained and the canonical name that could be used to import it
    considering the ``package_dir`` in the build configuration and ``root_dir``
    """
    parent_path = root_dir
    module_parts = module_name.split('.')
    if package_dir:
        if module_parts[0] in package_dir:
            # A custom path was specified for the module we want to import
            custom_path = package_dir[module_parts[0]]
            parts = custom_path.rsplit('/', 1)
            if len(parts) > 1:
                parent_path = os.path.join(root_dir, parts[0])
                parent_module = parts[1]
            else:
                parent_module = custom_path
            module_name = ".".join([parent_module, *module_parts[1:]])
        elif '' in package_dir:
            # A custom parent directory was specified for all root modules
            parent_path = os.path.join(root_dir, package_dir[''])

    path_start = os.path.join(parent_path, *module_name.split("."))
    candidates = chain(
        (f"{path_start}.py", os.path.join(path_start, "__init__.py")),
        iglob(f"{path_start}.*")
    )
    module_path = next((x for x in candidates if os.path.isfile(x)), None)
    return parent_path, module_path, module_name


def resolve_class(
    qualified_class_name: str,
    package_dir: Optional[Mapping[str, str]] = None,
    root_dir: Optional[_Path] = None
) -> Callable:
    """Given a qualified class name, return the associated class object"""
    root_dir = root_dir or os.getcwd()
    idx = qualified_class_name.rfind('.')
    class_name = qualified_class_name[idx + 1 :]
    pkg_name = qualified_class_name[:idx]

    _parent_path, path, module_name = _find_module(pkg_name, package_dir, root_dir)
    module = _load_spec(_find_spec(module_name, path), module_name)
    return getattr(module, class_name)


def cmdclass(
    values: Dict[str, str],
    package_dir: Optional[Mapping[str, str]] = None,
    root_dir: Optional[_Path] = None
) -> Dict[str, Callable]:
    """Given a dictionary mapping command names to strings for qualified class
    names, apply :func:`resolve_class` to the dict values.
    """
    return {k: resolve_class(v, package_dir, root_dir) for k, v in values.items()}


def find_packages(
    *,
    namespaces=True,
    fill_package_dir: Optional[Dict[str, str]] = None,
    root_dir: Optional[_Path] = None,
    **kwargs
) -> List[str]:
    """Works similarly to :func:`setuptools.find_packages`, but with all
    arguments given as keyword arguments. Moreover, ``where`` can be given
    as a list (the results will be simply concatenated).

    When the additional keyword argument ``namespaces`` is ``True``, it will
    behave like :func:`setuptools.find_namespace_packages`` (i.e. include
    implicit namespaces as per :pep:`420`).

    The ``where`` argument will be considered relative to ``root_dir`` (or the current
    working directory when ``root_dir`` is not given).

    If the ``fill_package_dir`` argument is passed, this function will consider it as a
    similar data structure to the ``package_dir`` configuration parameter add fill-in
    any missing package location.

    :rtype: list
    """
    from setuptools.discovery import construct_package_dir
    from setuptools.extern.more_itertools import unique_everseen, always_iterable

    if namespaces:
        from setuptools.discovery import PEP420PackageFinder as PackageFinder
    else:
        from setuptools.discovery import PackageFinder  # type: ignore

    root_dir = root_dir or os.curdir
    where = kwargs.pop('where', ['.'])
    packages: List[str] = []
    fill_package_dir = {} if fill_package_dir is None else fill_package_dir
    search = list(unique_everseen(always_iterable(where)))

    if len(search) == 1 and all(not _same_path(search[0], x) for x in (".", root_dir)):
        fill_package_dir.setdefault("", search[0])

    for path in search:
        package_path = _nest_path(root_dir, path)
        pkgs = PackageFinder.find(package_path, **kwargs)
        packages.extend(pkgs)
        if pkgs and not (
            fill_package_dir.get("") == path
            or os.path.samefile(package_path, root_dir)
        ):
            fill_package_dir.update(construct_package_dir(pkgs, path))

    return packages


def _nest_path(parent: _Path, path: _Path) -> str:
    path = parent if path in {".", ""} else os.path.join(parent, path)
    return os.path.normpath(path)


def version(value: Union[Callable, Iterable[Union[str, int]], str]) -> str:
    """When getting the version directly from an attribute,
    it should be normalised to string.
    """
    if callable(value):
        value = value()

    value = cast(Iterable[Union[str, int]], value)

    if not isinstance(value, str):
        if hasattr(value, '__iter__'):
            value = '.'.join(map(str, value))
        else:
            value = '%s' % value

    return value


def canonic_package_data(package_data: dict) -> dict:
    if "*" in package_data:
        package_data[""] = package_data.pop("*")
    return package_data


def canonic_data_files(
    data_files: Union[list, dict], root_dir: Optional[_Path] = None
) -> List[Tuple[str, List[str]]]:
    """For compatibility with ``setup.py``, ``data_files`` should be a list
    of pairs instead of a dict.

    This function also expands glob patterns.
    """
    if isinstance(data_files, list):
        return data_files

    return [
        (dest, glob_relative(patterns, root_dir))
        for dest, patterns in data_files.items()
    ]


def entry_points(text: str, text_source="entry-points") -> Dict[str, dict]:
    """Given the contents of entry-points file,
    process it into a 2-level dictionary (``dict[str, dict[str, str]]``).
    The first level keys are entry-point groups, the second level keys are
    entry-point names, and the second level values are references to objects
    (that correspond to the entry-point value).
    """
    parser = ConfigParser(default_section=None, delimiters=("=",))  # type: ignore
    parser.optionxform = str  # case sensitive
    parser.read_string(text, text_source)
    groups = {k: dict(v.items()) for k, v in parser.items()}
    groups.pop(parser.default_section, None)
    return groups


class EnsurePackagesDiscovered:
    """Some expand functions require all the packages to already be discovered before
    they run, e.g. :func:`read_attr`, :func:`resolve_class`, :func:`cmdclass`.

    Therefore in some cases we will need to run autodiscovery during the evaluation of
    the configuration. However, it is better to postpone calling package discovery as
    much as possible, because some parameters can influence it (e.g. ``package_dir``),
    and those might not have been processed yet.
    """

    def __init__(self, distribution: "Distribution"):
        self._dist = distribution
        self._called = False

    def __call__(self):
        """Trigger the automatic package discovery, if it is still necessary."""
        if not self._called:
            self._called = True
            self._dist.set_defaults(name=False)  # Skip name, we can still be parsing

    def __enter__(self):
        return self

    def __exit__(self, _exc_type, _exc_value, _traceback):
        if self._called:
            self._dist.set_defaults.analyse_name()  # Now we can set a default name

    def _get_package_dir(self) -> Mapping[str, str]:
        self()
        pkg_dir = self._dist.package_dir
        return {} if pkg_dir is None else pkg_dir

    @property
    def package_dir(self) -> Mapping[str, str]:
        """Proxy to ``package_dir`` that may trigger auto-discovery when used."""
        return LazyMappingProxy(self._get_package_dir)


class LazyMappingProxy(Mapping[_K, _V]):
    """Mapping proxy that delays resolving the target object, until really needed.

    >>> def obtain_mapping():
    ...     print("Running expensive function!")
    ...     return {"key": "value", "other key": "other value"}
    >>> mapping = LazyMappingProxy(obtain_mapping)
    >>> mapping["key"]
    Running expensive function!
    'value'
    >>> mapping["other key"]
    'other value'
    """

    def __init__(self, obtain_mapping_value: Callable[[], Mapping[_K, _V]]):
        self._obtain = obtain_mapping_value
        self._value: Optional[Mapping[_K, _V]] = None

    def _target(self) -> Mapping[_K, _V]:
        if self._value is None:
            self._value = self._obtain()
        return self._value

    def __getitem__(self, key: _K) -> _V:
        return self._target()[key]

    def __len__(self) -> int:
        return len(self._target())

    def __iter__(self) -> Iterator[_K]:
        return iter(self._target())
PK!Tnbnbconfig/setupcfg.pynu["""
Load setuptools configuration from ``setup.cfg`` files.

**API will be made private in the future**
"""
import os

import contextlib
import functools
import warnings
from collections import defaultdict
from functools import partial
from functools import wraps
from typing import (TYPE_CHECKING, Callable, Any, Dict, Generic, Iterable, List,
                    Optional, Tuple, TypeVar, Union)

from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.extern.packaging.requirements import Requirement, InvalidRequirement
from setuptools.extern.packaging.version import Version, InvalidVersion
from setuptools.extern.packaging.specifiers import SpecifierSet
from setuptools._deprecation_warning import SetuptoolsDeprecationWarning

from . import expand

if TYPE_CHECKING:
    from setuptools.dist import Distribution  # noqa
    from distutils.dist import DistributionMetadata  # noqa

_Path = Union[str, os.PathLike]
SingleCommandOptions = Dict["str", Tuple["str", Any]]
"""Dict that associate the name of the options of a particular command to a
tuple. The first element of the tuple indicates the origin of the option value
(e.g. the name of the configuration file where it was read from),
while the second element of the tuple is the option value itself
"""
AllCommandOptions = Dict["str", SingleCommandOptions]  # cmd name => its options
Target = TypeVar("Target", bound=Union["Distribution", "DistributionMetadata"])


def read_configuration(
    filepath: _Path,
    find_others=False,
    ignore_option_errors=False
) -> dict:
    """Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file
        to get options from.

    :param bool find_others: Whether to search for other configuration files
        which could be on in various places.

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :rtype: dict
    """
    from setuptools.dist import Distribution

    dist = Distribution()
    filenames = dist.find_config_files() if find_others else []
    handlers = _apply(dist, filepath, filenames, ignore_option_errors)
    return configuration_to_dict(handlers)


def apply_configuration(dist: "Distribution", filepath: _Path) -> "Distribution":
    """Apply the configuration from a ``setup.cfg`` file into an existing
    distribution object.
    """
    _apply(dist, filepath)
    dist._finalize_requires()
    return dist


def _apply(
    dist: "Distribution", filepath: _Path,
    other_files: Iterable[_Path] = (),
    ignore_option_errors: bool = False,
) -> Tuple["ConfigHandler", ...]:
    """Read configuration from ``filepath`` and applies to the ``dist`` object."""
    from setuptools.dist import _Distribution

    filepath = os.path.abspath(filepath)

    if not os.path.isfile(filepath):
        raise DistutilsFileError('Configuration file %s does not exist.' % filepath)

    current_directory = os.getcwd()
    os.chdir(os.path.dirname(filepath))
    filenames = [*other_files, filepath]

    try:
        _Distribution.parse_config_files(dist, filenames=filenames)
        handlers = parse_configuration(
            dist, dist.command_options, ignore_option_errors=ignore_option_errors
        )
        dist._finalize_license_files()
    finally:
        os.chdir(current_directory)

    return handlers


def _get_option(target_obj: Target, key: str):
    """
    Given a target object and option key, get that option from
    the target object, either through a get_{key} method or
    from an attribute directly.
    """
    getter_name = 'get_{key}'.format(**locals())
    by_attribute = functools.partial(getattr, target_obj, key)
    getter = getattr(target_obj, getter_name, by_attribute)
    return getter()


def configuration_to_dict(handlers: Tuple["ConfigHandler", ...]) -> dict:
    """Returns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    """
    config_dict: dict = defaultdict(dict)

    for handler in handlers:
        for option in handler.set_options:
            value = _get_option(handler.target_obj, option)
            config_dict[handler.section_prefix][option] = value

    return config_dict


def parse_configuration(
    distribution: "Distribution",
    command_options: AllCommandOptions,
    ignore_option_errors=False
) -> Tuple["ConfigMetadataHandler", "ConfigOptionsHandler"]:
    """Performs additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    """
    with expand.EnsurePackagesDiscovered(distribution) as ensure_discovered:
        options = ConfigOptionsHandler(
            distribution,
            command_options,
            ignore_option_errors,
            ensure_discovered,
        )

        options.parse()
        if not distribution.package_dir:
            distribution.package_dir = options.package_dir  # Filled by `find_packages`

        meta = ConfigMetadataHandler(
            distribution.metadata,
            command_options,
            ignore_option_errors,
            ensure_discovered,
            distribution.package_dir,
            distribution.src_root,
        )
        meta.parse()

    return meta, options


def _warn_accidental_env_marker_misconfig(label: str, orig_value: str, parsed: list):
    """Because users sometimes misinterpret this configuration:

    [options.extras_require]
    foo = bar;python_version<"4"

    It looks like one requirement with an environment marker
    but because there is no newline, it's parsed as two requirements
    with a semicolon as separator.

    Therefore, if:
        * input string does not contain a newline AND
        * parsed result contains two requirements AND
        * parsing of the two parts from the result (";")
        leads in a valid Requirement with a valid marker
    a UserWarning is shown to inform the user about the possible problem.
    """
    if "\n" in orig_value or len(parsed) != 2:
        return

    with contextlib.suppress(InvalidRequirement):
        original_requirements_str = ";".join(parsed)
        req = Requirement(original_requirements_str)
        if req.marker is not None:
            msg = (
                f"One of the parsed requirements in `{label}` "
                f"looks like a valid environment marker: '{parsed[1]}'\n"
                "Make sure that the config is correct and check "
                "https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#opt-2"  # noqa: E501
            )
            warnings.warn(msg, UserWarning)


class ConfigHandler(Generic[Target]):
    """Handles metadata supplied in configuration files."""

    section_prefix: str
    """Prefix for config sections handled by this handler.
    Must be provided by class heirs.

    """

    aliases: Dict[str, str] = {}
    """Options aliases.
    For compatibility with various packages. E.g.: d2to1 and pbr.
    Note: `-` in keys is replaced with `_` by config parser.

    """

    def __init__(
        self,
        target_obj: Target,
        options: AllCommandOptions,
        ignore_option_errors,
        ensure_discovered: expand.EnsurePackagesDiscovered,
    ):
        sections: AllCommandOptions = {}

        section_prefix = self.section_prefix
        for section_name, section_options in options.items():
            if not section_name.startswith(section_prefix):
                continue

            section_name = section_name.replace(section_prefix, '').strip('.')
            sections[section_name] = section_options

        self.ignore_option_errors = ignore_option_errors
        self.target_obj = target_obj
        self.sections = sections
        self.set_options: List[str] = []
        self.ensure_discovered = ensure_discovered

    @property
    def parsers(self):
        """Metadata item name to parser function mapping."""
        raise NotImplementedError(
            '%s must provide .parsers property' % self.__class__.__name__
        )

    def __setitem__(self, option_name, value):
        unknown = tuple()
        target_obj = self.target_obj

        # Translate alias into real name.
        option_name = self.aliases.get(option_name, option_name)

        current_value = getattr(target_obj, option_name, unknown)

        if current_value is unknown:
            raise KeyError(option_name)

        if current_value:
            # Already inhabited. Skipping.
            return

        skip_option = False
        parser = self.parsers.get(option_name)
        if parser:
            try:
                value = parser(value)

            except Exception:
                skip_option = True
                if not self.ignore_option_errors:
                    raise

        if skip_option:
            return

        setter = getattr(target_obj, 'set_%s' % option_name, None)
        if setter is None:
            setattr(target_obj, option_name, value)
        else:
            setter(value)

        self.set_options.append(option_name)

    @classmethod
    def _parse_list(cls, value, separator=','):
        """Represents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        """
        if isinstance(value, list):  # _get_parser_compound case
            return value

        if '\n' in value:
            value = value.splitlines()
        else:
            value = value.split(separator)

        return [chunk.strip() for chunk in value if chunk.strip()]

    @classmethod
    def _parse_dict(cls, value):
        """Represents value as a dict.

        :param value:
        :rtype: dict
        """
        separator = '='
        result = {}
        for line in cls._parse_list(value):
            key, sep, val = line.partition(separator)
            if sep != separator:
                raise DistutilsOptionError(
                    'Unable to parse option value to dict: %s' % value
                )
            result[key.strip()] = val.strip()

        return result

    @classmethod
    def _parse_bool(cls, value):
        """Represents value as boolean.

        :param value:
        :rtype: bool
        """
        value = value.lower()
        return value in ('1', 'true', 'yes')

    @classmethod
    def _exclude_files_parser(cls, key):
        """Returns a parser function to make sure field inputs
        are not files.

        Parses a value after getting the key so error messages are
        more informative.

        :param key:
        :rtype: callable
        """

        def parser(value):
            exclude_directive = 'file:'
            if value.startswith(exclude_directive):
                raise ValueError(
                    'Only strings are accepted for the {0} field, '
                    'files are not accepted'.format(key)
                )
            return value

        return parser

    @classmethod
    def _parse_file(cls, value, root_dir: _Path):
        """Represents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        """
        include_directive = 'file:'

        if not isinstance(value, str):
            return value

        if not value.startswith(include_directive):
            return value

        spec = value[len(include_directive) :]
        filepaths = (path.strip() for path in spec.split(','))
        return expand.read_files(filepaths, root_dir)

    def _parse_attr(self, value, package_dir, root_dir: _Path):
        """Represents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        """
        attr_directive = 'attr:'
        if not value.startswith(attr_directive):
            return value

        attr_desc = value.replace(attr_directive, '')

        # Make sure package_dir is populated correctly, so `attr:` directives can work
        package_dir.update(self.ensure_discovered.package_dir)
        return expand.read_attr(attr_desc, package_dir, root_dir)

    @classmethod
    def _get_parser_compound(cls, *parse_methods):
        """Returns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        """

        def parse(value):
            parsed = value

            for method in parse_methods:
                parsed = method(parsed)

            return parsed

        return parse

    @classmethod
    def _parse_section_to_dict_with_key(cls, section_options, values_parser):
        """Parses section options into a dictionary.

        Applies a given parser to each option in a section.

        :param dict section_options:
        :param callable values_parser: function with 2 args corresponding to key, value
        :rtype: dict
        """
        value = {}
        for key, (_, val) in section_options.items():
            value[key] = values_parser(key, val)
        return value

    @classmethod
    def _parse_section_to_dict(cls, section_options, values_parser=None):
        """Parses section options into a dictionary.

        Optionally applies a given parser to each value.

        :param dict section_options:
        :param callable values_parser: function with 1 arg corresponding to option value
        :rtype: dict
        """
        parser = (lambda _, v: values_parser(v)) if values_parser else (lambda _, v: v)
        return cls._parse_section_to_dict_with_key(section_options, parser)

    def parse_section(self, section_options):
        """Parses configuration file section.

        :param dict section_options:
        """
        for (name, (_, value)) in section_options.items():
            with contextlib.suppress(KeyError):
                # Keep silent for a new option may appear anytime.
                self[name] = value

    def parse(self):
        """Parses configuration file items from one
        or more related sections.

        """
        for section_name, section_options in self.sections.items():

            method_postfix = ''
            if section_name:  # [section.option] variant
                method_postfix = '_%s' % section_name

            section_parser_method: Optional[Callable] = getattr(
                self,
                # Dots in section names are translated into dunderscores.
                ('parse_section%s' % method_postfix).replace('.', '__'),
                None,
            )

            if section_parser_method is None:
                raise DistutilsOptionError(
                    'Unsupported distribution option section: [%s.%s]'
                    % (self.section_prefix, section_name)
                )

            section_parser_method(section_options)

    def _deprecated_config_handler(self, func, msg, warning_class):
        """this function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param warning_class: class of warning exception to be raised
        :param func: function to be wrapped around
        """

        @wraps(func)
        def config_handler(*args, **kwargs):
            warnings.warn(msg, warning_class)
            return func(*args, **kwargs)

        return config_handler


class ConfigMetadataHandler(ConfigHandler["DistributionMetadata"]):

    section_prefix = 'metadata'

    aliases = {
        'home_page': 'url',
        'summary': 'description',
        'classifier': 'classifiers',
        'platform': 'platforms',
    }

    strict_mode = False
    """We need to keep it loose, to be partially compatible with
    `pbr` and `d2to1` packages which also uses `metadata` section.

    """

    def __init__(
        self,
        target_obj: "DistributionMetadata",
        options: AllCommandOptions,
        ignore_option_errors: bool,
        ensure_discovered: expand.EnsurePackagesDiscovered,
        package_dir: Optional[dict] = None,
        root_dir: _Path = os.curdir
    ):
        super().__init__(target_obj, options, ignore_option_errors, ensure_discovered)
        self.package_dir = package_dir
        self.root_dir = root_dir

    @property
    def parsers(self):
        """Metadata item name to parser function mapping."""
        parse_list = self._parse_list
        parse_file = partial(self._parse_file, root_dir=self.root_dir)
        parse_dict = self._parse_dict
        exclude_files_parser = self._exclude_files_parser

        return {
            'platforms': parse_list,
            'keywords': parse_list,
            'provides': parse_list,
            'requires': self._deprecated_config_handler(
                parse_list,
                "The requires parameter is deprecated, please use "
                "install_requires for runtime dependencies.",
                SetuptoolsDeprecationWarning,
            ),
            'obsoletes': parse_list,
            'classifiers': self._get_parser_compound(parse_file, parse_list),
            'license': exclude_files_parser('license'),
            'license_file': self._deprecated_config_handler(
                exclude_files_parser('license_file'),
                "The license_file parameter is deprecated, "
                "use license_files instead.",
                SetuptoolsDeprecationWarning,
            ),
            'license_files': parse_list,
            'description': parse_file,
            'long_description': parse_file,
            'version': self._parse_version,
            'project_urls': parse_dict,
        }

    def _parse_version(self, value):
        """Parses `version` option value.

        :param value:
        :rtype: str

        """
        version = self._parse_file(value, self.root_dir)

        if version != value:
            version = version.strip()
            # Be strict about versions loaded from file because it's easy to
            # accidentally include newlines and other unintended content
            try:
                Version(version)
            except InvalidVersion:
                tmpl = (
                    'Version loaded from {value} does not '
                    'comply with PEP 440: {version}'
                )
                raise DistutilsOptionError(tmpl.format(**locals()))

            return version

        return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))


class ConfigOptionsHandler(ConfigHandler["Distribution"]):

    section_prefix = 'options'

    def __init__(
        self,
        target_obj: "Distribution",
        options: AllCommandOptions,
        ignore_option_errors: bool,
        ensure_discovered: expand.EnsurePackagesDiscovered,
    ):
        super().__init__(target_obj, options, ignore_option_errors, ensure_discovered)
        self.root_dir = target_obj.src_root
        self.package_dir: Dict[str, str] = {}  # To be filled by `find_packages`

    @classmethod
    def _parse_list_semicolon(cls, value):
        return cls._parse_list(value, separator=';')

    def _parse_file_in_root(self, value):
        return self._parse_file(value, root_dir=self.root_dir)

    def _parse_requirements_list(self, label: str, value: str):
        # Parse a requirements list, either by reading in a `file:`, or a list.
        parsed = self._parse_list_semicolon(self._parse_file_in_root(value))
        _warn_accidental_env_marker_misconfig(label, value, parsed)
        # Filter it to only include lines that are not comments. `parse_list`
        # will have stripped each line and filtered out empties.
        return [line for line in parsed if not line.startswith("#")]

    @property
    def parsers(self):
        """Metadata item name to parser function mapping."""
        parse_list = self._parse_list
        parse_bool = self._parse_bool
        parse_dict = self._parse_dict
        parse_cmdclass = self._parse_cmdclass

        return {
            'zip_safe': parse_bool,
            'include_package_data': parse_bool,
            'package_dir': parse_dict,
            'scripts': parse_list,
            'eager_resources': parse_list,
            'dependency_links': parse_list,
            'namespace_packages': self._deprecated_config_handler(
                parse_list,
                "The namespace_packages parameter is deprecated, "
                "consider using implicit namespaces instead (PEP 420).",
                SetuptoolsDeprecationWarning,
            ),
            'install_requires': partial(
                self._parse_requirements_list, "install_requires"
            ),
            'setup_requires': self._parse_list_semicolon,
            'tests_require': self._parse_list_semicolon,
            'packages': self._parse_packages,
            'entry_points': self._parse_file_in_root,
            'py_modules': parse_list,
            'python_requires': SpecifierSet,
            'cmdclass': parse_cmdclass,
        }

    def _parse_cmdclass(self, value):
        package_dir = self.ensure_discovered.package_dir
        return expand.cmdclass(self._parse_dict(value), package_dir, self.root_dir)

    def _parse_packages(self, value):
        """Parses `packages` option value.

        :param value:
        :rtype: list
        """
        find_directives = ['find:', 'find_namespace:']
        trimmed_value = value.strip()

        if trimmed_value not in find_directives:
            return self._parse_list(value)

        # Read function arguments from a dedicated section.
        find_kwargs = self.parse_section_packages__find(
            self.sections.get('packages.find', {})
        )

        find_kwargs.update(
            namespaces=(trimmed_value == find_directives[1]),
            root_dir=self.root_dir,
            fill_package_dir=self.package_dir,
        )

        return expand.find_packages(**find_kwargs)

    def parse_section_packages__find(self, section_options):
        """Parses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        """
        section_data = self._parse_section_to_dict(section_options, self._parse_list)

        valid_keys = ['where', 'include', 'exclude']

        find_kwargs = dict(
            [(k, v) for k, v in section_data.items() if k in valid_keys and v]
        )

        where = find_kwargs.get('where')
        if where is not None:
            find_kwargs['where'] = where[0]  # cast list to single val

        return find_kwargs

    def parse_section_entry_points(self, section_options):
        """Parses `entry_points` configuration file section.

        :param dict section_options:
        """
        parsed = self._parse_section_to_dict(section_options, self._parse_list)
        self['entry_points'] = parsed

    def _parse_package_data(self, section_options):
        package_data = self._parse_section_to_dict(section_options, self._parse_list)
        return expand.canonic_package_data(package_data)

    def parse_section_package_data(self, section_options):
        """Parses `package_data` configuration file section.

        :param dict section_options:
        """
        self['package_data'] = self._parse_package_data(section_options)

    def parse_section_exclude_package_data(self, section_options):
        """Parses `exclude_package_data` configuration file section.

        :param dict section_options:
        """
        self['exclude_package_data'] = self._parse_package_data(section_options)

    def parse_section_extras_require(self, section_options):
        """Parses `extras_require` configuration file section.

        :param dict section_options:
        """
        parsed = self._parse_section_to_dict_with_key(
            section_options,
            lambda k, v: self._parse_requirements_list(f"extras_require[{k}]", v)
        )

        self['extras_require'] = parsed

    def parse_section_data_files(self, section_options):
        """Parses `data_files` configuration file section.

        :param dict section_options:
        """
        parsed = self._parse_section_to_dict(section_options, self._parse_list)
        self['data_files'] = expand.canonic_data_files(parsed, self.root_dir)
PK!*aaconfig/__init__.pynu["""For backward compatibility, expose main functions from
``setuptools.config.setupcfg``
"""
import warnings
from functools import wraps
from textwrap import dedent
from typing import Callable, TypeVar, cast

from .._deprecation_warning import SetuptoolsDeprecationWarning
from . import setupcfg

Fn = TypeVar("Fn", bound=Callable)

__all__ = ('parse_configuration', 'read_configuration')


def _deprecation_notice(fn: Fn) -> Fn:
    @wraps(fn)
    def _wrapper(*args, **kwargs):
        msg = f"""\
        As setuptools moves its configuration towards `pyproject.toml`,
        `{__name__}.{fn.__name__}` became deprecated.

        For the time being, you can use the `{setupcfg.__name__}` module
        to access a backward compatible API, but this module is provisional
        and might be removed in the future.
        """
        warnings.warn(dedent(msg), SetuptoolsDeprecationWarning, stacklevel=2)
        return fn(*args, **kwargs)

    return cast(Fn, _wrapper)


read_configuration = _deprecation_notice(setupcfg.read_configuration)
parse_configuration = _deprecation_notice(setupcfg.parse_configuration)
PK!E_V4V4config/_apply_pyprojecttoml.pynu["""Translation layer between pyproject config and setuptools distribution and
metadata objects.

The distribution and metadata objects are modeled after (an old version of)
core metadata, therefore configs in the format specified for ``pyproject.toml``
need to be processed before being applied.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
"""
import logging
import os
import warnings
from collections.abc import Mapping
from email.headerregistry import Address
from functools import partial, reduce
from itertools import chain
from types import MappingProxyType
from typing import (TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple,
                    Type, Union)

from setuptools._deprecation_warning import SetuptoolsDeprecationWarning

if TYPE_CHECKING:
    from setuptools._importlib import metadata  # noqa
    from setuptools.dist import Distribution  # noqa

EMPTY: Mapping = MappingProxyType({})  # Immutable dict-like
_Path = Union[os.PathLike, str]
_DictOrStr = Union[dict, str]
_CorrespFn = Callable[["Distribution", Any, _Path], None]
_Correspondence = Union[str, _CorrespFn]

_logger = logging.getLogger(__name__)


def apply(dist: "Distribution", config: dict, filename: _Path) -> "Distribution":
    """Apply configuration dict read with :func:`read_configuration`"""

    if not config:
        return dist  # short-circuit unrelated pyproject.toml file

    root_dir = os.path.dirname(filename) or "."

    _apply_project_table(dist, config, root_dir)
    _apply_tool_table(dist, config, filename)

    current_directory = os.getcwd()
    os.chdir(root_dir)
    try:
        dist._finalize_requires()
        dist._finalize_license_files()
    finally:
        os.chdir(current_directory)

    return dist


def _apply_project_table(dist: "Distribution", config: dict, root_dir: _Path):
    project_table = config.get("project", {}).copy()
    if not project_table:
        return  # short-circuit

    _handle_missing_dynamic(dist, project_table)
    _unify_entry_points(project_table)

    for field, value in project_table.items():
        norm_key = json_compatible_key(field)
        corresp = PYPROJECT_CORRESPONDENCE.get(norm_key, norm_key)
        if callable(corresp):
            corresp(dist, value, root_dir)
        else:
            _set_config(dist, corresp, value)


def _apply_tool_table(dist: "Distribution", config: dict, filename: _Path):
    tool_table = config.get("tool", {}).get("setuptools", {})
    if not tool_table:
        return  # short-circuit

    for field, value in tool_table.items():
        norm_key = json_compatible_key(field)

        if norm_key in TOOL_TABLE_DEPRECATIONS:
            suggestion = TOOL_TABLE_DEPRECATIONS[norm_key]
            msg = f"The parameter `{norm_key}` is deprecated, {suggestion}"
            warnings.warn(msg, SetuptoolsDeprecationWarning)

        norm_key = TOOL_TABLE_RENAMES.get(norm_key, norm_key)
        _set_config(dist, norm_key, value)

    _copy_command_options(config, dist, filename)


def _handle_missing_dynamic(dist: "Distribution", project_table: dict):
    """Be temporarily forgiving with ``dynamic`` fields not listed in ``dynamic``"""
    # TODO: Set fields back to `None` once the feature stabilizes
    dynamic = set(project_table.get("dynamic", []))
    for field, getter in _PREVIOUSLY_DEFINED.items():
        if not (field in project_table or field in dynamic):
            value = getter(dist)
            if value:
                msg = _WouldIgnoreField.message(field, value)
                warnings.warn(msg, _WouldIgnoreField)


def json_compatible_key(key: str) -> str:
    """As defined in :pep:`566#json-compatible-metadata`"""
    return key.lower().replace("-", "_")


def _set_config(dist: "Distribution", field: str, value: Any):
    setter = getattr(dist.metadata, f"set_{field}", None)
    if setter:
        setter(value)
    elif hasattr(dist.metadata, field) or field in SETUPTOOLS_PATCHES:
        setattr(dist.metadata, field, value)
    else:
        setattr(dist, field, value)


_CONTENT_TYPES = {
    ".md": "text/markdown",
    ".rst": "text/x-rst",
    ".txt": "text/plain",
}


def _guess_content_type(file: str) -> Optional[str]:
    _, ext = os.path.splitext(file.lower())
    if not ext:
        return None

    if ext in _CONTENT_TYPES:
        return _CONTENT_TYPES[ext]

    valid = ", ".join(f"{k} ({v})" for k, v in _CONTENT_TYPES.items())
    msg = f"only the following file extensions are recognized: {valid}."
    raise ValueError(f"Undefined content type for {file}, {msg}")


def _long_description(dist: "Distribution", val: _DictOrStr, root_dir: _Path):
    from setuptools.config import expand

    if isinstance(val, str):
        text = expand.read_files(val, root_dir)
        ctype = _guess_content_type(val)
    else:
        text = val.get("text") or expand.read_files(val.get("file", []), root_dir)
        ctype = val["content-type"]

    _set_config(dist, "long_description", text)
    if ctype:
        _set_config(dist, "long_description_content_type", ctype)


def _license(dist: "Distribution", val: dict, root_dir: _Path):
    from setuptools.config import expand

    if "file" in val:
        _set_config(dist, "license", expand.read_files([val["file"]], root_dir))
    else:
        _set_config(dist, "license", val["text"])


def _people(dist: "Distribution", val: List[dict], _root_dir: _Path, kind: str):
    field = []
    email_field = []
    for person in val:
        if "name" not in person:
            email_field.append(person["email"])
        elif "email" not in person:
            field.append(person["name"])
        else:
            addr = Address(display_name=person["name"], addr_spec=person["email"])
            email_field.append(str(addr))

    if field:
        _set_config(dist, kind, ", ".join(field))
    if email_field:
        _set_config(dist, f"{kind}_email", ", ".join(email_field))


def _project_urls(dist: "Distribution", val: dict, _root_dir):
    _set_config(dist, "project_urls", val)


def _python_requires(dist: "Distribution", val: dict, _root_dir):
    from setuptools.extern.packaging.specifiers import SpecifierSet

    _set_config(dist, "python_requires", SpecifierSet(val))


def _dependencies(dist: "Distribution", val: list, _root_dir):
    if getattr(dist, "install_requires", []):
        msg = "`install_requires` overwritten in `pyproject.toml` (dependencies)"
        warnings.warn(msg)
    _set_config(dist, "install_requires", val)


def _optional_dependencies(dist: "Distribution", val: dict, _root_dir):
    existing = getattr(dist, "extras_require", {})
    _set_config(dist, "extras_require", {**existing, **val})


def _unify_entry_points(project_table: dict):
    project = project_table
    entry_points = project.pop("entry-points", project.pop("entry_points", {}))
    renaming = {"scripts": "console_scripts", "gui_scripts": "gui_scripts"}
    for key, value in list(project.items()):  # eager to allow modifications
        norm_key = json_compatible_key(key)
        if norm_key in renaming and value:
            entry_points[renaming[norm_key]] = project.pop(key)

    if entry_points:
        project["entry-points"] = {
            name: [f"{k} = {v}" for k, v in group.items()]
            for name, group in entry_points.items()
        }


def _copy_command_options(pyproject: dict, dist: "Distribution", filename: _Path):
    tool_table = pyproject.get("tool", {})
    cmdclass = tool_table.get("setuptools", {}).get("cmdclass", {})
    valid_options = _valid_command_options(cmdclass)

    cmd_opts = dist.command_options
    for cmd, config in pyproject.get("tool", {}).get("distutils", {}).items():
        cmd = json_compatible_key(cmd)
        valid = valid_options.get(cmd, set())
        cmd_opts.setdefault(cmd, {})
        for key, value in config.items():
            key = json_compatible_key(key)
            cmd_opts[cmd][key] = (str(filename), value)
            if key not in valid:
                # To avoid removing options that are specified dynamically we
                # just log a warn...
                _logger.warning(f"Command option {cmd}.{key} is not defined")


def _valid_command_options(cmdclass: Mapping = EMPTY) -> Dict[str, Set[str]]:
    from .._importlib import metadata
    from setuptools.dist import Distribution

    valid_options = {"global": _normalise_cmd_options(Distribution.global_options)}

    unloaded_entry_points = metadata.entry_points(group='distutils.commands')
    loaded_entry_points = (_load_ep(ep) for ep in unloaded_entry_points)
    entry_points = (ep for ep in loaded_entry_points if ep)
    for cmd, cmd_class in chain(entry_points, cmdclass.items()):
        opts = valid_options.get(cmd, set())
        opts = opts | _normalise_cmd_options(getattr(cmd_class, "user_options", []))
        valid_options[cmd] = opts

    return valid_options


def _load_ep(ep: "metadata.EntryPoint") -> Optional[Tuple[str, Type]]:
    # Ignore all the errors
    try:
        return (ep.name, ep.load())
    except Exception as ex:
        msg = f"{ex.__class__.__name__} while trying to load entry-point {ep.name}"
        _logger.warning(f"{msg}: {ex}")
        return None


def _normalise_cmd_option_key(name: str) -> str:
    return json_compatible_key(name).strip("_=")


def _normalise_cmd_options(desc: List[Tuple[str, Optional[str], str]]) -> Set[str]:
    return {_normalise_cmd_option_key(fancy_option[0]) for fancy_option in desc}


def _attrgetter(attr):
    """
    Similar to ``operator.attrgetter`` but returns None if ``attr`` is not found
    >>> from types import SimpleNamespace
    >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13))
    >>> _attrgetter("a")(obj)
    42
    >>> _attrgetter("b.c")(obj)
    13
    >>> _attrgetter("d")(obj) is None
    True
    """
    return partial(reduce, lambda acc, x: getattr(acc, x, None), attr.split("."))


def _some_attrgetter(*items):
    """
    Return the first "truth-y" attribute or None
    >>> from types import SimpleNamespace
    >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13))
    >>> _some_attrgetter("d", "a", "b.c")(obj)
    42
    >>> _some_attrgetter("d", "e", "b.c", "a")(obj)
    13
    >>> _some_attrgetter("d", "e", "f")(obj) is None
    True
    """
    def _acessor(obj):
        values = (_attrgetter(i)(obj) for i in items)
        return next((i for i in values if i is not None), None)
    return _acessor


PYPROJECT_CORRESPONDENCE: Dict[str, _Correspondence] = {
    "readme": _long_description,
    "license": _license,
    "authors": partial(_people, kind="author"),
    "maintainers": partial(_people, kind="maintainer"),
    "urls": _project_urls,
    "dependencies": _dependencies,
    "optional_dependencies": _optional_dependencies,
    "requires_python": _python_requires,
}

TOOL_TABLE_RENAMES = {"script_files": "scripts"}
TOOL_TABLE_DEPRECATIONS = {
    "namespace_packages": "consider using implicit namespaces instead (PEP 420)."
}

SETUPTOOLS_PATCHES = {"long_description_content_type", "project_urls",
                      "provides_extras", "license_file", "license_files"}

_PREVIOUSLY_DEFINED = {
    "name": _attrgetter("metadata.name"),
    "version": _attrgetter("metadata.version"),
    "description": _attrgetter("metadata.description"),
    "readme": _attrgetter("metadata.long_description"),
    "requires-python": _some_attrgetter("python_requires", "metadata.python_requires"),
    "license": _attrgetter("metadata.license"),
    "authors": _some_attrgetter("metadata.author", "metadata.author_email"),
    "maintainers": _some_attrgetter("metadata.maintainer", "metadata.maintainer_email"),
    "keywords": _attrgetter("metadata.keywords"),
    "classifiers": _attrgetter("metadata.classifiers"),
    "urls": _attrgetter("metadata.project_urls"),
    "entry-points": _attrgetter("entry_points"),
    "dependencies": _some_attrgetter("_orig_install_requires", "install_requires"),
    "optional-dependencies": _some_attrgetter("_orig_extras_require", "extras_require"),
}


class _WouldIgnoreField(UserWarning):
    """Inform users that ``pyproject.toml`` would overwrite previous metadata."""

    MESSAGE = """\
    {field!r} defined outside of `pyproject.toml` would be ignored.
    !!\n\n
    ##########################################################################
    # configuration would be ignored/result in error due to `pyproject.toml` #
    ##########################################################################

    The following seems to be defined outside of `pyproject.toml`:

    `{field} = {value!r}`

    According to the spec (see the link below), however, setuptools CANNOT
    consider this value unless {field!r} is listed as `dynamic`.

    https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

    For the time being, `setuptools` will still consider the given value (as a
    **transitional** measure), but please note that future releases of setuptools will
    follow strictly the standard.

    To prevent this warning, you can list {field!r} under `dynamic` or alternatively
    remove the `[project]` table from your file and rely entirely on other means of
    configuration.
    \n\n!!
    """

    @classmethod
    def message(cls, field, value):
        from inspect import cleandoc
        return cleandoc(cls.MESSAGE.format(field=field, value=value))
PK!zkK
hKhKconfig/pyprojecttoml.pynu["""
Load setuptools configuration from ``pyproject.toml`` files.

**PRIVATE MODULE**: API reserved for setuptools internal usage only.
"""
import logging
import os
import warnings
from contextlib import contextmanager
from functools import partial
from typing import TYPE_CHECKING, Callable, Dict, Optional, Mapping, Union

from setuptools.errors import FileError, OptionError

from . import expand as _expand
from ._apply_pyprojecttoml import apply as _apply
from ._apply_pyprojecttoml import _PREVIOUSLY_DEFINED, _WouldIgnoreField

if TYPE_CHECKING:
    from setuptools.dist import Distribution  # noqa

_Path = Union[str, os.PathLike]
_logger = logging.getLogger(__name__)


def load_file(filepath: _Path) -> dict:
    from setuptools.extern import tomli  # type: ignore

    with open(filepath, "rb") as file:
        return tomli.load(file)


def validate(config: dict, filepath: _Path) -> bool:
    from . import _validate_pyproject as validator

    trove_classifier = validator.FORMAT_FUNCTIONS.get("trove-classifier")
    if hasattr(trove_classifier, "_disable_download"):
        # Improve reproducibility by default. See issue 31 for validate-pyproject.
        trove_classifier._disable_download()  # type: ignore

    try:
        return validator.validate(config)
    except validator.ValidationError as ex:
        summary = f"configuration error: {ex.summary}"
        if ex.name.strip("`") != "project":
            # Probably it is just a field missing/misnamed, not worthy the verbosity...
            _logger.debug(summary)
            _logger.debug(ex.details)

        error = f"invalid pyproject.toml config: {ex.name}."
        raise ValueError(f"{error}\n{summary}") from None


def apply_configuration(
    dist: "Distribution",
    filepath: _Path,
    ignore_option_errors=False,
) -> "Distribution":
    """Apply the configuration from a ``pyproject.toml`` file into an existing
    distribution object.
    """
    config = read_configuration(filepath, True, ignore_option_errors, dist)
    return _apply(dist, config, filepath)


def read_configuration(
    filepath: _Path,
    expand=True,
    ignore_option_errors=False,
    dist: Optional["Distribution"] = None,
):
    """Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file in the ``pyproject.toml``
        format.

    :param bool expand: Whether to expand directives and other computed values
        (i.e. post-process the given configuration)

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. This is used for auto-discovery of packages in the case
        a dynamic configuration (e.g. ``attr`` or ``cmdclass``) is expanded.
        When ``expand=False`` this object is simply ignored.

    :rtype: dict
    """
    filepath = os.path.abspath(filepath)

    if not os.path.isfile(filepath):
        raise FileError(f"Configuration file {filepath!r} does not exist.")

    asdict = load_file(filepath) or {}
    project_table = asdict.get("project", {})
    tool_table = asdict.get("tool", {})
    setuptools_table = tool_table.get("setuptools", {})
    if not asdict or not (project_table or setuptools_table):
        return {}  # User is not using pyproject to configure setuptools

    if setuptools_table:
        # TODO: Remove the following once the feature stabilizes:
        msg = "Support for `[tool.setuptools]` in `pyproject.toml` is still *beta*."
        warnings.warn(msg, _BetaConfiguration)

    # There is an overall sense in the community that making include_package_data=True
    # the default would be an improvement.
    # `ini2toml` backfills include_package_data=False when nothing is explicitly given,
    # therefore setting a default here is backwards compatible.
    orig_setuptools_table = setuptools_table.copy()
    if dist and getattr(dist, "include_package_data") is not None:
        setuptools_table.setdefault("include-package-data", dist.include_package_data)
    else:
        setuptools_table.setdefault("include-package-data", True)
    # Persist changes:
    asdict["tool"] = tool_table
    tool_table["setuptools"] = setuptools_table

    try:
        # Don't complain about unrelated errors (e.g. tools not using the "tool" table)
        subset = {"project": project_table, "tool": {"setuptools": setuptools_table}}
        validate(subset, filepath)
    except Exception as ex:
        # TODO: Remove the following once the feature stabilizes:
        if _skip_bad_config(project_table, orig_setuptools_table, dist):
            return {}
        # TODO: After the previous statement is removed the try/except can be replaced
        # by the _ignore_errors context manager.
        if ignore_option_errors:
            _logger.debug(f"ignored error: {ex.__class__.__name__} - {ex}")
        else:
            raise  # re-raise exception

    if expand:
        root_dir = os.path.dirname(filepath)
        return expand_configuration(asdict, root_dir, ignore_option_errors, dist)

    return asdict


def _skip_bad_config(
    project_cfg: dict, setuptools_cfg: dict, dist: Optional["Distribution"]
) -> bool:
    """Be temporarily forgiving with invalid ``pyproject.toml``"""
    # See pypa/setuptools#3199 and pypa/cibuildwheel#1064

    if dist is None or (
        dist.metadata.name is None
        and dist.metadata.version is None
        and dist.install_requires is None
    ):
        # It seems that the build is not getting any configuration from other places
        return False

    if setuptools_cfg:
        # If `[tool.setuptools]` is set, then `pyproject.toml` config is intentional
        return False

    given_config = set(project_cfg.keys())
    popular_subset = {"name", "version", "python_requires", "requires-python"}
    if given_config <= popular_subset:
        # It seems that the docs in cibuildtool has been inadvertently encouraging users
        # to create `pyproject.toml` files that are not compliant with the standards.
        # Let's be forgiving for the time being.
        warnings.warn(_InvalidFile.message(), _InvalidFile, stacklevel=2)
        return True

    return False


def expand_configuration(
    config: dict,
    root_dir: Optional[_Path] = None,
    ignore_option_errors: bool = False,
    dist: Optional["Distribution"] = None,
) -> dict:
    """Given a configuration with unresolved fields (e.g. dynamic, cmdclass, ...)
    find their final values.

    :param dict config: Dict containing the configuration for the distribution
    :param str root_dir: Top-level directory for the distribution/project
        (the same directory where ``pyproject.toml`` is place)
    :param bool ignore_option_errors: see :func:`read_configuration`
    :param Distribution|None: Distribution object to which the configuration refers.
        If not given a dummy object will be created and discarded after the
        configuration is read. Used in the case a dynamic configuration
        (e.g. ``attr`` or ``cmdclass``).

    :rtype: dict
    """
    return _ConfigExpander(config, root_dir, ignore_option_errors, dist).expand()


class _ConfigExpander:
    def __init__(
        self,
        config: dict,
        root_dir: Optional[_Path] = None,
        ignore_option_errors: bool = False,
        dist: Optional["Distribution"] = None,
    ):
        self.config = config
        self.root_dir = root_dir or os.getcwd()
        self.project_cfg = config.get("project", {})
        self.dynamic = self.project_cfg.get("dynamic", [])
        self.setuptools_cfg = config.get("tool", {}).get("setuptools", {})
        self.dynamic_cfg = self.setuptools_cfg.get("dynamic", {})
        self.ignore_option_errors = ignore_option_errors
        self._dist = dist

    def _ensure_dist(self) -> "Distribution":
        from setuptools.dist import Distribution

        attrs = {"src_root": self.root_dir, "name": self.project_cfg.get("name", None)}
        return self._dist or Distribution(attrs)

    def _process_field(self, container: dict, field: str, fn: Callable):
        if field in container:
            with _ignore_errors(self.ignore_option_errors):
                container[field] = fn(container[field])

    def _canonic_package_data(self, field="package-data"):
        package_data = self.setuptools_cfg.get(field, {})
        return _expand.canonic_package_data(package_data)

    def expand(self):
        self._expand_packages()
        self._canonic_package_data()
        self._canonic_package_data("exclude-package-data")

        # A distribution object is required for discovering the correct package_dir
        dist = self._ensure_dist()
        ctx = _EnsurePackagesDiscovered(dist, self.project_cfg, self.setuptools_cfg)
        with ctx as ensure_discovered:
            package_dir = ensure_discovered.package_dir
            self._expand_data_files()
            self._expand_cmdclass(package_dir)
            self._expand_all_dynamic(dist, package_dir)

        return self.config

    def _expand_packages(self):
        packages = self.setuptools_cfg.get("packages")
        if packages is None or isinstance(packages, (list, tuple)):
            return

        find = packages.get("find")
        if isinstance(find, dict):
            find["root_dir"] = self.root_dir
            find["fill_package_dir"] = self.setuptools_cfg.setdefault("package-dir", {})
            with _ignore_errors(self.ignore_option_errors):
                self.setuptools_cfg["packages"] = _expand.find_packages(**find)

    def _expand_data_files(self):
        data_files = partial(_expand.canonic_data_files, root_dir=self.root_dir)
        self._process_field(self.setuptools_cfg, "data-files", data_files)

    def _expand_cmdclass(self, package_dir: Mapping[str, str]):
        root_dir = self.root_dir
        cmdclass = partial(_expand.cmdclass, package_dir=package_dir, root_dir=root_dir)
        self._process_field(self.setuptools_cfg, "cmdclass", cmdclass)

    def _expand_all_dynamic(self, dist: "Distribution", package_dir: Mapping[str, str]):
        special = (  # need special handling
            "version",
            "readme",
            "entry-points",
            "scripts",
            "gui-scripts",
            "classifiers",
            "dependencies",
            "optional-dependencies",
        )
        # `_obtain` functions are assumed to raise appropriate exceptions/warnings.
        obtained_dynamic = {
            field: self._obtain(dist, field, package_dir)
            for field in self.dynamic
            if field not in special
        }
        obtained_dynamic.update(
            self._obtain_entry_points(dist, package_dir) or {},
            version=self._obtain_version(dist, package_dir),
            readme=self._obtain_readme(dist),
            classifiers=self._obtain_classifiers(dist),
            dependencies=self._obtain_dependencies(dist),
            optional_dependencies=self._obtain_optional_dependencies(dist),
        )
        # `None` indicates there is nothing in `tool.setuptools.dynamic` but the value
        # might have already been set by setup.py/extensions, so avoid overwriting.
        updates = {k: v for k, v in obtained_dynamic.items() if v is not None}
        self.project_cfg.update(updates)

    def _ensure_previously_set(self, dist: "Distribution", field: str):
        previous = _PREVIOUSLY_DEFINED[field](dist)
        if previous is None and not self.ignore_option_errors:
            msg = (
                f"No configuration found for dynamic {field!r}.\n"
                "Some dynamic fields need to be specified via `tool.setuptools.dynamic`"
                "\nothers must be specified via the equivalent attribute in `setup.py`."
            )
            raise OptionError(msg)

    def _expand_directive(
        self, specifier: str, directive, package_dir: Mapping[str, str]
    ):
        with _ignore_errors(self.ignore_option_errors):
            root_dir = self.root_dir
            if "file" in directive:
                return _expand.read_files(directive["file"], root_dir)
            if "attr" in directive:
                return _expand.read_attr(directive["attr"], package_dir, root_dir)
            raise ValueError(f"invalid `{specifier}`: {directive!r}")
        return None

    def _obtain(self, dist: "Distribution", field: str, package_dir: Mapping[str, str]):
        if field in self.dynamic_cfg:
            return self._expand_directive(
                f"tool.setuptools.dynamic.{field}",
                self.dynamic_cfg[field],
                package_dir,
            )
        self._ensure_previously_set(dist, field)
        return None

    def _obtain_version(self, dist: "Distribution", package_dir: Mapping[str, str]):
        # Since plugins can set version, let's silently skip if it cannot be obtained
        if "version" in self.dynamic and "version" in self.dynamic_cfg:
            return _expand.version(self._obtain(dist, "version", package_dir))
        return None

    def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, str]]:
        if "readme" not in self.dynamic:
            return None

        dynamic_cfg = self.dynamic_cfg
        if "readme" in dynamic_cfg:
            return {
                "text": self._obtain(dist, "readme", {}),
                "content-type": dynamic_cfg["readme"].get("content-type", "text/x-rst"),
            }

        self._ensure_previously_set(dist, "readme")
        return None

    def _obtain_entry_points(
        self, dist: "Distribution", package_dir: Mapping[str, str]
    ) -> Optional[Dict[str, dict]]:
        fields = ("entry-points", "scripts", "gui-scripts")
        if not any(field in self.dynamic for field in fields):
            return None

        text = self._obtain(dist, "entry-points", package_dir)
        if text is None:
            return None

        groups = _expand.entry_points(text)
        expanded = {"entry-points": groups}

        def _set_scripts(field: str, group: str):
            if group in groups:
                value = groups.pop(group)
                if field not in self.dynamic:
                    msg = _WouldIgnoreField.message(field, value)
                    warnings.warn(msg, _WouldIgnoreField)
                # TODO: Don't set field when support for pyproject.toml stabilizes
                #       instead raise an error as specified in PEP 621
                expanded[field] = value

        _set_scripts("scripts", "console_scripts")
        _set_scripts("gui-scripts", "gui_scripts")

        return expanded

    def _obtain_classifiers(self, dist: "Distribution"):
        if "classifiers" in self.dynamic:
            value = self._obtain(dist, "classifiers", {})
            if value:
                return value.splitlines()
        return None

    def _obtain_dependencies(self, dist: "Distribution"):
        if "dependencies" in self.dynamic:
            value = self._obtain(dist, "dependencies", {})
            if value:
                return _parse_requirements_list(value)
        return None

    def _obtain_optional_dependencies(self, dist: "Distribution"):
        if "optional-dependencies" not in self.dynamic:
            return None
        if "optional-dependencies" in self.dynamic_cfg:
            optional_dependencies_map = self.dynamic_cfg["optional-dependencies"]
            assert isinstance(optional_dependencies_map, dict)
            return {
                group: _parse_requirements_list(self._expand_directive(
                    f"tool.setuptools.dynamic.optional-dependencies.{group}",
                    directive,
                    {},
                ))
                for group, directive in optional_dependencies_map.items()
            }
        self._ensure_previously_set(dist, "optional-dependencies")
        return None


def _parse_requirements_list(value):
    return [
        line
        for line in value.splitlines()
        if line.strip() and not line.strip().startswith("#")
    ]


@contextmanager
def _ignore_errors(ignore_option_errors: bool):
    if not ignore_option_errors:
        yield
        return

    try:
        yield
    except Exception as ex:
        _logger.debug(f"ignored error: {ex.__class__.__name__} - {ex}")


class _EnsurePackagesDiscovered(_expand.EnsurePackagesDiscovered):
    def __init__(
        self, distribution: "Distribution", project_cfg: dict, setuptools_cfg: dict
    ):
        super().__init__(distribution)
        self._project_cfg = project_cfg
        self._setuptools_cfg = setuptools_cfg

    def __enter__(self):
        """When entering the context, the values of ``packages``, ``py_modules`` and
        ``package_dir`` that are missing in ``dist`` are copied from ``setuptools_cfg``.
        """
        dist, cfg = self._dist, self._setuptools_cfg
        package_dir: Dict[str, str] = cfg.setdefault("package-dir", {})
        package_dir.update(dist.package_dir or {})
        dist.package_dir = package_dir  # needs to be the same object

        dist.set_defaults._ignore_ext_modules()  # pyproject.toml-specific behaviour

        # Set `name`, `py_modules` and `packages` in dist to short-circuit
        # auto-discovery, but avoid overwriting empty lists purposefully set by users.
        if dist.metadata.name is None:
            dist.metadata.name = self._project_cfg.get("name")
        if dist.py_modules is None:
            dist.py_modules = cfg.get("py-modules")
        if dist.packages is None:
            dist.packages = cfg.get("packages")

        return super().__enter__()

    def __exit__(self, exc_type, exc_value, traceback):
        """When exiting the context, if values of ``packages``, ``py_modules`` and
        ``package_dir`` are missing in ``setuptools_cfg``, copy from ``dist``.
        """
        # If anything was discovered set them back, so they count in the final config.
        self._setuptools_cfg.setdefault("packages", self._dist.packages)
        self._setuptools_cfg.setdefault("py-modules", self._dist.py_modules)
        return super().__exit__(exc_type, exc_value, traceback)


class _BetaConfiguration(UserWarning):
    """Explicitly inform users that some `pyproject.toml` configuration is *beta*"""


class _InvalidFile(UserWarning):
    """The given `pyproject.toml` file is invalid and would be ignored.
    !!\n\n
    ############################
    # Invalid `pyproject.toml` #
    ############################

    Any configurations in `pyproject.toml` will be ignored.
    Please note that future releases of setuptools will halt the build process
    if an invalid file is given.

    To prevent setuptools from considering `pyproject.toml` please
    DO NOT include the `[project]` or `[tool.setuptools]` tables in your file.
    \n\n!!
    """

    @classmethod
    def message(cls):
        from inspect import cleandoc
        return cleandoc(cls.__doc__)
PK!i7?Q?Qdiscovery.pynu["""Automatic discovery of Python modules and packages (for inclusion in the
distribution) and other config values.

For the purposes of this module, the following nomenclature is used:

- "src-layout": a directory representing a Python project that contains a "src"
  folder. Everything under the "src" folder is meant to be included in the
  distribution when packaging the project. Example::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── src/
        └── mypkg/
            ├── __init__.py
            ├── mymodule.py
            └── my_data_file.txt

- "flat-layout": a Python project that does not use "src-layout" but instead
  have a directory under the project root for each package::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── mypkg/
        ├── __init__.py
        ├── mymodule.py
        └── my_data_file.txt

- "single-module": a project that contains a single Python script direct under
  the project root (no directory used)::

    .
    ├── tox.ini
    ├── pyproject.toml
    └── mymodule.py

"""

import itertools
import os
from fnmatch import fnmatchcase
from glob import glob
from pathlib import Path
from typing import (
    TYPE_CHECKING,
    Callable,
    Dict,
    Iterable,
    Iterator,
    List,
    Mapping,
    Optional,
    Tuple,
    Union
)

import _distutils_hack.override  # noqa: F401

from distutils import log
from distutils.util import convert_path

_Path = Union[str, os.PathLike]
_Filter = Callable[[str], bool]
StrIter = Iterator[str]

chain_iter = itertools.chain.from_iterable

if TYPE_CHECKING:
    from setuptools import Distribution  # noqa


def _valid_name(path: _Path) -> bool:
    # Ignore invalid names that cannot be imported directly
    return os.path.basename(path).isidentifier()


class _Finder:
    """Base class that exposes functionality for module/package finders"""

    ALWAYS_EXCLUDE: Tuple[str, ...] = ()
    DEFAULT_EXCLUDE: Tuple[str, ...] = ()

    @classmethod
    def find(
        cls,
        where: _Path = '.',
        exclude: Iterable[str] = (),
        include: Iterable[str] = ('*',)
    ) -> List[str]:
        """Return a list of all Python items (packages or modules, depending on
        the finder implementation) found within directory 'where'.

        'where' is the root directory which will be searched.
        It should be supplied as a "cross-platform" (i.e. URL-style) path;
        it will be converted to the appropriate local path syntax.

        'exclude' is a sequence of names to exclude; '*' can be used
        as a wildcard in the names.
        When finding packages, 'foo.*' will exclude all subpackages of 'foo'
        (but not 'foo' itself).

        'include' is a sequence of names to include.
        If it's specified, only the named items will be included.
        If it's not specified, all found items will be included.
        'include' can contain shell style wildcard patterns just like
        'exclude'.
        """

        exclude = exclude or cls.DEFAULT_EXCLUDE
        return list(
            cls._find_iter(
                convert_path(str(where)),
                cls._build_filter(*cls.ALWAYS_EXCLUDE, *exclude),
                cls._build_filter(*include),
            )
        )

    @classmethod
    def _find_iter(cls, where: _Path, exclude: _Filter, include: _Filter) -> StrIter:
        raise NotImplementedError

    @staticmethod
    def _build_filter(*patterns: str) -> _Filter:
        """
        Given a list of patterns, return a callable that will be true only if
        the input matches at least one of the patterns.
        """
        return lambda name: any(fnmatchcase(name, pat) for pat in patterns)


class PackageFinder(_Finder):
    """
    Generate a list of all Python packages found within a directory
    """

    ALWAYS_EXCLUDE = ("ez_setup", "*__pycache__")

    @classmethod
    def _find_iter(cls, where: _Path, exclude: _Filter, include: _Filter) -> StrIter:
        """
        All the packages found in 'where' that pass the 'include' filter, but
        not the 'exclude' filter.
        """
        for root, dirs, files in os.walk(str(where), followlinks=True):
            # Copy dirs to iterate over it, then empty dirs.
            all_dirs = dirs[:]
            dirs[:] = []

            for dir in all_dirs:
                full_path = os.path.join(root, dir)
                rel_path = os.path.relpath(full_path, where)
                package = rel_path.replace(os.path.sep, '.')

                # Skip directory trees that are not valid packages
                if '.' in dir or not cls._looks_like_package(full_path, package):
                    continue

                # Should this package be included?
                if include(package) and not exclude(package):
                    yield package

                # Keep searching subdirectories, as there may be more packages
                # down there, even if the parent was excluded.
                dirs.append(dir)

    @staticmethod
    def _looks_like_package(path: _Path, _package_name: str) -> bool:
        """Does a directory look like a package?"""
        return os.path.isfile(os.path.join(path, '__init__.py'))


class PEP420PackageFinder(PackageFinder):
    @staticmethod
    def _looks_like_package(_path: _Path, _package_name: str) -> bool:
        return True


class ModuleFinder(_Finder):
    """Find isolated Python modules.
    This function will **not** recurse subdirectories.
    """

    @classmethod
    def _find_iter(cls, where: _Path, exclude: _Filter, include: _Filter) -> StrIter:
        for file in glob(os.path.join(where, "*.py")):
            module, _ext = os.path.splitext(os.path.basename(file))

            if not cls._looks_like_module(module):
                continue

            if include(module) and not exclude(module):
                yield module

    _looks_like_module = staticmethod(_valid_name)


# We have to be extra careful in the case of flat layout to not include files
# and directories not meant for distribution (e.g. tool-related)


class FlatLayoutPackageFinder(PEP420PackageFinder):
    _EXCLUDE = (
        "ci",
        "bin",
        "doc",
        "docs",
        "documentation",
        "manpages",
        "news",
        "changelog",
        "test",
        "tests",
        "unit_test",
        "unit_tests",
        "example",
        "examples",
        "scripts",
        "tools",
        "util",
        "utils",
        "python",
        "build",
        "dist",
        "venv",
        "env",
        "requirements",
        # ---- Task runners / Build tools ----
        "tasks",  # invoke
        "fabfile",  # fabric
        "site_scons",  # SCons
        # ---- Other tools ----
        "benchmark",
        "benchmarks",
        "exercise",
        "exercises",
        # ---- Hidden directories/Private packages ----
        "[._]*",
    )

    DEFAULT_EXCLUDE = tuple(chain_iter((p, f"{p}.*") for p in _EXCLUDE))
    """Reserved package names"""

    @staticmethod
    def _looks_like_package(_path: _Path, package_name: str) -> bool:
        names = package_name.split('.')
        # Consider PEP 561
        root_pkg_is_valid = names[0].isidentifier() or names[0].endswith("-stubs")
        return root_pkg_is_valid and all(name.isidentifier() for name in names[1:])


class FlatLayoutModuleFinder(ModuleFinder):
    DEFAULT_EXCLUDE = (
        "setup",
        "conftest",
        "test",
        "tests",
        "example",
        "examples",
        "build",
        # ---- Task runners ----
        "toxfile",
        "noxfile",
        "pavement",
        "dodo",
        "tasks",
        "fabfile",
        # ---- Other tools ----
        "[Ss][Cc]onstruct",  # SCons
        "conanfile",  # Connan: C/C++ build tool
        "manage",  # Django
        "benchmark",
        "benchmarks",
        "exercise",
        "exercises",
        # ---- Hidden files/Private modules ----
        "[._]*",
    )
    """Reserved top-level module names"""


def _find_packages_within(root_pkg: str, pkg_dir: _Path) -> List[str]:
    nested = PEP420PackageFinder.find(pkg_dir)
    return [root_pkg] + [".".join((root_pkg, n)) for n in nested]


class ConfigDiscovery:
    """Fill-in metadata and options that can be automatically derived
    (from other metadata/options, the file system or conventions)
    """

    def __init__(self, distribution: "Distribution"):
        self.dist = distribution
        self._called = False
        self._disabled = False
        self._skip_ext_modules = False

    def _disable(self):
        """Internal API to disable automatic discovery"""
        self._disabled = True

    def _ignore_ext_modules(self):
        """Internal API to disregard ext_modules.

        Normally auto-discovery would not be triggered if ``ext_modules`` are set
        (this is done for backward compatibility with existing packages relying on
        ``setup.py`` or ``setup.cfg``). However, ``setuptools`` can call this function
        to ignore given ``ext_modules`` and proceed with the auto-discovery if
        ``packages`` and ``py_modules`` are not given (e.g. when using pyproject.toml
        metadata).
        """
        self._skip_ext_modules = True

    @property
    def _root_dir(self) -> _Path:
        # The best is to wait until `src_root` is set in dist, before using _root_dir.
        return self.dist.src_root or os.curdir

    @property
    def _package_dir(self) -> Dict[str, str]:
        if self.dist.package_dir is None:
            return {}
        return self.dist.package_dir

    def __call__(self, force=False, name=True, ignore_ext_modules=False):
        """Automatically discover missing configuration fields
        and modifies the given ``distribution`` object in-place.

        Note that by default this will only have an effect the first time the
        ``ConfigDiscovery`` object is called.

        To repeatedly invoke automatic discovery (e.g. when the project
        directory changes), please use ``force=True`` (or create a new
        ``ConfigDiscovery`` instance).
        """
        if force is False and (self._called or self._disabled):
            # Avoid overhead of multiple calls
            return

        self._analyse_package_layout(ignore_ext_modules)
        if name:
            self.analyse_name()  # depends on ``packages`` and ``py_modules``

        self._called = True

    def _explicitly_specified(self, ignore_ext_modules: bool) -> bool:
        """``True`` if the user has specified some form of package/module listing"""
        ignore_ext_modules = ignore_ext_modules or self._skip_ext_modules
        ext_modules = not (self.dist.ext_modules is None or ignore_ext_modules)
        return (
            self.dist.packages is not None
            or self.dist.py_modules is not None
            or ext_modules
            or hasattr(self.dist, "configuration") and self.dist.configuration
            # ^ Some projects use numpy.distutils.misc_util.Configuration
        )

    def _analyse_package_layout(self, ignore_ext_modules: bool) -> bool:
        if self._explicitly_specified(ignore_ext_modules):
            # For backward compatibility, just try to find modules/packages
            # when nothing is given
            return True

        log.debug(
            "No `packages` or `py_modules` configuration, performing "
            "automatic discovery."
        )

        return (
            self._analyse_explicit_layout()
            or self._analyse_src_layout()
            # flat-layout is the trickiest for discovery so it should be last
            or self._analyse_flat_layout()
        )

    def _analyse_explicit_layout(self) -> bool:
        """The user can explicitly give a package layout via ``package_dir``"""
        package_dir = self._package_dir.copy()  # don't modify directly
        package_dir.pop("", None)  # This falls under the "src-layout" umbrella
        root_dir = self._root_dir

        if not package_dir:
            return False

        log.debug(f"`explicit-layout` detected -- analysing {package_dir}")
        pkgs = chain_iter(
            _find_packages_within(pkg, os.path.join(root_dir, parent_dir))
            for pkg, parent_dir in package_dir.items()
        )
        self.dist.packages = list(pkgs)
        log.debug(f"discovered packages -- {self.dist.packages}")
        return True

    def _analyse_src_layout(self) -> bool:
        """Try to find all packages or modules under the ``src`` directory
        (or anything pointed by ``package_dir[""]``).

        The "src-layout" is relatively safe for automatic discovery.
        We assume that everything within is meant to be included in the
        distribution.

        If ``package_dir[""]`` is not given, but the ``src`` directory exists,
        this function will set ``package_dir[""] = "src"``.
        """
        package_dir = self._package_dir
        src_dir = os.path.join(self._root_dir, package_dir.get("", "src"))
        if not os.path.isdir(src_dir):
            return False

        log.debug(f"`src-layout` detected -- analysing {src_dir}")
        package_dir.setdefault("", os.path.basename(src_dir))
        self.dist.package_dir = package_dir  # persist eventual modifications
        self.dist.packages = PEP420PackageFinder.find(src_dir)
        self.dist.py_modules = ModuleFinder.find(src_dir)
        log.debug(f"discovered packages -- {self.dist.packages}")
        log.debug(f"discovered py_modules -- {self.dist.py_modules}")
        return True

    def _analyse_flat_layout(self) -> bool:
        """Try to find all packages and modules under the project root.

        Since the ``flat-layout`` is more dangerous in terms of accidentally including
        extra files/directories, this function is more conservative and will raise an
        error if multiple packages or modules are found.

        This assumes that multi-package dists are uncommon and refuse to support that
        use case in order to be able to prevent unintended errors.
        """
        log.debug(f"`flat-layout` detected -- analysing {self._root_dir}")
        return self._analyse_flat_packages() or self._analyse_flat_modules()

    def _analyse_flat_packages(self) -> bool:
        self.dist.packages = FlatLayoutPackageFinder.find(self._root_dir)
        top_level = remove_nested_packages(remove_stubs(self.dist.packages))
        log.debug(f"discovered packages -- {self.dist.packages}")
        self._ensure_no_accidental_inclusion(top_level, "packages")
        return bool(top_level)

    def _analyse_flat_modules(self) -> bool:
        self.dist.py_modules = FlatLayoutModuleFinder.find(self._root_dir)
        log.debug(f"discovered py_modules -- {self.dist.py_modules}")
        self._ensure_no_accidental_inclusion(self.dist.py_modules, "modules")
        return bool(self.dist.py_modules)

    def _ensure_no_accidental_inclusion(self, detected: List[str], kind: str):
        if len(detected) > 1:
            from inspect import cleandoc

            from setuptools.errors import PackageDiscoveryError

            msg = f"""Multiple top-level {kind} discovered in a flat-layout: {detected}.

            To avoid accidental inclusion of unwanted files or directories,
            setuptools will not proceed with this build.

            If you are trying to create a single distribution with multiple {kind}
            on purpose, you should not rely on automatic discovery.
            Instead, consider the following options:

            1. set up custom discovery (`find` directive with `include` or `exclude`)
            2. use a `src-layout`
            3. explicitly set `py_modules` or `packages` with a list of names

            To find more information, look for "package discovery" on setuptools docs.
            """
            raise PackageDiscoveryError(cleandoc(msg))

    def analyse_name(self):
        """The packages/modules are the essential contribution of the author.
        Therefore the name of the distribution can be derived from them.
        """
        if self.dist.metadata.name or self.dist.name:
            # get_name() is not reliable (can return "UNKNOWN")
            return None

        log.debug("No `name` configuration, performing automatic discovery")

        name = (
            self._find_name_single_package_or_module()
            or self._find_name_from_packages()
        )
        if name:
            self.dist.metadata.name = name

    def _find_name_single_package_or_module(self) -> Optional[str]:
        """Exactly one module or package"""
        for field in ('packages', 'py_modules'):
            items = getattr(self.dist, field, None) or []
            if items and len(items) == 1:
                log.debug(f"Single module/package detected, name: {items[0]}")
                return items[0]

        return None

    def _find_name_from_packages(self) -> Optional[str]:
        """Try to find the root package that is not a PEP 420 namespace"""
        if not self.dist.packages:
            return None

        packages = remove_stubs(sorted(self.dist.packages, key=len))
        package_dir = self.dist.package_dir or {}

        parent_pkg = find_parent_package(packages, package_dir, self._root_dir)
        if parent_pkg:
            log.debug(f"Common parent package detected, name: {parent_pkg}")
            return parent_pkg

        log.warn("No parent package detected, impossible to derive `name`")
        return None


def remove_nested_packages(packages: List[str]) -> List[str]:
    """Remove nested packages from a list of packages.

    >>> remove_nested_packages(["a", "a.b1", "a.b2", "a.b1.c1"])
    ['a']
    >>> remove_nested_packages(["a", "b", "c.d", "c.d.e.f", "g.h", "a.a1"])
    ['a', 'b', 'c.d', 'g.h']
    """
    pkgs = sorted(packages, key=len)
    top_level = pkgs[:]
    size = len(pkgs)
    for i, name in enumerate(reversed(pkgs)):
        if any(name.startswith(f"{other}.") for other in top_level):
            top_level.pop(size - i - 1)

    return top_level


def remove_stubs(packages: List[str]) -> List[str]:
    """Remove type stubs (:pep:`561`) from a list of packages.

    >>> remove_stubs(["a", "a.b", "a-stubs", "a-stubs.b.c", "b", "c-stubs"])
    ['a', 'a.b', 'b']
    """
    return [pkg for pkg in packages if not pkg.split(".")[0].endswith("-stubs")]


def find_parent_package(
    packages: List[str], package_dir: Mapping[str, str], root_dir: _Path
) -> Optional[str]:
    """Find the parent package that is not a namespace."""
    packages = sorted(packages, key=len)
    common_ancestors = []
    for i, name in enumerate(packages):
        if not all(n.startswith(f"{name}.") for n in packages[i+1:]):
            # Since packages are sorted by length, this condition is able
            # to find a list of all common ancestors.
            # When there is divergence (e.g. multiple root packages)
            # the list will be empty
            break
        common_ancestors.append(name)

    for name in common_ancestors:
        pkg_path = find_package_path(name, package_dir, root_dir)
        init = os.path.join(pkg_path, "__init__.py")
        if os.path.isfile(init):
            return name

    return None


def find_package_path(
    name: str, package_dir: Mapping[str, str], root_dir: _Path
) -> str:
    """Given a package name, return the path where it should be found on
    disk, considering the ``package_dir`` option.

    >>> path = find_package_path("my.pkg", {"": "root/is/nested"}, ".")
    >>> path.replace(os.sep, "/")
    './root/is/nested/my/pkg'

    >>> path = find_package_path("my.pkg", {"my": "root/is/nested"}, ".")
    >>> path.replace(os.sep, "/")
    './root/is/nested/pkg'

    >>> path = find_package_path("my.pkg", {"my.pkg": "root/is/nested"}, ".")
    >>> path.replace(os.sep, "/")
    './root/is/nested'

    >>> path = find_package_path("other.pkg", {"my.pkg": "root/is/nested"}, ".")
    >>> path.replace(os.sep, "/")
    './other/pkg'
    """
    parts = name.split(".")
    for i in range(len(parts), 0, -1):
        # Look backwards, the most specific package_dir first
        partial_name = ".".join(parts[:i])
        if partial_name in package_dir:
            parent = package_dir[partial_name]
            return os.path.join(root_dir, parent, *parts[i:])

    parent = package_dir.get("") or ""
    return os.path.join(root_dir, *parent.split("/"), *parts)


def construct_package_dir(packages: List[str], package_path: _Path) -> Dict[str, str]:
    parent_pkgs = remove_nested_packages(packages)
    prefix = Path(package_path).parts
    return {pkg: "/".join([*prefix, *pkg.split(".")]) for pkg in parent_pkgs}
PK!xii+extern/__pycache__/__init__.cpython-311.pycnu[

,Re	rddlZddlZGddZdZeeeddS)NcVeZdZdZddZedZdZdZdZ	d	Z
d
d
ZdZdS)VendorImporterz
    A PEP 302 meta path importer for finding optionally-vendored
    or otherwise naturally-installed packages from root_name.
    Ncv||_t||_|p|dd|_dS)Nextern_vendor)	root_namesetvendored_namesreplace
vendor_pkg)selfr	rr
s    /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/extern/__init__.py__init__zVendorImporter.__init__s9"!.11$N	(9(9(I(N(Nc#*K|jdzVdVdS)zL
        Search first the vendor package then as a natural package.
        .N)r
rs rsearch_pathzVendorImporter.search_paths(
o####rc||jdz\}}}|o&tt|j|jS)z,Figure out if the target module is vendored.r)	partitionr	anymap
startswithr)rfullnamerootbasetargets     r_module_matches_namespacez(VendorImporter._module_matches_namespacesH%//0DEEdFxLCF$5t7J K KLLLrc6||jdz\}}}|jD]K}	||z}t|tj|}|tj|<|cS#t$rYHwxYwt
djdit)zK
        Iterate over the search path to locate and load fullname.
        rzThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.Nr)	rr	r
__import__sysmodulesImportErrorformatlocals)rrrrrprefixextantmods        rload_modulezVendorImporter.load_modules&//0DEEdF&		F
&6"""k&)(+H%






' !'33*033
s6A%%
A21A2c6||jSN)r+name)rspecs  r
create_modulezVendorImporter.create_module3s	***rcdSr-r)rmodules  rexec_modulezVendorImporter.exec_module6srcp||r tj||ndS)z(Return a module spec for vendored names.N)r 	importlibutilspec_from_loader)rrpathrs    r	find_speczVendorImporter.find_spec9s:--h77
BIN++Hd;;;=A	
rcd|tjvr!tj|dSdS)zR
        Install this importer into sys.meta_path if not already present.
        N)r#	meta_pathappendrs rinstallzVendorImporter.install@s5s}$$M  &&&&&%$r)rN)NN)
__name__
__module____qualname____doc__rpropertyrr r+r0r3r9r=rrrrrs
OOOO
XMMM
,+++






'''''rr)
	packaging	pyparsingordered_setmore_itertoolsimportlib_metadatazippimportlib_resourcesjaracotyping_extensionstomlizsetuptools._vendor)importlib.utilr5r#rnamesr>r=rrrrOs{



@'@'@'@'@'@'@'@'F	x 455==?????rPK!Q	errors.pynu["""setuptools.errors

Provides exceptions used by setuptools modules.
"""

from distutils.errors import DistutilsError


class RemovedCommandError(DistutilsError, RuntimeError):
    """Error used for commands that have been removed in setuptools.

    Since ``setuptools`` is built on ``distutils``, simply removing a command
    from ``setuptools`` will make the behavior fall back to ``distutils``; this
    error is raised if a command exists in ``distutils`` but has been actively
    removed in ``setuptools``.
    """
PK!6
_importlib.pynu[import sys


def disable_importlib_metadata_finder(metadata):
    """
    Ensure importlib_metadata doesn't provide older, incompatible
    Distributions.

    Workaround for #3102.
    """
    try:
        import importlib_metadata
    except ImportError:
        return
    except AttributeError:
        import warnings

        msg = (
            "`importlib-metadata` version is incompatible with `setuptools`.\n"
            "This problem is likely to be solved by installing an updated version of "
            "`importlib-metadata`."
        )
        warnings.warn(msg)  # Ensure a descriptive message is shown.
        raise  # This exception can be suppressed by _distutils_hack

    if importlib_metadata is metadata:
        return
    to_remove = [
        ob
        for ob in sys.meta_path
        if isinstance(ob, importlib_metadata.MetadataPathFinder)
    ]
    for item in to_remove:
        sys.meta_path.remove(item)


if sys.version_info < (3, 10):
    from setuptools.extern import importlib_metadata as metadata
    disable_importlib_metadata_finder(metadata)
else:
    import importlib.metadata as metadata  # noqa: F401


if sys.version_info < (3, 9):
    from setuptools.extern import importlib_resources as resources
else:
    import importlib.resources as resources  # noqa: F401
PK!.command/build.pynu[import sys
import warnings
from typing import TYPE_CHECKING, List, Dict
from distutils.command.build import build as _build

from setuptools import SetuptoolsDeprecationWarning

if sys.version_info >= (3, 8):
    from typing import Protocol
elif TYPE_CHECKING:
    from typing_extensions import Protocol
else:
    from abc import ABC as Protocol


_ORIGINAL_SUBCOMMANDS = {"build_py", "build_clib", "build_ext", "build_scripts"}


class build(_build):
    # copy to avoid sharing the object with parent class
    sub_commands = _build.sub_commands[:]

    def get_sub_commands(self):
        subcommands = {cmd[0] for cmd in _build.sub_commands}
        if subcommands - _ORIGINAL_SUBCOMMANDS:
            msg = """
            It seems that you are using `distutils.command.build` to add
            new subcommands. Using `distutils` directly is considered deprecated,
            please use `setuptools.command.build`.
            """
            warnings.warn(msg, SetuptoolsDeprecationWarning)
            self.sub_commands = _build.sub_commands
        return super().get_sub_commands()


class SubCommand(Protocol):
    """In order to support editable installations (see :pep:`660`) all
    build subcommands **SHOULD** implement this protocol. They also **MUST** inherit
    from ``setuptools.Command``.

    When creating an :pep:`editable wheel <660>`, ``setuptools`` will try to evaluate
    custom ``build`` subcommands using the following procedure:

    1. ``setuptools`` will set the ``editable_mode`` attribute to ``True``
    2. ``setuptools`` will execute the ``run()`` command.

       .. important::
          Subcommands **SHOULD** take advantage of ``editable_mode=True`` to adequate
          its behaviour or perform optimisations.

          For example, if a subcommand doesn't need to generate an extra file and
          all it does is to copy a source file into the build directory,
          ``run()`` **SHOULD** simply "early return".

          Similarly, if the subcommand creates files that would be placed alongside
          Python files in the final distribution, during an editable install
          the command **SHOULD** generate these files "in place" (i.e. write them to
          the original source directory, instead of using the build directory).
          Note that ``get_output_mapping()`` should reflect that and include mappings
          for "in place" builds accordingly.

    3. ``setuptools`` use any knowledge it can derive from the return values of
       ``get_outputs()`` and ``get_output_mapping()`` to create an editable wheel.
       When relevant ``setuptools`` **MAY** attempt to use file links based on the value
       of ``get_output_mapping()``. Alternatively, ``setuptools`` **MAY** attempt to use
       :doc:`import hooks ` to redirect any attempt to import
       to the directory with the original source code and other files built in place.

    Please note that custom sub-commands **SHOULD NOT** rely on ``run()`` being
    executed (or not) to provide correct return values for ``get_outputs()``,
    ``get_output_mapping()`` or ``get_source_files()``. The ``get_*`` methods should
    work independently of ``run()``.
    """

    editable_mode: bool = False
    """Boolean flag that will be set to ``True`` when setuptools is used for an
    editable installation (see :pep:`660`).
    Implementations **SHOULD** explicitly set the default value of this attribute to
    ``False``.
    When subcommands run, they can use this flag to perform optimizations or change
    their behaviour accordingly.
    """

    build_lib: str
    """String representing the directory where the build artifacts should be stored,
    e.g. ``build/lib``.
    For example, if a distribution wants to provide a Python module named ``pkg.mod``,
    then a corresponding file should be written to ``{build_lib}/package/module.py``.
    A way of thinking about this is that the files saved under ``build_lib``
    would be eventually copied to one of the directories in :obj:`site.PREFIXES`
    upon installation.

    A command that produces platform-independent files (e.g. compiling text templates
    into Python functions), **CAN** initialize ``build_lib`` by copying its value from
    the ``build_py`` command. On the other hand, a command that produces
    platform-specific files **CAN** initialize ``build_lib`` by copying its value from
    the ``build_ext`` command. In general this is done inside the ``finalize_options``
    method with the help of the ``set_undefined_options`` command::

        def finalize_options(self):
            self.set_undefined_options("build_py", ("build_lib", "build_lib"))
            ...
    """

    def initialize_options(self):
        """(Required by the original :class:`setuptools.Command` interface)"""

    def finalize_options(self):
        """(Required by the original :class:`setuptools.Command` interface)"""

    def run(self):
        """(Required by the original :class:`setuptools.Command` interface)"""

    def get_source_files(self) -> List[str]:
        """
        Return a list of all files that are used by the command to create the expected
        outputs.
        For example, if your build command transpiles Java files into Python, you should
        list here all the Java files.
        The primary purpose of this function is to help populating the ``sdist``
        with all the files necessary to build the distribution.
        All files should be strings relative to the project root directory.
        """

    def get_outputs(self) -> List[str]:
        """
        Return a list of files intended for distribution as they would have been
        produced by the build.
        These files should be strings in the form of
        ``"{build_lib}/destination/file/path"``.

        .. note::
           The return value of ``get_output()`` should include all files used as keys
           in ``get_output_mapping()`` plus files that are generated during the build
           and don't correspond to any source file already present in the project.
        """

    def get_output_mapping(self) -> Dict[str, str]:
        """
        Return a mapping between destination files as they would be produced by the
        build (dict keys) into the respective existing (source) files (dict values).
        Existing (source) files should be represented as strings relative to the project
        root directory.
        Destination files should be strings in the form of
        ``"{build_lib}/destination/file/path"``.
        """
PK!#l2yycommand/editable_wheel.pynu["""
Create a wheel that, when installed, will make the source package 'editable'
(add it to the interpreter's path, including metadata) per PEP 660. Replaces
'setup.py develop'.

.. note::
   One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is
   to create a separated directory inside ``build`` and use a .pth file to point to that
   directory. In the context of this file such directory is referred as
   *auxiliary build directory* or ``auxiliary_dir``.
"""

import logging
import os
import re
import shutil
import sys
import traceback
import warnings
from contextlib import suppress
from enum import Enum
from inspect import cleandoc
from itertools import chain
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import (
    TYPE_CHECKING,
    Dict,
    Iterable,
    Iterator,
    List,
    Mapping,
    Optional,
    Tuple,
    TypeVar,
    Union,
)

from setuptools import Command, SetuptoolsDeprecationWarning, errors, namespaces
from setuptools.command.build_py import build_py as build_py_cls
from setuptools.discovery import find_package_path
from setuptools.dist import Distribution

if TYPE_CHECKING:
    from wheel.wheelfile import WheelFile  # noqa

if sys.version_info >= (3, 8):
    from typing import Protocol
elif TYPE_CHECKING:
    from typing_extensions import Protocol
else:
    from abc import ABC as Protocol

_Path = Union[str, Path]
_P = TypeVar("_P", bound=_Path)
_logger = logging.getLogger(__name__)


class _EditableMode(Enum):
    """
    Possible editable installation modes:
    `lenient` (new files automatically added to the package - DEFAULT);
    `strict` (requires a new installation when files are added/removed); or
    `compat` (attempts to emulate `python setup.py develop` - DEPRECATED).
    """

    STRICT = "strict"
    LENIENT = "lenient"
    COMPAT = "compat"  # TODO: Remove `compat` after Dec/2022.

    @classmethod
    def convert(cls, mode: Optional[str]) -> "_EditableMode":
        if not mode:
            return _EditableMode.LENIENT  # default

        _mode = mode.upper()
        if _mode not in _EditableMode.__members__:
            raise errors.OptionError(f"Invalid editable mode: {mode!r}. Try: 'strict'.")

        if _mode == "COMPAT":
            msg = """
            The 'compat' editable mode is transitional and will be removed
            in future versions of `setuptools`.
            Please adapt your code accordingly to use either the 'strict' or the
            'lenient' modes.

            For more information, please check:
            https://setuptools.pypa.io/en/latest/userguide/development_mode.html
            """
            warnings.warn(msg, SetuptoolsDeprecationWarning)

        return _EditableMode[_mode]


_STRICT_WARNING = """
New or renamed files may not be automatically picked up without a new installation.
"""

_LENIENT_WARNING = """
Options like `package-data`, `include/exclude-package-data` or
`packages.find.exclude/include` may have no effect.
"""


class editable_wheel(Command):
    """Build 'editable' wheel for development.
    (This command is reserved for internal use of setuptools).
    """

    description = "create a PEP 660 'editable' wheel"

    user_options = [
        ("dist-dir=", "d", "directory to put final built distributions in"),
        ("dist-info-dir=", "I", "path to a pre-build .dist-info directory"),
        ("mode=", None, cleandoc(_EditableMode.__doc__ or "")),
    ]

    def initialize_options(self):
        self.dist_dir = None
        self.dist_info_dir = None
        self.project_dir = None
        self.mode = None

    def finalize_options(self):
        dist = self.distribution
        self.project_dir = dist.src_root or os.curdir
        self.package_dir = dist.package_dir or {}
        self.dist_dir = Path(self.dist_dir or os.path.join(self.project_dir, "dist"))

    def run(self):
        try:
            self.dist_dir.mkdir(exist_ok=True)
            self._ensure_dist_info()

            # Add missing dist_info files
            self.reinitialize_command("bdist_wheel")
            bdist_wheel = self.get_finalized_command("bdist_wheel")
            bdist_wheel.write_wheelfile(self.dist_info_dir)

            self._create_wheel_file(bdist_wheel)
        except Exception as ex:
            traceback.print_exc()
            msg = """
            Support for editable installs via PEP 660 was recently introduced
            in `setuptools`. If you are seeing this error, please report to:

            https://github.com/pypa/setuptools/issues

            Meanwhile you can try the legacy behavior by setting an
            environment variable and trying to install again:

            SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
            """
            raise errors.InternalError(cleandoc(msg)) from ex

    def _ensure_dist_info(self):
        if self.dist_info_dir is None:
            dist_info = self.reinitialize_command("dist_info")
            dist_info.output_dir = self.dist_dir
            dist_info.ensure_finalized()
            dist_info.run()
            self.dist_info_dir = dist_info.dist_info_dir
        else:
            assert str(self.dist_info_dir).endswith(".dist-info")
            assert Path(self.dist_info_dir, "METADATA").exists()

    def _install_namespaces(self, installation_dir, pth_prefix):
        # XXX: Only required to support the deprecated namespace practice
        dist = self.distribution
        if not dist.namespace_packages:
            return

        src_root = Path(self.project_dir, self.package_dir.get("", ".")).resolve()
        installer = _NamespaceInstaller(dist, installation_dir, pth_prefix, src_root)
        installer.install_namespaces()

    def _find_egg_info_dir(self) -> Optional[str]:
        parent_dir = Path(self.dist_info_dir).parent if self.dist_info_dir else Path()
        candidates = map(str, parent_dir.glob("*.egg-info"))
        return next(candidates, None)

    def _configure_build(
        self, name: str, unpacked_wheel: _Path, build_lib: _Path, tmp_dir: _Path
    ):
        """Configure commands to behave in the following ways:

        - Build commands can write to ``build_lib`` if they really want to...
          (but this folder is expected to be ignored and modules are expected to live
          in the project directory...)
        - Binary extensions should be built in-place (editable_mode = True)
        - Data/header/script files are not part of the "editable" specification
          so they are written directly to the unpacked_wheel directory.
        """
        # Non-editable files (data, headers, scripts) are written directly to the
        # unpacked_wheel

        dist = self.distribution
        wheel = str(unpacked_wheel)
        build_lib = str(build_lib)
        data = str(Path(unpacked_wheel, f"{name}.data", "data"))
        headers = str(Path(unpacked_wheel, f"{name}.data", "headers"))
        scripts = str(Path(unpacked_wheel, f"{name}.data", "scripts"))

        # egg-info may be generated again to create a manifest (used for package data)
        egg_info = dist.reinitialize_command("egg_info", reinit_subcommands=True)
        egg_info.egg_base = str(tmp_dir)
        egg_info.ignore_egg_info_in_manifest = True

        build = dist.reinitialize_command("build", reinit_subcommands=True)
        install = dist.reinitialize_command("install", reinit_subcommands=True)

        build.build_platlib = build.build_purelib = build.build_lib = build_lib
        install.install_purelib = install.install_platlib = install.install_lib = wheel
        install.install_scripts = build.build_scripts = scripts
        install.install_headers = headers
        install.install_data = data

        install_scripts = dist.get_command_obj("install_scripts")
        install_scripts.no_ep = True

        build.build_temp = str(tmp_dir)

        build_py = dist.get_command_obj("build_py")
        build_py.compile = False
        build_py.existing_egg_info_dir = self._find_egg_info_dir()

        self._set_editable_mode()

        build.ensure_finalized()
        install.ensure_finalized()

    def _set_editable_mode(self):
        """Set the ``editable_mode`` flag in the build sub-commands"""
        dist = self.distribution
        build = dist.get_command_obj("build")
        for cmd_name in build.get_sub_commands():
            cmd = dist.get_command_obj(cmd_name)
            if hasattr(cmd, "editable_mode"):
                cmd.editable_mode = True
            elif hasattr(cmd, "inplace"):
                cmd.inplace = True  # backward compatibility with distutils

    def _collect_build_outputs(self) -> Tuple[List[str], Dict[str, str]]:
        files: List[str] = []
        mapping: Dict[str, str] = {}
        build = self.get_finalized_command("build")

        for cmd_name in build.get_sub_commands():
            cmd = self.get_finalized_command(cmd_name)
            if hasattr(cmd, "get_outputs"):
                files.extend(cmd.get_outputs() or [])
            if hasattr(cmd, "get_output_mapping"):
                mapping.update(cmd.get_output_mapping() or {})

        return files, mapping

    def _run_build_commands(
        self, dist_name: str, unpacked_wheel: _Path, build_lib: _Path, tmp_dir: _Path
    ) -> Tuple[List[str], Dict[str, str]]:
        self._configure_build(dist_name, unpacked_wheel, build_lib, tmp_dir)
        self._run_build_subcommands()
        files, mapping = self._collect_build_outputs()
        self._run_install("headers")
        self._run_install("scripts")
        self._run_install("data")
        return files, mapping

    def _run_build_subcommands(self):
        """
        Issue #3501 indicates that some plugins/customizations might rely on:

        1. ``build_py`` not running
        2. ``build_py`` always copying files to ``build_lib``

        However both these assumptions may be false in editable_wheel.
        This method implements a temporary workaround to support the ecosystem
        while the implementations catch up.
        """
        # TODO: Once plugins/customisations had the chance to catch up, replace
        #       `self._run_build_subcommands()` with `self.run_command("build")`.
        #       Also remove _safely_run, TestCustomBuildPy. Suggested date: Aug/2023.
        build: Command = self.get_finalized_command("build")
        for name in build.get_sub_commands():
            cmd = self.get_finalized_command(name)
            if name == "build_py" and type(cmd) != build_py_cls:
                self._safely_run(name)
            else:
                self.run_command(name)

    def _safely_run(self, cmd_name: str):
        try:
            return self.run_command(cmd_name)
        except Exception:
            msg = f"""{traceback.format_exc()}\n
            If you are seeing this warning it is very likely that a setuptools
            plugin or customization overrides the `{cmd_name}` command, without
            taking into consideration how editable installs run build steps
            starting from v64.0.0.

            Plugin authors and developers relying on custom build steps are encouraged
            to update their `{cmd_name}` implementation considering the information in
            https://setuptools.pypa.io/en/latest/userguide/extension.html
            about editable installs.

            For the time being `setuptools` will silence this error and ignore
            the faulty command, but this behaviour will change in future versions.\n
            """
            warnings.warn(msg, SetuptoolsDeprecationWarning, stacklevel=2)

    def _create_wheel_file(self, bdist_wheel):
        from wheel.wheelfile import WheelFile

        dist_info = self.get_finalized_command("dist_info")
        dist_name = dist_info.name
        tag = "-".join(bdist_wheel.get_tag())
        build_tag = "0.editable"  # According to PEP 427 needs to start with digit
        archive_name = f"{dist_name}-{build_tag}-{tag}.whl"
        wheel_path = Path(self.dist_dir, archive_name)
        if wheel_path.exists():
            wheel_path.unlink()

        unpacked_wheel = TemporaryDirectory(suffix=archive_name)
        build_lib = TemporaryDirectory(suffix=".build-lib")
        build_tmp = TemporaryDirectory(suffix=".build-temp")

        with unpacked_wheel as unpacked, build_lib as lib, build_tmp as tmp:
            unpacked_dist_info = Path(unpacked, Path(self.dist_info_dir).name)
            shutil.copytree(self.dist_info_dir, unpacked_dist_info)
            self._install_namespaces(unpacked, dist_info.name)
            files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
            strategy = self._select_strategy(dist_name, tag, lib)
            with strategy, WheelFile(wheel_path, "w") as wheel_obj:
                strategy(wheel_obj, files, mapping)
                wheel_obj.write_files(unpacked)

        return wheel_path

    def _run_install(self, category: str):
        has_category = getattr(self.distribution, f"has_{category}", None)
        if has_category and has_category():
            _logger.info(f"Installing {category} as non editable")
            self.run_command(f"install_{category}")

    def _select_strategy(
        self,
        name: str,
        tag: str,
        build_lib: _Path,
    ) -> "EditableStrategy":
        """Decides which strategy to use to implement an editable installation."""
        build_name = f"__editable__.{name}-{tag}"
        project_dir = Path(self.project_dir)
        mode = _EditableMode.convert(self.mode)

        if mode is _EditableMode.STRICT:
            auxiliary_dir = _empty_dir(Path(self.project_dir, "build", build_name))
            return _LinkTree(self.distribution, name, auxiliary_dir, build_lib)

        packages = _find_packages(self.distribution)
        has_simple_layout = _simple_layout(packages, self.package_dir, project_dir)
        is_compat_mode = mode is _EditableMode.COMPAT
        if set(self.package_dir) == {""} and has_simple_layout or is_compat_mode:
            # src-layout(ish) is relatively safe for a simple pth file
            src_dir = self.package_dir.get("", ".")
            return _StaticPth(self.distribution, name, [Path(project_dir, src_dir)])

        # Use a MetaPathFinder to avoid adding accidental top-level packages/modules
        return _TopLevelFinder(self.distribution, name)


class EditableStrategy(Protocol):
    def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
        ...

    def __enter__(self):
        ...

    def __exit__(self, _exc_type, _exc_value, _traceback):
        ...


class _StaticPth:
    def __init__(self, dist: Distribution, name: str, path_entries: List[Path]):
        self.dist = dist
        self.name = name
        self.path_entries = path_entries

    def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
        entries = "\n".join((str(p.resolve()) for p in self.path_entries))
        contents = bytes(f"{entries}\n", "utf-8")
        wheel.writestr(f"__editable__.{self.name}.pth", contents)

    def __enter__(self):
        msg = f"""
        Editable install will be performed using .pth file to extend `sys.path` with:
        {list(map(os.fspath, self.path_entries))!r}
        """
        _logger.warning(msg + _LENIENT_WARNING)
        return self

    def __exit__(self, _exc_type, _exc_value, _traceback):
        ...


class _LinkTree(_StaticPth):
    """
    Creates a ``.pth`` file that points to a link tree in the ``auxiliary_dir``.

    This strategy will only link files (not dirs), so it can be implemented in
    any OS, even if that means using hardlinks instead of symlinks.

    By collocating ``auxiliary_dir`` and the original source code, limitations
    with hardlinks should be avoided.
    """
    def __init__(
        self, dist: Distribution,
        name: str,
        auxiliary_dir: _Path,
        build_lib: _Path,
    ):
        self.auxiliary_dir = Path(auxiliary_dir)
        self.build_lib = Path(build_lib).resolve()
        self._file = dist.get_command_obj("build_py").copy_file
        super().__init__(dist, name, [self.auxiliary_dir])

    def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
        self._create_links(files, mapping)
        super().__call__(wheel, files, mapping)

    def _normalize_output(self, file: str) -> Optional[str]:
        # Files relative to build_lib will be normalized to None
        with suppress(ValueError):
            path = Path(file).resolve().relative_to(self.build_lib)
            return str(path).replace(os.sep, '/')
        return None

    def _create_file(self, relative_output: str, src_file: str, link=None):
        dest = self.auxiliary_dir / relative_output
        if not dest.parent.is_dir():
            dest.parent.mkdir(parents=True)
        self._file(src_file, dest, link=link)

    def _create_links(self, outputs, output_mapping):
        self.auxiliary_dir.mkdir(parents=True, exist_ok=True)
        link_type = "sym" if _can_symlink_files(self.auxiliary_dir) else "hard"
        mappings = {
            self._normalize_output(k): v
            for k, v in output_mapping.items()
        }
        mappings.pop(None, None)  # remove files that are not relative to build_lib

        for output in outputs:
            relative = self._normalize_output(output)
            if relative and relative not in mappings:
                self._create_file(relative, output)

        for relative, src in mappings.items():
            self._create_file(relative, src, link=link_type)

    def __enter__(self):
        msg = "Strict editable install will be performed using a link tree.\n"
        _logger.warning(msg + _STRICT_WARNING)
        return self

    def __exit__(self, _exc_type, _exc_value, _traceback):
        msg = f"""\n
        Strict editable installation performed using the auxiliary directory:
            {self.auxiliary_dir}

        Please be careful to not remove this directory, otherwise you might not be able
        to import/use your package.
        """
        warnings.warn(msg, InformationOnly)


class _TopLevelFinder:
    def __init__(self, dist: Distribution, name: str):
        self.dist = dist
        self.name = name

    def __call__(self, wheel: "WheelFile", files: List[str], mapping: Dict[str, str]):
        src_root = self.dist.src_root or os.curdir
        top_level = chain(_find_packages(self.dist), _find_top_level_modules(self.dist))
        package_dir = self.dist.package_dir or {}
        roots = _find_package_roots(top_level, package_dir, src_root)

        namespaces_: Dict[str, List[str]] = dict(chain(
            _find_namespaces(self.dist.packages or [], roots),
            ((ns, []) for ns in _find_virtual_namespaces(roots)),
        ))

        name = f"__editable__.{self.name}.finder"
        finder = _make_identifier(name)
        content = bytes(_finder_template(name, roots, namespaces_), "utf-8")
        wheel.writestr(f"{finder}.py", content)

        content = bytes(f"import {finder}; {finder}.install()", "utf-8")
        wheel.writestr(f"__editable__.{self.name}.pth", content)

    def __enter__(self):
        msg = "Editable install will be performed using a meta path finder.\n"
        _logger.warning(msg + _LENIENT_WARNING)
        return self

    def __exit__(self, _exc_type, _exc_value, _traceback):
        msg = """\n
        Please be careful with folders in your working directory with the same
        name as your package as they may take precedence during imports.
        """
        warnings.warn(msg, InformationOnly)


def _can_symlink_files(base_dir: Path) -> bool:
    with TemporaryDirectory(dir=str(base_dir.resolve())) as tmp:
        path1, path2 = Path(tmp, "file1.txt"), Path(tmp, "file2.txt")
        path1.write_text("file1", encoding="utf-8")
        with suppress(AttributeError, NotImplementedError, OSError):
            os.symlink(path1, path2)
            if path2.is_symlink() and path2.read_text(encoding="utf-8") == "file1":
                return True

        try:
            os.link(path1, path2)  # Ensure hard links can be created
        except Exception as ex:
            msg = (
                "File system does not seem to support either symlinks or hard links. "
                "Strict editable installs require one of them to be supported."
            )
            raise LinksNotSupported(msg) from ex
        return False


def _simple_layout(
    packages: Iterable[str], package_dir: Dict[str, str], project_dir: Path
) -> bool:
    """Return ``True`` if:
    - all packages are contained by the same parent directory, **and**
    - all packages become importable if the parent directory is added to ``sys.path``.

    >>> _simple_layout(['a'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "a", "b": "b"}, ".")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a", "b": "_b"}, ".")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a"}, "/tmp/myproj")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a.a1.a2": "_a2"}, ".")
    False
    >>> _simple_layout(['a', 'a.b'], {"": "src", "a.b": "_ab"}, "/tmp/myproj")
    False
    >>> # Special cases, no packages yet:
    >>> _simple_layout([], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout([], {"a": "_a", "": "src"}, "/tmp/myproj")
    False
    """
    layout = {
        pkg: find_package_path(pkg, package_dir, project_dir)
        for pkg in packages
    }
    if not layout:
        return set(package_dir) in ({}, {""})
    parent = os.path.commonpath([_parent_path(k, v) for k, v in layout.items()])
    return all(
        _normalize_path(Path(parent, *key.split('.'))) == _normalize_path(value)
        for key, value in layout.items()
    )


def _parent_path(pkg, pkg_path):
    """Infer the parent path containing a package, that if added to ``sys.path`` would
    allow importing that package.
    When ``pkg`` is directly mapped into a directory with a different name, return its
    own path.
    >>> _parent_path("a", "src/a")
    'src'
    >>> _parent_path("b", "src/c")
    'src/c'
    """
    parent = pkg_path[:-len(pkg)] if pkg_path.endswith(pkg) else pkg_path
    return parent.rstrip("/" + os.sep)


def _find_packages(dist: Distribution) -> Iterator[str]:
    yield from iter(dist.packages or [])

    py_modules = dist.py_modules or []
    nested_modules = [mod for mod in py_modules if "." in mod]
    if dist.ext_package:
        yield dist.ext_package
    else:
        ext_modules = dist.ext_modules or []
        nested_modules += [x.name for x in ext_modules if "." in x.name]

    for module in nested_modules:
        package, _, _ = module.rpartition(".")
        yield package


def _find_top_level_modules(dist: Distribution) -> Iterator[str]:
    py_modules = dist.py_modules or []
    yield from (mod for mod in py_modules if "." not in mod)

    if not dist.ext_package:
        ext_modules = dist.ext_modules or []
        yield from (x.name for x in ext_modules if "." not in x.name)


def _find_package_roots(
    packages: Iterable[str],
    package_dir: Mapping[str, str],
    src_root: _Path,
) -> Dict[str, str]:
    pkg_roots: Dict[str, str] = {
        pkg: _absolute_root(find_package_path(pkg, package_dir, src_root))
        for pkg in sorted(packages)
    }

    return _remove_nested(pkg_roots)


def _absolute_root(path: _Path) -> str:
    """Works for packages and top-level modules"""
    path_ = Path(path)
    parent = path_.parent

    if path_.exists():
        return str(path_.resolve())
    else:
        return str(parent.resolve() / path_.name)


def _find_virtual_namespaces(pkg_roots: Dict[str, str]) -> Iterator[str]:
    """By carefully designing ``package_dir``, it is possible to implement the logical
    structure of PEP 420 in a package without the corresponding directories.

    Moreover a parent package can be purposefully/accidentally skipped in the discovery
    phase (e.g. ``find_packages(include=["mypkg.*"])``, when ``mypkg.foo`` is included
    by ``mypkg`` itself is not).
    We consider this case to also be a virtual namespace (ignoring the original
    directory) to emulate a non-editable installation.

    This function will try to find these kinds of namespaces.
    """
    for pkg in pkg_roots:
        if "." not in pkg:
            continue
        parts = pkg.split(".")
        for i in range(len(parts) - 1, 0, -1):
            partial_name = ".".join(parts[:i])
            path = Path(find_package_path(partial_name, pkg_roots, ""))
            if not path.exists() or partial_name not in pkg_roots:
                # partial_name not in pkg_roots ==> purposefully/accidentally skipped
                yield partial_name


def _find_namespaces(
    packages: List[str], pkg_roots: Dict[str, str]
) -> Iterator[Tuple[str, List[str]]]:
    for pkg in packages:
        path = find_package_path(pkg, pkg_roots, "")
        if Path(path).exists() and not Path(path, "__init__.py").exists():
            yield (pkg, [path])


def _remove_nested(pkg_roots: Dict[str, str]) -> Dict[str, str]:
    output = dict(pkg_roots.copy())

    for pkg, path in reversed(list(pkg_roots.items())):
        if any(
            pkg != other and _is_nested(pkg, path, other, other_path)
            for other, other_path in pkg_roots.items()
        ):
            output.pop(pkg)

    return output


def _is_nested(pkg: str, pkg_path: str, parent: str, parent_path: str) -> bool:
    """
    Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the
    file system.
    >>> _is_nested("a.b", "path/a/b", "a", "path/a")
    True
    >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a")
    False
    >>> _is_nested("a.b", "path/a/b", "c", "path/c")
    False
    >>> _is_nested("a.a", "path/a/a", "a", "path/a")
    True
    >>> _is_nested("b.a", "path/b/a", "a", "path/a")
    False
    """
    norm_pkg_path = _normalize_path(pkg_path)
    rest = pkg.replace(parent, "", 1).strip(".").split(".")
    return (
        pkg.startswith(parent)
        and norm_pkg_path == _normalize_path(Path(parent_path, *rest))
    )


def _normalize_path(filename: _Path) -> str:
    """Normalize a file/dir name for comparison purposes"""
    # See pkg_resources.normalize_path
    file = os.path.abspath(filename) if sys.platform == 'cygwin' else filename
    return os.path.normcase(os.path.realpath(os.path.normpath(file)))


def _empty_dir(dir_: _P) -> _P:
    """Create a directory ensured to be empty. Existing files may be removed."""
    shutil.rmtree(dir_, ignore_errors=True)
    os.makedirs(dir_)
    return dir_


def _make_identifier(name: str) -> str:
    """Make a string safe to be used as Python identifier.
    >>> _make_identifier("12abc")
    '_12abc'
    >>> _make_identifier("__editable__.myns.pkg-78.9.3_local")
    '__editable___myns_pkg_78_9_3_local'
    """
    safe = re.sub(r'\W|^(?=\d)', '_', name)
    assert safe.isidentifier()
    return safe


class _NamespaceInstaller(namespaces.Installer):
    def __init__(self, distribution, installation_dir, editable_name, src_root):
        self.distribution = distribution
        self.src_root = src_root
        self.installation_dir = installation_dir
        self.editable_name = editable_name
        self.outputs = []
        self.dry_run = False

    def _get_target(self):
        """Installation target."""
        return os.path.join(self.installation_dir, self.editable_name)

    def _get_root(self):
        """Where the modules/packages should be loaded from."""
        return repr(str(self.src_root))


_FINDER_TEMPLATE = """\
import sys
from importlib.machinery import ModuleSpec
from importlib.machinery import all_suffixes as module_suffixes
from importlib.util import spec_from_file_location
from itertools import chain
from pathlib import Path

MAPPING = {mapping!r}
NAMESPACES = {namespaces!r}
PATH_PLACEHOLDER = {name!r} + ".__path_hook__"


class _EditableFinder:  # MetaPathFinder
    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        for pkg, pkg_path in reversed(list(MAPPING.items())):
            if fullname == pkg or fullname.startswith(f"{{pkg}}."):
                rest = fullname.replace(pkg, "", 1).strip(".").split(".")
                return cls._find_spec(fullname, Path(pkg_path, *rest))

        return None

    @classmethod
    def _find_spec(cls, fullname, candidate_path):
        init = candidate_path / "__init__.py"
        candidates = (candidate_path.with_suffix(x) for x in module_suffixes())
        for candidate in chain([init], candidates):
            if candidate.exists():
                return spec_from_file_location(fullname, candidate)


class _EditableNamespaceFinder:  # PathEntryFinder
    @classmethod
    def _path_hook(cls, path):
        if path == PATH_PLACEHOLDER:
            return cls
        raise ImportError

    @classmethod
    def _paths(cls, fullname):
        # Ensure __path__ is not empty for the spec to be considered a namespace.
        return NAMESPACES[fullname] or MAPPING.get(fullname) or [PATH_PLACEHOLDER]

    @classmethod
    def find_spec(cls, fullname, target=None):
        if fullname in NAMESPACES:
            spec = ModuleSpec(fullname, None, is_package=True)
            spec.submodule_search_locations = cls._paths(fullname)
            return spec
        return None

    @classmethod
    def find_module(cls, fullname):
        return None


def install():
    if not any(finder == _EditableFinder for finder in sys.meta_path):
        sys.meta_path.append(_EditableFinder)

    if not NAMESPACES:
        return

    if not any(hook == _EditableNamespaceFinder._path_hook for hook in sys.path_hooks):
        # PathEntryFinder is needed to create NamespaceSpec without private APIS
        sys.path_hooks.append(_EditableNamespaceFinder._path_hook)
    if PATH_PLACEHOLDER not in sys.path:
        sys.path.append(PATH_PLACEHOLDER)  # Used just to trigger the path hook
"""


def _finder_template(
    name: str, mapping: Mapping[str, str], namespaces: Dict[str, List[str]]
) -> str:
    """Create a string containing the code for the``MetaPathFinder`` and
    ``PathEntryFinder``.
    """
    mapping = dict(sorted(mapping.items(), key=lambda p: p[0]))
    return _FINDER_TEMPLATE.format(name=name, mapping=mapping, namespaces=namespaces)


class InformationOnly(UserWarning):
    """Currently there is no clear way of displaying messages to the users
    that use the setuptools backend directly via ``pip``.
    The only thing that might work is a warning, although it is not the
    most appropriate tool for the job...
    """


class LinksNotSupported(errors.FileError):
    """File system does not seem to support either symlinks or hard links."""
PK!9V9V-command/__pycache__/build_ext.cpython-311.pycnu[

,Re=ddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZmZddl
mZddlmZddlmZmZddlmZdd	lmZdd
lmZmZ	ddlmZedn
#e$reZYnwxYweddd
lm Z!dZ"dZ#dZ$dZ%ej&dkrdZ$n*ej'dkr	ddl(Z(e)e(dxZ$Z#n#e$rYnwxYwdZ*dZ+GddeZe$sej'dkr
				ddZ,dSdZ%				ddZ,dS)NEXTENSION_SUFFIXES)cache_from_source)DictIteratorListTuple)	build_ext)new_compiler)customize_compilerget_config_var)log)	BaseError)	ExtensionLibraryzCython.Compiler.MainLDSHARED)_config_varscptjdkrtj}	dtd<dtd<dtd<t	|tjtj|dS#tjtj|wxYwt	|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclibCCSHAREDz.dylibSO)sysplatform_CONFIG_VARScopyrclearupdate)compilertmps  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build_ext.py_customize_compiler_for_shlibr!s
|x!!		%C
$'5L$!)Lx(((   $$$$$
   $$$$8$$$$$s-A;;)B$FsharedrTntRTLD_NOWctr|ndS)N)	have_rtld)ss r if_dlr)@s!11r!c>tD]}d|vr|cS|dkr|cSdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)suffixs r get_abi3_suffixr-DsH$fMMM
v

MMMr*c$eZdZUdZeed<dZeed<dZdede	e
e
ffdZdZded	e
de
fd
Z
dee	e
e
ffdZdZd
ZdZdZdZdZdZdee
fdZdee
e
ffdZdZdZddZdde
defdZde
fdZdS)r
F
editable_modeinplacec|jdc}|_tj|||_|r|dSdS)z;Build extensions in build directory, then copy if --inplacerN)r0
_build_extruncopy_extensions_to_source)selfold_inplaces  r r3z
build_ext.runQsS$(L!!T\t"	-**,,,,,	-	-r*extreturnc||j}||}|d}d|dd}||}tj|tj|}tj|j	|}	||	fS)N.)
get_ext_fullnamenameget_ext_filenamesplitjoinget_package_dirospathbasename	build_lib)
r5build_pyr7fullnamefilenamemodpathpackagepackage_dirinplace_fileregular_files
          r _get_inplace_equivalentz!build_ext._get_inplace_equivalentYs((22((22..%%((73B3<((..w77w||K1A1A(1K1KLLw||DNH==l++r*cf|d}|jD]}|||\}}tj|s|js||||j|j	r.|
||}|||ddS)NrF)levelT)compile)get_finalized_command
extensionsrNrBrCexistsoptional	copy_fileverbose_needs_stub_get_equivalent_stub_write_stub_file)r5rFr7rLrMinplace_stubs      r r4z#build_ext.copy_extensions_to_sourcecs--j99?	G	GC)-)E)EhPS)T)T&L,
w~~l++
O3<
O|\NNN
G#88lKK%%lC%FFF	G	Gr*output_filectj|}|jd\}}}tj||dSNr:.py)rBrCdirnamer=
rpartitionr@)r5r7r\dir__r=s      r rYzbuild_ext._get_equivalent_stubtsOw{++X((--
1d',,tT**////r*c#K|jsdS|d}|djpd}|jD]|}|||\}}||fV|jrT|||}|||}t||}t||}	|	|fV}dS)NrFinstall_libr&)optimization)r0rRoptimizerSrNrXrY_compiled_file_name)
r5rFoptr7rLrMr[regular_stub
inplace_cacheoutput_caches
          r _get_output_mappingzbuild_ext._get_output_mappingys|	F--j99((77@FB?	4	4C)-)E)EhPS)T)T&L,....
4 $88lKK#88lKK 3Ls S S S
2r
ext_mapgetattrr-len
isinstancersplitextshlib_compilerlibrary_filenamelibtype	use_stubs_links_to_dynamic)r5rGso_extrHr7use_abi3fnds        r r>zbuild_ext.get_ext_filenamesM233	2w|X^^C%8%89FBHH!24BBH#L11Ft|##,x(Cs$455K/:K:KH
-#Mc&kk\M2(**#f,#w''
3'**844C*;;BHHH
3s4
3

h//2w||Aurz222r*cftj|d|_g|_i|_d|_dS)NF)r2initialize_optionsrxshlibsrsr/r5s r rzbuild_ext.initialize_optionss7%d+++""r*ctj||jpg|_||jd|jD|_|jr||jD]!}||j|_"|jD]E}|j}||j	|<||j	|
dd<|jr||pd}|otot|t}||_||_||x}|_t&jt&j|j|}|r#||jvr|j||r>tr7t&j|jvr$|jt&jG|jr	d|_dSdS)Nc<g|]}t|t|S)rvr).0r7s  r 
z.build_ext.finalize_options..s6444s$S'224s444r*r:r;FT)r2finalize_optionsrScheck_extensions_listrsetup_shlib_compilerr<r=
_full_namersr?links_to_dynamicr{rvrr|rXr>
_file_namerBrCr`r@rElibrary_dirsappendcurdirruntime_library_dirsr/r0)r5r7rGltdnsrHlibdirs       r rzbuild_ext.finalize_optionss#D)))//R""4?33344do444;	(%%'''?	=	=C!2238<%""4>222(%%d&7888:!--dj999(%%d&7888'9&@&@&J&J###r*cdt|tr|jStj||SN)rvrexport_symbolsr2get_export_symbols)r5r7s  r rzbuild_ext.get_export_symbolss0c7##	&%%,T3777r*c>||j}	t|tr|j|_tj|||jr0|dj	}|
||||_dS#||_wxYw)NrF)_convert_pyx_sources_to_langrrvrrxr2build_extensionrXrRrE
write_stub)r5r7	_compilerrEs    r rzbuild_ext.build_extensions((***M		&#w''
4 $ 3
&tS111
0 66zBBL		3///%DMMMIDM%%%%sA-B	Bctd|jDd|jddddgzt
fd|jDS)z?Return true if 'ext' links to a dynamic lib in the same packagecg|]	}|j
Sr)r)rlibs  r rz.build_ext.links_to_dynamic..s!H!H!HS#.!H!H!Hr*r:Nr;r&c3&K|]}|zvVdSrr)rlibnamelibnamespkgs  r 	z-build_ext.links_to_dynamic..s,JJ3=H,JJJJJJr*)dictfromkeysrr@rr?anyr)r5r7rrs  @@r rzbuild_ext.links_to_dynamics
==!H!HDK!H!H!HIIhhs~++C00"5<==JJJJJCMJJJJJJr*c|jr3t|St	tj||zSr)r0listget_output_mappingkeyssortedr2get_outputs_build_ext__get_stubs_outputsrs r rzbuild_ext.get_outputss\<	://116688999j,T22T5M5M5O5OOPPPr*ch|}tt|dS)z1See :class:`setuptools.commands.build.SubCommand`c|dS)Nrr)xs r z.build_ext.get_output_mapping..s
!A$r*)key)rmrr)r5mappings  r rzbuild_ext.get_output_mappings0**,,F7777888r*cfdjD}tj|}t	d|DS)Nc3K|]?}|j	tjjjg|jdRV@dS)r:N)rXrBrCr@rErr?)rr7r5s  r rz0build_ext.__get_stubs_outputs..se


GLD#.*>*>s*C*CDDD





r*c3&K|]\}}||zV
dSrr)rbasefnexts   r rz0build_ext.__get_stubs_outputs..s*::[T5D5L::::::r*)rS	itertoolsproduct!_build_ext__get_output_extensionsr)r5ns_ext_basespairss`  r __get_stubs_outputszbuild_ext.__get_stubs_outputssj






!,0L0L0N0NOO::E::::::r*c#ZKdVdV|djrdVdSdS)Nr_z.pycrFz.pyo)rRrgrs r __get_output_extensionsz!build_ext.__get_output_extensionssH%%j11:	LLLLL		r*ctjj|g|jdRdz}||||dSr^)rBrCr@rr?rZ)r5
output_dirr7rQ	stub_files     r rzbuild_ext.write_stub!sNGLHcn.B.B3.G.GHHH5P	ig66666r*rc\tjd|j||r1tj|rt
|dz|jst|d}|	d
dddtdzd	tj|j
zd
ddtd
dddtddddddtddddg||r||dSdS)Nz writing stub loader for %s to %sz already exists! Please delete.w
zdef __bootstrap__():z-   global __bootstrap__, __file__, __loader__z0   import sys, os, pkg_resources, importlib.utilz, dlz:   __file__ = pkg_resources.resource_filename(__name__,%r)z   del __bootstrap__z    if '__loader__' in globals():z       del __loader__z#   old_flags = sys.getdlopenflags()z   old_dir = os.getcwd()z   try:z(     os.chdir(os.path.dirname(__file__))z$     sys.setdlopenflags(dl.RTLD_NOW)z3     spec = importlib.util.spec_from_file_location(z#                __name__, __file__)z0     mod = importlib.util.module_from_spec(spec)z!     spec.loader.exec_module(mod)z   finally:z"     sys.setdlopenflags(old_flags)z     os.chdir(old_dir)z__bootstrap__()r&)rinforrBrCrTrropenwriter@r)rDrclose_compile_and_remove_stub)r5rr7rQfs     r rZzbuild_ext._write_stub_file%sR3S^YOOO	Krw~~i00	KI(IIJJJ|	Y$$A
GG		*CF&MM"$g&&s~667+6+?@@.>@AAI9F7!>??,%1


8
GGIII	5)))44444	5	5r*c"ddlm}||gdd|j|dj}|dkr||g|d|jt
j|r|jstj|dSdSdS)Nr)byte_compileT)rgrrre)	distutils.utilrrrRrgrBrCrTunlink)r5rrrgs    r rz"build_ext._compile_and_remove_stubKs//////i[1	7	7	7	7--m<<Ea<<L)x#T\
;
;
;
;
7>>)$$	!T\	!Ii     	!	!	!	!r*N)F) __name__
__module____qualname__r/bool__annotations__r0r3rr	strrNr4rYrrmr>rrrrrrrrrrrrrrZrrr*r r
r
MsM4GT---,Y,5c?,,,,
G
G
G"0	000000
4XeCHo%>44442.###   @KKK6888
&&&KKKQT#YQQQQ
9DcN9999
	;	;	;7777$5$5#$5I$5$5$5$5L
!#
!
!
!
!
!
!r*r
c
R||j|||||||||	|
||

dSr)linkSHARED_LIBRARY)
r5objectsoutput_libnamerrrrrdebug
extra_preargsextra_postargs
build_temptarget_langs
             r rr[sF
	
		.	<1EE=.		
	
	
	
	
r*staticc
,|Jtj|\}}
tj|
\}}|ddr
|dd}||||||dS)Nrr)rBrCr?rwry
startswithcreate_static_lib)r5rrrrrrrrrrrrrHrDr7s                r rrjs!!!!w}}^<<
H((22
#  %%0077	$ |HXz5+	
	
	
	
	
r*)
NNNNNrNNNN)-rBrrimportlib.machineryrimportlib.utilrrhtypingrrrr	distutils.command.build_extr

_du_build_extdistutils.ccompilerrdistutils.sysconfigrr
	distutilsrsetuptools.errorsrsetuptools.extensionrrCython.Distutils.build_extr2
__import__ImportErrorrrr!r'r{rzrr=dlhasattrr)r-rrr*r r
s				



222222CCCCCC............BBBBBB,,,,,,BBBBBBBB''''''33333333BBBBBBJ%&&&&JJJz<<<<<<%%%(
		
<8IIW__
			 'J 7 77	II



"""H!H!H!H!H!
H!H!H!V
'
4GKIMIM	











GGKIMIM	





s$A  A*)A*!B44B<;B<PK!l*command/__pycache__/rotate.cpython-311.pycnu[

,RePbddlmZddlmZddlmZddlZddlZddlm	Z	Gdde	Z
dS))convert_path)log)DistutilsOptionErrorN)Commandc4eZdZdZdZgdZgZdZdZdZ	dS)rotatezDelete older distributionsz2delete older distributions, keeping N newest files))zmatch=mzpatterns to match (required))z	dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepc0d|_d|_d|_dS)N)matchdist_dirkeep)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/rotate.pyinitialize_optionszrotate.initialize_optionss

			c|jtd|jtd	t|j|_n"#t$r}td|d}~wwxYwt|jtr)d|jdD|_|dddS)NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercPg|]#}t|$S)rstrip).0ps  r
z+rotate.finalize_options..(s5,-QWWYY''r,bdist)rr)	r
rrint
ValueError
isinstancestrsplitset_undefined_options)res  rfinalize_optionszrotate.finalize_optionss:&*
9&'MNNN	KDIDII	K	K	K&'BCCJ	Kdj#&&	151A1A#1F1FDJ	
""7,DEEEEEsA
A'A""A'c|dddlm}|jD]"}|jdz|z}|t
j|j|}d|D}|	|
tjdt||||jd}|D]i\}}tjd||jsHt
j|rt#j|Utj|j$dS)Negg_infor)glob*cPg|]#}tj||f$Sr)ospathgetmtime)rfs  rrzrotate.run..4s-===!bg&&q))1-===rz%d file(s) matching %szDeleting %s)run_commandr'r
distributionget_namer*r+joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)rr'patternfilestr-s      rrunz
rotate.run-sE$$$z	%	%G'0022S87BGDdmW==>>E==u===EJJLLLMMOOOH-s5zz7CCC$)**%E
%
%A***|%w}}Q''%
a((((	!

%	%	%rN)
__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsrr$r>rrrrr
sg$$FKLO
FFF$%%%%%rr)distutils.utilr	distutilsrdistutils.errorsrr*r8
setuptoolsrrrrrrJs''''''111111				



6%6%6%6%6%W6%6%6%6%6%rPK!~ţ.command/__pycache__/py36compat.cpython-311.pycnu[

,ReRddlZddlmZddlmZddlmZGddZeejdrGddZdSdS)	N)glob)convert_path)sdistcXeZdZdZdZedZdZdZdZ	dZ
dZd	Zd
Z
dS)sdist_add_defaultsz
    Mix-in providing forward-compatibility for functionality as found in
    distutils on Python 3.7.

    Do not edit the code in this class except to update functionality
    as implemented in distutils. Instead, override in the subclass.
    c|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/py36compat.pyadd_defaultszsdist_add_defaults.add_defaultss	
$$&&&##%%%!!###%%'''   !!###""$$$$$ctj|sdStj|}tj|\}}|tj|vS)z
        Case-sensitive path existence check

        >>> sdist_add_defaults._cs_path_exists(__file__)
        True
        >>> sdist_add_defaults._cs_path_exists(__file__.upper())
        False
        F)ospathexistsabspathsplitlistdir)fspathr	directoryfilenames    r_cs_path_existsz"sdist_add_defaults._cs_path_exists&s_w~~f%%	5'//&)) gmmG44	82:i0000rc|j|jjg}|D]}t|trj|}d}|D]5}||rd}|j|n6|s+|dd	|z||r|j||d|zdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
READMESdistributionscript_name
isinstancetuplerfilelistappendwarnjoin)r	standardsfnaltsgot_its     rr	z*sdist_add_defaults._add_defaults_standards7s\4#4#@A		C	CB"e$$
CB++B//!%
,,R000
/IIL"iioo.///''++CM((,,,,II4==99EM  ''''	(	(rcR|d}|jr,|j||jD]D\}}}}|D]:}|jtj	
||;EdS)Nbuild_py)get_finalized_commandr!has_pure_modulesr%r0get_source_files
data_filesr&rrr()rr5pkgsrc_dir	build_dir	filenamesrs       rrz'sdist_add_defaults._add_defaults_pythonRs--j99--//	>M  !:!:!>!,,4 M003334
	4
	4
4
4rc|jrC|d}|j|dSdS)N	build_ext)r!has_ext_modulesr6r%r0r8)rrEs  rr
z$sdist_add_defaults._add_defaults_extss^,,..	?22;??IM  !;!;!=!=>>>>>	?	?rc|jrC|d}|j|dSdS)N
build_clib)r!has_c_librariesr6r%r0r8)rrHs  rrz'sdist_add_defaults._add_defaults_c_libsxsa,,..	@33LAAJM  !!>?????	@	@rc|jrC|d}|j|dSdS)N
build_scripts)r!has_scriptsr6r%r0r8)rrKs  rrz(sdist_add_defaults._add_defaults_scripts}sa((**	C 66GGMM  !?!?!A!ABBBBB	C	CrN)__name__
__module____qualname____doc__rstaticmethodrr	r
rrr
rrrrrrs%%%,11\1 CCC*(((FFF 444"???
@@@
CCCCCrrr	ceZdZdS)rN)rMrNrOrRrrrrsr)rrdistutils.utilrdistutils.commandrrhasattrrRrrrWs				''''''######yCyCyCyCyCyCyCyCx75;122












rPK!&g4**+command/__pycache__/develop.cpython-311.pycnu[

,RedddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddl
Z
GddejeZGd	d
ZdS))convert_path)log)DistutilsErrorDistutilsOptionErrorN)easy_install)
namespacesceZdZdZdZejddgzZejdgzZdZdZ	dZ
d	Zed
Z
dZdZd
ZdZdS)developzSet up package for developmentz%install package in 'development mode')	uninstalluzUninstall this source package)z	egg-path=Nz-Set the path to be used in the .egg-link filerFc|jr0d|_||n||dS)NT)r
multi_versionuninstall_linkuninstall_namespacesinstall_for_developmentwarn_deprecated_optionsselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/develop.pyrunzdevelop.runse>	+!%D!!!%%''''((***$$&&&&&cfd|_d|_tj|d|_d|_dS)N.)regg_pathrinitialize_options
setup_pathalways_copy_fromrs rrzdevelop.initialize_options%s6
'--- #rc	(|d}|jr"d}|j|jf}t||z|jg|_t
j|||	|j
tjd|jdz}tj|j||_|j|_|j)tj|j|_t+j|j}t+jtj|j|j}||krt/d|zt+j|t+j|tj|j|j|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz	.egg-linkzA--egg-path must be a relative path from the install directory to project_name)get_finalized_commandbroken_egg_inforregg_nameargsrfinalize_optionsexpand_basedirsexpand_dirs
package_indexscanglobospathjoininstall_diregg_linkegg_baserabspath
pkg_resourcesnormalize_pathrDistributionPathMetadatadist_resolve_setup_pathr)reitemplater%egg_link_fntargetrs       rr&zdevelop.finalize_options,s

'
'

3
3
	2FH; 22D D111[M	%d+++	' 2 2333kK/T%5{CC

= GOOBK88DM-dm<< /GLL)4=99

v&!#)*
".&vrwr{/K/KLL


	22MM

rc|tjdd}|tjkrd|ddzz}t
jtj	|||}|t
jtjkr-td|t
jtj|S)z
        Generate a path from egg_base back to '.' where the
        setup script resides and ensure that path points to the
        setup path from $install_dir/$egg_path.
        /z../zGCan't get a consistent path to setup script from installation directory)replacer,seprstripcurdircountr3r4r-r.r)r1r/r
path_to_setupresolveds     rr8zdevelop._resolve_setup_pathWs!((55<>

}3BI>>>>&*,RY77	
rcT|d|dd|dtjr+|tjdt_|t
jd|j|j	|j
sRt|jd5}||j
dz|jzdddn#1swxYwY|d|j|jdS)Nr	build_extr?)inplacezCreating %s (link to %s)w
)run_commandreinitialize_command
setuptoolsbootstrap_install_fromrinstall_namespacesrinfor0r1dry_runopenwriterrprocess_distributionr7no_deps)rfs  rrzdevelop.install_for_developmentmsb$$$	
!!+q!999%%%,	5j?@@@04J-!!!	+T]DMJJJ|	@dmS))
@Q
,t>???
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@	
!!$	t|3CDDDDDs	&C;;C?C?ctj|jrt	jd|j|jt|j}d|D}|||j	g|j	|j
gfvrt	jd|dS|jstj
|j|js||j|jjrt	jddSdS)NzRemoving %s (link to %s)c6g|]}|S)rB).0lines  r
z*develop.uninstall_link..s @@@$

@@@rz$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r,r-existsr0rrQr1rScloserrwarnrRunlink
update_pthr7distributionscripts)r
egg_link_filecontentss   rrzdevelop.uninstall_links
7>>$-((		)H/
NNN //M@@-@@@H!!!$-1QRRR?JJJ<
)	$-(((|	'OODI&&&$	NHLMMMMM	N	Nrc||jurtj||S|||jjpgD]}tjt|}tj
|}tj|5}|
}dddn#1swxYwY|||||dSN)r7rinstall_egg_scriptsinstall_wrapper_scriptsrcrdr,r-r2rbasenameiorSreadinstall_script)rr7script_namescript_pathstrmscript_texts      rrizdevelop.install_egg_scriptssty  3D$???
	
$$T*** ,4:	M	MK'//,{*C*CDDK'**;77K%%
*"iikk
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*k;LLLL	M	Ms#CC	C	cJt|}tj||Srh)VersionlessRequirementrrjrr7s  rrjzdevelop.install_wrapper_scriptss"%d++3D$???rN)__name__
__module____qualname____doc__descriptionruser_optionsboolean_optionscommand_consumes_argumentsrrr&staticmethodr8rrrirjrZrrr
r
s((9K,;L0L
#2k]BO!&'''$$$)
)
)
V\*EEE,NNN"MMM$@@@@@rr
c$eZdZdZdZdZdZdS)rta
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.

    >>> from pkg_resources import Distribution
    >>> dist = Distribution(project_name='foo', version='1.0')
    >>> str(dist.as_requirement())
    'foo==1.0'
    >>> adapted_dist = VersionlessRequirement(dist)
    >>> str(adapted_dist.as_requirement())
    'foo'
    c||_dSrh)_VersionlessRequirement__distrus  r__init__zVersionlessRequirement.__init__s
rc,t|j|Srh)getattrr)rnames  r__getattr__z"VersionlessRequirement.__getattr__st{D)))rc|jSrhr rs ras_requirementz%VersionlessRequirement.as_requirements  rN)rvrwrxryrrrrZrrrtrtsK***!!!!!rrt)distutils.utilr	distutilsrdistutils.errorsrrr,r+rlr3setuptools.command.easy_installrrNrDevelopInstallerr
rtrZrrrs
''''''AAAAAAAA								888888!!!!!!Z@Z@Z@Z@Z@j)<Z@Z@Z@z!!!!!!!!!!rPK!+/d/d-command/__pycache__/bdist_egg.cpython-311.pycnu[

,Re@bdZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZddlmZddlmZd	d
lmZddlmZmZdZd
ZdZdZGddeZed Z!dZ"dZ#dZ$dddZ%dZ&dZ'dZ(gdZ)		d dZ*dS)!z6setuptools.command.bdist_egg

Build .egg distributions)remove_treemkpath)log)CodeTypeN)get_build_platformDistribution)Library)Command)ensure_directory)get_pathget_python_versionc tdS)Npurelib)r
/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/bdist_egg.py_get_purelibrsIrcd|vr%tj|d}|dr
|dd}|S)N.rmodulei)ospathsplitextendswith)filenames rstrip_modulersM
h7##H--a0""!CRC=Orc#Ktj|D]5\}}}|||||fV6dS)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)rwalksort)dirbasedirsfiless    rsorted_walkr%"s` WS\\  dE		

D%  rctjd}t|d5}|||zddddS#1swxYwYdS)Na
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, importlib.util
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __loader__ = None; del __bootstrap__, __loader__
            spec = importlib.util.spec_from_file_location(__name__,__file__)
            mod = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(mod)
        __bootstrap__()
        w)textwrapdedentlstripopenwrite)resourcepyfile_stub_templatefs    r
write_stubr1,s_
&



VXX
fc		+a	)***++++++++++++++++++sAA!$A!ceZdZdZddddezfdddd	gZgd
ZdZdZd
Z	dZ
dZdZdZ
dZdZdZdZdS)	bdist_eggzcreate an "egg" distribution)z
bdist-dir=bz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))exclude-source-filesNz+remove all .py files from the generated egg)	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=dz-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))r7r:r6chd|_d|_d|_d|_d|_d|_d|_dS)Nr)	bdist_dir	plat_name	keep_tempdist_dir
skip_build
egg_outputexclude_source_filesselfs rinitialize_optionszbdist_egg.initialize_optionsSs:
$(!!!rc	b|dx}|_|j|_|j?|dj}t
j|d|_|jt|_|
dd|jtdd|j
|jt|jo|j
}t
j|j|dz|_dSdS)Negg_infobdistegg)r?r?z.egg)get_finalized_commandei_cmdrGr<
bdist_baserrjoinr=rset_undefined_optionsrAregg_nameegg_versionrdistributionhas_ext_modulesr?)rDrKrLbasenames    rfinalize_optionszbdist_egg.finalize_options\s	#99*EEE
>!33G<<GJW\\*e<!/11DN""7,DEEE?"$dFOV-?"$$!1133Fhjj	
!gll4=(V:KLLDOOO#"rc|j|d_tjtjt}|jj	gc}|j_	|D]}t|trt|dkrtj
|drtj|d}tj|}||ks"||tjzr"|t|dzd|df}|jj	|	t#jd|j|ddd||j_	dS#||j_	wxYw)Ninstallrrzinstalling package data to %sinstall_data)forceroot)r<rJinstall_librrnormcaserealpathrrQ
data_files
isinstancetuplelenisabs
startswithsepappendrinfocall_command)rD
site_packagesolditemr]
normalizeds      rdo_install_datazbdist_egg.do_install_datats<@N""9--9(()9)9,..)I)IJJ
,0,=,H")T

)
	6
	6D$&&
J3t99>>7==a))J!w//Q88H!#!1!1(!;!;J!]22j6K6K%.772 (M(:(:Q(>(?(?@$q'I(//5555	/H4dnEEEnADAAA+.D(((3D(....s2GGc|jgS)N)rArCs rget_outputszbdist_egg.get_outputss
  rctD]}|||j|d|j|d|j|j|fi|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr@dry_run)INSTALL_DIRECTORY_ATTRS
setdefaultr<r@rpreinitialize_commandrun_command)rDcmdnamekwdirnamecmds     rrgzbdist_egg.call_commands.	3	3GMM'4>2222


lDO444


i...'d'66266!!!
rc	|dtjd|j|d}|j}d|_|jr|js|d|	dd}||_|
\}}g|_g}t|D]\}}tj|\}	}
tj|jt#|	dz}|j|tjd	||js-t)tj|||||tjd
||<|r|||jjr||j}tj|d}
||
|jjrMtj|
d}tjd
||	d|d||
tj|
d}|rtjd||jspt=|t?|d}| d|| d|!nOtj"|r0tjd||jstj#|tItj|d|%tj&tj|j'drtj(d|j)r|*tW|j,||j-|j|.|j/sta|j|jtc|jdgdte|j,fdS)NrGzinstalling library code to %srV
build_clibr[r)warn_dir.pyzcreating stub loader for %s/EGG-INFOscriptszinstalling scripts to %sinstall_scriptsrW)install_dirno_epznative_libs.txtz
writing %swt
zremoving %szdepends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)verboserpmoderp
dist_filesr3)3rtrrfr<rJrZrQhas_c_librariesr@rgget_ext_outputsstubs	enumeraterrrrMrrerpr1rSreplacerdbyte_compiler^rlrrcopy_metadata_torr+r,closeisfileunlinkwrite_safety_flagzip_safeexistsrGwarnrBzap_pyfilesmake_zipfilerAr
gen_headerr>rgetattrr)rDinstcmdold_rootrxall_outputsext_outputs
to_compiler5ext_namerextr.archive_rootrG
script_dirnative_libs	libs_files                 rrunz
bdist_egg.runs$$$	0$.AAA,,Y77<,,..	+t	+\***
::#'#7#7#9#9 [

&{33		;		;MQG,,X66MHcW\\$.,x2H2H"'3())FJf%%%H2H===<
?27++H55v>>>f%%%%--bfc::KNN	)Z((('	#  """~7<<j99H$	'h	::JH/<<</Z$%

'
'
'	
h'''gll8->??	'H\;///<
" --- d33			+ 6 6777%%%!!!
W^^K
(
(	'H]K000<
'	+&&&GLLz22DMMOO	
	
	
7>>"',,t}mDDEE	HP



$		T_lDL!\0A0A	C	C	C	C~	>====	!<44;;
,..@	B	B	B	B	Brc	tjdt|jD]1\}}}|D]&}tj||}|dr)tjd|t	j	||dr|}d}tj||}tj|tj|
ddz}	tjd|d	|	d
	t	j|	n#t$rYnwxYwt	j||	(3dS)Nz+Removing .py files from temporary directoryr|zDeleting %s__pycache__z#(?P.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [z] to [])rrfwalk_eggr<rrrMrdebugrrematchpardirgroupremoveOSErrorrename)
rDr"r#r$rrpath_oldpatternmpath_news
          rrzbdist_egg.zap_pyfilessj>???!)$.!9!9	2	2D$
2
2w||D$//==''$ImT222IdOOO==//2#HDG$//A!w||bi6)A C CHHH#88XXX/000	(++++"Ih111+
2	2	2sD33
E?Ect|jdd}||Stjdt	|j|jS)Nrz4zip_safe flag not set; analyzing archive contents...)rrQrranalyze_eggr<r)rDsafes  rrzbdist_egg.zip_safesFt(*d;;KGHHH4>4:666rcdS)Nr'rrCs rrzbdist_egg.gen_headerssrctj|j}tj|d}|jjjD]q}||rZtj||t|d}t||||rdS)z*Copy metadata (egg info) to the target_dirN)rrnormpathrGrMrKfilelistr$rcrar	copy_file)rD
target_dir
norm_egg_infoprefixrtargets      rrzbdist_egg.copy_metadata_tos((77
mR00K(.	-	-Dv&&
-j$s6{{||2DEE (((tV,,,		-	-rcg}g}|jdi}t|jD]\}}}|D]^}tj|dtvr||||z_|D]1}|||zdz|tj||<2|j	
r|d}|jD]}	t|	tr||	j}
||
}tj|dsWtjtj|j|r||||fS)zAGet a list of relative paths to C extensions in the output distrorrWr}	build_extzdl-)r<r%rrrlowerNATIVE_EXTENSIONSrerMrQrRrJ
extensionsr_r	get_ext_fullnamerget_ext_filenamerSrcr)rDrrpathsr"r#r$r	build_cmdrfullnames           rrzbdist_egg.get_ext_outputss$!,T^!>> 
G
G78&L&LMM5#**8444K''rN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrErTrlrnrgrrrrrrrrrr3r3<s2K	>	s,.@.@.B.BC	D	8	.	:	?L O)))MMM0///2!!!OBOBOBb2224777
-
-
-(((((rr3z.dll .so .dylib .pydc#Kt|}t|\}}}d|vr|d|||fV|D]}|VdS)z@Walk an unpacked egg's contents, skipping the metadata directoryr~N)r%nextr)egg_dirwalkerr"r#r$bdfs      rrr;sy

!
!FVD$TJ
e
				rctD]G\}}tjtj|d|r|cSHt
sdSd}t|D]t\}}}|D]k}|ds|dr-|ds|drt||||o|}lu|S)Nr~FTr|z.pywrz.pyo)
safety_flagsitemsrrrrMcan_scanrrscan_module)	rrflagfnrr"r#r$rs	         rrrFs &&((b
7>>"',,w
B??@@	KKK	::uD%g..HHdE	H	HD}}U##
Ht}}V'<'<
Hv&&
H$--*?*?
H"7D$>>G4	HKrctD]\}}tj||}tj|r*|t
||krtj|n|Lt
||kr9t|d}|	d|
dS)Nrr)rrrrrMrboolrr+r,r)rrrrr0s     rrrXs &&((b
W\\'2
&
&
7>>"	|tDzzT11	"




$t**"4"4RA
GGDMMM
GGIIIrzzip-safeznot-zip-safe)TFctj||}|dd|vrdS|t|dzdtjd}||rdpdztj|dz}tjdkrd	}nd
}t|d}|
|tj|}	|
d}
tt!|	}dD]}||vrt#jd
||d}
d|vr!dD]}||vrt#jd||d}
|
S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrWrrr)rb)__file____path__z%s: module references %sFinspect)	getsource
getabsfile
getsourcefilegetfilegetsourcelines
findsourcegetcommentsgetframeinfogetinnerframesgetouterframesstacktracez"%s: module MAY be using inspect.%s)rrrMrarrdrsysversion_infor+readmarshalloadrdictfromkeysiter_symbolsrr)
rr"rrrpkgrskipr0codersymbolsbads
             rrrksuw||D$''H}t
s7||a  
!
)
)"&#
6
6C
CKC%2
&)9)9$)?)?)B
BF
&  XtAFF4LLL<??DGGIIIDmmL..//G''>>H/===DG
		C
g~~=vsKKKKrc#K|jD]}|V|jD]G}t|tr|Vt|trt|D]}|VHdS)zBYield names and strings used by `code` and its nested code objectsN)co_names	co_constsr_strrr)rrconsts   rrrs




eS!!	KKKK
x
(
(	$U++





rctjdstjdkrdStjdtjddS)NjavacliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py)rplatformrcrrrrrrrse<""6**s|u/D/DtH
@AAAHIJJJJJr)r[rrXinstall_baseTr'cddl}ttj|tjd|fd}|r|jn|j}sP|	|||}	tD]\}
}}||	|
||	n#tD]\}
}}|d|
||S)aqCreate a zip file from all the files under 'base_dir'.  The output
    zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
    Python module (if available) or the InfoZIP "zip" utility (if installed
    and found on the default search path).  If neither tool is available,
    raises DistutilsExecError.  Returns the name of the output zip file.
    rNrz#creating '%s' and adding '%s' to itcX|D]}tjtj||}tj|rG|tdzd}s|||tjd|dS)NrWzadding '%s')	rrrrMrrar,rr)zrwnamesrrr5base_dirrps      rvisitzmake_zipfile..visits	,	,D7##BGLL$$?$?@@Dw~~d##
,X*++,%GGD!$$$	-+++
	,	,r)compression)zipfilerrrrwrrfZIP_DEFLATED
ZIP_STOREDZipFiler%r)
zip_filenamerrrpcompressrrrrrrwr#r$s
 ` `         rrrsNNN
27??<(('::::H
2L(KKK,,,,,,+3J'&&8JK(OOL$KOHH$/$9$9	%	% GT5E!We$$$$					$/$9$9	(	( GT5E$''''r)rrTr')+__doc__distutils.dir_utilrr	distutilsrtypesrrrrr(r
pkg_resourcesrrsetuptools.extensionr	
setuptoolsr
_pathr	sysconfigr
rrrr%r1r3rrsplitrrrrrrrrrqrrrrr's32222222



								::::::::(((((($$$$$$22222222   
+
+
+ y(y(y(y(y(y(y(y(xMM"8">">"@"@AA$


D			JJJ
IMrPK!w3command/__pycache__/install_scripts.cpython-311.pycnu[

,Re4
ddlmZddlmcmZddlmZddlZddl	Z	ddl
mZmZddl
mZGddejZdS)	)logN)DistutilsModuleError)DistributionPathMetadata)ensure_directoryc&eZdZdZdZdZddZdS)install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscRtj|d|_dS)NF)origr
initialize_optionsno_ep)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/install_scripts.pyr
z"install_scripts.initialize_optionss$//555


cXddlmcm}|d|jjr tj|ng|_	|j
rdS|d}t|j
t|j
|j|j|j}|d}t%|dd}	|d}t%|dd}n#t&t(f$rd}YnwxYw|j}|r	d}|j}|t.jkr|g}|}|j|}	|||	D]}
|j|

dS)	Nregg_info
build_scripts
executable
bdist_wininst_is_runningFz
python.exe)setuptools.command.easy_installcommandeasy_installrun_commanddistributionscriptsrr
runoutfilesrget_finalized_commandregg_baserregg_nameegg_versiongetattrImportErrorrScriptWriterWindowsScriptWritersysrbestcommand_spec_class
from_paramget_args	as_headerwrite_script)reiei_cmddistbs_cmd
exec_parambw_cmd
is_wininstwritercmdargss           rrzinstall_scripts.runs444444444$$$$	 $$T****DM:	F++J77O\&/6?KKOV/

++O<<V\488
	//@@F >>JJ12			JJJ		,%J+F''%J',,..99*EEOOD#--//::	%	%DDt$$$	%	%s&C77D
D
tcddlm}m}tjd||jtj|j|}|j	
||}|js\t|t|d|z}	|	||	||d|z
dSdS)z1Write an executable file to the scripts directoryr)chmod
current_umaskzInstalling %s script to %swiN)rr;r<rinfoinstall_dirospathjoinrappenddry_runropenwriteclose)
rscript_namecontentsmodeignoredr;r<targetmaskfs
          rr.zinstall_scripts.write_script8sHHHHHHHH-{DrYs000000000111111				



44444444$$$$$$;(;(;(;(;(d*;(;(;(;(;(rPK!rsq,,,,,,111111
'
'
'
'
'T[
'
'
'
'
'rPK!kZ9Z9(command/__pycache__/test.cpython-311.pycnu[

,ReddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZddlmZddlmZdd	lmZdd
lmZGddeZGd
dZGddeZdS)N)DistutilsErrorDistutilsOptionError)log)
TestLoader)resource_listdirresource_existsnormalize_pathworking_setevaluate_markeradd_activation_listenerrequire)metadata)Command)unique_everseen)	pass_noneceZdZdZddZdS)ScanningLoadercTtj|t|_dSN)r__init__set_visitedselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/test.pyrzScanningLoader.__init__s"D!!!


Nc||jvrdS|j|g}|tj||t|dr'||t|drt|jdD]}|	dr|dkr|jdz|ddz}n't|j|d	zr|jdz|z}nZ|||t|d
kr|
|S|dS)aReturn a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        Nadditional_tests__path__z.pyz__init__.py.z/__init__.pyr)raddappendrloadTestsFromModulehasattrrr__name__endswithrloadTestsFromNamelen
suiteClass)rmodulepatterntestsfile	submodules      rr'z"ScanningLoader.loadTestsFromModulesfT]""4
&!!!
Z3D&AABBB6-..	4LL00223336:&&		@("==
@
@==''!DM,A,A &# 5SbS	 AII&v~8MNN!$*Oc$9D$@		 T33I>>????u::????5)))8Orr)r)
__module____qualname__rr'rrrrs7rrceZdZdZddZdS)NonDataPropertyc||_dSrfget)rr:s  rrzNonDataProperty.__init__Cs
			rNc4||S||Srr9)robjobjtypes   r__get__zNonDataProperty.__get__Fs;Kyy~~rr)r)r3r4rr>r5rrr7r7Bs7rr7ceZdZdZdZgdZdZdZedZ	dZ
dZej
gfd	Zeej
d
ZedZdZd
ZedZeedZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated)))ztest-module=mz$Run 'test_suite' in specified module)ztest-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=rzTest runner to usec>d|_d|_d|_d|_dSr)
test_suitetest_moduletest_loadertest_runnerrs rinitialize_optionsztest.initialize_options[s'rcJ|jr|jrd}t||j(|j|jj|_n|jdz|_|jt|jdd|_|jd|_|jt|jdd|_dSdS)Nz1You may specify a module or a suite, but not bothz.test_suiterGz&setuptools.command.test:ScanningLoaderrH)rErFrdistributionrGgetattrrH)rmsgs  rfinalize_optionsztest.finalize_optionsas?	,t/	,EC&s+++?"'"&"3">"&"2]"B#&t'8-NND#GD#&t'8-NND$#rcDt|Sr)list
_test_argsrs r	test_argsztest.test_argstsDOO%%&&&rc#ZK|jsdV|jrdV|jr|jVdSdS)Ndiscoverz	--verbose)rEverbosers rrQztest._test_argsxsZ	<	?	"/!!!!!	"	"rct|5|ddddS#1swxYwYdS)zI
        Backward compatibility for project_on_sys_path context.
        N)project_on_sys_path)rfuncs  rwith_project_on_sys_pathztest.with_project_on_sys_paths
%
%
'
'		DFFF																		s-11c#K|d|dd|d|d}tjdd}tj}	t|j}tj	d|tjtdt|jd|j||g5dVdddn#1swxYwY|tjdd<tjtj|tjdS#|tjdd<tjtj|tjwxYw)Negg_info	build_extr$)inplacerc*|Sr)activate)dists rz*test.project_on_sys_path..srz==)run_commandreinitialize_commandget_finalized_commandsyspathmodulescopyr	egg_baseinsertr
rrr
egg_nameegg_versionpaths_on_pythonpathclearupdate)r
include_distsei_cmdold_pathold_modulesproject_paths      rrWztest.project_on_sys_paths$$$	
!!+q!999%%%++J778AAA;k&&((	#)&/::LHOOA|,,, """#$@$@AAA1C1CDEEE))<.99
















#CHQQQKKK{+++ """""#CHQQQKKK{+++ """"s2BFD(F(D,,F/D,0FA#G9c#hKt}tjd|}tjdd}	tjt
|}td||g}tj|}|r|tjd<dV||ur"tjdddS|tjd<dS#||ur!tjddn|tjd<wxYw)z
        Add the indicated paths to the head of the PYTHONPATH environment
        variable so that subprocesses will also see the packages at
        these paths.

        Do this in a context that restores the value on exit.
        
PYTHONPATHr!N)	objectosenvirongetpathsepjoinrfilterpop)pathsnothingorig_pythonpathcurrent_pythonpathprefixto_joinnew_paths       rrmztest.paths_on_pythonpaths((*..w??Z^^L"==	;Z___U%;%;<#?@@Gzw//H
4+3
<(EEE'))
|T22222+:
<((('))
|T2222+:
<(::::s
A2C;;6D1c||j}||jpg}|d|jD}tj|||S)z
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        c3xK|]5\}}|dt|dd1|V6dS):r$N)
startswithr).0kvs   r	z%test.install_dists..sf%
%
1||C  %
&5QqrrU%;%;%

%
%
%
%
%
%
r)fetch_build_eggsinstall_requires
tests_requireextras_requireitems	itertoolschain)r`ir_dtr_der_ds    r
install_distsztest.install_distss$$T%:;;$$T%7%=2>>$$%
%
+1133%
%
%



tT4000rc@|dtj||j}d|j}|jr|d|zdS|d|zttj
d|}||5|5|
dddn#1swxYwYddddS#1swxYwYdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)zrunning "%s"location)announcerWARNrrKr|_argvdry_runmapoperator
attrgetterrmrW	run_tests)rinstalled_distscmdrs    rrunztest.runs



H	
	
	
,,T->??hhtz""<	MM3c9:::F

ns*+++H'
33_EE

%
%e
,
,	!	!))++
!
!   
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!s6DC;/D;C?	?DC?	DDDc	Htjdd|j||j||jd}|js9d|jz}||tj
t|dS)NF)
testLoader
testRunnerexitzTest failed: %s)unittestmainr_resolve_as_eprGrHresult
wasSuccessfulrrERRORr)rr@rMs   rrztest.run_testss}J**4+;<<**4+;<<



{((**	&#dk1CMM#sy))) %%%	&	&rcdg|jzS)Nr)rRrs rrz
test._argvs|dn,,rcdtj|ddS)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        N)valuenamegroup)r
EntryPointload)vals rrztest._resolve_as_eps1Lx"4tDDDIIKKMMMrN)r)r3r4__doc__descriptionuser_optionsrIrNr7rRrQrY
contextlibcontextmanagerrWstaticmethodrmrrrpropertyrrrr5rrr@r@LsX88DKL   OOO&''_'"""02####4;;\;011\1!!!.&&&--X-NNY\NNNrr@)rxrrerrrdistutils.errorsrr	distutilsrr
pkg_resourcesrrr	r
rrr

_importlibr
setuptoolsr setuptools.extern.more_itertoolsr"setuptools.extern.jaraco.functoolsrrr7r@r5rrrs				



AAAAAAAA"!!!!!<<<<<<888888$$$$$Z$$$PoNoNoNoNoN7oNoNoNoNoNrPK!73;+command/__pycache__/install.cpython-311.pycnu[

,Re+ddlmZddlZddlZddlZddlZddlmcmZ	ddl
Z
e	jZGdde	jZde	jjDej
ze_dS))DistutilsArgErrorNceZdZdZejjddgzZejjddgzZddfdd	fgZe	eZ
d
ZdZdZ
d
ZedZdZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrinstall_egg_infocdSNTselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/install.pyzinstall.s$install_scriptscdSr
rrs rrzinstall.srctjdtjtj|d|_d|_dS)NzRsetup.py install is deprecated. Use build and pip and other standards-based tools.)	warningswarn
setuptoolsSetuptoolsDeprecationWarningorigrinitialize_optionsold_and_unmanageable!single_version_externally_managedrs rrzinstall.initialize_options sP

A3	
	
	
	
''---$(!15...rctj||jr	d|_dS|jr|js|jst
ddSdSdS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrrs rrzinstall.finalize_options,s%%d+++9	59D222

3	9
T[
' 		



rc||js|jrtj|Sd|_d|_dS)N)rrrrhandle_extra_path	path_file
extra_dirsrs rr"zinstall.handle_extra_path7s@9	8>	8<11$777rc|js|jrtj|S|t
js!tj|dS|dS)N)	rrrrrun_called_from_setupinspectcurrentframedo_egg_installrs rr&zinstall.runAs$	*(N	*<##D)))&&w';'='=>>	"LT"""""!!!!!rc|Ed}tj|tjdkrd}tj|dSt	j|}|ddD]a}|dd\}t	j|}|jd	d
}|dkr|j	dkrO|d
ko
|j	dkcSdS)a
        Attempt to detect whether run() was called from setup() or by another
        command.  If called by setup(), the parent caller will be the
        'run_command' method in 'distutils.dist', and *its* caller will be
        the 'run_commands' method.  If called any other way, the
        immediate caller *might* be 'run_command', but it won't have been
        called by 'run_commands'. Return True in that case or if a call stack
        is unavailable. Return False otherwise.
        Nz4Call stack not available. bdist_* commands may fail.
IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__r!zsetuptools.distrun_commandzdistutils.distrun_commands)
rrplatformpython_implementationr(getouterframesgetframeinfo	f_globalsgetfunction)	run_framemsgframesframecallerinfo
caller_modules       rr'zinstall._called_from_setupLsHCM#-//<??N
c"""4'	22AaC[		EBQBiGF'//D",00R@@M 111dm}6T6T!114M^3


		rc|jd}||jd|j|j}|d|_|jtjd|	d|j
djg}tj
r |dtj
||_|d	dt_
dS)
Neasy_installx)argsrr.z*.egg	bdist_eggrF)show_deprecation)distributionget_command_classrrensure_finalizedalways_copy_from
package_indexscanglobr1get_command_obj
egg_outputrbootstrap_install_frominsertrDr&)r
rBcmdrDs    rr*zinstall.do_egg_installns(::>JJlCdi


	"	ty11222%%%!11+>>IJ,	>KK:<===''',0
)))rN)r0
__module____qualname____doc__rruser_optionsboolean_optionsnew_commandsdict_ncrrr"r&staticmethodr'r*rrrrrsAA<,>	B0L
l2 C6O
../	--.L$|

C
6
6
6				"	"	"\B11111rrc:g|]}|dtjv|S)r)rr[).0rSs  r
r_s(KKKSQw{1J1JS1J1J1Jr)distutils.errorsrr(rNrr3distutils.command.installcommandrrr_installsub_commandsrYrrrres......(((((((((<u1u1u1u1u1dlu1u1u1tLKDL-KKKrPK!A0,command/__pycache__/__init__.cpython-311.pycnu[

,ReddlmZddlZdejvr;	dejd<n/#e$r'dejd<ejdYnwxYw[[dS))bdistNegg)	bdist_eggzPython .egg file)distutils.command.bdistrsysformat_commands	TypeErrorformat_commandappend/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/__init__.pyrs))))))



%%%,'He$$,,,&GU#
$$U+++++,

333s
 )AAPK!da2command/__pycache__/editable_wheel.cpython-311.pycnu[

,Rey
dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZmZmZmZmZmZmZmZmZmZdd
lm Z m!Z!m"Z"m#Z#ddl$m%Z&ddl'm(Z(dd
l)m*Z*erddl+m,Z,ej-dkrddlm.Z.nerddl/m.Z.nddl0m1Z.ee2efZ3ede3Z4ej5e6Z7GddeZ8dZ9dZ:Gdde Z;Gdde.Z<GddZ=Gdde=Z>Gd d!Z?d"ed#e@fd$ZAd%ee2d&ee2e2fd'ed#e@fd(ZBd)ZCd*e*d#ee2fd+ZDd*e*d#ee2fd,ZEd%ee2d&ee2e2fd-e3d#ee2e2ffd.ZFd/e3d#e2fd0ZGd1ee2e2fd#ee2fd2ZHd%ee2d1ee2e2fd#eee2ee2ffd3ZId1ee2e2fd#ee2e2ffd4ZJd5e2d6e2d7e2d8e2d#e@f
d9ZKd:e3d#e2fd;ZLde2d#e2fd?ZNGd@dAe#jOZPdBZQd>e2dCee2e2fdDee2ee2fd#e2fdEZRGdFdGeSZTGdHdIe"jUZVdS)Ja
Create a wheel that, when installed, will make the source package 'editable'
(add it to the interpreter's path, including metadata) per PEP 660. Replaces
'setup.py develop'.

.. note::
   One of the mechanisms briefly mentioned in PEP 660 to implement editable installs is
   to create a separated directory inside ``build`` and use a .pth file to point to that
   directory. In the context of this file such directory is referred as
   *auxiliary build directory* or ``auxiliary_dir``.
N)suppress)Enum)cleandoc)chain)Path)TemporaryDirectory)

TYPE_CHECKINGDictIterableIteratorListMappingOptionalTupleTypeVarUnion)CommandSetuptoolsDeprecationWarningerrors
namespaces)build_pyfind_package_path)Distribution	WheelFile))Protocol)ABC_P)boundcJeZdZdZdZdZdZedee	ddfdZ
dS)	
_EditableModea
    Possible editable installation modes:
    `lenient` (new files automatically added to the package - DEFAULT);
    `strict` (requires a new installation when files are added/removed); or
    `compat` (attempts to emulate `python setup.py develop` - DEPRECATED).
    strictlenientcompatmodereturnc|stjS|}|tjvrt	jd|d|dkrd}t
j|tt|S)NzInvalid editable mode: z. Try: 'strict'.COMPATax
            The 'compat' editable mode is transitional and will be removed
            in future versions of `setuptools`.
            Please adapt your code accordingly to use either the 'strict' or the
            'lenient' modes.

            For more information, please check:
            https://setuptools.pypa.io/en/latest/userguide/development_mode.html
            )	r$LENIENTupper__members__rOptionErrorwarningswarnr)clsr(_modemsgs    /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/editable_wheel.pyconvertz_EditableMode.convertGs}	) ((


111$%Wt%W%W%WXXXHC
M#;<<<U##N)__name__
__module____qualname____doc__STRICTr,r+classmethodrstrr6r7r5r$r$;s_FG
F$8C=$_$$$[$$$r7r$zU
New or renamed files may not be automatically picked up without a new installation.
zt
Options like `package-data`, `include/exclude-package-data` or
`packages.find.exclude/include` may have no effect.
cVeZdZdZdZddddeejpdfgZdZd	Z	d
Z
dZdZd
e
efdZdedededefdZdZd
eeeeeefffdZdedededed
eeeeeefff
dZdZdefdZdZdefdZdededed
dfd ZdS)!editable_wheelzkBuild 'editable' wheel for development.
    (This command is reserved for internal use of setuptools).
    z!create a PEP 660 'editable' wheel)z	dist-dir=dz-directory to put final built distributions in)zdist-info-dir=Iz(path to a pre-build .dist-info directoryzmode=Nc>d|_d|_d|_d|_dSN)dist_dir
dist_info_dirproject_dirr(selfs r5initialize_optionsz!editable_wheel.initialize_optionsvs$
!			r7c|j}|jptj|_|jpi|_t
|jp$tj	|jd|_dS)Ndist)
distributionsrc_rootoscurdirrIpackage_dirrrGpathjoin)rKrNs  r5finalize_optionszeditable_wheel.finalize_options|sX =5BI+1rT]Tbgll4;KV.T.TUU


r7c	|jd||d|d}||j||dS#t$r<}tj
d}tjt||d}~wwxYw)NT)exist_okbdist_wheela
            Support for editable installs via PEP 660 was recently introduced
            in `setuptools`. If you are seeing this error, please report to:

            https://github.com/pypa/setuptools/issues

            Meanwhile you can try the legacy behavior by setting an
            environment variable and trying to install again:

            SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
            )rGmkdir_ensure_dist_inforeinitialize_commandget_finalized_commandwrite_wheelfilerH_create_wheel_file	Exception	traceback	print_excr
InternalErrorr)rKrYexr4s    r5runzeditable_wheel.runs	>M...""$$$
%%m44444]CCK''(:;;;##K00000
	>
	>
	>!!!
C&x}}552=
	>sBB
C7C

Ccf|jW|d}|j|_|||j|_dSt
|jdsJt|jd	sJdS)N	dist_infoz
.dist-infoMETADATA)
rHr\rG
output_dirensure_finalizedrer>endswithrexists)rKrgs  r5r[z editable_wheel._ensure_dist_infos%11+>>I#'=I &&(((MMOOO!*!8Dt)**33LAAAAA*J77>>@@@@@@@r7c|j}|jsdSt|j|jdd}t||||}|dS)NrD.)	rOnamespace_packagesrrIrSgetresolve_NamespaceInstallerinstall_namespaces)rKinstallation_dir
pth_prefixrNrP	installers      r5_install_namespacesz"editable_wheel._install_namespacessw &	F($*:*>*>r3*G*GHHPPRR'.>
HUU	$$&&&&&r7r)c|jrt|jjn
t}tt|d}t
|dS)Nz
*.egg-info)rHrparentmapr>globnext)rK
parent_dir
candidatess   r5_find_egg_info_dirz!editable_wheel._find_egg_info_dirsT8<8JVT$,--44PTPVPV
jool;;<<
J%%%r7nameunpacked_wheel	build_libtmp_dirc|j}t|}t|}tt||dd}tt||dd}tt||dd}	|dd}
t||
_d|
_|dd}|d	d}|x|_x|_|_|x|_	x|_
|_|	x|_|_
||_||_|d
}
d|
_t||_|d}d|_||_|||d
S)aConfigure commands to behave in the following ways:

        - Build commands can write to ``build_lib`` if they really want to...
          (but this folder is expected to be ignored and modules are expected to live
          in the project directory...)
        - Binary extensions should be built in-place (editable_mode = True)
        - Data/header/script files are not part of the "editable" specification
          so they are written directly to the unpacked_wheel directory.
        z.datadataheadersscriptsegg_infoT)reinit_subcommandsbuildinstallinstall_scriptsrFN)rOr>rr\egg_baseignore_egg_info_in_manifest
build_platlib
build_purelibrinstall_purelibinstall_platlibinstall_libr
build_scriptsinstall_headersinstall_dataget_command_objno_ep
build_tempcompilerexisting_egg_info_dir_set_editable_moderj)rKrrrrrNwheelrrrrrrrrs               r5_configure_buildzeditable_wheel._configure_builds N##	NN	44??@@d>d>>>9EEFFd>d>>>9EEFF,,ZD,QQLL/3,))'d)KK++I$+OOFOOOe1EORWWW'"9G>>g~r7	dist_namec|||||||\}}|d|d|d||fS)Nrrr)r_run_build_subcommandsr_run_install)rKrrrrrrs       r5_run_build_commandsz"editable_wheel._run_build_commandss	
iGLLL##%%%4466w)$$$)$$$&!!!g~r7c|d}|D]`}||}|dkr.t|tkr||K||adS)a}
        Issue #3501 indicates that some plugins/customizations might rely on:

        1. ``build_py`` not running
        2. ``build_py`` always copying files to ``build_lib``

        However both these assumptions may be false in editable_wheel.
        This method implements a temporary workaround to support the ecosystem
        while the implementations catch up.
        rrN)r]rtypebuild_py_cls_safely_runrun_command)rKrrrs    r5rz%editable_wheel._run_build_subcommandss33G<<**,,	'	'D,,T22Cz!!d3ii<&?&?  &&&&  &&&&	'	'r7rc	||S#t$r<tjd|d|d}t	j|tdYdSwxYw)Nz

            If you are seeing this warning it is very likely that a setuptools
            plugin or customization overrides the `z` command, without
            taking into consideration how editable installs run build steps
            starting from v64.0.0.

            Plugin authors and developers relying on custom build steps are encouraged
            to update their `aO` implementation considering the information in
            https://setuptools.pypa.io/en/latest/userguide/extension.html
            about editable installs.

            For the time being `setuptools` will silence this error and ignore
            the faulty command, but this behaviour will change in future versions.

            )
stacklevel)rr`ra
format_excr0r1r)rKrr4s   r5rzeditable_wheel._safely_run"s	K##H---	K	K	K +--

4<

'


C
M#;JJJJJJJ	KsAAAc
ddlm}|d}|j}d|}d}|d|d|d}t
|j|}|r|	t|}	td}
td	}|	5}|
5}
|5}t
|t
|jj}tj
|j||||j||||
|\}}||||
}|5||d
5}||||||dddn#1swxYwYdddn#1swxYwYdddn#1swxYwYdddn#1swxYwYdddn#1swxYwY|S)Nrrrg-z
0.editablez.whl)suffixz
.build-libz.build-tempw)wheel.wheelfilerr]rrUget_tagrrGrlunlinkrrHshutilcopytreerwr_select_strategywrite_files)rKrYrrgrtag	build_tagarchive_name
wheel_pathrr	build_tmpunpackedlibtmpunpacked_dist_inforrstrategy	wheel_objs                    r5r_z!editable_wheel._create_wheel_file6sJ------..{;;	N	hh{**,,-- 	#;;i;;#;;;$-66
	 +<@@@&l;;;	&m<<<	
	0x	0c9	0!%hT5G0H0H0M!N!NOD.0BCCC$$Xy~>>>!55i3PSTTNE7,,YSAAH
0
099Z55
0E7333%%h///
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0sG5	GBG
F0	*#F
F0	FF0	 F!F0	$G0F4
4G7F4
8G;GGGGGG5G"	"G5%G"	&G55G9<G9categoryct|jd|d}|rB|r:td|d|d|dSdSdS)Nhas_zInstalling z as non editableinstall_)getattrrO_loggerinfor)rKrhas_categorys   r5rzeditable_wheel._run_installRst02C2C2CTJJ	4LLNN	4LLAxAAABBB22233333	4	4	4	4r7rEditableStrategyc\d|d|}t|j}t|j}|tjur:t
t|jd|}t|j|||St|j}t||j|}	|tju}
t|jdhkr|	s|
r@|jdd}t|j|t||gSt!|j|S)zDDecides which strategy to use to implement an editable installation.
__editable__.rrrDrn)rrIr$r6r(r<
_empty_dir	_LinkTreerO_find_packages_simple_layoutrSr+setrp
_StaticPth_TopLevelFinder)rKrrr
build_namerIr(
auxiliary_dirpackageshas_simple_layoutis_compat_modesrc_dirs            r5rzeditable_wheel._select_strategyXs#2T11C11
4+,,$$TY//='''&tD,(.(&**2s33Gd/['8R8R7STTTt0$777r7)r8r9r:r;descriptionrr$user_optionsrLrVrer[rwrr>r_Pathrrrr
r
rrrrr_rrr?r7r5rArAis6K	LK	$!6!<"==>LVVV>>>4	A	A	A'''&HSM&&&&
0#0#).0#;@0#KP0#0#0#0#d	#	#	#d3ic3h.G(H		.3	@E	PU		tCy$sCx.(	)				''',KCKKKK(84S4444888	8

888888r7rAcJeZdZdddeedeeeffdZdZdZdS)	rrrrrcdSrFr?)rKrrrs    r5__call__zEditableStrategy.__call__tr7cdSrFr?rJs r5	__enter__zEditableStrategy.__enter__wrr7cdSrFr?rK	_exc_type
_exc_value
_tracebacks    r5__exit__zEditableStrategy.__exit__zrr7N)	r8r9r:r
r>r
rrrr?r7r5rrsshk$s)d3PS8nr7rcjeZdZdededeefdZdddeedeeeffd	Z	d
Z
dZdS)
rrNrpath_entriesc0||_||_||_dSrF)rNrr)rKrNrrs    r5__init__z_StaticPth.__init__s		(r7rrrrcdd|jD}t|dd}|d|jd|dS)N
c3XK|]%}t|V&dSrF)r>rq).0ps  r5	z&_StaticPth.__call__..s2II!S--IIIIIIr7utf-8r.pth)rUrbyteswritestrr)rKrrrentriescontentss      r5rz_StaticPth.__call__sb))IIt7HIIIJJG11
6ty666AAAAAr7cdtttj|jd}t
|tz|S)Nz_
        Editable install will be performed using .pth file to extend `sys.path` with:
        z	
        )listrzrQfspathrrwarning_LENIENT_WARNINGrKr4s  r5rz_StaticPth.__enter__sQ	
c")T.//	0	0	..///r7cdSrFr?rs    r5rz_StaticPth.__exit__rr7N)r8r9r:rr>r
rrr
rrrr?r7r5rr~s)\))DJ))))
BkB$s)Bd3PS8nBBBB
r7rceZdZdZdedededeffdZddd	eed
e	eefffdZ
ded
eefdZddedefdZ
dZdZdZxZS)ra`
    Creates a ``.pth`` file that points to a link tree in the ``auxiliary_dir``.

    This strategy will only link files (not dirs), so it can be implemented in
    any OS, even if that means using hardlinks instead of symlinks.

    By collocating ``auxiliary_dir`` and the original source code, limitations
    with hardlinks should be avoided.
    rNrrrct||_t||_|dj|_t|||jgdS)Nr)	rrrqrr	copy_file_filesuperr)rKrNrrr	__class__s     r5rz_LinkTree.__init__sn"-00i0022))*55?

td&8%9:::::r7rrrrcz|||t|||dSrF)
_create_linksrr)rKrrrrs    r5rz_LinkTree.__call__s;5'***
w/////r7filer)c*tt5t||j}t
|tj	dcdddS#1swxYwYdS)N/)
r
ValueErrorrrqrelative_torr>replacerQsep)rKrrTs   r5_normalize_outputz_LinkTree._normalize_outputs
j
!
!	2	2::%%''33DNCCDt99$$RVS11	2	2	2	2	2	2	2	2	2	2	2	2	2	2	2	2tsA&BBBNrelative_outputsrc_filec|j|z}|js|jd||||dS)NT)parentslink)rryis_dirrZr)rKr r!r%dests     r5_create_filez_LinkTree._create_files\!O3{!!##	,Kd+++

8T
-----r7cjddtjrdnd}fd|D}|dd|D]3}|}|r||vr||4|D]\}}|||dS)NT)r#rXsymhardcBi|]\}}||Sr?)r)rkvrKs   r5
z+_LinkTree._create_links..s=


1
""1%%q


r7r$)rrZ_can_symlink_filesitemspoprr()rKoutputsoutput_mapping	link_typemappingsoutputrelativesrcs`       r5rz_LinkTree._create_linkss   ===/0BCCOEE	



&,,..


	T4   	4	4F--f55H
4HH44!!(F333%^^--	=	=MHch)<<<<	=	=r7cNd}t|tz|S)Nz=Strict editable install will be performed using a link tree.
)rr_STRICT_WARNINGrs  r5rz_LinkTree.__enter__s#No-...r7cPd|jd}tj|tdS)Nz\

        Strict editable installation performed using the auxiliary directory:
            z

        Please be careful to not remove this directory, otherwise you might not be able
        to import/use your package.
        )rr0r1InformationOnlyrKrrrr4s     r5rz_LinkTree.__exit__s8

	
c?+++++r7rF)r8r9r:r;rr>rrr
r
rrrr(rrr
__classcell__)rs@r5rrs%	; 	;	;	;		;	;	;	;	;	;0k0$s)0d3PS8n000000chsm..C.3....==="
,,,,,,,r7rcZeZdZdedefdZdddeedeeeffdZd	Z	d
Z
dS)rrNrc"||_||_dSrF)rNr)rKrNrs   r5rz_TopLevelFinder.__init__s				r7rrrrc	|jjptj}t	t|jt
|j}|jjpi}t|||}tt	t|jjpg|dt|D}d|j
d}	t|	}
tt!|	||d}||
d|td|
d|
dd}|d|j
d	|dS)
Nc3K|]}|gfV	dSrFr?)rnss  r5rz+_TopLevelFinder.__call__..s&@@"b"X@@@@@@r7rz.finderrz.pyzimport z; z
.install()r)rNrPrQrRrr_find_top_level_modulesrS_find_package_rootsdict_find_namespacesr_find_virtual_namespacesr_make_identifierr_finder_templater)rKrrrrP	top_levelrSrootsnamespaces_rfindercontents            r5rz_TopLevelFinder.__call__sE9%2.335LTY5W5WXX	i+1r#I{HEE,0TY/52u==@@ 8 ? ?@@@2
2
--
2ty111!$''(ukBBGLL
&~~~w///>&>>F>>>HH
6ty666@@@@@r7cNd}t|tz|S)Nz=Editable install will be performed using a meta path finder.
)rrr
rs  r5rz_TopLevelFinder.__enter__s$N..///r7c>d}tj|tdS)Nz

        Please be careful with folders in your working directory with the same
        name as your package as they may take precedence during imports.
        )r0r1r=r>s     r5rz_TopLevelFinder.__exit__s#	
c?+++++r7N)r8r9r:rr>rr
r
rrrr?r7r5rrs\AkA$s)Ad3PS8nAAAA&
,,,,,r7rbase_dirr)ctt|5}t|dt|d}}|ddtttt5tj
|||r3|ddkr	dddddddSdddn#1swxYwY	tj
||n$#t$r}d}t||d}~wwxYw	dddd	S#1swxYwYdS)
N)dirz	file1.txtz	file2.txtfile1r)encodingTzFile system does not seem to support either symlinks or hard links. Strict editable installs require one of them to be supported.F)rr>rqr
write_textrAttributeErrorNotImplementedErrorOSErrorrQsymlink
is_symlink	read_textr%r`LinksNotSupported)rSrpath1path2rdr4s      r5r0r0s	H$4$4$6$6 7 7	8	8	8CC--tC/E/Eu
7333
n&97
C
C		Jue$$$!!
eoowo&G&G7&R&R																					
	1GE5!!!!	1	1	1P
$C((b0	1!saAEAC1
E%E1C5	5E8C5	9E=DE
D4D//D44EE	E	rrSrIc"fd|D}|stidhfvStjd|Dtfd|DS)a[Return ``True`` if:
    - all packages are contained by the same parent directory, **and**
    - all packages become importable if the parent directory is added to ``sys.path``.

    >>> _simple_layout(['a'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.b'], {}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "a", "b": "b"}, ".")
    True
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a", "b": "_b"}, ".")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a": "_a"}, "/tmp/myproj")
    False
    >>> _simple_layout(['a', 'a.a1', 'a.a1.a2', 'b'], {"a.a1.a2": "_a2"}, ".")
    False
    >>> _simple_layout(['a', 'a.b'], {"": "src", "a.b": "_ab"}, "/tmp/myproj")
    False
    >>> # Special cases, no packages yet:
    >>> _simple_layout([], {"": "src"}, "/tmp/myproj")
    True
    >>> _simple_layout([], {"a": "_a", "": "src"}, "/tmp/myproj")
    False
    c4i|]}|t|Sr?r)rpkgrSrIs  r5r/z"_simple_layout..4s8	
sK
=
=r7rDc4g|]\}}t||Sr?)_parent_path)rr-r.s   r5
z"_simple_layout..:s& O O O1a!3!3 O O Or7c	3K|]E\}}ttg|dRt|kVFdSrnN)_normalize_pathrsplit)rkeyvaluerys   r5rz!_simple_layout..;sjC	V5ciinn55566/%:P:PPr7)rrQrT
commonpathr1all)rrSrIlayoutrys `` @r5rrs>F.;B:--
W

 O O O O O
P
PF ,,..r7c||r|dt|n|}|dtjzS)a7Infer the parent path containing a package, that if added to ``sys.path`` would
    allow importing that package.
    When ``pkg`` is directly mapped into a directory with a different name, return its
    own path.
    >>> _parent_path("a", "src/a")
    'src'
    >>> _parent_path("b", "src/c")
    'src/c'
    Nr)rklenrstriprQr)rdpkg_pathrys   r5rfrfAsJ&.%6%6s%;%;
IXjCyj
!
!F==rv&&&r7rNc#Kt|jpgEd{V|jpg}d|D}|jr
|jVn|jpg}|d|Dz
}|D]}|d\}}}|V dS)Ncg|]}d|v|	Srnr?rmods  r5rgz"_find_packages..Ss>>>c3#::c:::r7c.g|]}d|jv|jSrwrrxs  r5rgz"_find_packages..Xs!HHHa#--16---r7rn)iterr
py_modulesext_packageext_modules
rpartition)rNrnested_modulesrmodulepackage_s       r5rrOsDM'R(((((((((&BJ>>Z>>>NI&,"HH;HHHH ))#..
A



r7c#K|jpg}d|DEd{V|js|jpg}d|DEd{VdSdS)Nc3"K|]
}d|v|VdSrir?rxs  r5rz*_find_top_level_modules..as&<<S^^^^^^<.es0EEq3af3D3DAF3D3D3D3DEEr7)rrr)rNrrs   r5rErE_s&BJ<.ms@!!!	^-c;II
J
J!!!r7)sorted_remove_nested)rrSrP	pkg_rootss `` r5rFrFhsI
!!!!!(##!!!I
)$$$r7rTct|}|j}|r!t|St||jzS)z(Works for packages and top-level modules)rryrlr>rqr)rTpath_rys   r5rrusYJJE
\F||~~25==??###6>>##ej0111r7rc	#>K|D]}d|vr|d}tt|dz
ddD]Y}d|d|}t	t||d}|r||vr|VZdS)a8By carefully designing ``package_dir``, it is possible to implement the logical
    structure of PEP 420 in a package without the corresponding directories.

    Moreover a parent package can be purposefully/accidentally skipped in the discovery
    phase (e.g. ``find_packages(include=["mypkg.*"])``, when ``mypkg.foo`` is included
    by ``mypkg`` itself is not).
    We consider this case to also be a virtual namespace (ignoring the original
    directory) to emulate a non-editable installation.

    This function will try to find these kinds of namespaces.
    rnrNrD)rkrangerrrUrrrl)rrdpartsipartial_namerTs      r5rIrIs	#	#c>>		#s5zzA~q"--	#	#A88E"1"I..L),	2FFGGD;;==
#L	$A$A""""	#		#	#r7c#K|D]]}t||d}t|r)t|ds||gfV^dS)NrDz__init__.py)rrrl)rrrdrTs    r5rHrHs|   i44::	 tD-'@'@'G'G'I'I	 -  r7c:t|}tt|D]H\tfd|Dr|I|S)Nc3NK|]\}}|kot||V dSrF)
_is_nested)rother
other_pathrTrds   r5rz!_remove_nested..sR

!z
5LEZT5*EE





r7)rGcopyreversedr
r1anyr2)rr7rTrds  @@r5rrs
)..""
#
#Fd9??#4#45566	T




%.__%6%6




	
JJsOOOMr7rdrtryparent_pathct|}||dddd}||o|tt|g|RkS)a
    Return ``True`` if ``pkg`` is nested inside ``parent`` both logically and in the
    file system.
    >>> _is_nested("a.b", "path/a/b", "a", "path/a")
    True
    >>> _is_nested("a.b", "path/a/b", "a", "otherpath/a")
    False
    >>> _is_nested("a.b", "path/a/b", "c", "path/c")
    False
    >>> _is_nested("a.a", "path/a/a", "a", "path/a")
    True
    >>> _is_nested("b.a", "path/b/a", "a", "path/a")
    False
    rDrrn)rjrstriprk
startswithr)rdrtryr
norm_pkg_pathrests      r5rrs|$H--M;;vr1%%++C0066s;;Dv	G_T+-E-E-E-EFFFr7filenamectjdkrtj|n|}tjtjtj|S)z1Normalize a file/dir name for comparison purposescygwin)sysplatformrQrTabspathnormcaserealpathnormpath)rrs  r5rjrjs^),(@(@27??8$$$hD
7BG,,RW-=-=d-C-CDDEEEr7dir_cZtj|dtj||S)zFCreate a directory ensured to be empty. Existing files may be removed.T)
ignore_errors)rrmtreerQmakedirs)rs r5rrs,
M$d++++KKr7rc^tjdd|}|sJ|S)zMake a string safe to be used as Python identifier.
    >>> _make_identifier("12abc")
    '_12abc'
    >>> _make_identifier("__editable__.myns.pkg-78.9.3_local")
    '__editable___myns_pkg_78_9_3_local'
    z
\W|^(?=\d)r)resubisidentifier)rsafes  r5rJrJs46-d++DKr7c eZdZdZdZdZdS)rrcZ||_||_||_||_g|_d|_dS)NF)rOrPrt
editable_namer3dry_run)rKrOrtrrPs     r5rz_NamespaceInstaller.__init__s3( 
 0*r7cVtj|j|jS)zInstallation target.)rQrTrUrtrrJs r5_get_targetz_NamespaceInstaller._get_targetsw||D143EFFFr7cDtt|jS)z1Where the modules/packages should be loaded from.)reprr>rPrJs r5	_get_rootz_NamespaceInstaller._get_rootsC
&&'''r7N)r8r9r:rrrr?r7r5rrrrsDGGG(((((r7rra<	import sys
from importlib.machinery import ModuleSpec
from importlib.machinery import all_suffixes as module_suffixes
from importlib.util import spec_from_file_location
from itertools import chain
from pathlib import Path

MAPPING = {mapping!r}
NAMESPACES = {namespaces!r}
PATH_PLACEHOLDER = {name!r} + ".__path_hook__"


class _EditableFinder:  # MetaPathFinder
    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        for pkg, pkg_path in reversed(list(MAPPING.items())):
            if fullname == pkg or fullname.startswith(f"{{pkg}}."):
                rest = fullname.replace(pkg, "", 1).strip(".").split(".")
                return cls._find_spec(fullname, Path(pkg_path, *rest))

        return None

    @classmethod
    def _find_spec(cls, fullname, candidate_path):
        init = candidate_path / "__init__.py"
        candidates = (candidate_path.with_suffix(x) for x in module_suffixes())
        for candidate in chain([init], candidates):
            if candidate.exists():
                return spec_from_file_location(fullname, candidate)


class _EditableNamespaceFinder:  # PathEntryFinder
    @classmethod
    def _path_hook(cls, path):
        if path == PATH_PLACEHOLDER:
            return cls
        raise ImportError

    @classmethod
    def _paths(cls, fullname):
        # Ensure __path__ is not empty for the spec to be considered a namespace.
        return NAMESPACES[fullname] or MAPPING.get(fullname) or [PATH_PLACEHOLDER]

    @classmethod
    def find_spec(cls, fullname, target=None):
        if fullname in NAMESPACES:
            spec = ModuleSpec(fullname, None, is_package=True)
            spec.submodule_search_locations = cls._paths(fullname)
            return spec
        return None

    @classmethod
    def find_module(cls, fullname):
        return None


def install():
    if not any(finder == _EditableFinder for finder in sys.meta_path):
        sys.meta_path.append(_EditableFinder)

    if not NAMESPACES:
        return

    if not any(hook == _EditableNamespaceFinder._path_hook for hook in sys.path_hooks):
        # PathEntryFinder is needed to create NamespaceSpec without private APIS
        sys.path_hooks.append(_EditableNamespaceFinder._path_hook)
    if PATH_PLACEHOLDER not in sys.path:
        sys.path.append(PATH_PLACEHOLDER)  # Used just to trigger the path hook
rrctt|d}t|||S)z_Create a string containing the code for the``MetaPathFinder`` and
    ``PathEntryFinder``.
    c|dS)Nrr?)rs r5z"_finder_template..?s
1r7)rlrrr)rGrr1_FINDER_TEMPLATEformatrs   r5rKrK9sC6'--//~~>>>??G""g*"UUUr7ceZdZdZdS)r=zCurrently there is no clear way of displaying messages to the users
    that use the setuptools backend directly via ``pip``.
    The only thing that might work is a warning, although it is not the
    most appropriate tool for the job...
    Nr8r9r:r;r?r7r5r=r=Csr7r=ceZdZdZdS)r_zCFile system does not seem to support either symlinks or hard links.Nrr?r7r5r_r_KsMMMMr7r_)Wr;loggingrQrrrrar0
contextlibrenumrinspectr	itertoolsrpathlibrtempfilertypingr	r
rrr
rrrrr
setuptoolsrrrrsetuptools.command.build_pyrrsetuptools.discoveryrsetuptools.distrrrversion_infortyping_extensionsabcr r>rr!	getLoggerr8rr$r;r
rArrrrboolr0rrfrrErFrrIrHrrrjrrJ	InstallerrrrrKUserWarningr=	FileErrorr_r?r7r5rs

								







''''''QPPPPPPPPPPP@@@@@@222222((((((*))))))v$*******######
c4iWT
'
H
%
%!$!$!$!$!$D!$!$!$HG8G8G8G8G8WG8G8G8Tx.D,D,D,D,D,
D,D,D,N",",",",",",",",J$()sm)*.sCx.)GK)	))))X'''

(3-



 F,F8C=FFFF
%sm
%c"
%
%
#s(^	
%
%
%
%2232222#S#X#8C=####0 3i $(cN 
eCcN#$    
d38n
c3h



C3#$.FeFFFFFRB	3	3				(((((*.((($EPV

VS)V7;CcN7KVVVVVkNNNNN(NNNNNr7PK!+P&}})command/__pycache__/alias.cpython-311.pycnu[

,ReM	NddlmZddlmZmZmZdZGddeZdZdS))DistutilsOptionError)edit_configoption_baseconfig_filecdD]}||vrt|cS||gkrt|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcs  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/alias.pyshquotersW
 8899
yy{{seCyyJcXeZdZdZdZdZdgejzZejdgzZdZ	dZ
dZd	S)
aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasrcJtj|d|_d|_dS)N)rinitialize_optionsargsrselfs rrzalias.initialize_optionss%&t,,,	rctj||jr't|jdkrtddSdS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrrrs rrzalias.finalize_options!sV$T***;	3ty>>Q..&!
		..rcV|jd}|jsCtdtd|D] }tdt	||!dSt|jdkrK|j\}|jrd}nz||vr tdt	||dStd|zdS|jd}dtt|jdd}t|jd||ii|jdS)	NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr )
distributionget_option_dictrprintformat_aliasrrjoinmaprrfilenamedry_run)rr!rcommands    rrunz	alias.run)s;#33I>>y	<#$$$#$$$ 
F
F&UG(D(DEEEEF
^^q
 
 YFE{
'!!&UG(D(DEEE85@AAAIaLEhhs7DIabbM::;;GDMIw/?#@$,OOOOOrN)__name__
__module____qualname____doc__descriptioncommand_consumes_argumentsruser_optionsboolean_optionsrrr,rrrrs==DK!%	4 !L"1XJ>O
PPPPPrrc||\}}|tdkrd}n1|tdkrd}n|tdkrd}nd|z}||zdz|zS)	Nglobalz--global-config userz--user-config localz
--filename=%rr")r)namer!sourcer+s    rr&r&Ds{dmOFG
X&&&&#	;v&&	&	&!	;w''	'	' 6)D=3((rN)	distutils.errorsrsetuptools.command.setoptrrrrrr&r5rrr?s111111KKKKKKKKKK1P1P1P1P1PK1P1P1Ph
)
)
)
)
)rPK!"ӕ,command/__pycache__/saveopts.cpython-311.pycnu[

,Re2ddlmZmZGddeZdS))edit_configoption_baseceZdZdZdZdZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filec|j}i}|jD]X}|dkr	||D]'\}\}}|dkr|||i|<(Yt|j||jdS)Nrzcommand line)distributioncommand_optionsget_option_dictitems
setdefaultrfilenamedry_run)selfdistsettingscmdoptsrcvals       /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/saveopts.pyrunzsaveopts.run	s '	<	r sQ>>>>>>>>;;;;;{;;;;;rPK!ߘi+__4command/__pycache__/install_egg_info.cpython-311.pycnu[

,Re~ddlmZmZddlZddlmZddlmZddlmZddl	m
Z
ddlZGdd	ejeZ
dS)
)logdir_utilN)Command)
namespaces)unpack_archive)ensure_directoryc:eZdZdZdZdgZdZdZdZdZ	dZ
dS)	install_egg_infoz.Install an .egg-info directory for the package)zinstall-dir=dzdirectory to install tocd|_dSN)install_dirselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/install_egg_info.pyinitialize_optionsz#install_egg_info.initialize_optionsscB|dd|d}tjdd|j|jdz}|j|_tj	
|j||_g|_
dS)Ninstall_lib)rregg_infoz	.egg-info)set_undefined_optionsget_finalized_command
pkg_resourcesDistributionegg_nameegg_versionrsourceospathjoinrtargetoutputs)rei_cmdbasenames   rfinalize_optionsz!install_egg_info.finalize_optionss""=#A	C	C	C++J77 -$);


(**{#ogll4#3X>>rc^|dtj|jrEtj|js!t
j|j|jnStj	|jr/|
tj|jfd|jz|jst|j|
|j
dd|jd|j|dS)Nr)dry_runz	Removing zCopying z to )run_commandrr isdirr"islinkrremove_treer(existsexecuteunlinkr	copytreerinstall_namespacesrs rrunzinstall_egg_info.run"s$$$
7==%%	ObgnnT[.I.I	O dlCCCCC
W^^DK
(
(	OLLT[NK$+4MNNN|	*T[)))M22T[[[$++N	
	
	
	
!!!!!rc|jSr)r#rs rget_outputszinstall_egg_info.get_outputs/s
|rcHfd}tjj|dS)NcdD]!}||sd|z|vrdS"j|tjd|||S)N)z.svn/zCVS//zCopying %s to %s)
startswithr#appendrdebug)srcdstskiprs   rskimmerz*install_egg_info.copytree..skimmer4sr(
 
 >>$'' 3:+<+<44,=L$$$I(#s333Jr)rrr")rr?s` rr1zinstall_egg_info.copytree2s:											t{DK99999rN)__name__
__module____qualname____doc__descriptionuser_optionsrr&r3r5r1r)rrrrsv88BK	9L   			"""
:
:
:
:
:rr)	distutilsrrr
setuptoolsrrsetuptools.archive_utilr_pathr	r	Installerrr)rrrKs########				!!!!!!222222$$$$$$4:4:4:4:4:z+W4:4:4:4:4:rPK!}0tEZZ,command/__pycache__/build_py.cpython-311.pycnu[

,Re#7ddlmZddlmZddlmZddlmcmZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlmZmZmZmZmZmZddlmZddlmZd	ZGd
dejZdZ Gd
dZ!dS))partial)glob)convert_pathN)Path)DictIterableIteratorListOptionalTuple)SetuptoolsDeprecationWarning)unique_everseencxtj|tj|jtjzdSN)oschmodstatst_modeS_IWRITE)targets /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build_py.py
make_writablers,HVRWV__,t}<=====cxeZdZUdZdZeed<dZee	ed<dZ
		d fd	Zd	Zd
Z
dZdZd
ZdZdZd!dee	ffd
Zdee	e	ffdZdeee	e	ffdZdeee	e	ffdZdZdZdee	de	dee	fdZdZdZ dZ!dZ"dZ#e$dZ%xZ&S)"build_pyaXEnhanced 'build_py' command that includes data files with packages

    The data files are specified via a 'package_data' argument to 'setup()'.
    See 'setuptools.dist.Distribution' for more details.

    Also, this version of the 'build_py' command allows you to specify both
    'py_modules' and 'packages' in the same setup operation.
    F
editable_modeNexisting_egg_info_dirctj||jj|_|jjpi|_d|jvr|jd=g|_dS)N
data_files)origrfinalize_optionsdistributionpackage_dataexclude_package_data__dict___build_py__updated_filesselfs rr!zbuild_py.finalize_options$s^
&&t,,, -:$($5$J$Pb!4=((
l+!rc|r\tt|}tt|}t||||||Sr)strrresolvesuper	copy_file)r(infileoutfile
preserve_modepreserve_timeslinklevel	__class__s       rr.zbuild_py.copy_file,st	3f--//00F$w--//1122Gww  -!%u..	.rc0|js|jr|jrdS|jr||jr(|||tj	|ddS)z?Build modules, packages, and copy data files to build directoryNr)include_bytecode)

py_modulespackagesr
build_modulesbuild_packagesbuild_package_databyte_compiler rget_outputsr's rrunzbuild_py.run5s	4=	T5G	F?	!   =	&!!!##%%%	
$-33D13MMNNNNNrc|dkr ||_|jStj||S)zlazily compute data filesr)_get_data_filesrr r__getattr__)r(attrs  rrBzbuild_py.__getattr__Es@<"2244DO?"}((t444rctj||||\}}|r|j|||fSr)r rbuild_moduler&append)r(modulemodule_filepackager0copieds      rrEzbuild_py.build_moduleLsK-44T6;PWXX	1 ''000rc||tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples)analyze_manifestlistmap_get_pkg_data_filesr9r's rrAzbuild_py._get_data_filesRs6C0$-2E2FFGGGrc|jditt|j|jpdS)z
        Generate list of ``(package,src_dir,build_dir,filenames)`` tuples,
        but without triggering any attempt to analyze or build the manifest.
        manifest_filesrL)r%
setdefaultrNrOrPr9r's rget_data_files_without_manifestz(build_py.get_data_files_without_manifestWs?	

  !12666C0$-2E2FFGGGrc||tjj|jg|dz}fd||D}|||fS)N.cPg|]"}tj|#SrL)rpathrelpath).0filesrc_dirs  r
z0build_py._get_pkg_data_files..is9



GOOD'**


r)get_package_dirrrXjoin	build_libsplitfind_data_files)r(rI	build_dir	filenamesr\s    @rrPzbuild_py._get_pkg_data_filesas&&w//GLDN#3gmmC6H6H#HJ	



,,Wg>>


	I55rc||j||}tttd|}t
j|}ttj
j|}tj|j
|g|}||||S)z6Return filenames for package's data files in 'src_dir'T)	recursive)_get_platform_patternsr#rOrr	itertoolschain
from_iterablefilterrrXisfilerRgetexclude_data_files)r(rIr\patternsglobs_expanded
globs_matches
glob_filesfiless        rrbzbuild_py.find_data_filesos..


WTT:::HEE!55nEE
BGNM::
##GR00

&&w???rreturnc|jr3t|St	|S)1See :class:`setuptools.commands.build.SubCommand`)rrNget_output_mappingkeysr-r>)r(r7r5s  rr>zbuild_py.get_outputssM	://116688999ww""#3444rctj||}t	t|dS)rvc|dS)NrrL)xs rz-build_py.get_output_mapping..s
!A$r)key)rhri _get_package_data_output_mapping_get_module_mappingdictsorted)r(mappings  rrwzbuild_py.get_output_mappingsP/1133$$&&

F7777888rc#K|D]=\}}}|d}||j||}||fV>dS)z5Iterate over all modules producing (dest, src) pairs.rVN)find_all_modulesraget_module_outfiler`)r(rIrGrHfilenames     rrzbuild_py._get_module_mappingsp.2.C.C.E.E	*	**WfkmmC((G..t~wOOH[)))))	*	*rc#K|jD]R\}}}}|D]H}tj||}tj||}||fVISdS)z6Iterate over package data producing (dest, src) pairs.N)rrrXr_)r(rIr\rcrdrrsrcfiles        rr~z)build_py._get_package_data_output_mappings|6:o	(	(2GWi%
(
(i::',,w99w'''''
(	(	(rc|D]_\}}|tj||||\}}t
|`dS)z$Copy data files into build directoryN)r~mkpathrrXdirnamer.r)r(rr_outf_copieds     rr<zbuild_py.build_package_datass#DDFF	"	"OFGKK//000!^^GV<.s-BBBQBRW%%a((BBBrc3 K|]}|vV	dSrrL)rZr	norm_paths  r	z/build_py._filter_build_files..s(-T-TQay.@-T-T-T-T-T-TrN)	rr`
build_temp
build_baserrXrisabsall)r(rsrr
build_dirs	norm_dirsr[rs       @rrzbuild_py._filter_build_filess**7330@%BRS
BB*BBB			D((..I7==&&
#-T-T-T-T)-T-T-T*T*T



		rcdSrrLr's rget_data_fileszbuild_py.get_data_filessrc	|j|S#t$rYnwxYwtj|||}||j|<|r|jjs|S|jjD]"}||ks||dzrn#|Stj	|d5}|
}dddn#1swxYwYd|vr#tj
d|d|S)z8Check namespace packages' __init__ for declare_namespacerVrbNsdeclare_namespacezNamespace package problem: z is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
")packages_checkedKeyErrorr r
check_packager"namespace_packages
startswithioopenread	distutilserrorsDistutilsError)r(rIpackage_dirinit_pypkgrcontentss       rrzbuild_py.check_packagesk	(11			D	---dG[II)0g&	d/B	N$7		Cg~~#
!>!>~N
WWd
#
#	 qvvxxH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 x//"111.s/OO7ug66OOOOOOrc3$K|]
}|v|VdSrrL)rZfnbads  rrz.build_py.exclude_data_files..s'77"3277r)rNrgr$rhrirjsetr)	r(rIr\rsromatch_groupsmatcheskeepersrs	   `    @rrnzbuild_py.exclude_data_files
sU..%


POOOhOOO///=='ll7777777OG,,---rctj|dg||g}fd|DS)z
        yield platform-specific path patterns (suitable for glob
        or fn_match) from a glob-based spec (such as
        self.package_data or self.exclude_package_data)
        matching package in src_dir.
        c3rK|]1}tjt|V2dSr)rrXr_r)rZrr\s  rrz2build_py._get_platform_patterns..)sQ


GLL,w"7"788





r)rhrirm)specrIr\raw_patternss  ` rrgzbuild_py._get_platform_patternsse!HHRHHWb!!





(


	
r)r)r)Nr))r))'__name__
__module____qualname____doc__rbool__annotations__rrr+r!r.r?rBrErArTrPrbr
r>rrwr	rrr~r<rMrrrrrr^rnstaticmethodrg
__classcell__)r5s@rrrsV M4+/8C=///"""JK#$......OOO 555HHH
HHH666@@@"55c5555559DcN9999*XeCHo%>****((5c?2K(((("""'<'<'Inform users that package or module is included as 'data file'a    Installing {importable!r} as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes {importable!r} as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    {importable!r} has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that {importable!r} is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.
    

!!
    c,t|_dSr)r_already_warnedr's r__init__z!_IncludePackageDataAbuse.__init___s"uurc|do)|dtdS)Nz.py)endswithlenisidentifier)r(r[s  rrz"_IncludePackageDataAbuse.is_modulebs6}}U##I\s5zzk\(:(G(G(I(IIrct|j}ttjt
j|j}|rd|g|SdS)NrV)	rparentrNrh	takewhiler+rpartsr_)r(rr[rrs     rrz._IncludePackageDataAbuse.importable_subpackageesV4jjY()939EEFF	.88V,e,---trc||jvretj|j|}tj|td|j|dSdS)N)r)
stacklevel)	rrrMESSAGEformatwarningsrr
add)r(rrs   rrz_IncludePackageDataAbuse.warnlsoT111/$,//66*6MMCM#;JJJJ $$Z0000021rN)	rrrrrrrrrrLrrrrEs`HHG.%%%JJJ11111rr)"	functoolsrrdistutils.utilrdistutils.command.build_pycommandrr rrrrrrrhrrpathlibrtypingrrr	r
rrsetuptools._deprecation_warningr
 setuptools.extern.more_itertoolsrrrrrLrrrs'''''')))))))))								BBBBBBBBBBBBBBBBHHHHHH<<<<<<>>>U
U
U
U
U
t}U
U
U
p###*+1+1+1+1+1+1+1+1+1+1rPK!m_ff0command/__pycache__/easy_install.cpython-311.pycnu[

,ReNdZddlmZddlmZddlmZmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZddlmZdd	lmZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
l Z dd
l!Z!dd
l"Z"dd
l#Z#dd
l$Z$dd
l%Z%dd
l&Z&ddl&m'Z'ddl(m)Z)dd
l(m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2m3Z3m4Z4ddl-m5Z5m6Z6ddl7m8Z8ddl9m:Z:m;Z;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFdd
l9Z9ddlGmHZHddlImJZJejKde9jLgdZMdZNdZOdZPdZQGdd e*ZRd!ZSd"ZTd#ZUd$ZVd%ZWGd&d'e>ZXGd(d)eXZYejZ[d*d+d,kreYZXd-Z\d.Z]d/Z^d0Z_dPd1Z`d2Zad3Zbd4ejcvrebZdnd5ZddQd7Zed8Zfd9Zgd:Zh	dd;lmiZjn#ek$rd<ZjYnwxYwd=ZiGd>d?elZmemnZoGd@dAemZpGdBdCZqGdDdEeqZrGdFdGerZseqjtZteqjuZudHZvdIZwdJe]fdKZxdLZydMZzGdNdOe)Z{d
S)Ra)
Easy Install
------------

A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.

__ https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

)glob)get_platform)convert_path
subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)logdir_util)
first_line_re)find_executable)installN)get_path)SetuptoolsDeprecationWarning)Command)	run_setup)setopt)unpack_archive)PackageIndexparse_requirement_arg
URL_SCHEME)	bdist_eggegg_info)Wheel)
normalize_pathresource_stringget_distributionfind_distributionsEnvironmentRequirementDistributionPathMetadataEggMetadata
WorkingSetDistributionNotFoundVersionConflictDEVELOP_DIST)ensure_directory)yield_linesdefault)category)easy_installPthDistributionsextract_wininst_cfgget_exe_prefixesc2tjddkS)NP)structcalcsize/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/easy_install.pyis_64bitr:Ns?31$$r8c,|dS)Nutf8)encodess r9	_to_bytesr@Rs88Fr8cT	|ddS#t$rYdSwxYw)NasciiTF)r=UnicodeErrorr>s r9isasciirDVs@	tuus
''cvtj|ddS)N
z; )textwrapdedentstripreplace)texts r9
_one_linerrL^s.?4  &&((00t<<Z1d?Z2dcd@Z3edAZ4dddDZ5dEZ6dFZ7dGZ8dHZ9dIZ:dJZ;ejdKZ<ejdLZ=dedNZ>ejdOZ?dPZ@dQZAdRZBdSZCdTZDdUZEdVZFdWZGejdXHZIdYZJeKeKdZd[\]ZLeKd^d_\ZMd`ZNdS)fr.z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zip-okzzinstall package as a zipfile)
multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))zinstall-dir=dzinstall package to DIR)zscript-dir=r?zinstall scripts to DIR)exclude-scriptsxzDon't install scripts)always-copyaz'Copy all needed packages to install dir)z
index-url=iz base URL of Python Package Index)zfind-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)always-unzipZz*don't install as a zipfile, no matter what)z
site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)no-depsNzdon't install dependencies)zallow-hosts=Hz$pattern(s) that hostnames must match)local-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z
no-find-linksNz9Don't load find-links defined in packages being installeduserNz!install in user site-package '%s')
rNrPrUrRrWr`rbrergrhr]rNctjdtd|_dx|_|_dx|_x|_|_d|_	d|_
d|_d|_dx|_
|_dx|_x|_|_dx|_x|_|_dx|_x|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ tBj"|_#tBj$|_%d|_&d|_'dx|_(|_)d|_*i|_+d|_,|j-j.|_.|j-/||j-0ddS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr.)1warningswarnEasyInstallDeprecationWarningrhzip_oklocal_snapshots_okinstall_dir
script_direxclude_scripts	index_url
find_linksbuild_directoryargsoptimizerecordrRalways_copy
multi_versionr`no_depsallow_hostsrootprefix	no_reportrginstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datainstall_baseinstall_platbasesite	USER_BASEinstall_userbase	USER_SITEinstall_usersite
no_find_links
package_indexpth_filealways_copy_from	site_dirsinstalled_projects_dry_rundistributionverbose_set_command_optionsget_option_dictselfs r9initialize_optionszeasy_install.initialize_optionss

A)	
	
	
	044d-DHHH4?T-A#	&**
?CCCt'$*<:>>
>t'7377	7DK$.####   $ $ $!"044
-"$
(0..$#33NCC	
	
	
	
	
r8cbd|D}tt|j|dS)Nc3K|]D}tj|stj|@|VEdSN)ospathexistsislink).0filenames  r9	z/easy_install.delete_blockers..s`

!w~~h''
+-7>>(+C+C






r8)listmap_delete_path)rblockersextant_blockerss   r9delete_blockerszeasy_install.delete_blockerssC

%-


	
S"O
4
455555r8ctjd||jrdStj|otj|}|rtntj}||dS)NzDeleting %s)	rinfodry_runrrisdirrrmtreeunlink)rris_treeremovers    r9rzeasy_install._delete_pathsm%%%<	F'--%%BbgnnT.B.B*B#2&&




r8cdjtj}td}d}t	|jditt
)zT
        Render the Setuptools version and installation details, then exit.
        {}.{}
setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})Nr7)formatsysversion_inforprintlocals
SystemExit)verdisttmpls   r9_render_versionzeasy_install._render_versionsU
gnc./--N
kdk%%FHH%%&&&llr8cL|jo|tjd}t	tj|_|j|j	
|j	|j	|tj
jdtj
jtj
jtj
j|jd|jdt!tddt!tddd	
t#jt&5|jt)jt)jd
dddn#1swxYwY|jdt!tdddd|j|jd
<|j|jd<|jr t8jst=jd| |!|"|#dddd|j$|j%|_$|j&d|_&|'dd|'dd|jr|j(r|j(|_%|j)|_$|'ddtU|_+|j+,|-|j.|j/s|0tcj2dd}|j3p||_3|j+dd|_4|j%tk|j$fD]&}||j4vr|j46d|'|j7%d|j7dD}ndg}|j8'|9|j3|j4| |_8tu|j4tj;z|_<|j=9t}|j=t~r|j=|_=ng|_=|j@r,|j8A|j4tj;z|j&s|j8B|j=|'dd!|C|jD|_D|j/r|jEstd"|jGstd#g|_HdS)$Nr.r}exec_prefixabiflags
platlibdirlib)
	dist_namedist_version
dist_fullname
py_versionpy_version_shortpy_version_nodot
sys_prefixsys_exec_prefixrr)implementation_lowerimplementationpy_version_nodot_platwindiruserbaseusersitez6WARNING: The user site-packages directory is disabled.rorprtrFr)rororrorpr)rwrw__EASYINSTALL_INDEXzhttps://pypi.org/simple/c6g|]}|Sr7)rIrr?s  r9
z1easy_install.finalize_options..0s DDD1QWWYYDDDr8,*)search_pathhosts)rvrvz9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))Irgrrsplitdict	sysconfigget_config_varsconfig_varsupdaterget_nameget_versionget_fullnamermajorminorgetattr
contextlibsuppressAttributeErrorr_get_implementationlower
setdefaultrJrrrhrENABLE_USER_SITErrk_fix_install_dir_for_user_siteexpand_basedirsexpand_dirs_expandrprorset_undefined_optionsrr
get_site_dirs
all_site_dirsextend_process_site_dirsrr`check_site_dirrgetenvrrshadow_pathrinsertr{rcreate_indexr rlocal_indexrs
isinstancestrrnscan_egg_linksadd_find_links_validate_optimizervrtrruoutputs)rr
default_index	path_itemrs     r9finalize_optionszeasy_install.finalize_optionss/--//[&&((+
	 9 ; ;<<*3355 -99;;!.;;==$##9 T TCZ44!#|U;;!
!
			
 
0
0		##(/(C(E(E(K(K(M(M")"="?"?%%


																
###C2&&..sB77	
	
	

(,'<$'+'<$9	OT2	OHMNNN++---<):	
	
	
?"".DO%!&D
	
""9	
	
	
	
""<	
	
	
9	3-	3#3D"2DO""9.BCCC*__!!$"9"9$."I"IJJJ}	"!!!	"79STT
8=-aaa0)>$/+J+JJ	6	6I 000 ''9555'DD(8(>(>s(C(CDDDEEEE%!%!2!2D,.IJJJ!	?--do>>>""=2JKKK//
>>
=	!5	#K
y	N#LNN
Ns+AG		G
G
c#jK|dStttj}d|dD}|D]k}t
j|stjd|7t||vrt|dzt|VldS)Ncpg|]3}tj|4Sr7)rr
expanduserrIrs  r9rz3easy_install._process_site_dirs..Us=


./BGqwwyy))


r8rz"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.path)
rrrrrrrrrkr)rnormpathrTs   r9rzeasy_install._process_site_dirsOsF~sx00

OOC  


		(	(A7==##
(=qAAAA""(22*>>%Q''''''	(	(r8c	t|}|tdvrtn"#t$r}td|d}~wwxYw|S)Nz--optimize must be 0, 1, or 2)intrange
ValueErrorr)valueras  r9rzeasy_install._validate_optimizecsl	JJEE!HH$$  %			&/
	
s'*
A	AA	c|jsdS||jd}t||jx|_|_tjd}||dS)z;
        Fix the install_dir if "--user" was used.
        Nz$User base directory is not specified_user)	rhcreate_home_pathrr
rrrname
select_scheme)rmsgscheme_names   r9rz+easy_install._fix_install_dir_for_user_siteps~y	F (8C(---484IID1''';'''''r8c|D]y}t||}|etjdkstjdkrtj|}t||j}t|||zdS)Nposixnt)rrrrr
rrsetattr)rattrsattrvals    r9
_expand_attrszeasy_install._expand_attrss	)	)D$%%C7g%%D',,S11C d&677dC(((
	)	)r8c4|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)rrr|Nr rs r9rzeasy_install.expand_basedirss%	
GGGHHHHHr8c8gd}||dS)z+Calls `os.path.expanduser` on install dirs.)rrrrrrNr")rdirss  r9rzeasy_install.expand_dirss/


	
4     r8c|r |dtj|j|jjkrtj|j	|jD]}|||j|j	r|j
}|jrFt|j}tt|D]}|||d||<ddlm}||j|j	|fd|j	z|tj|jjdS#tj|jjwxYw)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r)	file_utilz'writing list of installed files to '%s')announcerWARNrr
set_verbosityrur.rzrwrr|lenr	distutilsr&execute
write_filewarn_deprecated_options)rshow_deprecationspecrroot_lencounterr&s       r9runzeasy_install.runs{	MM;



<4,444dl+++	9	
:
:!!$DL(89999{
,9G"49~~H#(W#6#6GG+27+;HII+F((//////(4;*@=K 

((***d/788888Cd/78888s
CD88 Ec	tj}n/#t$r"tjdt
j}YnwxYwtj|j	d|zS)zReturn a pseudo-tempname base in the install directory.
        This code is intentionally naive; if a malicious party can write to
        the target directory you're already in deep doodoo.
        rztest-easy-install-%s)
rgetpid	Exceptionrandomrandintrmaxsizerjoinro)rpids  r9pseudo_tempnamezeasy_install.pseudo_tempnamese
	1)++CC	1	1	1.CK00CCC	1w||D,.Ds.JKKKs)AAcdSrr7rs r9r.z$easy_install.warn_deprecated_optionsr8c*t|j}tj|d}tj|sA	tj|n+#ttf$r|	YnwxYw||j
v}|s|js|}n|
dz}tj|}	|rtj|t|dtj|n+#ttf$r|	YnwxYw|sG|js@tjdd}t'j|j|j||r"|jt/||j
|_nd|_|jr&tj|sd|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededeasy-install.pthz.write-testw
PYTHONPATHrN)rrorrr:rmakedirsOSErrorIOErrorcant_write_to_targetrrycheck_pth_processingr<ropencloseenvirongetrrk_easy_install__no_default_msgrr/)rinstdirris_site_dirtestfiletest_exists
pythonpaths       r9rzeasy_install.check_site_dirs!!1227<<);<<w~~g&&	,
,G$$$$W%
,
,
,))+++++
,!33
	,4#5
	,3355KK++--
=H'..22K
,(Ih'''Xs##))+++	(####W%
,
,
,))+++++
,	J4#5	Jb99JHT*D,&>	! DM"s%A**%BB3AE%E('E(aS
        can't create or remove files in install directory

        The following error occurred while trying to add or remove files in the
        installation directory:

            %s

        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s
        z
        This directory does not currently exist.  Please create it and try again, or
        choose a different installation directory (using the -d or --install-dir
        option).
        a
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.

        For information on other options, you may wish to consult the
        documentation at:

          https://setuptools.pypa.io/en/latest/deprecated/easy_install.html

        Please make the appropriate changes for your system and try again.
        c|jtjd|jfz}tj|js|d|jzz
}n
|d|jzz
}t|)NrF)
_easy_install__cant_write_msgrexc_infororrr_easy_install__not_exists_id_easy_install__access_msgr	)rrs  r9rFz!easy_install.cant_write_to_targetso#s|~~a'8$:J&LLw~~d.//	,4$...CC4$+++CS!!!r8cl|j}tjd||dz}|dz}tj|}tddz}	|rt	j|tj	|}t	j
|dt|d}	||j
dit|d	}t j}tjd
kr}tj|\}}	tj|d}
|	dkotj|
}|r|
}d
dlm}||dddgd
tj|rtjd|	|r|tj|rt	j|tj|rt	j|dSdS	|r|tj|rt	j|tj|rt	j|n#|r|tj|rt	j|tj|rt	j|wwxYw#t0t2f$r|YnwxYw|jstjd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s.pthz.okzz
            import os
            f = open({ok_file!r}, 'w')
            f.write('OK')
            f.close()
            rFT)exist_okrANrpythonw.exe
python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesFr7)rorrr<rrrrLrdirnamerCrHwriterrrIr
executablerrr:rdistutils.spawnr]rDrErFryrk)
rrMrok_file	ok_existsrr_rZrabasenamealtuse_altr]s
             r9rGz!easy_install.check_pth_processings"3W===''))F2U"GNN7++	
)	(
#	'"""goog..GK$////Xs##A 
(//fhh//000			 ^
7d??(*

j(A(A%GX',,w
>>C ((L8,s++)%(
111111z4v6:::7>>'** HG GGIII7>>'**'Ig&&&7>>(++(Ih'''''(( GGIII7>>'**'Ig&&&7>>(++(Ih'''GGIII7>>'**'Ig&&&7>>(++(Ih''''(E!	(	(	(%%'''''	(H!	MHBGLLLus!+AM-D%K++A?M*-%NNc	$|jss|dr^|dD]H}|d|zr||||d|zI||dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rqmetadata_isdirmetadata_listdirinstall_scriptget_metadatainstall_wrapper_scripts)rrscript_names   r9install_egg_scriptsz easy_install.install_egg_scriptsYs#		(;(;I(F(F		#44Y??

&&zK'?@@##+%%j;&>??	
$$T*****r8c,tj|rZtj|D]C\}}}|D]:}|jtj||;DdS|j|dSr)rrrwalkrappendr:)rrbaser$filesrs      r9
add_outputzeasy_install.add_outputgs
7==	&%'WT]]
F
F!dE %FFHL''T8(D(DEEEEF
F
F
L%%%%%r8c:|jrtd|ddS)NzInvalid argument zW: you can't use filenames or URLs with --editable (except via the --find-links option).)r`rrr0s  r9not_editablezeasy_install.not_editableos9=	##44
		r8c|jsdStjtj|j|jrt|jd|jddS)Nz already exists in z; can't do a checkout there)r`rrrr:rtkeyrrxs  r9check_editablezeasy_install.check_editablewsq}	F
7>>"',,t';TXFFGG	#4///1
		r8c#$Ktjd}	t|Vtj|ot
|dSdS#tj|ot
|wwxYw)Nz
easy_install-)r})tempfilemkdtemprrrrr)rtmpdirs  r9_tmpdirzeasy_install._tmpdirs!)9:::	6f++GNN6""5vf~~~~~555BGNN6""5vf~~~~55sA2BFc	|5}t|tst|rU|||j||}|d|||dcdddStj	
|r:|||d|||dcdddSt|}|||j
|||j|j|j|j}| d|z}|jr|dz
}t%||jt(kr&||||d|cdddS|||j||cdddS#1swxYwYdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)rrr!rryrdownloadinstall_itemrrrrr|fetch_distributionrRr`rxrr	
precedencer(process_distributionlocation)rr0depsrdlrrs       r9r.zeasy_install.easy_installs
\\^^	LvdK00
7d##7%%d++++44T6BBB,,T2vtTJJ
	L	L	L	L	L	L	L	LW^^D))7%%d+++,,T4tLL	L	L	L	L	L	L	L	L166D%%%%88fdlDM$$d&6D|CdJ#POOC$S)))L00))$dGDDD9	L	L	L	L	L	L	L	L<((t}fdKK=	L	L	L	L	L	L	L	L	L	L	L	L	L	L	L	L	L	Ls&A-GAG(B#GGGGc|p|j}|p"tj||k}|p|d}|pJ|jduoAtjt
|t
|jk}|r&|s$|j|jD]}|j	|krnd}tjdtj||r4|
|||}|D]}||||n4||g}|||d|d|
|D]}||vr|cSdSdS)N.eggTz
Processing %srr)rxrrr_endswithrrrproject_namerrrreinstall_eggsregg_distribution)rr0rrrinstall_neededrdistss        r9rzeasy_install.install_items(;4+;'N27??8+D+D+N'Hx/@/@/H/H+H'
!-
2GOON844554011
2		&	&():;
&
&=H,,E-"&"'"2"28"<"<===	E%%dHf==E
<
<))$d;;;;
<**8445E%%dE!HdGDDD
 
 4<<KKK 
 
 r8c	tj||dS#t$r8tj||ddYdSwxYw)Nrunix)r_select_schemerrrJ)rrs  r9rzeasy_install.select_schemeso	O"4.....	O	O	OO))$Wf0M0MNNNNNN	Os>AAc|||j|||j|jvr|j||j|||||j|j<tj	|j
||g|R|dr4|js-|j
|d|s	|jsdS|'|j|jkrtjd|dS|||vr0|}t%t'|}tj	d|	t)g|g|j|j}n^#t.$r"}t1t'||d}~wt2$r'}t1||d}~wwxYw|js|jr:|D]7}|j|jvr'||8tj	d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)
update_pthraddrr{removerprrrinstallation_reporthas_metadatarrget_metadata_linesrxrkas_requirementr!rr%resolver.r&r	r'reportr)rrequirementrrrdistreqdistrosras        r9rz!easy_install.process_distributions	
t$$$4#DH---##D)))T"""  &&&,0)))+tCdCCCDDD455	&	--''(>??


	4D,	4F

$[_)D)DH3T:::F

 D$;$;))++G%c'll33K1;???	4 nn,,
t/1BGG$	0	0	0 Q((a/	4	4	4 ,,!3	4	=t4	=
=
=84#:::%%d&9&9&;&;<<<:KHHHHHs$/F66
HG
H*"HHc|j|jS|drdS|dsdSdS)Nznot-zip-safeTzzip-safeF)rmr)rrs  r9should_unzipzeasy_install.should_unzipsO;"{?"^,,	4  ,,	4ur8ctj|j|j}tj|r%d}t
j||j|j||Stj|r|}ntj	||krtj
|tj|}t|dkrGtj||d}tj|r|}t|tj|||S)Nz<%r already exists in %s; build directory %s will not be keptrSr)rrr:rtr{rrrkrr_rlistdirr*r*shutilmove)rr0
dist_filename
setup_basedstrcontentss       r9
maybe_movezeasy_install.maybe_move	sgll4/::
7>>#	N

HS$(D$8*EEE
7==''
	/&JJw}--;;	-(((z*--H8}}!! "Z! E E
7==///!.JJ$$$
r8c|jrdSt|D]}|j|
dSr)rqScriptWriterbestget_argswrite_script)rrrus   r9rnz$easy_install.install_wrapper_scripts sX	F %%''0066	%	%DDt$$$	%	%r8c6t|}t||}|rA||t	z}t
||z}||t|ddS)z/Generate a legacy script wrapper and install itr[N)	rris_python_script_load_templaterr
get_headerrr@)rrroscript_textdev_pathr0	is_scriptbodys        r9rlzeasy_install.install_script&s4&&(())$[+>>		F&&x00688;D&11+>>EK+y'='=sCCCCCr8cd}|r|dd}td|}|dS)z
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        zscript.tmplz.tmplz (dev).tmplrutf-8)rJrdecode)rr	raw_bytess   r9rzeasy_install._load_template0sG	8<<77D#L$77	(((r8tr7cLfd|Dtjd|jtjj|}|jrdSt}t|tj|rt	j|t|d|z5}||dddn#1swxYwYt|d|z
dS)z1Write an executable file to the scripts directorycZg|]'}tjj|(Sr7)rrr:rp)rrVrs  r9rz-easy_install.write_script..Bs+@@@!RW\\$/1
-
-@@@r8zInstalling %s script to %sNrAi)rrrrprrr:rvr
current_umaskr*rrrHr`chmod)rrormodertargetmaskrZs`       r9rzeasy_install.write_script?sR@@@@x@@@	
	
	
	-{DOLLLdo{;;<	F   
7>>&!!	If
&#*
%
%	
GGH															
fedl#####s$DD

D
c|j|j|jd}	||dd}|||gS#t$rYnwxYw|}t
j|r,|dst|||j
n>t
j|rt
j|}|
|r |jr|||||}t
j|d}t
j|st%t
j|dd}|s/t'dt
j|zt)|dkr/t'dt
j|z|d	}|jr*t-j|||gS|||S)
N)r.exez.whl.pyzsetup.pyrz"Couldn't find a setup script in %srSzMultiple setup scripts in %sr)install_egginstall_exe
install_wheelrKeyErrorrrisfilerrunpack_progressrabspath
startswithrtrr:rrr	r*r`rrreport_editablebuild_and_install)	rr0rr
installer_mapinstall_distrsetup_scriptsetupss	         r9rzeasy_install.install_eggsSsA$$&


	9(##%%bcc*L!L7788			D	

7>>-((	81G1G1N1N	8=&$2FGGGG
W]]=
)
)	877J!!&))	J(	J-1-=}jIIJw||J
;;w~~l++	%"',,z3
CCDDF
$8GOOM2236{{Q$2GOOM223"!9L=	DHT))$==>>>I)),
CCCs"A
AActj|r/t|tj|d}n!tt
j|}tj	||S)NEGG-INFO)metadata)
rrrr#r:r$	zipimportzipimporterr"
from_filename)regg_pathrs   r9rzeasy_install.egg_distributionsw
7==""	D#Hbgll8;E/G/GHHHH#9#8#B#BCCH)(XFFFFr8c	tj|jtj|}tj|}|jst|||}tj	|r!tj
||stj|r;tj|stj||jnDtj	|r%|tj|fd|z	d}tj|r3||rt$jd}}nwt$jd}}nh||r|||jd}}n4d}||rt$jd}}nt$jd}}||||f|dztj|tj|fzt5||	n #t6$rt5|d	wxYw||||S)
Nr	Removing FMovingCopying
ExtractingTz	 %s to %sfix_zipimporter_caches)rrr:rorerrr*rrsamefilerrrremove_treer,rrrrcopytreermkpathunpack_and_compilecopy2r_update_dist_cachesr6rv)rrrdestinationrnew_dist_is_zippedrZrQs        r9rzeasy_install.install_eggsgllGX&&

gook22|	*[)))$$X..GNN;'')	,.G,<,.s=



GLLT!W--


r8)rr)r0r	r"rKrrrr:egg_namerr*r#	_provider
exe_to_eggrrHr`itemsrJtitlerIrrrrmake_zipfilerrr)
rrrcfgrregg_tmp	_egg_infopkg_infrZkvrps
            @r9rzeasy_install.install_exesT!-00; :]J
V44GGJ	22\^^


7<<

&(@AA 
V#GLL*55	',,y*55!!!%gy99
w///w~~g&&	Wc""A
GG-...		*--
K
K1(((GG!))C*=*=*C*C*E*E*E*EqqqIJJJ
GGIIIW\\)Y77




$--d33


			
	gt|T\	
	
	
	
&111r8c 
t|
ggi
fd}t||g}D]}|dr|d}|d}tj|ddz|d<tjj	g|R}
||
|tj|||tj
tj	dtj|dD]}	t|	rtj	d|	dz}
tj|
sat#|
d	}|d
	t|	d
z|dS)z;Extract a bdist_wininst to the directories an egg would usecR|}	D]c\}}||rG||t|dz}|d}t	jjg|R}|}|ds|dratj	|d|d<dtj
|dd<|n^|drI|dkrCdtj
|dd<
||cSe|d	stj
d
|dS)N/.pyd.dllrSrrSCRIPTS/rYzWARNING: can't process %s)rrr*rrrr:rrstrip_modulesplitextrsrrk)srcrr?oldnewpartsrrnative_libsprefixes
to_compile	top_levels       r9processz(easy_install.exe_to_egg..processs		A$



S<<$$CHHII.CIIcNNE',w7777CB{{6**/bkk&.A.A/$-$:59$E$Eb	CD	"'"2"258"<"=%(version)s")  # this version or higher
        z
        Note also that the installation directory must be on sys.path at runtime for
        this to work.  (e.g. by being the application's script directory, by being on
        PYTHONPATH, or by being added to sys.path by your code.)
        	Installedcd}|jrG|js@|d|jzz
}|jt	t
tjvr
|d|jzz
}|j	}|j
}|j}d}|tzS)z9Helpful installation message for display to package usersz
%(what)s %(eggloc)s%(extras)srFr)
ryr~_easy_install__mv_warningrorrrr_easy_install__id_warningrrrgr)	rreqrwhatregglocrrgextrass	         r9rz easy_install.installation_reportXs/	0dn	04$+++Cs>38'D'DDDtd/// ,VXX~r8aR
        Extracted editable version of %(spec)s to %(dirname)s

        If it uses setuptools in its setup script, you can activate it in
        "development" mode by going to that directory and running::

            %(python)s setup.py develop

        See the setuptools documentation for the "develop" command for more info.
        ctj|}tj}d|jt
zzS)NrF)rrr_rra_easy_install__editable_msgr)rr0rr_pythons     r9rzeasy_install.report_editableqs3'//,//d)FHH444r8ctjdttjdtt|}|jdkr'd|jdz
z}|dd|zn!|jdkr|dd|jr|dd	tj
d
|t|dzdd|	t||dS#t$r#}td|jd|d}~wwxYw)
Nzdistutils.command.bdist_eggzdistutils.command.egg_infor)rrSrrz-qz-nz
Running %s %s zSetup script exited with )rmodulesrrrrrrrrrr*r:rrr	ru)rrrrurs     r9rzeasy_install.run_setupvsQ*>?$	
	
	
	lD)))))			 .12<
	sD
E(EEcddg}tjdtj|}	|tj|||||||t|g}g}|D];}||D]0}||	|j
|1<|s|jstj
d||t|tj|jS#t|tj|jwxYw)Nrz
--dist-dirz
egg-dist-tmp-)r}dirz+No eggs found in %s (setup script problem?))r~rrrr__set_fetcher_optionsrsrr rrrrrkrr)r)	rrrrudist_dirall_eggseggsr{rs	         r9rzeasy_install.build_and_installsh\*#"(E(E


	,%%bgool&C&CDDDKK!!!NN<T:::"H:..HD
M
M$SMMMDKK 0 0
 K KLLLLM
#
#F!###8dl++++
8dl++++sC
D//*EcD|jd}d}i}|D]\}}||vr
|d||<t	|}t
j|d}tj	||dS)a
        When easy_install is about to run bdist_egg on a source dist, that
        source dist might have 'setup_requires' directives, requiring
        additional fetching. Ensure the fetcher options given to easy_install
        are available to that command as well.
        r.)rsrrrrvr{rS)r.z	setup.cfgN)
rrcopyrrrrr:redit_config)	rrtei_optsfetch_directives
fetch_optionsr{rsettingscfg_filenames	         r9r5z!easy_install._set_fetcher_optionss#33NCCHHJJ



	(	(HC***!$QM#]333w||D+66<22222r8c|jdS|j|jD]v}|js|j|jkrt	jd||j||j|jvr|j|jw|js|j|jjvrt	jd|n\t	jd||j	||j|jvr|j
|j|jrdS|j|jdkrdStj|jd}tj|rtj|t'|d5}||j|jdzddddS#1swxYwYdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filersetuptools.pthwtrF)rr{ryrrrrrpathsrrsrsaverrr:rorrrHr`
make_relative)rrrTrrZs     r9rzeasy_install.update_pthsI= Ftx(	4	4A%
!*
*E*EH=qAAAM  ###zT--- ''
333!
	;}
 333J
=tDDD
!!$'''=(888$++DM:::<	F
8|##F7<< 02BCC
7>>(##	 Ih
(D
!
!	GQ
GGDM//
>>EFFF	G	G	G	G	G	G	G	G	G	G	G	G	G	G	G	G	G	Gs66G99G=G=c2tjd|||S)NzUnpacking %s to %s)rdebug)rrrs   r9rzeasy_install.unpack_progresss	&S111
r8cggfd}t|||js?D]>}tj|tjdzdz}t
||=dSdS)NcF|dr+|ds|n?|ds|dr|||jr|pdS)Nr	EGG-INFO/r	z.so)rrrsrr)rrrto_chmodrs  r9pfz+easy_install.unpack_and_compile..pfs||E""
%3>>++F+F
%!!#&&&&f%%
%e)<)<
%$$$  c***|#+3t3r8imi)rrrrstatST_MODEr)rrrrMrZrrLrs`     @@r9rzeasy_install.unpack_and_compiles
	4	4	4	4	4	4	4	xb111*%%%|	

DL1U:fDa		

r8c>tjrdSddlm}	t	j|jdz
||dd|j|jr|||jd|jt	j|jdS#t	j|jwxYw)Nr)rrS)rvforcer)	rdont_write_bytecodedistutils.utilrrr)rrrv)rrrs   r9rzeasy_install.byte_compiles"	F//////	,dlQ.///Laq$,OOOO}
a L

dl+++++Cdl++++sABBa
        bad install directory or PYTHONPATH

        You are attempting to install a package to a directory that is not
        on PYTHONPATH and which Python does not read ".pth" files from.  The
        installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s

        and your PYTHONPATH environment variable currently contains:

            %r

        Here are some of your options for correcting the problem:

        * You can choose a different installation directory, i.e., one that is
          on PYTHONPATH or supports .pth files

        * You can add the installation directory to the PYTHONPATH environment
          variable.  (It must then also be on PYTHONPATH whenever you run
          Python and want to use the package(s) you are installing.)

        * You can set up the installation directory to support ".pth" files by
          using one of the approaches described here:

          https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations


        Please make the appropriate changes for your system and try again.
        c|jsdSttjd}t|jD]c}||rLtj	|s-|
d|ztj|dddS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)rhrrrr
	only_strsrvaluesrrdebug_printrC)rhomers   r9rzeasy_install.create_home_path/sy	FBG..s3344d.557788	)	)Dt$$
)RW]]4-@-@
)  !;d!BCCCD%(((	)	)r8z/$base/lib/python$py_version_short/site-packagesz	$base/binrrz$base/Lib/site-packagesz
$base/Scriptsc|dj}|jrt|}|j|d<|jtj|j}|	D]'\}}t||dt|||(ddlm
}|D]`}t||}|L|||}tjdkrtj|}t|||adS)Nrrtr)rr)get_finalized_commandrr}rINSTALL_SCHEMESrKrrDEFAULT_SCHEMErrrrSrrr
)rrrschemerrrs       r9rzeasy_install._expandEs00;;G;	-{++K"&+K)--bgt7JKKF#\\^^
-
-	c4t,,4D$,,,------	)	)D$%%C jk227g%%',,S11CdC(((
	)	)r8)T)Fr)rr7)r%)O__name__
__module____qualname____doc__descriptioncommand_consumes_argumentsrruser_optionsboolean_optionsnegative_optrrrrrstaticmethodrrrrrr rrr3r<r.rrGrHlstriprTrVrWrFrGrprvryr|rcontextmanagerrr.rrrrrrnrlrrrrrrrrr'r(rr.rrrr5rrrrrIrLrrr]r^rr7r8r9r.r.bs}114K!%	17GM769G?H	<	F	@KHH6E	5?	F	:T^KL9L<O#H-LL/
/
/
b666\rrrh((\(&

\

(
(
()))III

!
!
!9999:	L	L	L


+#+#+#Z'x(

VXX&ho'

VXX	#8?$

VXX """999v+++&&&666LLLLB" " " " HOOO+/'I'I'I'IR.%%%DDDD))\)$$$$(1D1D1DfGGG626262p+2+2+2\333j222:#8?	$	
	
VXX#8?$

L%X_	&	
	
VXX555
,,,,0333.'G'G'GR
&,,,&'x(

<UWW=@)))ddI"


OT-"N
)))))r8r.ctjddtj}td|S)NrBr)rrJrKrpathsepfilter)rs r9_pythonpathro\s7JNN<,,222:>>E$r8c
gttjg}tjtjkr|tj|D]}}|stjdvr5tj	|ddntj
dkritj	|ddjtjdtj	|ddgn6|tj	|ddgtjdkr
d	|vrtj
d
}|s3tj	|ddd
jtjd}|tdtdf}fd|Dt jrt jt'jt*5t!jdddn#1swxYwYt/t1t2S)z&
    Return a list of 'site' dirs
    )os2emxriscosLibz
site-packagesrrzpython{}.{}zsite-pythondarwinzPython.frameworkHOMELibraryPythonrpurelibplatlibc3$K|]
}|v|VdSrr7)rr?sitedirss  r9rz get_site_dirs..s->>!AX,=,=A,=,=,=,=>>r8N)rrorr}rrsrrrr:seprrrJrKrrrrrrrgetsitepackagesrrr)rr}rYhome_sp	lib_pathsr{s     @r9rras
H
OOKMM"""
|H
#*$$((()!)!	<///OOBGLLHHIIII
Vs]]OO(M(#*:;#	VUM::




OOVUO<<


<8##
V++z~~f%%	',,GNC,-

	    ##Xi%8%88IOO>>>>y>>>>>>('''		^	,	,00,..///000000000000000C1122HOs/'J""J&)J&c#Ki}|D]Q}t|}||vrd||<tj|sd||<tj|sc|tj|fV|SdS)zBYield sys.path directories that might contain "old-style" packagesrSrY)r@rBimportN)
rrrrrrrHr:rr+rIrrstrip)inputsseenr_rurrZlineslines        r9expand_pathsrsD&-&- ))d??W
w}}W%%	
7##un	-	-D==((
===RW\\'40011AQ((E
GGIII
-
-??8,,%dkkmm444<<T
w}}T**BJt,,,,,,,
-	-&-&-r8cFt|d}	tj|}|	|dS|d|dz
|dz
}|dkr	|dS||dz
tjd|d\}}}|dvr	|dS||d|zz
d	d	d
}tj	|}	||}	|	
ddd
}
|
tj
}
|tj|
n*#tj$rY|dSwxYw|dr|ds	|dS||S#|wxYw)znExtract configuration data from a bdist_wininst .exe

    Returns a configparser.RawConfigParser, or None
    rbN	z:	
					7AY*fQi7	r>>2	
					1	
y2~#]6166"::>>VU...(	
					%	
yBK()))44*400		66&>>DZZq))!,F]]3#<#>#>??FMM"+f--....!				
						z**	#//'2J2J		
						
								sHH
 H
6AH
4H

A>F	H
	F0H
/F00-H
4H

H c	,gd}tj|}	|D]}|j}|d}t|dkr\|ddkrP|ddr5|dd|d	dd
fnt|dks|ds|dr|d	d
vr|
|}t|D]b}|
dd}|ds#||dd|ddfc|n#|wxYwd|D}|||S)z4Get exe->egg path translations for a given .exe file))zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)rzEGG-INFO/scripts/)zDATA/lib/site-packagesrrr
r)rrSz	.egg-inforNrKrYz
-nspkg.pth)PURELIBPLATLIB\rrc@g|]\}}||fSr7)r)rrVys   r9rz$get_exe_prefixes..s(44441aA444r8)rZipFileinfolistrrr*rrr:upperrrr+rIrJrrsrIsortreverse)exe_filenamerrOrrrrpths        r9r1r1sH	%%AJJLL	L	LD=DJJsOOE5zzQ58z#9#98$$[11OOArr(;(;['IJJJE5zzQdmmF&;&;}}\**
Qx~~#99966$<<..00&x00LLC))++--dC88C>>(33L eAhhh*Dr(JKKK									448444HMMOOOOsFGGcdeZdZdZdZdfd	ZdZdZedZ	fdZ
fd	Zd
ZxZ
S)r/z)A .pth file with Distribution paths in itFr7c
||_ttt||_tt
j|j|_|	tgddt|j
D]2}tt|jt|d3dS)NT)rrrrr{rrr_basedir_loadsuper__init__r+rDrr)rrr{r	__class__s    r9rzPthDistributions.__init__(s 
S::;;
%bgoodm&D&DEE


T4(((
++	@	@DTX1$==>>????	@	@r8cg|_d}t|j}tj|jr8t|jd}|D]}|	drd}|
}|j||r'|	drttj|j|x}|jd<tj|r||vr"|jd|_d||<
||jr	|sd|_|jr`|jdsE|j|jr#|jd?dSdSdSdS)NFrtrT#r
rS)rDrfromkeysr{rrrrrHrrrsrIrr:rrpopdirtyrI)r
saw_importrrZrrs      r9rzPthDistributions._load1s

}}T]++
7>>$-((	T]D))A

??8,,!%J{{}}
!!$'''zz||tzz||'>'>s'C'C)7GLLt44))tz"~w~~d++tt||JNN$$$!%DJT


GGIII:	j	DJj	B!5!5!7!7	JNNj	B!5!5!7!7									r8c|jsdStt|j|j}|rtjd|j||}d	|dz}tj|jrtj
|jt|jd5}||dddn#1swxYwYnWtj|jr3tjd|jtj
|jd|_dS)z$Write changed .pth file back to diskNz	Saving %srFrCzDeleting empty %sF)rrrrFrDrrHr_wrap_linesr:rrrrrHr`r)r	rel_pathsrdatarZs     r9rEzPthDistributions.savePs\z	FT/<<==		%Ik4=111$$Y//E99U##d*Dw~~dm,,
)	$-(((dmT**
a

















W^^DM
*
*	%I)4=999Idm$$$


sC..C25C2c|Srr7)rs r9rzPthDistributions._wrap_linesfsr8c
|j|jvo)|j|jvp|jtjk}|r&|j|jd|_t|dS)z"Add `dist` to the distribution mapTN)	rrDr{rgetcwdrsrrr)rrnew_pathrs   r9rzPthDistributions.addjs
M+

T]2-
,			Jdm,,,DJ
Dr8c|j|jvr4|j|jd|_|j|jv4t	|dS)z'Remove `dist` from the distribution mapTN)rrDrrr)rrrs  r9rzPthDistributions.removexs`mtz))Jdm,,,DJmtz))	tr8c.tjt|\}}t	|j}|g}tjdkrdptj}t	||kr||jkrH|tj	|
||Stj|\}}||t	||k|S)Nr)rrrrr*raltsepr|rscurdirrr:)rrnpathlastbaselenrr|s       r9rFzPthDistributions.make_relativesgmmN4$8$899tdl##i3&30"&%jjG##$$RY'''

xx&'--..KE4LL
%jjG##Kr8)r7)r`rarbrcrrrrErirrrrF
__classcell__)rs@r9r/r/#s33E@@@@@@>,\






r8r/cPeZdZedZedZedZdS)RewritePthDistributionsc#@K|jV|D]}|V|jVdSr)preludepostlude)clsrrs   r9rz#RewritePthDistributions._wrap_linessBk		DJJJJlr8z?
        import sys
        sys.__plen = len(sys.path)
        z
        import sys
        new = sys.path[sys.__plen:]
        del sys.path[sys.__plen:]
        p = getattr(sys, '__egginsert', 0)
        sys.path[p:p] = new
        sys.__egginsert = p + len(new)
        N)r`rarbclassmethodrrLrrr7r8r9rrsW[j

Gz

HHHr8rSETUPTOOLS_SYS_PATH_TECHNIQUErawrewritecttjtrtSt	jtjS)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )rr
patternrrecompilerr7r8r9_first_line_rers@
-'--:m+2244555r8c|tjtjfvr5tjdkr%t	|t
j||Stj\}}}|d|dd|d|zf)NrrrSr1)	rrrrrrNS_IWRITErrU)funcargexcetevrs      r9
auto_chmodrsv	29%%%"'T//
c4=!!!tCyyIBA
a5"Q%%tttSS12
33r8ct|}t|tj|rt	|dSt|dS)aa

    Fix any globally cached `dist_path` related data

    `dist_path` should be a path of a newly installed egg distribution (zipped
    or unzipped).

    sys.path_importer_cache contains finder objects that have been cached when
    importing data from the original distribution. Any such finders need to be
    cleared since the replacement distribution might be packaged differently,
    e.g. a zipped egg distribution might get replaced with an unzipped egg
    folder or vice versa. Having the old finders cached may then cause Python
    to attempt loading modules from the replacement distribution using an
    incorrect loader.

    zipimport.zipimporter objects are Python loaders charged with importing
    data packaged inside zip archives. If stale loaders referencing the
    original distribution, are left behind, they can fail to load modules from
    the replacement distribution. E.g. if an old zipimport.zipimporter instance
    is used to load data from a new zipped egg archive, it may cause the
    operation to attempt to locate the requested data in the wrong location -
    one indicated by the original distribution's zip archive directory
    information. Such an operation may then fail outright, e.g. report having
    read a 'bad local file header', or even worse, it may fail silently &
    return invalid data.

    zipimport._zip_directory_cache contains cached zip archive directory
    information for all existing zipimport.zipimporter instances and all such
    instances connected to the same archive share the same cached directory
    information.

    If asked, and the underlying Python implementation allows it, we can fix
    all existing zipimport.zipimporter instances instead of having to track
    them down and remove them one by one, by updating their shared cached zip
    archive directory information. This, of course, assumes that the
    replacement distribution is packaged as a zipped egg.

    If not asked to fix existing zipimport.zipimporter instances, we still do
    our best to clear any remaining zipimport.zipimporter related cached data
    that might somehow later get used when attempting to load data from the new
    distribution and thus cause such load operations to fail. Note that when
    tracking down such remaining stale data, we can not catch every conceivable
    usage from here, and we clear only those that we know of and have found to
    cause problems if left alive. Any remaining caches should be updated by
    whomever is in charge of maintaining them, i.e. they should be ready to
    handle us replacing their zip archives with new distributions at runtime.

    N)r_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)	dist_pathrnormalized_paths   r9rrsXx%Y//O_c5666D)/::::: 	3?CCCCCr8cg}t|}|D]V}t|}||r0|||dztjdfvr||W|S)ap
    Return zipimporter cache entry keys related to a given normalized path.

    Alternative path spellings (e.g. those using different character case or
    those using alternative path separators) related to the same path are
    included. Any sub-path entries are included as well, i.e. those
    corresponding to zip archives embedded in other zip archives.

    rSr)r*rrrr|rs)rcacheresult
prefix_lenpnps      r9"_collect_zipimporter_cache_entriesrs}F_%%J

A

MM/**	:j1n,-"&"==MM!Mr8clt||D]"}||}||=|o|||}||||<#dS)a
    Update zipimporter cache data for a given normalized path.

    Any sub-path entries are processed as well, i.e. those corresponding to zip
    archives embedded in other zip archives.

    Given updater is a callable taking a cache entry key and the original entry
    (after already removing the entry from the cache), and expected to update
    the entry and possibly return a new one to be inserted in its place.
    Returning None indicates that the entry should not be replaced with a new
    one. If no updater is given, the cache entries are simply removed without
    any additional processing, the same as if the updater simply returned None.

    N)r)rrupdaterr	old_entry	new_entrys      r9_update_zipimporter_cacher$s_0
G
G!!!H	!H59 5 5	  E!H!!r8c&t||dSr)r)rrs  r9rrDsou55555r8cDd}t|tj|dS)Nc.|dSr)clearrrs  r92clear_and_remove_cached_zip_archive_directory_datazf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_dataIsr8rrr_zip_directory_cache)rrs  r9rrHsE7BDDDDDDr8__pypy__cDd}t|tj|dS)Nc|tj||tj||Sr)rrrrrrs  r9)replace_cached_zip_archive_directory_datazT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data_sG
OO!$'''Y;DABBBr8rr)rrs  r9rr^s?				"Y;=	?	?	?	?	?	?r8cZ	t||ddS#ttf$rYdSwxYw)z%Is this string a valid Python script?execTF)rSyntaxError	TypeError)rKrs  r9	is_pythonrqsIh'''t
#uus**c	tj|d5}|d}dddn#1swxYwYn#ttf$r|cYSwxYw|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)encodingr)N#!)rrHrrDrE)rafpmagics   r9is_shr{s
WZ)
4
4
4	GGAJJE															WD=s.A:A>A>AAAc,tj|gS)z@Quote a command line argument according to Windows parsing rules
subprocesslist2cmdline)rs r9nt_quote_argrs"C5)))r8c|ds|drdSt||rdS|dr.d|dvSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    r.pywTrr/rF)rrr
splitlinesr)rrs  r9rrs8#4#4V#<#<th''td##?;1133A6<<>>>>5r8)rcdSrr7)rus r9_chmodrr>r8ctjd||	t||dS#tj$r }tjd|Yd}~dSd}~wwxYw)Nzchanging mode of %s to %ozchmod failed: %s)rrHrrerror)rrras   r9rrsxI)4666)tT
8)))	$a((((((((()s*AAAceZdZdZgZeZedZedZ	edZ
edZedZdZ
edZd	Zed
ZedZdS)
CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    c|S)zV
        Choose the best CommandSpec class based on environmental conditions.
        r7rs r9rzCommandSpec.bests	

r8ctjtj}tjd|S)N__PYVENV_LAUNCHER__)rrrrrarJrK)r_defaults  r9_sys_executablezCommandSpec._sys_executables07##CN33z~~3X>>>r8ct||r|St|tr||S||S||S)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        )rrfrom_environmentfrom_string)rparams  r9
from_paramzCommandSpec.from_paramsdeS!!	LeT""	3u::='')))u%%%r8c>||gSr)r&r"s r9r(zCommandSpec.from_environments!sC''))*+++r8cFtj|fi|j}||S)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )shlexr
split_args)rstringrs   r9r)zCommandSpec.from_strings+F55cn55s5zzr8ctj|||_t	j|}t
|sdg|jdd<dSdS)Nz-xr)r.r_extract_optionsoptionsrrrD)rrcmdlines   r9install_optionszCommandSpec.install_optionssc{4#8#8#E#EFF)$//w	& $vDL!	&	&r8c|dzd}t|}|r|dpdnd}|S)zH
        Extract any options from the first line of the script.
        rFrrSr)rrmatchgrouprI)orig_scriptfirstr7r3s    r9r2zCommandSpec._extract_optionssb
t#//11!4  &&u--*/7%++a..&BR}}r8cV||t|jzSr)_renderrr3rs r9	as_headerzCommandSpec.as_headers#||D4#5#55666r8cd}|D]8}||r!||r|ddcS9|S)Nz"'rSr
)rr)item_QUOTESqs   r9
_strip_quoteszCommandSpec._strip_quotessW	"	"Aq!!
"dmmA&6&6
"AbDz!!!r8cNtjd|D}d|zdzS)Nc3nK|]0}t|V1dSr)r rBrI)rr?s  r9rz&CommandSpec._render..sQ*G*G8^^%%F4&&(())%		EJ&E ..u55;;==

b%%d+++!lVXX5++E4MMCIIII	
		r8cRtjd|}|rtddS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)rsearchr)rhas_path_seps  r9rWzScriptWriter._ensure_safe_nameQs9
y400	LJKKK	L	Lr8ctjdt|rtn|SNzUse best)rjrkrlrIr)r
force_windowss  r9
get_writerzScriptWriter.get_writerZs<	
j"?@@@-:J"'')))

Jr8ctjdks tjdkr)tjdkrt
S|S)zD
        Select the best ScriptWriter for this environment.
        win32javar)rrrr_namerIrr"s r9rzScriptWriter.best`s@
<7""rw&'8'8RX=M=M&++---Jr8c#K|||zfVdSrr7)rrZrrMrs     r9rYzScriptWriter._get_script_argsjs$Vk)******r8rc|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrr+r5r=)rrracmds    r9rzScriptWriter.get_headerosH$))++66zBBK(((}}r8)NFr)rN)r`rarbrcrGrHrjrXr rirrNrJrrirWrbrrYrr7r8r9rrsA
x! !
!
BVXXC
F%---[-777[7["LL\LKK[K
[++[+[r8rceZdZeZedZedZedZedZ	e
dZdS)rIc^tjdt|Sr`)rjrkrlrr"s r9rbzWindowsScriptWriter.get_writerzs%	
j"?@@@xxzzr8c~tt|}tjdd}||S)zC
        Select the best ScriptWriter suitable for Windows
        )ranaturalSETUPTOOLS_LAUNCHERra)rWindowsExecutableLauncherWriterrrJrK)r
writer_lookuplaunchers   r9rzWindowsScriptWriter.bestsA
6



:>>"7FFX&&r8c#Ktdd|}|tjddvr3djdit
}tj|tgd}|
||||}fd|D}|z||zd	|fVd
S)z For Windows, add a .py extension.pyarrRPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)rtr
-script.py.pyc.pyorrcg|]}|zSr7r7rrVrs  r9rz8WindowsScriptWriter._get_script_args..***D1H***r8rNr7)rrrJrrrrrjrkUserWarningr_adjust_header)	rrZrrMrextrrrs	  `      r9rYz$WindowsScriptWriter._get_script_argss6v...u5bj+113399#>>>>-!!xx!!C
M#{+++KKK

3##E622****c***Sj&;.X======r8cd}d}|dkr||}}tjtj|tj}|||}||r|n|S)z
        Make sure 'pythonw' is used for gui and 'python' is used for
        console (regardless of what sys.executable is).
        r[r\rT)r0repl)rrescape
IGNORECASEsub_use_header)rrZorig_headerrr
pattern_ob
new_headers       r9r~z"WindowsScriptWriter._adjust_headersm E>> 'TGZ	' 2 2BMBB
^^;T^BB
 __Z88IzzkIr8cz|ddd}tjdkpt|S)z
        Should _adjust_header use the replaced header?

        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        r)r
"rd)rIrrr)rclean_headers  r9rzWindowsScriptWriter._use_headers:"!B$'--c22|w&G/,*G*GGr8N)r`rarbrFrirrbrrYr~rirr7r8r9rIrIws+[

'
'[
'
>
>[
>JJ[J	H	H\	H	H	Hr8rIc$eZdZedZdS)rpc#K|dkrd}d}dg}nd}d}gd}|||}fd|D}	|z||zd|	fVd	zt|d
fVtsdz}
|
tdfVdSdS)
zG
        For Windows, add a .py extension and an .exe launcher
        rTz-script.pywrclirw)rrxrycg|]}|zSr7r7r{s  r9rzDWindowsExecutableLauncherWriter._get_script_args..r|r8rrr[z
.exe.manifestN)r~get_win_launcherr:load_launcher_manifest)rrZrrMr
launcher_typerrhdrrm_names  `        r9rYz0WindowsExecutableLauncherWriter._get_script_argss
E>>!MC(CC!MC)))C  //****c***cz3,c8<<<<6M+M::
	
	
	
zz	>O+F1$77======	>	>r8N)r`rarbrrYr7r8r9rprps->>[>>>r8rpcd|z}tr@tdkr|dd}n-|dd}n|dd}td|S)z
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    z%s.exez	win-arm64rz-arm64.z-64.z-32.r)r:rrJr)typelauncher_fns  r9rrs{T/Kzz7>>[((%--c9==KK%--c6::KK!))#v66<555r8c~tjtd}|dt	zS)Nzlauncher manifest.xmlr)
pkg_resourcesrr`rvars)rmanifests  r9rrs0,X7NOOH??7##dff,,r8Fc.tj|||Sr)rr)r
ignore_errorsonerrors   r9rrs=}g666r8cVtjd}tj||S)N)rumask)tmps r9rrs!
(5//CHSMMMJr8c$td|S)z,
    Exclude non-str values. Ref #3063.
    c,t|tSr)rr)rs r9zonly_strs..	sjc22r8)rn)rWs r9rVrVs22F;;;r8ceZdZdZdS)rlzF
    Warning for EasyInstall deprecations, bypassing suppression.
    N)r`rarbrcr7r8r9rlrl	sr8rlr)r)|rcrrSrrrdistutils.errorsrrr	r
r+rrdistutils.command.build_scriptsr
rbrdistutils.commandrrrrrr~rrrNr7rGrjrr5rrr.rrrrrrrsetuptools.sandboxrsetuptools.commandrsetuptools.archive_utilrsetuptools.package_indexrrrrrsetuptools.wheelrrrrrrr r!r"r#r$r%r&r'r(_pathr*extern.jaraco.textr+filterwarnings
PEP440Warning__all__r:r@rDrLr.rorrr0r1r/rrJrKrrrrrrrbuiltin_module_namesrrrrrrrImportErrorrr r&sys_executablerFrrIrprNrJrrrrrVrlr7r8r9rsx

''''''33333333$#######999999++++++%%%%%%



				



				







				333333((((((%%%%%%22222232222222""""""$$$$$$,,,,,,	M,GHHHH%%%===w)w)w)w)w)7w)w)w)t'
CCCL+-+-+-\&&&R"""Jiiiii{iiiX




.


,:>>1599YFF.	6	6	6444ODODODd(!!!!@666DDD")))2&%???&***

"""""""








)))P%P%P%P%P%$P%P%P%h,,..########qqqqqqqqh>H>H>H>H>H,>H>H>HB>>>>>&9>>>@. 2666&---
 %j7777<<<$@s'F..F98F9PK!-command/__pycache__/bdist_rpm.cpython-311.pycnu[

,ReRddlmcmZddlZddlmZGddejZdS)N)SetuptoolsDeprecationWarningceZdZdZdZdZdS)	bdist_rpma
    Override the default bdist_rpm behavior to do the following:

    1. Run egg_info to ensure the name and version are properly calculated.
    2. Always run 'install' using --single-version-externally-managed to
       disable eggs in RPM distributions.
    ctjdt|dtj|dS)Nzjbdist_rpm is deprecated and will be removed in a future version. Use bdist_wheel (wheel packages) instead.egg_info)warningswarnrrun_commandorigrrun)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/bdist_rpm.pyrz
bdist_rpm.runsQ

A(	
	
	
	
$$$4     c\tj|}d|D}|S)Ncbg|],}|dddd-S)zsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0lines  r
z-bdist_rpm._make_spec_file..sU	
	
	

LL#G

g8		
	
	
r)rr_make_spec_file)r
specs  rrzbdist_rpm._make_spec_files>~--d33	
	
	
	
	
rN)__name__
__module____qualname____doc__rrrrrrs<
!
!
!rr)distutils.command.bdist_rpmcommandrrr
setuptoolsrrrrr sq*********333333!!!!!!!!!!rPK!]~no)command/__pycache__/build.cpython-311.pycnu[

,ReddlZddlZddlmZmZmZddlmZddl	m
Z
ejdkrddlmZnerddl
mZnddlmZhdZGd	d
eZGddeZdS)
N)
TYPE_CHECKINGListDict)build)SetuptoolsDeprecationWarning))Protocol)ABC>build_py	build_ext
build_clib
build_scriptsc<eZdZejddZfdZxZS)rNcdtjD}|tz
r-d}tj|t
tj|_t
S)Nch|]
}|dS)r).0cmds  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build.py	z)build.get_sub_commands..s===#s1v===z
            It seems that you are using `distutils.command.build` to add
            new subcommands. Using `distutils` directly is considered deprecated,
            please use `setuptools.command.build`.
            )_buildsub_commands_ORIGINAL_SUBCOMMANDSwarningswarnrsuperget_sub_commands)selfsubcommandsmsg	__class__s   rrzbuild.get_sub_commandssd==)<===..	4C

M#;<<< & 3Dww'')))r)__name__
__module____qualname__rrr
__classcell__)r#s@rrrsI&qqq)L
*
*
*
*
*
*
*
*
*rrceZdZUdZdZeed<	eed<	dZdZ	dZ
deefd	Zdeefd
Z
deeeffdZdS)
SubCommanda.In order to support editable installations (see :pep:`660`) all
    build subcommands **SHOULD** implement this protocol. They also **MUST** inherit
    from ``setuptools.Command``.

    When creating an :pep:`editable wheel <660>`, ``setuptools`` will try to evaluate
    custom ``build`` subcommands using the following procedure:

    1. ``setuptools`` will set the ``editable_mode`` attribute to ``True``
    2. ``setuptools`` will execute the ``run()`` command.

       .. important::
          Subcommands **SHOULD** take advantage of ``editable_mode=True`` to adequate
          its behaviour or perform optimisations.

          For example, if a subcommand doesn't need to generate an extra file and
          all it does is to copy a source file into the build directory,
          ``run()`` **SHOULD** simply "early return".

          Similarly, if the subcommand creates files that would be placed alongside
          Python files in the final distribution, during an editable install
          the command **SHOULD** generate these files "in place" (i.e. write them to
          the original source directory, instead of using the build directory).
          Note that ``get_output_mapping()`` should reflect that and include mappings
          for "in place" builds accordingly.

    3. ``setuptools`` use any knowledge it can derive from the return values of
       ``get_outputs()`` and ``get_output_mapping()`` to create an editable wheel.
       When relevant ``setuptools`` **MAY** attempt to use file links based on the value
       of ``get_output_mapping()``. Alternatively, ``setuptools`` **MAY** attempt to use
       :doc:`import hooks ` to redirect any attempt to import
       to the directory with the original source code and other files built in place.

    Please note that custom sub-commands **SHOULD NOT** rely on ``run()`` being
    executed (or not) to provide correct return values for ``get_outputs()``,
    ``get_output_mapping()`` or ``get_source_files()``. The ``get_*`` methods should
    work independently of ``run()``.
    F
editable_mode	build_libcdSz@(Required by the original :class:`setuptools.Command` interface)Nrr s rinitialize_optionszSubCommand.initialize_optionsircdSr-rr.s rfinalize_optionszSubCommand.finalize_optionslr0rcdSr-rr.s rrunzSubCommand.runor0rreturncdS)a
        Return a list of all files that are used by the command to create the expected
        outputs.
        For example, if your build command transpiles Java files into Python, you should
        list here all the Java files.
        The primary purpose of this function is to help populating the ``sdist``
        with all the files necessary to build the distribution.
        All files should be strings relative to the project root directory.
        Nrr.s rget_source_fileszSubCommand.get_source_filesrr0rcdS)a
        Return a list of files intended for distribution as they would have been
        produced by the build.
        These files should be strings in the form of
        ``"{build_lib}/destination/file/path"``.

        .. note::
           The return value of ``get_output()`` should include all files used as keys
           in ``get_output_mapping()`` plus files that are generated during the build
           and don't correspond to any source file already present in the project.
        Nrr.s rget_outputszSubCommand.get_outputs}r0rcdS)a
        Return a mapping between destination files as they would be produced by the
        build (dict keys) into the respective existing (source) files (dict values).
        Existing (source) files should be represented as strings relative to the project
        root directory.
        Destination files should be strings in the form of
        ``"{build_lib}/destination/file/path"``.
        Nrr.s rget_output_mappingzSubCommand.get_output_mappingr0rN)r$r%r&__doc__r*bool__annotations__strr/r2r4rr7r9rr;rrrr)r)$s$$L M4NNN(OOOOOOOOO	$s)				T#YDcNrr))sysrtypingrrrdistutils.command.buildrr
setuptoolsrversion_infor
typing_extensionsabcrrr)rrrrGs"



,,,,,,,,,,333333333333v$*******######QPP*****F***"nnnnnnnnnnrPK!˝../command/__pycache__/upload_docs.cpython-311.pycnu[

,Re.dZddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZd	d
lmZdZGdd
eZdS)z|upload_docs

Implements a Distutils 'upload_docs' subcommand (upload documentation to
sites other than PyPi such as devpi).
)standard_b64encode)log)DistutilsOptionErrorN)metadata)SetuptoolsDeprecationWarning)uploadc.|ddS)Nzutf-8surrogateescape)encode)ss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/upload_docs.py_encoders88G.///ceZdZdZdZdddejzfddgZejZdZd	efgZ	d
Z
dZdZd
Z
edZedZdZdS)upload_docszhttps://pypi.python.org/pypi/z;Upload documentation to sites other than PyPi such as devpizrepository=rzurl of repository [default: %s])z
show-responseNz&display full response text from server)zupload-dir=Nzdirectory to uploadcZt|jduotjddS)Nzdistutils.commandsbuild_sphinx)groupname)bool
upload_dirrentry_pointsselfs r
has_sphinxzupload_docs.has_sphinx/s8Ot#
W%,@~VVV

	
rrcJtj|d|_d|_dS)N)r
initialize_optionsr
target_dirrs rr zupload_docs.initialize_options7s%!$'''rctjdtj||j|r5|d}t|jd|_	na|d}tj|j
d|_	n!|d|j|_	|d|j	zdS)NzWUpload_docs command is deprecated. Use Read the Docs (https://readthedocs.org) instead.rhtmlbuilddocsrzUsing upload directory %s)rwarnr
finalize_optionsrrget_finalized_commanddictbuilder_target_dirsr!ospathjoin
build_baseensure_dirnameannounce)rrr$s   rr'zupload_docs.finalize_options<s
1	2	2	2	%%%?"  
I#99.II"&|'G"H"H"P227;;"$',,u/?"H"H---"oDO

1DOCDDDDDrctj|d}	||jt	j|jD]\}}}||jkr|sd}t
||jz|D]}tj||}|t|jd
tjj}	tj|	|}
|||
	|
dS#|
wxYw)Nwz'no files found in upload directory '%s')zipfileZipFilemkpathr!r+walkrr,r-lenlstripsepwriteclose)rfilenamezip_filerootdirsfilestmplrfullrelativedests           rcreate_zipfilezupload_docs.create_zipfileMs.?8S11	KK(((%'WT_%=%=
/
/!dE4?**5*DD.tdo/EFFF!//D7<<d33D#C$8$8$9$9:AA"'+NNH7<<$77DNN4....	/	
/
NNHNNsC9D''D=ctjdt|D]}||tj}|jj	}tj|d|z}	|
|||tj|dS#tj|wxYw)Nziupload_docs is deprecated and will be removed in a future version. Use tools like httpie or curl instead.z%s.zip)warningsr&rget_sub_commandsrun_commandtempfilemkdtempdistributionrget_namer+r,r-rEupload_fileshutilrmtree)rcmd_nametmp_dirrr=s     rrunzupload_docs.run]s

>(	
	
	
--//	'	'HX&&&&"$$ )22447<<D99	#)))X&&&M'"""""FM'""""s*CC2c#0K|\}}d|z}t|ts|g}|D]n}t|tr|d|dzz
}|d}nt|}|Vt|VdV|V|r|dddkrdVodS)	Nz*
Content-Disposition: form-data; name="%s"z; filename="%s"rr	s



)
isinstancelisttupler)itemsep_boundarykeyvaluestitlevalues      r_build_partzupload_docs._build_partqsV=C&$''	XF		E%''
'*U1X55a%..   MMMKKK
rssu,,		rcbd}d|dz}|dz}|df}tj|j|}t	||}tj|}t
j||}	d|z}
d	|	|
fS)	z=
        Build up the MIME payload for the POST data
        z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--asciis--rW)r\z multipart/form-data; boundary=%sr)
r
	functoolspartialramapitems	itertoolschain
from_iterabler-)clsdataboundaryr\end_boundary	end_itemsbuilderpart_groupsparts
body_itemscontent_types           r_build_multipartzupload_docs._build_multiparts
I!9!99#e+ %(	#O%


'4::<<00--k::_UI66
9HDxx
##\11rcRt|d5}|}dddn#1swxYwY|jj}d|t
j||fd}t|j	dz|j
z}t|d}d|z}|
|\}}	d|jz}
||
t jt$j|j\}}}
}}}|s|s|rJ|dkr t*j|}n8|d	kr t*j|}nt3d
|zd}	||d|
|	}|d
||dt;t=||d||| |nJ#tBj"$r8}|t;|t j#Yd}~dSd}~wwxYw|$}|j%dkr3d|j%d|j&}
||
t jn|j%dkrT|'d}|d|z}d|z}
||
t jn2d|j%d|j&}
||
t j#|j(r%tSd|ddSdS)Nrb
doc_upload)z:actionrcontent:rczBasic zSubmitting documentation to %shttphttpszunsupported schema POSTzContent-typezContent-length
AuthorizationzServer response (z): i-Locationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (zK---------------------------------------------------------------------------)*openreadrLrrMr+r,basenamerusernamepasswordrdecoderu
repositoryr0rINFOurllibparseurlparser{clientHTTPConnectionHTTPSConnectionAssertionErrorconnect
putrequest	putheaderstrr7
endheaderssendsocketerrorERRORgetresponsestatusreason	getheader
show_responseprint)rr<frymetarlcredentialsauthbodyctmsgschemanetlocurlparamsquery	fragmentsconnrterlocations                      rrNzupload_docs.upload_files
(D
!
!	QffhhG															 )#MMOO((22G<

dmc1DMABB(55<<888NN+ST^^<<<NN?D111OOIIdOOOO|			MM#a&&#),,,FFFFF	
8s???01!((CCMM#sx((((
X__{{:..H9DMMOOK/(:CMM#sx((((/0hhhACMM#sy)))	0(AFFHHh/////	0	0s%266B1IJ-JJN)__name__
__module____qualname__DEFAULT_REPOSITORYdescriptionr
user_optionsboolean_optionsrsub_commandsr r'rErSstaticmethodraclassmethodrurNrrrrs9OK
	*V-F	F	H	34L,O


$Z01L
EEE" ###(\&22[2$<0<0<0<0<0rr)__doc__base64r	distutilsrdistutils.errorsrr+rr3rJrOrhrdhttp.clientr{urllib.parserrG
_importlibrr}rr
rrrrrrs0&%%%%%111111				







!!!!!!++++++000u0u0u0u0u0&u0u0u0u0u0rPK!Ekk-command/__pycache__/dist_info.cpython-311.pycnu[

,RedZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZGd
de
Zded
efdZded
efdZdZdZdS)zD
Create a dist_info directory
As defined in the wheel specification
N)contextmanager)cleandoc)Path)Command)log)	packaging)SetuptoolsDeprecationWarningc\eZdZdZgdZddgZddiZdZdZe	de
d	efd
ZdZ
dS)
	dist_infozcreate a .dist-info directory))z	egg-base=ezjdirectory containing .egg-info directories (default: top of the source tree) DEPRECATED: use --output-dir.)zoutput-dir=ozYdirectory inside of which the .dist-info will becreated (default: top of the source tree))tag-datedz0Add date stamp (e.g. 20050528) to version number)z
tag-build=bz-Specify explicit tag to add to version number)no-dateDz"Don't include date stamp [default])
keep-egg-infoNz,*TRANSITIONAL* will be removed in the futurerrrchd|_d|_d|_d|_d|_d|_d|_dS)NF)egg_base
output_dirname
dist_info_dirtag_date	tag_build
keep_egg_info)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/dist_info.pyinitialize_optionszdist_info.initialize_options(s;
	!
"c|jr/d}tj|t|jp|j|_|j}|jptj}t|jp||_|
d}t|j|_|jr
|j|_n|j|_|j
r
|j
|_
n|j
|_
|||_t!|}t%|}|d||_tj|j|jd|_dS)NzA--egg-base is deprecated for dist_info command. Use --output-dir.egg_info-z
.dist-info)rwarningswarnr	rdistributionsrc_rootoscurdirrreinitialize_commandstrrrfinalize_optionsr!_safeget_name_versionget_versionrpathjoinr)rmsgdistproject_dirr!rversions       rr+zdist_info.finalize_options1sN=	?UCM#;<<<"m>tDO m0ryt=+>>,,Z8800=	. $
H$-DM>	0!%H%/DN!!### 
T]]__%%4++--..''g''	W\\$/di;S;S;STTrdir_pathrequires_bkpc#K|r|d}t|dt||dd	dVt|dtj||dS#t|dtj||wxYwdVdS)Nz.__bkp__T)
ignore_errors)
dirs_exist_oksymlinks)_rm_copyshutilmove)rr6r7bkp_names    r_maybe_bkp_dirzdist_info._maybe_bkp_dirPs
	",,,H----(HD4HHHH
0HD1111Hh/////HD1111Hh////EEEEEsA(Bc4|jdd|j|jj}tj|s
Jdtjd	tj
|j|d}|
||j5|||jddddS#1swxYwYdS)NT)parentsexist_okz&.egg-info dir should have been createdz
creating '{}'bdist_wheel)rmkdirr!runr'r0isdirrinfoformatabspathrget_finalized_commandrAregg2dist)regg_info_dirrEs   rrGz
dist_info.run^sLdT:::
}-w}}\**TT,TTTT''8J(K(KLLMMM00??
 
 t/A
B
B	C	C  t/ABBB	C	C	C	C	C	C	C	C	C	C	C	C	C	C	C	C	C	Cs$D

DDN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr+rr*boolrArGrrrrs1K


L"?3Oz*L###UUU>s$^CCCCCrr	componentreturnc.tjdd|S)zAEscape a component used to form a wheel name according to PEP 491z	[^\w\d.]+_)resub)rXs rr,r,ls
6,Y///rr5c||dd}	ttj|ddS#tjj$rOd|d|d}t
jt|t|
dcYSwxYw)z0Convert an arbitrary string to a version string. .r"r[zInvalid version: zk.
        !!


        ###################
        # Invalid version #
        ###################
        z is not valid according to PEP 440.

        Please make sure specify a valid version for your package.
        Also note that future releases of setuptools may halt the build process
        if an invalid version is given.
        

!!
        )replacer*rr5VersionInvalidVersionr#r$rr,strip)r5vr2s   rr.r.qsS!!A#9$,,Q//0088cBBB+
#
#
#
G






	
hsmm$$$Qxx~~c"""""
#s?AA B;:B;cltj|rtj|fi|dSdS)N)r'r0rHr>rmtree)dir_nameoptss  rr<r<s@	w}}X(
h''$'''''((rcxtjdkr|ddtj||fi|dS)N)r:)sysversion_infopopr>copytree)srcdstris   rr=r=sD
&  $'''
OC%%%%%%%r)__doc__r'r\r>rmr#
contextlibrinspectrpathlibrdistutils.corer	distutilsrsetuptools.externrsetuptools._deprecation_warningr	rr*r,r.r<r=rWrrr{sc

							







%%%%%%""""""''''''HHHHHHTCTCTCTCTCTCTCTCn0S0S0000
#c#c####*(((
&&&&&rPK!xo؛؛,command/__pycache__/egg_info.cpython-311.pycnu[

,RehdZddlmZddlmZddlmZddlm	Z	ddlZddlZddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddlm-Z-dZ.GddZ/Gdde/eZ0GddeZGddeZ1dZ2dZ3dZ4d Z5d!Z6d"Z7d#Z8d$Z9d+d&Z:d'Z;d(Z<Gd)d*e-Z=dS),zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError)convert_path)logN)metadata)
_entry_points)Command)sdist)walk_revctrl)edit_config)	bdist_egg)Requirement	safe_name
parse_versionsafe_versionto_filename)glob)	packaging)yield_lines)SetuptoolsDeprecationWarningcd}|jtjj}t	jtj}d|d}t
|D]f\}}|t|dz
k}|dkr|r|dz
}n|d|d|d	z
}7d
}t|}	||	kr||}
|
dkr	||dzz
}n|
dkr||z
}n|
d
kr|dz}||	kr||dkr|dz}||	kr||dkr|dz}||	kr#||dkr|dz}||	kr||dk||	kr|t	j|
z
}na||dz|}d}
|d
dkrd}
|dd}|
t	j|z
}
|d
|
dz
}|}n|t	j|
z
}|dz
}||	k|s||z
}h|dz
}t	j|tj	tj
zS)z
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    z[^]**z.*z(?:+z)*r*?[!^Nz\Z)flags)splitospathsepreescape	enumeratelencompile	MULTILINEDOTALL)rpatchunksr'
valid_charcchunk
last_chunki	chunk_lencharinner_iinner
char_classs              /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/egg_info.pytranslate_patternr<'s
CTZ
$
$F
)BF

CCCC!Jf%%>>5#f++/)
D==
8tzzz33377
JJ	)mm8Ds{{zC''z!a%Y&&5>S+@+@%kGY&&5>S+@+@%kG	))eGn.C.C%kG	))eGn.C.Ci''29T??*CC"!a%-0E!#JQx3%(
 %abb	")E"2"22JCZZZ11C AAry&
FAU)mmZ	3JC5LC
:c	!9::::cveZdZdZdZedZdZdZde	de
fdZde	fdZde	fd	Z
ee
ZdS)

InfoCommonNcNt|jSN)rdistributionget_nameselfs r;namezInfoCommon.name~s*3355666r=ctt||jSrA)r
_maybe_tagrBget_versionrDs r;tagged_versionzInfoCommon.tagged_versions+DOOD,=,I,I,K,KLLMMMr=cR|jr||r|n	||jzS)z
        egg_info may be called more than once for a distribution,
        in which case the version string already contains all tags.
        )vtags_already_taggedrEversions  r;rHzInfoCommon._maybe_tags6z
&d&:&:7&C&C
&GG4:%	
r=rOreturnc||jp&||SrA)endswithrL
_safe_tagsrNs  r;rMzInfoCommon._already_taggeds7
++Rw/?/?@Q@Q/R/RRr=c@td|jddS)N0r)rrLrDs r;rSzInfoCommon._safe_tagss&,
,,--abb11r=chd}|jr
||jz
}|jr|tjdz
}|S)Nrz-%Y%m%d)	tag_buildtag_datetimestrftimerNs  r;tagszInfoCommon.tagss@>	&t~%G=	0t}Y///Gr=)__name__
__module____qualname__rWrXpropertyrFrJrHstrboolrMrSr[rLr=r;r?r?zsIH
77X7NNN


SsStSSSS
2C2222
c
HTNNEEEr=r?ceZdZdZgdZdgZddiZdZedZ	e	j
dZ	dZd	ZddZ
dZd
ZdZdZdZdS)egg_infoz+create a distribution's .egg-info directory))z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree))tag-datedz0Add date stamp (e.g. 20050528) to version number)z
tag-build=bz-Specify explicit tag to add to version number)no-dateDz"Don't include date stamp [default]rfricZd|_d|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerdegg_versionbroken_egg_infoignore_egg_info_in_manifestrDs r;initialize_optionszegg_info.initialize_optionss5


$+0(((r=cdSrArbrDs r;tag_svn_revisionzegg_info.tag_svn_revisionr=cdSrArb)rEvalues  r;rszegg_info.tag_svn_revisionrtr=ctj}||d<d|d<t|t	|dS)z
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        rWrrX)rdN)collectionsOrderedDictr[r
dict)rEfilenamerds   r;save_version_infozegg_info.save_version_infosQ*,,!%		 HdH55566666r=c|j|_||_t	|j}	t|tjj}|rdnd}t||j|jfznB#t$r5}tj
d|jd|j|d}~wwxYw|j3|jj}|pidt$j|_|dt+|jdz|_|jt$jkr/t$j|j|j|_d|jvr||j|jj_|jj}|U|j|jkr5|j|_t	|j|_d|j_dSdSdS)Nz%s==%sz%s===%sz-Invalid distribution name or version syntax: -rrl	.egg-info) rFrmrJrnr
isinstancerrOVersionr
ValueError	distutilserrorsDistutilsOptionErrorrlrBpackage_dirgetr%curdirensure_dirnamerrdr&joincheck_broken_egg_infor
_patched_distkeylower_version_parsed_version)rEparsed_version
is_versionspecredirspds       r;finalize_optionszegg_info.finalize_optionss
	
..00&t'788	#NI4E4MNNJ)888yD
t/?@@AAAA			"777 0 02
	= $0D!ZR,,R;;DMJ'''#DM22[@
=BI%%GLL
FFDM$-&&(((
.2-="*

,
>bf
(;(;(=(===*BK!.t/?!@!@B.2D+++>==sAA??
B>	0B99B>Fc|r||||dStj|r3||st	jd||dS||dSdS)aWrite `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        Nz$%s not set in setup(), but %s exists)
write_filer%r&existsrwarndelete_file)rEwhatr{dataforces     r;write_or_delete_filezegg_info.write_or_delete_files		+OOD(D11111
W^^H
%
%	+|E|:D(  *****	+	+r=ctjd|||d}|js;t	|d}|||dSdS)zWrite `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        zwriting %s to %sutf-8wbN)rinfoencodedry_runopenwriteclose)rErr{rfs     r;rzegg_info.write_filesm	#T8444{{7##|	Xt$$A
GGDMMM
GGIIIII		r=cjtjd||jstj|dSdS)z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)rrrr%unlink)rEr{s  r;rzegg_info.delete_file"s>)))|	 Ih	 	 r=c	||jtj|jdt	jdD]P}|}|||jtj	|j|jQtj	|jd}tj
|r|||dS)Nzegg_info.writers)groupznative_libs.txt)
mkpathrdr%utimerentry_pointsloadrFr&rrrfind_sources)rEepwriternls    r;runzegg_info.run(sDM"""
%%%'.@AAA	H	HBWWYYFF4"',,t}bg"F"FGGGGW\\$-):
;
;
7>>"	!R   r=ctj|jd}t	|j}|j|_||_|	|j
|_
dS)z"Generate SOURCES.txt manifest filezSOURCES.txtN)r%r&rrdmanifest_makerrBrpignore_egg_info_dirmanifestrfilelist)rEmanifest_filenamemms   r;rzegg_info.find_sources6sVGLL
FF
D-
.
.!%!A'



r=c,|jdz}|jtjkr%tj|j|}tj|r0tjd||j	|j	|_
||_	dSdS)NraB------------------------------------------------------------------------------
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
------------------------------------------------------------------------------)rmrlr%rr&rrrrrdro)rEbeis  r;rzegg_info.check_broken_egg_info?smk)=BI%%',,t}c22C
7>>#		 HOT]


$(=D DMMM		 		 r=NF)r\r]r^descriptionuser_optionsboolean_optionsnegative_optrqr_rssetterr|rrrrrrrrbr=r;rdrds?KL"lO:L111

X



777+3+3+3Z++++(   $$$
 
 
 
 
 r=rdcteZdZdfd	ZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZxZS)rNFcZt||||_dSrA)super__init__r)rErdebug_printr	__class__s    r;rzFileList.__init__Rs+
{+++#6   r=c	|||\}}}}|j|j|j|jtj|j|tj|j||j	|j
d}dddddddd	d}	||}n1#t$r$td

|wxYw|d}	|d
vr|g}|	r|fnd}
||}|d|g|	r|gngz|z|D] }||st#j||g|
R!dS)N)includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')actionz
recursive->rrrb )_parse_template_linerrglobal_includeglobal_exclude	functoolspartialrecursive_includerecursive_excluderrKeyErrorrformat
startswithrrrr)
rElinerpatternsdirdir_pattern
action_maplog_mapprocess_actionaction_is_recursiveextra_log_argslog_tmplpatterns
             r;process_template_linezFileList.process_template_lineVs04/H/H/N/N,3||"1"1!*!2&"""+!2&""ZZ




? +6'2CM/

4	'/NN			(Af%%
	%//=='''#}H$7?#R6?HH-5#27

	
	
	
 	=	=G!>'**
=7<^<<<<	=	=sB		.B7cd}tt|jdz
ddD]E}||j|r-|d|j|z|j|=d}F|S)z
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Frz
 removing T)ranger+filesr)rE	predicatefoundr5s    r;
_remove_fileszFileList._remove_filess|
s4:*B33		AyA''
  
1
!=>>>JqMr=c|dt|D}||t|S)z#Include files that match 'pattern'.cPg|]#}tj|!|$Srbr%r&isdir.0rs  r;
z$FileList.include..s+BBBqq1A1ABBBBr=rextendra)rErrs   r;rzFileList.includes9BBDMMBBBEE{{r=cTt|}||jS)z#Exclude files that match 'pattern'.)r<rmatchrErrs   r;rzFileList.excludes%!'**!!%+...r=ctj|d|}dt|dD}||t|S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        rcPg|]#}tj|!|$Srbrrs  r;rz.FileList.recursive_include..s:***q

a((****r=T)	recursive)r%r&rrrra)rErrfull_patternrs     r;rzFileList.recursive_includescw||Cw77**D>>>***EE{{r=cttj|d|}||jS)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        rr<r%r&rrr)rErrrs    r;rzFileList.recursive_excludes9""',,sD'"B"BCC!!%+...r=c|dt|D}||t|S)zInclude all files from 'dir/'.cVg|]&}tj|D]}|'Srb)rrfindall)r	match_diritems   r;rz"FileList.graft..sP


!*229==






r=r)rErrs   r;rzFileList.graftsF

!#YY



	
EE{{r=cttj|d}||jS)zFilter out files from 'dir/'.rr)rErrs   r;rzFileList.prunes5!"',,sD"9"9::!!%+...r=c|j|ttjd|fd|jD}||t|S)z
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nrc>g|]}||Srb)r)rrrs  r;rz+FileList.global_include..s(<<%@%@AAAAAA	Bs"B75>B771C,+C,)NNF)r\r]r^rrrrrrrrrrrrrrr
__classcell__)rs@r;rrOs777777K=K=K=Z///
//////



///$$$:::???BBBBBBBr=rcdeZdZdZdZdZdZdZdZdZ	e
dZd	Zd
Z
dZdZd
S)rzMANIFEST.incLd|_d|_d|_d|_d|_dS)NrF)use_defaultsr
manifest_onlyforce_manifestrrDs r;rqz!manifest_maker.initialize_options"s/
#(   r=cdSrArbrDs r;rzmanifest_maker.finalize_options)sr=ct|j|_tj|js||tj|j	r|
|||j
|j|dS)N)r)rrrr%r&rrwrite_manifestadd_defaultstemplate
read_templateadd_license_filesprune_file_listsortremove_duplicatesrDs r;rzmanifest_maker.run,s T5MNNN
w~~dm,,	"!!!
7>>$-((	!      

'')))r=cjtj|}|tjdS)N/)rrreplacer%r')rEr&s  r;_manifest_normalizez"manifest_maker._manifest_normalize9s(+D11||BFC(((r=cjfdjjD}djz}t
j|f|dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        c:g|]}|Srb)r4)rrrEs  r;rz1manifest_maker.write_manifest..Es'JJJ))!,,JJJr=zwriting manifest file '%s'N)rrrrexecuter)rErmsgs`  r;r)zmanifest_maker.write_manifest=si
	

KJJJdm6IJJJ*T]:Z$-!7=====r=c^||stj||dSdSrA)_should_suppress_warningrr)rEr8s  r;rzmanifest_maker.warnIs:,,S11	"JtS!!!!!	"	"r=c,tjd|S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r(r)r8s r;r:z'manifest_maker._should_suppress_warningMs
x4c:::r=cdtj||j|j|j|jt
t}|r|j|n8tj
|jr|tj
dr|jd|
d}|j|jdS)Nzsetup.pyrd)rr*rrr+rrrrr%r&r
read_manifestget_finalized_commandrrd)rErcfilesei_cmds   r;r*zmanifest_maker.add_defaultsTs
4   
T]+++
T]+++|~~&&	!M  ))))
W^^DM
*
*	!   
7>>*%%	-
M  ,,,++J77
FO,,,,,r=c|jjjpg}|D]}tjd||j|dS)Nzadding license file '%s')rBr
license_filesrrrr)rErBlfs   r;r-z manifest_maker.add_license_filesfsV)2@FB
		BH/444
]+++++r=cZ|d}|j}|j|j|j|t
jtj	}|j
d|zdz|zddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)is_regex)r>rBget_fullnamerr
build_baser(r)r%r'exclude_pattern)rErEbase_dirr's    r;r.zmanifest_maker.prune_file_listms**733$1133
E,---
H%%%i
%%fsl5H&H3&N/0	&	2	2	2	2	2r=ct|dr|Stjdt|S)a0
        The parent class implementation of this method
        (``sdist``) will try to include data files, which
        might cause recursion problems when
        ``include_package_data=True``.

        Therefore, avoid triggering any attempt of
        analyzing/building the manifest again.
        get_data_files_without_manifestzCustom 'build_py' does not implement 'get_data_files_without_manifest'.
Please extend command classes from setuptools instead of distutils.)hasattrrLwarningsrrget_data_files)rEbuild_pys  r;_safe_data_fileszmanifest_maker._safe_data_filesvs[8>??	>;;===

5
)		
	
	
&&(((r=N)r\r]r^r+rqrrr4r)rstaticmethodr:r*r-r.rQrbr=r;rrsH)))


)))
>
>
>""";;\;---$,,,222)))))r=rcd|}|d}t|d5}||ddddS#1swxYwYdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    
rrN)rrrr)r{contentsrs   r;rrsyy""Hw''H	
h			sAA"%A"c~tjd||js|jj}|j|jc|_}|j|jc|_}	|j	|j
||c|_|_n#||c|_|_wxYwt|jdd}tj
|j
|dSdS)Nz
writing %szip_safe)rrrrBrrnrOrmrFwrite_pkg_infordgetattrrwrite_safety_flag)cmdbasenamer{roldveroldnamesafes       r;rXrXsH\8$$$;8#,#&?H4D &!$x}
w	>
$H#CL111.5v+HM8++gv+HM8+====s'T::#CL$7777788sA77Bcptj|rtjddSdS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r%r&rrrr[r\r{s   r;warn_depends_obsoleterbsF	w~~h

L	
	
	
	
	


r=cxt|pd}d}t||}||dS)Nrbc|dzS)NrTrb)rs r;	append_crz&_write_requirements..append_crsd{r=)rmap
writelines)streamreqslinesres    r;_write_requirementsrksK
##E	5!!E
er=c	p|j}tj}t||j|jpi}t
|D]D}|djditt|||E|
d||dS)Nz
[{extra}]
requirementsrb)rBioStringIOrkinstall_requiresextras_requiresortedrrvarsrgetvalue)r[r\r{distrrqextras       r;write_requirementsrwsD
;==Dd3444(.BN''99

)?)33DFF33444D."78888^Xt}}GGGGGr=ctj}t||jj|d||dS)Nzsetup-requirements)rnrorkrBsetup_requiresrrt)r[r\r{rs    r;write_setup_requirementsrzsJ
;==Dc.=>>>18T]]__MMMMMr=c	td|jD}|d|dt
|dzdS)NcFg|]}|dddS).rr)r$)rks  r;rz(write_toplevel_names..s9	
	
	

GGCOOA	
	
	
r=ztop-level namesrT)rzfromkeysrBiter_distribution_namesrrrr)r[r\r{pkgss    r;write_toplevel_namesrsv==	
	
%==??	
	
	
DNN$h		&,,0G0G$0NOOOOOr=c*t|||ddS)NT)	write_argras   r;
overwrite_argrs
c8Xt,,,,,r=Fctj|d}t|j|d}|d|dz}|||||dS)NrrT)r%r&splitextrYrBrr)r[r\r{rargnamervs      r;rrslgx((+GC$gt44E		%  4'Whu=====r=ctj|jj}tj|}|d||ddS)Nzentry pointsT)r	rrBrrenderr)r[r\r{epsdefns     r;
write_entriesrsH

S-:
;
;C$$D^XtTBBBBBr=cjtjdttjdryt
jd5}|D]I}tj	d|}|r0t|dccdddSJ	dddn#1swxYwYdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr)rNrEggInfoDeprecationWarningr%r&rrnrr(rintr)rrrs   r;get_pkg_info_revisionrs

M.0IKKK	w~~j!!/
WZ
 
 	/A
/
/!94@@/u{{1~~....		/	/	/	/	/	/	/	//
/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/

1s?B(B((B,/B,ceZdZdZdS)rz?Deprecated behavior warning for EggInfo, bypassing suppression.N)r\r]r^__doc__rbr=r;rrsIIIIr=rr)>rdistutils.filelistr	_FileListdistutils.errorsrdistutils.utilrrrrr%r(rrnrNrYrx
_importlibrrr	
setuptoolsr
setuptools.command.sdistrrsetuptools.command.setoptr
setuptools.commandr
pkg_resourcesrrrrrsetuptools.unicode_utilsrsetuptools.globrsetuptools.externrsetuptools.extern.jaraco.textrrr<r?rdrrrXrbrkrwrzrrrrrrrbr=r;rs<<544444333333''''''								



				!!!!!!******111111111111((((((100000      ''''''555555333333P;P;P;f&&&&&&&&Ri i i i i z7i i i XMBMBMBMBMByMBMBMB`j)j)j)j)j)Uj)j)j)Z


888&


HHHNNNPPP--->>>>CCC





 JJJJJ <JJJJJr=PK!>+,command/__pycache__/register.cpython-311.pycnu[

,ReVddlmZddlmcmZddlmZGddejZdS))logN)RemovedCommandErrorceZdZdZdZdS)registerz+Formerly used to register packages on PyPI.cjd}|d|ztjt|)Nz]The register command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgs  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/register.pyrunzregister.run
s6
3	
	


i#osy111!#&&&N)__name__
__module____qualname____doc__r
rrrrs)55'''''rr)	distutilsrdistutils.command.registercommandrorigsetuptools.errorsrrrrrsz)))))))))111111'''''t}'''''rPK!,544)command/__pycache__/sdist.cpython-311.pycnu[

,ReddlmZddlmcmZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZeZd
d
ZGdde
ejZdS))logN)chain)sdist_add_defaults)metadata)_ORIGINAL_SUBCOMMANDSc#KtjdD]&}||D]}|V'dS)z%Find all files under revision controlzsetuptools.file_finders)groupN)rentry_pointsload)dirnameepitems   /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/sdist.pywalk_revctrlrs_#*CDDDBGGIIg&&		DJJJJ	ceZdZdZgdZiZgdZedeDZdZ	dZ
dZdZe
ejd	Zfd
ZfdZdZd
ZdZdZfdZdZdZdZdZxZS)sdistz=Smart sdist that finds anything supported by revision control))zformats=Nz6formats for source distribution (comma-separated list))z	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r
z.rstz.txtz.mdc#@K|]}d|VdS)z	README{0}N)format).0exts  r	zsdist.-s0IIK&&s++IIIIIIrc|d|d}|j|_|jtj|jd||	D]}|||
t|jdg}|j
D] }dd|f}||vr||!dS)Negg_infozSOURCES.txt
dist_filesrr
)run_commandget_finalized_commandfilelistappendospathjoinr!check_readmeget_sub_commandsmake_distributiongetattrdistribution
archive_files)selfei_cmdcmd_namer"filedatas      rrunz	sdist.run/s$$$++J77

RW\\&/=IIJJJ--//	'	'HX&&&&   T.bAA
&	(	(DR&D:%%!!$'''	(	(rcltj||dSN)origrinitialize_options_default_to_gztarr0s rr9zsdist.initialize_optionsBs0
%%d+++     rc:tjdkrdSdg|_dS)N)rbetargztar)sysversion_infoformatsr;s rr:zsdist._default_to_gztarGs#333Fyrc|5tj|ddddS#1swxYwYdS)z%
        Workaround for #516
        N)_remove_os_linkr8rr,r;s rr,zsdist.make_distributionMs
!
!
#
#	/	/J((...	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/s AA	Ac#KGdd}ttd|}	t`n#t$rYnwxYw	dV||urt	td|dSdS#||urt	td|wwxYw)zG
        In a context, remove and restore os.link if it exists
        ceZdZdS)&sdist._remove_os_link..NoValueN)__name__
__module____qualname__rrNoValuerH[sDrrMlinkN)r-r'rN	Exceptionsetattr)rMorig_vals  rrEzsdist._remove_os_linkTs								2vw//				D		.EEEw&&FH-----'&xw&&FH----'s/
<<A""A?cpt|dSr7)superadd_defaults _add_defaults_build_sub_commandsr0	__class__s rrTzsdist.add_defaultsis1
--/////rcttjdr|jddSdS)Nzpyproject.toml)rS_add_defaults_optionalr'r(isfiler%r&rVs rrYzsdist._add_defaults_optionalmsW
&&(((
7>>*++	3M  !122222	3	3rc|jrk|d}|j||||dSdS)zgetting python filesbuild_pyN)r.has_pure_modulesr$r%extendget_source_files_add_data_files_safe_data_filesr0r\s  r_add_defaults_pythonzsdist._add_defaults_pythonrs--//	B11*==HM  !:!:!.}s1DD!**1--DDDDDDrc3^K|](}t|d|V)dS)r_N)hasattrr_)rrgs  rrz9sdist._add_defaults_build_sub_commands..~s>VV!wqBT7U7UV##%%VVVVVVr)r$setr+r	r%r^r
from_iterable)r0remissing_cmdscmdsfiless`    rrUz&sdist._add_defaults_build_sub_commandsys**73351133447LLDDDD|DDDVVtVVV
U07788888rc|jS)a
        Since the ``sdist`` class is also used to compute the MANIFEST
        (via :obj:`setuptools.command.egg_info.manifest_maker`),
        there might be recursion problems when trying to obtain the list of
        data_files and ``include_package_data=True`` (which in turn depends on
        the files included in the MANIFEST).

        To avoid that, ``manifest_maker`` should be able to overwrite this
        method and avoid recursive attempts to build/analyze the MANIFEST.
        )
data_filesrbs  rrazsdist._safe_data_filess
""rcN|jd|DdS)zA
        Add data files as found in build_py.data_files.
        c3jK|].\}}}}|D]$}tj||V%/dSr7)r'r(r))r_src_dir	filenamesnames     rrz(sdist._add_data_files..se

(7Ay!


GLL$''






rN)r%r^)r0rps  rr`zsdist._add_data_filessD	



,6


	
	
	
	
	
rc	tdS#t$rtjdYdSwxYw)Nz&data_files contains unexpected objects)rS_add_defaults_data_files	TypeErrorrwarnrVs rrxzsdist._add_defaults_data_filessY	?GG,,.....	?	?	?H=>>>>>>	?s %AAc|jD]$}tj|rdS%|dd|jzdS)Nz,standard file not found: should have one of z, )READMESr'r(existsrzr))r0fs  rr*zsdist.check_readmesp		Aw~~a  


II>		$,''(




rctj|||tj|d}t
tdrItj|r*tj||	d||
d|dS)Nz	setup.cfgrNr!)r8rmake_release_treer'r(r)rir}unlink	copy_filer$save_version_info)r0base_dirrndests    rrzsdist.make_release_trees
$$T8U;;;w||Hk222v	.27>>$#7#7	.
IdOOONN;---"":..@@FFFFFrc
tj|jsdSt	j|jd5}|}dddn#1swxYwY|dkS)NFrbz+# file GENERATED by distutils, do NOT edit
)r'r(rZmanifestioopenreadlineencode)r0fp
first_lines   r_manifest_is_not_generatedz sdist._manifest_is_not_generatedsw~~dm,,	5
WT]D
)
)	'RJ	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'>EEGGH	IsA""A&)A&ctjd|jt|jd}|D]}	|d}n'#t
$rtjd|zYrs&&&&&&&&&				



				******!!!!!!((((((zzzzz
zzzzzrPK!II/command/__pycache__/install_lib.cpython-311.pycnu[

,Re#^ddlZddlZddlmZmZddlmcmZGddejZdS)N)productstarmapcfeZdZdZdZdZdZedZdZ	edZ
	d
d
ZdZdS)install_libz9Don't add compiled flags to filenames of non-Python filesc||}|||dSdSN)buildinstallbyte_compile)selfoutfiless  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/install_lib.pyrunzinstall_lib.run
sD

<<>>h''''' cfdD}t|}tt	j|S)z
        Return a collections.Sized collections.Container of paths to be
        excluded for single_version_externally_managed installations.
        c3LK|]}|D]}|VdSr)
_all_packages).0ns_pkgpkgrs   r	z-install_lib.get_exclusions..s\

))&11









r)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rall_packages
excl_specss`  rget_exclusionszinstall_lib.get_exclusionsso




--//


\4+D+D+F+FGG
741:>>???rcl|d|gz}tjj|jg|RS)zw
        Given a package name and exclusion path within that package,
        compute the full exclusion path.
        .)splitospathjoininstall_dir)rrexclusion_pathpartss    rrzinstall_lib._exclude_pkg_paths8
		#.!11w|D,5u5555rc#PK|r!|V|d\}}}|dSdS)zn
        >>> list(install_lib._all_packages('foo.bar.baz'))
        ['foo.bar.baz', 'foo.bar', 'foo']
        r N)
rpartition)pkg_namesepchilds   rrzinstall_lib._all_packages'sQ	<NNN#+#6#6s#;#; Hc5	<	<	<	<	 %s)warninfor"r#dirnameappend)srcdstexcluder>r
s  rpfz!install_lib.copy_tree..pfhsig~~JuHH'bgooc.B.BCCCOOC   Jr)rorigr	copy_treesetuptools.archive_utilr=	distutilsr>)rinfileoutfile
preserve_modepreserve_timespreserve_symlinkslevelr=rGrFr>r
s         @@@rrIzinstall_lib.copy_treeWsII8IIII%%''	E#--dFGDDD	=<<<<<!!!!!!								"---rctj|}|rfd|DS|S)Ncg|]}|v|	SrT)rfrFs  r
z+install_lib.get_outputs..ys#;;;!!7*:*:A*:*:*:r)rHrget_outputsr)routputsrFs  @rrWzinstall_lib.get_outputsusQ"..t44%%''	<;;;;w;;;;rN)r;r;rr;)
__name__
__module____qualname____doc__rrrstaticmethodrrrrIrWrTrrrrsCC(((@@@666<<\<DDD ""\".KL<rr)	r"r8	itertoolsrrdistutils.command.install_libcommandrrHrTrrras				



&&&&&&&&,,,,,,,,,sssss$"sssssrPK!6_!==*command/__pycache__/setopt.cpython-311.pycnu[

,ReddlmZddlmZddlmZddlZddlZddlZddlm	Z	gdZ
ddZdd
ZGdde	Z
Gd
de
ZdS))convert_path)log)DistutilsOptionErrorN)Command)config_fileedit_configoption_basesetoptlocalc^|dkrdS|dkrGtjtjtjdS|dkrCtjdkrdpd}tjtd	|zStd
|)zGet the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    rz	setup.cfgglobalz
distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user')
ospathjoindirname	distutils__file__name
expanduserr
ValueError)kinddots  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/setopt.pyrr
s
w{xw||GOOI.//

	
v~~g (S.Bw!!,/Ds/J"K"KLLL
A4Fc	tjd|tj}d|_||g|D]-\}}|,tjd||||4|	|s+tjd|||
||D]\}}|ntjd||||||||s+tjd||||utjd|||||
|||/tjd	||s@t|d
5}||ddddS#1swxYwYdSdS)aYEdit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %sc|SN)xs rzedit_config..*srNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %sw)rdebugconfigparserRawConfigParseroptionxformreaditemsinforemove_sectionhas_sectionadd_section
remove_optionoptionssetopenwrite)	filenamesettingsdry_runoptssectionr1optionvaluefs	         rrr sRI-x888'))D"{DIIxj$NN,,55?H4gxHHH((((##G,,
*	97HMMM  )))!(
5
5
=I0&&w777<<005!F!((444++G444I3HHWfe4444!
5$H\8$$$
(C
 
 	AJJqMMM																		s1GGGc.eZdZdZgdZddgZdZdZdS)r	zr@c0d|_d|_d|_dSr!)
global_configuser_configr5selfs rinitialize_optionszoption_base.initialize_options\s!


rcg}|jr"|td|jr"|td|j||j|s"|tdt|dkrt
d||\|_dS)Nr
rrz/Must specify only one configuration file option)rCappendrrDr5lenr)rF	filenamess  rfinalize_optionszoption_base.finalize_optionsas		4[22333	2[00111=$T]+++	3[11222y>>A&A
#


rN)__name__
__module____qualname____doc__user_optionsboolean_optionsrGrMr"rrr	r	LsWFFL	O
#####rr	cVeZdZdZdZgdejzZejdgzZdZdZ	dZ
dS)	r
z#Save command-line options to a filez1set an option in setup.cfg or another config file))zcommand=czcommand to set an option for)zoption=oz
option to set)z
set-value=szvalue of the option)removerzremove (unset) the valuerXcrt|d|_d|_d|_d|_dSr!)r	rGcommandr:	set_valuerXrEs rrGzsetopt.initialize_optionss6&&t,,,rct||j|jt	d|j|jst	ddSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r	rMr[r:rr\rXrEs rrMzsetopt.finalize_optionss`$$T***<4;#6&'NOOO>!$+!&'MNNN"!!!rct|j|j|jdd|jii|jdS)N-_)rr5r[r:replacer\r7rEs rrunz
setopt.runsOMt{223<OOOO




rr
)r)F)distutils.utilrrrdistutils.errorsrrr'
setuptoolsr__all__rrr	r
r"rrrhs''''''111111				
A
A
A&))))X$#$#$#$#$#'$#$#$#N"
"
"
"
"
["
"
"
"
"
rPK!kAe.command/__pycache__/build_clib.cpython-311.pycnu[

,ReGbddlmcmZddlmZddlmZddlm	Z	GddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupceZdZdZdZdS)
build_clibav
    Override the default build_clib behaviour to do the following:

    1. Implement a rudimentary timestamp-based dependency system
       so 'compile()' doesn't run every time.
    2. Add more keys to the 'build_info' dictionary:
        * obj_deps - specify dependencies for each object compiled.
                     this should be a dictionary mapping a key
                     with the source filename to a list of
                     dependencies. Use an empty string for global
                     dependencies.
        * cflags   - specify a list of additional flags to pass to
                     the compiler.
    c	|D]v\}}|d}|t|ttfst	d|ztt|}t
jd||dt}t|tst	d|zg}|dt}t|ttfst	d|z|D]}|g}	|		|||t}
t|
ttfst	d|z|		|
|
|	|j||j
}t||ggfkri|d}|d	}
|d
}|j||j
||
||j|j|||j|jxdS)
Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list')
output_dirmacrosinclude_dirscflags)rr
rextra_postargsdebug)rr)get
isinstancelisttuplersortedrinfodictextendappendcompilerobject_filenames
build_temprcompilercreate_static_libr)self	librarieslib_name
build_infor	r
dependenciesglobal_depssourcesrc_deps
extra_depsexpected_objectsr
rrs               /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/build_clib.pybuild_librarieszbuild_clib.build_librariess&/M	M	"Xz nnY//Gj4-&H&H)13;<===T']]++GH,h777
"~~j$&&99Hh--
6)*,45666L#,,r46622KkD%=99
6)*,45666"

.

."8,,,%\\&$&&99
!*tUm<<:-.089:::
+++##H----#}==? >  %\3CDD8$11)~~n==#11
%%#!!-#)*
&
M++ ?j	
,



QM	M	N)__name__
__module____qualname____doc__r+r,r*rrs2

NNNNNr,r)
distutils.command.build_clibcommandrorigdistutils.errorsr	distutilsrsetuptools.dep_utilrr1r,r*r8s+++++++++000000444444^^^^^^^^^^r,PK!arSUSU/_vendor/__pycache__/ordered_set.cpython-311.pycnu[

,Re;dZddlZddlmZ	ddlmZmZn#e$rddlmZmZYnwxYwe	dZ
dZdZGddeeZ
dS)	z
An OrderedSet is a custom MutableSet that remembers its order, so that every
entry has an index that can be looked up.

Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger,
and released under the MIT license.
N)deque)
MutableSetSequencez3.1czt|do+t|tot|tS)a

    Are we being asked to look up a list of things, instead of a single thing?
    We check for the `__iter__` attribute so that this can cover types that
    don't have to be known by this module, such as NumPy arrays.

    Strings, however, should be considered as atomic values to look up, not
    iterables. The same goes for tuples, since they are immutable and therefore
    valid entries.

    We don't need to check for the Python 2 `unicode` type, because it doesn't
    have an `__iter__` attribute anyway.
    __iter__)hasattr
isinstancestrtuple)objs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/ordered_set.pyis_iterablers@	Z  	'3$$$	'3&&&ceZdZdZddZdZdZdZdZdZ	d	Z
d
ZeZdZ
dZeZeZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dS) 
OrderedSetz
    An OrderedSet is a custom MutableSet that remembers its order, so that
    every entry has an index that can be looked up.

    Example:
        >>> OrderedSet([1, 1, 2, 3, 2])
        OrderedSet([1, 2, 3])
    Nc4g|_i|_|||z}dSdSN)itemsmap)selfiterables  r
__init__zOrderedSet.__init__4s,
HDDD rc*t|jS)z
        Returns the number of unique elements in the ordered set

        Example:
            >>> len(OrderedSet([]))
            0
            >>> len(OrderedSet([1, 2]))
            2
        )lenrrs r
__len__zOrderedSet.__len__:s4:rct|tr|tkrSt	|rfd|DSt|dst|tr9j|}t|tr|S|Std|z)aQ
        Get the item at a given index.

        If `index` is a slice, you will get back that slice of items, as a
        new OrderedSet.

        If `index` is a list or a similar iterable, you'll get a list of
        items corresponding to those indices. This is similar to NumPy's
        "fancy indexing". The result is not an OrderedSet because you may ask
        for duplicate indices, and the number of elements returned should be
        the number of elements asked for.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset[1]
            2
        c*g|]}j|S)r).0irs  r

z*OrderedSet.__getitem__..[s111aDJqM111r	__index__z+Don't know how to index an OrderedSet by %r)
r	slice	SLICE_ALLcopyrrrlist	__class__	TypeError)rindexresults`  r
__getitem__zOrderedSet.__getitem__Fs$eU##	S(:(:99;;


		S111151111
UK
(
(	SJue,D,D	SZ&F&$''
~~f---
IEQRRRrc,||S)z
        Return a shallow copy of this object.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> other = this.copy()
            >>> this == other
            True
            >>> this is other
            False
        )r(rs r
r&zOrderedSet.copyes~~d###rcJt|dkrdSt|S)Nrr)rr'rs r
__getstate__zOrderedSet.__getstate__ss$t99>>7::rcj|dkr|gdS||dS)Nr)r)rstates  r
__setstate__zOrderedSet.__setstate__s=GMM"MM%     rc||jvS)z
        Test if the item is in this ordered set

        Example:
            >>> 1 in OrderedSet([1, 3, 2])
            True
            >>> 5 in OrderedSet([1, 3, 2])
            False
        )rrkeys  r
__contains__zOrderedSet.__contains__sdhrc||jvr6t|j|j|<|j||j|S)aE
        Add `key` as an item to this OrderedSet, then return its index.

        If `key` is already in the OrderedSet, return the index it already
        had.

        Example:
            >>> oset = OrderedSet()
            >>> oset.append(3)
            0
            >>> print(oset)
            OrderedSet([3])
        )rrrappendr4s  r
addzOrderedSet.addsFdh
OODHSMJc"""x}rcd}	|D]}||}n-#t$r tdt|zwxYw|S)a<
        Update the set with the given iterable sequence, then return the index
        of the last element inserted.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.update([3, 1, 5, 1, 4])
            4
            >>> print(oset)
            OrderedSet([1, 2, 3, 5, 4])
        Nz(Argument needs to be an iterable, got %s)r9r)
ValueErrortype)rsequence
item_indexitems    r
updatezOrderedSet.updatesv
	 
,
,!XXd^^


,			:T(^^K
	s	*A	cXt|rfd|DSj|S)aH
        Get the index of a given entry, raising an IndexError if it's not
        present.

        `key` can be an iterable of entries that is not a string, in which case
        this returns a list of indices.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.index(2)
            1
        c:g|]}|Sr)r*)r subkeyrs  r
r"z$OrderedSet.index..s%9996DJJv&&999r)rrr4s` r
r*zOrderedSet.indexs;s	:9999S9999x}rcl|jstd|jd}|jd=|j|=|S)z
        Remove and return the last element from the set.

        Raises KeyError if the set is empty.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.pop()
            3
        zSet is empty)rKeyErrorr)relems  r
popzOrderedSet.pops>z	+>***z"~JrNHTNrc||vrO|j|}|j|=|j|=|jD]\}}||kr
|dz
|j|<dSdS)a
        Remove an element.  Do not raise an exception if absent.

        The MutableSet mixin uses this to implement the .remove() method, which
        *does* raise an error when asked to remove a non-existent item.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
        N)rr)rr5r!kvs     r
discardzOrderedSet.discardss $;;
A
1

((
(
(166"#a%DHQK
;
(
(rcL|jdd=|jdS)z8
        Remove all items from this OrderedSet.
        N)rrclearrs r
rOzOrderedSet.clears)
JqqqMrc*t|jS)zb
        Example:
            >>> list(iter(OrderedSet([1, 2, 3])))
            [1, 2, 3]
        )iterrrs r
rzOrderedSet.__iter__sDJrc*t|jS)zf
        Example:
            >>> list(reversed(OrderedSet([1, 2, 3])))
            [3, 2, 1]
        )reversedrrs r
__reversed__zOrderedSet.__reversed__s
###rcb|s|jjdS|jjdt|dS)Nz()())r(__name__r'rs r
__repr__zOrderedSet.__repr__s>	7!^44466>222DJJJJ??rct|ttfr t|t|kS	t	|}t	||kS#t
$rYdSwxYw)a
        Returns true if the containers have the same items. If `other` is a
        Sequence, then order is checked, otherwise it is ignored.

        Example:
            >>> oset = OrderedSet([1, 3, 2])
            >>> oset == [1, 3, 2]
            True
            >>> oset == [1, 2, 3]
            False
            >>> oset == [2, 3]
            False
            >>> oset == OrderedSet([3, 2, 1])
            False
        F)r	rrr'setr))rotherother_as_sets   r
__eq__zOrderedSet.__eq__s{$eh.//	-::e,,	-u::L
t99,,				55	sA  
A.-A.ct|tr|jnt}tttj|g|}t
j|}||S)a
        Combines all unique items.
        Each items order is defined by its first appearance.

        Example:
            >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
            >>> print(oset)
            OrderedSet([3, 1, 4, 5, 2, 0])
            >>> oset.union([8, 9])
            OrderedSet([3, 1, 4, 5, 2, 0, 8, 9])
            >>> oset | {10}
            OrderedSet([3, 1, 4, 5, 2, 0, 10])
        )r	rr(rr'itchain
from_iterable)rsetscls
containersrs     r
unionzOrderedSet.union6s^!+4 < <Ldnn*rx5566
&&z22s5zzrc,||Sr)intersectionrr\s  r
__and__zOrderedSet.__and__Is  '''rct|tr|jnt}|r0tjtt|fd|D}n|}||S)a
        Returns elements in common between all sets. Order is defined only
        by the first set.

        Example:
            >>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3])
            >>> print(oset)
            OrderedSet([1, 2, 3])
            >>> oset.intersection([2, 4, 5], [1, 2, 3, 4])
            OrderedSet([2])
            >>> oset.intersection()
            OrderedSet([1, 2, 3])
        c3$K|]
}|v|VdSrr)r r?commons  r
	z*OrderedSet.intersection..^s'==ddfnnTnnnn==r)r	rr(r[rhr)rrcrdrrms    @r
rhzOrderedSet.intersectionMsj!+4 < <Ldnn*	%s3~~6F====d===EEEs5zzrc|j}|r0tjtt|fd|D}n|}||S)a
        Returns all elements that are in this set but not the others.

        Example:
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
            OrderedSet([1])
            >>> OrderedSet([1, 2, 3]) - OrderedSet([2])
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference()
            OrderedSet([1, 2, 3])
        c3$K|]
}|v|VdSrrr r?r\s  r
rnz(OrderedSet.difference..ts-@@dd%.?.?T.?.?.?.?@@r)r(r[rfr)rrcrdrr\s    @r

differencezOrderedSet.differencecsVn	Is3~~.E@@@@d@@@EEEs5zzrc~t|tkrdStfd|DS)a7
        Report whether another set contains this set.

        Example:
            >>> OrderedSet([1, 2, 3]).issubset({1, 2})
            False
            >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4})
            True
            >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5})
            False
        Fc3 K|]}|vV	dSrrrqs  r
rnz&OrderedSet.issubset..s'22T45=222222rrallris `r
issubsetzOrderedSet.issubsetysDt99s5zz!!52222T222222rc~tt|krdStfd|DS)a=
        Report whether this set contains another set.

        Example:
            >>> OrderedSet([1, 2]).issuperset([1, 2, 3])
            False
            >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3})
            True
            >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3})
            False
        Fc3 K|]}|vV	dSrrr r?rs  r
rnz(OrderedSet.issuperset..s'22D44<222222rruris` r

issupersetzOrderedSet.issupersetsDt99s5zz!!52222E222222rct|tr|jnt}|||}|||}||S)a
        Return the symmetric difference of two OrderedSets as a new set.
        That is, the new set will contain all elements that are in exactly
        one of the sets.

        Their order will be preserved, with elements from `self` preceding
        elements from `other`.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference(other)
            OrderedSet([4, 5, 9, 2])
        )r	rr(rrrf)rr\rddiff1diff2s     r
symmetric_differencezOrderedSet.symmetric_differencesf!+4 < <Ldnn*D		$$U++E

%%d++{{5!!!rcP||_dt|D|_dS)zt
        Replace the 'items' list of this OrderedSet with a new one, updating
        self.map accordingly.
        ci|]\}}||	Srr)r idxr?s   r

z,OrderedSet._update_items..sBBB+3D#BBBrN)r	enumerater)rrs  r

_update_itemszOrderedSet._update_itemss,

BB51A1ABBBrct|D]}t|z|fd|jDdS)a
        Update this OrderedSet to remove items from one or more other sets.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> this.difference_update(OrderedSet([2, 4]))
            >>> print(this)
            OrderedSet([1, 3])

            >>> this = OrderedSet([1, 2, 3, 4, 5])
            >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6]))
            >>> print(this)
            OrderedSet([3, 5])
        cg|]}|v|	Srrr r?items_to_removes  r
r"z0OrderedSet.difference_update..s#WWWT4;V;VD;V;V;VrNr[rr)rrcr\rs   @r
difference_updatezOrderedSet.difference_updates`%%	*	*Es5zz)OOWWWWTZWWWXXXXXrcrt|fd|jDdS)a^
        Update this OrderedSet to keep only items in another set, preserving
        their order in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.intersection_update(other)
            >>> print(this)
            OrderedSet([1, 3, 7])
        cg|]}|v|	Srrrqs  r
r"z2OrderedSet.intersection_update..sIIIT45==D===rNrris `r
intersection_updatezOrderedSet.intersection_updatesAE

IIIITZIIIJJJJJrcfd|D}t|fdjD|zdS)a
        Update this OrderedSet to remove items from another set, then
        add items from the other set that were not present in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference_update(other)
            >>> print(this)
            OrderedSet([4, 5, 9, 2])
        cg|]}|v|	Srrrzs  r
r"z:OrderedSet.symmetric_difference_update..s#CCC$d2B2B2B2B2Brcg|]}|v|	Srrrs  r
r"z:OrderedSet.symmetric_difference_update..s#HHHdD,G,GT,G,G,GrNr)rr\items_to_addrs`  @r
symmetric_difference_updatez&OrderedSet.symmetric_difference_updateskDCCCCCCe**HHHHdjHHH<W	
	
	
	
	
rr)#rX
__module____qualname____doc__rrr,r&r/r2r6r9r8r@r*get_locget_indexerrHrMrOrrTrYr^rfrjrhrrrwr{rrrrrrrr
rr*s


SSS>$$$


!!!


&F,$GK&(((0   $$$@@@
---<&(((,,333 333 """(CCCYYY(
K
K
K




rr)r	itertoolsr`collectionsrcollections.abcrrImportErrorr$r%__version__rrrrr
rs144444444411100000000001
E$KK	(~
~
~
~
~
X~
~
~
~
~
s
''PK!/,_vendor/__pycache__/__init__.cpython-311.pycnu[

,RedS)Nr/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/__init__.pyrsrPK!0>>(_vendor/__pycache__/zipp.cpython-311.pycnu[

,Re ddlZddlZddlZddlZddlZddlZddlZejdkrddlm	Z	ne
Z	dgZdZdZ
e	jZ	dZGdd	ejZGd
deZdZGd
dZdS)N))OrderedDictPathcHtjt|ddS)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    N)	itertoolsislice	_ancestrypaths /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/zipp.py_parentsrs IdOOQ555c#K|tj}|r?|tjkr3|Vtj|\}}|r|tjk-dSdSdSdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)rstrip	posixpathsepsplit)r
tails  rrr%s ;;y}%%D
+49=((


_T**
d+49=((((++++((rcPtjt|j|S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r	filterfalseset__contains__)minuend
subtrahends  r_differencer?s 
 Z!=wGGGrcZeZdZdZedZfdZdZdZe	dZ
xZS)CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    ctjtt|}d|D}tt
||S)Nc34K|]}|tjzVdSN)rr).0ps  r	z-CompleteDirs._implied_dirs..Ps)661y}$666666r)r	chain
from_iterablemapr_deduper)namesparentsas_dirss   r
_implied_dirszCompleteDirs._implied_dirsMsL///He0D0DEE66g666{7E22333rctt|}|t||zSr")superrnamelistlistr-)selfr*	__class__s  rr0zCompleteDirs.namelistSs?lD))2244tD..u556666rcDt|Sr")rr0r2s r	_name_setzCompleteDirs._name_setWs4==??###rcP|}|dz}||vo||v}|r|n|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        /)r6)r2namer*dirname	dir_matchs     rresolve_dirzCompleteDirs.resolve_dirZs?
  *%:'U*:	#-ww-rct|tr|St|tjs|t	|Sd|jvrt}||_|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r)
isinstancerzipfileZipFile_pathlib_compatmoder3)clssources  rmakezCompleteDirs.makedshfl++	M&'/22	03v..///fk!!C
r)__name__
__module____qualname____doc__staticmethodr-r0r6r<classmethodrF
__classcell__r3s@rrrGs
44\4
77777$$$...[rrc,eZdZdZfdZfdZxZS)
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    ctjt5|jcdddS#1swxYwYt	t
||_|jSr")
contextlibsuppressAttributeError_FastLookup__namesr/rPr0r2r3s rr0zFastLookup.namelist~s

 
0
0	 	 <	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 Z..7799|/33ctjt5|jcdddS#1swxYwYt	t
||_|jSr")rRrSrT_FastLookup__lookupr/rPr6rVs rr6zFastLookup._name_sets

 
0
0	!	!=	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!j$//99;;
}rW)rGrHrIrJr0r6rMrNs@rrPrPxs[
rrPcj	|S#t$rt|cYSwxYw)zi
    For path-like objects, convert to a filename for compatibility
    on Python 3.6.1 and earlier.
    )
__fspath__rTstrrs rrBrBsD
   4yys22ceZdZdZdZddZddddZed	Zed
Z	edZ
edZed
ZdZ
dZdZdZdZdZdZdZdZdZdZeZedZdS)ru4
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = zipfile.ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'mem/abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('mem/abcde.zip', 'a.txt')
    >>> b
    Path('mem/abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('mem/abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> import os
    >>> str(c).replace(os.sep, posixpath.sep)
    'mem/abcde.zip/b/c.txt'

    At the root, ``name``, ``filename``, and ``parent``
    resolve to the zipfile. Note these attributes are not
    valid and will raise a ``ValueError`` if the zipfile
    has no filename.

    >>> root.name
    'abcde.zip'
    >>> str(root.filename).replace(os.sep, posixpath.sep)
    'mem/abcde.zip'
    >>> str(root.parent)
    'mem'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})cRt||_||_dS)aX
        Construct a Path from a ZipFile or filename.

        Note: When the source is an existing ZipFile object,
        its type (__class__) will be mutated to a
        specialized type. If the caller wishes to retain the
        original type, the caller should either create a
        separate ZipFile object or pass a filename.
        N)rPrFrootat)r2r`ras   r__init__z
Path.__init__s"OOD))	rr>NpwdcJ|rt||d}|s|dkrt||j|j||}d|vr|s|rtd|Stj	|g|Ri|S)z
        Open this entry as text or binary following the semantics
        of ``pathlib.Path.open()`` by passing arguments through
        to io.TextIOWrapper().
        rr>rcbz*encoding args invalid for binary operation)
is_dirIsADirectoryErrorexistsFileNotFoundErrorr`openra
ValueErrorio
TextIOWrapper)r2rCrdargskwargszip_modestreams       rrkz	Path.opens;;==	*#D)))7{{}}	*S#D)))s;;$;;
Ov
O !MNNNM8888888rcVtj|jjp|jjSr")pathlibrrar9filenamer5s rr9z	Path.name!|DG$$)?T]-??rcVtj|jjp|jjSr")rtrrasuffixrur5s rrxzPath.suffix	s!|DG$$+Ct}/CCrcVtj|jjp|jjSr")rtrrasuffixesrur5s rrzz
Path.suffixes
s!|DG$$-G1GGrcVtj|jjp|jjSr")rtrrastemrur5s rr|z	Path.stemrvrcntj|jj|jSr")rtrr`rujoinpathrar5s rruz
Path.filenames'|DI.//88AAArc|jdg|Ri|5}|cdddS#1swxYwYdS)Nr>rkread)r2rorpstrms    r	read_textzPath.read_texts
TYs
,T
,
,
,V
,
,	99;;																		s377c|d5}|cdddS#1swxYwYdS)Nrbr)r2rs  r
read_byteszPath.read_bytess~
YYt__	99;;																		s7;;ctj|jd|jdkSNr8)rr:rar)r2r
s  r	_is_childzPath._is_child!s4 !4!4559L9LLLrc8||j|Sr")r3r`)r2ras  r_nextz
Path._next$s~~di,,,rcF|jp|jdSr)raendswithr5s rrgzPath.is_dir's!7{3dg..s333rcT|o|Sr")rirgr5s ris_filezPath.is_file*s {{}}2T[[]]!22rcB|j|jvSr")rar`r6r5s rrizPath.exists-sw$)--////rc|stdt|j|j}t
|j|S)NzCan't listdir a file)rgrlr(rr`r0filterr)r2subss  riterdirzPath.iterdir0sR{{}}	534444:ty113344dnd+++rcJtj|jj|jSr")rjoinr`rurar5s r__str__zPath.__str__6s~di0$':::rc8|j|S)Nr5)_Path__reprformatr5s r__repr__z
Path.__repr__9s{!!t!,,,rctj|jgtt|R}||j|Sr")rrrar(rBrr`r<)r2othernexts   rr~z
Path.joinpath<sG~dgDOU(C(CDDDzz$)//55666rc|js|jjStj|jd}|r|dz
}||Sr)raruparentrr:rr)r2	parent_ats  rrzPath.parentBsYw	(=''%dgnnS&9&9::		Izz)$$$r)r^)r>)rGrHrIrJrrbrkpropertyr9rxrzr|rurrrrrgrrirrrr~__truediv__rrrrrsKKZNF999999$@@X@DDXDHHXH@@X@BBXBMMM---444333000,,,;;;---777K
%%X%%%r)rmrr@r	rRsysrtversion_infocollectionsrdict__all__rrfromkeysr)rrArrPrBrrrrrs]				



f'''''''K(666&+++,
/HHH.....7?...b&s%s%s%s%s%s%s%s%s%s%rPK!	5_vendor/__pycache__/typing_extensions.cpython-311.pycnu[

,RemTxddlZddlZddlZddlZddlZddlZejdddkZereZ	nddlm	Z	m
Z
dZdZgdZ
ere
gdeed	rejZn!Gd
dejd
Zed
ZejdZejdZejdZejddZejddZejZeedrejdddkrejZnWejdddkr#Gddejd
ZeddZn!Gddejd
Zed
ZeedrejZndZd Zeed!rej Z nWejdddkr#Gd"d#ejd
Z!e!d!d$Z n!Gd%d&ejd
Z"e"d
Z ej#Z#ej$Z$ej%Z%Gd'd(e	Z&ej'Z'ej(Z(ej)Z)ej*Z*eed)rej+Z+n'Gd*d)ej,ej-ee&ej,+Z+ej.Z.eed,rej/Z/ndd-l0m1Z2Gd.d,ej3eZ/ej4Z4eed/rej5Z5n_dejddcxkrd0krnnej6ej5eefZ5n)Gd1d/ej5ej7eefe&ej5+Z5eed2rej8Z8n)Gd3d2ej8ej9ee:fe&ej8+Z8eed4rej;Z;n5eed4r)Gd5d4ej;ej7eefe&ej;+Z;eed6rej<ZZ>ej?Z?d8Z@gd9ZAd:ZBd;ZCeed<rejDZDnVer,dd=lmEZEd>ZFGd?d@ejGZHGdAd NoReturn:
              raise Exception('no way')

        This type is invalid in other positions, e.g., ``List[NoReturn]``
        will fail in static type checkers.
        c td)Nz*NoReturn cannot be used with isinstance().rselfobjs  r__instancecheck__z_NoReturn.__instancecheck__mHIIIrc td)Nz*NoReturn cannot be used with issubclass().rErGrs  r__subclasscheck__z_NoReturn.__subclasscheck__prJrN__name__
__module____qualname____doc__rrIrMrCrrrBrB_sK
	
			J	J	J	J	J	J	J	JrrBT_rootTKTVTT_co)	covariantT_contra)
contravariantr)rrceZdZdZdZdS)
_FinalFormcd|jzSNztyping_extensions._namerGs r__repr__z_FinalForm.__repr__'$*44rchtj||jd}tj||fS)N accepts only single typetyping_type_checkrb
_GenericAliasrGritems   r__getitem__z_FinalForm.__getitem__s;%j)-&N&N&NPPD'tg666rNrOrPrQrdrnrCrrr^r^2	5	5	5	7	7	7	7	7rr^aWA special typing construct to indicate that a name
                       cannot be re-assigned or overridden in a subclass.
                       For example:

                           MAX_SIZE: Final = 9000
                           MAX_SIZE += 1  # Error reported by type checker

                           class Connection:
                               TIMEOUT: Final[int] = 10
                           class FastConnector(Connection):
                               TIMEOUT = 1  # Error reported by type checker

                       There is no runtime checking of these properties.)doccFeZdZdZdZd
dZdZdZfdZdZ	d	Z
xZS)_FinalaA special typing construct to indicate that a name
        cannot be re-assigned or overridden in a subclass.
        For example:

            MAX_SIZE: Final = 9000
            MAX_SIZE += 1  # Error reported by type checker

            class Connection:
                TIMEOUT: Final[int] = 10
            class FastConnector(Connection):
                TIMEOUT = 1  # Error reported by type checker

        There is no runtime checking of these properties.
        __type__Nc||_dSNrtrGtpkwdss   r__init__z_Final.__init__
DMMMrct|}|j0|tj||jddddSt|jddd)N accepts only single type.TrS cannot be further subscriptedtyperurirjrOrrGrmrs   rrnz_Final.__getitem__st**C}$s6-d!l122.JJJLL!%''''s|ABB/OOOPPPrctj|j||}||jkr|St||dSNTrSri
_eval_typerurrGglobalnslocalnsnew_tps    rrz_Final._eval_typeE&t}hHHF&&4::fD1111rct}|j |dtj|jdz
}|SN[]superrdruri
_type_reprrGr	__class__s  rrdz_Final.__repr__H  ""A}(<*4=99<<<<HrcRtt|j|jfSrwhashrrOrurcs r__hash__z_Final.__hash__ d,dm<===rcpt|tstS|j|j|jkS||uSrw)
isinstancersNotImplementedrurGothers  r__eq__z
_Final.__eq__s;eV,,
&%%}(}665= rrwrOrPrQrRrr{rnrrdrr
__classcell__rs@rrsrss
	
	"						Q	Q	Q	2	2	2						>	>	>	!	!	!	!	!	!	!rrsr1c|S)auThis decorator can be used to indicate to type checkers that
        the decorated method cannot be overridden, and decorated class
        cannot be subclassed. For example:

            class Base:
                @final
                def done(self) -> None:
                    ...
            class Sub(Base):
                def done(self) -> None:  # Error reported by type checker
                    ...
            @final
            class Leaf:
                ...
            class Other(Leaf):  # Error reported by type checker
                ...

        There is no runtime checking of these properties.
        rC)fs rr1r1s	(rc*tj|Srw)riTypeVarnames rr2r2s>$rr3ceZdZdZdZdS)_LiteralFormcd|jzSr`rarcs rrdz_LiteralForm.__repr__rerc,tj||Srw)rirkrGrs  rrnz_LiteralForm.__getitem__s'j999rNrorCrrrrs2	5	5	5	:	:	:	:	:rraoA type that can be used to indicate to type checkers
                           that the corresponding value has a value literally equivalent
                           to the provided parameter. For example:

                               var: Literal[4] = 4

                           The type checker understands that 'var' is literally equal to
                           the value 4 and no other value.

                           Literal[...] cannot be subclassed. There is no runtime
                           checking verifying that the parameter is actually a value
                           instead of a type.cFeZdZdZdZd
dZdZdZfdZdZ	d	Z
xZS)_LiteralaA type that can be used to indicate to type checkers that the
        corresponding value has a value literally equivalent to the
        provided parameter. For example:

            var: Literal[4] = 4

        The type checker understands that 'var' is literally equal to the
        value 4 and no other value.

        Literal[...] cannot be subclassed. There is no runtime checking
        verifying that the parameter is actually a value instead of a type.
        
__values__Nc||_dSrwr)rGvaluesrzs   rr{z_Literal.__init__!
$DOOOrct|}|j%t|ts|f}||dSt	|jddd)NTrSr~r)rrrtuplerrO)rGrrs   rrnz_Literal.__getitem__$set**C&!&%00'$YFs6....s|ABB/OOOPPPrc|SrwrC)rGrrs   rrz_Literal._eval_type,Krct}|j9|ddt	t
j|jdz
}|S)Nr, r)rrdrjoinmaprirrs  rrdz_Literal.__repr__/sV  ""A*N3v'8$/#J#JKKNNNNHrcRtt|j|jfSrw)rrrOrrcs rrz_Literal.__hash__5s d,do>???rcpt|tstS|j|j|jkS||uSrw)rrrrrs  rrz_Literal.__eq__8s<eX..
&%%*%*:::5= rrwrrs@rrrs		$		%	%	%	%	Q	Q	Q									@	@	@	!	!	!	!	!	!	!rrceZdZfdZxZS)_ExtensionsGenericMetac|j2tjdjddvrt	ddS|js!t
|S|j|}|tur|S|j|j
vrdS|jD]+}t|trt||rdS,dS)a*This mimics a more modern GenericMeta.__subclasscheck__() logic
        (that does not have problems with recursion) to work around interactions
        between collections, typing, and typing_extensions on older
        versions of Python, see https://github.com/python/typing/issues/501.
        Nr~rOabc	functoolsCParameterized generics cannot be used with class or instance checksFT)
__origin__sys	_getframe	f_globalsr	__extra__rrM__subclasshook__r__mro____subclasses__rr
issubclass)rGsubclassressclsrs    rrMz(_ExtensionsGenericMeta.__subclasscheck__Ns?&}Q)*5=QQQ!56665~	777,,X666n--h77n$$J>X---4N1133		D$,,
(D))
tt
ur)rOrPrQrMrrs@rrrMs8rrr+ceZdZdZdZdS)r+rCc|jturtj|i|St	jtj|g|Ri|Srw)_gorgr+collectionsdequeri_generic_newrargsrzs   r__new__z
Deque.__new__wsKyE!!"($7$777&{'8#MMMMMMMrNrOrPrQrrrCrrr+r+rs/		N	N	N	N	Nr)	metaclassextrar')_check_methodscNeZdZdZdZejdZedZ	dS)r'rCc
K|SrwrCrcs r
__aenter__zAsyncContextManager.__aenter__sKrc
KdSrwrC)rGexc_type	exc_value	tracebacks    r	__aexit__zAsyncContextManager.__aexit__s4rcD|turt|ddStS)Nrr)r'_check_methods_in_mror)rCs  rrz$AsyncContextManager.__subclasshook__s&))),QkJJJ!!rN)
rOrPrQrrrabstractmethodrclassmethodrrCrrr'r'sb				

			
		
	"	"
	"	"	"rr-)rrr\ceZdZdZdZdS)r-rCc|jturtj|i|Stjtj|g|Ri|Srw)rr-rrirrs   rrzOrderedDict.__new__sKyK''".====&{'>SdSSSdSSSrNrrCrrr-r-s/		T	T	T	T	Trr*ceZdZdZdZdS)r*rCc|jturtj|i|Stjtj|g|Ri|Srw)rr*rrirrs   rrzCounter.__new__sKyG##"*D9D999&{':CO$OOO$OOOrNrrCrrr*r*s/		P	P	P	P	Prr(ceZdZdZdZdS)r(rCc|jturtj|i|Stjtj|g|Ri|Srw)rr(rrirrs   rrzChainMap.__new__sKyH$$"+T:T:::&{';SP4PPP4PPPrNrrCrrr(r(s/		Q	Q	Q	Q	Qrr&ceZdZdZdS)r&rCN)rOrPrQrrCrrr&r&s			rct|tsJt|dr|jS|j|j}|j|S)z@This function exists for compatibility with old typing versions.r)rrhasattrrrrs rrrsPc;'''''sGy

.
$n.
$Jr)
Callabler"IterableIteratorr$r#HashableSized	Container
Collection
Reversibler)r'cnt}|jddD]}|jdvrt|di}t	|jt	|zD]0}|ds|dvr||1|S)N)r6Generic__annotations___abc_)__abstractmethods__r__weakref___is_protocol_is_runtime_protocol__dict____args__r__next_in_mro__rr__orig_bases__r
__tree_hash__rRrr{rrP_MutableMapping__markerr)	setrrOgetattrlistr
keys
startswithadd)rattrsbaseannotationsattrs     r_get_protocol_attrsrsEEECRC 
 
 =333d$5r::++--..k6F6F6H6H1I1II		 		 DOOG,,
 >F2F2F		$		 LrcTtfdtDS)Nc3TK|]"}tt|dV#dSrw)callabler).0rrs  r	z,_is_callable_members_only..s7WWdxT40011WWWWWWr)allrrs`r_is_callable_members_onlyr!s0WWWW>QRU>V>VWWWWWWrr6)_collect_type_varscLt|jrtddSNz Protocols cannot be instantiatedrrrrGrkwargss   r_no_initr(/::"	@>???	@	@rceZdZfdZxZS)
_ProtocolMetactddrtrtjrdSjr+tfdt
DrdStS)NrFTc3K|]E}t|o0tt|dpt|duVFdSrwrrr)rrrinstances  rrz2_ProtocolMeta.__instancecheck__..sy== x..=$WS$%=%=>>><$//t;======r)	rr!rrrr rrrI)rr/rs``rrIz_ProtocolMeta.__instancecheck__sS.%88
*3//
x1377
t
 =====$7s#;#;=====  477,,X666r)rOrPrQrIrrs@rr+r+	s8
	7
	7
	7
	7
	7
	7
	7
	7
	7rr+cPeZdZdZdZdZfdZejdZ	dZ
xZS)r6aBase class for protocol classes. Protocol classes are defined as::

            class Proto(Protocol):
                def meth(self) -> int:
                    ...

        Such classes are primarily used with static type checkers that recognize
        structural subtyping (static duck-typing), for example::

            class C:
                def meth(self) -> int:
                    return 0

            def func(x: Proto) -> int:
                return x.meth()

            func(C())  # Passes static type check

        See PEP 544 for details. Protocol classes decorated with
        @typing_extensions.runtime act as simple-minded runtime protocol that checks
        only the presence of given attributes, ignoring their type signatures.

        Protocol classes can be generic, they are defined as::

            class GenProto(Protocol[T]):
                def meth(self) -> T:
                    ...
        rCTcv|turtdt|S)NzIType Protocol cannot be instantiated; it can only be used as a base class)r6rrr)rrrzrs   rrzProtocol.__new__>s=h!FGGG77??3'''rct|ts|f}|s&|tjurt	d|jddtfd|D}|turtd|Dsed}t||tjr%|dz
}t||tj%t	d|dzd	||tt|t|krt	d
nt||tj||S)NParameter list to [...] cannot be empty*Parameters to generic types must be types.c3BK|]}tj|VdSrwrirjrpmsgs  rrz-Protocol.__class_getitem__..Ls0FF!6-a55FFFFFFrc3JK|]}t|tjVdSrwrrirrr9s  rrz-Protocol.__class_getitem__..O.IIQ:a88IIIIIIrrr~zBParameters to Protocol[...] must all be type variables. Parameter z is z.Parameters to Protocol[...] must all be unique)
rrriTuplerrQr6r rrrrrk)rparamsir:s   @r__class_getitem__zProtocol.__class_getitem__Dsfe,,
# 
Rc55P)9PPPRRR>CFFFFvFFFFFFhII&IIIII>A$VAY??Q%VAY??#=&'!e==17==>>>s6{{##s6{{22#HJJJ3
sF+++'V444rc	xg}djvrtjjv}ntjjv}|rtddjvrt
j}d}jD]Z}t|tjr>|j	tjtfvr$|j	j}|td|j}[||}nt|}t||ksYdfd|D}	dd|D}
td|	d|d	|
d
|}t|_jdds#t#djD_fd
}djvr|_jsdSjD]k}|t(tjfvsT|jdkr|jt,vs;t|t.r|jstdt1|lt2_dS)Nr
!Cannot inherit from plain GenericzECannot inherit from Generic[...] and/or Protocol[...] multiple types.rc3>K|]}|vt|VdSrwstrrtgvarsets  rrz-Protocol.__init_subclass__..~3*U*UaAWDTDT3q66DTDTDTDT*U*Urc34K|]}t|VdSrwrFrgs  rrz-Protocol.__init_subclass__..(*A*Aa3q66*A*A*A*A*A*ArSome type variables () are not listed in rrrc3(K|]
}|tuVdSrw)r6rbs  rrz-Protocol.__init_subclass__..s&&L&LqH}&L&L&L&L&L&LrcjddstStdds7t	jdjddvrtStdts7t	jdjddvrtStdt|tstd	tD]}|jD]r}||jvr|j|tccSnWt|d
i}t|tjr"||vrt|tr	|jrn
stcSdS)Nrr	Fr\rOrBInstance and class checks can only be used with @runtime protocols._proto_hooks|''==*))s$:EBB;}Q''1*=AUUU--#%:;;;055C}Q''1*=AUUU--#%BCCC!%..J#$HIII/44
.
.D %
..4=00#}T2:'5 5 5 5 5 5!E&-d4Er&J&J&{FNCC" $ 3 3 *5- @ @!4 % 2!4"E----trrcollections.abc5Protocols can only inherit from other protocols, got )r
rirr
	__bases__rr"rrkrr6rOrrrrrYanyrrobjectrP_PROTO_WHITELISTr+reprr(r{)
rrr'tvarserrorgvarsrthe_basetvarsets_varss_argsr\rJs
`           @r__init_subclass__zProtocol.__init_subclass__^sE3<//#*<<#-7
E CDDD3<//*3+=>>.	4	4D"4)=>>4 O/III#'?#; ,"+!H#I#II!% 3=!EE!%jjG!%jjG"g--!%*U*U*U*U5*U*U*U!U!U!%*A*A5*A*A*A!A!A')O)O)O:B)O)OEK)O)O)OPPP!E!&uC<##ND99
M#&&L&Lcm&L&L&L#L#L 




>"55'2$#


E
E 888+<<<
)999"477:<@.s.HHQ:a88HHHHHHrrDzACannot inherit from Generic[...] or Protocol[...] multiple times.rc3>K|]}|vt|VdSrwrFrHs  rrz(_ProtocolMeta.__new__..rKrc34K|]}t|VdSrwrFrMs  rrz(_ProtocolMeta.__new__..rOrc3<K|]}|jtjuVdSrw)rrirrSs  rrz(_ProtocolMeta.__new__..sG4D4D8956LFN4R4D4D4D4D4D4Drrr6rPrQrrc3bK|]*}t|trt|n|V+dSrw)rrrrSs  rrz(_ProtocolMeta.__new__..sO**'1K&@&@G%(((a******rc3\K|]'}t|to
|tjuV(dSrw)rrrirrSs  rrz(_ProtocolMeta.__new__..s8YYa:a--I!6>2IYYYYYYrc36K|]}|tju|VdSrw)rirrSs  rrz(_ProtocolMeta.__new__..s.JJA!6>2I2Ia2I2I2I2IJJr)rrTrSrc3ZK|]&}|tjurdn|tjurdn|V'dS).rCN)ri_TypingEllipsis_TypingEmptyras  rrz(_ProtocolMeta.__new__..sZ"3"3()*+f.D)D)D##()V-@(@(@"""#"3"3"3"3"3"3r
_subs_tree)!r rrirrrrrr6rrrr`rrABCMetarupdaterr__setattr__rrrmrr

_abc_registry
_abc_cacherrr}rr)rrbases	namespacerdroriginr
orig_basesrfrrhrirjcls_name
initial_basesrGrJrs                 @rrz_ProtocolMeta.__new__s=== )))HH%HHHHHOO%OOOO"5))!	4	4Dv~--'(KLLL"4554 O/III ,"+!A#B#BB!% 3=!EE!%jjG!%jjG"g--!%*U*U*U*U5*U*U*U!U!U!%*A*A5*A*A*A!A!A034D4D=B4D4D4D1D1D$T99IS!')O)O)O:B)O)OEK)O)O)OPPP!E!M!d5kkS[&@&@&&5(**#(*****EYYSXYYYYY
KJJJJJJJFGGHHHc**223eY9=3??D+t$$00=C2?16v
@
@
@#(D7;EE"3"3-1"3"3"3333@D
M$0#5#5D !&3###%+%9""("3t\**
KAG'Jd4??+<+<&=&=&=&+K&>&>&G&G&I&I"Krc\tj|i|jdds#t	djD_jrjddD]}|ttj
fvs|jdkr|jtvsht|tjr|jsGt|t r|jtj
ust%dt'|t(_fd}djvr	|_dSdS)Nrc3nK|]0}|tup"t|to
|jtuV1dSrw)r6rr+rrSs  rrz)_ProtocolMeta.__init__..
s_'?'?,-()H}(@'1!]'C'C(@'(|x'?'?'?'?'?'?'?rr~r]r^cjddstSt|tstdt
D]}|jD]r}||jvr|j|tccSnWt|di}t|tj
r"||vrt|tr	|jrn
stcSdS)NrrXrT)
r
rYrrrrrrrrirZr+rr[s    rr\z+_ProtocolMeta.__init__.._proto_hooks|''==*))!%..J#$HIII/44
.
.D %
..4=00#}T2:'5 5 5 5 5 5!E&-d4Er&J&J&{FNCC" $ 3 3 *5- @ @!4 % 2!4"E----trr)rr{r
rYr`r_rrrarirrPrOrbr
TypingMetarrrrcr(r)rrr'rr\rs`    rr{z_ProtocolMeta.__init__s}EGGd-f---<##ND99
?#&'?'?14
'?'?'?$?$? 
(KOIID VV^$<<< O/@@@ M-===&tV->??>DHDU>&t[99>!Ov~==')H;?::)H)HIII (




*"55'2$$$65rc*tddrtrtjrdSjr+tfdt
DrdStt	S)NrFTc3K|]E}t|o0tt|dpt|duVFdSrwr.)rrr/rGs  rrz2_ProtocolMeta.__instancecheck__..;sy??!x..>%gdD$&?&?@@@= 400<??????r)
rr!rrrr rrrrI)rGr/rs``rrIz_ProtocolMeta.__instancecheck__3sT>599
-d33
x1488
t 
 ?????%8$=$=?????  4d++==hGGGrc|j2tjdjddvrt	ddS|jddrM|jdds2tjdjddvrdSt	d	|jddrgt|sXtjdjddvr(tt|
|St	d
tt|
|S)Nr~rOrrFrr	rrrirVrW)rrrrrr
rYr!rrrM)rGrrs  rrMz_ProtocolMeta.__subclasscheck__Bsf*=##-j9AUUU#%9:::u
!!.$77
7
))*@$GG
7=##-j9>HHH!5!6777
!!"8$??
?1$77
?=##-j9>HHH!d33EEcJJJ!>???d++==cBBBrc
t|ts|f}|s3t|tjurtd|jddtfd|D}|tjtfvrtd|Ds tdt|dtt|t|kr tdt|d|}|}n|tjtj
fvrt|}|}nZ|jtjtfvrtd	t|t!||t|}|}|j|fnd
}||j||jzt)|j||||j|jS)Nr3r4r5c38K|]}t|VdSrw)rjr8s  rrz,_ProtocolMeta.__getitem__..ds-??1;q#..??????rc3JK|]}t|tjVdSrwr<r=s  rrz,_ProtocolMeta.__getitem__..fr>rzParameters to z [...] must all be type variablesz[...] must all be uniquez%Cannot subscript already-subscripted rC)rdrrrr)rrrrir?rrQrr6r rcrrrrrrrrOr_rr
rr
)rGr@rdrprependr:s     @rrnz_ProtocolMeta.__getitem__Zsfe,,
# 
SeDkk==Q):QQQSSS>C?????????F111II&IIIIIW#UdUUUWWWs6{{##s6{{22#MdMMMOOO&,888"6**V^X$>>> TT

 T TUUUtV,,,"6**!%!8tggbG>>$-")DN":"0"?"?(-'+)-(,-1-@"BB
Br)NNNNN)rOrPrQrRrr{rIrMrirlrnrrs@rr+r+s		PT>	>	>	>	>	>	@*	3*	3*	3*	3*	3X
	H
	H
	H
	H
	H	C	C	C	C	C0
	%	B%	B
	%	B%	B%	B%	B%	Brc eZdZdZdZdZdZdS)r6aBase class for protocol classes. Protocol classes are defined as::

          class Proto(Protocol):
              def meth(self) -> int:
                  ...

        Such classes are primarily used with static type checkers that recognize
        structural subtyping (static duck-typing), for example::

          class C:
              def meth(self) -> int:
                  return 0

          def func(x: Proto) -> int:
              return x.meth()

          func(C())  # Passes static type check

        See PEP 544 for details. Protocol classes decorated with
        @typing_extensions.runtime act as simple-minded runtime protocol that checks
        only the presence of given attributes, ignoring their type signatures.

        Protocol classes can be generic, they are defined as::

          class GenProto(Protocol[T]):
              def meth(self) -> T:
                  ...
        rCTct|turtdtj|j|g|Ri|S)NzIType Protocol cannot be instantiated; it can be used only as a base class)rr6rrirrrs   rrzProtocol.__new__sTSzzX%%!FGGG&s':CO$OOO$OOOrN)rOrPrQrRrrrrCrrr6r6s>		8		P	P	P	P	Prr8cpt|tr|jstd|d|_|S)a4Mark a protocol class as a runtime protocol, so that it
        can be used with isinstance() and issubclass(). Raise TypeError
        if applied to a non-protocol class.

        This allows a simple-minded structural check very similar to the
        one-offs in collections.abc such as Hashable.
        z@@runtime_checkable can be only applied to protocol classes, got T)rr+rrr	rs rr8r8sQ#}--	-S5E	-,$',,--
-#' 
rr/c8eZdZdZejdefdZdS)r/rCreturncdSrwrCrcs r	__index__zSupportsIndex.__index__sDrN)rOrPrQrrrintrrCrrr/r/sB				s			
				r)r	r\c	tjdjddvrtdn#tt
f$rYnwxYwdS)Nr~rOrz4TypedDict does not support instance and class checksF)rrrrAttributeError
ValueError)rrs  r_check_failsrsq	}Q)*5>HHH  VWWW	H

+			D	us03AAc`|std|d|dd}}t|i|S)N)TypedDict.__new__(): not enough argumentsrr~)rr	)rr'_s   r	_dict_newrsB	IGHHHq'484T$V$$$rz,($cls, _typename, _fields=None, /, **kwargs)totalc|std|d|dd}}|r|d|dd}}nJd|vr7|d}ddl}|dtdntd|r7	|\}n#t
$r$td	t
|dzd
wxYwd|vrJt
|dkr7|d}ddl}|dtdnd}||}n|rtd
dt|i}	tj	dj
dd|d<n#tt
f$rYnwxYwt|d||S)Nrrr~	_typenamez5Passing '_typename' as keyword argument is deprecatedr\)
stacklevelzGTypedDict.__new__() missing 1 required positional argument: '_typename'z?TypedDict.__new__() takes from 2 to 3 positional arguments but z were given_fieldsz3Passing '_fields' as keyword argument is deprecatedz@TypedDict takes either a dict or keyword arguments, but not bothrrO__main__rPrCr)rr
warningswarnDeprecationWarningrrr	rrrrYr_TypedDictMeta)rrr'rtypenamerfieldsnss        r_typeddict_newrs(	IGHHHq'484		5!!Wd122hdHH
F
"
"zz+..HOOOMMQ,

<
<
<
<455
5
	
.
.
.
.!-FF
	-,--
- f
.	"}Q//9==j*UUB|
+			D	hBe<<<z*_TypedDictMeta.__new__..*s9381b6%b#..r__required_keys__rC__optional_keys__	__total__)rrrrr	rYrritemsrr
r	frozensetrrrr)rrrrrtp_dictrown_annotationsown_annotation_keys
required_keys
optional_keysrr:rs            @rrz_TypedDictMeta.__new__s/3k.A.ANNyByMggooc4$"==GK ff%6;;O"%o&:&:&<&<"="=SC???rcdtj|jddd|jDdS)Nztyping_extensions.Annotated[rc34K|]}t|VdSrwrcr{s  rrz+_AnnotatedAlias.__repr__..s( D DQa D D D D D Drr)rirrrrrcs rrdz_AnnotatedAlias.__repr__s\H63DT_3U3UHHyy D D$2C D D DDDHHH
IrcHtjt|jf|jzffSrw)operatorgetitemr0rrrcs r
__reduce__z_AnnotatedAlias.__reduce__s)#DO-0AA&
rc~t|tstS|j|jkrdS|j|jkS)NF)rrrrrrs  rrz_AnnotatedAlias.__eq__s@e_55
&%%%"222u$(:::rc8t|j|jfSrw)rrrrcs rrz_AnnotatedAlias.__hash__s$*;<===r)rOrPrQrRr{rrdrrrrrs@rrrns			)	)	)	)	)	@	@	@
	I	I	I			
	;	;	;	>	>	>	>	>	>	>rrcBeZdZdZdZdZejdZdZ	dS)r0aAdd context specific metadata to a type.

        Example: Annotated[int, runtime_check.Unsigned] indicates to the
        hypothetical runtime_check module that this type is an unsigned int.
        Every other consumer of this type can ignore this metadata and treat
        this type as int.

        The first argument to Annotated must be a valid type (and will be in
        the __origin__ field), the remaining arguments are kept as a tuple in
        the __extra__ field.

        Details:

        - It's an error to call `Annotated` with less than two arguments.
        - Nested Annotated are flattened::

            Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

        - Instantiating an annotated type is equivalent to instantiating the
        underlying type::

            Annotated[C, Ann1](5) == C(5)

        - Annotated can be used as a generic type alias::

            Optimized = Annotated[T, runtime.Optimize()]
            Optimized[int] == Annotated[int, runtime.Optimize()]

            OptimizedList = Annotated[List[T], runtime.Optimize()]
            OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
        rCc td)Nz&Type Annotated cannot be instantiated.rErrr's   rrzAnnotated.__new__sDEEErct|trt|dkrtdd}t	j|d|}t|dd}t
||S)Nr\zUAnnotated[...] should be used with at least two arguments (a type and an annotation).$Annotated[t, ...]: t must be a type.rr~)rrrrrirjr)rr@r:rrs     rrBzAnnotated.__class_getitem__s{fe,,
0Fa!/0009C'q	377FVABBZ((H"68444rc2td|jd)NCannot subclass z
.Annotated)rrPrs   rrkzAnnotated.__init_subclass__s$=3>===
rN)
rOrPrQrRrrrirlrBrkrCrrr0r0sf		@		F	F	F
		5	5
		5					rc(t|trt|jSt|tjrNt
d|jD}||jkr|S||}|j	|_	|S|S)z2Strips the annotations from a given type.
        c34K|]}t|VdSrw_strip_annotationsr{s  rrz%_strip_annotations..s+!L!LA"4Q"7"7!L!L!L!L!L!Lr)
rrrrrirkrrr_special)rI
stripped_argsrs   rrrsa))	4%al333a-..	!!L!L!L!L!LLLM
**++m,,C:CLJrFcttj|||}|r|Sd|DS)a]Return type hints for an object.

        This is often the same as obj.__annotations__, but it handles
        forward references encoded as string literals, adds Optional[t] if a
        default value equal to None is set and recursively replaces all
        'Annotated[T, ...]' with 'T' (unless 'include_extras=True').

        The argument may be a module, class, method, or function. The annotations
        are returned as a dictionary. For classes, annotations include also
        inherited members.

        TypeError is raised if the argument is not of a type that can contain
        annotations, and an empty dictionary is returned if no annotations are
        present.

        BEWARE -- the behavior of globalns and localns is counterintuitive
        (unless you are familiar with how eval() and exec() work).  The
        search order is locals first, then globals.

        - If no dict arguments are passed, an attempt is made to use the
          globals from obj (or the respective module's globals for classes),
          and these are also used as the locals.  If the object does not appear
          to have globals, an empty dictionary is used.

        - If one dict argument is passed, it is used for both globals and
          locals.

        - If two dict arguments are passed, they specify globals and
          locals, respectively.
        )rrc4i|]\}}|t|SrCr)rkrIs   rrz"get_type_hints..s'BBBTQ%a((BBBr)rir?r)rHrrinclude_extrashints     rr?r?sD>$S8WMMM	KBBTZZ\\BBBBrc|t|dko)|do|dS)z3Returns True if name is a __dunder_variable_name__.__)rrendswithrs r
_is_dunderrs44yy1}N!6!6N4==;N;NNrceZdZdZfdZedZdZdfd	ZdZ	e
jfdZd	Z
d
ZfdZdZd
ZxZS)
AnnotatedMetazMetaclass for Annotatedctd|Dr$tdttzt	j||||fi|S)Nc3(K|]
}|tuVdSrw)rarSs  rrz(AnnotatedMeta.__new__..s&22q1F?222222rr)r`rrGr0rr)rrrrr'rs     rrzAnnotatedMeta.__new__
sa22E22222
E 2S^^ CDDD"577?3eYII&IIIrc6|dS)Nr\)r}rcs rrzAnnotatedMeta.__metadata__s??$$Q''rc|\}}}t|tstj|}n|d|}dd|D}|d|d|dS)Nrrc34K|]}t|VdSrwr)rargs  rrz+AnnotatedMeta._tree_repr..s(&E&EStCyy&E&E&E&E&E&Errr)rrrir
_tree_reprr)rGtreerrrtp_reprmetadata_reprss       rrzAnnotatedMeta._tree_reprs$(!Cfe,,
7 +F33 )..v66!YY&E&EH&E&E&EEEN88G88~8888rNc,|turtSt||}t|dtrD|ddtur/|dd}|dd}t|||dzfS|S)N)rdrr~rr\)r0rr}rr)rGrdrrsub_tp	sub_annotrs      rr}zAnnotatedMeta._subs_treesy    ''$$5t$<>Jrc4|jtd|}t|tr;|dt
ur,|d}t|tr|dt
u,t|tr|dS|S)z6Return the class used to create instance of this type.NzCCannot get the underlying type of a non-specialized Annotated type.rr~)rrr}rrr0)rGrs  r	_get_conszAnnotatedMeta._get_cons's&!BCCC??$$DT5))
d1g.B.BAwT5))
d1g.B.B$&&
Awrct|ts|f}|j!t|St|trt|dkrt
dd}tj|d|}t|dd}|	|j
|jt|j
t|f||f|S)Nr\z]Annotated[...] should be instantiated with at least two arguments (a type and an annotation).rrr~)rdrr)rrrrrnrrrirjrrOr_rr
r)rGr@r:ryrrs     rrnzAnnotatedMeta.__getitem__4sfe,,
# *ww**6222..
-#f++//!/000='q	377 ,,>>
t}-- "''(^"
rcp|}||i|}	||_n#t$rYnwxYw|Srw)r__orig_class__r)rGrr'consresults     r__call__zAnnotatedMeta.__call__LsZ>>##DT4*6**F
(,%%!



Ms&
33c|j1t|s"t||St	|rw)rrrrr)rGrs  r__getattr__zAnnotatedMeta.__getattr__Us?*:d3C3C*t~~//666 &&&rc
t|s|dr$t||dS|jt|t
|||dS)Nr)rrrrrrsetattrr)rGrvaluers   rrzAnnotatedMeta.__setattr__[s~$
74??7#;#;
7##D%00000($T***(($66666rc td)Nz+Annotated cannot be used with isinstance().rErFs  rrIzAnnotatedMeta.__instancecheck__cIJJJrc td)Nz+Annotated cannot be used with issubclass().rErLs  rrMzAnnotatedMeta.__subclasscheck__fr
r)NN)rOrPrQrRrpropertyrrr}rrirlrnrrrrIrMrrs@rrrs"%%	J	J	J	J	J

	(	(
	(	9	9	9															
					
		.				'	'	'	7	7	7	7	7	K	K	K	K	K	K	K	K	K	KrrceZdZdZdS)r0avAdd context specific metadata to a type.

        Example: Annotated[int, runtime_check.Unsigned] indicates to the
        hypothetical runtime_check module that this type is an unsigned int.
        Every other consumer of this type can ignore this metadata and treat
        this type as int.

        The first argument to Annotated must be a valid type, the remaining
        arguments are kept as a tuple in the __metadata__ field.

        Details:

        - It's an error to call `Annotated` with less than two arguments.
        - Nested Annotated are flattened::

            Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

        - Instantiating an annotated type is equivalent to instantiating the
        underlying type::

            Annotated[C, Ann1](5) == C(5)

        - Annotated can be used as a generic type alias::

            Optimized = Annotated[T, runtime.Optimize()]
            Optimized[int] == Annotated[int, runtime.Optimize()]

            OptimizedList = Annotated[List[T], runtime.Optimize()]
            OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
        NrOrPrQrRrCrrr0r0is				r)r
)_BaseGenericAlias)GenericAliasct|trtSt|tjt
tttfr|j	S|tj
urtj
SdS)a6Get the unsubscripted version of a type.

        This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar
        and Annotated. Return None for unsupported types. Examples::

            get_origin(Literal[42]) is Literal
            get_origin(int) is None
            get_origin(ClassVar[int]) is ClassVar
            get_origin(Generic) is Generic
            get_origin(Generic[T]) is Generic
            get_origin(Union[T, int]) is Union
            get_origin(List[Tuple[T, T]][int]) == list
            get_origin(P.args) is P
        N)rrr0rirkrr
ParamSpecArgsParamSpecKwargsrr)rys rr>r>sfb/**	b6/?P(/;<<	!= 
>!trcft|tr|jf|jzSt|tjtfrjt|ddrdS|j}t|tjjur.|dturt|dd|df}|SdS)aGet type arguments with all substitutions performed.

        For unions, basic simplifications used by Union constructor are performed.
        Examples::
            get_args(Dict[str, int]) == (str, int)
            get_args(int) == ()
            get_args(Union[int, Union[T, int], str][int]) == (int, str)
            get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
            get_args(Callable[[], T][int]) == ([], int)
        rFrCrNr)rrrrrirkrrrr>rrrEllipsisr)ryrs  rr=r=sb/**	6M#bo55b6/>??	r:u--
r+C"~~!999c!fH>T>TCH~~s2w/Jrrr:)rrceZdZdZdS)_TypeAliasFormcd|jzSr`rarcs rrdz_TypeAliasForm.__repr__rerNrOrPrQrdrCrrrr#	5	5	5	5	5rrc&t|d)&Special marker indicating that an assignment should
        be recognized as a proper type alias definition by type
        checkers.

        For example::

            Predicate: TypeAlias = Callable[..., bool]

        It's invalid when used anywhere except as in the example above.
         is not subscriptablerErs  rr:r:s4666777rceZdZdZdS)rcd|jzSr`rarcs rrdz_TypeAliasForm.__repr__rerNrrCrrrrrraSpecial marker indicating that an assignment should
                               be recognized as a proper type alias definition by type
                               checkers.

                               For example::

                                   Predicate: TypeAlias = Callable[..., bool]

                               It's invalid when used anywhere except as in the example
                               above.ceZdZdZdZdS)_TypeAliasMetazMetaclass for TypeAliascdSNztyping_extensions.TypeAliasrCrcs rrdz_TypeAliasMeta.__repr__00rNrOrPrQrRrdrCrrr"r"s)%%	1	1	1	1	1rr"c(eZdZdZdZdZdZdZdS)_TypeAliasBaserrCc td)Nz+TypeAlias cannot be used with isinstance().rErFs  rrIz _TypeAliasBase.__instancecheck__r
rc td)Nz+TypeAlias cannot be used with issubclass().rErLs  rrMz _TypeAliasBase.__subclasscheck__
r
rcdSr$rCrcs rrdz_TypeAliasBase.__repr__
r%rN)rOrPrQrRrrIrMrdrCrrr(r(sX						K	K	K	K	K	K	1	1	1	1	1rr()rrTrc"eZdZdZdZdZdZdS)
_Immutablez3Mixin to indicate that object should not be copied.rCc|SrwrCrcs r__copy__z_Immutable.__copy__rrc|SrwrC)rGmemos  r__deepcopy__z_Immutable.__deepcopy__ rrN)rOrPrQrRrr/r2rCrrr-r-s=AA									rr-ceZdZdZdZdZdS)raQThe args for a ParamSpec object.

        Given a ParamSpec object P, P.args is an instance of ParamSpecArgs.

        ParamSpecArgs objects have a reference back to their ParamSpec:

        P.args.__origin__ is P

        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        c||_dSrwrrGrs  rr{zParamSpecArgs.__init__/rrc |jjdS)Nz.argsrrOrcs rrdzParamSpecArgs.__repr__2so.5555rNrOrPrQrRr{rdrCrrrr#s<
	
		%	%	%	6	6	6	6	6rceZdZdZdZdZdS)ra[The kwargs for a ParamSpec object.

        Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs.

        ParamSpecKwargs objects have a reference back to their ParamSpec:

        P.kwargs.__origin__ is P

        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        c||_dSrwr5r6s  rr{zParamSpecKwargs.__init__Arrc |jjdS)Nz.kwargsr8rcs rrdzParamSpecKwargs.__repr__Dso.7777rNr9rCrrrr5s<
	
		%	%	%	8	8	8	8	8rrrceZdZdZejZedZedZ	ddddfd
Z
dZd	Zd
Z
dZdZesd
ZxZSxZS)ra'Parameter specification variable.

        Usage::

           P = ParamSpec('P')

        Parameter specification variables exist primarily for the benefit of static
        type checkers.  They are used to forward the parameter types of one
        callable to another callable, a pattern commonly found in higher order
        functions and decorators.  They are only valid when used in ``Concatenate``,
        or s the first argument to ``Callable``. In Python 3.10 and higher,
        they are also supported in user-defined Generics at runtime.
        See class Generic for more information on generic types.  An
        example for annotating a decorator::

           T = TypeVar('T')
           P = ParamSpec('P')

           def add_logging(f: Callable[P, T]) -> Callable[P, T]:
               '''A type-safe decorator to add logging to a function.'''
               def inner(*args: P.args, **kwargs: P.kwargs) -> T:
                   logging.info(f'{f.__name__} was called')
                   return f(*args, **kwargs)
               return inner

           @add_logging
           def add_two(x: float, y: float) -> float:
               '''Add two numbers together.'''
               return x + y

        Parameter specification variables defined with covariant=True or
        contravariant=True can be used to declare covariant or contravariant
        generic types.  These keyword arguments are valid, but their actual semantics
        are yet to be decided.  See PEP 612 for details.

        Parameter specification variables can be introspected. e.g.:

           P.__name__ == 'T'
           P.__bound__ == None
           P.__covariant__ == False
           P.__contravariant__ == False

        Note that only parameter specification variables defined in global scope can
        be pickled.
        c t|Srw)rrcs rrzParamSpec.argss &&&rc t|Srw)rrcs rr'zParamSpec.kwargss"4(((rNF)boundrYr[ct|g||_t||_t||_|rt
j|d|_nd|_	tj
djdd}n#ttf$rd}YnwxYw|dkr	||_dSdS)NzBound must be a type.r~rOrtyping_extensions)rr{rObool
__covariant____contravariant__rirj	__bound__rrrrYrrrP)rGrr@rYr[def_modrs      rr{zParamSpec.__init__sGGdV$$$ DM!%iD%)-%8%8D"
&!'!3E;R!S!S!%
-**488ZPP"J/



---").-s8-B&&B<;B<cB|jrd}n|jrd}nd}||jzS)N+-~)rDrErO)rGprefixs  rrdzParamSpec.__repr__s8!
'
DM))rc6t|Srw)rarrcs rrzParamSpec.__hash__s??4(((rc
||uSrwrCrs  rrzParamSpec.__eq__s5= rc|jSrw)rOrcs rrzParamSpec.__reduce__s
= rcdSrwrCr&s   rrzParamSpec.__call__Drc<||vr||dSdSrw)appendrGrds  r_get_type_varszParamSpec._get_type_varss-u$$LL&&&&&%$r)rOrPrQrRrirrrrr'r{rdrrrrPEP_560rUrrs@rrrNs,	,	^N			'	'
	'
	)	)
	)+/%u	*	*	*	*	*	*	*$	*	*	*	)	)	)	!	!	!	!	!	!				'
'
'
'
'
'
'
'	'	'	'	'rrceZdZerejZnejZdZej	Z
fdZdZdZ
dZedZesdZxZSxZS)_ConcatenateGenericAliasFcft|||_||_dSrw)rr{rr)rGrrrs   rr{z!_ConcatenateGenericAlias.__init__s-GGT"""$DO DMMMrctj|jddfd|jDdS)Nrrc3.K|]}|VdSrwrC)rrrs  rrz4_ConcatenateGenericAlias.__repr__..s+!K!Kc**S//!K!K!K!K!K!Krr)rirrrr)rGrs @rrdz!_ConcatenateGenericAlias.__repr__sd*J!z$/22OO		!K!K!K!KT]!K!K!KKKOOO
Prc8t|j|jfSrw)rrrrcs rrz!_ConcatenateGenericAlias.__hash__s$-8999rcdSrwrCr&s   rrz!_ConcatenateGenericAlias.__call__rQrc>td|jDS)Nc3\K|]'}t|tjtf#|V(dSrw)rrirr)rrys  rrz:_ConcatenateGenericAlias.__parameters__..sLjfni=X.Y.Yr)rrrcs rrz'_ConcatenateGenericAlias.__parameters__s2!]
rc^|jr#|jrtj|j|dSdSdSrw)rrrirUrTs  rrUz'_ConcatenateGenericAlias._get_type_varssL?Ft':F)$*=uEEEEEFFFFr)rOrPrQrVrirkr_TypingBaserrrr{rdrrrrrUrrs@rrXrXs	+,II*I	!	!	!	!	!
	P	P	P
	:	:	:			
		
	
	F
F
F
F
F
F
F
F	F	F	F	FrrXc|dkrtdt|ts|f}t|dtstddtfd|D}t	||S)NrCz&Cannot take a Concatenate of no types.rzAThe last parameter to Concatenate should be a ParamSpec variable.z/Concatenate[arg, ...]: each arg must be a type.c3BK|]}tj|VdSrwr7r8s  rrz'_concatenate_getitem..s0FFav)!S11FFFFFFr)rrrrrX)rGrr:s  @r_concatenate_getitemrdsR@AAAj%((# ]
jni00/.//	/
;CFFFF:FFFFFJ#D*555rc"t||S)&Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
        higher order function which adds, removes or transforms parameters of a
        callable.

        For example::

           Callable[Concatenate[int, P], int]

        See PEP 612 for detailed information.
        rdrs  rrrs$D*555rceZdZdZdZdS)_ConcatenateFormcd|jzSr`rarcs rrdz_ConcatenateForm.__repr__
rerc"t||Srwrgrs  rrnz_ConcatenateForm.__getitem__
'j999rNrorCrrriri	s2	5	5	5	:	:	:	:	:rrirfceZdZdZdZdS)_ConcatenateAliasMetazMetaclass for Concatenate.cdSNztyping_extensions.ConcatenaterCrcs rrdz_ConcatenateAliasMeta.__repr__!22rNr&rCrrrnrns)((	3	3	3	3	3rrnc.eZdZdZdZdZdZdZdZdS)_ConcatenateAliasBaserfrCc td)Nz-Concatenate cannot be used with isinstance().rErFs  rrIz'_ConcatenateAliasBase.__instancecheck__3KLLLrc td)Nz-Concatenate cannot be used with issubclass().rErLs  rrMz'_ConcatenateAliasBase.__subclasscheck__6rurcdSrprCrcs rrdz_ConcatenateAliasBase.__repr__9rqrc"t||Srwrgrs  rrnz!_ConcatenateAliasBase.__getitem__<rlrN)	rOrPrQrRrrIrMrdrnrCrrrsrs$sg						M	M	M	M	M	M	3	3	3	:	:	:	:	:rrsr;ceZdZdZdS)_TypeGuardFormcd|jzSr`rarcs rrdz_TypeGuardForm.__repr__GrerNrrCrrrzrzFrrrzc^tj||d}tj||fS)	Special typing form used to annotate the return type of a user-defined
        type guard function.  ``TypeGuard`` only accepts a single type argument.
        At runtime, functions marked this way should return a boolean.

        ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
        type checkers to determine a more precise type of an expression within a
        program's code flow.  Usually type narrowing is done by analyzing
        conditional code flow and applying the narrowing to a block of code.  The
        conditional expression here is sometimes referred to as a "type guard".

        Sometimes it would be convenient to use a user-defined boolean function
        as a type guard.  Such a function should use ``TypeGuard[...]`` as its
        return type to alert static type checkers to this intention.

        Using  ``-> TypeGuard`` tells the static type checker that for a given
        function:

        1. The return value is a boolean.
        2. If the return value is ``True``, the type of its argument
        is the type inside ``TypeGuard``.

        For example::

            def is_str(val: Union[str, float]):
                # "isinstance" type guard
                if isinstance(val, str):
                    # Type of ``val`` is narrowed to ``str``
                    ...
                else:
                    # Else, type of ``val`` is narrowed to ``float``.
                    ...

        Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
        form of ``TypeA`` (it can even be a wider form) and this may lead to
        type-unsafe results.  The main reason is to allow for things like
        narrowing ``List[object]`` to ``List[str]`` even though the latter is not
        a subtype of the former, since ``List`` is invariant.  The responsibility of
        writing type-safe type guards is left to the user.

        ``TypeGuard`` also works with type variables.  For more information, see
        PEP 647 (User-Defined Type Guards).
        r)rirjrkrls   rr;r;Js5X!*.Q.Q.QRR#D4'222rceZdZdZdZdS)rzcd|jzSr`rarcs rrdz_TypeGuardForm.__repr__|rerchtj||jd}tj||fS)Nz accepts only a single typerhrls   rrnz_TypeGuardForm.__getitem__s;%j)-&P&P&PRRD'tg666rNrorCrrrzrzzrprr}cFeZdZdZdZd
dZdZdZfdZdZ	d	Z
xZS)
_TypeGuardr}rtNc||_dSrwrtrxs   rr{z_TypeGuard.__init__r|rct|}|j0|tj||jddddSt|jddd)Nr~z accepts only a single type.TrSrrrs   rrnz_TypeGuard.__getitem__st**C}$s6-d!l122.LLLNN!%''''s|ABB/OOOPPPrctj|j||}||jkr|St||dSrrrs    rrz_TypeGuard._eval_typerrct}|j |dtj|jdz
}|Srrrs  rrdz_TypeGuard.__repr__rrcRtt|j|jfSrwrrcs rrz_TypeGuard.__hash__rrcpt|tstS|j|j|jkS||uSrw)rrrrurs  rrz_TypeGuard.__eq__s;eZ00
&%%}(}665= rrwrrs@rrrs)	)	V"						Q	Q	Q	2	2	2						>	>	>	!	!	!	!	!	!	!rrr cneZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
ejdZd
S)_SpecialForm)rbrR_getitemcD||_|j|_|j|_dSrw)rrOrbrR)rGrs  rr{z_SpecialForm.__init__
s #DM )DJ"?DLLLrc6|dvr|jSt|)N>rOrQ)rbr)rGrms  rrz_SpecialForm.__getattr__s$333z! &&&rc&td|)NrrE)rGrs  r__mro_entries__z_SpecialForm.__mro_entries__s7t77888rcd|jSr`rarcs rrdz_SpecialForm.__repr__s4
444rc|jSrwrarcs rrz_SpecialForm.__reduce__s
:rc&td|)NzCannot instantiate rE)rGrrzs   rrz_SpecialForm.__call__s:$::;;;rc*tj||fSrwriUnionrs  r__or__z_SpecialForm.__or__!s<e,,rc*tj||fSrwrrs  r__ror__z_SpecialForm.__ror__$s<t,,rc&t|d)Nz! cannot be used with isinstance()rErFs  rrIz_SpecialForm.__instancecheck__'tFFFGGGrc&t|d)Nz! cannot be used with issubclass()rErLs  rrMz_SpecialForm.__subclasscheck__*rrc.|||Srw)rrs  rrnz_SpecialForm.__getitem__-s==z222rN)rOrPrQrr{rrrdrrrrrIrMrirlrnrCrrrrs4		+	+	+
	'	'	'	9	9	9	5	5	5				<	<	<	-	-	-	-	-	-	H	H	H	H	H	H
		3	3
		3	3	3rrc&t|d)Used to spell the type of "self" in classes.

        Example::

          from typing import Self

          class ReturnsSelf:
              def parse(self, data: bytes) -> Self:
                  ...
                  return self

        rrE)rGr@s  rr r 1s4666777rc"eZdZdZdZdZdZdS)_SelfrrCc&t|d)Nz" cannot be used with isinstance().rErFs  rrIz_Self.__instancecheck__RtGGGHHHrc&t|d)Nz" cannot be used with issubclass().rErLs  rrMz_Self.__subclasscheck__UrrNrNrCrrrrBsK				I	I	I	I	I	I	I	IrrRequiredceZdZdZdS)_ExtensionsSpecialFormcd|jzSr`rarcs rrdz_ExtensionsSpecialForm.__repr__`rerNrrCrrrr_rrrchtj||jd}tj||fS)A special typing construct to mark a key of a total=False TypedDict
        as required. For example:

            class Movie(TypedDict, total=False):
                title: Required[str]
                year: int

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )

        There is no runtime checking that a required key is actually provided
        when instantiating a related TypedDict.
        rgrhrls   rrrcs6"!*.V.V.VWW#D4'222rchtj||jd}tj||fS)`A special typing construct to mark a key of a TypedDict as
        potentially missing. For example:

            class Movie(TypedDict):
                title: str
                year: NotRequired[int]

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
        rgrhrls   rNotRequiredrws6!*.V.V.VWW#D4'222rceZdZdZdZdS)
_RequiredFormcd|jzSr`rarcs rrdz_RequiredForm.__repr__rerctj|d|j}tj||fS)Nz{} accepts only single type)rirjformatrbrkrls   rrnz_RequiredForm.__getitem__s@%j&C&J&J4:&V&VXXD'tg666rNrorCrrrrs2	5	5	5	7	7	7	7	7rrrrrcBeZdZdZd	dZdZdZfdZdZdZ	xZ
S)
_MaybeRequiredrtNc||_dSrwrtrxs   rr{z_MaybeRequired.__init__r|rc
t|}|j@|tj|d|jdddSt
d|jdd)Nz{} accepts only single type.r~TrSz {} cannot be further subscripted)rrurirjrrOrrs   rrnz_MaybeRequired.__getitem__st**C}$s6-d9@@abbAQRRTT!%''''>#VCL$45577
7rctj|j||}||jkr|St||dSrrrs    rrz_MaybeRequired._eval_typerrct}|j/|dt	j|jz
}|S)Nz[{}])rrdrurrirrs  rrdz_MaybeRequired.__repr__sH  ""A}(V]]6#4T]#C#CDDDHrcRtt|j|jfSrwrrcs rrz_MaybeRequired.__hash__rrct|t|stS|j|j|jkS||uSrw)rrrrurs  rrz_MaybeRequired.__eq__sAeT$ZZ00
&%%}(}665= rrw)rOrPrQrr{rnrrdrrrrs@rrrs!						7	7	7	2	2	2						>	>	>	!	!	!	!	!	!	!rrceZdZdZdS)	_RequiredrNrrCrrrrs				rrceZdZdZdS)_NotRequiredrNrrCrrrrs				rr)NNF)rrcollections.abcrrriversion_inforVrrrrr__all__extendrr@_FinalTypingBaserBrrUrVrWrXrZrrrr^rsr1r2r3rr_overload_dummyr5r!rr"r%r$r#r+rMutableSequencer)r'_collections_abcrrrr,r-_aliasMutableMappingr*Dictrr(r&r4r9r<rrbrr!r6r"r(r~r+rmrjr8r7r/r.rr__text_signature__rrr	rOrPrRr0r?rrkrrrr>r=rImportErrorrr:rrr"r(rrr-rrrXrlrdrrirnrsr;rzrr rrrrrrrrrCrrrs












2A2
)
+
/KK/.......<<<+++ZANN???@@@76:%HHJJJJJF+4JJJJ(yt$$$HFN3V^DV^Dv~f---6>*D999?767Q 0! 4 > >LEEbqbV##77777V(7777
JwL

M

M

MEE 1!1!1!1!1!(1!1!1!1!f
FE767LEE.   
769I#nGGbqbV##:::::v*$::::l9 1222GG,!,!,!,!,!6*$,!,!,!,!\hT"""G(?{[6
		$
$
767NLEENNNNN!6#9!#<0!'NNNN&
76())" 4IHHHHH"""""fnT2"""  76=!!T$KK#"2A2&222222222&- 7"bBBKK	T	T	T	T	Tk-v/DRV/L 6'3	T	T	T	T769
PnGG	P	P	P	P	P+%+af%2+:M	P	P	P	P76:QHHW[*%%
Q	Q	Q	Q	Q	Q;')>r2v)F3$-	Q	Q	Q	Q76#$$*NNt,fnT8^.L#9*=
.
{$
===&XXX
76:gPHHdP))))))@@@77777777$]$]$]$]$]$]]$]$]$]$]$@10000000@@@BBBBBBBBB$P$P$P$P$P]$P$P$P$PP76&''0 76?##
(MMy  
 II			%%%$RI $(*=*=*=*=*=X*HN%*=*=*=*=*=*=*=*=X{TGR88I#I	@76;a I*N,OOZ%>%>%>%>%>&.d%>%>%>%>N44444444l"C"C"C"C"CLOOO`K`K`K`K`K*`K`K`KDmFBQB7"""JHH81,,,,,,,111"01,''''''',,,+,0076;D+ IIbqbV##55555,D555588^88	bqbV##55555,D5555{	$)
*
*
*II11111*111111110NRV1111,T***I76?##18(M,OO66666
666$88888*888&76;l' II
f'f'f'f'f'Df'f'f'Twv}%%*F(F(F(F(F(F4(F(F(FX
6
6
676=!!J4$K%>bqbV##66^66	bqbV##:::::6.d::::#"	



KK33333 1333::::: 7*?&*::::6('d333K76;' IIbqbV##55555,D5555,3,3^,3,3\	bqbV##77777,D7777)
+
+
+
II\M!M!M!M!M!V,DM!M!M!M!^
&&&I
766U;DDbqbV##(3(3(3(3(3v}D(3(3(3(3T88\88 IIIII'tIIII,5tD76:]+H$KKKbqbV##55555!4D5555333&33333 	bqbV##77777+47777}



H" -






KKK #!#!#!#!#!0#!#!#!#!JN$"~Tyt$$$H,T***KKKs$$V++V:9V:>WWWPK!kh

&_vendor/importlib_resources/_compat.pynu[# flake8: noqa

import abc
import sys
import pathlib
from contextlib import suppress

if sys.version_info >= (3, 10):
    from zipfile import Path as ZipPath  # type: ignore
else:
    from ..zipp import Path as ZipPath  # type: ignore


try:
    from typing import runtime_checkable  # type: ignore
except ImportError:

    def runtime_checkable(cls):  # type: ignore
        return cls


try:
    from typing import Protocol  # type: ignore
except ImportError:
    Protocol = abc.ABC  # type: ignore


class TraversableResourcesLoader:
    """
    Adapt loaders to provide TraversableResources and other
    compatibility.

    Used primarily for Python 3.9 and earlier where the native
    loaders do not yet implement TraversableResources.
    """

    def __init__(self, spec):
        self.spec = spec

    @property
    def path(self):
        return self.spec.origin

    def get_resource_reader(self, name):
        from . import readers, _adapters

        def _zip_reader(spec):
            with suppress(AttributeError):
                return readers.ZipReader(spec.loader, spec.name)

        def _namespace_reader(spec):
            with suppress(AttributeError, ValueError):
                return readers.NamespaceReader(spec.submodule_search_locations)

        def _available_reader(spec):
            with suppress(AttributeError):
                return spec.loader.get_resource_reader(spec.name)

        def _native_reader(spec):
            reader = _available_reader(spec)
            return reader if hasattr(reader, 'files') else None

        def _file_reader(spec):
            try:
                path = pathlib.Path(self.path)
            except TypeError:
                return None
            if path.exists():
                return readers.FileReader(self)

        return (
            # native reader if it supplies 'files'
            _native_reader(self.spec)
            or
            # local ZipReader if a zip module
            _zip_reader(self.spec)
            or
            # local NamespaceReader if a namespace module
            _namespace_reader(self.spec)
            or
            # local FileReader
            _file_reader(self.spec)
            # fallback - adapt the spec ResourceReader to TraversableReader
            or _adapters.CompatibilityFiles(self.spec)
        )


def wrap_spec(package):
    """
    Construct a package spec with traversable compatibility
    on the spec/loader/reader.

    Supersedes _adapters.wrap_spec to use TraversableResourcesLoader
    from above for older Python compatibility (<3.10).
    """
    from . import _adapters

    return _adapters.SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)
PK!D

&_vendor/importlib_resources/readers.pynu[import collections
import pathlib
import operator

from . import abc

from ._itertools import unique_everseen
from ._compat import ZipPath


def remove_duplicates(items):
    return iter(collections.OrderedDict.fromkeys(items))


class FileReader(abc.TraversableResources):
    def __init__(self, loader):
        self.path = pathlib.Path(loader.path).parent

    def resource_path(self, resource):
        """
        Return the file system path to prevent
        `resources.path()` from creating a temporary
        copy.
        """
        return str(self.path.joinpath(resource))

    def files(self):
        return self.path


class ZipReader(abc.TraversableResources):
    def __init__(self, loader, module):
        _, _, name = module.rpartition('.')
        self.prefix = loader.prefix.replace('\\', '/') + name + '/'
        self.archive = loader.archive

    def open_resource(self, resource):
        try:
            return super().open_resource(resource)
        except KeyError as exc:
            raise FileNotFoundError(exc.args[0])

    def is_resource(self, path):
        # workaround for `zipfile.Path.is_file` returning true
        # for non-existent paths.
        target = self.files().joinpath(path)
        return target.is_file() and target.exists()

    def files(self):
        return ZipPath(self.archive, self.prefix)


class MultiplexedPath(abc.Traversable):
    """
    Given a series of Traversable objects, implement a merged
    version of the interface across all objects. Useful for
    namespace packages which may be multihomed at a single
    name.
    """

    def __init__(self, *paths):
        self._paths = list(map(pathlib.Path, remove_duplicates(paths)))
        if not self._paths:
            message = 'MultiplexedPath must contain at least one path'
            raise FileNotFoundError(message)
        if not all(path.is_dir() for path in self._paths):
            raise NotADirectoryError('MultiplexedPath only supports directories')

    def iterdir(self):
        files = (file for path in self._paths for file in path.iterdir())
        return unique_everseen(files, key=operator.attrgetter('name'))

    def read_bytes(self):
        raise FileNotFoundError(f'{self} is not a file')

    def read_text(self, *args, **kwargs):
        raise FileNotFoundError(f'{self} is not a file')

    def is_dir(self):
        return True

    def is_file(self):
        return False

    def joinpath(self, child):
        # first try to find child in current paths
        for file in self.iterdir():
            if file.name == child:
                return file
        # if it does not exist, construct it with the first path
        return self._paths[0] / child

    __truediv__ = joinpath

    def open(self, *args, **kwargs):
        raise FileNotFoundError(f'{self} is not a file')

    @property
    def name(self):
        return self._paths[0].name

    def __repr__(self):
        paths = ', '.join(f"'{path}'" for path in self._paths)
        return f'MultiplexedPath({paths})'


class NamespaceReader(abc.TraversableResources):
    def __init__(self, namespace_path):
        if 'NamespacePath' not in str(namespace_path):
            raise ValueError('Invalid path')
        self.path = MultiplexedPath(*list(namespace_path))

    def resource_path(self, resource):
        """
        Return the file system path to prevent
        `resources.path()` from creating a temporary
        copy.
        """
        return str(self.path.joinpath(resource))

    def files(self):
        return self.path
PK!OT{{@_vendor/importlib_resources/__pycache__/__init__.cpython-311.pycnu[

,ReZdZddlmZmZmZddlmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZgdZdS)z*Read resources contained within a package.)as_filefilesPackage)contentsopen_binaryread_binary	open_text	read_textis_resourcepathResource)ResourceReader)rr
rrrrrrr	rrr
N)__doc___commonrrr_legacyrrrr	r
rrr
abcr__all__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/__init__.pyrs00																				 


rPK!s  ?_vendor/importlib_resources/__pycache__/readers.cpython-311.pycnu[

,Re
ddlZddlZddlZddlmZddlmZddlmZdZ	Gddej
ZGd	d
ej
ZGddej
ZGd
dej
ZdS)N)abc)unique_everseen)ZipPathcZttj|SN)itercollectionsOrderedDictfromkeys)itemss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/readers.pyremove_duplicatesrs!'0077888c eZdZdZdZdZdS)
FileReadercLtj|jj|_dSr)pathlibPathpathparent)selfloaders  r__init__zFileReader.__init__sL--4			rcPt|j|Sz{
        Return the file system path to prevent
        `resources.path()` from creating a temporary
        copy.
        strrjoinpathrresources  r
resource_pathzFileReader.resource_path"49%%h//000rc|jSrrrs rfileszFileReader.files
yrN__name__
__module____qualname__rr"r'rrrrsA555111rrc0eZdZdZfdZdZdZxZS)	ZipReaderc|d\}}}|jdd|zdz|_|j|_dS)N.\/)
rpartitionprefixreplacearchive)rrmodule_names     rrzZipReader.__init__ sK&&s++
1dm++D#66=C~rc	t|S#t$r}t|jdd}~wwxYwNr)super
open_resourceKeyErrorFileNotFoundErrorargs)rr!exc	__class__s   rr>zZipReader.open_resource%sS	177((222	1	1	1#CHQK000	1s $
A
AA
c||}|o|Sr)r'ris_fileexists)rrtargets   ris_resourcezZipReader.is_resource+s<&&t,,~~3FMMOO3rc6t|j|jSr)rr7r5r&s rr'zZipReader.files1st|T[111r)r*r+r,rr>rHr'
__classcell__)rCs@rr/r/se&&&
111114442222222rr/cbeZdZdZdZdZdZdZdZdZ	dZ
e
Zd	Ze
d
ZdZdS)
MultiplexedPathz
    Given a series of Traversable objects, implement a merged
    version of the interface across all objects. Useful for
    namespace packages which may be multihomed at a single
    name.
    ctttjt	||_|jsd}t
|td|jDstddS)Nz.MultiplexedPath must contain at least one pathc3>K|]}|VdSr)is_dir.0rs  r	z+MultiplexedPath.__init__..Bs*99T4;;==999999rz)MultiplexedPath only supports directories)	listmaprrr_pathsr@allNotADirectoryError)rpathsmessages   rrzMultiplexedPath.__init__=s3w|->u-E-EFFGG{	-FG#G,,,99T[99999	R$%PQQQ	R	Rrcjd|jD}t|tjdS)Nc3HK|]}|D]}|VdSr)iterdir)rQrfiles   rrRz*MultiplexedPath.iterdir..Fs7II$$,,..II$IIIIIIIrr:)key)rUroperator
attrgetter)rr's  rr\zMultiplexedPath.iterdirEs5II$+IIIu(*=f*E*EFFFFrc&t|dNz is not a filer@r&s r
read_byteszMultiplexedPath.read_bytesI4 7 7 7888rc&t|drbrcrrAkwargss   r	read_textzMultiplexedPath.read_textLrercdS)NTr-r&s rrOzMultiplexedPath.is_dirOstrcdS)NFr-r&s rrEzMultiplexedPath.is_fileRsurcn|D]}|j|kr|cS|jd|zSr<)r\r:rU)rchildr]s   rrzMultiplexedPath.joinpathUsGLLNN		DyE!!"{1~%%rc&t|drbrcrgs   ropenzMultiplexedPath.open_rerc&|jdjSr<)rUr:r&s rr:zMultiplexedPath.namebs{1~""rcVdd|jD}d|dS)Nz, c3"K|]
}d|dVdS)'Nr-rPs  rrRz+MultiplexedPath.__repr__..gs*>>$+d+++>>>>>>rzMultiplexedPath())joinrU)rrXs  r__repr__zMultiplexedPath.__repr__fs5		>>$+>>>>>*%****rN)r*r+r,__doc__rr\rdrirOrEr__truediv__ropropertyr:rvr-rrrLrL5sRRRGGG999999&&&K999##X#+++++rrLc eZdZdZdZdZdS)NamespaceReaderc|dt|vrtdtt||_dS)N
NamespacePathzInvalid path)r
ValueErrorrLrSr)rnamespace_paths  rrzNamespaceReader.__init__ls;#n"5"555^,,,#T.%9%9:			rcPt|j|Srrr s  rr"zNamespaceReader.resource_pathqr#rc|jSrr%r&s rr'zNamespaceReader.filesyr(rNr)r-rrr{r{ksA;;;
111rr{)r
rr_r
_itertoolsr_compatrrTraversableResourcesrr/TraversablerLr{r-rrrs&''''''999




)


 22222(222,3+3+3+3+3+co3+3+3+lc.rPK!7?_vendor/importlib_resources/__pycache__/_common.cpython-311.pycnu[

,Re
HddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZddl
mZeejefZdZdZdZd	Zd
ZejddZejd
ZeejejdZdS)N)UnionOptional)ResourceReaderTraversable)	wrap_specc:tt|S)z3
    Get a Traversable resource from a package
    )from_packageget_package)packages /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/_common.pyfilesrs
G,,---cd|j}t|jdd}|dS||jS)z?
    Return the package's loader if it's a ResourceReader.
    get_resource_readerN)__spec__getattrloadernamerspecreaders   r
rrs<D
T["7
>
>F
~t6$)rcbt|tjr|ntj|S)N)
isinstancetypes
ModuleType	importlib
import_module)cands r
resolver *s*dE$455X449;RSW;X;XXrcpt|}t|jt|d|S)zTake a package name or module object and return the module.

    Raise an exception if the resolved module is not a package.
    Nz is not a package)r rsubmodule_search_locations	TypeError)rresolveds  r
rr/s>wH5=7777888Orct|}|j|j}|S)z=
    Return a Traversable object for the given package.

    )rrrrrrs   r
r
r
;s6
WD
[
,
,TY
7
7F<<>>rc#Ktj|\}}		tj||tj|n#tj|wxYw~tj|V	tj|dS#t$rYdSwxYw#	tj|w#t$rYwwxYwxYw)Nsuffix)	tempfilemkstemposwriteclosepathlibPathremoveFileNotFoundError)rr)fdraw_paths    r
	_tempfiler5Es
#6222LB	HR"""HRLLLLBHRLLLLl8$$$$$	Ih 			DD		Ih 			D	sRAB'A%%B'B
B$#B$'C)B>=C>
CC
CCc8t|j|jS)zu
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    r()r5
read_bytesrpaths r
as_filer:YsT_TY7777rc#K|VdS)z7
    Degenerate behavior for pathlib.Path objects.
    Nr8s r
_r=bsJJJJJr)r&)r,r/r*	functools
contextlibrrtypingrrabcrr_compatrrstrPackagerrr rr
contextmanagerr5singledispatchr:registerr0r=r<rr
rHsv				"""""""",,,,,,,,
 #%
&..."YYY
			&888	', rPK!{tt;_vendor/importlib_resources/__pycache__/abc.cpython-311.pycnu[

,Re.ddlZddlmZmZmZddlmZmZGddejZ	eGdd	eZ
Gd
de	ZdS)N)BinaryIOIterableText)runtime_checkableProtocolceZdZdZejdedefdZejdedefdZ	ejdede
fdZejdee
fdZd	S)
ResourceReaderzDAbstract base class for loaders to provide resource reading support.resourcereturnct)zReturn an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name.
        If the resource cannot be found, FileNotFoundError is raised.
        FileNotFoundErrorselfrs  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/abc.py
open_resourcezResourceReader.open_resource
s
 ct)zReturn the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name.
        If the resource does not exist on the file system, raise
        FileNotFoundError.
        rrs  r
resource_pathzResourceReader.resource_paths
 rpathct)zjReturn True if the named 'path' is a resource.

        Files are resources, directories are not.
        rrrs  ris_resourcezResourceReader.is_resource#s
 rct)z+Return an iterable of entries in `package`.rrs rcontentszResourceReader.contents+s
 rN)__name__
__module____qualname____doc__abcabstractmethodrrrrboolrrstrrrrr
r
sNN	 d	 x	 	 	 	 	
 d
 t
 
 
 
 	      	 (3-      rr
)	metaclassceZdZdZejdZdZddZejde	fdZ
ejde	fdZejd	Zd
Z
ejddZejdefd
ZdS)Traversablezt
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    cdS)z3
        Yield Traversable objects in self
        Nr&rs riterdirzTraversable.iterdir8rc|d5}|cdddS#1swxYwYdS)z0
        Read contents of self as bytes
        rbNopenread)rstrms  r
read_byteszTraversable.read_bytes>sYYt__	99;;																		s7;;Nc||5}|cdddS#1swxYwYdS)z/
        Read contents of self as text
        )encodingNr/)rr5r2s   r	read_textzTraversable.read_textEsYYY
)
)	T99;;																		s8<<rcdS)z4
        Return True if self is a directory
        Nr&rs ris_dirzTraversable.is_dirLr,rcdS)z/
        Return True if self is a file
        Nr&rs ris_filezTraversable.is_fileRr,rcdS)2
        Return Traversable child in self
        Nr&rchilds  rjoinpathzTraversable.joinpathXr,rc,||S)r<)r?r=s  r__truediv__zTraversable.__truediv__^s}}U###rrcdS)z
        mode may be 'r' or 'rb' to open as text or binary. Return a handle
        suitable for reading (same as pathlib.Path.open).

        When opening as text, accepts encoding parameters such as those
        accepted by io.TextIOWrapper.
        Nr&)rmodeargskwargss    rr0zTraversable.opendr,rcdS)zM
        The base name of this object without any parent references.
        Nr&rs rnamezTraversable.namenr,rN)rB)rrr r!r"r#r+r3r6r$r8r:r?rAr0abstractpropertyr%rHr&rrr)r)1s3
	
	
	
	
$$$		crr)cJeZdZdZejdZdZdZdZ	dZ
dS)TraversableResourceszI
    The required interface for providing traversable
    resources.
    cdS)z3Return a Traversable object for the loaded package.Nr&rs rfileszTraversableResources.files{r,rcv||dS)Nr.)rNr?r0rs  rrz"TraversableResources.open_resources,zz||$$X..33D999rc t|rIrrs  rrz"TraversableResources.resource_paths)))rct||SrI)rNr?r:rs  rrz TraversableResources.is_resources*zz||$$T**22444rcbd|DS)Nc3$K|]}|jVdSrI)rH).0items  r	z0TraversableResources.contents..s$==d	======r)rNr+rs rrzTraversableResources.contentss*==djjll&:&:&<&<====rN)rrr r!r"r#rNrrrrr&rrrLrLus|
	BBB:::***555>>>>>rrL)r"typingrrr_compatrrABCMetar
r)rLr&rrrZs



++++++++++00000000' ' ' ' ' s{' ' ' ' T@@@@@(@@@F>>>>>>>>>>>rPK!BB_vendor/importlib_resources/__pycache__/_itertools.cpython-311.pycnu[

,RetddlmZddlmZmZmZmZmZmZm	Z	edZ
edZ	d
dee
deee
gefdee
fd	ZdS))filterfalse)CallableIterableIteratorOptionalSetTypeVarUnion_T_UNiterablekeyreturnc#Kt}|j}|)t|j|D]}|||VdS|D] }||}||vr|||V!dS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddr__contains__)r
rseenseen_addelementks      /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/_itertools.pyunique_everseenrs #uuDxH
{"4#4h??		GHWMMMM		 		GGA}}


			)N)
	itertoolsrtypingrrrrrr	r
rrrrrrs!!!!!!
WT]]WT]]AErl!)(B48*.wrappersR
}
P
P
P
	
	
	
	
tT$V$$$)	functoolswraps)rrs` r
deprecatedrs8_T%%%%%Nrct|}tj|\}}|rt	|d|S)zNormalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    z must be only a file name)strospathsplit
ValueError)rstr_pathparent	file_names    rnormalize_pathr%sL4yyH

h//FI
?D===>>>rpackageresourcereturncptj|t|zdS)zDReturn a file-like object opened for binary reading of the resource.rbr
filesr%openr&r's  ropen_binaryr/+s/
M'""^H%=%==CCDIIIrcntj|t|zS)z+Return the binary contents of the resource.)r
r,r%
read_bytesr.s  rread_binaryr21s-
M'""^H%=%==IIKKKrutf-8strictencodingerrorscvtj|t|zd||S)zBReturn a file-like object opened for text reading of the resource.r)r5r6r+)r&r'r5r6s    r	open_textr97s@
M'""^H%=%==CChvDrct||||5}|cdddS#1swxYwYdS)zReturn the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    N)r9read)r&r'r5r6fps     r	read_textr=Ds
7Hh	7	72wwyys488cbdtj|DS)zReturn an iterable of entries in `package`.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    cg|]	}|j
S)name).0rs  r
zcontents..\sCCC$DICCCr)r
r,iterdir)r&s rcontentsrETs/DC'-"8"8"@"@"B"BCCCCrrAct|tfdtj|DS)zYTrue if `name` is a resource inside `package`.

    Directories are *not* resources.
    c3VK|]#}|jko|V$dS)N)rAis_file)rBtraversabler's  r	zis_resource..fsP	H$>)<)<)>)>r)r%anyr
r,rD)r&rAr's  @ris_resourcerL_s`d##H"=1199;;rcntjtj|t|zS)akA context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    )r
as_filer,r%r.s  rrrls+?7=11N84L4LLMMMr)r3r4)rrpathlibtypesrtypingrrrrrrr

ModuleTyperPackageResourcerr%r/bytesr2r9r=rEboolrLPathrr@rrrYs				IIIIIIIIIIIIIIII
 #%
&


JJHJJJJJ
LLHLLLLL
			
			
		
					

	
	DgD(3-DDDD							N
NNGL!NNNNNNrPK!_,00>_vendor/importlib_resources/__pycache__/simple.cpython-311.pycnu[

,RedZddlZddlZddlZddlmZmZddlmZmZGddej	Z
Gdd	eZGd
deZGdd
ee
Z
dS)z+
Interface adapters for low-level readers.
N)BinaryIOList)TraversableTraversableResourcesceZdZdZejdZejdZejdZ	ejdZ
edZdS)SimpleReaderzQ
    The minimum, low-level interface required from a resource
    provider.
    cdS)zP
        The name of the package for which this reader loads resources.
        Nselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/simple.pypackagezSimpleReader.packagecdS)zo
        Obtain an iterable of SimpleReader for available
        child containers (e.g. directories).
        Nrrs rchildrenzSimpleReader.childrenrrcdS)zL
        Obtain available named resources for this virtual package.
        Nrrs r	resourceszSimpleReader.resources"rrcdS)z:
        Obtain a File-like for a named resource.
        Nr)r
resources  ropen_binaryzSimpleReader.open_binary)rrcB|jddS)N.)rsplitrs rnamezSimpleReader.name0s|!!#&&r**rN)
__name__
__module____qualname____doc__abcabstractpropertyrabstractmethodrrrpropertyrrrrr	r	
s
				++X+++rr	c2eZdZdZdZdZdZd	dZdZdS)
ResourceHandlez9
    Handle to a named resource in a ResourceReader.
    c"||_||_dSN)parentr)r
r*rs   r__init__zResourceHandle.__init__:s			rcdSNTrrs ris_filezResourceHandle.is_file?trcdSNFrrs ris_dirzResourceHandle.is_dirBurrcx|jj|j}d|vrt	j|i|}|S)Nb)r*readerrrio
TextIOWrapper)r
modeargskwargsstreams     ropenzResourceHandle.openEs?#//	::d??%t6v66F
rc td)NzCannot traverse into a resource)RuntimeErrorr
rs  rjoinpathzResourceHandle.joinpathKs<===rN)r4)	rrr r!r+r.r2r>rBrrrr'r'5sn
>>>>>rr'c6eZdZdZdZdZdZdZdZdZ	dS)	ResourceContainerzI
    Traversable container for a package's resources via its reader.
    c||_dSr))r7)r
r7s  rr+zResourceContainer.__init__Ts
rcdSr-rrs rr2zResourceContainer.is_dirXr/rcdSr1rrs rr.zResourceContainer.is_file[r3rcfdjjD}ttj}tj||S)Nc38K|]}t|VdSr))r').0rr
s  r	z,ResourceContainer.iterdir.._s-NNd++NNNNNNr)r7rmaprDr	itertoolschain)r
filesdirss`  riterdirzResourceContainer.iterdir^sQNNNN8MNNN$dk&:&:&<&<==ud+++rctr))IsADirectoryError)r
r;r<s   rr>zResourceContainer.opencs!!!rc^tfd|DS)Nc32K|]}|jk
|VdSr))r)rJtraversablers  rrKz-ResourceContainer.joinpath..gs:

'[=MQU=U=UK=U=U=U=U

r)nextrQrAs `rrBzResourceContainer.joinpathfsC



+/<<>>




	
rN)
rrr r!r+r2r.rQr>rBrrrrDrDOsx,,,
"""




rrDceZdZdZdZdS)TraversableReaderz
    A TraversableResources based on SimpleReader. Resource providers
    may derive from this class to provide the TraversableResources
    interface by supplying the SimpleReader interface.
    c t|Sr))rDrs rrOzTraversableReader.filesss &&&rN)rrr r!rOrrrrYrYls-'''''rrY)r!r"r8rMtypingrrrrABCr	r'rDrYrrrr]s


				!!!!!!!!22222222%+%+%+%+%+37%+%+%+P>>>>>[>>>4







:''''',l'''''rPK!bY?_vendor/importlib_resources/__pycache__/_compat.cpython-311.pycnu[

,Re
ddlZddlZddlZddlmZejdkrddlmZnddl	mZ	ddl
mZn#e$rdZYnwxYw	ddl
m
Z
n#e$r
ejZ
YnwxYwGd	d
ZdZdS)N)suppress)
)Path)runtime_checkablec|SN)clss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/_compat.pyrrs
)Protocolc4eZdZdZdZedZdZdS)TraversableResourcesLoaderz
    Adapt loaders to provide TraversableResources and other
    compatibility.

    Used primarily for Python 3.9 and earlier where the native
    loaders do not yet implement TraversableResources.
    c||_dSr
spec)selfrs  r
__init__z#TraversableResourcesLoader.__init__%s
			rc|jjSr
)rorigin)rs r
pathzTraversableResourcesLoader.path(s
yrcddlmm}fd}fd}dfd}fd}|jpI|jp9|jp)|jp|jS)N)readers	_adaptersctt5|j|jcdddS#1swxYwYdSr
)rAttributeError	ZipReaderloadernamerrs r
_zip_readerzCTraversableResourcesLoader.get_resource_reader.._zip_reader/s.))
A
A((di@@
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
As AA
Acttt5|jcdddS#1swxYwYdSr
)rr
ValueErrorNamespaceReadersubmodule_search_locationsr#s r
_namespace_readerzITraversableResourcesLoader.get_resource_reader.._namespace_reader3s.*55
P
P..t/NOO
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
PsAA
Actt5|j|jcdddS#1swxYwYdSr
)rrr!get_resource_readerr"rs r
_available_readerzITraversableResourcesLoader.get_resource_reader.._available_reader7s.))
B
B{66tyAA
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
BsAAAcB|}t|dr|ndS)Nfiles)hasattr)rreaderr,s  r
_native_readerzFTraversableResourcesLoader.get_resource_reader.._native_reader;s,&&t,,F$VW55?664?rc	tjj}n#t$rYdSwxYw|rSdSr
)pathlibrr	TypeErrorexists
FileReader)rrrrs  r
_file_readerzDTraversableResourcesLoader.get_resource_reader.._file_reader?sk
|DI..


tt
{{}}
0))$///
0
0s
++)rrrCompatibilityFiles)	rr"rr$r)r1r7r,rs	`      @@r
r+z.TraversableResourcesLoader.get_resource_reader,s((((((((	A	A	A	A	A	P	P	P	P	P	B	B	B	@	@	@	@	@	0	0	0	0	0	0
N49%%
7
K	""
7
di((

7
L##
7++DI66	
rN)__name__
__module____qualname____doc__rpropertyrr+rrr
rrsW  X )
)
)
)
)
rrcNddlm}||jtS)z
    Construct a package spec with traversable compatibility
    on the spec/loader/reader.

    Supersedes _adapters.wrap_spec to use TraversableResourcesLoader
    from above for older Python compatibility (<3.10).
    r)r)r8rSpecLoaderAdapter__spec__r)packagers  r
	wrap_specrCXs0&&w'79STTTr)abcsysr3
contextlibrversion_infozipfilerZipPathzipptypingrImportErrorrABCrrCrrr
rNs>






w'''''''&&&&&&(((((((wHHH9
9
9
9
9
9
9
9
x
U
U
U
U
Us3>>A		AAPK!8*8*A_vendor/importlib_resources/__pycache__/_adapters.cpython-311.pycnu[

,ReddlmZddlmZddlmZGddZGddZdd
ZGddZ	d
Z
dS))suppress)
TextIOWrapper)abcc$eZdZdZdfdZdZdS)SpecLoaderAdapterz>
    Adapt a package spec to adapt the underlying loader.
    c|jSN)loaderspecs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_resources/_adapters.pyzSpecLoaderAdapter.s$+c4||_|||_dSr
)r
r)selfr
adapters   r__init__zSpecLoaderAdapter.__init__s	gdmmrc,t|j|Sr
)getattrr
rnames  r__getattr__zSpecLoaderAdapter.__getattr__sty$'''rN)__name__
__module____qualname____doc__rrrrrrsI&>%=$$$$(((((rrceZdZdZdZdZdS)TraversableResourcesLoaderz9
    Adapt a loader to provide TraversableResources.
    c||_dSr
rrr
s  rrz#TraversableResourcesLoader.__init__
			rcNt|jSr
)CompatibilityFilesr
_nativers  rget_resource_readerz.TraversableResourcesLoader.get_resource_readers!$),,44666rN)rrrrrr'rrrr r s<77777rr rc|dkrt|g|Ri|S|dkr|Std|)Nr(rbz8Invalid mode value '{}', only 'r' and 'rb' are supported)r
ValueErrorformat)filemodeargskwargss    r_io_wrapperr1 sZs{{T3D333F333	

BII$OOrceZdZdZGddejZGddejZGddejZdZ	e
d	Zd
ZdZ
dZd
S)r%zj
    Adapter for an existing or non-existent resource reader
    to provide a compatibility .files().
    cLeZdZdZdZdZdZeZdZe	dZ
d
dZd	S)CompatibilityFiles.SpecPathzk
        Path tied to a module spec.
        Can be read and exposes the resource reader children.
        c"||_||_dSr
)_spec_reader)rr
readers   rrz$CompatibilityFiles.SpecPath.__init__6sDJ!DLLLrcjstdStfdjDS)Nrc3XK|]$}tj|V%dSr
)r%	ChildPathr7).0pathrs  r	z6CompatibilityFiles.SpecPath.iterdir..=sI#,,T\4@@r)r7itercontentsrs`riterdirz#CompatibilityFiles.SpecPath.iterdir:s^<
 Bxx L1133
rcdSNFrrAs ris_filez#CompatibilityFiles.SpecPath.is_fileB5rc|jst|St|j|Sr
)r7r%
OrphanPathr;rothers  rjoinpathz$CompatibilityFiles.SpecPath.joinpathGs8<
<)44U;;;%//eDDDrc|jjSr
)r6rrAs rrz CompatibilityFiles.SpecPath.nameLs:?"rr(cTt|jd|g|Ri|Sr
)r1r7
open_resourcerr.r/r0s    ropenz CompatibilityFiles.SpecPath.openPs3t|99$??WWWWPVWWWrNr(rrrrrrBrEis_dirrKpropertyrrPrrrSpecPathr40s		
	"	"	"							E	E	E

	#	#
	#	X	X	X	X	X	XrrUcNeZdZdZdZdZdZdZdZe	dZ
dd	Zd
S)CompatibilityFiles.ChildPathzw
        Path tied to a resource reader child.
        Can be read but doesn't expose any meaningful children.
        c"||_||_dSr
)r7_name)rr8rs   rrz%CompatibilityFiles.ChildPath.__init__Ys!DLDJJJrc tdSNrr?rAs rrBz$CompatibilityFiles.ChildPath.iterdir]
88Orc@|j|jSr
)r7is_resourcerrAs rrEz$CompatibilityFiles.ChildPath.is_file`s<++DI666rc,|Sr
)rErAs rrSz#CompatibilityFiles.ChildPath.is_dircs||~~%%rcBt|j|Sr
)r%rHrrIs  rrKz%CompatibilityFiles.ChildPath.joinpathfs%00EBBBrc|jSr
)rYrAs rrz!CompatibilityFiles.ChildPath.nameis
:rr(c^t|j|j|g|Ri|Sr
)r1r7rNrrOs    rrPz!CompatibilityFiles.ChildPath.openmsE**4955t>BFL
rNrQrRrrrr;rWSs		
							7	7	7	&	&	&	C	C	C
		
							rr;cLeZdZdZdZdZdZeZdZe	dZ
d
dZd	S)CompatibilityFiles.OrphanPathz
        Orphan path, not tied to a module spec or resource reader.
        Can't be read and doesn't expose any meaningful children.
        cXt|dkrtd||_dS)Nrz/Need at least one path part to construct a path)lenr+_path)r
path_partss  rrz&CompatibilityFiles.OrphanPath.__init__xs-:"" !RSSS#DJJJrc tdSr[r\rAs rrBz%CompatibilityFiles.OrphanPath.iterdir}r]rcdSrDrrAs rrEz%CompatibilityFiles.OrphanPath.is_filerFrc2tjg|j|RSr
)r%rHrhrIs  rrKz&CompatibilityFiles.OrphanPath.joinpaths %0D$*DeDDDDrc|jdS)N)rhrAs rrz"CompatibilityFiles.OrphanPath.names:b>!rr(c td)NzCan't open orphan path)FileNotFoundErrorrOs    rrPz"CompatibilityFiles.OrphanPath.opens#$<===rNrQrRrrrrHrers		
	$	$	$
							E	E	E
	"	"
	"	>	>	>	>	>	>rrHc||_dSr
rr"s  rrzCompatibilityFiles.__init__r#rctt5|jj|jjcdddS#1swxYwYdSr
)rAttributeErrorr
rr'rrAs rr7zCompatibilityFiles._readers
n
%
%	H	H9#77	GG	H	H	H	H	H	H	H	H	H	H	H	H	H	H	H	H	H	Hs)AAAc8|j}t|dr|n|S)zB
        Return the native reader if it supports files().
        files)r7hasattr)rr8s  rr&zCompatibilityFiles._natives$ 11;vvt;rc,t|j|Sr
)rr7)rattrs  rrzCompatibilityFiles.__getattr__st|T***rcLt|j|jSr
)r%rUr
r7rAs rruzCompatibilityFiles.filess!**49dlCCCrN)rrrrrTraversablerUr;rHrrTr7r&rrurrrr%r%*s

!X!X!X!X!X3?!X!X!XFCO>>>>>>S_>>>:HHXH<<<+++DDDDDrr%c6t|jtS)z`
    Construct a package spec with traversable compatibility
    on the spec/loader/reader.
    )r__spec__r )packages r	wrap_specr~s
W-/IJJJrNrQ)
contextlibriorrrr r1r%r~rrrrs
(
(
(
(
(
(
(
(	7	7	7	7	7	7	7	7xDxDxDxDxDxDxDxDvKKKKKrPK!.1

&_vendor/importlib_resources/_legacy.pynu[import functools
import os
import pathlib
import types
import warnings

from typing import Union, Iterable, ContextManager, BinaryIO, TextIO, Any

from . import _common

Package = Union[types.ModuleType, str]
Resource = str


def deprecated(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        warnings.warn(
            f"{func.__name__} is deprecated. Use files() instead. "
            "Refer to https://importlib-resources.readthedocs.io"
            "/en/latest/using.html#migrating-from-legacy for migration advice.",
            DeprecationWarning,
            stacklevel=2,
        )
        return func(*args, **kwargs)

    return wrapper


def normalize_path(path):
    # type: (Any) -> str
    """Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    """
    str_path = str(path)
    parent, file_name = os.path.split(str_path)
    if parent:
        raise ValueError(f'{path!r} must be only a file name')
    return file_name


@deprecated
def open_binary(package: Package, resource: Resource) -> BinaryIO:
    """Return a file-like object opened for binary reading of the resource."""
    return (_common.files(package) / normalize_path(resource)).open('rb')


@deprecated
def read_binary(package: Package, resource: Resource) -> bytes:
    """Return the binary contents of the resource."""
    return (_common.files(package) / normalize_path(resource)).read_bytes()


@deprecated
def open_text(
    package: Package,
    resource: Resource,
    encoding: str = 'utf-8',
    errors: str = 'strict',
) -> TextIO:
    """Return a file-like object opened for text reading of the resource."""
    return (_common.files(package) / normalize_path(resource)).open(
        'r', encoding=encoding, errors=errors
    )


@deprecated
def read_text(
    package: Package,
    resource: Resource,
    encoding: str = 'utf-8',
    errors: str = 'strict',
) -> str:
    """Return the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    """
    with open_text(package, resource, encoding, errors) as fp:
        return fp.read()


@deprecated
def contents(package: Package) -> Iterable[str]:
    """Return an iterable of entries in `package`.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    """
    return [path.name for path in _common.files(package).iterdir()]


@deprecated
def is_resource(package: Package, name: str) -> bool:
    """True if `name` is a resource inside `package`.

    Directories are *not* resources.
    """
    resource = normalize_path(name)
    return any(
        traversable.name == resource and traversable.is_file()
        for traversable in _common.files(package).iterdir()
    )


@deprecated
def path(
    package: Package,
    resource: Resource,
) -> ContextManager[pathlib.Path]:
    """A context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    """
    return _common.as_file(_common.files(package) / normalize_path(resource))
PK!0Q}

&_vendor/importlib_resources/_common.pynu[import os
import pathlib
import tempfile
import functools
import contextlib
import types
import importlib

from typing import Union, Optional
from .abc import ResourceReader, Traversable

from ._compat import wrap_spec

Package = Union[types.ModuleType, str]


def files(package):
    # type: (Package) -> Traversable
    """
    Get a Traversable resource from a package
    """
    return from_package(get_package(package))


def get_resource_reader(package):
    # type: (types.ModuleType) -> Optional[ResourceReader]
    """
    Return the package's loader if it's a ResourceReader.
    """
    # We can't use
    # a issubclass() check here because apparently abc.'s __subclasscheck__()
    # hook wants to create a weak reference to the object, but
    # zipimport.zipimporter does not support weak references, resulting in a
    # TypeError.  That seems terrible.
    spec = package.__spec__
    reader = getattr(spec.loader, 'get_resource_reader', None)  # type: ignore
    if reader is None:
        return None
    return reader(spec.name)  # type: ignore


def resolve(cand):
    # type: (Package) -> types.ModuleType
    return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)


def get_package(package):
    # type: (Package) -> types.ModuleType
    """Take a package name or module object and return the module.

    Raise an exception if the resolved module is not a package.
    """
    resolved = resolve(package)
    if wrap_spec(resolved).submodule_search_locations is None:
        raise TypeError(f'{package!r} is not a package')
    return resolved


def from_package(package):
    """
    Return a Traversable object for the given package.

    """
    spec = wrap_spec(package)
    reader = spec.loader.get_resource_reader(spec.name)
    return reader.files()


@contextlib.contextmanager
def _tempfile(reader, suffix=''):
    # Not using tempfile.NamedTemporaryFile as it leads to deeper 'try'
    # blocks due to the need to close the temporary file to work on Windows
    # properly.
    fd, raw_path = tempfile.mkstemp(suffix=suffix)
    try:
        try:
            os.write(fd, reader())
        finally:
            os.close(fd)
        del reader
        yield pathlib.Path(raw_path)
    finally:
        try:
            os.remove(raw_path)
        except FileNotFoundError:
            pass


@functools.singledispatch
def as_file(path):
    """
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    """
    return _tempfile(path.read_bytes, suffix=path.name)


@as_file.register(pathlib.Path)
@contextlib.contextmanager
def _(path):
    """
    Degenerate behavior for pathlib.Path objects.
    """
    yield path
PK!'(_vendor/importlib_resources/_adapters.pynu[from contextlib import suppress
from io import TextIOWrapper

from . import abc


class SpecLoaderAdapter:
    """
    Adapt a package spec to adapt the underlying loader.
    """

    def __init__(self, spec, adapter=lambda spec: spec.loader):
        self.spec = spec
        self.loader = adapter(spec)

    def __getattr__(self, name):
        return getattr(self.spec, name)


class TraversableResourcesLoader:
    """
    Adapt a loader to provide TraversableResources.
    """

    def __init__(self, spec):
        self.spec = spec

    def get_resource_reader(self, name):
        return CompatibilityFiles(self.spec)._native()


def _io_wrapper(file, mode='r', *args, **kwargs):
    if mode == 'r':
        return TextIOWrapper(file, *args, **kwargs)
    elif mode == 'rb':
        return file
    raise ValueError(
        "Invalid mode value '{}', only 'r' and 'rb' are supported".format(mode)
    )


class CompatibilityFiles:
    """
    Adapter for an existing or non-existent resource reader
    to provide a compatibility .files().
    """

    class SpecPath(abc.Traversable):
        """
        Path tied to a module spec.
        Can be read and exposes the resource reader children.
        """

        def __init__(self, spec, reader):
            self._spec = spec
            self._reader = reader

        def iterdir(self):
            if not self._reader:
                return iter(())
            return iter(
                CompatibilityFiles.ChildPath(self._reader, path)
                for path in self._reader.contents()
            )

        def is_file(self):
            return False

        is_dir = is_file

        def joinpath(self, other):
            if not self._reader:
                return CompatibilityFiles.OrphanPath(other)
            return CompatibilityFiles.ChildPath(self._reader, other)

        @property
        def name(self):
            return self._spec.name

        def open(self, mode='r', *args, **kwargs):
            return _io_wrapper(self._reader.open_resource(None), mode, *args, **kwargs)

    class ChildPath(abc.Traversable):
        """
        Path tied to a resource reader child.
        Can be read but doesn't expose any meaningful children.
        """

        def __init__(self, reader, name):
            self._reader = reader
            self._name = name

        def iterdir(self):
            return iter(())

        def is_file(self):
            return self._reader.is_resource(self.name)

        def is_dir(self):
            return not self.is_file()

        def joinpath(self, other):
            return CompatibilityFiles.OrphanPath(self.name, other)

        @property
        def name(self):
            return self._name

        def open(self, mode='r', *args, **kwargs):
            return _io_wrapper(
                self._reader.open_resource(self.name), mode, *args, **kwargs
            )

    class OrphanPath(abc.Traversable):
        """
        Orphan path, not tied to a module spec or resource reader.
        Can't be read and doesn't expose any meaningful children.
        """

        def __init__(self, *path_parts):
            if len(path_parts) < 1:
                raise ValueError('Need at least one path part to construct a path')
            self._path = path_parts

        def iterdir(self):
            return iter(())

        def is_file(self):
            return False

        is_dir = is_file

        def joinpath(self, other):
            return CompatibilityFiles.OrphanPath(*self._path, other)

        @property
        def name(self):
            return self._path[-1]

        def open(self, mode='r', *args, **kwargs):
            raise FileNotFoundError("Can't open orphan path")

    def __init__(self, spec):
        self.spec = spec

    @property
    def _reader(self):
        with suppress(AttributeError):
            return self.spec.loader.get_resource_reader(self.spec.name)

    def _native(self):
        """
        Return the native reader if it supports files().
        """
        reader = self._reader
        return reader if hasattr(reader, 'files') else self

    def __getattr__(self, attr):
        return getattr(self._reader, attr)

    def files(self):
        return CompatibilityFiles.SpecPath(self.spec, self._reader)


def wrap_spec(package):
    """
    Construct a package spec with traversable compatibility
    on the spec/loader/reader.
    """
    return SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)
PK!c%_vendor/importlib_resources/simple.pynu["""
Interface adapters for low-level readers.
"""

import abc
import io
import itertools
from typing import BinaryIO, List

from .abc import Traversable, TraversableResources


class SimpleReader(abc.ABC):
    """
    The minimum, low-level interface required from a resource
    provider.
    """

    @abc.abstractproperty
    def package(self):
        # type: () -> str
        """
        The name of the package for which this reader loads resources.
        """

    @abc.abstractmethod
    def children(self):
        # type: () -> List['SimpleReader']
        """
        Obtain an iterable of SimpleReader for available
        child containers (e.g. directories).
        """

    @abc.abstractmethod
    def resources(self):
        # type: () -> List[str]
        """
        Obtain available named resources for this virtual package.
        """

    @abc.abstractmethod
    def open_binary(self, resource):
        # type: (str) -> BinaryIO
        """
        Obtain a File-like for a named resource.
        """

    @property
    def name(self):
        return self.package.split('.')[-1]


class ResourceHandle(Traversable):
    """
    Handle to a named resource in a ResourceReader.
    """

    def __init__(self, parent, name):
        # type: (ResourceContainer, str) -> None
        self.parent = parent
        self.name = name  # type: ignore

    def is_file(self):
        return True

    def is_dir(self):
        return False

    def open(self, mode='r', *args, **kwargs):
        stream = self.parent.reader.open_binary(self.name)
        if 'b' not in mode:
            stream = io.TextIOWrapper(*args, **kwargs)
        return stream

    def joinpath(self, name):
        raise RuntimeError("Cannot traverse into a resource")


class ResourceContainer(Traversable):
    """
    Traversable container for a package's resources via its reader.
    """

    def __init__(self, reader):
        # type: (SimpleReader) -> None
        self.reader = reader

    def is_dir(self):
        return True

    def is_file(self):
        return False

    def iterdir(self):
        files = (ResourceHandle(self, name) for name in self.reader.resources)
        dirs = map(ResourceContainer, self.reader.children())
        return itertools.chain(files, dirs)

    def open(self, *args, **kwargs):
        raise IsADirectoryError()

    def joinpath(self, name):
        return next(
            traversable for traversable in self.iterdir() if traversable.name == name
        )


class TraversableReader(TraversableResources, SimpleReader):
    """
    A TraversableResources based on SimpleReader. Resource providers
    may derive from this class to provide the TraversableResources
    interface by supplying the SimpleReader interface.
    """

    def files(self):
        return ResourceContainer(self)
PK!oq'_vendor/importlib_resources/__init__.pynu["""Read resources contained within a package."""

from ._common import (
    as_file,
    files,
    Package,
)

from ._legacy import (
    contents,
    open_binary,
    read_binary,
    open_text,
    read_text,
    is_resource,
    path,
    Resource,
)

from .abc import ResourceReader


__all__ = [
    'Package',
    'Resource',
    'ResourceReader',
    'as_file',
    'contents',
    'files',
    'is_resource',
    'open_binary',
    'open_text',
    'path',
    'read_binary',
    'read_text',
]
PK!htt)_vendor/importlib_resources/_itertools.pynu[from itertools import filterfalse

from typing import (
    Callable,
    Iterable,
    Iterator,
    Optional,
    Set,
    TypeVar,
    Union,
)

# Type and type variable definitions
_T = TypeVar('_T')
_U = TypeVar('_U')


def unique_everseen(
    iterable: Iterable[_T], key: Optional[Callable[[_T], _U]] = None
) -> Iterator[_T]:
    "List unique elements, preserving order. Remember all elements ever seen."
    # unique_everseen('AAAABBBCCDAABBB') --> A B C D
    # unique_everseen('ABBCcAD', str.lower) --> A B C D
    seen: Set[Union[_T, _U]] = set()
    seen_add = seen.add
    if key is None:
        for element in filterfalse(seen.__contains__, iterable):
            seen_add(element)
            yield element
    else:
        for element in iterable:
            k = key(element)
            if k not in seen:
                seen_add(k)
                yield element
PK!}>.."_vendor/importlib_resources/abc.pynu[import abc
from typing import BinaryIO, Iterable, Text

from ._compat import runtime_checkable, Protocol


class ResourceReader(metaclass=abc.ABCMeta):
    """Abstract base class for loaders to provide resource reading support."""

    @abc.abstractmethod
    def open_resource(self, resource: Text) -> BinaryIO:
        """Return an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name.
        If the resource cannot be found, FileNotFoundError is raised.
        """
        # This deliberately raises FileNotFoundError instead of
        # NotImplementedError so that if this method is accidentally called,
        # it'll still do the right thing.
        raise FileNotFoundError

    @abc.abstractmethod
    def resource_path(self, resource: Text) -> Text:
        """Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name.
        If the resource does not exist on the file system, raise
        FileNotFoundError.
        """
        # This deliberately raises FileNotFoundError instead of
        # NotImplementedError so that if this method is accidentally called,
        # it'll still do the right thing.
        raise FileNotFoundError

    @abc.abstractmethod
    def is_resource(self, path: Text) -> bool:
        """Return True if the named 'path' is a resource.

        Files are resources, directories are not.
        """
        raise FileNotFoundError

    @abc.abstractmethod
    def contents(self) -> Iterable[str]:
        """Return an iterable of entries in `package`."""
        raise FileNotFoundError


@runtime_checkable
class Traversable(Protocol):
    """
    An object with a subset of pathlib.Path methods suitable for
    traversing directories and opening files.
    """

    @abc.abstractmethod
    def iterdir(self):
        """
        Yield Traversable objects in self
        """

    def read_bytes(self):
        """
        Read contents of self as bytes
        """
        with self.open('rb') as strm:
            return strm.read()

    def read_text(self, encoding=None):
        """
        Read contents of self as text
        """
        with self.open(encoding=encoding) as strm:
            return strm.read()

    @abc.abstractmethod
    def is_dir(self) -> bool:
        """
        Return True if self is a directory
        """

    @abc.abstractmethod
    def is_file(self) -> bool:
        """
        Return True if self is a file
        """

    @abc.abstractmethod
    def joinpath(self, child):
        """
        Return Traversable child in self
        """

    def __truediv__(self, child):
        """
        Return Traversable child in self
        """
        return self.joinpath(child)

    @abc.abstractmethod
    def open(self, mode='r', *args, **kwargs):
        """
        mode may be 'r' or 'rb' to open as text or binary. Return a handle
        suitable for reading (same as pathlib.Path.open).

        When opening as text, accepts encoding parameters such as those
        accepted by io.TextIOWrapper.
        """

    @abc.abstractproperty
    def name(self) -> str:
        """
        The base name of this object without any parent references.
        """


class TraversableResources(ResourceReader):
    """
    The required interface for providing traversable
    resources.
    """

    @abc.abstractmethod
    def files(self):
        """Return a Traversable object for the loaded package."""

    def open_resource(self, resource):
        return self.files().joinpath(resource).open('rb')

    def resource_path(self, resource):
        raise FileNotFoundError(resource)

    def is_resource(self, path):
        return self.files().joinpath(path).is_file()

    def contents(self):
        return (item.name for item in self.files().iterdir())
PK!{$$%_vendor/importlib_metadata/_compat.pynu[import sys
import platform


__all__ = ['install', 'NullFinder', 'Protocol']


try:
    from typing import Protocol
except ImportError:  # pragma: no cover
    from ..typing_extensions import Protocol  # type: ignore


def install(cls):
    """
    Class decorator for installation on sys.meta_path.

    Adds the backport DistributionFinder to sys.meta_path and
    attempts to disable the finder functionality of the stdlib
    DistributionFinder.
    """
    sys.meta_path.append(cls())
    disable_stdlib_finder()
    return cls


def disable_stdlib_finder():
    """
    Give the backport primacy for discovering path-based distributions
    by monkey-patching the stdlib O_O.

    See #91 for more background for rationale on this sketchy
    behavior.
    """

    def matches(finder):
        return getattr(
            finder, '__module__', None
        ) == '_frozen_importlib_external' and hasattr(finder, 'find_distributions')

    for finder in filter(matches, sys.meta_path):  # pragma: nocover
        del finder.find_distributions


class NullFinder:
    """
    A "Finder" (aka "MetaClassFinder") that never finds any modules,
    but may find distributions.
    """

    @staticmethod
    def find_spec(*args, **kwargs):
        return None

    # In Python 2, the import system requires finders
    # to have a find_module() method, but this usage
    # is deprecated in Python 3 in favor of find_spec().
    # For the purposes of this finder (i.e. being present
    # on sys.meta_path but having no other import
    # system functionality), the two methods are identical.
    find_module = find_spec


def pypy_partial(val):
    """
    Adjust for variable stacklevel on partial under PyPy.

    Workaround for #327.
    """
    is_pypy = platform.python_implementation() == 'PyPy'
    return val + is_pypy
PK!C_vendor/importlib_metadata/__pycache__/_collections.cpython-311.pycnu[

,RenddlZGddejZGddejddZdS)Nc(eZdZdZfdZdZxZS)FreezableDefaultDicta!
    Often it is desirable to prevent the mutation of
    a default dict after its initial construction, such
    as to prevent mutation during iteration.

    >>> dd = FreezableDefaultDict(list)
    >>> dd[0].append('1')
    >>> dd.freeze()
    >>> dd[1]
    []
    >>> len(dd)
    1
    cZt|dtj|S)N_frozen)getattrsuper__missing__)selfkey	__class__s  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_collections.pyr	z FreezableDefaultDict.__missing__s&z-FreezableDefaultDict.freeze..s4#7#7#9#9r)r)r
s`r
freezezFreezableDefaultDict.freezes9999r)__name__
__module____qualname____doc__r	r
__classcell__)rs@r
rrsVBBBBB:::::::rrc$eZdZedZdS)Pairc	d|ttj|ddS)N=)mapstrstripsplit)clstexts  r
parsez
Pair.parses)sC	4::c1#5#56677rN)rrrclassmethodr$rr
rrs-88[888rrz
name value)collectionsdefaultdictr
namedtuplerr&rr
r*s:::::;2:::,88888!;!&,7788888rPK!=	?_vendor/importlib_metadata/__pycache__/__init__.cpython-311.pycnu[

,ReuddlZddlZddlZddlZddlZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZmZddlmZmZddlmZmZmZddlmZmZdd	lmZmZdd
lmZm Z ddl!m"Z"ddl#m$Z$dd
l%m&Z&ddl
m'Z'ddl(m)Z)m*Z*m+Z+m,Z,gdZ-Gdde.Z/GddZ0GddZ1Gdde1Z2Gdde3Z4Gdde4Z5GddZ6Gdd e6e7Z8Gd!d"ej9Z:Gd#d$Z;Gd%d&Z<Gd'd(e&Z=Gd)d*Z>Gd+d,Z?Gd-d.Z@eGd/d0ee=ZAGd1d2e<ZBd3ZCd4ZDd5ejfd6ZEd7ZFd5e,e5e8ffd8ZGd9ZHd:ZId5e*eJe)eJffd;ZKd<ZLd=ZMdS)>N)zipp)	_adapters_meta)FreezableDefaultDictPair)
NullFinderinstallpypy_partial)method_cache	pass_none)always_iterableunique_everseen)PackageMetadata
SimplePath)suppress)
import_module)MetaPathFinder)starmap)ListMappingOptionalUnion)DistributionDistributionFinderrPackageNotFoundErrordistribution
distributionsentry_pointsfilesmetadatapackages_distributionsrequiresversionc.eZdZdZdZedZdS)rzThe package was not found.cd|jS)Nz"No package metadata was found for nameselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/__init__.py__str__zPackageNotFoundError.__str__6s?DI???c|j\}|SN)argsr+r)s  r,r)zPackageNotFoundError.name9s)r.N)__name__
__module____qualname____doc__r-propertyr)r.r,rr3sG$$@@@Xr.rceZdZdZejdZedZ	e
ddZe
dZdS)	Sectioneda
    A simple entry point config parser for performance

    >>> for item in Sectioned.read(Sectioned._sample):
    ...     print(item)
    Pair(name='sec1', value='# comments ignored')
    Pair(name='sec1', value='a = 1')
    Pair(name='sec1', value='b = 2')
    Pair(name='sec2', value='a = 2')

    >>> res = Sectioned.section_pairs(Sectioned._sample)
    >>> item = next(res)
    >>> item.name
    'sec1'
    >>> item.value
    Pair(name='a', value='1')
    >>> item = next(res)
    >>> item.value
    Pair(name='b', value='2')
    >>> item = next(res)
    >>> item.name
    'sec2'
    >>> item.value
    Pair(name='a', value='2')
    >>> list(res)
    []
    zm
        [sec1]
        # comments ignored
        a = 1
        b = 2

        [sec2]
        a = 2
        cNd|||jDS)Nc3~K|]8}|j	|tj|jV9dS)N)value)r)_replacer	parser=).0sections  r,	z*Sectioned.section_pairs..jsS

|'
4:gm#<#<==''''

r.)filter_)readvalid)clstexts  r,
section_pairszSectioned.section_pairshs5

88D#)8<<


	
r.Nc#4Kt|ttj|}d}|D]V}|do|d}|r|d}Dt||VWdS)N[]z[])filtermapstrstrip
splitlines
startswithendswithr	)rGrClinesr)r=
section_matchs      r,rDzSectioned.readpswCIt/@/@ A ABB	$	$E!,,S11IennS6I6IM
{{4((tU######	$	$r.c2|o|dS)N#)rQ)lines r,rEzSectioned.valid{s0DOOC0000r.r0)
r3r4r5r6textwrapdedentlstrip_sampleclassmethodrHstaticmethodrDrEr8r.r,r:r:?s8ho	


fhh

[
$$$\$11\111r.r:c\eZdZdZejejdee	dZ
dZdS)DeprecatedTuplea
    Provide subscript item access for backward compatibility.

    >>> recwarn = getfixture('recwarn')
    >>> ep = EntryPoint(name='name', value='value', group='group')
    >>> ep[:]
    ('name', 'value', 'group')
    >>> ep[0]
    'name'
    >>> len(recwarn)
    1
    zAEntryPoint tuple interface is deprecated. Access members by name.r
stacklevelc^|||Sr0)_warn_key)r+items  r,__getitem__zDeprecatedTuple.__getitem__s"

yy{{4  r.N)r3r4r5r6	functoolspartialwarningswarnDeprecationWarningrrcrfr8r.r,r_r_s^
I
K<??	


E!!!!!r.r_ceZdZUdZejdZ	dZede	d<dZ
dZedZ
ed	Zed
ZdZdZd
ZdZdZdZdZdZdZdS)
EntryPointzAn entry point as defined by Python packaging conventions.

    See `the packaging docs on entry points
    `_
    for more information.
    zH(?P[\w.]+)\s*(:\s*(?P[\w.]+)\s*)?((?P\[.*\])\s*)?$NrdistcPt||||dS)Nr)r=groupvarsupdate)r+r)r=rqs    r,__init__zEntryPoint.__init__s)T

t5>>>>>r.c*|j|j}t|d}td|dpdd}tjt||S)zLoad the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        moduleNattr.)
patternmatchr=rrqrLsplitrgreducegetattr)r+r|rwattrss    r,loadzEntryPoint.loadsw
""4:..u{{84455tekk&117R>>sCCDD777r.cj|j|j}|dS)Nrwr{r|r=rqr+r|s  r,rwzEntryPoint.modules+""4:..{{8$$$r.cj|j|j}|dS)Nrxrrs  r,rxzEntryPoint.attrs+""4:..{{6"""r.c|j|j}tt	jd|dpdS)Nz\w+extrasry)r{r|r=listrefinditerrqrs  r,rzEntryPoint.extrassD""4:..BKH(=(=(CDDEEEr.cLt|||S)Nrnrr)r+rns  r,_forzEntryPoint._fors$T

t$$$r.cfd}tj|tt|j|fS)zP
        Supply iter so one may construct dicts of EntryPoints by name.
        zJConstruction of dict of EntryPoints is deprecated in favor of EntryPoints.)rirjrkiterr))r+msgs  r,__iter__zEntryPoint.__iter__s6

$		
c-...TY%&&&r.cfd|D}tttj||S)Nc38K|]}t|VdSr0r)r@paramr+s  r,rBz%EntryPoint.matches..s-::%u%%::::::r.)allrMoperatoreqvalues)r+paramsrs`  r,matcheszEntryPoint.matchess@::::6:::3x{FMMOOU;;<<
")))???888%%X%##X#FFXF	'	'	'===111***+++BBB


!!!!!r.rmceZdZdZdZejejde	e
dZdeffdZ
eee
dd	Zd
ZxZS)DeprecatedLista>
    Allow an otherwise immutable object to implement mutability
    for compatibility.

    >>> recwarn = getfixture('recwarn')
    >>> dl = DeprecatedList(range(3))
    >>> dl[0] = 1
    >>> dl.append(3)
    >>> del dl[3]
    >>> dl.reverse()
    >>> dl.sort()
    >>> dl.extend([4])
    >>> dl.pop(-1)
    4
    >>> dl.remove(1)
    >>> dl += [5]
    >>> dl + [6]
    [1, 2, 5, 6]
    >>> dl + (6,)
    [1, 2, 5, 6]
    >>> dl.insert(0, 0)
    >>> dl
    [0, 1, 2, 5]
    >>> dl == [0, 1, 2, 5]
    True
    >>> dl == (0, 1, 2, 5)
    True
    >>> len(recwarn)
    1
    r8zAEntryPoints list interface is deprecated. Cast to list if needed.rr`method_namecfd}|fS)Ncp|tt|i|Sr0)rcrsuper)r+r1kwargs	__class__rs   r,wrappedz7DeprecatedList._wrap_deprecated_method..wrapped(s3JJLLL07577K00$A&AAAr.r8)rrrs` r,_wrap_deprecated_methodz&DeprecatedList._wrap_deprecated_method's5	B	B	B	B	B	BG##r.zM__setitem__ __delitem__ append reverse extend pop remove __iadd__ insert sortct|ts#|t|}|t||zSr0)
isinstancetuplercrrs  r,__add__zDeprecatedList.__add__6sI%''	!JJLLL%LLE~~eDkkE1222r.ct|ts#|t|}t||Sr0)rrrcrrs  r,rzDeprecatedList.__eq__<sF%''	!JJLLL%LLET{{!!%(((r.)r3r4r5r6	__slots__rgrhrirjrkrrcrNrlocalsrtrMr}rr
__classcell__rs@r,rrs>II
K<??	


E$S$$$$$$FHHOO#
##(577	
	
333)))))))r.rceZdZdZdZfdZdZedZedZ	e
dZedZ
xZS)	EntryPointszC
    An immutable collection of selectable EntryPoint objects.
    r8cDt|tr=tjdtdt|S	tt|	|S#t$rt|wxYw)z;
        Get the EntryPoint in self matching name.
        zGAccessing entry points by index is deprecated. Cast to tuple if needed.rr`r()rintrirjrkrrfnextrselect
StopIterationKeyErrorr+r)rs  r,rfzEntryPoints.__getitem__KsdC  	-M+"	



77&&t,,,	!T[[d[3344555	!	!	!4.. 	!s/BBc:tfd|DS)zv
        Select entry points from self that match the
        given parameters (typically group and/or name).
        c36K|]}|jdi|VdSNr8)r)r@eprs  r,rBz%EntryPoints.select..as:EE"

0D0DV0D0DE2EEEEEEr.rr+rs `r,rzEntryPoints.select\s(
EEEEEEEEEEr.cd|DS)zB
        Return the set of all names of all entry points.
        ch|]	}|j
Sr8r(r@rs  r,	z$EntryPoints.names..hs'''B'''r.r8r*s r,nameszEntryPoints.namescs
('$''''r.cd|DS)z
        Return the set of all groups of all entry points.

        For coverage while SelectableGroups is present.
        >>> EntryPoints().groups
        set()
        ch|]	}|j
Sr8)rqrs  r,rz%EntryPoints.groups..ss(((R(((r.r8r*s r,groupszEntryPoints.groupsjs)(4((((r.cX|fd||DS)Nc3BK|]}|VdSr0)r)r@rrns  r,rBz-EntryPoints._from_text_for..ws-@@R2774==@@@@@@r.)
_from_text)rFrGrns  `r,_from_text_forzEntryPoints._from_text_forus4s@@@@3>>$+?+?@@@@@@r.cNdt|pdDS)Nc3lK|]/}t|jj|jj|jV0dS)rpN)rmr=r))r@res  r,rBz)EntryPoints._from_text..{sP


DJO4:3C49UUU





r.ry)r:rH)rGs r,rzEntryPoints._from_textys5

!//
;;


	
r.)r3r4r5r6rrfrr7rrr\rr]rrrs@r,rrDsI!!!!!"FFF((X())X)AA[A

\




r.rceZdZdZejejdee	dZ
fdZdfd	ZfdZ
fd	Zfd
ZfdZxZS)
Deprecateda
    Compatibility add-in for mapping to indicate that
    mapping behavior is deprecated.

    >>> recwarn = getfixture('recwarn')
    >>> class DeprecatedDict(Deprecated, dict): pass
    >>> dd = DeprecatedDict(foo='bar')
    >>> dd.get('baz', None)
    >>> dd['foo']
    'bar'
    >>> list(dd)
    ['foo']
    >>> list(dd.keys())
    ['foo']
    >>> 'foo' in dd
    True
    >>> list(dd.values())
    ['bar']
    >>> len(recwarn)
    1
    z:SelectableGroups dict interface is deprecated. Use select.rr`cn|t|Sr0)rcrrfrs  r,rfzDeprecated.__getitem__s(

ww""4(((r.Ncp|t||Sr0)rcrget)r+r)defaultrs   r,rzDeprecated.gets(

ww{{4)))r.cl|tSr0)rcrrr+rs r,rzDeprecated.__iter__s&

ww!!!r.cX|tj|Sr0)rcr__contains__)r+r1rs  r,rzDeprecated.__contains__s$

#uww#T**r.cl|tSr0)rcrkeysrs r,rzDeprecated.keyss"

ww||~~r.cl|tSr0)rcrrrs r,rzDeprecated.valuess$

ww~~r.r0)r3r4r5r6rgrhrirjrkrrcrfrrrrrrrs@r,rrs,
I
D<??	


E)))))******"""""+++++         r.rczeZdZdZedZefdZedZedZ	dZ
xZS)SelectableGroupszs
    A backward- and forward-compatible result from
    entry_points that fully implements the dict interface.
    ctjd}t||}tj||}|d|DS)Nrqkeyc3>K|]\}}|t|fVdSr0r)r@rqepss   r,rBz(SelectableGroups.load..s3GGE;s++,GGGGGGr.)r
attrgettersorted	itertoolsgroupby)rFrby_grouporderedgroupeds     r,rzSelectableGroups.loadsU&w//(+++#GX66sGGwGGGGGGr.ctt|}ttj|S)zH
        Reconstruct a list of all entrypoints from the groups.
        )rrrrrchain
from_iterable)r+rrs  r,_allzSelectableGroups._alls>
z4((//119?88@@AAAr.c|jjSr0)rrr*s r,rzSelectableGroups.groupss
yr.c|jjS)zR
        for coverage:
        >>> SelectableGroups().names
        set()
        )rrr*s r,rzSelectableGroups.namessyr.c.|s|S|jjdi|Sr)rrrs  r,rzSelectableGroups.selects*	Kty))&)))r.)r3r4r5r6r\rr7rrrrrrs@r,rrs
HH[HBBBBXB  X X*******r.rc&eZdZdZddZdZdZdS)PackagePathz"A reference to a path in a packageutf-8c||5}|cdddS#1swxYwYdS)NencodinglocateopenrD)r+rstreams   r,	read_textzPackagePath.read_texts
[[]]



2
2	!f;;==	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!sA

AAc|d5}|cdddS#1swxYwYdS)Nrbr)r+r
s  r,read_binaryzPackagePath.read_binarys
[[]]


%
%	!;;==	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!	!sA		A
A
c6|j|S)z'Return a path-like object for this path)rnlocate_filer*s r,rzPackagePath.locatesy$$T***r.N)r)r3r4r5r6rrrr8r.r,rrsL,,!!!!!!!+++++r.rceZdZdZdZdS)FileHashcL|d\|_}|_dS)N=)	partitionmoder=)r+spec_s   r,ruzFileHash.__init__s"#'>>##6#6 	1djjjr.c(d|jd|jdS)Nz)rr=r*s r,rzFileHash.__repr__sB$)BBTZBBBBr.N)r3r4r5rurr8r.r,rrs7777CCCCCr.rceZdZdZejdZejdZedZ	edZ
edZedZ
edejfd	Zed
ZedZedZed
ZedZdZdZedZdZdZedZedZdS)rzA Python distribution package.cdS)zAttempt to load metadata file given by the name.

        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        Nr8r+filenames  r,rzDistribution.read_textr.cdS)z[
        Given a path to a file in this distribution, return a path
        to it.
        Nr8r+paths  r,rzDistribution.locate_filerr.c|D]I}|t|}tt	|d}||cSJt|)afReturn the Distribution for the given package name.

        :param name: The name of the distribution package to search for.
        :return: The Distribution instance (or subclass thereof) for the named
            package, if found.
        :raises PackageNotFoundError: When the named package's distribution
            metadata cannot be found.
        r(N)_discover_resolversrContextrrr)rFr)resolverdistsrns     r,	from_namezDistribution.from_name
sy//11	-	-HH/77T7BBCCEUT**D 't,,,r.c|ddr|rtdptjdi|tjfd|DS)aReturn an iterable of Distribution objects for all packages.

        Pass a ``context`` or pass keyword arguments for constructing
        a context.

        :context: A ``DistributionFinder.Context`` object.
        :return: Iterable of Distribution objects for all packages.
        contextNz cannot accept context and kwargsc3.K|]}|VdSr0r8)r@r&r*s  r,rBz(Distribution.discover..*s>-
-
"*HHW-
-
-
-
-
-
r.r8)pop
ValueErrorrr%rrrr$)rFrr*s  @r,discoverzDistribution.discovers**Y--	Av	A?@@@A/7AA&AA,,-
-
-
-
.1.E.E.G.G-
-
-


	
r.cDttj|S)zReturn a Distribution for the indicated metadata path

        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        )PathDistributionpathlibPath)r"s r,atzDistribution.at.s T 2 2333r.cNdtjD}td|S)z#Search the meta_path for resolvers.c38K|]}t|ddVdS)find_distributionsNr)r@finders  r,rBz3Distribution._discover_resolvers..:s@

.make_fileosH &&F,0:(4...dFK+3=#h---FKFKMr.cbtttj|Sr0)rrcsvreader)rSrQs r,
make_filesz&Distribution.files..make_filesvs%	3:e+<+<==>>>r.)NN)r_read_files_distinfo_read_files_egginfo)r+rUrQs` @r,r!zDistribution.filescsv						
	?	?	?	?
	?z$3355S9Q9Q9S9STTTr.cX|d}|o|S)z*
        Read the lines of RECORD
        RECORD)rrPrAs  r,rVz!Distribution._read_files_distinfo|s*~~h''))))r.c~|d}|o&tdj|S)z`
        SOURCES.txt might contain literal commas, so wrap each line
        in quotes.
        zSOURCES.txtz"{}")rrMformatrPrAs  r,rWz Distribution._read_files_egginfos6
~~m,,=FM4??+<+<===r.ct|p|}|ot|S)z6Generated requirements specified for this Distribution)_read_dist_info_reqs_read_egg_info_reqsr)r+reqss  r,r$zDistribution.requiress7((**Hd.F.F.H.H"T

"r.c6|jdS)Nz
Requires-Dist)r"get_allr*s r,r]z!Distribution._read_dist_info_reqss}$$_555r.cf|d}t|j|S)Nzrequires.txt)rr_deps_from_requires_text)r+sources  r,r^z Distribution._read_egg_info_reqss.//7y677???r.c\|t|Sr0)%_convert_egg_info_reqs_to_simple_reqsr:rD)rFrds  r,rcz%Distribution._deps_from_requires_texts"889O9OPPPr.c#Kdfd}d}|D]/}||j}|j|z||jzV0dS)a
        Historically, setuptools would solicit and store 'extra'
        requirements, including those with environment markers,
        in separate sections. More modern tools expect each
        dependency to be defined separately, with any relevant
        extras and environment markers attached directly to that
        requirement. This method converts the former to the
        latter. See _test_deps_from_requires_text for an example.
        c|od|dS)Nz
extra == ""r8r(s r,make_conditionzJDistribution._convert_egg_info_reqs_to_simple_reqs..make_conditions000000r.c	|pd}|d\}}}|r|rd|d}ttd||g}|rdd|zndS)Nry:(rz; z and )rrrLjoin)rAextrasepmarkers
conditionsrjs     r,
quoted_markerzIDistribution._convert_egg_info_reqs_to_simple_reqs..quoted_markersmG")"3"3C"8"8E3
)
)(g...fTG^^E5J5J+KLLMMJ6@H4',,z2222bHr.cdd|vzS)z
            PEP 508 requires a space between the url_spec and the quoted_marker.
            Ref python/importlib_metadata#357.
             @r8)reqs r,
url_req_spacezIDistribution._convert_egg_info_reqs_to_simple_reqs..url_req_spaces#*%%r.N)r=r))sectionsrsrxrAspacerjs     @r,rfz2Distribution._convert_egg_info_reqs_to_simple_reqss	1	1	1	I	I	I	I	I	&	&	& 	F	FG!M'-00E-%'--*E*EEEEEE	F	Fr.N)r3r4r5r6abcabstractmethodrrr\r(r.r]r3r$r7rrr"r)rHr%r r!rVrWr$r]r^rcrfr8r.r,rrs((	--[-"

[
"44\4&&\&B%/BBBXB %%X%--X-((X(TTXTUUXU0***>>>##X#
666@@@QQ[Q F F\ F F Fr.rc`eZdZdZGddZejefdZdS)rzJ
    A MetaPathFinder capable of discovering installed distributions.
    c4eZdZdZdZ	dZedZdS)DistributionFinder.Contextaw
        Keyword arguments presented by the caller to
        ``distributions()`` or ``Distribution.discover()``
        to narrow the scope of a search for distributions
        in all DistributionFinders.

        Each DistributionFinder may expect any parameters
        and should attempt to honor the canonical
        parameters defined below when appropriate.
        NcJt||dSr0rr)r+rs  r,ruz#DistributionFinder.Context.__init__s"JJf%%%%%r.c\t|dtjS)z
            The sequence of directory path that a distribution finder
            should search.

            Typically refers to Python installed package paths such as
            "site-packages" directories and defaults to ``sys.path``.
            r")rsrr8r"r*s r,r"zDistributionFinder.Context.paths ::>>&#(333r.)r3r4r5r6r)rur7r"r8r.r,r%rsT					
	&	&	&
	4	4
	4	4	4r.r%cdS)z
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        Nr8)r+r*s  r,r6z%DistributionFinder.find_distributionsrr.N)r3r4r5r6r%r{r|r6r8r.r,rrst44444444@	)0r.rceZdZdZejfdZdZdZdZ	dZ
dZedZ
ed	ZxZS)
FastPathzs
    Micro-optimized class for searching a path for
    children.

    >>> FastPath('').children()
    ['...']
    cFt|Sr0)r__new__)rFrootrs  r,rzFastPath.__new__swws###r.c.t||_dSr0)rNr)r+rs  r,ruzFastPath.__init__sII			r.c6tj|j|Sr0)r1r2r)r+childs  r,joinpathzFastPath.joinpaths|DIu---r.ctt5tj|jpdcdddS#1swxYwYtt5|cdddS#1swxYwYgS)Nrz)r	Exceptionoslistdirrzip_childrenr*s r,childrenzFastPath.childrens
i
 
 	0	0:di.3//	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
i
 
 	'	'$$&&	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	'	s!=AAA==BBctj|j}|j}|j|_t
d|DS)Nc3bK|]*}|tjddV+dS)rrN)r}	posixpathrp)r@rs  r,rBz(FastPath.zip_children..s7QQ%U[[::1=QQQQQQr.)rr2rnamelistrdictfromkeys)r+zip_pathrs   r,rzFastPath.zip_children
sQ9TY''
&&(( )
}}QQ5QQQQQQr.c\||j|Sr0)lookupmtimesearchr2s  r,rzFastPath.searchs${{4:&&--d333r.ctt5tj|jjcdddS#1swxYwY|jdSr0)rOSErrorrstatrst_mtimercache_clearr*s r,rzFastPath.mtimes
g

	/	/749%%.	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/	/!!!!!sAAAc t|Sr0)Lookup)r+rs  r,rzFastPath.lookupsd||r.)r3r4r5r6rg	lru_cacherrurrrrr7rr
rrrs@r,rrsY$$$$$...RRR444""X"
\r.rc eZdZdefdZdZdS)rr"ctj|j}|d}t
t|_t
t|_	|
D]7}|}|dr|dddd}t|}|j||||r|dkr|dddd}t|}|j	|||9|j|j	dS)Nz.eggz
.dist-infoz	.egg-inforzr-zegg-info)rr"basenamerlowerrRrrinfoseggsr
rpartitionrrFrGappendrlegacy_normalizefreeze)	r+r"basebase_is_eggrlowr)
normalizedlegacy_normalizeds	         r,ruzLookup.__init__ sw	**0022mmF++)$//
(..	]]__
	J
	JE++--C||788
J~~c**1-77<X*,,,,,r.rcReZdZdZdZdZdZedZedZ	dZ
dS)rFzE
    A prepared search for metadata on a possibly-named package.
    Nc||_|dS|||_|||_dSr0)r)rGrrrr2s  r,ruzPrepared.__init__KsB	<F....!%!6!6t!>#U+++r.ct|tjfdt	t
|DS)z1Find metadata directories in paths heuristically.c3BK|]}|VdSr0)r)r@r"rs  r,rBz3MetadataPathFinder._search_paths..}s@-
-
&*DKK!!-
-
-
-
-
-
r.)rFrrrrMr)rFr)pathsrs   @r,rz MetadataPathFinder._search_pathsysZD>>,,-
-
-
-
.1(E.B.B-
-
-


	
r.cBtjdSr0)rrr)rFs r,invalidate_cachesz$MetadataPathFinder.invalidate_cachess$$&&&&&r.N)
r3r4r5r6rr%r6r\rrr8r.r,rresm*<)C)C)E)E
,
,
,
,

[
'''''r.rcneZdZdefdZdZejje_dZe	fdZ
dZxZS)r0r"c||_dS)zfConstruct a distribution.

        :param path: SimplePath indicating the metadata directory.
        N)_pathr!s  r,ruzPathDistribution.__init__s



r.ctttttt
5|j|dcdddS#1swxYwYdS)Nrr)	rFileNotFoundErrorIsADirectoryErrorrNotADirectoryErrorPermissionErrorrrrrs  r,rzPathDistribution.read_texts


	M	M:&&x00::G:LL	M	M	M	M	M	M	M	M	M	M	M	M	M	M	M	M	M	Ms.A((A,/A,c |jj|zSr0)rparentr!s  r,rzPathDistribution.locate_filesz 4''r.ctjt|j}||pt
jS)zz
        Performance optimization: where possible, resolve the
        normalized name from the file system path.
        )rr"rrNr_name_from_stemrrH)r+stemrs  r,rHz!PathDistribution._normalized_namesBwDJ00##D))EUWW-EEr.ctj|\}}|dvrdS|d\}}}|S)Nrr)rr"splitextr)r+rr)extrprests      r,rz PathDistribution._name_from_stemsHG$$T**	c111F..--c4r.)
r3r4r5rrurrr6rr7rHrrrs@r,r0r0sZMMM%.6I(((FFFFXFr.r0c6t|S)zGet the ``Distribution`` instance for the named package.

    :param distribution_name: The name of the distribution package as a string.
    :return: A ``Distribution`` instance (or subclass thereof).
    )rr(distribution_names r,rrs!!"3444r.c$tjdi|S)z|Get all ``Distribution`` instances in the current environment.

    :return: An iterable of ``Distribution`` instances.
    r8)rr.)rs r,rrs
 **6***r.r;c@t|jS)zGet the metadata for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: A PackageMetadata containing the parsed metadata.
    )rr(r"rs r,r"r"s!!"344==r.c*t|jS)zGet the version string for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: The version string for the package as defined in the package's
        "Version" metadata key.
    )rr%rs r,r%r%s)**22r.c$tjd}tjt|}t
jd|tD}t
|jdi|S)aReturn EntryPoint objects for all installed packages.

    Pass selection parameters (group or name) to filter the
    result to entry points matching those properties (see
    EntryPoints.select()).

    For compatibility, returns ``SelectableGroups`` object unless
    selection parameters are supplied. In the future, this function
    will return ``EntryPoints`` instead of ``SelectableGroups``
    even when no selection parameters are supplied.

    For maximum future compatibility, pass selection parameters
    or invoke ``.select`` with parameters on the result.

    :return: EntryPoints or SelectableGroups for all installed packages.
    rHrc3$K|]}|jVdSr0)r )r@rns  r,rBzentry_points..s6(("((((((r.r8)rrrgrhrrrrrrrr)r	norm_nameuniquers    r,r r s"#$677I

I
>
>
>F
/
'
'((&,f]__&=&=(((C  %%,66v666r.c*t|jS)zReturn a list of files for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: List of files composing the distribution.
    )rr!rs r,r!r!s)**00r.c*t|jS)z
    Return a list of requirements for the named package.

    :return: An iterator of requirements, suitable for
        packaging.requirement.Requirement.
    )rr$rs r,r$r$s)**33r.ctjt}tD]I}t	|pt|D](}|||jd)Jt|S)z
    Return a mapping of top-level packages to their
    distributions.

    >>> import collections.abc
    >>> pkgs = packages_distributions()
    >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values())
    True
    rC)	collectionsdefaultdictrr_top_level_declared_top_level_inferredrr"r)pkg_to_distrnpkgs   r,r#r#s)$//K;;&t,,I0CD0I0I	;	;C##DM&$9::::	;r.cT|dpdS)Nz
top_level.txtry)rr}rs r,rrs%NN?++1r88:::r.c>dt|jDS)Nch|]L}|jdk
t|jdkr
|jdn|djMS)z.pyrrry)suffixlenpartswith_suffixr))r@fs  r,rz&_top_level_inferred..sZ
8u!'llQ&&

AMM",=,=,Br.)rr!rs r,rrs- ,,r.)Nrrr{rSr8ryrr?r1rrXrirgrrrrr_collectionsrr	_compatr
rr
_functoolsr
r
_itertoolsrrrr
contextlibr	importlibr
importlib.abcrrtypingrrrr__all__ModuleNotFoundErrorrr:r_rmrrrrrr
PurePosixPathrrrrrrrFrr0rrr"r%r r!r$rNr#rrr8r.r,rs								











44444444
0///////88888888........######((((((111111111111


 					.			>1>1>1>1>1>1>1>1B!!!!!!!!4a!a!a!a!a!a!a!a!HC)C)C)C)C)TC)C)C)L:
:
:
:
:
.:
:
:
z4 4 4 4 4 4 4 4 n%*%*%*%*%*z4%*%*%*P
+
+
+
+
+''
+
+
+ CCCCCCCCEFEFEFEFEFEFEFEFP--------`,,,,,,,,^!,!,!,!,!,!,!,!,HD	'''''%7''	'>%%%%%|%%%P555+++>5#8>>>>3337eK1A$AB77772111444T#Y 7";;;r.PK!v>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    N)iter
isinstance	TypeError)obj	base_types  ralways_iterablersxR{Bxx:c9#=#=SF||CyySF||sAA! A!)N)	itertoolsrrstrbytesrrrrrsR!!!!!!&%(<222222rPK!a-<_vendor/importlib_metadata/__pycache__/_meta.cpython-311.pycnu[

,ReddlmZddlmZmZmZmZmZmZedZ	GddeZ
GddeZd	S)
)Protocol)AnyDictIteratorListTypeVarUnion_Tc	eZdZdefdZdedefdZdedefdZde	efdZ
dd	ed
edee
eeffdZedeeeee
efffdZd
S)PackageMetadatareturncdSNselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_meta.py__len__zPackageMetadata.__len__	itemcdSrr)rrs  r__contains__zPackageMetadata.__contains__rrkeycdSrr)rrs  r__getitem__zPackageMetadata.__getitem__rrcdSrrrs r__iter__zPackageMetadata.__iter__rr.namefailobjcdS)zP
        Return all values associated with a possibly multi-valued key.
        Nr)rr r!s   rget_allzPackageMetadata.get_allrcdS)z9
        A JSON-compatible form of the metadata.
        Nrrs rjsonzPackageMetadata.jsonr$rN).)__name__
__module____qualname__intrstrboolrrrrrr
rrr#propertyrr&rrrr
r
sss(3-C"uT#Y]7K
d3c49n 556Xrr
c6eZdZdZddZddZddZdefdZdS)	
SimplePathzH
    A minimal subset of pathlib.Path required by PathDistribution.
    rcdSrrrs rjoinpathzSimplePath.joinpath&rrcdSrrrs r__truediv__zSimplePath.__truediv__)rrcdSrrrs rparentzSimplePath.parent,rrcdSrrrs r	read_textzSimplePath.read_text/rrN)rr/)	r'r(r)__doc__r1r3r5r+r7rrrr/r/!su3rr/N)_compatrtypingrrrrr	r
rr
r/rrrr;s<<<<<<<<<<<<<<<<
WT]]h2rPK!_ff<_vendor/importlib_metadata/__pycache__/_text.cpython-311.pycnu[

,Rev6ddlZddlmZGddeZdS)N)method_cachecneZdZdZdZdZdZdZdZfdZ	dZ
efd	Zd
Z
dd
ZxZS)
FoldedCasea{
    A case insensitive string class; behaves just like str
    except compares equal when the only variation is case.

    >>> s = FoldedCase('hello world')

    >>> s == 'Hello World'
    True

    >>> 'Hello World' == s
    True

    >>> s != 'Hello World'
    False

    >>> s.index('O')
    4

    >>> s.split('O')
    ['hell', ' w', 'rld']

    >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta']))
    ['alpha', 'Beta', 'GAMMA']

    Sequence membership is straightforward.

    >>> "Hello World" in [s]
    True
    >>> s in ["Hello World"]
    True

    You may test for set inclusion, but candidate and elements
    must both be folded.

    >>> FoldedCase("Hello World") in {s}
    True
    >>> s in {FoldedCase("Hello World")}
    True

    String inclusion works as long as the FoldedCase object
    is on the right.

    >>> "hello" in FoldedCase("Hello World")
    True

    But not if the FoldedCase object is on the left:

    >>> FoldedCase('hello') in 'Hello World'
    False

    In that case, use in_:

    >>> FoldedCase('hello').in_('Hello World')
    True

    >>> FoldedCase('hello') > FoldedCase('Hello')
    False
    cV||kSNlowerselfothers  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_text.py__lt__zFoldedCase.__lt__Czz||ekkmm++cV||kSrr	rs  r__gt__zFoldedCase.__gt__FrrcV||kSrr	rs  r__eq__zFoldedCase.__eq__Izz||u{{}},,rcV||kSrr	rs  r__ne__zFoldedCase.__ne__LrrcDt|Sr)hashr
)rs r__hash__zFoldedCase.__hash__OsDJJLL!!!rct|Sr)superr
__contains__)rr
	__class__s  rrzFoldedCase.__contains__Rs+ww}}++EKKMM:::rc$|t|vS)zDoes self appear in other?)rrs  rin_zFoldedCase.in_Usz%((((rcDtSr)rr
)rrs rr
zFoldedCase.lowerZsww}}rct||Sr)r
index)rsubs  rr$zFoldedCase.index^s&zz||!!#))++...r rctjtj|tj}|||Sr)recompileescapeIsplit)rsplittermaxsplitpatterns    rr,zFoldedCase.splitas3*RYx00"$77}}T8,,,r)r&r)__name__
__module____qualname____doc__rrrrrrr!rr
r$r,
__classcell__)rs@rrrs99v,,,,,,------""";;;;;)))
\///--------rr)r(
_functoolsrstrrrrr8s^				$$$$$$\-\-\-\-\-\-\-\-\-\-rPK!
bppA_vendor/importlib_metadata/__pycache__/_functools.cpython-311.pycnu[

,ReO$ddlZddlZddZdZdS)NcPptjfd}d|_|S)aV
    Wrap lru_cache to support storing the cache data in the object instances.

    Abstracts the common paradigm where the method explicitly saves an
    underscore-prefixed protected property on first call and returns that
    subsequently.

    >>> class MyClass:
    ...     calls = 0
    ...
    ...     @method_cache
    ...     def method(self, value):
    ...         self.calls += 1
    ...         return value

    >>> a = MyClass()
    >>> a.method(3)
    3
    >>> for x in range(75):
    ...     res = a.method(x)
    >>> a.calls
    75

    Note that the apparent behavior will be exactly like that of lru_cache
    except that the cache is stored on each instance, so values in one
    instance will not flush values from another, and when an instance is
    deleted, so are the cached values for that instance.

    >>> b = MyClass()
    >>> for x in range(35):
    ...     res = b.method(x)
    >>> b.calls
    35
    >>> a.method(0)
    0
    >>> a.calls
    75

    Note that if method had been decorated with ``functools.lru_cache()``,
    a.calls would have been 76 (due to the cached value of 0 having been
    flushed by the 'b' instance).

    Clear the cache with ``.cache_clear()``

    >>> a.method.cache_clear()

    Same for a method that hasn't yet been called.

    >>> c = MyClass()
    >>> c.method.cache_clear()

    Another cache wrapper may be supplied:

    >>> cache = functools.lru_cache(maxsize=2)
    >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache)
    >>> a = MyClass()
    >>> a.method2()
    3

    Caution - do not subsequently wrap the method with another decorator, such
    as ``@property``, which changes the semantics of the function.

    See also
    http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/
    for another implementation and additional justification.
    ctj|}|}t|j|||i|SN)types
MethodTypesetattr__name__)selfargskwargsbound_method
cached_method
cache_wrappermethods     /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_functools.pywrapperzmethod_cache..wrapperKsM'55%
l33
fo}555}d-f---cdSrrrrzmethod_cache..Ss$r)	functools	lru_cachecache_clear)rrrs`` rmethod_cachersIF":Y%8%:%:M......',GNrcFtjfd}|S)z
    Wrap func so it's not called if its first param is None

    >>> print_text = pass_none(print)
    >>> print_text('text')
    text
    >>> print_text(None)
    c$||g|Ri|SdSrr)paramrrfuncs   rrzpass_none..wrappercs14///////r)rwraps)rrs` r	pass_noner Ys:_T00000Nrr)rrrr rrrr!sLOOOOfrPK!

>_vendor/importlib_metadata/__pycache__/_compat.cpython-311.pycnu[

,Re$|ddlZddlZgdZ	ddlmZn#e$r	ddlmZYnwxYwdZdZGddZ	d	Z
dS)
N)install
NullFinderProtocol)rcptj|t|S)z
    Class decorator for installation on sys.meta_path.

    Adds the backport DistributionFinder to sys.meta_path and
    attempts to disable the finder functionality of the stdlib
    DistributionFinder.
    )sys	meta_pathappenddisable_stdlib_finder)clss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_compat.pyrrs1MJcJd}t|tjD]}|`dS)z
    Give the backport primacy for discovering path-based distributions
    by monkey-patching the stdlib O_O.

    See #91 for more background for rationale on this sketchy
    behavior.
    cLt|dddkot|dS)N
__module___frozen_importlib_externalfind_distributions)getattrhasattr)finders r
matchesz&disable_stdlib_finder..matches$s8L$


)*T.5f>R.S.S	TrN)filterrr	r)rrs  r
rrsDTTT
#-00&&%%&&rc,eZdZdZedZeZdS)rzj
    A "Finder" (aka "MetaClassFinder") that never finds any modules,
    but may find distributions.
    cdS)N)argskwargss  r
	find_speczNullFinder.find_spec3strN)__name__r__qualname____doc__staticmethodrfind_modulerrr
rr-s:
\KKKrrc:tjdk}||zS)zY
    Adjust for variable stacklevel on partial under PyPy.

    Workaround for #327.
    PyPy)platformpython_implementation)valis_pypys  r
pypy_partialr*@s!,..&8G=r)rr&__all__typingrImportErrortyping_extensionsrrrr*rrr
r/s



0
/
/----,,,,,,,,-


&&&$&s##PK!bEE@_vendor/importlib_metadata/__pycache__/_adapters.cpython-311.pycnu[

,ReFZddlZddlZddlZddlmZGddejjZdS)N)
FoldedCaseceZdZeeegdZ	dejj	ffdZ
dZfdZdZ
edZxZS)Message)

ClassifierzObsoletes-DistPlatformzProject-URLz
Provides-DistzProvides-Extraz
Requires-DistzRequires-ExternalzSupported-PlatformDynamicorigct|}t|t||SN)super__new__varsupdate)clsr
res	__class__s   /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/importlib_metadata/_adapters.pyrzMessage.__new__s=ggooc""S		d$$$
c8||_dSr)_repair_headers_headers)selfargskwargss   r__init__zMessage.__init__#s,,..


rcDtSr)r
__iter__)rrs rrzMessage.__iter__'sww!!!rcdfdt|dD}|jr)|d|f|S)Nc@|rd|vr|Stjd|zS)zCorrect for RFC822 indentation
z        )textwrapdedent)values rredentz'Message._repair_headers..redent+s-
D--?7U?333rc0g|]\}}||fSr').0keyr$r%s   r
z+Message._repair_headers..1s*QQQJCC'QQQrrDescription)r_payloadappendget_payload)rheadersr%s  @rrzMessage._repair_headers*sl	4	4	4RQQQ$t**Z:PQQQ=	@NNM4+;+;+=+=>???rc	nfd}tt|ttS)z[
        Convert PackageMetadata to a JSON-compatible format
        per PEP 0566.
        c|jvr|n|}|dkrtjd|}|dd}||fS)NKeywordsz\s+-_)multiple_use_keysget_allresplitlowerreplace)r)r$tkrs   r	transformzMessage.json..transform=sn),0F)F)FDLL%%%DQTIEj  //$$S#..Bu9r)dictmapr)rr<s` rjsonzMessage.json6s@					C	3z4#8#899:::r)__name__
__module____qualname__setr>rr5emailmessagerrrrrpropertyr?
__classcell__)rs@rrrs


	
	
"5=0
///"""""



;
;X
;
;
;
;
;rr)r7r"
email.messagerD_textrrErr'rrrJsn				<;<;<;<;<;em#<;<;<;<;<;rPK!:oiOO(_vendor/importlib_metadata/_functools.pynu[import types
import functools


# from jaraco.functools 3.3
def method_cache(method, cache_wrapper=None):
    """
    Wrap lru_cache to support storing the cache data in the object instances.

    Abstracts the common paradigm where the method explicitly saves an
    underscore-prefixed protected property on first call and returns that
    subsequently.

    >>> class MyClass:
    ...     calls = 0
    ...
    ...     @method_cache
    ...     def method(self, value):
    ...         self.calls += 1
    ...         return value

    >>> a = MyClass()
    >>> a.method(3)
    3
    >>> for x in range(75):
    ...     res = a.method(x)
    >>> a.calls
    75

    Note that the apparent behavior will be exactly like that of lru_cache
    except that the cache is stored on each instance, so values in one
    instance will not flush values from another, and when an instance is
    deleted, so are the cached values for that instance.

    >>> b = MyClass()
    >>> for x in range(35):
    ...     res = b.method(x)
    >>> b.calls
    35
    >>> a.method(0)
    0
    >>> a.calls
    75

    Note that if method had been decorated with ``functools.lru_cache()``,
    a.calls would have been 76 (due to the cached value of 0 having been
    flushed by the 'b' instance).

    Clear the cache with ``.cache_clear()``

    >>> a.method.cache_clear()

    Same for a method that hasn't yet been called.

    >>> c = MyClass()
    >>> c.method.cache_clear()

    Another cache wrapper may be supplied:

    >>> cache = functools.lru_cache(maxsize=2)
    >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache)
    >>> a = MyClass()
    >>> a.method2()
    3

    Caution - do not subsequently wrap the method with another decorator, such
    as ``@property``, which changes the semantics of the function.

    See also
    http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/
    for another implementation and additional justification.
    """
    cache_wrapper = cache_wrapper or functools.lru_cache()

    def wrapper(self, *args, **kwargs):
        # it's the first call, replace the method with a cached, bound method
        bound_method = types.MethodType(method, self)
        cached_method = cache_wrapper(bound_method)
        setattr(self, method.__name__, cached_method)
        return cached_method(*args, **kwargs)

    # Support cache clear even before cache has been created.
    wrapper.cache_clear = lambda: None

    return wrapper


# From jaraco.functools 3.3
def pass_none(func):
    """
    Wrap func so it's not called if its first param is None

    >>> print_text = pass_none(print)
    >>> print_text('text')
    text
    >>> print_text(None)
    """

    @functools.wraps(func)
    def wrapper(param, *args, **kwargs):
        if param is not None:
            return func(param, *args, **kwargs)

    return wrapper
PK!xvv#_vendor/importlib_metadata/_text.pynu[import re

from ._functools import method_cache


# from jaraco.text 3.5
class FoldedCase(str):
    """
    A case insensitive string class; behaves just like str
    except compares equal when the only variation is case.

    >>> s = FoldedCase('hello world')

    >>> s == 'Hello World'
    True

    >>> 'Hello World' == s
    True

    >>> s != 'Hello World'
    False

    >>> s.index('O')
    4

    >>> s.split('O')
    ['hell', ' w', 'rld']

    >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta']))
    ['alpha', 'Beta', 'GAMMA']

    Sequence membership is straightforward.

    >>> "Hello World" in [s]
    True
    >>> s in ["Hello World"]
    True

    You may test for set inclusion, but candidate and elements
    must both be folded.

    >>> FoldedCase("Hello World") in {s}
    True
    >>> s in {FoldedCase("Hello World")}
    True

    String inclusion works as long as the FoldedCase object
    is on the right.

    >>> "hello" in FoldedCase("Hello World")
    True

    But not if the FoldedCase object is on the left:

    >>> FoldedCase('hello') in 'Hello World'
    False

    In that case, use in_:

    >>> FoldedCase('hello').in_('Hello World')
    True

    >>> FoldedCase('hello') > FoldedCase('Hello')
    False
    """

    def __lt__(self, other):
        return self.lower() < other.lower()

    def __gt__(self, other):
        return self.lower() > other.lower()

    def __eq__(self, other):
        return self.lower() == other.lower()

    def __ne__(self, other):
        return self.lower() != other.lower()

    def __hash__(self):
        return hash(self.lower())

    def __contains__(self, other):
        return super().lower().__contains__(other.lower())

    def in_(self, other):
        "Does self appear in other?"
        return self in FoldedCase(other)

    # cache lower since it's likely to be called frequently.
    @method_cache
    def lower(self):
        return super().lower()

    def index(self, sub):
        return self.lower().index(sub.lower())

    def split(self, splitter=' ', maxsplit=0):
        pattern = re.compile(re.escape(splitter), re.I)
        return pattern.split(self, maxsplit)
PK!mFF'_vendor/importlib_metadata/_adapters.pynu[import re
import textwrap
import email.message

from ._text import FoldedCase


class Message(email.message.Message):
    multiple_use_keys = set(
        map(
            FoldedCase,
            [
                'Classifier',
                'Obsoletes-Dist',
                'Platform',
                'Project-URL',
                'Provides-Dist',
                'Provides-Extra',
                'Requires-Dist',
                'Requires-External',
                'Supported-Platform',
                'Dynamic',
            ],
        )
    )
    """
    Keys that may be indicated multiple times per PEP 566.
    """

    def __new__(cls, orig: email.message.Message):
        res = super().__new__(cls)
        vars(res).update(vars(orig))
        return res

    def __init__(self, *args, **kwargs):
        self._headers = self._repair_headers()

    # suppress spurious error from mypy
    def __iter__(self):
        return super().__iter__()

    def _repair_headers(self):
        def redent(value):
            "Correct for RFC822 indentation"
            if not value or '\n' not in value:
                return value
            return textwrap.dedent(' ' * 8 + value)

        headers = [(key, redent(value)) for key, value in vars(self)['_headers']]
        if self._payload:
            headers.append(('Description', self.get_payload()))
        return headers

    @property
    def json(self):
        """
        Convert PackageMetadata to a JSON-compatible format
        per PEP 0566.
        """

        def transform(key):
            value = self.get_all(key) if key in self.multiple_use_keys else self[key]
            if key == 'Keywords':
                value = re.split(r'\s+', value)
            tk = key.lower().replace('-', '_')
            return tk, value

        return dict(map(transform, map(FoldedCase, self)))
PK!.#_vendor/importlib_metadata/_meta.pynu[from ._compat import Protocol
from typing import Any, Dict, Iterator, List, TypeVar, Union


_T = TypeVar("_T")


class PackageMetadata(Protocol):
    def __len__(self) -> int:
        ...  # pragma: no cover

    def __contains__(self, item: str) -> bool:
        ...  # pragma: no cover

    def __getitem__(self, key: str) -> str:
        ...  # pragma: no cover

    def __iter__(self) -> Iterator[str]:
        ...  # pragma: no cover

    def get_all(self, name: str, failobj: _T = ...) -> Union[List[Any], _T]:
        """
        Return all values associated with a possibly multi-valued key.
        """

    @property
    def json(self) -> Dict[str, Union[str, List[str]]]:
        """
        A JSON-compatible form of the metadata.
        """


class SimplePath(Protocol):
    """
    A minimal subset of pathlib.Path required by PathDistribution.
    """

    def joinpath(self) -> 'SimplePath':
        ...  # pragma: no cover

    def __truediv__(self) -> 'SimplePath':
        ...  # pragma: no cover

    def parent(self) -> 'SimplePath':
        ...  # pragma: no cover

    def read_text(self) -> str:
        ...  # pragma: no cover
PK!suu&_vendor/importlib_metadata/__init__.pynu[import os
import re
import abc
import csv
import sys
from .. import zipp
import email
import pathlib
import operator
import textwrap
import warnings
import functools
import itertools
import posixpath
import collections

from . import _adapters, _meta
from ._collections import FreezableDefaultDict, Pair
from ._compat import (
    NullFinder,
    install,
    pypy_partial,
)
from ._functools import method_cache, pass_none
from ._itertools import always_iterable, unique_everseen
from ._meta import PackageMetadata, SimplePath

from contextlib import suppress
from importlib import import_module
from importlib.abc import MetaPathFinder
from itertools import starmap
from typing import List, Mapping, Optional, Union


__all__ = [
    'Distribution',
    'DistributionFinder',
    'PackageMetadata',
    'PackageNotFoundError',
    'distribution',
    'distributions',
    'entry_points',
    'files',
    'metadata',
    'packages_distributions',
    'requires',
    'version',
]


class PackageNotFoundError(ModuleNotFoundError):
    """The package was not found."""

    def __str__(self):
        return f"No package metadata was found for {self.name}"

    @property
    def name(self):
        (name,) = self.args
        return name


class Sectioned:
    """
    A simple entry point config parser for performance

    >>> for item in Sectioned.read(Sectioned._sample):
    ...     print(item)
    Pair(name='sec1', value='# comments ignored')
    Pair(name='sec1', value='a = 1')
    Pair(name='sec1', value='b = 2')
    Pair(name='sec2', value='a = 2')

    >>> res = Sectioned.section_pairs(Sectioned._sample)
    >>> item = next(res)
    >>> item.name
    'sec1'
    >>> item.value
    Pair(name='a', value='1')
    >>> item = next(res)
    >>> item.value
    Pair(name='b', value='2')
    >>> item = next(res)
    >>> item.name
    'sec2'
    >>> item.value
    Pair(name='a', value='2')
    >>> list(res)
    []
    """

    _sample = textwrap.dedent(
        """
        [sec1]
        # comments ignored
        a = 1
        b = 2

        [sec2]
        a = 2
        """
    ).lstrip()

    @classmethod
    def section_pairs(cls, text):
        return (
            section._replace(value=Pair.parse(section.value))
            for section in cls.read(text, filter_=cls.valid)
            if section.name is not None
        )

    @staticmethod
    def read(text, filter_=None):
        lines = filter(filter_, map(str.strip, text.splitlines()))
        name = None
        for value in lines:
            section_match = value.startswith('[') and value.endswith(']')
            if section_match:
                name = value.strip('[]')
                continue
            yield Pair(name, value)

    @staticmethod
    def valid(line):
        return line and not line.startswith('#')


class DeprecatedTuple:
    """
    Provide subscript item access for backward compatibility.

    >>> recwarn = getfixture('recwarn')
    >>> ep = EntryPoint(name='name', value='value', group='group')
    >>> ep[:]
    ('name', 'value', 'group')
    >>> ep[0]
    'name'
    >>> len(recwarn)
    1
    """

    _warn = functools.partial(
        warnings.warn,
        "EntryPoint tuple interface is deprecated. Access members by name.",
        DeprecationWarning,
        stacklevel=pypy_partial(2),
    )

    def __getitem__(self, item):
        self._warn()
        return self._key()[item]


class EntryPoint(DeprecatedTuple):
    """An entry point as defined by Python packaging conventions.

    See `the packaging docs on entry points
    `_
    for more information.
    """

    pattern = re.compile(
        r'(?P[\w.]+)\s*'
        r'(:\s*(?P[\w.]+)\s*)?'
        r'((?P\[.*\])\s*)?$'
    )
    """
    A regular expression describing the syntax for an entry point,
    which might look like:

        - module
        - package.module
        - package.module:attribute
        - package.module:object.attribute
        - package.module:attr [extra1, extra2]

    Other combinations are possible as well.

    The expression is lenient about whitespace around the ':',
    following the attr, and following any extras.
    """

    dist: Optional['Distribution'] = None

    def __init__(self, name, value, group):
        vars(self).update(name=name, value=value, group=group)

    def load(self):
        """Load the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        """
        match = self.pattern.match(self.value)
        module = import_module(match.group('module'))
        attrs = filter(None, (match.group('attr') or '').split('.'))
        return functools.reduce(getattr, attrs, module)

    @property
    def module(self):
        match = self.pattern.match(self.value)
        return match.group('module')

    @property
    def attr(self):
        match = self.pattern.match(self.value)
        return match.group('attr')

    @property
    def extras(self):
        match = self.pattern.match(self.value)
        return list(re.finditer(r'\w+', match.group('extras') or ''))

    def _for(self, dist):
        vars(self).update(dist=dist)
        return self

    def __iter__(self):
        """
        Supply iter so one may construct dicts of EntryPoints by name.
        """
        msg = (
            "Construction of dict of EntryPoints is deprecated in "
            "favor of EntryPoints."
        )
        warnings.warn(msg, DeprecationWarning)
        return iter((self.name, self))

    def matches(self, **params):
        attrs = (getattr(self, param) for param in params)
        return all(map(operator.eq, params.values(), attrs))

    def _key(self):
        return self.name, self.value, self.group

    def __lt__(self, other):
        return self._key() < other._key()

    def __eq__(self, other):
        return self._key() == other._key()

    def __setattr__(self, name, value):
        raise AttributeError("EntryPoint objects are immutable.")

    def __repr__(self):
        return (
            f'EntryPoint(name={self.name!r}, value={self.value!r}, '
            f'group={self.group!r})'
        )

    def __hash__(self):
        return hash(self._key())


class DeprecatedList(list):
    """
    Allow an otherwise immutable object to implement mutability
    for compatibility.

    >>> recwarn = getfixture('recwarn')
    >>> dl = DeprecatedList(range(3))
    >>> dl[0] = 1
    >>> dl.append(3)
    >>> del dl[3]
    >>> dl.reverse()
    >>> dl.sort()
    >>> dl.extend([4])
    >>> dl.pop(-1)
    4
    >>> dl.remove(1)
    >>> dl += [5]
    >>> dl + [6]
    [1, 2, 5, 6]
    >>> dl + (6,)
    [1, 2, 5, 6]
    >>> dl.insert(0, 0)
    >>> dl
    [0, 1, 2, 5]
    >>> dl == [0, 1, 2, 5]
    True
    >>> dl == (0, 1, 2, 5)
    True
    >>> len(recwarn)
    1
    """

    __slots__ = ()

    _warn = functools.partial(
        warnings.warn,
        "EntryPoints list interface is deprecated. Cast to list if needed.",
        DeprecationWarning,
        stacklevel=pypy_partial(2),
    )

    def _wrap_deprecated_method(method_name: str):  # type: ignore
        def wrapped(self, *args, **kwargs):
            self._warn()
            return getattr(super(), method_name)(*args, **kwargs)

        return method_name, wrapped

    locals().update(
        map(
            _wrap_deprecated_method,
            '__setitem__ __delitem__ append reverse extend pop remove '
            '__iadd__ insert sort'.split(),
        )
    )

    def __add__(self, other):
        if not isinstance(other, tuple):
            self._warn()
            other = tuple(other)
        return self.__class__(tuple(self) + other)

    def __eq__(self, other):
        if not isinstance(other, tuple):
            self._warn()
            other = tuple(other)

        return tuple(self).__eq__(other)


class EntryPoints(DeprecatedList):
    """
    An immutable collection of selectable EntryPoint objects.
    """

    __slots__ = ()

    def __getitem__(self, name):  # -> EntryPoint:
        """
        Get the EntryPoint in self matching name.
        """
        if isinstance(name, int):
            warnings.warn(
                "Accessing entry points by index is deprecated. "
                "Cast to tuple if needed.",
                DeprecationWarning,
                stacklevel=2,
            )
            return super().__getitem__(name)
        try:
            return next(iter(self.select(name=name)))
        except StopIteration:
            raise KeyError(name)

    def select(self, **params):
        """
        Select entry points from self that match the
        given parameters (typically group and/or name).
        """
        return EntryPoints(ep for ep in self if ep.matches(**params))

    @property
    def names(self):
        """
        Return the set of all names of all entry points.
        """
        return {ep.name for ep in self}

    @property
    def groups(self):
        """
        Return the set of all groups of all entry points.

        For coverage while SelectableGroups is present.
        >>> EntryPoints().groups
        set()
        """
        return {ep.group for ep in self}

    @classmethod
    def _from_text_for(cls, text, dist):
        return cls(ep._for(dist) for ep in cls._from_text(text))

    @staticmethod
    def _from_text(text):
        return (
            EntryPoint(name=item.value.name, value=item.value.value, group=item.name)
            for item in Sectioned.section_pairs(text or '')
        )


class Deprecated:
    """
    Compatibility add-in for mapping to indicate that
    mapping behavior is deprecated.

    >>> recwarn = getfixture('recwarn')
    >>> class DeprecatedDict(Deprecated, dict): pass
    >>> dd = DeprecatedDict(foo='bar')
    >>> dd.get('baz', None)
    >>> dd['foo']
    'bar'
    >>> list(dd)
    ['foo']
    >>> list(dd.keys())
    ['foo']
    >>> 'foo' in dd
    True
    >>> list(dd.values())
    ['bar']
    >>> len(recwarn)
    1
    """

    _warn = functools.partial(
        warnings.warn,
        "SelectableGroups dict interface is deprecated. Use select.",
        DeprecationWarning,
        stacklevel=pypy_partial(2),
    )

    def __getitem__(self, name):
        self._warn()
        return super().__getitem__(name)

    def get(self, name, default=None):
        self._warn()
        return super().get(name, default)

    def __iter__(self):
        self._warn()
        return super().__iter__()

    def __contains__(self, *args):
        self._warn()
        return super().__contains__(*args)

    def keys(self):
        self._warn()
        return super().keys()

    def values(self):
        self._warn()
        return super().values()


class SelectableGroups(Deprecated, dict):
    """
    A backward- and forward-compatible result from
    entry_points that fully implements the dict interface.
    """

    @classmethod
    def load(cls, eps):
        by_group = operator.attrgetter('group')
        ordered = sorted(eps, key=by_group)
        grouped = itertools.groupby(ordered, by_group)
        return cls((group, EntryPoints(eps)) for group, eps in grouped)

    @property
    def _all(self):
        """
        Reconstruct a list of all entrypoints from the groups.
        """
        groups = super(Deprecated, self).values()
        return EntryPoints(itertools.chain.from_iterable(groups))

    @property
    def groups(self):
        return self._all.groups

    @property
    def names(self):
        """
        for coverage:
        >>> SelectableGroups().names
        set()
        """
        return self._all.names

    def select(self, **params):
        if not params:
            return self
        return self._all.select(**params)


class PackagePath(pathlib.PurePosixPath):
    """A reference to a path in a package"""

    def read_text(self, encoding='utf-8'):
        with self.locate().open(encoding=encoding) as stream:
            return stream.read()

    def read_binary(self):
        with self.locate().open('rb') as stream:
            return stream.read()

    def locate(self):
        """Return a path-like object for this path"""
        return self.dist.locate_file(self)


class FileHash:
    def __init__(self, spec):
        self.mode, _, self.value = spec.partition('=')

    def __repr__(self):
        return f''


class Distribution:
    """A Python distribution package."""

    @abc.abstractmethod
    def read_text(self, filename):
        """Attempt to load metadata file given by the name.

        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        """

    @abc.abstractmethod
    def locate_file(self, path):
        """
        Given a path to a file in this distribution, return a path
        to it.
        """

    @classmethod
    def from_name(cls, name):
        """Return the Distribution for the given package name.

        :param name: The name of the distribution package to search for.
        :return: The Distribution instance (or subclass thereof) for the named
            package, if found.
        :raises PackageNotFoundError: When the named package's distribution
            metadata cannot be found.
        """
        for resolver in cls._discover_resolvers():
            dists = resolver(DistributionFinder.Context(name=name))
            dist = next(iter(dists), None)
            if dist is not None:
                return dist
        else:
            raise PackageNotFoundError(name)

    @classmethod
    def discover(cls, **kwargs):
        """Return an iterable of Distribution objects for all packages.

        Pass a ``context`` or pass keyword arguments for constructing
        a context.

        :context: A ``DistributionFinder.Context`` object.
        :return: Iterable of Distribution objects for all packages.
        """
        context = kwargs.pop('context', None)
        if context and kwargs:
            raise ValueError("cannot accept context and kwargs")
        context = context or DistributionFinder.Context(**kwargs)
        return itertools.chain.from_iterable(
            resolver(context) for resolver in cls._discover_resolvers()
        )

    @staticmethod
    def at(path):
        """Return a Distribution for the indicated metadata path

        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        """
        return PathDistribution(pathlib.Path(path))

    @staticmethod
    def _discover_resolvers():
        """Search the meta_path for resolvers."""
        declared = (
            getattr(finder, 'find_distributions', None) for finder in sys.meta_path
        )
        return filter(None, declared)

    @property
    def metadata(self) -> _meta.PackageMetadata:
        """Return the parsed metadata for this Distribution.

        The returned object will have keys that name the various bits of
        metadata.  See PEP 566 for details.
        """
        text = (
            self.read_text('METADATA')
            or self.read_text('PKG-INFO')
            # This last clause is here to support old egg-info files.  Its
            # effect is to just end up using the PathDistribution's self._path
            # (which points to the egg-info file) attribute unchanged.
            or self.read_text('')
        )
        return _adapters.Message(email.message_from_string(text))

    @property
    def name(self):
        """Return the 'Name' metadata for the distribution package."""
        return self.metadata['Name']

    @property
    def _normalized_name(self):
        """Return a normalized version of the name."""
        return Prepared.normalize(self.name)

    @property
    def version(self):
        """Return the 'Version' metadata for the distribution package."""
        return self.metadata['Version']

    @property
    def entry_points(self):
        return EntryPoints._from_text_for(self.read_text('entry_points.txt'), self)

    @property
    def files(self):
        """Files in this distribution.

        :return: List of PackagePath for this distribution or None

        Result is `None` if the metadata file that enumerates files
        (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is
        missing.
        Result may be empty if the metadata exists but is empty.
        """

        def make_file(name, hash=None, size_str=None):
            result = PackagePath(name)
            result.hash = FileHash(hash) if hash else None
            result.size = int(size_str) if size_str else None
            result.dist = self
            return result

        @pass_none
        def make_files(lines):
            return list(starmap(make_file, csv.reader(lines)))

        return make_files(self._read_files_distinfo() or self._read_files_egginfo())

    def _read_files_distinfo(self):
        """
        Read the lines of RECORD
        """
        text = self.read_text('RECORD')
        return text and text.splitlines()

    def _read_files_egginfo(self):
        """
        SOURCES.txt might contain literal commas, so wrap each line
        in quotes.
        """
        text = self.read_text('SOURCES.txt')
        return text and map('"{}"'.format, text.splitlines())

    @property
    def requires(self):
        """Generated requirements specified for this Distribution"""
        reqs = self._read_dist_info_reqs() or self._read_egg_info_reqs()
        return reqs and list(reqs)

    def _read_dist_info_reqs(self):
        return self.metadata.get_all('Requires-Dist')

    def _read_egg_info_reqs(self):
        source = self.read_text('requires.txt')
        return pass_none(self._deps_from_requires_text)(source)

    @classmethod
    def _deps_from_requires_text(cls, source):
        return cls._convert_egg_info_reqs_to_simple_reqs(Sectioned.read(source))

    @staticmethod
    def _convert_egg_info_reqs_to_simple_reqs(sections):
        """
        Historically, setuptools would solicit and store 'extra'
        requirements, including those with environment markers,
        in separate sections. More modern tools expect each
        dependency to be defined separately, with any relevant
        extras and environment markers attached directly to that
        requirement. This method converts the former to the
        latter. See _test_deps_from_requires_text for an example.
        """

        def make_condition(name):
            return name and f'extra == "{name}"'

        def quoted_marker(section):
            section = section or ''
            extra, sep, markers = section.partition(':')
            if extra and markers:
                markers = f'({markers})'
            conditions = list(filter(None, [markers, make_condition(extra)]))
            return '; ' + ' and '.join(conditions) if conditions else ''

        def url_req_space(req):
            """
            PEP 508 requires a space between the url_spec and the quoted_marker.
            Ref python/importlib_metadata#357.
            """
            # '@' is uniquely indicative of a url_req.
            return ' ' * ('@' in req)

        for section in sections:
            space = url_req_space(section.value)
            yield section.value + space + quoted_marker(section.name)


class DistributionFinder(MetaPathFinder):
    """
    A MetaPathFinder capable of discovering installed distributions.
    """

    class Context:
        """
        Keyword arguments presented by the caller to
        ``distributions()`` or ``Distribution.discover()``
        to narrow the scope of a search for distributions
        in all DistributionFinders.

        Each DistributionFinder may expect any parameters
        and should attempt to honor the canonical
        parameters defined below when appropriate.
        """

        name = None
        """
        Specific name for which a distribution finder should match.
        A name of ``None`` matches all distributions.
        """

        def __init__(self, **kwargs):
            vars(self).update(kwargs)

        @property
        def path(self):
            """
            The sequence of directory path that a distribution finder
            should search.

            Typically refers to Python installed package paths such as
            "site-packages" directories and defaults to ``sys.path``.
            """
            return vars(self).get('path', sys.path)

    @abc.abstractmethod
    def find_distributions(self, context=Context()):
        """
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        """


class FastPath:
    """
    Micro-optimized class for searching a path for
    children.

    >>> FastPath('').children()
    ['...']
    """

    @functools.lru_cache()  # type: ignore
    def __new__(cls, root):
        return super().__new__(cls)

    def __init__(self, root):
        self.root = str(root)

    def joinpath(self, child):
        return pathlib.Path(self.root, child)

    def children(self):
        with suppress(Exception):
            return os.listdir(self.root or '.')
        with suppress(Exception):
            return self.zip_children()
        return []

    def zip_children(self):
        zip_path = zipp.Path(self.root)
        names = zip_path.root.namelist()
        self.joinpath = zip_path.joinpath

        return dict.fromkeys(child.split(posixpath.sep, 1)[0] for child in names)

    def search(self, name):
        return self.lookup(self.mtime).search(name)

    @property
    def mtime(self):
        with suppress(OSError):
            return os.stat(self.root).st_mtime
        self.lookup.cache_clear()

    @method_cache
    def lookup(self, mtime):
        return Lookup(self)


class Lookup:
    def __init__(self, path: FastPath):
        base = os.path.basename(path.root).lower()
        base_is_egg = base.endswith(".egg")
        self.infos = FreezableDefaultDict(list)
        self.eggs = FreezableDefaultDict(list)

        for child in path.children():
            low = child.lower()
            if low.endswith((".dist-info", ".egg-info")):
                # rpartition is faster than splitext and suitable for this purpose.
                name = low.rpartition(".")[0].partition("-")[0]
                normalized = Prepared.normalize(name)
                self.infos[normalized].append(path.joinpath(child))
            elif base_is_egg and low == "egg-info":
                name = base.rpartition(".")[0].partition("-")[0]
                legacy_normalized = Prepared.legacy_normalize(name)
                self.eggs[legacy_normalized].append(path.joinpath(child))

        self.infos.freeze()
        self.eggs.freeze()

    def search(self, prepared):
        infos = (
            self.infos[prepared.normalized]
            if prepared
            else itertools.chain.from_iterable(self.infos.values())
        )
        eggs = (
            self.eggs[prepared.legacy_normalized]
            if prepared
            else itertools.chain.from_iterable(self.eggs.values())
        )
        return itertools.chain(infos, eggs)


class Prepared:
    """
    A prepared search for metadata on a possibly-named package.
    """

    normalized = None
    legacy_normalized = None

    def __init__(self, name):
        self.name = name
        if name is None:
            return
        self.normalized = self.normalize(name)
        self.legacy_normalized = self.legacy_normalize(name)

    @staticmethod
    def normalize(name):
        """
        PEP 503 normalization plus dashes as underscores.
        """
        return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')

    @staticmethod
    def legacy_normalize(name):
        """
        Normalize the package name as found in the convention in
        older packaging tools versions and specs.
        """
        return name.lower().replace('-', '_')

    def __bool__(self):
        return bool(self.name)


@install
class MetadataPathFinder(NullFinder, DistributionFinder):
    """A degenerate finder for distribution packages on the file system.

    This finder supplies only a find_distributions() method for versions
    of Python that do not have a PathFinder find_distributions().
    """

    def find_distributions(self, context=DistributionFinder.Context()):
        """
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        """
        found = self._search_paths(context.name, context.path)
        return map(PathDistribution, found)

    @classmethod
    def _search_paths(cls, name, paths):
        """Find metadata directories in paths heuristically."""
        prepared = Prepared(name)
        return itertools.chain.from_iterable(
            path.search(prepared) for path in map(FastPath, paths)
        )

    def invalidate_caches(cls):
        FastPath.__new__.cache_clear()


class PathDistribution(Distribution):
    def __init__(self, path: SimplePath):
        """Construct a distribution.

        :param path: SimplePath indicating the metadata directory.
        """
        self._path = path

    def read_text(self, filename):
        with suppress(
            FileNotFoundError,
            IsADirectoryError,
            KeyError,
            NotADirectoryError,
            PermissionError,
        ):
            return self._path.joinpath(filename).read_text(encoding='utf-8')

    read_text.__doc__ = Distribution.read_text.__doc__

    def locate_file(self, path):
        return self._path.parent / path

    @property
    def _normalized_name(self):
        """
        Performance optimization: where possible, resolve the
        normalized name from the file system path.
        """
        stem = os.path.basename(str(self._path))
        return self._name_from_stem(stem) or super()._normalized_name

    def _name_from_stem(self, stem):
        name, ext = os.path.splitext(stem)
        if ext not in ('.dist-info', '.egg-info'):
            return
        name, sep, rest = stem.partition('-')
        return name


def distribution(distribution_name):
    """Get the ``Distribution`` instance for the named package.

    :param distribution_name: The name of the distribution package as a string.
    :return: A ``Distribution`` instance (or subclass thereof).
    """
    return Distribution.from_name(distribution_name)


def distributions(**kwargs):
    """Get all ``Distribution`` instances in the current environment.

    :return: An iterable of ``Distribution`` instances.
    """
    return Distribution.discover(**kwargs)


def metadata(distribution_name) -> _meta.PackageMetadata:
    """Get the metadata for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: A PackageMetadata containing the parsed metadata.
    """
    return Distribution.from_name(distribution_name).metadata


def version(distribution_name):
    """Get the version string for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: The version string for the package as defined in the package's
        "Version" metadata key.
    """
    return distribution(distribution_name).version


def entry_points(**params) -> Union[EntryPoints, SelectableGroups]:
    """Return EntryPoint objects for all installed packages.

    Pass selection parameters (group or name) to filter the
    result to entry points matching those properties (see
    EntryPoints.select()).

    For compatibility, returns ``SelectableGroups`` object unless
    selection parameters are supplied. In the future, this function
    will return ``EntryPoints`` instead of ``SelectableGroups``
    even when no selection parameters are supplied.

    For maximum future compatibility, pass selection parameters
    or invoke ``.select`` with parameters on the result.

    :return: EntryPoints or SelectableGroups for all installed packages.
    """
    norm_name = operator.attrgetter('_normalized_name')
    unique = functools.partial(unique_everseen, key=norm_name)
    eps = itertools.chain.from_iterable(
        dist.entry_points for dist in unique(distributions())
    )
    return SelectableGroups.load(eps).select(**params)


def files(distribution_name):
    """Return a list of files for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: List of files composing the distribution.
    """
    return distribution(distribution_name).files


def requires(distribution_name):
    """
    Return a list of requirements for the named package.

    :return: An iterator of requirements, suitable for
        packaging.requirement.Requirement.
    """
    return distribution(distribution_name).requires


def packages_distributions() -> Mapping[str, List[str]]:
    """
    Return a mapping of top-level packages to their
    distributions.

    >>> import collections.abc
    >>> pkgs = packages_distributions()
    >>> all(isinstance(dist, collections.abc.Sequence) for dist in pkgs.values())
    True
    """
    pkg_to_dist = collections.defaultdict(list)
    for dist in distributions():
        for pkg in _top_level_declared(dist) or _top_level_inferred(dist):
            pkg_to_dist[pkg].append(dist.metadata['Name'])
    return dict(pkg_to_dist)


def _top_level_declared(dist):
    return (dist.read_text('top_level.txt') or '').split()


def _top_level_inferred(dist):
    return {
        f.parts[0] if len(f.parts) > 1 else f.with_suffix('').name
        for f in always_iterable(dist.files)
        if f.suffix == ".py"
    }
PK!*_vendor/importlib_metadata/_collections.pynu[import collections


# from jaraco.collections 3.3
class FreezableDefaultDict(collections.defaultdict):
    """
    Often it is desirable to prevent the mutation of
    a default dict after its initial construction, such
    as to prevent mutation during iteration.

    >>> dd = FreezableDefaultDict(list)
    >>> dd[0].append('1')
    >>> dd.freeze()
    >>> dd[1]
    []
    >>> len(dd)
    1
    """

    def __missing__(self, key):
        return getattr(self, '_frozen', super().__missing__)(key)

    def freeze(self):
        self._frozen = lambda key: self.default_factory()


class Pair(collections.namedtuple('Pair', 'name value')):
    @classmethod
    def parse(cls, text):
        return cls(*map(str.strip, text.split("=", 1)))
PK!:(_vendor/importlib_metadata/_itertools.pynu[from itertools import filterfalse


def unique_everseen(iterable, key=None):
    "List unique elements, preserving order. Remember all elements ever seen."
    # unique_everseen('AAAABBBCCDAABBB') --> A B C D
    # unique_everseen('ABBCcAD', str.lower) --> A B C D
    seen = set()
    seen_add = seen.add
    if key is None:
        for element in filterfalse(seen.__contains__, iterable):
            seen_add(element)
            yield element
    else:
        for element in iterable:
            k = key(element)
            if k not in seen:
                seen_add(k)
                yield element


# copied from more_itertools 8.8
def always_iterable(obj, base_type=(str, bytes)):
    """If *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    """
    if obj is None:
        return iter(())

    if (base_type is not None) and isinstance(obj, base_type):
        return iter((obj,))

    try:
        return iter(obj)
    except TypeError:
        return iter((obj,))
PK!aLmTmT_vendor/typing_extensions.pynu[import abc
import collections
import collections.abc
import operator
import sys
import typing

# After PEP 560, internal typing API was substantially reworked.
# This is especially important for Protocol class which uses internal APIs
# quite extensively.
PEP_560 = sys.version_info[:3] >= (3, 7, 0)

if PEP_560:
    GenericMeta = type
else:
    # 3.6
    from typing import GenericMeta, _type_vars  # noqa

# The two functions below are copies of typing internal helpers.
# They are needed by _ProtocolMeta


def _no_slots_copy(dct):
    dict_copy = dict(dct)
    if '__slots__' in dict_copy:
        for slot in dict_copy['__slots__']:
            dict_copy.pop(slot, None)
    return dict_copy


def _check_generic(cls, parameters):
    if not cls.__parameters__:
        raise TypeError(f"{cls} is not a generic class")
    alen = len(parameters)
    elen = len(cls.__parameters__)
    if alen != elen:
        raise TypeError(f"Too {'many' if alen > elen else 'few'} arguments for {cls};"
                        f" actual {alen}, expected {elen}")


# Please keep __all__ alphabetized within each category.
__all__ = [
    # Super-special typing primitives.
    'ClassVar',
    'Concatenate',
    'Final',
    'ParamSpec',
    'Self',
    'Type',

    # ABCs (from collections.abc).
    'Awaitable',
    'AsyncIterator',
    'AsyncIterable',
    'Coroutine',
    'AsyncGenerator',
    'AsyncContextManager',
    'ChainMap',

    # Concrete collection types.
    'ContextManager',
    'Counter',
    'Deque',
    'DefaultDict',
    'OrderedDict',
    'TypedDict',

    # Structural checks, a.k.a. protocols.
    'SupportsIndex',

    # One-off things.
    'Annotated',
    'final',
    'IntVar',
    'Literal',
    'NewType',
    'overload',
    'Protocol',
    'runtime',
    'runtime_checkable',
    'Text',
    'TypeAlias',
    'TypeGuard',
    'TYPE_CHECKING',
]

if PEP_560:
    __all__.extend(["get_args", "get_origin", "get_type_hints"])

# 3.6.2+
if hasattr(typing, 'NoReturn'):
    NoReturn = typing.NoReturn
# 3.6.0-3.6.1
else:
    class _NoReturn(typing._FinalTypingBase, _root=True):
        """Special type indicating functions that never return.
        Example::

          from typing import NoReturn

          def stop() -> NoReturn:
              raise Exception('no way')

        This type is invalid in other positions, e.g., ``List[NoReturn]``
        will fail in static type checkers.
        """
        __slots__ = ()

        def __instancecheck__(self, obj):
            raise TypeError("NoReturn cannot be used with isinstance().")

        def __subclasscheck__(self, cls):
            raise TypeError("NoReturn cannot be used with issubclass().")

    NoReturn = _NoReturn(_root=True)

# Some unconstrained type variables.  These are used by the container types.
# (These are not for export.)
T = typing.TypeVar('T')  # Any type.
KT = typing.TypeVar('KT')  # Key type.
VT = typing.TypeVar('VT')  # Value type.
T_co = typing.TypeVar('T_co', covariant=True)  # Any type covariant containers.
T_contra = typing.TypeVar('T_contra', contravariant=True)  # Ditto contravariant.

ClassVar = typing.ClassVar

# On older versions of typing there is an internal class named "Final".
# 3.8+
if hasattr(typing, 'Final') and sys.version_info[:2] >= (3, 7):
    Final = typing.Final
# 3.7
elif sys.version_info[:2] >= (3, 7):
    class _FinalForm(typing._SpecialForm, _root=True):

        def __repr__(self):
            return 'typing_extensions.' + self._name

        def __getitem__(self, parameters):
            item = typing._type_check(parameters,
                                      f'{self._name} accepts only single type')
            return typing._GenericAlias(self, (item,))

    Final = _FinalForm('Final',
                       doc="""A special typing construct to indicate that a name
                       cannot be re-assigned or overridden in a subclass.
                       For example:

                           MAX_SIZE: Final = 9000
                           MAX_SIZE += 1  # Error reported by type checker

                           class Connection:
                               TIMEOUT: Final[int] = 10
                           class FastConnector(Connection):
                               TIMEOUT = 1  # Error reported by type checker

                       There is no runtime checking of these properties.""")
# 3.6
else:
    class _Final(typing._FinalTypingBase, _root=True):
        """A special typing construct to indicate that a name
        cannot be re-assigned or overridden in a subclass.
        For example:

            MAX_SIZE: Final = 9000
            MAX_SIZE += 1  # Error reported by type checker

            class Connection:
                TIMEOUT: Final[int] = 10
            class FastConnector(Connection):
                TIMEOUT = 1  # Error reported by type checker

        There is no runtime checking of these properties.
        """

        __slots__ = ('__type__',)

        def __init__(self, tp=None, **kwds):
            self.__type__ = tp

        def __getitem__(self, item):
            cls = type(self)
            if self.__type__ is None:
                return cls(typing._type_check(item,
                           f'{cls.__name__[1:]} accepts only single type.'),
                           _root=True)
            raise TypeError(f'{cls.__name__[1:]} cannot be further subscripted')

        def _eval_type(self, globalns, localns):
            new_tp = typing._eval_type(self.__type__, globalns, localns)
            if new_tp == self.__type__:
                return self
            return type(self)(new_tp, _root=True)

        def __repr__(self):
            r = super().__repr__()
            if self.__type__ is not None:
                r += f'[{typing._type_repr(self.__type__)}]'
            return r

        def __hash__(self):
            return hash((type(self).__name__, self.__type__))

        def __eq__(self, other):
            if not isinstance(other, _Final):
                return NotImplemented
            if self.__type__ is not None:
                return self.__type__ == other.__type__
            return self is other

    Final = _Final(_root=True)


# 3.8+
if hasattr(typing, 'final'):
    final = typing.final
# 3.6-3.7
else:
    def final(f):
        """This decorator can be used to indicate to type checkers that
        the decorated method cannot be overridden, and decorated class
        cannot be subclassed. For example:

            class Base:
                @final
                def done(self) -> None:
                    ...
            class Sub(Base):
                def done(self) -> None:  # Error reported by type checker
                    ...
            @final
            class Leaf:
                ...
            class Other(Leaf):  # Error reported by type checker
                ...

        There is no runtime checking of these properties.
        """
        return f


def IntVar(name):
    return typing.TypeVar(name)


# 3.8+:
if hasattr(typing, 'Literal'):
    Literal = typing.Literal
# 3.7:
elif sys.version_info[:2] >= (3, 7):
    class _LiteralForm(typing._SpecialForm, _root=True):

        def __repr__(self):
            return 'typing_extensions.' + self._name

        def __getitem__(self, parameters):
            return typing._GenericAlias(self, parameters)

    Literal = _LiteralForm('Literal',
                           doc="""A type that can be used to indicate to type checkers
                           that the corresponding value has a value literally equivalent
                           to the provided parameter. For example:

                               var: Literal[4] = 4

                           The type checker understands that 'var' is literally equal to
                           the value 4 and no other value.

                           Literal[...] cannot be subclassed. There is no runtime
                           checking verifying that the parameter is actually a value
                           instead of a type.""")
# 3.6:
else:
    class _Literal(typing._FinalTypingBase, _root=True):
        """A type that can be used to indicate to type checkers that the
        corresponding value has a value literally equivalent to the
        provided parameter. For example:

            var: Literal[4] = 4

        The type checker understands that 'var' is literally equal to the
        value 4 and no other value.

        Literal[...] cannot be subclassed. There is no runtime checking
        verifying that the parameter is actually a value instead of a type.
        """

        __slots__ = ('__values__',)

        def __init__(self, values=None, **kwds):
            self.__values__ = values

        def __getitem__(self, values):
            cls = type(self)
            if self.__values__ is None:
                if not isinstance(values, tuple):
                    values = (values,)
                return cls(values, _root=True)
            raise TypeError(f'{cls.__name__[1:]} cannot be further subscripted')

        def _eval_type(self, globalns, localns):
            return self

        def __repr__(self):
            r = super().__repr__()
            if self.__values__ is not None:
                r += f'[{", ".join(map(typing._type_repr, self.__values__))}]'
            return r

        def __hash__(self):
            return hash((type(self).__name__, self.__values__))

        def __eq__(self, other):
            if not isinstance(other, _Literal):
                return NotImplemented
            if self.__values__ is not None:
                return self.__values__ == other.__values__
            return self is other

    Literal = _Literal(_root=True)


_overload_dummy = typing._overload_dummy  # noqa
overload = typing.overload


# This is not a real generic class.  Don't use outside annotations.
Type = typing.Type

# Various ABCs mimicking those in collections.abc.
# A few are simply re-exported for completeness.


class _ExtensionsGenericMeta(GenericMeta):
    def __subclasscheck__(self, subclass):
        """This mimics a more modern GenericMeta.__subclasscheck__() logic
        (that does not have problems with recursion) to work around interactions
        between collections, typing, and typing_extensions on older
        versions of Python, see https://github.com/python/typing/issues/501.
        """
        if self.__origin__ is not None:
            if sys._getframe(1).f_globals['__name__'] not in ['abc', 'functools']:
                raise TypeError("Parameterized generics cannot be used with class "
                                "or instance checks")
            return False
        if not self.__extra__:
            return super().__subclasscheck__(subclass)
        res = self.__extra__.__subclasshook__(subclass)
        if res is not NotImplemented:
            return res
        if self.__extra__ in subclass.__mro__:
            return True
        for scls in self.__extra__.__subclasses__():
            if isinstance(scls, GenericMeta):
                continue
            if issubclass(subclass, scls):
                return True
        return False


Awaitable = typing.Awaitable
Coroutine = typing.Coroutine
AsyncIterable = typing.AsyncIterable
AsyncIterator = typing.AsyncIterator

# 3.6.1+
if hasattr(typing, 'Deque'):
    Deque = typing.Deque
# 3.6.0
else:
    class Deque(collections.deque, typing.MutableSequence[T],
                metaclass=_ExtensionsGenericMeta,
                extra=collections.deque):
        __slots__ = ()

        def __new__(cls, *args, **kwds):
            if cls._gorg is Deque:
                return collections.deque(*args, **kwds)
            return typing._generic_new(collections.deque, cls, *args, **kwds)

ContextManager = typing.ContextManager
# 3.6.2+
if hasattr(typing, 'AsyncContextManager'):
    AsyncContextManager = typing.AsyncContextManager
# 3.6.0-3.6.1
else:
    from _collections_abc import _check_methods as _check_methods_in_mro  # noqa

    class AsyncContextManager(typing.Generic[T_co]):
        __slots__ = ()

        async def __aenter__(self):
            return self

        @abc.abstractmethod
        async def __aexit__(self, exc_type, exc_value, traceback):
            return None

        @classmethod
        def __subclasshook__(cls, C):
            if cls is AsyncContextManager:
                return _check_methods_in_mro(C, "__aenter__", "__aexit__")
            return NotImplemented

DefaultDict = typing.DefaultDict

# 3.7.2+
if hasattr(typing, 'OrderedDict'):
    OrderedDict = typing.OrderedDict
# 3.7.0-3.7.2
elif (3, 7, 0) <= sys.version_info[:3] < (3, 7, 2):
    OrderedDict = typing._alias(collections.OrderedDict, (KT, VT))
# 3.6
else:
    class OrderedDict(collections.OrderedDict, typing.MutableMapping[KT, VT],
                      metaclass=_ExtensionsGenericMeta,
                      extra=collections.OrderedDict):

        __slots__ = ()

        def __new__(cls, *args, **kwds):
            if cls._gorg is OrderedDict:
                return collections.OrderedDict(*args, **kwds)
            return typing._generic_new(collections.OrderedDict, cls, *args, **kwds)

# 3.6.2+
if hasattr(typing, 'Counter'):
    Counter = typing.Counter
# 3.6.0-3.6.1
else:
    class Counter(collections.Counter,
                  typing.Dict[T, int],
                  metaclass=_ExtensionsGenericMeta, extra=collections.Counter):

        __slots__ = ()

        def __new__(cls, *args, **kwds):
            if cls._gorg is Counter:
                return collections.Counter(*args, **kwds)
            return typing._generic_new(collections.Counter, cls, *args, **kwds)

# 3.6.1+
if hasattr(typing, 'ChainMap'):
    ChainMap = typing.ChainMap
elif hasattr(collections, 'ChainMap'):
    class ChainMap(collections.ChainMap, typing.MutableMapping[KT, VT],
                   metaclass=_ExtensionsGenericMeta,
                   extra=collections.ChainMap):

        __slots__ = ()

        def __new__(cls, *args, **kwds):
            if cls._gorg is ChainMap:
                return collections.ChainMap(*args, **kwds)
            return typing._generic_new(collections.ChainMap, cls, *args, **kwds)

# 3.6.1+
if hasattr(typing, 'AsyncGenerator'):
    AsyncGenerator = typing.AsyncGenerator
# 3.6.0
else:
    class AsyncGenerator(AsyncIterator[T_co], typing.Generic[T_co, T_contra],
                         metaclass=_ExtensionsGenericMeta,
                         extra=collections.abc.AsyncGenerator):
        __slots__ = ()

NewType = typing.NewType
Text = typing.Text
TYPE_CHECKING = typing.TYPE_CHECKING


def _gorg(cls):
    """This function exists for compatibility with old typing versions."""
    assert isinstance(cls, GenericMeta)
    if hasattr(cls, '_gorg'):
        return cls._gorg
    while cls.__origin__ is not None:
        cls = cls.__origin__
    return cls


_PROTO_WHITELIST = ['Callable', 'Awaitable',
                    'Iterable', 'Iterator', 'AsyncIterable', 'AsyncIterator',
                    'Hashable', 'Sized', 'Container', 'Collection', 'Reversible',
                    'ContextManager', 'AsyncContextManager']


def _get_protocol_attrs(cls):
    attrs = set()
    for base in cls.__mro__[:-1]:  # without object
        if base.__name__ in ('Protocol', 'Generic'):
            continue
        annotations = getattr(base, '__annotations__', {})
        for attr in list(base.__dict__.keys()) + list(annotations.keys()):
            if (not attr.startswith('_abc_') and attr not in (
                    '__abstractmethods__', '__annotations__', '__weakref__',
                    '_is_protocol', '_is_runtime_protocol', '__dict__',
                    '__args__', '__slots__',
                    '__next_in_mro__', '__parameters__', '__origin__',
                    '__orig_bases__', '__extra__', '__tree_hash__',
                    '__doc__', '__subclasshook__', '__init__', '__new__',
                    '__module__', '_MutableMapping__marker', '_gorg')):
                attrs.add(attr)
    return attrs


def _is_callable_members_only(cls):
    return all(callable(getattr(cls, attr, None)) for attr in _get_protocol_attrs(cls))


# 3.8+
if hasattr(typing, 'Protocol'):
    Protocol = typing.Protocol
# 3.7
elif PEP_560:
    from typing import _collect_type_vars  # noqa

    def _no_init(self, *args, **kwargs):
        if type(self)._is_protocol:
            raise TypeError('Protocols cannot be instantiated')

    class _ProtocolMeta(abc.ABCMeta):
        # This metaclass is a bit unfortunate and exists only because of the lack
        # of __instancehook__.
        def __instancecheck__(cls, instance):
            # We need this method for situations where attributes are
            # assigned in __init__.
            if ((not getattr(cls, '_is_protocol', False) or
                 _is_callable_members_only(cls)) and
                    issubclass(instance.__class__, cls)):
                return True
            if cls._is_protocol:
                if all(hasattr(instance, attr) and
                       (not callable(getattr(cls, attr, None)) or
                        getattr(instance, attr) is not None)
                       for attr in _get_protocol_attrs(cls)):
                    return True
            return super().__instancecheck__(instance)

    class Protocol(metaclass=_ProtocolMeta):
        # There is quite a lot of overlapping code with typing.Generic.
        # Unfortunately it is hard to avoid this while these live in two different
        # modules. The duplicated code will be removed when Protocol is moved to typing.
        """Base class for protocol classes. Protocol classes are defined as::

            class Proto(Protocol):
                def meth(self) -> int:
                    ...

        Such classes are primarily used with static type checkers that recognize
        structural subtyping (static duck-typing), for example::

            class C:
                def meth(self) -> int:
                    return 0

            def func(x: Proto) -> int:
                return x.meth()

            func(C())  # Passes static type check

        See PEP 544 for details. Protocol classes decorated with
        @typing_extensions.runtime act as simple-minded runtime protocol that checks
        only the presence of given attributes, ignoring their type signatures.

        Protocol classes can be generic, they are defined as::

            class GenProto(Protocol[T]):
                def meth(self) -> T:
                    ...
        """
        __slots__ = ()
        _is_protocol = True

        def __new__(cls, *args, **kwds):
            if cls is Protocol:
                raise TypeError("Type Protocol cannot be instantiated; "
                                "it can only be used as a base class")
            return super().__new__(cls)

        @typing._tp_cache
        def __class_getitem__(cls, params):
            if not isinstance(params, tuple):
                params = (params,)
            if not params and cls is not typing.Tuple:
                raise TypeError(
                    f"Parameter list to {cls.__qualname__}[...] cannot be empty")
            msg = "Parameters to generic types must be types."
            params = tuple(typing._type_check(p, msg) for p in params)  # noqa
            if cls is Protocol:
                # Generic can only be subscripted with unique type variables.
                if not all(isinstance(p, typing.TypeVar) for p in params):
                    i = 0
                    while isinstance(params[i], typing.TypeVar):
                        i += 1
                    raise TypeError(
                        "Parameters to Protocol[...] must all be type variables."
                        f" Parameter {i + 1} is {params[i]}")
                if len(set(params)) != len(params):
                    raise TypeError(
                        "Parameters to Protocol[...] must all be unique")
            else:
                # Subscripting a regular Generic subclass.
                _check_generic(cls, params)
            return typing._GenericAlias(cls, params)

        def __init_subclass__(cls, *args, **kwargs):
            tvars = []
            if '__orig_bases__' in cls.__dict__:
                error = typing.Generic in cls.__orig_bases__
            else:
                error = typing.Generic in cls.__bases__
            if error:
                raise TypeError("Cannot inherit from plain Generic")
            if '__orig_bases__' in cls.__dict__:
                tvars = _collect_type_vars(cls.__orig_bases__)
                # Look for Generic[T1, ..., Tn] or Protocol[T1, ..., Tn].
                # If found, tvars must be a subset of it.
                # If not found, tvars is it.
                # Also check for and reject plain Generic,
                # and reject multiple Generic[...] and/or Protocol[...].
                gvars = None
                for base in cls.__orig_bases__:
                    if (isinstance(base, typing._GenericAlias) and
                            base.__origin__ in (typing.Generic, Protocol)):
                        # for error messages
                        the_base = base.__origin__.__name__
                        if gvars is not None:
                            raise TypeError(
                                "Cannot inherit from Generic[...]"
                                " and/or Protocol[...] multiple types.")
                        gvars = base.__parameters__
                if gvars is None:
                    gvars = tvars
                else:
                    tvarset = set(tvars)
                    gvarset = set(gvars)
                    if not tvarset <= gvarset:
                        s_vars = ', '.join(str(t) for t in tvars if t not in gvarset)
                        s_args = ', '.join(str(g) for g in gvars)
                        raise TypeError(f"Some type variables ({s_vars}) are"
                                        f" not listed in {the_base}[{s_args}]")
                    tvars = gvars
            cls.__parameters__ = tuple(tvars)

            # Determine if this is a protocol or a concrete subclass.
            if not cls.__dict__.get('_is_protocol', None):
                cls._is_protocol = any(b is Protocol for b in cls.__bases__)

            # Set (or override) the protocol subclass hook.
            def _proto_hook(other):
                if not cls.__dict__.get('_is_protocol', None):
                    return NotImplemented
                if not getattr(cls, '_is_runtime_protocol', False):
                    if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
                        return NotImplemented
                    raise TypeError("Instance and class checks can only be used with"
                                    " @runtime protocols")
                if not _is_callable_members_only(cls):
                    if sys._getframe(2).f_globals['__name__'] in ['abc', 'functools']:
                        return NotImplemented
                    raise TypeError("Protocols with non-method members"
                                    " don't support issubclass()")
                if not isinstance(other, type):
                    # Same error as for issubclass(1, int)
                    raise TypeError('issubclass() arg 1 must be a class')
                for attr in _get_protocol_attrs(cls):
                    for base in other.__mro__:
                        if attr in base.__dict__:
                            if base.__dict__[attr] is None:
                                return NotImplemented
                            break
                        annotations = getattr(base, '__annotations__', {})
                        if (isinstance(annotations, typing.Mapping) and
                                attr in annotations and
                                isinstance(other, _ProtocolMeta) and
                                other._is_protocol):
                            break
                    else:
                        return NotImplemented
                return True
            if '__subclasshook__' not in cls.__dict__:
                cls.__subclasshook__ = _proto_hook

            # We have nothing more to do for non-protocols.
            if not cls._is_protocol:
                return

            # Check consistency of bases.
            for base in cls.__bases__:
                if not (base in (object, typing.Generic) or
                        base.__module__ == 'collections.abc' and
                        base.__name__ in _PROTO_WHITELIST or
                        isinstance(base, _ProtocolMeta) and base._is_protocol):
                    raise TypeError('Protocols can only inherit from other'
                                    f' protocols, got {repr(base)}')
            cls.__init__ = _no_init
# 3.6
else:
    from typing import _next_in_mro, _type_check  # noqa

    def _no_init(self, *args, **kwargs):
        if type(self)._is_protocol:
            raise TypeError('Protocols cannot be instantiated')

    class _ProtocolMeta(GenericMeta):
        """Internal metaclass for Protocol.

        This exists so Protocol classes can be generic without deriving
        from Generic.
        """
        def __new__(cls, name, bases, namespace,
                    tvars=None, args=None, origin=None, extra=None, orig_bases=None):
            # This is just a version copied from GenericMeta.__new__ that
            # includes "Protocol" special treatment. (Comments removed for brevity.)
            assert extra is None  # Protocols should not have extra
            if tvars is not None:
                assert origin is not None
                assert all(isinstance(t, typing.TypeVar) for t in tvars), tvars
            else:
                tvars = _type_vars(bases)
                gvars = None
                for base in bases:
                    if base is typing.Generic:
                        raise TypeError("Cannot inherit from plain Generic")
                    if (isinstance(base, GenericMeta) and
                            base.__origin__ in (typing.Generic, Protocol)):
                        if gvars is not None:
                            raise TypeError(
                                "Cannot inherit from Generic[...] or"
                                " Protocol[...] multiple times.")
                        gvars = base.__parameters__
                if gvars is None:
                    gvars = tvars
                else:
                    tvarset = set(tvars)
                    gvarset = set(gvars)
                    if not tvarset <= gvarset:
                        s_vars = ", ".join(str(t) for t in tvars if t not in gvarset)
                        s_args = ", ".join(str(g) for g in gvars)
                        cls_name = "Generic" if any(b.__origin__ is typing.Generic
                                                    for b in bases) else "Protocol"
                        raise TypeError(f"Some type variables ({s_vars}) are"
                                        f" not listed in {cls_name}[{s_args}]")
                    tvars = gvars

            initial_bases = bases
            if (extra is not None and type(extra) is abc.ABCMeta and
                    extra not in bases):
                bases = (extra,) + bases
            bases = tuple(_gorg(b) if isinstance(b, GenericMeta) else b
                          for b in bases)
            if any(isinstance(b, GenericMeta) and b is not typing.Generic for b in bases):
                bases = tuple(b for b in bases if b is not typing.Generic)
            namespace.update({'__origin__': origin, '__extra__': extra})
            self = super(GenericMeta, cls).__new__(cls, name, bases, namespace,
                                                   _root=True)
            super(GenericMeta, self).__setattr__('_gorg',
                                                 self if not origin else
                                                 _gorg(origin))
            self.__parameters__ = tvars
            self.__args__ = tuple(... if a is typing._TypingEllipsis else
                                  () if a is typing._TypingEmpty else
                                  a for a in args) if args else None
            self.__next_in_mro__ = _next_in_mro(self)
            if orig_bases is None:
                self.__orig_bases__ = initial_bases
            elif origin is not None:
                self._abc_registry = origin._abc_registry
                self._abc_cache = origin._abc_cache
            if hasattr(self, '_subs_tree'):
                self.__tree_hash__ = (hash(self._subs_tree()) if origin else
                                      super(GenericMeta, self).__hash__())
            return self

        def __init__(cls, *args, **kwargs):
            super().__init__(*args, **kwargs)
            if not cls.__dict__.get('_is_protocol', None):
                cls._is_protocol = any(b is Protocol or
                                       isinstance(b, _ProtocolMeta) and
                                       b.__origin__ is Protocol
                                       for b in cls.__bases__)
            if cls._is_protocol:
                for base in cls.__mro__[1:]:
                    if not (base in (object, typing.Generic) or
                            base.__module__ == 'collections.abc' and
                            base.__name__ in _PROTO_WHITELIST or
                            isinstance(base, typing.TypingMeta) and base._is_protocol or
                            isinstance(base, GenericMeta) and
                            base.__origin__ is typing.Generic):
                        raise TypeError(f'Protocols can only inherit from other'
                                        f' protocols, got {repr(base)}')

                cls.__init__ = _no_init

            def _proto_hook(other):
                if not cls.__dict__.get('_is_protocol', None):
                    return NotImplemented
                if not isinstance(other, type):
                    # Same error as for issubclass(1, int)
                    raise TypeError('issubclass() arg 1 must be a class')
                for attr in _get_protocol_attrs(cls):
                    for base in other.__mro__:
                        if attr in base.__dict__:
                            if base.__dict__[attr] is None:
                                return NotImplemented
                            break
                        annotations = getattr(base, '__annotations__', {})
                        if (isinstance(annotations, typing.Mapping) and
                                attr in annotations and
                                isinstance(other, _ProtocolMeta) and
                                other._is_protocol):
                            break
                    else:
                        return NotImplemented
                return True
            if '__subclasshook__' not in cls.__dict__:
                cls.__subclasshook__ = _proto_hook

        def __instancecheck__(self, instance):
            # We need this method for situations where attributes are
            # assigned in __init__.
            if ((not getattr(self, '_is_protocol', False) or
                    _is_callable_members_only(self)) and
                    issubclass(instance.__class__, self)):
                return True
            if self._is_protocol:
                if all(hasattr(instance, attr) and
                        (not callable(getattr(self, attr, None)) or
                         getattr(instance, attr) is not None)
                        for attr in _get_protocol_attrs(self)):
                    return True
            return super(GenericMeta, self).__instancecheck__(instance)

        def __subclasscheck__(self, cls):
            if self.__origin__ is not None:
                if sys._getframe(1).f_globals['__name__'] not in ['abc', 'functools']:
                    raise TypeError("Parameterized generics cannot be used with class "
                                    "or instance checks")
                return False
            if (self.__dict__.get('_is_protocol', None) and
                    not self.__dict__.get('_is_runtime_protocol', None)):
                if sys._getframe(1).f_globals['__name__'] in ['abc',
                                                              'functools',
                                                              'typing']:
                    return False
                raise TypeError("Instance and class checks can only be used with"
                                " @runtime protocols")
            if (self.__dict__.get('_is_runtime_protocol', None) and
                    not _is_callable_members_only(self)):
                if sys._getframe(1).f_globals['__name__'] in ['abc',
                                                              'functools',
                                                              'typing']:
                    return super(GenericMeta, self).__subclasscheck__(cls)
                raise TypeError("Protocols with non-method members"
                                " don't support issubclass()")
            return super(GenericMeta, self).__subclasscheck__(cls)

        @typing._tp_cache
        def __getitem__(self, params):
            # We also need to copy this from GenericMeta.__getitem__ to get
            # special treatment of "Protocol". (Comments removed for brevity.)
            if not isinstance(params, tuple):
                params = (params,)
            if not params and _gorg(self) is not typing.Tuple:
                raise TypeError(
                    f"Parameter list to {self.__qualname__}[...] cannot be empty")
            msg = "Parameters to generic types must be types."
            params = tuple(_type_check(p, msg) for p in params)
            if self in (typing.Generic, Protocol):
                if not all(isinstance(p, typing.TypeVar) for p in params):
                    raise TypeError(
                        f"Parameters to {repr(self)}[...] must all be type variables")
                if len(set(params)) != len(params):
                    raise TypeError(
                        f"Parameters to {repr(self)}[...] must all be unique")
                tvars = params
                args = params
            elif self in (typing.Tuple, typing.Callable):
                tvars = _type_vars(params)
                args = params
            elif self.__origin__ in (typing.Generic, Protocol):
                raise TypeError(f"Cannot subscript already-subscripted {repr(self)}")
            else:
                _check_generic(self, params)
                tvars = _type_vars(params)
                args = params

            prepend = (self,) if self.__origin__ is None else ()
            return self.__class__(self.__name__,
                                  prepend + self.__bases__,
                                  _no_slots_copy(self.__dict__),
                                  tvars=tvars,
                                  args=args,
                                  origin=self,
                                  extra=self.__extra__,
                                  orig_bases=self.__orig_bases__)

    class Protocol(metaclass=_ProtocolMeta):
        """Base class for protocol classes. Protocol classes are defined as::

          class Proto(Protocol):
              def meth(self) -> int:
                  ...

        Such classes are primarily used with static type checkers that recognize
        structural subtyping (static duck-typing), for example::

          class C:
              def meth(self) -> int:
                  return 0

          def func(x: Proto) -> int:
              return x.meth()

          func(C())  # Passes static type check

        See PEP 544 for details. Protocol classes decorated with
        @typing_extensions.runtime act as simple-minded runtime protocol that checks
        only the presence of given attributes, ignoring their type signatures.

        Protocol classes can be generic, they are defined as::

          class GenProto(Protocol[T]):
              def meth(self) -> T:
                  ...
        """
        __slots__ = ()
        _is_protocol = True

        def __new__(cls, *args, **kwds):
            if _gorg(cls) is Protocol:
                raise TypeError("Type Protocol cannot be instantiated; "
                                "it can be used only as a base class")
            return typing._generic_new(cls.__next_in_mro__, cls, *args, **kwds)


# 3.8+
if hasattr(typing, 'runtime_checkable'):
    runtime_checkable = typing.runtime_checkable
# 3.6-3.7
else:
    def runtime_checkable(cls):
        """Mark a protocol class as a runtime protocol, so that it
        can be used with isinstance() and issubclass(). Raise TypeError
        if applied to a non-protocol class.

        This allows a simple-minded structural check very similar to the
        one-offs in collections.abc such as Hashable.
        """
        if not isinstance(cls, _ProtocolMeta) or not cls._is_protocol:
            raise TypeError('@runtime_checkable can be only applied to protocol classes,'
                            f' got {cls!r}')
        cls._is_runtime_protocol = True
        return cls


# Exists for backwards compatibility.
runtime = runtime_checkable


# 3.8+
if hasattr(typing, 'SupportsIndex'):
    SupportsIndex = typing.SupportsIndex
# 3.6-3.7
else:
    @runtime_checkable
    class SupportsIndex(Protocol):
        __slots__ = ()

        @abc.abstractmethod
        def __index__(self) -> int:
            pass


if sys.version_info >= (3, 9, 2):
    # The standard library TypedDict in Python 3.8 does not store runtime information
    # about which (if any) keys are optional.  See https://bugs.python.org/issue38834
    # The standard library TypedDict in Python 3.9.0/1 does not honour the "total"
    # keyword with old-style TypedDict().  See https://bugs.python.org/issue42059
    TypedDict = typing.TypedDict
else:
    def _check_fails(cls, other):
        try:
            if sys._getframe(1).f_globals['__name__'] not in ['abc',
                                                              'functools',
                                                              'typing']:
                # Typed dicts are only for static structural subtyping.
                raise TypeError('TypedDict does not support instance and class checks')
        except (AttributeError, ValueError):
            pass
        return False

    def _dict_new(*args, **kwargs):
        if not args:
            raise TypeError('TypedDict.__new__(): not enough arguments')
        _, args = args[0], args[1:]  # allow the "cls" keyword be passed
        return dict(*args, **kwargs)

    _dict_new.__text_signature__ = '($cls, _typename, _fields=None, /, **kwargs)'

    def _typeddict_new(*args, total=True, **kwargs):
        if not args:
            raise TypeError('TypedDict.__new__(): not enough arguments')
        _, args = args[0], args[1:]  # allow the "cls" keyword be passed
        if args:
            typename, args = args[0], args[1:]  # allow the "_typename" keyword be passed
        elif '_typename' in kwargs:
            typename = kwargs.pop('_typename')
            import warnings
            warnings.warn("Passing '_typename' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError("TypedDict.__new__() missing 1 required positional "
                            "argument: '_typename'")
        if args:
            try:
                fields, = args  # allow the "_fields" keyword be passed
            except ValueError:
                raise TypeError('TypedDict.__new__() takes from 2 to 3 '
                                f'positional arguments but {len(args) + 2} '
                                'were given')
        elif '_fields' in kwargs and len(kwargs) == 1:
            fields = kwargs.pop('_fields')
            import warnings
            warnings.warn("Passing '_fields' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            fields = None

        if fields is None:
            fields = kwargs
        elif kwargs:
            raise TypeError("TypedDict takes either a dict or keyword arguments,"
                            " but not both")

        ns = {'__annotations__': dict(fields)}
        try:
            # Setting correct module is necessary to make typed dict classes pickleable.
            ns['__module__'] = sys._getframe(1).f_globals.get('__name__', '__main__')
        except (AttributeError, ValueError):
            pass

        return _TypedDictMeta(typename, (), ns, total=total)

    _typeddict_new.__text_signature__ = ('($cls, _typename, _fields=None,'
                                         ' /, *, total=True, **kwargs)')

    class _TypedDictMeta(type):
        def __init__(cls, name, bases, ns, total=True):
            super().__init__(name, bases, ns)

        def __new__(cls, name, bases, ns, total=True):
            # Create new typed dict class object.
            # This method is called directly when TypedDict is subclassed,
            # or via _typeddict_new when TypedDict is instantiated. This way
            # TypedDict supports all three syntaxes described in its docstring.
            # Subclasses and instances of TypedDict return actual dictionaries
            # via _dict_new.
            ns['__new__'] = _typeddict_new if name == 'TypedDict' else _dict_new
            tp_dict = super().__new__(cls, name, (dict,), ns)

            annotations = {}
            own_annotations = ns.get('__annotations__', {})
            own_annotation_keys = set(own_annotations.keys())
            msg = "TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a type"
            own_annotations = {
                n: typing._type_check(tp, msg) for n, tp in own_annotations.items()
            }
            required_keys = set()
            optional_keys = set()

            for base in bases:
                annotations.update(base.__dict__.get('__annotations__', {}))
                required_keys.update(base.__dict__.get('__required_keys__', ()))
                optional_keys.update(base.__dict__.get('__optional_keys__', ()))

            annotations.update(own_annotations)
            if total:
                required_keys.update(own_annotation_keys)
            else:
                optional_keys.update(own_annotation_keys)

            tp_dict.__annotations__ = annotations
            tp_dict.__required_keys__ = frozenset(required_keys)
            tp_dict.__optional_keys__ = frozenset(optional_keys)
            if not hasattr(tp_dict, '__total__'):
                tp_dict.__total__ = total
            return tp_dict

        __instancecheck__ = __subclasscheck__ = _check_fails

    TypedDict = _TypedDictMeta('TypedDict', (dict,), {})
    TypedDict.__module__ = __name__
    TypedDict.__doc__ = \
        """A simple typed name space. At runtime it is equivalent to a plain dict.

        TypedDict creates a dictionary type that expects all of its
        instances to have a certain set of keys, with each key
        associated with a value of a consistent type. This expectation
        is not checked at runtime but is only enforced by type checkers.
        Usage::

            class Point2D(TypedDict):
                x: int
                y: int
                label: str

            a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
            b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

            assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

        The type info can be accessed via the Point2D.__annotations__ dict, and
        the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
        TypedDict supports two additional equivalent forms::

            Point2D = TypedDict('Point2D', x=int, y=int, label=str)
            Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

        The class syntax is only supported in Python 3.6+, while two other
        syntax forms work for Python 2.7 and 3.2+
        """


# Python 3.9+ has PEP 593 (Annotated and modified get_type_hints)
if hasattr(typing, 'Annotated'):
    Annotated = typing.Annotated
    get_type_hints = typing.get_type_hints
    # Not exported and not a public API, but needed for get_origin() and get_args()
    # to work.
    _AnnotatedAlias = typing._AnnotatedAlias
# 3.7-3.8
elif PEP_560:
    class _AnnotatedAlias(typing._GenericAlias, _root=True):
        """Runtime representation of an annotated type.

        At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
        with extra annotations. The alias behaves like a normal typing alias,
        instantiating is the same as instantiating the underlying type, binding
        it to types is also the same.
        """
        def __init__(self, origin, metadata):
            if isinstance(origin, _AnnotatedAlias):
                metadata = origin.__metadata__ + metadata
                origin = origin.__origin__
            super().__init__(origin, origin)
            self.__metadata__ = metadata

        def copy_with(self, params):
            assert len(params) == 1
            new_type = params[0]
            return _AnnotatedAlias(new_type, self.__metadata__)

        def __repr__(self):
            return (f"typing_extensions.Annotated[{typing._type_repr(self.__origin__)}, "
                    f"{', '.join(repr(a) for a in self.__metadata__)}]")

        def __reduce__(self):
            return operator.getitem, (
                Annotated, (self.__origin__,) + self.__metadata__
            )

        def __eq__(self, other):
            if not isinstance(other, _AnnotatedAlias):
                return NotImplemented
            if self.__origin__ != other.__origin__:
                return False
            return self.__metadata__ == other.__metadata__

        def __hash__(self):
            return hash((self.__origin__, self.__metadata__))

    class Annotated:
        """Add context specific metadata to a type.

        Example: Annotated[int, runtime_check.Unsigned] indicates to the
        hypothetical runtime_check module that this type is an unsigned int.
        Every other consumer of this type can ignore this metadata and treat
        this type as int.

        The first argument to Annotated must be a valid type (and will be in
        the __origin__ field), the remaining arguments are kept as a tuple in
        the __extra__ field.

        Details:

        - It's an error to call `Annotated` with less than two arguments.
        - Nested Annotated are flattened::

            Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

        - Instantiating an annotated type is equivalent to instantiating the
        underlying type::

            Annotated[C, Ann1](5) == C(5)

        - Annotated can be used as a generic type alias::

            Optimized = Annotated[T, runtime.Optimize()]
            Optimized[int] == Annotated[int, runtime.Optimize()]

            OptimizedList = Annotated[List[T], runtime.Optimize()]
            OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
        """

        __slots__ = ()

        def __new__(cls, *args, **kwargs):
            raise TypeError("Type Annotated cannot be instantiated.")

        @typing._tp_cache
        def __class_getitem__(cls, params):
            if not isinstance(params, tuple) or len(params) < 2:
                raise TypeError("Annotated[...] should be used "
                                "with at least two arguments (a type and an "
                                "annotation).")
            msg = "Annotated[t, ...]: t must be a type."
            origin = typing._type_check(params[0], msg)
            metadata = tuple(params[1:])
            return _AnnotatedAlias(origin, metadata)

        def __init_subclass__(cls, *args, **kwargs):
            raise TypeError(
                f"Cannot subclass {cls.__module__}.Annotated"
            )

    def _strip_annotations(t):
        """Strips the annotations from a given type.
        """
        if isinstance(t, _AnnotatedAlias):
            return _strip_annotations(t.__origin__)
        if isinstance(t, typing._GenericAlias):
            stripped_args = tuple(_strip_annotations(a) for a in t.__args__)
            if stripped_args == t.__args__:
                return t
            res = t.copy_with(stripped_args)
            res._special = t._special
            return res
        return t

    def get_type_hints(obj, globalns=None, localns=None, include_extras=False):
        """Return type hints for an object.

        This is often the same as obj.__annotations__, but it handles
        forward references encoded as string literals, adds Optional[t] if a
        default value equal to None is set and recursively replaces all
        'Annotated[T, ...]' with 'T' (unless 'include_extras=True').

        The argument may be a module, class, method, or function. The annotations
        are returned as a dictionary. For classes, annotations include also
        inherited members.

        TypeError is raised if the argument is not of a type that can contain
        annotations, and an empty dictionary is returned if no annotations are
        present.

        BEWARE -- the behavior of globalns and localns is counterintuitive
        (unless you are familiar with how eval() and exec() work).  The
        search order is locals first, then globals.

        - If no dict arguments are passed, an attempt is made to use the
          globals from obj (or the respective module's globals for classes),
          and these are also used as the locals.  If the object does not appear
          to have globals, an empty dictionary is used.

        - If one dict argument is passed, it is used for both globals and
          locals.

        - If two dict arguments are passed, they specify globals and
          locals, respectively.
        """
        hint = typing.get_type_hints(obj, globalns=globalns, localns=localns)
        if include_extras:
            return hint
        return {k: _strip_annotations(t) for k, t in hint.items()}
# 3.6
else:

    def _is_dunder(name):
        """Returns True if name is a __dunder_variable_name__."""
        return len(name) > 4 and name.startswith('__') and name.endswith('__')

    # Prior to Python 3.7 types did not have `copy_with`. A lot of the equality
    # checks, argument expansion etc. are done on the _subs_tre. As a result we
    # can't provide a get_type_hints function that strips out annotations.

    class AnnotatedMeta(typing.GenericMeta):
        """Metaclass for Annotated"""

        def __new__(cls, name, bases, namespace, **kwargs):
            if any(b is not object for b in bases):
                raise TypeError("Cannot subclass " + str(Annotated))
            return super().__new__(cls, name, bases, namespace, **kwargs)

        @property
        def __metadata__(self):
            return self._subs_tree()[2]

        def _tree_repr(self, tree):
            cls, origin, metadata = tree
            if not isinstance(origin, tuple):
                tp_repr = typing._type_repr(origin)
            else:
                tp_repr = origin[0]._tree_repr(origin)
            metadata_reprs = ", ".join(repr(arg) for arg in metadata)
            return f'{cls}[{tp_repr}, {metadata_reprs}]'

        def _subs_tree(self, tvars=None, args=None):  # noqa
            if self is Annotated:
                return Annotated
            res = super()._subs_tree(tvars=tvars, args=args)
            # Flatten nested Annotated
            if isinstance(res[1], tuple) and res[1][0] is Annotated:
                sub_tp = res[1][1]
                sub_annot = res[1][2]
                return (Annotated, sub_tp, sub_annot + res[2])
            return res

        def _get_cons(self):
            """Return the class used to create instance of this type."""
            if self.__origin__ is None:
                raise TypeError("Cannot get the underlying type of a "
                                "non-specialized Annotated type.")
            tree = self._subs_tree()
            while isinstance(tree, tuple) and tree[0] is Annotated:
                tree = tree[1]
            if isinstance(tree, tuple):
                return tree[0]
            else:
                return tree

        @typing._tp_cache
        def __getitem__(self, params):
            if not isinstance(params, tuple):
                params = (params,)
            if self.__origin__ is not None:  # specializing an instantiated type
                return super().__getitem__(params)
            elif not isinstance(params, tuple) or len(params) < 2:
                raise TypeError("Annotated[...] should be instantiated "
                                "with at least two arguments (a type and an "
                                "annotation).")
            else:
                msg = "Annotated[t, ...]: t must be a type."
                tp = typing._type_check(params[0], msg)
                metadata = tuple(params[1:])
            return self.__class__(
                self.__name__,
                self.__bases__,
                _no_slots_copy(self.__dict__),
                tvars=_type_vars((tp,)),
                # Metadata is a tuple so it won't be touched by _replace_args et al.
                args=(tp, metadata),
                origin=self,
            )

        def __call__(self, *args, **kwargs):
            cons = self._get_cons()
            result = cons(*args, **kwargs)
            try:
                result.__orig_class__ = self
            except AttributeError:
                pass
            return result

        def __getattr__(self, attr):
            # For simplicity we just don't relay all dunder names
            if self.__origin__ is not None and not _is_dunder(attr):
                return getattr(self._get_cons(), attr)
            raise AttributeError(attr)

        def __setattr__(self, attr, value):
            if _is_dunder(attr) or attr.startswith('_abc_'):
                super().__setattr__(attr, value)
            elif self.__origin__ is None:
                raise AttributeError(attr)
            else:
                setattr(self._get_cons(), attr, value)

        def __instancecheck__(self, obj):
            raise TypeError("Annotated cannot be used with isinstance().")

        def __subclasscheck__(self, cls):
            raise TypeError("Annotated cannot be used with issubclass().")

    class Annotated(metaclass=AnnotatedMeta):
        """Add context specific metadata to a type.

        Example: Annotated[int, runtime_check.Unsigned] indicates to the
        hypothetical runtime_check module that this type is an unsigned int.
        Every other consumer of this type can ignore this metadata and treat
        this type as int.

        The first argument to Annotated must be a valid type, the remaining
        arguments are kept as a tuple in the __metadata__ field.

        Details:

        - It's an error to call `Annotated` with less than two arguments.
        - Nested Annotated are flattened::

            Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]

        - Instantiating an annotated type is equivalent to instantiating the
        underlying type::

            Annotated[C, Ann1](5) == C(5)

        - Annotated can be used as a generic type alias::

            Optimized = Annotated[T, runtime.Optimize()]
            Optimized[int] == Annotated[int, runtime.Optimize()]

            OptimizedList = Annotated[List[T], runtime.Optimize()]
            OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
        """

# Python 3.8 has get_origin() and get_args() but those implementations aren't
# Annotated-aware, so we can't use those. Python 3.9's versions don't support
# ParamSpecArgs and ParamSpecKwargs, so only Python 3.10's versions will do.
if sys.version_info[:2] >= (3, 10):
    get_origin = typing.get_origin
    get_args = typing.get_args
# 3.7-3.9
elif PEP_560:
    try:
        # 3.9+
        from typing import _BaseGenericAlias
    except ImportError:
        _BaseGenericAlias = typing._GenericAlias
    try:
        # 3.9+
        from typing import GenericAlias
    except ImportError:
        GenericAlias = typing._GenericAlias

    def get_origin(tp):
        """Get the unsubscripted version of a type.

        This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar
        and Annotated. Return None for unsupported types. Examples::

            get_origin(Literal[42]) is Literal
            get_origin(int) is None
            get_origin(ClassVar[int]) is ClassVar
            get_origin(Generic) is Generic
            get_origin(Generic[T]) is Generic
            get_origin(Union[T, int]) is Union
            get_origin(List[Tuple[T, T]][int]) == list
            get_origin(P.args) is P
        """
        if isinstance(tp, _AnnotatedAlias):
            return Annotated
        if isinstance(tp, (typing._GenericAlias, GenericAlias, _BaseGenericAlias,
                           ParamSpecArgs, ParamSpecKwargs)):
            return tp.__origin__
        if tp is typing.Generic:
            return typing.Generic
        return None

    def get_args(tp):
        """Get type arguments with all substitutions performed.

        For unions, basic simplifications used by Union constructor are performed.
        Examples::
            get_args(Dict[str, int]) == (str, int)
            get_args(int) == ()
            get_args(Union[int, Union[T, int], str][int]) == (int, str)
            get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
            get_args(Callable[[], T][int]) == ([], int)
        """
        if isinstance(tp, _AnnotatedAlias):
            return (tp.__origin__,) + tp.__metadata__
        if isinstance(tp, (typing._GenericAlias, GenericAlias)):
            if getattr(tp, "_special", False):
                return ()
            res = tp.__args__
            if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
                res = (list(res[:-1]), res[-1])
            return res
        return ()


# 3.10+
if hasattr(typing, 'TypeAlias'):
    TypeAlias = typing.TypeAlias
# 3.9
elif sys.version_info[:2] >= (3, 9):
    class _TypeAliasForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

    @_TypeAliasForm
    def TypeAlias(self, parameters):
        """Special marker indicating that an assignment should
        be recognized as a proper type alias definition by type
        checkers.

        For example::

            Predicate: TypeAlias = Callable[..., bool]

        It's invalid when used anywhere except as in the example above.
        """
        raise TypeError(f"{self} is not subscriptable")
# 3.7-3.8
elif sys.version_info[:2] >= (3, 7):
    class _TypeAliasForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

    TypeAlias = _TypeAliasForm('TypeAlias',
                               doc="""Special marker indicating that an assignment should
                               be recognized as a proper type alias definition by type
                               checkers.

                               For example::

                                   Predicate: TypeAlias = Callable[..., bool]

                               It's invalid when used anywhere except as in the example
                               above.""")
# 3.6
else:
    class _TypeAliasMeta(typing.TypingMeta):
        """Metaclass for TypeAlias"""

        def __repr__(self):
            return 'typing_extensions.TypeAlias'

    class _TypeAliasBase(typing._FinalTypingBase, metaclass=_TypeAliasMeta, _root=True):
        """Special marker indicating that an assignment should
        be recognized as a proper type alias definition by type
        checkers.

        For example::

            Predicate: TypeAlias = Callable[..., bool]

        It's invalid when used anywhere except as in the example above.
        """
        __slots__ = ()

        def __instancecheck__(self, obj):
            raise TypeError("TypeAlias cannot be used with isinstance().")

        def __subclasscheck__(self, cls):
            raise TypeError("TypeAlias cannot be used with issubclass().")

        def __repr__(self):
            return 'typing_extensions.TypeAlias'

    TypeAlias = _TypeAliasBase(_root=True)


# Python 3.10+ has PEP 612
if hasattr(typing, 'ParamSpecArgs'):
    ParamSpecArgs = typing.ParamSpecArgs
    ParamSpecKwargs = typing.ParamSpecKwargs
# 3.6-3.9
else:
    class _Immutable:
        """Mixin to indicate that object should not be copied."""
        __slots__ = ()

        def __copy__(self):
            return self

        def __deepcopy__(self, memo):
            return self

    class ParamSpecArgs(_Immutable):
        """The args for a ParamSpec object.

        Given a ParamSpec object P, P.args is an instance of ParamSpecArgs.

        ParamSpecArgs objects have a reference back to their ParamSpec:

        P.args.__origin__ is P

        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        """
        def __init__(self, origin):
            self.__origin__ = origin

        def __repr__(self):
            return f"{self.__origin__.__name__}.args"

    class ParamSpecKwargs(_Immutable):
        """The kwargs for a ParamSpec object.

        Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs.

        ParamSpecKwargs objects have a reference back to their ParamSpec:

        P.kwargs.__origin__ is P

        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        """
        def __init__(self, origin):
            self.__origin__ = origin

        def __repr__(self):
            return f"{self.__origin__.__name__}.kwargs"

# 3.10+
if hasattr(typing, 'ParamSpec'):
    ParamSpec = typing.ParamSpec
# 3.6-3.9
else:

    # Inherits from list as a workaround for Callable checks in Python < 3.9.2.
    class ParamSpec(list):
        """Parameter specification variable.

        Usage::

           P = ParamSpec('P')

        Parameter specification variables exist primarily for the benefit of static
        type checkers.  They are used to forward the parameter types of one
        callable to another callable, a pattern commonly found in higher order
        functions and decorators.  They are only valid when used in ``Concatenate``,
        or s the first argument to ``Callable``. In Python 3.10 and higher,
        they are also supported in user-defined Generics at runtime.
        See class Generic for more information on generic types.  An
        example for annotating a decorator::

           T = TypeVar('T')
           P = ParamSpec('P')

           def add_logging(f: Callable[P, T]) -> Callable[P, T]:
               '''A type-safe decorator to add logging to a function.'''
               def inner(*args: P.args, **kwargs: P.kwargs) -> T:
                   logging.info(f'{f.__name__} was called')
                   return f(*args, **kwargs)
               return inner

           @add_logging
           def add_two(x: float, y: float) -> float:
               '''Add two numbers together.'''
               return x + y

        Parameter specification variables defined with covariant=True or
        contravariant=True can be used to declare covariant or contravariant
        generic types.  These keyword arguments are valid, but their actual semantics
        are yet to be decided.  See PEP 612 for details.

        Parameter specification variables can be introspected. e.g.:

           P.__name__ == 'T'
           P.__bound__ == None
           P.__covariant__ == False
           P.__contravariant__ == False

        Note that only parameter specification variables defined in global scope can
        be pickled.
        """

        # Trick Generic __parameters__.
        __class__ = typing.TypeVar

        @property
        def args(self):
            return ParamSpecArgs(self)

        @property
        def kwargs(self):
            return ParamSpecKwargs(self)

        def __init__(self, name, *, bound=None, covariant=False, contravariant=False):
            super().__init__([self])
            self.__name__ = name
            self.__covariant__ = bool(covariant)
            self.__contravariant__ = bool(contravariant)
            if bound:
                self.__bound__ = typing._type_check(bound, 'Bound must be a type.')
            else:
                self.__bound__ = None

            # for pickling:
            try:
                def_mod = sys._getframe(1).f_globals.get('__name__', '__main__')
            except (AttributeError, ValueError):
                def_mod = None
            if def_mod != 'typing_extensions':
                self.__module__ = def_mod

        def __repr__(self):
            if self.__covariant__:
                prefix = '+'
            elif self.__contravariant__:
                prefix = '-'
            else:
                prefix = '~'
            return prefix + self.__name__

        def __hash__(self):
            return object.__hash__(self)

        def __eq__(self, other):
            return self is other

        def __reduce__(self):
            return self.__name__

        # Hack to get typing._type_check to pass.
        def __call__(self, *args, **kwargs):
            pass

        if not PEP_560:
            # Only needed in 3.6.
            def _get_type_vars(self, tvars):
                if self not in tvars:
                    tvars.append(self)


# 3.6-3.9
if not hasattr(typing, 'Concatenate'):
    # Inherits from list as a workaround for Callable checks in Python < 3.9.2.
    class _ConcatenateGenericAlias(list):

        # Trick Generic into looking into this for __parameters__.
        if PEP_560:
            __class__ = typing._GenericAlias
        else:
            __class__ = typing._TypingBase

        # Flag in 3.8.
        _special = False
        # Attribute in 3.6 and earlier.
        _gorg = typing.Generic

        def __init__(self, origin, args):
            super().__init__(args)
            self.__origin__ = origin
            self.__args__ = args

        def __repr__(self):
            _type_repr = typing._type_repr
            return (f'{_type_repr(self.__origin__)}'
                    f'[{", ".join(_type_repr(arg) for arg in self.__args__)}]')

        def __hash__(self):
            return hash((self.__origin__, self.__args__))

        # Hack to get typing._type_check to pass in Generic.
        def __call__(self, *args, **kwargs):
            pass

        @property
        def __parameters__(self):
            return tuple(
                tp for tp in self.__args__ if isinstance(tp, (typing.TypeVar, ParamSpec))
            )

        if not PEP_560:
            # Only required in 3.6.
            def _get_type_vars(self, tvars):
                if self.__origin__ and self.__parameters__:
                    typing._get_type_vars(self.__parameters__, tvars)


# 3.6-3.9
@typing._tp_cache
def _concatenate_getitem(self, parameters):
    if parameters == ():
        raise TypeError("Cannot take a Concatenate of no types.")
    if not isinstance(parameters, tuple):
        parameters = (parameters,)
    if not isinstance(parameters[-1], ParamSpec):
        raise TypeError("The last parameter to Concatenate should be a "
                        "ParamSpec variable.")
    msg = "Concatenate[arg, ...]: each arg must be a type."
    parameters = tuple(typing._type_check(p, msg) for p in parameters)
    return _ConcatenateGenericAlias(self, parameters)


# 3.10+
if hasattr(typing, 'Concatenate'):
    Concatenate = typing.Concatenate
    _ConcatenateGenericAlias = typing._ConcatenateGenericAlias # noqa
# 3.9
elif sys.version_info[:2] >= (3, 9):
    @_TypeAliasForm
    def Concatenate(self, parameters):
        """Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
        higher order function which adds, removes or transforms parameters of a
        callable.

        For example::

           Callable[Concatenate[int, P], int]

        See PEP 612 for detailed information.
        """
        return _concatenate_getitem(self, parameters)
# 3.7-8
elif sys.version_info[:2] >= (3, 7):
    class _ConcatenateForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

        def __getitem__(self, parameters):
            return _concatenate_getitem(self, parameters)

    Concatenate = _ConcatenateForm(
        'Concatenate',
        doc="""Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
        higher order function which adds, removes or transforms parameters of a
        callable.

        For example::

           Callable[Concatenate[int, P], int]

        See PEP 612 for detailed information.
        """)
# 3.6
else:
    class _ConcatenateAliasMeta(typing.TypingMeta):
        """Metaclass for Concatenate."""

        def __repr__(self):
            return 'typing_extensions.Concatenate'

    class _ConcatenateAliasBase(typing._FinalTypingBase,
                                metaclass=_ConcatenateAliasMeta,
                                _root=True):
        """Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
        higher order function which adds, removes or transforms parameters of a
        callable.

        For example::

           Callable[Concatenate[int, P], int]

        See PEP 612 for detailed information.
        """
        __slots__ = ()

        def __instancecheck__(self, obj):
            raise TypeError("Concatenate cannot be used with isinstance().")

        def __subclasscheck__(self, cls):
            raise TypeError("Concatenate cannot be used with issubclass().")

        def __repr__(self):
            return 'typing_extensions.Concatenate'

        def __getitem__(self, parameters):
            return _concatenate_getitem(self, parameters)

    Concatenate = _ConcatenateAliasBase(_root=True)

# 3.10+
if hasattr(typing, 'TypeGuard'):
    TypeGuard = typing.TypeGuard
# 3.9
elif sys.version_info[:2] >= (3, 9):
    class _TypeGuardForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

    @_TypeGuardForm
    def TypeGuard(self, parameters):
        """Special typing form used to annotate the return type of a user-defined
        type guard function.  ``TypeGuard`` only accepts a single type argument.
        At runtime, functions marked this way should return a boolean.

        ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
        type checkers to determine a more precise type of an expression within a
        program's code flow.  Usually type narrowing is done by analyzing
        conditional code flow and applying the narrowing to a block of code.  The
        conditional expression here is sometimes referred to as a "type guard".

        Sometimes it would be convenient to use a user-defined boolean function
        as a type guard.  Such a function should use ``TypeGuard[...]`` as its
        return type to alert static type checkers to this intention.

        Using  ``-> TypeGuard`` tells the static type checker that for a given
        function:

        1. The return value is a boolean.
        2. If the return value is ``True``, the type of its argument
        is the type inside ``TypeGuard``.

        For example::

            def is_str(val: Union[str, float]):
                # "isinstance" type guard
                if isinstance(val, str):
                    # Type of ``val`` is narrowed to ``str``
                    ...
                else:
                    # Else, type of ``val`` is narrowed to ``float``.
                    ...

        Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
        form of ``TypeA`` (it can even be a wider form) and this may lead to
        type-unsafe results.  The main reason is to allow for things like
        narrowing ``List[object]`` to ``List[str]`` even though the latter is not
        a subtype of the former, since ``List`` is invariant.  The responsibility of
        writing type-safe type guards is left to the user.

        ``TypeGuard`` also works with type variables.  For more information, see
        PEP 647 (User-Defined Type Guards).
        """
        item = typing._type_check(parameters, f'{self} accepts only single type.')
        return typing._GenericAlias(self, (item,))
# 3.7-3.8
elif sys.version_info[:2] >= (3, 7):
    class _TypeGuardForm(typing._SpecialForm, _root=True):

        def __repr__(self):
            return 'typing_extensions.' + self._name

        def __getitem__(self, parameters):
            item = typing._type_check(parameters,
                                      f'{self._name} accepts only a single type')
            return typing._GenericAlias(self, (item,))

    TypeGuard = _TypeGuardForm(
        'TypeGuard',
        doc="""Special typing form used to annotate the return type of a user-defined
        type guard function.  ``TypeGuard`` only accepts a single type argument.
        At runtime, functions marked this way should return a boolean.

        ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
        type checkers to determine a more precise type of an expression within a
        program's code flow.  Usually type narrowing is done by analyzing
        conditional code flow and applying the narrowing to a block of code.  The
        conditional expression here is sometimes referred to as a "type guard".

        Sometimes it would be convenient to use a user-defined boolean function
        as a type guard.  Such a function should use ``TypeGuard[...]`` as its
        return type to alert static type checkers to this intention.

        Using  ``-> TypeGuard`` tells the static type checker that for a given
        function:

        1. The return value is a boolean.
        2. If the return value is ``True``, the type of its argument
        is the type inside ``TypeGuard``.

        For example::

            def is_str(val: Union[str, float]):
                # "isinstance" type guard
                if isinstance(val, str):
                    # Type of ``val`` is narrowed to ``str``
                    ...
                else:
                    # Else, type of ``val`` is narrowed to ``float``.
                    ...

        Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
        form of ``TypeA`` (it can even be a wider form) and this may lead to
        type-unsafe results.  The main reason is to allow for things like
        narrowing ``List[object]`` to ``List[str]`` even though the latter is not
        a subtype of the former, since ``List`` is invariant.  The responsibility of
        writing type-safe type guards is left to the user.

        ``TypeGuard`` also works with type variables.  For more information, see
        PEP 647 (User-Defined Type Guards).
        """)
# 3.6
else:
    class _TypeGuard(typing._FinalTypingBase, _root=True):
        """Special typing form used to annotate the return type of a user-defined
        type guard function.  ``TypeGuard`` only accepts a single type argument.
        At runtime, functions marked this way should return a boolean.

        ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
        type checkers to determine a more precise type of an expression within a
        program's code flow.  Usually type narrowing is done by analyzing
        conditional code flow and applying the narrowing to a block of code.  The
        conditional expression here is sometimes referred to as a "type guard".

        Sometimes it would be convenient to use a user-defined boolean function
        as a type guard.  Such a function should use ``TypeGuard[...]`` as its
        return type to alert static type checkers to this intention.

        Using  ``-> TypeGuard`` tells the static type checker that for a given
        function:

        1. The return value is a boolean.
        2. If the return value is ``True``, the type of its argument
        is the type inside ``TypeGuard``.

        For example::

            def is_str(val: Union[str, float]):
                # "isinstance" type guard
                if isinstance(val, str):
                    # Type of ``val`` is narrowed to ``str``
                    ...
                else:
                    # Else, type of ``val`` is narrowed to ``float``.
                    ...

        Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
        form of ``TypeA`` (it can even be a wider form) and this may lead to
        type-unsafe results.  The main reason is to allow for things like
        narrowing ``List[object]`` to ``List[str]`` even though the latter is not
        a subtype of the former, since ``List`` is invariant.  The responsibility of
        writing type-safe type guards is left to the user.

        ``TypeGuard`` also works with type variables.  For more information, see
        PEP 647 (User-Defined Type Guards).
        """

        __slots__ = ('__type__',)

        def __init__(self, tp=None, **kwds):
            self.__type__ = tp

        def __getitem__(self, item):
            cls = type(self)
            if self.__type__ is None:
                return cls(typing._type_check(item,
                           f'{cls.__name__[1:]} accepts only a single type.'),
                           _root=True)
            raise TypeError(f'{cls.__name__[1:]} cannot be further subscripted')

        def _eval_type(self, globalns, localns):
            new_tp = typing._eval_type(self.__type__, globalns, localns)
            if new_tp == self.__type__:
                return self
            return type(self)(new_tp, _root=True)

        def __repr__(self):
            r = super().__repr__()
            if self.__type__ is not None:
                r += f'[{typing._type_repr(self.__type__)}]'
            return r

        def __hash__(self):
            return hash((type(self).__name__, self.__type__))

        def __eq__(self, other):
            if not isinstance(other, _TypeGuard):
                return NotImplemented
            if self.__type__ is not None:
                return self.__type__ == other.__type__
            return self is other

    TypeGuard = _TypeGuard(_root=True)

if hasattr(typing, "Self"):
    Self = typing.Self
elif sys.version_info[:2] >= (3, 7):
    # Vendored from cpython typing._SpecialFrom
    class _SpecialForm(typing._Final, _root=True):
        __slots__ = ('_name', '__doc__', '_getitem')

        def __init__(self, getitem):
            self._getitem = getitem
            self._name = getitem.__name__
            self.__doc__ = getitem.__doc__

        def __getattr__(self, item):
            if item in {'__name__', '__qualname__'}:
                return self._name

            raise AttributeError(item)

        def __mro_entries__(self, bases):
            raise TypeError(f"Cannot subclass {self!r}")

        def __repr__(self):
            return f'typing_extensions.{self._name}'

        def __reduce__(self):
            return self._name

        def __call__(self, *args, **kwds):
            raise TypeError(f"Cannot instantiate {self!r}")

        def __or__(self, other):
            return typing.Union[self, other]

        def __ror__(self, other):
            return typing.Union[other, self]

        def __instancecheck__(self, obj):
            raise TypeError(f"{self} cannot be used with isinstance()")

        def __subclasscheck__(self, cls):
            raise TypeError(f"{self} cannot be used with issubclass()")

        @typing._tp_cache
        def __getitem__(self, parameters):
            return self._getitem(self, parameters)

    @_SpecialForm
    def Self(self, params):
        """Used to spell the type of "self" in classes.

        Example::

          from typing import Self

          class ReturnsSelf:
              def parse(self, data: bytes) -> Self:
                  ...
                  return self

        """

        raise TypeError(f"{self} is not subscriptable")
else:
    class _Self(typing._FinalTypingBase, _root=True):
        """Used to spell the type of "self" in classes.

        Example::

          from typing import Self

          class ReturnsSelf:
              def parse(self, data: bytes) -> Self:
                  ...
                  return self

        """

        __slots__ = ()

        def __instancecheck__(self, obj):
            raise TypeError(f"{self} cannot be used with isinstance().")

        def __subclasscheck__(self, cls):
            raise TypeError(f"{self} cannot be used with issubclass().")

    Self = _Self(_root=True)


if hasattr(typing, 'Required'):
    Required = typing.Required
    NotRequired = typing.NotRequired
elif sys.version_info[:2] >= (3, 9):
    class _ExtensionsSpecialForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

    @_ExtensionsSpecialForm
    def Required(self, parameters):
        """A special typing construct to mark a key of a total=False TypedDict
        as required. For example:

            class Movie(TypedDict, total=False):
                title: Required[str]
                year: int

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )

        There is no runtime checking that a required key is actually provided
        when instantiating a related TypedDict.
        """
        item = typing._type_check(parameters, f'{self._name} accepts only single type')
        return typing._GenericAlias(self, (item,))

    @_ExtensionsSpecialForm
    def NotRequired(self, parameters):
        """A special typing construct to mark a key of a TypedDict as
        potentially missing. For example:

            class Movie(TypedDict):
                title: str
                year: NotRequired[int]

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
        """
        item = typing._type_check(parameters, f'{self._name} accepts only single type')
        return typing._GenericAlias(self, (item,))

elif sys.version_info[:2] >= (3, 7):
    class _RequiredForm(typing._SpecialForm, _root=True):
        def __repr__(self):
            return 'typing_extensions.' + self._name

        def __getitem__(self, parameters):
            item = typing._type_check(parameters,
                                      '{} accepts only single type'.format(self._name))
            return typing._GenericAlias(self, (item,))

    Required = _RequiredForm(
        'Required',
        doc="""A special typing construct to mark a key of a total=False TypedDict
        as required. For example:

            class Movie(TypedDict, total=False):
                title: Required[str]
                year: int

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )

        There is no runtime checking that a required key is actually provided
        when instantiating a related TypedDict.
        """)
    NotRequired = _RequiredForm(
        'NotRequired',
        doc="""A special typing construct to mark a key of a TypedDict as
        potentially missing. For example:

            class Movie(TypedDict):
                title: str
                year: NotRequired[int]

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
        """)
else:
    # NOTE: Modeled after _Final's implementation when _FinalTypingBase available
    class _MaybeRequired(typing._FinalTypingBase, _root=True):
        __slots__ = ('__type__',)

        def __init__(self, tp=None, **kwds):
            self.__type__ = tp

        def __getitem__(self, item):
            cls = type(self)
            if self.__type__ is None:
                return cls(typing._type_check(item,
                           '{} accepts only single type.'.format(cls.__name__[1:])),
                           _root=True)
            raise TypeError('{} cannot be further subscripted'
                            .format(cls.__name__[1:]))

        def _eval_type(self, globalns, localns):
            new_tp = typing._eval_type(self.__type__, globalns, localns)
            if new_tp == self.__type__:
                return self
            return type(self)(new_tp, _root=True)

        def __repr__(self):
            r = super().__repr__()
            if self.__type__ is not None:
                r += '[{}]'.format(typing._type_repr(self.__type__))
            return r

        def __hash__(self):
            return hash((type(self).__name__, self.__type__))

        def __eq__(self, other):
            if not isinstance(other, type(self)):
                return NotImplemented
            if self.__type__ is not None:
                return self.__type__ == other.__type__
            return self is other

    class _Required(_MaybeRequired, _root=True):
        """A special typing construct to mark a key of a total=False TypedDict
        as required. For example:

            class Movie(TypedDict, total=False):
                title: Required[str]
                year: int

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )

        There is no runtime checking that a required key is actually provided
        when instantiating a related TypedDict.
        """

    class _NotRequired(_MaybeRequired, _root=True):
        """A special typing construct to mark a key of a TypedDict as
        potentially missing. For example:

            class Movie(TypedDict):
                title: str
                year: NotRequired[int]

            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
        """

    Required = _Required(_root=True)
    NotRequired = _NotRequired(_root=True)
PK!:@@5_vendor/packaging/__pycache__/markers.cpython-311.pycnu[

,Re-!	UddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZddlmZmZgdZeeegefZGddeZGd	d
eZ GddeZ!Gd
dZ"Gdde"Z#Gdde"Z$Gdde"Z%ededzedzedzedzedzedzedzedzedzedzed zed!zed"zed#zed$zed%zed&zZ&ddddddd'Z'e&(d(ed)ed*zed+zed,zed-zed.zed/zed0zZ)e)ed1zed2zZ*e*(d3ed4ed5zZ+e+(d6ed7ed8zZ,e&e+zZ-ee-e*ze-zZ.e.(d9ed:/Z0ed;/Z1e
Z2e.ee0e2ze1zzZ3e2e3ee,e2zzzee2zezZ4dZ5	dYd@eeee
e"dAfefdBe	ed=efdCZ6dDdEej7ej8ej9ej:ej;ej<dFZ=eeefe>dG<dHedIe%dJed=efdKZ?GdLdMZ@e@ZAdNeeefdOed=efdPZBdQeedNeeefd=efdRZCdSdTd=efdUZDd=eeeffdVZEGdWdXZFdS)ZN)AnyCallableDictListOptionalTupleUnion)	ForwardGroupLiteralParseExceptionParseResultsQuotedString
ZeroOrMore	stringEndstringStart)InvalidSpecifier	Specifier)
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentceZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/markers.pyrr$r"rceZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    Nrr!r"r#rr*r$r"rceZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    Nrr!r"r#rr0sr"rcBeZdZdeddfdZdefdZdefdZdefdZdS)NodevaluereturnNc||_dSN)r))selfr)s  r#__init__z
Node.__init__8s



r"c*t|jSr,)strr)r-s r#__str__zNode.__str__;s4:r"c(d|jjd|dS)N)	__class__rr1s r#__repr__z
Node.__repr__>s 74>*77d7777r"ctr,)NotImplementedErrorr1s r#	serializezNode.serializeAs!!r")	rrrrr.r0r2r7r:r!r"r#r(r(7scd8#8888"3""""""r"r(ceZdZdefdZdS)Variabler*c t|Sr,r0r1s r#r:zVariable.serializeF4yyr"Nrrrr0r:r!r"r#r<r<E/3r"r<ceZdZdefdZdS)Valuer*cd|dS)N"r!r1s r#r:zValue.serializeKs4{{{r"Nr@r!r"r#rCrCJs/3r"rCceZdZdefdZdS)Opr*c t|Sr,r>r1s r#r:zOp.serializePr?r"Nr@r!r"r#rGrGOrAr"rGimplementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_nameos.namesys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationextra)rTrUrVrWrXrYcjtt|d|dSNr)r<ALIASESgetslts   r#rcps$QqT1Q41H1H(I(Ir"z=====>=<=!=z~=>r4not ininc,t|dSr\)rGr_s   r#rcrcwsAaDr"'rEc,t|dSr\)rCr_s   r#rcrczsE!A$KKr"andorc,t|dSr\)tupler_s   r#rcrcs51;;r"()resultsr*cHt|trd|DS|S)Nc,g|]}t|Sr!)_coerce_parse_result).0is  r#
z(_coerce_parse_result..s!999A$Q''999r")
isinstancer)rts r#rwrws-'<((999999r"Tmarker.firstct|tttfsJt|trJt	|dkr7t|dttfrt|dSt|tr>d|D}|rd|Sdd|zdzSt|trdd|DS|S)Nrrc38K|]}t|dVdS)F)r}N)_format_markerrxms  r#	z!_format_marker..s/@@A///@@@@@@r" rrrsc6g|]}|Sr!)r:rs  r#rzz"_format_marker..s 7771777r")r{listrqr0lenrjoin)r|r}inners   r#rrsftUC011111	64  )KK1vay4-00
fQi(((&$	@@@@@	/88E??"%(3..	FE	"	"xx77777888
r"c
||vSr,r!lhsrhss  r#rcrcs
3#:r"c
||vSr,r!rs  r#rcrcs
s#~r")rjrir4rfrdrgrerh
_operatorsroprc	`	td||g}||S#t$rYnwxYwt
|}|td|d|d|d|||S)Nz
Undefined z on z and .)rrr:containsrrr^r)rrrspecopers     r#_eval_oprs"",,..#!67788}}S!!!



 *~~bllnn==D|!"Mr"M"M"M"MS"M"M"MNNN4S>>s6A

AAceZdZdS)	UndefinedN)rrrr!r"r#rrsDr"renvironmentnamec||t}t|trt	|d|S)Nz* does not exist in evaluation environment.)r^
_undefinedr{rr)rrr)s   r#_get_envrsL#.??4#D#DE%##
&AAA

	
Lr"markerscxgg}|D]}t|tttfsJt|tr*|dt||ft|tr|\}}}t|trt||j}|j}n|j}t||j}|dt||||dvsJ|dkr|gtd|DS)N)rnroroc34K|]}t|VdSr,)all)rxitems  r#rz$_evaluate_markers..s(,,Ts4yy,,,,,,r")r{rrqr0append_evaluate_markersr<rr)rany)	rrgroupsr|rrr	lhs_value	rhs_values	         r#rrs? "tF""&4"455555fd##	"2J/DDEEEE

&
&	"!LCS#x((
=$[#)<<	I		I	$[#)<<	2Jhy"i@@AAAA]****~~

b!!!,,V,,,,,,r"infozsys._version_infocd|}|j}|dkr ||dt|jzz
}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)formatreleaselevelr0serial)rversionkinds   r#format_full_versionrsH-44T::GDw47S----Nr"cttjj}tjj}||t
jt
jt
jt
j	t
jt
j
t
jdt
j
ddtjdS)Nr)rKrIrSrOrMrPrNrLrJrQrR)rsysimplementationrrosplatformmachinereleasesystemrQrYrpython_version_tuple)iverrKs  r#rrss19::D,12"&7$,..$,..#?,,$,..'688*2*H*J*J((8#@#B#B2A2#FGGr"cdeZdZdeddfdZdefdZdefdZd	deeeefde	fdZ
dS)
rr|r*Nc
	tt||_dS#t$r/}td|d||j|jdzd}~wwxYw)NzInvalid marker: z, parse error at )rwMARKERparseString_markersr
rloc)r-r|es   r#r.zMarker.__init__s	01C1CF1K1KLLDMMM			1611!%!%!)+,11
	s,0
A)*A$$A)c*t|jSr,)rrr1s r#r2zMarker.__str__sdm,,,r"cd|dS)Nz	rs
				



DDDDDDDDDDDDDDDDDD





















43333333S#J$%J*z""""""""t
D
Aa())*aaa	
aa
aaa	a	ll
a	llaa
aa())* a  !!"ajj#	*"**&F=
	IIJJJAeHHqqww4 11T77*QQtWW4qqww>3G!!C&&P
!!H++%$/		11222|C  <<#4#4477888	
5AAdGG	

$
eJ*Z78866777	
3			
3		giiEE&;"6"?@@@{ZZ(<=====	{	"Y	.%d3i(?"@T#YNR$s)U49-s23e+ee0ze>e=zzZ?ee?zezZ@e@AdGddZBdS) N)ListOptionalSet)
CombineLiteralrParseExceptionRegexWord
ZeroOrMoreoriginalTextFor	stringEndstringStart)MARKER_EXPRMarker)LegacySpecifier	SpecifierSpecifierSetceZdZdZdS)InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/requirements.pyrrsrr[](),;@z-_.namez[^ ]+urlextrasF)
joinStringadjacent	_raw_specc|jpdS)N)r*slts   rr1@s
Q[->Br	specifierc|dS)Nrrr-s   rr1r1Cs
AaDrmarkercDt||j|jS)N)r_original_start
_original_endr-s   rr1r1GsF1Q.@ABBrzx[]c:eZdZdZdeddfdZdefdZdefdZdS)RequirementzParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    requirement_stringreturnNc	t|}nA#t$r4}td||j|jdzd|jd}~wwxYw|j|_|jrtj	
|j}|jdkr8tj	||jkrtdn3|jr|j
r|js|j
std|j|j|_nd|_t|jr|jng|_t#|j|_|jr|jnd|_dS)NzParse error at "z": filezInvalid URL givenz
Invalid URL: )REQUIREMENTparseStringrrlocmsgr%r&urllibparseurlparsescheme
urlunparsenetlocsetr'asListrr2r4)selfr:reqe
parsed_urls     r__init__zRequirement.__init__ds	))*<==CC			$W$6ququqy7H$IWWPQPUWW
	
	7	..sw77J F**<**:66#'AA,-@AAAB '
DJ,=
D%
D.8.?
D))B)B)BCCC'*wDHHDH #3:$MCJ$5$5$7$7$72 N N'3CM'B'B7:z)Kts
A/AAc|jg}|jr@dt|j}|d|d|jr'|t
|j|jr9|d|j|jr|d|jr|d|jd|S)Nr"rrz@  z; r,)	r%r'joinsortedappendr2strr&r4)rKpartsformatted_extrass   r__str__zRequirement.__str__}s I;;	2"xxt{(;(;<<LL0-000111>	.LLT^,,---8	"LLdh))){
"S!!!;	-LL+dk++,,,wwu~~rcd|dS)Nzr)rKs r__repr__zRequirement.__repr__s)))))r)rrrrrUrOrXrZrrrr9r9Ws|L3L4LLLL2(*#******rr9)Crestringurllib.parserCtypingrr	TOptionalrsetuptools.extern.pyparsingrrLrr	r
rrr
rmarkersrr
specifiersrrr
ValueErrorr
ascii_lettersdigitsALPHANUMsuppressLBRACKETRBRACKETLPARENRPARENCOMMA	SEMICOLONATPUNCTUATIONIDENTIFIER_END
IDENTIFIERNAMEEXTRAURIURLEXTRAS_LISTEXTRAS
_regex_strVERBOSE
IGNORECASEVERSION_PEP440VERSION_LEGACYVERSION_ONEVERSION_MANY
_VERSION_SPECsetParseActionVERSION_SPECMARKER_SEPARATORMARKERVERSION_AND_MARKERURL_AND_MARKERNAMED_REQUIREMENTr?r@r9rrrrsj

			



3333333333)(((((((@@@@@@@@@@4$v}4551S66??1S66??	
3			
3			#
AcFFOO	QsVV__d5kkZZ44x?@
WX

> : ::
;
;
z&eeHooe3hjj///
5(XXk**
*X
5x	@	@y+RZ"--GHH12:
3MNN~-ww**U[0111cE
&</&8LHII

>>???-}--k::00111,ookkmm,,X66BB	K	'!HHV$4$44xx'''88F+++~@R/RS--	9;*;*;*;*;*;*;*;*;*;*rPK!s7_vendor/packaging/__pycache__/__about__.cpython-311.pycnu[

,Re4gdZdZdZdZdZdZdZdZdezZd	S)
)	__title____summary____uri____version__
__author__	__email____license__
__copyright__	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz21.3z)Donald Stufft and individual contributorszdonald@stufft.iozBSD-2-Clause or Apache-2.0z2014-2019 %sN)	__all__rrrrrrrr	/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/__about__.pyrsI
			
	2
-
8
	*+


r
PK!}uu6_vendor/packaging/__pycache__/__init__.cpython-311.pycnu[

,Re6ddlmZmZmZmZmZmZmZmZgdZ	dS))
__author__
__copyright__	__email____license____summary__	__title____uri____version__)rrr	r
rrrrN)
	__about__rrrrrrr	r
__all__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/__init__.pyrs~
																							rPK!٧9_vendor/packaging/__pycache__/_structures.cpython-311.pycnu[

,RebGddZeZGddZeZdS)ceZdZdefdZdefdZdedefdZ	dedefdZ
dedefdZdedefdZdedefd	Z
d
eddfdZd
S)InfinityTypereturncdS)NInfinityselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/_structures.py__repr__zInfinityType.__repr__szc:tt|SNhashreprrs r
__hash__zInfinityType.__hash__
DJJrothercdSNFrr	rs  r
__lt__zInfinityType.__lt__
urcdSrrrs  r
__le__zInfinityType.__le__rrc,t||jSr
isinstance	__class__rs  r
__eq__zInfinityType.__eq__%000rcdSNTrrs  r
__gt__zInfinityType.__gt__trcdSr#rrs  r
__ge__zInfinityType.__ge__r%rr	NegativeInfinityTypectSr)NegativeInfinityrs r
__neg__zInfinityType.__neg__srN)__name__
__module____qualname__strrintrobjectboolrrr r$r'r+rrr
rrs# #    FtFt1F1t1111FtFt f !7      rrceZdZdefdZdefdZdedefdZ	dedefdZ
dedefdZdedefdZdedefd	Z
d
edefdZdS)
r(rcdS)Nz	-Infinityrrs r
rzNegativeInfinityType.__repr__$s{rc:tt|Srrrs r
rzNegativeInfinityType.__hash__'rrrcdSr#rrs  r
rzNegativeInfinityType.__lt__*r%rcdSr#rrs  r
rzNegativeInfinityType.__le__-r%rc,t||jSrrrs  r
r zNegativeInfinityType.__eq__0r!rcdSrrrs  r
r$zNegativeInfinityType.__gt__3rrcdSrrrs  r
r'zNegativeInfinityType.__ge__6rrr	ctSr)rrs r
r+zNegativeInfinityType.__neg__9srN)r,r-r.r/rr0rr1r2rrr r$r'rr+rrr
r(r(#s# #    FtFt1F1t1111FtFtfrr(N)rrr(r*rrr
r<sy        4<>>4('))rPK!}]]3_vendor/packaging/__pycache__/utils.cpython-311.pycnu[

,Reh	ddlZddlmZmZmZmZmZddlmZm	Z	ddl
mZmZeedee
effZedeZGdd	eZGd
deZejdZejd
ZdedefdZdeeefdefdZdedeeeeeeffdZdedeeeffdZdS)N)	FrozenSetNewTypeTupleUnioncast)Tag	parse_tag)InvalidVersionVersionNormalizedNameceZdZdZdS)InvalidWheelFilenamezM
    An invalid wheel filename was found, users should refer to PEP 427.
    N__name__
__module____qualname____doc__r
/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/utils.pyrrrrceZdZdZdS)InvalidSdistFilenamez^
    An invalid sdist filename was found, users should refer to the packaging user guide.
    Nrr
rrrrrrrz[-_.]+z	(\d+)(.*)namereturnctd|}tt|S)N-)_canonicalize_regexsublowerrr)rvalues  rcanonicalize_namer# s3##C..4466E&&&rversionc
t|tr#	t|}n#t$r|cYSwxYw|}g}|jdkr||jd|t
jdddd|j	D|j
7|dd|j
D|j|d	|j|j|d
|j|j
|d|j
d|S)z
    This is very similar to Version.__str__, but has one subtle difference
    with the way it handles the release segment.
    r!z(\.0)+$.c34K|]}t|VdSNstr.0xs  r	z'canonicalize_version..<s(0P0PAQ0P0P0P0P0P0PrNc34K|]}t|VdSr*r+r-s  rr0z'canonicalize_version..@s(88SVV888888rz.postz.dev+)
isinstancer,rrepochappendrer joinreleaseprepostdevlocal)r$parsedpartss   rcanonicalize_versionr?&s
'3	W%%FF			NNN	E|q
'''(((
LL
B0P0P0P0P0P(P(PQQRRRz
RWW88VZ88888999{
*V[**+++z
(FJ(()))|
'''(((
775>>s'66filenamec|dstd||dd}|d}|dvrtd||d|dz
}|d}d	|vs t	jd
|tjtd|t|}t|d}|d
kr|d}t|}|td|d|dttt|
d|
df}nd}t|d}	||||	fS)Nz.whlz3Invalid wheel filename (extension must be '.whl'): r)z0Invalid wheel filename (wrong number of parts): r__z^[\w\d._]*$zInvalid project name: rrDzInvalid build number: z in ''r
)endswithrcountsplitr6matchUNICODEr#r_build_tag_regexrBuildTagintgroupr
)
r@dashesr>	name_partrr$
build_partbuild_matchbuildtagss
          rparse_wheel_filenamerXQsV$$
"L(LL

	
}H
^^C
 
 F
V"IxII

	

NN3
++EaIyBH^Y
KKS"#FH#F#FGGGY''DeAhG
{{1X
&,,Z88&EEE(EEE
XK$5$5a$8$8 9 9;;L;LQ;O;OPQQU2YD'5$''rc||dr|dtd}n@|dr|dtd}ntd||d\}}}|std|t	|}t|}||fS)Nz.tar.gzz.zipz@Invalid sdist filename (extension must be '.tar.gz' or '.zip'): rzInvalid sdist filename: )rIlenr
rpartitionr#r)r@	file_stemrSsepversion_partrr$s       rparse_sdist_filenamer_us##
.I./					6	"	"
^F|^,		"




	
$-#7#7#<#< IsLJ"#Hh#H#HIIIY''Dl##G'?r)r6typingrrrrrrWr	r
r$rrrPr,rOr
ValueErrorrrcompilerrNr#r?rXr_r
rrrcs

			99999999999999        ,,,,,,,,rE#s(O+,)3//::!bj++2:l++'C'N''''(%"5(#((((V!(!(
>7Hin<=!(!(!(!(H351H+IrPK!6SS2_vendor/packaging/__pycache__/tags.cpython-311.pycnu[

,ReS=
$UddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZmZejeZe
eZeeefZdddd	d
dZeeefed<ejd
kZGddZdedeefdZ d4dede!deeedffdZ"dedefdZ#dede!fdZ$d4dede!deefdZ%			d5dddeedee	edee	ede!de
ef
d Z&de
efd!Z'			d5ddd"eedee	edee	ede!de
ef
d#Z(dede
efd$Z)			d5deed"eedee	ede
efd%Z*efd&ed'e!defd(Z+d)ed*edeefd+Z,	d6d)eed&eede
efd,Z-efd'e!de
efd-Z.de
efd.Z/de
efd/Z0defd0Z1ddde!defd1Z2d)edefd2Z3ddde!de
efd3Z4dS)7N)EXTENSION_SUFFIXES)
Dict	FrozenSetIterableIteratorListOptionalSequenceTupleUnioncast)
_manylinux
_musllinuxpycpppipjy)pythoncpythonpypy
ironpythonjythonINTERPRETER_SHORT_NAMESlceZdZdZgdZdedededdfdZedefd	Zedefd
Z	edefdZ
dedefd
Z
defdZdefdZdefdZdS)Tagz
    A representation of the tag triple for a wheel.

    Instances are considered immutable and thus are hashable. Equality checking
    is also supported.
    )_interpreter_abi	_platform_hashinterpreterabiplatformreturnNc||_||_|j|_t	|j|j|jf|_dSN)lowerrrr hashr!)selfr"r#r$s    /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/tags.py__init__zTag.__init__4sY'--//IIKK	'))4,diHII


c|jSr')rr*s r+r"zTag.interpreter?s  r-c|jSr')rr/s r+r#zTag.abiCs
yr-c|jSr')r r/s r+r$zTag.platformGs
~r-otherct|tstS|j|jko/|j|jko|j|jko|j|jkSr')
isinstancerNotImplementedr!r rr)r*r2s  r+__eq__z
Tag.__eq__Ksd%%%	"!!Z5;
&
:5?2
:ej(
:"e&88		
r-c|jSr')r!r/s r+__hash__zTag.__hash__Vs
zr-c4|jd|jd|jS)N-)rrr r/s r+__str__zTag.__str__Ys%#BBdiBB$.BBBr-c.d|dt|dS)N)idr/s r+__repr__zTag.__repr__\s!'4''BtHH''''r-)__name__
__module____qualname____doc__	__slots__strr,propertyr"r#r$objectboolr6intr8r;r@r-r+rr*sP?>>I	JC	Jc	JS	JT	J	J	J	J!S!!!X!SX#X	
F	
t	
	
	
	
#CCCCC(#((((((r-rtagr%c
Ft}|d\}}}|dD]V}|dD]>}|dD]&}|t|||'?Wt	|S)z
    Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.

    Returning a set is required due to the possibility that the tag is a
    compressed tag set.
    r:.)setsplitaddr	frozenset)rLtagsinterpretersabis	platformsr"r#	platform_s        r+	parse_tagrX`s55D$'IIcNN!L$	#))#..;;::c??	;	;C&__S11
;
;	[#y99::::
;	;T??r-Fnamewarncltj|}||rtd||S)Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)	sysconfigget_config_varloggerdebug)rYrZvalues   r+_get_config_varraps=$T**E}}Ld	
	
	
Lr-stringcV|ddddS)NrN_r:)replace)rbs r+_normalize_stringrfys&>>#s##++C555r-python_versioncNt|dkot|dkS)zj
    Determine if the Python version supports abi3.

    PEP 384 was first implemented in Python 3.2.
    r))lentuple)rgs r+
_abi3_appliesrm}s)~"Fu^'<'<'FFr-
py_versionc	t|}g}t|dd}dx}x}}td|}ttd}dt
v}	|s||s|	rd}|dkrGtd|}
|
s|
d	}|d
kr*td|}|dks|tjd
krd}n|r|d||dd	|||||S)NrjPy_DEBUGgettotalrefcountz_d.pydd)ri
WITH_PYMALLOCm)ririPy_UNICODE_SIZEiurrz"cp{version}{debug}{pymalloc}{ucs4})versionr_pymallocucs4)
rl_version_nodotrahasattrsysr
maxunicodeappendinsertformat)rnrZrUrzr_r{r|
with_debughas_refcounthas_ext
with_pymallocunicode_sizes            r+
_cpython_abisrsMz""J
DZ^,,G  E Ht T22J3 233L,,Gj(l(g(F'>>
	M1H*+--
    - cp-abi3-
    - cp-none-
    - cp-abi3-  # Older Python versions down to 3.2.

    If python_version only specifies a major version then user-provided ABIs and
    the 'none' ABItag will be used.

    If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
    their normal position and not at the beginning.
    Nrjrr)abi3nonec3:K|]}td|VdS)rNr.0rWr"s  r+	zcpython_tags..s/SSICVY77SSSSSSr-c3:K|]}td|VdS)rNrrs  r+rzcpython_tags..s/OO	K33OOOOOOr-zcp{version}rrzr)
rversion_infor}rkrlistremove
ValueError
platform_tagsrrmranger)	rgrUrVrZexplicit_abir#rW
minor_versionr"s	        @r+cpython_tagsrs*,.)"1"-;~nRaR&899;;K|~"" 66DDD::D(	KK%%%%			D	Y1-//22I33"	3	3Ik3	222222	3^$$TSSSSSSSSSSSSSSOOOOYOOOOOOOOOO^$$:">!#4q#8!R@@	:	:M&
:
:	+22*N1,=}+MNN3+vy999999	
:::	:	:s0B
BBc#\Ktjd}|rt|VdSdS)NSOABI)r\r]rf)r#s r+_generic_abirsB

"7
+
+C
%$$$$$$$%%r-r"c#\K|s5t}t|}d||g}|t}t	|p
t}t	|}d|vr|d|D]}|D]}t|||VdS)z
    Yields the tags for a generic interpreter.

    The tags consist of:
    - --

    The "none" ABI will be added if it was not explicitly provided.
    rrpNr)interpreter_nameinterpreter_versionjoinrrrrr)r"rUrVrZinterp_nameinterp_versionr#rWs        r+generic_tagsrs=&((,$777gg{N;<<|~~Y1-//22I::D
TF33"	3	3Ik3	222222	333r-c#Kt|dkrdt|ddVd|dVt|dkr9t|ddz
ddD] }dt|d|fVdSdS)z
    Yields Python versions in descending order.

    After the latest version, the major-only version will be yielded, and then
    all previous versions of that major version.
    rrNrjrr)rkr}r)rnminors  r+_py_interpreter_rangers:3>*RaR.1133333
z!}


::a=1,b"55	@	@E?~z!}e&<==??????	@	@r-c#8K|stjdd}t|p
t}t	|D]}|D]}t|d|V|rt|ddVt	|D]}t|ddVdS)z
    Yields the sequence of tags that are compatible with a specific version of Python.

    The tags consist of:
    - py*-none-
    - -none-any  # ... if `interpreter` is provided.
    - py*-none-any
    Nrjrany)rrrrrr)rgr"rVrzrWs     r+compatible_tagsrs.)"1"-Y1-//22I(8822"	2	2Igvy111111	2.+vu-----(88**'65))))))**r-archis_32bitc<|s|S|drdSdS)Nppci386)
startswith)rrs  r+	_mac_archr/s-uu6r-rzcpu_archc|g}|dkr |dkrgS|gdnu|dkr |dkrgS|gdnO|dkr$|dks|dkrgS|dn%|d	kr|d
krgS|ddg|d
vr|d|dvr|d|S)Nx86_64)
rx)intelfat64fat32r)rrfatppc64)rrr)rrr>arm64r
universal2>rrrrr	universal)extendr)rzrformatss   r+_mac_binary_formatsr9s$jG8WI2223333	V		WI0001111	W		W' 1 1Iw	U		WI'(((&&&|$$$>>>{###Nr-c#Ktj\}}}|Ltdtt	t
|ddd}n|}|t|}n|}d|krS|dkrMt|dddD]5}d	|f}t||}|D]}d

d	||V6|dkrMt|dd	dD]5}	|	df}t||}|D]}d

|	d|V6|dkr|d
krUtdddD]A}d	|f}t||}|D](}d

|d|d|V)BdStdddD]0}d	|f}d}d

|d|d|V/dSdS)aD
    Yields the platform tags for a macOS system.

    The `version` parameter is a two-item tuple specifying the macOS version to
    generate platform tags for. The `arch` parameter is the CPU architecture to
    generate platform tags for. Both parameters default to the appropriate value
    for the current system.
    N
MacVersionrNrj)rr)rrrrz&macosx_{major}_{minor}_{binary_format})majorr
binary_formatrrrir)r$mac_verr
rlmaprJrPrrrr)
rzrversion_strrdrrcompat_versionbinary_formatsr
major_versions
          r+
mac_platformsrYs (/11KH|U3sK4E4Ec4J4J2A24N+O+O%P%PQQ|""'g//#71:r266		M.N0FFN!/


>EEMF

'#71:r266		M*A-N0FFN!/


>EE'q
F

'8!&r1b!1!1


!#]!2!4^T!J!J%3MBII,Q/,Q/&3J

"'r1b!1!1


!#]!2 ,
>EE(+(+"/F-&

r-c#Kttj}|r|dkrd}n|dkrd}|dd\}}t	j||Ed{Vt
j|Ed{V|VdS)Nlinux_x86_64
linux_i686
linux_aarch64linux_armv7lrdr)rfr\get_platformrPrrr)rlinuxrdrs    r+_linux_platformsrsi46677E#N"" EE
o
%
%"Ekk#q!!GAt't444444444'---------
KKKKKr-c#NKttjVdSr')rfr\rrKr-r+_generic_platformsrs)
I244
5
555555r-ctjdkrtStjdkrtSt	S)z;
    Provides the platform tags for this installation.
    DarwinLinux)r$systemrrrrKr-r+rrsLH$$			g	%	%!!!!###r-c\tjj}t|p|S)z6
    Returns the name of the running interpreter.
    )rimplementationrYrget)rYs r+rrs("D"&&t,,44r-ctd|}|rt|}n!ttjdd}|S)z9
    Returns the version of the running interpreter.
    py_version_nodotrNrj)rarFr}rr)rZrzs  r+rrsJ0t<<>!!!!!!!d"u555555555555"$$$$$$$$$$$r-)F)NNN)NN)5loggingr$rr\importlib.machineryrtypingrrrrrr	r
rrr
rprr	getLoggerrAr^rJ
PythonVersionrrrF__annotations__maxsize_32_BIT_INTERPRETERrrXrIrarfrmrrrrrrrrrrrrrrr}rrKr-r+rs




222222%$$$$$$$		8	$	$


38_
++c3hkW,3(3(3(3(3(3(3(3(l
3
9S>



 #TeCdN6K6c6c6666G-GDGGGG!!m!4!DI!!!!J/3$()-6:
6:6:6:]+6:
8C=
!6:
&6:
6:c]
6:6:6:6:r%hsm%%%%"&$()-3
333#3
8C=
!3
&3
3c]
3333<@m@
@@@@ /3!%)-**]+*#*
&*c]	****2+>C4#stCyBAEEE
j
!E08
E
c]EEEEP':

t
hsm



6HSM6666	$x}	$	$	$	$5#5555).				#				&M&c&&&&#%%%d%x}%%%%%%r-PK!:HUU5_vendor/packaging/__pycache__/version.cpython-311.pycnu[

,ReI9ddlZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZddlm
Z
mZmZmZgdZeeefZeee
eeffZeeeefZeee
eee
eefe
eeffdffZe
ee
edfeeeefZe
ee
edffZeeeefeeefgefZejdgdZd	ed
edfdZGd
deZ GddZ!Gdde!Z"ej#dej$Z%ddddddZ&ded
eefdZ'd	ed
efdZ(dZ)Gdde!Z*dedeee+e	fd
ee
eeffd Z,ej#d!Z-d"ed
eefd#Z.d$ed%e
edfd&ee
eefd'ee
eefd(ee
eefd"ee
ed
efd)Z/dS)*N)CallableIteratorListOptionalSupportsIntTupleUnion)InfinityInfinityTypeNegativeInfinityNegativeInfinityType)parseVersion
LegacyVersionInvalidVersionVERSION_PATTERN._Version)epochreleasedevprepostlocalversionreturn)rrc`	t|S#t$rt|cYSwxYw)z
    Parse the given version string and return either a :class:`Version` object
    or a :class:`LegacyVersion` object depending on if the given version is
    a valid PEP 440 version or a legacy version.
    )rrr)rs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/version.pyrr*sD&w&&&W%%%%%&s--ceZdZdZdS)rzF
    An invalid version was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rrr6sr%rceZdZUeeefed<defdZddde	fdZ
ddde	fdZdede	fdZ
ddde	fdZddde	fd	Zdede	fd
ZdS)_BaseVersion_keyrc*t|jSN)hashr(selfs r__hash__z_BaseVersion.__hash__?sDIr%othercZt|tstS|j|jkSr*
isinstancer'NotImplementedr(r-r/s  r__lt__z_BaseVersion.__lt__E)%..	"!!y5:%%r%cZt|tstS|j|jkSr*r1r4s  r__le__z_BaseVersion.__le__K)%..	"!!yEJ&&r%cZt|tstS|j|jkSr*r1r4s  r__eq__z_BaseVersion.__eq__Qr9r%cZt|tstS|j|jkSr*r1r4s  r__ge__z_BaseVersion.__ge__Wr9r%cZt|tstS|j|jkSr*r1r4s  r__gt__z_BaseVersion.__gt__]r6r%cZt|tstS|j|jkSr*r1r4s  r__ne__z_BaseVersion.__ne__cr9r%N)r r!r"r	CmpKeyLegacyCmpKey__annotations__intr.boolr5r8objectr;r=r?rAr$r%rr'r'<s
$
%%%%#&N&t&&&&'N't'''''F't'''''N't''''&N&t&&&&'F't''''''r%r'cVeZdZdeddfdZdefdZdefdZedefdZedefdZ	ede
fd	Zedd
ZeddZ
eddZedd
ZeddZedefdZedefdZedefdZdS)rrrNct||_t|j|_t	jdtdS)NzZCreating a LegacyVersion has been deprecated and will be removed in the next major release)str_version_legacy_cmpkeyr(warningswarnDeprecationWarning)r-rs  r__init__zLegacyVersion.__init__ksFG
"4=11	

0	
	
	
	
	
r%c|jSr*rKr,s r__str__zLegacyVersion.__str__us
}r%cd|dS)Nzr$r,s r__repr__zLegacyVersion.__repr__xs+$++++r%c|jSr*rRr,s rpubliczLegacyVersion.public{
}r%c|jSr*rRr,s rbase_versionzLegacyVersion.base_versionrYr%cdS)Nr$r,s rrzLegacyVersion.epochsrr%cdSr*r$r,s rrzLegacyVersion.releasetr%cdSr*r$r,s rrzLegacyVersion.prer_r%cdSr*r$r,s rrzLegacyVersion.postr_r%cdSr*r$r,s rrzLegacyVersion.devr_r%cdSr*r$r,s rrzLegacyVersion.localr_r%cdSNFr$r,s r
is_prereleasezLegacyVersion.is_prereleaseur%cdSrer$r,s ris_postreleasezLegacyVersion.is_postreleasergr%cdSrer$r,s r
is_devreleasezLegacyVersion.is_devreleasergr%)rN)r r!r"rJrPrSrVpropertyrXr[rErrrrrrrFrfrirkr$r%rrrjs





,#,,,,XcXsXXXXXXtXXtXr%rz(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrsc#Kt|D]Q}t||}|r|dkr&|dddvr|dVJd|zVRdVdS)N.r

0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)rrparts  r_parse_version_partsrs,22155

.224>>	ts{{8|##**Q--*NNNNNr%cd}g}t|D]}|drf|dkr0|r.|ddkr"||r|ddk"|r.|ddkr"||r|ddk"|||t|fS)Nr]rwrxz*final-00000000)rlower
startswithpopappendtuple)rrpartsr~s    rrLrLs
EE$W]]__55??3	h b	Y 6 6IIKKK b	Y 6 6
E"I33		
E"I33	T%,,r%a
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
cVeZdZejdezdzejejzZde	ddfdZ
de	fdZde	fdZe
defd	Ze
deed
ffdZe
deee	effdZe
deefd
Ze
deefdZe
dee	fdZe
de	fdZe
de	fdZe
defdZe
defdZe
defdZe
defdZe
defdZe
defdZdS)rz^\s*z\s*$rrNc|j|}|std|dt|dr"t|dndt
d|ddDt|d|d	t|d
|dp|dt|d
|dt|d|_
t|j
j|j
j
|j
j|j
j|j
j|j
j|_dS)NzInvalid version: ''rrc34K|]}t|VdSr*)rE.0is  r	z#Version.__init__..s(LLQ#a&&LLLLLLr%rrtpre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrr)_regexsearchrrgrouprErrz_parse_letter_version_parse_local_versionrK_cmpkeyrrrrrrr()r-rmatchs   rrPzVersion.__init__s""7++	B !@g!@!@!@AAA!/4{{7/C/CJ#ekk'**+++LL%++i*@*@*F*Fs*K*KLLLLL%ekk'&:&:EKK.-(;;c!ff;;;;;;r%c34K|]}t|VdSr*rrs  rrz"Version.__str__..1s( : :AQ : : : : : :r%z.postz.dev+)rrjoinrrrrrr-rs  rrSzVersion.__str__%s :??LLDJ)))***	SXX;;dl;;;;;<<<8LL : : : : :::;;;9 LL,,,---8LL***+++:!LL)TZ))***wwu~~r%c|jj}|Sr*)rKr)r-_epochs  rrz
Version.epochAsm)
r%.c|jj}|Sr*)rKr)r-_releases  rrzVersion.releaseFs$(M$9r%c|jj}|Sr*)rKr)r-_pres  rrzVersion.preKs*.-*;r%cB|jjr|jjdndSNr
)rKrr,s rrzVersion.postPs!(,
(:Dt}!!$$Dr%cB|jjr|jjdndSr)rKrr,s rrzVersion.devTs!'+}'8Bt} ##dBr%cp|jjr)dd|jjDSdS)Nrtc34K|]}t|VdSr*rrs  rrz Version.local..[s(@@qCFF@@@@@@r%)rKrrr,s rrz
Version.localXs:=	88@@DM,?@@@@@@4r%cTt|dddS)Nrr
r)rJrzr,s rrXzVersion.public_s!4yysA&&q))r%cg}|jdkr||jd|dd|jDd|S)Nrrrtc34K|]}t|VdSr*rrs  rrz'Version.base_version..lrr%r)rrrrrs  rr[zVersion.base_versioncsr:??LLDJ)))***	SXX;;dl;;;;;<<<wwu~~r%c&|jdup|jduSr*)rrr,s rrfzVersion.is_prereleasepsxt#;txt';;r%c|jduSr*)rr,s rrizVersion.is_postreleasetsy$$r%c|jduSr*)rr,s rrkzVersion.is_devreleasexsxt##r%cPt|jdkr
|jdndS)Nr
rlenrr,s rmajorz
Version.major|&"%dl"3"3q"8"8t|Aa?r%cPt|jdkr
|jdndS)Nr
rrr,s rminorz
Version.minorrr%cPt|jdkr
|jdndS)Nrrrr,s rmicroz
Version.microrr%) r r!r"recompilerVERBOSE
IGNORECASErrJrPrVrSrlrErrrrrrrrrXr[rFrfrirkrrrr$r%rrrs
RZ/1G;RZ"-=W
X
XF





:&#&&&&8sXsCxXXeCHo.XEhsmEEEXECXc]CCCXCx}X****X*
c


X
F
WFF
v

FF
.
.
.FF
|
#
#Fs6{{""#f#s6{{""4r%z[\._-]rcl|1tdt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Nc3K|];}|s|nt|V.sU

!%=DJJLLLCII





r%)r_local_version_separatorsrz)rs rrrsM


177>>




	
4r%rrrrrcPttttjdt|}||
|t
}n|t}n|}|t
}n|}|t}	n|}	|t
}
ntd|D}
|||||	|
fS)Nc|dkS)Nrr$)rs rz_cmpkey..s
AFr%c3ZK|]&}t|tr|dfnt|fV'dS)rN)r2rEr
rs  rrz_cmpkey..sP

IJz!S))DQGG0@!/D





r%)rreversedlist	itertools	dropwhiler
r)rrrrrrrr_post_dev_locals           rrrsi)*:*:HWrs*
				PPPPPPPPPPPPPPPPPPWWWWWWWWWWWW
T
T
Tl$889
}eCHo56]C,-	
,#$&45
7	

		


	
sCx...)S
S%S/)*"
6< %(<"=>D";!CCC
	&3	&5!;<	&	&	&	&Z+'+'+'+'+'+'+'+'\;;;;;L;;;| *rz*CRZPP	

##CHSM"CL:@E@E@E@E@E@lE@E@E@P!!sE;67!
eCHo!!!!H'BJy11		(;				<6<6
38_<6
%S/	"<65c?
#	<6

%S/	"<6E,'(
<6<6<6<6<6<6<6r%PK!B338_vendor/packaging/__pycache__/_manylinux.cpython-311.pycnu[

,Re,UddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
GddZdeefdZdefdZdefdZd	edefd
ZejdZe	eefed<Gd
deZdeefdZdeefdZdeefdZdede
eeffdZejde
eeffdZded	ededefdZ ddddZ!ded	ede
efdZ"dS)N)IODictIterator
NamedTupleOptionalTuplecveZdZGddeZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
eeddfdZdS)_ELFFileHeaderceZdZdZdS)$_ELFFileHeader._InvalidELFFileHeaderz7
        An invalid ELF file header was found.
        N)__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/_manylinux.py_InvalidELFFileHeaderrs				rriFLE(>l~iifilereturnNcndtdtffd}|d|_|j|jkrt|d|_|j|j|jhvrt|d|_	|j	|j
|jhvrt|d|_|d|_
|d|_d|_|j	|j
krdnd}|j	|j
krd	nd}|j	|j
krd
nd}|j|jkr|n|}|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_dS)Nfmtrc	tj|}tj||}n,#tj$rt
wxYw|dS)Nr)readstructcalcsizeunpackerrorr
r)rdataresultrs   rr#z'_ELFFileHeader.__init__..unpack$so
=yy!5!566*0-T*B*B<
=
=
=$::<<<
=!9sIBzHzQ)strint
e_ident_magicELF_MAGIC_NUMBERr
r
e_ident_class
ELFCLASS32
ELFCLASS64e_ident_dataELFDATA2LSBELFDATA2MSBe_ident_version
e_ident_osabie_ident_abiversionr e_ident_pade_type	e_machine	e_versione_entrye_phoffe_shoffe_flagse_ehsizee_phentsizee_phnume_shentsizee_shnum
e_shstrndx)selfrr#format_hformat_iformat_qformat_ps `     r__init__z_ELFFileHeader.__init__#s`								$VD\\!666 66888#VC[[dot%GGG 66888"F3KKT%5t7G$HHH 66888%vc{{#VC[["(&++99Q<<,0@@@44d,0@@@44d,0@@@44d#1T_DD88(fX&&))))vh''vh''vh''vh''x((
!6(++vh''!6(++vh'' &**r)r
rr
ValueErrorrr,r.r/r1r2EM_386EM_S390EM_ARM	EM_X86_64EF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDrbytesrIrrrr
r
s

"JJKK
FG
FIN O&&+RY&+4&+&+&+&+&+&+rr
rc	ttjd5}t|}dddn#1swxYwYn##tt
tjf$rYdSwxYw|S)Nrb)opensys
executabler
OSError	TypeErrorr)f
elf_headers  r_get_elf_headerr\Ls
#.$
'
'	+1'**J	+	+	+	+	+	+	+	+	+	+	+	+	+	+	+Y DEtts-A8A<A<AA$#A$ct}|dS|j|jk}||j|jkz}||j|jkz}||j|jz|j	kz}||j|j
z|j
kz}|SNF)r\r-r.r0r1r8rMr=rOrPrQr[r&s  r_is_linux_armhfr`Us!""Ju

%)>
>F
j%)???F
j"j&777F
Z66		#$$FZ==		)**FMrct}|dS|j|jk}||j|jkz}||j|jkz}|Sr^)r\r-r.r0r1r8rKr_s  r_is_linux_i686rbhsW ""Ju

%)>
>F
j%)???F
j"j&777FMrarchcZ|dkrtS|dkrtS|dvS)Narmv7li686>ppc64s390xx86_64aarch64ppc64le)r`rb)rcs r_have_compatible_abirlrs:x   v~~EEErcdS)N2rrrrrosBr_LAST_GLIBC_MINORc$eZdZUeed<eed<dS)
_GLibCVersionmajorminorN)r
rrr*__annotations__rrrrrrrs"JJJJJJJJrrrc	tjd}|J|\}}n$#ttt
tf$rYdSwxYw|S)zJ
    Primary implementation of glibc_version_string using os.confstr.
    CS_GNU_LIBC_VERSIONN)osconfstrsplitAssertionErrorAttributeErrorrXrJ)version_string_versions   r_glibc_version_string_confstrrsl$9::)))#))++
77NGZ@ttNs/2AAc8	ddl}n#t$rYdSwxYw	|d}n#t$rYdSwxYw	|j}n#t
$rYdSwxYw|j|_|}t|ts|
d}|S)zG
    Fallback implementation of glibc_version_string using ctypes.
    rNascii)ctypesImportErrorCDLLrXgnu_get_libc_versionr|c_char_prestype
isinstancer)decode)rprocess_namespacerversion_strs    r_glibc_version_string_ctypesrs



tt "KK--tt0Ett$*? ++--Kk3''2!((11s*
/
==A		
AAc:tp
tS)z9Returns glibc version string, or None if not using glibc.)rrrrr_glibc_version_stringrs(**L.J.L.LLrrctjd|}|stjd|ztdSt|dt|dfS)a3Parse glibc version.

    We use a regexp instead of str.split because we want to discard any
    random junk that might come after the minor version -- this might happen
    in patched/forked versions of glibc (e.g. Linaro's version of glibc
    uses version strings like "2.20-2014.11"). See gh-3588.
    z$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %srrsrt)rematchwarningswarnRuntimeWarningr*group)rms  r_parse_glibc_versionrs|	8+FFA

$
%	
	
	

vqwww  #aggg&6&6"7"777rcDt}|dSt|S)Nr)rr)rs r_get_glibc_versionrs&'))Kx,,,rnamerc<t}||krdS	ddl}n#t$rYdSwxYwt|dr6||d|d|}|t|SdS|t
ddkr$t|drt|jS|t
dd	kr$t|d
rt|jS|t
ddkr$t|drt|j	SdS)
NFrTmanylinux_compatiblerrmanylinux1_compatiblemanylinux2010_compatiblemanylinux2014_compatible)
r
_manylinuxrhasattrrboolrrrrr)rrcr	sys_glibcrr&s      r_is_compatiblersL"$$I7uttz12200WQZNN<<t-1%%%%:677	:
8999-2&&&&:9::	=
;<<<-2&&&&:9::	=
;<<<4s
++
manylinux2014
manylinux2010
manylinux1))rr)rr)rrlinuxc#Kt|sdStdd}|dvrtdd}tt}|g}t|jdz
ddD]2}t
|}|t||3|D]}|j|jkr|j}nd}t|j|dD]}t|j|}	dj|	}
t|
||	r|
d|
V|	tvr6t|	}t|||	r|
d|VdS)	Nr>rfrirrzmanylinux_{}_{}r)rlrrrrangersrpappendrtformatrreplace_LEGACY_MANYLINUX_MAP)rrctoo_old_glibc2
current_glibcglibc_max_listglibc_majorglibc_minor	glibc_max	min_minor
glibc_versiontag
legacy_tags            r
platform_tagsrs%%"1b))N!!!&q!,,!#5#7#78M#_N]014a<<GG'4mKEEFFFF#==	?n222&,III )R@@		=		=K))/;GGM*#*M:Cc477
2mmGS11111 5552=A
!*dMBB=--<<<<<		=
==r)#collections	functoolsrxrr!rVrtypingrrrrrrr
r\rr`rbr)rldefaultdictrpr*rurrrrrr	lru_cacherrrrrrrrs								







BBBBBBBBBBBBBBBB:+:+:+:+:+:+:+:+z.1&FsFtFFFF%GGGJ
x}&)hsm))))XMx}MMMM
8c8eCHo8888&-E#s(O----C-D8

"="=C"=HSM"="="="="="=rPK!!8_vendor/packaging/__pycache__/_musllinux.cpython-311.pycnu[

,Re
dZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
mZde
ededeedffdZde
ede
efd	ZGd
deZdede
efd
Zejdede
efdZdedeefdZedkrddlZejZeds
Jdedeedeejeddeej dde!dddD]Z"ee"ddSdS) zPEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
N)IOIterator
NamedTupleOptionalTupleffmtreturn.cvtj||tj|SN)structunpackreadcalcsize)rr	s  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/_musllinux.py_read_unpackedrs*=affV_S%9%9::;;;cb|d	t|d}n#tj$rYdSwxYw|ddt	dkrdS|tjdd	dd	d
|d\}}}t
j|}n#t$rYdSwxYw	t||\}}}}}}}	n#tj$rYdSwxYwt|	dzD]}
||||
zz	|t||\}}}
n#tj$rYdSwxYw|dkrZ||tj||

d}d
|vrdS|cSdS)zDetect musl libc location by parsing the Python executable.

    Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca
    ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
    r16BNsELFHHI)IIIIHHHIIIIIIII)rrr)QQQIHHHIIQQQQQQ)r)rrmusl)seekrr
errortupleroperator
itemgetterKeyErrorrangeosfsdecoderstrip)ridente_fmtp_fmtp_idxp_get_e_phoffe_phentsizee_phnumip_typep_offsetp_fileszinterpreters               r_parse_ld_musl_from_elfr:s$FF1IIIq%((<ttRaRyE*%%%%tFF6?5!!1%%%,
21

(ue#U+tt4B1e4L4L17Aq![''<tt
7Q;

	wq()))	).~a/G/G)H)H&FHhh|			444	Q;;	xk!&&"2"23399$??$$444sB(;;B((
B65B6:CC&%C&D77E
Ec$eZdZUeed<eed<dS)_MuslVersionmajorminorN)__name__
__module____qualname__int__annotations__rrr<r<Gs"JJJJJJJJrr<outputcdd|DD}t|dks|ddddkrdStjd|d}|sdSt	t|dt|d	S)
Ncg|]}||SrDrD.0ns  r
z'_parse_musl_version..MsFFF1AFQFFFrc3>K|]}|VdSr)r+rHs  r	z&_parse_musl_version..Ms*@@q@@@@@@rrrrr!zVersion (\d+)\.(\d+)r)r=r>)
splitlineslenrematchr<rBgroup)rElinesms   r_parse_musl_versionrULsFF@@F,=,=,?,?@@@FFFE
5zzA~~q"1"//t
(%(33Atc!''!**ooS__EEEEr
executablecltj5}	|t|d}n#t$rYddddSwxYwt|}dddn#1swxYwY|sdSt
j|gtjd}t|j
S)a`Detect currently-running musl runtime version.

    This is done by checking the specified executable's dynamic linking
    information, and invoking the loader to parse its output for a version
    string. If the loader is musl, the output would be something like::

        musl libc (x86_64)
        Version 1.2.2
        Dynamic Program Loader
    rbNT)stderruniversal_newlines)
contextlib	ExitStack
enter_contextopenOSErrorr:
subprocessrunPIPErUrY)rVstackrldprocs     r_get_musl_versionrfVs
			(5	##DT$:$:;;AA				((((((((	
$Q
'
'(((((((((((((((t>2$z4PPPDt{+++s1A1#:A1
AA1AA11A58A5archc#Kttj}|dSt|jddD]}d|jd|d|VdS)aTGenerate musllinux tags compatible to the current platform.

    :param arch: Should be the part of platform tag after the ``linux_``
        prefix, e.g. ``x86_64``. The ``linux_`` prefix is assumed as a
        prerequisite for the current platform to be musllinux-compatible.

    :returns: An iterator of compatible musllinux tags.
    N
musllinux_r1)rfsysrVr(r>r=)rgsys_muslr>s   r
platform_tagsrmnsr!00Hx~r2..;;:8>::E::D::::::;;r__main__zlinux-z	not linuxzplat:zmusl:ztags: )endz[.-]r1-rriz
      )#__doc__r[	functoolsr%r)rPr
r`rktypingrrrrrbytesstrrBrr:r<rU	lru_cacherfrmr?	sysconfigget_platformplat
startswithprintrVsubsplittrDrrrs								







<<<<<<<<<<<<<<FFFF,#,(<*@,,,,.
;
;

;
;
;
; z!9!##D??8$$11k111	E'4	E'$$S^44555	E's
]626'3

30B0B20FGG
H
H!!
aZ     !!rPK!w\#}}8_vendor/packaging/__pycache__/specifiers.cpython-311.pycnu[

,Reu	nddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZmZmZeeefZeeeefZedeZeeegefZGdd	eZGd
dejZ Gd
de Z!Gdde!Z"dedeegefdedeegeffdZ#Gdde!Z$ej%dZ&dede
efdZ'dedefdZ(de
ede
edee
ee
effdZ)Gdde Z*dS) N)CallableDictIterableIteratorListOptionalPatternSetTupleTypeVarUnion)canonicalize_version)
LegacyVersionVersionparseVersionTypeVar)boundceZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/packaging/specifiers.pyrr!srrc	reZdZejdefdZejdefdZejde	de
fdZejde
e
fdZejde
ddfd	Zejdd
ede
e
de
fdZej	dd
eede
e
deefdZdS)
BaseSpecifierreturncdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nrselfs r__str__zBaseSpecifier.__str__(rcdS)zF
        Returns a hash value for this Specifier like object.
        Nrr"s r__hash__zBaseSpecifier.__hash__/r%rothercdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nrr#r(s  r__eq__zBaseSpecifier.__eq__5r%rcdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrr"s rprereleaseszBaseSpecifier.prereleases<r%rvalueNcdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrr#r.s  rr-zBaseSpecifier.prereleasesCr%ritemr-cdS)zR
        Determines if the given item is contained within this specifier.
        Nrr#r1r-s   rcontainszBaseSpecifier.containsJr%riterablecdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)r#r5r-s   rfilterzBaseSpecifier.filterPr%rN)rrrabcabstractmethodstrr$intr'objectboolr+abstractpropertyrr-setterr4rrr7rrrrr's	#
	Ft	Xd^$	Sx~
	PT 0?G~	.	!rr)	metaclassceZdZUiZeeefed<eeed<ddedee	ddfdZ
defd	Zdefd
Ze
deeeffdZdefdZd
ede	fdZdedefdZdedefdZe
defdZe
defdZe
dee	fdZejde	ddfdZdede	fdZ	ddedee	de	fdZ	ddee dee	dee fdZ!dS)_IndividualSpecifier
_operators_regexNspecr-r c|j|}|std|d|d|df|_||_dS)NzInvalid specifier: ''operatorversion)rEsearchrgroupstrip_spec_prereleases)r#rGr-matchs    r__init__z_IndividualSpecifier.__init___s""4((	C"#A$#A#A#ABBB
KK
##))++KK	""((**'

(rcl|j
d|jnd}d|jjdt	||dS)N, prereleases=rF<()>)rPr-	__class__rr;r#pres  r__repr__z_IndividualSpecifier.__repr__lsT ,
2T-111	B4>*AASYYA#AAAArc dj|jS)Nz{}{})formatrOr"s rr$z_IndividualSpecifier.__str__usv}dj))rcP|jdt|jdfS)Nrr)rOrr"s r_canonical_specz$_IndividualSpecifier._canonical_specxs"z!}24:a=AAAArc*t|jSr8)hashr_r"s rr'z_IndividualSpecifier.__hash__|sD()))rr(ct|tr;	|t|}n3#t$r
tcYSwxYwt||jstS|j|jkSr8)
isinstancer;rXrNotImplementedr_r*s  rr+z_IndividualSpecifier.__eq__seS!!	"
&s5zz22#
&
&
&%%%%
&E4>22	"!!#u'<<rRr[r$propertyrr_r<r'r=r+CallableOperatorrjUnparsedVersion
ParsedVersionrmrJrKr-r@ryr4rrr7rrrrCrCZs!#JS#X###CL((S(HTN(d((((B#BBBB*****BsCxBBBXB*#****	=F	=t	=	=	=	=!!(8!!!!=
#XX!Xd^!!!X!""$""""######DH@@#@2:4.@	
@@@@0QU!! 0!?G~!	.	!!!!!!!rrCc eZdZdZejdezdzejejzZdddddd	d
Z	dd
e
deeddffd
Z
dedefdZded
e
defdZded
e
defdZded
e
defdZded
e
defdZded
e
defdZded
e
defdZxZS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ^\s*\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)==!=<=>=rU>rFNrGr-r ct||tjdtdS)NzZCreating a LegacyVersion has been deprecated and will be removed in the next major release)superrRwarningswarnDeprecationWarning)r#rGr-rXs   rrRzLegacySpecifier.__init__sC
{+++

0	
	
	
	
	
rrKcht|tstt|}|Sr8)rcrr;rls  rrmzLegacySpecifier._coerce_versions,'=11	2#CLL11Grprospectivec4|||kSr8rmr#rrGs   r_compare_equalzLegacySpecifier._compare_equal
d2248888rc4|||kSr8rrs   r_compare_not_equalz"LegacySpecifier._compare_not_equal
rrc4|||kSr8rrs   r_compare_less_than_equalz(LegacySpecifier._compare_less_than_equalrrc4|||kSr8rrs   r_compare_greater_than_equalz+LegacySpecifier._compare_greater_than_equalsd2248888rc4|||kSr8rrs   r_compare_less_thanz"LegacySpecifier._compare_less_thanT11$7777rc4|||kSr8rrs   r_compare_greater_thanz%LegacySpecifier._compare_greater_thanrrr)rrr
_regex_strrecompileVERBOSE
IGNORECASErErDr;rr>rRrrrmrrrrrr
__classcell__)rXs@rrrs
JRZ*,w6
R]8R
S
SF"


J

S
HTN
d





=
9-9s9t99999m939499999M99QU99999(9039	
9999
8m8384888888c8d88888888rrfn	Specifierr c	vtjdddtdtdtffd}|S)Nr#rrrGr cLt|tsdS|||Sr|)rcr)r#rrGrs   rwrappedz)_require_version_compare..wrapped"s.+w//	5r$T***r)	functoolswrapsrr;r>)rrs` r_require_version_comparers[_R+k+
+S+T++++++
Nrc	eZdZdZejdezdzejejzZdddddd	d
ddZ	e
d
edede
fdZe
d
edede
fdZe
d
edede
fdZe
d
edede
fdZe
d
edede
fdZe
d
edede
fdZe
d
edede
fdZd
edede
fdZede
fdZejde
ddfdZdS)ra
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?rrrrrrrrrrr-r@rrrrr+sm[JzRZ*,w6
R]8R
S
SF"

		J
}
C
D



*%/-%/s%/t%/%/%/%/N:m:3:4::::=g=S=T====TX0""$""""""rz^([0-9]+)((?:a|b|c|rc)[0-9]+)$rKcg}|dD][}t|}|r(||F||\|S)Nr)split
_prefix_regexrLextendgroupsr)rKresultr1rQs    rrrIstF

c""  $$T**	 MM%,,..))))MM$Mrsegmentc<tfddDS)Nc3BK|]}|VdSr8)
startswith).0rrs  r	z!_is_not_suffix..UsB'-6""r)devabrcpost)any)rs`rrrTs@1PrleftrightcRgg}}|ttjd||ttjd|||t	|dd||t	|dd|ddgt
dt	|dt	|dz
z|ddgt
dt	|dt	|dz
zttj|ttj|fS)Nc*|Sr8isdigitxs rz_pad_version..^src*|Sr8rrs rrz_pad_version.._s!))++rrr0)rrrrrinsertmaxchain)rr
left_splitright_splits    rrrZsr "Jd9./D/DdKKLLMMMtI/0E0EuMMNNOOOd3z!}--//0111uSQ00223444a#QKN(;(;c*Q->P>P(P!Q!QQRRRq3%#aZ]););c+a.>Q>Q)Q"R"RRSSS*-..Y_k5R0S0STTrcleZdZ	ddedeeddfdZdefdZdefdZde	fd	Z
d
edefddfdZd
e
defdZde	fd
ZdeefdZedeefdZejdeddfdZdedefdZ	ddedeedefdZ	ddeedeedeefdZdS)SpecifierSetrFN
specifiersr-r cJd|dD}t}|D]W}	|t|&#t$r%|t|YTwxYwt
||_||_dS)Nc^g|]*}||+Sr)rNrss  r
z)SpecifierSet.__init__..ss-RRR!		RAGGIIRRRr,)	rsetaddrrr	frozenset_specsrP)r#rr-split_specifiersparsed	specifiers      rrRzSpecifierSet.__init__msSRz/?/?/D/DRRR-0EE)	7	7I
7

9Y//0000#
7
7
7

?95566666
7 ''(s"A,BBcR|j
d|jnd}dt||dS)NrTrFz.s(;;!s1vv;;;;;;r)rsortedrr"s rr$zSpecifierSet.__str__s-xx;;t{;;;;;<<.s$66Q1=666666r)rPrrr"s rr-zSpecifierSet.prereleasessH
($$
{	466$+666666rr.c||_dSr8rsr0s  rr-zSpecifierSet.prereleasesrurr1c,||Sr8rwrxs  rryzSpecifierSet.__contains__rzrctttfst|js	jrdSt
fd|jDS)NFc3FK|]}|VdS)r0Nrw)rrr1r-s  rrz(SpecifierSet.contains..s3RR1::d:<<RRRRRRr)rcrrrr-r}allrr3s ``rr4zSpecifierSet.containss{
$ 899	;;D
*K	t1	5RRRRRdkRRRRRRrr5c||j}|jr0|jD]&}||t|}'|Sg}g}|D]|}t	|t
tfst|}n|}t	|t
rF|jr|s|s|	|g|	|}|s|r||S|S)Nr0)
r-rr7r>rcrrrr}r)r#r5r-rGfilteredrr1rs        rr7zSpecifierSet.filters*K
;&	
P
P;;xT+=N=N;OOO
.0H68
!
*
*!$(@AA*%*4[[NN%)Nnm<<"/**#7)00666OOD))))
) 1
)k6I((Orrr8)rrrr;rr>rRr[r$r<r'r
r'r=r+r*rrCr-rr-r@rryr4rrr7rrrrrls0BF(((19$(	
((((05#5555=====!#!!!!U>3#67N.+F+t++++     !(#78!!!!7Xd^777X7"""$""""##T####DHSS#S2:4.S	
SSSS<QU33 03?G~3	.	!333333rr)+r9rrrrtypingrrrrrrr	r
rrr
utilsrrKrrrrr;rrr>rr&rABCMetarrCrrrrrrrrrrrrr;sQ



				('''''2222222222g},-
34)AAA]C0$67z00000ck0000fFFFFF=FFFR9898989898*989898x	+}c2D89	
{M3/56				X"X"X"X"X"$X"X"X"v
<==
CDICDUtCyUcUuT#YS	=Q7RUUUU$vvvvv=vvvvvrPK!'^^_vendor/packaging/tags.pynu[# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from __future__ import absolute_import

import distutils.util

try:
    from importlib.machinery import EXTENSION_SUFFIXES
except ImportError:  # pragma: no cover
    import imp

    EXTENSION_SUFFIXES = [x[0] for x in imp.get_suffixes()]
    del imp
import logging
import os
import platform
import re
import struct
import sys
import sysconfig
import warnings

from ._typing import TYPE_CHECKING, cast

if TYPE_CHECKING:  # pragma: no cover
    from typing import (
        Dict,
        FrozenSet,
        IO,
        Iterable,
        Iterator,
        List,
        Optional,
        Sequence,
        Tuple,
        Union,
    )

    PythonVersion = Sequence[int]
    MacVersion = Tuple[int, int]
    GlibcVersion = Tuple[int, int]


logger = logging.getLogger(__name__)

INTERPRETER_SHORT_NAMES = {
    "python": "py",  # Generic.
    "cpython": "cp",
    "pypy": "pp",
    "ironpython": "ip",
    "jython": "jy",
}  # type: Dict[str, str]


_32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32


class Tag(object):
    """
    A representation of the tag triple for a wheel.

    Instances are considered immutable and thus are hashable. Equality checking
    is also supported.
    """

    __slots__ = ["_interpreter", "_abi", "_platform"]

    def __init__(self, interpreter, abi, platform):
        # type: (str, str, str) -> None
        self._interpreter = interpreter.lower()
        self._abi = abi.lower()
        self._platform = platform.lower()

    @property
    def interpreter(self):
        # type: () -> str
        return self._interpreter

    @property
    def abi(self):
        # type: () -> str
        return self._abi

    @property
    def platform(self):
        # type: () -> str
        return self._platform

    def __eq__(self, other):
        # type: (object) -> bool
        if not isinstance(other, Tag):
            return NotImplemented

        return (
            (self.platform == other.platform)
            and (self.abi == other.abi)
            and (self.interpreter == other.interpreter)
        )

    def __hash__(self):
        # type: () -> int
        return hash((self._interpreter, self._abi, self._platform))

    def __str__(self):
        # type: () -> str
        return "{}-{}-{}".format(self._interpreter, self._abi, self._platform)

    def __repr__(self):
        # type: () -> str
        return "<{self} @ {self_id}>".format(self=self, self_id=id(self))


def parse_tag(tag):
    # type: (str) -> FrozenSet[Tag]
    """
    Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.

    Returning a set is required due to the possibility that the tag is a
    compressed tag set.
    """
    tags = set()
    interpreters, abis, platforms = tag.split("-")
    for interpreter in interpreters.split("."):
        for abi in abis.split("."):
            for platform_ in platforms.split("."):
                tags.add(Tag(interpreter, abi, platform_))
    return frozenset(tags)


def _warn_keyword_parameter(func_name, kwargs):
    # type: (str, Dict[str, bool]) -> bool
    """
    Backwards-compatibility with Python 2.7 to allow treating 'warn' as keyword-only.
    """
    if not kwargs:
        return False
    elif len(kwargs) > 1 or "warn" not in kwargs:
        kwargs.pop("warn", None)
        arg = next(iter(kwargs.keys()))
        raise TypeError(
            "{}() got an unexpected keyword argument {!r}".format(func_name, arg)
        )
    return kwargs["warn"]


def _get_config_var(name, warn=False):
    # type: (str, bool) -> Union[int, str, None]
    value = sysconfig.get_config_var(name)
    if value is None and warn:
        logger.debug(
            "Config variable '%s' is unset, Python ABI tag may be incorrect", name
        )
    return value


def _normalize_string(string):
    # type: (str) -> str
    return string.replace(".", "_").replace("-", "_")


def _abi3_applies(python_version):
    # type: (PythonVersion) -> bool
    """
    Determine if the Python version supports abi3.

    PEP 384 was first implemented in Python 3.2.
    """
    return len(python_version) > 1 and tuple(python_version) >= (3, 2)


def _cpython_abis(py_version, warn=False):
    # type: (PythonVersion, bool) -> List[str]
    py_version = tuple(py_version)  # To allow for version comparison.
    abis = []
    version = _version_nodot(py_version[:2])
    debug = pymalloc = ucs4 = ""
    with_debug = _get_config_var("Py_DEBUG", warn)
    has_refcount = hasattr(sys, "gettotalrefcount")
    # Windows doesn't set Py_DEBUG, so checking for support of debug-compiled
    # extension modules is the best option.
    # https://github.com/pypa/pip/issues/3383#issuecomment-173267692
    has_ext = "_d.pyd" in EXTENSION_SUFFIXES
    if with_debug or (with_debug is None and (has_refcount or has_ext)):
        debug = "d"
    if py_version < (3, 8):
        with_pymalloc = _get_config_var("WITH_PYMALLOC", warn)
        if with_pymalloc or with_pymalloc is None:
            pymalloc = "m"
        if py_version < (3, 3):
            unicode_size = _get_config_var("Py_UNICODE_SIZE", warn)
            if unicode_size == 4 or (
                unicode_size is None and sys.maxunicode == 0x10FFFF
            ):
                ucs4 = "u"
    elif debug:
        # Debug builds can also load "normal" extension modules.
        # We can also assume no UCS-4 or pymalloc requirement.
        abis.append("cp{version}".format(version=version))
    abis.insert(
        0,
        "cp{version}{debug}{pymalloc}{ucs4}".format(
            version=version, debug=debug, pymalloc=pymalloc, ucs4=ucs4
        ),
    )
    return abis


def cpython_tags(
    python_version=None,  # type: Optional[PythonVersion]
    abis=None,  # type: Optional[Iterable[str]]
    platforms=None,  # type: Optional[Iterable[str]]
    **kwargs  # type: bool
):
    # type: (...) -> Iterator[Tag]
    """
    Yields the tags for a CPython interpreter.

    The tags consist of:
    - cp--
    - cp-abi3-
    - cp-none-
    - cp-abi3-  # Older Python versions down to 3.2.

    If python_version only specifies a major version then user-provided ABIs and
    the 'none' ABItag will be used.

    If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
    their normal position and not at the beginning.
    """
    warn = _warn_keyword_parameter("cpython_tags", kwargs)
    if not python_version:
        python_version = sys.version_info[:2]

    interpreter = "cp{}".format(_version_nodot(python_version[:2]))

    if abis is None:
        if len(python_version) > 1:
            abis = _cpython_abis(python_version, warn)
        else:
            abis = []
    abis = list(abis)
    # 'abi3' and 'none' are explicitly handled later.
    for explicit_abi in ("abi3", "none"):
        try:
            abis.remove(explicit_abi)
        except ValueError:
            pass

    platforms = list(platforms or _platform_tags())
    for abi in abis:
        for platform_ in platforms:
            yield Tag(interpreter, abi, platform_)
    if _abi3_applies(python_version):
        for tag in (Tag(interpreter, "abi3", platform_) for platform_ in platforms):
            yield tag
    for tag in (Tag(interpreter, "none", platform_) for platform_ in platforms):
        yield tag

    if _abi3_applies(python_version):
        for minor_version in range(python_version[1] - 1, 1, -1):
            for platform_ in platforms:
                interpreter = "cp{version}".format(
                    version=_version_nodot((python_version[0], minor_version))
                )
                yield Tag(interpreter, "abi3", platform_)


def _generic_abi():
    # type: () -> Iterator[str]
    abi = sysconfig.get_config_var("SOABI")
    if abi:
        yield _normalize_string(abi)


def generic_tags(
    interpreter=None,  # type: Optional[str]
    abis=None,  # type: Optional[Iterable[str]]
    platforms=None,  # type: Optional[Iterable[str]]
    **kwargs  # type: bool
):
    # type: (...) -> Iterator[Tag]
    """
    Yields the tags for a generic interpreter.

    The tags consist of:
    - --

    The "none" ABI will be added if it was not explicitly provided.
    """
    warn = _warn_keyword_parameter("generic_tags", kwargs)
    if not interpreter:
        interp_name = interpreter_name()
        interp_version = interpreter_version(warn=warn)
        interpreter = "".join([interp_name, interp_version])
    if abis is None:
        abis = _generic_abi()
    platforms = list(platforms or _platform_tags())
    abis = list(abis)
    if "none" not in abis:
        abis.append("none")
    for abi in abis:
        for platform_ in platforms:
            yield Tag(interpreter, abi, platform_)


def _py_interpreter_range(py_version):
    # type: (PythonVersion) -> Iterator[str]
    """
    Yields Python versions in descending order.

    After the latest version, the major-only version will be yielded, and then
    all previous versions of that major version.
    """
    if len(py_version) > 1:
        yield "py{version}".format(version=_version_nodot(py_version[:2]))
    yield "py{major}".format(major=py_version[0])
    if len(py_version) > 1:
        for minor in range(py_version[1] - 1, -1, -1):
            yield "py{version}".format(version=_version_nodot((py_version[0], minor)))


def compatible_tags(
    python_version=None,  # type: Optional[PythonVersion]
    interpreter=None,  # type: Optional[str]
    platforms=None,  # type: Optional[Iterable[str]]
):
    # type: (...) -> Iterator[Tag]
    """
    Yields the sequence of tags that are compatible with a specific version of Python.

    The tags consist of:
    - py*-none-
    - -none-any  # ... if `interpreter` is provided.
    - py*-none-any
    """
    if not python_version:
        python_version = sys.version_info[:2]
    platforms = list(platforms or _platform_tags())
    for version in _py_interpreter_range(python_version):
        for platform_ in platforms:
            yield Tag(version, "none", platform_)
    if interpreter:
        yield Tag(interpreter, "none", "any")
    for version in _py_interpreter_range(python_version):
        yield Tag(version, "none", "any")


def _mac_arch(arch, is_32bit=_32_BIT_INTERPRETER):
    # type: (str, bool) -> str
    if not is_32bit:
        return arch

    if arch.startswith("ppc"):
        return "ppc"

    return "i386"


def _mac_binary_formats(version, cpu_arch):
    # type: (MacVersion, str) -> List[str]
    formats = [cpu_arch]
    if cpu_arch == "x86_64":
        if version < (10, 4):
            return []
        formats.extend(["intel", "fat64", "fat32"])

    elif cpu_arch == "i386":
        if version < (10, 4):
            return []
        formats.extend(["intel", "fat32", "fat"])

    elif cpu_arch == "ppc64":
        # TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
        if version > (10, 5) or version < (10, 4):
            return []
        formats.append("fat64")

    elif cpu_arch == "ppc":
        if version > (10, 6):
            return []
        formats.extend(["fat32", "fat"])

    formats.append("universal")
    return formats


def mac_platforms(version=None, arch=None):
    # type: (Optional[MacVersion], Optional[str]) -> Iterator[str]
    """
    Yields the platform tags for a macOS system.

    The `version` parameter is a two-item tuple specifying the macOS version to
    generate platform tags for. The `arch` parameter is the CPU architecture to
    generate platform tags for. Both parameters default to the appropriate value
    for the current system.
    """
    version_str, _, cpu_arch = platform.mac_ver()  # type: ignore
    if version is None:
        version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
    else:
        version = version
    if arch is None:
        arch = _mac_arch(cpu_arch)
    else:
        arch = arch
    for minor_version in range(version[1], -1, -1):
        compat_version = version[0], minor_version
        binary_formats = _mac_binary_formats(compat_version, arch)
        for binary_format in binary_formats:
            yield "macosx_{major}_{minor}_{binary_format}".format(
                major=compat_version[0],
                minor=compat_version[1],
                binary_format=binary_format,
            )


# From PEP 513.
def _is_manylinux_compatible(name, glibc_version):
    # type: (str, GlibcVersion) -> bool
    # Check for presence of _manylinux module.
    try:
        import _manylinux  # noqa

        return bool(getattr(_manylinux, name + "_compatible"))
    except (ImportError, AttributeError):
        # Fall through to heuristic check below.
        pass

    return _have_compatible_glibc(*glibc_version)


def _glibc_version_string():
    # type: () -> Optional[str]
    # Returns glibc version string, or None if not using glibc.
    return _glibc_version_string_confstr() or _glibc_version_string_ctypes()


def _glibc_version_string_confstr():
    # type: () -> Optional[str]
    """
    Primary implementation of glibc_version_string using os.confstr.
    """
    # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
    # to be broken or missing. This strategy is used in the standard library
    # platform module.
    # https://github.com/python/cpython/blob/fcf1d003bf4f0100c9d0921ff3d70e1127ca1b71/Lib/platform.py#L175-L183
    try:
        # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17".
        version_string = os.confstr(  # type: ignore[attr-defined] # noqa: F821
            "CS_GNU_LIBC_VERSION"
        )
        assert version_string is not None
        _, version = version_string.split()  # type: Tuple[str, str]
    except (AssertionError, AttributeError, OSError, ValueError):
        # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
        return None
    return version


def _glibc_version_string_ctypes():
    # type: () -> Optional[str]
    """
    Fallback implementation of glibc_version_string using ctypes.
    """
    try:
        import ctypes
    except ImportError:
        return None

    # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
    # manpage says, "If filename is NULL, then the returned handle is for the
    # main program". This way we can let the linker do the work to figure out
    # which libc our process is actually using.
    #
    # Note: typeshed is wrong here so we are ignoring this line.
    process_namespace = ctypes.CDLL(None)  # type: ignore
    try:
        gnu_get_libc_version = process_namespace.gnu_get_libc_version
    except AttributeError:
        # Symbol doesn't exist -> therefore, we are not linked to
        # glibc.
        return None

    # Call gnu_get_libc_version, which returns a string like "2.5"
    gnu_get_libc_version.restype = ctypes.c_char_p
    version_str = gnu_get_libc_version()  # type: str
    # py2 / py3 compatibility:
    if not isinstance(version_str, str):
        version_str = version_str.decode("ascii")

    return version_str


# Separated out from have_compatible_glibc for easier unit testing.
def _check_glibc_version(version_str, required_major, minimum_minor):
    # type: (str, int, int) -> bool
    # Parse string and check against requested version.
    #
    # We use a regexp instead of str.split because we want to discard any
    # random junk that might come after the minor version -- this might happen
    # in patched/forked versions of glibc (e.g. Linaro's version of glibc
    # uses version strings like "2.20-2014.11"). See gh-3588.
    m = re.match(r"(?P[0-9]+)\.(?P[0-9]+)", version_str)
    if not m:
        warnings.warn(
            "Expected glibc version with 2 components major.minor,"
            " got: %s" % version_str,
            RuntimeWarning,
        )
        return False
    return (
        int(m.group("major")) == required_major
        and int(m.group("minor")) >= minimum_minor
    )


def _have_compatible_glibc(required_major, minimum_minor):
    # type: (int, int) -> bool
    version_str = _glibc_version_string()
    if version_str is None:
        return False
    return _check_glibc_version(version_str, required_major, minimum_minor)


# Python does not provide platform information at sufficient granularity to
# identify the architecture of the running executable in some cases, so we
# determine it dynamically by reading the information from the running
# process. This only applies on Linux, which uses the ELF format.
class _ELFFileHeader(object):
    # https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
    class _InvalidELFFileHeader(ValueError):
        """
        An invalid ELF file header was found.
        """

    ELF_MAGIC_NUMBER = 0x7F454C46
    ELFCLASS32 = 1
    ELFCLASS64 = 2
    ELFDATA2LSB = 1
    ELFDATA2MSB = 2
    EM_386 = 3
    EM_S390 = 22
    EM_ARM = 40
    EM_X86_64 = 62
    EF_ARM_ABIMASK = 0xFF000000
    EF_ARM_ABI_VER5 = 0x05000000
    EF_ARM_ABI_FLOAT_HARD = 0x00000400

    def __init__(self, file):
        # type: (IO[bytes]) -> None
        def unpack(fmt):
            # type: (str) -> int
            try:
                (result,) = struct.unpack(
                    fmt, file.read(struct.calcsize(fmt))
                )  # type: (int, )
            except struct.error:
                raise _ELFFileHeader._InvalidELFFileHeader()
            return result

        self.e_ident_magic = unpack(">I")
        if self.e_ident_magic != self.ELF_MAGIC_NUMBER:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_class = unpack("B")
        if self.e_ident_class not in {self.ELFCLASS32, self.ELFCLASS64}:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_data = unpack("B")
        if self.e_ident_data not in {self.ELFDATA2LSB, self.ELFDATA2MSB}:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_version = unpack("B")
        self.e_ident_osabi = unpack("B")
        self.e_ident_abiversion = unpack("B")
        self.e_ident_pad = file.read(7)
        format_h = "H"
        format_i = "I"
        format_q = "Q"
        format_p = format_i if self.e_ident_class == self.ELFCLASS32 else format_q
        self.e_type = unpack(format_h)
        self.e_machine = unpack(format_h)
        self.e_version = unpack(format_i)
        self.e_entry = unpack(format_p)
        self.e_phoff = unpack(format_p)
        self.e_shoff = unpack(format_p)
        self.e_flags = unpack(format_i)
        self.e_ehsize = unpack(format_h)
        self.e_phentsize = unpack(format_h)
        self.e_phnum = unpack(format_h)
        self.e_shentsize = unpack(format_h)
        self.e_shnum = unpack(format_h)
        self.e_shstrndx = unpack(format_h)


def _get_elf_header():
    # type: () -> Optional[_ELFFileHeader]
    try:
        with open(sys.executable, "rb") as f:
            elf_header = _ELFFileHeader(f)
    except (IOError, OSError, TypeError, _ELFFileHeader._InvalidELFFileHeader):
        return None
    return elf_header


def _is_linux_armhf():
    # type: () -> bool
    # hard-float ABI can be detected from the ELF header of the running
    # process
    # https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
    elf_header = _get_elf_header()
    if elf_header is None:
        return False
    result = elf_header.e_ident_class == elf_header.ELFCLASS32
    result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
    result &= elf_header.e_machine == elf_header.EM_ARM
    result &= (
        elf_header.e_flags & elf_header.EF_ARM_ABIMASK
    ) == elf_header.EF_ARM_ABI_VER5
    result &= (
        elf_header.e_flags & elf_header.EF_ARM_ABI_FLOAT_HARD
    ) == elf_header.EF_ARM_ABI_FLOAT_HARD
    return result


def _is_linux_i686():
    # type: () -> bool
    elf_header = _get_elf_header()
    if elf_header is None:
        return False
    result = elf_header.e_ident_class == elf_header.ELFCLASS32
    result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
    result &= elf_header.e_machine == elf_header.EM_386
    return result


def _have_compatible_manylinux_abi(arch):
    # type: (str) -> bool
    if arch == "armv7l":
        return _is_linux_armhf()
    if arch == "i686":
        return _is_linux_i686()
    return True


def _linux_platforms(is_32bit=_32_BIT_INTERPRETER):
    # type: (bool) -> Iterator[str]
    linux = _normalize_string(distutils.util.get_platform())
    if is_32bit:
        if linux == "linux_x86_64":
            linux = "linux_i686"
        elif linux == "linux_aarch64":
            linux = "linux_armv7l"
    manylinux_support = []
    _, arch = linux.split("_", 1)
    if _have_compatible_manylinux_abi(arch):
        if arch in {"x86_64", "i686", "aarch64", "armv7l", "ppc64", "ppc64le", "s390x"}:
            manylinux_support.append(
                ("manylinux2014", (2, 17))
            )  # CentOS 7 w/ glibc 2.17 (PEP 599)
        if arch in {"x86_64", "i686"}:
            manylinux_support.append(
                ("manylinux2010", (2, 12))
            )  # CentOS 6 w/ glibc 2.12 (PEP 571)
            manylinux_support.append(
                ("manylinux1", (2, 5))
            )  # CentOS 5 w/ glibc 2.5 (PEP 513)
    manylinux_support_iter = iter(manylinux_support)
    for name, glibc_version in manylinux_support_iter:
        if _is_manylinux_compatible(name, glibc_version):
            yield linux.replace("linux", name)
            break
    # Support for a later manylinux implies support for an earlier version.
    for name, _ in manylinux_support_iter:
        yield linux.replace("linux", name)
    yield linux


def _generic_platforms():
    # type: () -> Iterator[str]
    yield _normalize_string(distutils.util.get_platform())


def _platform_tags():
    # type: () -> Iterator[str]
    """
    Provides the platform tags for this installation.
    """
    if platform.system() == "Darwin":
        return mac_platforms()
    elif platform.system() == "Linux":
        return _linux_platforms()
    else:
        return _generic_platforms()


def interpreter_name():
    # type: () -> str
    """
    Returns the name of the running interpreter.
    """
    try:
        name = sys.implementation.name  # type: ignore
    except AttributeError:  # pragma: no cover
        # Python 2.7 compatibility.
        name = platform.python_implementation().lower()
    return INTERPRETER_SHORT_NAMES.get(name) or name


def interpreter_version(**kwargs):
    # type: (bool) -> str
    """
    Returns the version of the running interpreter.
    """
    warn = _warn_keyword_parameter("interpreter_version", kwargs)
    version = _get_config_var("py_version_nodot", warn=warn)
    if version:
        version = str(version)
    else:
        version = _version_nodot(sys.version_info[:2])
    return version


def _version_nodot(version):
    # type: (PythonVersion) -> str
    if any(v >= 10 for v in version):
        sep = "_"
    else:
        sep = ""
    return sep.join(map(str, version))


def sys_tags(**kwargs):
    # type: (bool) -> Iterator[Tag]
    """
    Returns the sequence of tag triples for the running interpreter.

    The order of the sequence corresponds to priority order for the
    interpreter, from most to least important.
    """
    warn = _warn_keyword_parameter("sys_tags", kwargs)

    interp_name = interpreter_name()
    if interp_name == "cp":
        for tag in cpython_tags(warn=warn):
            yield tag
    else:
        for tag in generic_tags():
            yield tag

    for tag in compatible_tags():
        yield tag
PK!t1_vendor/packaging/_musllinux.pynu["""PEP 656 support.

This module implements logic to detect if the currently running Python is
linked against musl, and what musl version is used.
"""

import contextlib
import functools
import operator
import os
import re
import struct
import subprocess
import sys
from typing import IO, Iterator, NamedTuple, Optional, Tuple


def _read_unpacked(f: IO[bytes], fmt: str) -> Tuple[int, ...]:
    return struct.unpack(fmt, f.read(struct.calcsize(fmt)))


def _parse_ld_musl_from_elf(f: IO[bytes]) -> Optional[str]:
    """Detect musl libc location by parsing the Python executable.

    Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca
    ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
    """
    f.seek(0)
    try:
        ident = _read_unpacked(f, "16B")
    except struct.error:
        return None
    if ident[:4] != tuple(b"\x7fELF"):  # Invalid magic, not ELF.
        return None
    f.seek(struct.calcsize("HHI"), 1)  # Skip file type, machine, and version.

    try:
        # e_fmt: Format for program header.
        # p_fmt: Format for section header.
        # p_idx: Indexes to find p_type, p_offset, and p_filesz.
        e_fmt, p_fmt, p_idx = {
            1: ("IIIIHHH", "IIIIIIII", (0, 1, 4)),  # 32-bit.
            2: ("QQQIHHH", "IIQQQQQQ", (0, 2, 5)),  # 64-bit.
        }[ident[4]]
    except KeyError:
        return None
    else:
        p_get = operator.itemgetter(*p_idx)

    # Find the interpreter section and return its content.
    try:
        _, e_phoff, _, _, _, e_phentsize, e_phnum = _read_unpacked(f, e_fmt)
    except struct.error:
        return None
    for i in range(e_phnum + 1):
        f.seek(e_phoff + e_phentsize * i)
        try:
            p_type, p_offset, p_filesz = p_get(_read_unpacked(f, p_fmt))
        except struct.error:
            return None
        if p_type != 3:  # Not PT_INTERP.
            continue
        f.seek(p_offset)
        interpreter = os.fsdecode(f.read(p_filesz)).strip("\0")
        if "musl" not in interpreter:
            return None
        return interpreter
    return None


class _MuslVersion(NamedTuple):
    major: int
    minor: int


def _parse_musl_version(output: str) -> Optional[_MuslVersion]:
    lines = [n for n in (n.strip() for n in output.splitlines()) if n]
    if len(lines) < 2 or lines[0][:4] != "musl":
        return None
    m = re.match(r"Version (\d+)\.(\d+)", lines[1])
    if not m:
        return None
    return _MuslVersion(major=int(m.group(1)), minor=int(m.group(2)))


@functools.lru_cache()
def _get_musl_version(executable: str) -> Optional[_MuslVersion]:
    """Detect currently-running musl runtime version.

    This is done by checking the specified executable's dynamic linking
    information, and invoking the loader to parse its output for a version
    string. If the loader is musl, the output would be something like::

        musl libc (x86_64)
        Version 1.2.2
        Dynamic Program Loader
    """
    with contextlib.ExitStack() as stack:
        try:
            f = stack.enter_context(open(executable, "rb"))
        except OSError:
            return None
        ld = _parse_ld_musl_from_elf(f)
    if not ld:
        return None
    proc = subprocess.run([ld], stderr=subprocess.PIPE, universal_newlines=True)
    return _parse_musl_version(proc.stderr)


def platform_tags(arch: str) -> Iterator[str]:
    """Generate musllinux tags compatible to the current platform.

    :param arch: Should be the part of platform tag after the ``linux_``
        prefix, e.g. ``x86_64``. The ``linux_`` prefix is assumed as a
        prerequisite for the current platform to be musllinux-compatible.

    :returns: An iterator of compatible musllinux tags.
    """
    sys_musl = _get_musl_version(sys.executable)
    if sys_musl is None:  # Python not dynamically linked against musl.
        return
    for minor in range(sys_musl.minor, -1, -1):
        yield f"musllinux_{sys_musl.major}_{minor}_{arch}"


if __name__ == "__main__":  # pragma: no cover
    import sysconfig

    plat = sysconfig.get_platform()
    assert plat.startswith("linux-"), "not linux"

    print("plat:", plat)
    print("musl:", _get_musl_version(sys.executable))
    print("tags:", end=" ")
    for t in platform_tags(re.sub(r"[.-]", "_", plat.split("-", 1)[-1])):
        print(t, end="\n      ")
PK!*:c,,_vendor/packaging/_manylinux.pynu[import collections
import functools
import os
import re
import struct
import sys
import warnings
from typing import IO, Dict, Iterator, NamedTuple, Optional, Tuple


# Python does not provide platform information at sufficient granularity to
# identify the architecture of the running executable in some cases, so we
# determine it dynamically by reading the information from the running
# process. This only applies on Linux, which uses the ELF format.
class _ELFFileHeader:
    # https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
    class _InvalidELFFileHeader(ValueError):
        """
        An invalid ELF file header was found.
        """

    ELF_MAGIC_NUMBER = 0x7F454C46
    ELFCLASS32 = 1
    ELFCLASS64 = 2
    ELFDATA2LSB = 1
    ELFDATA2MSB = 2
    EM_386 = 3
    EM_S390 = 22
    EM_ARM = 40
    EM_X86_64 = 62
    EF_ARM_ABIMASK = 0xFF000000
    EF_ARM_ABI_VER5 = 0x05000000
    EF_ARM_ABI_FLOAT_HARD = 0x00000400

    def __init__(self, file: IO[bytes]) -> None:
        def unpack(fmt: str) -> int:
            try:
                data = file.read(struct.calcsize(fmt))
                result: Tuple[int, ...] = struct.unpack(fmt, data)
            except struct.error:
                raise _ELFFileHeader._InvalidELFFileHeader()
            return result[0]

        self.e_ident_magic = unpack(">I")
        if self.e_ident_magic != self.ELF_MAGIC_NUMBER:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_class = unpack("B")
        if self.e_ident_class not in {self.ELFCLASS32, self.ELFCLASS64}:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_data = unpack("B")
        if self.e_ident_data not in {self.ELFDATA2LSB, self.ELFDATA2MSB}:
            raise _ELFFileHeader._InvalidELFFileHeader()
        self.e_ident_version = unpack("B")
        self.e_ident_osabi = unpack("B")
        self.e_ident_abiversion = unpack("B")
        self.e_ident_pad = file.read(7)
        format_h = "H"
        format_i = "I"
        format_q = "Q"
        format_p = format_i if self.e_ident_class == self.ELFCLASS32 else format_q
        self.e_type = unpack(format_h)
        self.e_machine = unpack(format_h)
        self.e_version = unpack(format_i)
        self.e_entry = unpack(format_p)
        self.e_phoff = unpack(format_p)
        self.e_shoff = unpack(format_p)
        self.e_flags = unpack(format_i)
        self.e_ehsize = unpack(format_h)
        self.e_phentsize = unpack(format_h)
        self.e_phnum = unpack(format_h)
        self.e_shentsize = unpack(format_h)
        self.e_shnum = unpack(format_h)
        self.e_shstrndx = unpack(format_h)


def _get_elf_header() -> Optional[_ELFFileHeader]:
    try:
        with open(sys.executable, "rb") as f:
            elf_header = _ELFFileHeader(f)
    except (OSError, TypeError, _ELFFileHeader._InvalidELFFileHeader):
        return None
    return elf_header


def _is_linux_armhf() -> bool:
    # hard-float ABI can be detected from the ELF header of the running
    # process
    # https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
    elf_header = _get_elf_header()
    if elf_header is None:
        return False
    result = elf_header.e_ident_class == elf_header.ELFCLASS32
    result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
    result &= elf_header.e_machine == elf_header.EM_ARM
    result &= (
        elf_header.e_flags & elf_header.EF_ARM_ABIMASK
    ) == elf_header.EF_ARM_ABI_VER5
    result &= (
        elf_header.e_flags & elf_header.EF_ARM_ABI_FLOAT_HARD
    ) == elf_header.EF_ARM_ABI_FLOAT_HARD
    return result


def _is_linux_i686() -> bool:
    elf_header = _get_elf_header()
    if elf_header is None:
        return False
    result = elf_header.e_ident_class == elf_header.ELFCLASS32
    result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
    result &= elf_header.e_machine == elf_header.EM_386
    return result


def _have_compatible_abi(arch: str) -> bool:
    if arch == "armv7l":
        return _is_linux_armhf()
    if arch == "i686":
        return _is_linux_i686()
    return arch in {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"}


# If glibc ever changes its major version, we need to know what the last
# minor version was, so we can build the complete list of all versions.
# For now, guess what the highest minor version might be, assume it will
# be 50 for testing. Once this actually happens, update the dictionary
# with the actual value.
_LAST_GLIBC_MINOR: Dict[int, int] = collections.defaultdict(lambda: 50)


class _GLibCVersion(NamedTuple):
    major: int
    minor: int


def _glibc_version_string_confstr() -> Optional[str]:
    """
    Primary implementation of glibc_version_string using os.confstr.
    """
    # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
    # to be broken or missing. This strategy is used in the standard library
    # platform module.
    # https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
    try:
        # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17".
        version_string = os.confstr("CS_GNU_LIBC_VERSION")
        assert version_string is not None
        _, version = version_string.split()
    except (AssertionError, AttributeError, OSError, ValueError):
        # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
        return None
    return version


def _glibc_version_string_ctypes() -> Optional[str]:
    """
    Fallback implementation of glibc_version_string using ctypes.
    """
    try:
        import ctypes
    except ImportError:
        return None

    # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
    # manpage says, "If filename is NULL, then the returned handle is for the
    # main program". This way we can let the linker do the work to figure out
    # which libc our process is actually using.
    #
    # We must also handle the special case where the executable is not a
    # dynamically linked executable. This can occur when using musl libc,
    # for example. In this situation, dlopen() will error, leading to an
    # OSError. Interestingly, at least in the case of musl, there is no
    # errno set on the OSError. The single string argument used to construct
    # OSError comes from libc itself and is therefore not portable to
    # hard code here. In any case, failure to call dlopen() means we
    # can proceed, so we bail on our attempt.
    try:
        process_namespace = ctypes.CDLL(None)
    except OSError:
        return None

    try:
        gnu_get_libc_version = process_namespace.gnu_get_libc_version
    except AttributeError:
        # Symbol doesn't exist -> therefore, we are not linked to
        # glibc.
        return None

    # Call gnu_get_libc_version, which returns a string like "2.5"
    gnu_get_libc_version.restype = ctypes.c_char_p
    version_str: str = gnu_get_libc_version()
    # py2 / py3 compatibility:
    if not isinstance(version_str, str):
        version_str = version_str.decode("ascii")

    return version_str


def _glibc_version_string() -> Optional[str]:
    """Returns glibc version string, or None if not using glibc."""
    return _glibc_version_string_confstr() or _glibc_version_string_ctypes()


def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
    """Parse glibc version.

    We use a regexp instead of str.split because we want to discard any
    random junk that might come after the minor version -- this might happen
    in patched/forked versions of glibc (e.g. Linaro's version of glibc
    uses version strings like "2.20-2014.11"). See gh-3588.
    """
    m = re.match(r"(?P[0-9]+)\.(?P[0-9]+)", version_str)
    if not m:
        warnings.warn(
            "Expected glibc version with 2 components major.minor,"
            " got: %s" % version_str,
            RuntimeWarning,
        )
        return -1, -1
    return int(m.group("major")), int(m.group("minor"))


@functools.lru_cache()
def _get_glibc_version() -> Tuple[int, int]:
    version_str = _glibc_version_string()
    if version_str is None:
        return (-1, -1)
    return _parse_glibc_version(version_str)


# From PEP 513, PEP 600
def _is_compatible(name: str, arch: str, version: _GLibCVersion) -> bool:
    sys_glibc = _get_glibc_version()
    if sys_glibc < version:
        return False
    # Check for presence of _manylinux module.
    try:
        import _manylinux  # noqa
    except ImportError:
        return True
    if hasattr(_manylinux, "manylinux_compatible"):
        result = _manylinux.manylinux_compatible(version[0], version[1], arch)
        if result is not None:
            return bool(result)
        return True
    if version == _GLibCVersion(2, 5):
        if hasattr(_manylinux, "manylinux1_compatible"):
            return bool(_manylinux.manylinux1_compatible)
    if version == _GLibCVersion(2, 12):
        if hasattr(_manylinux, "manylinux2010_compatible"):
            return bool(_manylinux.manylinux2010_compatible)
    if version == _GLibCVersion(2, 17):
        if hasattr(_manylinux, "manylinux2014_compatible"):
            return bool(_manylinux.manylinux2014_compatible)
    return True


_LEGACY_MANYLINUX_MAP = {
    # CentOS 7 w/ glibc 2.17 (PEP 599)
    (2, 17): "manylinux2014",
    # CentOS 6 w/ glibc 2.12 (PEP 571)
    (2, 12): "manylinux2010",
    # CentOS 5 w/ glibc 2.5 (PEP 513)
    (2, 5): "manylinux1",
}


def platform_tags(linux: str, arch: str) -> Iterator[str]:
    if not _have_compatible_abi(arch):
        return
    # Oldest glibc to be supported regardless of architecture is (2, 17).
    too_old_glibc2 = _GLibCVersion(2, 16)
    if arch in {"x86_64", "i686"}:
        # On x86/i686 also oldest glibc to be supported is (2, 5).
        too_old_glibc2 = _GLibCVersion(2, 4)
    current_glibc = _GLibCVersion(*_get_glibc_version())
    glibc_max_list = [current_glibc]
    # We can assume compatibility across glibc major versions.
    # https://sourceware.org/bugzilla/show_bug.cgi?id=24636
    #
    # Build a list of maximum glibc versions so that we can
    # output the canonical list of all glibc from current_glibc
    # down to too_old_glibc2, including all intermediary versions.
    for glibc_major in range(current_glibc.major - 1, 1, -1):
        glibc_minor = _LAST_GLIBC_MINOR[glibc_major]
        glibc_max_list.append(_GLibCVersion(glibc_major, glibc_minor))
    for glibc_max in glibc_max_list:
        if glibc_max.major == too_old_glibc2.major:
            min_minor = too_old_glibc2.minor
        else:
            # For other glibc major versions oldest supported is (x, 0).
            min_minor = -1
        for glibc_minor in range(glibc_max.minor, min_minor, -1):
            glibc_version = _GLibCVersion(glibc_max.major, glibc_minor)
            tag = "manylinux_{}_{}".format(*glibc_version)
            if _is_compatible(tag, arch, glibc_version):
                yield linux.replace("linux", tag)
            # Handle the legacy manylinux1, manylinux2010, manylinux2014 tags.
            if glibc_version in _LEGACY_MANYLINUX_MAP:
                legacy_tag = _LEGACY_MANYLINUX_MAP[glibc_version]
                if _is_compatible(legacy_tag, arch, glibc_version):
                    yield linux.replace("linux", legacy_tag)
PK!ah_vendor/more_itertools/more.pynu[import warnings

from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from concurrent.futures import ThreadPoolExecutor
from functools import partial, reduce, wraps
from heapq import merge, heapify, heapreplace, heappop
from itertools import (
    chain,
    compress,
    count,
    cycle,
    dropwhile,
    groupby,
    islice,
    repeat,
    starmap,
    takewhile,
    tee,
    zip_longest,
)
from math import exp, factorial, floor, log
from queue import Empty, Queue
from random import random, randrange, uniform
from operator import itemgetter, mul, sub, gt, lt
from sys import hexversion, maxsize
from time import monotonic

from .recipes import (
    consume,
    flatten,
    pairwise,
    powerset,
    take,
    unique_everseen,
)

__all__ = [
    'AbortThread',
    'adjacent',
    'always_iterable',
    'always_reversible',
    'bucket',
    'callback_iter',
    'chunked',
    'circular_shifts',
    'collapse',
    'collate',
    'consecutive_groups',
    'consumer',
    'countable',
    'count_cycle',
    'mark_ends',
    'difference',
    'distinct_combinations',
    'distinct_permutations',
    'distribute',
    'divide',
    'exactly_n',
    'filter_except',
    'first',
    'groupby_transform',
    'ilen',
    'interleave_longest',
    'interleave',
    'intersperse',
    'islice_extended',
    'iterate',
    'ichunked',
    'is_sorted',
    'last',
    'locate',
    'lstrip',
    'make_decorator',
    'map_except',
    'map_reduce',
    'nth_or_last',
    'nth_permutation',
    'nth_product',
    'numeric_range',
    'one',
    'only',
    'padded',
    'partitions',
    'set_partitions',
    'peekable',
    'repeat_last',
    'replace',
    'rlocate',
    'rstrip',
    'run_length',
    'sample',
    'seekable',
    'SequenceView',
    'side_effect',
    'sliced',
    'sort_together',
    'split_at',
    'split_after',
    'split_before',
    'split_when',
    'split_into',
    'spy',
    'stagger',
    'strip',
    'substrings',
    'substrings_indexes',
    'time_limited',
    'unique_to_each',
    'unzip',
    'windowed',
    'with_iter',
    'UnequalIterablesError',
    'zip_equal',
    'zip_offset',
    'windowed_complete',
    'all_unique',
    'value_chain',
    'product_index',
    'combination_index',
    'permutation_index',
]

_marker = object()


def chunked(iterable, n, strict=False):
    """Break *iterable* into lists of length *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]

    By the default, the last yielded list will have fewer than *n* elements
    if the length of *iterable* is not divisible by *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
        [[1, 2, 3], [4, 5, 6], [7, 8]]

    To use a fill-in value instead, see the :func:`grouper` recipe.

    If the length of *iterable* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    list is yielded.

    """
    iterator = iter(partial(take, n, iter(iterable)), [])
    if strict:

        def ret():
            for chunk in iterator:
                if len(chunk) != n:
                    raise ValueError('iterable is not divisible by n.')
                yield chunk

        return iter(ret())
    else:
        return iterator


def first(iterable, default=_marker):
    """Return the first item of *iterable*, or *default* if *iterable* is
    empty.

        >>> first([0, 1, 2, 3])
        0
        >>> first([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.

    :func:`first` is useful when you have a generator of expensive-to-retrieve
    values and want any arbitrary one. It is marginally shorter than
    ``next(iter(iterable), default)``.

    """
    try:
        return next(iter(iterable))
    except StopIteration as e:
        if default is _marker:
            raise ValueError(
                'first() was called on an empty iterable, and no '
                'default value was provided.'
            ) from e
        return default


def last(iterable, default=_marker):
    """Return the last item of *iterable*, or *default* if *iterable* is
    empty.

        >>> last([0, 1, 2, 3])
        3
        >>> last([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    """
    try:
        if isinstance(iterable, Sequence):
            return iterable[-1]
        # Work around https://bugs.python.org/issue38525
        elif hasattr(iterable, '__reversed__') and (hexversion != 0x030800F0):
            return next(reversed(iterable))
        else:
            return deque(iterable, maxlen=1)[-1]
    except (IndexError, TypeError, StopIteration):
        if default is _marker:
            raise ValueError(
                'last() was called on an empty iterable, and no default was '
                'provided.'
            )
        return default


def nth_or_last(iterable, n, default=_marker):
    """Return the nth or the last item of *iterable*,
    or *default* if *iterable* is empty.

        >>> nth_or_last([0, 1, 2, 3], 2)
        2
        >>> nth_or_last([0, 1], 2)
        1
        >>> nth_or_last([], 0, 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    """
    return last(islice(iterable, n + 1), default=default)


class peekable:
    """Wrap an iterator to allow lookahead and prepending elements.

    Call :meth:`peek` on the result to get the value that will be returned
    by :func:`next`. This won't advance the iterator:

        >>> p = peekable(['a', 'b'])
        >>> p.peek()
        'a'
        >>> next(p)
        'a'

    Pass :meth:`peek` a default value to return that instead of raising
    ``StopIteration`` when the iterator is exhausted.

        >>> p = peekable([])
        >>> p.peek('hi')
        'hi'

    peekables also offer a :meth:`prepend` method, which "inserts" items
    at the head of the iterable:

        >>> p = peekable([1, 2, 3])
        >>> p.prepend(10, 11, 12)
        >>> next(p)
        10
        >>> p.peek()
        11
        >>> list(p)
        [11, 12, 1, 2, 3]

    peekables can be indexed. Index 0 is the item that will be returned by
    :func:`next`, index 1 is the item after that, and so on:
    The values up to the given index will be cached.

        >>> p = peekable(['a', 'b', 'c', 'd'])
        >>> p[0]
        'a'
        >>> p[1]
        'b'
        >>> next(p)
        'a'

    Negative indexes are supported, but be aware that they will cache the
    remaining items in the source iterator, which may require significant
    storage.

    To check whether a peekable is exhausted, check its truth value:

        >>> p = peekable(['a', 'b'])
        >>> if p:  # peekable has items
        ...     list(p)
        ['a', 'b']
        >>> if not p:  # peekable is exhausted
        ...     list(p)
        []

    """

    def __init__(self, iterable):
        self._it = iter(iterable)
        self._cache = deque()

    def __iter__(self):
        return self

    def __bool__(self):
        try:
            self.peek()
        except StopIteration:
            return False
        return True

    def peek(self, default=_marker):
        """Return the item that will be next returned from ``next()``.

        Return ``default`` if there are no items left. If ``default`` is not
        provided, raise ``StopIteration``.

        """
        if not self._cache:
            try:
                self._cache.append(next(self._it))
            except StopIteration:
                if default is _marker:
                    raise
                return default
        return self._cache[0]

    def prepend(self, *items):
        """Stack up items to be the next ones returned from ``next()`` or
        ``self.peek()``. The items will be returned in
        first in, first out order::

            >>> p = peekable([1, 2, 3])
            >>> p.prepend(10, 11, 12)
            >>> next(p)
            10
            >>> list(p)
            [11, 12, 1, 2, 3]

        It is possible, by prepending items, to "resurrect" a peekable that
        previously raised ``StopIteration``.

            >>> p = peekable([])
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration
            >>> p.prepend(1)
            >>> next(p)
            1
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration

        """
        self._cache.extendleft(reversed(items))

    def __next__(self):
        if self._cache:
            return self._cache.popleft()

        return next(self._it)

    def _get_slice(self, index):
        # Normalize the slice's arguments
        step = 1 if (index.step is None) else index.step
        if step > 0:
            start = 0 if (index.start is None) else index.start
            stop = maxsize if (index.stop is None) else index.stop
        elif step < 0:
            start = -1 if (index.start is None) else index.start
            stop = (-maxsize - 1) if (index.stop is None) else index.stop
        else:
            raise ValueError('slice step cannot be zero')

        # If either the start or stop index is negative, we'll need to cache
        # the rest of the iterable in order to slice from the right side.
        if (start < 0) or (stop < 0):
            self._cache.extend(self._it)
        # Otherwise we'll need to find the rightmost index and cache to that
        # point.
        else:
            n = min(max(start, stop) + 1, maxsize)
            cache_len = len(self._cache)
            if n >= cache_len:
                self._cache.extend(islice(self._it, n - cache_len))

        return list(self._cache)[index]

    def __getitem__(self, index):
        if isinstance(index, slice):
            return self._get_slice(index)

        cache_len = len(self._cache)
        if index < 0:
            self._cache.extend(self._it)
        elif index >= cache_len:
            self._cache.extend(islice(self._it, index + 1 - cache_len))

        return self._cache[index]


def collate(*iterables, **kwargs):
    """Return a sorted merge of the items from each of several already-sorted
    *iterables*.

        >>> list(collate('ACDZ', 'AZ', 'JKL'))
        ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']

    Works lazily, keeping only the next value from each iterable in memory. Use
    :func:`collate` to, for example, perform a n-way mergesort of items that
    don't fit in memory.

    If a *key* function is specified, the iterables will be sorted according
    to its result:

        >>> key = lambda s: int(s)  # Sort by numeric value, not by string
        >>> list(collate(['1', '10'], ['2', '11'], key=key))
        ['1', '2', '10', '11']


    If the *iterables* are sorted in descending order, set *reverse* to
    ``True``:

        >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
        [5, 4, 3, 2, 1, 0]

    If the elements of the passed-in iterables are out of order, you might get
    unexpected results.

    On Python 3.5+, this function is an alias for :func:`heapq.merge`.

    """
    warnings.warn(
        "collate is no longer part of more_itertools, use heapq.merge",
        DeprecationWarning,
    )
    return merge(*iterables, **kwargs)


def consumer(func):
    """Decorator that automatically advances a PEP-342-style "reverse iterator"
    to its first yield point so you don't have to call ``next()`` on it
    manually.

        >>> @consumer
        ... def tally():
        ...     i = 0
        ...     while True:
        ...         print('Thing number %s is %s.' % (i, (yield)))
        ...         i += 1
        ...
        >>> t = tally()
        >>> t.send('red')
        Thing number 0 is red.
        >>> t.send('fish')
        Thing number 1 is fish.

    Without the decorator, you would have to call ``next(t)`` before
    ``t.send()`` could be used.

    """

    @wraps(func)
    def wrapper(*args, **kwargs):
        gen = func(*args, **kwargs)
        next(gen)
        return gen

    return wrapper


def ilen(iterable):
    """Return the number of items in *iterable*.

        >>> ilen(x for x in range(1000000) if x % 3 == 0)
        333334

    This consumes the iterable, so handle with care.

    """
    # This approach was selected because benchmarks showed it's likely the
    # fastest of the known implementations at the time of writing.
    # See GitHub tracker: #236, #230.
    counter = count()
    deque(zip(iterable, counter), maxlen=0)
    return next(counter)


def iterate(func, start):
    """Return ``start``, ``func(start)``, ``func(func(start))``, ...

    >>> from itertools import islice
    >>> list(islice(iterate(lambda x: 2*x, 1), 10))
    [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

    """
    while True:
        yield start
        start = func(start)


def with_iter(context_manager):
    """Wrap an iterable in a ``with`` statement, so it closes once exhausted.

    For example, this will close the file when the iterator is exhausted::

        upper_lines = (line.upper() for line in with_iter(open('foo')))

    Any context manager which returns an iterable is a candidate for
    ``with_iter``.

    """
    with context_manager as iterable:
        yield from iterable


def one(iterable, too_short=None, too_long=None):
    """Return the first item from *iterable*, which is expected to contain only
    that item. Raise an exception if *iterable* is empty or has more than one
    item.

    :func:`one` is useful for ensuring that an iterable contains only one item.
    For example, it can be used to retrieve the result of a database query
    that is expected to return a single row.

    If *iterable* is empty, ``ValueError`` will be raised. You may specify a
    different exception with the *too_short* keyword:

        >>> it = []
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: too many items in iterable (expected 1)'
        >>> too_short = IndexError('too few items')
        >>> one(it, too_short=too_short)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        IndexError: too few items

    Similarly, if *iterable* contains more than one item, ``ValueError`` will
    be raised. You may specify a different exception with the *too_long*
    keyword:

        >>> it = ['too', 'many']
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: Expected exactly one item in iterable, but got 'too',
        'many', and perhaps more.
        >>> too_long = RuntimeError
        >>> one(it, too_long=too_long)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        RuntimeError

    Note that :func:`one` attempts to advance *iterable* twice to ensure there
    is only one item. See :func:`spy` or :func:`peekable` to check iterable
    contents less destructively.

    """
    it = iter(iterable)

    try:
        first_value = next(it)
    except StopIteration as e:
        raise (
            too_short or ValueError('too few items in iterable (expected 1)')
        ) from e

    try:
        second_value = next(it)
    except StopIteration:
        pass
    else:
        msg = (
            'Expected exactly one item in iterable, but got {!r}, {!r}, '
            'and perhaps more.'.format(first_value, second_value)
        )
        raise too_long or ValueError(msg)

    return first_value


def distinct_permutations(iterable, r=None):
    """Yield successive distinct permutations of the elements in *iterable*.

        >>> sorted(distinct_permutations([1, 0, 1]))
        [(0, 1, 1), (1, 0, 1), (1, 1, 0)]

    Equivalent to ``set(permutations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    Duplicate permutations arise when there are duplicated elements in the
    input iterable. The number of items returned is
    `n! / (x_1! * x_2! * ... * x_n!)`, where `n` is the total number of
    items input, and each `x_i` is the count of a distinct item in the input
    sequence.

    If *r* is given, only the *r*-length permutations are yielded.

        >>> sorted(distinct_permutations([1, 0, 1], r=2))
        [(0, 1), (1, 0), (1, 1)]
        >>> sorted(distinct_permutations(range(3), r=2))
        [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

    """
    # Algorithm: https://w.wiki/Qai
    def _full(A):
        while True:
            # Yield the permutation we have
            yield tuple(A)

            # Find the largest index i such that A[i] < A[i + 1]
            for i in range(size - 2, -1, -1):
                if A[i] < A[i + 1]:
                    break
            #  If no such index exists, this permutation is the last one
            else:
                return

            # Find the largest index j greater than j such that A[i] < A[j]
            for j in range(size - 1, i, -1):
                if A[i] < A[j]:
                    break

            # Swap the value of A[i] with that of A[j], then reverse the
            # sequence from A[i + 1] to form the new permutation
            A[i], A[j] = A[j], A[i]
            A[i + 1 :] = A[: i - size : -1]  # A[i + 1:][::-1]

    # Algorithm: modified from the above
    def _partial(A, r):
        # Split A into the first r items and the last r items
        head, tail = A[:r], A[r:]
        right_head_indexes = range(r - 1, -1, -1)
        left_tail_indexes = range(len(tail))

        while True:
            # Yield the permutation we have
            yield tuple(head)

            # Starting from the right, find the first index of the head with
            # value smaller than the maximum value of the tail - call it i.
            pivot = tail[-1]
            for i in right_head_indexes:
                if head[i] < pivot:
                    break
                pivot = head[i]
            else:
                return

            # Starting from the left, find the first value of the tail
            # with a value greater than head[i] and swap.
            for j in left_tail_indexes:
                if tail[j] > head[i]:
                    head[i], tail[j] = tail[j], head[i]
                    break
            # If we didn't find one, start from the right and find the first
            # index of the head with a value greater than head[i] and swap.
            else:
                for j in right_head_indexes:
                    if head[j] > head[i]:
                        head[i], head[j] = head[j], head[i]
                        break

            # Reverse head[i + 1:] and swap it with tail[:r - (i + 1)]
            tail += head[: i - r : -1]  # head[i + 1:][::-1]
            i += 1
            head[i:], tail[:] = tail[: r - i], tail[r - i :]

    items = sorted(iterable)

    size = len(items)
    if r is None:
        r = size

    if 0 < r <= size:
        return _full(items) if (r == size) else _partial(items, r)

    return iter(() if r else ((),))


def intersperse(e, iterable, n=1):
    """Intersperse filler element *e* among the items in *iterable*, leaving
    *n* items between each filler element.

        >>> list(intersperse('!', [1, 2, 3, 4, 5]))
        [1, '!', 2, '!', 3, '!', 4, '!', 5]

        >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2))
        [1, 2, None, 3, 4, None, 5]

    """
    if n == 0:
        raise ValueError('n must be > 0')
    elif n == 1:
        # interleave(repeat(e), iterable) -> e, x_0, e, e, x_1, e, x_2...
        # islice(..., 1, None) -> x_0, e, e, x_1, e, x_2...
        return islice(interleave(repeat(e), iterable), 1, None)
    else:
        # interleave(filler, chunks) -> [e], [x_0, x_1], [e], [x_2, x_3]...
        # islice(..., 1, None) -> [x_0, x_1], [e], [x_2, x_3]...
        # flatten(...) -> x_0, x_1, e, x_2, x_3...
        filler = repeat([e])
        chunks = chunked(iterable, n)
        return flatten(islice(interleave(filler, chunks), 1, None))


def unique_to_each(*iterables):
    """Return the elements from each of the input iterables that aren't in the
    other input iterables.

    For example, suppose you have a set of packages, each with a set of
    dependencies::

        {'pkg_1': {'A', 'B'}, 'pkg_2': {'B', 'C'}, 'pkg_3': {'B', 'D'}}

    If you remove one package, which dependencies can also be removed?

    If ``pkg_1`` is removed, then ``A`` is no longer necessary - it is not
    associated with ``pkg_2`` or ``pkg_3``. Similarly, ``C`` is only needed for
    ``pkg_2``, and ``D`` is only needed for ``pkg_3``::

        >>> unique_to_each({'A', 'B'}, {'B', 'C'}, {'B', 'D'})
        [['A'], ['C'], ['D']]

    If there are duplicates in one input iterable that aren't in the others
    they will be duplicated in the output. Input order is preserved::

        >>> unique_to_each("mississippi", "missouri")
        [['p', 'p'], ['o', 'u', 'r']]

    It is assumed that the elements of each iterable are hashable.

    """
    pool = [list(it) for it in iterables]
    counts = Counter(chain.from_iterable(map(set, pool)))
    uniques = {element for element in counts if counts[element] == 1}
    return [list(filter(uniques.__contains__, it)) for it in pool]


def windowed(seq, n, fillvalue=None, step=1):
    """Return a sliding window of width *n* over the given iterable.

        >>> all_windows = windowed([1, 2, 3, 4, 5], 3)
        >>> list(all_windows)
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    When the window is larger than the iterable, *fillvalue* is used in place
    of missing values:

        >>> list(windowed([1, 2, 3], 4))
        [(1, 2, 3, None)]

    Each window will advance in increments of *step*:

        >>> list(windowed([1, 2, 3, 4, 5, 6], 3, fillvalue='!', step=2))
        [(1, 2, 3), (3, 4, 5), (5, 6, '!')]

    To slide into the iterable's items, use :func:`chain` to add filler items
    to the left:

        >>> iterable = [1, 2, 3, 4]
        >>> n = 3
        >>> padding = [None] * (n - 1)
        >>> list(windowed(chain(padding, iterable), 3))
        [(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
    """
    if n < 0:
        raise ValueError('n must be >= 0')
    if n == 0:
        yield tuple()
        return
    if step < 1:
        raise ValueError('step must be >= 1')

    window = deque(maxlen=n)
    i = n
    for _ in map(window.append, seq):
        i -= 1
        if not i:
            i = step
            yield tuple(window)

    size = len(window)
    if size < n:
        yield tuple(chain(window, repeat(fillvalue, n - size)))
    elif 0 < i < min(step, n):
        window += (fillvalue,) * i
        yield tuple(window)


def substrings(iterable):
    """Yield all of the substrings of *iterable*.

        >>> [''.join(s) for s in substrings('more')]
        ['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']

    Note that non-string iterables can also be subdivided.

        >>> list(substrings([0, 1, 2]))
        [(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)]

    """
    # The length-1 substrings
    seq = []
    for item in iter(iterable):
        seq.append(item)
        yield (item,)
    seq = tuple(seq)
    item_count = len(seq)

    # And the rest
    for n in range(2, item_count + 1):
        for i in range(item_count - n + 1):
            yield seq[i : i + n]


def substrings_indexes(seq, reverse=False):
    """Yield all substrings and their positions in *seq*

    The items yielded will be a tuple of the form ``(substr, i, j)``, where
    ``substr == seq[i:j]``.

    This function only works for iterables that support slicing, such as
    ``str`` objects.

    >>> for item in substrings_indexes('more'):
    ...    print(item)
    ('m', 0, 1)
    ('o', 1, 2)
    ('r', 2, 3)
    ('e', 3, 4)
    ('mo', 0, 2)
    ('or', 1, 3)
    ('re', 2, 4)
    ('mor', 0, 3)
    ('ore', 1, 4)
    ('more', 0, 4)

    Set *reverse* to ``True`` to yield the same items in the opposite order.


    """
    r = range(1, len(seq) + 1)
    if reverse:
        r = reversed(r)
    return (
        (seq[i : i + L], i, i + L) for L in r for i in range(len(seq) - L + 1)
    )


class bucket:
    """Wrap *iterable* and return an object that buckets it iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    """

    def __init__(self, iterable, key, validator=None):
        self._it = iter(iterable)
        self._key = key
        self._cache = defaultdict(deque)
        self._validator = validator or (lambda x: True)

    def __contains__(self, value):
        if not self._validator(value):
            return False

        try:
            item = next(self[value])
        except StopIteration:
            return False
        else:
            self._cache[value].appendleft(item)

        return True

    def _get_values(self, value):
        """
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        """
        while True:
            # If we've cached some items that match the target value, emit
            # the first one and evict it from the cache.
            if self._cache[value]:
                yield self._cache[value].popleft()
            # Otherwise we need to advance the parent iterator to search for
            # a matching item, caching the rest.
            else:
                while True:
                    try:
                        item = next(self._it)
                    except StopIteration:
                        return
                    item_value = self._key(item)
                    if item_value == value:
                        yield item
                        break
                    elif self._validator(item_value):
                        self._cache[item_value].append(item)

    def __iter__(self):
        for item in self._it:
            item_value = self._key(item)
            if self._validator(item_value):
                self._cache[item_value].append(item)

        yield from self._cache.keys()

    def __getitem__(self, value):
        if not self._validator(value):
            return iter(())

        return self._get_values(value)


def spy(iterable, n=1):
    """Return a 2-tuple with a list containing the first *n* elements of
    *iterable*, and an iterator with the same items as *iterable*.
    This allows you to "look ahead" at the items in the iterable without
    advancing it.

    There is one item in the list by default:

        >>> iterable = 'abcdefg'
        >>> head, iterable = spy(iterable)
        >>> head
        ['a']
        >>> list(iterable)
        ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    You may use unpacking to retrieve items instead of lists:

        >>> (head,), iterable = spy('abcdefg')
        >>> head
        'a'
        >>> (first, second), iterable = spy('abcdefg', 2)
        >>> first
        'a'
        >>> second
        'b'

    The number of items requested can be larger than the number of items in
    the iterable:

        >>> iterable = [1, 2, 3, 4, 5]
        >>> head, iterable = spy(iterable, 10)
        >>> head
        [1, 2, 3, 4, 5]
        >>> list(iterable)
        [1, 2, 3, 4, 5]

    """
    it = iter(iterable)
    head = take(n, it)

    return head.copy(), chain(head, it)


def interleave(*iterables):
    """Return a new iterable yielding from each iterable in turn,
    until the shortest is exhausted.

        >>> list(interleave([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7]

    For a version that doesn't terminate after the shortest iterable is
    exhausted, see :func:`interleave_longest`.

    """
    return chain.from_iterable(zip(*iterables))


def interleave_longest(*iterables):
    """Return a new iterable yielding from each iterable in turn,
    skipping any that are exhausted.

        >>> list(interleave_longest([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7, 3, 8]

    This function produces the same output as :func:`roundrobin`, but may
    perform better for some inputs (in particular when the number of iterables
    is large).

    """
    i = chain.from_iterable(zip_longest(*iterables, fillvalue=_marker))
    return (x for x in i if x is not _marker)


def collapse(iterable, base_type=None, levels=None):
    """Flatten an iterable with multiple levels of nesting (e.g., a list of
    lists of tuples) into non-iterable types.

        >>> iterable = [(1, 2), ([3, 4], [[5], [6]])]
        >>> list(collapse(iterable))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and
    will not be collapsed.

    To avoid collapsing other types, specify *base_type*:

        >>> iterable = ['ab', ('cd', 'ef'), ['gh', 'ij']]
        >>> list(collapse(iterable, base_type=tuple))
        ['ab', ('cd', 'ef'), 'gh', 'ij']

    Specify *levels* to stop flattening after a certain level:

    >>> iterable = [('a', ['b']), ('c', ['d'])]
    >>> list(collapse(iterable))  # Fully flattened
    ['a', 'b', 'c', 'd']
    >>> list(collapse(iterable, levels=1))  # Only one level flattened
    ['a', ['b'], 'c', ['d']]

    """

    def walk(node, level):
        if (
            ((levels is not None) and (level > levels))
            or isinstance(node, (str, bytes))
            or ((base_type is not None) and isinstance(node, base_type))
        ):
            yield node
            return

        try:
            tree = iter(node)
        except TypeError:
            yield node
            return
        else:
            for child in tree:
                yield from walk(child, level + 1)

    yield from walk(iterable, 0)


def side_effect(func, iterable, chunk_size=None, before=None, after=None):
    """Invoke *func* on each item in *iterable* (or on each *chunk_size* group
    of items) before yielding the item.

    `func` must be a function that takes a single argument. Its return value
    will be discarded.

    *before* and *after* are optional functions that take no arguments. They
    will be executed before iteration starts and after it ends, respectively.

    `side_effect` can be used for logging, updating progress bars, or anything
    that is not functionally "pure."

    Emitting a status message:

        >>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> func = lambda x: print(x, file=f)
        >>> before = lambda: print(u'HEADER', file=f)
        >>> after = f.close
        >>> it = [u'a', u'b', u'c']
        >>> consume(side_effect(func, it, before=before, after=after))
        >>> f.closed
        True

    """
    try:
        if before is not None:
            before()

        if chunk_size is None:
            for item in iterable:
                func(item)
                yield item
        else:
            for chunk in chunked(iterable, chunk_size):
                func(chunk)
                yield from chunk
    finally:
        if after is not None:
            after()


def sliced(seq, n, strict=False):
    """Yield slices of length *n* from the sequence *seq*.

    >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
    [(1, 2, 3), (4, 5, 6)]

    By the default, the last yielded slice will have fewer than *n* elements
    if the length of *seq* is not divisible by *n*:

    >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
    [(1, 2, 3), (4, 5, 6), (7, 8)]

    If the length of *seq* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    slice is yielded.

    This function will only work for iterables that support slicing.
    For non-sliceable iterables, see :func:`chunked`.

    """
    iterator = takewhile(len, (seq[i : i + n] for i in count(0, n)))
    if strict:

        def ret():
            for _slice in iterator:
                if len(_slice) != n:
                    raise ValueError("seq is not divisible by n.")
                yield _slice

        return iter(ret())
    else:
        return iterator


def split_at(iterable, pred, maxsplit=-1, keep_separator=False):
    """Yield lists of items from *iterable*, where each list is delimited by
    an item where callable *pred* returns ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b'))
        [['a'], ['c', 'd', 'c'], ['a']]

        >>> list(split_at(range(10), lambda n: n % 2 == 1))
        [[0], [2], [4], [6], [8], []]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_at(range(10), lambda n: n % 2 == 1, maxsplit=2))
        [[0], [2], [4, 5, 6, 7, 8, 9]]

    By default, the delimiting items are not included in the output.
    The include them, set *keep_separator* to ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b', keep_separator=True))
        [['a'], ['b'], ['c', 'd', 'c'], ['b'], ['a']]

    """
    if maxsplit == 0:
        yield list(iterable)
        return

    buf = []
    it = iter(iterable)
    for item in it:
        if pred(item):
            yield buf
            if keep_separator:
                yield [item]
            if maxsplit == 1:
                yield list(it)
                return
            buf = []
            maxsplit -= 1
        else:
            buf.append(item)
    yield buf


def split_before(iterable, pred, maxsplit=-1):
    """Yield lists of items from *iterable*, where each list ends just before
    an item for which callable *pred* returns ``True``:

        >>> list(split_before('OneTwo', lambda s: s.isupper()))
        [['O', 'n', 'e'], ['T', 'w', 'o']]

        >>> list(split_before(range(10), lambda n: n % 3 == 0))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_before(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]
    """
    if maxsplit == 0:
        yield list(iterable)
        return

    buf = []
    it = iter(iterable)
    for item in it:
        if pred(item) and buf:
            yield buf
            if maxsplit == 1:
                yield [item] + list(it)
                return
            buf = []
            maxsplit -= 1
        buf.append(item)
    if buf:
        yield buf


def split_after(iterable, pred, maxsplit=-1):
    """Yield lists of items from *iterable*, where each list ends with an
    item where callable *pred* returns ``True``:

        >>> list(split_after('one1two2', lambda s: s.isdigit()))
        [['o', 'n', 'e', '1'], ['t', 'w', 'o', '2']]

        >>> list(split_after(range(10), lambda n: n % 3 == 0))
        [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_after(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0], [1, 2, 3], [4, 5, 6, 7, 8, 9]]

    """
    if maxsplit == 0:
        yield list(iterable)
        return

    buf = []
    it = iter(iterable)
    for item in it:
        buf.append(item)
        if pred(item) and buf:
            yield buf
            if maxsplit == 1:
                yield list(it)
                return
            buf = []
            maxsplit -= 1
    if buf:
        yield buf


def split_when(iterable, pred, maxsplit=-1):
    """Split *iterable* into pieces based on the output of *pred*.
    *pred* should be a function that takes successive pairs of items and
    returns ``True`` if the iterable should be split in between them.

    For example, to find runs of increasing numbers, split the iterable when
    element ``i`` is larger than element ``i + 1``:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2], lambda x, y: x > y))
        [[1, 2, 3, 3], [2, 5], [2, 4], [2]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2],
        ...                 lambda x, y: x > y, maxsplit=2))
        [[1, 2, 3, 3], [2, 5], [2, 4, 2]]

    """
    if maxsplit == 0:
        yield list(iterable)
        return

    it = iter(iterable)
    try:
        cur_item = next(it)
    except StopIteration:
        return

    buf = [cur_item]
    for next_item in it:
        if pred(cur_item, next_item):
            yield buf
            if maxsplit == 1:
                yield [next_item] + list(it)
                return
            buf = []
            maxsplit -= 1

        buf.append(next_item)
        cur_item = next_item

    yield buf


def split_into(iterable, sizes):
    """Yield a list of sequential items from *iterable* of length 'n' for each
    integer 'n' in *sizes*.

        >>> list(split_into([1,2,3,4,5,6], [1,2,3]))
        [[1], [2, 3], [4, 5, 6]]

    If the sum of *sizes* is smaller than the length of *iterable*, then the
    remaining items of *iterable* will not be returned.

        >>> list(split_into([1,2,3,4,5,6], [2,3]))
        [[1, 2], [3, 4, 5]]

    If the sum of *sizes* is larger than the length of *iterable*, fewer items
    will be returned in the iteration that overruns *iterable* and further
    lists will be empty:

        >>> list(split_into([1,2,3,4], [1,2,3,4]))
        [[1], [2, 3], [4], []]

    When a ``None`` object is encountered in *sizes*, the returned list will
    contain items up to the end of *iterable* the same way that itertools.slice
    does:

        >>> list(split_into([1,2,3,4,5,6,7,8,9,0], [2,3,None]))
        [[1, 2], [3, 4, 5], [6, 7, 8, 9, 0]]

    :func:`split_into` can be useful for grouping a series of items where the
    sizes of the groups are not uniform. An example would be where in a row
    from a table, multiple columns represent elements of the same feature
    (e.g. a point represented by x,y,z) but, the format is not the same for
    all columns.
    """
    # convert the iterable argument into an iterator so its contents can
    # be consumed by islice in case it is a generator
    it = iter(iterable)

    for size in sizes:
        if size is None:
            yield list(it)
            return
        else:
            yield list(islice(it, size))


def padded(iterable, fillvalue=None, n=None, next_multiple=False):
    """Yield the elements from *iterable*, followed by *fillvalue*, such that
    at least *n* items are emitted.

        >>> list(padded([1, 2, 3], '?', 5))
        [1, 2, 3, '?', '?']

    If *next_multiple* is ``True``, *fillvalue* will be emitted until the
    number of items emitted is a multiple of *n*::

        >>> list(padded([1, 2, 3, 4], n=3, next_multiple=True))
        [1, 2, 3, 4, None, None]

    If *n* is ``None``, *fillvalue* will be emitted indefinitely.

    """
    it = iter(iterable)
    if n is None:
        yield from chain(it, repeat(fillvalue))
    elif n < 1:
        raise ValueError('n must be at least 1')
    else:
        item_count = 0
        for item in it:
            yield item
            item_count += 1

        remaining = (n - item_count) % n if next_multiple else n - item_count
        for _ in range(remaining):
            yield fillvalue


def repeat_last(iterable, default=None):
    """After the *iterable* is exhausted, keep yielding its last element.

        >>> list(islice(repeat_last(range(3)), 5))
        [0, 1, 2, 2, 2]

    If the iterable is empty, yield *default* forever::

        >>> list(islice(repeat_last(range(0), 42), 5))
        [42, 42, 42, 42, 42]

    """
    item = _marker
    for item in iterable:
        yield item
    final = default if item is _marker else item
    yield from repeat(final)


def distribute(n, iterable):
    """Distribute the items from *iterable* among *n* smaller iterables.

        >>> group_1, group_2 = distribute(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 3, 5]
        >>> list(group_2)
        [2, 4, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = distribute(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 4, 7], [2, 5], [3, 6]]

    If the length of *iterable* is smaller than *n*, then the last returned
    iterables will be empty:

        >>> children = distribute(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function uses :func:`itertools.tee` and may require significant
    storage. If you need the order items in the smaller iterables to match the
    original iterable, see :func:`divide`.

    """
    if n < 1:
        raise ValueError('n must be at least 1')

    children = tee(iterable, n)
    return [islice(it, index, None, n) for index, it in enumerate(children)]


def stagger(iterable, offsets=(-1, 0, 1), longest=False, fillvalue=None):
    """Yield tuples whose elements are offset from *iterable*.
    The amount by which the `i`-th item in each tuple is offset is given by
    the `i`-th item in *offsets*.

        >>> list(stagger([0, 1, 2, 3]))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3)]
        >>> list(stagger(range(8), offsets=(0, 2, 4)))
        [(0, 2, 4), (1, 3, 5), (2, 4, 6), (3, 5, 7)]

    By default, the sequence will end when the final element of a tuple is the
    last item in the iterable. To continue until the first element of a tuple
    is the last item in the iterable, set *longest* to ``True``::

        >>> list(stagger([0, 1, 2, 3], longest=True))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3), (2, 3, None), (3, None, None)]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    """
    children = tee(iterable, len(offsets))

    return zip_offset(
        *children, offsets=offsets, longest=longest, fillvalue=fillvalue
    )


class UnequalIterablesError(ValueError):
    def __init__(self, details=None):
        msg = 'Iterables have different lengths'
        if details is not None:
            msg += (': index 0 has length {}; index {} has length {}').format(
                *details
            )

        super().__init__(msg)


def _zip_equal_generator(iterables):
    for combo in zip_longest(*iterables, fillvalue=_marker):
        for val in combo:
            if val is _marker:
                raise UnequalIterablesError()
        yield combo


def zip_equal(*iterables):
    """``zip`` the input *iterables* together, but raise
    ``UnequalIterablesError`` if they aren't all the same length.

        >>> it_1 = range(3)
        >>> it_2 = iter('abc')
        >>> list(zip_equal(it_1, it_2))
        [(0, 'a'), (1, 'b'), (2, 'c')]

        >>> it_1 = range(3)
        >>> it_2 = iter('abcd')
        >>> list(zip_equal(it_1, it_2)) # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        more_itertools.more.UnequalIterablesError: Iterables have different
        lengths

    """
    if hexversion >= 0x30A00A6:
        warnings.warn(
            (
                'zip_equal will be removed in a future version of '
                'more-itertools. Use the builtin zip function with '
                'strict=True instead.'
            ),
            DeprecationWarning,
        )
    # Check whether the iterables are all the same size.
    try:
        first_size = len(iterables[0])
        for i, it in enumerate(iterables[1:], 1):
            size = len(it)
            if size != first_size:
                break
        else:
            # If we didn't break out, we can use the built-in zip.
            return zip(*iterables)

        # If we did break out, there was a mismatch.
        raise UnequalIterablesError(details=(first_size, i, size))
    # If any one of the iterables didn't have a length, start reading
    # them until one runs out.
    except TypeError:
        return _zip_equal_generator(iterables)


def zip_offset(*iterables, offsets, longest=False, fillvalue=None):
    """``zip`` the input *iterables* together, but offset the `i`-th iterable
    by the `i`-th item in *offsets*.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1)))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e')]

    This can be used as a lightweight alternative to SciPy or pandas to analyze
    data sets in which some series have a lead or lag relationship.

    By default, the sequence will end when the shortest iterable is exhausted.
    To continue until the longest iterable is exhausted, set *longest* to
    ``True``.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1), longest=True))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e'), (None, 'f')]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    """
    if len(iterables) != len(offsets):
        raise ValueError("Number of iterables and offsets didn't match")

    staggered = []
    for it, n in zip(iterables, offsets):
        if n < 0:
            staggered.append(chain(repeat(fillvalue, -n), it))
        elif n > 0:
            staggered.append(islice(it, n, None))
        else:
            staggered.append(it)

    if longest:
        return zip_longest(*staggered, fillvalue=fillvalue)

    return zip(*staggered)


def sort_together(iterables, key_list=(0,), key=None, reverse=False):
    """Return the input iterables sorted together, with *key_list* as the
    priority for sorting. All iterables are trimmed to the length of the
    shortest one.

    This can be used like the sorting function in a spreadsheet. If each
    iterable represents a column of data, the key list determines which
    columns are used for sorting.

    By default, all iterables are sorted using the ``0``-th iterable::

        >>> iterables = [(4, 3, 2, 1), ('a', 'b', 'c', 'd')]
        >>> sort_together(iterables)
        [(1, 2, 3, 4), ('d', 'c', 'b', 'a')]

    Set a different key list to sort according to another iterable.
    Specifying multiple keys dictates how ties are broken::

        >>> iterables = [(3, 1, 2), (0, 1, 0), ('c', 'b', 'a')]
        >>> sort_together(iterables, key_list=(1, 2))
        [(2, 3, 1), (0, 0, 1), ('a', 'c', 'b')]

    To sort by a function of the elements of the iterable, pass a *key*
    function. Its arguments are the elements of the iterables corresponding to
    the key list::

        >>> names = ('a', 'b', 'c')
        >>> lengths = (1, 2, 3)
        >>> widths = (5, 2, 1)
        >>> def area(length, width):
        ...     return length * width
        >>> sort_together([names, lengths, widths], key_list=(1, 2), key=area)
        [('c', 'b', 'a'), (3, 2, 1), (1, 2, 5)]

    Set *reverse* to ``True`` to sort in descending order.

        >>> sort_together([(1, 2, 3), ('c', 'b', 'a')], reverse=True)
        [(3, 2, 1), ('a', 'b', 'c')]

    """
    if key is None:
        # if there is no key function, the key argument to sorted is an
        # itemgetter
        key_argument = itemgetter(*key_list)
    else:
        # if there is a key function, call it with the items at the offsets
        # specified by the key function as arguments
        key_list = list(key_list)
        if len(key_list) == 1:
            # if key_list contains a single item, pass the item at that offset
            # as the only argument to the key function
            key_offset = key_list[0]
            key_argument = lambda zipped_items: key(zipped_items[key_offset])
        else:
            # if key_list contains multiple items, use itemgetter to return a
            # tuple of items, which we pass as *args to the key function
            get_key_items = itemgetter(*key_list)
            key_argument = lambda zipped_items: key(
                *get_key_items(zipped_items)
            )

    return list(
        zip(*sorted(zip(*iterables), key=key_argument, reverse=reverse))
    )


def unzip(iterable):
    """The inverse of :func:`zip`, this function disaggregates the elements
    of the zipped *iterable*.

    The ``i``-th iterable contains the ``i``-th element from each element
    of the zipped iterable. The first element is used to to determine the
    length of the remaining elements.

        >>> iterable = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> letters, numbers = unzip(iterable)
        >>> list(letters)
        ['a', 'b', 'c', 'd']
        >>> list(numbers)
        [1, 2, 3, 4]

    This is similar to using ``zip(*iterable)``, but it avoids reading
    *iterable* into memory. Note, however, that this function uses
    :func:`itertools.tee` and thus may require significant storage.

    """
    head, iterable = spy(iter(iterable))
    if not head:
        # empty iterable, e.g. zip([], [], [])
        return ()
    # spy returns a one-length iterable as head
    head = head[0]
    iterables = tee(iterable, len(head))

    def itemgetter(i):
        def getter(obj):
            try:
                return obj[i]
            except IndexError:
                # basically if we have an iterable like
                # iter([(1, 2, 3), (4, 5), (6,)])
                # the second unzipped iterable would fail at the third tuple
                # since it would try to access tup[1]
                # same with the third unzipped iterable and the second tuple
                # to support these "improperly zipped" iterables,
                # we create a custom itemgetter
                # which just stops the unzipped iterables
                # at first length mismatch
                raise StopIteration

        return getter

    return tuple(map(itemgetter(i), it) for i, it in enumerate(iterables))


def divide(n, iterable):
    """Divide the elements from *iterable* into *n* parts, maintaining
    order.

        >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 2, 3]
        >>> list(group_2)
        [4, 5, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = divide(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 2, 3], [4, 5], [6, 7]]

    If the length of the iterable is smaller than n, then the last returned
    iterables will be empty:

        >>> children = divide(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function will exhaust the iterable before returning and may require
    significant storage. If order is not important, see :func:`distribute`,
    which does not first pull the iterable into memory.

    """
    if n < 1:
        raise ValueError('n must be at least 1')

    try:
        iterable[:0]
    except TypeError:
        seq = tuple(iterable)
    else:
        seq = iterable

    q, r = divmod(len(seq), n)

    ret = []
    stop = 0
    for i in range(1, n + 1):
        start = stop
        stop += q + 1 if i <= r else q
        ret.append(iter(seq[start:stop]))

    return ret


def always_iterable(obj, base_type=(str, bytes)):
    """If *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    """
    if obj is None:
        return iter(())

    if (base_type is not None) and isinstance(obj, base_type):
        return iter((obj,))

    try:
        return iter(obj)
    except TypeError:
        return iter((obj,))


def adjacent(predicate, iterable, distance=1):
    """Return an iterable over `(bool, item)` tuples where the `item` is
    drawn from *iterable* and the `bool` indicates whether
    that item satisfies the *predicate* or is adjacent to an item that does.

    For example, to find whether items are adjacent to a ``3``::

        >>> list(adjacent(lambda x: x == 3, range(6)))
        [(False, 0), (False, 1), (True, 2), (True, 3), (True, 4), (False, 5)]

    Set *distance* to change what counts as adjacent. For example, to find
    whether items are two places away from a ``3``:

        >>> list(adjacent(lambda x: x == 3, range(6), distance=2))
        [(False, 0), (True, 1), (True, 2), (True, 3), (True, 4), (True, 5)]

    This is useful for contextualizing the results of a search function.
    For example, a code comparison tool might want to identify lines that
    have changed, but also surrounding lines to give the viewer of the diff
    context.

    The predicate function will only be called once for each item in the
    iterable.

    See also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    """
    # Allow distance=0 mainly for testing that it reproduces results with map()
    if distance < 0:
        raise ValueError('distance must be at least 0')

    i1, i2 = tee(iterable)
    padding = [False] * distance
    selected = chain(padding, map(predicate, i1), padding)
    adjacent_to_selected = map(any, windowed(selected, 2 * distance + 1))
    return zip(adjacent_to_selected, i2)


def groupby_transform(iterable, keyfunc=None, valuefunc=None, reducefunc=None):
    """An extension of :func:`itertools.groupby` that can apply transformations
    to the grouped data.

    * *keyfunc* is a function computing a key value for each item in *iterable*
    * *valuefunc* is a function that transforms the individual items from
      *iterable* after grouping
    * *reducefunc* is a function that transforms each group of items

    >>> iterable = 'aAAbBBcCC'
    >>> keyfunc = lambda k: k.upper()
    >>> valuefunc = lambda v: v.lower()
    >>> reducefunc = lambda g: ''.join(g)
    >>> list(groupby_transform(iterable, keyfunc, valuefunc, reducefunc))
    [('A', 'aaa'), ('B', 'bbb'), ('C', 'ccc')]

    Each optional argument defaults to an identity function if not specified.

    :func:`groupby_transform` is useful when grouping elements of an iterable
    using a separate iterable as the key. To do this, :func:`zip` the iterables
    and pass a *keyfunc* that extracts the first element and a *valuefunc*
    that extracts the second element::

        >>> from operator import itemgetter
        >>> keys = [0, 0, 1, 1, 1, 2, 2, 2, 3]
        >>> values = 'abcdefghi'
        >>> iterable = zip(keys, values)
        >>> grouper = groupby_transform(iterable, itemgetter(0), itemgetter(1))
        >>> [(k, ''.join(g)) for k, g in grouper]
        [(0, 'ab'), (1, 'cde'), (2, 'fgh'), (3, 'i')]

    Note that the order of items in the iterable is significant.
    Only adjacent items are grouped together, so if you don't want any
    duplicate groups, you should sort the iterable by the key function.

    """
    ret = groupby(iterable, keyfunc)
    if valuefunc:
        ret = ((k, map(valuefunc, g)) for k, g in ret)
    if reducefunc:
        ret = ((k, reducefunc(g)) for k, g in ret)

    return ret


class numeric_range(abc.Sequence, abc.Hashable):
    """An extension of the built-in ``range()`` function whose arguments can
    be any orderable numeric type.

    With only *stop* specified, *start* defaults to ``0`` and *step*
    defaults to ``1``. The output items will match the type of *stop*:

        >>> list(numeric_range(3.5))
        [0.0, 1.0, 2.0, 3.0]

    With only *start* and *stop* specified, *step* defaults to ``1``. The
    output items will match the type of *start*:

        >>> from decimal import Decimal
        >>> start = Decimal('2.1')
        >>> stop = Decimal('5.1')
        >>> list(numeric_range(start, stop))
        [Decimal('2.1'), Decimal('3.1'), Decimal('4.1')]

    With *start*, *stop*, and *step*  specified the output items will match
    the type of ``start + step``:

        >>> from fractions import Fraction
        >>> start = Fraction(1, 2)  # Start at 1/2
        >>> stop = Fraction(5, 2)  # End at 5/2
        >>> step = Fraction(1, 2)  # Count by 1/2
        >>> list(numeric_range(start, stop, step))
        [Fraction(1, 2), Fraction(1, 1), Fraction(3, 2), Fraction(2, 1)]

    If *step* is zero, ``ValueError`` is raised. Negative steps are supported:

        >>> list(numeric_range(3, -1, -1.0))
        [3.0, 2.0, 1.0, 0.0]

    Be aware of the limitations of floating point numbers; the representation
    of the yielded numbers may be surprising.

    ``datetime.datetime`` objects can be used for *start* and *stop*, if *step*
    is a ``datetime.timedelta`` object:

        >>> import datetime
        >>> start = datetime.datetime(2019, 1, 1)
        >>> stop = datetime.datetime(2019, 1, 3)
        >>> step = datetime.timedelta(days=1)
        >>> items = iter(numeric_range(start, stop, step))
        >>> next(items)
        datetime.datetime(2019, 1, 1, 0, 0)
        >>> next(items)
        datetime.datetime(2019, 1, 2, 0, 0)

    """

    _EMPTY_HASH = hash(range(0, 0))

    def __init__(self, *args):
        argc = len(args)
        if argc == 1:
            (self._stop,) = args
            self._start = type(self._stop)(0)
            self._step = type(self._stop - self._start)(1)
        elif argc == 2:
            self._start, self._stop = args
            self._step = type(self._stop - self._start)(1)
        elif argc == 3:
            self._start, self._stop, self._step = args
        elif argc == 0:
            raise TypeError(
                'numeric_range expected at least '
                '1 argument, got {}'.format(argc)
            )
        else:
            raise TypeError(
                'numeric_range expected at most '
                '3 arguments, got {}'.format(argc)
            )

        self._zero = type(self._step)(0)
        if self._step == self._zero:
            raise ValueError('numeric_range() arg 3 must not be zero')
        self._growing = self._step > self._zero
        self._init_len()

    def __bool__(self):
        if self._growing:
            return self._start < self._stop
        else:
            return self._start > self._stop

    def __contains__(self, elem):
        if self._growing:
            if self._start <= elem < self._stop:
                return (elem - self._start) % self._step == self._zero
        else:
            if self._start >= elem > self._stop:
                return (self._start - elem) % (-self._step) == self._zero

        return False

    def __eq__(self, other):
        if isinstance(other, numeric_range):
            empty_self = not bool(self)
            empty_other = not bool(other)
            if empty_self or empty_other:
                return empty_self and empty_other  # True if both empty
            else:
                return (
                    self._start == other._start
                    and self._step == other._step
                    and self._get_by_index(-1) == other._get_by_index(-1)
                )
        else:
            return False

    def __getitem__(self, key):
        if isinstance(key, int):
            return self._get_by_index(key)
        elif isinstance(key, slice):
            step = self._step if key.step is None else key.step * self._step

            if key.start is None or key.start <= -self._len:
                start = self._start
            elif key.start >= self._len:
                start = self._stop
            else:  # -self._len < key.start < self._len
                start = self._get_by_index(key.start)

            if key.stop is None or key.stop >= self._len:
                stop = self._stop
            elif key.stop <= -self._len:
                stop = self._start
            else:  # -self._len < key.stop < self._len
                stop = self._get_by_index(key.stop)

            return numeric_range(start, stop, step)
        else:
            raise TypeError(
                'numeric range indices must be '
                'integers or slices, not {}'.format(type(key).__name__)
            )

    def __hash__(self):
        if self:
            return hash((self._start, self._get_by_index(-1), self._step))
        else:
            return self._EMPTY_HASH

    def __iter__(self):
        values = (self._start + (n * self._step) for n in count())
        if self._growing:
            return takewhile(partial(gt, self._stop), values)
        else:
            return takewhile(partial(lt, self._stop), values)

    def __len__(self):
        return self._len

    def _init_len(self):
        if self._growing:
            start = self._start
            stop = self._stop
            step = self._step
        else:
            start = self._stop
            stop = self._start
            step = -self._step
        distance = stop - start
        if distance <= self._zero:
            self._len = 0
        else:  # distance > 0 and step > 0: regular euclidean division
            q, r = divmod(distance, step)
            self._len = int(q) + int(r != self._zero)

    def __reduce__(self):
        return numeric_range, (self._start, self._stop, self._step)

    def __repr__(self):
        if self._step == 1:
            return "numeric_range({}, {})".format(
                repr(self._start), repr(self._stop)
            )
        else:
            return "numeric_range({}, {}, {})".format(
                repr(self._start), repr(self._stop), repr(self._step)
            )

    def __reversed__(self):
        return iter(
            numeric_range(
                self._get_by_index(-1), self._start - self._step, -self._step
            )
        )

    def count(self, value):
        return int(value in self)

    def index(self, value):
        if self._growing:
            if self._start <= value < self._stop:
                q, r = divmod(value - self._start, self._step)
                if r == self._zero:
                    return int(q)
        else:
            if self._start >= value > self._stop:
                q, r = divmod(self._start - value, -self._step)
                if r == self._zero:
                    return int(q)

        raise ValueError("{} is not in numeric range".format(value))

    def _get_by_index(self, i):
        if i < 0:
            i += self._len
        if i < 0 or i >= self._len:
            raise IndexError("numeric range object index out of range")
        return self._start + i * self._step


def count_cycle(iterable, n=None):
    """Cycle through the items from *iterable* up to *n* times, yielding
    the number of completed cycles along with each item. If *n* is omitted the
    process repeats indefinitely.

    >>> list(count_cycle('AB', 3))
    [(0, 'A'), (0, 'B'), (1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]

    """
    iterable = tuple(iterable)
    if not iterable:
        return iter(())
    counter = count() if n is None else range(n)
    return ((i, item) for i in counter for item in iterable)


def mark_ends(iterable):
    """Yield 3-tuples of the form ``(is_first, is_last, item)``.

    >>> list(mark_ends('ABC'))
    [(True, False, 'A'), (False, False, 'B'), (False, True, 'C')]

    Use this when looping over an iterable to take special action on its first
    and/or last items:

    >>> iterable = ['Header', 100, 200, 'Footer']
    >>> total = 0
    >>> for is_first, is_last, item in mark_ends(iterable):
    ...     if is_first:
    ...         continue  # Skip the header
    ...     if is_last:
    ...         continue  # Skip the footer
    ...     total += item
    >>> print(total)
    300
    """
    it = iter(iterable)

    try:
        b = next(it)
    except StopIteration:
        return

    try:
        for i in count():
            a = b
            b = next(it)
            yield i == 0, False, a

    except StopIteration:
        yield i == 0, True, a


def locate(iterable, pred=bool, window_size=None):
    """Yield the index of each item in *iterable* for which *pred* returns
    ``True``.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(locate([0, 1, 1, 0, 1, 0, 0]))
        [1, 2, 4]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item.

        >>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
        [1, 3]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(locate(iterable, pred=pred, window_size=3))
        [1, 5, 9]

    Use with :func:`seekable` to find indexes and then retrieve the associated
    items:

        >>> from itertools import count
        >>> from more_itertools import seekable
        >>> source = (3 * n + 1 if (n % 2) else n // 2 for n in count())
        >>> it = seekable(source)
        >>> pred = lambda x: x > 100
        >>> indexes = locate(it, pred=pred)
        >>> i = next(indexes)
        >>> it.seek(i)
        >>> next(it)
        106

    """
    if window_size is None:
        return compress(count(), map(pred, iterable))

    if window_size < 1:
        raise ValueError('window size must be at least 1')

    it = windowed(iterable, window_size, fillvalue=_marker)
    return compress(count(), starmap(pred, it))


def lstrip(iterable, pred):
    """Yield the items from *iterable*, but strip any from the beginning
    for which *pred* returns ``True``.

    For example, to remove a set of items from the start of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(lstrip(iterable, pred))
        [1, 2, None, 3, False, None]

    This function is analogous to to :func:`str.lstrip`, and is essentially
    an wrapper for :func:`itertools.dropwhile`.

    """
    return dropwhile(pred, iterable)


def rstrip(iterable, pred):
    """Yield the items from *iterable*, but strip any from the end
    for which *pred* returns ``True``.

    For example, to remove a set of items from the end of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(rstrip(iterable, pred))
        [None, False, None, 1, 2, None, 3]

    This function is analogous to :func:`str.rstrip`.

    """
    cache = []
    cache_append = cache.append
    cache_clear = cache.clear
    for x in iterable:
        if pred(x):
            cache_append(x)
        else:
            yield from cache
            cache_clear()
            yield x


def strip(iterable, pred):
    """Yield the items from *iterable*, but strip any from the
    beginning and end for which *pred* returns ``True``.

    For example, to remove a set of items from both ends of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(strip(iterable, pred))
        [1, 2, None, 3]

    This function is analogous to :func:`str.strip`.

    """
    return rstrip(lstrip(iterable, pred), pred)


class islice_extended:
    """An extension of :func:`itertools.islice` that supports negative values
    for *stop*, *start*, and *step*.

        >>> iterable = iter('abcdefgh')
        >>> list(islice_extended(iterable, -4, -1))
        ['e', 'f', 'g']

    Slices with negative values require some caching of *iterable*, but this
    function takes care to minimize the amount of memory required.

    For example, you can use a negative step with an infinite iterator:

        >>> from itertools import count
        >>> list(islice_extended(count(), 110, 99, -2))
        [110, 108, 106, 104, 102, 100]

    You can also use slice notation directly:

        >>> iterable = map(str, count())
        >>> it = islice_extended(iterable)[10:20:2]
        >>> list(it)
        ['10', '12', '14', '16', '18']

    """

    def __init__(self, iterable, *args):
        it = iter(iterable)
        if args:
            self._iterable = _islice_helper(it, slice(*args))
        else:
            self._iterable = it

    def __iter__(self):
        return self

    def __next__(self):
        return next(self._iterable)

    def __getitem__(self, key):
        if isinstance(key, slice):
            return islice_extended(_islice_helper(self._iterable, key))

        raise TypeError('islice_extended.__getitem__ argument must be a slice')


def _islice_helper(it, s):
    start = s.start
    stop = s.stop
    if s.step == 0:
        raise ValueError('step argument must be a non-zero integer or None.')
    step = s.step or 1

    if step > 0:
        start = 0 if (start is None) else start

        if start < 0:
            # Consume all but the last -start items
            cache = deque(enumerate(it, 1), maxlen=-start)
            len_iter = cache[-1][0] if cache else 0

            # Adjust start to be positive
            i = max(len_iter + start, 0)

            # Adjust stop to be positive
            if stop is None:
                j = len_iter
            elif stop >= 0:
                j = min(stop, len_iter)
            else:
                j = max(len_iter + stop, 0)

            # Slice the cache
            n = j - i
            if n <= 0:
                return

            for index, item in islice(cache, 0, n, step):
                yield item
        elif (stop is not None) and (stop < 0):
            # Advance to the start position
            next(islice(it, start, start), None)

            # When stop is negative, we have to carry -stop items while
            # iterating
            cache = deque(islice(it, -stop), maxlen=-stop)

            for index, item in enumerate(it):
                cached_item = cache.popleft()
                if index % step == 0:
                    yield cached_item
                cache.append(item)
        else:
            # When both start and stop are positive we have the normal case
            yield from islice(it, start, stop, step)
    else:
        start = -1 if (start is None) else start

        if (stop is not None) and (stop < 0):
            # Consume all but the last items
            n = -stop - 1
            cache = deque(enumerate(it, 1), maxlen=n)
            len_iter = cache[-1][0] if cache else 0

            # If start and stop are both negative they are comparable and
            # we can just slice. Otherwise we can adjust start to be negative
            # and then slice.
            if start < 0:
                i, j = start, stop
            else:
                i, j = min(start - len_iter, -1), None

            for index, item in list(cache)[i:j:step]:
                yield item
        else:
            # Advance to the stop position
            if stop is not None:
                m = stop + 1
                next(islice(it, m, m), None)

            # stop is positive, so if start is negative they are not comparable
            # and we need the rest of the items.
            if start < 0:
                i = start
                n = None
            # stop is None and start is positive, so we just need items up to
            # the start index.
            elif stop is None:
                i = None
                n = start + 1
            # Both stop and start are positive, so they are comparable.
            else:
                i = None
                n = start - stop
                if n <= 0:
                    return

            cache = list(islice(it, n))

            yield from cache[i::step]


def always_reversible(iterable):
    """An extension of :func:`reversed` that supports all iterables, not
    just those which implement the ``Reversible`` or ``Sequence`` protocols.

        >>> print(*always_reversible(x for x in range(3)))
        2 1 0

    If the iterable is already reversible, this function returns the
    result of :func:`reversed()`. If the iterable is not reversible,
    this function will cache the remaining items in the iterable and
    yield them in reverse order, which may require significant storage.
    """
    try:
        return reversed(iterable)
    except TypeError:
        return reversed(list(iterable))


def consecutive_groups(iterable, ordering=lambda x: x):
    """Yield groups of consecutive items using :func:`itertools.groupby`.
    The *ordering* function determines whether two items are adjacent by
    returning their position.

    By default, the ordering function is the identity function. This is
    suitable for finding runs of numbers:

        >>> iterable = [1, 10, 11, 12, 20, 30, 31, 32, 33, 40]
        >>> for group in consecutive_groups(iterable):
        ...     print(list(group))
        [1]
        [10, 11, 12]
        [20]
        [30, 31, 32, 33]
        [40]

    For finding runs of adjacent letters, try using the :meth:`index` method
    of a string of letters:

        >>> from string import ascii_lowercase
        >>> iterable = 'abcdfgilmnop'
        >>> ordering = ascii_lowercase.index
        >>> for group in consecutive_groups(iterable, ordering):
        ...     print(list(group))
        ['a', 'b', 'c', 'd']
        ['f', 'g']
        ['i']
        ['l', 'm', 'n', 'o', 'p']

    Each group of consecutive items is an iterator that shares it source with
    *iterable*. When an an output group is advanced, the previous group is
    no longer available unless its elements are copied (e.g., into a ``list``).

        >>> iterable = [1, 2, 11, 12, 21, 22]
        >>> saved_groups = []
        >>> for group in consecutive_groups(iterable):
        ...     saved_groups.append(list(group))  # Copy group elements
        >>> saved_groups
        [[1, 2], [11, 12], [21, 22]]

    """
    for k, g in groupby(
        enumerate(iterable), key=lambda x: x[0] - ordering(x[1])
    ):
        yield map(itemgetter(1), g)


def difference(iterable, func=sub, *, initial=None):
    """This function is the inverse of :func:`itertools.accumulate`. By default
    it will compute the first difference of *iterable* using
    :func:`operator.sub`:

        >>> from itertools import accumulate
        >>> iterable = accumulate([0, 1, 2, 3, 4])  # produces 0, 1, 3, 6, 10
        >>> list(difference(iterable))
        [0, 1, 2, 3, 4]

    *func* defaults to :func:`operator.sub`, but other functions can be
    specified. They will be applied as follows::

        A, B, C, D, ... --> A, func(B, A), func(C, B), func(D, C), ...

    For example, to do progressive division:

        >>> iterable = [1, 2, 6, 24, 120]
        >>> func = lambda x, y: x // y
        >>> list(difference(iterable, func))
        [1, 2, 3, 4, 5]

    If the *initial* keyword is set, the first element will be skipped when
    computing successive differences.

        >>> it = [10, 11, 13, 16]  # from accumulate([1, 2, 3], initial=10)
        >>> list(difference(it, initial=10))
        [1, 2, 3]

    """
    a, b = tee(iterable)
    try:
        first = [next(b)]
    except StopIteration:
        return iter([])

    if initial is not None:
        first = []

    return chain(first, starmap(func, zip(b, a)))


class SequenceView(Sequence):
    """Return a read-only view of the sequence object *target*.

    :class:`SequenceView` objects are analogous to Python's built-in
    "dictionary view" types. They provide a dynamic view of a sequence's items,
    meaning that when the sequence updates, so does the view.

        >>> seq = ['0', '1', '2']
        >>> view = SequenceView(seq)
        >>> view
        SequenceView(['0', '1', '2'])
        >>> seq.append('3')
        >>> view
        SequenceView(['0', '1', '2', '3'])

    Sequence views support indexing, slicing, and length queries. They act
    like the underlying sequence, except they don't allow assignment:

        >>> view[1]
        '1'
        >>> view[1:-1]
        ['1', '2']
        >>> len(view)
        4

    Sequence views are useful as an alternative to copying, as they don't
    require (much) extra storage.

    """

    def __init__(self, target):
        if not isinstance(target, Sequence):
            raise TypeError
        self._target = target

    def __getitem__(self, index):
        return self._target[index]

    def __len__(self):
        return len(self._target)

    def __repr__(self):
        return '{}({})'.format(self.__class__.__name__, repr(self._target))


class seekable:
    """Wrap an iterator to allow for seeking backward and forward. This
    progressively caches the items in the source iterable so they can be
    re-visited.

    Call :meth:`seek` with an index to seek to that position in the source
    iterable.

    To "reset" an iterator, seek to ``0``:

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> it.seek(0)
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> next(it)
        '3'

    You can also seek forward:

        >>> it = seekable((str(n) for n in range(20)))
        >>> it.seek(10)
        >>> next(it)
        '10'
        >>> it.seek(20)  # Seeking past the end of the source isn't a problem
        >>> list(it)
        []
        >>> it.seek(0)  # Resetting works even after hitting the end
        >>> next(it), next(it), next(it)
        ('0', '1', '2')

    Call :meth:`peek` to look ahead one item without advancing the iterator:

        >>> it = seekable('1234')
        >>> it.peek()
        '1'
        >>> list(it)
        ['1', '2', '3', '4']
        >>> it.peek(default='empty')
        'empty'

    Before the iterator is at its end, calling :func:`bool` on it will return
    ``True``. After it will return ``False``:

        >>> it = seekable('5678')
        >>> bool(it)
        True
        >>> list(it)
        ['5', '6', '7', '8']
        >>> bool(it)
        False

    You may view the contents of the cache with the :meth:`elements` method.
    That returns a :class:`SequenceView`, a view that updates automatically:

        >>> it = seekable((str(n) for n in range(10)))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> elements = it.elements()
        >>> elements
        SequenceView(['0', '1', '2'])
        >>> next(it)
        '3'
        >>> elements
        SequenceView(['0', '1', '2', '3'])

    By default, the cache grows as the source iterable progresses, so beware of
    wrapping very large or infinite iterables. Supply *maxlen* to limit the
    size of the cache (this of course limits how far back you can seek).

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()), maxlen=2)
        >>> next(it), next(it), next(it), next(it)
        ('0', '1', '2', '3')
        >>> list(it.elements())
        ['2', '3']
        >>> it.seek(0)
        >>> next(it), next(it), next(it), next(it)
        ('2', '3', '4', '5')
        >>> next(it)
        '6'

    """

    def __init__(self, iterable, maxlen=None):
        self._source = iter(iterable)
        if maxlen is None:
            self._cache = []
        else:
            self._cache = deque([], maxlen)
        self._index = None

    def __iter__(self):
        return self

    def __next__(self):
        if self._index is not None:
            try:
                item = self._cache[self._index]
            except IndexError:
                self._index = None
            else:
                self._index += 1
                return item

        item = next(self._source)
        self._cache.append(item)
        return item

    def __bool__(self):
        try:
            self.peek()
        except StopIteration:
            return False
        return True

    def peek(self, default=_marker):
        try:
            peeked = next(self)
        except StopIteration:
            if default is _marker:
                raise
            return default
        if self._index is None:
            self._index = len(self._cache)
        self._index -= 1
        return peeked

    def elements(self):
        return SequenceView(self._cache)

    def seek(self, index):
        self._index = index
        remainder = index - len(self._cache)
        if remainder > 0:
            consume(self, remainder)


class run_length:
    """
    :func:`run_length.encode` compresses an iterable with run-length encoding.
    It yields groups of repeated items with the count of how many times they
    were repeated:

        >>> uncompressed = 'abbcccdddd'
        >>> list(run_length.encode(uncompressed))
        [('a', 1), ('b', 2), ('c', 3), ('d', 4)]

    :func:`run_length.decode` decompresses an iterable that was previously
    compressed with run-length encoding. It yields the items of the
    decompressed iterable:

        >>> compressed = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> list(run_length.decode(compressed))
        ['a', 'b', 'b', 'c', 'c', 'c', 'd', 'd', 'd', 'd']

    """

    @staticmethod
    def encode(iterable):
        return ((k, ilen(g)) for k, g in groupby(iterable))

    @staticmethod
    def decode(iterable):
        return chain.from_iterable(repeat(k, n) for k, n in iterable)


def exactly_n(iterable, n, predicate=bool):
    """Return ``True`` if exactly ``n`` items in the iterable are ``True``
    according to the *predicate* function.

        >>> exactly_n([True, True, False], 2)
        True
        >>> exactly_n([True, True, False], 1)
        False
        >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
        True

    The iterable will be advanced until ``n + 1`` truthy items are encountered,
    so avoid calling it on infinite iterables.

    """
    return len(take(n + 1, filter(predicate, iterable))) == n


def circular_shifts(iterable):
    """Return a list of circular shifts of *iterable*.

    >>> circular_shifts(range(4))
    [(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
    """
    lst = list(iterable)
    return take(len(lst), windowed(cycle(lst), len(lst)))


def make_decorator(wrapping_func, result_index=0):
    """Return a decorator version of *wrapping_func*, which is a function that
    modifies an iterable. *result_index* is the position in that function's
    signature where the iterable goes.

    This lets you use itertools on the "production end," i.e. at function
    definition. This can augment what the function returns without changing the
    function's code.

    For example, to produce a decorator version of :func:`chunked`:

        >>> from more_itertools import chunked
        >>> chunker = make_decorator(chunked, result_index=0)
        >>> @chunker(3)
        ... def iter_range(n):
        ...     return iter(range(n))
        ...
        >>> list(iter_range(9))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

    To only allow truthy items to be returned:

        >>> truth_serum = make_decorator(filter, result_index=1)
        >>> @truth_serum(bool)
        ... def boolean_test():
        ...     return [0, 1, '', ' ', False, True]
        ...
        >>> list(boolean_test())
        [1, ' ', True]

    The :func:`peekable` and :func:`seekable` wrappers make for practical
    decorators:

        >>> from more_itertools import peekable
        >>> peekable_function = make_decorator(peekable)
        >>> @peekable_function()
        ... def str_range(*args):
        ...     return (str(x) for x in range(*args))
        ...
        >>> it = str_range(1, 20, 2)
        >>> next(it), next(it), next(it)
        ('1', '3', '5')
        >>> it.peek()
        '7'
        >>> next(it)
        '7'

    """
    # See https://sites.google.com/site/bbayles/index/decorator_factory for
    # notes on how this works.
    def decorator(*wrapping_args, **wrapping_kwargs):
        def outer_wrapper(f):
            def inner_wrapper(*args, **kwargs):
                result = f(*args, **kwargs)
                wrapping_args_ = list(wrapping_args)
                wrapping_args_.insert(result_index, result)
                return wrapping_func(*wrapping_args_, **wrapping_kwargs)

            return inner_wrapper

        return outer_wrapper

    return decorator


def map_reduce(iterable, keyfunc, valuefunc=None, reducefunc=None):
    """Return a dictionary that maps the items in *iterable* to categories
    defined by *keyfunc*, transforms them with *valuefunc*, and
    then summarizes them by category with *reducefunc*.

    *valuefunc* defaults to the identity function if it is unspecified.
    If *reducefunc* is unspecified, no summarization takes place:

        >>> keyfunc = lambda x: x.upper()
        >>> result = map_reduce('abbccc', keyfunc)
        >>> sorted(result.items())
        [('A', ['a']), ('B', ['b', 'b']), ('C', ['c', 'c', 'c'])]

    Specifying *valuefunc* transforms the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> result = map_reduce('abbccc', keyfunc, valuefunc)
        >>> sorted(result.items())
        [('A', [1]), ('B', [1, 1]), ('C', [1, 1, 1])]

    Specifying *reducefunc* summarizes the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> reducefunc = sum
        >>> result = map_reduce('abbccc', keyfunc, valuefunc, reducefunc)
        >>> sorted(result.items())
        [('A', 1), ('B', 2), ('C', 3)]

    You may want to filter the input iterable before applying the map/reduce
    procedure:

        >>> all_items = range(30)
        >>> items = [x for x in all_items if 10 <= x <= 20]  # Filter
        >>> keyfunc = lambda x: x % 2  # Evens map to 0; odds to 1
        >>> categories = map_reduce(items, keyfunc=keyfunc)
        >>> sorted(categories.items())
        [(0, [10, 12, 14, 16, 18, 20]), (1, [11, 13, 15, 17, 19])]
        >>> summaries = map_reduce(items, keyfunc=keyfunc, reducefunc=sum)
        >>> sorted(summaries.items())
        [(0, 90), (1, 75)]

    Note that all items in the iterable are gathered into a list before the
    summarization step, which may require significant storage.

    The returned object is a :obj:`collections.defaultdict` with the
    ``default_factory`` set to ``None``, such that it behaves like a normal
    dictionary.

    """
    valuefunc = (lambda x: x) if (valuefunc is None) else valuefunc

    ret = defaultdict(list)
    for item in iterable:
        key = keyfunc(item)
        value = valuefunc(item)
        ret[key].append(value)

    if reducefunc is not None:
        for key, value_list in ret.items():
            ret[key] = reducefunc(value_list)

    ret.default_factory = None
    return ret


def rlocate(iterable, pred=bool, window_size=None):
    """Yield the index of each item in *iterable* for which *pred* returns
    ``True``, starting from the right and moving left.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(rlocate([0, 1, 1, 0, 1, 0, 0]))  # Truthy at 1, 2, and 4
        [4, 2, 1]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item:

        >>> iterable = iter('abcb')
        >>> pred = lambda x: x == 'b'
        >>> list(rlocate(iterable, pred))
        [3, 1]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(rlocate(iterable, pred=pred, window_size=3))
        [9, 5, 1]

    Beware, this function won't return anything for infinite iterables.
    If *iterable* is reversible, ``rlocate`` will reverse it and search from
    the right. Otherwise, it will search from the left and return the results
    in reverse order.

    See :func:`locate` to for other example applications.

    """
    if window_size is None:
        try:
            len_iter = len(iterable)
            return (len_iter - i - 1 for i in locate(reversed(iterable), pred))
        except TypeError:
            pass

    return reversed(list(locate(iterable, pred, window_size)))


def replace(iterable, pred, substitutes, count=None, window_size=1):
    """Yield the items from *iterable*, replacing the items for which *pred*
    returns ``True`` with the items from the iterable *substitutes*.

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
        >>> pred = lambda x: x == 0
        >>> substitutes = (2, 3)
        >>> list(replace(iterable, pred, substitutes))
        [1, 1, 2, 3, 1, 1, 2, 3, 1, 1]

    If *count* is given, the number of replacements will be limited:

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1, 0]
        >>> pred = lambda x: x == 0
        >>> substitutes = [None]
        >>> list(replace(iterable, pred, substitutes, count=2))
        [1, 1, None, 1, 1, None, 1, 1, 0]

    Use *window_size* to control the number of items passed as arguments to
    *pred*. This allows for locating and replacing subsequences.

        >>> iterable = [0, 1, 2, 5, 0, 1, 2, 5]
        >>> window_size = 3
        >>> pred = lambda *args: args == (0, 1, 2)  # 3 items passed to pred
        >>> substitutes = [3, 4] # Splice in these items
        >>> list(replace(iterable, pred, substitutes, window_size=window_size))
        [3, 4, 5, 3, 4, 5]

    """
    if window_size < 1:
        raise ValueError('window_size must be at least 1')

    # Save the substitutes iterable, since it's used more than once
    substitutes = tuple(substitutes)

    # Add padding such that the number of windows matches the length of the
    # iterable
    it = chain(iterable, [_marker] * (window_size - 1))
    windows = windowed(it, window_size)

    n = 0
    for w in windows:
        # If the current window matches our predicate (and we haven't hit
        # our maximum number of replacements), splice in the substitutes
        # and then consume the following windows that overlap with this one.
        # For example, if the iterable is (0, 1, 2, 3, 4...)
        # and the window size is 2, we have (0, 1), (1, 2), (2, 3)...
        # If the predicate matches on (0, 1), we need to zap (0, 1) and (1, 2)
        if pred(*w):
            if (count is None) or (n < count):
                n += 1
                yield from substitutes
                consume(windows, window_size - 1)
                continue

        # If there was no match (or we've reached the replacement limit),
        # yield the first item from the window.
        if w and (w[0] is not _marker):
            yield w[0]


def partitions(iterable):
    """Yield all possible order-preserving partitions of *iterable*.

    >>> iterable = 'abc'
    >>> for part in partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['a', 'b', 'c']

    This is unrelated to :func:`partition`.

    """
    sequence = list(iterable)
    n = len(sequence)
    for i in powerset(range(1, n)):
        yield [sequence[i:j] for i, j in zip((0,) + i, i + (n,))]


def set_partitions(iterable, k=None):
    """
    Yield the set partitions of *iterable* into *k* parts. Set partitions are
    not order-preserving.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable, 2):
    ...     print([''.join(p) for p in part])
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']


    If *k* is not given, every set partition is generated.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']
    ['a', 'b', 'c']

    """
    L = list(iterable)
    n = len(L)
    if k is not None:
        if k < 1:
            raise ValueError(
                "Can't partition in a negative or zero number of groups"
            )
        elif k > n:
            return

    def set_partitions_helper(L, k):
        n = len(L)
        if k == 1:
            yield [L]
        elif n == k:
            yield [[s] for s in L]
        else:
            e, *M = L
            for p in set_partitions_helper(M, k - 1):
                yield [[e], *p]
            for p in set_partitions_helper(M, k):
                for i in range(len(p)):
                    yield p[:i] + [[e] + p[i]] + p[i + 1 :]

    if k is None:
        for k in range(1, n + 1):
            yield from set_partitions_helper(L, k)
    else:
        yield from set_partitions_helper(L, k)


class time_limited:
    """
    Yield items from *iterable* until *limit_seconds* have passed.
    If the time limit expires before all items have been yielded, the
    ``timed_out`` parameter will be set to ``True``.

    >>> from time import sleep
    >>> def generator():
    ...     yield 1
    ...     yield 2
    ...     sleep(0.2)
    ...     yield 3
    >>> iterable = time_limited(0.1, generator())
    >>> list(iterable)
    [1, 2]
    >>> iterable.timed_out
    True

    Note that the time is checked before each item is yielded, and iteration
    stops if  the time elapsed is greater than *limit_seconds*. If your time
    limit is 1 second, but it takes 2 seconds to generate the first item from
    the iterable, the function will run for 2 seconds and not yield anything.

    """

    def __init__(self, limit_seconds, iterable):
        if limit_seconds < 0:
            raise ValueError('limit_seconds must be positive')
        self.limit_seconds = limit_seconds
        self._iterable = iter(iterable)
        self._start_time = monotonic()
        self.timed_out = False

    def __iter__(self):
        return self

    def __next__(self):
        item = next(self._iterable)
        if monotonic() - self._start_time > self.limit_seconds:
            self.timed_out = True
            raise StopIteration

        return item


def only(iterable, default=None, too_long=None):
    """If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.

    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError

    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    """
    it = iter(iterable)
    first_value = next(it, default)

    try:
        second_value = next(it)
    except StopIteration:
        pass
    else:
        msg = (
            'Expected exactly one item in iterable, but got {!r}, {!r}, '
            'and perhaps more.'.format(first_value, second_value)
        )
        raise too_long or ValueError(msg)

    return first_value


def ichunked(iterable, n):
    """Break *iterable* into sub-iterables with *n* elements each.
    :func:`ichunked` is like :func:`chunked`, but it yields iterables
    instead of lists.

    If the sub-iterables are read in order, the elements of *iterable*
    won't be stored in memory.
    If they are read out of order, :func:`itertools.tee` is used to cache
    elements as necessary.

    >>> from itertools import count
    >>> all_chunks = ichunked(count(), 4)
    >>> c_1, c_2, c_3 = next(all_chunks), next(all_chunks), next(all_chunks)
    >>> list(c_2)  # c_1's elements have been cached; c_3's haven't been
    [4, 5, 6, 7]
    >>> list(c_1)
    [0, 1, 2, 3]
    >>> list(c_3)
    [8, 9, 10, 11]

    """
    source = iter(iterable)

    while True:
        # Check to see whether we're at the end of the source iterable
        item = next(source, _marker)
        if item is _marker:
            return

        # Clone the source and yield an n-length slice
        source, it = tee(chain([item], source))
        yield islice(it, n)

        # Advance the source iterable
        consume(source, n)


def distinct_combinations(iterable, r):
    """Yield the distinct combinations of *r* items taken from *iterable*.

        >>> list(distinct_combinations([0, 0, 1], 2))
        [(0, 0), (0, 1)]

    Equivalent to ``set(combinations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    """
    if r < 0:
        raise ValueError('r must be non-negative')
    elif r == 0:
        yield ()
        return
    pool = tuple(iterable)
    generators = [unique_everseen(enumerate(pool), key=itemgetter(1))]
    current_combo = [None] * r
    level = 0
    while generators:
        try:
            cur_idx, p = next(generators[-1])
        except StopIteration:
            generators.pop()
            level -= 1
            continue
        current_combo[level] = p
        if level + 1 == r:
            yield tuple(current_combo)
        else:
            generators.append(
                unique_everseen(
                    enumerate(pool[cur_idx + 1 :], cur_idx + 1),
                    key=itemgetter(1),
                )
            )
            level += 1


def filter_except(validator, iterable, *exceptions):
    """Yield the items from *iterable* for which the *validator* function does
    not raise one of the specified *exceptions*.

    *validator* is called for each item in *iterable*.
    It should be a function that accepts one argument and raises an exception
    if that item is not valid.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(filter_except(int, iterable, ValueError, TypeError))
    ['1', '2', '4']

    If an exception other than one given by *exceptions* is raised by
    *validator*, it is raised like normal.
    """
    for item in iterable:
        try:
            validator(item)
        except exceptions:
            pass
        else:
            yield item


def map_except(function, iterable, *exceptions):
    """Transform each item from *iterable* with *function* and yield the
    result, unless *function* raises one of the specified *exceptions*.

    *function* is called to transform each item in *iterable*.
    It should be a accept one argument.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(map_except(int, iterable, ValueError, TypeError))
    [1, 2, 4]

    If an exception other than one given by *exceptions* is raised by
    *function*, it is raised like normal.
    """
    for item in iterable:
        try:
            yield function(item)
        except exceptions:
            pass


def _sample_unweighted(iterable, k):
    # Implementation of "Algorithm L" from the 1994 paper by Kim-Hung Li:
    # "Reservoir-Sampling Algorithms of Time Complexity O(n(1+log(N/n)))".

    # Fill up the reservoir (collection of samples) with the first `k` samples
    reservoir = take(k, iterable)

    # Generate random number that's the largest in a sample of k U(0,1) numbers
    # Largest order statistic: https://en.wikipedia.org/wiki/Order_statistic
    W = exp(log(random()) / k)

    # The number of elements to skip before changing the reservoir is a random
    # number with a geometric distribution. Sample it using random() and logs.
    next_index = k + floor(log(random()) / log(1 - W))

    for index, element in enumerate(iterable, k):

        if index == next_index:
            reservoir[randrange(k)] = element
            # The new W is the largest in a sample of k U(0, `old_W`) numbers
            W *= exp(log(random()) / k)
            next_index += floor(log(random()) / log(1 - W)) + 1

    return reservoir


def _sample_weighted(iterable, k, weights):
    # Implementation of "A-ExpJ" from the 2006 paper by Efraimidis et al. :
    # "Weighted random sampling with a reservoir".

    # Log-transform for numerical stability for weights that are small/large
    weight_keys = (log(random()) / weight for weight in weights)

    # Fill up the reservoir (collection of samples) with the first `k`
    # weight-keys and elements, then heapify the list.
    reservoir = take(k, zip(weight_keys, iterable))
    heapify(reservoir)

    # The number of jumps before changing the reservoir is a random variable
    # with an exponential distribution. Sample it using random() and logs.
    smallest_weight_key, _ = reservoir[0]
    weights_to_skip = log(random()) / smallest_weight_key

    for weight, element in zip(weights, iterable):
        if weight >= weights_to_skip:
            # The notation here is consistent with the paper, but we store
            # the weight-keys in log-space for better numerical stability.
            smallest_weight_key, _ = reservoir[0]
            t_w = exp(weight * smallest_weight_key)
            r_2 = uniform(t_w, 1)  # generate U(t_w, 1)
            weight_key = log(r_2) / weight
            heapreplace(reservoir, (weight_key, element))
            smallest_weight_key, _ = reservoir[0]
            weights_to_skip = log(random()) / smallest_weight_key
        else:
            weights_to_skip -= weight

    # Equivalent to [element for weight_key, element in sorted(reservoir)]
    return [heappop(reservoir)[1] for _ in range(k)]


def sample(iterable, k, weights=None):
    """Return a *k*-length list of elements chosen (without replacement)
    from the *iterable*. Like :func:`random.sample`, but works on iterables
    of unknown length.

    >>> iterable = range(100)
    >>> sample(iterable, 5)  # doctest: +SKIP
    [81, 60, 96, 16, 4]

    An iterable with *weights* may also be given:

    >>> iterable = range(100)
    >>> weights = (i * i + 1 for i in range(100))
    >>> sampled = sample(iterable, 5, weights=weights)  # doctest: +SKIP
    [79, 67, 74, 66, 78]

    The algorithm can also be used to generate weighted random permutations.
    The relative weight of each item determines the probability that it
    appears late in the permutation.

    >>> data = "abcdefgh"
    >>> weights = range(1, len(data) + 1)
    >>> sample(data, k=len(data), weights=weights)  # doctest: +SKIP
    ['c', 'a', 'b', 'e', 'g', 'd', 'h', 'f']
    """
    if k == 0:
        return []

    iterable = iter(iterable)
    if weights is None:
        return _sample_unweighted(iterable, k)
    else:
        weights = iter(weights)
        return _sample_weighted(iterable, k, weights)


def is_sorted(iterable, key=None, reverse=False):
    """Returns ``True`` if the items of iterable are in sorted order, and
    ``False`` otherwise. *key* and *reverse* have the same meaning that they do
    in the built-in :func:`sorted` function.

    >>> is_sorted(['1', '2', '3', '4', '5'], key=int)
    True
    >>> is_sorted([5, 4, 3, 1, 2], reverse=True)
    False

    The function returns ``False`` after encountering the first out-of-order
    item. If there are no out-of-order items, the iterable is exhausted.
    """

    compare = lt if reverse else gt
    it = iterable if (key is None) else map(key, iterable)
    return not any(starmap(compare, pairwise(it)))


class AbortThread(BaseException):
    pass


class callback_iter:
    """Convert a function that uses callbacks to an iterator.

    Let *func* be a function that takes a `callback` keyword argument.
    For example:

    >>> def func(callback=None):
    ...     for i, c in [(1, 'a'), (2, 'b'), (3, 'c')]:
    ...         if callback:
    ...             callback(i, c)
    ...     return 4


    Use ``with callback_iter(func)`` to get an iterator over the parameters
    that are delivered to the callback.

    >>> with callback_iter(func) as it:
    ...     for args, kwargs in it:
    ...         print(args)
    (1, 'a')
    (2, 'b')
    (3, 'c')

    The function will be called in a background thread. The ``done`` property
    indicates whether it has completed execution.

    >>> it.done
    True

    If it completes successfully, its return value will be available
    in the ``result`` property.

    >>> it.result
    4

    Notes:

    * If the function uses some keyword argument besides ``callback``, supply
      *callback_kwd*.
    * If it finished executing, but raised an exception, accessing the
      ``result`` property will raise the same exception.
    * If it hasn't finished executing, accessing the ``result``
      property from within the ``with`` block will raise ``RuntimeError``.
    * If it hasn't finished executing, accessing the ``result`` property from
      outside the ``with`` block will raise a
      ``more_itertools.AbortThread`` exception.
    * Provide *wait_seconds* to adjust how frequently the it is polled for
      output.

    """

    def __init__(self, func, callback_kwd='callback', wait_seconds=0.1):
        self._func = func
        self._callback_kwd = callback_kwd
        self._aborted = False
        self._future = None
        self._wait_seconds = wait_seconds
        self._executor = ThreadPoolExecutor(max_workers=1)
        self._iterator = self._reader()

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, traceback):
        self._aborted = True
        self._executor.shutdown()

    def __iter__(self):
        return self

    def __next__(self):
        return next(self._iterator)

    @property
    def done(self):
        if self._future is None:
            return False
        return self._future.done()

    @property
    def result(self):
        if not self.done:
            raise RuntimeError('Function has not yet completed')

        return self._future.result()

    def _reader(self):
        q = Queue()

        def callback(*args, **kwargs):
            if self._aborted:
                raise AbortThread('canceled by user')

            q.put((args, kwargs))

        self._future = self._executor.submit(
            self._func, **{self._callback_kwd: callback}
        )

        while True:
            try:
                item = q.get(timeout=self._wait_seconds)
            except Empty:
                pass
            else:
                q.task_done()
                yield item

            if self._future.done():
                break

        remaining = []
        while True:
            try:
                item = q.get_nowait()
            except Empty:
                break
            else:
                q.task_done()
                remaining.append(item)
        q.join()
        yield from remaining


def windowed_complete(iterable, n):
    """
    Yield ``(beginning, middle, end)`` tuples, where:

    * Each ``middle`` has *n* items from *iterable*
    * Each ``beginning`` has the items before the ones in ``middle``
    * Each ``end`` has the items after the ones in ``middle``

    >>> iterable = range(7)
    >>> n = 3
    >>> for beginning, middle, end in windowed_complete(iterable, n):
    ...     print(beginning, middle, end)
    () (0, 1, 2) (3, 4, 5, 6)
    (0,) (1, 2, 3) (4, 5, 6)
    (0, 1) (2, 3, 4) (5, 6)
    (0, 1, 2) (3, 4, 5) (6,)
    (0, 1, 2, 3) (4, 5, 6) ()

    Note that *n* must be at least 0 and most equal to the length of
    *iterable*.

    This function will exhaust the iterable and may require significant
    storage.
    """
    if n < 0:
        raise ValueError('n must be >= 0')

    seq = tuple(iterable)
    size = len(seq)

    if n > size:
        raise ValueError('n must be <= len(seq)')

    for i in range(size - n + 1):
        beginning = seq[:i]
        middle = seq[i : i + n]
        end = seq[i + n :]
        yield beginning, middle, end


def all_unique(iterable, key=None):
    """
    Returns ``True`` if all the elements of *iterable* are unique (no two
    elements are equal).

        >>> all_unique('ABCB')
        False

    If a *key* function is specified, it will be used to make comparisons.

        >>> all_unique('ABCb')
        True
        >>> all_unique('ABCb', str.lower)
        False

    The function returns as soon as the first non-unique element is
    encountered. Iterables with a mix of hashable and unhashable items can
    be used, but the function will be slower for unhashable items.
    """
    seenset = set()
    seenset_add = seenset.add
    seenlist = []
    seenlist_add = seenlist.append
    for element in map(key, iterable) if key else iterable:
        try:
            if element in seenset:
                return False
            seenset_add(element)
        except TypeError:
            if element in seenlist:
                return False
            seenlist_add(element)
    return True


def nth_product(index, *args):
    """Equivalent to ``list(product(*args))[index]``.

    The products of *args* can be ordered lexicographically.
    :func:`nth_product` computes the product at sort position *index* without
    computing the previous products.

        >>> nth_product(8, range(2), range(2), range(2), range(2))
        (1, 0, 0, 0)

    ``IndexError`` will be raised if the given *index* is invalid.
    """
    pools = list(map(tuple, reversed(args)))
    ns = list(map(len, pools))

    c = reduce(mul, ns)

    if index < 0:
        index += c

    if not 0 <= index < c:
        raise IndexError

    result = []
    for pool, n in zip(pools, ns):
        result.append(pool[index % n])
        index //= n

    return tuple(reversed(result))


def nth_permutation(iterable, r, index):
    """Equivalent to ``list(permutations(iterable, r))[index]```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`nth_permutation`
    computes the subsequence at sort position *index* directly, without
    computing the previous subsequences.

        >>> nth_permutation('ghijk', 2, 5)
        ('h', 'i')

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    """
    pool = list(iterable)
    n = len(pool)

    if r is None or r == n:
        r, c = n, factorial(n)
    elif not 0 <= r < n:
        raise ValueError
    else:
        c = factorial(n) // factorial(n - r)

    if index < 0:
        index += c

    if not 0 <= index < c:
        raise IndexError

    if c == 0:
        return tuple()

    result = [0] * r
    q = index * factorial(n) // c if r < n else index
    for d in range(1, n + 1):
        q, i = divmod(q, d)
        if 0 <= n - d < r:
            result[n - d] = i
        if q == 0:
            break

    return tuple(map(pool.pop, result))


def value_chain(*args):
    """Yield all arguments passed to the function in the same order in which
    they were passed. If an argument itself is iterable then iterate over its
    values.

        >>> list(value_chain(1, 2, 3, [4, 5, 6]))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and are emitted
    as-is:

        >>> list(value_chain('12', '34', ['56', '78']))
        ['12', '34', '56', '78']


    Multiple levels of nesting are not flattened.

    """
    for value in args:
        if isinstance(value, (str, bytes)):
            yield value
            continue
        try:
            yield from value
        except TypeError:
            yield value


def product_index(element, *args):
    """Equivalent to ``list(product(*args)).index(element)``

    The products of *args* can be ordered lexicographically.
    :func:`product_index` computes the first index of *element* without
    computing the previous products.

        >>> product_index([8, 2], range(10), range(5))
        42

    ``ValueError`` will be raised if the given *element* isn't in the product
    of *args*.
    """
    index = 0

    for x, pool in zip_longest(element, args, fillvalue=_marker):
        if x is _marker or pool is _marker:
            raise ValueError('element is not a product of args')

        pool = tuple(pool)
        index = index * len(pool) + pool.index(x)

    return index


def combination_index(element, iterable):
    """Equivalent to ``list(combinations(iterable, r)).index(element)``

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`combination_index` computes the index of the
    first *element*, without computing the previous combinations.

        >>> combination_index('adf', 'abcdefg')
        10

    ``ValueError`` will be raised if the given *element* isn't one of the
    combinations of *iterable*.
    """
    element = enumerate(element)
    k, y = next(element, (None, None))
    if k is None:
        return 0

    indexes = []
    pool = enumerate(iterable)
    for n, x in pool:
        if x == y:
            indexes.append(n)
            tmp, y = next(element, (None, None))
            if tmp is None:
                break
            else:
                k = tmp
    else:
        raise ValueError('element is not a combination of iterable')

    n, _ = last(pool, default=(n, None))

    # Python versiosn below 3.8 don't have math.comb
    index = 1
    for i, j in enumerate(reversed(indexes), start=1):
        j = n - j
        if i <= j:
            index += factorial(j) // (factorial(i) * factorial(j - i))

    return factorial(n + 1) // (factorial(k + 1) * factorial(n - k)) - index


def permutation_index(element, iterable):
    """Equivalent to ``list(permutations(iterable, r)).index(element)```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`permutation_index`
    computes the index of the first *element* directly, without computing
    the previous permutations.

        >>> permutation_index([1, 3, 2], range(5))
        19

    ``ValueError`` will be raised if the given *element* isn't one of the
    permutations of *iterable*.
    """
    index = 0
    pool = list(iterable)
    for i, x in zip(range(len(pool), -1, -1), element):
        r = pool.index(x)
        index = index * i + r
        del pool[r]

    return index


class countable:
    """Wrap *iterable* and keep a count of how many items have been consumed.

    The ``items_seen`` attribute starts at ``0`` and increments as the iterable
    is consumed:

        >>> iterable = map(str, range(10))
        >>> it = countable(iterable)
        >>> it.items_seen
        0
        >>> next(it), next(it)
        ('0', '1')
        >>> list(it)
        ['2', '3', '4', '5', '6', '7', '8', '9']
        >>> it.items_seen
        10
    """

    def __init__(self, iterable):
        self._it = iter(iterable)
        self.items_seen = 0

    def __iter__(self):
        return self

    def __next__(self):
        item = next(self._it)
        self.items_seen += 1

        return item
PK!DJree;_vendor/more_itertools/__pycache__/__init__.cpython-311.pycnu[

,ReRddlTddlTdZdS))*z8.8.0N)morerecipes__version__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/more_itertools/__init__.pyr
s&rPK!|N]]:_vendor/more_itertools/__pycache__/recipes.cpython-311.pycnu[

,Re?dZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlZddlmZmZmZgdZdZd'dZd	Zd(d
Zd(dZdZefd
ZdZeZdZdZ dZ!d(dZ"dZ#	ddlm$Z%dZ$e#je$_n
#e&$re#Z$YnwxYwd(dZ'dZ(dZ)dZ*d(dZ+d(dZ,d(dZ-d)dZ.ddd Z/d(d!Z0d"Z1d#Z2d$Z3d%Z4d&Z5dS)*aImported from the recipes section of the itertools documentation.

All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.

.. [1] http://docs.python.org/library/itertools.html#recipes

N)deque)
chaincombinationscountcyclegroupbyislicerepeatstarmapteezip_longest)	randrangesamplechoice)	all_equalconsumeconvolve
dotproduct
first_trueflattengrouperiter_exceptncyclesnthnth_combinationpadnonepad_nonepairwise	partitionpowersetprependquantify#random_combination_with_replacementrandom_combinationrandom_permutationrandom_product
repeatfunc
roundrobintabulatetailtakeunique_everseenunique_justseenc<tt||S)zReturn first *n* items of the iterable as a list.

        >>> take(3, range(10))
        [0, 1, 2]

    If there are fewer than *n* items in the iterable, all of them are
    returned.

        >>> take(10, range(3))
        [0, 1, 2]

    )listr	niterables  /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/more_itertools/recipes.pyr+r+<sx##$$$c<t|t|S)aReturn an iterator over the results of ``func(start)``,
    ``func(start + 1)``, ``func(start + 2)``...

    *func* should be a function that accepts one integer argument.

    If *start* is not specified it defaults to 0. It will be incremented each
    time the iterator is advanced.

        >>> square = lambda x: x ** 2
        >>> iterator = tabulate(square, -3)
        >>> take(4, iterator)
        [9, 4, 1, 0]

    )mapr)functionstarts  r3r)r)Lsxu&&&r4c>tt||S)zReturn an iterator over the last *n* items of *iterable*.

    >>> t = tail(3, 'ABCDEFG')
    >>> list(t)
    ['E', 'F', 'G']

    maxlen)iterrr0s  r3r*r*^shq)))***r4cn|t|ddStt|||ddS)aXAdvance *iterable* by *n* steps. If *n* is ``None``, consume it
    entirely.

    Efficiently exhausts an iterator without returning values. Defaults to
    consuming the whole iterator, but an optional second argument may be
    provided to limit consumption.

        >>> i = (x for x in range(10))
        >>> next(i)
        0
        >>> consume(i, 3)
        >>> next(i)
        4
        >>> consume(i)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    If the iterator has fewer items remaining than the provided limit, the
    whole iterator will be consumed.

        >>> i = (x for x in range(3))
        >>> consume(i, 5)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    Nrr:)rnextr	)iteratorr1s  r3rrisG@	y
hq!!!!!!	
VHa
#
#T*****r4c@tt||d|S)zReturns the nth item or a default value.

    >>> l = range(10)
    >>> nth(l, 3)
    3
    >>> nth(l, 20, "zebra")
    'zebra'

    N)r>r	)r2r1defaults   r3rrs xD))7333r4cbt|}t|dot|dS)z
    Returns ``True`` if all the elements are equal to each other.

        >>> all_equal('aaaa')
        True
        >>> all_equal('aaab')
        False

    TF)rr>)r2gs  r3rrs/	A4==/a//r4c<tt||S)zcReturn the how many times the predicate is true.

    >>> quantify([True, False, True])
    2

    )sumr6)r2preds  r3r"r"ss4""###r4c<t|tdS)aReturns the sequence of elements and then returns ``None`` indefinitely.

        >>> take(5, pad_none(range(3)))
        [0, 1, 2, None, None]

    Useful for emulating the behavior of the built-in :func:`map` function.

    See also :func:`padded`.

    N)rr
r2s r3rrs6$<<(((r4c`tjtt||S)zvReturns the sequence elements *n* times

    >>> list(ncycles(["a", "b"], 3))
    ['a', 'b', 'a', 'b', 'a', 'b']

    )r
from_iterabler
tuple)r2r1s  r3rrs%veHooq99:::r4cRtttj||S)zcReturns the dot product of the two iterables.

    >>> dotproduct([10, 10], [20, 20])
    400

    )rEr6operatormul)vec1vec2s  r3rrs s8<t,,---r4c*tj|S)zReturn an iterator flattening one level of nesting in a list of lists.

        >>> list(flatten([[0, 1], [2, 3]]))
        [0, 1, 2, 3]

    See also :func:`collapse`, which can flatten multiple levels of nesting.

    )rrJ)listOfListss r3rrs{+++r4c||t|t|St|t||S)aGCall *func* with *args* repeatedly, returning an iterable over the
    results.

    If *times* is specified, the iterable will terminate after that many
    repetitions:

        >>> from operator import add
        >>> times = 4
        >>> args = 3, 5
        >>> list(repeatfunc(add, times, *args))
        [8, 8, 8, 8]

    If *times* is ``None`` the iterable will not terminate:

        >>> from random import randrange
        >>> times = None
        >>> args = 1, 11
        >>> take(6, repeatfunc(randrange, times, *args))  # doctest:+SKIP
        [2, 4, 8, 1, 8, 4]

    )rr
)functimesargss   r3r'r's9,
}tVD\\***4e,,---r4c#zKt|\}}t|dt||Ed{VdS)zReturns an iterator of paired items, overlapping, from the original

    >>> take(4, pairwise(count()))
    [(0, 1), (1, 2), (2, 3), (3, 4)]

    On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.

    N)rr>zip)r2abs   r3	_pairwiser[sJx==DAqDMMM1ayyr4)rc#4Kt|Ed{VdSN)itertools_pairwiserHs r3rrs,%h///////////r4ct|trtjdt||}}t|g|z}t
|d|iS)zCollect data into fixed-length chunks or blocks.

    >>> list(grouper('ABCDEFG', 3, 'x'))
    [('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]

    z+grouper expects iterable as first parameter	fillvalue)
isinstanceintwarningswarnDeprecationWarningr<r
)r2r1r`rVs    r3rrsa(C  "
9;M	
	
	
8NNaDT2222r4c'Kt|}td|D}|rI	|D]}|Vn2#t$r%|dz}tt||}YnwxYw|GdSdS)aJYields an item from each iterable, alternating between them.

        >>> list(roundrobin('ABC', 'D', 'EF'))
        ['A', 'D', 'E', 'B', 'F', 'C']

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    c3>K|]}t|jVdSr])r<__next__).0its  r3	zroundrobin..9s+88$r((#888888r4N)lenr
StopIterationr	)	iterablespendingnextsr>s    r3r(r(,s)nnG88i88888E
2	2

dff
	2	2	2qLG&0011EEE	2	22222sA,A/.A/ctfd|D}t|\}}d|Dd|DfS)a
    Returns a 2-tuple of iterables derived from the input iterable.
    The first yields the items that have ``pred(item) == False``.
    The second yields the items that have ``pred(item) == True``.

        >>> is_odd = lambda x: x % 2 != 0
        >>> iterable = range(10)
        >>> even_items, odd_items = partition(is_odd, iterable)
        >>> list(even_items), list(odd_items)
        ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])

    If *pred* is None, :func:`bool` is used.

        >>> iterable = [0, 1, False, True, '', ' ']
        >>> false_items, true_items = partition(None, iterable)
        >>> list(false_items), list(true_items)
        ([0, False, ''], [1, True, ' '])

    Nc32K|]}||fVdSr])rixrFs  r3rkzpartition..Zs/22ADDGGQ<222222r4c3$K|]\}}||VdSr]rtricondrus   r3rkzpartition..]s+++yad+++++++r4c3$K|]\}}||VdSr]rtrws   r3rkzpartition..^s+''ya$'''''''r4)boolr)rFr2evaluationst1t2s`    r3rrCse(|2222222K


FB++B+++''B'''r4ct|tjfdtt	dzDS)aYields all possible subsets of the iterable.

        >>> list(powerset([1, 2, 3]))
        [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]

    :func:`powerset` will operate on iterables that aren't :class:`set`
    instances, so repeated elements in the input will produce repeated elements
    in the output. Use :func:`unique_everseen` on the input to avoid generating
    duplicates:

        >>> seq = [1, 1, 0]
        >>> list(powerset(seq))
        [(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
        >>> from more_itertools import unique_everseen
        >>> list(powerset(unique_everseen(seq)))
        [(), (1,), (0,), (1, 0)]

    c38K|]}t|VdSr])r)rirss  r3rkzpowerset..vs-MMa|Aq11MMMMMMr4rl)r/rrJrangerm)r2rs @r3r r bsH&	
XAMMMM5Q!;L;LMMMMMMr4c#Kt}|j}g}|j}|du}|D]H}|r||n|}	||vr|||V&#t$r||vr|||VYEwxYwdS)a
    Yield unique elements, preserving order.

        >>> list(unique_everseen('AAAABBBCCDAABBB'))
        ['A', 'B', 'C', 'D']
        >>> list(unique_everseen('ABBCcAD', str.lower))
        ['A', 'B', 'C', 'D']

    Sequences with a mix of hashable and unhashable items can be used.
    The function will be slower (i.e., `O(n^2)`) for unhashable items.

    Remember that ``list`` objects are unhashable - you can use the *key*
    parameter to transform the list to a tuple (which is hashable) to
    avoid a slowdown.

        >>> iterable = ([1, 2], [2, 3], [1, 2])
        >>> list(unique_everseen(iterable))  # Slow
        [[1, 2], [2, 3]]
        >>> list(unique_everseen(iterable, key=tuple))  # Faster
        [[1, 2], [2, 3]]

    Similary, you may want to convert unhashable ``set`` objects with
    ``key=frozenset``. For ``dict`` objects,
    ``key=lambda x: frozenset(x.items())`` can be used.

    N)setaddappend	TypeError)	r2keyseensetseenset_addseenlistseenlist_adduse_keyelementks	         r3r,r,ys6eeG+KH?LoG		#0CCLLL	A


			  Q


	
		sA

A-,A-c
ttttjdt	||S)zYields elements in order, ignoring serial duplicates

    >>> list(unique_justseen('AAAABBBCCDAABBB'))
    ['A', 'B', 'C', 'D', 'A', 'B']
    >>> list(unique_justseen('ABBCcAD', str.lower))
    ['A', 'B', 'C', 'A', 'D']

    rl)r6r>rM
itemgetterr)r2rs  r3r-r-s3tS,Q//31G1GHHIIIr4c#XK	||V	|V
#|$rYdSwxYw)aXYields results from a function repeatedly until an exception is raised.

    Converts a call-until-exception interface to an iterator interface.
    Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
    to end the loop.

        >>> l = [0, 1, 2]
        >>> list(iter_except(l.pop, IndexError))
        [2, 1, 0]

    Nrt)rT	exceptionfirsts   r3rrs[
%''MMM	$&&LLL	



s ))c>tt|||S)a
    Returns the first true value in the iterable.

    If no true value is found, returns *default*

    If *pred* is not None, returns the first item for which
    ``pred(item) == True`` .

        >>> first_true(range(10))
        1
        >>> first_true(range(10), pred=lambda x: x > 5)
        6
        >>> first_true(range(10), default='missing', pred=lambda x: x > 9)
        'missing'

    )r>filter)r2rArFs   r3rrs"tX&&000r4rl)r
cRd|D|z}td|DS)aDraw an item at random from each of the input iterables.

        >>> random_product('abc', range(4), 'XYZ')  # doctest:+SKIP
        ('c', 3, 'Z')

    If *repeat* is provided as a keyword argument, that many items will be
    drawn from each iterable.

        >>> random_product('abcd', range(4), repeat=2)  # doctest:+SKIP
        ('a', 2, 'd', 3)

    This equivalent to taking a random selection from
    ``itertools.product(*args, **kwarg)``.

    c,g|]}t|SrtrKripools  r3
z"random_product..s***TU4[[***r4c34K|]}t|VdSr])rrs  r3rkz!random_product..s(00$000000r4r)r
rVpoolss   r3r&r&s9 
+*T***V3E00%000000r4ct|}|t|n|}tt||S)abReturn a random *r* length permutation of the elements in *iterable*.

    If *r* is not specified or is ``None``, then *r* defaults to the length of
    *iterable*.

        >>> random_permutation(range(5))  # doctest:+SKIP
        (3, 4, 0, 1, 2)

    This equivalent to taking a random selection from
    ``itertools.permutations(iterable, r)``.

    )rKrmr)r2rrs   r3r%r%s8??DYD			AAa!!!r4ct|t}ttt	||}tfd|DS)zReturn a random *r* length subsequence of the elements in *iterable*.

        >>> random_combination(range(5), 3)  # doctest:+SKIP
        (2, 3, 4)

    This equivalent to taking a random selection from
    ``itertools.combinations(iterable, r)``.

    c3(K|]}|V
dSr]rtriirs  r3rkz%random_combination..'**Qa******r4)rKrmsortedrr)r2rr1indicesrs    @r3r$r$s[??DD		AVE!HHa(())G****'******r4ct|ttfdt|D}tfd|DS)aSReturn a random *r* length subsequence of elements in *iterable*,
    allowing individual elements to be repeated.

        >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
        (0, 0, 1, 2, 2)

    This equivalent to taking a random selection from
    ``itertools.combinations_with_replacement(iterable, r)``.

    c36K|]}tVdSr])r)rirr1s  r3rkz6random_combination_with_replacement..s)44aYq\\444444r4c3(K|]}|V
dSr]rtrs  r3rkz6random_combination_with_replacement..rr4)rKrmrr)r2rrr1rs   @@r3r#r#sg??DD		A444458844444G****'******r4ct|}t|}|dks||krtd}t|||z
}t	d|dzD]}|||z
|zz|z}|dkr||z
}|dks||krt
g}|rS||z|z|dz
|dz
}}}||kr||z}|||z
z|z|dz
}}||k||d|z
|St|S)aEquivalent to ``list(combinations(iterable, r))[index]``.

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`nth_combination` computes the subsequence at
    sort position *index* directly, without computing the previous
    subsequences.

        >>> nth_combination(range(5), 3, 5)
        (0, 3, 4)

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    rrl)rKrm
ValueErrorminr
IndexErrorr)	r2rindexrr1crrresults	         r3rr"s8??DD		A	A1q55	AAq1u

A
1a!e__!!
QOq qyy


		uzz
F
$a%1*a!eQUa1qjjQJEA;!#QUqAqjj	

d26l###$==r4c$t|g|S)aYield *value*, followed by the elements in *iterator*.

        >>> value = '0'
        >>> iterator = ['1', '2', '3']
        >>> list(prepend(value, iterator))
        ['0', '1', '2', '3']

    To prepend multiple values, see :func:`itertools.chain`
    or :func:`value_chain`.

    )r)valuer?s  r3r!r!Ls%(###r4c#HKt|ddd}t|}tdg||z}t|t	d|dz
D]A}||t
ttj	||VBdS)aBConvolve the iterable *signal* with the iterable *kernel*.

        >>> signal = (1, 2, 3, 4, 5)
        >>> kernel = [3, 2, 1]
        >>> list(convolve(signal, kernel))
        [3, 8, 14, 20, 26, 14, 5]

    Note: the input arguments are not interchangeable, as the *kernel*
    is immediately consumed and stored.

    Nrrr:rl)
rKrmrrr
rrEr6rMrN)signalkernelr1windowrus     r3rr[s6]]44R4
 FFA
A3q
!
!
!A
%F
66!QU++
,
,55

a#hlFF3344444455r4)rr])NN)6__doc__rccollectionsr	itertoolsrrrrrr	r
rrr
rMrandomrrr__all__r+r)r*rrrrzr"rrrrrr'r[rr^ImportErrorrr(rr r,r-rrr&r%r$r#rr!rrtr4r3rsE,,,,,,,,,,B
%
%
% ''''$+++%+%+%+%+P
4
4
4
4000!$$$$)));;;...	,	,	,....6	)888888
000!(HHHH
3
3
3
3 222.>NNN.****Z	J	J	J	J



*1111("#11111(""""$
+
+
+ +++"'''T$$$55555s'A==BBPK!FF7_vendor/more_itertools/__pycache__/more.cpython-311.pycnu[

,ReddlZddlmZmZmZmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZddlmZm Z m!Z!m"Z"ddl#m$Z$m%Z%dd	l&m&Z&m'Z'm(Z(dd
l)m*Z*m+Z+m,Z,m-Z-m.Z.ddl/m0Z0m1Z1ddl2m3Z3d
dl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:gdZ;e<Z=dzdZ>e=fdZ?e=fdZ@e=fdZAGddZBdZCdZDdZEdZFdZGd{dZHd|dZId}dZJdZKd~d ZLd!ZMdzd"ZNGd#d$ZOd}d%ZPd&ZQd'ZRd{d(ZSdd)ZTdzd*ZUdd,ZVdd-ZWdd.ZXdd/ZYd0ZZdd1Z[d|d2Z\d3Z]dd5Z^Gd6d7e_Z`d8Zad9Zbddd:d;Zcdd=Zdd>Zed?Zfegehffd@Zid}dAZjddBZkGdCdDejejlZmd|dEZndFZoepdfdGZqdHZrdIZsdJZtGdKdLZudMZvdNZwdOfdPZxe,fddQdRZyGdSdTeZzGdUdVZ{GdWdXZ|epfdYZ}dZZ~d>> list(chunked([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]

    By the default, the last yielded list will have fewer than *n* elements
    if the length of *iterable* is not divisible by *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
        [[1, 2, 3], [4, 5, 6], [7, 8]]

    To use a fill-in value instead, see the :func:`grouper` recipe.

    If the length of *iterable* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    list is yielded.

    c3bKD](}t|krtd|V)dS)Nziterable is not divisible by n.len
ValueError)chunkiteratorns /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/more_itertools/more.pyretzchunked..retsI!

u::??$%FGGG

)iterrr1)iterablerstrictrrs `  @rr9r9~sf&GD!T(^^44b99H

						CCEE{{rc	tt|S#t$r%}|turt	d||cYd}~Sd}~wwxYw)aReturn the first item of *iterable*, or *default* if *iterable* is
    empty.

        >>> first([0, 1, 2, 3])
        0
        >>> first([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.

    :func:`first` is useful when you have a generator of expensive-to-retrieve
    values and want any arbitrary one. It is marginally shorter than
    ``next(iter(iterable), default)``.

    zKfirst() was called on an empty iterable, and no default value was provided.N)nextr
StopIteration_markerr)rdefaultes   rrIrIsr"DNN###g.

s
A
AA
A
cH	t|tr|dSt|dr'tdkrt	t|St
|ddS#tttf$r|turtd|cYSwxYw)aReturn the last item of *iterable*, or *default* if *iterable* is
    empty.

        >>> last([0, 1, 2, 3])
        3
        >>> last([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    __reversed__ir,maxlenzDlast() was called on an empty iterable, and no default was provided.)
isinstancerhasattrr)rreversedr
IndexError	TypeErrorrrr)rrs  rrSrSsh))	1B<
X~
.
.	1J*4L4L**+++!,,,R00	=1g

sA-6A-A--1B! B!cFtt||dz|S)agReturn the nth or the last item of *iterable*,
    or *default* if *iterable* is empty.

        >>> nth_or_last([0, 1, 2, 3], 2)
        2
        >>> nth_or_last([0, 1], 2)
        1
        >>> nth_or_last([], 0, 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    r,r)rSr)rrrs   rrYrYs%xQ''9999rcFeZdZdZdZdZdZefdZdZ	dZ
dZd	Zd
S)rbaWrap an iterator to allow lookahead and prepending elements.

    Call :meth:`peek` on the result to get the value that will be returned
    by :func:`next`. This won't advance the iterator:

        >>> p = peekable(['a', 'b'])
        >>> p.peek()
        'a'
        >>> next(p)
        'a'

    Pass :meth:`peek` a default value to return that instead of raising
    ``StopIteration`` when the iterator is exhausted.

        >>> p = peekable([])
        >>> p.peek('hi')
        'hi'

    peekables also offer a :meth:`prepend` method, which "inserts" items
    at the head of the iterable:

        >>> p = peekable([1, 2, 3])
        >>> p.prepend(10, 11, 12)
        >>> next(p)
        10
        >>> p.peek()
        11
        >>> list(p)
        [11, 12, 1, 2, 3]

    peekables can be indexed. Index 0 is the item that will be returned by
    :func:`next`, index 1 is the item after that, and so on:
    The values up to the given index will be cached.

        >>> p = peekable(['a', 'b', 'c', 'd'])
        >>> p[0]
        'a'
        >>> p[1]
        'b'
        >>> next(p)
        'a'

    Negative indexes are supported, but be aware that they will cache the
    remaining items in the source iterator, which may require significant
    storage.

    To check whether a peekable is exhausted, check its truth value:

        >>> p = peekable(['a', 'b'])
        >>> if p:  # peekable has items
        ...     list(p)
        ['a', 'b']
        >>> if not p:  # peekable is exhausted
        ...     list(p)
        []

    cTt||_t|_dSN)r_itr_cacheselfrs  r__init__zpeekable.__init__$s>>ggrc|Srrs r__iter__zpeekable.__iter__(rcT	|n#t$rYdSwxYwdSNFTpeekrrs r__bool__zpeekable.__bool__+=	IIKKKK			55	t
%%c|jsJ	|jt|jn#t$r|t
ur|cYSwxYw|jdS)zReturn the item that will be next returned from ``next()``.

        Return ``default`` if there are no items left. If ``default`` is not
        provided, raise ``StopIteration``.

        r)rappendrrrr)rrs  rrz
peekable.peek2st{	
""4>>2222 


g%%
{1~s,6AAcT|jt|dS)aStack up items to be the next ones returned from ``next()`` or
        ``self.peek()``. The items will be returned in
        first in, first out order::

            >>> p = peekable([1, 2, 3])
            >>> p.prepend(10, 11, 12)
            >>> next(p)
            10
            >>> list(p)
            [11, 12, 1, 2, 3]

        It is possible, by prepending items, to "resurrect" a peekable that
        previously raised ``StopIteration``.

            >>> p = peekable([])
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration
            >>> p.prepend(1)
            >>> next(p)
            1
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration

        N)r
extendleftr)ritemss  rprependzpeekable.prependBs&:	
x/////rcj|jr|jSt|jSr)rpopleftrrrs r__next__zpeekable.__next__as.;	);&&(((DH~~rcd|jdn|j}|dkr&|jdn|j}|jtn|j}n?|dkr*|jdn|j}|jtdz
n|j}nt	d|dks|dkr |j|jnptt||dzt}t|j}||kr0|jt|j||z
t|j|S)Nr,rrzslice step cannot be zero)
stepstartstopr*rrextendrminmaxrrlist)rindexrrrr	cache_lens       r
_get_slicezpeekable._get_slicegs(Z'qqej!88+-AAEKE$z177
DD
AXX ;.BBU[E&+j&8WHqLLuzDD8999
AII4!88Ktx((((Ct$$q('22ADK((II~~""6$(A	M#B#BCCCDK  ''rcVt|tr||St|j}|dkr |j|jn9||kr3|jt|j|dz|z
|j|SNrr,)rslicerrrrrr)rrrs   r__getitem__zpeekable.__getitem__seU##	*??5)))$$	199Ktx((((
i

Kvdh	I0EFFGGG{5!!rN)
__name__
__module____qualname____doc__rrrrrrrrrrrrrbrbs88t# 000>(((4
"
"
"
"
"rrbcNtjdtt|i|S)aReturn a sorted merge of the items from each of several already-sorted
    *iterables*.

        >>> list(collate('ACDZ', 'AZ', 'JKL'))
        ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']

    Works lazily, keeping only the next value from each iterable in memory. Use
    :func:`collate` to, for example, perform a n-way mergesort of items that
    don't fit in memory.

    If a *key* function is specified, the iterables will be sorted according
    to its result:

        >>> key = lambda s: int(s)  # Sort by numeric value, not by string
        >>> list(collate(['1', '10'], ['2', '11'], key=key))
        ['1', '2', '10', '11']


    If the *iterables* are sorted in descending order, set *reverse* to
    ``True``:

        >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
        [5, 4, 3, 2, 1, 0]

    If the elements of the passed-in iterables are out of order, you might get
    unexpected results.

    On Python 3.5+, this function is an alias for :func:`heapq.merge`.

    z
MF)&v&&&rc<tfd}|S)abDecorator that automatically advances a PEP-342-style "reverse iterator"
    to its first yield point so you don't have to call ``next()`` on it
    manually.

        >>> @consumer
        ... def tally():
        ...     i = 0
        ...     while True:
        ...         print('Thing number %s is %s.' % (i, (yield)))
        ...         i += 1
        ...
        >>> t = tally()
        >>> t.send('red')
        Thing number 0 is red.
        >>> t.send('fish')
        Thing number 1 is fish.

    Without the decorator, you would have to call ``next(t)`` before
    ``t.send()`` could be used.

    c6|i|}t||Sr)r)argsrgenfuncs   rwrapperzconsumer..wrappers'dD#F##S			
r)r
)rrs` rr>r>s5.4[[[
Nrczt}tt||dt|S)zReturn the number of items in *iterable*.

        >>> ilen(x for x in range(1000000) if x % 3 == 0)
        333334

    This consumes the iterable, so handle with care.

    rr)rrzipr)rcounters  rrKrKs6ggG	#h
 
 ++++==rc#(K	|V||})zReturn ``start``, ``func(start)``, ``func(func(start))``, ...

    >>> from itertools import islice
    >>> list(islice(iterate(lambda x: 2*x, 1), 10))
    [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

    r)rrs  rrPrPs&Urc#PK|5}|Ed{VddddS#1swxYwYdS)a:Wrap an iterable in a ``with`` statement, so it closes once exhausted.

    For example, this will close the file when the iterator is exhausted::

        upper_lines = (line.upper() for line in with_iter(open('foo')))

    Any context manager which returns an iterable is a candidate for
    ``with_iter``.

    Nr)context_managerrs  rr|r|s
Hs	ct|}	t|}n$#t$r}|ptd|d}~wwxYw	t|}d||}|pt|#t$rYnwxYw|S)aReturn the first item from *iterable*, which is expected to contain only
    that item. Raise an exception if *iterable* is empty or has more than one
    item.

    :func:`one` is useful for ensuring that an iterable contains only one item.
    For example, it can be used to retrieve the result of a database query
    that is expected to return a single row.

    If *iterable* is empty, ``ValueError`` will be raised. You may specify a
    different exception with the *too_short* keyword:

        >>> it = []
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: too many items in iterable (expected 1)'
        >>> too_short = IndexError('too few items')
        >>> one(it, too_short=too_short)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        IndexError: too few items

    Similarly, if *iterable* contains more than one item, ``ValueError`` will
    be raised. You may specify a different exception with the *too_long*
    keyword:

        >>> it = ['too', 'many']
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: Expected exactly one item in iterable, but got 'too',
        'many', and perhaps more.
        >>> too_long = RuntimeError
        >>> one(it, too_long=too_long)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        RuntimeError

    Note that :func:`one` attempts to advance *iterable* twice to ensure there
    is only one item. See :func:`spy` or :func:`peekable` to check iterable
    contents less destructively.

    z&too few items in iterable (expected 1)NLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)rrrrformat)r	too_shorttoo_longitfirst_valuersecond_valuemsgs        rr]r]sX
hB2hhM$LMM	
	*Bxx

  &{L A A	)*S//)



s$!
A=AA<<
B	B	cfd}d}t|}t||}d|cxkrkr nn|kr||n|||St|rdndS)aYield successive distinct permutations of the elements in *iterable*.

        >>> sorted(distinct_permutations([1, 0, 1]))
        [(0, 1, 1), (1, 0, 1), (1, 1, 0)]

    Equivalent to ``set(permutations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    Duplicate permutations arise when there are duplicated elements in the
    input iterable. The number of items returned is
    `n! / (x_1! * x_2! * ... * x_n!)`, where `n` is the total number of
    items input, and each `x_i` is the count of a distinct item in the input
    sequence.

    If *r* is given, only the *r*-length permutations are yielded.

        >>> sorted(distinct_permutations([1, 0, 1], r=2))
        [(0, 1), (1, 0), (1, 1)]
        >>> sorted(distinct_permutations(range(3), r=2))
        [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

    c3>K	t|Vtdz
ddD]}||||dzkrndStdz
|dD]}||||krn||||c||<||<|d|z
d||dzd<)NTrr,)tuplerange)Aijsizes   r_fullz$distinct_permutations.._full]s	,((NNN4!8R,,

Q4!AE(??E#4!8Q++

Q4!A$;;E
1qtJAaD!A$?QX?+Aa!eggJ)	,rc34K|d|||d}}t|dz
dd}tt|}	t|V|d}|D]}|||krn||}dS|D]-}||||kr||||c||<||<n1.|D]-}||||kr||||c||<||<n.||d||z
dz
}|dz
}|d||z
|||z
dc||d<|dd<)Nr,r)rrr)	rrheadtailright_head_indexesleft_tail_indexespivotrrs	         r_partialz'distinct_permutations.._partialusrrUAabbEd"1q5"b11!#d)),,	=++HE'

7U??EQ'



7T!W$$'+AwQ$DGT!WE%,AAwa((+/7DG(Qa)

D1q52&&D
FA $Wq1uW
tAEGG}DHd111g?	=rNrr)r)sortedrr)rrrrrrs     @rrDrDDs2,,,,,0%=%=%=N
8Eu::Dy1}}}}}}}}} !T		uuU|||0B0BBa"U###rc(|dkrtd|dkr,ttt||ddSt|g}t	||}ttt||ddS)a6Intersperse filler element *e* among the items in *iterable*, leaving
    *n* items between each filler element.

        >>> list(intersperse('!', [1, 2, 3, 4, 5]))
        [1, '!', 2, '!', 3, '!', 4, '!', 5]

        >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2))
        [1, 2, None, 3, 4, None, 5]

    rz
n must be > 0r,N)rrrMrr9r.)rrrfillerchunkss     rrNrNs	Avv)))	
ajH55q$???
1%%vj88!TBBCCCrcd|D}ttjtt|fdDfd|DS)aReturn the elements from each of the input iterables that aren't in the
    other input iterables.

    For example, suppose you have a set of packages, each with a set of
    dependencies::

        {'pkg_1': {'A', 'B'}, 'pkg_2': {'B', 'C'}, 'pkg_3': {'B', 'D'}}

    If you remove one package, which dependencies can also be removed?

    If ``pkg_1`` is removed, then ``A`` is no longer necessary - it is not
    associated with ``pkg_2`` or ``pkg_3``. Similarly, ``C`` is only needed for
    ``pkg_2``, and ``D`` is only needed for ``pkg_3``::

        >>> unique_to_each({'A', 'B'}, {'B', 'C'}, {'B', 'D'})
        [['A'], ['C'], ['D']]

    If there are duplicates in one input iterable that aren't in the others
    they will be duplicated in the output. Input order is preserved::

        >>> unique_to_each("mississippi", "missouri")
        [['p', 'p'], ['o', 'u', 'r']]

    It is assumed that the elements of each iterable are hashable.

    c,g|]}t|Sr)r).0rs  r
z"unique_to_each..s)))DHH)))rc,h|]}|dk|Sr,r)r	elementcountss  r	z!unique_to_each..s'EEE7w10D0Dw0D0D0DrcTg|]$}ttj|%Sr)rfilter__contains__)r	runiquess  rr
z"unique_to_each..s.BBBrD,b1122BBBr)rr
from_iterablemapset)rpoolrrs  @@rryrysl6*)y)))D
U(S$88
9
9FEEEEfEEEGBBBBTBBBBrc
#K|dkrtd|dkrtVdS|dkrtdt|}|}t|j|D]}|dz}|s|}t|Vt|}||kr2tt
|t|||z
VdSd|cxkrt||kr ndS||f|zz
}t|VdSdS)aMReturn a sliding window of width *n* over the given iterable.

        >>> all_windows = windowed([1, 2, 3, 4, 5], 3)
        >>> list(all_windows)
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    When the window is larger than the iterable, *fillvalue* is used in place
    of missing values:

        >>> list(windowed([1, 2, 3], 4))
        [(1, 2, 3, None)]

    Each window will advance in increments of *step*:

        >>> list(windowed([1, 2, 3, 4, 5, 6], 3, fillvalue='!', step=2))
        [(1, 2, 3), (3, 4, 5), (5, 6, '!')]

    To slide into the iterable's items, use :func:`chain` to add filler items
    to the left:

        >>> iterable = [1, 2, 3, 4]
        >>> n = 3
        >>> padding = [None] * (n - 1)
        >>> list(windowed(chain(padding, iterable), 3))
        [(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
    rn must be >= 0Nr,zstep must be >= 1r)	rrrrrrrrr)seqr	fillvaluerwindowr_rs        rr{r{sM6	1uu)***Avvgg


axx,---
!___F	A

$
$  	Q	 A--v;;DaxxE&&AH"="=>>???????	
Q				T1						9,""Fmm
	rc#Kg}t|D]}|||fVt|}t|}t	d|dzD])}t	||z
dzD]}||||zV*dS)aFYield all of the substrings of *iterable*.

        >>> [''.join(s) for s in substrings('more')]
        ['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']

    Note that non-string iterables can also be subdivided.

        >>> list(substrings([0, 1, 2]))
        [(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)]

    rr,N)rrrrr)rritem
item_countrrs      rrvrvs
CX

4g



**CSJ1j1n
%
%!!zA~)**	!	!Aa!a%i.    	!!!rctdtdz}|rt|}fd|DS)a@Yield all substrings and their positions in *seq*

    The items yielded will be a tuple of the form ``(substr, i, j)``, where
    ``substr == seq[i:j]``.

    This function only works for iterables that support slicing, such as
    ``str`` objects.

    >>> for item in substrings_indexes('more'):
    ...    print(item)
    ('m', 0, 1)
    ('o', 1, 2)
    ('r', 2, 3)
    ('e', 3, 4)
    ('mo', 0, 2)
    ('or', 1, 3)
    ('re', 2, 4)
    ('mor', 0, 3)
    ('ore', 1, 4)
    ('more', 0, 4)

    Set *reverse* to ``True`` to yield the same items in the opposite order.


    r,c3K|]<}tt|z
dzD]}|||z|||zfV=dSr,N)rr)r	Lrrs   r	z%substrings_indexes..Msv'(uSXX\A=M7N7N23QQYAE"r)rrr)rreversers`  rrwrw0s\4	aSAAQKK,-rc2eZdZdZddZdZdZdZdZdS)	r7aWrap *iterable* and return an object that buckets it iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    Nct||_||_tt|_|pd|_dS)NcdSNTrxs rz!bucket.__init__..zs$r)rr_keyrrr
_validator)rrkey	validators    rrzbucket.__init__vs7>>	!%((#7rc||sdS	t||}|j||n#t$rYdSwxYwdSr)r/rr
appendleftr)rvaluers   rrzbucket.__contains__|s|u%%	5	0U$$D
K))$////			55	
tsA
AAc#dK	|j|r"|j|Vn~		t|j}n#t$rYdSwxYw||}||kr|Vn6||r |j||})z
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        TN)rrrrrr.r/r)rr4r
item_values    r_get_valueszbucket._get_valuess	={5!
=k%(00222222
=#DH~~(!%4J!U**"


44=J/66t<<<
=	=sA


AAc#K|jD]L}||}||r |j||M|jEd{VdSr)rr.r/rrkeys)rrr6s   rrzbucket.__iter__sH	5	5D4Jz**
5J'..t444;##%%%%%%%%%%%rct||stdS||S)Nr)r/rr7rr4s  rrzbucket.__getitem__s5u%%	88O&&&rr)	rrrrrrr7rrrrrr7r7Rso!!F8888===4&&&'''''rr7ct|}t||}|t||fS)aReturn a 2-tuple with a list containing the first *n* elements of
    *iterable*, and an iterator with the same items as *iterable*.
    This allows you to "look ahead" at the items in the iterable without
    advancing it.

    There is one item in the list by default:

        >>> iterable = 'abcdefg'
        >>> head, iterable = spy(iterable)
        >>> head
        ['a']
        >>> list(iterable)
        ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    You may use unpacking to retrieve items instead of lists:

        >>> (head,), iterable = spy('abcdefg')
        >>> head
        'a'
        >>> (first, second), iterable = spy('abcdefg', 2)
        >>> first
        'a'
        >>> second
        'b'

    The number of items requested can be larger than the number of items in
    the iterable:

        >>> iterable = [1, 2, 3, 4, 5]
        >>> head, iterable = spy(iterable, 10)
        >>> head
        [1, 2, 3, 4, 5]
        >>> list(iterable)
        [1, 2, 3, 4, 5]

    )rr1copyr)rrrrs    rrsrss8J
hB2;;D99;;dB''rc8tjt|S)a4Return a new iterable yielding from each iterable in turn,
    until the shortest is exhausted.

        >>> list(interleave([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7]

    For a version that doesn't terminate after the shortest iterable is
    exhausted, see :func:`interleave_longest`.

    )rrr)rs rrMrMssI///rc`tjt|dti}d|DS)asReturn a new iterable yielding from each iterable in turn,
    skipping any that are exhausted.

        >>> list(interleave_longest([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7, 3, 8]

    This function produces the same output as :func:`roundrobin`, but may
    perform better for some inputs (in particular when the number of iterables
    is large).

    rc3,K|]}|tu|VdSr)r)r	r,s  rr%z%interleave_longest..s,--!AW,,A,,,,--r)rrrr)rrs  rrLrLs5	KFgFFGGA--q----rc#BKfd|dEd{VdS)a>Flatten an iterable with multiple levels of nesting (e.g., a list of
    lists of tuples) into non-iterable types.

        >>> iterable = [(1, 2), ([3, 4], [[5], [6]])]
        >>> list(collapse(iterable))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and
    will not be collapsed.

    To avoid collapsing other types, specify *base_type*:

        >>> iterable = ['ab', ('cd', 'ef'), ['gh', 'ij']]
        >>> list(collapse(iterable, base_type=tuple))
        ['ab', ('cd', 'ef'), 'gh', 'ij']

    Specify *levels* to stop flattening after a certain level:

    >>> iterable = [('a', ['b']), ('c', ['d'])]
    >>> list(collapse(iterable))  # Fully flattened
    ['a', 'b', 'c', 'd']
    >>> list(collapse(iterable, levels=1))  # Only one level flattened
    ['a', ['b'], 'c', ['d']]

    c3K|ks.t|ttfst|r|VdS	t|}|D]}||dzEd{VdS#t$r|VYdSwxYwNr,)rstrbytesrr)nodeleveltreechild	base_typelevelswalks    rrLzcollapse..walks uv~~$e--(6&JtY,G,G&JJJF	2::D

2
24uqy1111111111
2
2				JJJFF	sA,,A>=A>rNr)rrJrKrLs ``@rr;r;sX62222222$tHa           rc#K	|
|||D]}|||Vn&t||D]}|||Ed{V||dSdS#||wwxYw)auInvoke *func* on each item in *iterable* (or on each *chunk_size* group
    of items) before yielding the item.

    `func` must be a function that takes a single argument. Its return value
    will be discarded.

    *before* and *after* are optional functions that take no arguments. They
    will be executed before iteration starts and after it ends, respectively.

    `side_effect` can be used for logging, updating progress bars, or anything
    that is not functionally "pure."

    Emitting a status message:

        >>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> func = lambda x: print(x, file=f)
        >>> before = lambda: print(u'HEADER', file=f)
        >>> after = f.close
        >>> it = [u'a', u'b', u'c']
        >>> consume(side_effect(func, it, before=before, after=after))
        >>> f.closed
        True

    N)r9)rr
chunk_sizebeforeafterrrs       rrkrk+sXFHHH 

T







!:66
!
!U         EGGGGG5EGGGGsA	AA,cttfdtdD|rfd}t|SS)apYield slices of length *n* from the sequence *seq*.

    >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
    [(1, 2, 3), (4, 5, 6)]

    By the default, the last yielded slice will have fewer than *n* elements
    if the length of *seq* is not divisible by *n*:

    >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
    [(1, 2, 3), (4, 5, 6), (7, 8)]

    If the length of *seq* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    slice is yielded.

    This function will only work for iterables that support slicing.
    For non-sliceable iterables, see :func:`chunked`.

    c32K|]}||zVdSrr)r	rrrs  rr%zsliced..|s/CC!s1q1u9~CCCCCCrrc3bKD](}t|krtd|V)dS)Nzseq is not divisible by n.r)_slicerrs rrzsliced..retsK"

v;;!##$%ABBB

r)rrrr)rrrrrs``  @rrlrlhsu(CCCCCuQ{{CCCDDH

						CCEE{{rrc#
K|dkrt|VdSg}t|}|D]O}||r-|V|r|gV|dkrt|VdSg}|dz}:||P|VdS)a<Yield lists of items from *iterable*, where each list is delimited by
    an item where callable *pred* returns ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b'))
        [['a'], ['c', 'd', 'c'], ['a']]

        >>> list(split_at(range(10), lambda n: n % 2 == 1))
        [[0], [2], [4], [6], [8], []]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_at(range(10), lambda n: n % 2 == 1, maxsplit=2))
        [[0], [2], [4, 5, 6, 7, 8, 9]]

    By default, the delimiting items are not included in the output.
    The include them, set *keep_separator* to ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b', keep_separator=True))
        [['a'], ['b'], ['c', 'd', 'c'], ['b'], ['a']]

    rNr,rrr)rpredmaxsplitkeep_separatorbufrrs       rrnrns.1}}8nn
C	
hB4::
	III
f1}}2hhCMHHJJt

IIIIIrc#K|dkrt|VdSg}t|}|D]M}||r+|r)|V|dkr|gt|zVdSg}|dz}||N|r|VdSdS)a\Yield lists of items from *iterable*, where each list ends just before
    an item for which callable *pred* returns ``True``:

        >>> list(split_before('OneTwo', lambda s: s.isupper()))
        [['O', 'n', 'e'], ['T', 'w', 'o']]

        >>> list(split_before(range(10), lambda n: n % 3 == 0))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_before(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]
    rNr,rVrrWrXrZrrs      rrprps 1}}8nn
C	
hB4::	#	III1}}ftBxx''''CMH

4
					rc#K|dkrt|VdSg}t|}|D]I}||||r'|r%|V|dkrt|VdSg}|dz}J|r|VdSdS)a[Yield lists of items from *iterable*, where each list ends with an
    item where callable *pred* returns ``True``:

        >>> list(split_after('one1two2', lambda s: s.isdigit()))
        [['o', 'n', 'e', '1'], ['t', 'w', 'o', '2']]

        >>> list(split_after(range(10), lambda n: n % 3 == 0))
        [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_after(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0], [1, 2, 3], [4, 5, 6, 7, 8, 9]]

    rNr,rVr\s      rroros"1}}8nn
C	
hB

44::	#	III1}}2hhCMH
					rc#NK|dkrt|VdSt|}	t|}n#t$rYdSwxYw|g}|D]N}|||r)|V|dkr|gt|zVdSg}|dz}|||}O|VdS)aSplit *iterable* into pieces based on the output of *pred*.
    *pred* should be a function that takes successive pairs of items and
    returns ``True`` if the iterable should be split in between them.

    For example, to find runs of increasing numbers, split the iterable when
    element ``i`` is larger than element ``i + 1``:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2], lambda x, y: x > y))
        [[1, 2, 3, 3], [2, 5], [2, 4], [2]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2],
        ...                 lambda x, y: x > y, maxsplit=2))
        [[1, 2, 3, 3], [2, 5], [2, 4, 2]]

    rNr,)rrrrr)rrWrXrcur_itemrZ	next_items       rrqrqs&1}}8nn	
hB88*C

	4)$$	III1}} kDHH,,,,CMH

9

IIIIIs<
A
	A
c#Kt|}|D]7}|t|VdStt||V8dS)aYield a list of sequential items from *iterable* of length 'n' for each
    integer 'n' in *sizes*.

        >>> list(split_into([1,2,3,4,5,6], [1,2,3]))
        [[1], [2, 3], [4, 5, 6]]

    If the sum of *sizes* is smaller than the length of *iterable*, then the
    remaining items of *iterable* will not be returned.

        >>> list(split_into([1,2,3,4,5,6], [2,3]))
        [[1, 2], [3, 4, 5]]

    If the sum of *sizes* is larger than the length of *iterable*, fewer items
    will be returned in the iteration that overruns *iterable* and further
    lists will be empty:

        >>> list(split_into([1,2,3,4], [1,2,3,4]))
        [[1], [2, 3], [4], []]

    When a ``None`` object is encountered in *sizes*, the returned list will
    contain items up to the end of *iterable* the same way that itertools.slice
    does:

        >>> list(split_into([1,2,3,4,5,6,7,8,9,0], [2,3,None]))
        [[1, 2], [3, 4, 5], [6, 7, 8, 9, 0]]

    :func:`split_into` can be useful for grouping a series of items where the
    sizes of the groups are not uniform. An example would be where in a row
    from a table, multiple columns represent elements of the same feature
    (e.g. a point represented by x,y,z) but, the format is not the same for
    all columns.
    N)rrr)rsizesrrs    rrrrr*siF
hB))<r((NNNFFvb$''(((((())rc#
Kt|}|%t|t|Ed{VdS|dkrtdd}|D]}|V|dz
}|r||z
|zn||z
}t	|D]}|VdS)aYield the elements from *iterable*, followed by *fillvalue*, such that
    at least *n* items are emitted.

        >>> list(padded([1, 2, 3], '?', 5))
        [1, 2, 3, '?', '?']

    If *next_multiple* is ``True``, *fillvalue* will be emitted until the
    number of items emitted is a multiple of *n*::

        >>> list(padded([1, 2, 3, 4], n=3, next_multiple=True))
        [1, 2, 3, 4, None, None]

    If *n* is ``None``, *fillvalue* will be emitted indefinitely.

    Nr,n must be at least 1r)rrrrr)	rrr
next_multiplerr r	remainingrs	         rr_r_Ws 
hByVI..///////////	
Q/000
		DJJJ!OJJ,9MQ^q((q:~	y!!		AOOOO		rc#nKt}|D]}|V|tur|n|}t|Ed{VdS)a"After the *iterable* is exhausted, keep yielding its last element.

        >>> list(islice(repeat_last(range(3)), 5))
        [0, 1, 2, 2, 2]

    If the iterable is empty, yield *default* forever::

        >>> list(islice(repeat_last(range(0), 42), 5))
        [42, 42, 42, 42, 42]

    N)rr)rrrfinals    rrcrcws\D



wGGDEe}}rcdkrtdt|}fdt|DS)aDistribute the items from *iterable* among *n* smaller iterables.

        >>> group_1, group_2 = distribute(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 3, 5]
        >>> list(group_2)
        [2, 4, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = distribute(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 4, 7], [2, 5], [3, 6]]

    If the length of *iterable* is smaller than *n*, then the last returned
    iterables will be empty:

        >>> children = distribute(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function uses :func:`itertools.tee` and may require significant
    storage. If you need the order items in the smaller iterables to match the
    original iterable, see :func:`divide`.

    r,rdc:g|]\}}t||dSr)r)r	rrrs   rr
zdistribute..s+LLL95"F2udA&&LLLr)rr	enumerate)rrchildrens`  rrErEsN8	1uu/0008QHLLLL	(8K8KLLLLrrrr,cXt|t|}t||||dS)a[Yield tuples whose elements are offset from *iterable*.
    The amount by which the `i`-th item in each tuple is offset is given by
    the `i`-th item in *offsets*.

        >>> list(stagger([0, 1, 2, 3]))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3)]
        >>> list(stagger(range(8), offsets=(0, 2, 4)))
        [(0, 2, 4), (1, 3, 5), (2, 4, 6), (3, 5, 7)]

    By default, the sequence will end when the final element of a tuple is the
    last item in the iterable. To continue until the first element of a tuple
    is the last item in the iterable, set *longest* to ``True``::

        >>> list(stagger([0, 1, 2, 3], longest=True))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3), (2, 3, None), (3, None, None)]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    )offsetslongestr)rrr)rrorprrls     rrtrts9*8S\\**H	7Gyrc eZdZdfd	ZxZS)r}Ncld}|
|dj|z
}t|dS)Nz Iterables have different lengthsz/: index 0 has length {}; index {} has length {})rsuperr)rdetailsr	__class__s   rrzUnequalIterablesError.__init__sI0MEM
C	rr)rrrr
__classcell__)rus@rr}r}s=rr}c#rKt|dtiD]"}|D]}|turt|V#dS)Nr)rrr})rcombovals   r_zip_equal_generatorrzs`i;7;;	.	.Cg~~+---	rcXtdkrtjdt	t	|d}t|dddD]\}}t	|}||krn
t
|St|||f#t$rt|cYSwxYw)a ``zip`` the input *iterables* together, but raise
    ``UnequalIterablesError`` if they aren't all the same length.

        >>> it_1 = range(3)
        >>> it_2 = iter('abc')
        >>> list(zip_equal(it_1, it_2))
        [(0, 'a'), (1, 'b'), (2, 'c')]

        >>> it_1 = range(3)
        >>> it_2 = iter('abcd')
        >>> list(zip_equal(it_1, it_2)) # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        more_itertools.more.UnequalIterablesError: Iterables have different
        lengths

    i
zwzip_equal will be removed in a future version of more-itertools. Use the builtin zip function with strict=True instead.rr,N)rt)
r)rrrrrkrr}rrz)r
first_sizerrrs     rr~r~s$Y
'

	
	
	
/1&&
y}a00	#	#EArr77Dz!!"	?"$ZD,ABBBB///#I...../sAB
:B

B)(B))rprc	t|t|krtdg}t||D]~\}}|dkr3|t	t|||>|dkr%|t
||di|||rt|d|iSt|S)aF``zip`` the input *iterables* together, but offset the `i`-th iterable
    by the `i`-th item in *offsets*.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1)))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e')]

    This can be used as a lightweight alternative to SciPy or pandas to analyze
    data sets in which some series have a lead or lag relationship.

    By default, the sequence will end when the shortest iterable is exhausted.
    To continue until the longest iterable is exhausted, set *longest* to
    ``True``.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1), longest=True))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e'), (None, 'f')]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    z,Number of iterables and offsets didn't matchrNr)rrrrrrrr)rorprr	staggeredrrs       rrr
s*9~~W%%GHHHIY((!!Aq55U6)aR#8#8"==>>>>
UUVB4001111R    <I;;;;	?rrc	
t|}n@t|}t|dkr|dfd}nt|fd}ttt	t|||S)aReturn the input iterables sorted together, with *key_list* as the
    priority for sorting. All iterables are trimmed to the length of the
    shortest one.

    This can be used like the sorting function in a spreadsheet. If each
    iterable represents a column of data, the key list determines which
    columns are used for sorting.

    By default, all iterables are sorted using the ``0``-th iterable::

        >>> iterables = [(4, 3, 2, 1), ('a', 'b', 'c', 'd')]
        >>> sort_together(iterables)
        [(1, 2, 3, 4), ('d', 'c', 'b', 'a')]

    Set a different key list to sort according to another iterable.
    Specifying multiple keys dictates how ties are broken::

        >>> iterables = [(3, 1, 2), (0, 1, 0), ('c', 'b', 'a')]
        >>> sort_together(iterables, key_list=(1, 2))
        [(2, 3, 1), (0, 0, 1), ('a', 'c', 'b')]

    To sort by a function of the elements of the iterable, pass a *key*
    function. Its arguments are the elements of the iterables corresponding to
    the key list::

        >>> names = ('a', 'b', 'c')
        >>> lengths = (1, 2, 3)
        >>> widths = (5, 2, 1)
        >>> def area(length, width):
        ...     return length * width
        >>> sort_together([names, lengths, widths], key_list=(1, 2), key=area)
        [('c', 'b', 'a'), (3, 2, 1), (1, 2, 5)]

    Set *reverse* to ``True`` to sort in descending order.

        >>> sort_together([(1, 2, 3), ('c', 'b', 'a')], reverse=True)
        [(3, 2, 1), ('a', 'b', 'c')]

    Nr,rc&|Srr)zipped_itemsr0
key_offsets rr-zsort_together..esL4L0M0Mrc |Srr)r
get_key_itemsr0s rr-zsort_together..js|,,1r)r0r&)r$rrrr)rkey_listr0r&key_argumentrrs  `  @@rrmrm1sP{"8,>>x==A"!JMMMMMLL'1MLVCOw
G
G
GHrctt|\}}|sdS|d}t|t|}dt	fdt|DS)aThe inverse of :func:`zip`, this function disaggregates the elements
    of the zipped *iterable*.

    The ``i``-th iterable contains the ``i``-th element from each element
    of the zipped iterable. The first element is used to to determine the
    length of the remaining elements.

        >>> iterable = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> letters, numbers = unzip(iterable)
        >>> list(letters)
        ['a', 'b', 'c', 'd']
        >>> list(numbers)
        [1, 2, 3, 4]

    This is similar to using ``zip(*iterable)``, but it avoids reading
    *iterable* into memory. Note, however, that this function uses
    :func:`itertools.tee` and thus may require significant storage.

    rrcfd}|S)Nc@	|S#t$rtwxYwr)rr)objrs rgetterz)unzip..itemgetter..getters4
$1v


$

$

$$#

$sr)rrs` rr$zunzip..itemgetters#
	$
	$
	$
	$
	$
rc3PK|] \}}t||V!dSrr)r	rrr$s   rr%zunzip..s9JJEArZZ]]B''JJJJJJr)rsrrrrrk)rrrr$s   @rrzrzss(h((ND(r7DHc$ii((I$JJJJYy5I5IJJJJJJrcv|dkrtd	|dd|}n#t$rt|}YnwxYwtt	||\}}g}d}td|dzD]>}|}|||kr|dzn|z
}|t|||?|S)aDivide the elements from *iterable* into *n* parts, maintaining
    order.

        >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 2, 3]
        >>> list(group_2)
        [4, 5, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = divide(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 2, 3], [4, 5], [6, 7]]

    If the length of the iterable is smaller than n, then the last returned
    iterables will be empty:

        >>> children = divide(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function will exhaust the iterable before returning and may require
    significant storage. If order is not important, see :func:`distribute`,
    which does not first pull the iterable into memory.

    r,rdNr)rrrdivmodrrrr)	rrrqrrrrrs	         rrFrFs:	1uu/000!Hoo
#c((ADAq
CD
1a!e__**aAQ&

4E$J(())))Js
$AAc|tdS| t||rt|fS	t|S#t$rt|fcYSwxYw)axIf *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    Nr)rrr)rrJs  rr5r5sxR{Bxx:c9#=#=SF||CyySF||sAA! A!c|dkrtdt|\}}dg|z}t|t|||}ttt|d|zdz}t
||S)asReturn an iterable over `(bool, item)` tuples where the `item` is
    drawn from *iterable* and the `bool` indicates whether
    that item satisfies the *predicate* or is adjacent to an item that does.

    For example, to find whether items are adjacent to a ``3``::

        >>> list(adjacent(lambda x: x == 3, range(6)))
        [(False, 0), (False, 1), (True, 2), (True, 3), (True, 4), (False, 5)]

    Set *distance* to change what counts as adjacent. For example, to find
    whether items are two places away from a ``3``:

        >>> list(adjacent(lambda x: x == 3, range(6), distance=2))
        [(False, 0), (True, 1), (True, 2), (True, 3), (True, 4), (True, 5)]

    This is useful for contextualizing the results of a search function.
    For example, a code comparison tool might want to identify lines that
    have changed, but also surrounding lines to give the viewer of the diff
    context.

    The predicate function will only be called once for each item in the
    iterable.

    See also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    rzdistance must be at least 0Frr,)rrrranyr{r)	predicaterdistancei1i2paddingselectedadjacent_to_selecteds        rr4r4s:!||6777
]]FBg GWc)R00'::HsHXq8|a7G$H$HII#R(((rcjt||}rfd|D}rfd|D}|S)aAn extension of :func:`itertools.groupby` that can apply transformations
    to the grouped data.

    * *keyfunc* is a function computing a key value for each item in *iterable*
    * *valuefunc* is a function that transforms the individual items from
      *iterable* after grouping
    * *reducefunc* is a function that transforms each group of items

    >>> iterable = 'aAAbBBcCC'
    >>> keyfunc = lambda k: k.upper()
    >>> valuefunc = lambda v: v.lower()
    >>> reducefunc = lambda g: ''.join(g)
    >>> list(groupby_transform(iterable, keyfunc, valuefunc, reducefunc))
    [('A', 'aaa'), ('B', 'bbb'), ('C', 'ccc')]

    Each optional argument defaults to an identity function if not specified.

    :func:`groupby_transform` is useful when grouping elements of an iterable
    using a separate iterable as the key. To do this, :func:`zip` the iterables
    and pass a *keyfunc* that extracts the first element and a *valuefunc*
    that extracts the second element::

        >>> from operator import itemgetter
        >>> keys = [0, 0, 1, 1, 1, 2, 2, 2, 3]
        >>> values = 'abcdefghi'
        >>> iterable = zip(keys, values)
        >>> grouper = groupby_transform(iterable, itemgetter(0), itemgetter(1))
        >>> [(k, ''.join(g)) for k, g in grouper]
        [(0, 'ab'), (1, 'cde'), (2, 'fgh'), (3, 'i')]

    Note that the order of items in the iterable is significant.
    Only adjacent items are grouped together, so if you don't want any
    duplicate groups, you should sort the iterable by the key function.

    c3BK|]\}}|t|fVdSrr)r	kg	valuefuncs   rr%z$groupby_transform..Ys666$!Q3y!$$%666666rc38K|]\}}||fVdSrr)r	rr
reducefuncs   rr%z$groupby_transform..[s422da::a==!222222rr)rkeyfuncrrrs  `` rrJrJ3s]H(G
$
$C76666#66632222c222JrceZdZdZeeddZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdS)r\a<An extension of the built-in ``range()`` function whose arguments can
    be any orderable numeric type.

    With only *stop* specified, *start* defaults to ``0`` and *step*
    defaults to ``1``. The output items will match the type of *stop*:

        >>> list(numeric_range(3.5))
        [0.0, 1.0, 2.0, 3.0]

    With only *start* and *stop* specified, *step* defaults to ``1``. The
    output items will match the type of *start*:

        >>> from decimal import Decimal
        >>> start = Decimal('2.1')
        >>> stop = Decimal('5.1')
        >>> list(numeric_range(start, stop))
        [Decimal('2.1'), Decimal('3.1'), Decimal('4.1')]

    With *start*, *stop*, and *step*  specified the output items will match
    the type of ``start + step``:

        >>> from fractions import Fraction
        >>> start = Fraction(1, 2)  # Start at 1/2
        >>> stop = Fraction(5, 2)  # End at 5/2
        >>> step = Fraction(1, 2)  # Count by 1/2
        >>> list(numeric_range(start, stop, step))
        [Fraction(1, 2), Fraction(1, 1), Fraction(3, 2), Fraction(2, 1)]

    If *step* is zero, ``ValueError`` is raised. Negative steps are supported:

        >>> list(numeric_range(3, -1, -1.0))
        [3.0, 2.0, 1.0, 0.0]

    Be aware of the limitations of floating point numbers; the representation
    of the yielded numbers may be surprising.

    ``datetime.datetime`` objects can be used for *start* and *stop*, if *step*
    is a ``datetime.timedelta`` object:

        >>> import datetime
        >>> start = datetime.datetime(2019, 1, 1)
        >>> stop = datetime.datetime(2019, 1, 3)
        >>> step = datetime.timedelta(days=1)
        >>> items = iter(numeric_range(start, stop, step))
        >>> next(items)
        datetime.datetime(2019, 1, 1, 0, 0)
        >>> next(items)
        datetime.datetime(2019, 1, 2, 0, 0)

    rct|}|dkrV|\|_t|jd|_t|j|jz
d|_n|dkr:|\|_|_t|j|jz
d|_nf|dkr|\|_|_|_nJ|dkr"td|td|t|jd|_|j|jkrtd|j|jk|_	|
dS)Nr,rrz2numeric_range expected at least 1 argument, got {}z2numeric_range expected at most 3 arguments, got {}z&numeric_range() arg 3 must not be zero)r_stoptype_start_steprr_zeror_growing	_init_len)rrargcs   rrznumeric_range.__init__sf4yy199 MTZ*$tz**1--DK7dj4;677::DJJ
QYY&*#DK7dj4;677::DJJ
QYY26/DKTZZ
QYY%%+VD\\

&&,fTll

&T$*%%a((
:##EFFF
TZ/
rcP|jr|j|jkS|j|jkSr)rrrrs rrznumeric_range.__bool__s*=	,;++;++rc|jr6|j|cxkr|jkrnnR||jz
|jz|jkSn6|j|cxkr|jkrnn|j|z
|jz|jkSdSNF)rrrrr)relems  rrznumeric_range.__contains__s=	J{d////TZ/////t{*dj8DJFF0{d////TZ/////d*
{;tzIIurct|trtt|}t|}|s|r|o|S|j|jko;|j|jko+|d|dkSdS)NrF)rr\boolrr
_get_by_index)rother
empty_selfempty_others    r__eq__znumeric_range.__eq__se]++	!$ZZJ"5kk/K
[
!1k1K5</J
ek1J**2..%2E2Eb2I2II5rct|tr||St|tr|j|jn|j|jz}|j|j|jkr|j}n2|j|jkr|j	}n||j}|j
|j
|jkr|j	}n3|j
|jkr|j}n||j
}t|||Std
t|j)Nz8numeric range indices must be integers or slices, not {})rintrrrrr_lenrrrr\rrrr)rr0rrrs     rrznumeric_range.__getitem__s0c3	%%c***
U
#
#	!$!14::sx$*7LDy CI$)$;$;di''
**3955x38ty#8#8zdiZ''{))#(33 d333--3VDII4F-G-G
rcr|r/t|j|d|jfS|jSNr)hashrrr_EMPTY_HASHrs r__hash__znumeric_range.__hash__s:	$d&8&8&<&.s0BBQ$+TZ0BBBBBBr)rrrrr'rr()rvaluess` rrznumeric_range.__iter__sbBBBB%''BBB=	>WR44f===WR44f===rc|jSr)rrs r__len__znumeric_range.__len__s
yrc|jr|j}|j}|j}n|j}|j}|j}||z
}||jkr	d|_dSt
||\}}t|t||jkz|_dSNr)rrrrrrrr)rrrrrrrs       rrznumeric_range._init_lens=	KE:D:DDJE;DJ;D%<tz!!DIII(D))DAqAQ$*_!5!55DIIIrc8t|j|j|jffSr)r\rrrrs r
__reduce__znumeric_range.__reduce__st{DJ
CCCrc&|jdkr:dt|jt|jSdt|jt|jt|jS)Nr,znumeric_range({}, {})znumeric_range({}, {}, {}))rrreprrrrs r__repr__znumeric_range.__repr__s}:??*11T[!!4
#3#3
/55T[!!4
#3#3T$*5E5E
rctt|d|j|jz
|jSr)rr\rrrrs rrznumeric_range.__reversed__sC""2&&dj(@4:+



	
rc$t||vSr)rr;s  rrznumeric_range.count s5D=!!!rc|jrU|j|cxkr|jkr=nnt||jz
|j\}}||jkrt
|SnU|j|cxkr|jkr>nn;t|j|z
|j\}}||jkrt
|Std|)Nz{} is not in numeric range)	rrrrrrrrr)rr4rrs    rrznumeric_range.index#s=		"{e0000dj00000edk14:>>1
??q66M{e0000dj00000dkE1DJ;??1
??q66M5<>>666 DDD


"""EEE,,,,,rr\ctstdS|tnt|}fd|DS)aCycle through the items from *iterable* up to *n* times, yielding
    the number of completed cycles along with each item. If *n* is omitted the
    process repeats indefinitely.

    >>> list(count_cycle('AB', 3))
    [(0, 'A'), (0, 'B'), (1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]

    rNc3*K|]
}D]}||fV	dSrr)r	rrrs   rr%zcount_cycle..Fs4<>> list(mark_ends('ABC'))
    [(True, False, 'A'), (False, False, 'B'), (False, True, 'C')]

    Use this when looping over an iterable to take special action on its first
    and/or last items:

    >>> iterable = ['Header', 100, 200, 'Footer']
    >>> total = 0
    >>> for is_first, is_last, item in mark_ends(iterable):
    ...     if is_first:
    ...         continue  # Skip the header
    ...     if is_last:
    ...         continue  # Skip the footer
    ...     total += item
    >>> print(total)
    300
    NrFT)rrrr)rrbras     rrArAIs(
hBHH	#	#AARAq&%"""""	#	#
1fdAos#
11-A$$A=<A=c|*ttt||S|dkrtdt	||t
}ttt
||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(locate([0, 1, 1, 0, 1, 0, 0]))
        [1, 2, 4]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item.

        >>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
        [1, 3]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(locate(iterable, pred=pred, window_size=3))
        [1, 5, 9]

    Use with :func:`seekable` to find indexes and then retrieve the associated
    items:

        >>> from itertools import count
        >>> from more_itertools import seekable
        >>> source = (3 * n + 1 if (n % 2) else n // 2 for n in count())
        >>> it = seekable(source)
        >>> pred = lambda x: x > 100
        >>> indexes = locate(it, pred=pred)
        >>> i = next(indexes)
        >>> it.seek(i)
        >>> next(it)
        106

    Nr,zwindow size must be at least 1r)rrrrr{rr)rrWwindow_sizers    rrTrTnssLT8!4!4555Q9:::	(K7	;	;	;BEGGWT2..///rc"t||S)aYield the items from *iterable*, but strip any from the beginning
    for which *pred* returns ``True``.

    For example, to remove a set of items from the start of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(lstrip(iterable, pred))
        [1, 2, None, 3, False, None]

    This function is analogous to to :func:`str.lstrip`, and is essentially
    an wrapper for :func:`itertools.dropwhile`.

    )rrrWs  rrUrUsT8$$$rc#Kg}|j}|j}|D]/}||r|||Ed{V||V0dS)aYield the items from *iterable*, but strip any from the end
    for which *pred* returns ``True``.

    For example, to remove a set of items from the end of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(rstrip(iterable, pred))
        [None, False, None, 1, 2, None, 3]

    This function is analogous to :func:`str.rstrip`.

    N)rclear)rrWcachecache_appendcache_clearr,s      rrfrfs
Ett|||S)aYield the items from *iterable*, but strip any from the
    beginning and end for which *pred* returns ``True``.

    For example, to remove a set of items from both ends of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(strip(iterable, pred))
        [1, 2, None, 3]

    This function is analogous to :func:`str.strip`.

    )rfrUrs  rrurus&4(($///rc*eZdZdZdZdZdZdZdS)rOaAn extension of :func:`itertools.islice` that supports negative values
    for *stop*, *start*, and *step*.

        >>> iterable = iter('abcdefgh')
        >>> list(islice_extended(iterable, -4, -1))
        ['e', 'f', 'g']

    Slices with negative values require some caching of *iterable*, but this
    function takes care to minimize the amount of memory required.

    For example, you can use a negative step with an infinite iterator:

        >>> from itertools import count
        >>> list(islice_extended(count(), 110, 99, -2))
        [110, 108, 106, 104, 102, 100]

    You can also use slice notation directly:

        >>> iterable = map(str, count())
        >>> it = islice_extended(iterable)[10:20:2]
        >>> list(it)
        ['10', '12', '14', '16', '18']

    crt|}|rt|t||_dS||_dSr)r_islice_helperr	_iterable)rrrrs    rrzislice_extended.__init__s9
(^^	 +Bt==DNNNDNNNrc|Srrrs rrzislice_extended.__iter__rrc*t|jSr)rrrs rrzislice_extended.__next__DN###rct|tr"tt|j|Std)Nz4islice_extended.__getitem__ argument must be a slice)rrrOrrr)rr0s  rrzislice_extended.__getitem__	s>c5!!	H">$.##F#FGGGNOOOrN)rrrrrrrrrrrrOrOs_2   $$$PPPPPrrOc#0K|j}|j}|jdkrtd|jpd}|dkrZ|dn|}|dkrt	t|d|}|r|ddnd}t
||zd}||}n*|dkrt||}nt
||zd}||z
}	|	dkrdSt|d|	|D]	\}
}|V
dS||dkrtt|||dt	t|||}t|D];\}
}|
}|
|zdkr|V||>> print(*always_reversible(x for x in range(3)))
        2 1 0

    If the iterable is already reversible, this function returns the
    result of :func:`reversed()`. If the iterable is not reversible,
    this function will cache the remaining items in the iterable and
    yield them in reverse order, which may require significant storage.
    )rrrrs rr6r6i	sJ(!!!(((X'''''(s&::c|Srrr+s rr-r-{	sArc#Ktt|fdD]$\}}ttd|V%dS)aYield groups of consecutive items using :func:`itertools.groupby`.
    The *ordering* function determines whether two items are adjacent by
    returning their position.

    By default, the ordering function is the identity function. This is
    suitable for finding runs of numbers:

        >>> iterable = [1, 10, 11, 12, 20, 30, 31, 32, 33, 40]
        >>> for group in consecutive_groups(iterable):
        ...     print(list(group))
        [1]
        [10, 11, 12]
        [20]
        [30, 31, 32, 33]
        [40]

    For finding runs of adjacent letters, try using the :meth:`index` method
    of a string of letters:

        >>> from string import ascii_lowercase
        >>> iterable = 'abcdfgilmnop'
        >>> ordering = ascii_lowercase.index
        >>> for group in consecutive_groups(iterable, ordering):
        ...     print(list(group))
        ['a', 'b', 'c', 'd']
        ['f', 'g']
        ['i']
        ['l', 'm', 'n', 'o', 'p']

    Each group of consecutive items is an iterator that shares it source with
    *iterable*. When an an output group is advanced, the previous group is
    no longer available unless its elements are copied (e.g., into a ``list``).

        >>> iterable = [1, 2, 11, 12, 21, 22]
        >>> saved_groups = []
        >>> for group in consecutive_groups(iterable):
        ...     saved_groups.append(list(group))  # Copy group elements
        >>> saved_groups
        [[1, 2], [11, 12], [21, 22]]

    c8|d|dz
Srr)r,orderings rr-z$consecutive_groups..	s1Q4((1Q4..+@rr0r,N)rrkrr$)rrrrs `  rr=r={	snT(!@!@!@!@$$1*Q--######$$r)initialc
t|\}}	t|g}n#t$rtgcYSwxYw|g}t	|t|t
||S)aThis function is the inverse of :func:`itertools.accumulate`. By default
    it will compute the first difference of *iterable* using
    :func:`operator.sub`:

        >>> from itertools import accumulate
        >>> iterable = accumulate([0, 1, 2, 3, 4])  # produces 0, 1, 3, 6, 10
        >>> list(difference(iterable))
        [0, 1, 2, 3, 4]

    *func* defaults to :func:`operator.sub`, but other functions can be
    specified. They will be applied as follows::

        A, B, C, D, ... --> A, func(B, A), func(C, B), func(D, C), ...

    For example, to do progressive division:

        >>> iterable = [1, 2, 6, 24, 120]
        >>> func = lambda x, y: x // y
        >>> list(difference(iterable, func))
        [1, 2, 3, 4, 5]

    If the *initial* keyword is set, the first element will be skipped when
    computing successive differences.

        >>> it = [10, 11, 13, 16]  # from accumulate([1, 2, 3], initial=10)
        >>> list(difference(it, initial=10))
        [1, 2, 3]

    )rrrrrrr)rrrrrrIs      rrBrB	s<x==DAqa	Bxxc!Qii00111s%AAc*eZdZdZdZdZdZdZdS)rjaSReturn a read-only view of the sequence object *target*.

    :class:`SequenceView` objects are analogous to Python's built-in
    "dictionary view" types. They provide a dynamic view of a sequence's items,
    meaning that when the sequence updates, so does the view.

        >>> seq = ['0', '1', '2']
        >>> view = SequenceView(seq)
        >>> view
        SequenceView(['0', '1', '2'])
        >>> seq.append('3')
        >>> view
        SequenceView(['0', '1', '2', '3'])

    Sequence views support indexing, slicing, and length queries. They act
    like the underlying sequence, except they don't allow assignment:

        >>> view[1]
        '1'
        >>> view[1:-1]
        ['1', '2']
        >>> len(view)
        4

    Sequence views are useful as an alternative to copying, as they don't
    require (much) extra storage.

    cLt|tst||_dSr)rrr_target)rtargets  rrzSequenceView.__init__	s$&(++	Orc|j|Sr)r)rrs  rrzSequenceView.__getitem__	s|E""rc*t|jSr)rrrs rrzSequenceView.__len__	s4<   rcfd|jjt|jS)Nz{}({}))rrurrrrs rrzSequenceView.__repr__	s%t~6T\8J8JKKKrN)rrrrrrrrrrrrjrj	s_:
###!!!LLLLLrrjcBeZdZdZd
dZdZdZdZefdZ	dZ
d	ZdS)ria
Wrap an iterator to allow for seeking backward and forward. This
    progressively caches the items in the source iterable so they can be
    re-visited.

    Call :meth:`seek` with an index to seek to that position in the source
    iterable.

    To "reset" an iterator, seek to ``0``:

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> it.seek(0)
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> next(it)
        '3'

    You can also seek forward:

        >>> it = seekable((str(n) for n in range(20)))
        >>> it.seek(10)
        >>> next(it)
        '10'
        >>> it.seek(20)  # Seeking past the end of the source isn't a problem
        >>> list(it)
        []
        >>> it.seek(0)  # Resetting works even after hitting the end
        >>> next(it), next(it), next(it)
        ('0', '1', '2')

    Call :meth:`peek` to look ahead one item without advancing the iterator:

        >>> it = seekable('1234')
        >>> it.peek()
        '1'
        >>> list(it)
        ['1', '2', '3', '4']
        >>> it.peek(default='empty')
        'empty'

    Before the iterator is at its end, calling :func:`bool` on it will return
    ``True``. After it will return ``False``:

        >>> it = seekable('5678')
        >>> bool(it)
        True
        >>> list(it)
        ['5', '6', '7', '8']
        >>> bool(it)
        False

    You may view the contents of the cache with the :meth:`elements` method.
    That returns a :class:`SequenceView`, a view that updates automatically:

        >>> it = seekable((str(n) for n in range(10)))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> elements = it.elements()
        >>> elements
        SequenceView(['0', '1', '2'])
        >>> next(it)
        '3'
        >>> elements
        SequenceView(['0', '1', '2', '3'])

    By default, the cache grows as the source iterable progresses, so beware of
    wrapping very large or infinite iterables. Supply *maxlen* to limit the
    size of the cache (this of course limits how far back you can seek).

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()), maxlen=2)
        >>> next(it), next(it), next(it), next(it)
        ('0', '1', '2', '3')
        >>> list(it.elements())
        ['2', '3']
        >>> it.seek(0)
        >>> next(it), next(it), next(it), next(it)
        ('2', '3', '4', '5')
        >>> next(it)
        '6'

    Nczt||_|g|_ntg||_d|_dSr)r_sourcerr_index)rrrs   rrzseekable.__init__X
s9H~~>DKKF++DKrc|Srrrs rrzseekable.__iter__`
rrc|j<	|j|j}|xjdz
c_|S#t$r
d|_YnwxYwt|j}|j||SrC)rrrrrrrrs  rrzseekable.__next__c
s;"
{4;/q 	
#
#
#"
#DL!!4   s-AAcT	|n#t$rYdSwxYwdSrrrs rrzseekable.__bool__q
rrc	t|}n#t$r|tur|cYSwxYw|jt	|j|_|xjdzc_|SrC)rrrrrr)rrpeekeds   rrz
seekable.peekx
sv	$ZZFF			'!!NNN	;dk**DKq
s++c*t|jSr)rjrrs relementszseekable.elements
sDK(((rcr||_|t|jz
}|dkrt||dSdSr)rrrr-)rr	remainders   rseekz
seekable.seek
sCC,,,	q==D)$$$$$=rr)rrrrrrrrrrrrrrrriri
sSSj#



)))%%%%%rric>eZdZdZedZedZdS)rga
    :func:`run_length.encode` compresses an iterable with run-length encoding.
    It yields groups of repeated items with the count of how many times they
    were repeated:

        >>> uncompressed = 'abbcccdddd'
        >>> list(run_length.encode(uncompressed))
        [('a', 1), ('b', 2), ('c', 3), ('d', 4)]

    :func:`run_length.decode` decompresses an iterable that was previously
    compressed with run-length encoding. It yields the items of the
    decompressed iterable:

        >>> compressed = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> list(run_length.decode(compressed))
        ['a', 'b', 'b', 'c', 'c', 'c', 'd', 'd', 'd', 'd']

    c4dt|DS)Nc3>K|]\}}|t|fVdSr)rK)r	rrs   rr%z$run_length.encode..
s0;;ADGG;;;;;;rrrs rencodezrun_length.encode
s;;):):;;;;rc>tjd|DS)Nc3<K|]\}}t||VdSr)r)r	rrs   rr%z$run_length.decode..
s."E"EDAq6!Q<<"E"E"E"E"E"Er)rrrs rdecodezrun_length.decode
s"""E"EH"E"E"EEEErN)rrrrstaticmethodrrrrrrgrg
sY&<<\<FF\FFFrrgc	ftt|dzt|||kS)aReturn ``True`` if exactly ``n`` items in the iterable are ``True``
    according to the *predicate* function.

        >>> exactly_n([True, True, False], 2)
        True
        >>> exactly_n([True, True, False], 1)
        False
        >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
        True

    The iterable will be advanced until ``n + 1`` truthy items are encountered,
    so avoid calling it on infinite iterables.

    r,)rr1r)rrrs   rrGrG
s/tAE6)X667788A==rc	t|}tt|tt	|t|S)zReturn a list of circular shifts of *iterable*.

    >>> circular_shifts(range(4))
    [(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
    )rr1rr{r)rlsts  rr:r:
s;x..CC(5::s3xx88999rcfd}|S)aReturn a decorator version of *wrapping_func*, which is a function that
    modifies an iterable. *result_index* is the position in that function's
    signature where the iterable goes.

    This lets you use itertools on the "production end," i.e. at function
    definition. This can augment what the function returns without changing the
    function's code.

    For example, to produce a decorator version of :func:`chunked`:

        >>> from more_itertools import chunked
        >>> chunker = make_decorator(chunked, result_index=0)
        >>> @chunker(3)
        ... def iter_range(n):
        ...     return iter(range(n))
        ...
        >>> list(iter_range(9))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

    To only allow truthy items to be returned:

        >>> truth_serum = make_decorator(filter, result_index=1)
        >>> @truth_serum(bool)
        ... def boolean_test():
        ...     return [0, 1, '', ' ', False, True]
        ...
        >>> list(boolean_test())
        [1, ' ', True]

    The :func:`peekable` and :func:`seekable` wrappers make for practical
    decorators:

        >>> from more_itertools import peekable
        >>> peekable_function = make_decorator(peekable)
        >>> @peekable_function()
        ... def str_range(*args):
        ...     return (str(x) for x in range(*args))
        ...
        >>> it = str_range(1, 20, 2)
        >>> next(it), next(it), next(it)
        ('1', '3', '5')
        >>> it.peek()
        '7'
        >>> next(it)
        '7'

    cfd}|S)Ncfd}|S)Ncn|i|}t}|||iSr)rinsert)	rrresultwrapping_args_fresult_index
wrapping_args
wrapping_funcwrapping_kwargss	    r
inner_wrapperzOmake_decorator..decorator..outer_wrapper..inner_wrapper
sOD+F++!%m!4!4%%lF;;;$}nHHHHrr)r!r&r"r#r$r%s` r
outer_wrapperz8make_decorator..decorator..outer_wrapper
sB
I
I
I
I
I
I
I
I
I! rr)r#r%r'r"r$s`` r	decoratorz!make_decorator..decorator
s5	!	!	!	!	!	!	!	!rr)r$r"r(s`` rrVrV
s+d





rc
|dn|}tt}|D]3}||}||}|||4|(|D]\}}||||<d|_|S)aReturn a dictionary that maps the items in *iterable* to categories
    defined by *keyfunc*, transforms them with *valuefunc*, and
    then summarizes them by category with *reducefunc*.

    *valuefunc* defaults to the identity function if it is unspecified.
    If *reducefunc* is unspecified, no summarization takes place:

        >>> keyfunc = lambda x: x.upper()
        >>> result = map_reduce('abbccc', keyfunc)
        >>> sorted(result.items())
        [('A', ['a']), ('B', ['b', 'b']), ('C', ['c', 'c', 'c'])]

    Specifying *valuefunc* transforms the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> result = map_reduce('abbccc', keyfunc, valuefunc)
        >>> sorted(result.items())
        [('A', [1]), ('B', [1, 1]), ('C', [1, 1, 1])]

    Specifying *reducefunc* summarizes the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> reducefunc = sum
        >>> result = map_reduce('abbccc', keyfunc, valuefunc, reducefunc)
        >>> sorted(result.items())
        [('A', 1), ('B', 2), ('C', 3)]

    You may want to filter the input iterable before applying the map/reduce
    procedure:

        >>> all_items = range(30)
        >>> items = [x for x in all_items if 10 <= x <= 20]  # Filter
        >>> keyfunc = lambda x: x % 2  # Evens map to 0; odds to 1
        >>> categories = map_reduce(items, keyfunc=keyfunc)
        >>> sorted(categories.items())
        [(0, [10, 12, 14, 16, 18, 20]), (1, [11, 13, 15, 17, 19])]
        >>> summaries = map_reduce(items, keyfunc=keyfunc, reducefunc=sum)
        >>> sorted(summaries.items())
        [(0, 90), (1, 75)]

    Note that all items in the iterable are gathered into a list before the
    summarization step, which may require significant storage.

    The returned object is a :obj:`collections.defaultdict` with the
    ``default_factory`` set to ``None``, such that it behaves like a normal
    dictionary.

    Nc|Srrr+s rr-zmap_reduce..;s1r)rrrrdefault_factory)	rrrrrrr0r4
value_lists	         rrXrXsf#,"3)I
d

Cgdmm	$C"yy{{	.	.OC!z*--CHHCJrc	|I	t|fdtt||DS#t$rYnwxYwtt	t|||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``, starting from the right and moving left.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(rlocate([0, 1, 1, 0, 1, 0, 0]))  # Truthy at 1, 2, and 4
        [4, 2, 1]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item:

        >>> iterable = iter('abcb')
        >>> pred = lambda x: x == 'b'
        >>> list(rlocate(iterable, pred))
        [3, 1]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(rlocate(iterable, pred=pred, window_size=3))
        [9, 5, 1]

    Beware, this function won't return anything for infinite iterables.
    If *iterable* is reversible, ``rlocate`` will reverse it and search from
    the right. Otherwise, it will search from the left and return the results
    in reverse order.

    See :func:`locate` to for other example applications.

    Nc3(K|]}|z
dz
V
dSr#r)r	rrs  rr%zrlocate..os,OOHqL1$OOOOOOr)rrTrrr)rrWrrs   @rrereKsB	8}}HOOOOfXh5G5G.N.NOOOO			D	D$<<==>>>s7=
A
	A
c#JK|dkrtdt|}t|tg|dz
z}t	||}d}|D]K}||r)|||kr!|dz
}|Ed{Vt||dz
0|r|dtur
|dVLdS)aYYield the items from *iterable*, replacing the items for which *pred*
    returns ``True`` with the items from the iterable *substitutes*.

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
        >>> pred = lambda x: x == 0
        >>> substitutes = (2, 3)
        >>> list(replace(iterable, pred, substitutes))
        [1, 1, 2, 3, 1, 1, 2, 3, 1, 1]

    If *count* is given, the number of replacements will be limited:

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1, 0]
        >>> pred = lambda x: x == 0
        >>> substitutes = [None]
        >>> list(replace(iterable, pred, substitutes, count=2))
        [1, 1, None, 1, 1, None, 1, 1, 0]

    Use *window_size* to control the number of items passed as arguments to
    *pred*. This allows for locating and replacing subsequences.

        >>> iterable = [0, 1, 2, 5, 0, 1, 2, 5]
        >>> window_size = 3
        >>> pred = lambda *args: args == (0, 1, 2)  # 3 items passed to pred
        >>> substitutes = [3, 4] # Splice in these items
        >>> list(replace(iterable, pred, substitutes, window_size=window_size))
        [3, 4, 5, 3, 4, 5]

    r,zwindow_size must be at least 1rN)rrrrr{r-)	rrWsubstitutesrrrwindowsrws	         rrdrdvs:Q9:::$$K
x'kAo6	7	7Br;''G	A
48	
1u99Q&&&&&&&&q111
	!A$g%%A$JJJ#rc#Kt|t}ttd|D]'}fdt	d|z||fzDV(dS)a"Yield all possible order-preserving partitions of *iterable*.

    >>> iterable = 'abc'
    >>> for part in partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['a', 'b', 'c']

    This is unrelated to :func:`partition`.

    r,c*g|]\}}||Srr)r	rrsequences   rr
zpartitions..s%AAAAx!}AAArrN)rrr0rr)rrrr5s   @rr`r`sH~~HH

A
eAqkk
"
"BBAAAATAXqA4x)@)@AAAAAAABBrc#Kt|}t|}||dkrtd||krdSfd|*td|dzD]}||Ed{VdS||Ed{VdS)a
    Yield the set partitions of *iterable* into *k* parts. Set partitions are
    not order-preserving.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable, 2):
    ...     print([''.join(p) for p in part])
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']


    If *k* is not given, every set partition is generated.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']
    ['a', 'b', 'c']

    Nr,z6Can't partition in a negative or zero number of groupsc3XKt|}|dkr|gVdS||krd|DVdS|^}}||dz
D]
}|gg|V||D]I}tt|D]*}|d||g||zgz||dzdzV+JdS)Nr,cg|]}|gSrr)r	rs  rr
zAset_partitions..set_partitions_helper..s"""1A3"""r)rr)r$rrrMprset_partitions_helpers       rr;z-set_partitions..set_partitions_helpersFF66#IIIII
!VV""""""""""EA**1a!e44
 
 siQi**1a00
<
<s1vv<>> from time import sleep
    >>> def generator():
    ...     yield 1
    ...     yield 2
    ...     sleep(0.2)
    ...     yield 3
    >>> iterable = time_limited(0.1, generator())
    >>> list(iterable)
    [1, 2]
    >>> iterable.timed_out
    True

    Note that the time is checked before each item is yielded, and iteration
    stops if  the time elapsed is greater than *limit_seconds*. If your time
    limit is 1 second, but it takes 2 seconds to generate the first item from
    the iterable, the function will run for 2 seconds and not yield anything.

    c|dkrtd||_t||_t	|_d|_dS)Nrzlimit_seconds must be positiveF)r
limit_secondsrrr+_start_time	timed_out)rr>rs   rrztime_limited.__init__sH1=>>>*h$;;rc|Srrrs rrztime_limited.__iter__ rrct|j}t|jz
|jkrd|_t|Sr*)rrr+r?r>r@rrs  rrztime_limited.__next__#s=DN##;;))D,>>>!DNrNrrrrrrrrrrrxrxsK0rrxct|}t||}	t|}d||}|pt|#t$rYnwxYw|S)a*If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.

    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError

    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    r)rrrrr)rrrrrrrs       rr^r^,s0
hBr7##K	*Bxx

  &{L A A	)*S//)



sA
A$#A$c#Kt|}	t|t}|turdStt	|g|\}}t||Vt
||d)aBreak *iterable* into sub-iterables with *n* elements each.
    :func:`ichunked` is like :func:`chunked`, but it yields iterables
    instead of lists.

    If the sub-iterables are read in order, the elements of *iterable*
    won't be stored in memory.
    If they are read out of order, :func:`itertools.tee` is used to cache
    elements as necessary.

    >>> from itertools import count
    >>> all_chunks = ichunked(count(), 4)
    >>> c_1, c_2, c_3 = next(all_chunks), next(all_chunks), next(all_chunks)
    >>> list(c_2)  # c_1's elements have been cached; c_3's haven't been
    [4, 5, 6, 7]
    >>> list(c_1)
    [0, 1, 2, 3]
    >>> list(c_3)
    [8, 9, 10, 11]

    TN)rrrrrrr-)rrsourcerrs     rrQrQUs*(^^FFG$$7??Fvv..//
Rmm	rc	#HK|dkrtd|dkrdVdSt|}tt|t	dg}dg|z}d}|r	t|d\}}n)#t$r||dz}YAwxYw|||<|dz|krt|VnR|tt||dzd|dzt	d|dz
}|dSdS)aBYield the distinct combinations of *r* items taken from *iterable*.

        >>> list(distinct_combinations([0, 0, 1], 2))
        [(0, 0), (0, 1)]

    Equivalent to ``set(combinations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    rzr must be non-negativerNr,rr)	rrr2rkr$rrpopr)rrr
generators
current_comborGcur_idxr:s        rrCrCzsz	1uu1222	
a??D!)D//z!}}EEEFJFQJM
E
	jn--JGQQ			NNQJEH	 !
e19>>
&&&&&&d7Q;==17Q;??"1





QJE#s*B#B)(B)c'JK|D]}	|||V#|$rYwxYwdS)aYield the items from *iterable* for which the *validator* function does
    not raise one of the specified *exceptions*.

    *validator* is called for each item in *iterable*.
    It should be a function that accepts one argument and raises an exception
    if that item is not valid.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(filter_except(int, iterable, ValueError, TypeError))
    ['1', '2', '4']

    If an exception other than one given by *exceptions* is raised by
    *validator*, it is raised like normal.
    Nr)r1r
exceptionsrs    rrHrHsb	IdOOOJJJJ			D	s  c'FK|D]}	||V#|$rYwxYwdS)aTransform each item from *iterable* with *function* and yield the
    result, unless *function* raises one of the specified *exceptions*.

    *function* is called to transform each item in *iterable*.
    It should be a accept one argument.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(map_except(int, iterable, ValueError, TypeError))
    [1, 2, 4]

    If an exception other than one given by *exceptions* is raised by
    *function*, it is raised like normal.
    Nr)functionrrMrs    rrWrWs]	(4..    			D	s
c	2t||}ttt|z}|t	tttd|z
zz}t||D]\}}||kr||t
|<|ttt|zz}|t	tttd|z
zdzz
}|SrC)r1rrr!rrkr")rr	reservoirW
next_indexrr
s       r_sample_unweightedrTs
Q!!I	CMMAAU3vxx==3q1u::5666J#Ha00@@wJ&-Iill#
S]]Q&'''A%FHH

AE

 :;;a??Jrc6d|D}t|t||td\}}tt	|z}t||D]\}}||kr{d\}}t||z}	t
|	d}
t|
|z}t||fd\}}tt	|z}||z}fdt|DS)Nc3RK|]"}tt|zV#dSr)rr!)r	weights  rr%z#_sample_weighted..s1@@f3vxx==6)@@@@@@rrr,c:g|]}tdSr)r)r	rrQs  rr
z$_sample_weighted..	
s&444aGIq!444r)	r1rrrr!rr#r
r)
rrweightsweight_keyssmallest_weight_keyrweights_to_skiprWr
t_wr_2
weight_keyrQs
            @r_sample_weightedr`s:
A@@@@KQK2233II'q\&((mm&99Ow11&&_$$&/q\"f2233C#q//CSF*J	J#8999%.q\"!&((mm.AAOOv%OO54445884444rc|dkrgSt|}|t||St|}t|||S)afReturn a *k*-length list of elements chosen (without replacement)
    from the *iterable*. Like :func:`random.sample`, but works on iterables
    of unknown length.

    >>> iterable = range(100)
    >>> sample(iterable, 5)  # doctest: +SKIP
    [81, 60, 96, 16, 4]

    An iterable with *weights* may also be given:

    >>> iterable = range(100)
    >>> weights = (i * i + 1 for i in range(100))
    >>> sampled = sample(iterable, 5, weights=weights)  # doctest: +SKIP
    [79, 67, 74, 66, 78]

    The algorithm can also be used to generate weighted random permutations.
    The relative weight of each item determines the probability that it
    appears late in the permutation.

    >>> data = "abcdefgh"
    >>> weights = range(1, len(data) + 1)
    >>> sample(data, k=len(data), weights=weights)  # doctest: +SKIP
    ['c', 'a', 'b', 'e', 'g', 'd', 'h', 'f']
    r)rrTr`)rrrYs   rrhrh
sO2	Avv	H~~H!(A...w--!W555rc|rtnt}||nt||}tt	|t|S)aReturns ``True`` if the items of iterable are in sorted order, and
    ``False`` otherwise. *key* and *reverse* have the same meaning that they do
    in the built-in :func:`sorted` function.

    >>> is_sorted(['1', '2', '3', '4', '5'], key=int)
    True
    >>> is_sorted([5, 4, 3, 1, 2], reverse=True)
    False

    The function returns ``False`` after encountering the first out-of-order
    item. If there are no out-of-order items, the iterable is exhausted.
    )r(r'rrrr/)rr0r&comparers     rrRrR0
sJ#bbGkC(:(:B77HRLL112222rceZdZdS)r3N)rrrrrrr3r3C
sDrr3cdeZdZdZd
dZdZdZdZdZe	d	Z
e	d
ZdZdS)r8aConvert a function that uses callbacks to an iterator.

    Let *func* be a function that takes a `callback` keyword argument.
    For example:

    >>> def func(callback=None):
    ...     for i, c in [(1, 'a'), (2, 'b'), (3, 'c')]:
    ...         if callback:
    ...             callback(i, c)
    ...     return 4


    Use ``with callback_iter(func)`` to get an iterator over the parameters
    that are delivered to the callback.

    >>> with callback_iter(func) as it:
    ...     for args, kwargs in it:
    ...         print(args)
    (1, 'a')
    (2, 'b')
    (3, 'c')

    The function will be called in a background thread. The ``done`` property
    indicates whether it has completed execution.

    >>> it.done
    True

    If it completes successfully, its return value will be available
    in the ``result`` property.

    >>> it.result
    4

    Notes:

    * If the function uses some keyword argument besides ``callback``, supply
      *callback_kwd*.
    * If it finished executing, but raised an exception, accessing the
      ``result`` property will raise the same exception.
    * If it hasn't finished executing, accessing the ``result``
      property from within the ``with`` block will raise ``RuntimeError``.
    * If it hasn't finished executing, accessing the ``result`` property from
      outside the ``with`` block will raise a
      ``more_itertools.AbortThread`` exception.
    * Provide *wait_seconds* to adjust how frequently the it is polled for
      output.

    callback皙?c||_||_d|_d|_||_tdjd|_|	|_
dS)NFzconcurrent.futuresr,)max_workers)_func
_callback_kwd_aborted_future
_wait_seconds
__import__futuresThreadPoolExecutor	_executor_reader	_iterator)rrcallback_kwdwait_secondss    rrzcallback_iter.__init__z
s_
)
)#$899ATTabTccrc|Srrrs r	__enter__zcallback_iter.__enter__
rrcFd|_|jdSr*)rlrrshutdown)rexc_type	exc_value	tracebacks    r__exit__zcallback_iter.__exit__
s#
!!!!!rc|Srrrs rrzcallback_iter.__iter__
rrc*t|jSr)rrtrs rrzcallback_iter.__next__
rrcF|jdS|jSr)rmdoners rrzcallback_iter.done
s#<5|  """rc`|jstd|jS)NzFunction has not yet completed)rRuntimeErrorrmrrs rrzcallback_iter.result
s0y	A?@@@|""$$$rc#Ktfd}jjjfij|i_		j}|Vn#t$rYnwxYwj
rn`g}		}||n#t$rYnwxYwP
|Ed{VdS)Ncbjrtd||fdS)Nzcanceled by user)rlr3put)rrrrs  rrfz'callback_iter._reader..callback
s8}
6!"4555
EE4.!!!!!rT)timeout)r rrsubmitrjrkrmgetrn	task_donerr
get_nowaitrjoin)rrfrrfrs`   @rrszcallback_iter._reader
swGG	"	"	"	"	"	"-t~,J

-x8


	
uuT%7u88






	



|  ""

			'
'||~~


  &&&&	



	'	
s#A33
B?B"C  
C-,C-N)rfrg)
rrrrrrxr~rrpropertyrrrsrrrr8r8G
s00d(((("""$$$##X#
%%X%#####rr8c# K|dkrtdt|}t|}||krtdt||z
dzD]-}|d|}||||z}|||zd}|||fV.dS)a
    Yield ``(beginning, middle, end)`` tuples, where:

    * Each ``middle`` has *n* items from *iterable*
    * Each ``beginning`` has the items before the ones in ``middle``
    * Each ``end`` has the items after the ones in ``middle``

    >>> iterable = range(7)
    >>> n = 3
    >>> for beginning, middle, end in windowed_complete(iterable, n):
    ...     print(beginning, middle, end)
    () (0, 1, 2) (3, 4, 5, 6)
    (0,) (1, 2, 3) (4, 5, 6)
    (0, 1) (2, 3, 4) (5, 6)
    (0, 1, 2) (3, 4, 5) (6,)
    (0, 1, 2, 3) (4, 5, 6) ()

    Note that *n* must be at least 0 and most equal to the length of
    *iterable*.

    This function will exhaust the iterable and may require significant
    storage.
    rrzn must be <= len(seq)r,N)rrrr)rrrrr	beginningmiddleends        rrr
s0	1uu)***
//Cs88D4xx0111
4!8a<
 
 %%G	QQY!a%''l$$$$$	%%rct}|j}g}|j}|rt||n|D]8}	||vrdS||#t$r||vrYdS||Y5wxYwdS)a
    Returns ``True`` if all the elements of *iterable* are unique (no two
    elements are equal).

        >>> all_unique('ABCB')
        False

    If a *key* function is specified, it will be used to make comparisons.

        >>> all_unique('ABCb')
        True
        >>> all_unique('ABCb', str.lower)
        False

    The function returns as soon as the first non-unique element is
    encountered. Iterables with a mix of hashable and unhashable items can
    be used, but the function will be slower for unhashable items.
    FT)raddrrr)rr0seensetseenset_addseenlistseenlist_addr
s       rrr
s&eeG+KH?L),:3sH%%%(""	"'!!uuK    	"	"	"(""uuuL!!!!!	"4sA	A		A)A)(A)ctttt|}ttt|}tt|}|dkr||z
}d|cxkr|ks	ntg}t||D](\}}|	|||z||z})tt|S)aEquivalent to ``list(product(*args))[index]``.

    The products of *args* can be ordered lexicographically.
    :func:`nth_product` computes the product at sort position *index* without
    computing the previous products.

        >>> nth_product(8, range(2), range(2), range(2), range(2))
        (1, 0, 0, 0)

    ``IndexError`` will be raised if the given *index* is invalid.
    r)
rrrrrr	r%rrr)rrpoolsnscrrrs        rr[r[s
UHTNN++,,E	
c#uoo		BsBAqyy

>>>>>>>>
Fub>>a

d519o&&&
!&!!"""rcnt|}t|}|||kr|t|}}n8d|cxkr|ks	ntt|t||z
z}|dkr||z
}d|cxkr|ks	nt|dkrtSdg|z}||kr|t|z|zn|}t
d|dzD]8}t||\}}	d||z
cxkr|krnn|	|||z
<|dkrn9tt|j	|S)a'Equivalent to ``list(permutations(iterable, r))[index]```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`nth_permutation`
    computes the subsequence at sort position *index* directly, without
    computing the previous subsequences.

        >>> nth_permutation('ghijk', 2, 5)
        ('h', 'i')

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    Nrr,)
rrrrrrrrrrH)
rrrrrrrrdrs
          rrZrZ-sd>>DD		AyAFF)A,,1
!ZZZZaZZZZaLLIa!e,,,qyy

>>>>>>>>AvvwwS1WF%&UU	!!!A
1a!e__a||1A>>>>>>>>>F1q5M66ETXv&&'''rc'K|D]@}t|ttfr|V#	|Ed{V-#t$r|VY=wxYwdS)aYield all arguments passed to the function in the same order in which
    they were passed. If an argument itself is iterable then iterate over its
    values.

        >>> list(value_chain(1, 2, 3, [4, 5, 6]))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and are emitted
    as-is:

        >>> list(value_chain('12', '34', ['56', '78']))
        ['12', '34', '56', '78']


    Multiple levels of nesting are not flattened.

    N)rrDrEr)rr4s  rrr[s$ec5\**	KKK				KKKKK	
s2AAcd}t||tD]]\}}|tus	|turtdt|}|t	|z||z}^|S)aEquivalent to ``list(product(*args)).index(element)``

    The products of *args* can be ordered lexicographically.
    :func:`product_index` computes the first index of *element* without
    computing the previous products.

        >>> product_index([8, 2], range(10), range(5))
        42

    ``ValueError`` will be raised if the given *element* isn't in the product
    of *args*.
    rrz element is not a product of args)rrrrrr)r
rrr,rs     rrrws|
Ew@@@224<<47???@@@T{{D		!DJJqMM1Lrctt|}t|d\}}|dSg}t|}|D]9\}}||kr.||t|d\}}|n|}:tdt	||df\}}	d}
tt|dD]E\}}||z
}||kr5|
t
|t
|t
||z
zzz
}
Ft
|dzt
|dzt
||z
zz|
z
S)aEquivalent to ``list(combinations(iterable, r)).index(element)``

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`combination_index` computes the index of the
    first *element*, without computing the previous combinations.

        >>> combination_index('adf', 'abcdefg')
        10

    ``ValueError`` will be raised if the given *element* isn't one of the
    combinations of *iterable*.
    NNNrz(element is not a combination of iterablerr,)r)rkrrrrSrr)
r
rryindexesrrr,tmprrrrs
             rrrse  G&&DAqyqGXD	E	E166NN1'<00FC{CDDDq$i(((DAq
E(7++1555GG1
E66Yq\\illYq1u5E5E&EFFEQU	!a% 0 09QU3C3C CDuLLrcd}t|}ttt|dd|D]%\}}||}||z|z}||=&|S)aEquivalent to ``list(permutations(iterable, r)).index(element)```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`permutation_index`
    computes the index of the first *element* directly, without computing
    the previous permutations.

        >>> permutation_index([1, 3, 2], range(5))
        19

    ``ValueError`` will be raised if the given *element* isn't one of the
    permutations of *iterable*.
    rr)rrrrr)r
rrrrr,rs       rrrsm
E>>DE#d))R,,g661JJqMM	A
GGLrc$eZdZdZdZdZdZdS)r?aWrap *iterable* and keep a count of how many items have been consumed.

    The ``items_seen`` attribute starts at ``0`` and increments as the iterable
    is consumed:

        >>> iterable = map(str, range(10))
        >>> it = countable(iterable)
        >>> it.items_seen
        0
        >>> next(it), next(it)
        ('0', '1')
        >>> list(it)
        ['2', '3', '4', '5', '6', '7', '8', '9']
        >>> it.items_seen
        10
    c<t||_d|_dSr)rr
items_seenrs  rrzcountable.__init__s>>rc|Srrrs rrzcountable.__iter__rrcNt|j}|xjdz
c_|SrC)rrrrs  rrzcountable.__next__s$DH~~1rNrCrrrr?r?sK"rr?)FrrrrC)NNN)rF)r)NNF)rmFN)rNFr)rcollectionsrrrrcollections.abcr	functoolsrr	r
heapqrrr
r	itertoolsrrrrrrrrrrrrmathrrrrqueuerr r!r"r#operatorr$r%r&r'r(sysr)r*timer+recipesr-r.r/r0r1r2__all__objectrr9rIrSrYrbr<r>rKrPr|r]rDrNryr{rvrwr7rsrMrLr;rkrlrnrprorqrrr_rcrErtrr}rzr~rrmrzrFrDrEr5r4rJHashabler\r@rArrTrUrfrurOrr6r=rBrjrirgrGr:rVrXrerdr`rarxr^rQrCrHrWrTr`rhrR
BaseExceptionr3r8rrr[rZrrrrr?rrrrs;
888888888888$$$$$$,,,,,,,,,,666666666666



























,+++++++++++----------11111111111111########TTTl&((B$8#:&-::::"b"b"b"b"b"b"b"b"J#'#'#'L@"


@@@@Fa$a$a$a$HDDDD4CCCB0000f!!!4D]']']']']']']']'@((((((((V000
.
.
. -!-!-!-!`::::zD))))X    F!!!!H****Z*)*)*)Z@& M M MF8J+/+/+/\-2T$$$$$N????D.K.K.Kb000f%(<2222j$)$)$)$)N****ZV,V,V,V,V,CL#,V,V,V,r
=
=
=
= """JD-0-0-0-0`%%%$4000"+P+P+P+P+P+P+P+P\]&]&]&@((($+6+-$-$-$-$`"'2d'2'2'2'2'2T*L*L*L*L*L8*L*L*LZI%I%I%I%I%I%I%I%XFFFFFFFF:&*>>>>$:::>>>>B@@@@F T(?(?(?(?V::::zBBB(5/5/5/5/p********Z&&&&R"""J%%%P0*4 5 5 5F!6!6!6!6H3333&					-			yyyyyyyyx%%%%%%P    F###>+(+(+(\82(M(M(MV0rPK!!Q8RR"_vendor/more_itertools/__init__.pynu[from .more import *  # noqa
from .recipes import *  # noqa

__version__ = '8.8.0'
PK!ʀ??!_vendor/more_itertools/recipes.pynu["""Imported from the recipes section of the itertools documentation.

All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.

.. [1] http://docs.python.org/library/itertools.html#recipes

"""
import warnings
from collections import deque
from itertools import (
    chain,
    combinations,
    count,
    cycle,
    groupby,
    islice,
    repeat,
    starmap,
    tee,
    zip_longest,
)
import operator
from random import randrange, sample, choice

__all__ = [
    'all_equal',
    'consume',
    'convolve',
    'dotproduct',
    'first_true',
    'flatten',
    'grouper',
    'iter_except',
    'ncycles',
    'nth',
    'nth_combination',
    'padnone',
    'pad_none',
    'pairwise',
    'partition',
    'powerset',
    'prepend',
    'quantify',
    'random_combination_with_replacement',
    'random_combination',
    'random_permutation',
    'random_product',
    'repeatfunc',
    'roundrobin',
    'tabulate',
    'tail',
    'take',
    'unique_everseen',
    'unique_justseen',
]


def take(n, iterable):
    """Return first *n* items of the iterable as a list.

        >>> take(3, range(10))
        [0, 1, 2]

    If there are fewer than *n* items in the iterable, all of them are
    returned.

        >>> take(10, range(3))
        [0, 1, 2]

    """
    return list(islice(iterable, n))


def tabulate(function, start=0):
    """Return an iterator over the results of ``func(start)``,
    ``func(start + 1)``, ``func(start + 2)``...

    *func* should be a function that accepts one integer argument.

    If *start* is not specified it defaults to 0. It will be incremented each
    time the iterator is advanced.

        >>> square = lambda x: x ** 2
        >>> iterator = tabulate(square, -3)
        >>> take(4, iterator)
        [9, 4, 1, 0]

    """
    return map(function, count(start))


def tail(n, iterable):
    """Return an iterator over the last *n* items of *iterable*.

    >>> t = tail(3, 'ABCDEFG')
    >>> list(t)
    ['E', 'F', 'G']

    """
    return iter(deque(iterable, maxlen=n))


def consume(iterator, n=None):
    """Advance *iterable* by *n* steps. If *n* is ``None``, consume it
    entirely.

    Efficiently exhausts an iterator without returning values. Defaults to
    consuming the whole iterator, but an optional second argument may be
    provided to limit consumption.

        >>> i = (x for x in range(10))
        >>> next(i)
        0
        >>> consume(i, 3)
        >>> next(i)
        4
        >>> consume(i)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    If the iterator has fewer items remaining than the provided limit, the
    whole iterator will be consumed.

        >>> i = (x for x in range(3))
        >>> consume(i, 5)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    """
    # Use functions that consume iterators at C speed.
    if n is None:
        # feed the entire iterator into a zero-length deque
        deque(iterator, maxlen=0)
    else:
        # advance to the empty slice starting at position n
        next(islice(iterator, n, n), None)


def nth(iterable, n, default=None):
    """Returns the nth item or a default value.

    >>> l = range(10)
    >>> nth(l, 3)
    3
    >>> nth(l, 20, "zebra")
    'zebra'

    """
    return next(islice(iterable, n, None), default)


def all_equal(iterable):
    """
    Returns ``True`` if all the elements are equal to each other.

        >>> all_equal('aaaa')
        True
        >>> all_equal('aaab')
        False

    """
    g = groupby(iterable)
    return next(g, True) and not next(g, False)


def quantify(iterable, pred=bool):
    """Return the how many times the predicate is true.

    >>> quantify([True, False, True])
    2

    """
    return sum(map(pred, iterable))


def pad_none(iterable):
    """Returns the sequence of elements and then returns ``None`` indefinitely.

        >>> take(5, pad_none(range(3)))
        [0, 1, 2, None, None]

    Useful for emulating the behavior of the built-in :func:`map` function.

    See also :func:`padded`.

    """
    return chain(iterable, repeat(None))


padnone = pad_none


def ncycles(iterable, n):
    """Returns the sequence elements *n* times

    >>> list(ncycles(["a", "b"], 3))
    ['a', 'b', 'a', 'b', 'a', 'b']

    """
    return chain.from_iterable(repeat(tuple(iterable), n))


def dotproduct(vec1, vec2):
    """Returns the dot product of the two iterables.

    >>> dotproduct([10, 10], [20, 20])
    400

    """
    return sum(map(operator.mul, vec1, vec2))


def flatten(listOfLists):
    """Return an iterator flattening one level of nesting in a list of lists.

        >>> list(flatten([[0, 1], [2, 3]]))
        [0, 1, 2, 3]

    See also :func:`collapse`, which can flatten multiple levels of nesting.

    """
    return chain.from_iterable(listOfLists)


def repeatfunc(func, times=None, *args):
    """Call *func* with *args* repeatedly, returning an iterable over the
    results.

    If *times* is specified, the iterable will terminate after that many
    repetitions:

        >>> from operator import add
        >>> times = 4
        >>> args = 3, 5
        >>> list(repeatfunc(add, times, *args))
        [8, 8, 8, 8]

    If *times* is ``None`` the iterable will not terminate:

        >>> from random import randrange
        >>> times = None
        >>> args = 1, 11
        >>> take(6, repeatfunc(randrange, times, *args))  # doctest:+SKIP
        [2, 4, 8, 1, 8, 4]

    """
    if times is None:
        return starmap(func, repeat(args))
    return starmap(func, repeat(args, times))


def _pairwise(iterable):
    """Returns an iterator of paired items, overlapping, from the original

    >>> take(4, pairwise(count()))
    [(0, 1), (1, 2), (2, 3), (3, 4)]

    On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.

    """
    a, b = tee(iterable)
    next(b, None)
    yield from zip(a, b)


try:
    from itertools import pairwise as itertools_pairwise
except ImportError:
    pairwise = _pairwise
else:

    def pairwise(iterable):
        yield from itertools_pairwise(iterable)

    pairwise.__doc__ = _pairwise.__doc__


def grouper(iterable, n, fillvalue=None):
    """Collect data into fixed-length chunks or blocks.

    >>> list(grouper('ABCDEFG', 3, 'x'))
    [('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]

    """
    if isinstance(iterable, int):
        warnings.warn(
            "grouper expects iterable as first parameter", DeprecationWarning
        )
        n, iterable = iterable, n
    args = [iter(iterable)] * n
    return zip_longest(fillvalue=fillvalue, *args)


def roundrobin(*iterables):
    """Yields an item from each iterable, alternating between them.

        >>> list(roundrobin('ABC', 'D', 'EF'))
        ['A', 'D', 'E', 'B', 'F', 'C']

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    """
    # Recipe credited to George Sakkis
    pending = len(iterables)
    nexts = cycle(iter(it).__next__ for it in iterables)
    while pending:
        try:
            for next in nexts:
                yield next()
        except StopIteration:
            pending -= 1
            nexts = cycle(islice(nexts, pending))


def partition(pred, iterable):
    """
    Returns a 2-tuple of iterables derived from the input iterable.
    The first yields the items that have ``pred(item) == False``.
    The second yields the items that have ``pred(item) == True``.

        >>> is_odd = lambda x: x % 2 != 0
        >>> iterable = range(10)
        >>> even_items, odd_items = partition(is_odd, iterable)
        >>> list(even_items), list(odd_items)
        ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])

    If *pred* is None, :func:`bool` is used.

        >>> iterable = [0, 1, False, True, '', ' ']
        >>> false_items, true_items = partition(None, iterable)
        >>> list(false_items), list(true_items)
        ([0, False, ''], [1, True, ' '])

    """
    if pred is None:
        pred = bool

    evaluations = ((pred(x), x) for x in iterable)
    t1, t2 = tee(evaluations)
    return (
        (x for (cond, x) in t1 if not cond),
        (x for (cond, x) in t2 if cond),
    )


def powerset(iterable):
    """Yields all possible subsets of the iterable.

        >>> list(powerset([1, 2, 3]))
        [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]

    :func:`powerset` will operate on iterables that aren't :class:`set`
    instances, so repeated elements in the input will produce repeated elements
    in the output. Use :func:`unique_everseen` on the input to avoid generating
    duplicates:

        >>> seq = [1, 1, 0]
        >>> list(powerset(seq))
        [(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
        >>> from more_itertools import unique_everseen
        >>> list(powerset(unique_everseen(seq)))
        [(), (1,), (0,), (1, 0)]

    """
    s = list(iterable)
    return chain.from_iterable(combinations(s, r) for r in range(len(s) + 1))


def unique_everseen(iterable, key=None):
    """
    Yield unique elements, preserving order.

        >>> list(unique_everseen('AAAABBBCCDAABBB'))
        ['A', 'B', 'C', 'D']
        >>> list(unique_everseen('ABBCcAD', str.lower))
        ['A', 'B', 'C', 'D']

    Sequences with a mix of hashable and unhashable items can be used.
    The function will be slower (i.e., `O(n^2)`) for unhashable items.

    Remember that ``list`` objects are unhashable - you can use the *key*
    parameter to transform the list to a tuple (which is hashable) to
    avoid a slowdown.

        >>> iterable = ([1, 2], [2, 3], [1, 2])
        >>> list(unique_everseen(iterable))  # Slow
        [[1, 2], [2, 3]]
        >>> list(unique_everseen(iterable, key=tuple))  # Faster
        [[1, 2], [2, 3]]

    Similary, you may want to convert unhashable ``set`` objects with
    ``key=frozenset``. For ``dict`` objects,
    ``key=lambda x: frozenset(x.items())`` can be used.

    """
    seenset = set()
    seenset_add = seenset.add
    seenlist = []
    seenlist_add = seenlist.append
    use_key = key is not None

    for element in iterable:
        k = key(element) if use_key else element
        try:
            if k not in seenset:
                seenset_add(k)
                yield element
        except TypeError:
            if k not in seenlist:
                seenlist_add(k)
                yield element


def unique_justseen(iterable, key=None):
    """Yields elements in order, ignoring serial duplicates

    >>> list(unique_justseen('AAAABBBCCDAABBB'))
    ['A', 'B', 'C', 'D', 'A', 'B']
    >>> list(unique_justseen('ABBCcAD', str.lower))
    ['A', 'B', 'C', 'A', 'D']

    """
    return map(next, map(operator.itemgetter(1), groupby(iterable, key)))


def iter_except(func, exception, first=None):
    """Yields results from a function repeatedly until an exception is raised.

    Converts a call-until-exception interface to an iterator interface.
    Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
    to end the loop.

        >>> l = [0, 1, 2]
        >>> list(iter_except(l.pop, IndexError))
        [2, 1, 0]

    """
    try:
        if first is not None:
            yield first()
        while 1:
            yield func()
    except exception:
        pass


def first_true(iterable, default=None, pred=None):
    """
    Returns the first true value in the iterable.

    If no true value is found, returns *default*

    If *pred* is not None, returns the first item for which
    ``pred(item) == True`` .

        >>> first_true(range(10))
        1
        >>> first_true(range(10), pred=lambda x: x > 5)
        6
        >>> first_true(range(10), default='missing', pred=lambda x: x > 9)
        'missing'

    """
    return next(filter(pred, iterable), default)


def random_product(*args, repeat=1):
    """Draw an item at random from each of the input iterables.

        >>> random_product('abc', range(4), 'XYZ')  # doctest:+SKIP
        ('c', 3, 'Z')

    If *repeat* is provided as a keyword argument, that many items will be
    drawn from each iterable.

        >>> random_product('abcd', range(4), repeat=2)  # doctest:+SKIP
        ('a', 2, 'd', 3)

    This equivalent to taking a random selection from
    ``itertools.product(*args, **kwarg)``.

    """
    pools = [tuple(pool) for pool in args] * repeat
    return tuple(choice(pool) for pool in pools)


def random_permutation(iterable, r=None):
    """Return a random *r* length permutation of the elements in *iterable*.

    If *r* is not specified or is ``None``, then *r* defaults to the length of
    *iterable*.

        >>> random_permutation(range(5))  # doctest:+SKIP
        (3, 4, 0, 1, 2)

    This equivalent to taking a random selection from
    ``itertools.permutations(iterable, r)``.

    """
    pool = tuple(iterable)
    r = len(pool) if r is None else r
    return tuple(sample(pool, r))


def random_combination(iterable, r):
    """Return a random *r* length subsequence of the elements in *iterable*.

        >>> random_combination(range(5), 3)  # doctest:+SKIP
        (2, 3, 4)

    This equivalent to taking a random selection from
    ``itertools.combinations(iterable, r)``.

    """
    pool = tuple(iterable)
    n = len(pool)
    indices = sorted(sample(range(n), r))
    return tuple(pool[i] for i in indices)


def random_combination_with_replacement(iterable, r):
    """Return a random *r* length subsequence of elements in *iterable*,
    allowing individual elements to be repeated.

        >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
        (0, 0, 1, 2, 2)

    This equivalent to taking a random selection from
    ``itertools.combinations_with_replacement(iterable, r)``.

    """
    pool = tuple(iterable)
    n = len(pool)
    indices = sorted(randrange(n) for i in range(r))
    return tuple(pool[i] for i in indices)


def nth_combination(iterable, r, index):
    """Equivalent to ``list(combinations(iterable, r))[index]``.

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`nth_combination` computes the subsequence at
    sort position *index* directly, without computing the previous
    subsequences.

        >>> nth_combination(range(5), 3, 5)
        (0, 3, 4)

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    """
    pool = tuple(iterable)
    n = len(pool)
    if (r < 0) or (r > n):
        raise ValueError

    c = 1
    k = min(r, n - r)
    for i in range(1, k + 1):
        c = c * (n - k + i) // i

    if index < 0:
        index += c

    if (index < 0) or (index >= c):
        raise IndexError

    result = []
    while r:
        c, n, r = c * r // n, n - 1, r - 1
        while index >= c:
            index -= c
            c, n = c * (n - r) // n, n - 1
        result.append(pool[-1 - n])

    return tuple(result)


def prepend(value, iterator):
    """Yield *value*, followed by the elements in *iterator*.

        >>> value = '0'
        >>> iterator = ['1', '2', '3']
        >>> list(prepend(value, iterator))
        ['0', '1', '2', '3']

    To prepend multiple values, see :func:`itertools.chain`
    or :func:`value_chain`.

    """
    return chain([value], iterator)


def convolve(signal, kernel):
    """Convolve the iterable *signal* with the iterable *kernel*.

        >>> signal = (1, 2, 3, 4, 5)
        >>> kernel = [3, 2, 1]
        >>> list(convolve(signal, kernel))
        [3, 8, 14, 20, 26, 14, 5]

    Note: the input arguments are not interchangeable, as the *kernel*
    is immediately consumed and stored.

    """
    kernel = tuple(kernel)[::-1]
    n = len(kernel)
    window = deque([0], maxlen=n) * n
    for x in chain(signal, repeat(0, n - 1)):
        window.append(x)
        yield sum(map(operator.mul, kernel, window))
PK!(p"h"h8_vendor/jaraco/text/__pycache__/__init__.cpython-311.pycnu[

,Re<ddlZddlZddlZddlZ	ddlmZn#e$r	ddlmZYnwxYwddlm	Z	m
Z
ddlmZdZ
dZGddeZeeZejd	Zd
ZdZdZd
ZGddeZd!dZGddeZejZdZ GddeZ!GddZ"dZ#dZ$dZ%dZ&ej'dZ(e()edZ*dZ+d Z,dS)"N)files)composemethod_cache)
ExceptionTrapcfdS)zH
    Return a function that will perform a substitution on a string
    c0|SNreplace)snewolds /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/jaraco/text/__init__.pyzsubstitution..sQYYsC(()rr
s``rsubstitutionrs)(((((rctjt|}tt	|}t|S)z
    Take a sequence of pairs specifying substitutions, and create
    a function that performs those substitutions.

    >>> multi_substitution(('foo', 'bar'), ('bar', 'baz'))('foo')
    'baz'
    )	itertoolsstarmaprreversedtupler)
substitutionss rmulti_substitutionrs8%lMBBMU=1122MM""rcneZdZdZdZdZdZdZdZfdZ	dZ
efd	Zd
Z
dd
ZxZS)
FoldedCasea
    A case insensitive string class; behaves just like str
    except compares equal when the only variation is case.

    >>> s = FoldedCase('hello world')

    >>> s == 'Hello World'
    True

    >>> 'Hello World' == s
    True

    >>> s != 'Hello World'
    False

    >>> s.index('O')
    4

    >>> s.split('O')
    ['hell', ' w', 'rld']

    >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta']))
    ['alpha', 'Beta', 'GAMMA']

    Sequence membership is straightforward.

    >>> "Hello World" in [s]
    True
    >>> s in ["Hello World"]
    True

    You may test for set inclusion, but candidate and elements
    must both be folded.

    >>> FoldedCase("Hello World") in {s}
    True
    >>> s in {FoldedCase("Hello World")}
    True

    String inclusion works as long as the FoldedCase object
    is on the right.

    >>> "hello" in FoldedCase("Hello World")
    True

    But not if the FoldedCase object is on the left:

    >>> FoldedCase('hello') in 'Hello World'
    False

    In that case, use ``in_``:

    >>> FoldedCase('hello').in_('Hello World')
    True

    >>> FoldedCase('hello') > FoldedCase('Hello')
    False
    cV||kSr	lowerselfothers  r__lt__zFoldedCase.__lt__azz||ekkmm++rcV||kSr	rr s  r__gt__zFoldedCase.__gt__dr$rcV||kSr	rr s  r__eq__zFoldedCase.__eq__gzz||u{{}},,rcV||kSr	rr s  r__ne__zFoldedCase.__ne__jr)rcDt|Sr	)hashrr!s r__hash__zFoldedCase.__hash__msDJJLL!!!rct|Sr	)superr__contains__)r!r"	__class__s  rr2zFoldedCase.__contains__ps+ww}}++EKKMM:::rc$|t|vS)zDoes self appear in other?)rr s  rin_zFoldedCase.in_ssz%((((rcDtSr	)r1r)r!r3s rrzFoldedCase.lowerxsww}}rct||Sr	)rindex)r!subs  rr8zFoldedCase.index|s&zz||!!#))++...r rctjtj|tj}|||Sr	)recompileescapeIsplit)r!splittermaxsplitpatterns    rr@zFoldedCase.splits3*RYx00"$77}}T8,,,r)r:r)__name__
__module____qualname____doc__r#r&r(r+r/r2r5rrr8r@
__classcell__r3s@rrr%s99v,,,,,,------""";;;;;)))
\///--------rrc.|dS)z
    Return True if the supplied value is decodable (using the default
    encoding).

    >>> is_decodable(b'\xff')
    False
    >>> is_decodable(b'\x32')
    True
    N)decodevalues ris_decodablerNs
LLNNNNNrcLt|tot|S)z
    Return True if the value appears to be binary (that is, it's a byte
    string and isn't decodable).

    >>> is_binary(b'\xff')
    True
    >>> is_binary('\xff')
    False
    )
isinstancebytesrNrLs r	is_binaryrRs$eU##?L,?,?(??rcNtj|S)z
    Trim something like a docstring to remove the whitespace that
    is common due to indentation and formatting.

    >>> trim("\n\tfoo = bar\n\t\tbar = baz\n")
    'foo = bar\n\tbar = baz'
    )textwrapdedentstrip)rs rtrimrWs ?1##%%%rcl|}d|D}d|S)a
    Wrap lines of text, retaining existing newlines as
    paragraph markers.

    >>> print(wrap(lorem_ipsum))
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
    eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
    minim veniam, quis nostrud exercitation ullamco laboris nisi ut
    aliquip ex ea commodo consequat. Duis aute irure dolor in
    reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
    pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
    culpa qui officia deserunt mollit anim id est laborum.
    
    Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam
    varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus
    magna felis sollicitudin mauris. Integer in mauris eu nibh euismod
    gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis
    risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue,
    eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas
    fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla
    a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis,
    neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing
    sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque
    nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus
    quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis,
    molestie eu, feugiat in, orci. In hac habitasse platea dictumst.
    c3dK|]+}dtj|V,dS)
N)joinrTwrap.0paras  r	zwrap..s8EE$tyyt,,--EEEEEErz

)
splitlinesr[)r
paragraphswrappeds   rr\r\s68JEE*EEEG;;wrcntjd|}d|D}d|S)ad
    Given a multi-line string, return an unwrapped version.

    >>> wrapped = wrap(lorem_ipsum)
    >>> wrapped.count('\n')
    20
    >>> unwrapped = unwrap(wrapped)
    >>> unwrapped.count('\n')
    1
    >>> print(unwrapped)
    Lorem ipsum dolor sit amet, consectetur adipiscing ...
    Curabitur pretium tincidunt lacus. Nulla gravida orci ...

    z\n\n+c3BK|]}|ddVdS)rZr:Nr
r]s  rr`zunwrap..s0>>4t||D#&&>>>>>>rrZ)r<r@r[)rrbcleaneds   runwraprgs:(A&&J>>:>>>G99WrceZdZdZdZdZdS)Splitterzobject that will split a string with the given arguments for each call

    >>> s = Splitter(',')
    >>> s('hello, world, this is your, master calling')
    ['hello', ' world', ' this is your', ' master calling']
    c||_dSr	)args)r!rks  r__init__zSplitter.__init__s
			rc |j|jSr	)r@rk)r!rs  r__call__zSplitter.__call__sqw	""rN)rDrErFrGrlrnrrrriris<#####rri    c||zS)z)
    >>> indent('foo')
    '    foo'
    r)stringprefixs  rindentrss
F?rceZdZdZejdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZfd
ZedZedZxZS)WordSeta
    Given an identifier, return the words that identifier represents,
    whether in camel case, underscore-separated, etc.

    >>> WordSet.parse("camelCase")
    ('camel', 'Case')

    >>> WordSet.parse("under_sep")
    ('under', 'sep')

    Acronyms should be retained

    >>> WordSet.parse("firstSNL")
    ('first', 'SNL')

    >>> WordSet.parse("you_and_I")
    ('you', 'and', 'I')

    >>> WordSet.parse("A simple test")
    ('A', 'simple', 'test')

    Multiple caps should not interfere with the first cap of another word.

    >>> WordSet.parse("myABCClass")
    ('my', 'ABC', 'Class')

    The result is a WordSet, so you can get the form you need.

    >>> WordSet.parse("myABCClass").underscore_separated()
    'my_ABC_Class'

    >>> WordSet.parse('a-command').camel_case()
    'ACommand'

    >>> WordSet.parse('someIdentifier').lowered().space_separated()
    'some identifier'

    Slices of the result should return another WordSet.

    >>> WordSet.parse('taken-out-of-context')[1:].underscore_separated()
    'out_of_context'

    >>> WordSet.from_class_name(WordSet()).lowered().space_separated()
    'word set'

    >>> example = WordSet.parse('figured it out')
    >>> example.headless_camel_case()
    'figuredItOut'
    >>> example.dash_separated()
    'figured-it-out'

    z ([A-Z]?[a-z]+)|([A-Z]+(?![a-z]))c4td|DS)Nc3>K|]}|VdSr	)
capitalizer^words  rr`z&WordSet.capitalized..5s,::Tt((::::::rrur.s rcapitalizedzWordSet.capitalized4s::T::::::rc4td|DS)Nc3>K|]}|VdSr	rrys  rr`z"WordSet.lowered..8s*55tzz||555555rr{r.s rloweredzWordSet.lowered7s55555555rcPd|SN)r[r|r.s r
camel_casezWordSet.camel_case:s wwt''))***rct|}t|}tj|ft|}d|Sr)iternextrrchainrurr[)r!wordsfirst	new_wordss    rheadless_camel_casezWordSet.headless_camel_case=s[T

U!!##OUHgenn.G.G.I.IJJ	wwy!!!rc,d|S)N_r[r.s runderscore_separatedzWordSet.underscore_separatedCxx~~rc,d|S)N-rr.s rdash_separatedzWordSet.dash_separatedFrrc,d|S)Nr:rr.s rspace_separatedzWordSet.space_separatedIrrc6|r|d|kr
|ddn|S)a
        Remove the item from the end of the set.

        >>> WordSet.parse('foo bar').trim_right('foo')
        ('foo', 'bar')
        >>> WordSet.parse('foo bar').trim_right('bar')
        ('foo',)
        >>> WordSet.parse('').trim_right('bar')
        ()
        Nrr!items  r
trim_rightzWordSet.trim_rightLs)!?T"X%5%5tCRCyy4?rc6|r|d|kr
|ddn|S)a
        Remove the item from the beginning of the set.

        >>> WordSet.parse('foo bar').trim_left('foo')
        ('bar',)
        >>> WordSet.parse('foo bar').trim_left('bar')
        ('foo', 'bar')
        >>> WordSet.parse('').trim_left('bar')
        ()
        rNrrs  r	trim_leftzWordSet.trim_leftYs' =DGtOOtABBxx=rcR|||S)zK
        >>> WordSet.parse('foo bar').trim('foo')
        ('bar',)
        )rrrs  rrWzWordSet.trimfs$
~~d##..t444rctt||}t|trt|}|Sr	)r1ru__getitem__rPslice)r!rresultr3s   rrzWordSet.__getitem__msBw%%11$77dE""	%V__F
rch|j|}td|DS)Nc3@K|]}|dVdS)rNgroupr^matchs  rr`z WordSet.parse..vs,;;%u{{1~~;;;;;;r)_patternfinditerru)cls
identifiermatchess   rparsez
WordSet.parsess4,''
33;;7;;;;;;rc@||jjSr	)rr3rD)rsubjects  rfrom_class_namezWordSet.from_class_namexsyy*3444r)rDrErFrGr<r=rr|rrrrrrrrrWrclassmethodrrrHrIs@rrurus&33jrz<==H;;;666+++"""@@@>>>555<<[<55[55555rructjdtj}d||D}d|S)a
    Remove HTML from the string `s`.

    >>> str(simple_html_strip(''))
    ''

    >>> print(simple_html_strip('A stormy day in paradise'))
    A stormy day in paradise

    >>> print(simple_html_strip('Somebody  tell the truth.'))
    Somebody  tell the truth.

    >>> print(simple_html_strip('What about
\nmultiple lines?')) What about multiple lines? z()|(<[^>]*>)|([^<]+)c3DK|]}|dpdVdS)rNrrs rr`z$simple_html_strip..s1 I IeU[[^^ !r I I I I I Irr)r<r=DOTALLrr[)r html_strippertextss rsimple_html_striprsI"J?KKM I I}/E/Ea/H/H I I IE 775>>rceZdZdZdZdZdS)SeparatedValuesa A string separated by a separator. Overrides __iter__ for getting the values. >>> list(SeparatedValues('a,b,c')) ['a', 'b', 'c'] Whitespace is stripped and empty values are discarded. >>> list(SeparatedValues(' a, b , c, ')) ['a', 'b', 'c'] ,cj||j}tdd|DS)Nc3>K|]}|VdSr )rV)r^parts rr`z+SeparatedValues.__iter__..s*<**d<>>>>rrcJeZdZdZdZedZdZedZ dS)Strippera& Given a series of lines, find the common prefix and strip it from them. >>> lines = [ ... 'abcdefg\n', ... 'abc\n', ... 'abcde\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix 'abc' >>> list(res.lines) ['defg\n', '\n', 'de\n'] If no prefix is common, nothing should be stripped. >>> lines = [ ... 'abcd\n', ... '1234\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix = '' >>> list(res.lines) ['abcd\n', '1234\n'] c>||_t|||_dSr )rrmaplines)r!rrrs rrlzStripper.__init__s u%% rc|tj|\}}tj|j|}|||Sr )rtee functoolsreduce common_prefix)rr prefix_linesrrs r strip_prefixzStripper.strip_prefixs='mE22 e!#"3\BBs65!!!rcT|js|S||j\}}}|Sr )rr partition)r!linenullrrrests rrnzStripper.__call__s0{ K!^^DK88fd rctt|t|}|d||d|kr|dz}|d||d|k|d|S)z8 Return the common prefix of two lines. Nr)minlen)s1s2r8s rrzStripper.common_prefixsn CGGSWW%%%jBvvJ&& QJE%jBvvJ&&&5&zrN) rDrErFrGrlrrrn staticmethodrrrrrrsr4&&&""["  \rrc8||\}}}|S)z Remove the prefix from the text if it exists. >>> remove_prefix('underwhelming performance', 'underwhelming ') 'performance' >>> remove_prefix('something special', 'sample') 'something special' ) rpartition)textrrrrs r remove_prefixrs!00D&$ Krc8||\}}}|S)z Remove the suffix from the text if it exists. >>> remove_suffix('name.git', '.git') 'name' >>> remove_suffix('something special', 'sample') 'something special' r)rsuffixrrs r remove_suffixrs!//D&$ Krc`gd}d|}tj|d|S)a  Replace alternate newlines with the canonical newline. >>> normalize_newlines('Lorem Ipsum\u2029') 'Lorem Ipsum\n' >>> normalize_newlines('Lorem Ipsum\r\n') 'Lorem Ipsum\n' >>> normalize_newlines('Lorem Ipsum\x85') 'Lorem Ipsum\n' )z  rZ…u
u
|rZ)r[r<r9)rnewlinesrCs rnormalize_newlinesrs5BAAHhhx  G 6'4 & &&rc2|o|d S)N#) startswith)strs r _nonblankrs  *s~~c****rcftjtt|S)a Yield valid lines of a string or iterable. >>> list(yield_lines('')) [] >>> list(yield_lines(['foo', 'bar'])) ['foo', 'bar'] >>> list(yield_lines('foo\nbar')) ['foo', 'bar'] >>> list(yield_lines('\nfoo\n#bar\nbaz #comment')) ['foo', 'baz #comment'] >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n'])) ['foo', 'bar', 'baz', 'bing'] )rr from_iterabler yield_lines)iterables rrrs$ ? ( ([()C)C D DDrcttttj|Sr )rrrrrVra)rs rrr%s( )SDOO,=,=>> ? ??rc8|ddS)z Drop comments. >>> drop_comment('foo # bar') 'foo' A hash without a space may be in a URL. >>> drop_comment('http://example.com/foo#bar') 'http://example.com/foo#bar' z #rr)rs r drop_commentr*s >>$   ""rc#Kt|}|D]p}|drU |ddt|z}n#t$rYdSwxYw|dU|VqdS)a_ Join lines continued by a trailing backslash. >>> list(join_continuation(['foo \\', 'bar', 'baz'])) ['foobar', 'baz'] >>> list(join_continuation(['foo \\', 'bar', 'baz'])) ['foobar', 'baz'] >>> list(join_continuation(['foo \\', 'bar \\', 'baz'])) ['foobarbaz'] Not sure why, but... The character preceeding the backslash is also elided. >>> list(join_continuation(['goo\\', 'dly'])) ['godly'] A terrible idea, but... If no line is available to continue, suppress the lines. >>> list(join_continuation(['foo', 'bar\\', 'baz\\'])) ['foo'] \N)rendswithrVr StopIteration)rrs rjoin_continuationr9s. KKEmmD!!  CRCy((4;;6     mmD!!   s,A A('A()ro)-r<rrTrimportlib.resourcesr ImportError%setuptools.extern.importlib_resources"setuptools.extern.jaraco.functoolsrr setuptools.extern.jaraco.contextrrrrrUnicodeDecodeError _unicode_trappassesrNrRrWr\rgobjectrirsrrurrrrrrrrrsingledispatchrregisterrrrrrrrs <)))))))<<<;;;;;;;;<EDDDDDDD::::::))) # # #\-\-\-\-\-\-\-\-@ 011     @ @ @&&&   B, # # # # #v # # #~5~5~5~5~5e~5~5~5D  ,>>>>>c>>>*33333333l       ' ' ' +++ EEE$ c@@@ # # #s  ''PK!]"ʝ<<_vendor/jaraco/text/__init__.pynu[import re import itertools import textwrap import functools try: from importlib.resources import files # type: ignore except ImportError: # pragma: nocover from setuptools.extern.importlib_resources import files # type: ignore from setuptools.extern.jaraco.functools import compose, method_cache from setuptools.extern.jaraco.context import ExceptionTrap def substitution(old, new): """ Return a function that will perform a substitution on a string """ return lambda s: s.replace(old, new) def multi_substitution(*substitutions): """ Take a sequence of pairs specifying substitutions, and create a function that performs those substitutions. >>> multi_substitution(('foo', 'bar'), ('bar', 'baz'))('foo') 'baz' """ substitutions = itertools.starmap(substitution, substitutions) # compose function applies last function first, so reverse the # substitutions to get the expected order. substitutions = reversed(tuple(substitutions)) return compose(*substitutions) class FoldedCase(str): """ A case insensitive string class; behaves just like str except compares equal when the only variation is case. >>> s = FoldedCase('hello world') >>> s == 'Hello World' True >>> 'Hello World' == s True >>> s != 'Hello World' False >>> s.index('O') 4 >>> s.split('O') ['hell', ' w', 'rld'] >>> sorted(map(FoldedCase, ['GAMMA', 'alpha', 'Beta'])) ['alpha', 'Beta', 'GAMMA'] Sequence membership is straightforward. >>> "Hello World" in [s] True >>> s in ["Hello World"] True You may test for set inclusion, but candidate and elements must both be folded. >>> FoldedCase("Hello World") in {s} True >>> s in {FoldedCase("Hello World")} True String inclusion works as long as the FoldedCase object is on the right. >>> "hello" in FoldedCase("Hello World") True But not if the FoldedCase object is on the left: >>> FoldedCase('hello') in 'Hello World' False In that case, use ``in_``: >>> FoldedCase('hello').in_('Hello World') True >>> FoldedCase('hello') > FoldedCase('Hello') False """ def __lt__(self, other): return self.lower() < other.lower() def __gt__(self, other): return self.lower() > other.lower() def __eq__(self, other): return self.lower() == other.lower() def __ne__(self, other): return self.lower() != other.lower() def __hash__(self): return hash(self.lower()) def __contains__(self, other): return super().lower().__contains__(other.lower()) def in_(self, other): "Does self appear in other?" return self in FoldedCase(other) # cache lower since it's likely to be called frequently. @method_cache def lower(self): return super().lower() def index(self, sub): return self.lower().index(sub.lower()) def split(self, splitter=' ', maxsplit=0): pattern = re.compile(re.escape(splitter), re.I) return pattern.split(self, maxsplit) # Python 3.8 compatibility _unicode_trap = ExceptionTrap(UnicodeDecodeError) @_unicode_trap.passes def is_decodable(value): r""" Return True if the supplied value is decodable (using the default encoding). >>> is_decodable(b'\xff') False >>> is_decodable(b'\x32') True """ value.decode() def is_binary(value): r""" Return True if the value appears to be binary (that is, it's a byte string and isn't decodable). >>> is_binary(b'\xff') True >>> is_binary('\xff') False """ return isinstance(value, bytes) and not is_decodable(value) def trim(s): r""" Trim something like a docstring to remove the whitespace that is common due to indentation and formatting. >>> trim("\n\tfoo = bar\n\t\tbar = baz\n") 'foo = bar\n\tbar = baz' """ return textwrap.dedent(s).strip() def wrap(s): """ Wrap lines of text, retaining existing newlines as paragraph markers. >>> print(wrap(lorem_ipsum)) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris. Integer in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst. """ paragraphs = s.splitlines() wrapped = ('\n'.join(textwrap.wrap(para)) for para in paragraphs) return '\n\n'.join(wrapped) def unwrap(s): r""" Given a multi-line string, return an unwrapped version. >>> wrapped = wrap(lorem_ipsum) >>> wrapped.count('\n') 20 >>> unwrapped = unwrap(wrapped) >>> unwrapped.count('\n') 1 >>> print(unwrapped) Lorem ipsum dolor sit amet, consectetur adipiscing ... Curabitur pretium tincidunt lacus. Nulla gravida orci ... """ paragraphs = re.split(r'\n\n+', s) cleaned = (para.replace('\n', ' ') for para in paragraphs) return '\n'.join(cleaned) class Splitter(object): """object that will split a string with the given arguments for each call >>> s = Splitter(',') >>> s('hello, world, this is your, master calling') ['hello', ' world', ' this is your', ' master calling'] """ def __init__(self, *args): self.args = args def __call__(self, s): return s.split(*self.args) def indent(string, prefix=' ' * 4): """ >>> indent('foo') ' foo' """ return prefix + string class WordSet(tuple): """ Given an identifier, return the words that identifier represents, whether in camel case, underscore-separated, etc. >>> WordSet.parse("camelCase") ('camel', 'Case') >>> WordSet.parse("under_sep") ('under', 'sep') Acronyms should be retained >>> WordSet.parse("firstSNL") ('first', 'SNL') >>> WordSet.parse("you_and_I") ('you', 'and', 'I') >>> WordSet.parse("A simple test") ('A', 'simple', 'test') Multiple caps should not interfere with the first cap of another word. >>> WordSet.parse("myABCClass") ('my', 'ABC', 'Class') The result is a WordSet, so you can get the form you need. >>> WordSet.parse("myABCClass").underscore_separated() 'my_ABC_Class' >>> WordSet.parse('a-command').camel_case() 'ACommand' >>> WordSet.parse('someIdentifier').lowered().space_separated() 'some identifier' Slices of the result should return another WordSet. >>> WordSet.parse('taken-out-of-context')[1:].underscore_separated() 'out_of_context' >>> WordSet.from_class_name(WordSet()).lowered().space_separated() 'word set' >>> example = WordSet.parse('figured it out') >>> example.headless_camel_case() 'figuredItOut' >>> example.dash_separated() 'figured-it-out' """ _pattern = re.compile('([A-Z]?[a-z]+)|([A-Z]+(?![a-z]))') def capitalized(self): return WordSet(word.capitalize() for word in self) def lowered(self): return WordSet(word.lower() for word in self) def camel_case(self): return ''.join(self.capitalized()) def headless_camel_case(self): words = iter(self) first = next(words).lower() new_words = itertools.chain((first,), WordSet(words).camel_case()) return ''.join(new_words) def underscore_separated(self): return '_'.join(self) def dash_separated(self): return '-'.join(self) def space_separated(self): return ' '.join(self) def trim_right(self, item): """ Remove the item from the end of the set. >>> WordSet.parse('foo bar').trim_right('foo') ('foo', 'bar') >>> WordSet.parse('foo bar').trim_right('bar') ('foo',) >>> WordSet.parse('').trim_right('bar') () """ return self[:-1] if self and self[-1] == item else self def trim_left(self, item): """ Remove the item from the beginning of the set. >>> WordSet.parse('foo bar').trim_left('foo') ('bar',) >>> WordSet.parse('foo bar').trim_left('bar') ('foo', 'bar') >>> WordSet.parse('').trim_left('bar') () """ return self[1:] if self and self[0] == item else self def trim(self, item): """ >>> WordSet.parse('foo bar').trim('foo') ('bar',) """ return self.trim_left(item).trim_right(item) def __getitem__(self, item): result = super(WordSet, self).__getitem__(item) if isinstance(item, slice): result = WordSet(result) return result @classmethod def parse(cls, identifier): matches = cls._pattern.finditer(identifier) return WordSet(match.group(0) for match in matches) @classmethod def from_class_name(cls, subject): return cls.parse(subject.__class__.__name__) # for backward compatibility words = WordSet.parse def simple_html_strip(s): r""" Remove HTML from the string `s`. >>> str(simple_html_strip('')) '' >>> print(simple_html_strip('A stormy day in paradise')) A stormy day in paradise >>> print(simple_html_strip('Somebody tell the truth.')) Somebody tell the truth. >>> print(simple_html_strip('What about
\nmultiple lines?')) What about multiple lines? """ html_stripper = re.compile('()|(<[^>]*>)|([^<]+)', re.DOTALL) texts = (match.group(3) or '' for match in html_stripper.finditer(s)) return ''.join(texts) class SeparatedValues(str): """ A string separated by a separator. Overrides __iter__ for getting the values. >>> list(SeparatedValues('a,b,c')) ['a', 'b', 'c'] Whitespace is stripped and empty values are discarded. >>> list(SeparatedValues(' a, b , c, ')) ['a', 'b', 'c'] """ separator = ',' def __iter__(self): parts = self.split(self.separator) return filter(None, (part.strip() for part in parts)) class Stripper: r""" Given a series of lines, find the common prefix and strip it from them. >>> lines = [ ... 'abcdefg\n', ... 'abc\n', ... 'abcde\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix 'abc' >>> list(res.lines) ['defg\n', '\n', 'de\n'] If no prefix is common, nothing should be stripped. >>> lines = [ ... 'abcd\n', ... '1234\n', ... ] >>> res = Stripper.strip_prefix(lines) >>> res.prefix = '' >>> list(res.lines) ['abcd\n', '1234\n'] """ def __init__(self, prefix, lines): self.prefix = prefix self.lines = map(self, lines) @classmethod def strip_prefix(cls, lines): prefix_lines, lines = itertools.tee(lines) prefix = functools.reduce(cls.common_prefix, prefix_lines) return cls(prefix, lines) def __call__(self, line): if not self.prefix: return line null, prefix, rest = line.partition(self.prefix) return rest @staticmethod def common_prefix(s1, s2): """ Return the common prefix of two lines. """ index = min(len(s1), len(s2)) while s1[:index] != s2[:index]: index -= 1 return s1[:index] def remove_prefix(text, prefix): """ Remove the prefix from the text if it exists. >>> remove_prefix('underwhelming performance', 'underwhelming ') 'performance' >>> remove_prefix('something special', 'sample') 'something special' """ null, prefix, rest = text.rpartition(prefix) return rest def remove_suffix(text, suffix): """ Remove the suffix from the text if it exists. >>> remove_suffix('name.git', '.git') 'name' >>> remove_suffix('something special', 'sample') 'something special' """ rest, suffix, null = text.partition(suffix) return rest def normalize_newlines(text): r""" Replace alternate newlines with the canonical newline. >>> normalize_newlines('Lorem Ipsum\u2029') 'Lorem Ipsum\n' >>> normalize_newlines('Lorem Ipsum\r\n') 'Lorem Ipsum\n' >>> normalize_newlines('Lorem Ipsum\x85') 'Lorem Ipsum\n' """ newlines = ['\r\n', '\r', '\n', '\u0085', '\u2028', '\u2029'] pattern = '|'.join(newlines) return re.sub(pattern, '\n', text) def _nonblank(str): return str and not str.startswith('#') @functools.singledispatch def yield_lines(iterable): r""" Yield valid lines of a string or iterable. >>> list(yield_lines('')) [] >>> list(yield_lines(['foo', 'bar'])) ['foo', 'bar'] >>> list(yield_lines('foo\nbar')) ['foo', 'bar'] >>> list(yield_lines('\nfoo\n#bar\nbaz #comment')) ['foo', 'baz #comment'] >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n'])) ['foo', 'bar', 'baz', 'bing'] """ return itertools.chain.from_iterable(map(yield_lines, iterable)) @yield_lines.register(str) def _(text): return filter(_nonblank, map(str.strip, text.splitlines())) def drop_comment(line): """ Drop comments. >>> drop_comment('foo # bar') 'foo' A hash without a space may be in a URL. >>> drop_comment('http://example.com/foo#bar') 'http://example.com/foo#bar' """ return line.partition(' #')[0] def join_continuation(lines): r""" Join lines continued by a trailing backslash. >>> list(join_continuation(['foo \\', 'bar', 'baz'])) ['foobar', 'baz'] >>> list(join_continuation(['foo \\', 'bar', 'baz'])) ['foobar', 'baz'] >>> list(join_continuation(['foo \\', 'bar \\', 'baz'])) ['foobarbaz'] Not sure why, but... The character preceeding the backslash is also elided. >>> list(join_continuation(['goo\\', 'dly'])) ['godly'] A terrible idea, but... If no line is available to continue, suppress the lines. >>> list(join_continuation(['foo', 'bar\\', 'baz\\'])) ['foo'] """ lines = iter(lines) for item in lines: while item.endswith('\\'): try: item = item[:-2].strip() + next(lines) except StopIteration: return yield item PK!2& ,,_vendor/jaraco/context.pynu[import os import subprocess import contextlib import functools import tempfile import shutil import operator @contextlib.contextmanager def pushd(dir): orig = os.getcwd() os.chdir(dir) try: yield dir finally: os.chdir(orig) @contextlib.contextmanager def tarball_context(url, target_dir=None, runner=None, pushd=pushd): """ Get a tarball, extract it, change to that directory, yield, then clean up. `runner` is the function to invoke commands. `pushd` is a context manager for changing the directory. """ if target_dir is None: target_dir = os.path.basename(url).replace('.tar.gz', '').replace('.tgz', '') if runner is None: runner = functools.partial(subprocess.check_call, shell=True) # In the tar command, use --strip-components=1 to strip the first path and # then # use -C to cause the files to be extracted to {target_dir}. This ensures # that we always know where the files were extracted. runner('mkdir {target_dir}'.format(**vars())) try: getter = 'wget {url} -O -' extract = 'tar x{compression} --strip-components=1 -C {target_dir}' cmd = ' | '.join((getter, extract)) runner(cmd.format(compression=infer_compression(url), **vars())) with pushd(target_dir): yield target_dir finally: runner('rm -Rf {target_dir}'.format(**vars())) def infer_compression(url): """ Given a URL or filename, infer the compression code for tar. """ # cheat and just assume it's the last two characters compression_indicator = url[-2:] mapping = dict(gz='z', bz='j', xz='J') # Assume 'z' (gzip) if no match return mapping.get(compression_indicator, 'z') @contextlib.contextmanager def temp_dir(remover=shutil.rmtree): """ Create a temporary directory context. Pass a custom remover to override the removal behavior. """ temp_dir = tempfile.mkdtemp() try: yield temp_dir finally: remover(temp_dir) @contextlib.contextmanager def repo_context(url, branch=None, quiet=True, dest_ctx=temp_dir): """ Check out the repo indicated by url. If dest_ctx is supplied, it should be a context manager to yield the target directory for the check out. """ exe = 'git' if 'git' in url else 'hg' with dest_ctx() as repo_dir: cmd = [exe, 'clone', url, repo_dir] if branch: cmd.extend(['--branch', branch]) devnull = open(os.path.devnull, 'w') stdout = devnull if quiet else None subprocess.check_call(cmd, stdout=stdout) yield repo_dir @contextlib.contextmanager def null(): yield class ExceptionTrap: """ A context manager that will catch certain exceptions and provide an indication they occurred. >>> with ExceptionTrap() as trap: ... raise Exception() >>> bool(trap) True >>> with ExceptionTrap() as trap: ... pass >>> bool(trap) False >>> with ExceptionTrap(ValueError) as trap: ... raise ValueError("1 + 1 is not 3") >>> bool(trap) True >>> with ExceptionTrap(ValueError) as trap: ... raise Exception() Traceback (most recent call last): ... Exception >>> bool(trap) False """ exc_info = None, None, None def __init__(self, exceptions=(Exception,)): self.exceptions = exceptions def __enter__(self): return self @property def type(self): return self.exc_info[0] @property def value(self): return self.exc_info[1] @property def tb(self): return self.exc_info[2] def __exit__(self, *exc_info): type = exc_info[0] matches = type and issubclass(type, self.exceptions) if matches: self.exc_info = exc_info return matches def __bool__(self): return bool(self.type) def raises(self, func, *, _test=bool): """ Wrap func and replace the result with the truth value of the trap (True if an exception occurred). First, give the decorator an alias to support Python 3.8 Syntax. >>> raises = ExceptionTrap(ValueError).raises Now decorate a function that always fails. >>> @raises ... def fail(): ... raise ValueError('failed') >>> fail() True """ @functools.wraps(func) def wrapper(*args, **kwargs): with ExceptionTrap(self.exceptions) as trap: func(*args, **kwargs) return _test(trap) return wrapper def passes(self, func): """ Wrap func and replace the result with the truth value of the trap (True if no exception). First, give the decorator an alias to support Python 3.8 Syntax. >>> passes = ExceptionTrap(ValueError).passes Now decorate a function that always fails. >>> @passes ... def fail(): ... raise ValueError('failed') >>> fail() False """ return self.raises(func, _test=operator.not_) class suppress(contextlib.suppress, contextlib.ContextDecorator): """ A version of contextlib.suppress with decorator support. >>> @suppress(KeyError) ... def key_error(): ... {}[''] >>> key_error() """ PK!aP3_vendor/jaraco/__pycache__/__init__.cpython-311.pycnu[ ,RedS)Nr/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/jaraco/__init__.pyrsrPK!A%%2_vendor/jaraco/__pycache__/context.cpython-311.pycnu[ ,Re,NddlZddlZddlZddlZddlZddlZddlZejdZejddefdZ dZ ejej fdZ ejdde fdZ ejdZGd d ZGd d ejejZdS) Nc#Ktj}tj| |Vtj|dS#tj|wxYwN)osgetcwdchdir)dirorigs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/jaraco/context.pypushdr sO 9;;DHSMMM  s AAc #K|Gtj|dddd}| t jt jd}|djd it d}d }d ||f}||jd d t|it||5|Vdddn #1swxYwY|d jd itdS#|d jd itwxYw)z Get a tarball, extract it, change to that directory, yield, then clean up. `runner` is the function to invoke commands. `pushd` is a context manager for changing the directory. Nz.tar.gzz.tgzT)shellzmkdir {target_dir}zwget {url} -O -z7tar x{compression} --strip-components=1 -C {target_dir}z | compressionzrm -Rf {target_dir}) rpathbasenamereplace functoolspartial subprocess check_callformatvarsjoininfer_compression)url target_dirrunnerr getterextractcmds r tarball_contextr"sW%%c**229bAAII&RTUU  ~":#8EEE  F &  & 0 0 0 01117"Kjj&'*++zszGG&7&<&<GGGHHH U:                       +$+55dff5566666+$+55dff556666s1AD((C9- D(9C==D(C=D(($E cf|dd}tddd}||dS)zF Given a URL or filename, infer the compression code for tar. NzjJ)gzbzxz)dictget)rcompression_indicatormappings r rr0s;  Hccc***G ;;,c 2 22c#pKtj} |V||dS#||wxYw)zk Create a temporary directory context. Pass a custom remover to override the removal behavior. N)tempfilemkdtemp)removertemp_dirs r r4r4;sP !!Hs( 5Tc#Kd|vrdnd}|5}|d||g}|r|d|gttjjd}|r|nd}t j|||VddddS#1swxYwYdS)z Check out the repo indicated by url. If dest_ctx is supplied, it should be a context manager to yield the target directory for the check out. githgclonez--branchwN)stdout)extendopenrrdevnullrr) rbranchquietdest_ctxexerepo_dirr!r=r:s r repo_contextrCHsC<<%%TC xGS(+  - JJ F+ , , ,rw,,!+tc&1111sABBBc#KdVdSrrrr/r nullrE[s EEEEEr/ceZdZdZdZeffdZdZedZ edZ edZ dZ d Z ed d Zd Zd S) ExceptionTrapaG A context manager that will catch certain exceptions and provide an indication they occurred. >>> with ExceptionTrap() as trap: ... raise Exception() >>> bool(trap) True >>> with ExceptionTrap() as trap: ... pass >>> bool(trap) False >>> with ExceptionTrap(ValueError) as trap: ... raise ValueError("1 + 1 is not 3") >>> bool(trap) True >>> with ExceptionTrap(ValueError) as trap: ... raise Exception() Traceback (most recent call last): ... Exception >>> bool(trap) False )NNNc||_dSr) exceptions)selfrIs r __init__zExceptionTrap.__init__s $r/c|SrrrJs r __enter__zExceptionTrap.__enter__s r/c|jdSNrexc_inforMs r typezExceptionTrap.type}Qr/c|jdS)NrQrMs r valuezExceptionTrap.valuerTr/c|jdS)NrQrMs r tbzExceptionTrap.tbrTr/cV|d}|ot||j}|r||_|SrP) issubclassrIrR)rJrRrSmatchess r __exit__zExceptionTrap.__exit__s5{<:dDO<<  %$DMr/c*t|jSr)boolrSrMs r __bool__zExceptionTrap.__bool__sDIr/_testcNtjfd}|S)a Wrap func and replace the result with the truth value of the trap (True if an exception occurred). First, give the decorator an alias to support Python 3.8 Syntax. >>> raises = ExceptionTrap(ValueError).raises Now decorate a function that always fails. >>> @raises ... def fail(): ... raise ValueError('failed') >>> fail() True ctj5}|i|dddn #1swxYwY|Sr)rGrI)argskwargstraprcfuncrJs r wrapperz%ExceptionTrap.raises..wrapperst// &4d%f%%% & & & & & & & & & & & & & & &5;; s +//)rwraps)rJrircrjs``` r raiseszExceptionTrap.raisessF&             r/cD||tjS)a Wrap func and replace the result with the truth value of the trap (True if no exception). First, give the decorator an alias to support Python 3.8 Syntax. >>> passes = ExceptionTrap(ValueError).passes Now decorate a function that always fails. >>> @passes ... def fail(): ... raise ValueError('failed') >>> fail() False rb)rloperatornot_)rJris r passeszExceptionTrap.passess&{{4x}{555r/N)__name__ __module__ __qualname____doc__rR ExceptionrKrNpropertyrSrWrZr^rar`rlrprr/r rGrG`s: H#,,%%%%  X   X   X %)666666r/rGceZdZdZdS)suppressz A version of contextlib.suppress with decorator support. >>> @suppress(KeyError) ... def key_error(): ... {}[''] >>> key_error() N)rqrrrsrtrr/r rxrxsr/rx)rr contextlibrr1shutilrncontextmanagerr r"rrmtreer4rCrErGrxContextDecoratorrr/r r~s    $(U77776333 ]     !$    j6j6j6j6j6j6j6j6Zz"J$?r/PK!vtxOxO4_vendor/jaraco/__pycache__/functools.cpython-311.pycnu[ ,Re4BddlZddlZddlZddlZddlZddlZddlZddlm Z m Z e de de fZ dZ dZdZejfd e d e e ge fd e fd Zd ZdZdZdZGddZdZdddfdZdZdZdZdZdZddddZdS)N)CallableTypeVar CallableT.)boundc2d}tj||S)a; Compose any number of unary functions into a single unary function. >>> import textwrap >>> expected = str.strip(textwrap.dedent(compose.__doc__)) >>> strip_and_dedent = compose(str.strip, textwrap.dedent) >>> strip_and_dedent(compose.__doc__) == expected True Compose also allows the innermost function to take arbitrary arguments. >>> round_three = lambda x: round(x, ndigits=3) >>> f = compose(round_three, int.__truediv__) >>> [f(3*x, x+1) for x in range(1,10)] [1.5, 2.0, 2.25, 2.4, 2.5, 2.571, 2.625, 2.667, 2.7] cfdS)Nc&|i|SN)argskwargsf1f2s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/jaraco/functools.pyz.compose..compose_two..#s rr""d*=f*=*='>'>r )rrs``r compose_twozcompose..compose_two"s>>>>>>r) functoolsreduce)funcsrs rcomposers&$???  K / //rcfd}|S)z Return a function that will call a named method on the target object with optional positional and keyword arguments. >>> lower = method_caller('lower') >>> lower('MyString') 'mystring' c4t|}|iSr )getattr)targetfuncr r method_names r call_methodz"method_caller..call_method3s'v{++tT$V$$$rr )rr r rs``` r method_callerr(s0%%%%%%% rc^tjfdfd_S)ad Decorate func so it's only ever called the first time. This decorator can ensure that an expensive or non-idempotent function will not be expensive on subsequent calls and is idempotent. >>> add_three = once(lambda a: a+3) >>> add_three(3) 6 >>> add_three(9) 6 >>> add_three('12') 6 To reset the stored value, simply clear the property ``saved_result``. >>> del add_three.saved_result >>> add_three(9) 12 >>> add_three(8) 12 Or invoke 'reset()' on it. >>> add_three.reset() >>> add_three(-3) 0 >>> add_three(0) 0 cLtds |i|_jSN saved_result)hasattrr#)r r rwrappers rr%zonce..wrapperZs5w// 9#'4#8#8#8G ##rcHtdSr")vars __delitem__)r%srrzonce..`sDMM55nEEr)rwrapsresetrr%s`@roncer,:sR@_T$$$$$$ FEEEGM Nrmethod cache_wrapperreturncdtdtdtdtffd }d|_tp|S)aV Wrap lru_cache to support storing the cache data in the object instances. Abstracts the common paradigm where the method explicitly saves an underscore-prefixed protected property on first call and returns that subsequently. >>> class MyClass: ... calls = 0 ... ... @method_cache ... def method(self, value): ... self.calls += 1 ... return value >>> a = MyClass() >>> a.method(3) 3 >>> for x in range(75): ... res = a.method(x) >>> a.calls 75 Note that the apparent behavior will be exactly like that of lru_cache except that the cache is stored on each instance, so values in one instance will not flush values from another, and when an instance is deleted, so are the cached values for that instance. >>> b = MyClass() >>> for x in range(35): ... res = b.method(x) >>> b.calls 35 >>> a.method(0) 0 >>> a.calls 75 Note that if method had been decorated with ``functools.lru_cache()``, a.calls would have been 76 (due to the cached value of 0 having been flushed by the 'b' instance). Clear the cache with ``.cache_clear()`` >>> a.method.cache_clear() Same for a method that hasn't yet been called. >>> c = MyClass() >>> c.method.cache_clear() Another cache wrapper may be supplied: >>> cache = functools.lru_cache(maxsize=2) >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache) >>> a = MyClass() >>> a.method2() 3 Caution - do not subsequently wrap the method with another decorator, such as ``@property``, which changes the semantics of the function. See also http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/ for another implementation and additional justification. selfr r r/ctj|}|}t|j|||i|Sr )types MethodTypesetattr__name__)r1r r bound_method cached_methodr.r-s rr%zmethod_cache..wrappersT"'"2 D# # & l33 fo}555}d-f---rcdSr r r rrrzmethod_cache..s$r)object cache_clear_special_method_cache)r-r.r%s`` r method_cacher=dsiR.f.V.v.&.......',G fm44?rcBj}d}||vrdSd|zfd}|S)a: Because Python treats special methods differently, it's not possible to use instance attributes to implement the cached methods. Instead, install the wrapper method under a different name and return a simple proxy to that wrapper. https://github.com/jaraco/jaraco.functools/issues/5 ) __getattr__ __getitem__N__cachedct|vr2tj|}|}t||nt |}||i|Sr )r'r3r4r5r)r1r r rcacher.r- wrapper_names rproxyz$_special_method_cache..proxysn tDzz ) )$VT22E!M%((E D, . . . .D,//Eud%f%%%r)r6)r-r.name special_namesrErDs`` @rr<r<sW ?D0M =  $L&&&&&&& Lrcfd}|S)ab Decorate a function with a transform function that is invoked on results returned from the decorated function. >>> @apply(reversed) ... def get_numbers(start): ... "doc for get_numbers" ... return range(start, start+3) >>> list(get_numbers(4)) [6, 5, 4] >>> get_numbers.__doc__ 'doc for get_numbers' cZtj|t|Sr )rr)r)r transforms rwrapzapply..wraps'$yt$$WY%=%=>>>rr )rJrKs` rapplyrLs#????? Krcfd}|S)a@ Decorate a function with an action function that is invoked on the results returned from the decorated function (for its side-effect), then return the original result. >>> @result_invoke(print) ... def add_two(a, b): ... return a + b >>> x = add_two(2, 3) 5 >>> x 5 cJtjfd}|S)Nc.|i|}||Sr r )r r resultactionrs rr%z,result_invoke..wrap..wrappers)T4*6**F F6NNNMrrr))rr%rQs` rrKzresult_invoke..wraps>            rr )rQrKs` r result_invokerSs#  Krc||i||S)ab Call a function for its side effect after initialization. >>> @call_aside ... def func(): print("called") called >>> func() called Use functools.partial to pass parameters to the initial call >>> @functools.partial(call_aside, name='bingo') ... def func(name): print("called with", name) called with bingo r )fr r s r call_asiderV s Atv HrcHeZdZdZedfdZdZdZdZd dZ dS) Throttlerz3 Rate-limit a function (or other callable) Infct|tr|j}||_||_|dSr ) isinstancerXrmax_rater*)r1rr\s r__init__zThrottler.__init__&s: dI & & 9D    rcd|_dS)Nr) last_called)r1s rr*zThrottler.reset-srcD||j|i|Sr )_waitr)r1r r s r__call__zThrottler.__call__0s& ty$)&)))rctj|jz }d|jz |z }tjt d|tj|_dS)z1ensure at least 1/max_rate seconds from last callrN)timer_r\sleepmax)r1elapsed must_waits rrazThrottler._wait4sT)++ 00 %/  3q)$$%%%9;;rNc\t|jtj|j|Sr ) first_invokerarpartialr)r1objtypes r__get__zThrottler.__get__;s#DJ (9$)S(I(IJJJrr ) r6 __module__ __qualname____doc__floatr]r*rbraror rrrXrX!s',eEll***'''KKKKKKrrXcfd}|S)z Return a function that when invoked will invoke func1 without any parameters (for its side-effect) and then invoke func2 with whatever parameters were passed, returning its result. c(|i|Sr r )r r func1func2s rr%zfirst_invoke..wrapperFs# ud%f%%%rr )rvrwr%s`` rrkrk?s)&&&&&& NrcdSr r r rrrrMsTrr c|tdkrtjnt|}|D]#} |cS#|$r |Y wxYw|S)z Given a callable func, trap the indicated exceptions for up to 'retries' times, invoking cleanup on the exception. On the final attempt, allow any exceptions to propagate. inf)rs itertoolscountrange)rcleanupretriestrapattemptsattempts r retry_callrMs%,uU||$;$;y   wH 466MMM    GIIIII  466Ms AAAcfd}|S)a7 Decorator wrapper for retry_call. Accepts arguments to retry_call except func and then returns a decorator for the decorated function. Ex: >>> @retry(retries=3) ... def my_func(a, b): ... "this is my funk" ... print(a, b) >>> my_func.__doc__ 'this is my funk' cLtjfd}|S)NcNtjg|Ri|}t|gRiSr )rrlr)f_argsf_kwargsrrr_argsr_kwargss rr%z(retry..decorate..wrappernsA%d@V@@@x@@Ee9f99999 9rrR)rr%rrs` rdecoratezretry..decoratemsC    : : : : : :   :rr )rrrs`` rretryr^s) Orctjtt}t t j||}tj||S)z Convert a generator into a function that prints all yielded elements >>> @print_yielded ... def x(): ... yield 3; yield None >>> x() 3 None )rrlmapprintrmore_itertoolsconsumer))r print_all print_resultss r print_yieldedrxsD!#u--IN2ItDDM 9?4  / //rcFtjfd}|S)z Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) c$| |g|Ri|SdSr r )paramr r rs rr%zpass_none..wrappers1  4////// /  rrRr+s` r pass_noners:_T00000 Nrctj|}|j}fd|D}t j|fi|S)a Assign parameters from namespace where func solicits. >>> def func(x, y=3): ... print(x, y) >>> assigned = assign_params(func, dict(x=2, z=4)) >>> assigned() 2 3 The usual errors are raised if a function doesn't receive its required parameters: >>> assigned = assign_params(func, dict(y=3, z=4)) >>> assigned() Traceback (most recent call last): TypeError: func() ...argument... It even works on methods: >>> class Handler: ... def meth(self, arg): ... print(arg) >>> assign_params(Handler().meth, dict(arg='crystal', foo='clear'))() crystal c*i|]}|v||Sr r ).0k namespaces r z!assign_params..s$AAA1!y..q)A,...r)inspect signature parameterskeysrrl)rrsigparamscall_nss ` r assign_paramsrsZ4  D ! !C ^ " "FAAAAAAAG  T - -W - --rcttjddtjfd}|S)a& Wrap a method such that when it is called, the args and kwargs are saved on the method. >>> class MyClass: ... @save_method_args ... def method(self, a, b): ... print(a, b) >>> my_ob = MyClass() >>> my_ob.method(1, 2) 1 2 >>> my_ob._saved_method.args (1, 2) >>> my_ob._saved_method.kwargs {} >>> my_ob.method(a=3, b='foo') 3 foo >>> my_ob._saved_method.args () >>> my_ob._saved_method.kwargs == dict(a=3, b='foo') True The arguments are stored on the instance, allowing for different instance to save different args. >>> your_ob = MyClass() >>> your_ob.method({str('x'): 3}, b=[4]) {'x': 3} [4] >>> your_ob._saved_method.args ({'x': 3},) >>> my_ob._saved_method.args () args_and_kwargsz args kwargscjdjz}||}t||||g|Ri|S)N_saved_)r6r5)r1r r attr_nameattrrr-s rr%z!save_method_args..wrappersR/ tV,,i&&&vd,T,,,V,,,r) collections namedtuplerr))r-r%rs` @rsave_method_argsrsTD",-> NNO_V------ Nr)replaceusecfd}|S)a- Replace the indicated exceptions, if raised, with the indicated literal replacement or evaluated expression (if present). >>> safe_int = except_(ValueError)(int) >>> safe_int('five') >>> safe_int('5') 5 Specify a literal replacement with ``replace``. >>> safe_int_r = except_(ValueError, replace=0)(int) >>> safe_int_r('five') 0 Provide an expression to ``use`` to pass through particular parameters. >>> safe_int_pt = except_(ValueError, use='args[0]')(int) >>> safe_int_pt('five') 'five' cNtjfd}|S)Nct |i|S#$r' tcYS#t$rcYcYSwxYwwxYwr )eval TypeError)r r exceptionsrrrs rr%z*except_..decorate..wrappersw #tT,V,,, # # ##99$$$ ###"NNNNN# #s  7"7 3737rR)rr%rrrs` rrzexcept_..decoratesH    # # # # # # #   #rr )rrrrs``` rexcept_rs/0        Or)rrerrr3r{ setuptools.extern.more_itertools setuptoolstypingrrr:rrrr, lru_cacher=r<rLrSrVrXrkrrrrrrrr rrrs!  ''''$$$$$$$$ GKxV '< = = = 0000$'''\   WW W  YW  WWWWt<*8   (KKKKKKKK<   *\12"4 0 0 0 $...@+++\"&4%%%%%%%rPK!44_vendor/jaraco/functools.pynu[import functools import time import inspect import collections import types import itertools import setuptools.extern.more_itertools from typing import Callable, TypeVar CallableT = TypeVar("CallableT", bound=Callable[..., object]) def compose(*funcs): """ Compose any number of unary functions into a single unary function. >>> import textwrap >>> expected = str.strip(textwrap.dedent(compose.__doc__)) >>> strip_and_dedent = compose(str.strip, textwrap.dedent) >>> strip_and_dedent(compose.__doc__) == expected True Compose also allows the innermost function to take arbitrary arguments. >>> round_three = lambda x: round(x, ndigits=3) >>> f = compose(round_three, int.__truediv__) >>> [f(3*x, x+1) for x in range(1,10)] [1.5, 2.0, 2.25, 2.4, 2.5, 2.571, 2.625, 2.667, 2.7] """ def compose_two(f1, f2): return lambda *args, **kwargs: f1(f2(*args, **kwargs)) return functools.reduce(compose_two, funcs) def method_caller(method_name, *args, **kwargs): """ Return a function that will call a named method on the target object with optional positional and keyword arguments. >>> lower = method_caller('lower') >>> lower('MyString') 'mystring' """ def call_method(target): func = getattr(target, method_name) return func(*args, **kwargs) return call_method def once(func): """ Decorate func so it's only ever called the first time. This decorator can ensure that an expensive or non-idempotent function will not be expensive on subsequent calls and is idempotent. >>> add_three = once(lambda a: a+3) >>> add_three(3) 6 >>> add_three(9) 6 >>> add_three('12') 6 To reset the stored value, simply clear the property ``saved_result``. >>> del add_three.saved_result >>> add_three(9) 12 >>> add_three(8) 12 Or invoke 'reset()' on it. >>> add_three.reset() >>> add_three(-3) 0 >>> add_three(0) 0 """ @functools.wraps(func) def wrapper(*args, **kwargs): if not hasattr(wrapper, 'saved_result'): wrapper.saved_result = func(*args, **kwargs) return wrapper.saved_result wrapper.reset = lambda: vars(wrapper).__delitem__('saved_result') return wrapper def method_cache( method: CallableT, cache_wrapper: Callable[ [CallableT], CallableT ] = functools.lru_cache(), # type: ignore[assignment] ) -> CallableT: """ Wrap lru_cache to support storing the cache data in the object instances. Abstracts the common paradigm where the method explicitly saves an underscore-prefixed protected property on first call and returns that subsequently. >>> class MyClass: ... calls = 0 ... ... @method_cache ... def method(self, value): ... self.calls += 1 ... return value >>> a = MyClass() >>> a.method(3) 3 >>> for x in range(75): ... res = a.method(x) >>> a.calls 75 Note that the apparent behavior will be exactly like that of lru_cache except that the cache is stored on each instance, so values in one instance will not flush values from another, and when an instance is deleted, so are the cached values for that instance. >>> b = MyClass() >>> for x in range(35): ... res = b.method(x) >>> b.calls 35 >>> a.method(0) 0 >>> a.calls 75 Note that if method had been decorated with ``functools.lru_cache()``, a.calls would have been 76 (due to the cached value of 0 having been flushed by the 'b' instance). Clear the cache with ``.cache_clear()`` >>> a.method.cache_clear() Same for a method that hasn't yet been called. >>> c = MyClass() >>> c.method.cache_clear() Another cache wrapper may be supplied: >>> cache = functools.lru_cache(maxsize=2) >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache) >>> a = MyClass() >>> a.method2() 3 Caution - do not subsequently wrap the method with another decorator, such as ``@property``, which changes the semantics of the function. See also http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/ for another implementation and additional justification. """ def wrapper(self: object, *args: object, **kwargs: object) -> object: # it's the first call, replace the method with a cached, bound method bound_method: CallableT = types.MethodType( # type: ignore[assignment] method, self ) cached_method = cache_wrapper(bound_method) setattr(self, method.__name__, cached_method) return cached_method(*args, **kwargs) # Support cache clear even before cache has been created. wrapper.cache_clear = lambda: None # type: ignore[attr-defined] return ( # type: ignore[return-value] _special_method_cache(method, cache_wrapper) or wrapper ) def _special_method_cache(method, cache_wrapper): """ Because Python treats special methods differently, it's not possible to use instance attributes to implement the cached methods. Instead, install the wrapper method under a different name and return a simple proxy to that wrapper. https://github.com/jaraco/jaraco.functools/issues/5 """ name = method.__name__ special_names = '__getattr__', '__getitem__' if name not in special_names: return wrapper_name = '__cached' + name def proxy(self, *args, **kwargs): if wrapper_name not in vars(self): bound = types.MethodType(method, self) cache = cache_wrapper(bound) setattr(self, wrapper_name, cache) else: cache = getattr(self, wrapper_name) return cache(*args, **kwargs) return proxy def apply(transform): """ Decorate a function with a transform function that is invoked on results returned from the decorated function. >>> @apply(reversed) ... def get_numbers(start): ... "doc for get_numbers" ... return range(start, start+3) >>> list(get_numbers(4)) [6, 5, 4] >>> get_numbers.__doc__ 'doc for get_numbers' """ def wrap(func): return functools.wraps(func)(compose(transform, func)) return wrap def result_invoke(action): r""" Decorate a function with an action function that is invoked on the results returned from the decorated function (for its side-effect), then return the original result. >>> @result_invoke(print) ... def add_two(a, b): ... return a + b >>> x = add_two(2, 3) 5 >>> x 5 """ def wrap(func): @functools.wraps(func) def wrapper(*args, **kwargs): result = func(*args, **kwargs) action(result) return result return wrapper return wrap def call_aside(f, *args, **kwargs): """ Call a function for its side effect after initialization. >>> @call_aside ... def func(): print("called") called >>> func() called Use functools.partial to pass parameters to the initial call >>> @functools.partial(call_aside, name='bingo') ... def func(name): print("called with", name) called with bingo """ f(*args, **kwargs) return f class Throttler: """ Rate-limit a function (or other callable) """ def __init__(self, func, max_rate=float('Inf')): if isinstance(func, Throttler): func = func.func self.func = func self.max_rate = max_rate self.reset() def reset(self): self.last_called = 0 def __call__(self, *args, **kwargs): self._wait() return self.func(*args, **kwargs) def _wait(self): "ensure at least 1/max_rate seconds from last call" elapsed = time.time() - self.last_called must_wait = 1 / self.max_rate - elapsed time.sleep(max(0, must_wait)) self.last_called = time.time() def __get__(self, obj, type=None): return first_invoke(self._wait, functools.partial(self.func, obj)) def first_invoke(func1, func2): """ Return a function that when invoked will invoke func1 without any parameters (for its side-effect) and then invoke func2 with whatever parameters were passed, returning its result. """ def wrapper(*args, **kwargs): func1() return func2(*args, **kwargs) return wrapper def retry_call(func, cleanup=lambda: None, retries=0, trap=()): """ Given a callable func, trap the indicated exceptions for up to 'retries' times, invoking cleanup on the exception. On the final attempt, allow any exceptions to propagate. """ attempts = itertools.count() if retries == float('inf') else range(retries) for attempt in attempts: try: return func() except trap: cleanup() return func() def retry(*r_args, **r_kwargs): """ Decorator wrapper for retry_call. Accepts arguments to retry_call except func and then returns a decorator for the decorated function. Ex: >>> @retry(retries=3) ... def my_func(a, b): ... "this is my funk" ... print(a, b) >>> my_func.__doc__ 'this is my funk' """ def decorate(func): @functools.wraps(func) def wrapper(*f_args, **f_kwargs): bound = functools.partial(func, *f_args, **f_kwargs) return retry_call(bound, *r_args, **r_kwargs) return wrapper return decorate def print_yielded(func): """ Convert a generator into a function that prints all yielded elements >>> @print_yielded ... def x(): ... yield 3; yield None >>> x() 3 None """ print_all = functools.partial(map, print) print_results = compose(more_itertools.consume, print_all, func) return functools.wraps(func)(print_results) def pass_none(func): """ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) """ @functools.wraps(func) def wrapper(param, *args, **kwargs): if param is not None: return func(param, *args, **kwargs) return wrapper def assign_params(func, namespace): """ Assign parameters from namespace where func solicits. >>> def func(x, y=3): ... print(x, y) >>> assigned = assign_params(func, dict(x=2, z=4)) >>> assigned() 2 3 The usual errors are raised if a function doesn't receive its required parameters: >>> assigned = assign_params(func, dict(y=3, z=4)) >>> assigned() Traceback (most recent call last): TypeError: func() ...argument... It even works on methods: >>> class Handler: ... def meth(self, arg): ... print(arg) >>> assign_params(Handler().meth, dict(arg='crystal', foo='clear'))() crystal """ sig = inspect.signature(func) params = sig.parameters.keys() call_ns = {k: namespace[k] for k in params if k in namespace} return functools.partial(func, **call_ns) def save_method_args(method): """ Wrap a method such that when it is called, the args and kwargs are saved on the method. >>> class MyClass: ... @save_method_args ... def method(self, a, b): ... print(a, b) >>> my_ob = MyClass() >>> my_ob.method(1, 2) 1 2 >>> my_ob._saved_method.args (1, 2) >>> my_ob._saved_method.kwargs {} >>> my_ob.method(a=3, b='foo') 3 foo >>> my_ob._saved_method.args () >>> my_ob._saved_method.kwargs == dict(a=3, b='foo') True The arguments are stored on the instance, allowing for different instance to save different args. >>> your_ob = MyClass() >>> your_ob.method({str('x'): 3}, b=[4]) {'x': 3} [4] >>> your_ob._saved_method.args ({'x': 3},) >>> my_ob._saved_method.args () """ args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs') @functools.wraps(method) def wrapper(self, *args, **kwargs): attr_name = '_saved_' + method.__name__ attr = args_and_kwargs(args, kwargs) setattr(self, attr_name, attr) return method(self, *args, **kwargs) return wrapper def except_(*exceptions, replace=None, use=None): """ Replace the indicated exceptions, if raised, with the indicated literal replacement or evaluated expression (if present). >>> safe_int = except_(ValueError)(int) >>> safe_int('five') >>> safe_int('5') 5 Specify a literal replacement with ``replace``. >>> safe_int_r = except_(ValueError, replace=0)(int) >>> safe_int_r('five') 0 Provide an expression to ``use`` to pass through particular parameters. >>> safe_int_pt = except_(ValueError, use='args[0]')(int) >>> safe_int_pt('five') 'five' """ def decorate(func): @functools.wraps(func) def wrapper(*args, **kwargs): try: return func(*args, **kwargs) except exceptions: try: return eval(use) except TypeError: return replace return wrapper return decorate PK!_vendor/jaraco/__init__.pynu[PK!2_vendor/tomli/__pycache__/__init__.cpython-311.pycnu[ ,Re0dZdZddlmZmZmZee_dS))loadsloadTOMLDecodeErrorz2.0.1)rrrN)__all__ __version___parserrrr__name__ __module__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/tomli/__init__.pyrs? / 1111111111&r PK!0_vendor/tomli/__pycache__/_types.cpython-311.pycnu[ ,ReHddlmZmZmZeegefZeedfZeZdS))AnyCallableTuple.N) typingrrrstr ParseFloatKeyintPos/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/tomli/_types.pyrsM ('''''''''seSj !  CHo r PK!*?Syxx1_vendor/tomli/__pycache__/_parser.cpython-311.pycnu[ ,ReiX 4ddlmZddlmZddlZddlmZddlmZm Z m Z ddl m Z m Z mZmZmZmZddlmZmZmZed ed Deed zZeed z Zeed z ZeZeZeZedZeedzZ eej!ej"zdzZ#e#edzZ$eej%Z&edd ddddddZ'Gdde(Z)e*dd]d!Z+e*dd^d$Z,Gd%d&Z-Gd'd(Z.Gd)d*e Z/d_d0Z0d`d6Z1dad7Z2dad8Z3dbd;Z4dbd<Z5dcd?Z6dddAZ7dedBZ8dfdDZ9dfdEZ:dgdGZ;dhdIZdjdQZ?dfdRZ@dkdTZAdidUZBdldWZCdmdYZDdnd[ZEdod\ZFdS)p) annotations)IterableN)MappingProxyType)AnyBinaryIO NamedTuple) RE_DATETIME RE_LOCALTIME RE_NUMBERmatch_to_datetimematch_to_localtimematch_to_number)Key ParseFloatPosc#4K|]}t|VdSN)chr).0is /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/tomli/_parser.py rs(11!s1vv111111  z z  z-_z"'  "\)z\bz\tz\nz\fz\rz\"z\\ceZdZdZdS)TOMLDecodeErrorz0An error raised if a document is not valid TOML.N)__name__ __module__ __qualname____doc__rrr%r%5s::::rr% parse_float__fprr,rreturndict[str, Any]c|} |}n#t$rtddwxYwt ||S)z%Parse TOML from a binary file object.zEFile must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`Nr+)readdecodeAttributeError TypeErrorloads)r-r,bss rloadr89sk A HHJJ  S     , , ,,s +A__sstrcd|dd}d}ttt}d}t |} t ||t } ||}n#t$rYn&wxYw|dkr|dz }>|tvr*t|||||}t ||t }n|dkr~ ||dz}n#t$rd}YnwxYw|j |dkrt|||\}}nt|||\}}t ||t }n|d krt||d t||} ||}n#t$rYn"wxYw|dkrt||d |dz }S|jjS) zParse TOML from a string.z rrr*Tr [N#zInvalid statementz5Expected newline or end of document after a statement)replaceOutput NestedDictFlagsmake_safe_parse_float skip_charsTOML_WS IndexErrorKEY_INITIAL_CHARSkey_value_ruleflagsfinalize_pendingcreate_list_rulecreate_dict_rule suffixed_err skip_commentdatadict)r9r,srcposoutheaderchar second_chars rr5r5Es ++fd # #C C uww ' 'CF' 44K0c7++ s8DD    E  4<< 1HC  $ $ $ c3 DDCS#w//CC S[[ #*-cAg,  # # #"  # I & & ( ( (c!!.sC== VV.sC== VS#w//CC S[[sC)<== =3$$ s8DD    E  4<<SQ  qa0d 8=s6*A33 BB C C%$C%/E88 FFcJeZdZdZdZdZddZdd Zdd Zdd Z ddZ ddZ dS)rAz)Flags that map to parsed keys/namespaces.rr r.Nonec:i|_t|_dSr)_flagsset_pending_flagsselfs r__init__zFlags.__init__s') 47EErkeyrflagintc>|j||fdSr)r[addr]r_r`s r add_pendingzFlags.add_pendings# d ,,,,,rc|jD]\}}|||d|jdS)NF recursive)r[rZclearrds rrIzFlags.finalize_pendingsN, 1 1IC HHS$%H 0 0 0 0 !!#####rc|j}|ddD]}||vrdS||d}||dddS)Nnested)rYpop)r]r_contks r unset_allzFlags.unset_alls^{SbS % %A}}78$DD R$rrhboolc<|j}|dd|d}}|D]5}||vr!ttid||<||d}6||vr!ttid||<|||rdnd|dS)Nrk)rHrecursive_flagsrlrlrsrH)rYrZrc)r]r_r`rhrn key_parentkey_stemros rrZz Flags.sets{"3B3xRH  % %A}}$'EEceerRRQ78$DD 4  '*uuRTUUDN XIB((7CGGMMMMMrc|sdS|j}|ddD]&}||vrdS||}||dvrdS|d}'|d}||vr||}||dvp ||dvSdS)NFrkrsTrlrH)rY)r]r_r`rnro inner_contrus ris_z Flags.is_s 5{SbS ( (A}}uuaJz"3444tth'DDr7 t  >D4=(KDD9J4K,K KurNr.rW)r_rr`rar.rWr_rr.rW)r_rr`rarhrqr.rW)r_rr`rar.rq) r&r'r(r)FROZEN EXPLICIT_NESTr^rerIrprZrxr*rrrArAs33FM::::----$$$$      N N N NrrAc,eZdZddZdddd Zdd Zd S)r@r.rWci|_dSr)rOr\s rr^zNestedDict.__init__s $& rT access_listsr_rrrqrOc|j}|D]V}||vri||<||}|rt|tr|d}t|tstdW|S)Nrkz There is no nest behind this key)rO isinstancelistKeyError)r]r_rrnros rget_or_create_nestzNestedDict.get_or_create_nests I C CA}}Q7D 4 6 6 BxdD)) CABBB C rc||dd}|d}||vrC||}t|tstd|idSig||<dS)Nrkz/An object other than list found behind this key)rrrrappend)r]r_rnlast_keylist_s rappend_nest_to_listzNestedDict.append_nest_to_lists&&s3B3x00r7 t  NEeT** RPQQQ LL      TDNNNrNry)r_rrrqr.rOrz)r&r'r(r^rrr*rrr@r@s_''''" " " " " " " "rr@c$eZdZUded<ded<dS)r?r@rNrArHN)r&r'r(__annotations__r*rrr?r?s%LLLLLrr?rPrQrchars Iterable[str]c\ |||vr|dz }|||vn#t$rYnwxYw|S)Nr )rE)rPrQrs rrCrCsV #h% 1HC#h%      Js  ))expecterror_onfrozenset[str] error_on_eofrqcB |||}n6#t$r)t|}|rt||d|dYnwxYw||||s3|||vr|dz }|||vt||d|||S)Nz Expected r zFound invalid character )index ValueErrorlenrL isdisjoint)rPrQrrrnew_poss r skip_untilrsO))FC(( OOOc((  OsG-C-C-CDD$ N O OO   s3w;/ 0 0N#hh&& 1HC#hh&&3%LC%L%LMMM Ns0A  A c ||}n#t$rd}YnwxYw|dkrt||dzdtdS|S)Nr=r rFrr)rErILLEGAL_COMMENT_CHARS)rPrQrTs rrMrMsms8  s{{ q$)>U     J  cf |}t||t}t||}||kr|S1r)rCTOML_WS_AND_NEWLINErM)rPrQpos_before_skips rskip_comments_and_array_wsrsBc#6773$$ / ! !J rrRtuple[Pos, Key]c>|dz }t||t}t||\}}|j|t js%|j|t jrt||d|d|j |t jd |j |n #t$rt||ddwxYw| d|st||d|dz|fS) Nr zCannot declare z twiceFrgCannot overwrite a value]z.Expected ']' at the end of a table declaration)rCrD parse_keyrHrxrAr|r{rLrZrNrr startswithrPrQrRr_s rrKrKs-1HC S#w ' 'Cc""HC y}}S%-..D#)--U\2R2RD3%Bs%B%B%BCCCIMM#u*eM<<<K ##C(((( KKK3%?@@dJK >>#s # #W3%UVVV 7C<s 6CC.c&|dz }t||t}t||\}}|j|t jrt||d||j||j |t j d |j |n #t$rt||ddwxYw|d|st||d|dz|fS)N"Cannot mutate immutable namespace Frgrz]]z0Expected ']]' at the end of an array declaration)rCrDrrHrxrAr{rLrprZr|rNrrrrs rrJrJ.s%1HC S#w ' 'Cc""HC y}}S%,''Q3%O#%O%OPPPIIMM#u*eM<<<K $$S)))) KKK3%?@@dJK >>$ $ $Y3%WXXX 7C<s *CC"rSrc& t|||\} } dd d}}|z} fdtdt D} | D]`} |j| t jrt||d| |j| t ja|j|t j rt||d| |j |} n #t$rt||ddwxYw|| vrt||dt|ttfr*|j zt j d|| |<|S) Nrkc32K|]}d|zVdSrr*)rrrSr_s rrz!key_value_rule..Js0LLAvBQB/LLLLLLrr zCannot redefine namespace rrTrg)parse_key_value_pairrangerrHrxrAr|rLrer{rNrrrrOrrZ) rPrQrRrSr,valuertruabs_key_parentrelative_path_cont_keyscont_keynestr_s ` @rrGrGCs+3[AAOCess8SWJj(NLLLLLq#c((9K9KLLL+== 9==5#6 7 7 RsC)Ph)P)PQQ Q h(;<<<< y}}^U\22  K>KK   Kx**>:: KKK3%?@@dJK43%?@@@%$&&B fslELD AAADN Js 6DD.tuple[Pos, Key, Any]ct||\}} ||}n#t$rd}YnwxYw|dkrt||d|dz }t||t}t |||\}}|||fS)N=z,Expected '=' after a key in a key/value pairr )rrErLrCrD parse_value)rPrQr,r_rTrs rrresc""HCs8  s{{3%STTT1HC S#w ' 'CS#{33JC U?s  --c>t||\}}|f}t||t} ||}n#t$rd}YnwxYw|dkr||fS|dz }t||t}t||\}}||fz }t||t}q)NT.r )parse_key_partrCrDrE)rPrQkey_partr_rTs rrrus"3,,MC{C S#w ' 'C , "3xDD   DDD  3;;8O qc7++&sC00 X {c7++ ,s8 AAtuple[Pos, str]c ||}n#t$rd}YnwxYw|tvr$|}t||t}||||fS|dkrt||S|dkrt ||St ||d)N'r"z(Invalid initial character for a key part)rEBARE_KEY_CHARSrCparse_literal_strparse_one_line_basic_strrL)rPrQrT start_poss rrrss8  ~ c>22C # &&& s{{ c*** s{{'S111 sC!K L LLrc0|dz }t||dS)Nr F multiline)parse_basic_strrPrQs rrrs 1HC 3u 5 5 55rtuple[Pos, list]c|dz }g}t||}|d|r|dz|fS t|||\}}||t||}|||dz}|dkr|dz|fS|dkrt ||d|dz }t||}|d|r|dz|fS)Nr rT,zUnclosed array)rrrrrL)rPrQr,arrayvalcs r parse_arrayrs1HCE $S# . .C ~~c3Qw~"sC55S S(c22 cAg  887E> ! 88sC)9:: : q(c22 >>#s # # "7E> !"rtuple[Pos, dict]cf|dz }t}t}t||t}|d|r |dz|jfS t |||\}}}|dd|d}}||tjrt||d| | |d} n #t$rt||ddwxYw|| vrt||d ||| |<t||t}|||dz} | dkr |dz|jfS| d krt||d t|t tfr"||tjd |dz }t||t}X) Nr }TrkrFrrzDuplicate inline table key rzUnclosed inline tablerg)r@rArCrDrrOrrxr{rLrrrrrZ) rPrQr, nested_dictrHr_rrtrurrs rparse_inline_tablers1HC,,K GGE S#w ' 'C ~~c3)Qw (((,.sCEES%"3B3xRH 99S%, ' ' UsC)Sc)S)STT T O11*51QQDD O O OsC)CDD$ N O t  sC)Sx)S)STT TXc7++ cAg  887K,, , 88sC)@AA A edD\ * * 9 IIc5<4I 8 8 8 qc7+++,s 7CC,Frrc|||dz}|dz }|rt|dvrp|dkrPt||t} ||}n#t$r|dfcYSwxYw|dkrt||d|dz }t||t}|dfS|dkrt ||d S|d krt ||d S |t |fS#t$rt||ddwxYw) Nr>\ \ \ rrzUnescaped '\' in a stringr z\uz\U)rCrDrErLrparse_hex_charBASIC_STR_ESCAPE_REPLACEMENTSr)rPrQr escape_idrTs rparse_basic_str_escapersMC#'M"I1HC Y"999   S#w//C 3x   Bw t||"3-IJJJ 1HCc#677BwEc3***Ec3***M1)<<< MMM3%ABBLMs?AA8CC$c&t||dS)NTr)rrs r parse_basic_str_escape_multiliners !#sd ; ; ;;rhex_lenrac$||||z}t||kst|st||d||z }t |d}t |st||d|t |fS)NzInvalid hex valuez/Escaped character is not a Unicode scalar value)rHEXDIGIT_CHARS issupersetrLrais_unicode_scalar_valuer)rPrQrhex_strhex_ints rrrs#g %&G 7||wn&?&?&H&H3%89997NC'2G "7 + +X3%VWWW G rc`|dz }|}t||dtd}|dz|||fS)Nr rTr)rILLEGAL_LITERAL_STR_CHARS)rPrQrs rrrsJ1HCI  S# 9   C 7C # & &&rliteralc`|dz }|d|r|dz }|r+d}t||dtd}|||}|dz}nd}t||d \}}|||s||fS|dz }|||s|||zfS|dz }|||d zzfS) Nrr r'''Trr"rr)rr#ILLEGAL_MULTILINE_LITERAL_STR_CHARSr)rPrQrdelimend_posresults rparse_multiline_strr s1HC ~~dC   q @   8    S[!k%c3$??? V >>% % %F{1HC >>% % %#FUN""1HC %!)$ $$rc|rt}t}nt}t}d}|} ||}n #t$rt ||ddwxYw|dkrB|s|dz||||zfS|d|r|dz||||zfS|dz }s|dkr$||||z }|||\}}||z }|}||vrt ||d ||dz }) NrTzUnterminated stringr"r """rr#zIllegal character )!ILLEGAL_MULTILINE_BASIC_STR_CHARSrILLEGAL_BASIC_STR_CHARSrrErLr) rPrQrr parse_escapesrrrT parsed_escapes rrr(sY/48 *. FI Js8DD J J JsC)>??T I J 3;; <QwYs]); ;;;~~eS)) <QwYs]); ;;; 1HC  4<< c)C-( (F!.sC!8!8 C m #FI  8  sC)Fd)F)FGG G q)s /A tuple[Pos, Any]cn ||}n#t$rd}YnwxYw|dkr8|d|rt||dSt||S|dkr8|d|rt||dSt ||S|dkr|d |r|d zdfS|d kr|d |r|d zdfS|dkrt |||S|dkrt |||Stj||}|rK t|}n$#t$r}t||d|d}~wwxYw| |fStj||}|r#| t|fStj||}|r$| t!||fS|||dz} | dvr|dz|| fS|||d z} | dvr|d z|| fSt||d)Nr"rF)rrrTttruerffalser<{zInvalid date or datetimer>infnan>+inf+nan-inf-nanz Invalid value)rErrrrrrr matchr rrLendr rr r) rPrQr,rTdatetime_match datetime_objelocaltime_match number_match first_three first_fours rrrHss8   s{{ >>% % % @&sC??? ?'S111 s{{ >>% % % ?&sC>>> > c*** s{{ >>&# & & !7D=  s{{ >>'3 ' ' "7E> ! s{{3[111 s{{!#sK888!&sC00N2 L,^<.coord_reprsu #c((??$$yyq#&&* 1991WFF3::dAs333F.t..f...rz (at ))rPr:rQrr.r:)r%)rPrQrrs rrLrLsC//// c?? 3(<(<??? @ @@r codepointcBd|cxkodkncpd|cxkodkncS)Nriiir*)rs rrrsE  # # # #e # # # # G))F)F)F)Fw)F)F)F)FGrc4turtSdfd }|S)a%A decorator to make `parse_float` safe. `parse_float` must not return dicts or lists, because these types would be mixed with parsed TOML tables and arrays, thus confusing the parser. The returned decorated callable raises `ValueError` instead of returning illegal types. float_strr:r.rct|}t|ttfrtd|S)Nz*parse_float must not return dicts or lists)rrOrr)r float_valuer,s rsafe_parse_floatz/make_safe_parse_float..safe_parse_floats>!k),, kD$< 0 0 KIJJ Jr)rr:r.r)float)r,r"s` rrBrBs;e  r)r-rr,rr.r/)r9r:r,rr.r/)rPr:rQrrrr.r) rPr:rQrrr:rrrrqr.r)rPr:rQrr.r)rPr:rQrrRr?r.r) rPr:rQrrRr?rSrr,rr.r)rPr:rQrr,rr.r)rPr:rQrr.r)rPr:rQrr.r)rPr:rQrr,rr.r)rPr:rQrr,rr.r)rPr:rQrrrqr.r)rPr:rQrrrar.r)rPr:rQrrrqr.r)rPr:rQrr,rr.r)rPr:rQrrr:r.r%)rrar.rq)r,rr.r)G __future__rcollections.abcrstringtypesrtypingrrr_rer r r r rr_typesrrr frozensetrr ASCII_CTRLrrrrrrDr ascii_lettersdigitsrrF hexdigitsrrrr%r#r8r5rAr@r?rCrrMrrKrJrGrrrrrrrrrrrrrrLrrBr*rrr0s #"""""$$$$$$ """""",,,,,,,,,,)((((((((( Y11uuRyy111 1 1IIcc#hh4G4G G %yy6$.61B1B$B!3&G#/ )E   $/6/&-?$FGG"YYu%5%556+,, 0 0 ! !;;;;;j;;;7< - - - - - -27??????D77777777t""""""""DZ ,    $*D     ,,,,$ M M M M 6666 """"0,,,,B.3MMMMMM:<<<<''''%%%%>@A2A2A2A2HAAAA"HHHHrPK!X\-_vendor/tomli/__pycache__/_re.cpython-311.pycnu[ ,Re *ddlmZddlmZmZmZmZmZmZddlm Z ddl Z ddl m Z ddl mZdZe jd e j Ze jeZe jd ed e j ZddZe dd dZd!dZd"dZdS)#) annotations)datedatetimetime timedeltatimezonetzinfo) lru_cacheN)Any) ParseFloatzE([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\.([0-9]{1,6})[0-9]*)?a` 0 (?: x[0-9A-Fa-f](?:_?[0-9A-Fa-f])* # hex | b[01](?:_?[01])* # bin | o[0-7](?:_?[0-7])* # oct ) | [+-]?(?:0|[1-9](?:_?[0-9])*) # dec, integer part (?P (?:\.[0-9](?:_?[0-9])*)? # optional fractional part (?:[eE][+-]?[0-9](?:_?[0-9])*)? # optional exponent part ) )flagsz` ([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27 (?: [Tt ] zR (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset )? matchre.Matchreturndatetime | datec |\ }}}}}}}}} } } t|t|t|}} } |t| | |St|t|t|}}}|r#t|ddnd}| rt | | | }n|r t j}nd}t| | ||||||S)zConvert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. Raises ValueError if the match does not correspond to a valid date or datetime. N0r)r )groupsintrljust cached_tzrutcr)ryear_str month_strday_strhour_str minute_strsec_str micros_str zulu_timeoffset_sign_stroffset_hour_stroffset_minute_stryearmonthdayhourminutesecmicrostzs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/tomli/_re.pymatch_to_datetimer/4s $   8}}c)nnc'll%DD%%%%H s:G #&D.8 ?S!!!S)) * * *aF% .    \  D%dFC K K KK)maxsizerstrrsign_strrc |dkrdnd}tt|t|z|t|zS)N+r )hoursminutes)rrr)rrr3signs r.rrWsSC11RD X&3z??*     r0rc|\}}}}|r#t|ddnd}tt|t|t||S)Nrrr)rrrr)rrrr r!r,s r.match_to_localtimer;bse05 -Hj':.8 ?S!!!S)) * * *aF H s:G f E EEr0 parse_floatr r c|dr||St|dS)N floatpartr)groupr)rr<s r.match_to_numberr@hsF {{;*{5;;==))) u{{}}a  r0)rrrr)rr2rr2r3r2rr)rrrr)rrr<r rr ) __future__rrrrrrr functoolsr retypingr _typesr _TIME_RE_STRcompileVERBOSE RE_NUMBER RE_LOCALTIME RE_DATETIMEr/rr;r@r0r.rMs| #"""""FFFFFFFFFFFFFFFF  X BJ *#    &rz,'' bj  *     L L L LF 4FFFF !!!!!!r0PK!iiXiX_vendor/tomli/_parser.pynu[# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations from collections.abc import Iterable import string from types import MappingProxyType from typing import Any, BinaryIO, NamedTuple from ._re import ( RE_DATETIME, RE_LOCALTIME, RE_NUMBER, match_to_datetime, match_to_localtime, match_to_number, ) from ._types import Key, ParseFloat, Pos ASCII_CTRL = frozenset(chr(i) for i in range(32)) | frozenset(chr(127)) # Neither of these sets include quotation mark or backslash. They are # currently handled as separate cases in the parser functions. ILLEGAL_BASIC_STR_CHARS = ASCII_CTRL - frozenset("\t") ILLEGAL_MULTILINE_BASIC_STR_CHARS = ASCII_CTRL - frozenset("\t\n") ILLEGAL_LITERAL_STR_CHARS = ILLEGAL_BASIC_STR_CHARS ILLEGAL_MULTILINE_LITERAL_STR_CHARS = ILLEGAL_MULTILINE_BASIC_STR_CHARS ILLEGAL_COMMENT_CHARS = ILLEGAL_BASIC_STR_CHARS TOML_WS = frozenset(" \t") TOML_WS_AND_NEWLINE = TOML_WS | frozenset("\n") BARE_KEY_CHARS = frozenset(string.ascii_letters + string.digits + "-_") KEY_INITIAL_CHARS = BARE_KEY_CHARS | frozenset("\"'") HEXDIGIT_CHARS = frozenset(string.hexdigits) BASIC_STR_ESCAPE_REPLACEMENTS = MappingProxyType( { "\\b": "\u0008", # backspace "\\t": "\u0009", # tab "\\n": "\u000A", # linefeed "\\f": "\u000C", # form feed "\\r": "\u000D", # carriage return '\\"': "\u0022", # quote "\\\\": "\u005C", # backslash } ) class TOMLDecodeError(ValueError): """An error raised if a document is not valid TOML.""" def load(__fp: BinaryIO, *, parse_float: ParseFloat = float) -> dict[str, Any]: """Parse TOML from a binary file object.""" b = __fp.read() try: s = b.decode() except AttributeError: raise TypeError( "File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`" ) from None return loads(s, parse_float=parse_float) def loads(__s: str, *, parse_float: ParseFloat = float) -> dict[str, Any]: # noqa: C901 """Parse TOML from a string.""" # The spec allows converting "\r\n" to "\n", even in string # literals. Let's do so to simplify parsing. src = __s.replace("\r\n", "\n") pos = 0 out = Output(NestedDict(), Flags()) header: Key = () parse_float = make_safe_parse_float(parse_float) # Parse one statement at a time # (typically means one line in TOML source) while True: # 1. Skip line leading whitespace pos = skip_chars(src, pos, TOML_WS) # 2. Parse rules. Expect one of the following: # - end of file # - end of line # - comment # - key/value pair # - append dict to list (and move to its namespace) # - create dict (and move to its namespace) # Skip trailing whitespace when applicable. try: char = src[pos] except IndexError: break if char == "\n": pos += 1 continue if char in KEY_INITIAL_CHARS: pos = key_value_rule(src, pos, out, header, parse_float) pos = skip_chars(src, pos, TOML_WS) elif char == "[": try: second_char: str | None = src[pos + 1] except IndexError: second_char = None out.flags.finalize_pending() if second_char == "[": pos, header = create_list_rule(src, pos, out) else: pos, header = create_dict_rule(src, pos, out) pos = skip_chars(src, pos, TOML_WS) elif char != "#": raise suffixed_err(src, pos, "Invalid statement") # 3. Skip comment pos = skip_comment(src, pos) # 4. Expect end of line or end of file try: char = src[pos] except IndexError: break if char != "\n": raise suffixed_err( src, pos, "Expected newline or end of document after a statement" ) pos += 1 return out.data.dict class Flags: """Flags that map to parsed keys/namespaces.""" # Marks an immutable namespace (inline array or inline table). FROZEN = 0 # Marks a nest that has been explicitly created and can no longer # be opened using the "[table]" syntax. EXPLICIT_NEST = 1 def __init__(self) -> None: self._flags: dict[str, dict] = {} self._pending_flags: set[tuple[Key, int]] = set() def add_pending(self, key: Key, flag: int) -> None: self._pending_flags.add((key, flag)) def finalize_pending(self) -> None: for key, flag in self._pending_flags: self.set(key, flag, recursive=False) self._pending_flags.clear() def unset_all(self, key: Key) -> None: cont = self._flags for k in key[:-1]: if k not in cont: return cont = cont[k]["nested"] cont.pop(key[-1], None) def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003 cont = self._flags key_parent, key_stem = key[:-1], key[-1] for k in key_parent: if k not in cont: cont[k] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont = cont[k]["nested"] if key_stem not in cont: cont[key_stem] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag) def is_(self, key: Key, flag: int) -> bool: if not key: return False # document root has no flags cont = self._flags for k in key[:-1]: if k not in cont: return False inner_cont = cont[k] if flag in inner_cont["recursive_flags"]: return True cont = inner_cont["nested"] key_stem = key[-1] if key_stem in cont: cont = cont[key_stem] return flag in cont["flags"] or flag in cont["recursive_flags"] return False class NestedDict: def __init__(self) -> None: # The parsed content of the TOML document self.dict: dict[str, Any] = {} def get_or_create_nest( self, key: Key, *, access_lists: bool = True, ) -> dict: cont: Any = self.dict for k in key: if k not in cont: cont[k] = {} cont = cont[k] if access_lists and isinstance(cont, list): cont = cont[-1] if not isinstance(cont, dict): raise KeyError("There is no nest behind this key") return cont def append_nest_to_list(self, key: Key) -> None: cont = self.get_or_create_nest(key[:-1]) last_key = key[-1] if last_key in cont: list_ = cont[last_key] if not isinstance(list_, list): raise KeyError("An object other than list found behind this key") list_.append({}) else: cont[last_key] = [{}] class Output(NamedTuple): data: NestedDict flags: Flags def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos: try: while src[pos] in chars: pos += 1 except IndexError: pass return pos def skip_until( src: str, pos: Pos, expect: str, *, error_on: frozenset[str], error_on_eof: bool, ) -> Pos: try: new_pos = src.index(expect, pos) except ValueError: new_pos = len(src) if error_on_eof: raise suffixed_err(src, new_pos, f"Expected {expect!r}") from None if not error_on.isdisjoint(src[pos:new_pos]): while src[pos] not in error_on: pos += 1 raise suffixed_err(src, pos, f"Found invalid character {src[pos]!r}") return new_pos def skip_comment(src: str, pos: Pos) -> Pos: try: char: str | None = src[pos] except IndexError: char = None if char == "#": return skip_until( src, pos + 1, "\n", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False ) return pos def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos: while True: pos_before_skip = pos pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) pos = skip_comment(src, pos) if pos == pos_before_skip: return pos def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 1 # Skip "[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot declare {key} twice") out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.get_or_create_nest(key) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if not src.startswith("]", pos): raise suffixed_err(src, pos, "Expected ']' at the end of a table declaration") return pos + 1, key def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 2 # Skip "[[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot mutate immutable namespace {key}") # Free the namespace now that it points to another empty list item... out.flags.unset_all(key) # ...but this key precisely is still prohibited from table declaration out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.append_nest_to_list(key) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if not src.startswith("]]", pos): raise suffixed_err(src, pos, "Expected ']]' at the end of an array declaration") return pos + 2, key def key_value_rule( src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat ) -> Pos: pos, key, value = parse_key_value_pair(src, pos, parse_float) key_parent, key_stem = key[:-1], key[-1] abs_key_parent = header + key_parent relative_path_cont_keys = (header + key[:i] for i in range(1, len(key))) for cont_key in relative_path_cont_keys: # Check that dotted key syntax does not redefine an existing table if out.flags.is_(cont_key, Flags.EXPLICIT_NEST): raise suffixed_err(src, pos, f"Cannot redefine namespace {cont_key}") # Containers in the relative path can't be opened with the table syntax or # dotted key/value syntax in following table sections. out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST) if out.flags.is_(abs_key_parent, Flags.FROZEN): raise suffixed_err( src, pos, f"Cannot mutate immutable namespace {abs_key_parent}" ) try: nest = out.data.get_or_create_nest(abs_key_parent) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if key_stem in nest: raise suffixed_err(src, pos, "Cannot overwrite a value") # Mark inline table and array namespaces recursively immutable if isinstance(value, (dict, list)): out.flags.set(header + key, Flags.FROZEN, recursive=True) nest[key_stem] = value return pos def parse_key_value_pair( src: str, pos: Pos, parse_float: ParseFloat ) -> tuple[Pos, Key, Any]: pos, key = parse_key(src, pos) try: char: str | None = src[pos] except IndexError: char = None if char != "=": raise suffixed_err(src, pos, "Expected '=' after a key in a key/value pair") pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, value = parse_value(src, pos, parse_float) return pos, key, value def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]: pos, key_part = parse_key_part(src, pos) key: Key = (key_part,) pos = skip_chars(src, pos, TOML_WS) while True: try: char: str | None = src[pos] except IndexError: char = None if char != ".": return pos, key pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, key_part = parse_key_part(src, pos) key += (key_part,) pos = skip_chars(src, pos, TOML_WS) def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]: try: char: str | None = src[pos] except IndexError: char = None if char in BARE_KEY_CHARS: start_pos = pos pos = skip_chars(src, pos, BARE_KEY_CHARS) return pos, src[start_pos:pos] if char == "'": return parse_literal_str(src, pos) if char == '"': return parse_one_line_basic_str(src, pos) raise suffixed_err(src, pos, "Invalid initial character for a key part") def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 return parse_basic_str(src, pos, multiline=False) def parse_array(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, list]: pos += 1 array: list = [] pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array while True: pos, val = parse_value(src, pos, parse_float) array.append(val) pos = skip_comments_and_array_ws(src, pos) c = src[pos : pos + 1] if c == "]": return pos + 1, array if c != ",": raise suffixed_err(src, pos, "Unclosed array") pos += 1 pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array def parse_inline_table(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, dict]: pos += 1 nested_dict = NestedDict() flags = Flags() pos = skip_chars(src, pos, TOML_WS) if src.startswith("}", pos): return pos + 1, nested_dict.dict while True: pos, key, value = parse_key_value_pair(src, pos, parse_float) key_parent, key_stem = key[:-1], key[-1] if flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot mutate immutable namespace {key}") try: nest = nested_dict.get_or_create_nest(key_parent, access_lists=False) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if key_stem in nest: raise suffixed_err(src, pos, f"Duplicate inline table key {key_stem!r}") nest[key_stem] = value pos = skip_chars(src, pos, TOML_WS) c = src[pos : pos + 1] if c == "}": return pos + 1, nested_dict.dict if c != ",": raise suffixed_err(src, pos, "Unclosed inline table") if isinstance(value, (dict, list)): flags.set(key, Flags.FROZEN, recursive=True) pos += 1 pos = skip_chars(src, pos, TOML_WS) def parse_basic_str_escape( src: str, pos: Pos, *, multiline: bool = False ) -> tuple[Pos, str]: escape_id = src[pos : pos + 2] pos += 2 if multiline and escape_id in {"\\ ", "\\\t", "\\\n"}: # Skip whitespace until next non-whitespace character or end of # the doc. Error if non-whitespace is found before newline. if escape_id != "\\\n": pos = skip_chars(src, pos, TOML_WS) try: char = src[pos] except IndexError: return pos, "" if char != "\n": raise suffixed_err(src, pos, "Unescaped '\\' in a string") pos += 1 pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) return pos, "" if escape_id == "\\u": return parse_hex_char(src, pos, 4) if escape_id == "\\U": return parse_hex_char(src, pos, 8) try: return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id] except KeyError: raise suffixed_err(src, pos, "Unescaped '\\' in a string") from None def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]: return parse_basic_str_escape(src, pos, multiline=True) def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]: hex_str = src[pos : pos + hex_len] if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str): raise suffixed_err(src, pos, "Invalid hex value") pos += hex_len hex_int = int(hex_str, 16) if not is_unicode_scalar_value(hex_int): raise suffixed_err(src, pos, "Escaped character is not a Unicode scalar value") return pos, chr(hex_int) def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 # Skip starting apostrophe start_pos = pos pos = skip_until( src, pos, "'", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True ) return pos + 1, src[start_pos:pos] # Skip ending apostrophe def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]: pos += 3 if src.startswith("\n", pos): pos += 1 if literal: delim = "'" end_pos = skip_until( src, pos, "'''", error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS, error_on_eof=True, ) result = src[pos:end_pos] pos = end_pos + 3 else: delim = '"' pos, result = parse_basic_str(src, pos, multiline=True) # Add at maximum two extra apostrophes/quotes if the end sequence # is 4 or 5 chars long instead of just 3. if not src.startswith(delim, pos): return pos, result pos += 1 if not src.startswith(delim, pos): return pos, result + delim pos += 1 return pos, result + (delim * 2) def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]: if multiline: error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape_multiline else: error_on = ILLEGAL_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape result = "" start_pos = pos while True: try: char = src[pos] except IndexError: raise suffixed_err(src, pos, "Unterminated string") from None if char == '"': if not multiline: return pos + 1, result + src[start_pos:pos] if src.startswith('"""', pos): return pos + 3, result + src[start_pos:pos] pos += 1 continue if char == "\\": result += src[start_pos:pos] pos, parsed_escape = parse_escapes(src, pos) result += parsed_escape start_pos = pos continue if char in error_on: raise suffixed_err(src, pos, f"Illegal character {char!r}") pos += 1 def parse_value( # noqa: C901 src: str, pos: Pos, parse_float: ParseFloat ) -> tuple[Pos, Any]: try: char: str | None = src[pos] except IndexError: char = None # IMPORTANT: order conditions based on speed of checking and likelihood # Basic strings if char == '"': if src.startswith('"""', pos): return parse_multiline_str(src, pos, literal=False) return parse_one_line_basic_str(src, pos) # Literal strings if char == "'": if src.startswith("'''", pos): return parse_multiline_str(src, pos, literal=True) return parse_literal_str(src, pos) # Booleans if char == "t": if src.startswith("true", pos): return pos + 4, True if char == "f": if src.startswith("false", pos): return pos + 5, False # Arrays if char == "[": return parse_array(src, pos, parse_float) # Inline tables if char == "{": return parse_inline_table(src, pos, parse_float) # Dates and times datetime_match = RE_DATETIME.match(src, pos) if datetime_match: try: datetime_obj = match_to_datetime(datetime_match) except ValueError as e: raise suffixed_err(src, pos, "Invalid date or datetime") from e return datetime_match.end(), datetime_obj localtime_match = RE_LOCALTIME.match(src, pos) if localtime_match: return localtime_match.end(), match_to_localtime(localtime_match) # Integers and "normal" floats. # The regex will greedily match any type starting with a decimal # char, so needs to be located after handling of dates and times. number_match = RE_NUMBER.match(src, pos) if number_match: return number_match.end(), match_to_number(number_match, parse_float) # Special floats first_three = src[pos : pos + 3] if first_three in {"inf", "nan"}: return pos + 3, parse_float(first_three) first_four = src[pos : pos + 4] if first_four in {"-inf", "+inf", "-nan", "+nan"}: return pos + 4, parse_float(first_four) raise suffixed_err(src, pos, "Invalid value") def suffixed_err(src: str, pos: Pos, msg: str) -> TOMLDecodeError: """Return a `TOMLDecodeError` where error message is suffixed with coordinates in source.""" def coord_repr(src: str, pos: Pos) -> str: if pos >= len(src): return "end of document" line = src.count("\n", 0, pos) + 1 if line == 1: column = pos + 1 else: column = pos - src.rindex("\n", 0, pos) return f"line {line}, column {column}" return TOMLDecodeError(f"{msg} (at {coord_repr(src, pos)})") def is_unicode_scalar_value(codepoint: int) -> bool: return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111) def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat: """A decorator to make `parse_float` safe. `parse_float` must not return dicts or lists, because these types would be mixed with parsed TOML tables and arrays, thus confusing the parser. The returned decorated callable raises `ValueError` instead of returning illegal types. """ # The default `float` callable never returns illegal types. Optimize it. if parse_float is float: # type: ignore[comparison-overlap] return float def safe_parse_float(float_str: str) -> Any: float_value = parse_float(float_str) if isinstance(float_value, (dict, list)): raise ValueError("parse_float must not return dicts or lists") return float_value return safe_parse_float PK!u1  _vendor/tomli/_re.pynu[# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations from datetime import date, datetime, time, timedelta, timezone, tzinfo from functools import lru_cache import re from typing import Any from ._types import ParseFloat # E.g. # - 00:32:00.999999 # - 00:32:00 _TIME_RE_STR = r"([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:\.([0-9]{1,6})[0-9]*)?" RE_NUMBER = re.compile( r""" 0 (?: x[0-9A-Fa-f](?:_?[0-9A-Fa-f])* # hex | b[01](?:_?[01])* # bin | o[0-7](?:_?[0-7])* # oct ) | [+-]?(?:0|[1-9](?:_?[0-9])*) # dec, integer part (?P (?:\.[0-9](?:_?[0-9])*)? # optional fractional part (?:[eE][+-]?[0-9](?:_?[0-9])*)? # optional exponent part ) """, flags=re.VERBOSE, ) RE_LOCALTIME = re.compile(_TIME_RE_STR) RE_DATETIME = re.compile( rf""" ([0-9]{{4}})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]) # date, e.g. 1988-10-27 (?: [Tt ] {_TIME_RE_STR} (?:([Zz])|([+-])([01][0-9]|2[0-3]):([0-5][0-9]))? # optional time offset )? """, flags=re.VERBOSE, ) def match_to_datetime(match: re.Match) -> datetime | date: """Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`. Raises ValueError if the match does not correspond to a valid date or datetime. """ ( year_str, month_str, day_str, hour_str, minute_str, sec_str, micros_str, zulu_time, offset_sign_str, offset_hour_str, offset_minute_str, ) = match.groups() year, month, day = int(year_str), int(month_str), int(day_str) if hour_str is None: return date(year, month, day) hour, minute, sec = int(hour_str), int(minute_str), int(sec_str) micros = int(micros_str.ljust(6, "0")) if micros_str else 0 if offset_sign_str: tz: tzinfo | None = cached_tz( offset_hour_str, offset_minute_str, offset_sign_str ) elif zulu_time: tz = timezone.utc else: # local date-time tz = None return datetime(year, month, day, hour, minute, sec, micros, tzinfo=tz) @lru_cache(maxsize=None) def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone: sign = 1 if sign_str == "+" else -1 return timezone( timedelta( hours=sign * int(hour_str), minutes=sign * int(minute_str), ) ) def match_to_localtime(match: re.Match) -> time: hour_str, minute_str, sec_str, micros_str = match.groups() micros = int(micros_str.ljust(6, "0")) if micros_str else 0 return time(int(hour_str), int(minute_str), int(sec_str), micros) def match_to_number(match: re.Match, parse_float: ParseFloat) -> Any: if match.group("floatpart"): return parse_float(match.group()) return int(match.group(), 0) PK!%_vendor/tomli/__init__.pynu[# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. __all__ = ("loads", "load", "TOMLDecodeError") __version__ = "2.0.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT from ._parser import TOMLDecodeError, load, loads # Pretend this exception was created here. TOMLDecodeError.__module__ = __name__ PK!g_vendor/tomli/_types.pynu[# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from typing import Any, Callable, Tuple # Type annotations ParseFloat = Callable[[str], Any] Key = Tuple[str, ...] Pos = int PK!zx#*#*_vendor/pyparsing/unicode.pynu[# unicode.py import sys from itertools import filterfalse from typing import List, Tuple, Union class _lazyclassproperty: def __init__(self, fn): self.fn = fn self.__doc__ = fn.__doc__ self.__name__ = fn.__name__ def __get__(self, obj, cls): if cls is None: cls = type(obj) if not hasattr(cls, "_intern") or any( cls._intern is getattr(superclass, "_intern", []) for superclass in cls.__mro__[1:] ): cls._intern = {} attrname = self.fn.__name__ if attrname not in cls._intern: cls._intern[attrname] = self.fn(cls) return cls._intern[attrname] UnicodeRangeList = List[Union[Tuple[int, int], Tuple[int]]] class unicode_set: """ A set of Unicode characters, for language-specific strings for ``alphas``, ``nums``, ``alphanums``, and ``printables``. A unicode_set is defined by a list of ranges in the Unicode character set, in a class attribute ``_ranges``. Ranges can be specified using 2-tuples or a 1-tuple, such as:: _ranges = [ (0x0020, 0x007e), (0x00a0, 0x00ff), (0x0100,), ] Ranges are left- and right-inclusive. A 1-tuple of (x,) is treated as (x, x). A unicode set can also be defined using multiple inheritance of other unicode sets:: class CJK(Chinese, Japanese, Korean): pass """ _ranges: UnicodeRangeList = [] @_lazyclassproperty def _chars_for_ranges(cls): ret = [] for cc in cls.__mro__: if cc is unicode_set: break for rr in getattr(cc, "_ranges", ()): ret.extend(range(rr[0], rr[-1] + 1)) return [chr(c) for c in sorted(set(ret))] @_lazyclassproperty def printables(cls): "all non-whitespace characters in this range" return "".join(filterfalse(str.isspace, cls._chars_for_ranges)) @_lazyclassproperty def alphas(cls): "all alphabetic characters in this range" return "".join(filter(str.isalpha, cls._chars_for_ranges)) @_lazyclassproperty def nums(cls): "all numeric digit characters in this range" return "".join(filter(str.isdigit, cls._chars_for_ranges)) @_lazyclassproperty def alphanums(cls): "all alphanumeric characters in this range" return cls.alphas + cls.nums @_lazyclassproperty def identchars(cls): "all characters in this range that are valid identifier characters, plus underscore '_'" return "".join( sorted( set( "".join(filter(str.isidentifier, cls._chars_for_ranges)) + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzªµº" + "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ" + "_" ) ) ) @_lazyclassproperty def identbodychars(cls): """ all characters in this range that are valid identifier body characters, plus the digits 0-9 """ return "".join( sorted( set( cls.identchars + "0123456789" + "".join( [c for c in cls._chars_for_ranges if ("_" + c).isidentifier()] ) ) ) ) class pyparsing_unicode(unicode_set): """ A namespace class for defining common language unicode_sets. """ # fmt: off # define ranges in language character sets _ranges: UnicodeRangeList = [ (0x0020, sys.maxunicode), ] class BasicMultilingualPlane(unicode_set): "Unicode set for the Basic Multilingual Plane" _ranges: UnicodeRangeList = [ (0x0020, 0xFFFF), ] class Latin1(unicode_set): "Unicode set for Latin-1 Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0020, 0x007E), (0x00A0, 0x00FF), ] class LatinA(unicode_set): "Unicode set for Latin-A Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0100, 0x017F), ] class LatinB(unicode_set): "Unicode set for Latin-B Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0180, 0x024F), ] class Greek(unicode_set): "Unicode set for Greek Unicode Character Ranges" _ranges: UnicodeRangeList = [ (0x0342, 0x0345), (0x0370, 0x0377), (0x037A, 0x037F), (0x0384, 0x038A), (0x038C,), (0x038E, 0x03A1), (0x03A3, 0x03E1), (0x03F0, 0x03FF), (0x1D26, 0x1D2A), (0x1D5E,), (0x1D60,), (0x1D66, 0x1D6A), (0x1F00, 0x1F15), (0x1F18, 0x1F1D), (0x1F20, 0x1F45), (0x1F48, 0x1F4D), (0x1F50, 0x1F57), (0x1F59,), (0x1F5B,), (0x1F5D,), (0x1F5F, 0x1F7D), (0x1F80, 0x1FB4), (0x1FB6, 0x1FC4), (0x1FC6, 0x1FD3), (0x1FD6, 0x1FDB), (0x1FDD, 0x1FEF), (0x1FF2, 0x1FF4), (0x1FF6, 0x1FFE), (0x2129,), (0x2719, 0x271A), (0xAB65,), (0x10140, 0x1018D), (0x101A0,), (0x1D200, 0x1D245), (0x1F7A1, 0x1F7A7), ] class Cyrillic(unicode_set): "Unicode set for Cyrillic Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0400, 0x052F), (0x1C80, 0x1C88), (0x1D2B,), (0x1D78,), (0x2DE0, 0x2DFF), (0xA640, 0xA672), (0xA674, 0xA69F), (0xFE2E, 0xFE2F), ] class Chinese(unicode_set): "Unicode set for Chinese Unicode Character Range" _ranges: UnicodeRangeList = [ (0x2E80, 0x2E99), (0x2E9B, 0x2EF3), (0x31C0, 0x31E3), (0x3400, 0x4DB5), (0x4E00, 0x9FEF), (0xA700, 0xA707), (0xF900, 0xFA6D), (0xFA70, 0xFAD9), (0x16FE2, 0x16FE3), (0x1F210, 0x1F212), (0x1F214, 0x1F23B), (0x1F240, 0x1F248), (0x20000, 0x2A6D6), (0x2A700, 0x2B734), (0x2B740, 0x2B81D), (0x2B820, 0x2CEA1), (0x2CEB0, 0x2EBE0), (0x2F800, 0x2FA1D), ] class Japanese(unicode_set): "Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana ranges" _ranges: UnicodeRangeList = [] class Kanji(unicode_set): "Unicode set for Kanji Unicode Character Range" _ranges: UnicodeRangeList = [ (0x4E00, 0x9FBF), (0x3000, 0x303F), ] class Hiragana(unicode_set): "Unicode set for Hiragana Unicode Character Range" _ranges: UnicodeRangeList = [ (0x3041, 0x3096), (0x3099, 0x30A0), (0x30FC,), (0xFF70,), (0x1B001,), (0x1B150, 0x1B152), (0x1F200,), ] class Katakana(unicode_set): "Unicode set for Katakana Unicode Character Range" _ranges: UnicodeRangeList = [ (0x3099, 0x309C), (0x30A0, 0x30FF), (0x31F0, 0x31FF), (0x32D0, 0x32FE), (0xFF65, 0xFF9F), (0x1B000,), (0x1B164, 0x1B167), (0x1F201, 0x1F202), (0x1F213,), ] class Hangul(unicode_set): "Unicode set for Hangul (Korean) Unicode Character Range" _ranges: UnicodeRangeList = [ (0x1100, 0x11FF), (0x302E, 0x302F), (0x3131, 0x318E), (0x3200, 0x321C), (0x3260, 0x327B), (0x327E,), (0xA960, 0xA97C), (0xAC00, 0xD7A3), (0xD7B0, 0xD7C6), (0xD7CB, 0xD7FB), (0xFFA0, 0xFFBE), (0xFFC2, 0xFFC7), (0xFFCA, 0xFFCF), (0xFFD2, 0xFFD7), (0xFFDA, 0xFFDC), ] Korean = Hangul class CJK(Chinese, Japanese, Hangul): "Unicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character Range" class Thai(unicode_set): "Unicode set for Thai Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0E01, 0x0E3A), (0x0E3F, 0x0E5B) ] class Arabic(unicode_set): "Unicode set for Arabic Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0600, 0x061B), (0x061E, 0x06FF), (0x0700, 0x077F), ] class Hebrew(unicode_set): "Unicode set for Hebrew Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0591, 0x05C7), (0x05D0, 0x05EA), (0x05EF, 0x05F4), (0xFB1D, 0xFB36), (0xFB38, 0xFB3C), (0xFB3E,), (0xFB40, 0xFB41), (0xFB43, 0xFB44), (0xFB46, 0xFB4F), ] class Devanagari(unicode_set): "Unicode set for Devanagari Unicode Character Range" _ranges: UnicodeRangeList = [ (0x0900, 0x097F), (0xA8E0, 0xA8FF) ] # fmt: on pyparsing_unicode.Japanese._ranges = ( pyparsing_unicode.Japanese.Kanji._ranges + pyparsing_unicode.Japanese.Hiragana._ranges + pyparsing_unicode.Japanese.Katakana._ranges ) pyparsing_unicode.BMP = pyparsing_unicode.BasicMultilingualPlane # add language identifiers using language Unicode pyparsing_unicode.العربية = pyparsing_unicode.Arabic pyparsing_unicode.中文 = pyparsing_unicode.Chinese pyparsing_unicode.кириллица = pyparsing_unicode.Cyrillic pyparsing_unicode.Ελληνικά = pyparsing_unicode.Greek pyparsing_unicode.עִברִית = pyparsing_unicode.Hebrew pyparsing_unicode.日本語 = pyparsing_unicode.Japanese pyparsing_unicode.Japanese.漢字 = pyparsing_unicode.Japanese.Kanji pyparsing_unicode.Japanese.カタカナ = pyparsing_unicode.Japanese.Katakana pyparsing_unicode.Japanese.ひらがな = pyparsing_unicode.Japanese.Hiragana pyparsing_unicode.한국어 = pyparsing_unicode.Korean pyparsing_unicode.ไทย = pyparsing_unicode.Thai pyparsing_unicode.देवनागरी = pyparsing_unicode.Devanagari PK!e~22_vendor/pyparsing/common.pynu[# common.py from .core import * from .helpers import delimited_list, any_open_tag, any_close_tag from datetime import datetime # some other useful expressions - using lower-case class name since we are really using this as a namespace class pyparsing_common: """Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (:class:`integers`, :class:`reals`, :class:`scientific notation`) - common :class:`programming identifiers` - network addresses (:class:`MAC`, :class:`IPv4`, :class:`IPv6`) - ISO8601 :class:`dates` and :class:`datetime` - :class:`UUID` - :class:`comma-separated list` - :class:`url` Parse actions: - :class:`convertToInteger` - :class:`convertToFloat` - :class:`convertToDate` - :class:`convertToDatetime` - :class:`stripHTMLTags` - :class:`upcaseTokens` - :class:`downcaseTokens` Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] """ convert_to_integer = token_map(int) """ Parse action for converting parsed integers to Python int """ convert_to_float = token_map(float) """ Parse action for converting parsed numbers to Python float """ integer = Word(nums).set_name("integer").set_parse_action(convert_to_integer) """expression that parses an unsigned integer, returns an int""" hex_integer = ( Word(hexnums).set_name("hex integer").set_parse_action(token_map(int, 16)) ) """expression that parses a hexadecimal integer, returns an int""" signed_integer = ( Regex(r"[+-]?\d+") .set_name("signed integer") .set_parse_action(convert_to_integer) ) """expression that parses an integer with optional leading sign, returns an int""" fraction = ( signed_integer().set_parse_action(convert_to_float) + "/" + signed_integer().set_parse_action(convert_to_float) ).set_name("fraction") """fractional expression of an integer divided by an integer, returns a float""" fraction.add_parse_action(lambda tt: tt[0] / tt[-1]) mixed_integer = ( fraction | signed_integer + Opt(Opt("-").suppress() + fraction) ).set_name("fraction or mixed integer-fraction") """mixed integer of the form 'integer - fraction', with optional leading integer, returns float""" mixed_integer.add_parse_action(sum) real = ( Regex(r"[+-]?(?:\d+\.\d*|\.\d+)") .set_name("real number") .set_parse_action(convert_to_float) ) """expression that parses a floating point number and returns a float""" sci_real = ( Regex(r"[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)") .set_name("real number with scientific notation") .set_parse_action(convert_to_float) ) """expression that parses a floating point number with optional scientific notation and returns a float""" # streamlining this expression makes the docs nicer-looking number = (sci_real | real | signed_integer).setName("number").streamline() """any numeric expression, returns the corresponding Python type""" fnumber = ( Regex(r"[+-]?\d+\.?\d*([eE][+-]?\d+)?") .set_name("fnumber") .set_parse_action(convert_to_float) ) """any int or real number, returned as float""" identifier = Word(identchars, identbodychars).set_name("identifier") """typical code identifier (leading alpha or '_', followed by 0 or more alphas, nums, or '_')""" ipv4_address = Regex( r"(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}" ).set_name("IPv4 address") "IPv4 address (``0.0.0.0 - 255.255.255.255``)" _ipv6_part = Regex(r"[0-9a-fA-F]{1,4}").set_name("hex_integer") _full_ipv6_address = (_ipv6_part + (":" + _ipv6_part) * 7).set_name( "full IPv6 address" ) _short_ipv6_address = ( Opt(_ipv6_part + (":" + _ipv6_part) * (0, 6)) + "::" + Opt(_ipv6_part + (":" + _ipv6_part) * (0, 6)) ).set_name("short IPv6 address") _short_ipv6_address.add_condition( lambda t: sum(1 for tt in t if pyparsing_common._ipv6_part.matches(tt)) < 8 ) _mixed_ipv6_address = ("::ffff:" + ipv4_address).set_name("mixed IPv6 address") ipv6_address = Combine( (_full_ipv6_address | _mixed_ipv6_address | _short_ipv6_address).set_name( "IPv6 address" ) ).set_name("IPv6 address") "IPv6 address (long, short, or mixed form)" mac_address = Regex( r"[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}" ).set_name("MAC address") "MAC address xx:xx:xx:xx:xx (may also have '-' or '.' delimiters)" @staticmethod def convert_to_date(fmt: str = "%Y-%m-%d"): """ Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] """ def cvt_fn(ss, ll, tt): try: return datetime.strptime(tt[0], fmt).date() except ValueError as ve: raise ParseException(ss, ll, str(ve)) return cvt_fn @staticmethod def convert_to_datetime(fmt: str = "%Y-%m-%dT%H:%M:%S.%f"): """Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] """ def cvt_fn(s, l, t): try: return datetime.strptime(t[0], fmt) except ValueError as ve: raise ParseException(s, l, str(ve)) return cvt_fn iso8601_date = Regex( r"(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?" ).set_name("ISO8601 date") "ISO8601 date (``yyyy-mm-dd``)" iso8601_datetime = Regex( r"(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?" ).set_name("ISO8601 datetime") "ISO8601 datetime (``yyyy-mm-ddThh:mm:ss.s(Z|+-00:00)``) - trailing seconds, milliseconds, and timezone optional; accepts separating ``'T'`` or ``' '``" uuid = Regex(r"[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}").set_name("UUID") "UUID (``xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx``)" _html_stripper = any_open_tag.suppress() | any_close_tag.suppress() @staticmethod def strip_html_tags(s: str, l: int, tokens: ParseResults): """Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the pyparsing wiki page' td, td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) Prints:: More info at the pyparsing wiki page """ return pyparsing_common._html_stripper.transform_string(tokens[0]) _commasepitem = ( Combine( OneOrMore( ~Literal(",") + ~LineEnd() + Word(printables, exclude_chars=",") + Opt(White(" \t") + ~FollowedBy(LineEnd() | ",")) ) ) .streamline() .set_name("commaItem") ) comma_separated_list = delimited_list( Opt(quoted_string.copy() | _commasepitem, default="") ).set_name("comma separated list") """Predefined expression of 1 or more printable words or quoted strings, separated by commas.""" upcase_tokens = staticmethod(token_map(lambda t: t.upper())) """Parse action to convert tokens to upper case.""" downcase_tokens = staticmethod(token_map(lambda t: t.lower())) """Parse action to convert tokens to lower case.""" # fmt: off url = Regex( # https://mathiasbynens.be/demo/url-regex # https://gist.github.com/dperini/729294 r"^" + # protocol identifier (optional) # short syntax // still required r"(?:(?:(?Phttps?|ftp):)?\/\/)" + # user:pass BasicAuth (optional) r"(?:(?P\S+(?::\S*)?)@)?" + r"(?P" + # IP address exclusion # private & local networks r"(?!(?:10|127)(?:\.\d{1,3}){3})" + r"(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})" + r"(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})" + # IP address dotted notation octets # excludes loopback network 0.0.0.0 # excludes reserved space >= 224.0.0.0 # excludes network & broadcast addresses # (first & last IP address of each class) r"(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])" + r"(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}" + r"(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))" + r"|" + # host & domain names, may end with dot # can be replaced by a shortest alternative # (?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.)+ r"(?:" + r"(?:" + r"[a-z0-9\u00a1-\uffff]" + r"[a-z0-9\u00a1-\uffff_-]{0,62}" + r")?" + r"[a-z0-9\u00a1-\uffff]\." + r")+" + # TLD identifier name, may end with dot r"(?:[a-z\u00a1-\uffff]{2,}\.?)" + r")" + # port number (optional) r"(:(?P\d{2,5}))?" + # resource path (optional) r"(?P\/[^?# ]*)?" + # query string (optional) r"(\?(?P[^#]*))?" + # fragment (optional) r"(#(?P\S*))?" + r"$" ).set_name("url") # fmt: on # pre-PEP8 compatibility names convertToInteger = convert_to_integer convertToFloat = convert_to_float convertToDate = convert_to_date convertToDatetime = convert_to_datetime stripHTMLTags = strip_html_tags upcaseTokens = upcase_tokens downcaseTokens = downcase_tokens _builtin_exprs = [ v for v in vars(pyparsing_common).values() if isinstance(v, ParserElement) ] PK!<ǀ>A>A_vendor/pyparsing/core.pynu[# # core.py # import os import typing from typing import ( NamedTuple, Union, Callable, Any, Generator, Tuple, List, TextIO, Set, Sequence, ) from abc import ABC, abstractmethod from enum import Enum import string import copy import warnings import re import sys from collections.abc import Iterable import traceback import types from operator import itemgetter from functools import wraps from threading import RLock from pathlib import Path from .util import ( _FifoCache, _UnboundedCache, __config_flags, _collapse_string_to_ranges, _escape_regex_range_chars, _bslash, _flatten, LRUMemo as _LRUMemo, UnboundedMemo as _UnboundedMemo, ) from .exceptions import * from .actions import * from .results import ParseResults, _ParseResultsWithOffset from .unicode import pyparsing_unicode _MAX_INT = sys.maxsize str_type: Tuple[type, ...] = (str, bytes) # # Copyright (c) 2003-2022 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # if sys.version_info >= (3, 8): from functools import cached_property else: class cached_property: def __init__(self, func): self._func = func def __get__(self, instance, owner=None): ret = instance.__dict__[self._func.__name__] = self._func(instance) return ret class __compat__(__config_flags): """ A cross-version compatibility configuration for pyparsing features that will be released in a future version. By setting values in this configuration to True, those features can be enabled in prior versions for compatibility development and testing. - ``collect_all_And_tokens`` - flag to enable fix for Issue #63 that fixes erroneous grouping of results names when an :class:`And` expression is nested within an :class:`Or` or :class:`MatchFirst`; maintained for compatibility, but setting to ``False`` no longer restores pre-2.3.1 behavior """ _type_desc = "compatibility" collect_all_And_tokens = True _all_names = [__ for __ in locals() if not __.startswith("_")] _fixed_names = """ collect_all_And_tokens """.split() class __diag__(__config_flags): _type_desc = "diagnostic" warn_multiple_tokens_in_named_alternation = False warn_ungrouped_named_tokens_in_collection = False warn_name_set_on_empty_Forward = False warn_on_parse_using_empty_Forward = False warn_on_assignment_to_Forward = False warn_on_multiple_string_args_to_oneof = False warn_on_match_first_with_lshift_operator = False enable_debug_on_named_expressions = False _all_names = [__ for __ in locals() if not __.startswith("_")] _warning_names = [name for name in _all_names if name.startswith("warn")] _debug_names = [name for name in _all_names if name.startswith("enable_debug")] @classmethod def enable_all_warnings(cls) -> None: for name in cls._warning_names: cls.enable(name) class Diagnostics(Enum): """ Diagnostic configuration (all default to disabled) - ``warn_multiple_tokens_in_named_alternation`` - flag to enable warnings when a results name is defined on a :class:`MatchFirst` or :class:`Or` expression with one or more :class:`And` subexpressions - ``warn_ungrouped_named_tokens_in_collection`` - flag to enable warnings when a results name is defined on a containing expression with ungrouped subexpressions that also have results names - ``warn_name_set_on_empty_Forward`` - flag to enable warnings when a :class:`Forward` is defined with a results name, but has no contents defined - ``warn_on_parse_using_empty_Forward`` - flag to enable warnings when a :class:`Forward` is defined in a grammar but has never had an expression attached to it - ``warn_on_assignment_to_Forward`` - flag to enable warnings when a :class:`Forward` is defined but is overwritten by assigning using ``'='`` instead of ``'<<='`` or ``'<<'`` - ``warn_on_multiple_string_args_to_oneof`` - flag to enable warnings when :class:`one_of` is incorrectly called with multiple str arguments - ``enable_debug_on_named_expressions`` - flag to auto-enable debug on all subsequent calls to :class:`ParserElement.set_name` Diagnostics are enabled/disabled by calling :class:`enable_diag` and :class:`disable_diag`. All warnings can be enabled by calling :class:`enable_all_warnings`. """ warn_multiple_tokens_in_named_alternation = 0 warn_ungrouped_named_tokens_in_collection = 1 warn_name_set_on_empty_Forward = 2 warn_on_parse_using_empty_Forward = 3 warn_on_assignment_to_Forward = 4 warn_on_multiple_string_args_to_oneof = 5 warn_on_match_first_with_lshift_operator = 6 enable_debug_on_named_expressions = 7 def enable_diag(diag_enum: Diagnostics) -> None: """ Enable a global pyparsing diagnostic flag (see :class:`Diagnostics`). """ __diag__.enable(diag_enum.name) def disable_diag(diag_enum: Diagnostics) -> None: """ Disable a global pyparsing diagnostic flag (see :class:`Diagnostics`). """ __diag__.disable(diag_enum.name) def enable_all_warnings() -> None: """ Enable all global pyparsing diagnostic warnings (see :class:`Diagnostics`). """ __diag__.enable_all_warnings() # hide abstract class del __config_flags def _should_enable_warnings( cmd_line_warn_options: typing.Iterable[str], warn_env_var: typing.Optional[str] ) -> bool: enable = bool(warn_env_var) for warn_opt in cmd_line_warn_options: w_action, w_message, w_category, w_module, w_line = (warn_opt + "::::").split( ":" )[:5] if not w_action.lower().startswith("i") and ( not (w_message or w_category or w_module) or w_module == "pyparsing" ): enable = True elif w_action.lower().startswith("i") and w_module in ("pyparsing", ""): enable = False return enable if _should_enable_warnings( sys.warnoptions, os.environ.get("PYPARSINGENABLEALLWARNINGS") ): enable_all_warnings() # build list of single arg builtins, that can be used as parse actions _single_arg_builtins = { sum, len, sorted, reversed, list, tuple, set, any, all, min, max, } _generatorType = types.GeneratorType ParseAction = Union[ Callable[[], Any], Callable[[ParseResults], Any], Callable[[int, ParseResults], Any], Callable[[str, int, ParseResults], Any], ] ParseCondition = Union[ Callable[[], bool], Callable[[ParseResults], bool], Callable[[int, ParseResults], bool], Callable[[str, int, ParseResults], bool], ] ParseFailAction = Callable[[str, int, "ParserElement", Exception], None] DebugStartAction = Callable[[str, int, "ParserElement", bool], None] DebugSuccessAction = Callable[ [str, int, int, "ParserElement", ParseResults, bool], None ] DebugExceptionAction = Callable[[str, int, "ParserElement", Exception, bool], None] alphas = string.ascii_uppercase + string.ascii_lowercase identchars = pyparsing_unicode.Latin1.identchars identbodychars = pyparsing_unicode.Latin1.identbodychars nums = "0123456789" hexnums = nums + "ABCDEFabcdef" alphanums = alphas + nums printables = "".join([c for c in string.printable if c not in string.whitespace]) _trim_arity_call_line: traceback.StackSummary = None def _trim_arity(func, max_limit=3): """decorator to trim function calls to match the arity of the target""" global _trim_arity_call_line if func in _single_arg_builtins: return lambda s, l, t: func(t) limit = 0 found_arity = False def extract_tb(tb, limit=0): frames = traceback.extract_tb(tb, limit=limit) frame_summary = frames[-1] return [frame_summary[:2]] # synthesize what would be returned by traceback.extract_stack at the call to # user's parse action 'func', so that we don't incur call penalty at parse time # fmt: off LINE_DIFF = 7 # IF ANY CODE CHANGES, EVEN JUST COMMENTS OR BLANK LINES, BETWEEN THE NEXT LINE AND # THE CALL TO FUNC INSIDE WRAPPER, LINE_DIFF MUST BE MODIFIED!!!! _trim_arity_call_line = (_trim_arity_call_line or traceback.extract_stack(limit=2)[-1]) pa_call_line_synth = (_trim_arity_call_line[0], _trim_arity_call_line[1] + LINE_DIFF) def wrapper(*args): nonlocal found_arity, limit while 1: try: ret = func(*args[limit:]) found_arity = True return ret except TypeError as te: # re-raise TypeErrors if they did not come from our arity testing if found_arity: raise else: tb = te.__traceback__ trim_arity_type_error = ( extract_tb(tb, limit=2)[-1][:2] == pa_call_line_synth ) del tb if trim_arity_type_error: if limit < max_limit: limit += 1 continue raise # fmt: on # copy func name to wrapper for sensible debug output # (can't use functools.wraps, since that messes with function signature) func_name = getattr(func, "__name__", getattr(func, "__class__").__name__) wrapper.__name__ = func_name wrapper.__doc__ = func.__doc__ return wrapper def condition_as_parse_action( fn: ParseCondition, message: str = None, fatal: bool = False ) -> ParseAction: """ Function to convert a simple predicate function that returns ``True`` or ``False`` into a parse action. Can be used in places when a parse action is required and :class:`ParserElement.add_condition` cannot be used (such as when adding a condition to an operator level in :class:`infix_notation`). Optional keyword arguments: - ``message`` - define a custom message to be used in the raised exception - ``fatal`` - if True, will raise :class:`ParseFatalException` to stop parsing immediately; otherwise will raise :class:`ParseException` """ msg = message if message is not None else "failed user-defined condition" exc_type = ParseFatalException if fatal else ParseException fn = _trim_arity(fn) @wraps(fn) def pa(s, l, t): if not bool(fn(s, l, t)): raise exc_type(s, l, msg) return pa def _default_start_debug_action( instring: str, loc: int, expr: "ParserElement", cache_hit: bool = False ): cache_hit_str = "*" if cache_hit else "" print( ( "{}Match {} at loc {}({},{})\n {}\n {}^".format( cache_hit_str, expr, loc, lineno(loc, instring), col(loc, instring), line(loc, instring), " " * (col(loc, instring) - 1), ) ) ) def _default_success_debug_action( instring: str, startloc: int, endloc: int, expr: "ParserElement", toks: ParseResults, cache_hit: bool = False, ): cache_hit_str = "*" if cache_hit else "" print("{}Matched {} -> {}".format(cache_hit_str, expr, toks.as_list())) def _default_exception_debug_action( instring: str, loc: int, expr: "ParserElement", exc: Exception, cache_hit: bool = False, ): cache_hit_str = "*" if cache_hit else "" print( "{}Match {} failed, {} raised: {}".format( cache_hit_str, expr, type(exc).__name__, exc ) ) def null_debug_action(*args): """'Do-nothing' debug action, to suppress debugging output during parsing.""" class ParserElement(ABC): """Abstract base level parser element class.""" DEFAULT_WHITE_CHARS: str = " \n\t\r" verbose_stacktrace: bool = False _literalStringClass: typing.Optional[type] = None @staticmethod def set_default_whitespace_chars(chars: str) -> None: r""" Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline Word(alphas)[1, ...].parse_string("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.set_default_whitespace_chars(" \t") Word(alphas)[1, ...].parse_string("abc def\nghi jkl") # -> ['abc', 'def'] """ ParserElement.DEFAULT_WHITE_CHARS = chars # update whitespace all parse expressions defined in this module for expr in _builtin_exprs: if expr.copyDefaultWhiteChars: expr.whiteChars = set(chars) @staticmethod def inline_literals_using(cls: type) -> None: """ Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parse_string("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inline_literals_using(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parse_string("1999/12/31") # -> ['1999', '12', '31'] """ ParserElement._literalStringClass = cls class DebugActions(NamedTuple): debug_try: typing.Optional[DebugStartAction] debug_match: typing.Optional[DebugSuccessAction] debug_fail: typing.Optional[DebugExceptionAction] def __init__(self, savelist: bool = False): self.parseAction: List[ParseAction] = list() self.failAction: typing.Optional[ParseFailAction] = None self.customName = None self._defaultName = None self.resultsName = None self.saveAsList = savelist self.skipWhitespace = True self.whiteChars = set(ParserElement.DEFAULT_WHITE_CHARS) self.copyDefaultWhiteChars = True # used when checking for left-recursion self.mayReturnEmpty = False self.keepTabs = False self.ignoreExprs: List["ParserElement"] = list() self.debug = False self.streamlined = False # optimize exception handling for subclasses that don't advance parse index self.mayIndexError = True self.errmsg = "" # mark results names as modal (report only last) or cumulative (list all) self.modalResults = True # custom debug actions self.debugActions = self.DebugActions(None, None, None) # avoid redundant calls to preParse self.callPreparse = True self.callDuringTry = False self.suppress_warnings_: List[Diagnostics] = [] def suppress_warning(self, warning_type: Diagnostics) -> "ParserElement": """ Suppress warnings emitted for a particular diagnostic on this expression. Example:: base = pp.Forward() base.suppress_warning(Diagnostics.warn_on_parse_using_empty_Forward) # statement would normally raise a warning, but is now suppressed print(base.parseString("x")) """ self.suppress_warnings_.append(warning_type) return self def copy(self) -> "ParserElement": """ Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).set_parse_action(lambda toks: int(toks[0])) integerK = integer.copy().add_parse_action(lambda toks: toks[0] * 1024) + Suppress("K") integerM = integer.copy().add_parse_action(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") print((integerK | integerM | integer)[1, ...].parse_string("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of ``expr.copy()`` is just ``expr()``:: integerM = integer().add_parse_action(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") """ cpy = copy.copy(self) cpy.parseAction = self.parseAction[:] cpy.ignoreExprs = self.ignoreExprs[:] if self.copyDefaultWhiteChars: cpy.whiteChars = set(ParserElement.DEFAULT_WHITE_CHARS) return cpy def set_results_name( self, name: str, list_all_matches: bool = False, *, listAllMatches: bool = False ) -> "ParserElement": """ Define name for referencing matching tokens as a nested attribute of the returned parse results. Normally, results names are assigned as you would assign keys in a dict: any existing value is overwritten by later values. If it is necessary to keep all values captured for a particular results name, call ``set_results_name`` with ``list_all_matches`` = True. NOTE: ``set_results_name`` returns a *copy* of the original :class:`ParserElement` object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, ``expr("name")`` in place of ``expr.set_results_name("name")`` - see :class:`__call__`. If ``list_all_matches`` is required, use ``expr("name*")``. Example:: date_str = (integer.set_results_name("year") + '/' + integer.set_results_name("month") + '/' + integer.set_results_name("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") """ listAllMatches = listAllMatches or list_all_matches return self._setResultsName(name, listAllMatches) def _setResultsName(self, name, listAllMatches=False): if name is None: return self newself = self.copy() if name.endswith("*"): name = name[:-1] listAllMatches = True newself.resultsName = name newself.modalResults = not listAllMatches return newself def set_break(self, break_flag: bool = True) -> "ParserElement": """ Method to invoke the Python pdb debugger when this element is about to be parsed. Set ``break_flag`` to ``True`` to enable, ``False`` to disable. """ if break_flag: _parseMethod = self._parse def breaker(instring, loc, doActions=True, callPreParse=True): import pdb # this call to pdb.set_trace() is intentional, not a checkin error pdb.set_trace() return _parseMethod(instring, loc, doActions, callPreParse) breaker._originalParseMethod = _parseMethod self._parse = breaker else: if hasattr(self._parse, "_originalParseMethod"): self._parse = self._parse._originalParseMethod return self def set_parse_action(self, *fns: ParseAction, **kwargs) -> "ParserElement": """ Define one or more actions to perform when successfully matching parse element definition. Parse actions can be called to perform data conversions, do extra validation, update external data structures, or enhance or replace the parsed tokens. Each parse action ``fn`` is a callable method with 0-3 arguments, called as ``fn(s, loc, toks)`` , ``fn(loc, toks)`` , ``fn(toks)`` , or just ``fn()`` , where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a :class:`ParseResults` object The parsed tokens are passed to the parse action as ParseResults. They can be modified in place using list-style append, extend, and pop operations to update the parsed list elements; and with dictionary-style item set and del operations to add, update, or remove any named results. If the tokens are modified in place, it is not necessary to return them with a return statement. Parse actions can also completely replace the given tokens, with another ``ParseResults`` object, or with some entirely different object (common for parse actions that perform data conversions). A convenient way to build a new parse result is to define the values using a dict, and then create the return value using :class:`ParseResults.from_dict`. If None is passed as the ``fn`` parse action, all previously added parse actions for this expression are cleared. Optional keyword arguments: - call_during_try = (default= ``False``) indicate if parse action should be run during lookaheads and alternate testing. For parse actions that have side effects, it is important to only call the parse action once it is determined that it is being called as part of a successful parse. For parse actions that perform additional validation, then call_during_try should be passed as True, so that the validation code is included in the preliminary "try" parses. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`parse_string` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: # parse dates in the form YYYY/MM/DD # use parse action to convert toks from str to int at parse time def convert_to_int(toks): return int(toks[0]) # use a parse action to verify that the date is a valid date def is_valid_date(instring, loc, toks): from datetime import date year, month, day = toks[::2] try: date(year, month, day) except ValueError: raise ParseException(instring, loc, "invalid date given") integer = Word(nums) date_str = integer + '/' + integer + '/' + integer # add parse actions integer.set_parse_action(convert_to_int) date_str.set_parse_action(is_valid_date) # note that integer fields are now ints, not strings date_str.run_tests(''' # successful parse - note that integer fields were converted to ints 1999/12/31 # fail - invalid date 1999/13/31 ''') """ if list(fns) == [None]: self.parseAction = [] else: if not all(callable(fn) for fn in fns): raise TypeError("parse actions must be callable") self.parseAction = [_trim_arity(fn) for fn in fns] self.callDuringTry = kwargs.get( "call_during_try", kwargs.get("callDuringTry", False) ) return self def add_parse_action(self, *fns: ParseAction, **kwargs) -> "ParserElement": """ Add one or more parse actions to expression's list of parse actions. See :class:`set_parse_action`. See examples in :class:`copy`. """ self.parseAction += [_trim_arity(fn) for fn in fns] self.callDuringTry = self.callDuringTry or kwargs.get( "call_during_try", kwargs.get("callDuringTry", False) ) return self def add_condition(self, *fns: ParseCondition, **kwargs) -> "ParserElement": """Add a boolean predicate function to expression's list of parse actions. See :class:`set_parse_action` for function call signatures. Unlike ``set_parse_action``, functions passed to ``add_condition`` need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException - call_during_try = boolean to indicate if this method should be called during internal tryParse calls, default=False Example:: integer = Word(nums).set_parse_action(lambda toks: int(toks[0])) year_int = integer.copy() year_int.add_condition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parse_string("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) """ for fn in fns: self.parseAction.append( condition_as_parse_action( fn, message=kwargs.get("message"), fatal=kwargs.get("fatal", False) ) ) self.callDuringTry = self.callDuringTry or kwargs.get( "call_during_try", kwargs.get("callDuringTry", False) ) return self def set_fail_action(self, fn: ParseFailAction) -> "ParserElement": """ Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments ``fn(s, loc, expr, err)`` where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw :class:`ParseFatalException` if it is desired to stop parsing immediately.""" self.failAction = fn return self def _skipIgnorables(self, instring, loc): exprsFound = True while exprsFound: exprsFound = False for e in self.ignoreExprs: try: while 1: loc, dummy = e._parse(instring, loc) exprsFound = True except ParseException: pass return loc def preParse(self, instring, loc): if self.ignoreExprs: loc = self._skipIgnorables(instring, loc) if self.skipWhitespace: instrlen = len(instring) white_chars = self.whiteChars while loc < instrlen and instring[loc] in white_chars: loc += 1 return loc def parseImpl(self, instring, loc, doActions=True): return loc, [] def postParse(self, instring, loc, tokenlist): return tokenlist # @profile def _parseNoCache( self, instring, loc, doActions=True, callPreParse=True ) -> Tuple[int, ParseResults]: TRY, MATCH, FAIL = 0, 1, 2 debugging = self.debug # and doActions) len_instring = len(instring) if debugging or self.failAction: # print("Match {} at loc {}({}, {})".format(self, loc, lineno(loc, instring), col(loc, instring))) try: if callPreParse and self.callPreparse: pre_loc = self.preParse(instring, loc) else: pre_loc = loc tokens_start = pre_loc if self.debugActions.debug_try: self.debugActions.debug_try(instring, tokens_start, self, False) if self.mayIndexError or pre_loc >= len_instring: try: loc, tokens = self.parseImpl(instring, pre_loc, doActions) except IndexError: raise ParseException(instring, len_instring, self.errmsg, self) else: loc, tokens = self.parseImpl(instring, pre_loc, doActions) except Exception as err: # print("Exception raised:", err) if self.debugActions.debug_fail: self.debugActions.debug_fail( instring, tokens_start, self, err, False ) if self.failAction: self.failAction(instring, tokens_start, self, err) raise else: if callPreParse and self.callPreparse: pre_loc = self.preParse(instring, loc) else: pre_loc = loc tokens_start = pre_loc if self.mayIndexError or pre_loc >= len_instring: try: loc, tokens = self.parseImpl(instring, pre_loc, doActions) except IndexError: raise ParseException(instring, len_instring, self.errmsg, self) else: loc, tokens = self.parseImpl(instring, pre_loc, doActions) tokens = self.postParse(instring, loc, tokens) ret_tokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList, modal=self.modalResults ) if self.parseAction and (doActions or self.callDuringTry): if debugging: try: for fn in self.parseAction: try: tokens = fn(instring, tokens_start, ret_tokens) except IndexError as parse_action_exc: exc = ParseException("exception raised in parse action") raise exc from parse_action_exc if tokens is not None and tokens is not ret_tokens: ret_tokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens, (ParseResults, list)), modal=self.modalResults, ) except Exception as err: # print "Exception raised in user parse action:", err if self.debugActions.debug_fail: self.debugActions.debug_fail( instring, tokens_start, self, err, False ) raise else: for fn in self.parseAction: try: tokens = fn(instring, tokens_start, ret_tokens) except IndexError as parse_action_exc: exc = ParseException("exception raised in parse action") raise exc from parse_action_exc if tokens is not None and tokens is not ret_tokens: ret_tokens = ParseResults( tokens, self.resultsName, asList=self.saveAsList and isinstance(tokens, (ParseResults, list)), modal=self.modalResults, ) if debugging: # print("Matched", self, "->", ret_tokens.as_list()) if self.debugActions.debug_match: self.debugActions.debug_match( instring, tokens_start, loc, self, ret_tokens, False ) return loc, ret_tokens def try_parse(self, instring: str, loc: int, raise_fatal: bool = False) -> int: try: return self._parse(instring, loc, doActions=False)[0] except ParseFatalException: if raise_fatal: raise raise ParseException(instring, loc, self.errmsg, self) def can_parse_next(self, instring: str, loc: int) -> bool: try: self.try_parse(instring, loc) except (ParseException, IndexError): return False else: return True # cache for left-recursion in Forward references recursion_lock = RLock() recursion_memos: typing.Dict[ Tuple[int, "Forward", bool], Tuple[int, Union[ParseResults, Exception]] ] = {} # argument cache for optimizing repeated calls when backtracking through recursive expressions packrat_cache = ( {} ) # this is set later by enabled_packrat(); this is here so that reset_cache() doesn't fail packrat_cache_lock = RLock() packrat_cache_stats = [0, 0] # this method gets repeatedly called during backtracking with the same arguments - # we can cache these arguments and save ourselves the trouble of re-parsing the contained expression def _parseCache( self, instring, loc, doActions=True, callPreParse=True ) -> Tuple[int, ParseResults]: HIT, MISS = 0, 1 TRY, MATCH, FAIL = 0, 1, 2 lookup = (self, instring, loc, callPreParse, doActions) with ParserElement.packrat_cache_lock: cache = ParserElement.packrat_cache value = cache.get(lookup) if value is cache.not_in_cache: ParserElement.packrat_cache_stats[MISS] += 1 try: value = self._parseNoCache(instring, loc, doActions, callPreParse) except ParseBaseException as pe: # cache a copy of the exception, without the traceback cache.set(lookup, pe.__class__(*pe.args)) raise else: cache.set(lookup, (value[0], value[1].copy(), loc)) return value else: ParserElement.packrat_cache_stats[HIT] += 1 if self.debug and self.debugActions.debug_try: try: self.debugActions.debug_try(instring, loc, self, cache_hit=True) except TypeError: pass if isinstance(value, Exception): if self.debug and self.debugActions.debug_fail: try: self.debugActions.debug_fail( instring, loc, self, value, cache_hit=True ) except TypeError: pass raise value loc_, result, endloc = value[0], value[1].copy(), value[2] if self.debug and self.debugActions.debug_match: try: self.debugActions.debug_match( instring, loc_, endloc, self, result, cache_hit=True ) except TypeError: pass return loc_, result _parse = _parseNoCache @staticmethod def reset_cache() -> None: ParserElement.packrat_cache.clear() ParserElement.packrat_cache_stats[:] = [0] * len( ParserElement.packrat_cache_stats ) ParserElement.recursion_memos.clear() _packratEnabled = False _left_recursion_enabled = False @staticmethod def disable_memoization() -> None: """ Disables active Packrat or Left Recursion parsing and their memoization This method also works if neither Packrat nor Left Recursion are enabled. This makes it safe to call before activating Packrat nor Left Recursion to clear any previous settings. """ ParserElement.reset_cache() ParserElement._left_recursion_enabled = False ParserElement._packratEnabled = False ParserElement._parse = ParserElement._parseNoCache @staticmethod def enable_left_recursion( cache_size_limit: typing.Optional[int] = None, *, force=False ) -> None: """ Enables "bounded recursion" parsing, which allows for both direct and indirect left-recursion. During parsing, left-recursive :class:`Forward` elements are repeatedly matched with a fixed recursion depth that is gradually increased until finding the longest match. Example:: import pyparsing as pp pp.ParserElement.enable_left_recursion() E = pp.Forward("E") num = pp.Word(pp.nums) # match `num`, or `num '+' num`, or `num '+' num '+' num`, ... E <<= E + '+' - num | num print(E.parse_string("1+2+3")) Recursion search naturally memoizes matches of ``Forward`` elements and may thus skip reevaluation of parse actions during backtracking. This may break programs with parse actions which rely on strict ordering of side-effects. Parameters: - cache_size_limit - (default=``None``) - memoize at most this many ``Forward`` elements during matching; if ``None`` (the default), memoize all ``Forward`` elements. Bounded Recursion parsing works similar but not identical to Packrat parsing, thus the two cannot be used together. Use ``force=True`` to disable any previous, conflicting settings. """ if force: ParserElement.disable_memoization() elif ParserElement._packratEnabled: raise RuntimeError("Packrat and Bounded Recursion are not compatible") if cache_size_limit is None: ParserElement.recursion_memos = _UnboundedMemo() elif cache_size_limit > 0: ParserElement.recursion_memos = _LRUMemo(capacity=cache_size_limit) else: raise NotImplementedError("Memo size of %s" % cache_size_limit) ParserElement._left_recursion_enabled = True @staticmethod def enable_packrat(cache_size_limit: int = 128, *, force: bool = False) -> None: """ Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default= ``128``) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method :class:`ParserElement.enable_packrat`. For best results, call ``enable_packrat()`` immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enable_packrat() Packrat parsing works similar but not identical to Bounded Recursion parsing, thus the two cannot be used together. Use ``force=True`` to disable any previous, conflicting settings. """ if force: ParserElement.disable_memoization() elif ParserElement._left_recursion_enabled: raise RuntimeError("Packrat and Bounded Recursion are not compatible") if not ParserElement._packratEnabled: ParserElement._packratEnabled = True if cache_size_limit is None: ParserElement.packrat_cache = _UnboundedCache() else: ParserElement.packrat_cache = _FifoCache(cache_size_limit) ParserElement._parse = ParserElement._parseCache def parse_string( self, instring: str, parse_all: bool = False, *, parseAll: bool = False ) -> ParseResults: """ Parse a string with respect to the parser definition. This function is intended as the primary interface to the client code. :param instring: The input string to be parsed. :param parse_all: If set, the entire input string must match the grammar. :param parseAll: retained for pre-PEP8 compatibility, will be removed in a future release. :raises ParseException: Raised if ``parse_all`` is set and the input string does not match the whole grammar. :returns: the parsed data as a :class:`ParseResults` object, which may be accessed as a `list`, a `dict`, or an object with attributes if the given parser includes results names. If the input string is required to match the entire grammar, ``parse_all`` flag must be set to ``True``. This is also equivalent to ending the grammar with :class:`StringEnd`(). To report proper column numbers, ``parse_string`` operates on a copy of the input string where all tabs are converted to spaces (8 spaces per tab, as per the default in ``string.expandtabs``). If the input string contains tabs and the grammar uses parse actions that use the ``loc`` argument to index into the string being parsed, one can ensure a consistent view of the input string by doing one of the following: - calling ``parse_with_tabs`` on your grammar before calling ``parse_string`` (see :class:`parse_with_tabs`), - define your parse action using the full ``(s,loc,toks)`` signature, and reference the input string using the parse action's ``s`` argument, or - explicitly expand the tabs in your input string before calling ``parse_string``. Examples: By default, partial matches are OK. >>> res = Word('a').parse_string('aaaaabaaa') >>> print(res) ['aaaaa'] The parsing behavior varies by the inheriting class of this abstract class. Please refer to the children directly to see more examples. It raises an exception if parse_all flag is set and instring does not match the whole grammar. >>> res = Word('a').parse_string('aaaaabaaa', parse_all=True) Traceback (most recent call last): ... pyparsing.ParseException: Expected end of text, found 'b' (at char 5), (line:1, col:6) """ parseAll = parse_all or parseAll ParserElement.reset_cache() if not self.streamlined: self.streamline() for e in self.ignoreExprs: e.streamline() if not self.keepTabs: instring = instring.expandtabs() try: loc, tokens = self._parse(instring, 0) if parseAll: loc = self.preParse(instring, loc) se = Empty() + StringEnd() se._parse(instring, loc) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clearing out pyparsing internal stack trace raise exc.with_traceback(None) else: return tokens def scan_string( self, instring: str, max_matches: int = _MAX_INT, overlap: bool = False, *, debug: bool = False, maxMatches: int = _MAX_INT, ) -> Generator[Tuple[ParseResults, int, int], None, None]: """ Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional ``max_matches`` argument, to clip scanning after 'n' matches are found. If ``overlap`` is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See :class:`parse_string` for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens, start, end in Word(alphas).scan_string(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd """ maxMatches = min(maxMatches, max_matches) if not self.streamlined: self.streamline() for e in self.ignoreExprs: e.streamline() if not self.keepTabs: instring = str(instring).expandtabs() instrlen = len(instring) loc = 0 preparseFn = self.preParse parseFn = self._parse ParserElement.resetCache() matches = 0 try: while loc <= instrlen and matches < maxMatches: try: preloc = preparseFn(instring, loc) nextLoc, tokens = parseFn(instring, preloc, callPreParse=False) except ParseException: loc = preloc + 1 else: if nextLoc > loc: matches += 1 if debug: print( { "tokens": tokens.asList(), "start": preloc, "end": nextLoc, } ) yield tokens, preloc, nextLoc if overlap: nextloc = preparseFn(instring, loc) if nextloc > loc: loc = nextLoc else: loc += 1 else: loc = nextLoc else: loc = preloc + 1 except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc.with_traceback(None) def transform_string(self, instring: str, *, debug: bool = False) -> str: """ Extension to :class:`scan_string`, to modify matching text with modified tokens that may be returned from a parse action. To use ``transform_string``, define a grammar and attach a parse action to it that modifies the returned token list. Invoking ``transform_string()`` on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. ``transform_string()`` returns the resulting transformed string. Example:: wd = Word(alphas) wd.set_parse_action(lambda toks: toks[0].title()) print(wd.transform_string("now is the winter of our discontent made glorious summer by this sun of york.")) prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. """ out: List[str] = [] lastE = 0 # force preservation of s, to minimize unwanted transformation of string, and to # keep string locs straight between transform_string and scan_string self.keepTabs = True try: for t, s, e in self.scan_string(instring, debug=debug): out.append(instring[lastE:s]) if t: if isinstance(t, ParseResults): out += t.as_list() elif isinstance(t, Iterable) and not isinstance(t, str_type): out.extend(t) else: out.append(t) lastE = e out.append(instring[lastE:]) out = [o for o in out if o] return "".join([str(s) for s in _flatten(out)]) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc.with_traceback(None) def search_string( self, instring: str, max_matches: int = _MAX_INT, *, debug: bool = False, maxMatches: int = _MAX_INT, ) -> ParseResults: """ Another extension to :class:`scan_string`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``max_matches`` argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.search_string("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.search_string("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] """ maxMatches = min(maxMatches, max_matches) try: return ParseResults( [t for t, s, e in self.scan_string(instring, maxMatches, debug=debug)] ) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc.with_traceback(None) def split( self, instring: str, maxsplit: int = _MAX_INT, include_separators: bool = False, *, includeSeparators=False, ) -> Generator[str, None, None]: """ Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to limit the number of splits; and the optional ``include_separators`` argument (default= ``False``), if the separating matching text should be included in the split results. Example:: punc = one_of(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] """ includeSeparators = includeSeparators or include_separators last = 0 for t, s, e in self.scan_string(instring, max_matches=maxsplit): yield instring[last:s] if includeSeparators: yield t[0] last = e yield instring[last:] def __add__(self, other) -> "ParserElement": """ Implementation of ``+`` operator - returns :class:`And`. Adding strings to a :class:`ParserElement` converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print(hello, "->", greet.parse_string(hello)) prints:: Hello, World! -> ['Hello', ',', 'World', '!'] ``...`` may be used as a parse expression as a short form of :class:`SkipTo`. Literal('start') + ... + Literal('end') is equivalent to: Literal('start') + SkipTo('end')("_skipped*") + Literal('end') Note that the skipped text is returned with '_skipped' as a results name, and to support having multiple skips in the same parser, the value returned is a list of all skipped text. """ if other is Ellipsis: return _PendingSkip(self) if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return And([self, other]) def __radd__(self, other) -> "ParserElement": """ Implementation of ``+`` operator when left operand is not a :class:`ParserElement` """ if other is Ellipsis: return SkipTo(self)("_skipped*") + self if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return other + self def __sub__(self, other) -> "ParserElement": """ Implementation of ``-`` operator, returns :class:`And` with error stop """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return self + And._ErrorStop() + other def __rsub__(self, other) -> "ParserElement": """ Implementation of ``-`` operator when left operand is not a :class:`ParserElement` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return other - self def __mul__(self, other) -> "ParserElement": """ Implementation of ``*`` operator, allows use of ``expr * 3`` in place of ``expr + expr + expr``. Expressions may also be multiplied by a 2-integer tuple, similar to ``{min, max}`` multipliers in regular expressions. Tuples may also include ``None`` as in: - ``expr*(n, None)`` or ``expr*(n, )`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr*(None, n)`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr*(None, None)`` is equivalent to ``ZeroOrMore(expr)`` - ``expr*(1, None)`` is equivalent to ``OneOrMore(expr)`` Note that ``expr*(None, n)`` does not raise an exception if more than n exprs exist in the input stream; that is, ``expr*(None, n)`` does not enforce a maximum number of expr occurrences. If this behavior is desired, then write ``expr*(None, n) + ~expr`` """ if other is Ellipsis: other = (0, None) elif isinstance(other, tuple) and other[:1] == (Ellipsis,): other = ((0,) + other[1:] + (None,))[:2] if isinstance(other, int): minElements, optElements = other, 0 elif isinstance(other, tuple): other = tuple(o if o is not Ellipsis else None for o in other) other = (other + (None, None))[:2] if other[0] is None: other = (0, other[1]) if isinstance(other[0], int) and other[1] is None: if other[0] == 0: return ZeroOrMore(self) if other[0] == 1: return OneOrMore(self) else: return self * other[0] + ZeroOrMore(self) elif isinstance(other[0], int) and isinstance(other[1], int): minElements, optElements = other optElements -= minElements else: raise TypeError( "cannot multiply ParserElement and ({}) objects".format( ",".join(type(item).__name__ for item in other) ) ) else: raise TypeError( "cannot multiply ParserElement and {} objects".format( type(other).__name__ ) ) if minElements < 0: raise ValueError("cannot multiply ParserElement by negative value") if optElements < 0: raise ValueError( "second tuple value must be greater or equal to first tuple value" ) if minElements == optElements == 0: return And([]) if optElements: def makeOptionalList(n): if n > 1: return Opt(self + makeOptionalList(n - 1)) else: return Opt(self) if minElements: if minElements == 1: ret = self + makeOptionalList(optElements) else: ret = And([self] * minElements) + makeOptionalList(optElements) else: ret = makeOptionalList(optElements) else: if minElements == 1: ret = self else: ret = And([self] * minElements) return ret def __rmul__(self, other) -> "ParserElement": return self.__mul__(other) def __or__(self, other) -> "ParserElement": """ Implementation of ``|`` operator - returns :class:`MatchFirst` """ if other is Ellipsis: return _PendingSkip(self, must_skip=True) if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return MatchFirst([self, other]) def __ror__(self, other) -> "ParserElement": """ Implementation of ``|`` operator when left operand is not a :class:`ParserElement` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return other | self def __xor__(self, other) -> "ParserElement": """ Implementation of ``^`` operator - returns :class:`Or` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return Or([self, other]) def __rxor__(self, other) -> "ParserElement": """ Implementation of ``^`` operator when left operand is not a :class:`ParserElement` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return other ^ self def __and__(self, other) -> "ParserElement": """ Implementation of ``&`` operator - returns :class:`Each` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return Each([self, other]) def __rand__(self, other) -> "ParserElement": """ Implementation of ``&`` operator when left operand is not a :class:`ParserElement` """ if isinstance(other, str_type): other = self._literalStringClass(other) if not isinstance(other, ParserElement): raise TypeError( "Cannot combine element of type {} with ParserElement".format( type(other).__name__ ) ) return other & self def __invert__(self) -> "ParserElement": """ Implementation of ``~`` operator - returns :class:`NotAny` """ return NotAny(self) # disable __iter__ to override legacy use of sequential access to __getitem__ to # iterate over a sequence __iter__ = None def __getitem__(self, key): """ use ``[]`` indexing notation as a short form for expression repetition: - ``expr[n]`` is equivalent to ``expr*n`` - ``expr[m, n]`` is equivalent to ``expr*(m, n)`` - ``expr[n, ...]`` or ``expr[n,]`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr[..., n]`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr[...]`` and ``expr[0, ...]`` are equivalent to ``ZeroOrMore(expr)`` - ``expr[1, ...]`` is equivalent to ``OneOrMore(expr)`` ``None`` may be used in place of ``...``. Note that ``expr[..., n]`` and ``expr[m, n]``do not raise an exception if more than ``n`` ``expr``s exist in the input stream. If this behavior is desired, then write ``expr[..., n] + ~expr``. """ # convert single arg keys to tuples try: if isinstance(key, str_type): key = (key,) iter(key) except TypeError: key = (key, key) if len(key) > 2: raise TypeError( "only 1 or 2 index arguments supported ({}{})".format( key[:5], "... [{}]".format(len(key)) if len(key) > 5 else "" ) ) # clip to 2 elements ret = self * tuple(key[:2]) return ret def __call__(self, name: str = None) -> "ParserElement": """ Shortcut for :class:`set_results_name`, with ``list_all_matches=False``. If ``name`` is given with a trailing ``'*'`` character, then ``list_all_matches`` will be passed as ``True``. If ``name` is omitted, same as calling :class:`copy`. Example:: # these are equivalent userdata = Word(alphas).set_results_name("name") + Word(nums + "-").set_results_name("socsecno") userdata = Word(alphas)("name") + Word(nums + "-")("socsecno") """ if name is not None: return self._setResultsName(name) else: return self.copy() def suppress(self) -> "ParserElement": """ Suppresses the output of this :class:`ParserElement`; useful to keep punctuation from cluttering up returned output. """ return Suppress(self) def ignore_whitespace(self, recursive: bool = True) -> "ParserElement": """ Enables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. :param recursive: If ``True`` (the default), also enable whitespace skipping in child elements (if any) """ self.skipWhitespace = True return self def leave_whitespace(self, recursive: bool = True) -> "ParserElement": """ Disables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. :param recursive: If true (the default), also disable whitespace skipping in child elements (if any) """ self.skipWhitespace = False return self def set_whitespace_chars( self, chars: Union[Set[str], str], copy_defaults: bool = False ) -> "ParserElement": """ Overrides the default whitespace chars """ self.skipWhitespace = True self.whiteChars = set(chars) self.copyDefaultWhiteChars = copy_defaults return self def parse_with_tabs(self) -> "ParserElement": """ Overrides default behavior to expand ```` s to spaces before parsing the input string. Must be called before ``parse_string`` when the input grammar contains elements that match ```` characters. """ self.keepTabs = True return self def ignore(self, other: "ParserElement") -> "ParserElement": """ Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = Word(alphas)[1, ...] patt.parse_string('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(c_style_comment) patt.parse_string('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] """ import typing if isinstance(other, str_type): other = Suppress(other) if isinstance(other, Suppress): if other not in self.ignoreExprs: self.ignoreExprs.append(other) else: self.ignoreExprs.append(Suppress(other.copy())) return self def set_debug_actions( self, start_action: DebugStartAction, success_action: DebugSuccessAction, exception_action: DebugExceptionAction, ) -> "ParserElement": """ Customize display of debugging messages while doing pattern matching: - ``start_action`` - method to be called when an expression is about to be parsed; should have the signature ``fn(input_string: str, location: int, expression: ParserElement, cache_hit: bool)`` - ``success_action`` - method to be called when an expression has successfully parsed; should have the signature ``fn(input_string: str, start_location: int, end_location: int, expression: ParserELement, parsed_tokens: ParseResults, cache_hit: bool)`` - ``exception_action`` - method to be called when expression fails to parse; should have the signature ``fn(input_string: str, location: int, expression: ParserElement, exception: Exception, cache_hit: bool)`` """ self.debugActions = self.DebugActions( start_action or _default_start_debug_action, success_action or _default_success_debug_action, exception_action or _default_exception_debug_action, ) self.debug = True return self def set_debug(self, flag: bool = True) -> "ParserElement": """ Enable display of debugging messages while doing pattern matching. Set ``flag`` to ``True`` to enable, ``False`` to disable. Example:: wd = Word(alphas).set_name("alphaword") integer = Word(nums).set_name("numword") term = wd | integer # turn on debugging for wd wd.set_debug() term[1, ...].parse_string("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using :class:`set_debug_actions`. Prior to attempting to match the ``wd`` expression, the debugging message ``"Match at loc (,)"`` is shown. Then if the parse succeeds, a ``"Matched"`` message is shown, or an ``"Exception raised"`` message is shown. Also note the use of :class:`set_name` to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the :class:`Word` expression without calling ``set_name`` is ``"W:(A-Za-z)"``. """ if flag: self.set_debug_actions( _default_start_debug_action, _default_success_debug_action, _default_exception_debug_action, ) else: self.debug = False return self @property def default_name(self) -> str: if self._defaultName is None: self._defaultName = self._generateDefaultName() return self._defaultName @abstractmethod def _generateDefaultName(self): """ Child classes must define this method, which defines how the ``default_name`` is set. """ def set_name(self, name: str) -> "ParserElement": """ Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parse_string("ABC") # -> Exception: Expected W:(0-9) (at char 0), (line:1, col:1) Word(nums).set_name("integer").parse_string("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) """ self.customName = name self.errmsg = "Expected " + self.name if __diag__.enable_debug_on_named_expressions: self.set_debug() return self @property def name(self) -> str: # This will use a user-defined name if available, but otherwise defaults back to the auto-generated name return self.customName if self.customName is not None else self.default_name def __str__(self) -> str: return self.name def __repr__(self) -> str: return str(self) def streamline(self) -> "ParserElement": self.streamlined = True self._defaultName = None return self def recurse(self) -> Sequence["ParserElement"]: return [] def _checkRecursion(self, parseElementList): subRecCheckList = parseElementList[:] + [self] for e in self.recurse(): e._checkRecursion(subRecCheckList) def validate(self, validateTrace=None) -> None: """ Check defined expressions for valid structure, check for infinite recursive definitions. """ self._checkRecursion([]) def parse_file( self, file_or_filename: Union[str, Path, TextIO], encoding: str = "utf-8", parse_all: bool = False, *, parseAll: bool = False, ) -> ParseResults: """ Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. """ parseAll = parseAll or parse_all try: file_contents = file_or_filename.read() except AttributeError: with open(file_or_filename, "r", encoding=encoding) as f: file_contents = f.read() try: return self.parse_string(file_contents, parseAll) except ParseBaseException as exc: if ParserElement.verbose_stacktrace: raise else: # catch and re-raise exception from here, clears out pyparsing internal stack trace raise exc.with_traceback(None) def __eq__(self, other): if self is other: return True elif isinstance(other, str_type): return self.matches(other, parse_all=True) elif isinstance(other, ParserElement): return vars(self) == vars(other) return False def __hash__(self): return id(self) def matches( self, test_string: str, parse_all: bool = True, *, parseAll: bool = True ) -> bool: """ Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - ``test_string`` - to test against this expression for a match - ``parse_all`` - (default= ``True``) - flag to pass to :class:`parse_string` when running tests Example:: expr = Word(nums) assert expr.matches("100") """ parseAll = parseAll and parse_all try: self.parse_string(str(test_string), parse_all=parseAll) return True except ParseBaseException: return False def run_tests( self, tests: Union[str, List[str]], parse_all: bool = True, comment: typing.Optional[Union["ParserElement", str]] = "#", full_dump: bool = True, print_results: bool = True, failure_tests: bool = False, post_parse: Callable[[str, ParseResults], str] = None, file: typing.Optional[TextIO] = None, with_line_numbers: bool = False, *, parseAll: bool = True, fullDump: bool = True, printResults: bool = True, failureTests: bool = False, postParse: Callable[[str, ParseResults], str] = None, ) -> Tuple[bool, List[Tuple[str, Union[ParseResults, Exception]]]]: """ Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - ``tests`` - a list of separate test strings, or a multiline string of test strings - ``parse_all`` - (default= ``True``) - flag to pass to :class:`parse_string` when running tests - ``comment`` - (default= ``'#'``) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - ``full_dump`` - (default= ``True``) - dump results as list followed by results names in nested outline; if False, only dump nested list - ``print_results`` - (default= ``True``) prints test output to stdout - ``failure_tests`` - (default= ``False``) indicates if these tests are expected to fail parsing - ``post_parse`` - (default= ``None``) optional callback for successful parse results; called as `fn(test_string, parse_results)` and returns a string to be added to the test output - ``file`` - (default= ``None``) optional file-like object to which test output will be written; if None, will default to ``sys.stdout`` - ``with_line_numbers`` - default= ``False``) show test strings with line and column numbers Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if ``failure_tests`` is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.run_tests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.run_tests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failure_tests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.run_tests(r"this is a test\\n of strings that spans \\n 3 lines") (Note that this is a raw string literal, you must include the leading ``'r'``.) """ from .testing import pyparsing_test parseAll = parseAll and parse_all fullDump = fullDump and full_dump printResults = printResults and print_results failureTests = failureTests or failure_tests postParse = postParse or post_parse if isinstance(tests, str_type): line_strip = type(tests).strip tests = [line_strip(test_line) for test_line in tests.rstrip().splitlines()] if isinstance(comment, str_type): comment = Literal(comment) if file is None: file = sys.stdout print_ = file.write result: Union[ParseResults, Exception] allResults = [] comments = [] success = True NL = Literal(r"\n").add_parse_action(replace_with("\n")).ignore(quoted_string) BOM = "\ufeff" for t in tests: if comment is not None and comment.matches(t, False) or comments and not t: comments.append( pyparsing_test.with_line_numbers(t) if with_line_numbers else t ) continue if not t: continue out = [ "\n" + "\n".join(comments) if comments else "", pyparsing_test.with_line_numbers(t) if with_line_numbers else t, ] comments = [] try: # convert newline marks to actual newlines, and strip leading BOM if present t = NL.transform_string(t.lstrip(BOM)) result = self.parse_string(t, parse_all=parseAll) except ParseBaseException as pe: fatal = "(FATAL)" if isinstance(pe, ParseFatalException) else "" out.append(pe.explain()) out.append("FAIL: " + str(pe)) if ParserElement.verbose_stacktrace: out.extend(traceback.format_tb(pe.__traceback__)) success = success and failureTests result = pe except Exception as exc: out.append("FAIL-EXCEPTION: {}: {}".format(type(exc).__name__, exc)) if ParserElement.verbose_stacktrace: out.extend(traceback.format_tb(exc.__traceback__)) success = success and failureTests result = exc else: success = success and not failureTests if postParse is not None: try: pp_value = postParse(t, result) if pp_value is not None: if isinstance(pp_value, ParseResults): out.append(pp_value.dump()) else: out.append(str(pp_value)) else: out.append(result.dump()) except Exception as e: out.append(result.dump(full=fullDump)) out.append( "{} failed: {}: {}".format( postParse.__name__, type(e).__name__, e ) ) else: out.append(result.dump(full=fullDump)) out.append("") if printResults: print_("\n".join(out)) allResults.append((t, result)) return success, allResults def create_diagram( self, output_html: Union[TextIO, Path, str], vertical: int = 3, show_results_names: bool = False, show_groups: bool = False, **kwargs, ) -> None: """ Create a railroad diagram for the parser. Parameters: - output_html (str or file-like object) - output target for generated diagram HTML - vertical (int) - threshold for formatting multiple alternatives vertically instead of horizontally (default=3) - show_results_names - bool flag whether diagram should show annotations for defined results names - show_groups - bool flag whether groups should be highlighted with an unlabeled surrounding box Additional diagram-formatting keyword arguments can also be included; see railroad.Diagram class. """ try: from .diagram import to_railroad, railroad_to_html except ImportError as ie: raise Exception( "must ``pip install pyparsing[diagrams]`` to generate parser railroad diagrams" ) from ie self.streamline() railroad = to_railroad( self, vertical=vertical, show_results_names=show_results_names, show_groups=show_groups, diagram_kwargs=kwargs, ) if isinstance(output_html, (str, Path)): with open(output_html, "w", encoding="utf-8") as diag_file: diag_file.write(railroad_to_html(railroad)) else: # we were passed a file-like object, just write to it output_html.write(railroad_to_html(railroad)) setDefaultWhitespaceChars = set_default_whitespace_chars inlineLiteralsUsing = inline_literals_using setResultsName = set_results_name setBreak = set_break setParseAction = set_parse_action addParseAction = add_parse_action addCondition = add_condition setFailAction = set_fail_action tryParse = try_parse canParseNext = can_parse_next resetCache = reset_cache enableLeftRecursion = enable_left_recursion enablePackrat = enable_packrat parseString = parse_string scanString = scan_string searchString = search_string transformString = transform_string setWhitespaceChars = set_whitespace_chars parseWithTabs = parse_with_tabs setDebugActions = set_debug_actions setDebug = set_debug defaultName = default_name setName = set_name parseFile = parse_file runTests = run_tests ignoreWhitespace = ignore_whitespace leaveWhitespace = leave_whitespace class _PendingSkip(ParserElement): # internal placeholder class to hold a place were '...' is added to a parser element, # once another ParserElement is added, this placeholder will be replaced with a SkipTo def __init__(self, expr: ParserElement, must_skip: bool = False): super().__init__() self.anchor = expr self.must_skip = must_skip def _generateDefaultName(self): return str(self.anchor + Empty()).replace("Empty", "...") def __add__(self, other) -> "ParserElement": skipper = SkipTo(other).set_name("...")("_skipped*") if self.must_skip: def must_skip(t): if not t._skipped or t._skipped.as_list() == [""]: del t[0] t.pop("_skipped", None) def show_skip(t): if t._skipped.as_list()[-1:] == [""]: t.pop("_skipped") t["_skipped"] = "missing <" + repr(self.anchor) + ">" return ( self.anchor + skipper().add_parse_action(must_skip) | skipper().add_parse_action(show_skip) ) + other return self.anchor + skipper + other def __repr__(self): return self.defaultName def parseImpl(self, *args): raise Exception( "use of `...` expression without following SkipTo target expression" ) class Token(ParserElement): """Abstract :class:`ParserElement` subclass, for defining atomic matching patterns. """ def __init__(self): super().__init__(savelist=False) def _generateDefaultName(self): return type(self).__name__ class Empty(Token): """ An empty token, will always match. """ def __init__(self): super().__init__() self.mayReturnEmpty = True self.mayIndexError = False class NoMatch(Token): """ A token that will never match. """ def __init__(self): super().__init__() self.mayReturnEmpty = True self.mayIndexError = False self.errmsg = "Unmatchable token" def parseImpl(self, instring, loc, doActions=True): raise ParseException(instring, loc, self.errmsg, self) class Literal(Token): """ Token to exactly match a specified string. Example:: Literal('blah').parse_string('blah') # -> ['blah'] Literal('blah').parse_string('blahfooblah') # -> ['blah'] Literal('blah').parse_string('bla') # -> Exception: Expected "blah" For case-insensitive matching, use :class:`CaselessLiteral`. For keyword matching (force word break before and after the matched string), use :class:`Keyword` or :class:`CaselessKeyword`. """ def __init__(self, match_string: str = "", *, matchString: str = ""): super().__init__() match_string = matchString or match_string self.match = match_string self.matchLen = len(match_string) try: self.firstMatchChar = match_string[0] except IndexError: raise ValueError("null string passed to Literal; use Empty() instead") self.errmsg = "Expected " + self.name self.mayReturnEmpty = False self.mayIndexError = False # Performance tuning: modify __class__ to select # a parseImpl optimized for single-character check if self.matchLen == 1 and type(self) is Literal: self.__class__ = _SingleCharLiteral def _generateDefaultName(self): return repr(self.match) def parseImpl(self, instring, loc, doActions=True): if instring[loc] == self.firstMatchChar and instring.startswith( self.match, loc ): return loc + self.matchLen, self.match raise ParseException(instring, loc, self.errmsg, self) class _SingleCharLiteral(Literal): def parseImpl(self, instring, loc, doActions=True): if instring[loc] == self.firstMatchChar: return loc + 1, self.match raise ParseException(instring, loc, self.errmsg, self) ParserElement._literalStringClass = Literal class Keyword(Token): """ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with :class:`Literal`: - ``Literal("if")`` will match the leading ``'if'`` in ``'ifAndOnlyIf'``. - ``Keyword("if")`` will not; it will only match the leading ``'if'`` in ``'if x=1'``, or ``'if(y==2)'`` Accepts two optional constructor arguments in addition to the keyword string: - ``identChars`` is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - ``caseless`` allows case-insensitive matching, default is ``False``. Example:: Keyword("start").parse_string("start") # -> ['start'] Keyword("start").parse_string("starting") # -> Exception For case-insensitive matching, use :class:`CaselessKeyword`. """ DEFAULT_KEYWORD_CHARS = alphanums + "_$" def __init__( self, match_string: str = "", ident_chars: typing.Optional[str] = None, caseless: bool = False, *, matchString: str = "", identChars: typing.Optional[str] = None, ): super().__init__() identChars = identChars or ident_chars if identChars is None: identChars = Keyword.DEFAULT_KEYWORD_CHARS match_string = matchString or match_string self.match = match_string self.matchLen = len(match_string) try: self.firstMatchChar = match_string[0] except IndexError: raise ValueError("null string passed to Keyword; use Empty() instead") self.errmsg = "Expected {} {}".format(type(self).__name__, self.name) self.mayReturnEmpty = False self.mayIndexError = False self.caseless = caseless if caseless: self.caselessmatch = match_string.upper() identChars = identChars.upper() self.identChars = set(identChars) def _generateDefaultName(self): return repr(self.match) def parseImpl(self, instring, loc, doActions=True): errmsg = self.errmsg errloc = loc if self.caseless: if instring[loc : loc + self.matchLen].upper() == self.caselessmatch: if loc == 0 or instring[loc - 1].upper() not in self.identChars: if ( loc >= len(instring) - self.matchLen or instring[loc + self.matchLen].upper() not in self.identChars ): return loc + self.matchLen, self.match else: # followed by keyword char errmsg += ", was immediately followed by keyword character" errloc = loc + self.matchLen else: # preceded by keyword char errmsg += ", keyword was immediately preceded by keyword character" errloc = loc - 1 # else no match just raise plain exception else: if ( instring[loc] == self.firstMatchChar and self.matchLen == 1 or instring.startswith(self.match, loc) ): if loc == 0 or instring[loc - 1] not in self.identChars: if ( loc >= len(instring) - self.matchLen or instring[loc + self.matchLen] not in self.identChars ): return loc + self.matchLen, self.match else: # followed by keyword char errmsg += ( ", keyword was immediately followed by keyword character" ) errloc = loc + self.matchLen else: # preceded by keyword char errmsg += ", keyword was immediately preceded by keyword character" errloc = loc - 1 # else no match just raise plain exception raise ParseException(instring, errloc, errmsg, self) @staticmethod def set_default_keyword_chars(chars) -> None: """ Overrides the default characters used by :class:`Keyword` expressions. """ Keyword.DEFAULT_KEYWORD_CHARS = chars setDefaultKeywordChars = set_default_keyword_chars class CaselessLiteral(Literal): """ Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: CaselessLiteral("CMD")[1, ...].parse_string("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for :class:`CaselessKeyword`.) """ def __init__(self, match_string: str = "", *, matchString: str = ""): match_string = matchString or match_string super().__init__(match_string.upper()) # Preserve the defining literal. self.returnString = match_string self.errmsg = "Expected " + self.name def parseImpl(self, instring, loc, doActions=True): if instring[loc : loc + self.matchLen].upper() == self.match: return loc + self.matchLen, self.returnString raise ParseException(instring, loc, self.errmsg, self) class CaselessKeyword(Keyword): """ Caseless version of :class:`Keyword`. Example:: CaselessKeyword("CMD")[1, ...].parse_string("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for :class:`CaselessLiteral`.) """ def __init__( self, match_string: str = "", ident_chars: typing.Optional[str] = None, *, matchString: str = "", identChars: typing.Optional[str] = None, ): identChars = identChars or ident_chars match_string = matchString or match_string super().__init__(match_string, identChars, caseless=True) class CloseMatch(Token): """A variation on :class:`Literal` which matches "close" matches, that is, strings with at most 'n' mismatching characters. :class:`CloseMatch` takes parameters: - ``match_string`` - string to be matched - ``caseless`` - a boolean indicating whether to ignore casing when comparing characters - ``max_mismatches`` - (``default=1``) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - ``mismatches`` - a list of the positions within the match_string where mismatches were found - ``original`` - the original match_string used to compare against the input string If ``mismatches`` is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parse_string("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parse_string("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parse_string("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", max_mismatches=2) patt.parse_string("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) """ def __init__( self, match_string: str, max_mismatches: int = None, *, maxMismatches: int = 1, caseless=False, ): maxMismatches = max_mismatches if max_mismatches is not None else maxMismatches super().__init__() self.match_string = match_string self.maxMismatches = maxMismatches self.errmsg = "Expected {!r} (with up to {} mismatches)".format( self.match_string, self.maxMismatches ) self.caseless = caseless self.mayIndexError = False self.mayReturnEmpty = False def _generateDefaultName(self): return "{}:{!r}".format(type(self).__name__, self.match_string) def parseImpl(self, instring, loc, doActions=True): start = loc instrlen = len(instring) maxloc = start + len(self.match_string) if maxloc <= instrlen: match_string = self.match_string match_stringloc = 0 mismatches = [] maxMismatches = self.maxMismatches for match_stringloc, s_m in enumerate( zip(instring[loc:maxloc], match_string) ): src, mat = s_m if self.caseless: src, mat = src.lower(), mat.lower() if src != mat: mismatches.append(match_stringloc) if len(mismatches) > maxMismatches: break else: loc = start + match_stringloc + 1 results = ParseResults([instring[start:loc]]) results["original"] = match_string results["mismatches"] = mismatches return loc, results raise ParseException(instring, loc, self.errmsg, self) class Word(Token): """Token for matching words composed of allowed character sets. Parameters: - ``init_chars`` - string of all characters that should be used to match as a word; "ABC" will match "AAA", "ABAB", "CBAC", etc.; if ``body_chars`` is also specified, then this is the string of initial characters - ``body_chars`` - string of characters that can be used for matching after a matched initial character as given in ``init_chars``; if omitted, same as the initial characters (default=``None``) - ``min`` - minimum number of characters to match (default=1) - ``max`` - maximum number of characters to match (default=0) - ``exact`` - exact number of characters to match (default=0) - ``as_keyword`` - match as a keyword (default=``False``) - ``exclude_chars`` - characters that might be found in the input ``body_chars`` string but which should not be accepted for matching ;useful to define a word of all printables except for one or two characters, for instance (default=``None``) :class:`srange` is useful for defining custom character set strings for defining :class:`Word` expressions, using range notation from regular expression character sets. A common mistake is to use :class:`Word` to match a specific literal string, as in ``Word("Address")``. Remember that :class:`Word` uses the string argument to define *sets* of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use :class:`Literal` or :class:`Keyword`. pyparsing includes helper strings for building Words: - :class:`alphas` - :class:`nums` - :class:`alphanums` - :class:`hexnums` - :class:`alphas8bit` (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - :class:`punc8bit` (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - :class:`printables` (any non-whitespace character) ``alphas``, ``nums``, and ``printables`` are also defined in several Unicode sets - see :class:`pyparsing_unicode``. Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums + '-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, exclude_chars=",") """ def __init__( self, init_chars: str = "", body_chars: typing.Optional[str] = None, min: int = 1, max: int = 0, exact: int = 0, as_keyword: bool = False, exclude_chars: typing.Optional[str] = None, *, initChars: typing.Optional[str] = None, bodyChars: typing.Optional[str] = None, asKeyword: bool = False, excludeChars: typing.Optional[str] = None, ): initChars = initChars or init_chars bodyChars = bodyChars or body_chars asKeyword = asKeyword or as_keyword excludeChars = excludeChars or exclude_chars super().__init__() if not initChars: raise ValueError( "invalid {}, initChars cannot be empty string".format( type(self).__name__ ) ) initChars = set(initChars) self.initChars = initChars if excludeChars: excludeChars = set(excludeChars) initChars -= excludeChars if bodyChars: bodyChars = set(bodyChars) - excludeChars self.initCharsOrig = "".join(sorted(initChars)) if bodyChars: self.bodyCharsOrig = "".join(sorted(bodyChars)) self.bodyChars = set(bodyChars) else: self.bodyCharsOrig = "".join(sorted(initChars)) self.bodyChars = set(initChars) self.maxSpecified = max > 0 if min < 1: raise ValueError( "cannot specify a minimum length < 1; use Opt(Word()) if zero-length word is permitted" ) self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact self.errmsg = "Expected " + self.name self.mayIndexError = False self.asKeyword = asKeyword # see if we can make a regex for this Word if " " not in self.initChars | self.bodyChars and (min == 1 and exact == 0): if self.bodyChars == self.initChars: if max == 0: repeat = "+" elif max == 1: repeat = "" else: repeat = "{{{},{}}}".format( self.minLen, "" if self.maxLen == _MAX_INT else self.maxLen ) self.reString = "[{}]{}".format( _collapse_string_to_ranges(self.initChars), repeat, ) elif len(self.initChars) == 1: if max == 0: repeat = "*" else: repeat = "{{0,{}}}".format(max - 1) self.reString = "{}[{}]{}".format( re.escape(self.initCharsOrig), _collapse_string_to_ranges(self.bodyChars), repeat, ) else: if max == 0: repeat = "*" elif max == 2: repeat = "" else: repeat = "{{0,{}}}".format(max - 1) self.reString = "[{}][{}]{}".format( _collapse_string_to_ranges(self.initChars), _collapse_string_to_ranges(self.bodyChars), repeat, ) if self.asKeyword: self.reString = r"\b" + self.reString + r"\b" try: self.re = re.compile(self.reString) except re.error: self.re = None else: self.re_match = self.re.match self.__class__ = _WordRegex def _generateDefaultName(self): def charsAsStr(s): max_repr_len = 16 s = _collapse_string_to_ranges(s, re_escape=False) if len(s) > max_repr_len: return s[: max_repr_len - 3] + "..." else: return s if self.initChars != self.bodyChars: base = "W:({}, {})".format( charsAsStr(self.initChars), charsAsStr(self.bodyChars) ) else: base = "W:({})".format(charsAsStr(self.initChars)) # add length specification if self.minLen > 1 or self.maxLen != _MAX_INT: if self.minLen == self.maxLen: if self.minLen == 1: return base[2:] else: return base + "{{{}}}".format(self.minLen) elif self.maxLen == _MAX_INT: return base + "{{{},...}}".format(self.minLen) else: return base + "{{{},{}}}".format(self.minLen, self.maxLen) return base def parseImpl(self, instring, loc, doActions=True): if instring[loc] not in self.initChars: raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 instrlen = len(instring) bodychars = self.bodyChars maxloc = start + self.maxLen maxloc = min(maxloc, instrlen) while loc < maxloc and instring[loc] in bodychars: loc += 1 throwException = False if loc - start < self.minLen: throwException = True elif self.maxSpecified and loc < instrlen and instring[loc] in bodychars: throwException = True elif self.asKeyword: if ( start > 0 and instring[start - 1] in bodychars or loc < instrlen and instring[loc] in bodychars ): throwException = True if throwException: raise ParseException(instring, loc, self.errmsg, self) return loc, instring[start:loc] class _WordRegex(Word): def parseImpl(self, instring, loc, doActions=True): result = self.re_match(instring, loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() return loc, result.group() class Char(_WordRegex): """A short-cut class for defining :class:`Word` ``(characters, exact=1)``, when defining a match of any single character in a string of characters. """ def __init__( self, charset: str, as_keyword: bool = False, exclude_chars: typing.Optional[str] = None, *, asKeyword: bool = False, excludeChars: typing.Optional[str] = None, ): asKeyword = asKeyword or as_keyword excludeChars = excludeChars or exclude_chars super().__init__( charset, exact=1, asKeyword=asKeyword, excludeChars=excludeChars ) self.reString = "[{}]".format(_collapse_string_to_ranges(self.initChars)) if asKeyword: self.reString = r"\b{}\b".format(self.reString) self.re = re.compile(self.reString) self.re_match = self.re.match class Regex(Token): r"""Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the stdlib Python `re module `_. If the given regex contains named groups (defined using ``(?P...)``), these will be preserved as named :class:`ParseResults`. If instead of the Python stdlib ``re`` module you wish to use a different RE module (such as the ``regex`` module), you can do so by building your ``Regex`` object with a compiled RE that was compiled using ``regex``. Example:: realnum = Regex(r"[+-]?\d+\.\d*") # ref: https://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") # named fields in a regex will be returned as named results date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # the Regex class will accept re's compiled using the regex module import regex parser = pp.Regex(regex.compile(r'[0-9]')) """ def __init__( self, pattern: Any, flags: Union[re.RegexFlag, int] = 0, as_group_list: bool = False, as_match: bool = False, *, asGroupList: bool = False, asMatch: bool = False, ): """The parameters ``pattern`` and ``flags`` are passed to the ``re.compile()`` function as-is. See the Python `re module `_ module for an explanation of the acceptable patterns and flags. """ super().__init__() asGroupList = asGroupList or as_group_list asMatch = asMatch or as_match if isinstance(pattern, str_type): if not pattern: raise ValueError("null string passed to Regex; use Empty() instead") self._re = None self.reString = self.pattern = pattern self.flags = flags elif hasattr(pattern, "pattern") and hasattr(pattern, "match"): self._re = pattern self.pattern = self.reString = pattern.pattern self.flags = flags else: raise TypeError( "Regex may only be constructed with a string or a compiled RE object" ) self.errmsg = "Expected " + self.name self.mayIndexError = False self.asGroupList = asGroupList self.asMatch = asMatch if self.asGroupList: self.parseImpl = self.parseImplAsGroupList if self.asMatch: self.parseImpl = self.parseImplAsMatch @cached_property def re(self): if self._re: return self._re else: try: return re.compile(self.pattern, self.flags) except re.error: raise ValueError( "invalid pattern ({!r}) passed to Regex".format(self.pattern) ) @cached_property def re_match(self): return self.re.match @cached_property def mayReturnEmpty(self): return self.re_match("") is not None def _generateDefaultName(self): return "Re:({})".format(repr(self.pattern).replace("\\\\", "\\")) def parseImpl(self, instring, loc, doActions=True): result = self.re_match(instring, loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() ret = ParseResults(result.group()) d = result.groupdict() if d: for k, v in d.items(): ret[k] = v return loc, ret def parseImplAsGroupList(self, instring, loc, doActions=True): result = self.re_match(instring, loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() ret = result.groups() return loc, ret def parseImplAsMatch(self, instring, loc, doActions=True): result = self.re_match(instring, loc) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() ret = result return loc, ret def sub(self, repl: str) -> ParserElement: r""" Return :class:`Regex` with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string) `_. Example:: make_html = Regex(r"(\w+):(.*?):").sub(r"<\1>\2") print(make_html.transform_string("h1:main title:")) # prints "

main title

" """ if self.asGroupList: raise TypeError("cannot use sub() with Regex(asGroupList=True)") if self.asMatch and callable(repl): raise TypeError("cannot use sub() with a callable with Regex(asMatch=True)") if self.asMatch: def pa(tokens): return tokens[0].expand(repl) else: def pa(tokens): return self.re.sub(repl, tokens[0]) return self.add_parse_action(pa) class QuotedString(Token): r""" Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - ``quote_char`` - string of one or more characters defining the quote delimiting string - ``esc_char`` - character to re_escape quotes, typically backslash (default= ``None``) - ``esc_quote`` - special quote sequence to re_escape an embedded quote string (such as SQL's ``""`` to re_escape an embedded ``"``) (default= ``None``) - ``multiline`` - boolean indicating whether quotes can span multiple lines (default= ``False``) - ``unquote_results`` - boolean indicating whether the matched text should be unquoted (default= ``True``) - ``end_quote_char`` - string of one or more characters defining the end of the quote delimited string (default= ``None`` => same as quote_char) - ``convert_whitespace_escapes`` - convert escaped whitespace (``'\t'``, ``'\n'``, etc.) to actual whitespace (default= ``True``) Example:: qs = QuotedString('"') print(qs.search_string('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', end_quote_char='}}') print(complex_qs.search_string('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', esc_quote='""') print(sql_qs.search_string('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] """ ws_map = ((r"\t", "\t"), (r"\n", "\n"), (r"\f", "\f"), (r"\r", "\r")) def __init__( self, quote_char: str = "", esc_char: typing.Optional[str] = None, esc_quote: typing.Optional[str] = None, multiline: bool = False, unquote_results: bool = True, end_quote_char: typing.Optional[str] = None, convert_whitespace_escapes: bool = True, *, quoteChar: str = "", escChar: typing.Optional[str] = None, escQuote: typing.Optional[str] = None, unquoteResults: bool = True, endQuoteChar: typing.Optional[str] = None, convertWhitespaceEscapes: bool = True, ): super().__init__() escChar = escChar or esc_char escQuote = escQuote or esc_quote unquoteResults = unquoteResults and unquote_results endQuoteChar = endQuoteChar or end_quote_char convertWhitespaceEscapes = ( convertWhitespaceEscapes and convert_whitespace_escapes ) quote_char = quoteChar or quote_char # remove white space from quote chars - wont work anyway quote_char = quote_char.strip() if not quote_char: raise ValueError("quote_char cannot be the empty string") if endQuoteChar is None: endQuoteChar = quote_char else: endQuoteChar = endQuoteChar.strip() if not endQuoteChar: raise ValueError("endQuoteChar cannot be the empty string") self.quoteChar = quote_char self.quoteCharLen = len(quote_char) self.firstQuoteChar = quote_char[0] self.endQuoteChar = endQuoteChar self.endQuoteCharLen = len(endQuoteChar) self.escChar = escChar self.escQuote = escQuote self.unquoteResults = unquoteResults self.convertWhitespaceEscapes = convertWhitespaceEscapes sep = "" inner_pattern = "" if escQuote: inner_pattern += r"{}(?:{})".format(sep, re.escape(escQuote)) sep = "|" if escChar: inner_pattern += r"{}(?:{}.)".format(sep, re.escape(escChar)) sep = "|" self.escCharReplacePattern = re.escape(self.escChar) + "(.)" if len(self.endQuoteChar) > 1: inner_pattern += ( "{}(?:".format(sep) + "|".join( "(?:{}(?!{}))".format( re.escape(self.endQuoteChar[:i]), re.escape(self.endQuoteChar[i:]), ) for i in range(len(self.endQuoteChar) - 1, 0, -1) ) + ")" ) sep = "|" if multiline: self.flags = re.MULTILINE | re.DOTALL inner_pattern += r"{}(?:[^{}{}])".format( sep, _escape_regex_range_chars(self.endQuoteChar[0]), (_escape_regex_range_chars(escChar) if escChar is not None else ""), ) else: self.flags = 0 inner_pattern += r"{}(?:[^{}\n\r{}])".format( sep, _escape_regex_range_chars(self.endQuoteChar[0]), (_escape_regex_range_chars(escChar) if escChar is not None else ""), ) self.pattern = "".join( [ re.escape(self.quoteChar), "(?:", inner_pattern, ")*", re.escape(self.endQuoteChar), ] ) try: self.re = re.compile(self.pattern, self.flags) self.reString = self.pattern self.re_match = self.re.match except re.error: raise ValueError( "invalid pattern {!r} passed to Regex".format(self.pattern) ) self.errmsg = "Expected " + self.name self.mayIndexError = False self.mayReturnEmpty = True def _generateDefaultName(self): if self.quoteChar == self.endQuoteChar and isinstance(self.quoteChar, str_type): return "string enclosed in {!r}".format(self.quoteChar) return "quoted string, starting with {} ending with {}".format( self.quoteChar, self.endQuoteChar ) def parseImpl(self, instring, loc, doActions=True): result = ( instring[loc] == self.firstQuoteChar and self.re_match(instring, loc) or None ) if not result: raise ParseException(instring, loc, self.errmsg, self) loc = result.end() ret = result.group() if self.unquoteResults: # strip off quotes ret = ret[self.quoteCharLen : -self.endQuoteCharLen] if isinstance(ret, str_type): # replace escaped whitespace if "\\" in ret and self.convertWhitespaceEscapes: for wslit, wschar in self.ws_map: ret = ret.replace(wslit, wschar) # replace escaped characters if self.escChar: ret = re.sub(self.escCharReplacePattern, r"\g<1>", ret) # replace escaped quotes if self.escQuote: ret = ret.replace(self.escQuote, self.endQuoteChar) return loc, ret class CharsNotIn(Token): """Token for matching words composed of characters *not* in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimited_list(csv_value).parse_string("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] """ def __init__( self, not_chars: str = "", min: int = 1, max: int = 0, exact: int = 0, *, notChars: str = "", ): super().__init__() self.skipWhitespace = False self.notChars = not_chars or notChars self.notCharsSet = set(self.notChars) if min < 1: raise ValueError( "cannot specify a minimum length < 1; use " "Opt(CharsNotIn()) if zero-length char group is permitted" ) self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact self.errmsg = "Expected " + self.name self.mayReturnEmpty = self.minLen == 0 self.mayIndexError = False def _generateDefaultName(self): not_chars_str = _collapse_string_to_ranges(self.notChars) if len(not_chars_str) > 16: return "!W:({}...)".format(self.notChars[: 16 - 3]) else: return "!W:({})".format(self.notChars) def parseImpl(self, instring, loc, doActions=True): notchars = self.notCharsSet if instring[loc] in notchars: raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 maxlen = min(start + self.maxLen, len(instring)) while loc < maxlen and instring[loc] not in notchars: loc += 1 if loc - start < self.minLen: raise ParseException(instring, loc, self.errmsg, self) return loc, instring[start:loc] class White(Token): """Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is ``" \\t\\r\\n"``. Also takes optional ``min``, ``max``, and ``exact`` arguments, as defined for the :class:`Word` class. """ whiteStrs = { " ": "", "\t": "", "\n": "", "\r": "", "\f": "", "\u00A0": "", "\u1680": "", "\u180E": "", "\u2000": "", "\u2001": "", "\u2002": "", "\u2003": "", "\u2004": "", "\u2005": "", "\u2006": "", "\u2007": "", "\u2008": "", "\u2009": "", "\u200A": "", "\u200B": "", "\u202F": "", "\u205F": "", "\u3000": "", } def __init__(self, ws: str = " \t\r\n", min: int = 1, max: int = 0, exact: int = 0): super().__init__() self.matchWhite = ws self.set_whitespace_chars( "".join(c for c in self.whiteStrs if c not in self.matchWhite), copy_defaults=True, ) # self.leave_whitespace() self.mayReturnEmpty = True self.errmsg = "Expected " + self.name self.minLen = min if max > 0: self.maxLen = max else: self.maxLen = _MAX_INT if exact > 0: self.maxLen = exact self.minLen = exact def _generateDefaultName(self): return "".join(White.whiteStrs[c] for c in self.matchWhite) def parseImpl(self, instring, loc, doActions=True): if instring[loc] not in self.matchWhite: raise ParseException(instring, loc, self.errmsg, self) start = loc loc += 1 maxloc = start + self.maxLen maxloc = min(maxloc, len(instring)) while loc < maxloc and instring[loc] in self.matchWhite: loc += 1 if loc - start < self.minLen: raise ParseException(instring, loc, self.errmsg, self) return loc, instring[start:loc] class PositionToken(Token): def __init__(self): super().__init__() self.mayReturnEmpty = True self.mayIndexError = False class GoToColumn(PositionToken): """Token to advance to a specific column of input text; useful for tabular report scraping. """ def __init__(self, colno: int): super().__init__() self.col = colno def preParse(self, instring, loc): if col(loc, instring) != self.col: instrlen = len(instring) if self.ignoreExprs: loc = self._skipIgnorables(instring, loc) while ( loc < instrlen and instring[loc].isspace() and col(loc, instring) != self.col ): loc += 1 return loc def parseImpl(self, instring, loc, doActions=True): thiscol = col(loc, instring) if thiscol > self.col: raise ParseException(instring, loc, "Text not in expected column", self) newloc = loc + self.col - thiscol ret = instring[loc:newloc] return newloc, ret class LineStart(PositionToken): r"""Matches if current position is at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).search_string(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] """ def __init__(self): super().__init__() self.leave_whitespace() self.orig_whiteChars = set() | self.whiteChars self.whiteChars.discard("\n") self.skipper = Empty().set_whitespace_chars(self.whiteChars) self.errmsg = "Expected start of line" def preParse(self, instring, loc): if loc == 0: return loc else: ret = self.skipper.preParse(instring, loc) if "\n" in self.orig_whiteChars: while instring[ret : ret + 1] == "\n": ret = self.skipper.preParse(instring, ret + 1) return ret def parseImpl(self, instring, loc, doActions=True): if col(loc, instring) == 1: return loc, [] raise ParseException(instring, loc, self.errmsg, self) class LineEnd(PositionToken): """Matches if current position is at the end of a line within the parse string """ def __init__(self): super().__init__() self.whiteChars.discard("\n") self.set_whitespace_chars(self.whiteChars, copy_defaults=False) self.errmsg = "Expected end of line" def parseImpl(self, instring, loc, doActions=True): if loc < len(instring): if instring[loc] == "\n": return loc + 1, "\n" else: raise ParseException(instring, loc, self.errmsg, self) elif loc == len(instring): return loc + 1, [] else: raise ParseException(instring, loc, self.errmsg, self) class StringStart(PositionToken): """Matches if current position is at the beginning of the parse string """ def __init__(self): super().__init__() self.errmsg = "Expected start of text" def parseImpl(self, instring, loc, doActions=True): if loc != 0: # see if entire string up to here is just whitespace and ignoreables if loc != self.preParse(instring, 0): raise ParseException(instring, loc, self.errmsg, self) return loc, [] class StringEnd(PositionToken): """ Matches if current position is at the end of the parse string """ def __init__(self): super().__init__() self.errmsg = "Expected end of text" def parseImpl(self, instring, loc, doActions=True): if loc < len(instring): raise ParseException(instring, loc, self.errmsg, self) elif loc == len(instring): return loc + 1, [] elif loc > len(instring): return loc, [] else: raise ParseException(instring, loc, self.errmsg, self) class WordStart(PositionToken): """Matches if the current position is at the beginning of a :class:`Word`, and is not preceded by any character in a given set of ``word_chars`` (default= ``printables``). To emulate the ``\b`` behavior of regular expressions, use ``WordStart(alphanums)``. ``WordStart`` will also match at the beginning of the string being parsed, or at the beginning of a line. """ def __init__(self, word_chars: str = printables, *, wordChars: str = printables): wordChars = word_chars if wordChars == printables else wordChars super().__init__() self.wordChars = set(wordChars) self.errmsg = "Not at the start of a word" def parseImpl(self, instring, loc, doActions=True): if loc != 0: if ( instring[loc - 1] in self.wordChars or instring[loc] not in self.wordChars ): raise ParseException(instring, loc, self.errmsg, self) return loc, [] class WordEnd(PositionToken): """Matches if the current position is at the end of a :class:`Word`, and is not followed by any character in a given set of ``word_chars`` (default= ``printables``). To emulate the ``\b`` behavior of regular expressions, use ``WordEnd(alphanums)``. ``WordEnd`` will also match at the end of the string being parsed, or at the end of a line. """ def __init__(self, word_chars: str = printables, *, wordChars: str = printables): wordChars = word_chars if wordChars == printables else wordChars super().__init__() self.wordChars = set(wordChars) self.skipWhitespace = False self.errmsg = "Not at the end of a word" def parseImpl(self, instring, loc, doActions=True): instrlen = len(instring) if instrlen > 0 and loc < instrlen: if ( instring[loc] in self.wordChars or instring[loc - 1] not in self.wordChars ): raise ParseException(instring, loc, self.errmsg, self) return loc, [] class ParseExpression(ParserElement): """Abstract subclass of ParserElement, for combining and post-processing parsed tokens. """ def __init__(self, exprs: typing.Iterable[ParserElement], savelist: bool = False): super().__init__(savelist) self.exprs: List[ParserElement] if isinstance(exprs, _generatorType): exprs = list(exprs) if isinstance(exprs, str_type): self.exprs = [self._literalStringClass(exprs)] elif isinstance(exprs, ParserElement): self.exprs = [exprs] elif isinstance(exprs, Iterable): exprs = list(exprs) # if sequence of strings provided, wrap with Literal if any(isinstance(expr, str_type) for expr in exprs): exprs = ( self._literalStringClass(e) if isinstance(e, str_type) else e for e in exprs ) self.exprs = list(exprs) else: try: self.exprs = list(exprs) except TypeError: self.exprs = [exprs] self.callPreparse = False def recurse(self) -> Sequence[ParserElement]: return self.exprs[:] def append(self, other) -> ParserElement: self.exprs.append(other) self._defaultName = None return self def leave_whitespace(self, recursive: bool = True) -> ParserElement: """ Extends ``leave_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions. """ super().leave_whitespace(recursive) if recursive: self.exprs = [e.copy() for e in self.exprs] for e in self.exprs: e.leave_whitespace(recursive) return self def ignore_whitespace(self, recursive: bool = True) -> ParserElement: """ Extends ``ignore_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions. """ super().ignore_whitespace(recursive) if recursive: self.exprs = [e.copy() for e in self.exprs] for e in self.exprs: e.ignore_whitespace(recursive) return self def ignore(self, other) -> ParserElement: if isinstance(other, Suppress): if other not in self.ignoreExprs: super().ignore(other) for e in self.exprs: e.ignore(self.ignoreExprs[-1]) else: super().ignore(other) for e in self.exprs: e.ignore(self.ignoreExprs[-1]) return self def _generateDefaultName(self): return "{}:({})".format(self.__class__.__name__, str(self.exprs)) def streamline(self) -> ParserElement: if self.streamlined: return self super().streamline() for e in self.exprs: e.streamline() # collapse nested :class:`And`'s of the form ``And(And(And(a, b), c), d)`` to ``And(a, b, c, d)`` # but only if there are no parse actions or resultsNames on the nested And's # (likewise for :class:`Or`'s and :class:`MatchFirst`'s) if len(self.exprs) == 2: other = self.exprs[0] if ( isinstance(other, self.__class__) and not other.parseAction and other.resultsName is None and not other.debug ): self.exprs = other.exprs[:] + [self.exprs[1]] self._defaultName = None self.mayReturnEmpty |= other.mayReturnEmpty self.mayIndexError |= other.mayIndexError other = self.exprs[-1] if ( isinstance(other, self.__class__) and not other.parseAction and other.resultsName is None and not other.debug ): self.exprs = self.exprs[:-1] + other.exprs[:] self._defaultName = None self.mayReturnEmpty |= other.mayReturnEmpty self.mayIndexError |= other.mayIndexError self.errmsg = "Expected " + str(self) return self def validate(self, validateTrace=None) -> None: tmp = (validateTrace if validateTrace is not None else [])[:] + [self] for e in self.exprs: e.validate(tmp) self._checkRecursion([]) def copy(self) -> ParserElement: ret = super().copy() ret.exprs = [e.copy() for e in self.exprs] return ret def _setResultsName(self, name, listAllMatches=False): if ( __diag__.warn_ungrouped_named_tokens_in_collection and Diagnostics.warn_ungrouped_named_tokens_in_collection not in self.suppress_warnings_ ): for e in self.exprs: if ( isinstance(e, ParserElement) and e.resultsName and Diagnostics.warn_ungrouped_named_tokens_in_collection not in e.suppress_warnings_ ): warnings.warn( "{}: setting results name {!r} on {} expression " "collides with {!r} on contained expression".format( "warn_ungrouped_named_tokens_in_collection", name, type(self).__name__, e.resultsName, ), stacklevel=3, ) return super()._setResultsName(name, listAllMatches) ignoreWhitespace = ignore_whitespace leaveWhitespace = leave_whitespace class And(ParseExpression): """ Requires all given :class:`ParseExpression` s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the ``'+'`` operator. May also be constructed using the ``'-'`` operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = Word(alphas)[1, ...] expr = And([integer("id"), name_expr("name"), integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") """ class _ErrorStop(Empty): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.leave_whitespace() def _generateDefaultName(self): return "-" def __init__( self, exprs_arg: typing.Iterable[ParserElement], savelist: bool = True ): exprs: List[ParserElement] = list(exprs_arg) if exprs and Ellipsis in exprs: tmp = [] for i, expr in enumerate(exprs): if expr is Ellipsis: if i < len(exprs) - 1: skipto_arg: ParserElement = (Empty() + exprs[i + 1]).exprs[-1] tmp.append(SkipTo(skipto_arg)("_skipped*")) else: raise Exception( "cannot construct And with sequence ending in ..." ) else: tmp.append(expr) exprs[:] = tmp super().__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) if not isinstance(self.exprs[0], White): self.set_whitespace_chars( self.exprs[0].whiteChars, copy_defaults=self.exprs[0].copyDefaultWhiteChars, ) self.skipWhitespace = self.exprs[0].skipWhitespace else: self.skipWhitespace = False else: self.mayReturnEmpty = True self.callPreparse = True def streamline(self) -> ParserElement: # collapse any _PendingSkip's if self.exprs: if any( isinstance(e, ParseExpression) and e.exprs and isinstance(e.exprs[-1], _PendingSkip) for e in self.exprs[:-1] ): for i, e in enumerate(self.exprs[:-1]): if e is None: continue if ( isinstance(e, ParseExpression) and e.exprs and isinstance(e.exprs[-1], _PendingSkip) ): e.exprs[-1] = e.exprs[-1] + self.exprs[i + 1] self.exprs[i + 1] = None self.exprs = [e for e in self.exprs if e is not None] super().streamline() # link any IndentedBlocks to the prior expression for prev, cur in zip(self.exprs, self.exprs[1:]): # traverse cur or any first embedded expr of cur looking for an IndentedBlock # (but watch out for recursive grammar) seen = set() while cur: if id(cur) in seen: break seen.add(id(cur)) if isinstance(cur, IndentedBlock): prev.add_parse_action( lambda s, l, t, cur_=cur: setattr( cur_, "parent_anchor", col(l, s) ) ) break subs = cur.recurse() cur = next(iter(subs), None) self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) return self def parseImpl(self, instring, loc, doActions=True): # pass False as callPreParse arg to _parse for first element, since we already # pre-parsed the string as part of our And pre-parsing loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False ) errorStop = False for e in self.exprs[1:]: # if isinstance(e, And._ErrorStop): if type(e) is And._ErrorStop: errorStop = True continue if errorStop: try: loc, exprtokens = e._parse(instring, loc, doActions) except ParseSyntaxException: raise except ParseBaseException as pe: pe.__traceback__ = None raise ParseSyntaxException._from_exception(pe) except IndexError: raise ParseSyntaxException( instring, len(instring), self.errmsg, self ) else: loc, exprtokens = e._parse(instring, loc, doActions) if exprtokens or exprtokens.haskeys(): resultlist += exprtokens return loc, resultlist def __iadd__(self, other): if isinstance(other, str_type): other = self._literalStringClass(other) return self.append(other) # And([self, other]) def _checkRecursion(self, parseElementList): subRecCheckList = parseElementList[:] + [self] for e in self.exprs: e._checkRecursion(subRecCheckList) if not e.mayReturnEmpty: break def _generateDefaultName(self): inner = " ".join(str(e) for e in self.exprs) # strip off redundant inner {}'s while len(inner) > 1 and inner[0 :: len(inner) - 1] == "{}": inner = inner[1:-1] return "{" + inner + "}" class Or(ParseExpression): """Requires that at least one :class:`ParseExpression` is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the ``'^'`` operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.search_string("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] """ def __init__(self, exprs: typing.Iterable[ParserElement], savelist: bool = False): super().__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = all(e.skipWhitespace for e in self.exprs) else: self.mayReturnEmpty = True def streamline(self) -> ParserElement: super().streamline() if self.exprs: self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) self.saveAsList = any(e.saveAsList for e in self.exprs) self.skipWhitespace = all( e.skipWhitespace and not isinstance(e, White) for e in self.exprs ) else: self.saveAsList = False return self def parseImpl(self, instring, loc, doActions=True): maxExcLoc = -1 maxException = None matches = [] fatals = [] if all(e.callPreparse for e in self.exprs): loc = self.preParse(instring, loc) for e in self.exprs: try: loc2 = e.try_parse(instring, loc, raise_fatal=True) except ParseFatalException as pfe: pfe.__traceback__ = None pfe.parserElement = e fatals.append(pfe) maxException = None maxExcLoc = -1 except ParseException as err: if not fatals: err.__traceback__ = None if err.loc > maxExcLoc: maxException = err maxExcLoc = err.loc except IndexError: if len(instring) > maxExcLoc: maxException = ParseException( instring, len(instring), e.errmsg, self ) maxExcLoc = len(instring) else: # save match among all matches, to retry longest to shortest matches.append((loc2, e)) if matches: # re-evaluate all matches in descending order of length of match, in case attached actions # might change whether or how much they match of the input. matches.sort(key=itemgetter(0), reverse=True) if not doActions: # no further conditions or parse actions to change the selection of # alternative, so the first match will be the best match best_expr = matches[0][1] return best_expr._parse(instring, loc, doActions) longest = -1, None for loc1, expr1 in matches: if loc1 <= longest[0]: # already have a longer match than this one will deliver, we are done return longest try: loc2, toks = expr1._parse(instring, loc, doActions) except ParseException as err: err.__traceback__ = None if err.loc > maxExcLoc: maxException = err maxExcLoc = err.loc else: if loc2 >= loc1: return loc2, toks # didn't match as much as before elif loc2 > longest[0]: longest = loc2, toks if longest != (-1, None): return longest if fatals: if len(fatals) > 1: fatals.sort(key=lambda e: -e.loc) if fatals[0].loc == fatals[1].loc: fatals.sort(key=lambda e: (-e.loc, -len(str(e.parserElement)))) max_fatal = fatals[0] raise max_fatal if maxException is not None: maxException.msg = self.errmsg raise maxException else: raise ParseException( instring, loc, "no defined alternatives to match", self ) def __ixor__(self, other): if isinstance(other, str_type): other = self._literalStringClass(other) return self.append(other) # Or([self, other]) def _generateDefaultName(self): return "{" + " ^ ".join(str(e) for e in self.exprs) + "}" def _setResultsName(self, name, listAllMatches=False): if ( __diag__.warn_multiple_tokens_in_named_alternation and Diagnostics.warn_multiple_tokens_in_named_alternation not in self.suppress_warnings_ ): if any( isinstance(e, And) and Diagnostics.warn_multiple_tokens_in_named_alternation not in e.suppress_warnings_ for e in self.exprs ): warnings.warn( "{}: setting results name {!r} on {} expression " "will return a list of all parsed tokens in an And alternative, " "in prior versions only the first token was returned; enclose " "contained argument in Group".format( "warn_multiple_tokens_in_named_alternation", name, type(self).__name__, ), stacklevel=3, ) return super()._setResultsName(name, listAllMatches) class MatchFirst(ParseExpression): """Requires that at least one :class:`ParseExpression` is found. If more than one expression matches, the first one listed is the one that will match. May be constructed using the ``'|'`` operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.search_string("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.search_string("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] """ def __init__(self, exprs: typing.Iterable[ParserElement], savelist: bool = False): super().__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = all(e.skipWhitespace for e in self.exprs) else: self.mayReturnEmpty = True def streamline(self) -> ParserElement: if self.streamlined: return self super().streamline() if self.exprs: self.saveAsList = any(e.saveAsList for e in self.exprs) self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) self.skipWhitespace = all( e.skipWhitespace and not isinstance(e, White) for e in self.exprs ) else: self.saveAsList = False self.mayReturnEmpty = True return self def parseImpl(self, instring, loc, doActions=True): maxExcLoc = -1 maxException = None for e in self.exprs: try: return e._parse( instring, loc, doActions, ) except ParseFatalException as pfe: pfe.__traceback__ = None pfe.parserElement = e raise except ParseException as err: if err.loc > maxExcLoc: maxException = err maxExcLoc = err.loc except IndexError: if len(instring) > maxExcLoc: maxException = ParseException( instring, len(instring), e.errmsg, self ) maxExcLoc = len(instring) if maxException is not None: maxException.msg = self.errmsg raise maxException else: raise ParseException( instring, loc, "no defined alternatives to match", self ) def __ior__(self, other): if isinstance(other, str_type): other = self._literalStringClass(other) return self.append(other) # MatchFirst([self, other]) def _generateDefaultName(self): return "{" + " | ".join(str(e) for e in self.exprs) + "}" def _setResultsName(self, name, listAllMatches=False): if ( __diag__.warn_multiple_tokens_in_named_alternation and Diagnostics.warn_multiple_tokens_in_named_alternation not in self.suppress_warnings_ ): if any( isinstance(e, And) and Diagnostics.warn_multiple_tokens_in_named_alternation not in e.suppress_warnings_ for e in self.exprs ): warnings.warn( "{}: setting results name {!r} on {} expression " "will return a list of all parsed tokens in an And alternative, " "in prior versions only the first token was returned; enclose " "contained argument in Group".format( "warn_multiple_tokens_in_named_alternation", name, type(self).__name__, ), stacklevel=3, ) return super()._setResultsName(name, listAllMatches) class Each(ParseExpression): """Requires all given :class:`ParseExpression` s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the ``'&'`` operator. Example:: color = one_of("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = one_of("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Opt(color_attr) & Opt(size_attr) shape_spec.run_tests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 """ def __init__(self, exprs: typing.Iterable[ParserElement], savelist: bool = True): super().__init__(exprs, savelist) if self.exprs: self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) else: self.mayReturnEmpty = True self.skipWhitespace = True self.initExprGroups = True self.saveAsList = True def streamline(self) -> ParserElement: super().streamline() if self.exprs: self.mayReturnEmpty = all(e.mayReturnEmpty for e in self.exprs) else: self.mayReturnEmpty = True return self def parseImpl(self, instring, loc, doActions=True): if self.initExprGroups: self.opt1map = dict( (id(e.expr), e) for e in self.exprs if isinstance(e, Opt) ) opt1 = [e.expr for e in self.exprs if isinstance(e, Opt)] opt2 = [ e for e in self.exprs if e.mayReturnEmpty and not isinstance(e, (Opt, Regex, ZeroOrMore)) ] self.optionals = opt1 + opt2 self.multioptionals = [ e.expr.set_results_name(e.resultsName, list_all_matches=True) for e in self.exprs if isinstance(e, _MultipleMatch) ] self.multirequired = [ e.expr.set_results_name(e.resultsName, list_all_matches=True) for e in self.exprs if isinstance(e, OneOrMore) ] self.required = [ e for e in self.exprs if not isinstance(e, (Opt, ZeroOrMore, OneOrMore)) ] self.required += self.multirequired self.initExprGroups = False tmpLoc = loc tmpReqd = self.required[:] tmpOpt = self.optionals[:] multis = self.multioptionals[:] matchOrder = [] keepMatching = True failed = [] fatals = [] while keepMatching: tmpExprs = tmpReqd + tmpOpt + multis failed.clear() fatals.clear() for e in tmpExprs: try: tmpLoc = e.try_parse(instring, tmpLoc, raise_fatal=True) except ParseFatalException as pfe: pfe.__traceback__ = None pfe.parserElement = e fatals.append(pfe) failed.append(e) except ParseException: failed.append(e) else: matchOrder.append(self.opt1map.get(id(e), e)) if e in tmpReqd: tmpReqd.remove(e) elif e in tmpOpt: tmpOpt.remove(e) if len(failed) == len(tmpExprs): keepMatching = False # look for any ParseFatalExceptions if fatals: if len(fatals) > 1: fatals.sort(key=lambda e: -e.loc) if fatals[0].loc == fatals[1].loc: fatals.sort(key=lambda e: (-e.loc, -len(str(e.parserElement)))) max_fatal = fatals[0] raise max_fatal if tmpReqd: missing = ", ".join([str(e) for e in tmpReqd]) raise ParseException( instring, loc, "Missing one or more required elements ({})".format(missing), ) # add any unmatched Opts, in case they have default values defined matchOrder += [e for e in self.exprs if isinstance(e, Opt) and e.expr in tmpOpt] total_results = ParseResults([]) for e in matchOrder: loc, results = e._parse(instring, loc, doActions) total_results += results return loc, total_results def _generateDefaultName(self): return "{" + " & ".join(str(e) for e in self.exprs) + "}" class ParseElementEnhance(ParserElement): """Abstract subclass of :class:`ParserElement`, for combining and post-processing parsed tokens. """ def __init__(self, expr: Union[ParserElement, str], savelist: bool = False): super().__init__(savelist) if isinstance(expr, str_type): if issubclass(self._literalStringClass, Token): expr = self._literalStringClass(expr) elif issubclass(type(self), self._literalStringClass): expr = Literal(expr) else: expr = self._literalStringClass(Literal(expr)) self.expr = expr if expr is not None: self.mayIndexError = expr.mayIndexError self.mayReturnEmpty = expr.mayReturnEmpty self.set_whitespace_chars( expr.whiteChars, copy_defaults=expr.copyDefaultWhiteChars ) self.skipWhitespace = expr.skipWhitespace self.saveAsList = expr.saveAsList self.callPreparse = expr.callPreparse self.ignoreExprs.extend(expr.ignoreExprs) def recurse(self) -> Sequence[ParserElement]: return [self.expr] if self.expr is not None else [] def parseImpl(self, instring, loc, doActions=True): if self.expr is not None: return self.expr._parse(instring, loc, doActions, callPreParse=False) else: raise ParseException(instring, loc, "No expression defined", self) def leave_whitespace(self, recursive: bool = True) -> ParserElement: super().leave_whitespace(recursive) if recursive: self.expr = self.expr.copy() if self.expr is not None: self.expr.leave_whitespace(recursive) return self def ignore_whitespace(self, recursive: bool = True) -> ParserElement: super().ignore_whitespace(recursive) if recursive: self.expr = self.expr.copy() if self.expr is not None: self.expr.ignore_whitespace(recursive) return self def ignore(self, other) -> ParserElement: if isinstance(other, Suppress): if other not in self.ignoreExprs: super().ignore(other) if self.expr is not None: self.expr.ignore(self.ignoreExprs[-1]) else: super().ignore(other) if self.expr is not None: self.expr.ignore(self.ignoreExprs[-1]) return self def streamline(self) -> ParserElement: super().streamline() if self.expr is not None: self.expr.streamline() return self def _checkRecursion(self, parseElementList): if self in parseElementList: raise RecursiveGrammarException(parseElementList + [self]) subRecCheckList = parseElementList[:] + [self] if self.expr is not None: self.expr._checkRecursion(subRecCheckList) def validate(self, validateTrace=None) -> None: if validateTrace is None: validateTrace = [] tmp = validateTrace[:] + [self] if self.expr is not None: self.expr.validate(tmp) self._checkRecursion([]) def _generateDefaultName(self): return "{}:({})".format(self.__class__.__name__, str(self.expr)) ignoreWhitespace = ignore_whitespace leaveWhitespace = leave_whitespace class IndentedBlock(ParseElementEnhance): """ Expression to match one or more expressions at a given indentation level. Useful for parsing text where structure is implied by indentation (like Python source code). """ class _Indent(Empty): def __init__(self, ref_col: int): super().__init__() self.errmsg = "expected indent at column {}".format(ref_col) self.add_condition(lambda s, l, t: col(l, s) == ref_col) class _IndentGreater(Empty): def __init__(self, ref_col: int): super().__init__() self.errmsg = "expected indent at column greater than {}".format(ref_col) self.add_condition(lambda s, l, t: col(l, s) > ref_col) def __init__( self, expr: ParserElement, *, recursive: bool = False, grouped: bool = True ): super().__init__(expr, savelist=True) # if recursive: # raise NotImplementedError("IndentedBlock with recursive is not implemented") self._recursive = recursive self._grouped = grouped self.parent_anchor = 1 def parseImpl(self, instring, loc, doActions=True): # advance parse position to non-whitespace by using an Empty() # this should be the column to be used for all subsequent indented lines anchor_loc = Empty().preParse(instring, loc) # see if self.expr matches at the current location - if not it will raise an exception # and no further work is necessary self.expr.try_parse(instring, anchor_loc, doActions) indent_col = col(anchor_loc, instring) peer_detect_expr = self._Indent(indent_col) inner_expr = Empty() + peer_detect_expr + self.expr if self._recursive: sub_indent = self._IndentGreater(indent_col) nested_block = IndentedBlock( self.expr, recursive=self._recursive, grouped=self._grouped ) nested_block.set_debug(self.debug) nested_block.parent_anchor = indent_col inner_expr += Opt(sub_indent + nested_block) inner_expr.set_name(f"inner {hex(id(inner_expr))[-4:].upper()}@{indent_col}") block = OneOrMore(inner_expr) trailing_undent = self._Indent(self.parent_anchor) | StringEnd() if self._grouped: wrapper = Group else: wrapper = lambda expr: expr return (wrapper(block) + Optional(trailing_undent)).parseImpl( instring, anchor_loc, doActions ) class AtStringStart(ParseElementEnhance): """Matches if expression matches at the beginning of the parse string:: AtStringStart(Word(nums)).parse_string("123") # prints ["123"] AtStringStart(Word(nums)).parse_string(" 123") # raises ParseException """ def __init__(self, expr: Union[ParserElement, str]): super().__init__(expr) self.callPreparse = False def parseImpl(self, instring, loc, doActions=True): if loc != 0: raise ParseException(instring, loc, "not found at string start") return super().parseImpl(instring, loc, doActions) class AtLineStart(ParseElementEnhance): r"""Matches if an expression matches at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (AtLineStart('AAA') + restOfLine).search_string(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] """ def __init__(self, expr: Union[ParserElement, str]): super().__init__(expr) self.callPreparse = False def parseImpl(self, instring, loc, doActions=True): if col(loc, instring) != 1: raise ParseException(instring, loc, "not found at line start") return super().parseImpl(instring, loc, doActions) class FollowedBy(ParseElementEnhance): """Lookahead matching of the given parse expression. ``FollowedBy`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. ``FollowedBy`` always returns a null token list. If any results names are defined in the lookahead expression, those *will* be returned for access by name. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) attr_expr[1, ...].parse_string("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] """ def __init__(self, expr: Union[ParserElement, str]): super().__init__(expr) self.mayReturnEmpty = True def parseImpl(self, instring, loc, doActions=True): # by using self._expr.parse and deleting the contents of the returned ParseResults list # we keep any named results that were defined in the FollowedBy expression _, ret = self.expr._parse(instring, loc, doActions=doActions) del ret[:] return loc, ret class PrecededBy(ParseElementEnhance): """Lookbehind matching of the given parse expression. ``PrecededBy`` does not advance the parsing position within the input string, it only verifies that the specified parse expression matches prior to the current position. ``PrecededBy`` always returns a null token list, but if a results name is defined on the given expression, it is returned. Parameters: - expr - expression that must match prior to the current parse location - retreat - (default= ``None``) - (int) maximum number of characters to lookbehind prior to the current parse location If the lookbehind expression is a string, :class:`Literal`, :class:`Keyword`, or a :class:`Word` or :class:`CharsNotIn` with a specified exact or maximum length, then the retreat parameter is not required. Otherwise, retreat must be specified to give a maximum number of characters to look back from the current parse position for a lookbehind match. Example:: # VB-style variable names with type prefixes int_var = PrecededBy("#") + pyparsing_common.identifier str_var = PrecededBy("$") + pyparsing_common.identifier """ def __init__( self, expr: Union[ParserElement, str], retreat: typing.Optional[int] = None ): super().__init__(expr) self.expr = self.expr().leave_whitespace() self.mayReturnEmpty = True self.mayIndexError = False self.exact = False if isinstance(expr, str_type): retreat = len(expr) self.exact = True elif isinstance(expr, (Literal, Keyword)): retreat = expr.matchLen self.exact = True elif isinstance(expr, (Word, CharsNotIn)) and expr.maxLen != _MAX_INT: retreat = expr.maxLen self.exact = True elif isinstance(expr, PositionToken): retreat = 0 self.exact = True self.retreat = retreat self.errmsg = "not preceded by " + str(expr) self.skipWhitespace = False self.parseAction.append(lambda s, l, t: t.__delitem__(slice(None, None))) def parseImpl(self, instring, loc=0, doActions=True): if self.exact: if loc < self.retreat: raise ParseException(instring, loc, self.errmsg) start = loc - self.retreat _, ret = self.expr._parse(instring, start) else: # retreat specified a maximum lookbehind window, iterate test_expr = self.expr + StringEnd() instring_slice = instring[max(0, loc - self.retreat) : loc] last_expr = ParseException(instring, loc, self.errmsg) for offset in range(1, min(loc, self.retreat + 1) + 1): try: # print('trying', offset, instring_slice, repr(instring_slice[loc - offset:])) _, ret = test_expr._parse( instring_slice, len(instring_slice) - offset ) except ParseBaseException as pbe: last_expr = pbe else: break else: raise last_expr return loc, ret class Located(ParseElementEnhance): """ Decorates a returned token with its starting and ending locations in the input string. This helper adds the following results names: - ``locn_start`` - location where matched expression begins - ``locn_end`` - location where matched expression ends - ``value`` - the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parse_with_tabs` Example:: wd = Word(alphas) for match in Located(wd).search_string("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [0, ['ljsdf'], 5] [8, ['lksdjjf'], 15] [18, ['lkkjj'], 23] """ def parseImpl(self, instring, loc, doActions=True): start = loc loc, tokens = self.expr._parse(instring, start, doActions, callPreParse=False) ret_tokens = ParseResults([start, tokens, loc]) ret_tokens["locn_start"] = start ret_tokens["value"] = tokens ret_tokens["locn_end"] = loc if self.resultsName: # must return as a list, so that the name will be attached to the complete group return loc, [ret_tokens] else: return loc, ret_tokens class NotAny(ParseElementEnhance): """ Lookahead to disallow matching with the given parse expression. ``NotAny`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression does *not* match at the current position. Also, ``NotAny`` does *not* skip over leading whitespace. ``NotAny`` always returns a null token list. May be constructed using the ``'~'`` operator. Example:: AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split()) # take care not to mistake keywords for identifiers ident = ~(AND | OR | NOT) + Word(alphas) boolean_term = Opt(NOT) + ident # very crude boolean expression - to support parenthesis groups and # operation hierarchy, use infix_notation boolean_expr = boolean_term + ((AND | OR) + boolean_term)[...] # integers that are followed by "." are actually floats integer = Word(nums) + ~Char(".") """ def __init__(self, expr: Union[ParserElement, str]): super().__init__(expr) # do NOT use self.leave_whitespace(), don't want to propagate to exprs # self.leave_whitespace() self.skipWhitespace = False self.mayReturnEmpty = True self.errmsg = "Found unwanted token, " + str(self.expr) def parseImpl(self, instring, loc, doActions=True): if self.expr.can_parse_next(instring, loc): raise ParseException(instring, loc, self.errmsg, self) return loc, [] def _generateDefaultName(self): return "~{" + str(self.expr) + "}" class _MultipleMatch(ParseElementEnhance): def __init__( self, expr: ParserElement, stop_on: typing.Optional[Union[ParserElement, str]] = None, *, stopOn: typing.Optional[Union[ParserElement, str]] = None, ): super().__init__(expr) stopOn = stopOn or stop_on self.saveAsList = True ender = stopOn if isinstance(ender, str_type): ender = self._literalStringClass(ender) self.stopOn(ender) def stopOn(self, ender) -> ParserElement: if isinstance(ender, str_type): ender = self._literalStringClass(ender) self.not_ender = ~ender if ender is not None else None return self def parseImpl(self, instring, loc, doActions=True): self_expr_parse = self.expr._parse self_skip_ignorables = self._skipIgnorables check_ender = self.not_ender is not None if check_ender: try_not_ender = self.not_ender.tryParse # must be at least one (but first see if we are the stopOn sentinel; # if so, fail) if check_ender: try_not_ender(instring, loc) loc, tokens = self_expr_parse(instring, loc, doActions) try: hasIgnoreExprs = not not self.ignoreExprs while 1: if check_ender: try_not_ender(instring, loc) if hasIgnoreExprs: preloc = self_skip_ignorables(instring, loc) else: preloc = loc loc, tmptokens = self_expr_parse(instring, preloc, doActions) if tmptokens or tmptokens.haskeys(): tokens += tmptokens except (ParseException, IndexError): pass return loc, tokens def _setResultsName(self, name, listAllMatches=False): if ( __diag__.warn_ungrouped_named_tokens_in_collection and Diagnostics.warn_ungrouped_named_tokens_in_collection not in self.suppress_warnings_ ): for e in [self.expr] + self.expr.recurse(): if ( isinstance(e, ParserElement) and e.resultsName and Diagnostics.warn_ungrouped_named_tokens_in_collection not in e.suppress_warnings_ ): warnings.warn( "{}: setting results name {!r} on {} expression " "collides with {!r} on contained expression".format( "warn_ungrouped_named_tokens_in_collection", name, type(self).__name__, e.resultsName, ), stacklevel=3, ) return super()._setResultsName(name, listAllMatches) class OneOrMore(_MultipleMatch): """ Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stop_on - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).set_parse_action(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" attr_expr[1, ...].parse_string(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stop_on attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) OneOrMore(attr_expr).parse_string(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parse_string(text).pprint() """ def _generateDefaultName(self): return "{" + str(self.expr) + "}..." class ZeroOrMore(_MultipleMatch): """ Optional repetition of zero or more of the given expression. Parameters: - ``expr`` - expression that must match zero or more times - ``stop_on`` - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) - (default= ``None``) Example: similar to :class:`OneOrMore` """ def __init__( self, expr: ParserElement, stop_on: typing.Optional[Union[ParserElement, str]] = None, *, stopOn: typing.Optional[Union[ParserElement, str]] = None, ): super().__init__(expr, stopOn=stopOn or stop_on) self.mayReturnEmpty = True def parseImpl(self, instring, loc, doActions=True): try: return super().parseImpl(instring, loc, doActions) except (ParseException, IndexError): return loc, ParseResults([], name=self.resultsName) def _generateDefaultName(self): return "[" + str(self.expr) + "]..." class _NullToken: def __bool__(self): return False def __str__(self): return "" class Opt(ParseElementEnhance): """ Optional matching of the given expression. Parameters: - ``expr`` - expression that must match zero or more times - ``default`` (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Opt('-' + Word(nums, exact=4))) zip.run_tests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) """ __optionalNotMatched = _NullToken() def __init__( self, expr: Union[ParserElement, str], default: Any = __optionalNotMatched ): super().__init__(expr, savelist=False) self.saveAsList = self.expr.saveAsList self.defaultValue = default self.mayReturnEmpty = True def parseImpl(self, instring, loc, doActions=True): self_expr = self.expr try: loc, tokens = self_expr._parse(instring, loc, doActions, callPreParse=False) except (ParseException, IndexError): default_value = self.defaultValue if default_value is not self.__optionalNotMatched: if self_expr.resultsName: tokens = ParseResults([default_value]) tokens[self_expr.resultsName] = default_value else: tokens = [default_value] else: tokens = [] return loc, tokens def _generateDefaultName(self): inner = str(self.expr) # strip off redundant inner {}'s while len(inner) > 1 and inner[0 :: len(inner) - 1] == "{}": inner = inner[1:-1] return "[" + inner + "]" Optional = Opt class SkipTo(ParseElementEnhance): """ Token for skipping over all undefined text until the matched expression is found. Parameters: - ``expr`` - target expression marking the end of the data to be skipped - ``include`` - if ``True``, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list) (default= ``False``). - ``ignore`` - (default= ``None``) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - ``fail_on`` - (default= ``None``) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the :class:`SkipTo` is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quoted_string) string_data.set_parse_action(token_map(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.search_string(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: '6' - desc: 'Intermittent system crash' - issue_num: '101' - sev: 'Critical' ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: '14' - desc: "Spelling error on Login ('log|n')" - issue_num: '94' - sev: 'Cosmetic' ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: '47' - desc: 'System slow when running too many reports' - issue_num: '79' - sev: 'Minor' """ def __init__( self, other: Union[ParserElement, str], include: bool = False, ignore: bool = None, fail_on: typing.Optional[Union[ParserElement, str]] = None, *, failOn: Union[ParserElement, str] = None, ): super().__init__(other) failOn = failOn or fail_on self.ignoreExpr = ignore self.mayReturnEmpty = True self.mayIndexError = False self.includeMatch = include self.saveAsList = False if isinstance(failOn, str_type): self.failOn = self._literalStringClass(failOn) else: self.failOn = failOn self.errmsg = "No match found for " + str(self.expr) def parseImpl(self, instring, loc, doActions=True): startloc = loc instrlen = len(instring) self_expr_parse = self.expr._parse self_failOn_canParseNext = ( self.failOn.canParseNext if self.failOn is not None else None ) self_ignoreExpr_tryParse = ( self.ignoreExpr.tryParse if self.ignoreExpr is not None else None ) tmploc = loc while tmploc <= instrlen: if self_failOn_canParseNext is not None: # break if failOn expression matches if self_failOn_canParseNext(instring, tmploc): break if self_ignoreExpr_tryParse is not None: # advance past ignore expressions while 1: try: tmploc = self_ignoreExpr_tryParse(instring, tmploc) except ParseBaseException: break try: self_expr_parse(instring, tmploc, doActions=False, callPreParse=False) except (ParseException, IndexError): # no match, advance loc in string tmploc += 1 else: # matched skipto expr, done break else: # ran off the end of the input string without matching skipto expr, fail raise ParseException(instring, loc, self.errmsg, self) # build up return values loc = tmploc skiptext = instring[startloc:loc] skipresult = ParseResults(skiptext) if self.includeMatch: loc, mat = self_expr_parse(instring, loc, doActions, callPreParse=False) skipresult += mat return loc, skipresult class Forward(ParseElementEnhance): """ Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the ``Forward`` variable using the ``'<<'`` operator. Note: take care when assigning to ``Forward`` not to overlook precedence of operators. Specifically, ``'|'`` has a lower precedence than ``'<<'``, so that:: fwd_expr << a | b | c will actually be evaluated as:: (fwd_expr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the ``Forward``:: fwd_expr << (a | b | c) Converting to use the ``'<<='`` operator instead will avoid this problem. See :class:`ParseResults.pprint` for an example of a recursive parser created using ``Forward``. """ def __init__(self, other: typing.Optional[Union[ParserElement, str]] = None): self.caller_frame = traceback.extract_stack(limit=2)[0] super().__init__(other, savelist=False) self.lshift_line = None def __lshift__(self, other): if hasattr(self, "caller_frame"): del self.caller_frame if isinstance(other, str_type): other = self._literalStringClass(other) self.expr = other self.mayIndexError = self.expr.mayIndexError self.mayReturnEmpty = self.expr.mayReturnEmpty self.set_whitespace_chars( self.expr.whiteChars, copy_defaults=self.expr.copyDefaultWhiteChars ) self.skipWhitespace = self.expr.skipWhitespace self.saveAsList = self.expr.saveAsList self.ignoreExprs.extend(self.expr.ignoreExprs) self.lshift_line = traceback.extract_stack(limit=2)[-2] return self def __ilshift__(self, other): return self << other def __or__(self, other): caller_line = traceback.extract_stack(limit=2)[-2] if ( __diag__.warn_on_match_first_with_lshift_operator and caller_line == self.lshift_line and Diagnostics.warn_on_match_first_with_lshift_operator not in self.suppress_warnings_ ): warnings.warn( "using '<<' operator with '|' is probably an error, use '<<='", stacklevel=2, ) ret = super().__or__(other) return ret def __del__(self): # see if we are getting dropped because of '=' reassignment of var instead of '<<=' or '<<' if ( self.expr is None and __diag__.warn_on_assignment_to_Forward and Diagnostics.warn_on_assignment_to_Forward not in self.suppress_warnings_ ): warnings.warn_explicit( "Forward defined here but no expression attached later using '<<=' or '<<'", UserWarning, filename=self.caller_frame.filename, lineno=self.caller_frame.lineno, ) def parseImpl(self, instring, loc, doActions=True): if ( self.expr is None and __diag__.warn_on_parse_using_empty_Forward and Diagnostics.warn_on_parse_using_empty_Forward not in self.suppress_warnings_ ): # walk stack until parse_string, scan_string, search_string, or transform_string is found parse_fns = [ "parse_string", "scan_string", "search_string", "transform_string", ] tb = traceback.extract_stack(limit=200) for i, frm in enumerate(reversed(tb), start=1): if frm.name in parse_fns: stacklevel = i + 1 break else: stacklevel = 2 warnings.warn( "Forward expression was never assigned a value, will not parse any input", stacklevel=stacklevel, ) if not ParserElement._left_recursion_enabled: return super().parseImpl(instring, loc, doActions) # ## Bounded Recursion algorithm ## # Recursion only needs to be processed at ``Forward`` elements, since they are # the only ones that can actually refer to themselves. The general idea is # to handle recursion stepwise: We start at no recursion, then recurse once, # recurse twice, ..., until more recursion offers no benefit (we hit the bound). # # The "trick" here is that each ``Forward`` gets evaluated in two contexts # - to *match* a specific recursion level, and # - to *search* the bounded recursion level # and the two run concurrently. The *search* must *match* each recursion level # to find the best possible match. This is handled by a memo table, which # provides the previous match to the next level match attempt. # # See also "Left Recursion in Parsing Expression Grammars", Medeiros et al. # # There is a complication since we not only *parse* but also *transform* via # actions: We do not want to run the actions too often while expanding. Thus, # we expand using `doActions=False` and only run `doActions=True` if the next # recursion level is acceptable. with ParserElement.recursion_lock: memo = ParserElement.recursion_memos try: # we are parsing at a specific recursion expansion - use it as-is prev_loc, prev_result = memo[loc, self, doActions] if isinstance(prev_result, Exception): raise prev_result return prev_loc, prev_result.copy() except KeyError: act_key = (loc, self, True) peek_key = (loc, self, False) # we are searching for the best recursion expansion - keep on improving # both `doActions` cases must be tracked separately here! prev_loc, prev_peek = memo[peek_key] = ( loc - 1, ParseException( instring, loc, "Forward recursion without base case", self ), ) if doActions: memo[act_key] = memo[peek_key] while True: try: new_loc, new_peek = super().parseImpl(instring, loc, False) except ParseException: # we failed before getting any match – do not hide the error if isinstance(prev_peek, Exception): raise new_loc, new_peek = prev_loc, prev_peek # the match did not get better: we are done if new_loc <= prev_loc: if doActions: # replace the match for doActions=False as well, # in case the action did backtrack prev_loc, prev_result = memo[peek_key] = memo[act_key] del memo[peek_key], memo[act_key] return prev_loc, prev_result.copy() del memo[peek_key] return prev_loc, prev_peek.copy() # the match did get better: see if we can improve further else: if doActions: try: memo[act_key] = super().parseImpl(instring, loc, True) except ParseException as e: memo[peek_key] = memo[act_key] = (new_loc, e) raise prev_loc, prev_peek = memo[peek_key] = new_loc, new_peek def leave_whitespace(self, recursive: bool = True) -> ParserElement: self.skipWhitespace = False return self def ignore_whitespace(self, recursive: bool = True) -> ParserElement: self.skipWhitespace = True return self def streamline(self) -> ParserElement: if not self.streamlined: self.streamlined = True if self.expr is not None: self.expr.streamline() return self def validate(self, validateTrace=None) -> None: if validateTrace is None: validateTrace = [] if self not in validateTrace: tmp = validateTrace[:] + [self] if self.expr is not None: self.expr.validate(tmp) self._checkRecursion([]) def _generateDefaultName(self): # Avoid infinite recursion by setting a temporary _defaultName self._defaultName = ": ..." # Use the string representation of main expression. retString = "..." try: if self.expr is not None: retString = str(self.expr)[:1000] else: retString = "None" finally: return self.__class__.__name__ + ": " + retString def copy(self) -> ParserElement: if self.expr is not None: return super().copy() else: ret = Forward() ret <<= self return ret def _setResultsName(self, name, list_all_matches=False): if ( __diag__.warn_name_set_on_empty_Forward and Diagnostics.warn_name_set_on_empty_Forward not in self.suppress_warnings_ ): if self.expr is None: warnings.warn( "{}: setting results name {!r} on {} expression " "that has no contained expression".format( "warn_name_set_on_empty_Forward", name, type(self).__name__ ), stacklevel=3, ) return super()._setResultsName(name, list_all_matches) ignoreWhitespace = ignore_whitespace leaveWhitespace = leave_whitespace class TokenConverter(ParseElementEnhance): """ Abstract subclass of :class:`ParseExpression`, for converting parsed results. """ def __init__(self, expr: Union[ParserElement, str], savelist=False): super().__init__(expr) # , savelist) self.saveAsList = False class Combine(TokenConverter): """Converter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying ``'adjacent=False'`` in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parse_string('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parse_string('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parse_string('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parse_string('3. 1416')) # -> Exception: Expected W:(0123...) """ def __init__( self, expr: ParserElement, join_string: str = "", adjacent: bool = True, *, joinString: typing.Optional[str] = None, ): super().__init__(expr) joinString = joinString if joinString is not None else join_string # suppress whitespace-stripping in contained parse expressions, but re-enable it on the Combine itself if adjacent: self.leave_whitespace() self.adjacent = adjacent self.skipWhitespace = True self.joinString = joinString self.callPreparse = True def ignore(self, other) -> ParserElement: if self.adjacent: ParserElement.ignore(self, other) else: super().ignore(other) return self def postParse(self, instring, loc, tokenlist): retToks = tokenlist.copy() del retToks[:] retToks += ParseResults( ["".join(tokenlist._asStringList(self.joinString))], modal=self.modalResults ) if self.resultsName and retToks.haskeys(): return [retToks] else: return retToks class Group(TokenConverter): """Converter to return the matched tokens as a list - useful for returning tokens of :class:`ZeroOrMore` and :class:`OneOrMore` expressions. The optional ``aslist`` argument when set to True will return the parsed tokens as a Python list instead of a pyparsing ParseResults. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Opt(delimited_list(term)) print(func.parse_string("fn a, b, 100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Opt(delimited_list(term))) print(func.parse_string("fn a, b, 100")) # -> ['fn', ['a', 'b', '100']] """ def __init__(self, expr: ParserElement, aslist: bool = False): super().__init__(expr) self.saveAsList = True self._asPythonList = aslist def postParse(self, instring, loc, tokenlist): if self._asPythonList: return ParseResults.List( tokenlist.asList() if isinstance(tokenlist, ParseResults) else list(tokenlist) ) else: return [tokenlist] class Dict(TokenConverter): """Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. The optional ``asdict`` argument when set to True will return the parsed tokens as a Python dict instead of a pyparsing ParseResults. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) # print attributes as plain groups print(attr_expr[1, ...].parse_string(text).dump()) # instead of OneOrMore(expr), parse using Dict(Group(expr)[1, ...]) - Dict will auto-assign names result = Dict(Group(attr_expr)[1, ...]).parse_string(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.as_dict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: 'light blue' - posn: 'upper left' - shape: 'SQUARE' - texture: 'burlap' SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at :class:`ParseResults` of accessing fields by results name. """ def __init__(self, expr: ParserElement, asdict: bool = False): super().__init__(expr) self.saveAsList = True self._asPythonDict = asdict def postParse(self, instring, loc, tokenlist): for i, tok in enumerate(tokenlist): if len(tok) == 0: continue ikey = tok[0] if isinstance(ikey, int): ikey = str(ikey).strip() if len(tok) == 1: tokenlist[ikey] = _ParseResultsWithOffset("", i) elif len(tok) == 2 and not isinstance(tok[1], ParseResults): tokenlist[ikey] = _ParseResultsWithOffset(tok[1], i) else: try: dictvalue = tok.copy() # ParseResults(i) except Exception: exc = TypeError( "could not extract dict values from parsed results" " - Dict expression must contain Grouped expressions" ) raise exc from None del dictvalue[0] if len(dictvalue) != 1 or ( isinstance(dictvalue, ParseResults) and dictvalue.haskeys() ): tokenlist[ikey] = _ParseResultsWithOffset(dictvalue, i) else: tokenlist[ikey] = _ParseResultsWithOffset(dictvalue[0], i) if self._asPythonDict: return [tokenlist.as_dict()] if self.resultsName else tokenlist.as_dict() else: return [tokenlist] if self.resultsName else tokenlist class Suppress(TokenConverter): """Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + (',' + wd)[...] print(wd_list1.parse_string(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + (Suppress(',') + wd)[...] print(wd_list2.parse_string(source)) # Skipped text (using '...') can be suppressed as well source = "lead in START relevant text END trailing text" start_marker = Keyword("START") end_marker = Keyword("END") find_body = Suppress(...) + start_marker + ... + end_marker print(find_body.parse_string(source) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] ['START', 'relevant text ', 'END'] (See also :class:`delimited_list`.) """ def __init__(self, expr: Union[ParserElement, str], savelist: bool = False): if expr is ...: expr = _PendingSkip(NoMatch()) super().__init__(expr) def __add__(self, other) -> "ParserElement": if isinstance(self.expr, _PendingSkip): return Suppress(SkipTo(other)) + other else: return super().__add__(other) def __sub__(self, other) -> "ParserElement": if isinstance(self.expr, _PendingSkip): return Suppress(SkipTo(other)) - other else: return super().__sub__(other) def postParse(self, instring, loc, tokenlist): return [] def suppress(self) -> ParserElement: return self def trace_parse_action(f: ParseAction) -> ParseAction: """Decorator for debugging parse actions. When the parse action is called, this decorator will print ``">> entering method-name(line:, , )"``. When the parse action completes, the decorator will print ``"<<"`` followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @trace_parse_action def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = wd[1, ...].set_parse_action(remove_duplicate_chars) print(wds.parse_string("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) < 3: thisFunc = paArgs[0].__class__.__name__ + "." + thisFunc sys.stderr.write( ">>entering {}(line: {!r}, {}, {!r})\n".format(thisFunc, line(l, s), l, t) ) try: ret = f(*paArgs) except Exception as exc: sys.stderr.write("< str: r"""Helper to easily define string ranges for use in :class:`Word` construction. Borrows syntax from regexp ``'[]'`` string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as ``\-`` or ``\]``) - an escaped hex character with a leading ``'\x'`` (``\x21``, which is a ``'!'`` character) (``\0x##`` is also supported for backwards compatibility) - an escaped octal character with a leading ``'\0'`` (``\041``, which is a ``'!'`` character) - a range of any of the above, separated by a dash (``'a-z'``, etc.) - any combination of the above (``'aeiouy'``, ``'a-zA-Z0-9_$'``, etc.) """ _expanded = ( lambda p: p if not isinstance(p, ParseResults) else "".join(chr(c) for c in range(ord(p[0]), ord(p[1]) + 1)) ) try: return "".join(_expanded(part) for part in _reBracketExpr.parse_string(s).body) except Exception: return "" def token_map(func, *args) -> ParseAction: """Helper to define a parse action by mapping a function to all elements of a :class:`ParseResults` list. If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in ``hex_integer = Word(hexnums).set_parse_action(token_map(int, 16))``, which will convert the parsed data to an integer using base 16. Example (compare the last to example in :class:`ParserElement.transform_string`:: hex_ints = Word(hexnums)[1, ...].set_parse_action(token_map(int, 16)) hex_ints.run_tests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).set_parse_action(token_map(str.upper)) upperword[1, ...].run_tests(''' my kingdom for a horse ''') wd = Word(alphas).set_parse_action(token_map(str.title)) wd[1, ...].set_parse_action(' '.join).run_tests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] """ def pa(s, l, t): return [func(tokn, *args) for tokn in t] func_name = getattr(func, "__name__", getattr(func, "__class__").__name__) pa.__name__ = func_name return pa def autoname_elements() -> None: """ Utility to simplify mass-naming of parser elements, for generating railroad diagram with named subdiagrams. """ for name, var in sys._getframe().f_back.f_locals.items(): if isinstance(var, ParserElement) and not var.customName: var.set_name(name) dbl_quoted_string = Combine( Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*') + '"' ).set_name("string enclosed in double quotes") sgl_quoted_string = Combine( Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*") + "'" ).set_name("string enclosed in single quotes") quoted_string = Combine( Regex(r'"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*') + '"' | Regex(r"'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*") + "'" ).set_name("quotedString using single or double quotes") unicode_string = Combine("u" + quoted_string.copy()).set_name("unicode string literal") alphas8bit = srange(r"[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]") punc8bit = srange(r"[\0xa1-\0xbf\0xd7\0xf7]") # build list of built-in expressions, for future reference if a global default value # gets updated _builtin_exprs: List[ParserElement] = [ v for v in vars().values() if isinstance(v, ParserElement) ] # backward compatibility names tokenMap = token_map conditionAsParseAction = condition_as_parse_action nullDebugAction = null_debug_action sglQuotedString = sgl_quoted_string dblQuotedString = dbl_quoted_string quotedString = quoted_string unicodeString = unicode_string lineStart = line_start lineEnd = line_end stringStart = string_start stringEnd = string_end traceParseAction = trace_parse_action PK!ڊ::4_vendor/pyparsing/__pycache__/common.cpython-311.pycnu[ ,Re2ddlTddlmZmZmZddlmZGddZdeeDZ dS) )*)delimited_list any_open_tag any_close_tag)datetimec eZdZdZeeZ eeZ e e  d eZ e e d eedZ ed d eZ e edze ez dZ ed eeeed ezzz d Z eeed  d  eZ ed d eZ eezezdZ ed d eZ e ee dZ ed dZ! ed dZ"e"de"zdzz dZ#ee"de"zdzzdzee"de"zdzzz dZ$e$%dde!z d Z&e'e#e&ze$z d! d!Z( ed" d#Z) e*d?d%e+fd&Z,e*d@d%e+fd(Z-ed) d*Z. ed+ d,Z/ ed- d.Z0 e1je2jzZ3e*d/e+d0ed1e4fd2Z5e'e6e7d3e8ze e9d34zee:d5e;e8d3zzz d6Z<e=ee>?eS)Apyparsing_commona" Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (:class:`integers`, :class:`reals`, :class:`scientific notation`) - common :class:`programming identifiers` - network addresses (:class:`MAC`, :class:`IPv4`, :class:`IPv6`) - ISO8601 :class:`dates` and :class:`datetime` - :class:`UUID` - :class:`comma-separated list` - :class:`url` Parse actions: - :class:`convertToInteger` - :class:`convertToFloat` - :class:`convertToDate` - :class:`convertToDatetime` - :class:`stripHTMLTags` - :class:`upcaseTokens` - :class:`downcaseTokens` Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerz[+-]?\d+zsigned integer/fractionc$|d|dz S)Nr)tts /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/common.pyzpyparsing_common.sAB-z"fraction or mixed integer-fractionz[+-]?(?:\d+\.\d*|\.\d+)z real numberz@[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)z$real number with scientific notationnumberz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumber identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integer:zfull IPv6 address)rz::zshort IPv6 addressc<td|DdkS)Nc3XK|]%}tj|!dV&dS)rN)r _ipv6_partmatches).0rs r z,pyparsing_common...s9OOB'7'B'J'J2'N'NOaOOOOOOr)sumts rrzpyparsing_common.s##OO!OOOOORSSrz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dfmtcfd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c tj|dS#t$r#}t ||t |d}~wwxYwNr)rstrptimedate ValueErrorParseExceptionstr)ssllrver)s rcvt_fnz0pyparsing_common.convert_to_date..cvt_fnsb 6(A4499;;; 6 6 6$RSWW555 6s,0 AAArr)r5s` rconvert_to_datez pyparsing_common.convert_to_dates#& 6 6 6 6 6  r%Y-%m-%dT%H:%M:%S.%fcfd}|S)aHelper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c tj|dS#t$r#}t||t |d}~wwxYwr,)rr-r/r0r1)slr'r4r)s rr5z4pyparsing_common.convert_to_datetime..cvt_fn*sV 4(1s333 4 4 4$Q3r77333 4s A AA rr6s` rconvert_to_datetimez$pyparsing_common.convert_to_datetimes#& 4 4 4 4 4  rz7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDr;r<tokenscLtj|dS)aParse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the pyparsing wiki page' td, td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) Prints:: More info at the pyparsing wiki page r)r _html_strippertransform_string)r;r<r?s rstrip_html_tagsz pyparsing_common.strip_html_tagsAs  .??q JJJr,) exclude_charsz commaItem)defaultzcomma separated listc*|SN)upperr&s rrzpyparsing_common.dsQWWYYrc*|SrJ)lowerr&s rrzpyparsing_common.gsqwwyyra^(?:(?:(?Phttps?|ftp):)?\/\/)(?:(?P\S+(?::\S*)?)@)?(?P(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(:(?P\d{2,5}))?(?P\/[^?# ]*)?(\?(?P[^#]*))?(#(?P\S*))?$urlN)r()r8)K__name__ __module__ __qualname____doc__ token_mapintconvert_to_integerfloatconvert_to_floatWordnumsset_nameset_parse_actionr hexnumsrRegexsigned_integerradd_parse_actionOptsuppress mixed_integerr%realsci_realsetName streamlinerr identcharsidentbodycharsr ipv4_addressr _full_ipv6_address_short_ipv6_address add_condition_mixed_ipv6_addressCombine ipv6_address mac_address staticmethodr1r7r= iso8601_dateiso8601_datetimeuuidrrrA ParseResultsrC OneOrMoreLiteralLineEnd printablesWhite FollowedBy _commasepitemr quoted_stringcopycomma_separated_list upcase_tokensdowncase_tokensrNconvertToIntegerconvertToFloat convertToDateconvertToDatetime stripHTMLTags upcaseTokensdowncaseTokensrrrr r sOOb#3!y''d4jj!!),,==>PQQGD W }-->>yyb?Q?QRRG k " # #  , - - W ))*:;;   .   + +,< = = >hz  U 77888 >CCC(9(9(;(;h(F$G$GGGh344g""3''' ()) -  * + + M QRR 8 9 9  * + + /o. 7 7 A A L L N NFG .// )    * + + 4j.11::<HHJd5Vh~3*++44]CCJ$j(8A'==GG J# *f4 455   #jC*,66 7 7 8h#$$  %%SS%|3==>RSS7 1 14G GQQ   h~  0%Eh}GS\4\45Bh~$u Rh!""] 5F G G P PQW X XD5*\*,,/E}/E/G/GGNK3K3K KKK\K$  I 799*$z5556#eeElljjS&A&A%AABBC      +  *> M   = 0"===h%&&e L+>+>!?!?@@M7"l99-@-@#A#ABBO7 %* . . \huoo]d*%N#M+#M L$NNNrr c<g|]}t|t|Sr) isinstance ParserElement)r"vs r rs7 *Q 2N2NrN) corehelpersrrrrr varsvalues_builtin_exprsrrrrs@@@@@@@@@@[%[%[%[%[%[%[%[%| t$%%,,..rPK!= 6_vendor/pyparsing/__pycache__/__init__.cpython-311.pycnu[ ,Re#^dZddlmZGddeZedddddZdZejZeZd Zd d l Td d l Td d l Td d l m Z mZd d lTd d l Td d l mZd d lTd d lmZd dlmZmZmZd dlmZd dlmZmZdevreZdevreZdevreZeeezz ZgdZdS)a pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form ``", !"``), built up using :class:`Word`, :class:`Literal`, and :class:`And` elements (the :meth:`'+'` operators create :class:`And` expressions, and the strings are auto-converted to :class:`Literal` expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print(hello, "->", greet.parse_string(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of :class:`'+'`, :class:`'|'`, :class:`'^'` and :class:`'&'` operators. The :class:`ParseResults` object returned from :class:`ParserElement.parseString` can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes :class:`ParserElement` and :class:`ParseResults` to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from :class:`Literal` and :class:`CaselessLiteral` classes - construct character word-group expressions using the :class:`Word` class - see how to create repetitive expressions using :class:`ZeroOrMore` and :class:`OneOrMore` classes - use :class:`'+'`, :class:`'|'`, :class:`'^'`, and :class:`'&'` operators to combine simple expressions into more complex ones - associate names with your parsed results using :class:`ParserElement.setResultsName` - access the parsed data, which is returned as a :class:`ParseResults` object - find some helpful expression short-cuts like :class:`delimitedList` and :class:`oneOf` - find more useful common expressions in the :class:`pyparsing_common` namespace class ) NamedTuplecdeZdZUeed<eed<eed<eed<eed<edZdZdZ d S) version_infomajorminormicro releaselevelserialcd|j|j|jd|jddkrdnd|jd|jdf|jdkzS)Nz{}.{}.{}z{}{}{}rcrfinal)formatrrrr r selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/__init__.py __version__zversion_info.__version__js   dj$*dj A A,Q/366CCB%a(K  7*, , cNdt|jtS)Nz {} {} / {})r__name__r__version_time__rs r__str__zversion_info.__str__xs""8T-=?OPPPrc dtt|jddt |j|DS)Nz {}.{}({})z, c3*K|]}dj|VdS)z{}={!r}N)r).0nvs r z(version_info.__repr__..s-NN&i&+NNNNNNr)rrtypejoinzip_fieldsrs r__repr__zversion_info.__repr__{sS!!  JJ  IINNc$,6M6MNNN N N   rN) r __module__ __qualname__int__annotations__strpropertyrrr#rrrrcs JJJ JJJ JJJ KKK    X  QQQ     rr rz05 May 2022 07:02 UTCz+Paul McGuire )*)__diag__ __compat__)_builtin_exprs) unicode_setUnicodeRangeListpyparsing_unicode)pyparsing_test)pyparsing_commonr1r4r6r5)rr __author__r0r/And AtLineStart AtStringStartCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroup IndentedBlockKeywordLineEnd LineStartLiteralLocated PrecededBy MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOpAssocOptOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement PositionToken QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMoreChar alphanumsalphas alphas8bit any_close_tag any_open_tagc_style_commentcolcommon_html_entity counted_arraycpp_style_commentdbl_quoted_stringdbl_slash_commentdelimited_listdict_ofemptyhexnums html_comment identcharsidentbodycharsjava_style_commentlineline_end line_startlinenomake_html_tags make_xml_tagsmatch_only_at_colmatch_previous_exprmatch_previous_literal nested_exprnull_debug_actionnumsone_of printablespunc8bitpython_style_comment quoted_string remove_quotes replace_withreplace_html_entity rest_of_linesgl_quoted_stringsrange string_end string_starttrace_parse_actionunicode_stringwith_attribute indentedBlockoriginal_text_forungroupinfix_notation locatedExpr with_class CloseMatch token_mapr6r4r2condition_as_parse_actionr5__versionTime__ anyCloseTag anyOpenTag cStyleCommentcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOf htmlCommentjavaStyleCommentlineEnd lineStart makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActiononeOfopAssocpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedString stringEnd stringStarttraceParseAction unicodeString withAttributeroriginalTextFor infixNotationr withClasstokenMapconditionAsParseActionautoname_elementsN)__doc__typingrr__version_info__rrrr7util exceptionsactionscorer/r0resultsr1core_builtin_exprshelpershelper_builtin_exprsunicoder2r3r4testingr5commonr6common_builtin_exprsglobals__all__r*rrrs2F N     :   @ <1a!44** " : &&&&&&&&666666;;;;;;PPPPPPPPPP...... ggii''WWYY&&7799$$N*-AAAf f f rPK!Z772_vendor/pyparsing/__pycache__/util.cpython-311.pycnu[ ,ReddlZddlZddlZddlZddlmZddlmZmZm Z e dZ GddZ edd e d ed e fd Zedd e d ed e fd Zedd e d ed efdZGddZGddZGddZGddeZded efdZ ddeee efded efdZded efdZdS)N) lru_cache)ListUnionIterable\ceZdZUdZgZeeed<gZeeed<dZ e dZ e dZ e dZ dS) __config_flagsz=Internal class for defining compatibility and debugging flags _all_names _fixed_names configurationc b||jvrctjd|j||jt t||dS||j vrt|||dStd|j|)Nz'{}.{} {} is {} and cannot be overriddenzno such {} {!r}) r warningswarnformat__name__ _type_descstrgetattrupperr setattr ValueError)clsdnamevalues /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/util.py_setz__config_flags._sets C$ $ $ M9@@LNU++,,2244     F CN " " C & & & & &.55cneLLMM Mc.||dS)NTrrnames rz__config_flags.$s388D$+?+?rc.||dS)NFrr s rr"z__config_flags.%sCHHT5,A,ArN)r __module__ __qualname____doc__r rr__annotations__r r classmethodrenabledisablerrr r sGGJS  L$s)    JNN[N [?? @ @FkAABBGGGrr )maxsizelocstrgreturnc|}d|cxkrt|krnn||dz dkrdn||dd|z S)a Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. r )lenrfind)r.r/ss rcolr7(sc AC    #a&&     QsQwZ4%7%711S1774QRTWCXCX=XXrc6|dd|dzS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note - the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. r3rr2)count)r.r/s rlinenor:9s ::dAs # #a ''rc|dd|}|d|}|dkr ||dz|n ||dzdS)zh Returns the line of text containing loc within a string, counting newlines as line separators. r3rr2N)r5find)r.r/last_crnext_crs rliner?GsZ jjq#&&Giic""G*1Q,,4! g% & &D1.getW9S,// /rc||<dSrDr+)rFrGrcaches rset_z&_UnboundedCache.__init__..set_ZsE#JJJrc0dSrDclearrFrMs rrQz'_UnboundedCache.__init__..clear] KKMMMMMr)rJobjectrIsizetypes MethodTypesetrQ)selfrJrNrQrMrHrIs @@@r__init__z_UnboundedCache.__init__RsI +1883L 0 0 0 0 0 0           #C..#D$//%eT22 rNrr$r%rZr+rrrArAQs#33333rrAceZdZdZdS) _FifoCachec8tx|_tjjfd}fd}fd}|_t j|||_t j|||_t j|||_ dS)Nc|SrDr+rEs rrJz _FifoCache.__init__..getlrKrc||<tkr+dtk)dSdSNF)last)r4popitem)rFrGrrMrUs rrNz!_FifoCache.__init__..set_osPE#Je**t## 5 )))e**t######rc0dSrDrPrRs rrQz"_FifoCache.__init__..cleartrSr) rTrI collections OrderedDictrJrUrVrWrXrQ)rYrUrJrNrQrMrHrIs ` @@@rrZz_FifoCache.__init__gs+1883L'))I  0 0 0 0 0 0 * * * * * *       #C..#D$//%eT22 rNr[r+rrr]r]fs#33333rr]c0eZdZdZdZdZdZdZdZdS)LRUMemoz A memoizing mapping that retains `capacity` deleted items The memo tracks retained items by their access order; once `capacity` items are retained, the least recently used item is discarded. cR||_i|_tj|_dSrD) _capacity_activererf_memory)rYcapacitys rrZzLRUMemo.__init__s$! ".00 rc |j|S#t$r*|j||j|cYSwxYwrD)rkKeyErrorrl move_to_endrYrGs r __getitem__zLRUMemo.__getitem__sX %<$ $ % % % L $ $S ) ) )<$ $ $ $ %s 1AAcP|j|d||j|<dSrD)rlpoprkrYrGrs r __setitem__zLRUMemo.__setitem__s, d###! Src |j|}t|j|jkr8|jdt|j|jk8||j|<dS#t $rYdSwxYwra)rkrtr4rlrjrcrorus r __delitem__zLRUMemo.__delitem__s &L$$S))Edl##t~55 $$%$000dl##t~55 %DL        DD sA== B  B cj|j|jdSrD)rkrQrl)rYs rrQz LRUMemo.clears0  rN) rr$r%r&rZrrrvrxrQr+rrrhrh}si111 %%%"""&&&rrhceZdZdZdZdS) UnboundedMemoz< A memoizing mapping that retains all deleted items cdSrDr+rqs rrxzUnboundedMemo.__delitem__s rN)rr$r%r&rxr+rrr{r{s-     rr{r6cdD] }||t|z}!|dd}|dd}t|S)Nz\^-[]r3z\n z\t)replace_bslashr)r6cs r_escape_regex_range_charsrs[ && IIa1 % % $A $A q66MrT re_escapec < fd d _tj _d _d d}|s| g}dt t|}t|dkrtj | D]\}}t|x}}tj tj t|g|d }||kr| |t#|t#|d zkrdnd }|d  || |n fd |D}d|S)Nct|}|jc_}||z dkrtj_jS)Nr2)ordprevnextcounterr)rc_intris_consecutives rrz2_collapse_string_to_ranges..is_consecutivesKA$)>+>!T 4#?#?N ##rrc|dvrd|zn|S)Nz\^-][\r+rs rescape_re_range_charz8_collapse_string_to_ranges..escape_re_range_chars==taxxa/rc|SrDr+rs rno_escape_re_range_charz;_collapse_string_to_ranges..no_escape_re_range_charsr)rGr2)maxlen-z{}{}{}c&g|] }|Sr+r+).0rrs r z._collapse_string_to_ranges..s%2221##A&&222r)r itertoolsr9rrjoinsortedrXr4groupbyrredequechainiterrtappendrr) r6rrretrFcharsfirstrbseprrs @@r_collapse_string_to_rangesrs$$$$$N&_..NN000 76 C s1vvA 1vvzz!)!@@@  HAu;; &ED$dV e44Qcee }} //667777IIUa77bbS OO,,U33S:N:Nt:T:T 3222222 773<<rllcg}|D]O}t|tr#|t|:||P|SrD) isinstancelistextend_flattenr)rris rrrsY C  a    JJx{{ # # # # JJqMMMM Jr)T)rrVrer functoolsrtypingrrrchrrr intrr7r:r?rAr]rhdictr{rboolrrrr+rrrs (((((((((( #b''CCCCCCCC8 3 YS Y Y Y Y Y Y  3 ( (3 (3 ( ( ( ( 3PcPPPPPP33333333*33333333.$$$$$$$$N     D   59++ S(3-  +-1+++++\$rPK!ÉeF<F<5_vendor/pyparsing/__pycache__/unicode.cpython-311.pycnu[ ,Re#*ddlZddlmZddlmZmZmZGddZeeeeefeefZ GddZ Gdd e Z e j j je j jjze j jjze j _e je _e je _e je _e je _e je _e je _e j e _e j j e j _e j je j _e j je j _ e j!e _"e j#e _$e j%e _&dS) N) filterfalse)ListTupleUnionceZdZdZdZdS)_lazyclasspropertycD||_|j|_|j|_dS)N)fn__doc____name__)selfr s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/unicode.py__init__z_lazyclassproperty.__init__ sz   c"t|tdr(tfdjddDri_|jj}|jvr|j|<j|S)N_internc3HK|]}jt|dguVdS)rN)rgetattr).0 superclassclss r z-_lazyclassproperty.__get__..sJ. .  K7:y"== =. . . . . . r)typehasattrany__mro__rr r )r objrattrnames ` r__get__z_lazyclassproperty.__get__s ;s))CsI&& #. . . . !k!""o. . . + +  CK7# 3; & &$(GGCLLCK !{8$$rN)r __module__ __qualname__rr rrrrs2$$$ % % % % %rrceZdZUdZgZeed<edZedZ edZ edZ edZ edZ ed Zd S) unicode_seta A set of Unicode characters, for language-specific strings for ``alphas``, ``nums``, ``alphanums``, and ``printables``. A unicode_set is defined by a list of ranges in the Unicode character set, in a class attribute ``_ranges``. Ranges can be specified using 2-tuples or a 1-tuple, such as:: _ranges = [ (0x0020, 0x007e), (0x00a0, 0x00ff), (0x0100,), ] Ranges are left- and right-inclusive. A 1-tuple of (x,) is treated as (x, x). A unicode set can also be defined using multiple inheritance of other unicode sets:: class CJK(Chinese, Japanese, Korean): pass _rangesc g}|jD]S}|turnGt|ddD]4}|t |d|ddz5Tdt t |DS)Nr&r#rrc,g|]}t|Sr#)chrrcs r z1unicode_set._chars_for_ranges..?s1111A111r)rr%rextendrangesortedset)rretccrrs r_chars_for_rangeszunicode_set._chars_for_ranges7s+ 5 5B[  b)R00 5 5 5A2 334444 511s3xx 0 01111rcfdttj|jS)z+all non-whitespace characters in this range)joinrstrisspacer5rs r printableszunicode_set.printablesAs%ww{3;0EFFGGGrcfdttj|jS)z'all alphabetic characters in this ranger7)r8filterr9isalphar5r;s ralphaszunicode_set.alphasF%wwvck3+@AABBBrcfdttj|jS)z*all numeric digit characters in this ranger7)r8r>r9isdigitr5r;s rnumszunicode_set.numsKrArc |j|jzS)z)all alphanumeric characters in this range)r@rDr;s r alphanumszunicode_set.alphanumsPszCH$$rc dttdttj|jdzdzdzS)zVall characters in this range that are valid identifier characters, plus underscore '_'r7u:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzªµºu|ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ_)r8r0r1r>r9 isidentifierr5r;s r identcharszunicode_set.identcharsUsrww GGF3#3S5JKKLLRSUU     rc dtt|jdzdd|jDzS)zu all characters in this range that are valid identifier body characters, plus the digits 0-9 r7 0123456789c@g|]}d|z|S)rH)rIr+s rr-z.unicode_set.identbodychars..os-VVVqcAg=S=S=U=UVVVVr)r8r0r1rJr5r;s ridentbodycharszunicode_set.identbodycharscsk ww N"#ggVVC$9VVV     rN)r r!r"r r&UnicodeRangeList__annotations__rr5r<r@rDrFrJrNr#rrr%r%s*!#G """222HHHCCCCCC%%%          rr%ceZdZUdZdejfgZeed<Gdde Z Gdde Z Gdd e Z Gd d e Z Gd d e ZGdde ZGdde ZGdde ZGdde ZeZGddeeeZGdde ZGdde ZGdde ZGdde Zd S)!pyparsing_unicodezF A namespace class for defining common language unicode_sets. r&c$eZdZUdZdgZeed<dS)(pyparsing_unicode.BasicMultilingualPlanez,Unicode set for the Basic Multilingual Plane)rSir&Nr r!r"r r&rOrPr#rrBasicMultilingualPlanerUs866 % !     rrWc&eZdZUdZddgZeed<dS)pyparsing_unicode.Latin1z/Unicode set for Latin-1 Unicode Character Range)rS~)r&NrVr#rrLatin1rYs;99  % !     rr]c$eZdZUdZdgZeed<dS)pyparsing_unicode.LatinAz/Unicode set for Latin-A Unicode Character Range)ir&NrVr#rrLatinAr_899 % !     rrac$eZdZUdZdgZeed<dS)pyparsing_unicode.LatinBz/Unicode set for Latin-B Unicode Character Range)iiOr&NrVr#rrLatinBrdrbrrec&eZdZUdZgdZeed<dS)pyparsing_unicode.Greekz.Unicode set for Greek Unicode Character Ranges)#)iBiE)ipiw)izi)ii)i)ii)ii)ii)i&i*)i^)i`)ifij)ii)ii)i iE)iHiM)iPiW)iY)i[)i])i_i})ii)ii)ii)ii)ii)ii)ii)i)!)i'i')ie)i@i)i)iiE)iir&NrVr#rrGreekrgs?88$% $% $% !$ $ $ $ $ rrhc&eZdZUdZgdZeed<dS)pyparsing_unicode.Cyrillicz0Unicode set for Cyrillic Unicode Character Range))ii/)ii)i+)ix)i-i-)i@ir)iti)i.i/r&NrVr#rrCyrillicrjs?:: % % % ! rrkc&eZdZUdZgdZeed<dS)pyparsing_unicode.Chinesez/Unicode set for Chinese Unicode Character Range))i.i.)i.i.)i1i1)i4iM)Ni)ii)iim)ipi)ioio)ii)ii;)i@iH)ii֦)ii4)i@i)i i)ii)iir&NrVr#rrChineserms?99% % % !     rrocveZdZUdZgZeed<GddeZGddeZ GddeZ d S) pyparsing_unicode.Japanesez`Unicode set for Japanese Unicode Character Range, combining Kanji, Hiragana, and Katakana rangesr&c&eZdZUdZddgZeed<dS) pyparsing_unicode.Japanese.Kanjiz-Unicode set for Kanji Unicode Character Range)rni)i0i?0r&NrVr#rrKanjirss; ; ;  )G%     rrtc&eZdZUdZgdZeed<dS)#pyparsing_unicode.Japanese.Hiraganaz0Unicode set for Hiragana Unicode Character Range))iA0i0)00)i0)ip)i)iPiR)ir&NrVr#rrHiraganarvs? > >)))G%     rryc&eZdZUdZgdZeed<dS)#pyparsing_unicode.Japanese.Katakanaz1Unicode set for Katakana Unicode Character Range) )rwi0)rxi0)i1i1)i2i2)iei)i)idig)ii)ir&NrVr#rrKatakanar{s? ? ? ) ) )G%     rr|N) r r!r"r r&rOrPr%rtryr|r#rrJapaneserqsjj$&!&&&     K        {        {     rr}c&eZdZUdZgdZeed<dS)pyparsing_unicode.Hangulz7Unicode set for Hangul (Korean) Unicode Character Range))ii)i.0i/0)i11i1)i2i2)i`2i{2)i~2)i`i|)ii)ii)ii)ii)ii)ii)ii)iir&NrVr#rrHangulr s?AA% % % !     rrceZdZdZdS)pyparsing_unicode.CJKzTUnicode set for combined Chinese, Japanese, and Korean (CJK) Unicode Character RangeN)r r!r"r r#rrCJKr"s^^^^rrc&eZdZUdZddgZeed<dS)pyparsing_unicode.Thaiz,Unicode set for Thai Unicode Character Range)ii:)i?i[r&NrVr#rrThair%s;66  % !     rrc&eZdZUdZgdZeed<dS)pyparsing_unicode.Arabicz.Unicode set for Arabic Unicode Character Range))ii)ii)iir&NrVr#rrArabicr,s?88% % % !     rrc&eZdZUdZgdZeed<dS)pyparsing_unicode.Hebrewz.Unicode set for Hebrew Unicode Character Range) )ii)ii)ii)ii6)i8i<)i>)i@iA)iCiD)iFiOr&NrVr#rrHebrewr4s?88 % % % ! rrc&eZdZUdZddgZeed<dS)pyparsing_unicode.Devanagariz2Unicode set for Devanagari Unicode Character Range)i i )iir&NrVr#rr DevanagarirBs;<<  % !     rrN)r r!r"r sys maxunicoder&rOrPr%rWr]rarerhrkror}rKoreanrrrrrr#rrrRrRvs  !G                                 & & & & & & & & P      ;         +   .#####;###J        (F_____gx___     {                          [     rrR)'r itertoolsrtypingrrrrintrOr%rRr}rtr&ryr|rWBMPrالعربيةro中文rkкириллицаrhΕλληνικάrעִברִית 日本語漢字 カタカナ ひらがなr 한국어r ไทยrदेवनागरीr#rrrs !!!!!!%%%%%%%%%%%%%%%%%%(eCHouSz9:;T T T T T T T T nQ Q Q Q Q Q Q Q n$, )12 )12" *@$5#; ,4'8'A$%6%<"#4#; /8$5$>$D!*;*D*M'*;*D*M'/6/4->-I***rPK!g;P!P!5_vendor/pyparsing/__pycache__/actions.cpython-311.pycnu[ ,ReddlmZddlmZGddZdZdZdZdZe e_ d d Z eZ eZ eZe ZeZd S) )ParseException)colc$eZdZdZdZdZdZdS)OnlyOncezI Wrapper for parse actions, to ensure they are only called once. c@ddlm}|||_d|_dS)Nr) _trim_arityF)corercallablecalled)self method_callrs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/actions.py__init__zOnlyOnce.__init__ s0%%%%%%# K00  cr|js ||||}d|_|St||d)NTz.OnlyOnce obj called multiple times w/out reset)r r r)r sltresultss r__call__zOnlyOnce.__call__s@{ mmAq!,,GDKNQ#STTTrcd|_dS)zK Allow the associated parse action to be called once more. FN)r )r s rresetzOnlyOnce.resets  rN)__name__ __module__ __qualname____doc__rrrrrrrsN UUUrrcfd}|S)zt Helper method for defining parse actions that require matching at a specific column in the input text. cxt||kr$t||ddS)Nzmatched token not at column {})rrformat)strglocntoksns r verify_colz%match_only_at_col..verify_col's@ tT??a   t-M-T-TUV-W-WXX X rr)r$r%s` rmatch_only_at_colr&!s) YYYYY rcfdS)a Helper method for common parse actions that simply return a literal value. Especially useful when used with :class:`transform_string` (). Example:: num = Word(nums).set_parse_action(lambda toks: int(toks[0])) na = one_of("N/A NA").set_parse_action(replace_with(math.nan)) term = na | num term[1, ...].parse_string("324 234 N/A 234") # -> [324, 234, nan, 234] c gS)Nr)rrrrepl_strs rzreplace_with..<s H:rr)r)s`r replace_withr+.s & % % %%rc"|dddS)a# Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use remove_quotes to strip quotation marks from parsed results quoted_string.set_parse_action(remove_quotes) quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rr)rrrs r remove_quotesr/?s Q4":rcl|r |ddn|dDfd}|S)aK Helper to create a validating parse action to be used with start tags created with :class:`make_xml_tags` or :class:`make_html_tags`. Use ``with_attribute`` to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as ```` or ``
``. Call ``with_attribute`` with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in ``(align="right")``, or - as an explicit dict with ``**`` operator, when an attribute name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}`` - a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align", "right"))`` For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for ``class`` (with or without a namespace), use :class:`with_class`. To verify that the attribute exists, but without specifying a value, pass ``with_attribute.ANY_VALUE`` as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = make_html_tags("div") # only match div tag having a type attribute with value "grid" div_grid = div().set_parse_action(with_attribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.search_string(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().set_parse_action(with_attribute(type=with_attribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.search_string(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 Ncg|] \}}||f Srr).0kvs r z"with_attribute..s & & &1aV & & &rc D]e\}}||vrt||d|z|tjkr8|||kr,t||d||||fdS)Nzno matching attribute z+attribute {!r} has value {!r}, must be {!r})rwith_attribute ANY_VALUEr )rrtokensattrName attrValueattrss rpazwith_attribute..pas#(   Hiv%%$Q+Ch+NOOON4449IY9V9V$AHH &"2I  r)items)args attr_dictr=r<s @rr7r7Ps_r "QQQ!! & & & & &E      IrcP|rd|nd}tdi||iS)a Simplified version of :class:`with_attribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = make_html_tags("div") div_grid = div().set_parse_action(with_class("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.search_string(html): print(grid_header.body) div_any_type = div().set_parse_action(with_class(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.search_string(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z{}:classclassr)r r7) classname namespace classattrs r with_classrGs;H1:F !!),,,wI  3 3Y 2 3 33rN)rA) exceptionsrutilrrr&r+r/r7objectr8rG replaceWith removeQuotes withAttribute withClassmatchOnlyAtColrrrrPs'&&&&&4   &&&""LLL^"688%4%4%4%4R    "rPK!Ga<<2_vendor/pyparsing/__pycache__/core.cpython-311.pycnu[ ,Re>A UddlZddlZddlmZmZmZmZmZmZmZm Z m Z m Z ddl m Z mZddlmZddlZddlZddlZddlZddlZddlmZddlZddlZddlmZddlmZddlmZdd l m!Z!d d l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z+m,Z-d d l.Td d l/Td d l0m1Z1m2Z2d dl3m4Z4ej5Z6e7e8fZ9ee:dfe;d<ej<dkrddlm=Z=n GddZ=Gdde%Z>Gdde%Z?GddeZ@de@ddfdZAde@ddfdZBddZC[%d eje7d!ejDe7deEfd"ZFeFejGejHId#r eCeJeKeLeMeNeOePeQeReSeTh ZUejVZWeegefee1gefeeXe1gefee7eXe1geffZYeegeEfee1geEfeeXe1geEfee7eXe1geEffZZee7eXd$e[gdfZ\ee7eXd$eEgdfZ]ee7eXeXd$e1eEgdfZ^ee7eXd$e[eEgdfZ_ej`ejazZbe4jcjdZde4jcjeZed%Zfefd&zZgebefzZhd'id(ejjDZkdalejme;d)<dd+Zn dd-eZd.e7d/eEdeYfd0Zo dd1e7d2eXd3d$d4eEfd5Zp dd1e7d6eXd7eXd3d$d8e1d4eEf d9Zq dd1e7d2eXd3d$d:e[d4eEf d;Zrd<ZsGd=d$e ZtGd>d?etZuGd@dAetZvGdBdCevZwGdDdEevZxGdFdGevZyGdHdIeyZzeyet_{GdJdKevZ|GdLdMeyZ}GdNdOe|Z~GdPdQevZGdRdSevZGdTdUeZGdVdWeZGdXdYevZGdZd[evZGd\d]evZGd^d_evZGd`daevZGdbdceZGdddeeZGdfdgeZGdhdieZGdjdkeZGdldmeZGdndoeZGdpdqetZGdrdseZGdtdueZGdvdweZGdxdyeZGdzd{etZGd|d}eZGd~deZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGddeZGddZGddeZeZDGddeZGddeZGddeZGddeZGddeZGddeZGddeZdeYdeYfdZewdZedZedZedZedZee(dddZeddZeddZeezezedd zZeeedzezZeydeddzeeeezdzdzZde7de7fdZdeYfdZddZeeddzdZeeddzdZeeddzeddzzd¦ZedezdĦZedŦZedƦZdDŽeDZeete;d<eZeoZesZeZeZeZeZeZeZeZeZeZdS)N) NamedTupleUnionCallableAny GeneratorTupleListTextIOSetSequence)ABCabstractmethod)Enum)Iterable) itemgetter)wraps)RLock)Path) _FifoCache_UnboundedCache__config_flags_collapse_string_to_ranges_escape_regex_range_chars_bslash_flattenLRUMemo UnboundedMemo)*) ParseResults_ParseResultsWithOffset)pyparsing_unicode.str_type))cached_propertyceZdZdZddZdS)r&c||_dSN)_func)selffuncs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/core.py__init__zcached_property.__init__Qs DJJJNcX||x}|j|jj<|Sr))r*__dict____name__)r+instanceownerrets r-__get__zcached_property.__get__Ts*;?::h;O;O OC(#DJ$78Jr/r))r2 __module__ __qualname__r.r6r/r-r&r&Ps7         r/r&cjeZdZdZdZdZdeDZdZ dS) __compat__aJ A cross-version compatibility configuration for pyparsing features that will be released in a future version. By setting values in this configuration to True, those features can be enabled in prior versions for compatibility development and testing. - ``collect_all_And_tokens`` - flag to enable fix for Issue #63 that fixes erroneous grouping of results names when an :class:`And` expression is nested within an :class:`Or` or :class:`MatchFirst`; maintained for compatibility, but setting to ``False`` no longer restores pre-2.3.1 behavior compatibilityTc<g|]}|d|S_ startswith.0__s r- z__compat__.j)BBBr}}S/A/AB"BBBr/z( collect_all_And_tokens N) r2r7r8__doc__ _type_desccollect_all_And_tokenslocals _all_namessplit _fixed_namesr9r/r-r;r;YsQ  !J!BBvvxxBBBJ EGGLLr/r;ceZdZdZdZdZdZdZdZdZ dZ dZ de DZ de DZde DZed dZdS) __diag__ diagnosticFc<g|]}|d|Sr>r@rBs r-rEz__diag__.|rFr/c<g|]}|d|S)warnr@rCnames r-rEz__diag__.}s)MMMtT__V5L5LMdMMMr/c<g|]}|d|S) enable_debugr@rTs r-rEz__diag__.~s)SSST4??>3R3RSDSSSr/returnNcD|jD]}||dSr))_warning_namesenable)clsrUs r-enable_all_warningsz__diag__.enable_all_warningss3&  D JJt      r/rXN)r2r7r8rH)warn_multiple_tokens_in_named_alternation)warn_ungrouped_named_tokens_in_collectionwarn_name_set_on_empty_Forward!warn_on_parse_using_empty_Forwardwarn_on_assignment_to_Forward%warn_on_multiple_string_args_to_oneof(warn_on_match_first_with_lshift_operator!enable_debug_on_named_expressionsrJrKrZ _debug_names classmethodr]r9r/r-rOrOpsJ05-05-%*"(-%$)!,1)/4,(-%BBvvxxBBBJMMzMMMNSSZSSSL[r/rOc2eZdZdZdZdZdZdZdZdZ dZ d Z d S) Diagnosticsa Diagnostic configuration (all default to disabled) - ``warn_multiple_tokens_in_named_alternation`` - flag to enable warnings when a results name is defined on a :class:`MatchFirst` or :class:`Or` expression with one or more :class:`And` subexpressions - ``warn_ungrouped_named_tokens_in_collection`` - flag to enable warnings when a results name is defined on a containing expression with ungrouped subexpressions that also have results names - ``warn_name_set_on_empty_Forward`` - flag to enable warnings when a :class:`Forward` is defined with a results name, but has no contents defined - ``warn_on_parse_using_empty_Forward`` - flag to enable warnings when a :class:`Forward` is defined in a grammar but has never had an expression attached to it - ``warn_on_assignment_to_Forward`` - flag to enable warnings when a :class:`Forward` is defined but is overwritten by assigning using ``'='`` instead of ``'<<='`` or ``'<<'`` - ``warn_on_multiple_string_args_to_oneof`` - flag to enable warnings when :class:`one_of` is incorrectly called with multiple str arguments - ``enable_debug_on_named_expressions`` - flag to auto-enable debug on all subsequent calls to :class:`ParserElement.set_name` Diagnostics are enabled/disabled by calling :class:`enable_diag` and :class:`disable_diag`. All warnings can be enabled by calling :class:`enable_all_warnings`. rrr$N) r2r7r8rGr_r`rarbrcrdrerfr9r/r-rjrjsL,12-01-%&"()%$%!,-)/0,()%%%r/rj diag_enumrXcDt|jdS)zO Enable a global pyparsing diagnostic flag (see :class:`Diagnostics`). N)rOr[rUrps r- enable_diagrss OOIN#####r/cDt|jdS)zP Disable a global pyparsing diagnostic flag (see :class:`Diagnostics`). N)rOdisablerUrrs r- disable_diagrvs  Y^$$$$$r/c8tdS)zU Enable all global pyparsing diagnostic warnings (see :class:`Diagnostics`). N)rOr]r9r/r-r]r]s   """""r/cmd_line_warn_options warn_env_varc@t|}|D]}|dzddd\}}}}}|ds|s|s|r|dkrd}^|dr|dvrd}|S) Nz:::::rmi pyparsingT)r}F)boolrLlowerrA) rxryr[warn_optw_action w_message w_categoryw_modulew_lines r-_should_enable_warningsrs,  F)  =E=NO2O2OF Mr/PYPARSINGENABLEALLWARNINGS ParserElement 0123456789 ABCDEFabcdefr~c.g|]}|tjv|Sr9)string whitespacerCcs r-rErEs%PPPAQf>O5O5Oa5O5O5Or/_trim_arity_call_liner$cBtvrfdSddd dd}tptjddatdtd |zffd }t d t d j}||_j|_|S)zAdecorator to trim function calls to match the arity of the targetc|Sr)r9)sltr,s r-z_trim_arity.. sttAwwr/rFcTtj||}|d}|ddgS)Nlimitrk) traceback extract_tb)tbrframes frame_summarys r-rz_trim_arity..extract_tbs2%b666r bqb!""r/rorkrrrc |d}d|S#t$rB}r|j}|dddd k}~|r kr dz Yd}~Yd}~wwxYw)NrTrkrr) TypeError __traceback__) argsr5tertrim_arity_type_errorr found_arityr,r max_limitpa_call_line_synths r-wrapperz_trim_arity..wrappers  dDL)"     )B" 2Q///3BQB7;MM*,% 9,,!QJE$HHHH! s A!7AAA!r2 __class__r)_single_arg_builtinsrr extract_stackgetattrr2rG) r,r LINE_DIFFr func_namerrrrs `` @@@@r- _trim_arityrs ###&&&&& EK####I3Zi6MTU6V6V6VWY6Z/24I!4Ly4XY8j'$ *D*D*MNNI GlGO Nr/Ffnmessagefatalc||nd|rtntttfd}|S)aC Function to convert a simple predicate function that returns ``True`` or ``False`` into a parse action. Can be used in places when a parse action is required and :class:`ParserElement.add_condition` cannot be used (such as when adding a condition to an operator level in :class:`infix_notation`). Optional keyword arguments: - ``message`` - define a custom message to be used in the raised exception - ``fatal`` - if True, will raise :class:`ParseFatalException` to stop parsing immediately; otherwise will raise :class:`ParseException` Nzfailed user-defined conditioncVt|||s ||dSr))r)rrrexc_typermsgs r-paz%condition_as_parse_action..paVs=BBq!QKK   &(1a%% % & &r/)ParseFatalExceptionParseExceptionrr)rrrrrrs` @@r-condition_as_parse_actionrBsk (''.MC&+?""H RB 2YY&&&&&&Y& Ir/instringlocexpr cache_hitc|rdnd}td|||t||t||t ||dt||dz zdS)Nrr~z&{}Match {} at loc {}({},{}) {} {}^ r)printformatlinenocolline)rrrr cache_hit_strs r-_default_start_debug_actionr^s%,CC"M 6 = =sH%%C""S(##s3))A-.       r/startlocendloctoksc~|rdnd}td|||dS)Nrr~z{}Matched {} -> {})rras_list)rrrrrrrs r-_default_success_debug_actionrqsA%,CC"M  % %mT4<<>> J JKKKKKr/excc |rdnd}td||t|j|dS)Nrr~z {}Match {} failed, {} raised: {})rrtyper2)rrrrrrs r-_default_exception_debug_actionr}sS%,CC"M *11 4c!3S  r/cdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nr9)rs r-null_debug_actionrr/c'eZdZUdZdZeed<dZeed<dZ e j e ed<e ded dfd Ze d e d dfd ZGd deZddefdZded dfdZddZ ddddededed dfdZddZdded dfdZded dfdZded dfdZded dfd Zd!ed dfd"Zd#Z d$Z!dd%Z"d&Z# dd e$e%e&ffd'Z'dd(ed)e%d*ed e%fd+Z(d(ed)e%d efd,Z)e*Z+iZ,e j-e$e%d-efe$e%e.e&e/fffed.<iZ0e*Z1d/d/gZ2 dd e$e%e&ffd0Z3e'Z4e dd1Z5dZ6dZ7e dd2Z8e ddd3d4e j e%d dfd5Z9e ddd3d4e%d7ed dfd8Z: ddd9d(ed:ed;ed e&fd<Z;ee%d?ed@edAe%d e=e$e&e%e%fddff dBZ>ddCd(ed@ed efdDZ?ee%d@edAe%d e&f dEZ@eZe@Ze?ZeVZeWZe\Ze]Ze_ZebZemZesZeSZeTZdS)rz)Abstract base level parser element class.z DEFAULT_WHITE_CHARSFverbose_stacktraceN_literalStringClasscharsrXch|t_tD]}|jrt ||_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline Word(alphas)[1, ...].parse_string("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.set_default_whitespace_chars(" \t") Word(alphas)[1, ...].parse_string("abc def\nghi jkl") # -> ['abc', 'def'] N)rr_builtin_exprscopyDefaultWhiteCharsset whiteChars)rrs r-set_default_whitespace_charsz*ParserElement.set_default_whitespace_charss@-2 )# - -D) -"%e** - -r/r\c|t_dS)al Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parse_string("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inline_literals_using(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parse_string("1999/12/31") # -> ['1999', '12', '31'] N)rr)r\s r-inline_literals_usingz#ParserElement.inline_literals_usings(-0 )))r/cpeZdZUejeed<ejeed<ejeed<dS)ParserElement.DebugActions debug_try debug_match debug_failN) r2r7r8typingOptionalDebugStartAction__annotations__DebugSuccessActionDebugExceptionActionr9r/r- DebugActionsrsN?#34444_%78888O$8999999r/rsavelistct|_d|_d|_d|_d|_||_d|_ttj |_ d|_ d|_ d|_t|_d|_d|_d|_d|_d|_|ddd|_d|_d|_g|_dS)NTFr~)list parseAction failAction customName _defaultName resultsName saveAsListskipWhitespacerrrrrmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResultsr debugActions callPreparse callDuringTrysuppress_warnings_)r+rs r-r.zParserElement.__init__s.2ff<@ ""m?@@%)"# 26&&  !   --dD$?? "57r/ warning_typec:|j||S)aY Suppress warnings emitted for a particular diagnostic on this expression. Example:: base = pp.Forward() base.suppress_warning(Diagnostics.warn_on_parse_using_empty_Forward) # statement would normally raise a warning, but is now suppressed print(base.parseString("x")) )rappend)r+rs r-suppress_warningzParserElement.suppress_warnings  &&|444 r/ctj|}|jdd|_|jdd|_|jrt t j|_|S)a7 Make a copy of this :class:`ParserElement`. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).set_parse_action(lambda toks: int(toks[0])) integerK = integer.copy().add_parse_action(lambda toks: toks[0] * 1024) + Suppress("K") integerM = integer.copy().add_parse_action(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") print((integerK | integerM | integer)[1, ...].parse_string("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of ``expr.copy()`` is just ``expr()``:: integerM = integer().add_parse_action(lambda toks: toks[0] * 1024 * 1024) + Suppress("M") N)copyrrrrrrr)r+cpys r-r zParserElement.copysZ,ioo*111-*111-  % D !BCCCN r/)listAllMatchesrUlist_all_matchesrc6|p|}|||S)a Define name for referencing matching tokens as a nested attribute of the returned parse results. Normally, results names are assigned as you would assign keys in a dict: any existing value is overwritten by later values. If it is necessary to keep all values captured for a particular results name, call ``set_results_name`` with ``list_all_matches`` = True. NOTE: ``set_results_name`` returns a *copy* of the original :class:`ParserElement` object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, ``expr("name")`` in place of ``expr.set_results_name("name")`` - see :class:`__call__`. If ``list_all_matches`` is required, use ``expr("name*")``. Example:: date_str = (integer.set_results_name("year") + '/' + integer.set_results_name("month") + '/' + integer.set_results_name("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") )_setResultsName)r+rUrrs r-set_results_namezParserElement.set_results_names%<(;+;##D.999r/c||S|}|dr |dd}d}||_| |_|S)NrrT)r endswithrr)r+rUrnewselfs r-rzParserElement._setResultsName1sW <K))++ ==   "9D!N"#11r/T break_flagc|r|jdfd }|_||_n&t|jdr|jj|_|S)z Method to invoke the Python pdb debugger when this element is about to be parsed. Set ``break_flag`` to ``True`` to enable, ``False`` to disable. TcPddl}|||||SNr)pdb set_trace)rr doActions callPreParser _parseMethods r-breakerz(ParserElement.set_break..breakerEs1  #|Hc9lKKKr/_originalParseMethodTT)_parser hasattr)r+rrrs @r- set_breakzParserElement.set_break<sq  ?;L L L L L L L,8G (!DKKt{$:;; ?"k>  r/fnsct|dgkrg|_nhtd|Dstdd|D|_|d|dd|_|S)ao Define one or more actions to perform when successfully matching parse element definition. Parse actions can be called to perform data conversions, do extra validation, update external data structures, or enhance or replace the parsed tokens. Each parse action ``fn`` is a callable method with 0-3 arguments, called as ``fn(s, loc, toks)`` , ``fn(loc, toks)`` , ``fn(toks)`` , or just ``fn()`` , where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a :class:`ParseResults` object The parsed tokens are passed to the parse action as ParseResults. They can be modified in place using list-style append, extend, and pop operations to update the parsed list elements; and with dictionary-style item set and del operations to add, update, or remove any named results. If the tokens are modified in place, it is not necessary to return them with a return statement. Parse actions can also completely replace the given tokens, with another ``ParseResults`` object, or with some entirely different object (common for parse actions that perform data conversions). A convenient way to build a new parse result is to define the values using a dict, and then create the return value using :class:`ParseResults.from_dict`. If None is passed as the ``fn`` parse action, all previously added parse actions for this expression are cleared. Optional keyword arguments: - call_during_try = (default= ``False``) indicate if parse action should be run during lookaheads and alternate testing. For parse actions that have side effects, it is important to only call the parse action once it is determined that it is being called as part of a successful parse. For parse actions that perform additional validation, then call_during_try should be passed as True, so that the validation code is included in the preliminary "try" parses. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`parse_string` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: # parse dates in the form YYYY/MM/DD # use parse action to convert toks from str to int at parse time def convert_to_int(toks): return int(toks[0]) # use a parse action to verify that the date is a valid date def is_valid_date(instring, loc, toks): from datetime import date year, month, day = toks[::2] try: date(year, month, day) except ValueError: raise ParseException(instring, loc, "invalid date given") integer = Word(nums) date_str = integer + '/' + integer + '/' + integer # add parse actions integer.set_parse_action(convert_to_int) date_str.set_parse_action(is_valid_date) # note that integer fields are now ints, not strings date_str.run_tests(''' # successful parse - note that integer fields were converted to ints 1999/12/31 # fail - invalid date 1999/13/31 ''') Nc34K|]}t|VdSr))callablerCrs r- z1ParserElement.set_parse_action..s(22x||222222r/zparse actions must be callablec,g|]}t|Sr9rr)s r-rEz2ParserElement.set_parse_action..s>>>B B>>>r/call_during_tryrF)rrallrgetrr+r%kwargss r-set_parse_actionzParserElement.set_parse_actionSsV 99  !D  22c22222 B @AAA>>#>>>D !'!6::ou#E#E""D  r/c|xjd|Dz c_|jp)|d|dd|_|S)z Add one or more parse actions to expression's list of parse actions. See :class:`set_parse_action`. See examples in :class:`copy`. c,g|]}t|Sr9r,r)s r-rEz2ParserElement.add_parse_action..s;;;[__;;;r/r-rF)rrr/r0s r-add_parse_actionzParserElement.add_parse_actionsa ;;s;;;;!/ 6:: vzz/5AA4 4  r/c |D]S}|jt||d|ddT|jp)|d|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See :class:`set_parse_action` for function call signatures. Unlike ``set_parse_action``, functions passed to ``add_condition`` need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException - call_during_try = boolean to indicate if this method should be called during internal tryParse calls, default=False Example:: integer = Word(nums).set_parse_action(lambda toks: int(toks[0])) year_int = integer.copy() year_int.add_condition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parse_string("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) rrF)rrr-r)rr rr/r)r+r%r1rs r- add_conditionzParserElement.add_conditions.  B   # #) 9 5 5VZZQV=W=W     "/ 6:: vzz/5AA4 4  r/rc||_|S)a Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments ``fn(s, loc, expr, err)`` where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw :class:`ParseFatalException` if it is desired to stop parsing immediately.)r)r+rs r-set_fail_actionzParserElement.set_fail_actions r/cd}|r;d}|jD]/} |||\}}d}#t$rY,wxYw|;|SNTF)rr"r)r+rr exprsFoundedummys r-_skipIgnorableszParserElement._skipIgnorabless  J%  *%&XXh%<%< U%) *&D  s . ;;c|jr|||}|jr;t|}|j}||kr|||vr|dz }||kr |||v|SNr)rr?rlenr)r+rrinstrlen white_charss r-preParsezParserElement.preParses   6&&x55C   8}}H/K..Xc]k%A%Aq..Xc]k%A%A r/c |gfSr)r9r+rrrs r- parseImplzParserElement.parseImpls Bwr/c|Sr)r9r+rr tokenlists r- postParsezParserElement.postParsesr/c  d\}}}|j}t|} |s|jr |r|jr|||} n|} | } |jjr|j|| |d|js| | krA ||| |\}} n?#t$rt|| |j |wxYw||| |\}} n#t$rO} |jj r|j || || d|jr||| || d} ~ wwxYw|r|jr|||} n|} | } |js| | krA ||| |\}} n?#t$rt|| |j |wxYw||| |\}} |||| } t| |j|j|j}|jrM|s|jrC|r |jD]y} ||| |} n$#t$r}td}||d}~wwxYw| B| |ur>t| |j|jot+| tt,f|j}zn#t$r0} |jj r|j || || dd} ~ wwxYw|jD]y} ||| |} n$#t$r}td}||d}~wwxYw| B| |ur>t| |j|jot+| tt,f|j}z|r+|jjr|j|| |||d||fS)NrrrkF)asListmodalz exception raised in parse action)rrBrrrErrrrH IndexErrorrr ExceptionrrLr rrrrr isinstancerr)r+rrrrTRYMATCHFAIL debugging len_instringpre_loc tokens_starttokenserr ret_tokensrparse_action_excrs r- _parseNoCachezParserElement._parseNoCaches#UDJ 8}} & K& K "D$5""mmHc::GG!G& $.U%//,eTTT%OL)@)@X&*nnXw &R&R VV%XXX,X|T[RVWWWX#'..7I"N"NKC   $/%00 ,c5?GOOHlD#FFF   1 --#66"L! KW %<%<T"&..7I"N"NKC!TTT(<dSSST#nnXw JJ V#v66! D$T_DDU     ( ( d.@( ' ".<%'R, %K%KFF)<<<"01S"T"TC"%+;;<"-& 2J2J)5 & $ 0'+(M$.v d7K$L$L&*&7 ***J!(3)44$lD#u *B8!#HlJ!G!G%888,-OPP!'778)fJ.F.F%1" ,#'?$I *6L$3G H H"&"3 &&&    , !--lCz5JsACBC"CC D7(A D22D7,F"F) J H,+J, I 6II  AJ K +K  K K++ L 5LL rr raise_fatalc |||ddS#t$r|rt|||j|wxYw)NFrr)r"rrr)r+rrr`s r- try_parsezParserElement.try_parsense C;;x;>>qA A" C C C  3 TBB B Cs  %Acd |||dS#ttf$rYdSwxYwr;)rcrrQ)r+rrs r-can_parse_nextzParserElement.can_parse_nextvsK  NN8S ) ) )4 +   55 s //Forwardrecursion_memosrc xd\}}d\}}} |||||f} tj5tj} | | } | | jurtj|xxdz cc< |||||} | | | d| d|f| cdddS#t$r)} | | | j | j d} ~ wwxYwtj|xxdz cc<|j r<|j jr0 |j |||dn#t$rYnwxYwt!| t"rF|j r=|j jr1 |j |||| dn#t$rYnwxYw| | d| d| d}}}|j r>|j jr2 |j |||||dn#t$rYnwxYw||fcdddS#1swxYwYdS)N)rrrNrrT)rrk)rpackrat_cache_lock packrat_cacher/ not_in_cachepackrat_cache_statsr_rr ParseBaseExceptionrrrrrrrSrRrr)r+rrrrHITMISSrTrUrVlookupcachevaluepeloc_resultrs r- _parseCachezParserElement._parseCaches6 T"UD#|Y?  -( $( $!/EIIf%%E***1$7771<777! ..xiVVE IIfuQxq#&FGGG ( $( $( $( $( $( $( $( $*IIflblBG&<===1#666!;666:$"3"=)33Hc4SW3XXXX$eY// z!d&7&B!! -88 (#tUd9 )!!! D!K',Qxq%(ff:$"3"?)55$dFD&D6%V|Q( $( $( $( $( $( $( $( $( $( $( $( $( $( $( $( $( $( $sAH/%C=8H/ C5 $C00C550H/&EH/ EH/E+H/>FH/ F+(H/*F++AH/. HH/ HH/HH//H36H3ctjdgttjztjdd<tjdSr)rrjclearrBrlrgr9r/r- reset_cachezParserElement.reset_caches^#))+++01sS  -6 6 0 )!!!, %++-----r/ctdt_dt_tjt_dS)a$ Disables active Packrat or Left Recursion parsing and their memoization This method also works if neither Packrat nor Left Recursion are enabled. This makes it safe to call before activating Packrat nor Left Recursion to clear any previous settings. FN)rry_left_recursion_enabled_packratEnabledr_r"r9r/r-disable_memoizationz!ParserElement.disable_memoizations7 !!###05 -(- %,: r/)forcecache_size_limitc(|rtntjrtd|t t_n3|dkrt |t_ntd|zdt_dS)a# Enables "bounded recursion" parsing, which allows for both direct and indirect left-recursion. During parsing, left-recursive :class:`Forward` elements are repeatedly matched with a fixed recursion depth that is gradually increased until finding the longest match. Example:: import pyparsing as pp pp.ParserElement.enable_left_recursion() E = pp.Forward("E") num = pp.Word(pp.nums) # match `num`, or `num '+' num`, or `num '+' num '+' num`, ... E <<= E + '+' - num | num print(E.parse_string("1+2+3")) Recursion search naturally memoizes matches of ``Forward`` elements and may thus skip reevaluation of parse actions during backtracking. This may break programs with parse actions which rely on strict ordering of side-effects. Parameters: - cache_size_limit - (default=``None``) - memoize at most this many ``Forward`` elements during matching; if ``None`` (the default), memoize all ``Forward`` elements. Bounded Recursion parsing works similar but not identical to Packrat parsing, thus the two cannot be used together. Use ``force=True`` to disable any previous, conflicting settings. 0Packrat and Bounded Recursion are not compatibleNr)capacityzMemo size of %sT) rr}r| RuntimeError_UnboundedMemorg_LRUMemoNotImplementedErrorr{rr~s r-enable_left_recursionz#ParserElement.enable_left_recursionsH  S  - - / / / /  * SQRR R  #,:,<,N,O,O,OM ) )%&7:J&JKK K04 ---r/r~c<|rtntjrtdtjsXdt_|t t_nt|t_tjt_ dSdS)af Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default= ``128``) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method :class:`ParserElement.enable_packrat`. For best results, call ``enable_packrat()`` immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enable_packrat() Packrat parsing works similar but not identical to Bounded Recursion parsing, thus the two cannot be used together. Use ``force=True`` to disable any previous, conflicting settings. rTN) rr}r{rr|rrjrrvr"rs r-enable_packratzParserElement.enable_packrats@  S  - - / / / /  2 SQRR R, =,0M )'.=.?.? ++.89I.J.J +#0#>> res = Word('a').parse_string('aaaaabaaa') >>> print(res) ['aaaaa'] The parsing behavior varies by the inheriting class of this abstract class. Please refer to the children directly to see more examples. It raises an exception if parse_all flag is set and instring does not match the whole grammar. >>> res = Word('a').parse_string('aaaaabaaa', parse_all=True) Traceback (most recent call last): ... pyparsing.ParseException: Expected end of text, found 'b' (at char 5), (line:1, col:6) rN)rryr streamlinerr expandtabsr"rEEmpty StringEndrmrwith_traceback) r+rrrr=rr[sers r- parse_stringzParserElement.parse_string4s!Z(!!###  OO   !  A LLNNNN} -**,,H ++h22KC )mmHc22WWy{{* (C(((M" / / // /((...  /s3A$C D #"DD )r maxMatches max_matchesoverlaprrc#*Kt||}|js||jD]}||js!t |}t|}d}|j} |j } t d} ||kr| |kr | ||} | || d\} }| |krS| dz } |r%t| | | d|| | fV|r| ||}||kr| }n$|dz }n| }n| dz}n#t$r| dz}YnwxYw||kr | |kdSdSdSdS#t$r'}tjr|dd}~wwxYw)at Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional ``max_matches`` argument, to clip scanning after 'n' matches are found. If ``overlap`` is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See :class:`parse_string` for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens, start, end in Word(alphas).scan_string(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rFrr)r[startendN)minrrrrstrrrBrEr"r resetCacherrOrrmrr)r+rrrrrr=rCr preparseFnparseFnmatchesprelocnextLocr[nextlocrs r- scan_stringzParserElement.scan_stringys.N[11   OO   !  A LLNNNN} 28}}//11Hx==] +  """" ///g &:&:)'Z#66F&-ghU&S&S&SOGV}}1  !.4mmoo-3+2!"!"%fg5555"*&0j3&?&?G&}}&- #q")CC$qj/&%%% 1*CCC% //g &:&:&:&://&:&://8" / / // /((...  /s=/ E!<D8AE!8E E! E  E!! F+"F  Frcg}d}d|_ |||D]\}}}|||||rt|tr||z }nUt|t r+t|ts||n|||}|||dd|D}d dt|DS#t$r'}tj r|dd}~wwxYw)ab Extension to :class:`scan_string`, to modify matching text with modified tokens that may be returned from a parse action. To use ``transform_string``, define a grammar and attach a parse action to it that modifies the returned token list. Invoking ``transform_string()`` on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. ``transform_string()`` returns the resulting transformed string. Example:: wd = Word(alphas) wd.set_parse_action(lambda toks: toks[0].title()) print(wd.transform_string("now is the winter of our discontent made glorious summer by this sun of york.")) prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTrNcg|]}||Sr9r9rCos r-rEz2ParserElement.transform_string..s'''Q'1'''r/r~c,g|]}t|Sr9r)rCrs r-rEz2ParserElement.transform_string..s:::qCFF:::r/)rrr rSr rrr#extendjoinrrmrrr) r+rroutlastErrr=rs r-transform_stringzParserElement.transform_stringso(  /++HE+BB  1a 8E!G,---&!!\22&qyy{{*#Ax00&Ax9P9P& 1  1  JJx' ( ( (''c'''C77::HSMM:::;; ;! / / // /((...  /sDD## E-"EEct||} td||||DS#t$r'}tjr|dd}~wwxYw)a Another extension to :class:`scan_string`, simplifying the access to the tokens found to match the given parse expression. May be called with optional ``max_matches`` argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.search_string("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.search_string("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] cg|]\}}}| Sr9r9)rCrrr=s r-rEz/ParserElement.search_string..sVVVwq!QVVVr/rN)rr rrmrrr)r+rrrrrs r- search_stringzParserElement.search_strings8[11  /VV$"2"28Zu"2"U"UVVV " / / // /((...  /s.A A2 "A--A2)includeSeparatorsmaxsplitinclude_separatorsc#K|p|}d}|||D] \}}}|||V|r |dV|}!||dVdS)aT Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to limit the number of splits; and the optional ``include_separators`` argument (default= ``False``), if the separating matching text should be included in the split results. Example:: punc = one_of(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)rN)r) r+rrrrlastrrr=s r-rLzParserElement.split(s..C1C''h'GG  GAq!46" " " "  d DDtuuor/c:|turt|St|tr||}t|t s4t dt|j t||gS)ah Implementation of ``+`` operator - returns :class:`And`. Adding strings to a :class:`ParserElement` converts them to :class:`Literal`s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print(hello, "->", greet.parse_string(hello)) prints:: Hello, World! -> ['Hello', ',', 'World', '!'] ``...`` may be used as a parse expression as a short form of :class:`SkipTo`. Literal('start') + ... + Literal('end') is equivalent to: Literal('start') + SkipTo('end')("_skipped*") + Literal('end') Note that the skipped text is returned with '_skipped' as a results name, and to support having multiple skips in the same parser, the value returned is a list of all skipped text. 4Cannot combine element of type {} with ParserElement) Ellipsis _PendingSkiprSr#rrrrrr2Andr+others r-__add__zParserElement.__add__Hs6 H  %% % eX & & 4,,U33E%// FMMKK(  D%=!!!r/c:|turt|d|zSt|tr||}t|t s4t dt|j ||zS)zd Implementation of ``+`` operator when left operand is not a :class:`ParserElement` _skipped*r) rSkipTorSr#rrrrrr2rs r-__radd__zParserElement.__radd__ps H  6$<< ,,t3 3 eX & & 4,,U33E%// FMMKK(  t|r/c&t|tr||}t|ts4t dt |j|t z|zS)zX Implementation of ``-`` operator, returns :class:`And` with error stop r) rSr#rrrrrr2r _ErrorStoprs r-__sub__zParserElement.__sub__s eX & & 4,,U33E%// FMMKK(  cnn&&&..r/ct|tr||}t|ts4t dt |j||z S)zd Implementation of ``-`` operator when left operand is not a :class:`ParserElement` rrSr#rrrrrr2rs r-__rsub__zParserElement.__rsub__x eX & & 4,,U33E%// FMMKK(  t|r/c&|turd}nAt|tr,|ddtfkrd|ddzdzdd}t|tr|d}}nvt|tr,td|D}|d zdd}|d d|df}t|dtrY|dQ|ddkrt S|ddkrt S|dzt zSt|dtr&t|dtr |\}}||z}nst d d d |Dt d t|j |dkrtd|dkrtd||cxkrdkrnntgS|rIfd|r5|dkr|z}nHtg|z|z}n(|}n|dkr}ntg|z}|S)a Implementation of ``*`` operator, allows use of ``expr * 3`` in place of ``expr + expr + expr``. Expressions may also be multiplied by a 2-integer tuple, similar to ``{min, max}`` multipliers in regular expressions. Tuples may also include ``None`` as in: - ``expr*(n, None)`` or ``expr*(n, )`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr*(None, n)`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr*(None, None)`` is equivalent to ``ZeroOrMore(expr)`` - ``expr*(1, None)`` is equivalent to ``OneOrMore(expr)`` Note that ``expr*(None, n)`` does not raise an exception if more than n exprs exist in the input stream; that is, ``expr*(None, n)`` does not enforce a maximum number of expr occurrences. If this behavior is desired, then write ``expr*(None, n) + ~expr`` )rNNrrr)rkrc30K|]}|tur|ndVdSr))rrs r-r*z(ParserElement.__mul__..s0JJqq00!!dJJJJJJr/)NNz.cannot multiply ParserElement and ({}) objects,c3>K|]}t|jVdSr)rr2)rCitems r-r*z(ParserElement.__mul__..s+ G Gd!4 G G G G G Gr/z,cannot multiply ParserElement and {} objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuecj|dkrt|dz zStSrA)Opt)nmakeOptionalListr+s r-rz/ParserElement.__mul__..makeOptionalLists;q55t&6&6q1u&=&==>>>t99$r/) rrStupleint ZeroOrMore OneOrMorerrrrr2 ValueErrorr)r+r minElements optElementsr5rs` @r-__mul__zParserElement.__mul__s( H  EE u % % 5%){*B*BE!""I%/!4E eS ! ! ',aKK u % % JJEJJJJJE\)2A2.EQxE!H %(C(( U1X-=8q==%d+++8q==$T??*%(?Z-=-===E!Hc** z%(C/H/H +0( [{* DKK G G G G GGG >EEKK(  ??NOO O ??R  + * * * * * * * * *r77N  0 % % % % % %  4!##!1!1+!>!>>CCtf{2336F6F{6S6SSCC&&{33a4&;.// r/c,||Sr))rrs r-__rmul__zParserElement.__rmul__s||E"""r/c>|turt|dSt|tr||}t|t s4t dt|j t||gS)zP Implementation of ``|`` operator - returns :class:`MatchFirst` T) must_skipr) rrrSr#rrrrrr2 MatchFirstrs r-__or__zParserElement.__or__s H  555 5 eX & & 4,,U33E%// FMMKK(  4-(((r/ct|tr||}t|ts4t dt |j||zS)zd Implementation of ``|`` operator when left operand is not a :class:`ParserElement` rrrs r-__ror__zParserElement.__ror__rr/c t|tr||}t|ts4t dt |jt||gS)zH Implementation of ``^`` operator - returns :class:`Or` r) rSr#rrrrrr2Orrs r-__xor__zParserElement.__xor__s eX & & 4,,U33E%// FMMKK(  4-   r/ct|tr||}t|ts4t dt |j||z S)zd Implementation of ``^`` operator when left operand is not a :class:`ParserElement` rrrs r-__rxor__zParserElement.__rxor__#rr/c t|tr||}t|ts4t dt |jt||gS)zJ Implementation of ``&`` operator - returns :class:`Each` r) rSr#rrrrrr2Eachrs r-__and__zParserElement.__and__1s eX & & 4,,U33E%// FMMKK(  T5M"""r/ct|tr||}t|ts4t dt |j||zS)zd Implementation of ``&`` operator when left operand is not a :class:`ParserElement` rrrs r-__rand__zParserElement.__rand__?rr/c t|S)zL Implementation of ``~`` operator - returns :class:`NotAny` )NotAnyr+s r- __invert__zParserElement.__invert__Msd||r/c  t|tr|f}t|n#t$r||f}YnwxYwt |dkr`td|ddt |dkr"dt |nd|t |ddz}|S)a{ use ``[]`` indexing notation as a short form for expression repetition: - ``expr[n]`` is equivalent to ``expr*n`` - ``expr[m, n]`` is equivalent to ``expr*(m, n)`` - ``expr[n, ...]`` or ``expr[n,]`` is equivalent to ``expr*n + ZeroOrMore(expr)`` (read as "at least n instances of ``expr``") - ``expr[..., n]`` is equivalent to ``expr*(0, n)`` (read as "0 to n instances of ``expr``") - ``expr[...]`` and ``expr[0, ...]`` are equivalent to ``ZeroOrMore(expr)`` - ``expr[1, ...]`` is equivalent to ``OneOrMore(expr)`` ``None`` may be used in place of ``...``. Note that ``expr[..., n]`` and ``expr[m, n]``do not raise an exception if more than ``n`` ``expr``s exist in the input stream. If this behavior is desired, then write ``expr[..., n] + ~expr``. rkz,only 1 or 2 index arguments supported ({}{})Nrmz... [{}]r~)rSr#iterrrBrr)r+keyr5s r- __getitem__zParserElement.__getitem__Ws, #x(( f IIII   *CCC  s88a<<>EEGCHHqLLZ..s3xx888b U3rr7^^# s '*;;cX|||S|S)a Shortcut for :class:`set_results_name`, with ``list_all_matches=False``. If ``name`` is given with a trailing ``'*'`` character, then ``list_all_matches`` will be passed as ``True``. If ``name` is omitted, same as calling :class:`copy`. Example:: # these are equivalent userdata = Word(alphas).set_results_name("name") + Word(nums + "-").set_results_name("socsecno") userdata = Word(alphas)("name") + Word(nums + "-")("socsecno") )rr r+rUs r-__call__zParserElement.__call__s,  ''-- -99;; r/c t|S)z Suppresses the output of this :class:`ParserElement`; useful to keep punctuation from cluttering up returned output. )Suppressrs r-suppresszParserElement.suppresss ~~r/ recursivecd|_|S)z Enables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. :param recursive: If ``True`` (the default), also enable whitespace skipping in child elements (if any) Trr+rs r-ignore_whitespacezParserElement.ignore_whitespaces# r/cd|_|S)a| Disables the skipping of whitespace before matching the characters in the :class:`ParserElement`'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. :param recursive: If true (the default), also disable whitespace skipping in child elements (if any) Frrs r-leave_whitespacezParserElement.leave_whitespaces$ r/ copy_defaultscJd|_t||_||_|S)z8 Overrides the default whitespace chars T)rrrr)r+rrs r-set_whitespace_charsz"ParserElement.set_whitespace_charss& #e**%2" r/cd|_|S)z Overrides default behavior to expand ```` s to spaces before parsing the input string. Must be called before ``parse_string`` when the input grammar contains elements that match ```` characters. T)rrs r-parse_with_tabszParserElement.parse_with_tabss   r/rc:ddl}t|trt|}t|tr$||jvr|j|n9|jt||S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = Word(alphas)[1, ...] patt.parse_string('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(c_style_comment) patt.parse_string('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] rN)rrSr#rrr r )r+rrs r-ignorezParserElement.ignores  eX & & $UOOE eX & & <D,,, ''...   # #HUZZ\\$:$: ; ; ; r/ start_actionsuccess_actionexception_actioncv||pt|pt|pt|_d|_|S)a  Customize display of debugging messages while doing pattern matching: - ``start_action`` - method to be called when an expression is about to be parsed; should have the signature ``fn(input_string: str, location: int, expression: ParserElement, cache_hit: bool)`` - ``success_action`` - method to be called when an expression has successfully parsed; should have the signature ``fn(input_string: str, start_location: int, end_location: int, expression: ParserELement, parsed_tokens: ParseResults, cache_hit: bool)`` - ``exception_action`` - method to be called when expression fails to parse; should have the signature ``fn(input_string: str, location: int, expression: ParserElement, exception: Exception, cache_hit: bool)`` T)rrrrrr)r+rrrs r-set_debug_actionszParserElement.set_debug_actionssE$!--  77  ;;  ? ?     r/flagcf|r'|tttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set ``flag`` to ``True`` to enable, ``False`` to disable. Example:: wd = Word(alphas).set_name("alphaword") integer = Word(nums).set_name("numword") term = wd | integer # turn on debugging for wd wd.set_debug() term[1, ...].parse_string("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using :class:`set_debug_actions`. Prior to attempting to match the ``wd`` expression, the debugging message ``"Match at loc (,)"`` is shown. Then if the parse succeeds, a ``"Matched"`` message is shown, or an ``"Exception raised"`` message is shown. Also note the use of :class:`set_name` to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the :class:`Word` expression without calling ``set_name`` is ``"W:(A-Za-z)"``. F)rrrrr)r+rs r- set_debugzParserElement.set_debugsAJ    " "+-/     DJ r/cP|j||_|jSr))r_generateDefaultNamers r- default_namezParserElement.default_name(s(   $ $ 9 9 ; ;D   r/cdS)zg Child classes must define this method, which defines how the ``default_name`` is set. Nr9rs r-rz"ParserElement._generateDefaultName.rr/cr||_d|jz|_tjr||S)a\ Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parse_string("ABC") # -> Exception: Expected W:(0-9) (at char 0), (line:1, col:1) Word(nums).set_name("integer").parse_string("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) Expected )rrUrrOrfrrs r-set_namezParserElement.set_name4s9!DI-  5  NN    r/c,|j|jn|jSr))rrrs r-rUzParserElement.nameAs#'/"=t4CTTr/c|jSr)rUrs r-__str__zParserElement.__str__Fs yr/c t|Sr)rrs r-__repr__zParserElement.__repr__Is4yyr/c"d|_d|_|SNT)rrrs r-rzParserElement.streamlineLs  r/cgSr)r9rs r-recursezParserElement.recurseQ r/cz|dd|gz}|D]}||dSr))r&_checkRecursionr+parseElementListsubRecCheckListr=s r-r)zParserElement._checkRecursionTsO*111-6 / /A  o . . . . / /r/c0|gdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)r))r+ validateTraces r-validatezParserElement.validateYs R     r/utf-8file_or_filenameencodingch|p|} |}nN#t$rAt|d|5}|}dddn #1swxYwYYnwxYw |||S#t$r'}t jr|dd}~wwxYw)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rr2N)readAttributeErroropenrrmrrr)r+r1r2rr file_contentsfrs r- parse_filezParserElement.parse_file_s(y ),1133MM ) ) )&h??? )1 !  ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) /$$]H== =! / / // /((...  /sJA&A A&A A&A A&%A&*B B1 "B,,B1c||urdSt|tr||dSt|tr t |t |kSdS)NTrF)rSr#rrvarsrs r-__eq__zParserElement.__eq__{sf 5==4 x ( ( -<<<66 6 } - - -::e, ,ur/c t|Sr))idrs r-__hash__zParserElement.__hash__s $xxr/ test_stringcz|o|} |t||dS#t$rYdSwxYw)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - ``test_string`` - to test against this expression for a match - ``parse_all`` - (default= ``True``) - flag to pass to :class:`parse_string` when running tests Example:: expr = Word(nums) assert expr.matches("100") r=TF)rrrm)r+rCrrs r-rzParserElement.matchess[ )     c+..(  C C C4!   55 s $, ::#)rfullDump printResults failureTestsrLtestscomment full_dump print_results failure_tests post_parsefilewith_line_numbersrFrGrHrLc  V ddlm}| o|} | o|} | o|} | p|} |p|}t|trFt |jfd|D}t|trt|}| tj }|j }g}g}d}td tdt}d}|D]}|||d s|r/|s-|| r||n|L|sO|rdd|znd | r||n|g}g} |||}||| }|o| }| |||}|`t|t.r(||nJ|t3|n'||n#t4$ru}||| |d |jt |j|Yd}~nxd}~wwxYw||| nE#t:$r}t|t<rdnd }|||dt3|zt@j!r,|"tGj$|j%|o| }|}Yd}~nd}~wt4$r}|dt |j|t@j!r,|"tGj$|j%|o| }|}Yd}~nd}~wwxYw|d | r|d||||f||fS)a Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - ``tests`` - a list of separate test strings, or a multiline string of test strings - ``parse_all`` - (default= ``True``) - flag to pass to :class:`parse_string` when running tests - ``comment`` - (default= ``'#'``) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - ``full_dump`` - (default= ``True``) - dump results as list followed by results names in nested outline; if False, only dump nested list - ``print_results`` - (default= ``True``) prints test output to stdout - ``failure_tests`` - (default= ``False``) indicates if these tests are expected to fail parsing - ``post_parse`` - (default= ``None``) optional callback for successful parse results; called as `fn(test_string, parse_results)` and returns a string to be added to the test output - ``file`` - (default= ``None``) optional file-like object to which test output will be written; if None, will default to ``sys.stdout`` - ``with_line_numbers`` - default= ``False``) show test strings with line and column numbers Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if ``failure_tests`` is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.run_tests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.run_tests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failure_tests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.run_tests(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading ``'r'``.) r)pyparsing_testc&g|] }|Sr9r9)rC test_line line_strips r-rEz+ParserElement.run_tests..s#XXXyZZ **XXXr/NT\n uFr~r=)fullz{} failed: {}: {}z(FATAL)zFAIL: zFAIL-EXCEPTION: {}: {})&testingrRrSr#rstriprstrip splitlinesLiteralsysstdoutwriter5 replace_withr  quoted_stringrr rPrrlstriprr dumprrRrr2rmrexplainrrrr format_tbr)r+rIrrJrKrLrMrNrOrPrrFrGrHrLrRprint_ allResultscommentssuccessNLBOMrrrupp_valuer=rsrrrUs @r- run_testszParserElement.run_testss` ,+++++) ) #5 #4} + eX & & Ye*JXXXXELLNNtyy****B7HO00333aCH& ;'' 66**1*AA "6,&6(#,9Q#7#7#/)(LAA: # 8==?? ; ; ; ; # 3x== 9 9 9 9JJv{{}}555$ 6;;H;#=#=>>> /66 ) 2DGG4DaJJv{{{99::::E&   %/4G%H%HP b 2::<<((( 8c"gg-... 3FJJy223CDDEEE!2l    3::499;MsSSTTT 3GJJy233DEEFFF!2l  6 JJrNNN 'tyy~~&&&   q&k * * * * ""s@?LBI'' K&1A*K!!K& QB#O QA9QQr$ output_htmlverticalshow_results_names show_groupsc  ddlm}m}n"#t$r}t d|d}~wwxYw|||||||} t |ttfrKt|dd5} | || ddddS#1swxYwYdS| || dS) a Create a railroad diagram for the parser. Parameters: - output_html (str or file-like object) - output target for generated diagram HTML - vertical (int) - threshold for formatting multiple alternatives vertically instead of horizontally (default=3) - show_results_names - bool flag whether diagram should show annotations for defined results names - show_groups - bool flag whether groups should be highlighted with an unlabeled surrounding box Additional diagram-formatting keyword arguments can also be included; see railroad.Diagram class. r) to_railroadrailroad_to_htmlzMmust ``pip install pyparsing[diagrams]`` to generate parser railroad diagramsN)rprqrrdiagram_kwargswr0r5) diagramrtru ImportErrorrRrrSrrr8r`) r+rorprqrrr1rtruierailroad diag_files r-create_diagramzParserElement.create_diagramasd.  > > > > > > > > >   _   ; 1#!     kC; / / :k3999       8&+/   4--d-o----^!c!!!X!   ^ S _    UcUUUXU# /2/// !!!!!  /  ///T6 12// /  / ////837LP+/EI 4@C"#9=(,"'A#!"8.must_skipsPz,QZ%7%7%9%9bT%A%A!EE*d+++++&B%Ar/c|jdddgkr4|ddtjzdz|d<dSdS)Nrr~rz missing <>)rrrreprr)rr+s r- show_skipz'_PendingSkip.__add__..show_skipsb:%%'',44EE*%%%$/$t{2C2C$Cc$IAjMMM54r/)rrrrr5)r+rskipperrrs` r-rz_PendingSkip.__add__s/&--((// << >  , , ,  J J J J J  ggii88CCC')),,Y778  {W$u,,r/c|jSr))rrs r-r"z_PendingSkip.__repr__s r/c td)NzBuse of `...` expression without following SkipTo target expression)rR)r+rs r-rHz_PendingSkip.parseImpls P   r/r~r) r2r7r8rrr.rrr"rH __classcell__rs@r-rrs##]#t###### BBB----*          r/rc(eZdZdZfdZdZxZS)TokenzYAbstract :class:`ParserElement` subclass, for defining atomic matching patterns. cLtddS)NFrrr.r+rs r-r.zToken.__init__s$ %(((((r/c*t|jSr)rrs r-rzToken._generateDefaultNamesDzz""r/)r2r7r8rGr.rrrs@r-rrsQ)))))#######r/rc"eZdZdZfdZxZS)rz, An empty token, will always match. cdtd|_d|_dSr;rr.rrrs r-r.zEmpty.__init__/ ""r/)r2r7r8rGr.rrs@r-rrsB#########r/rc*eZdZdZfdZddZxZS)NoMatchz( A token that will never match. crtd|_d|_d|_dS)NTFzUnmatchable token)rr.rrrrs r-r.zNoMatch.__init__s4 "") r/Tc0t|||j|r))rrrGs r-rHzNoMatch.parseImplsXsDK>>>r/rr2r7r8rGr.rHrrs@r-rrsV***** ????????r/rcBeZdZdZd dddedeffdZdZd d ZxZS) r]a Token to exactly match a specified string. Example:: Literal('blah').parse_string('blah') # -> ['blah'] Literal('blah').parse_string('blahfooblah') # -> ['blah'] Literal('blah').parse_string('bla') # -> Exception: Expected "blah" For case-insensitive matching, use :class:`CaselessLiteral`. For keyword matching (force word break before and after the matched string), use :class:`Keyword` or :class:`CaselessKeyword`. r~ matchString match_stringrczt|p|}||_t||_ |d|_n#t $rtdwxYwd|jz|_ d|_ d|_ |jdkr$t|turt|_dSdSdS)Nrz2null string passed to Literal; use Empty() insteadrFr)rr.matchrBmatchLenfirstMatchCharrQrrUrrrrr]_SingleCharLiteralrr+rrrs r-r.zLiteral.__init__ s "2l ! L))  S".q/D   S S SQRR R S!DI- #" =A  $t**"7"7/DNNN  "7"7s  AA*c*t|jSr)rrrs r-rzLiteral._generateDefaultName DJr/Tc|||jkr,||j|r||jz|jfSt |||j|r))rrArrrrrGs r-rHzLiteral.parseImpl s\ C=D/ / /H4G4G J5 5 /& 2 2XsDK>>>r/r~r) r2r7r8rGrr.rrHrrs@r-r]r]s  0R000S0s000000$   ????????r/r]ceZdZddZdS)rTcj|||jkr |dz|jfSt|||j|rA)rrrrrGs r-rHz_SingleCharLiteral.parseImpl) s; C=D/ / /7DJ& &XsDK>>>r/Nrr2r7r8rHr9r/r-rr( s(??????r/rc eZdZdZedzZ dddddedejed e d ed ejef fd Z d Z ddZ e ddZeZxZS)Keyworda Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with :class:`Literal`: - ``Literal("if")`` will match the leading ``'if'`` in ``'ifAndOnlyIf'``. - ``Keyword("if")`` will not; it will only match the leading ``'if'`` in ``'if x=1'``, or ``'if(y==2)'`` Accepts two optional constructor arguments in addition to the keyword string: - ``identChars`` is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - ``caseless`` allows case-insensitive matching, default is ``False``. Example:: Keyword("start").parse_string("start") # -> ['start'] Keyword("start").parse_string("starting") # -> Exception For case-insensitive matching, use :class:`CaselessKeyword`. z_$r~NFr identCharsr ident_charscaselessrrct|p|}| tj}|p|}||_t ||_ |d|_n#t$rtdwxYwd t|j |j |_d|_d|_||_|r-||_|}t)||_dS)Nrz2null string passed to Keyword; use Empty() insteadzExpected {} {}F)rr.rDEFAULT_KEYWORD_CHARSrrBrrrQrrrr2rUrrrrupper caselessmatchrr)r+rrrrrrs r-r.zKeyword.__init__O s  .;   6J"2l ! L))  S".q/D   S S SQRR R S&--d4jj.A49MM #"   ,!-!3!3!5!5D #))++Jj//s  A""A<c*t|jSr)rrs r-rzKeyword._generateDefaultNamel rr/Tc,|j}|}|jr||||jz|jkr|dks$||dz |jvre|t ||jz ks)|||jz|jvr||jz|jfS|dz }||jz}n|dz }|dz }n|||jkr |jdks| |j|ru|dks||dz |jvrS|t ||jz ks|||jz|jvr||jz|jfS|dz }||jz}n |dz }|dz }t||||)Nrrz/, was immediately followed by keyword characterz7, keyword was immediately preceded by keyword characterz7, keyword was immediately followed by keyword character) rrrrrrrBrrrAr)r+rrrrerrlocs r-rHzKeyword.parseImplo s =' %cDM11288::d>PPP!88xa06688OOs8}}t}<<<#C$-$78>>@@WW"T]2DJ>>"SS!$t}!4WWF 1WF  !444MQ&&&&tz377'!88xa0GGs8}}t}<<<#C$-$78OO"T]2DJ>>U"%t}!4WWF 1WFXvvt<< ['CMD', 'CMD', 'CMD'] (Contrast with example for :class:`CaselessKeyword`.) r~rrrc|p|}t|||_d|jz|_dS)Nr)rr.r returnStringrUrrs r-r.zCaselessLiteral.__init__ sK"2l  ++--...(!DI- r/Tc||||jz|jkr||jz|jfSt |||j|r))rrrrrrrGs r-rHzCaselessLiteral.parseImpl sW C# -- . 4 4 6 6$* D D&(99 9XsDK>>>r/rr)r2r7r8rGrr.rHrrs@r-rr sz  .R...S.s......????????r/rc neZdZdZ d ddddedejededejeffd ZxZS) CaselessKeywordz Caseless version of :class:`Keyword`. Example:: CaselessKeyword("CMD")[1, ...].parse_string("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for :class:`CaselessLiteral`.) r~Nrrrrrc`|p|}|p|}t||ddS)NT)rr)r+rrrrrs r-r.zCaselessKeyword.__init__ s> .; "2l  zDAAAAAr/)r~N) r2r7r8rGrrrr.rrs@r-rr s  ,0 B +/ B B B B_S) B  B OC( B B B B B B B B B Br/rcJeZdZdZ d ddddededeffd Zd Zdd ZxZ S) CloseMatchaA variation on :class:`Literal` which matches "close" matches, that is, strings with at most 'n' mismatching characters. :class:`CloseMatch` takes parameters: - ``match_string`` - string to be matched - ``caseless`` - a boolean indicating whether to ignore casing when comparing characters - ``max_mismatches`` - (``default=1``) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - ``mismatches`` - a list of the positions within the match_string where mismatches were found - ``original`` - the original match_string used to compare against the input string If ``mismatches`` is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parse_string("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parse_string("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parse_string("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", max_mismatches=2) patt.parse_string("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) NrF) maxMismatchesrrmax_mismatchesrc||n|}t||_||_d|j|j|_||_d|_d|_dS)Nz(Expected {!r} (with up to {} mismatches)F) rr.rrrrrrr)r+rrrrrs r-r.zCloseMatch.__init__ sz+9*D-  (*@GG  t1   ! "#r/c\dt|j|jS)Nz{}:{!r})rrr2rrs r-rzCloseMatch._generateDefaultName s$T 3T5FGGGr/Tc*|}t|}|t|jz}||kr|j}d}g} |j} tt ||||D]i\}} | \} } |jr(| | } } | | kr*| |t| | krn/j||zdz}t|||g}||d<| |d<||fSt|||j |)Nrroriginal mismatches) rBrr enumerateziprrr r rr)r+rrrrrCmaxlocrmatch_stringlocrrs_msrcmatresultss r-rHzCloseMatch.parseImpl s>x==T./// X  ,LOJ .M(1HSZ(,77)) $ $$S=8"yy{{CIIKKC#::%%o666:66o-1&s(;'<==&2 #(2 %G|#XsDK>>>r/r)r r2r7r8rGrrr.rrHrrs@r-rr s  J#$  $$$$$  $$$$$$&HHH????????r/rceZdZdZ ddddddded ejed ed ed ed edejedejedejededejeffdZ dZ ddZ xZ S)Worda8 Token for matching words composed of allowed character sets. Parameters: - ``init_chars`` - string of all characters that should be used to match as a word; "ABC" will match "AAA", "ABAB", "CBAC", etc.; if ``body_chars`` is also specified, then this is the string of initial characters - ``body_chars`` - string of characters that can be used for matching after a matched initial character as given in ``init_chars``; if omitted, same as the initial characters (default=``None``) - ``min`` - minimum number of characters to match (default=1) - ``max`` - maximum number of characters to match (default=0) - ``exact`` - exact number of characters to match (default=0) - ``as_keyword`` - match as a keyword (default=``False``) - ``exclude_chars`` - characters that might be found in the input ``body_chars`` string but which should not be accepted for matching ;useful to define a word of all printables except for one or two characters, for instance (default=``None``) :class:`srange` is useful for defining custom character set strings for defining :class:`Word` expressions, using range notation from regular expression character sets. A common mistake is to use :class:`Word` to match a specific literal string, as in ``Word("Address")``. Remember that :class:`Word` uses the string argument to define *sets* of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use :class:`Literal` or :class:`Keyword`. pyparsing includes helper strings for building Words: - :class:`alphas` - :class:`nums` - :class:`alphanums` - :class:`hexnums` - :class:`alphas8bit` (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - :class:`punc8bit` (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - :class:`printables` (any non-whitespace character) ``alphas``, ``nums``, and ``printables`` are also defined in several Unicode sets - see :class:`pyparsing_unicode``. Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums + '-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, exclude_chars=",") r~NrrF) initChars bodyChars asKeyword excludeChars init_chars body_charsrmaxexact as_keyword exclude_charsrrr r c~|p|}| p|} | p|} | p|} t|s4tdt |jt |}||_| r(t | } || z}| rt | | z } dt||_ | rEEJJ'   NN "  :|,,L  %I : NN\9 WWVI%6%677  ,!# ):):!;!;D  ^^DNN!# ):):!;!;D  ^^DN!G 77g  77DKK"DK 199DKDK!DI- "" dnt~5 5 53!88QR ~//!88 FFAXXFF(// 4;(+B+BRR F!).t~>>!! T^$$))!88 FF'..sQw77F * 1 1Id011.t~>>!! !88 FFAXXFF'..sQw77F , 3 3.t~>>.t~>>!! ~ > % 5 =  ,*T]33!%  !+ 8    S 6 588 sNN65N6c2d}|j|jkr3d||j||j}n#d||j}|jdks|jt kr|j|jkr2|jdkr |ddS|d|jzS|jt kr|d|jzS|d|j|jzS|S) Ncrd}t|d}t||kr|d|dz dzS|S)NF) re_escaper$r)rrB)r max_repr_lens r- charsAsStrz-Word._generateDefaultName..charsAsStr sJL*1>>>A1vv $$+T^ + +&& 4>**JJt~,F,FDD??::dn#=#=>>D ;??dkX55{dk));!##8O(//$+">">>>((l11$+>>>>k00dkJJJJ r/Tc|||jvrt|||j||}|dz }t|}|j}||jz}t ||}||kr|||vr|dz }||kr |||vd}||z |jkrd}nF|jr||kr |||vrd}n,|j r%|dkr ||dz |vs||kr |||vrd}|rt|||j|||||fS)NrFTr) rrrrBrrrrrr ) r+rrrrrC bodycharsrthrowExceptions r-rHzWord.parseImpl s[ C= . . 3 TBB B qx==N $VX&&Fllx} 99 1HCFllx} 99 ; $ $!NN   &3>>hsmy6P6P!NN ^ & UQY'944>>SMY..!%  C 3 TBB BHU3Y'''r/)r~NrrrFNr) r2r7r8rGrrrrrr.rrHrrs@r-rr5 sC>>D+/ .2o,+/*.-1o,o,o,o,OC(o, o,  o,  o,o,s+o,?3'o,?3'o,o,oc*o,o,o,o,o,o,b:((((((((r/rceZdZddZdS)rTc|||}|st|||j||}||fSr))rrrrgroup)r+rrrrus r-rHz_WordRegex.parseImpl& sTx-- C 3 TBB BjjllFLLNN""r/Nrrr9r/r-rr% s(######r/rc reZdZdZ d ddddededejeded ejef fd ZxZ S) CharzA short-cut class for defining :class:`Word` ``(characters, exact=1)``, when defining a match of any single character in a string of characters. FN)r r charsetrrr r cZ|p|}|p|}t|d||dt|j|_|rd|j|_t j|j|_|jj|_ dS)Nr)rr r z[{}]z\b{}\b) rr.rrrrrrrr)r+r1rrr r rs r-r.z Char.__init__5 s+ #4}   1      &@&P&PQQ  <%,,T];;DM*T]++  r/)FN) r2r7r8rGrrrrr.rrs@r-r0r0/ s!.2 &  -1&&&&&s+ &  &oc*&&&&&&&&&&r/r0ceZdZdZ dddddedeejefde de d e d e f fd Z e d Ze d Z e dZ dZddZddZddZdedefdZxZS)RegexaToken for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the stdlib Python `re module `_. If the given regex contains named groups (defined using ``(?P...)``), these will be preserved as named :class:`ParseResults`. If instead of the Python stdlib ``re`` module you wish to use a different RE module (such as the ``regex`` module), you can do so by building your ``Regex`` object with a compiled RE that was compiled using ``regex``. Example:: realnum = Regex(r"[+-]?\d+\.\d*") # ref: https://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") # named fields in a regex will be returned as named results date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # the Regex class will accept re's compiled using the regex module import regex parser = pp.Regex(regex.compile(r'[0-9]')) rF) asGroupListasMatchpatternflags as_group_listas_matchr5r6ct|p|}|p|}t|tr.|st dd|_|x|_|_||_nQt|dr2t|dr"||_|jx|_|_||_ntdd|j z|_ d|_ ||_||_|jr |j|_|jr|j|_dSdS)aThe parameters ``pattern`` and ``flags`` are passed to the ``re.compile()`` function as-is. See the Python `re module `_ module for an explanation of the acceptable patterns and flags. z0null string passed to Regex; use Empty() insteadNr7rzCRegex may only be constructed with a string or a compiled RE objectrF)rr.rSr#r_rerr7r8r#rrUrrr5r6parseImplAsGroupListrHparseImplAsMatch)r+r7r8r9r:r5r6rs r-r.zRegex.__init__c s/ !2] %X gx ( (  U !STTTDH+2 2DMDLDJJ Wi ( ( WWg-F-F DH+2? :DL4=DJJU "DI- "&   7!6DN < 3!2DNNN 3 3r/c|jr|jS tj|j|jS#tj$r(t d|jwxYw)Nz&invalid pattern ({!r}) passed to Regex)r<rrr7r8r rrrs r-rzRegex.re sp 8 8O z$, ;;;8    <CCDLQQ s /7A&c|jjSr))rrrs r-rzRegex.re_match s w}r/c0|dduSNr~)rrs r-rzRegex.mayReturnEmpty s}}R  ,,r/cxdt|jddS)NzRe:({})z\\\)rrr7rrs r-rzRegex._generateDefaultName s0T\ 2 2 : :64 H HIIIr/Tc<|||}|st|||j||}t |}|}|r|D] \}}|||< ||fSr))rrrrr r. groupdictitems) r+rrrrur5dkvs r-rHzRegex.parseImpl sx-- C 3 TBB Bjjll6<<>>**          1ACxr/c|||}|st|||j||}|}||fSr))rrrrgroupsr+rrrrur5s r-r=zRegex.parseImplAsGroupList sWx-- C 3 TBB BjjllmmooCxr/c|||}|st|||j||}|}||fSr))rrrrrMs r-r>zRegex.parseImplAsMatch sOx-- C 3 TBB BjjllCxr/replrXcjrtdjrtrtdjrfd}nfd}|S)a Return :class:`Regex` with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string) `_. Example:: make_html = Regex(r"(\w+):(.*?):").sub(r"<\1>\2") print(make_html.transform_string("h1:main title:")) # prints "

main title

" z-cannot use sub() with Regex(asGroupList=True)z9cannot use sub() with a callable with Regex(asMatch=True)c:|dSr)expand)r[rOs r-rzRegex.sub..pa say''---r/cFj|dSr)rsub)r[rOr+s r-rzRegex.sub..pa sw{{4333r/)r5rr6r(r5)r+rOrs`` r-rTz Regex.sub s   MKLL L < YHTNN YWXX X < 4 . . . . . .  4 4 4 4 4 4$$R(((r/)rFFr)r2r7r8rGrrr RegexFlagrrr.r&rrrrHr=r>rrrTrrs@r-r4r4J sq6+,# ,3",3,3,3,3R\3&',3 ,3  ,3,3,3,3,3,3,3,3\  _ _--_-JJJ    )) ))))))))r/r4ceZdZdZdZ ddddddddded ejed ejed ed ed ejedededejedejededejedeffdZ dZ ddZ xZ S) QuotedStringa Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - ``quote_char`` - string of one or more characters defining the quote delimiting string - ``esc_char`` - character to re_escape quotes, typically backslash (default= ``None``) - ``esc_quote`` - special quote sequence to re_escape an embedded quote string (such as SQL's ``""`` to re_escape an embedded ``"``) (default= ``None``) - ``multiline`` - boolean indicating whether quotes can span multiple lines (default= ``False``) - ``unquote_results`` - boolean indicating whether the matched text should be unquoted (default= ``True``) - ``end_quote_char`` - string of one or more characters defining the end of the quote delimited string (default= ``None`` => same as quote_char) - ``convert_whitespace_escapes`` - convert escaped whitespace (``'\t'``, ``'\n'``, etc.) to actual whitespace (default= ``True``) Example:: qs = QuotedString('"') print(qs.search_string('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', end_quote_char='}}') print(complex_qs.search_string('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', esc_quote='""') print(sql_qs.search_string('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] ))z\t )rVrW)z\f )z\r r~NFT) quoteCharescCharescQuoteunquoteResults endQuoteCharconvertWhitespaceEscapes quote_charesc_char esc_quote multilineunquote_resultsend_quote_charconvert_whitespace_escapesr[r\r]r^r_r`c t| p|} | p|} | o|} | p|} | o|} |p|}|}|std| |} n%| } | std|_t |_|d_| _t | _ | _ | _ | _ | _ d}d}| r-|d|tj| z }d}| rN|d|tj| z }d}tjj dz_t jd krc|d |dfd t't jd z dd Dzd zz }d}|rbtjtjz_|d|t/jd| t/| ndz }nJd_|d|t/jd| t/| ndz }dtjjd|dtjjg_ tjjj_j_jj_n:#tj$r(tdjwxYwdjz_d_ d_!dS)Nz%quote_char cannot be the empty stringz'endQuoteChar cannot be the empty stringrr~z{}(?:{})|z {}(?:{}.)z(.)rz{}(?:c 3K|]X}dtjjd|tjj|dVYdS)z (?:{}(?!{}))N)rrrr_)rCr|r+s r-r*z(QuotedString.__init__..N s{  #)) $"3BQB"788 $"3ABB"788r/r)z {}(?:[^{}{}])z{}(?:[^{}\n\r{}])z(?:z)*z$invalid pattern {!r} passed to RegexrFT)"rr.rZrr[rB quoteCharLenfirstQuoteCharr_endQuoteCharLenr\r]r^r`rrrescCharReplacePatternrrange MULTILINEDOTALLr8rr7rrrrr rUrrr)r+rarbrcrdrerfrgr[r\r]r^r_r`sep inner_patternrs` r-r.zQuotedString.__init__ s" %X(y';O#5~ $ C)C !,*  %%''  FDEE E  %LL'--//L L !JKKK# OO(m("<00   ,(@%   [//RYx5H5HII IMC  I \00bi6H6HII IMC)+4<)@)@5)HD & t ! !A % % s##(( #3t'8#9#9A#=q"EE  MC   1DJ -44)$*;A*>??7>7J*7333PR MM DJ 188)$*;A*>??7>7J*7333PR M ww $.)) $+,,      jtz::DG LDM GMDMMx   6==dlKK   "DI- ""s #AL%%7Mc|j|jkr4t|jtrd|jSd|j|jS)Nzstring enclosed in {!r}z.quoted string, starting with {} ending with {})r[r_rSr#rrs r-rz!QuotedString._generateDefaultName s[ >T. . .:dnh3W3W .,33DNCC C?FF ND-   r/c.|||jkr|||pd}|st|||j||}|}|jr||j|j }t|trwd|vr*|j r#|j D]\}}| ||}|jrtj|jd|}|jr | |j|j}||fS)NrDz\g<1>)rmrrrrr.r^rlrnrSr#r`ws_maprr\rrTror]r_)r+rrrrur5wslitwschars r-rHzQuotedString.parseImpl s3 SMT0 0 - h,,    C 3 TBB Bjjllllnn   Hd'4+?*??@C#x(( H3;;4#@;)-99 v!kk%88<L&!;XsKKC=H++dmT5FGGCCxr/)r~NNFTNTr) r2r7r8rGrwrrrrr.rrHrrs@r-rWrW sn%%LJF)-*. $/3+/o#(,)-#-1)-o#o#o#o#/#&o#?3' o#  o#  o#,o#%)o#o#%o#/#&o#o#oc*o##'o#o#o#o#o#o#b   r/rWc VeZdZdZ ddddededed ed ef fd Zd ZddZxZ S) CharsNotInaToken for matching words composed of characters *not* in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for ``min`` is 1 (a minimum value < 1 is not valid); the default values for ``max`` and ``exact`` are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimited_list(csv_value).parse_string("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] r~rr)notChars not_charsrr rr|cztd|_|p||_t |j|_|dkrt d||_|dkr||_n t|_|dkr||_||_d|j z|_ |jdk|_ d|_ dS)NFrzacannot specify a minimum length < 1; use Opt(CharsNotIn()) if zero-length char group is permittedrr)rr.rr|r notCharsSetrrrrrUrrr)r+r}rr rr|rs r-r.zCharsNotIn.__init__ s #!-X t}-- 77K   77DKK"DK 199DKDK!DI- "kQ."r/ct|j}t|dkr"d|jddSd|jS)Nr$z !W:({}...) z!W:({}))rr|rBr)r+ not_chars_strs r-rzCharsNotIn._generateDefaultName sY24=AA }   " "&&t}XvX'>?? ?##DM22 2r/TcV|j}|||vrt|||j||}|dz }t||jzt |}||kr|||vr|dz }||kr |||v||z |jkrt|||j|||||fSrA)rrrrrrBr)r+rrrnotcharsrmaxlens r-rHzCharsNotIn.parseImpl s# C=H $ $ 3 TBB B qUT[(#h--88Fllx}H<< 1HCFllx}H<< ; $ $ 3 TBB BHU3Y'''r/)r~rrrrrrs@r-r{r{ s, !#!#!#!#!#!# !#  !#!#!#!#!#!#!#F333((((((((r/r{c eZdZdZidddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*Zd6d.ed/ed0ed1effd2 Zd3Zd7d5Z xZ S)8WhiteaSpecial matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is ``" \t\r\n"``. Also takes optional ``min``, ``max``, and ``exact`` arguments, as defined for the :class:`Word` class. rzrXzrWzrZzrYz zu zu᠎zu z u z u z u z u zu zu zu zu zz z zzzz)u u u​u u u  rrwsrr rcht|_dfdjDdd_djz_|_ |dkr|_ n t_ |dkr|_ |_ dSdS)Nr~c3.K|]}|jv |VdSr)) matchWhite)rCrr+s r-r*z!White.__init__..! s/JJ!$/1I1IA1I1I1I1IJJr/Trrr) rr.rr r whiteStrsrrUrrrr)r+rrr rrs` r-r.zWhite.__init__ s  !! GGJJJJt~JJJ J J "   #!DI-  77DKK"DK 199DKDKKK 9r/cJdd|jDS)Nr~c3:K|]}tj|VdSr))rrrs r-r*z-White._generateDefaultName..4 s)CCauq)CCCCCCr/)rrrs r-rzWhite._generateDefaultName3 s%wwCC4?CCCCCCr/Tcj|||jvrt|||j||}|dz }||jz}t |t |}||kr)|||jvr|dz }||kr|||jv||z |jkrt|||j|||||fSrA)rrrrrrBr)r+rrrrrs r-rHzWhite.parseImpl6 s C= / / 3 TBB B q$VS]]++Fllx}?? 1HCFllx}?? ; $ $ 3 TBB BHU3Y'''r/)rrrrr) r2r7r8rGrrrr.rrHrrs@r-rr s V g f f  f  (  & / + + , , ( ' & "!" '#$! &'/I4  3  s s      ,DDD ( ( ( ( ( ( ( (r/rceZdZfdZxZS) PositionTokencdtd|_d|_dSr;rrs r-r.zPositionToken.__init__G rr/)r2r7r8r.rrs@r-rrF s8#########r/rc6eZdZdZdeffd ZdZddZxZS) GoToColumnzaToken to advance to a specific column of input text; useful for tabular report scraping. colnocVt||_dSr))rr.r)r+rrs r-r.zGoToColumn.__init__R s$ r/c~t|||jkrt|}|jr|||}||krq||rWt|||jkr>|dz }||kr3||rt|||jk>|SrA)rrBrr?isspace)r+rrrCs r-rEzGoToColumn.preParseV s sH   ) )8}}H :**8S99hSM))++X&&$(22q hSM))++X&&$(22 r/Tct||}||jkrt||d|||jz|z }|||}||fS)NzText not in expected column)rr)r+rrrthiscolnewlocr5s r-rHzGoToColumn.parseImplc s[c8$$ TX   30MtTT Ttx')s6z"s{r/r) r2r7r8rGrr.rErHrrs@r-rrM sqc   r/rc0eZdZdZfdZdZddZxZS) LineStartaMatches if current position is at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).search_string(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] c>t|t|jz|_|jdt|j|_ d|_ dS)NrWzExpected start of line) rr.rrrorig_whiteCharsdiscardrr rrrs r-r.zLineStart.__init__ sz  "uut6 %%%ww33DODD . r/c|dkr|S|j||}d|jvr@|||dzdkr/|j||dz}|||dzdk/|S)NrrWr)rrEr)r+rrr5s r-rEzLineStart.preParse s !88J,''#66Ct+++sS1W}-55,//#'BBCsS1W}-55Jr/Tc`t||dkr|gfSt|||j|rA)rrrrGs r-rHzLineStart.parseImpl s6 sH   " "7NXsDK>>>r/r)r2r7r8rGr.rErHrrs@r-rrl se,/////????????r/rc*eZdZdZfdZddZxZS)LineEndzTMatches if current position is at the end of a line within the parse string ct|jd||jdd|_dS)NrWFrzExpected end of line)rr.rrr rrs r-r.zLineEnd.__init__ sU  %%% !!$/!GGG, r/Tc|t|kr*||dkr|dzdfSt|||j||t|kr|dzgfSt|||j|)NrWrrBrrrGs r-rHzLineEnd.parseImpl s{ X  }$$Qw}$$XsDKFFF CMM ! !7B;  3 TBB Br/rrrs@r-rr s^----- C C C C C C C Cr/rc*eZdZdZfdZddZxZS) StringStartzLMatches if current position is at the beginning of the parse string cVtd|_dS)NzExpected start of textrr.rrs r-r.zStringStart.__init__ s$ . r/Tcx|dkr1|||dkrt|||j||gfSr)rErrrGs r-rHzStringStart.parseImpl sC !88dmmHa0000$XsDKFFFBwr/rrrs@r-rr sV/////r/rc*eZdZdZfdZddZxZS)rzG Matches if current position is at the end of the parse string cVtd|_dS)NzExpected end of textrrs r-r.zStringEnd.__init__ s$ , r/Tc|t|krt|||j||t|kr|dzgfS|t|kr|gfSt|||j|rArrGs r-rHzStringEnd.parseImpl sx X   3 TBB B CMM ! !7B;  3x== 7N 3 TBB Br/rrrs@r-rr s^-----CCCCCCCCr/rc>eZdZdZefeddedeffdZddZxZS) WordStartaMatches if the current position is at the beginning of a :class:`Word`, and is not preceded by any character in a given set of ``word_chars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordStart(alphanums)``. ``WordStart`` will also match at the beginning of the string being parsed, or at the beginning of a line.  wordChars word_charsrc|tkr|n|}tt||_d|_dS)NzNot at the start of a word) printablesrr.rrrr+rrrs r-r.zWordStart.__init__ sD"+z"9"9JJy  Y2 r/Tc|dkr8||dz |jvs|||jvrt|||j||gfSNrr)rrrrGs r-rHzWordStart.parseImpl sQ !88q!T^33C=66$XsDKFFFBwr/r r2r7r8rGrrr.rHrrs@r-rr s*43333333333333 r/rc>eZdZdZefeddedeffdZddZxZS) WordEndaiMatches if the current position is at the end of a :class:`Word`, and is not followed by any character in a given set of ``word_chars`` (default= ``printables``). To emulate the ```` behavior of regular expressions, use ``WordEnd(alphanums)``. ``WordEnd`` will also match at the end of the string being parsed, or at the end of a line. rrrc|tkr|n|}tt||_d|_d|_dS)NFzNot at the end of a word)rrr.rrrrrs r-r.zWordEnd.__init__ sL"+z"9"9JJy  Y#0 r/Tct|}|dkr>||kr8|||jvs||dz |jvrt|||j||gfSr)rBrrr)r+rrrrCs r-rHzWordEnd.parseImplsdx== a<.s,@@$:dH--@@@@@@r/c3pK|]0}t|tr|n|V1dSr))rSr#r)rCr=r+s r-r*z+ParseExpression.__init__..sZ4>a3J3JQD,,Q///PQr/F) rr.rS_generatorTyperr#rrrranyrrr+rrrs` r-r.zParseExpression.__init__sG """ ' e^ , , KKE eX & & %22599:DJJ } - - %DJJ x ( ( %KKE@@%@@@@@ "eDJJ %!%[[  % % %#W  %!s:DD$#D$rXc |jddSr))rrs r-r&zParseExpression.recurse+sz!!!}r/cH|j|d|_|Sr))rr rrs r-r zParseExpression.append.s% %     r/Trct||r5d|jD|_|jD]}|||S)z Extends ``leave_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions. c6g|]}|Sr9r rCr=s r-rEz4ParseExpression.leave_whitespace..; 777q!&&((777r/)rrrr+rr=rs r-rz ParseExpression.leave_whitespace3si   +++  .77DJ777DJZ . .""9---- r/ct||r5d|jD|_|jD]}|||S)z Extends ``ignore_whitespace`` defined in base class, and also invokes ``leave_whitespace`` on all contained expressions. c6g|]}|Sr9rrs r-rEz5ParseExpression.ignore_whitespace..Grr/)rrrrs r-rz!ParseExpression.ignore_whitespace@si !!),,,  /77DJ777DJZ / /##I.... r/crt|trU||jvrKt||jD]"}||jd#nKt||jD]"}||jd#|SNr)rSrrrr r)r+rr=rs r-r zParseExpression.ignoreLs eX & & /D,,,u%%%33AHHT-b12222 GGNN5 ! ! !Z / /)"-.... r/cfd|jjt|jSNz{}:({}))rrr2rrrs r-rz$ParseExpression._generateDefaultNameXs% 7TZIIIr/c$|jr|St|jD]}|t |jdkr|jd}t ||jri|jsb|j[|j sT|jdd|jdgz|_d|_ |xj |j zc_ |xj |j zc_ |jd}t ||jrj|jsc|j\|j sU|jdd|jddz|_d|_ |xj |j zc_ |xj |j zc_ dt|z|_|S)Nrkrrrr)rrrrrBrSrrrrrrrrr)r+r=rrs r-rzParseExpression.streamline[s   K   A LLNNNN tz??a  JqME5$.11 :) :%- .#[^tz!}o= $(!##u';;##""e&99""JrNE5$.11 :) :%- ."Z_u{111~= $(!##u';;##""e&99""!CII-  r/Nc||ngdd|gz}|jD]}|||gdSr))rr/r))r+r.tmpr=s r-r/zParseExpression.validates\ - 9}}r111EN  A JJsOOOO R     r/ctt}d|jD|_|S)Nc6g|]}|Sr9rrs r-rEz(ParseExpression.copy..s 222!QVVXX222r/)rr rr+r5rs r-r zParseExpression.copys0ggllnn22tz222  r/c ~tjrtj|jvr||jD]t}t |t r]|jrVtj|jvrCtj d d|t|j |jdut||SNzY{}: setting results name {!r} on {} expression collides with {!r} on contained expressionr`r$ stacklevel)rOr`rjrrrSrrwarningsrSrrr2rrr+rUrr=rs r-rzParseExpression._setResultsNames  > E*++Z  q-00 $M/00MEEKVG  JJ/M FF $%    ww&&t^<<.%%K%K1a&6%K%K%K%K%K%Kr/rrFT)rrrrBrrr rrRrr.r.rrSrr rrrr) r+rrrrr|r skipto_argrs r-r.z And.__init__s&*)__  X&&C$U++ % %48##3u::>))5:WWuQU|5K4RSU4V  #56*#5#5k#B#BCCCC'NJJt$$$$E!!!H ))) : '"%%K%K %K%K%K"K"KD djmU33 ,))JqM,"&*Q-"E*'+jm&B##&+##"&D  r/rXc|jrtd|jddDrt|jddD]w\}}|t|trZ|jrSt|jdt r3|jd|j|dzz|jd<d|j|dz<xd|jD|_t t|j|jddD]\}}t}|rt||vrn| t|t|tr| |fdn3|}tt!|d}|t#d|jD|_|S)Nc3K|]@}t|to&|jot|jdtVAdSrN)rSrrrrs r-r*z!And.streamline..sd1o..:G:qwr{L99r/rrcg|]}||Sr)r9rs r-rEz"And.streamline..sEEEAq}a}}}r/c@t|dt||S)N parent_anchor)setattrr)rrrcur_s r-rz And.streamline.. s' /3q!9933r/c3$K|] }|jV dSr)rrs r-r*z!And.streamline..s%!G!Gq!"2!G!G!G!G!G!Gr/)rrrrSrrrrrrrAadd IndentedBlockr5r&nextrr.r)r+r|r=prevcurseensubsrs r-rzAnd.streamlines  : FCRC  F &dj"o66 1 1DAqy "1o661G1'qwr{LAA1 '(gbkDJq1u4E&E ,0 1q5)EEEEE  TZABB88 - -ID#55D -c77d??C!!!c=11))-0 {{}}4::t,, -"!G!GDJ!G!G!GGG r/c6|jd|||d\}}d}|jddD]}t|tjurd} |r ||||\}}n#t $rt $r&}d|_t |d}~wt$r%t |t||j |wxYw||||\}}|s| r||z }||fS)NrFrrT) rr"rrrParseSyntaxExceptionrmr_from_exceptionrQrBrhaskeys) r+rrr resultlist errorStopr= exprtokensrss r-rHz And.parseImplsh*Q-.. c95/  Z ABB ) )AAww#.((  E &'hhxi&H&HOC+)CCC'+B$.>>rBBB!. #h--d #$((8S)"D"DZ )Z//11 )j( JsA77C !B,,2Cct|tr||}||Sr)rSr#rr rs r-__iadd__z And.__iadd__39 eX & & 4,,U33E{{5!!!r/ct|dd|gz}|jD]!}|||jsdS"dSr))rr)rr*s r-r)zAnd._checkRecursion8s]*111-6  A  o . . .#    r/c6dd|jD}t|dkr[|ddt|dz dkr<|dd}t|dkr|ddt|dz dk.@s(44AQ444444r/rr{}r{})rrrBr+inners r-rzAnd._generateDefaultName?s4444444%jj1nnq':CJJN':!;t!C!C!B$KE%jj1nnq':CJJN':!;t!C!CU{S  r/r)r2r7r8rGrrrrrrr.rrHr r)rrrs@r-rrs"UKO!!7!CG!!!!!!B+M++++++Z<""" !!!!!!!r/rcteZdZdZd dejedeffd Zdeffd Z dd Z d Z d Z d fd Z xZS)raRequires that at least one :class:`ParseExpression` is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the ``'^'`` operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.search_string("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Frrct|||jrHtd|jD|_t d|jD|_dSd|_dS)Nc3$K|] }|jV dSr)rrs r-r*zOr.__init__..\rr/c3$K|] }|jV dSr)rrs r-r*zOr.__init__..]rr/Trr.rrrr.rrs r-r.z Or.__init__Y} ))) : '"%%K%K %K%K%K"K"KD "%%K%K %K%K%K"K"KD   "&D   r/rXc8t|jrjtd|jD|_td|jD|_t d|jD|_nd|_|S)Nc3$K|] }|jV dSr)rrs r-r*z Or.streamline..drr/c3$K|] }|jV dSr)rrs r-r*z Or.streamline..e$!C!C1!,!C!C!C!C!C!Cr/c3PK|]!}|jot|t V"dSr)rrSrrs r-r*z Or.streamline..fH&&BC =Au)=)=%=&&&&&&r/F)rrrrrrr.rrs r-rz Or.streamlineas  : $"%%K%K %K%K%K"K"KD !!C!C !C!C!CCCDO"%&&GKz&&&##D  $DO r/Tc0d}d}g}g}td|jDr|||}|jD]} |||d} || |f3#t $r1} d| _|| _|| d}d}Yd} ~ id} ~ wt$r'} |sd| _| j |kr | }| j }Yd} ~ d} ~ wt$rIt||kr3t|t||j |}t|}YwxYw|r| tdd|s%|dd} | |||Sd} |D]~\}}|| dkr| cS ||||\} }| |kr| |fcS| | dkr| |f} M#t$r%} d| _| j |kr | }| j }Yd} ~ wd} ~ wwxYw| dkr| S|rgt|dkrJ| d |dj |dj kr| d |d}|||j |_|t||d |) Nrc3$K|] }|jV dSr))rrs r-r*zOr.parseImpl..rs$22!q~222222r/Tr`r)rreverserrc|j Sr)rr=s r-rzOr.parseImpl.. 15&r/rcV|j tt|j fSr)rrBr parserElementr(s r-rzOr.parseImpl..$vC.(;;1A;;;;;;r/rrrrs r-rzOr._generateDefaultName/UZZ;; ;;;;;;cAAr/c <tjrntj|jvr[t d|jDr=t jdd|t|j dt ||S)Nc3fK|],}t|totj|jvV-dSr)rSrrjr_rrs r-r*z%Or._setResultsName..X1c"",I+,r/{}: setting results name {!r} on {} expression will return a list of all parsed tokens in an And alternative, in prior versions only the first token was returned; enclose contained argument in Groupr_r$r rOr_rjrrrrrSrrr2rrr+rUrrs r-rzOr._setResultsName  > E*++    239&CT +33 !    ww&&t^<< [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.search_string("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Frrct|||jrHtd|jD|_t d|jD|_dSd|_dS)Nc3$K|] }|jV dSr)rrs r-r*z&MatchFirst.__init__..rr/c3$K|] }|jV dSr)rrs r-r*z&MatchFirst.__init__..rr/Trrs r-r.zMatchFirst.__init__rr/rXcX|jr|St|jrjt d|jD|_t d|jD|_td|jD|_nd|_d|_|S)Nc3$K|] }|jV dSr)rrs r-r*z(MatchFirst.streamline..rr/c3$K|] }|jV dSr)rrs r-r*z(MatchFirst.streamline..rr/c3PK|]!}|jot|t V"dSr)r rs r-r*z(MatchFirst.streamline..r!r/FT) rrrrrrrr.rrs r-rzMatchFirst.streamlines   K  : '!!C!C !C!C!CCCDO"%%K%K %K%K%K"K"KD "%&&GKz&&&##D  $DO"&D  r/Tcd}d}|jD]} ||||cS#t$r}d|_||_d}~wt $r}|j|kr |}|j}Yd}~[d}~wt$rIt||kr3t |t||j |}t|}YwxYw||j |_ |t ||d|)Nrr/) rr"rrr-rrrQrBrr) r+rrrr1r2r=r5r\s r-rHzMatchFirst.parseImpl s9   . .A .xx '   $(!$%!! ( ( (7Y&&#&L #I . . .x==9,,#1 #h--4$$L!$H I  .  ##{L   #A4 s'( B=A B=A''AB=<B=ct|tr||}||Sr)r rs r-__ior__zMatchFirst.__ior__.r r/cVddd|jDzdzS)Nrz | c34K|]}t|VdSr)rrs r-r*z2MatchFirst._generateDefaultName..4r?r/rr@rs r-rzMatchFirst._generateDefaultName3rAr/c <tjrntj|jvr[t d|jDr=t jdd|t|j dt ||S)Nc3fK|],}t|totj|jvV-dSr)rDrs r-r*z-MatchFirst._setResultsName..<rEr/rFr_r$rrGrHs r-rzMatchFirst._setResultsName6rIr/r~r)r2r7r8rGrrrrr.rrHrTrrrrs@r-rrs"''fom<'''''''M    D""" BBB==========r/rcbeZdZdZd dejedeffd Zdeffd Z d dZ d Z xZ S) ralRequires all given :class:`ParseExpression` s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the ``'&'`` operator. Example:: color = one_of("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = one_of("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Opt(color_attr) & Opt(size_attr) shape_spec.run_tests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Trrct|||jr$td|jD|_nd|_d|_d|_d|_dS)Nc3$K|] }|jV dSr)rrs r-r*z Each.__init__..rr/T)rr.rr.rrinitExprGroupsrrs r-r.z Each.__init__sn ))) : '"%%K%K %K%K%K"K"KD  "&D ""r/rXct|jr$td|jD|_nd|_|S)Nc3$K|] }|jV dSr)rrs r-r*z"Each.streamline..rr/T)rrrr.rrs r-rzEach.streamlinesT  : '"%%K%K %K%K%K"K"KD  "&D  r/cv|jrtd|jD|_d|jD}d|jD}||z|_d|jD|_d|jD|_d|jD|_|xj|jz c_d|_|}|jdd}|jdd|jdd}g} d} g} g} | rP|z|z} | | | D]} | ||d }| |j t||||vr| |p|vr |#t$rB}d|_||_| || |Yd}~d}~wt"$r| |YwxYwt%| t%| krd} | P| rgt%| d krJ| d | d j| d jkr| d | d }||rCdd|D}t#||d|| fd|jDz } t/g}| D]!}||||\}}||z }"||fS)Nc3lK|]/}t|tt|j|fV0dSr))rSrrArrs r-r*z!Each.parseImpl..sQ  $%z!S7I7I AFQ      r/cFg|]}t|t|jSr9rSrrrs r-rEz"Each.parseImpl..s)EEEq*Q2D2DEAFEEEr/cdg|]-}|j t|tttf+|.Sr9)rrSrr4rrs r-rEz"Each.parseImpl..sL#-7q3z:R,S,Sr/czg|]8}t|t|j|jd9ST)r)rS_MultipleMatchrrrrs r-rEz"Each.parseImpl..sO###a00#'' 'MM###r/czg|]8}t|t|j|jd9Sre)rSrrrrrs r-rEz"Each.parseImpl..sO"""a++"'' 'MM"""r/cVg|]&}t|tttf$|'Sr9)rSrrrrs r-rEz"Each.parseImpl..s>ZCY;W-X-Xr/FTr$rc|j Sr)r'r(s r-rz Each.parseImpl..r)r/r*rcV|j tt|j fSr)r,r(s r-rz Each.parseImpl..r.r/z, c,g|]}t|Sr9rrs r-rEz"Each.parseImpl..s 9 9 9AQ 9 9 9r/z*Missing one or more required elements ({})cPg|]"}t|t|jv |#Sr9rb)rCr=tmpOpts r-rEz"Each.parseImpl..s5XXXQ 1c0B0BXqvQWGWGWqGWGWGWr/)r\dictropt1map optionalsmultioptionals multirequiredrequiredrxrcr r/rAremoverrr-rrBr0rrrr r")r+rrropt1opt2tmpLoctmpReqdmultis matchOrder keepMatchingfailedr3tmpExprsr=r5r:missing total_resultsrrms @r-rHzEach.parseImpls   (  )-   DLFEDJEEEDD "D[DN#####D  """""D  :DM MMT/ /MM"'D -""$QQQ'   %'&0H LLNNN LLNNN ) ))[[6t[LLF%%dl&6&6r!uua&@&@AAAG||q))))f a(((+%%%(,C%()C%MM#&&&MM!$$$$$$$$%%%%MM!$$$$$%6{{c(mm++$ + %0  6{{Q 0 0 111!9=F1IM11KK$R$RKSSSq IO  ii 9 9 9 9 9::G <CCGLL  XXXX$*XXXX $R((  % %A88Hc9==LC W $MMM!!s%F,, H68G33"HHcVddd|jDzdzS)Nrz & c34K|]}t|VdSr)rrs r-r*z,Each._generateDefaultName..r?r/rr@rs r-rzEach._generateDefaultNamerAr/r) r2r7r8rGrrrrr.rrHrrrs@r-rrQs77rfom<MU"U"U"U"nBBBBBBBr/rceZdZdZddeeefdeffd Zde efdZ dd Z dd edeffd Z dd edeffd Z deffd Zdeffd ZdZdddZdZe Ze ZxZS)ParseElementEnhancezfAbstract subclass of :class:`ParserElement`, for combining and post-processing parsed tokens. Frrct|t|trt |jt r||}nTt t||jrt|}n"|t|}||_ |~|j |_ |j |_ | |j |j|j|_|j|_|j|_|j|jdSdS)Nr)rr.rSr# issubclassrrrr]rrrr rrrrrrrr+rrrs r-r.zParseElementEnhance.__init__s+ """ dH % % ?$2E:: ?//55DJJ(@AA ?t}}// >>  !%!3D "&"5D   % %t/I &   #'"5D "oDO $ 1D    # #D$4 5 5 5 5 5  r/rXc$|j|jgngSr)rrs r-r&zParseElementEnhance.recurses"i3 {{;r/Tcp|j|j|||dSt||d|)NFrzNo expression defined)rr"rrGs r-rHzParseElementEnhance.parseImpls> 9 9##Hc95#QQ Q 30GNN Nr/rct||r?|j|_|j|j||Sr))rrrr r+rrs r-rz$ParseElementEnhance.leave_whitespacesY   +++  6 ((DIy$ **9555 r/ct||r?|j|_|j|j||Sr))rrrr rs r-rz%ParseElementEnhance.ignore_whitespace$sY !!),,,  7 ((DIy$ ++I666 r/czt|trW||jvrMt||j%|j|jdnMt||j%|j|jd|Sr)rSrrrr rr+rrs r-r zParseElementEnhance.ignore-s eX & & 7D,,,u%%%9(I$$T%5b%9::: GGNN5 ! ! !y$   !1"!5666 r/ct|j|j|Sr))rrrrs r-rzParseElementEnhance.streamline9s:  9 I " " " r/c||vrt||gz|dd|gz}|j|j|dSdSr))RecursiveGrammarExceptionrr))r+r+r,s r-r)z#ParseElementEnhance._checkRecursion?se # # #+,<v,EFF F*111-6 9 I % %o 6 6 6 6 6 ! r/Nc|g}|dd|gz}|j|j||gdSr)rr/r)r+r.rs r-r/zParseElementEnhance.validateFsZ  MAAA$' 9 I  s # # # R     r/cfd|jjt|jSr)rrr2rrrs r-rz(ParseElementEnhance._generateDefaultNameNs% 7TYHHHr/r~rr)r^)r2r7r8rGrrrrr.r r&rHrrr rr)r/rrrrrs@r-rrs66U=##566$666666*<-0<<<<OOOO $-4= }      M 777!!!!!III)&OOOOOr/rcxeZdZdZGddeZGddeZdddd ed ed effd Z dd Z xZ S)rz Expression to match one or more expressions at a given indentation level. Useful for parsing text where structure is implied by indentation (like Python source code). c$eZdZdeffd ZxZS)IndentedBlock._Indentref_colctd|_|fddS)Nzexpected indent at column {}c,t||kSr)rrrrrs r-rz0IndentedBlock._Indent.__init__.._ss1ayyG/Cr/rr.rrr7r+rrs `r-r.zIndentedBlock._Indent.__init__\sS GG     8??HHDK   CCCC D D D D Dr/r2r7r8rr.rrs@r-_Indentr[sO EC E E E E E E E E E Er/rc$eZdZdeffd ZxZS)IndentedBlock._IndentGreaterrctd|_|fddS)Nz)expected indent at column greater than {}c,t||kSr)rrs r-rz7IndentedBlock._IndentGreater.__init__..ess1ayy7/Br/rrs `r-r.z%IndentedBlock._IndentGreater.__init__bsS GG     ELLWUUDK   BBBB C C C C Cr/rrs@r-_IndentGreaterrasO DC D D D D D D D D D Dr/rFTrgroupedrrrcxt|d||_||_d|_dS)NTrr)rr. _recursive_groupedr)r+rrrrs r-r.zIndentedBlock.__init__gs@ ---$ r/crt||}|j|||t ||}||}t|z|jz}|jrl||}t|j|j|j } | |j || _ |t|| zz }|dtt!|ddd|t%|} ||j t'z} |j rt(} nd} | | t+| z|||S)Nrzinner @c|Sr)r9rs r-rz)IndentedBlock.parseImpl..s4r/)rrErrcrrrrrrrrrrrhexrArrrGrouprrH) r+rrr anchor_loc indent_colpeer_detect_expr inner_expr sub_indent nested_blockblocktrailing_undentrs r-rHzIndentedBlock.parseImplqsWW%%h44  Hj)<<<X.. << 33WW//$); ? 9,,Z88J( T_dmL  " "4: . . .)3L & #j<788 8JTSJ%8%8%=%C%C%E%ETT TTUUU*%%,,t'9::Y[[H = (GG''G/!:!::EE j)   r/r) r2r7r8rGrrrrrr.rHrrs@r-rrUs EEEEE%EEE DDDDDDDD9>t!15HL! ! ! ! ! ! ! ! r/rcDeZdZdZdeeefffd Zdfd ZxZ S) AtStringStartzMatches if expression matches at the beginning of the parse string:: AtStringStart(Word(nums)).parse_string("123") # prints ["123"] AtStringStart(Word(nums)).parse_string(" 123") # raises ParseException rcXt|d|_dSNFrr.rr+rrs r-r.zAtStringStart.__init__) !r/Tcx|dkrt||dt|||S)Nrznot found at string start)rrrHr+rrrrs r-rHzAtStringStart.parseImpls; !88 30KLL Lww  3 :::r/r r2r7r8rGrrrr.rHrrs@r-rrsv"U=##56"""""";;;;;;;;;;r/rcDeZdZdZdeeefffd Zdfd ZxZ S) AtLineStartaMatches if an expression matches at the beginning of a line within the parse string Example:: test = '''\ AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (AtLineStart('AAA') + restOfLine).search_string(test): print(t) prints:: ['AAA', ' this line'] ['AAA', ' and this line'] rcXt|d|_dSrrrs r-r.zAtLineStart.__init__rr/Tct||dkrt||dt|||S)Nrznot found at line start)rrrrHrs r-rHzAtLineStart.parseImplsG sH   " " 30IJJ Jww  3 :::r/rrrs@r-rrsv,"U=##56"""""";;;;;;;;;;r/rc@eZdZdZdeeefffd ZddZxZ S) FollowedByacLookahead matching of the given parse expression. ``FollowedBy`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. ``FollowedBy`` always returns a null token list. If any results names are defined in the lookahead expression, those *will* be returned for access by name. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) attr_expr[1, ...].parse_string("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] rcXt|d|_dSr$rr.rrs r-r.zFollowedBy.__init__s) "r/TcT|j|||\}}|dd=||fS)Nrb)rr")r+rrrr?r5s r-rHzFollowedBy.parseImpls8!!(C9!EE3 FCxr/rrrs@r-rrsl,#U=##56######r/rc^eZdZdZ d deeefdeje ffd Z d dZ xZ S) PrecededByaLookbehind matching of the given parse expression. ``PrecededBy`` does not advance the parsing position within the input string, it only verifies that the specified parse expression matches prior to the current position. ``PrecededBy`` always returns a null token list, but if a results name is defined on the given expression, it is returned. Parameters: - expr - expression that must match prior to the current parse location - retreat - (default= ``None``) - (int) maximum number of characters to lookbehind prior to the current parse location If the lookbehind expression is a string, :class:`Literal`, :class:`Keyword`, or a :class:`Word` or :class:`CharsNotIn` with a specified exact or maximum length, then the retreat parameter is not required. Otherwise, retreat must be specified to give a maximum number of characters to look back from the current parse position for a lookbehind match. Example:: # VB-style variable names with type prefixes int_var = PrecededBy("#") + pyparsing_common.identifier str_var = PrecededBy("$") + pyparsing_common.identifier Nrretreatct|||_d|_d|_d|_t|trt|}d|_nt|ttfr|j }d|_nYt|ttfr|jt kr|j}d|_nt|t"r d}d|_||_dt'|z|_d|_|jddS)NTFrznot preceded by cH|tddSr)) __delitem__slicerrrs r-rz%PrecededBy.__init__..$s eD$>O>O0P0Pr/)rr.rrrrrrSr#rBr]rrrr{rrrrrrrrr )r+rrrs r-r.zPrecededBy.__init__ s/ IIKK0022 "" dH % % $iiGDJJ w0 1 1 mGDJJ tZ0 1 1 dkX6M6MkGDJJ m , , GDJ (3t994 #  P PQQQQQr/rTc(|jrJ||jkrt|||j||jz }|j||\}}n|jt z}|td||jz |}t|||j} tdt||jdzdzD]F} ||t|| z \}}n#t$r } | } Yd} ~ ?d} ~ wwxYw| ||fSr) rrrrrr"rr rprrBrm) r+rrrrr?r5 test_exprinstring_slice last_exproffsetpbes r-rHzPrecededBy.parseImpl&sA : T\!!$XsDK@@@$,&EY%%h66FAss IKK/I%c!S4<-?&@&@3&FGN&xdkBBI3sDL1,<#=#=#ABB &--&N(;(;f(DFAs E*$$$ #IIIIII$  Cxs )C55 D ?DD r))rT) r2r7r8rGrrrrrrr.rHrrs@r-rrs<PTRR-,-R8>8LRRRRRR2r/rceZdZdZddZdS)Locateda Decorates a returned token with its starting and ending locations in the input string. This helper adds the following results names: - ``locn_start`` - location where matched expression begins - ``locn_end`` - location where matched expression ends - ``value`` - the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parse_with_tabs` Example:: wd = Word(alphas) for match in Located(wd).search_string("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [0, ['ljsdf'], 5] [8, ['lksdjjf'], 15] [18, ['lkkjj'], 23] Tc|}|j|||d\}}t|||g}||d<||d<||d<|jr||gfS||fS)NFr locn_startrrlocn_end)rr"r r)r+rrrrr[r]s r-rHzLocated.parseImpl\s~i&&x PU&VV V!5&#"677 #( < $ 7!$ :   # $ $ ? "r/Nr)r2r7r8rGrHr9r/r-rr@s26 # # # # # #r/rcFeZdZdZdeeefffd ZddZdZ xZ S)ra Lookahead to disallow matching with the given parse expression. ``NotAny`` does *not* advance the parsing position within the input string, it only verifies that the specified parse expression does *not* match at the current position. Also, ``NotAny`` does *not* skip over leading whitespace. ``NotAny`` always returns a null token list. May be constructed using the ``'~'`` operator. Example:: AND, OR, NOT = map(CaselessKeyword, "AND OR NOT".split()) # take care not to mistake keywords for identifiers ident = ~(AND | OR | NOT) + Word(alphas) boolean_term = Opt(NOT) + ident # very crude boolean expression - to support parenthesis groups and # operation hierarchy, use infix_notation boolean_expr = boolean_term + ((AND | OR) + boolean_term)[...] # integers that are followed by "." are actually floats integer = Word(nums) + ~Char(".") rct|d|_d|_dt |jz|_dS)NFTzFound unwanted token, )rr.rrrrrrs r-r.zNotAny.__init__sE $".TY? r/Tcn|j||rt|||j||gfSr))rrerrrGs r-rHzNotAny.parseImpls< 9 # #Hc 2 2 C 3 TBB BBwr/c6dt|jzdzS)Nz~{rrrrs r-rzNotAny._generateDefaultNamesc$)nn$s**r/r) r2r7r8rGrrrr.rHrrrs@r-rrjs0@U=##56@@@@@@ +++++++r/rc eZdZ d dddedejeeefdejeeefffdZdefdZ dd Z dfd Z xZ S)rfNstopOnrstop_onrct||p|}d|_|}t|tr||}||dSr$)rr.rrSr#rr)r+rrrenderrs r-r.z_MultipleMatch.__init__sp "7 eX & & 4,,U33E Er/rXcrt|tr||}||nd|_|Sr))rSr#r not_ender)r+rs r-rz_MultipleMatch.stopOns> eX & & 4,,U33E#(#4%$ r/Tct|jj}|j}|jdu}|r |jj}|r |||||||\}} |j } |r |||| r |||} n|} ||| |\}} | s| r|| z }K#ttf$rYnwxYw||fSr)) rr"r?rrrrrrQ) r+rrrself_expr_parseself_skip_ignorables check_ender try_not_enderr[hasIgnoreExprsr tmptokenss r-rHz_MultipleMatch.parseImpls-)*#3nD0  4 N3M  ) M(C ( ( (%ohY?? V %)%5!55N (1!M(C000!!11(C@@FF F!069!M!MY( 1 1 3 3(i'F ( +    D F{s ABB32B3Fc tjrtj|jvr|jg|jzD]t}t |tr]|jrVtj|jvrCtj d d|t|j |jdut||Sr)rOr`rjrrr&rSrrrrSrrr2rrrs r-rz_MultipleMatch._setResultsNames  > E*++i[49#4#4#6#66  q-00 $M/00MEEKVG  JJ/M FF $%    ww&&t^<<B    }c'9!:;  mS&8 9:      } :==========r/rfceZdZdZdZdS)rar Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stop_on - (default= ``None``) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).set_parse_action(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" attr_expr[1, ...].parse_string(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stop_on attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) OneOrMore(attr_expr).parse_string(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parse_string(text).pprint() c6dt|jzdzS)Nrz}...rrs r-rzOneOrMore._generateDefaultNameS^^#f,,r/N)r2r7r8rGrr9r/r-rrs-4-----r/rc eZdZdZ d dddedejeeefdejeeefffdZ d fd Z d Z xZ S) rao Optional repetition of zero or more of the given expression. Parameters: - ``expr`` - expression that must match zero or more times - ``stop_on`` - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) - (default= ``None``) Example: similar to :class:`OneOrMore` Nrrrrc`t||p|d|_dS)NrTr)r+rrrrs r-r.zZeroOrMore.__init__s5 f&7888"r/Tc t|||S#ttf$r|t g|jfcYSwxYw)Nr)rrHrrQr rrs r-rHzZeroOrMore.parseImplsj @77$$XsI>> > + @ @ @ Rd.>???? ? ? ? @s"&)AAc6dt|jzdzS)N[z]...rrs r-rzZeroOrMore._generateDefaultNamerr/r)r) r2r7r8rGrrrrrr.rHrrrs@r-rrs  ?C# >B ####}c'9!:;# mS&8 9: ######@@@@@@ -------r/rceZdZdZdZdS) _NullTokencdSrr9rs r-__bool__z_NullToken.__bool__$sur/cdSrBr9rs r-r z_NullToken.__str__'srr/N)r2r7r8rr r9r/r-rr#s2r/rcbeZdZdZeZefdeeefde ffd Z ddZ dZ xZ S) raN Optional matching of the given expression. Parameters: - ``expr`` - expression that must match zero or more times - ``default`` (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Opt('-' + Word(nums, exact=4))) zip.run_tests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) rdefaultct|d|jj|_||_d|_dS)NFrT)rr.rr defaultValuer)r+rrrs r-r.z Opt.__init__TsD ...).#"r/Tc|j} ||||d\}}nO#ttf$r;|j}||jur&|jrt|g}|||j<n|g}ng}YnwxYw||fS)NFr)rr"rrQr_Opt__optionalNotMatchedrr )r+rrr self_exprr[ default_values r-rHz Opt.parseImpl\sI  #**8S)RW*XXKC +    -MD$===(-)=/::F4AF9011+_FF F{s&A A21A2ct|j}t|dkr[|ddt|dz dkr<|dd}t|dkr|ddt|dz dkt||p|}||_d|_d|_||_d|_t|tr| ||_ n||_ dt|j z|_ dS)NTFzNo match found for )rr. ignoreExprrr includeMatchrrSr#rr rrr)r+rrr rr rs r-r.zSkipTo.__init__s "7 ""# fh ' ' !226::DKK DK+c$)nn< r/Tc|}t|}|jj}|j |jjnd}|j |jjnd}|} | |krd| ||| rnl| ||| } n#t$rYnwxYw ||| ddn9#ttf$r| dz } YnwxYw| |kdt|||j || }|||} t| } |j r||||d\}} | | z } || fS)NrF)rrr) rBrr"r rrrrmrrQrr r) r+rrrrrCrself_failOn_canParseNextself_ignoreExpr_tryParsetmplocskiptext skipresultrs r-rHzSkipTo.parseImplsx==)*(, (?DK $ $T !)-(CDO $ $ !  '3++Hf=='3!9!9(F!K!K-  &EPUVVVV  #J/   !  !  2!3 TBB BHSL)!(++   &xieTTTHC # JJs$# A00 A=<A=BB+*B+)FNNr) r2r7r8rGrrrrrrr.rHrrs@r-rrws::~>B =-1===]C'(== = }c'9!:; =mS()======,00000000r/rceZdZdZddejeeefffd Z dZ dZ fdZ dZ dfd Zdd ed efd Zdd ed efdZd efdZdddZdZd effd Zdfd ZeZeZxZS)rfaw Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the ``Forward`` variable using the ``'<<'`` operator. Note: take care when assigning to ``Forward`` not to overlook precedence of operators. Specifically, ``'|'`` has a lower precedence than ``'<<'``, so that:: fwd_expr << a | b | c will actually be evaluated as:: (fwd_expr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the ``Forward``:: fwd_expr << (a | b | c) Converting to use the ``'<<='`` operator instead will avoid this problem. See :class:`ParseResults.pprint` for an example of a recursive parser created using ``Forward``. Nrctjdd|_t|dd|_dS)NrkrrFr)rr caller_framerr. lshift_liners r-r.zForward.__init__sI%3!<<> >( )/ Q/ Q 0D- Q(,S$ -A(B%+k955&%%!1!1!3!33/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ Q' Q' Q' Qd+u-!G" #'Ld8#)d8n 3$(NDMQ@,1GG,=,=hU,S,S))@@@%i;;"!,4i @ (**$@FJ']R1HkDN $XW #+[-=-=-?-?#???I/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ QJ!N')9)9999M/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ QR%&&050A0A(CQU0V0VW #1&&&BI1 MXg %&@G?PP+)d8n5Q' Q/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ Q/ Qs I5:DAI2 &FI2$F.+I2-F..7I2%I53I2 I5I2&II2 I  II  I22I55I9<I9rrXcd|_|Srrrs r-rzForward.leave_whitespaces# r/cd|_|Sr$rrs r-rzForward.ignore_whitespaces" r/cb|js'd|_|j|j|Sr$)rrrrs r-rzForward.streamlines6 '#D y$ $$&&& r/c|g}||vr/|dd|gz}|j|j||gdSr)rrs r-r/zForward.validatese  M } $ $"dV+Cy$ ""3''' R     r/cd|_d} |jt|jdd}nd}|jjdz|zS#|jjdz|zccYSxYw)Nz: ...riNonez: )rrrrr2)r+ retStrings r-rzForward._generateDefaultNamesz#  >y$ NN5D51 " >*T1I= =4>*T1I= = = = = = = = =s &AAc||j tSt}||z}|Sr))rrr rfrs r-r z Forward.copys4 9 77<<>> !))C DLCJr/Fc tjrWtj|jvrD|j=t jdd|t|j dt ||S)NzO{}: setting results name {!r} on {} expression that has no contained expressionrar$r) rOrarjrrrrSrrr2rr)r+rUrrs r-rzForward._setResultsNames  3 :*++y  77=v8$T @S88 ! ww&&t-=>>>r/r)rr^r~)r2r7r8rGrrrrrr.rr!rr(rHrrrrr/rr rrrrrs@r-rfrfs8  foeM34F.GH      "        ]Q]Q]Q]Q]Q]Q~$-4=M!!!!! > > >m??????")&OOOOOr/rfc:eZdZdZddeeefffd ZxZS)TokenConverterzW Abstract subclass of :class:`ParseExpression`, for converting parsed results. FrcXt|d|_dSr)rr.rrs r-r.zTokenConverter.__init__s& r/r~) r2r7r8rGrrrr.rrs@r-rArAs]  U=##56          r/rAc leZdZdZ ddddededed ejeffd Z d effd Z d Z xZ S)CombineaConverter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying ``'adjacent=False'`` in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parse_string('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parse_string('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parse_string('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parse_string('3. 1416')) # -> Exception: Expected W:(0123...) r~TN) joinStringr join_stringadjacentrEct|||n|}|r|||_d|_||_d|_dSr$)rr.rrGrrEr)r+rrFrGrErs r-r.zCombine.__init__si #-#9ZZ{  $  ! ! # # #  "$ r/rXc|jrt||n!t||Sr))rGrr rrs r-r zCombine.ignore"sA = "  u - - - - GGNN5 ! ! ! r/c|}|dd=|td||jg|jz }|jr|r|gS|S)Nr~)rP)r r r _asStringListrErrr)r+rrrKretTokss r-rLzCombine.postParse)s.."" AAAJ< WWY,,T_== > > ?tGX        1 1 9 Nr/)r~T) r2r7r8rGrrrrrr.r rLrrs@r-rDrDs* ! ,0 !!!!! ! OC( !!!!!!$}       r/rDc4eZdZdZddedeffd ZdZxZS)raConverter to return the matched tokens as a list - useful for returning tokens of :class:`ZeroOrMore` and :class:`OneOrMore` expressions. The optional ``aslist`` argument when set to True will return the parsed tokens as a Python list instead of a pyparsing ParseResults. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Opt(delimited_list(term)) print(func.parse_string("fn a, b, 100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Opt(delimited_list(term))) print(func.parse_string("fn a, b, 100")) # -> ['fn', ['a', 'b', '100']] Fraslistcft|d|_||_dSr$)rr.r _asPythonList)r+rrNrs r-r.zGroup.__init__K0 #r/c|jrJtjt|tr|nt |S|gSr))rPr r rSrOrrJs r-rLzGroup.postParsePsX   $i66%   """)__  ; r/r~ r2r7r8rGrrr.rLrrs@r-rr6si($$]$D$$$$$$ r/rc4eZdZdZddedeffd ZdZxZS)rarConverter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. The optional ``asdict`` argument when set to True will return the parsed tokens as a Python dict instead of a pyparsing ParseResults. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) # print attributes as plain groups print(attr_expr[1, ...].parse_string(text).dump()) # instead of OneOrMore(expr), parse using Dict(Group(expr)[1, ...]) - Dict will auto-assign names result = Dict(Group(attr_expr)[1, ...]).parse_string(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.as_dict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: 'light blue' - posn: 'upper left' - shape: 'SQUARE' - texture: 'burlap' SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at :class:`ParseResults` of accessing fields by results name. Frasdictcft|d|_||_dSr$)rr.r _asPythonDict)r+rrUrs r-r.z Dict.__init__rQr/c~t|D]j\}}t|dkr|d}t|tr!t |}t|dkrt d|||<t|dkr5t|dtst |d|||< |}n #t$rtd}|dwxYw|d=t|dks)t|tr)| rt ||||<Qt |d|||<l|j r0|j r|gn|S|j r|gn|S)Nrrr~rkzdcould not extract dict values from parsed results - Dict expression must contain Grouped expressions)rrBrSrrrZr!r r rRrrrWras_dict) r+rrrKr|tokikey dictvaluers r-rLzDict.postParses ** O OFAs3xx1}}q6D$$$ )4yy((3xx1}}"9"a"@"@ $SQz#a&,'G'G"9#a&!"D"D $( # II (((#NC4' (aLy>>Q&&y,77'i&K&KIdOO&=ilA&N&NIdOO   B,0,<UI%%''(()BSBSBUBU U"&"2AI;; As C--D r~rSrs@r-rr[sq''R$$]$D$$$$$$ %B%B%B%B%B%B%Br/rcheZdZdZd deeefdeffd Zd fd Z d fd Z d Z defd Z xZ S)raConverter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + (',' + wd)[...] print(wd_list1.parse_string(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + (Suppress(',') + wd)[...] print(wd_list2.parse_string(source)) # Skipped text (using '...') can be suppressed as well source = "lead in START relevant text END trailing text" start_marker = Keyword("START") end_marker = Keyword("END") find_body = Suppress(...) + start_marker + ... + end_marker print(find_body.parse_string(source) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] ['START', 'relevant text ', 'END'] (See also :class:`delimited_list`.) Frrc|durtt}t|dS)N.)rrrr.rs r-r.zSuppress.__init__s; 3;; **D r/rXrct|jtrtt ||zSt |Sr))rSrrrrrrrs r-rzSuppress.__add__F di . . *F5MM**U2 277??5)) )r/ct|jtrtt ||z St |Sr))rSrrrrrrrs r-rzSuppress.__sub__r`r/cgSr)r9rJs r-rLzSuppress.postParser'r/c|Sr)r9rs r-rzSuppress.suppresss r/r~r)r2r7r8rGrrrrr.rrrLrrrs@r-rrs<U=##56$ ****** ****** -r/rr:cHtfd}j|_|S)asDecorator for debugging parse actions. When the parse action is called, this decorator will print ``">> entering method-name(line:, , )"``. When the parse action completes, the decorator will print ``"<<"`` followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @trace_parse_action def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = wd[1, ...].set_parse_action(remove_duplicate_chars) print(wds.parse_string("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering {}(line: {!r}, {}, {!r}) z<.zs :+1a v;;??ay*3c9HDH  3 : :8T!QZZQRTU V V    !V*CC    J  =DDXsSS T T T   5< "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as ``\-`` or ``\]``) - an escaped hex character with a leading ``'\x'`` (``\x21``, which is a ``'!'`` character) (``\0x##`` is also supported for backwards compatibility) - an escaped octal character with a leading ``'\0'`` (``\041``, which is a ``'!'`` character) - a range of any of the above, separated by a dash (``'a-z'``, etc.) - any combination of the above (``'aeiouy'``, ``'a-zA-Z0-9_$'``, etc.) c t|ts|nUddtt |dt |ddzDS)Nr~c34K|]}t|VdSr))rtrs r-r*z+srange....Qs(EESVVEEEEEEr/rr)rSr rrpord)ps r-rzsrange..Os^!\**F!! WWEEU3qt99c!A$ii!m%D%DEEE E Er/r~c3.K|]}|VdSr)r9)rCpart _expandeds r-r*zsrange..Ts+WW4yyWWWWWWr/)r_reBracketExprrrxrR)rrs @r-sranger4ss6 F F wwWWWW>3N3Nq3Q3Q3VWWWWWW rrs=A AAclfd}tdtdj}||_|S)a^Helper to define a parse action by mapping a function to all elements of a :class:`ParseResults` list. If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in ``hex_integer = Word(hexnums).set_parse_action(token_map(int, 16))``, which will convert the parsed data to an integer using base 16. Example (compare the last to example in :class:`ParserElement.transform_string`:: hex_ints = Word(hexnums)[1, ...].set_parse_action(token_map(int, 16)) hex_ints.run_tests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).set_parse_action(token_map(str.upper)) upperword[1, ...].run_tests(''' my kingdom for a horse ''') wd = Word(alphas).set_parse_action(token_map(str.title)) wd[1, ...].set_parse_action(' '.join).run_tests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] c"fd|DS)Nc"g|] }|gR Sr9r9)rCtoknrr,s r-rEz)token_map..pa..s+000dT!D!!!000r/r9)rrrrr,s r-rztoken_map..pa~s 00000a0000r/r2r)rr2)r,rrrs`` r- token_maprYsOJ111111j'$ *D*D*MNNIBK Ir/ctjjjD]6\}}t |t r|js||7dS)zy Utility to simplify mass-naming of parser elements, for generating railroad diagram with named subdiagrams. N) r^ _getframef_backf_localsrGrSrrr)rUvars r-autoname_elementsrsg ]__+4::<< c c= ) ) #.  LL   r/z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalz#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]c<g|]}t|t|Sr9)rSr)rCrJs r-rErEs7''' *Q ">">''''r/rr^)r$rr~)osrrrrrrrr r r r abcr renumrrr rrr^collections.abcrrtypesoperatorr functoolsr threadingrpathlibrutilrrrrrrrrrrr exceptionsactionsrr r!unicoder"maxsizerrbytesr#rr version_infor&r;rOrjrsrvr]rrr warnoptionsenvironr/sumrBrr+rrrrr.rr r GeneratorTyperrrrrRrrrrascii_uppercaseascii_lowercasealphasLatin1 identcharsidentbodycharsnumshexnumsrr printablerr StackSummaryrrrrrrrrrrrr]rrrrrrrrr0r4rWr{rrrrrrrrrrrrrrrrrrrrrrrfrrrrrrfrArDrrrrlrrmrnrorprqr2 _escapedPunc_escapedHexChar_escapedOctChar _singleChar _charRangerrrrrdbl_quoted_stringsgl_quoted_stringrbunicode_string alphas8bitpunc8bitr>valuesrtokenMapconditionAsParseActionnullDebugActionsglQuotedStringdblQuotedString quotedString unicodeString lineStartlineEnd stringStart stringEndtraceParseActionr9r/r-rs                         $#######  $$$$$$                       ::::::::&&&&&& ;!5\%c )))4v))))))).~,*****$***B$;$4$$$$%K%D%%%%####!?3/?Es?S "ORZ^^$@AA     $ RW l^S ! c< # %& c3 %s *+-  RX l^T !" c< $ &' c3 %t +,. CoyA4GHS#=tCD#sO\48$> c?It Ld RS  &"8 8  % 0 ")8   TM WWPP!1PPP Q Q 04y-4449999z,?,?,?,?,? ,?,?,?^CCCCCmCCC.-"CCCCC CCC( 4m6^'^'^'^'^'m^'^'^'BW!W!W!W!W!/W!W!W!tX=X=X=X=X=X=X=X=vl=l=l=l=l=l=l=l=^dBdBdBdBdB?dBdBdBNZ'Z'Z'Z'Z'-Z'Z'Z'z= = = = = '= = = @;;;;;';;;*;;;;;%;;;B!!!!!$!!!HNNNNN$NNNb'#'#'#'#'#!'#'#'#T(+(+(+(+(+ (+(+(+VK=K=K=K=K=(K=K=K=\-------->--------BF!F!F!F!F! F!F!F!R CCCCC CCCLs's's's's'!s's's'l     (   66666n666r"""""N"""JTBTBTBTBTB>TBTBTBn44444~444n, +, +, , , , ` !! Y[[ ! !, / / 799  j ) ){}}%%n55 Y[[ ! !, / / tG.a888II %/00AA55% %%66))?"_4zz%q7Q7Q7QQ U;#.< = =  GCLL c#hh))* eIIj;. / /00AA&IIJ  "c"c""""J+k++++\G E ABBSH ( -..G E ABBSH ( -.. E ABBSH e CDDsJK ( 788 }1133344==>VWWV: ; ; 6, - -''tvv}}''']# 2###     %r/PK!}228_vendor/pyparsing/__pycache__/exceptions.cpython-311.pycnu[ ,Re?# pddlZddlZddlZddlmZmZmZmZddlm Z Gdde j e j e j e je jZeejZejdezdzZGd d eZGd d eZGd deZGddeZGddeZdS)N)collinelineno_collapse_string_to_ranges)pyparsing_unicodeceZdZdS)ExceptionWordUnicodeN)__name__ __module__ __qualname__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/exceptions.pyr r sDrr z([z ]{1,16})|.ceZdZdZ ddededejefdZe dd Z e d Z e d efd Ze d efd Ze d efdZe d efdZd efdZdZdddded efdZdd efdZeZdS)ParseBaseExceptionz7base exception class for all parsing runtime exceptionsrNpstrlocmsgc||_|||_d|_n||_||_|x|_|_|||f|_dS)N)rrrparser_element parserElementargs)selfrrrelems r__init__zParseBaseException.__init__sP ;DHDIIDHDI377d03$ rcddl}ddlm}|tj}g}t |t r=||j|d|j dz zdz|d t|j ||dkr| |j|}t}t!|| dD]M\}}|d} | jd d} t | |r| jjd vrHt+| |vrZ|t+| t| } |d | j| j | n| Ct| } |d | j| j n?| j} | jd vr|d | j|dz}|snOd|S)a Method to take an exception and translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised. Parameters: - exc - exception raised during parsing (need not be a ParseException, in support of Python exceptions that might be raised in a parse action) - depth (default=16) - number of levels back in the stack trace to list expression and function names; if None, the full stack trace names will be listed; if 0, only the failing input line, marker, and exception string will be shown Returns a multi-line string listing the ParserElements and/or function names in the exception's stack trace. rNr) ParserElement ^z{}: {})contextr) parseImpl _parseNoCachez {}.{} - {}z{}.{})wrapperzz{} )inspectcorer sysgetrecursionlimit isinstancerappendrcolumnformattyper getinnerframes __traceback__set enumeratef_localsgetf_codeco_nameidaddr join) excdepthr(r retcallersseenifffrmf_self self_typecodes rexplain_exceptionz$ParseBaseException.explain_exception)sW" '''''' =)++E c- . . 5 JJsx JJscj1n-3 4 4 4 8??499#5s;;<<< 199,,S->,NNG55D"7E677#344  2e))&$77fm44:z)1OOO &zzT)) HHRZZ((( $V IJJ$++%0)2Df ' $V IJJw~~i.BIDVWWXXXX:D|'>>> JJt{{4<88999 Eyy~~rcF||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clspes r_from_exceptionz"ParseBaseException._from_exceptionks# s27BFBFB,<===rreturnc6t|j|jS)zG Return the line of text where the exception occurred. )rrrrs rrzParseBaseException.liness DHdi(((rc6t|j|jS)zV Return the 1-based line number of text where the exception occurred. )rrrrNs rrzParseBaseException.linenozs dh ***rc6t|j|jSz] Return the 1-based column on the line of text where the exception occurred. rrrrNs rrzParseBaseException.col 48TY'''rc6t|j|jSrQrRrNs rr.zParseBaseException.columnrSrc|jr|jt|jkrd}nut|j|j}||d}n|j|j|jdz}d|zdd}nd}d|j||j|j |j S) Nz, found end of textrrz , found %rz\\\rz%{}{} (at char {}), (line:{}, col:{})) rrlen_exception_word_extractormatchgroupreplacer/rrr.)rfoundstr found_matchfounds r__str__zParseBaseException.__str__s 9 x3ty>>))08==diRR *'--a00EE IdhA&=>E(5099%FFH6== Hh$+t{   rc t|SN)strrNs r__repr__zParseBaseException.__repr__s4yyrz>!<) markerString marker_stringc||n|}|j}|jdz }|r(d|d||||df}|S)z Extracts the exception line from the input string, and marks the location of the exception with a special symbol. Nrr)rr.r;strip)rrerdline_str line_columns rmark_input_linez"ParseBaseException.mark_input_linesm )6(A}}| 9kAo  ww,;,'x 7MNH~~rc.|||S)a  Method to translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised. Parameters: - depth (default=16) - number of levels back in the stack trace to list expression and function names; if None, the full stack trace names will be listed; if 0, only the failing input line, marker, and exception string will be shown Returns a multi-line string listing the ParserElements and/or function names in the exception's stack trace. Example:: expr = pp.Word(pp.nums) * 3 try: expr.parse_string("123 456 A789") except pp.ParseException as pe: print(pe.explain(depth=0)) prints:: 123 456 A789 ^ ParseException: Expected W:(0-9), found 'A' (at char 8), (line:1, col:9) Note: the diagnostic output will include string representations of the expressions that failed to parse. These representations will be more helpful if you use `set_name` to give identifiable names to your expressions. Otherwise they will use the default string forms, which may be cryptic to read. Note: pyparsing's default truncation of exception tracebacks may also truncate the stack of expressions that are displayed in the ``explain`` output. To get the full listing of parser expressions, you may have to set ``ParserElement.verbose_stacktrace = True`` )rG)rr=s rexplainzParseBaseException.explainsJ%%dE222r)rNN)rra)r r r __doc__rbinttypingOptionalr staticmethodrG classmethodrKpropertyrrrr.r_rcrjrl markInputlinerrrrrsAA$(  %%%%_S ! %%%%"???\?B>>[>)c)))X) ++++X+ (S(((X( ((((X(      $      S  SV     %3%33%3%3%3%3N$MMMrrceZdZdZdS)ParseExceptionaq Exception thrown when a parse expression doesn't match the input string Example:: try: Word(nums).set_name("integer").parse_string("ABC") except ParseException as pe: print(pe) print("column: {}".format(pe.column)) prints:: Expected integer (at char 0), (line:1, col:1) column: 1 Nr r r rmrrrrvrvsrrvceZdZdZdS)ParseFatalExceptionzu User-throwable exception thrown when inconsistent parse content is found; stops all parsing immediately NrwrrrryrysrryceZdZdZdS)ParseSyntaxExceptionz Just like :class:`ParseFatalException`, but thrown internally when an :class:`ErrorStop` ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found. Nrwrrrr{r{srr{c$eZdZdZdZdefdZdS)RecursiveGrammarExceptionz Exception thrown by :class:`ParserElement.validate` if the grammar could be left-recursive; parser may need to enable left recursion using :class:`ParserElement.enable_left_recursion` c||_dSra)parseElementTrace)rparseElementLists rrz"RecursiveGrammarException.__init__s!1rrLc6d|jS)NzRecursiveGrammarException: {})r/rrNs rr_z!RecursiveGrammarException.__str__ s.55d6LMMMrN)r r r rmrrbr_rrrr}r}sO 222NNNNNNNrr})rer*routilrrrrunicoderppuLatin1LatinALatinBGreekCyrillicr alphanums_extract_alphanumscompilerX Exceptionrrvryr{r}rrrrs ????????????------     3:sz3:sy#,   0/0D0NOO&BJt.@'@<'OPPF$F$F$F$F$F$F$F$R'(,. N N N N N N N N N NrPK!­5tLtL5_vendor/pyparsing/__pycache__/testing.cpython-311.pycnu[ ,ReZ4PddlmZddlZddlmZmZmZmZmZGddZ dS))contextmanagerN) ParserElementParseExceptionKeyword__diag__ __compat__ceZdZdZGddZGddZe dd ed ej e d ej e d e d edej edej edefdZ dS)pyparsing_testzB namespace class for classes useful in writing unit tests c6eZdZdZdZdZdZdZdZdZ dS) &pyparsing_test.reset_pyparsing_contexta Context manager to be used when writing unit tests that modify pyparsing config values: - packrat parsing - bounded recursion parsing - default whitespace characters. - default keyword characters - literal string auto-conversion class - __diag__ settings Example:: with reset_pyparsing_context(): # test that literals used to construct a grammar are automatically suppressed ParserElement.inlineLiteralsUsing(Suppress) term = Word(alphas) | Word(nums) group = Group('(' + term[...] + ')') # assert that the '()' characters are not included in the parsed tokens self.assertParseAndCheckList(group, "(abc 123 def)", ['abc', '123', 'def']) # after exiting context manager, literals are converted to Literal expressions again ci|_dSN) _save_contextselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/testing.py__init__z/pyparsing_test.reset_pyparsing_context.__init__-s!#D   ctj|jd<tj|jd<tj|jd<tj|jd<tj|jd<tjrtjj |jd<n d|jd<tj |jd<tj |jd<d tj D|jd <d tji|jd <|S) Ndefault_whitespacedefault_keyword_charsliteral_string_classverbose_stacktracepackrat_enabledpackrat_cache_size packrat_parserecursion_enabledc:i|]}|tt|S)getattrr).0names r z?pyparsing_test.reset_pyparsing_context.save..Fs1...26gh--...rrcollect_all_And_tokensr )rDEFAULT_WHITE_CHARSrrDEFAULT_KEYWORD_CHARS_literalStringClassr_packratEnabled packrat_cachesize_parse_left_recursion_enabledr _all_namesr r%rs rsavez+pyparsing_test.reset_pyparsing_context.save0s7D7XD 3 4:A:WD 6 71  & 8E7WD 3 44A4QD 0 1, @"/4"(<@"#782?2FD  /5  # ..:B:M...D z * )**K0D | ,Krctj|jdkrtj|jd|jdt_|jdt _tj|jd|jdD](\}}|r tj n tj |)dt_ |jdr tj |jdn|jd t_|jd t_|jd t _|S) NrrrrrFrrrrr )rr&rset_default_whitespace_charsrrr'inlineLiteralsUsingitemsrenabledisabler)enable_packratr,r-r r%)rr#values rrestorez.pyparsing_test.reset_pyparsing_context.restorePsE1%&:;<<:&';<04/ABV/WM ,,0,>?V,WG )  -"#9:    $1*=CCEE G G e?E?x/?FFFF,1M )!"34 K,T-?@T-UVVVV'+'9/'J $484F#5M 1150B<0PJ -Krcrt|}|j|j|Sr)typerupdate)rrets rcopyz+pyparsing_test.reset_pyparsing_context.copyqs2$t**,,C   $ $T%7 8 8 8Jrc*|Sr)r/rs r __enter__z0pyparsing_test.reset_pyparsing_context.__enter__vs99;; rc.|dSr)r8)rargss r__exit__z/pyparsing_test.reset_pyparsing_context.__exit__ys LLNNNNNrN) __name__ __module__ __qualname____doc__rr/r8r=r?rBr rrreset_pyparsing_contextr sz  0 $ $ $   @   B            rrGcVeZdZdZ d dZ d dZ d dZ d dZee dfdZ dS) &pyparsing_test.TestParseResultsAssertszk A mixin class to add parse results assertion methods to normal unittest.TestCase classes. Nc|*|||||,||||dSdS)z Unit test assertion to compare a :class:`ParseResults` object with an optional ``expected_list``, and compare any defined results names with an optional ``expected_dict``. Nmsg) assertEqualas_listas_dict)rresult expected_list expected_dictrLs rassertParseResultsEqualsz?pyparsing_test.TestParseResultsAsserts.assertParseResultsEqualssh(  0@0@c JJJ(  0@0@c JJJJJ)(rTc||d}|r"t|n!t|||||dS)z Convenience wrapper assert to test a parser element and input string, and assert that the resulting ``ParseResults.asList()`` is equal to the ``expected_list``. T) parse_all)rQrLN parse_stringprintdumprNrS)rexpr test_stringrQrLverboserPs rassertParseAndCheckListz>pyparsing_test.TestParseResultsAsserts.assertParseAndCheckListsw&&{d&CCF (fkkmm$$$$fnn&&'''  ) )& SV ) W W W W Wrc||d}|r"t|n!t|||||dS)z Convenience wrapper assert to test a parser element and input string, and assert that the resulting ``ParseResults.asDict()`` is equal to the ``expected_dict``. T)parseAll)rRrLNrV)rrZr[rRrLr\rPs rassertParseAndCheckDictz>pyparsing_test.TestParseResultsAsserts.assertParseAndCheckDictsw&&{T&BBF (fkkmm$$$$fnn&&'''  ) )& SV ) W W W W Wrc|\}}|dt||D}|D]\}}} td| Dd} td| Dd} | J|| | p|5t|tr| dddn #1swxYwYtd| Dd} td| Dd} | | fdkr||| | | p| t d |||||nd dS) ah Unit test assertion to evaluate output of ``ParserElement.runTests()``. If a list of list-dict tuples is given as the ``expected_parse_results`` argument, then these are zipped with the report tuples returned by ``runTests`` and evaluated using ``assertParseResultsEquals``. Finally, asserts that the overall ``runTests()`` success value is ``True``. :param run_tests_report: tuple(bool, [tuple(str, ParseResults or Exception)]) returned from runTests :param expected_parse_results (optional): [tuple(str, list, dict, Exception)] Nc"g|] \}}g||R Sr r )r"rptexpecteds r zOpyparsing_test.TestParseResultsAsserts.assertRunTestResults..s9%X%c$8$$rc3DK|]}t|t|VdSr) isinstancestrr"exps r zNpyparsing_test.TestParseResultsAsserts.assertRunTestResults..s1IIJsC4H4HIIIIIIIrc3nK|]0}t|tt|t,|V1dSr)rgr: issubclass Exceptionris rrkzNpyparsing_test.TestParseResultsAsserts.assertRunTestResults..s[ #)#t44:DC9S9Sr)expected_exceptionrLc3DK|]}t|t|VdSr)rglistris rrkzNpyparsing_test.TestParseResultsAsserts.assertRunTestResults..1NNS 38M8MNSNNNNNNrc3DK|]}t|t|VdSr)rgdictris rrkzNpyparsing_test.TestParseResultsAsserts.assertRunTestResults..rrrNN)rQrRrLzno validation for {!r}zfailed runTestsrK) zipnext assertRaisesrgrnrSrXformat assertTrue)rrun_tests_reportexpected_parse_resultsrLrun_test_successrun_test_resultsmergedr[rPrdfail_msgrorQrRs rassertRunTestResultsz;pyparsing_test.TestParseResultsAsserts.assertRunTestResultss82B . .%1),-=?U)V)V6<%P%P1K $IIIII4  H*.'/  **&*5!../AxSV/-- *&)<<-&, ---------------- )-NNHNNNPT)) )-NNHNNNPT)) *=9\II 99 &.;.;$,O :"":"A"A+"N"NOOOO OO S_ccBS      s;B  B$ 'B$ c#rK|||5dVddddS#1swxYwYdS)NrK)rx)rexc_typerLs rassertRaisesParseExceptionzApyparsing_test.TestParseResultsAsserts.assertRaisesParseExceptions""8"55                    s ,00)NNN)NTru) rCrDrErFrSr]r`rrrrr rrTestParseResultsAssertsrI|s  GK K K K KGK X X X XGK X X X XFJ= = = = ~ 6D$       rrNT|s start_lineend_line expand_tabseol_mark mark_spaces mark_controlreturnc |r|}dkrVtdtt ddt ddDdd iz}d nEtfd t t dd dgzD}||}|U|d krO|dkr3tddd}||}n|d |}|d}|t|}t|t|}ttd||}dkr | |dz |}n*d| d|dz |D}|sd Stt|td|D} d dzz} | dkrD| d dt t| dzdDzdz} nd } | | zd dt | dz Dzdz} | d| dz zzdz} | | zd fdt||DzdzS)u  Helpful method for debugging a parser - prints a string with line and column numbers. (Line and column numbers are 1-based.) :param s: tuple(bool, str - string to be printed with line and column numbers :param start_line: int - (optional) starting line number in s to print (default=1) :param end_line: int - (optional) ending line number in s to print (default=len(s)) :param expand_tabs: bool - (optional) expand tabs to spaces, to match the pyparsing default :param eol_mark: str - (optional) string to mark the end of lines, helps visualize trailing spaces (default="|") :param mark_spaces: str - (optional) special character to display in place of spaces :param mark_control: str - (optional) convert non-printing control characters to a placeholding character; valid values: - "unicode" - replaces control chars with Unicode symbols, such as "␍" and "␊" - any single character string - replace control characters with given string - None (default) - string is displayed as-is :return: str - input string with leading line numbers and column number headers Nunicodeci|]\}}|| Sr r )r"cus rr$z4pyparsing_test.with_line_numbers..sOOOdaQOOOrr!i$i3$i!$ci|]}|Sr r )r"rrs rr$z4pyparsing_test.with_line_numbers..sIIIQ IIIr  i $i#$) rrcg|]}|dzS)␊r r"lines rrez4pyparsing_test.with_line_numbers..'sZZZte|ZZZrrc34K|]}t|VdSr)lenrs rrkz3pyparsing_test.with_line_numbers..,s(993t99999999rcc3NK|] }dd|dzdzV!dS)z{}{}zc rdNryr"is rrkz3pyparsing_test.with_line_numbers..1sLMM(QUcM::rr c3LK|]}d|dzdzV dS)z {}r Nrrs rrkz3pyparsing_test.with_line_numbers..<sL$$a!er\22rr 1234567890c3NK|]\}}d||V dS)z {:{}d}:{}{}Nr)r"rrr lineno_widths rrkz3pyparsing_test.with_line_numbers..FsOAt$$Q dHEEr)start) expandtabsrh maketransrvrangerq translatereplacerminmax splitlinessplitjoin enumerate)rrrrrrrtbls_lines max_line_lenleadheader0header1header2rs ` ` @rwith_line_numbersz pyparsing_test.with_line_numberssn8   A  #y((mmOOc%2,,ff8M8M&N&NOOOFm$mmIIIId5B<<.@.@C5.HIII C  A  "{c'9'9i''mmF$;$;<<KK$$IIc;//  J  1vvHxQ((Q ++X66 9 $ $llnnZ!^h%>?GGZZzA~PX?X0YZZZG 23x==)) 9999999 lQ&' 2  ''"3|s':A#>#>??   GG  gg,"!4566     L=B+>)?@@4G  ii( CCC     r)NNTrNN) rCrDrErFrGr staticmethodrhtypingOptionalintboolrr rrr r s0ffffffffPoooooooob,0)- ,0-1] ] ] OC(] /#&]  ]  ] _S) ] oc*]  ] ] ] \] ] ] rr ) contextlibrrcorerrrrr r r rrrs&%%%%% | | | | | | | | | | rPK!-5_vendor/pyparsing/__pycache__/helpers.cpython-311.pycnu[ ,Re٘UddlZddlZddlZddlmZddlTddlmZm Z m Z  dXddd e e e fd e e e fd ed ejed ejedede fdZ dYddd e deje deje de fdZd e de fdZd e de fdZ dZdddde eje e fdededededede fdZd e d!e de fd"Z d[dd#d e d$ed%ede fd&Zd e de fd'Zd e de fd(Zd)d*defed+d,e e e fd-e e e fd.eje d/e d0e de f d1Zed2ed3fd4Zd5e e e fdee e ffd6Z d5e e e fdee e ffd7Z!e e"d8<e e"d9<e e#e$e%d:z&d;\Z'Z(d<ej)j*+DZ,e-d=d>.e,zd?z&d@Z/dAZ0GdBdCe1Z2e e e ee e e fe e e fffZ3e ee3ee2eje4fee3ee2ffZ5ed)ed*fdDe dEe6e5dFe e e fdGe e e fde f dHZ7dgfdIZ8e9e-dJdKz&dLZ: e-dM&dNZ; e-dO<&dPZ=e-dQ&dRZ> e9e-dJdKze>z&dSZ? e?Z@ e-dT&dUZA dVeBCDZDe6e e"dW<eZEeZFeZGeZHeZIeZJeZKeZLe ZMe!ZNe'e(cZOZPe/ZQe0ZRe2ZSe7ZTe:ZUe;ZVe=ZWe>ZXe?ZYe@ZZeAZ[dS)\N)__diag__)*)_bslash_flatten_escape_regex_range_chars,F)allow_trailing_delimexprdelimcombineminmaxr returnc t|trt|}dt |t ||r"dt |nd}|st|}||dkrtd|dz}||||krtd|dz}|||z||fz}|r|t|z }|r"t| |S| |S) a/Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing ``combine=True`` in the constructor. If ``combine`` is set to ``True``, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. If ``allow_trailing_delim`` is set to True, then the list may end with a delimiter. Example:: delimited_list(Word(alphas)).parse_string("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimited_list(Word(hexnums), delim=':', combine=True).parse_string("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z{expr} [{delim} {expr}]...{end}z [{}])r r endNrzmin must be greater than 0z)max must be greater than, or equal to min) isinstancestr_type ParserElement_literalStringClassformatstrcopy streamlineSuppress ValueErrorOptCombineset_name)r r r rrr dlNamedelimited_list_exprs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/helpers.pydelimited_listr$sY4$!!70066 . 5 5 '')) * *%jj*> FGNN3u:: & & &B6F    779:: : q  ?sczzHII I q%$,S!99*s5zz)4*++44V<<<"++F333)intExprint_exprr&cb|p|}tfd}|)ttd}n|}|d||d|zdtzdzS) a~Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If ``int_expr`` is specified, it should be a pyparsing expression that produces an integer value. Example:: counted_array(Word(alphas)).parse_string('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binary_constant = Word('01').set_parse_action(lambda t: int(t[0], 2)) counted_array(Word(alphas), int_expr=binary_constant).parse_string('10 ab cd ef') # -> ['ab', 'cd'] # if other fields must be parsed after the count but before the # list items, give the fields results names and they will # be preserved in the returned ParseResults: count_with_metadata = integer + Word(alphas)("type") typed_array = counted_array(Word(alphanums), int_expr=count_with_metadata)("items") result = typed_array.parse_string("3 bool True True False") print(result.dump()) # prints # ['True', 'True', 'False'] # - items: ['True', 'True', 'False'] # - type: 'bool' cR|d}|r|zn tz|dd=dSNr)Empty)sltn array_exprr s r#count_field_parse_actionz/counted_array..count_field_parse_actionss6 aDQ3qEGG3 aaaDDDr%Nc,t|dSr*)intr.s r#zcounted_array..{sAaD r%arrayLenT)call_during_tryz(len) z...)ForwardWordnumsset_parse_actionrr add_parse_actionr)r r'r&r1r0s` @r# counted_arrayr=GsR!GJt**--.A.ABB,,.. Z    5tLLL j * *8c$ii+?%+G H HHr%ctfd}||ddt|zS)a9Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_literal(first) match_expr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches a previous literal, will also match the leading ``"1:1"`` in ``"1:10"``. If this is not desired, use :class:`match_previous_expr`. Do *not* use with packrat parsing enabled. c|r_t|dkr |dzdSt|}td|DzdSt zdS)Nrrc34K|]}t|VdSN)Literal).0tts r# zImatch_previous_literal..copy_token_to_repeater..s(77272;;777777r%)lenras_listAndr+)r,r-r.tflatreps r#copy_token_to_repeaterz6match_previous_literal..copy_token_to_repeaters{  1vv{{qt !--s77777777777 577NNNNr%T callDuringTry(prev) )r8r<r r)r rKrJs @r#match_previous_literalrOse ))C      0EEELLSYY&''' Jr%ct|}|zfd}||ddt |zS)aWHelper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_expr(first) match_expr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches by expressions, will *not* match the leading ``"1:1"`` in ``"1:10"``; the expressions are evaluated first, and then compared, so ``"1"`` is compared with ``"10"``. Do *not* use with packrat parsing enabled. ct|fd}|ddS)Nct|}|kr%t||d|dS)NzExpected {}, found{})rrGParseExceptionr)r,r-r. theseTokens matchTokenss r#must_match_these_tokenszTmatch_previous_expr..copy_token_to_repeater..must_match_these_tokenssU"199;;//Kk))$q077 [QQ*)r%TrL)rrGr;)r,r-r.rVrUrJs @r#rKz3match_previous_expr..copy_token_to_repeatersTqyy{{++       4DIIIIIr%TrLrN)r8rr<r r)r e2rKrJs @r#match_previous_exprrXs ))C BBJC J J J J J 0EEELLSYY&''' Jr%T)useRegex asKeywordstrscaseless use_regex as_keywordrYrZc |p|}|o|}t|tr(tjrtdd|rd}d}|rt ntnd}d}|rtntg}t|tr| }n4t|trt|}ntd|stStd |Drd } | t!|d z kr|| } t#|| d zd D]I\} } || | r || | zd z=n3|| | r!|| | zd z=|| | nJ| d z } | t!|d z k|r#|r t&jnd } t+d |Dr3ddd|D}ndd|D}|rd|}t1|| d|}|r$d|D|fd|S#t&j$rtddYnwxYwt9fd|Dd|S)a Helper to quickly define a set of alternative :class:`Literal` s, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a :class:`MatchFirst` for best performance. Parameters: - ``strs`` - a string of space-delimited literals, or a collection of string literals - ``caseless`` - treat all literals as caseless - (default= ``False``) - ``use_regex`` - as an optimization, will generate a :class:`Regex` object; otherwise, will generate a :class:`MatchFirst` object (if ``caseless=True`` or ``asKeyword=True``, or if creating a :class:`Regex` raises an exception) - (default= ``True``) - ``as_keyword`` - enforce :class:`Keyword`-style matching on the generated expressions - (default= ``False``) - ``asKeyword`` and ``useRegex`` are retained for pre-PEP8 compatibility, but will be removed in a future release Example:: comp_oper = one_of("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.search_string("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] z`More than one string argument passed to one_of, pass choices as a list or space-delimited string) stacklevelcV||kSrA)upperabs r#r5zone_of..sqwwyyAGGII5r%ct||SrA)rc startswithrds r#r5zone_of..s$QWWYY11!''))<<r%c||kSrArds r#r5zone_of..s qAvr%c,||SrA)rhrds r#r5zone_of..sQ\\!__r%z7Invalid argument to one_of, expected string or iterablec3<K|]}t|dkVdSrNrFrCsyms r#rEzone_of..s, + +C3s88a< + + + + + +r%rrNc3<K|]}t|dkVdSrmrnros r#rEzone_of..&s,44S3s88q=444444r%z[{}]rc34K|]}t|VdSrA)rros r#rEzone_of..)s+NNs5c::NNNNNNr%|c3>K|]}tj|VdSrA)reescaperos r#rEzone_of..,s*BB3 #BBBBBBr%z \b(?:{})\b)flagsz | c8i|]}||Srjlowerros r# zone_of..7s"BBB3ciikk3BBBr%cD|dSr*ry)r,r-r. symbol_maps r#r5zone_of..8sZ! 5Mr%z8Exception creating Regex for one_of, building MatchFirstc3.K|]}|VdSrArj)rCrpparseElementClasss r#rEzone_of..Bs/@@'',,@@@@@@r%)rrr%warn_on_multiple_string_args_to_oneofwarningswarnCaselessKeywordCaselessLiteralKeywordrBsplitIterablelist TypeErrorNoMatchanyrF enumerateinsertru IGNORECASEallrjoinRegexr r<error MatchFirst)r[r\r]r^rYrZisequalmaskssymbolsicurjotherre_flagspattretrr}s @@r#one_ofrsR'ZI%IH 8X&&  :    ;    >55<</8MOOo%%,,'0=GGgG$!!S**,, D( # #St**QRRR yy + +7 + + +++  #g,,"""!*C%ga!egg&677  575#&&A *EU3&&A *NN1e,,,E Q#g,,""")18 q 44G44444 C}}GGNNgNNNNNxxBB'BBBBB 2$++D11H---66uzz'7J7JKKC OCB'BBB $$%M%M%M%MNNNJx    MMJWX        @@@@@@@ @ @ I I 7  s3C J+KKkeyvaluecZttt||zS)aHelper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the :class:`Dict` results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) print(attr_expr[1, ...].parse_string(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join) # similar to Dict, but simpler call format result = dict_of(attr_label, attr_value).parse_string(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.as_dict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: 'light blue' - posn: 'upper left' - shape: 'SQUARE' - texture: 'burlap' SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )Dict OneOrMoreGroup)rrs r#dict_ofrGs'J  %e ,,-- . ..r%)asString as_stringrcN|o|}td}|}d|_|d|z|dz}|rd}nd}|||j|_|t j|S)aHelper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional ``as_string`` argument is passed as ``False``, then the return value is a :class:`ParseResults` containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to :class:`original_text_for` contains expressions with defined results names, you must set ``as_string`` to ``False`` if you want to preserve those results name values. The ``asString`` pre-PEP8 argument is retained for compatibility, but will be removed in a future release. Example:: src = "this is test bold text normal text " for tag in ("b", "i"): opener, closer = make_html_tags(tag) patt = original_text_for(opener + SkipTo(closer) + closer) print(patt.search_string(src)[0]) prints:: [' bold text '] ['text'] c|SrArj)r,locr.s r#r5z#original_text_for..s3r%F_original_start _original_endc*||j|jSrA)rrr,r-r.s r#r5z#original_text_for..sa(9AO(K&Lr%cr||d|dg|dd<dS)Nrrpoprs r# extractTextz&original_text_for..extractTexts9aee-..1G1GGHIAaaaDDDr%)r+r;r callPreparse ignoreExprssuppress_warning Diagnostics)warn_ungrouped_named_tokens_in_collection)r rr locMarker endlocMarker matchExprrs r#original_text_forrosD%IH(()>)>??I>>##L %L +,,t3ll?6S6SSIJLL  J J J{+++ ,I {TUUU r%cHt|dS)zkHelper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. c|dSr*rjr4s r#r5zungroup..s 1Q4r%)TokenConverterr<)r s r#ungrouprs" $   0 0 @ @@r%ctd}t|d|dz|dzS)a (DEPRECATED - future code should use the Located class) Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - ``locn_start`` - location where matched expression begins - ``locn_end`` - location where matched expression ends - ``value`` - the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parseWithTabs` Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] c|SrArj)ssllrDs r#r5zlocatedExpr..s"r% locn_startrlocn_end)r+r;rrleaveWhitespace)r locators r# locatedExprrst6gg&&'<'<==G   $w--  *',,.. ( ( * *: 6 6 7  r%()) ignoreExpropenerclosercontent ignore_exprrc ||kr|tkr|n|}||krtd|t|trt|trt |dkrt |dkr|Ut t |t||ztj zdz d}n;t t||ztj z dz}n|pt t |t|zt|zttj dz d}n{t t t|t|zttj dz d}ntd t}|F|tt!|t#||z|zzt!|zz}nB|tt!|t#||zzt!|zz}|d ||d |S) a& Helper method for defining nested lists enclosed in opening and closing delimiters (``"("`` and ``")"`` are the default). Parameters: - ``opener`` - opening character for a nested list (default= ``"("``); can also be a pyparsing expression - ``closer`` - closing character for a nested list (default= ``")"``); can also be a pyparsing expression - ``content`` - expression for items within the nested lists (default= ``None``) - ``ignore_expr`` - expression for ignoring opening and closing delimiters (default= :class:`quoted_string`) - ``ignoreExpr`` - this pre-PEP8 argument is retained for compatibility but will be removed in a future release If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the ``ignore_expr`` argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quoted_string or a comment expression. Specify multiple expressions using an :class:`Or` or :class:`MatchFirst`. The default is :class:`quoted_string`, but if no expressions are to be ignored, then pass ``None`` for this argument. Example:: data_type = one_of("void int short long char float double") decl_data_type = Combine(data_type + Opt(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR, RPAR = map(Suppress, "()") code_body = nested_expr('{', '}', ignore_expr=(quoted_string | c_style_comment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Opt(delimited_list(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(c_style_comment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.search_string(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNr)exactc6|dSr*stripr4s r#r5znested_expr..(1r%c6|dSr*rr4s r#r5znested_expr..,rr%c6|dSr*rr4s r#r5znested_expr..6rr%c6|dSr*rr4s r#r5znested_expr..>rr%zOopening and closing arguments must be strings if no content expression is givenznested z expression) quoted_stringrrrrFrr CharsNotInrDEFAULT_WHITE_CHARSr;emptyrrBr8rr ZeroOrMorer )rrrrrrs r# nested_exprrsT[  $.-//$A$A[[z  IJJJ fh ' '% Jvx,H,H% 6{{aCKK1$4$4)%!'K( &-2S S&''&'='=>>G$jjllZ-*KK..&&'='=>>?GG)%!'K&v./&v./))JRSTTTU'&'='=>>G&!$V__,&v./()JRSTTTU '&'='=>> Ga  ))C  V  z*s*:W*DEE EQWHXHX X    hv&&C'M)B)BBXfEUEUUVVVLLLVVVVV<=== Jr%<>c t|tr|t|| }n|jt t t dz}|rt t}||dzttt|tdz|zztddgd d z|z}nt  tt t"d z}||dzttt| d ttd|zzztddgd d z|z}t%t'd|zd zd}|dz|fd|ddddzdz}|_|_t7||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag name)r\z_-:tag=/F)defaultrc|ddkSNrrrjrs r#r5z_makeTags..^! r%r) exclude_charsc6|dSr*ryr4s r#r5z_makeTags..lsqtzz||r%c|ddkSrrjrs r#r5z_makeTags..rrr%zc |ddddz|S)Nstartr: ) __setitem__rreplacetitlerr)r.resnames r#r5z_makeTags..{sY!-- bgggooc377==??EEGGHH H!&&((  r%rrrrz)rrrnamer9alphas alphanumsdbl_quoted_stringrr; remove_quotesrrrrrr printablesrrBr r<rrrrrSkipTotag_body) tagStrxml suppress_LT suppress_GT tagAttrName tagAttrValueopenTagcloseTagrs @r# _makeTagsrNs&(##c'222+vy5011K  (--//@@OO fUmm :eK(3--$?,$NOOPPQQ R(c#w'''00AA++     %))++<<]KKd cO O O   fUmm #445K5KLLhsmml:;;< (c#w'''00AA++    wt}}v-3eDDDH Vg%&&&      x S117799??AABBBhw !! GKHLhhjj))G H r%tag_strc"t|dS)aPHelper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # make_html_tags returns pyparsing expressions for the opening and # closing tags as a 2-tuple a, a_end = make_html_tags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.search_string(text): # attributes in the tag (like "href" shown here) are # also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> https://github.com/pyparsing/pyparsing/wiki Frrs r#make_html_tagsr s0 We $ $$r%c"t|dS)zHelper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to :class:`make_html_tags` Trr s r# make_xml_tagsr s Wd # ##r% any_open_tag any_close_tagz_:zany tagc@i|]\}}|d|S);)rstrip)rCkvs r#r{r{s(KKKtq!!((3--KKKr%z &(?Prsz);zcommon HTML entityc@t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMapgetentityr4s r#replace_html_entityrs   ah ' ''r%ceZdZdZdZdS)OpAssocrr`N)__name__ __module__ __qualname__LEFTRIGHTrjr%r#rrs D EEEr%r base_exprop_listlparrparc ZGddt}d|_t}t|trt |}t|trt |}t|t rt|t s|t ||z|zz}n |||z|zz}t|D]V\}}|dzdd\} } } } t| trt | } | dkrZt| ttfrt| dkrtd | \} }d | |}nd | }d | cxkrdksntd | t jt jfvrtdt|}| t jur| d kr)||| zt || dzz}n| dkrW| /||| z|zt || |zdzz}nc|||zt |dz}n=| dkr@||| z|z|z|zt |t)| |z|z|zzz}n| t jur| d krKt| t*st+| } || j|zt | |zz}n| dkrX| .||| z|zt || |zdzz}na|||zt ||dzz}n9| dkr3||| z|z|z|zt || z|z|z|zz}| r._FBTc@|j|||gfSrA)r try_parse)selfinstringr doActionss r# parseImplz%infix_notation.._FB.parseImpl(s# I  # . . .7Nr%NT)rrrr,rjr%r#_FBr&'s(      r%r.z FollowedBy>rANr`z@if numterms=3, opExpr must be a tuple or list of two expressionsz {}{} termz{} termrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)r.)r`.) FollowedByrr8rrrrrrrrtuplerrFrrrrrr rrr r;setName)r r!r"r#r.rlastExprroperDefopExprarityrightLeftAssocpaopExpr1opExpr2 term_namethisExprrs r#infix_notationr>sbj !CL ))C$~~$~~ tX & &3:dH+E+E3uTCZ$%6777s T 12((<< 7-4w->,C)~r fh ' ' ?"66v>>F A::fudm44 F q8H8H V & GW#**7G< > >QRR R#II..y99 W\ ) )zzC6 122U8fVn;T5U5UU !% #Hv$5$@ A AE FX$5v#>>EE!II!$Hx$7 8 85&AQ;R;R RII!Cw&1G;hF(Yw/AG/Kh/V%W%WWXXY w} , ,zz!&#..) [[FC h 677%@Q:R:RR !% #Hv$5$@ A AE FX$5v#>>EE!II!$Hx$7 8 85 8F#33<<!II!Cw&1G;hF(W,x7'AHLMMN   /"udm,, /* *B///**2...i(*33I>>>HC Jr%c  ddfd fd}fd}fd}ttd}t t |zd}t |d} t |d } |rStt||zt| t|zt|zz| z} n\tt|t| t|zt|zzt| z} | fd | fd | ttz| d S) a (DEPRECATED - use IndentedBlock class instead) Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - ``blockStatementExpr`` - expression defining syntax of statement that is repeated within the indented block - ``indentStack`` - list created by caller to manage indentation stack (multiple ``statementWithIndentedBlock`` expressions within a single grammar should share a common ``indentStack``) - ``indent`` - boolean indicating whether block must be indented beyond the current level; set to ``False`` for block of left-most statements (default= ``True``) A valid block must contain at least one ``blockStatement``. (Note that indentedBlock uses internal parse actions which make it incompatible with packrat parsing.) Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group("(" + Opt(delimitedList(identifier)) + ")") + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group(funcDecl + func_body) rvalue = Forward() funcCall = Group(identifier + "(" + Opt(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << (funcDef | assignment | identifier) module_body = stmt[1, ...] parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] Nc"ddd<dSNrj) backup_stacks indentStacksr# reset_stackz"indentedBlock..reset_stacks&r* AAAr%c|t|krdSt||}|dkr.|dkrt||dt||ddS)NrBzillegal nestingznot a peer entry)rFcolrSr,r-r.curColrDs r#checkPeerIndentz&indentedBlock..checkPeerIndentsp A;; FQ [_ $ $ B''$Q+<=== A'9:: : % $r%ct||}|dkr|dSt||d)NrBznot a subentry)rGappendrSrHs r#checkSubIndentz%indentedBlock..checkSubIndentsLQ KO # #   v & & & & & A'788 8r%c|t|krdSt||}r|vst||d|dkrdSdS)Nznot an unindentrB)rFrGrSrrHs r# checkUnindentz$indentedBlock..checkUnindentsv A;; FQ :+ 5 5 A'899 9 KO # # OO      $ #r%z INDENTrUNINDENTc:rdodndSrAr)rCsr#r5zindentedBlock..s"-I !!"%%.$Tr%cSrArj)rerfcdrEs r#r5zindentedBlock..s kkmmr%zindented block)rLrLineEndset_whitespace_charssuppressr+r;r rrr<set_fail_actionignorer) blockStatementExprrDindentrCrJrMrONLrPPEERUNDENTsmExprrEs ` ` @r# indentedBlockra{sXlQQQ(((++++++;;;;;99999 79911%88AACC D DBgg00@@@ J J8 T TF 77 # #O 4 4 = =b A AD WW % %m 4 4 = =j I IF   GG u%78883r77BCC D    GGu%78883r77BCC D&kk    IIII ;;;;<<<g 1222 ??+ , ,,r%z/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentc<g|]}t|t|Srj)rr)rCrs r# rc%s7''' *Q ">">''''r%_builtin_exprs)r FNNrA)FTFr-)\ html.entitieshtmlrutypingrrcoreutilrrrUnionrrboolOptionalr3r$r=rOrXrrrrrrrrrrTupler r __annotations__r9rrr r rentitieshtml5itemsrrrcommon_html_entityrEnumrInfixNotationOperatorArgType ParseActionInfixNotationOperatorSpecListr>rarc_style_comment html_commentleave_whitespace rest_of_linedbl_slash_commentcpp_style_commentjava_style_commentpython_style_commentvarsvaluesrd delimitedList countedArraymatchPreviousLiteralmatchPreviousExproneOfdictOforiginalTextFor nestedExpr makeHTMLTags makeXMLTags anyOpenTag anyCloseTagcommonHTMLEntityreplaceHTMLEntityopAssoc infixNotation cStyleComment htmlComment restOfLinedblSlashCommentcppStyleCommentjavaStyleCommentpythonStyleCommentrjr%r#rs& >>>>>>>>>>(+ $ $ 64"'646464 ]" #64 m# $6464   64   646464646464v049I/3 9I9I9I 9Iom,9I_] + 9I  9I9I9I9Ix=B!m! !!!!L | ||| $c) *||| |  ||||||~%/%/}%/%/%/%/%/R,02EI222 2$(2>B22222jA-AMAAAA m     H),(+.2!. } !.  }}} #}$ %} #}$ %}_] +} }  }}}}}@(0x}}((3--7777t% 3 % &% =- '(%%%%6$ 3 % &$ =- '($$$$,nDT!""++I66 mLKt}/B/H/H/J/JKKKU>CHH^,D,DDtKLLUU ((( d %3eM3$67}c?Q9RRSS " $  $ &  $    $'/hsmm&.hsmm bbb + ,b ]" #b ]" # b  bbbbJ;?bL-L-L-L-`'%% 7884?@@II$u'((11.AA &uU||,,..77GG E.//88FF1G E !""T),== ( P&$uV}}--.DEE0 ''tvv}}''']#   -' #    &  K%'     ##%)r%PK!y5_vendor/pyparsing/__pycache__/results.cpython-311.pycnu[ ,RebUddlmZmZmZmZddlZddlmZddl m Z m Z e e fZe edfed<eddDZGd d ZGd d ZejeejedS) )MutableMappingMappingMutableSequenceIteratorN)ref)TupleAny.str_typec#K|]}|VdSN).0_s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/results.py rsar c,eZdZdgZdZdZdZdZdS)_ParseResultsWithOffsettupc||f|_dSr r)selfp1p2s r__init__z _ParseResultsWithOffset.__init__s8rc|j|Sr rris r __getitem__z#_ParseResultsWithOffset.__getitem__sx{rc|jSr rrs r __getstate__z$_ParseResultsWithOffset.__getstate__s xrc |d|_dSNrr)rargss r __setstate__z$_ParseResultsWithOffset.__setstate__s7rN)__name__ __module__ __qualname__ __slots__rrr"r&r rrrr sWIrrceZdZUdZdgddfZeedfed<gdZGdd e Z d3d Z ddd d e fd Z d Ze fdZdZdefdZdefdZdefdZdefdZdefdZdZdZdZdefdZdZd4dZdZdZ dZ!dZ"d Z#d5d!Z$d5d"Z%d5d#Z&de'fd$Z(de'fd%Z)d6d&Z*de fd'Z+de,fd(Z-d5d)Z.d*Z/d7de'fd,Z0d-Z1d.Z2d/Z3d0Z4d1Z5e6d4d5d2Z7e+Z8e-Z9e/Z:dS)8 ParseResultsaStructured parse results, to provide multiple means of access to the parsed data: - as a list (``len(results)``) - by list index (``results[0], results[1]``, etc.) - by attribute (``results.`` - see :class:`ParserElement.set_results_name`) Example:: integer = Word(nums) date_str = (integer.set_results_name("year") + '/' + integer.set_results_name("month") + '/' + integer.set_results_name("day")) # equivalent form: # date_str = (integer("year") + '/' # + integer("month") + '/' # + integer("day")) # parse_string returns a ParseResults object result = date_str.parse_string("1999/12/31") def test(s, fn=repr): print("{} -> {}".format(s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: '31' - month: '12' - year: '1999' Nr . _null_values)_name_parent _all_names_modal_toklist_tokdict __weakref__ceZdZdZddZdS)ParseResults.Lista Simple wrapper class to distinguish parsed list results that should be preserved as actual Python lists, instead of being converted to :class:`ParseResults`: LBRACK, RBRACK = map(pp.Suppress, "[]") element = pp.Forward() item = ppc.integer element_list = LBRACK + pp.delimited_list(element) + RBRACK # add parse actions to convert from ParseResults to actual Python collection types def as_python_list(t): return pp.ParseResults.List(t.as_list()) element_list.add_parse_action(as_python_list) element <<= item | element_list element.run_tests(''' 100 [2,3,4] [[2, 1],3,4] [(2, 1),3,4] (2,3,4) ''', post_parse=lambda s, r: (r[0], type(r[0]))) prints: 100 (100, ) [2,3,4] ([2, 3, 4], ) [[2, 1],3,4] ([[2, 1], 3, 4], ) (Used internally by :class:`Group` when `aslist=True`.) Nc|g}t|ts:td|jt |jt|S)Nz.{} may only be constructed with a list, not {}) isinstancelist TypeErrorformatr'type__new__)cls containeds rr>zParseResults.List.__new__|sd  i.. $fS\4 ??3KLL <<$$ $rr )r'r(r)__doc__r>r rrListr7Us3$ $ L % % % % % %rrBc t|tr|St|}d|_d|_t |_|g|_n^t|ttfr:t|tj r |ddgnt||_n|g|_t|_ |Sr )r9r,objectr>r/r0setr1r3r:_generator_typerBdictr4)r?toklistnamekwargsrs rr>zParseResults.__new__s g| , , N~~c""  %% ?DMM $!8 9 9 &g|'899# ']] MM %IDM  rTc4||_| |dkr||trt|}|s|h|_||_||jvr||t tfr|g}|rl||tr&tt|j d||<n&tt|dd||<|||_dS |d||<dS#tttf$r||ur|||<YdS||_YdSwxYwdSdSdS)Nr-r)r2intstrr1r/r.r r=r,rr3KeyErrorr; IndexError)rrHrIasListmodalr9s rrzParseResults.__init__sl   z$$$ !4yy )#'&DJd///:g$'788(&iG.!z'<88%<()9::A&&T &=(44a&&T (,DJ$$$.%,QZT $i<..."$..)0DJJJJ)-DJJJJ .-   0/s C## DDDct|ttfr |j|S||jvr|j|ddSt d|j|DS)Nrcg|] }|d S)rr )rvs r z,ParseResults.__getitem__..s$D$D$DaQqT$D$D$Dr)r9rLslicer3r1r4r,rs rrzParseResults.__getitem__sn a#u & & F=# #''}Q'+A..#$D$D4=3C$D$D$DEEErc||tr<|j|t|gz|j|<|d}nh||tt fr ||j|<|}nC|j|tt|dgz|j|<|}||trt||_ dSdSr$) rr4getr:rLrWr3r,wkrefr0)rkrUr9subs r __setitem__zParseResults.__setitem__s :a0 1 1 #}00DFF;;qcADM! A$CC ZC< ( (  DM! CC#}00DFF;;'1--? DM! C :c< ( ( &++CKKK & &rc t|ttfrt|j}|j|=t|tr|dkr||z }t||dz}t t ||}||j D]<\}}|D]4}t|D]"\}\}} t|| | |kz ||<#5=dS|j |=dS)Nr) r9rLrWlenr3r:rangeindicesreverser4items enumerater) rrmylenremovedrI occurrencesjr[valuepositions r __delitem__zParseResults.__delitem__s1 a#u & & ! &&E a !S!! $q55JA!QUOO5!))E"2"2344G OO   %)]%8%8%:%:  !k A09+0F0F,,E8)@!8x!|#<** A   a   rreturnc||jvSr )r4)rr[s r __contains__zParseResults.__contains__sDM!!rc*t|jSr )r`r3r!s r__len__zParseResults.__len__s4=!!!rc"|jp|j Sr )r3r4r!s r__bool__zParseResults.__bool__s 6777rc*t|jSr iterr3r!s r__iter__zParseResults.__iter__DM"""rc<t|jdddS)NrSrur!s r __reversed__zParseResults.__reversed__sDM$$B$'(((rc*t|jSr )rvr4r!s rkeyszParseResults.keysrxrcDfdDS)Nc3(K|] }|V dSr r rr[rs rrz&ParseResults.values..s'--AQ------rr|r!s`rvalueszParseResults.valuess%--------rcDfdDS)Nc3,K|]}||fVdSr r rs rrz%ParseResults.items..s+22DG 222222rrr!s`rrdzParseResults.itemss%2222diikk2222rc*t|jS)z Since ``keys()`` returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)boolr4r!s rhaskeyszParseResults.haskeyssDM"""rcR|sdg}|D]7\}}|dkr |d|f}td|t|dtst |dks |d|vr|d}||}||=|S|d}|S)a Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If passed no argument or an integer argument, it will use ``list`` semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use ``dict`` semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in ``dict.pop()``. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] def remove_first(tokens): tokens.pop(0) numlist.add_parse_action(remove_first) print(numlist.parse_string("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + Word(nums)[1, ...] print(patt.parse_string("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.add_parse_action(remove_LABEL) print(patt.parse_string("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: 'AAB' ['AAB', '123', '321'] rSdefaultrz-pop() got an unexpected keyword argument {!r}r_)rdr;r<r9rLr`)rr%rJr[rUindexret defaultvalues rpopzParseResults.pop sP 4DLLNN  DAqI~~Q|CJJ1MM d1gs # # s4yyA~~aDGEu+CU J7L rc||vr||S|S)a^ Returns named result matching the given key, or if there is no such name, then returns the given ``default_value`` or ``None`` if no ``default_value`` is specified. Similar to ``dict.get()``. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None r )rkey default_values rrYzParseResults.getFs$ $;;9  rc|j|||jD]7\}}t |D]"\}\}}t ||||kz||<#8dS)a; Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) numlist.add_parse_action(insert_locn) print(numlist.parse_string("0 123 321")) # -> [0, '0', '123', '321'] N)r3insertr4rdrer)rr ins_stringrIrhr[rjrks rrzParseResults.insert]s" UJ///!%!4!4!6!6   D+(1+(>(>  $$E8!88x%'78"" A   rc:|j|dS)a Add single element to end of ``ParseResults`` list of elements. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) numlist.add_parse_action(append_sum) print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321', 444] N)r3append)ritems rrzParseResults.appendvs  T"""""rct|tr||dS|j|dS)a Add sequence of elements to end of ``ParseResults`` list of elements. Example:: patt = Word(alphas)[1, ...] # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) patt.add_parse_action(make_palindrome) print(patt.parse_string("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)r9r,__iadd__r3extend)ritemseqs rrzParseResults.extendsJ g| , , * MM' " " " " " M  ) ) ) ) )rcL|jdd=|jdS)z7 Clear all elements and results names. N)r3r4clearr!s rrzParseResults.clears, M!!!  rc~ ||S#t$r(|drt|YdSwxYw)N__r-)rN startswithAttributeError)rrIs r __getattr__zParseResults.__getattr__sU :    t$$ +$T***22 s  .<<c8|}||z }|Sr )copy)rotherrs r__add__zParseResults.__add__siikk u  rcp|jrt|jfd|j}fd|D}|D]?\}}|||<t |dt rt ||d_@|xj|jz c_|xj|jzc_|S)Nc|dkrn|zSr$r )aoffsets rz'ParseResults.__iadd__..sAEE&&q6zrc ng|]1\}}|D])}|t|d|df*2S)rr_)r)rr[vlistrU addoffsets rrVz)ParseResults.__iadd__..sdAu+AaD))AaD//BBCrr) r4r`r3rdr9r,rZr0r1)rr otheritemsotherdictitemsr[rUrrs @@rrzParseResults.__iadd__s > /''FAAAAI--//J *N ' / /1QadL11/#(;;AaDL '  5++ rcjt|tr|dkr|S||zSr$)r9rLr)rrs r__radd__zParseResults.__radd__s6 eS ! ! eqjj99;; 4< rcdt|j|j|S)Nz {}({!r}, {}))r<r=r'r3as_dictr!s r__repr__zParseResults.__repr__s-$$T$ZZ%8$-XXXrcVddd|jDzdzS)N[z, ctg|]5}t|trt|nt|6Sr )r9r,rMrepr)rrs rrVz(ParseResults.__str__..sG)L99FCFFFtAwwr])joinr3r!s r__str__zParseResults.__str__sH ii!]   rcg}|jD]j}|r|r||t|tr||z }H|t |k|Sr )r3rr9r, _asStringListrM)rsepoutrs rrzParseResults._asStringListsM & &D s  3$ -- &t))+++ 3t99%%%% rc$d|jDS)ax Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = Word(alphas)[1, ...] result = patt.parse_string("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use as_list() to create an actual list result_list = result.as_list() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cdg|]-}t|tr|n|.Sr )r9r,as_list)rress rrVz(ParseResults.as_list..sC   (\:: CCKKMMM   r)r3r!s rrzParseResults.as_lists%  }    rchfdtfd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.as_dict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.as_dict())) # -> {"month": "31", "day": "1999", "year": "12"} ct|tr6|r|n fd|DS|S)Nc&g|] }|Sr r )rrUto_items rrVz9ParseResults.as_dict..to_item..s!;T;T;T1GGAJJ;T;T;Tr)r9r,rr)objrs rrz%ParseResults.as_dict..to_item sO#|,, (+ Ts{{}}};T;T;T;TPS;T;T;TT rc38K|]\}}||fVdSr r )rr[rUrs rrz'ParseResults.as_dict..s3==1Q O======r)rGrd)rrs @rrzParseResults.as_dictsI*      ==== ======rct|j}|j|_|j|_|xj|jzc_|j|_|S)zG Returns a new copy of a :class:`ParseResults` object. )r,r3r4rr0r1r/)rrs rrzParseResults.copysQ4=))}))++ l  $/)J  rc|jr|jS|jr(|fd}r ||ndSt|dkrt|jdkrtt t |jdddvr3t t |jSdS)a Returns the results name for this token expression. Useful when several different expressions might match at a particular location. Example:: integer = Word(nums) ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d") house_number_expr = Suppress('#') + Word(nums, alphanums) user_data = (Group(house_number_expr)("house_number") | Group(ssn_expr)("ssn") | Group(integer)("age")) user_info = user_data[1, ...] result = user_info.parse_string("22 111-22-3333 #221B") for item in result: print(item.get_name(), ':', item[0]) prints:: age : 22 ssn : 111-22-3333 house_number : 221B cltfdjDdS)Nc3:K|]\}}|D] \}}|u |VdSr r )rr[rrUlocr\s rrz@ParseResults.get_name..find_in_parent..@sS$Au&+#As!88$8888 r)nextr4rd)r\pars`rfind_in_parentz-ParseResults.get_name..find_in_parent>sO(+ (:(:(<(< rNr_r)rrS)r/r0r`r4rrvrr|)rrrs @rget_namezParseResults.get_name s2 : :  \ ,,..C     ,/8>>$'''D 8 IINNDM""a''T$-..00112215a8GCCT]//112233 34rrctg}d}||r$|t|znd|r|rt d|D}|D]\}} |r|||d|d|z|t| trU| r0|| ||||dz|t| |t| td|Dr|} t| D]\} } t| trQ|d |d|z| |d|dzz| ||||dzk|d |d|z| |d|dzzt| fzd |S) aM Diagnostic method for listing out the contents of a :class:`ParseResults`. Accepts an optional ``indent`` argument so that this string can be embedded in a nested display of other data. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string('1999/12/31') print(result.dump()) prints:: ['1999', '/', '12', '/', '31'] - day: '31' - month: '12' - year: '1999'  r-c3>K|]\}}t||fVdSr )rM)rr[rUs rrz$ParseResults.dump..ns0DDtq!A{DDDDDDrz {}{}- {}: z r_)indentfull include_list_depthc3@K|]}t|tVdSr )r9r,)rvvs rrz$ParseResults.dump..s,??B:b,//??????rz {}{}[{}]: {}{}{}z %s%s[%d]: %s%s%s)rrMrrsortedrdr<r9r,dumpranyrer) rrrrrrNLrdr[rUrrs rrzParseResults.dumpSs*  <G6C ////RHHH 3 ||~~ ,DDtzz||DDDDD!,,DAq' 2JJ|226D6MANNOOO!!\22 , /JJ !+1)-1=+1A: !'!"!" JJs1vv.... 477++++??$????? &q\\EAr!"l33 188 &!% ! &!%!!4 "+1)-1=+1A: !(!"!"    1 &!% ! &!%!!4 #B     wws||rcTtj|g|Ri|dS)a% Pretty-printer for parsed results as a list, using the `pprint `_ module. Accepts additional positional or keyword args as defined for `pprint.pprint `_ . Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimited_list(term))) result = func.parse_string("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintr)rr%rJs rrzParseResults.pprints22  dllnn6t666v66666rc|j|j|jdur|pd|j|jffSr )r3r4rr0r1r/r!s rr"zParseResults.__getstate__sM M ""$$ D(;T\\^^Ct    rc|\|_\|_}}|_t||_|t ||_dSd|_dSr )r3r4r/rEr1rZr0)rstater inAccumNamess rr&zParseResults.__setstate__sKHME E sL$*l++ ? ::DLLLDLLLrc|j|jfSr )r3r/r!s r__getnewargs__zParseResults.__getnewargs__s}dj((rc~tt|t|zSr )dirr=r:r|r!s r__dir__zParseResults.__dir__s)4::diikk!2!222rc  d}|g}|D]P\}}t|tr||||z }5|||g|||z }Q|||g|}|S)z Helper classmethod to construct a ``ParseResults`` from a ``dict``, preserving the name-value relations as results names. If an optional ``name`` argument is given, a nested ``ParseResults`` will be returned. cp t|t|t S#t$rYdSwxYw)NF)rvr9r Exception)rs r is_iterablez+ParseResults.from_dict..is_iterablesK 5S &c84444   uu s ' 55)rI)rIrP)rdr9r from_dict)r?rrIrrr[rUs rrzParseResults.from_dicts 5 5 5c"ggKKMM ? ?DAq!W%% ?s}}QQ}///ssA3Q{{1~~>>>>  #se$'''C r)NNr )rmr,)r-)r-TTr);r'r(r)rAr.rr __annotations__r*r:rBr>r9rrr]rlrrorLrqrsrrwrzr|rrdrrrYrrrrrrrrrMrrrrrGrrrrrr"r&rr classmethodrrPasDictgetNamer rrr,r,s++Z&*2r2$6L%S/666I1%1%1%1%1%t1%1%1%f0d$:....@FFF,6 & & & &!!!.""""""""""8$8888#(####)h))))###...333##### 8 8 8 t!!!!.2###"***( &    Y#YYYY                (>>>>>:    111fNNNNNN`7778       )))333[2F FGGGrr,)collections.abcrrrrrweakrefrrZtypingrr rMbytesr r=rrFrr,registerr rrrsNNNNNNNNNNNNN !5\%c )))$2''         Y Y Y Y Y Y Y Y x %%%&&&&&rPK!*٘٘_vendor/pyparsing/helpers.pynu[# helpers.py import html.entities import re import typing from . import __diag__ from .core import * from .util import _bslash, _flatten, _escape_regex_range_chars # # global helpers # def delimited_list( expr: Union[str, ParserElement], delim: Union[str, ParserElement] = ",", combine: bool = False, min: typing.Optional[int] = None, max: typing.Optional[int] = None, *, allow_trailing_delim: bool = False, ) -> ParserElement: """Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing ``combine=True`` in the constructor. If ``combine`` is set to ``True``, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. If ``allow_trailing_delim`` is set to True, then the list may end with a delimiter. Example:: delimited_list(Word(alphas)).parse_string("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimited_list(Word(hexnums), delim=':', combine=True).parse_string("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] """ if isinstance(expr, str_type): expr = ParserElement._literalStringClass(expr) dlName = "{expr} [{delim} {expr}]...{end}".format( expr=str(expr.copy().streamline()), delim=str(delim), end=" [{}]".format(str(delim)) if allow_trailing_delim else "", ) if not combine: delim = Suppress(delim) if min is not None: if min < 1: raise ValueError("min must be greater than 0") min -= 1 if max is not None: if min is not None and max <= min: raise ValueError("max must be greater than, or equal to min") max -= 1 delimited_list_expr = expr + (delim + expr)[min, max] if allow_trailing_delim: delimited_list_expr += Opt(delim) if combine: return Combine(delimited_list_expr).set_name(dlName) else: return delimited_list_expr.set_name(dlName) def counted_array( expr: ParserElement, int_expr: typing.Optional[ParserElement] = None, *, intExpr: typing.Optional[ParserElement] = None, ) -> ParserElement: """Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If ``int_expr`` is specified, it should be a pyparsing expression that produces an integer value. Example:: counted_array(Word(alphas)).parse_string('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binary_constant = Word('01').set_parse_action(lambda t: int(t[0], 2)) counted_array(Word(alphas), int_expr=binary_constant).parse_string('10 ab cd ef') # -> ['ab', 'cd'] # if other fields must be parsed after the count but before the # list items, give the fields results names and they will # be preserved in the returned ParseResults: count_with_metadata = integer + Word(alphas)("type") typed_array = counted_array(Word(alphanums), int_expr=count_with_metadata)("items") result = typed_array.parse_string("3 bool True True False") print(result.dump()) # prints # ['True', 'True', 'False'] # - items: ['True', 'True', 'False'] # - type: 'bool' """ intExpr = intExpr or int_expr array_expr = Forward() def count_field_parse_action(s, l, t): nonlocal array_expr n = t[0] array_expr <<= (expr * n) if n else Empty() # clear list contents, but keep any named results del t[:] if intExpr is None: intExpr = Word(nums).set_parse_action(lambda t: int(t[0])) else: intExpr = intExpr.copy() intExpr.set_name("arrayLen") intExpr.add_parse_action(count_field_parse_action, call_during_try=True) return (intExpr + array_expr).set_name("(len) " + str(expr) + "...") def match_previous_literal(expr: ParserElement) -> ParserElement: """Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_literal(first) match_expr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches a previous literal, will also match the leading ``"1:1"`` in ``"1:10"``. If this is not desired, use :class:`match_previous_expr`. Do *not* use with packrat parsing enabled. """ rep = Forward() def copy_token_to_repeater(s, l, t): if t: if len(t) == 1: rep << t[0] else: # flatten t tokens tflat = _flatten(t.as_list()) rep << And(Literal(tt) for tt in tflat) else: rep << Empty() expr.add_parse_action(copy_token_to_repeater, callDuringTry=True) rep.set_name("(prev) " + str(expr)) return rep def match_previous_expr(expr: ParserElement) -> ParserElement: """Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_expr(first) match_expr = first + ":" + second will match ``"1:1"``, but not ``"1:2"``. Because this matches by expressions, will *not* match the leading ``"1:1"`` in ``"1:10"``; the expressions are evaluated first, and then compared, so ``"1"`` is compared with ``"10"``. Do *not* use with packrat parsing enabled. """ rep = Forward() e2 = expr.copy() rep <<= e2 def copy_token_to_repeater(s, l, t): matchTokens = _flatten(t.as_list()) def must_match_these_tokens(s, l, t): theseTokens = _flatten(t.as_list()) if theseTokens != matchTokens: raise ParseException( s, l, "Expected {}, found{}".format(matchTokens, theseTokens) ) rep.set_parse_action(must_match_these_tokens, callDuringTry=True) expr.add_parse_action(copy_token_to_repeater, callDuringTry=True) rep.set_name("(prev) " + str(expr)) return rep def one_of( strs: Union[typing.Iterable[str], str], caseless: bool = False, use_regex: bool = True, as_keyword: bool = False, *, useRegex: bool = True, asKeyword: bool = False, ) -> ParserElement: """Helper to quickly define a set of alternative :class:`Literal` s, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a :class:`MatchFirst` for best performance. Parameters: - ``strs`` - a string of space-delimited literals, or a collection of string literals - ``caseless`` - treat all literals as caseless - (default= ``False``) - ``use_regex`` - as an optimization, will generate a :class:`Regex` object; otherwise, will generate a :class:`MatchFirst` object (if ``caseless=True`` or ``asKeyword=True``, or if creating a :class:`Regex` raises an exception) - (default= ``True``) - ``as_keyword`` - enforce :class:`Keyword`-style matching on the generated expressions - (default= ``False``) - ``asKeyword`` and ``useRegex`` are retained for pre-PEP8 compatibility, but will be removed in a future release Example:: comp_oper = one_of("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.search_string("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] """ asKeyword = asKeyword or as_keyword useRegex = useRegex and use_regex if ( isinstance(caseless, str_type) and __diag__.warn_on_multiple_string_args_to_oneof ): warnings.warn( "More than one string argument passed to one_of, pass" " choices as a list or space-delimited string", stacklevel=2, ) if caseless: isequal = lambda a, b: a.upper() == b.upper() masks = lambda a, b: b.upper().startswith(a.upper()) parseElementClass = CaselessKeyword if asKeyword else CaselessLiteral else: isequal = lambda a, b: a == b masks = lambda a, b: b.startswith(a) parseElementClass = Keyword if asKeyword else Literal symbols: List[str] = [] if isinstance(strs, str_type): symbols = strs.split() elif isinstance(strs, Iterable): symbols = list(strs) else: raise TypeError("Invalid argument to one_of, expected string or iterable") if not symbols: return NoMatch() # reorder given symbols to take care to avoid masking longer choices with shorter ones # (but only if the given symbols are not just single characters) if any(len(sym) > 1 for sym in symbols): i = 0 while i < len(symbols) - 1: cur = symbols[i] for j, other in enumerate(symbols[i + 1 :]): if isequal(other, cur): del symbols[i + j + 1] break elif masks(cur, other): del symbols[i + j + 1] symbols.insert(i, other) break else: i += 1 if useRegex: re_flags: int = re.IGNORECASE if caseless else 0 try: if all(len(sym) == 1 for sym in symbols): # symbols are just single characters, create range regex pattern patt = "[{}]".format( "".join(_escape_regex_range_chars(sym) for sym in symbols) ) else: patt = "|".join(re.escape(sym) for sym in symbols) # wrap with \b word break markers if defining as keywords if asKeyword: patt = r"\b(?:{})\b".format(patt) ret = Regex(patt, flags=re_flags).set_name(" | ".join(symbols)) if caseless: # add parse action to return symbols as specified, not in random # casing as found in input string symbol_map = {sym.lower(): sym for sym in symbols} ret.add_parse_action(lambda s, l, t: symbol_map[t[0].lower()]) return ret except re.error: warnings.warn( "Exception creating Regex for one_of, building MatchFirst", stacklevel=2 ) # last resort, just use MatchFirst return MatchFirst(parseElementClass(sym) for sym in symbols).set_name( " | ".join(symbols) ) def dict_of(key: ParserElement, value: ParserElement) -> ParserElement: """Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the :class:`Dict`, :class:`ZeroOrMore`, and :class:`Group` tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the :class:`Dict` results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join)) print(attr_expr[1, ...].parse_string(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stop_on=label).set_parse_action(' '.join) # similar to Dict, but simpler call format result = dict_of(attr_label, attr_value).parse_string(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.as_dict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: 'light blue' - posn: 'upper left' - shape: 'SQUARE' - texture: 'burlap' SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} """ return Dict(OneOrMore(Group(key + value))) def original_text_for( expr: ParserElement, as_string: bool = True, *, asString: bool = True ) -> ParserElement: """Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional ``as_string`` argument is passed as ``False``, then the return value is a :class:`ParseResults` containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to :class:`original_text_for` contains expressions with defined results names, you must set ``as_string`` to ``False`` if you want to preserve those results name values. The ``asString`` pre-PEP8 argument is retained for compatibility, but will be removed in a future release. Example:: src = "this is test bold text normal text " for tag in ("b", "i"): opener, closer = make_html_tags(tag) patt = original_text_for(opener + SkipTo(closer) + closer) print(patt.search_string(src)[0]) prints:: [' bold text '] ['text'] """ asString = asString and as_string locMarker = Empty().set_parse_action(lambda s, loc, t: loc) endlocMarker = locMarker.copy() endlocMarker.callPreparse = False matchExpr = locMarker("_original_start") + expr + endlocMarker("_original_end") if asString: extractText = lambda s, l, t: s[t._original_start : t._original_end] else: def extractText(s, l, t): t[:] = [s[t.pop("_original_start") : t.pop("_original_end")]] matchExpr.set_parse_action(extractText) matchExpr.ignoreExprs = expr.ignoreExprs matchExpr.suppress_warning(Diagnostics.warn_ungrouped_named_tokens_in_collection) return matchExpr def ungroup(expr: ParserElement) -> ParserElement: """Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. """ return TokenConverter(expr).add_parse_action(lambda t: t[0]) def locatedExpr(expr: ParserElement) -> ParserElement: """ (DEPRECATED - future code should use the Located class) Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - ``locn_start`` - location where matched expression begins - ``locn_end`` - location where matched expression ends - ``value`` - the actual parsed results Be careful if the input text contains ```` characters, you may want to call :class:`ParserElement.parseWithTabs` Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] """ locator = Empty().set_parse_action(lambda ss, ll, tt: ll) return Group( locator("locn_start") + expr("value") + locator.copy().leaveWhitespace()("locn_end") ) def nested_expr( opener: Union[str, ParserElement] = "(", closer: Union[str, ParserElement] = ")", content: typing.Optional[ParserElement] = None, ignore_expr: ParserElement = quoted_string(), *, ignoreExpr: ParserElement = quoted_string(), ) -> ParserElement: """Helper method for defining nested lists enclosed in opening and closing delimiters (``"("`` and ``")"`` are the default). Parameters: - ``opener`` - opening character for a nested list (default= ``"("``); can also be a pyparsing expression - ``closer`` - closing character for a nested list (default= ``")"``); can also be a pyparsing expression - ``content`` - expression for items within the nested lists (default= ``None``) - ``ignore_expr`` - expression for ignoring opening and closing delimiters (default= :class:`quoted_string`) - ``ignoreExpr`` - this pre-PEP8 argument is retained for compatibility but will be removed in a future release If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the ``ignore_expr`` argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quoted_string or a comment expression. Specify multiple expressions using an :class:`Or` or :class:`MatchFirst`. The default is :class:`quoted_string`, but if no expressions are to be ignored, then pass ``None`` for this argument. Example:: data_type = one_of("void int short long char float double") decl_data_type = Combine(data_type + Opt(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR, RPAR = map(Suppress, "()") code_body = nested_expr('{', '}', ignore_expr=(quoted_string | c_style_comment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Opt(delimited_list(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(c_style_comment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.search_string(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] """ if ignoreExpr != ignore_expr: ignoreExpr = ignore_expr if ignoreExpr == quoted_string() else ignoreExpr if opener == closer: raise ValueError("opening and closing strings cannot be the same") if content is None: if isinstance(opener, str_type) and isinstance(closer, str_type): if len(opener) == 1 and len(closer) == 1: if ignoreExpr is not None: content = Combine( OneOrMore( ~ignoreExpr + CharsNotIn( opener + closer + ParserElement.DEFAULT_WHITE_CHARS, exact=1, ) ) ).set_parse_action(lambda t: t[0].strip()) else: content = empty.copy() + CharsNotIn( opener + closer + ParserElement.DEFAULT_WHITE_CHARS ).set_parse_action(lambda t: t[0].strip()) else: if ignoreExpr is not None: content = Combine( OneOrMore( ~ignoreExpr + ~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS, exact=1) ) ).set_parse_action(lambda t: t[0].strip()) else: content = Combine( OneOrMore( ~Literal(opener) + ~Literal(closer) + CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS, exact=1) ) ).set_parse_action(lambda t: t[0].strip()) else: raise ValueError( "opening and closing arguments must be strings if no content expression is given" ) ret = Forward() if ignoreExpr is not None: ret <<= Group( Suppress(opener) + ZeroOrMore(ignoreExpr | ret | content) + Suppress(closer) ) else: ret <<= Group(Suppress(opener) + ZeroOrMore(ret | content) + Suppress(closer)) ret.set_name("nested %s%s expression" % (opener, closer)) return ret def _makeTags(tagStr, xml, suppress_LT=Suppress("<"), suppress_GT=Suppress(">")): """Internal helper to construct opening and closing tag expressions, given a tag name""" if isinstance(tagStr, str_type): resname = tagStr tagStr = Keyword(tagStr, caseless=not xml) else: resname = tagStr.name tagAttrName = Word(alphas, alphanums + "_-:") if xml: tagAttrValue = dbl_quoted_string.copy().set_parse_action(remove_quotes) openTag = ( suppress_LT + tagStr("tag") + Dict(ZeroOrMore(Group(tagAttrName + Suppress("=") + tagAttrValue))) + Opt("/", default=[False])("empty").set_parse_action( lambda s, l, t: t[0] == "/" ) + suppress_GT ) else: tagAttrValue = quoted_string.copy().set_parse_action(remove_quotes) | Word( printables, exclude_chars=">" ) openTag = ( suppress_LT + tagStr("tag") + Dict( ZeroOrMore( Group( tagAttrName.set_parse_action(lambda t: t[0].lower()) + Opt(Suppress("=") + tagAttrValue) ) ) ) + Opt("/", default=[False])("empty").set_parse_action( lambda s, l, t: t[0] == "/" ) + suppress_GT ) closeTag = Combine(Literal("", adjacent=False) openTag.set_name("<%s>" % resname) # add start results name in parse action now that ungrouped names are not reported at two levels openTag.add_parse_action( lambda t: t.__setitem__( "start" + "".join(resname.replace(":", " ").title().split()), t.copy() ) ) closeTag = closeTag( "end" + "".join(resname.replace(":", " ").title().split()) ).set_name("" % resname) openTag.tag = resname closeTag.tag = resname openTag.tag_body = SkipTo(closeTag()) return openTag, closeTag def make_html_tags( tag_str: Union[str, ParserElement] ) -> Tuple[ParserElement, ParserElement]: """Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # make_html_tags returns pyparsing expressions for the opening and # closing tags as a 2-tuple a, a_end = make_html_tags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.search_string(text): # attributes in the tag (like "href" shown here) are # also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> https://github.com/pyparsing/pyparsing/wiki """ return _makeTags(tag_str, False) def make_xml_tags( tag_str: Union[str, ParserElement] ) -> Tuple[ParserElement, ParserElement]: """Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to :class:`make_html_tags` """ return _makeTags(tag_str, True) any_open_tag: ParserElement any_close_tag: ParserElement any_open_tag, any_close_tag = make_html_tags( Word(alphas, alphanums + "_:").set_name("any tag") ) _htmlEntityMap = {k.rstrip(";"): v for k, v in html.entities.html5.items()} common_html_entity = Regex("&(?P" + "|".join(_htmlEntityMap) + ");").set_name( "common HTML entity" ) def replace_html_entity(t): """Helper parser action to replace common HTML entities with their special characters""" return _htmlEntityMap.get(t.entity) class OpAssoc(Enum): LEFT = 1 RIGHT = 2 InfixNotationOperatorArgType = Union[ ParserElement, str, Tuple[Union[ParserElement, str], Union[ParserElement, str]] ] InfixNotationOperatorSpec = Union[ Tuple[ InfixNotationOperatorArgType, int, OpAssoc, typing.Optional[ParseAction], ], Tuple[ InfixNotationOperatorArgType, int, OpAssoc, ], ] def infix_notation( base_expr: ParserElement, op_list: List[InfixNotationOperatorSpec], lpar: Union[str, ParserElement] = Suppress("("), rpar: Union[str, ParserElement] = Suppress(")"), ) -> ParserElement: """Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infix_notation. See :class:`ParserElement.enable_packrat` for a mechanism to potentially improve your parser performance. Parameters: - ``base_expr`` - expression representing the most basic operand to be used in the expression - ``op_list`` - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form ``(op_expr, num_operands, right_left_assoc, (optional)parse_action)``, where: - ``op_expr`` is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if ``num_operands`` is 3, ``op_expr`` is a tuple of two expressions, for the two operators separating the 3 terms - ``num_operands`` is the number of terms for this operator (must be 1, 2, or 3) - ``right_left_assoc`` is the indicator whether the operator is right or left associative, using the pyparsing-defined constants ``OpAssoc.RIGHT`` and ``OpAssoc.LEFT``. - ``parse_action`` is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling ``set_parse_action(*fn)`` (:class:`ParserElement.set_parse_action`) - ``lpar`` - expression for matching left-parentheses; if passed as a str, then will be parsed as Suppress(lpar). If lpar is passed as an expression (such as ``Literal('(')``), then it will be kept in the parsed results, and grouped with them. (default= ``Suppress('(')``) - ``rpar`` - expression for matching right-parentheses; if passed as a str, then will be parsed as Suppress(rpar). If rpar is passed as an expression (such as ``Literal(')')``), then it will be kept in the parsed results, and grouped with them. (default= ``Suppress(')')``) Example:: # simple example of four-function arithmetic with ints and # variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infix_notation(integer | varname, [ ('-', 1, OpAssoc.RIGHT), (one_of('* /'), 2, OpAssoc.LEFT), (one_of('+ -'), 2, OpAssoc.LEFT), ]) arith_expr.run_tests(''' 5+3*6 (5+3)*6 -2--11 ''', full_dump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] """ # captive version of FollowedBy that does not do parse actions or capture results names class _FB(FollowedBy): def parseImpl(self, instring, loc, doActions=True): self.expr.try_parse(instring, loc) return loc, [] _FB.__name__ = "FollowedBy>" ret = Forward() if isinstance(lpar, str): lpar = Suppress(lpar) if isinstance(rpar, str): rpar = Suppress(rpar) # if lpar and rpar are not suppressed, wrap in group if not (isinstance(rpar, Suppress) and isinstance(rpar, Suppress)): lastExpr = base_expr | Group(lpar + ret + rpar) else: lastExpr = base_expr | (lpar + ret + rpar) for i, operDef in enumerate(op_list): opExpr, arity, rightLeftAssoc, pa = (operDef + (None,))[:4] if isinstance(opExpr, str_type): opExpr = ParserElement._literalStringClass(opExpr) if arity == 3: if not isinstance(opExpr, (tuple, list)) or len(opExpr) != 2: raise ValueError( "if numterms=3, opExpr must be a tuple or list of two expressions" ) opExpr1, opExpr2 = opExpr term_name = "{}{} term".format(opExpr1, opExpr2) else: term_name = "{} term".format(opExpr) if not 1 <= arity <= 3: raise ValueError("operator must be unary (1), binary (2), or ternary (3)") if rightLeftAssoc not in (OpAssoc.LEFT, OpAssoc.RIGHT): raise ValueError("operator must indicate right or left associativity") thisExpr: Forward = Forward().set_name(term_name) if rightLeftAssoc is OpAssoc.LEFT: if arity == 1: matchExpr = _FB(lastExpr + opExpr) + Group(lastExpr + opExpr[1, ...]) elif arity == 2: if opExpr is not None: matchExpr = _FB(lastExpr + opExpr + lastExpr) + Group( lastExpr + (opExpr + lastExpr)[1, ...] ) else: matchExpr = _FB(lastExpr + lastExpr) + Group(lastExpr[2, ...]) elif arity == 3: matchExpr = _FB( lastExpr + opExpr1 + lastExpr + opExpr2 + lastExpr ) + Group(lastExpr + OneOrMore(opExpr1 + lastExpr + opExpr2 + lastExpr)) elif rightLeftAssoc is OpAssoc.RIGHT: if arity == 1: # try to avoid LR with this extra test if not isinstance(opExpr, Opt): opExpr = Opt(opExpr) matchExpr = _FB(opExpr.expr + thisExpr) + Group(opExpr + thisExpr) elif arity == 2: if opExpr is not None: matchExpr = _FB(lastExpr + opExpr + thisExpr) + Group( lastExpr + (opExpr + thisExpr)[1, ...] ) else: matchExpr = _FB(lastExpr + thisExpr) + Group( lastExpr + thisExpr[1, ...] ) elif arity == 3: matchExpr = _FB( lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr ) + Group(lastExpr + opExpr1 + thisExpr + opExpr2 + thisExpr) if pa: if isinstance(pa, (tuple, list)): matchExpr.set_parse_action(*pa) else: matchExpr.set_parse_action(pa) thisExpr <<= (matchExpr | lastExpr).setName(term_name) lastExpr = thisExpr ret <<= lastExpr return ret def indentedBlock(blockStatementExpr, indentStack, indent=True, backup_stacks=[]): """ (DEPRECATED - use IndentedBlock class instead) Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - ``blockStatementExpr`` - expression defining syntax of statement that is repeated within the indented block - ``indentStack`` - list created by caller to manage indentation stack (multiple ``statementWithIndentedBlock`` expressions within a single grammar should share a common ``indentStack``) - ``indent`` - boolean indicating whether block must be indented beyond the current level; set to ``False`` for block of left-most statements (default= ``True``) A valid block must contain at least one ``blockStatement``. (Note that indentedBlock uses internal parse actions which make it incompatible with packrat parsing.) Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group("(" + Opt(delimitedList(identifier)) + ")") + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group(funcDecl + func_body) rvalue = Forward() funcCall = Group(identifier + "(" + Opt(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << (funcDef | assignment | identifier) module_body = stmt[1, ...] parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] """ backup_stacks.append(indentStack[:]) def reset_stack(): indentStack[:] = backup_stacks[-1] def checkPeerIndent(s, l, t): if l >= len(s): return curCol = col(l, s) if curCol != indentStack[-1]: if curCol > indentStack[-1]: raise ParseException(s, l, "illegal nesting") raise ParseException(s, l, "not a peer entry") def checkSubIndent(s, l, t): curCol = col(l, s) if curCol > indentStack[-1]: indentStack.append(curCol) else: raise ParseException(s, l, "not a subentry") def checkUnindent(s, l, t): if l >= len(s): return curCol = col(l, s) if not (indentStack and curCol in indentStack): raise ParseException(s, l, "not an unindent") if curCol < indentStack[-1]: indentStack.pop() NL = OneOrMore(LineEnd().set_whitespace_chars("\t ").suppress()) INDENT = (Empty() + Empty().set_parse_action(checkSubIndent)).set_name("INDENT") PEER = Empty().set_parse_action(checkPeerIndent).set_name("") UNDENT = Empty().set_parse_action(checkUnindent).set_name("UNINDENT") if indent: smExpr = Group( Opt(NL) + INDENT + OneOrMore(PEER + Group(blockStatementExpr) + Opt(NL)) + UNDENT ) else: smExpr = Group( Opt(NL) + OneOrMore(PEER + Group(blockStatementExpr) + Opt(NL)) + Opt(UNDENT) ) # add a parse action to remove backup_stack from list of backups smExpr.add_parse_action( lambda: backup_stacks.pop(-1) and None if backup_stacks else None ) smExpr.set_fail_action(lambda a, b, c, d: reset_stack()) blockStatementExpr.ignore(_bslash + LineEnd()) return smExpr.set_name("indented block") # it's easy to get these comment structures wrong - they're very common, so may as well make them available c_style_comment = Combine(Regex(r"/\*(?:[^*]|\*(?!/))*") + "*/").set_name( "C style comment" ) "Comment of the form ``/* ... */``" html_comment = Regex(r"").set_name("HTML comment") "Comment of the form ````" rest_of_line = Regex(r".*").leave_whitespace().set_name("rest of line") dbl_slash_comment = Regex(r"//(?:\\\n|[^\n])*").set_name("// comment") "Comment of the form ``// ... (to end of line)``" cpp_style_comment = Combine( Regex(r"/\*(?:[^*]|\*(?!/))*") + "*/" | dbl_slash_comment ).set_name("C++ style comment") "Comment of either form :class:`c_style_comment` or :class:`dbl_slash_comment`" java_style_comment = cpp_style_comment "Same as :class:`cpp_style_comment`" python_style_comment = Regex(r"#.*").set_name("Python style comment") "Comment of the form ``# ... (to end of line)``" # build list of built-in expressions, for future reference if a global default value # gets updated _builtin_exprs: List[ParserElement] = [ v for v in vars().values() if isinstance(v, ParserElement) ] # pre-PEP8 compatible names delimitedList = delimited_list countedArray = counted_array matchPreviousLiteral = match_previous_literal matchPreviousExpr = match_previous_expr oneOf = one_of dictOf = dict_of originalTextFor = original_text_for nestedExpr = nested_expr makeHTMLTags = make_html_tags makeXMLTags = make_xml_tags anyOpenTag, anyCloseTag = any_open_tag, any_close_tag commonHTMLEntity = common_html_entity replaceHTMLEntity = replace_html_entity opAssoc = OpAssoc infixNotation = infix_notation cStyleComment = c_style_comment htmlComment = html_comment restOfLine = rest_of_line dblSlashComment = dbl_slash_comment cppStyleComment = cpp_style_comment javaStyleComment = java_style_comment pythonStyleComment = python_style_comment PK!/H_vendor/pyparsing/actions.pynu[# actions.py from .exceptions import ParseException from .util import col class OnlyOnce: """ Wrapper for parse actions, to ensure they are only called once. """ def __init__(self, method_call): from .core import _trim_arity self.callable = _trim_arity(method_call) self.called = False def __call__(self, s, l, t): if not self.called: results = self.callable(s, l, t) self.called = True return results raise ParseException(s, l, "OnlyOnce obj called multiple times w/out reset") def reset(self): """ Allow the associated parse action to be called once more. """ self.called = False def match_only_at_col(n): """ Helper method for defining parse actions that require matching at a specific column in the input text. """ def verify_col(strg, locn, toks): if col(locn, strg) != n: raise ParseException(strg, locn, "matched token not at column {}".format(n)) return verify_col def replace_with(repl_str): """ Helper method for common parse actions that simply return a literal value. Especially useful when used with :class:`transform_string` (). Example:: num = Word(nums).set_parse_action(lambda toks: int(toks[0])) na = one_of("N/A NA").set_parse_action(replace_with(math.nan)) term = na | num term[1, ...].parse_string("324 234 N/A 234") # -> [324, 234, nan, 234] """ return lambda s, l, t: [repl_str] def remove_quotes(s, l, t): """ Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use remove_quotes to strip quotation marks from parsed results quoted_string.set_parse_action(remove_quotes) quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] """ return t[0][1:-1] def with_attribute(*args, **attr_dict): """ Helper to create a validating parse action to be used with start tags created with :class:`make_xml_tags` or :class:`make_html_tags`. Use ``with_attribute`` to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as ```` or ``
``. Call ``with_attribute`` with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in ``(align="right")``, or - as an explicit dict with ``**`` operator, when an attribute name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}`` - a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align", "right"))`` For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for ``class`` (with or without a namespace), use :class:`with_class`. To verify that the attribute exists, but without specifying a value, pass ``with_attribute.ANY_VALUE`` as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = make_html_tags("div") # only match div tag having a type attribute with value "grid" div_grid = div().set_parse_action(with_attribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.search_string(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().set_parse_action(with_attribute(type=with_attribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.search_string(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 """ if args: attrs = args[:] else: attrs = attr_dict.items() attrs = [(k, v) for k, v in attrs] def pa(s, l, tokens): for attrName, attrValue in attrs: if attrName not in tokens: raise ParseException(s, l, "no matching attribute " + attrName) if attrValue != with_attribute.ANY_VALUE and tokens[attrName] != attrValue: raise ParseException( s, l, "attribute {!r} has value {!r}, must be {!r}".format( attrName, tokens[attrName], attrValue ), ) return pa with_attribute.ANY_VALUE = object() def with_class(classname, namespace=""): """ Simplified version of :class:`with_attribute` when matching on a div class - made difficult because ``class`` is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = make_html_tags("div") div_grid = div().set_parse_action(with_class("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.search_string(html): print(grid_header.body) div_any_type = div().set_parse_action(with_class(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.search_string(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 """ classattr = "{}:class".format(namespace) if namespace else "class" return with_attribute(**{classattr: classname}) # pre-PEP8 compatibility symbols replaceWith = replace_with removeQuotes = remove_quotes withAttribute = with_attribute withClass = with_class matchOnlyAtCol = match_only_at_col PK!-Gl_vendor/pyparsing/util.pynu[# util.py import warnings import types import collections import itertools from functools import lru_cache from typing import List, Union, Iterable _bslash = chr(92) class __config_flags: """Internal class for defining compatibility and debugging flags""" _all_names: List[str] = [] _fixed_names: List[str] = [] _type_desc = "configuration" @classmethod def _set(cls, dname, value): if dname in cls._fixed_names: warnings.warn( "{}.{} {} is {} and cannot be overridden".format( cls.__name__, dname, cls._type_desc, str(getattr(cls, dname)).upper(), ) ) return if dname in cls._all_names: setattr(cls, dname, value) else: raise ValueError("no such {} {!r}".format(cls._type_desc, dname)) enable = classmethod(lambda cls, name: cls._set(name, True)) disable = classmethod(lambda cls, name: cls._set(name, False)) @lru_cache(maxsize=128) def col(loc: int, strg: str) -> int: """ Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. """ s = strg return 1 if 0 < loc < len(s) and s[loc - 1] == "\n" else loc - s.rfind("\n", 0, loc) @lru_cache(maxsize=128) def lineno(loc: int, strg: str) -> int: """Returns current line number within a string, counting newlines as line separators. The first line is number 1. Note - the default parsing behavior is to expand tabs in the input string before starting the parsing process. See :class:`ParserElement.parseString` for more information on parsing strings containing ```` s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. """ return strg.count("\n", 0, loc) + 1 @lru_cache(maxsize=128) def line(loc: int, strg: str) -> str: """ Returns the line of text containing loc within a string, counting newlines as line separators. """ last_cr = strg.rfind("\n", 0, loc) next_cr = strg.find("\n", loc) return strg[last_cr + 1 : next_cr] if next_cr >= 0 else strg[last_cr + 1 :] class _UnboundedCache: def __init__(self): cache = {} cache_get = cache.get self.not_in_cache = not_in_cache = object() def get(_, key): return cache_get(key, not_in_cache) def set_(_, key, value): cache[key] = value def clear(_): cache.clear() self.size = None self.get = types.MethodType(get, self) self.set = types.MethodType(set_, self) self.clear = types.MethodType(clear, self) class _FifoCache: def __init__(self, size): self.not_in_cache = not_in_cache = object() cache = collections.OrderedDict() cache_get = cache.get def get(_, key): return cache_get(key, not_in_cache) def set_(_, key, value): cache[key] = value while len(cache) > size: cache.popitem(last=False) def clear(_): cache.clear() self.size = size self.get = types.MethodType(get, self) self.set = types.MethodType(set_, self) self.clear = types.MethodType(clear, self) class LRUMemo: """ A memoizing mapping that retains `capacity` deleted items The memo tracks retained items by their access order; once `capacity` items are retained, the least recently used item is discarded. """ def __init__(self, capacity): self._capacity = capacity self._active = {} self._memory = collections.OrderedDict() def __getitem__(self, key): try: return self._active[key] except KeyError: self._memory.move_to_end(key) return self._memory[key] def __setitem__(self, key, value): self._memory.pop(key, None) self._active[key] = value def __delitem__(self, key): try: value = self._active.pop(key) except KeyError: pass else: while len(self._memory) >= self._capacity: self._memory.popitem(last=False) self._memory[key] = value def clear(self): self._active.clear() self._memory.clear() class UnboundedMemo(dict): """ A memoizing mapping that retains all deleted items """ def __delitem__(self, key): pass def _escape_regex_range_chars(s: str) -> str: # escape these chars: ^-[] for c in r"\^-[]": s = s.replace(c, _bslash + c) s = s.replace("\n", r"\n") s = s.replace("\t", r"\t") return str(s) def _collapse_string_to_ranges( s: Union[str, Iterable[str]], re_escape: bool = True ) -> str: def is_consecutive(c): c_int = ord(c) is_consecutive.prev, prev = c_int, is_consecutive.prev if c_int - prev > 1: is_consecutive.value = next(is_consecutive.counter) return is_consecutive.value is_consecutive.prev = 0 is_consecutive.counter = itertools.count() is_consecutive.value = -1 def escape_re_range_char(c): return "\\" + c if c in r"\^-][" else c def no_escape_re_range_char(c): return c if not re_escape: escape_re_range_char = no_escape_re_range_char ret = [] s = "".join(sorted(set(s))) if len(s) > 3: for _, chars in itertools.groupby(s, key=is_consecutive): first = last = next(chars) last = collections.deque( itertools.chain(iter([last]), chars), maxlen=1 ).pop() if first == last: ret.append(escape_re_range_char(first)) else: sep = "" if ord(last) == ord(first) + 1 else "-" ret.append( "{}{}{}".format( escape_re_range_char(first), sep, escape_re_range_char(last) ) ) else: ret = [escape_re_range_char(c) for c in s] return "".join(ret) def _flatten(ll: list) -> list: ret = [] for i in ll: if isinstance(i, list): ret.extend(_flatten(i)) else: ret.append(i) return ret PK!6 t?#?#_vendor/pyparsing/exceptions.pynu[# exceptions.py import re import sys import typing from .util import col, line, lineno, _collapse_string_to_ranges from .unicode import pyparsing_unicode as ppu class ExceptionWordUnicode(ppu.Latin1, ppu.LatinA, ppu.LatinB, ppu.Greek, ppu.Cyrillic): pass _extract_alphanums = _collapse_string_to_ranges(ExceptionWordUnicode.alphanums) _exception_word_extractor = re.compile("([" + _extract_alphanums + "]{1,16})|.") class ParseBaseException(Exception): """base exception class for all parsing runtime exceptions""" # Performance tuning: we construct a *lot* of these, so keep this # constructor as small and fast as possible def __init__( self, pstr: str, loc: int = 0, msg: typing.Optional[str] = None, elem=None, ): self.loc = loc if msg is None: self.msg = pstr self.pstr = "" else: self.msg = msg self.pstr = pstr self.parser_element = self.parserElement = elem self.args = (pstr, loc, msg) @staticmethod def explain_exception(exc, depth=16): """ Method to take an exception and translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised. Parameters: - exc - exception raised during parsing (need not be a ParseException, in support of Python exceptions that might be raised in a parse action) - depth (default=16) - number of levels back in the stack trace to list expression and function names; if None, the full stack trace names will be listed; if 0, only the failing input line, marker, and exception string will be shown Returns a multi-line string listing the ParserElements and/or function names in the exception's stack trace. """ import inspect from .core import ParserElement if depth is None: depth = sys.getrecursionlimit() ret = [] if isinstance(exc, ParseBaseException): ret.append(exc.line) ret.append(" " * (exc.column - 1) + "^") ret.append("{}: {}".format(type(exc).__name__, exc)) if depth > 0: callers = inspect.getinnerframes(exc.__traceback__, context=depth) seen = set() for i, ff in enumerate(callers[-depth:]): frm = ff[0] f_self = frm.f_locals.get("self", None) if isinstance(f_self, ParserElement): if frm.f_code.co_name not in ("parseImpl", "_parseNoCache"): continue if id(f_self) in seen: continue seen.add(id(f_self)) self_type = type(f_self) ret.append( "{}.{} - {}".format( self_type.__module__, self_type.__name__, f_self ) ) elif f_self is not None: self_type = type(f_self) ret.append("{}.{}".format(self_type.__module__, self_type.__name__)) else: code = frm.f_code if code.co_name in ("wrapper", ""): continue ret.append("{}".format(code.co_name)) depth -= 1 if not depth: break return "\n".join(ret) @classmethod def _from_exception(cls, pe): """ internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses """ return cls(pe.pstr, pe.loc, pe.msg, pe.parserElement) @property def line(self) -> str: """ Return the line of text where the exception occurred. """ return line(self.loc, self.pstr) @property def lineno(self) -> int: """ Return the 1-based line number of text where the exception occurred. """ return lineno(self.loc, self.pstr) @property def col(self) -> int: """ Return the 1-based column on the line of text where the exception occurred. """ return col(self.loc, self.pstr) @property def column(self) -> int: """ Return the 1-based column on the line of text where the exception occurred. """ return col(self.loc, self.pstr) def __str__(self) -> str: if self.pstr: if self.loc >= len(self.pstr): foundstr = ", found end of text" else: # pull out next word at error location found_match = _exception_word_extractor.match(self.pstr, self.loc) if found_match is not None: found = found_match.group(0) else: found = self.pstr[self.loc : self.loc + 1] foundstr = (", found %r" % found).replace(r"\\", "\\") else: foundstr = "" return "{}{} (at char {}), (line:{}, col:{})".format( self.msg, foundstr, self.loc, self.lineno, self.column ) def __repr__(self): return str(self) def mark_input_line(self, marker_string: str = None, *, markerString=">!<") -> str: """ Extracts the exception line from the input string, and marks the location of the exception with a special symbol. """ markerString = marker_string if marker_string is not None else markerString line_str = self.line line_column = self.column - 1 if markerString: line_str = "".join( (line_str[:line_column], markerString, line_str[line_column:]) ) return line_str.strip() def explain(self, depth=16) -> str: """ Method to translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised. Parameters: - depth (default=16) - number of levels back in the stack trace to list expression and function names; if None, the full stack trace names will be listed; if 0, only the failing input line, marker, and exception string will be shown Returns a multi-line string listing the ParserElements and/or function names in the exception's stack trace. Example:: expr = pp.Word(pp.nums) * 3 try: expr.parse_string("123 456 A789") except pp.ParseException as pe: print(pe.explain(depth=0)) prints:: 123 456 A789 ^ ParseException: Expected W:(0-9), found 'A' (at char 8), (line:1, col:9) Note: the diagnostic output will include string representations of the expressions that failed to parse. These representations will be more helpful if you use `set_name` to give identifiable names to your expressions. Otherwise they will use the default string forms, which may be cryptic to read. Note: pyparsing's default truncation of exception tracebacks may also truncate the stack of expressions that are displayed in the ``explain`` output. To get the full listing of parser expressions, you may have to set ``ParserElement.verbose_stacktrace = True`` """ return self.explain_exception(self, depth) markInputline = mark_input_line class ParseException(ParseBaseException): """ Exception thrown when a parse expression doesn't match the input string Example:: try: Word(nums).set_name("integer").parse_string("ABC") except ParseException as pe: print(pe) print("column: {}".format(pe.column)) prints:: Expected integer (at char 0), (line:1, col:1) column: 1 """ class ParseFatalException(ParseBaseException): """ User-throwable exception thrown when inconsistent parse content is found; stops all parsing immediately """ class ParseSyntaxException(ParseFatalException): """ Just like :class:`ParseFatalException`, but thrown internally when an :class:`ErrorStop` ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found. """ class RecursiveGrammarException(Exception): """ Exception thrown by :class:`ParserElement.validate` if the grammar could be left-recursive; parser may need to enable left recursion using :class:`ParserElement.enable_left_recursion` """ def __init__(self, parseElementList): self.parseElementTrace = parseElementList def __str__(self) -> str: return "RecursiveGrammarException: {}".format(self.parseElementTrace) PK!^bb_vendor/pyparsing/results.pynu[# results.py from collections.abc import MutableMapping, Mapping, MutableSequence, Iterator import pprint from weakref import ref as wkref from typing import Tuple, Any str_type: Tuple[type, ...] = (str, bytes) _generator_type = type((_ for _ in ())) class _ParseResultsWithOffset: __slots__ = ["tup"] def __init__(self, p1, p2): self.tup = (p1, p2) def __getitem__(self, i): return self.tup[i] def __getstate__(self): return self.tup def __setstate__(self, *args): self.tup = args[0] class ParseResults: """Structured parse results, to provide multiple means of access to the parsed data: - as a list (``len(results)``) - by list index (``results[0], results[1]``, etc.) - by attribute (``results.`` - see :class:`ParserElement.set_results_name`) Example:: integer = Word(nums) date_str = (integer.set_results_name("year") + '/' + integer.set_results_name("month") + '/' + integer.set_results_name("day")) # equivalent form: # date_str = (integer("year") + '/' # + integer("month") + '/' # + integer("day")) # parse_string returns a ParseResults object result = date_str.parse_string("1999/12/31") def test(s, fn=repr): print("{} -> {}".format(s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: '31' - month: '12' - year: '1999' """ _null_values: Tuple[Any, ...] = (None, [], "", ()) __slots__ = [ "_name", "_parent", "_all_names", "_modal", "_toklist", "_tokdict", "__weakref__", ] class List(list): """ Simple wrapper class to distinguish parsed list results that should be preserved as actual Python lists, instead of being converted to :class:`ParseResults`: LBRACK, RBRACK = map(pp.Suppress, "[]") element = pp.Forward() item = ppc.integer element_list = LBRACK + pp.delimited_list(element) + RBRACK # add parse actions to convert from ParseResults to actual Python collection types def as_python_list(t): return pp.ParseResults.List(t.as_list()) element_list.add_parse_action(as_python_list) element <<= item | element_list element.run_tests(''' 100 [2,3,4] [[2, 1],3,4] [(2, 1),3,4] (2,3,4) ''', post_parse=lambda s, r: (r[0], type(r[0]))) prints: 100 (100, ) [2,3,4] ([2, 3, 4], ) [[2, 1],3,4] ([[2, 1], 3, 4], ) (Used internally by :class:`Group` when `aslist=True`.) """ def __new__(cls, contained=None): if contained is None: contained = [] if not isinstance(contained, list): raise TypeError( "{} may only be constructed with a list," " not {}".format(cls.__name__, type(contained).__name__) ) return list.__new__(cls) def __new__(cls, toklist=None, name=None, **kwargs): if isinstance(toklist, ParseResults): return toklist self = object.__new__(cls) self._name = None self._parent = None self._all_names = set() if toklist is None: self._toklist = [] elif isinstance(toklist, (list, _generator_type)): self._toklist = ( [toklist[:]] if isinstance(toklist, ParseResults.List) else list(toklist) ) else: self._toklist = [toklist] self._tokdict = dict() return self # Performance tuning: we construct a *lot* of these, so keep this # constructor as small and fast as possible def __init__( self, toklist=None, name=None, asList=True, modal=True, isinstance=isinstance ): self._modal = modal if name is not None and name != "": if isinstance(name, int): name = str(name) if not modal: self._all_names = {name} self._name = name if toklist not in self._null_values: if isinstance(toklist, (str_type, type)): toklist = [toklist] if asList: if isinstance(toklist, ParseResults): self[name] = _ParseResultsWithOffset( ParseResults(toklist._toklist), 0 ) else: self[name] = _ParseResultsWithOffset( ParseResults(toklist[0]), 0 ) self[name]._name = name else: try: self[name] = toklist[0] except (KeyError, TypeError, IndexError): if toklist is not self: self[name] = toklist else: self._name = name def __getitem__(self, i): if isinstance(i, (int, slice)): return self._toklist[i] else: if i not in self._all_names: return self._tokdict[i][-1][0] else: return ParseResults([v[0] for v in self._tokdict[i]]) def __setitem__(self, k, v, isinstance=isinstance): if isinstance(v, _ParseResultsWithOffset): self._tokdict[k] = self._tokdict.get(k, list()) + [v] sub = v[0] elif isinstance(k, (int, slice)): self._toklist[k] = v sub = v else: self._tokdict[k] = self._tokdict.get(k, list()) + [ _ParseResultsWithOffset(v, 0) ] sub = v if isinstance(sub, ParseResults): sub._parent = wkref(self) def __delitem__(self, i): if isinstance(i, (int, slice)): mylen = len(self._toklist) del self._toklist[i] # convert int to slice if isinstance(i, int): if i < 0: i += mylen i = slice(i, i + 1) # get removed indices removed = list(range(*i.indices(mylen))) removed.reverse() # fixup indices in token dictionary for name, occurrences in self._tokdict.items(): for j in removed: for k, (value, position) in enumerate(occurrences): occurrences[k] = _ParseResultsWithOffset( value, position - (position > j) ) else: del self._tokdict[i] def __contains__(self, k) -> bool: return k in self._tokdict def __len__(self) -> int: return len(self._toklist) def __bool__(self) -> bool: return not not (self._toklist or self._tokdict) def __iter__(self) -> Iterator: return iter(self._toklist) def __reversed__(self) -> Iterator: return iter(self._toklist[::-1]) def keys(self): return iter(self._tokdict) def values(self): return (self[k] for k in self.keys()) def items(self): return ((k, self[k]) for k in self.keys()) def haskeys(self) -> bool: """ Since ``keys()`` returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.""" return bool(self._tokdict) def pop(self, *args, **kwargs): """ Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If passed no argument or an integer argument, it will use ``list`` semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use ``dict`` semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in ``dict.pop()``. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] def remove_first(tokens): tokens.pop(0) numlist.add_parse_action(remove_first) print(numlist.parse_string("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + Word(nums)[1, ...] print(patt.parse_string("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.add_parse_action(remove_LABEL) print(patt.parse_string("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: 'AAB' ['AAB', '123', '321'] """ if not args: args = [-1] for k, v in kwargs.items(): if k == "default": args = (args[0], v) else: raise TypeError( "pop() got an unexpected keyword argument {!r}".format(k) ) if isinstance(args[0], int) or len(args) == 1 or args[0] in self: index = args[0] ret = self[index] del self[index] return ret else: defaultvalue = args[1] return defaultvalue def get(self, key, default_value=None): """ Returns named result matching the given key, or if there is no such name, then returns the given ``default_value`` or ``None`` if no ``default_value`` is specified. Similar to ``dict.get()``. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None """ if key in self: return self[key] else: return default_value def insert(self, index, ins_string): """ Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) numlist.add_parse_action(insert_locn) print(numlist.parse_string("0 123 321")) # -> [0, '0', '123', '321'] """ self._toklist.insert(index, ins_string) # fixup indices in token dictionary for name, occurrences in self._tokdict.items(): for k, (value, position) in enumerate(occurrences): occurrences[k] = _ParseResultsWithOffset( value, position + (position > index) ) def append(self, item): """ Add single element to end of ``ParseResults`` list of elements. Example:: numlist = Word(nums)[...] print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) numlist.add_parse_action(append_sum) print(numlist.parse_string("0 123 321")) # -> ['0', '123', '321', 444] """ self._toklist.append(item) def extend(self, itemseq): """ Add sequence of elements to end of ``ParseResults`` list of elements. Example:: patt = Word(alphas)[1, ...] # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) patt.add_parse_action(make_palindrome) print(patt.parse_string("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' """ if isinstance(itemseq, ParseResults): self.__iadd__(itemseq) else: self._toklist.extend(itemseq) def clear(self): """ Clear all elements and results names. """ del self._toklist[:] self._tokdict.clear() def __getattr__(self, name): try: return self[name] except KeyError: if name.startswith("__"): raise AttributeError(name) return "" def __add__(self, other) -> "ParseResults": ret = self.copy() ret += other return ret def __iadd__(self, other) -> "ParseResults": if other._tokdict: offset = len(self._toklist) addoffset = lambda a: offset if a < 0 else a + offset otheritems = other._tokdict.items() otherdictitems = [ (k, _ParseResultsWithOffset(v[0], addoffset(v[1]))) for k, vlist in otheritems for v in vlist ] for k, v in otherdictitems: self[k] = v if isinstance(v[0], ParseResults): v[0]._parent = wkref(self) self._toklist += other._toklist self._all_names |= other._all_names return self def __radd__(self, other) -> "ParseResults": if isinstance(other, int) and other == 0: # useful for merging many ParseResults using sum() builtin return self.copy() else: # this may raise a TypeError - so be it return other + self def __repr__(self) -> str: return "{}({!r}, {})".format(type(self).__name__, self._toklist, self.as_dict()) def __str__(self) -> str: return ( "[" + ", ".join( [ str(i) if isinstance(i, ParseResults) else repr(i) for i in self._toklist ] ) + "]" ) def _asStringList(self, sep=""): out = [] for item in self._toklist: if out and sep: out.append(sep) if isinstance(item, ParseResults): out += item._asStringList() else: out.append(str(item)) return out def as_list(self) -> list: """ Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = Word(alphas)[1, ...] result = patt.parse_string("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use as_list() to create an actual list result_list = result.as_list() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] """ return [ res.as_list() if isinstance(res, ParseResults) else res for res in self._toklist ] def as_dict(self) -> dict: """ Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.as_dict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.as_dict())) # -> {"month": "31", "day": "1999", "year": "12"} """ def to_item(obj): if isinstance(obj, ParseResults): return obj.as_dict() if obj.haskeys() else [to_item(v) for v in obj] else: return obj return dict((k, to_item(v)) for k, v in self.items()) def copy(self) -> "ParseResults": """ Returns a new copy of a :class:`ParseResults` object. """ ret = ParseResults(self._toklist) ret._tokdict = self._tokdict.copy() ret._parent = self._parent ret._all_names |= self._all_names ret._name = self._name return ret def get_name(self): r""" Returns the results name for this token expression. Useful when several different expressions might match at a particular location. Example:: integer = Word(nums) ssn_expr = Regex(r"\d\d\d-\d\d-\d\d\d\d") house_number_expr = Suppress('#') + Word(nums, alphanums) user_data = (Group(house_number_expr)("house_number") | Group(ssn_expr)("ssn") | Group(integer)("age")) user_info = user_data[1, ...] result = user_info.parse_string("22 111-22-3333 #221B") for item in result: print(item.get_name(), ':', item[0]) prints:: age : 22 ssn : 111-22-3333 house_number : 221B """ if self._name: return self._name elif self._parent: par = self._parent() def find_in_parent(sub): return next( ( k for k, vlist in par._tokdict.items() for v, loc in vlist if sub is v ), None, ) return find_in_parent(self) if par else None elif ( len(self) == 1 and len(self._tokdict) == 1 and next(iter(self._tokdict.values()))[0][1] in (0, -1) ): return next(iter(self._tokdict.keys())) else: return None def dump(self, indent="", full=True, include_list=True, _depth=0) -> str: """ Diagnostic method for listing out the contents of a :class:`ParseResults`. Accepts an optional ``indent`` argument so that this string can be embedded in a nested display of other data. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parse_string('1999/12/31') print(result.dump()) prints:: ['1999', '/', '12', '/', '31'] - day: '31' - month: '12' - year: '1999' """ out = [] NL = "\n" out.append(indent + str(self.as_list()) if include_list else "") if full: if self.haskeys(): items = sorted((str(k), v) for k, v in self.items()) for k, v in items: if out: out.append(NL) out.append("{}{}- {}: ".format(indent, (" " * _depth), k)) if isinstance(v, ParseResults): if v: out.append( v.dump( indent=indent, full=full, include_list=include_list, _depth=_depth + 1, ) ) else: out.append(str(v)) else: out.append(repr(v)) if any(isinstance(vv, ParseResults) for vv in self): v = self for i, vv in enumerate(v): if isinstance(vv, ParseResults): out.append( "\n{}{}[{}]:\n{}{}{}".format( indent, (" " * (_depth)), i, indent, (" " * (_depth + 1)), vv.dump( indent=indent, full=full, include_list=include_list, _depth=_depth + 1, ), ) ) else: out.append( "\n%s%s[%d]:\n%s%s%s" % ( indent, (" " * (_depth)), i, indent, (" " * (_depth + 1)), str(vv), ) ) return "".join(out) def pprint(self, *args, **kwargs): """ Pretty-printer for parsed results as a list, using the `pprint `_ module. Accepts additional positional or keyword args as defined for `pprint.pprint `_ . Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimited_list(term))) result = func.parse_string("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] """ pprint.pprint(self.as_list(), *args, **kwargs) # add support for pickle protocol def __getstate__(self): return ( self._toklist, ( self._tokdict.copy(), self._parent is not None and self._parent() or None, self._all_names, self._name, ), ) def __setstate__(self, state): self._toklist, (self._tokdict, par, inAccumNames, self._name) = state self._all_names = set(inAccumNames) if par is not None: self._parent = wkref(par) else: self._parent = None def __getnewargs__(self): return self._toklist, self._name def __dir__(self): return dir(type(self)) + list(self.keys()) @classmethod def from_dict(cls, other, name=None) -> "ParseResults": """ Helper classmethod to construct a ``ParseResults`` from a ``dict``, preserving the name-value relations as results names. If an optional ``name`` argument is given, a nested ``ParseResults`` will be returned. """ def is_iterable(obj): try: iter(obj) except Exception: return False else: return not isinstance(obj, str_type) ret = cls([]) for k, v in other.items(): if isinstance(v, Mapping): ret += cls.from_dict(v, name=k) else: ret += cls([v], name=k, asList=is_iterable(v)) if name is not None: ret = cls([ret], name=name) return ret asList = as_list asDict = as_dict getName = get_name MutableMapping.register(ParseResults) MutableSequence.register(ParseResults) PK!5Z4Z4_vendor/pyparsing/testing.pynu[# testing.py from contextlib import contextmanager import typing from .core import ( ParserElement, ParseException, Keyword, __diag__, __compat__, ) class pyparsing_test: """ namespace class for classes useful in writing unit tests """ class reset_pyparsing_context: """ Context manager to be used when writing unit tests that modify pyparsing config values: - packrat parsing - bounded recursion parsing - default whitespace characters. - default keyword characters - literal string auto-conversion class - __diag__ settings Example:: with reset_pyparsing_context(): # test that literals used to construct a grammar are automatically suppressed ParserElement.inlineLiteralsUsing(Suppress) term = Word(alphas) | Word(nums) group = Group('(' + term[...] + ')') # assert that the '()' characters are not included in the parsed tokens self.assertParseAndCheckList(group, "(abc 123 def)", ['abc', '123', 'def']) # after exiting context manager, literals are converted to Literal expressions again """ def __init__(self): self._save_context = {} def save(self): self._save_context["default_whitespace"] = ParserElement.DEFAULT_WHITE_CHARS self._save_context["default_keyword_chars"] = Keyword.DEFAULT_KEYWORD_CHARS self._save_context[ "literal_string_class" ] = ParserElement._literalStringClass self._save_context["verbose_stacktrace"] = ParserElement.verbose_stacktrace self._save_context["packrat_enabled"] = ParserElement._packratEnabled if ParserElement._packratEnabled: self._save_context[ "packrat_cache_size" ] = ParserElement.packrat_cache.size else: self._save_context["packrat_cache_size"] = None self._save_context["packrat_parse"] = ParserElement._parse self._save_context[ "recursion_enabled" ] = ParserElement._left_recursion_enabled self._save_context["__diag__"] = { name: getattr(__diag__, name) for name in __diag__._all_names } self._save_context["__compat__"] = { "collect_all_And_tokens": __compat__.collect_all_And_tokens } return self def restore(self): # reset pyparsing global state if ( ParserElement.DEFAULT_WHITE_CHARS != self._save_context["default_whitespace"] ): ParserElement.set_default_whitespace_chars( self._save_context["default_whitespace"] ) ParserElement.verbose_stacktrace = self._save_context["verbose_stacktrace"] Keyword.DEFAULT_KEYWORD_CHARS = self._save_context["default_keyword_chars"] ParserElement.inlineLiteralsUsing( self._save_context["literal_string_class"] ) for name, value in self._save_context["__diag__"].items(): (__diag__.enable if value else __diag__.disable)(name) ParserElement._packratEnabled = False if self._save_context["packrat_enabled"]: ParserElement.enable_packrat(self._save_context["packrat_cache_size"]) else: ParserElement._parse = self._save_context["packrat_parse"] ParserElement._left_recursion_enabled = self._save_context[ "recursion_enabled" ] __compat__.collect_all_And_tokens = self._save_context["__compat__"] return self def copy(self): ret = type(self)() ret._save_context.update(self._save_context) return ret def __enter__(self): return self.save() def __exit__(self, *args): self.restore() class TestParseResultsAsserts: """ A mixin class to add parse results assertion methods to normal unittest.TestCase classes. """ def assertParseResultsEquals( self, result, expected_list=None, expected_dict=None, msg=None ): """ Unit test assertion to compare a :class:`ParseResults` object with an optional ``expected_list``, and compare any defined results names with an optional ``expected_dict``. """ if expected_list is not None: self.assertEqual(expected_list, result.as_list(), msg=msg) if expected_dict is not None: self.assertEqual(expected_dict, result.as_dict(), msg=msg) def assertParseAndCheckList( self, expr, test_string, expected_list, msg=None, verbose=True ): """ Convenience wrapper assert to test a parser element and input string, and assert that the resulting ``ParseResults.asList()`` is equal to the ``expected_list``. """ result = expr.parse_string(test_string, parse_all=True) if verbose: print(result.dump()) else: print(result.as_list()) self.assertParseResultsEquals(result, expected_list=expected_list, msg=msg) def assertParseAndCheckDict( self, expr, test_string, expected_dict, msg=None, verbose=True ): """ Convenience wrapper assert to test a parser element and input string, and assert that the resulting ``ParseResults.asDict()`` is equal to the ``expected_dict``. """ result = expr.parse_string(test_string, parseAll=True) if verbose: print(result.dump()) else: print(result.as_list()) self.assertParseResultsEquals(result, expected_dict=expected_dict, msg=msg) def assertRunTestResults( self, run_tests_report, expected_parse_results=None, msg=None ): """ Unit test assertion to evaluate output of ``ParserElement.runTests()``. If a list of list-dict tuples is given as the ``expected_parse_results`` argument, then these are zipped with the report tuples returned by ``runTests`` and evaluated using ``assertParseResultsEquals``. Finally, asserts that the overall ``runTests()`` success value is ``True``. :param run_tests_report: tuple(bool, [tuple(str, ParseResults or Exception)]) returned from runTests :param expected_parse_results (optional): [tuple(str, list, dict, Exception)] """ run_test_success, run_test_results = run_tests_report if expected_parse_results is not None: merged = [ (*rpt, expected) for rpt, expected in zip(run_test_results, expected_parse_results) ] for test_string, result, expected in merged: # expected should be a tuple containing a list and/or a dict or an exception, # and optional failure message string # an empty tuple will skip any result validation fail_msg = next( (exp for exp in expected if isinstance(exp, str)), None ) expected_exception = next( ( exp for exp in expected if isinstance(exp, type) and issubclass(exp, Exception) ), None, ) if expected_exception is not None: with self.assertRaises( expected_exception=expected_exception, msg=fail_msg or msg ): if isinstance(result, Exception): raise result else: expected_list = next( (exp for exp in expected if isinstance(exp, list)), None ) expected_dict = next( (exp for exp in expected if isinstance(exp, dict)), None ) if (expected_list, expected_dict) != (None, None): self.assertParseResultsEquals( result, expected_list=expected_list, expected_dict=expected_dict, msg=fail_msg or msg, ) else: # warning here maybe? print("no validation for {!r}".format(test_string)) # do this last, in case some specific test results can be reported instead self.assertTrue( run_test_success, msg=msg if msg is not None else "failed runTests" ) @contextmanager def assertRaisesParseException(self, exc_type=ParseException, msg=None): with self.assertRaises(exc_type, msg=msg): yield @staticmethod def with_line_numbers( s: str, start_line: typing.Optional[int] = None, end_line: typing.Optional[int] = None, expand_tabs: bool = True, eol_mark: str = "|", mark_spaces: typing.Optional[str] = None, mark_control: typing.Optional[str] = None, ) -> str: """ Helpful method for debugging a parser - prints a string with line and column numbers. (Line and column numbers are 1-based.) :param s: tuple(bool, str - string to be printed with line and column numbers :param start_line: int - (optional) starting line number in s to print (default=1) :param end_line: int - (optional) ending line number in s to print (default=len(s)) :param expand_tabs: bool - (optional) expand tabs to spaces, to match the pyparsing default :param eol_mark: str - (optional) string to mark the end of lines, helps visualize trailing spaces (default="|") :param mark_spaces: str - (optional) special character to display in place of spaces :param mark_control: str - (optional) convert non-printing control characters to a placeholding character; valid values: - "unicode" - replaces control chars with Unicode symbols, such as "␍" and "␊" - any single character string - replace control characters with given string - None (default) - string is displayed as-is :return: str - input string with leading line numbers and column number headers """ if expand_tabs: s = s.expandtabs() if mark_control is not None: if mark_control == "unicode": tbl = str.maketrans( {c: u for c, u in zip(range(0, 33), range(0x2400, 0x2433))} | {127: 0x2421} ) eol_mark = "" else: tbl = str.maketrans( {c: mark_control for c in list(range(0, 32)) + [127]} ) s = s.translate(tbl) if mark_spaces is not None and mark_spaces != " ": if mark_spaces == "unicode": tbl = str.maketrans({9: 0x2409, 32: 0x2423}) s = s.translate(tbl) else: s = s.replace(" ", mark_spaces) if start_line is None: start_line = 1 if end_line is None: end_line = len(s) end_line = min(end_line, len(s)) start_line = min(max(1, start_line), end_line) if mark_control != "unicode": s_lines = s.splitlines()[start_line - 1 : end_line] else: s_lines = [line + "␊" for line in s.split("␊")[start_line - 1 : end_line]] if not s_lines: return "" lineno_width = len(str(end_line)) max_line_len = max(len(line) for line in s_lines) lead = " " * (lineno_width + 1) if max_line_len >= 99: header0 = ( lead + "".join( "{}{}".format(" " * 99, (i + 1) % 100) for i in range(max(max_line_len // 100, 1)) ) + "\n" ) else: header0 = "" header1 = ( header0 + lead + "".join( " {}".format((i + 1) % 10) for i in range(-(-max_line_len // 10)) ) + "\n" ) header2 = lead + "1234567890" * (-(-max_line_len // 10)) + "\n" return ( header1 + header2 + "\n".join( "{:{}d}:{}{}".format(i, lineno_width, line, eol_mark) for i, line in enumerate(s_lines, start=start_line) ) + "\n" ) PK!J##_vendor/pyparsing/__init__.pynu[# module pyparsing.py # # Copyright (c) 2003-2022 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __doc__ = """ pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form ``", !"``), built up using :class:`Word`, :class:`Literal`, and :class:`And` elements (the :meth:`'+'` operators create :class:`And` expressions, and the strings are auto-converted to :class:`Literal` expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print(hello, "->", greet.parse_string(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of :class:`'+'`, :class:`'|'`, :class:`'^'` and :class:`'&'` operators. The :class:`ParseResults` object returned from :class:`ParserElement.parseString` can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes :class:`ParserElement` and :class:`ParseResults` to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from :class:`Literal` and :class:`CaselessLiteral` classes - construct character word-group expressions using the :class:`Word` class - see how to create repetitive expressions using :class:`ZeroOrMore` and :class:`OneOrMore` classes - use :class:`'+'`, :class:`'|'`, :class:`'^'`, and :class:`'&'` operators to combine simple expressions into more complex ones - associate names with your parsed results using :class:`ParserElement.setResultsName` - access the parsed data, which is returned as a :class:`ParseResults` object - find some helpful expression short-cuts like :class:`delimitedList` and :class:`oneOf` - find more useful common expressions in the :class:`pyparsing_common` namespace class """ from typing import NamedTuple class version_info(NamedTuple): major: int minor: int micro: int releaselevel: str serial: int @property def __version__(self): return ( "{}.{}.{}".format(self.major, self.minor, self.micro) + ( "{}{}{}".format( "r" if self.releaselevel[0] == "c" else "", self.releaselevel[0], self.serial, ), "", )[self.releaselevel == "final"] ) def __str__(self): return "{} {} / {}".format(__name__, self.__version__, __version_time__) def __repr__(self): return "{}.{}({})".format( __name__, type(self).__name__, ", ".join("{}={!r}".format(*nv) for nv in zip(self._fields, self)), ) __version_info__ = version_info(3, 0, 9, "final", 0) __version_time__ = "05 May 2022 07:02 UTC" __version__ = __version_info__.__version__ __versionTime__ = __version_time__ __author__ = "Paul McGuire " from .util import * from .exceptions import * from .actions import * from .core import __diag__, __compat__ from .results import * from .core import * from .core import _builtin_exprs as core_builtin_exprs from .helpers import * from .helpers import _builtin_exprs as helper_builtin_exprs from .unicode import unicode_set, UnicodeRangeList, pyparsing_unicode as unicode from .testing import pyparsing_test as testing from .common import ( pyparsing_common as common, _builtin_exprs as common_builtin_exprs, ) # define backward compat synonyms if "pyparsing_unicode" not in globals(): pyparsing_unicode = unicode if "pyparsing_common" not in globals(): pyparsing_common = common if "pyparsing_test" not in globals(): pyparsing_test = testing core_builtin_exprs += common_builtin_exprs + helper_builtin_exprs __all__ = [ "__version__", "__version_time__", "__author__", "__compat__", "__diag__", "And", "AtLineStart", "AtStringStart", "CaselessKeyword", "CaselessLiteral", "CharsNotIn", "Combine", "Dict", "Each", "Empty", "FollowedBy", "Forward", "GoToColumn", "Group", "IndentedBlock", "Keyword", "LineEnd", "LineStart", "Literal", "Located", "PrecededBy", "MatchFirst", "NoMatch", "NotAny", "OneOrMore", "OnlyOnce", "OpAssoc", "Opt", "Optional", "Or", "ParseBaseException", "ParseElementEnhance", "ParseException", "ParseExpression", "ParseFatalException", "ParseResults", "ParseSyntaxException", "ParserElement", "PositionToken", "QuotedString", "RecursiveGrammarException", "Regex", "SkipTo", "StringEnd", "StringStart", "Suppress", "Token", "TokenConverter", "White", "Word", "WordEnd", "WordStart", "ZeroOrMore", "Char", "alphanums", "alphas", "alphas8bit", "any_close_tag", "any_open_tag", "c_style_comment", "col", "common_html_entity", "counted_array", "cpp_style_comment", "dbl_quoted_string", "dbl_slash_comment", "delimited_list", "dict_of", "empty", "hexnums", "html_comment", "identchars", "identbodychars", "java_style_comment", "line", "line_end", "line_start", "lineno", "make_html_tags", "make_xml_tags", "match_only_at_col", "match_previous_expr", "match_previous_literal", "nested_expr", "null_debug_action", "nums", "one_of", "printables", "punc8bit", "python_style_comment", "quoted_string", "remove_quotes", "replace_with", "replace_html_entity", "rest_of_line", "sgl_quoted_string", "srange", "string_end", "string_start", "trace_parse_action", "unicode_string", "with_attribute", "indentedBlock", "original_text_for", "ungroup", "infix_notation", "locatedExpr", "with_class", "CloseMatch", "token_map", "pyparsing_common", "pyparsing_unicode", "unicode_set", "condition_as_parse_action", "pyparsing_test", # pre-PEP8 compatibility names "__versionTime__", "anyCloseTag", "anyOpenTag", "cStyleComment", "commonHTMLEntity", "countedArray", "cppStyleComment", "dblQuotedString", "dblSlashComment", "delimitedList", "dictOf", "htmlComment", "javaStyleComment", "lineEnd", "lineStart", "makeHTMLTags", "makeXMLTags", "matchOnlyAtCol", "matchPreviousExpr", "matchPreviousLiteral", "nestedExpr", "nullDebugAction", "oneOf", "opAssoc", "pythonStyleComment", "quotedString", "removeQuotes", "replaceHTMLEntity", "replaceWith", "restOfLine", "sglQuotedString", "stringEnd", "stringStart", "traceParseAction", "unicodeString", "withAttribute", "indentedBlock", "originalTextFor", "infixNotation", "locatedExpr", "withClass", "tokenMap", "conditionAsParseAction", "autoname_elements", ] PK!H*%mm>_vendor/pyparsing/diagram/__pycache__/__init__.cpython-311.pycnu[ ,Ret\ddlZddlZddlZddlmZmZmZmZmZmZm Z m Z ddl m Z ddl mZddlZdZe eZeddefdejejfd efgZ ed ZGd d ejZGd dejZGddeeZdeedefdZdddefdZ d-dejdejedede de deef dZ!ded e ejde fd!Z"Gd"d#Z#Gd$d%Z$dejde fd&Z%d'Z&d e ejfd(Z'e& d.dejd)ejed*e$ded ed+ede de dejefd,Z(dS)/N)List NamedTupleGenericTypeVarDictCallableSetIterable)Template)StringIOaM {% if not head %} {% else %} {{ head | safe }} {% endif %} {{ body | safe }} {% for diagram in diagrams %}

{{ diagram.title }}

{{ diagram.text }}
{{ diagram.svg }}
{% endfor %} NamedDiagramnamediagramindexTc&eZdZdZdZfdZxZS)EachItemz Custom railroad item to compose a: - Group containing a - OneOrMore containing a - Choice of the elements in the Each with the group label indicating that all must be matched z[ALL]ctjt|dz g|R}tj|}t ||jdS)Nitem)label)railroadChoicelen OneOrMoresuper__init__ all_label)selfitems choice_itemone_or_more_item __class__s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_vendor/pyparsing/diagram/__init__.pyrzEachItem.__init__Is^oc%jj1n=u=== #-;??? )@@@@@)__name__ __module__ __qualname____doc__rr __classcell__r$s@r%rr>sRIAAAAAAAAAr&rc(eZdZdZdeffd ZxZS) AnnotatedItemzC Simple subclass of Group that creates an annotation label rc|t||rd|n|dS)Nz[{}]rr)rrformat)r rrr$s r%rzAnnotatedItem.__init__Ts< d%*R&--*>*>*>USSSSSr&)r'r(r)r*strrr+r,s@r%r.r.OsYTcTTTTTTTTTTr&r.ceZdZdZdedefdedefdZe dedefddfd Z e d Z defd Z d S) EditablePartialz Acts like a functools.partial, but can be edited. In other words, it represents a type that hasn't yet been constructed. func.argskwargsc0||_||_||_dSNr5r6r7)r r5r6r7s r%rzEditablePartial.__init__as   r&returnEditablePartial[T]c@t|t||S)z If you call this function in the same way that you would call the constructor, it will store the arguments as you expect. For example EditablePartial.from_call(Fraction, 1, 3)() == Fraction(1, 3) r:)r4list)clsr5r6r7s r% from_callzEditablePartial.from_callfs DtDzz&IIIIr&c|jdS)Nr)r7r s r%rzEditablePartial.namens{6""r&c|j}|j}tj|j}|j|jvr|||jz }|j|i|S)z< Evaluate the partial and return the result )r6copyr7inspectgetfullargspecr5varargspop)r r6r7arg_specs r%__call__zEditablePartial.__call__rs|y~~!!##)$)44  t{ * * FJJx/00 0Dty$)&)))r&N)r'r(r)r*rrr>dictr classmethodr@propertyrrJr&r%r4r4XsXc1f-T4 JXc1f-JCWJJJ[J##X# *! * * * * * *r&r4diagramsr;c $g}|D]y}|j t}|j|j|j}|jdkr|dz }||d|dztj dd|i|S)z Given a list of NamedDiagram, produce a single HTML string that visualises those diagrams :params kwargs: kwargs to be passed in to the template Nrz (root))titletextsvgrOrN) rr writeSvgwriterrappendgetvaluetemplaterender)rOr7datariorRs r%railroad_to_htmlr]s DHH ? "  ZZ  ***  =A   Y E eR FFGGGG ? 3 3D 3F 3 33r&partialr<cPt|trz#resolve_partial..s 444q""444r&c4i|]\}}|t|SrNra)rckeyrds r% z#resolve_partial..s&FFFFC_Q''FFFr&) isinstancer4rbr6r7r>rKr!)r^s r%rbrbs'?++ &w|44 (88wyy GT " "44G4444 GT " "FFgmmooFFFFr&Felementdiagram_kwargsverticalshow_results_names show_groupscbt|pi}t||d|||t|}||vr2|js d||_||||dt |j}t|dkrmt}g} |D]M} | jdkr| j8| j|vr/| | j| | Nd | D} n d |D} t| d S) a Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram creation if you want to access the Railroad tree before it is converted to HTML :param element: base element of the parser being diagrammed :param diagram_kwargs: kwargs to pass to the Diagram() constructor :param vertical: (optional) - int - limit at which number of alternatives should be shown vertically instead of horizontally :param show_results_names - bool to indicate whether results name annotations should be included in the diagram :param show_groups - bool to indicate whether groups should be highlighted with an unlabeled surrounding box )rlN)lookupparentrmrnrorQT)forcerz...c,g|]}t|SrNrarcr^s r%rezto_railroad..s JJJOG,,JJJr&c,g|]}t|SrNrarus r%rezto_railroad..s BBBOG,,BBBr&c|jSr9r)diags r%zto_railroad..sTZr&)rg)ConverterState_to_diagram_elementid customNamermark_for_extractionr>rOvaluesrsetaddrWsorted) rkrlrmrnrorqroot_iddiagsseen deduped_diagsdresolveds r% to_railroadrsf(>+?R @ @ @F- kkG&! &#%F7O w++GV4+HHH '')) * *E 5zzA~~uu  ( (Avv!afD&8&8   $$Q'''JJMJJJCBEBBB ( 7 7 8 8 88r& specificationexprscJ|dStt||kS)zF Returns true if we should return a vertical list of elements NF)r_visible_exprs)rrs r%_should_verticalrs* u>%(())]::r&cteZdZdZ ddejdedededede j ef d Z dd ed d dede fdZ dS) ElementStatez< State recorded for an individual pyparsing Element Nrk convertedrrnumberr parent_indexcv||_||_||_||_||_||_d|_d|_dSNF)rkrrrrrrextractcomplete)r rkrrrrrrs r%rzElementState.__init__sA18 *. *3'- ! 2>" # r&Fel_idstater{rscd|_|js/|r||_n%|jjr|jj|_nd|_|s|jr+t |jr||dSdSdS)a Called when this instance has been seen twice, and thus should eventually be extracted into a sub-diagram :param el_id: id of the element :param state: element/diagram state tracker :param name: name to use for this element's text :param force: If true, force extraction now, regardless of the state of this. Only useful for extracting the root element when we know we're finished TrQN)rrrkr~r_worth_extractingextract_into_diagram)r rrrrss r%rz ElementState.mark_for_extraction s y    (  L3   .T] .'8'F'F .  & &u - - - - - . . . .r&)NNr)r'r(r)r* pyparsing ParserElementr4intr2typingOptionalrboolrrNr&r%rrs-1$$($#$ $  $  $oc*$$$$6TY...!1.9<.LP......r&rceZdZdZddejefdZdede fdZ dede fd Z defd Z defd Z defd Zdefd ZdefdZdS)r{zR Stores some state that persists between recursions into the element tree Nrlcvi|_i|_d|_d|_|pi|_t |_dS)Nrr)_element_diagram_statesrO unnamed_indexrrlrextracted_diagram_names)r rls r%rzConverterState.__init__.s?@B$BD "# $2$8b14$$$r&rgvaluec||j|<dSr9r)r rgrs r% __setitem__zConverterState.__setitem__;s,1$S)))r&r;c|j|Sr9rr rgs r% __getitem__zConverterState.__getitem__>s+C00r&c|j|=dSr9rrs r% __delitem__zConverterState.__delitem__As  ( - - -r&c||jvSr9rrs r% __contains__zConverterState.__contains__Dsd222r&c0|xjdz c_|jS)zT Generate a number used in the name of an otherwise unnamed diagram r)rrBs r%generate_unnamedzConverterState.generate_unnamedGs! a!!r&c0|xjdz c_|jS)z; Generate a number used to index a diagram rrxrBs r%generate_indexzConverterState.generate_indexNs a zr&rc ||}|jrqttj|j}d|jjvr||jjd<n(d|jjvr||jjd|j<|jj tj kr|jjd}n|j}tt|jtjtj |fi|j |j|j|<||=dS)z Used when we encounter the same token twice in the same tree. When this happens, we replace all instances of that token with a terminal, and create a new subdiagram for the token rSrr!)rrrN)rrr4r@r NonTerminalrr7rrr5Groupr DiagramrlrrO)r rpositionretcontents r%rz#ConverterState.extract_into_diagramUs ; ? M!++H,@x}+UUC///14&v..HO222IL&w/0EF   "hn 4 4(/7GG(G.88 #- '-1-@/ 9   e KKKr&r9)r'r(r)r*rrrKrrrrrrrrrrrNr&r%r{r{)s 7 7vt'< 7 7 7 72s2<22221s1|1111.s....33333"#""""#r&r{c\|}td|DS)z Returns true if this element is worth having its own sub-diagram. Simply, if any of its children themselves have children, then its complex enough to extract c3>K|]}|VdSr9)recurse)rcchilds r% z$_worth_extracting..}s*555u}}555555r&)rany)rkchildrens r%rrws0   H 55H555 5 55r&c ddtjdtjtdt dt dt d td td td tjtffd }|S)z decorator to ensure enhancements to a diagram item (such as results name annotations) get applied on return from _to_diagram_element (we do this since there are several returns in _to_diagram_element) NrFrkrrrqrmr name_hintrnror;c  ||||||||}|r@|>|j} | r5| |jrdndz } ttj|| }|S)NrQ*r0) resultsName modalResultsr4r@rr) rkrrrqrmrrrnrorelement_results_namefns r%_innerz0_apply_diagram_item_enhancements.._innersb             #/#*#6 # $g.B(KK$%//N4H0 r&NNrNFF) rrrrr4r{rr2r)rrs` r% _apply_diagram_item_enhancementsrs"&#(!  ( 0       !    )      D Mr&cptjtjtjjffd|DS)NcPg|]"}|j |jt| |#SrN)r~rri)rcenon_diagramming_exprss r%rez"_visible_exprs..sR      !"  2ttj|j| jd}|St |tjr|sdSt+t-d|DdkrCttjd t1t+| }nt3||r(ttjg }nHttjg }n t |tjtjfre|sdSt3||r)ttjdg }nttjg }nt |tj r'|sdSttBg }nTt |tj"r$ttFd d }nt |tj$r$ttFdd }nt |tj%r$ttFdd }nt |tj&rO|r$ttFd d }nZttj&d d }n1t |tj'rHttFtQ|j)d }nt |tj*r(ttj+d }nt |tjr(ttjd }nKt |tj,r(ttj,d }n t |tj&r(ttj&d| }nt |tj-r |jsd}nt+|dkr'ttjg }nit+|dkr*| s(ttj&d | }n,ttj.|j/}|}|dSta|||||1|| <|jr"||  | ||jd}|D]}d|jvr!|jd2|dt|||||||}|3d|jvr ||jd<Xd|jvr||jd|<|dz }wd|jvr|jd|=|rbd|jvrt+|jddksd|jvr2|jd%ttj.| }| |vr d|| _3| |vrm|| j4r`|| j3rS|5| |.s+::qAFAM*::::::r&rrQ)rrepeat)r!NOT)rr LOOKAHEAD LOOKBEHINDrr0)rkrrrrrr!)rrrqrmrrnrorT)6rr~r$r'r}rrirLocatedr|exprrrr4r@rrrrOr7rrrrr2rStackSequenceOr MatchFirstrHorizontalChoiceEachrNotAnyr. FollowedBy PrecededByrTokenConvertertypelowerOptr ZeroOrMoreEmptyTerminal defaultNamerrinsertrrr)rkrrrqrmrrrnrorrrrpropagated_name looked_uprterminalirrs r%r|r|s0 OO  E  H* Hg.?.HD wKKE".    !     Qx*+&*OO&*O*L!!%-'9 +    !! F??u I  ) )%i ) H H H!++H,@y~+VVCJ fo % %"++$6?5+A+H+P,CJ '9=)): 4 s::E::::: ; ;q @ @!++"CE OO,CCh . . I!++HN"+EECC!++H,=R+HHCC GilI,@A B B- 4 He , , Q!++HOQb+IICC!++H,ER+PPCC GY^ , ,& 4''';; GY- . ."'' U'LL GY1 2 2 '' [r'RR GY1 2 2'' \PR'SS GY_ - -  O!++M"+MMCC!++HN"2+NNCC GY5 6 6'' g!7!=!=!?!?b(   GY] + +''(9'CC GY0 1 1''(:'DD GY1 2 2''(;"'EE GY_ - - '' N-A(   GY_ - - g6H  Ua''(9'DD Ua 4''Rt'LL",,X->@STT {!$$&& F5MMu ))%9KLLL A'' cj Jw  & &q$ / / /" 1#     ##%) 6""CJ&&)- 7#A&Q  " " 7#A& A CJ  3sz'':#;#;q#@#@ cj SZ%7%?''(94@@ !%u  6%=0VE]5K##E*** ?!++$6?5+A+H+P,C Jr&)NrjFFr))rrrrrrrrrr r jinja2r r\r rEjinja2_template_sourcerYr2r DiagramItemrr rrrr.r4r]rbrrKrrrrr{rrrr|rNr&r%rs                      : 8* + +z c]Y0D EFRUW  GCLLAAAAAx~AAA"TTTTTHNTTT'*'*'*'*'*gaj'*'*'*T4tL144444& 1 a    $-1$ 7979  $79OD)7979 79  79  , 79797979t ; ;' (?@ ;  ; ; ; ;;.;.;.;.;.;.;.;.|KKKKKKKK\6y6646666)))X (9#:;    ""$HH  $H OO ,H H H  H  HHH __%HHH"!HHHr&PK!-2Ut\t\%_vendor/pyparsing/diagram/__init__.pynu[import railroad import pyparsing import typing from typing import ( List, NamedTuple, Generic, TypeVar, Dict, Callable, Set, Iterable, ) from jinja2 import Template from io import StringIO import inspect jinja2_template_source = """\ {% if not head %} {% else %} {{ head | safe }} {% endif %} {{ body | safe }} {% for diagram in diagrams %}

{{ diagram.title }}

{{ diagram.text }}
{{ diagram.svg }}
{% endfor %} """ template = Template(jinja2_template_source) # Note: ideally this would be a dataclass, but we're supporting Python 3.5+ so we can't do this yet NamedDiagram = NamedTuple( "NamedDiagram", [("name", str), ("diagram", typing.Optional[railroad.DiagramItem]), ("index", int)], ) """ A simple structure for associating a name with a railroad diagram """ T = TypeVar("T") class EachItem(railroad.Group): """ Custom railroad item to compose a: - Group containing a - OneOrMore containing a - Choice of the elements in the Each with the group label indicating that all must be matched """ all_label = "[ALL]" def __init__(self, *items): choice_item = railroad.Choice(len(items) - 1, *items) one_or_more_item = railroad.OneOrMore(item=choice_item) super().__init__(one_or_more_item, label=self.all_label) class AnnotatedItem(railroad.Group): """ Simple subclass of Group that creates an annotation label """ def __init__(self, label: str, item): super().__init__(item=item, label="[{}]".format(label) if label else label) class EditablePartial(Generic[T]): """ Acts like a functools.partial, but can be edited. In other words, it represents a type that hasn't yet been constructed. """ # We need this here because the railroad constructors actually transform the data, so can't be called until the # entire tree is assembled def __init__(self, func: Callable[..., T], args: list, kwargs: dict): self.func = func self.args = args self.kwargs = kwargs @classmethod def from_call(cls, func: Callable[..., T], *args, **kwargs) -> "EditablePartial[T]": """ If you call this function in the same way that you would call the constructor, it will store the arguments as you expect. For example EditablePartial.from_call(Fraction, 1, 3)() == Fraction(1, 3) """ return EditablePartial(func=func, args=list(args), kwargs=kwargs) @property def name(self): return self.kwargs["name"] def __call__(self) -> T: """ Evaluate the partial and return the result """ args = self.args.copy() kwargs = self.kwargs.copy() # This is a helpful hack to allow you to specify varargs parameters (e.g. *args) as keyword args (e.g. # args=['list', 'of', 'things']) arg_spec = inspect.getfullargspec(self.func) if arg_spec.varargs in self.kwargs: args += kwargs.pop(arg_spec.varargs) return self.func(*args, **kwargs) def railroad_to_html(diagrams: List[NamedDiagram], **kwargs) -> str: """ Given a list of NamedDiagram, produce a single HTML string that visualises those diagrams :params kwargs: kwargs to be passed in to the template """ data = [] for diagram in diagrams: if diagram.diagram is None: continue io = StringIO() diagram.diagram.writeSvg(io.write) title = diagram.name if diagram.index == 0: title += " (root)" data.append({"title": title, "text": "", "svg": io.getvalue()}) return template.render(diagrams=data, **kwargs) def resolve_partial(partial: "EditablePartial[T]") -> T: """ Recursively resolves a collection of Partials into whatever type they are """ if isinstance(partial, EditablePartial): partial.args = resolve_partial(partial.args) partial.kwargs = resolve_partial(partial.kwargs) return partial() elif isinstance(partial, list): return [resolve_partial(x) for x in partial] elif isinstance(partial, dict): return {key: resolve_partial(x) for key, x in partial.items()} else: return partial def to_railroad( element: pyparsing.ParserElement, diagram_kwargs: typing.Optional[dict] = None, vertical: int = 3, show_results_names: bool = False, show_groups: bool = False, ) -> List[NamedDiagram]: """ Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram creation if you want to access the Railroad tree before it is converted to HTML :param element: base element of the parser being diagrammed :param diagram_kwargs: kwargs to pass to the Diagram() constructor :param vertical: (optional) - int - limit at which number of alternatives should be shown vertically instead of horizontally :param show_results_names - bool to indicate whether results name annotations should be included in the diagram :param show_groups - bool to indicate whether groups should be highlighted with an unlabeled surrounding box """ # Convert the whole tree underneath the root lookup = ConverterState(diagram_kwargs=diagram_kwargs or {}) _to_diagram_element( element, lookup=lookup, parent=None, vertical=vertical, show_results_names=show_results_names, show_groups=show_groups, ) root_id = id(element) # Convert the root if it hasn't been already if root_id in lookup: if not element.customName: lookup[root_id].name = "" lookup[root_id].mark_for_extraction(root_id, lookup, force=True) # Now that we're finished, we can convert from intermediate structures into Railroad elements diags = list(lookup.diagrams.values()) if len(diags) > 1: # collapse out duplicate diags with the same name seen = set() deduped_diags = [] for d in diags: # don't extract SkipTo elements, they are uninformative as subdiagrams if d.name == "...": continue if d.name is not None and d.name not in seen: seen.add(d.name) deduped_diags.append(d) resolved = [resolve_partial(partial) for partial in deduped_diags] else: # special case - if just one diagram, always display it, even if # it has no name resolved = [resolve_partial(partial) for partial in diags] return sorted(resolved, key=lambda diag: diag.index) def _should_vertical( specification: int, exprs: Iterable[pyparsing.ParserElement] ) -> bool: """ Returns true if we should return a vertical list of elements """ if specification is None: return False else: return len(_visible_exprs(exprs)) >= specification class ElementState: """ State recorded for an individual pyparsing Element """ # Note: this should be a dataclass, but we have to support Python 3.5 def __init__( self, element: pyparsing.ParserElement, converted: EditablePartial, parent: EditablePartial, number: int, name: str = None, parent_index: typing.Optional[int] = None, ): #: The pyparsing element that this represents self.element: pyparsing.ParserElement = element #: The name of the element self.name: typing.Optional[str] = name #: The output Railroad element in an unconverted state self.converted: EditablePartial = converted #: The parent Railroad element, which we store so that we can extract this if it's duplicated self.parent: EditablePartial = parent #: The order in which we found this element, used for sorting diagrams if this is extracted into a diagram self.number: int = number #: The index of this inside its parent self.parent_index: typing.Optional[int] = parent_index #: If true, we should extract this out into a subdiagram self.extract: bool = False #: If true, all of this element's children have been filled out self.complete: bool = False def mark_for_extraction( self, el_id: int, state: "ConverterState", name: str = None, force: bool = False ): """ Called when this instance has been seen twice, and thus should eventually be extracted into a sub-diagram :param el_id: id of the element :param state: element/diagram state tracker :param name: name to use for this element's text :param force: If true, force extraction now, regardless of the state of this. Only useful for extracting the root element when we know we're finished """ self.extract = True # Set the name if not self.name: if name: # Allow forcing a custom name self.name = name elif self.element.customName: self.name = self.element.customName else: self.name = "" # Just because this is marked for extraction doesn't mean we can do it yet. We may have to wait for children # to be added # Also, if this is just a string literal etc, don't bother extracting it if force or (self.complete and _worth_extracting(self.element)): state.extract_into_diagram(el_id) class ConverterState: """ Stores some state that persists between recursions into the element tree """ def __init__(self, diagram_kwargs: typing.Optional[dict] = None): #: A dictionary mapping ParserElements to state relating to them self._element_diagram_states: Dict[int, ElementState] = {} #: A dictionary mapping ParserElement IDs to subdiagrams generated from them self.diagrams: Dict[int, EditablePartial[NamedDiagram]] = {} #: The index of the next unnamed element self.unnamed_index: int = 1 #: The index of the next element. This is used for sorting self.index: int = 0 #: Shared kwargs that are used to customize the construction of diagrams self.diagram_kwargs: dict = diagram_kwargs or {} self.extracted_diagram_names: Set[str] = set() def __setitem__(self, key: int, value: ElementState): self._element_diagram_states[key] = value def __getitem__(self, key: int) -> ElementState: return self._element_diagram_states[key] def __delitem__(self, key: int): del self._element_diagram_states[key] def __contains__(self, key: int): return key in self._element_diagram_states def generate_unnamed(self) -> int: """ Generate a number used in the name of an otherwise unnamed diagram """ self.unnamed_index += 1 return self.unnamed_index def generate_index(self) -> int: """ Generate a number used to index a diagram """ self.index += 1 return self.index def extract_into_diagram(self, el_id: int): """ Used when we encounter the same token twice in the same tree. When this happens, we replace all instances of that token with a terminal, and create a new subdiagram for the token """ position = self[el_id] # Replace the original definition of this element with a regular block if position.parent: ret = EditablePartial.from_call(railroad.NonTerminal, text=position.name) if "item" in position.parent.kwargs: position.parent.kwargs["item"] = ret elif "items" in position.parent.kwargs: position.parent.kwargs["items"][position.parent_index] = ret # If the element we're extracting is a group, skip to its content but keep the title if position.converted.func == railroad.Group: content = position.converted.kwargs["item"] else: content = position.converted self.diagrams[el_id] = EditablePartial.from_call( NamedDiagram, name=position.name, diagram=EditablePartial.from_call( railroad.Diagram, content, **self.diagram_kwargs ), index=position.number, ) del self[el_id] def _worth_extracting(element: pyparsing.ParserElement) -> bool: """ Returns true if this element is worth having its own sub-diagram. Simply, if any of its children themselves have children, then its complex enough to extract """ children = element.recurse() return any(child.recurse() for child in children) def _apply_diagram_item_enhancements(fn): """ decorator to ensure enhancements to a diagram item (such as results name annotations) get applied on return from _to_diagram_element (we do this since there are several returns in _to_diagram_element) """ def _inner( element: pyparsing.ParserElement, parent: typing.Optional[EditablePartial], lookup: ConverterState = None, vertical: int = None, index: int = 0, name_hint: str = None, show_results_names: bool = False, show_groups: bool = False, ) -> typing.Optional[EditablePartial]: ret = fn( element, parent, lookup, vertical, index, name_hint, show_results_names, show_groups, ) # apply annotation for results name, if present if show_results_names and ret is not None: element_results_name = element.resultsName if element_results_name: # add "*" to indicate if this is a "list all results" name element_results_name += "" if element.modalResults else "*" ret = EditablePartial.from_call( railroad.Group, item=ret, label=element_results_name ) return ret return _inner def _visible_exprs(exprs: Iterable[pyparsing.ParserElement]): non_diagramming_exprs = ( pyparsing.ParseElementEnhance, pyparsing.PositionToken, pyparsing.And._ErrorStop, ) return [ e for e in exprs if not (e.customName or e.resultsName or isinstance(e, non_diagramming_exprs)) ] @_apply_diagram_item_enhancements def _to_diagram_element( element: pyparsing.ParserElement, parent: typing.Optional[EditablePartial], lookup: ConverterState = None, vertical: int = None, index: int = 0, name_hint: str = None, show_results_names: bool = False, show_groups: bool = False, ) -> typing.Optional[EditablePartial]: """ Recursively converts a PyParsing Element to a railroad Element :param lookup: The shared converter state that keeps track of useful things :param index: The index of this element within the parent :param parent: The parent of this element in the output tree :param vertical: Controls at what point we make a list of elements vertical. If this is an integer (the default), it sets the threshold of the number of items before we go vertical. If True, always go vertical, if False, never do so :param name_hint: If provided, this will override the generated name :param show_results_names: bool flag indicating whether to add annotations for results names :returns: The converted version of the input element, but as a Partial that hasn't yet been constructed :param show_groups: bool flag indicating whether to show groups using bounding box """ exprs = element.recurse() name = name_hint or element.customName or element.__class__.__name__ # Python's id() is used to provide a unique identifier for elements el_id = id(element) element_results_name = element.resultsName # Here we basically bypass processing certain wrapper elements if they contribute nothing to the diagram if not element.customName: if isinstance( element, ( # pyparsing.TokenConverter, # pyparsing.Forward, pyparsing.Located, ), ): # However, if this element has a useful custom name, and its child does not, we can pass it on to the child if exprs: if not exprs[0].customName: propagated_name = name else: propagated_name = None return _to_diagram_element( element.expr, parent=parent, lookup=lookup, vertical=vertical, index=index, name_hint=propagated_name, show_results_names=show_results_names, show_groups=show_groups, ) # If the element isn't worth extracting, we always treat it as the first time we say it if _worth_extracting(element): if el_id in lookup: # If we've seen this element exactly once before, we are only just now finding out that it's a duplicate, # so we have to extract it into a new diagram. looked_up = lookup[el_id] looked_up.mark_for_extraction(el_id, lookup, name=name_hint) ret = EditablePartial.from_call(railroad.NonTerminal, text=looked_up.name) return ret elif el_id in lookup.diagrams: # If we have seen the element at least twice before, and have already extracted it into a subdiagram, we # just put in a marker element that refers to the sub-diagram ret = EditablePartial.from_call( railroad.NonTerminal, text=lookup.diagrams[el_id].kwargs["name"] ) return ret # Recursively convert child elements # Here we find the most relevant Railroad element for matching pyparsing Element # We use ``items=[]`` here to hold the place for where the child elements will go once created if isinstance(element, pyparsing.And): # detect And's created with ``expr*N`` notation - for these use a OneOrMore with a repeat # (all will have the same name, and resultsName) if not exprs: return None if len(set((e.name, e.resultsName) for e in exprs)) == 1: ret = EditablePartial.from_call( railroad.OneOrMore, item="", repeat=str(len(exprs)) ) elif _should_vertical(vertical, exprs): ret = EditablePartial.from_call(railroad.Stack, items=[]) else: ret = EditablePartial.from_call(railroad.Sequence, items=[]) elif isinstance(element, (pyparsing.Or, pyparsing.MatchFirst)): if not exprs: return None if _should_vertical(vertical, exprs): ret = EditablePartial.from_call(railroad.Choice, 0, items=[]) else: ret = EditablePartial.from_call(railroad.HorizontalChoice, items=[]) elif isinstance(element, pyparsing.Each): if not exprs: return None ret = EditablePartial.from_call(EachItem, items=[]) elif isinstance(element, pyparsing.NotAny): ret = EditablePartial.from_call(AnnotatedItem, label="NOT", item="") elif isinstance(element, pyparsing.FollowedBy): ret = EditablePartial.from_call(AnnotatedItem, label="LOOKAHEAD", item="") elif isinstance(element, pyparsing.PrecededBy): ret = EditablePartial.from_call(AnnotatedItem, label="LOOKBEHIND", item="") elif isinstance(element, pyparsing.Group): if show_groups: ret = EditablePartial.from_call(AnnotatedItem, label="", item="") else: ret = EditablePartial.from_call(railroad.Group, label="", item="") elif isinstance(element, pyparsing.TokenConverter): ret = EditablePartial.from_call( AnnotatedItem, label=type(element).__name__.lower(), item="" ) elif isinstance(element, pyparsing.Opt): ret = EditablePartial.from_call(railroad.Optional, item="") elif isinstance(element, pyparsing.OneOrMore): ret = EditablePartial.from_call(railroad.OneOrMore, item="") elif isinstance(element, pyparsing.ZeroOrMore): ret = EditablePartial.from_call(railroad.ZeroOrMore, item="") elif isinstance(element, pyparsing.Group): ret = EditablePartial.from_call( railroad.Group, item=None, label=element_results_name ) elif isinstance(element, pyparsing.Empty) and not element.customName: # Skip unnamed "Empty" elements ret = None elif len(exprs) > 1: ret = EditablePartial.from_call(railroad.Sequence, items=[]) elif len(exprs) > 0 and not element_results_name: ret = EditablePartial.from_call(railroad.Group, item="", label=name) else: terminal = EditablePartial.from_call(railroad.Terminal, element.defaultName) ret = terminal if ret is None: return # Indicate this element's position in the tree so we can extract it if necessary lookup[el_id] = ElementState( element=element, converted=ret, parent=parent, parent_index=index, number=lookup.generate_index(), ) if element.customName: lookup[el_id].mark_for_extraction(el_id, lookup, element.customName) i = 0 for expr in exprs: # Add a placeholder index in case we have to extract the child before we even add it to the parent if "items" in ret.kwargs: ret.kwargs["items"].insert(i, None) item = _to_diagram_element( expr, parent=ret, lookup=lookup, vertical=vertical, index=i, show_results_names=show_results_names, show_groups=show_groups, ) # Some elements don't need to be shown in the diagram if item is not None: if "item" in ret.kwargs: ret.kwargs["item"] = item elif "items" in ret.kwargs: # If we've already extracted the child, don't touch this index, since it's occupied by a nonterminal ret.kwargs["items"][i] = item i += 1 elif "items" in ret.kwargs: # If we're supposed to skip this element, remove it from the parent del ret.kwargs["items"][i] # If all this items children are none, skip this item if ret and ( ("items" in ret.kwargs and len(ret.kwargs["items"]) == 0) or ("item" in ret.kwargs and ret.kwargs["item"] is None) ): ret = EditablePartial.from_call(railroad.Terminal, name) # Mark this element as "complete", ie it has all of its children if el_id in lookup: lookup[el_id].complete = True if el_id in lookup and lookup[el_id].extract and lookup[el_id].complete: lookup.extract_into_diagram(el_id) if ret is not None: ret = EditablePartial.from_call( railroad.NonTerminal, text=lookup.diagrams[el_id].kwargs["name"] ) return ret PK!Bq8 _vendor/zipp.pynu[import io import posixpath import zipfile import itertools import contextlib import sys import pathlib if sys.version_info < (3, 7): from collections import OrderedDict else: OrderedDict = dict __all__ = ['Path'] def _parents(path): """ Given a path with elements separated by posixpath.sep, generate all parents of that path. >>> list(_parents('b/d')) ['b'] >>> list(_parents('/b/d/')) ['/b'] >>> list(_parents('b/d/f/')) ['b/d', 'b'] >>> list(_parents('b')) [] >>> list(_parents('')) [] """ return itertools.islice(_ancestry(path), 1, None) def _ancestry(path): """ Given a path with elements separated by posixpath.sep, generate all elements of that path >>> list(_ancestry('b/d')) ['b/d', 'b'] >>> list(_ancestry('/b/d/')) ['/b/d', '/b'] >>> list(_ancestry('b/d/f/')) ['b/d/f', 'b/d', 'b'] >>> list(_ancestry('b')) ['b'] >>> list(_ancestry('')) [] """ path = path.rstrip(posixpath.sep) while path and path != posixpath.sep: yield path path, tail = posixpath.split(path) _dedupe = OrderedDict.fromkeys """Deduplicate an iterable in original order""" def _difference(minuend, subtrahend): """ Return items in minuend not in subtrahend, retaining order with O(1) lookup. """ return itertools.filterfalse(set(subtrahend).__contains__, minuend) class CompleteDirs(zipfile.ZipFile): """ A ZipFile subclass that ensures that implied directories are always included in the namelist. """ @staticmethod def _implied_dirs(names): parents = itertools.chain.from_iterable(map(_parents, names)) as_dirs = (p + posixpath.sep for p in parents) return _dedupe(_difference(as_dirs, names)) def namelist(self): names = super(CompleteDirs, self).namelist() return names + list(self._implied_dirs(names)) def _name_set(self): return set(self.namelist()) def resolve_dir(self, name): """ If the name represents a directory, return that name as a directory (with the trailing slash). """ names = self._name_set() dirname = name + '/' dir_match = name not in names and dirname in names return dirname if dir_match else name @classmethod def make(cls, source): """ Given a source (filename or zipfile), return an appropriate CompleteDirs subclass. """ if isinstance(source, CompleteDirs): return source if not isinstance(source, zipfile.ZipFile): return cls(_pathlib_compat(source)) # Only allow for FastLookup when supplied zipfile is read-only if 'r' not in source.mode: cls = CompleteDirs source.__class__ = cls return source class FastLookup(CompleteDirs): """ ZipFile subclass to ensure implicit dirs exist and are resolved rapidly. """ def namelist(self): with contextlib.suppress(AttributeError): return self.__names self.__names = super(FastLookup, self).namelist() return self.__names def _name_set(self): with contextlib.suppress(AttributeError): return self.__lookup self.__lookup = super(FastLookup, self)._name_set() return self.__lookup def _pathlib_compat(path): """ For path-like objects, convert to a filename for compatibility on Python 3.6.1 and earlier. """ try: return path.__fspath__() except AttributeError: return str(path) class Path: """ A pathlib-compatible interface for zip files. Consider a zip file with this structure:: . ├── a.txt └── b ├── c.txt └── d └── e.txt >>> data = io.BytesIO() >>> zf = zipfile.ZipFile(data, 'w') >>> zf.writestr('a.txt', 'content of a') >>> zf.writestr('b/c.txt', 'content of c') >>> zf.writestr('b/d/e.txt', 'content of e') >>> zf.filename = 'mem/abcde.zip' Path accepts the zipfile object itself or a filename >>> root = Path(zf) From there, several path operations are available. Directory iteration (including the zip file itself): >>> a, b = root.iterdir() >>> a Path('mem/abcde.zip', 'a.txt') >>> b Path('mem/abcde.zip', 'b/') name property: >>> b.name 'b' join with divide operator: >>> c = b / 'c.txt' >>> c Path('mem/abcde.zip', 'b/c.txt') >>> c.name 'c.txt' Read text: >>> c.read_text() 'content of c' existence: >>> c.exists() True >>> (b / 'missing.txt').exists() False Coercion to string: >>> import os >>> str(c).replace(os.sep, posixpath.sep) 'mem/abcde.zip/b/c.txt' At the root, ``name``, ``filename``, and ``parent`` resolve to the zipfile. Note these attributes are not valid and will raise a ``ValueError`` if the zipfile has no filename. >>> root.name 'abcde.zip' >>> str(root.filename).replace(os.sep, posixpath.sep) 'mem/abcde.zip' >>> str(root.parent) 'mem' """ __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})" def __init__(self, root, at=""): """ Construct a Path from a ZipFile or filename. Note: When the source is an existing ZipFile object, its type (__class__) will be mutated to a specialized type. If the caller wishes to retain the original type, the caller should either create a separate ZipFile object or pass a filename. """ self.root = FastLookup.make(root) self.at = at def open(self, mode='r', *args, pwd=None, **kwargs): """ Open this entry as text or binary following the semantics of ``pathlib.Path.open()`` by passing arguments through to io.TextIOWrapper(). """ if self.is_dir(): raise IsADirectoryError(self) zip_mode = mode[0] if not self.exists() and zip_mode == 'r': raise FileNotFoundError(self) stream = self.root.open(self.at, zip_mode, pwd=pwd) if 'b' in mode: if args or kwargs: raise ValueError("encoding args invalid for binary operation") return stream return io.TextIOWrapper(stream, *args, **kwargs) @property def name(self): return pathlib.Path(self.at).name or self.filename.name @property def suffix(self): return pathlib.Path(self.at).suffix or self.filename.suffix @property def suffixes(self): return pathlib.Path(self.at).suffixes or self.filename.suffixes @property def stem(self): return pathlib.Path(self.at).stem or self.filename.stem @property def filename(self): return pathlib.Path(self.root.filename).joinpath(self.at) def read_text(self, *args, **kwargs): with self.open('r', *args, **kwargs) as strm: return strm.read() def read_bytes(self): with self.open('rb') as strm: return strm.read() def _is_child(self, path): return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/") def _next(self, at): return self.__class__(self.root, at) def is_dir(self): return not self.at or self.at.endswith("/") def is_file(self): return self.exists() and not self.is_dir() def exists(self): return self.at in self.root._name_set() def iterdir(self): if not self.is_dir(): raise ValueError("Can't listdir a file") subs = map(self._next, self.root.namelist()) return filter(self._is_child, subs) def __str__(self): return posixpath.join(self.root.filename, self.at) def __repr__(self): return self.__repr.format(self=self) def joinpath(self, *other): next = posixpath.join(self.at, *map(_pathlib_compat, other)) return self._next(self.root.resolve_dir(next)) __truediv__ = joinpath @property def parent(self): if not self.at: return self.filename.parent parent_at = posixpath.dirname(self.at.rstrip('/')) if parent_at: parent_at += '/' return self._next(parent_at) PK!ˆб_distutils/log.pynu["""A simple log mechanism styled after PEP 282.""" # The class here is styled after PEP 282 so that it could later be # replaced with a standard Python logging implementation. DEBUG = 1 INFO = 2 WARN = 3 ERROR = 4 FATAL = 5 import sys class Log: def __init__(self, threshold=WARN): self.threshold = threshold def _log(self, level, msg, args): if level not in (DEBUG, INFO, WARN, ERROR, FATAL): raise ValueError('%s wrong log level' % str(level)) if level >= self.threshold: if args: msg = msg % args if level in (WARN, ERROR, FATAL): stream = sys.stderr else: stream = sys.stdout try: stream.write('%s\n' % msg) except UnicodeEncodeError: # emulate backslashreplace error handler encoding = stream.encoding msg = msg.encode(encoding, "backslashreplace").decode(encoding) stream.write('%s\n' % msg) stream.flush() def log(self, level, msg, *args): self._log(level, msg, args) def debug(self, msg, *args): self._log(DEBUG, msg, args) def info(self, msg, *args): self._log(INFO, msg, args) def warn(self, msg, *args): self._log(WARN, msg, args) def error(self, msg, *args): self._log(ERROR, msg, args) def fatal(self, msg, *args): self._log(FATAL, msg, args) _global_log = Log() log = _global_log.log debug = _global_log.debug info = _global_log.info warn = _global_log.warn error = _global_log.error fatal = _global_log.fatal def set_threshold(level): # return the old threshold for use from tests old = _global_log.threshold _global_log.threshold = level return old def set_verbosity(v): if v <= 0: set_threshold(WARN) elif v == 1: set_threshold(INFO) elif v >= 2: set_threshold(DEBUG) PK! _distutils/spawn.pynu["""distutils.spawn Provides the 'spawn()' function, a front-end to various platform- specific functions for launching another program in a sub-process. Also provides the 'find_executable()' to search the path for a given executable name. """ import sys import os import subprocess from distutils.errors import DistutilsPlatformError, DistutilsExecError from distutils.debug import DEBUG from distutils import log def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): """Run another program, specified as a command list 'cmd', in a new process. 'cmd' is just the argument list for the new process, ie. cmd[0] is the program to run and cmd[1:] are the rest of its arguments. There is no way to run a program with a name different from that of its executable. If 'search_path' is true (the default), the system's executable search path will be used to find the program; otherwise, cmd[0] must be the exact path to the executable. If 'dry_run' is true, the command will not actually be run. Raise DistutilsExecError if running the program fails in any way; just return on success. """ # cmd is documented as a list, but just in case some code passes a tuple # in, protect our %-formatting code against horrible death cmd = list(cmd) log.info(subprocess.list2cmdline(cmd)) if dry_run: return if search_path: executable = find_executable(cmd[0]) if executable is not None: cmd[0] = executable env = env if env is not None else dict(os.environ) if sys.platform == 'darwin': from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver macosx_target_ver = get_macosx_target_ver() if macosx_target_ver: env[MACOSX_VERSION_VAR] = macosx_target_ver try: proc = subprocess.Popen(cmd, env=env) proc.wait() exitcode = proc.returncode except OSError as exc: if not DEBUG: cmd = cmd[0] raise DistutilsExecError( "command %r failed: %s" % (cmd, exc.args[-1])) from exc if exitcode: if not DEBUG: cmd = cmd[0] raise DistutilsExecError( "command %r failed with exit code %s" % (cmd, exitcode)) def find_executable(executable, path=None): """Tries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the complete filename or None if not found. """ _, ext = os.path.splitext(executable) if (sys.platform == 'win32') and (ext != '.exe'): executable = executable + '.exe' if os.path.isfile(executable): return executable if path is None: path = os.environ.get('PATH', None) if path is None: try: path = os.confstr("CS_PATH") except (AttributeError, ValueError): # os.confstr() or CS_PATH is not available path = os.defpath # bpo-35755: Don't use os.defpath if the PATH environment variable is # set to an empty string # PATH='' doesn't match, whereas PATH=':' looks in the current directory if not path: return None paths = path.split(os.pathsep) for p in paths: f = os.path.join(p, executable) if os.path.isfile(f): # the file exists, we have a shot at spawn working return f return None PK!Q800_distutils/text_file.pynu["""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" import sys, io class TextFile: """Provides a file-like object that takes care of all the things you commonly want to do when processing a text file that has some line-by-line syntax: strip comments (as long as "#" is your comment character), skip blank lines, join adjacent lines by escaping the newline (ie. backslash at end of line), strip leading and/or trailing whitespace. All of these are optional and independently controllable. Provides a 'warn()' method so you can generate warning messages that report physical line number, even if the logical line in question spans multiple physical lines. Also provides 'unreadline()' for implementing line-at-a-time lookahead. Constructor is called as: TextFile (filename=None, file=None, **options) It bombs (RuntimeError) if both 'filename' and 'file' are None; 'filename' should be a string, and 'file' a file object (or something that provides 'readline()' and 'close()' methods). It is recommended that you supply at least 'filename', so that TextFile can include it in warning messages. If 'file' is not supplied, TextFile creates its own using 'io.open()'. The options are all boolean, and affect the value returned by 'readline()': strip_comments [default: true] strip from "#" to end-of-line, as well as any whitespace leading up to the "#" -- unless it is escaped by a backslash lstrip_ws [default: false] strip leading whitespace from each line before returning it rstrip_ws [default: true] strip trailing whitespace (including line terminator!) from each line before returning it skip_blanks [default: true} skip lines that are empty *after* stripping comments and whitespace. (If both lstrip_ws and rstrip_ws are false, then some lines may consist of solely whitespace: these will *not* be skipped, even if 'skip_blanks' is true.) join_lines [default: false] if a backslash is the last non-newline character on a line after stripping comments and whitespace, join the following line to it to form one "logical line"; if N consecutive lines end with a backslash, then N+1 physical lines will be joined to form one logical line. collapse_join [default: false] strip leading whitespace from lines that are joined to their predecessor; only matters if (join_lines and not lstrip_ws) errors [default: 'strict'] error handler used to decode the file content Note that since 'rstrip_ws' can strip the trailing newline, the semantics of 'readline()' must differ from those of the builtin file object's 'readline()' method! In particular, 'readline()' returns None for end-of-file: an empty string might just be a blank line (or an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is not.""" default_options = { 'strip_comments': 1, 'skip_blanks': 1, 'lstrip_ws': 0, 'rstrip_ws': 1, 'join_lines': 0, 'collapse_join': 0, 'errors': 'strict', } def __init__(self, filename=None, file=None, **options): """Construct a new TextFile object. At least one of 'filename' (a string) and 'file' (a file-like object) must be supplied. They keyword argument options are described above and affect the values returned by 'readline()'.""" if filename is None and file is None: raise RuntimeError("you must supply either or both of 'filename' and 'file'") # set values for all options -- either from client option hash # or fallback to default_options for opt in self.default_options.keys(): if opt in options: setattr(self, opt, options[opt]) else: setattr(self, opt, self.default_options[opt]) # sanity check client option hash for opt in options.keys(): if opt not in self.default_options: raise KeyError("invalid TextFile option '%s'" % opt) if file is None: self.open(filename) else: self.filename = filename self.file = file self.current_line = 0 # assuming that file is at BOF! # 'linebuf' is a stack of lines that will be emptied before we # actually read from the file; it's only populated by an # 'unreadline()' operation self.linebuf = [] def open(self, filename): """Open a new file named 'filename'. This overrides both the 'filename' and 'file' arguments to the constructor.""" self.filename = filename self.file = io.open(self.filename, 'r', errors=self.errors) self.current_line = 0 def close(self): """Close the current file and forget everything we know about it (filename, current line number).""" file = self.file self.file = None self.filename = None self.current_line = None file.close() def gen_error(self, msg, line=None): outmsg = [] if line is None: line = self.current_line outmsg.append(self.filename + ", ") if isinstance(line, (list, tuple)): outmsg.append("lines %d-%d: " % tuple(line)) else: outmsg.append("line %d: " % line) outmsg.append(str(msg)) return "".join(outmsg) def error(self, msg, line=None): raise ValueError("error: " + self.gen_error(msg, line)) def warn(self, msg, line=None): """Print (to stderr) a warning message tied to the current logical line in the current file. If the current logical line in the file spans multiple physical lines, the warning refers to the whole range, eg. "lines 3-5". If 'line' supplied, it overrides the current line number; it may be a list or tuple to indicate a range of physical lines, or an integer for a single physical line.""" sys.stderr.write("warning: " + self.gen_error(msg, line) + "\n") def readline(self): """Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updates the current line number, so calling 'warn()' after 'readline()' emits a warning about the physical line(s) just read. Returns None on end-of-file, since the empty string can occur if 'rstrip_ws' is true but 'strip_blanks' is not.""" # If any "unread" lines waiting in 'linebuf', return the top # one. (We don't actually buffer read-ahead data -- lines only # get put in 'linebuf' if the client explicitly does an # 'unreadline()'. if self.linebuf: line = self.linebuf[-1] del self.linebuf[-1] return line buildup_line = '' while True: # read the line, make it None if EOF line = self.file.readline() if line == '': line = None if self.strip_comments and line: # Look for the first "#" in the line. If none, never # mind. If we find one and it's the first character, or # is not preceded by "\", then it starts a comment -- # strip the comment, strip whitespace before it, and # carry on. Otherwise, it's just an escaped "#", so # unescape it (and any other escaped "#"'s that might be # lurking in there) and otherwise leave the line alone. pos = line.find("#") if pos == -1: # no "#" -- no comments pass # It's definitely a comment -- either "#" is the first # character, or it's elsewhere and unescaped. elif pos == 0 or line[pos-1] != "\\": # Have to preserve the trailing newline, because it's # the job of a later step (rstrip_ws) to remove it -- # and if rstrip_ws is false, we'd better preserve it! # (NB. this means that if the final line is all comment # and has no trailing newline, we will think that it's # EOF; I think that's OK.) eol = (line[-1] == '\n') and '\n' or '' line = line[0:pos] + eol # If all that's left is whitespace, then skip line # *now*, before we try to join it to 'buildup_line' -- # that way constructs like # hello \\ # # comment that should be ignored # there # result in "hello there". if line.strip() == "": continue else: # it's an escaped "#" line = line.replace("\\#", "#") # did previous line end with a backslash? then accumulate if self.join_lines and buildup_line: # oops: end of file if line is None: self.warn("continuation line immediately precedes " "end-of-file") return buildup_line if self.collapse_join: line = line.lstrip() line = buildup_line + line # careful: pay attention to line number when incrementing it if isinstance(self.current_line, list): self.current_line[1] = self.current_line[1] + 1 else: self.current_line = [self.current_line, self.current_line + 1] # just an ordinary line, read it as usual else: if line is None: # eof return None # still have to be careful about incrementing the line number! if isinstance(self.current_line, list): self.current_line = self.current_line[1] + 1 else: self.current_line = self.current_line + 1 # strip whitespace however the client wants (leading and # trailing, or one or the other, or neither) if self.lstrip_ws and self.rstrip_ws: line = line.strip() elif self.lstrip_ws: line = line.lstrip() elif self.rstrip_ws: line = line.rstrip() # blank line (whether we rstrip'ed or not)? skip to next line # if appropriate if (line == '' or line == '\n') and self.skip_blanks: continue if self.join_lines: if line[-1] == '\\': buildup_line = line[:-1] continue if line[-2:] == '\\\n': buildup_line = line[0:-2] + '\n' continue # well, I guess there's some actual content there: return it return line def readlines(self): """Read and return the list of all logical lines remaining in the current file.""" lines = [] while True: line = self.readline() if line is None: return lines lines.append(line) def unreadline(self, line): """Push 'line' (a string) onto an internal buffer that will be checked by future 'readline()' calls. Handy for implementing a parser with line-at-a-time lookahead.""" self.linebuf.append(line) PK!5<*B*B_distutils/cygwinccompiler.pynu["""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc compiled python version (1.5.2) # 1. you have to insert a __GNUC__ section in its config.h # 2. you have to generate an import library for its dll # - create a def-file for python??.dll # - create an import library using # dlltool --dllname python15.dll --def python15.def \ # --output-lib libpython15.a # # see also http://starship.python.net/crew/kernr/mingw32/Notes.html # # * We put export_symbols in a def-file, and don't use # --export-all-symbols because it doesn't worked reliable in some # tested configurations. And because other windows compilers also # need their symbols specified this no serious problem. # # tested configurations: # # * cygwin gcc 2.91.57/ld 2.9.4/dllwrap 0.2.4 works # (after patching python's config.h and for C++ some other include files) # see also http://starship.python.net/crew/kernr/mingw32/Notes.html # * mingw32 gcc 2.95.2/ld 2.9.4/dllwrap 0.2.4 works # (ld doesn't support -shared, so we use dllwrap) # * cygwin gcc 2.95.2/ld 2.10.90/dllwrap 2.10.90 works now # - its dllwrap doesn't work, there is a bug in binutils 2.10.90 # see also http://sources.redhat.com/ml/cygwin/2000-06/msg01274.html # - using gcc -mdll instead dllwrap doesn't work without -static because # it tries to link against dlls instead their import libraries. (If # it finds the dll first.) # By specifying -static we force ld to link against the import libraries, # this is windows standard and there are normally not the necessary symbols # in the dlls. # *** only the version of June 2000 shows these problems # * cygwin gcc 3.2/ld 2.13.90 works # (ld supports -shared) # * mingw gcc 3.2/ld 2.13 works # (ld supports -shared) # * llvm-mingw with Clang 11 works # (lld supports -shared) import os import sys import copy from subprocess import Popen, PIPE, check_output import re from distutils.unixccompiler import UnixCCompiler from distutils.file_util import write_file from distutils.errors import (DistutilsExecError, CCompilerError, CompileError, UnknownFileError) from distutils.version import LooseVersion from distutils.spawn import find_executable def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. """ msc_pos = sys.version.find('MSC v.') if msc_pos != -1: msc_ver = sys.version[msc_pos+6:msc_pos+10] if msc_ver == '1300': # MSVC 7.0 return ['msvcr70'] elif msc_ver == '1310': # MSVC 7.1 return ['msvcr71'] elif msc_ver == '1400': # VS2005 / MSVC 8.0 return ['msvcr80'] elif msc_ver == '1500': # VS2008 / MSVC 9.0 return ['msvcr90'] elif msc_ver == '1600': # VS2010 / MSVC 10.0 return ['msvcr100'] else: raise ValueError("Unknown MS Compiler version %s " % msc_ver) class CygwinCCompiler(UnixCCompiler): """ Handles the Cygwin port of the GNU C compiler to Windows. """ compiler_type = 'cygwin' obj_extension = ".o" static_lib_extension = ".a" shared_lib_extension = ".dll" static_lib_format = "lib%s%s" shared_lib_format = "%s%s" exe_extension = ".exe" def __init__(self, verbose=0, dry_run=0, force=0): UnixCCompiler.__init__(self, verbose, dry_run, force) status, details = check_config_h() self.debug_print("Python's GCC status: %s (details: %s)" % (status, details)) if status is not CONFIG_H_OK: self.warn( "Python's pyconfig.h doesn't seem to support your compiler. " "Reason: %s. " "Compiling may fail because of undefined preprocessor macros." % details) self.cc = os.environ.get('CC', 'gcc') self.cxx = os.environ.get('CXX', 'g++') if ('gcc' in self.cc): # Start gcc workaround self.gcc_version, self.ld_version, self.dllwrap_version = \ get_versions() self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" % (self.gcc_version, self.ld_version, self.dllwrap_version) ) # ld_version >= "2.10.90" and < "2.13" should also be able to use # gcc -mdll instead of dllwrap # Older dllwraps had own version numbers, newer ones use the # same as the rest of binutils ( also ld ) # dllwrap 2.10.90 is buggy if self.ld_version >= "2.10.90": self.linker_dll = self.cc else: self.linker_dll = "dllwrap" # ld_version >= "2.13" support -shared so use it instead of # -mdll -static if self.ld_version >= "2.13": shared_option = "-shared" else: shared_option = "-mdll -static" else: # Assume linker is up to date self.linker_dll = self.cc shared_option = "-shared" self.set_executables(compiler='%s -mcygwin -O -Wall' % self.cc, compiler_so='%s -mcygwin -mdll -O -Wall' % self.cc, compiler_cxx='%s -mcygwin -O -Wall' % self.cxx, linker_exe='%s -mcygwin' % self.cc, linker_so=('%s -mcygwin %s' % (self.linker_dll, shared_option))) # cygwin and mingw32 need different sets of libraries if ('gcc' in self.cc and self.gcc_version == "2.91.57"): # cygwin shouldn't need msvcrt, but without the dlls will crash # (gcc version 2.91.57) -- perhaps something about initialization self.dll_libraries=["msvcrt"] self.warn( "Consider upgrading to a newer version of gcc") else: # Include the appropriate MSVC runtime library if Python was built # with MSVC 7.0 or later. self.dll_libraries = get_msvcr() def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): """Compiles the source by spawning GCC and windres if needed.""" if ext == '.rc' or ext == '.res': # gcc needs '.res' and '.rc' compiled to object files !!! try: self.spawn(["windres", "-i", src, "-o", obj]) except DistutilsExecError as msg: raise CompileError(msg) else: # for other files use the C-compiler try: self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + extra_postargs) except DistutilsExecError as msg: raise CompileError(msg) def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): """Link the objects.""" # use separate copies, so we can modify the lists extra_preargs = copy.copy(extra_preargs or []) libraries = copy.copy(libraries or []) objects = copy.copy(objects or []) # Additional libraries libraries.extend(self.dll_libraries) # handle export symbols by creating a def-file # with executables this only works with gcc/ld as linker if ((export_symbols is not None) and (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")): # (The linker doesn't do anything if output is up-to-date. # So it would probably better to check if we really need this, # but for this we had to insert some unchanged parts of # UnixCCompiler, and this is not what we want.) # we want to put some files in the same directory as the # object files are, build_temp doesn't help much # where are the object files temp_dir = os.path.dirname(objects[0]) # name of dll to give the helper files the same base name (dll_name, dll_extension) = os.path.splitext( os.path.basename(output_filename)) # generate the filenames for these files def_file = os.path.join(temp_dir, dll_name + ".def") lib_file = os.path.join(temp_dir, 'lib' + dll_name + ".a") # Generate .def file contents = [ "LIBRARY %s" % os.path.basename(output_filename), "EXPORTS"] for sym in export_symbols: contents.append(sym) self.execute(write_file, (def_file, contents), "writing %s" % def_file) # next add options for def-file and to creating import libraries # dllwrap uses different options than gcc/ld if self.linker_dll == "dllwrap": extra_preargs.extend(["--output-lib", lib_file]) # for dllwrap we have to use a special option extra_preargs.extend(["--def", def_file]) # we use gcc/ld here and can be sure ld is >= 2.9.10 else: # doesn't work: bfd_close build\...\libfoo.a: Invalid operation #extra_preargs.extend(["-Wl,--out-implib,%s" % lib_file]) # for gcc/ld the def-file is specified as any object files objects.append(def_file) #end: if ((export_symbols is not None) and # (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")): # who wants symbols and a many times larger output file # should explicitly switch the debug mode on # otherwise we let dllwrap/ld strip the output file # (On my machine: 10KiB < stripped_file < ??100KiB # unstripped_file = stripped_file + XXX KiB # ( XXX=254 for a typical python extension)) if not debug: extra_preargs.append("-s") UnixCCompiler.link(self, target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, None, # export_symbols, we do this in our def-file debug, extra_preargs, extra_postargs, build_temp, target_lang) # -- Miscellaneous methods ----------------------------------------- def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): """Adds supports for rc and res files.""" if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: # use normcase to make sure '.rc' is really '.rc' and not '.RC' base, ext = os.path.splitext(os.path.normcase(src_name)) if ext not in (self.src_extensions + ['.rc','.res']): raise UnknownFileError("unknown file type '%s' (from '%s')" % \ (ext, src_name)) if strip_dir: base = os.path.basename (base) if ext in ('.res', '.rc'): # these need to be compiled to object files obj_names.append (os.path.join(output_dir, base + ext + self.obj_extension)) else: obj_names.append (os.path.join(output_dir, base + self.obj_extension)) return obj_names # the same as cygwin plus some additional parameters class Mingw32CCompiler(CygwinCCompiler): """ Handles the Mingw32 port of the GNU C compiler to Windows. """ compiler_type = 'mingw32' def __init__(self, verbose=0, dry_run=0, force=0): CygwinCCompiler.__init__ (self, verbose, dry_run, force) # ld_version >= "2.13" support -shared so use it instead of # -mdll -static if ('gcc' in self.cc and self.ld_version < "2.13"): shared_option = "-mdll -static" else: shared_option = "-shared" # A real mingw32 doesn't need to specify a different entry point, # but cygwin 2.91.57 in no-cygwin-mode needs it. if ('gcc' in self.cc and self.gcc_version <= "2.91.57"): entry_point = '--entry _DllMain@12' else: entry_point = '' if is_cygwincc(self.cc): raise CCompilerError( 'Cygwin gcc cannot be used with --compiler=mingw32') self.set_executables(compiler='%s -O -Wall' % self.cc, compiler_so='%s -mdll -O -Wall' % self.cc, compiler_cxx='%s -O -Wall' % self.cxx, linker_exe='%s' % self.cc, linker_so='%s %s %s' % (self.linker_dll, shared_option, entry_point)) # Maybe we should also append -mthreads, but then the finished # dlls need another dll (mingwm10.dll see Mingw32 docs) # (-mthreads: Support thread-safe exception handling on `Mingw32') # no additional libraries needed self.dll_libraries=[] # Include the appropriate MSVC runtime library if Python was built # with MSVC 7.0 or later. self.dll_libraries = get_msvcr() # Because these compilers aren't configured in Python's pyconfig.h file by # default, we should at least warn the user if he is using an unmodified # version. CONFIG_H_OK = "ok" CONFIG_H_NOTOK = "not ok" CONFIG_H_UNCERTAIN = "uncertain" def check_config_h(): """Check if the current Python installation appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: - CONFIG_H_OK: all is well, go ahead and compile - CONFIG_H_NOTOK: doesn't look good - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h 'details' is a human-readable string explaining the situation. Note there are two ways to conclude "OK": either 'sys.version' contains the string "GCC" (implying that this Python was built with GCC), or the installed "pyconfig.h" contains the string "__GNUC__". """ # XXX since this function also checks sys.version, it's not strictly a # "pyconfig.h" check -- should probably be renamed... from distutils import sysconfig # if sys.version contains GCC then python was compiled with GCC, and the # pyconfig.h file should be OK if "GCC" in sys.version: return CONFIG_H_OK, "sys.version mentions 'GCC'" # Clang would also work if "Clang" in sys.version: return CONFIG_H_OK, "sys.version mentions 'Clang'" # let's see if __GNUC__ is mentioned in python.h fn = sysconfig.get_config_h_filename() try: config_h = open(fn) try: if "__GNUC__" in config_h.read(): return CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn else: return CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn finally: config_h.close() except OSError as exc: return (CONFIG_H_UNCERTAIN, "couldn't read '%s': %s" % (fn, exc.strerror)) RE_VERSION = re.compile(br'(\d+\.\d+(\.\d+)*)') def _find_exe_version(cmd): """Find the version of an executable by running `cmd` in the shell. If the command is not found, or the output does not match `RE_VERSION`, returns None. """ executable = cmd.split()[0] if find_executable(executable) is None: return None out = Popen(cmd, shell=True, stdout=PIPE).stdout try: out_string = out.read() finally: out.close() result = RE_VERSION.search(out_string) if result is None: return None # LooseVersion works with strings # so we need to decode our bytes return LooseVersion(result.group(1).decode()) def get_versions(): """ Try to find out the versions of gcc, ld and dllwrap. If not possible it returns None for it. """ commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version'] return tuple([_find_exe_version(cmd) for cmd in commands]) def is_cygwincc(cc): '''Try to determine if the compiler that would be used is from cygwin.''' out_string = check_output([cc, '-dumpmachine']) return out_string.strip().endswith(b'cygwin') PK!MQMQ_distutils/_msvccompiler.pynu["""distutils._msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for Microsoft Visual Studio 2015. The module is compatible with VS 2015 and later. You can find legacy support for older versions in distutils.msvc9compiler and distutils.msvccompiler. """ # Written by Perry Stoll # hacked by Robin Becker and Thomas Heller to do a better job of # finding DevStudio (through the registry) # ported to VS 2005 and VS 2008 by Christian Heimes # ported to VS 2015 by Steve Dower import os import subprocess import contextlib import warnings import unittest.mock with contextlib.suppress(ImportError): import winreg from distutils.errors import DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError from distutils.ccompiler import CCompiler, gen_lib_options from distutils import log from distutils.util import get_platform from itertools import count def _find_vc2015(): try: key = winreg.OpenKeyEx( winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\VisualStudio\SxS\VC7", access=winreg.KEY_READ | winreg.KEY_WOW64_32KEY ) except OSError: log.debug("Visual C++ is not registered") return None, None best_version = 0 best_dir = None with key: for i in count(): try: v, vc_dir, vt = winreg.EnumValue(key, i) except OSError: break if v and vt == winreg.REG_SZ and os.path.isdir(vc_dir): try: version = int(float(v)) except (ValueError, TypeError): continue if version >= 14 and version > best_version: best_version, best_dir = version, vc_dir return best_version, best_dir def _find_vc2017(): """Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. """ root = os.environ.get("ProgramFiles(x86)") or os.environ.get("ProgramFiles") if not root: return None, None try: path = subprocess.check_output([ os.path.join(root, "Microsoft Visual Studio", "Installer", "vswhere.exe"), "-latest", "-prerelease", "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "-property", "installationPath", "-products", "*", ], encoding="mbcs", errors="strict").strip() except (subprocess.CalledProcessError, OSError, UnicodeDecodeError): return None, None path = os.path.join(path, "VC", "Auxiliary", "Build") if os.path.isdir(path): return 15, path return None, None PLAT_SPEC_TO_RUNTIME = { 'x86' : 'x86', 'x86_amd64' : 'x64', 'x86_arm' : 'arm', 'x86_arm64' : 'arm64' } def _find_vcvarsall(plat_spec): # bpo-38597: Removed vcruntime return value _, best_dir = _find_vc2017() if not best_dir: best_version, best_dir = _find_vc2015() if not best_dir: log.debug("No suitable Visual C++ version found") return None, None vcvarsall = os.path.join(best_dir, "vcvarsall.bat") if not os.path.isfile(vcvarsall): log.debug("%s cannot be found", vcvarsall) return None, None return vcvarsall, None def _get_vc_env(plat_spec): if os.getenv("DISTUTILS_USE_SDK"): return { key.lower(): value for key, value in os.environ.items() } vcvarsall, _ = _find_vcvarsall(plat_spec) if not vcvarsall: raise DistutilsPlatformError("Unable to find vcvarsall.bat") try: out = subprocess.check_output( 'cmd /u /c "{}" {} && set'.format(vcvarsall, plat_spec), stderr=subprocess.STDOUT, ).decode('utf-16le', errors='replace') except subprocess.CalledProcessError as exc: log.error(exc.output) raise DistutilsPlatformError("Error executing {}" .format(exc.cmd)) env = { key.lower(): value for key, _, value in (line.partition('=') for line in out.splitlines()) if key and value } return env def _find_exe(exe, paths=None): """Return path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. """ if not paths: paths = os.getenv('path').split(os.pathsep) for p in paths: fn = os.path.join(os.path.abspath(p), exe) if os.path.isfile(fn): return fn return exe # A map keyed by get_platform() return values to values accepted by # 'vcvarsall.bat'. Always cross-compile from x86 to work with the # lighter-weight MSVC installs that do not include native 64-bit tools. PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'x86_amd64', 'win-arm32' : 'x86_arm', 'win-arm64' : 'x86_arm64' } class MSVCCompiler(CCompiler) : """Concrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.""" compiler_type = 'msvc' # Just set this so CCompiler's constructor doesn't barf. We currently # don't use the 'set_executables()' bureaucracy provided by CCompiler, # as it really isn't necessary for this sort of single-compiler class. # Would be nice to have a consistent interface with UnixCCompiler, # though, so it's worth thinking about. executables = {} # Private class data (need to distinguish C from C++ source for compiler) _c_extensions = ['.c'] _cpp_extensions = ['.cc', '.cpp', '.cxx'] _rc_extensions = ['.rc'] _mc_extensions = ['.mc'] # Needed for the filename generation methods provided by the # base class, CCompiler. src_extensions = (_c_extensions + _cpp_extensions + _rc_extensions + _mc_extensions) res_extension = '.res' obj_extension = '.obj' static_lib_extension = '.lib' shared_lib_extension = '.dll' static_lib_format = shared_lib_format = '%s%s' exe_extension = '.exe' def __init__(self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) # target platform (.plat_name is consistent with 'bdist') self.plat_name = None self.initialized = False def initialize(self, plat_name=None): # multi-init means we would need to check platform same each time... assert not self.initialized, "don't init multiple times" if plat_name is None: plat_name = get_platform() # sanity check for platforms to prevent obscure errors later. if plat_name not in PLAT_TO_VCVARS: raise DistutilsPlatformError("--plat-name must be one of {}" .format(tuple(PLAT_TO_VCVARS))) # Get the vcvarsall.bat spec for the requested platform. plat_spec = PLAT_TO_VCVARS[plat_name] vc_env = _get_vc_env(plat_spec) if not vc_env: raise DistutilsPlatformError("Unable to find a compatible " "Visual Studio installation.") self._paths = vc_env.get('path', '') paths = self._paths.split(os.pathsep) self.cc = _find_exe("cl.exe", paths) self.linker = _find_exe("link.exe", paths) self.lib = _find_exe("lib.exe", paths) self.rc = _find_exe("rc.exe", paths) # resource compiler self.mc = _find_exe("mc.exe", paths) # message compiler self.mt = _find_exe("mt.exe", paths) # message compiler for dir in vc_env.get('include', '').split(os.pathsep): if dir: self.add_include_dir(dir.rstrip(os.sep)) for dir in vc_env.get('lib', '').split(os.pathsep): if dir: self.add_library_dir(dir.rstrip(os.sep)) self.preprocess_options = None # bpo-38597: Always compile with dynamic linking # Future releases of Python 3.x will include all past # versions of vcruntime*.dll for compatibility. self.compile_options = [ '/nologo', '/O2', '/W3', '/GL', '/DNDEBUG', '/MD' ] self.compile_options_debug = [ '/nologo', '/Od', '/MDd', '/Zi', '/W3', '/D_DEBUG' ] ldflags = [ '/nologo', '/INCREMENTAL:NO', '/LTCG' ] ldflags_debug = [ '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL' ] self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1'] self.ldflags_exe_debug = [*ldflags_debug, '/MANIFEST:EMBED,ID=1'] self.ldflags_shared = [*ldflags, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO'] self.ldflags_shared_debug = [*ldflags_debug, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO'] self.ldflags_static = [*ldflags] self.ldflags_static_debug = [*ldflags_debug] self._ldflags = { (CCompiler.EXECUTABLE, None): self.ldflags_exe, (CCompiler.EXECUTABLE, False): self.ldflags_exe, (CCompiler.EXECUTABLE, True): self.ldflags_exe_debug, (CCompiler.SHARED_OBJECT, None): self.ldflags_shared, (CCompiler.SHARED_OBJECT, False): self.ldflags_shared, (CCompiler.SHARED_OBJECT, True): self.ldflags_shared_debug, (CCompiler.SHARED_LIBRARY, None): self.ldflags_static, (CCompiler.SHARED_LIBRARY, False): self.ldflags_static, (CCompiler.SHARED_LIBRARY, True): self.ldflags_static_debug, } self.initialized = True # -- Worker methods ------------------------------------------------ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): ext_map = { **{ext: self.obj_extension for ext in self.src_extensions}, **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions}, } output_dir = output_dir or '' def make_out_path(p): base, ext = os.path.splitext(p) if strip_dir: base = os.path.basename(base) else: _, base = os.path.splitdrive(base) if base.startswith((os.path.sep, os.path.altsep)): base = base[1:] try: # XXX: This may produce absurdly long paths. We should check # the length of the result and trim base until we fit within # 260 characters. return os.path.join(output_dir, base + ext_map[ext]) except LookupError: # Better to raise an exception instead of silently continuing # and later complain about sources and targets having # different lengths raise CompileError("Don't know how to compile {}".format(p)) return list(map(make_out_path, source_filenames)) def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): if not self.initialized: self.initialize() compile_info = self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs) macros, objects, extra_postargs, pp_opts, build = compile_info compile_opts = extra_preargs or [] compile_opts.append('/c') if debug: compile_opts.extend(self.compile_options_debug) else: compile_opts.extend(self.compile_options) add_cpp_opts = False for obj in objects: try: src, ext = build[obj] except KeyError: continue if debug: # pass the full pathname to MSVC in debug mode, # this allows the debugger to find the source file # without asking the user to browse for it src = os.path.abspath(src) if ext in self._c_extensions: input_opt = "/Tc" + src elif ext in self._cpp_extensions: input_opt = "/Tp" + src add_cpp_opts = True elif ext in self._rc_extensions: # compile .RC to .RES file input_opt = src output_opt = "/fo" + obj try: self.spawn([self.rc] + pp_opts + [output_opt, input_opt]) except DistutilsExecError as msg: raise CompileError(msg) continue elif ext in self._mc_extensions: # Compile .MC to .RC file to .RES file. # * '-h dir' specifies the directory for the # generated include file # * '-r dir' specifies the target directory of the # generated RC file and the binary message resource # it includes # # For now (since there are no options to change this), # we use the source-directory for the include file and # the build directory for the RC file and message # resources. This works at least for win32all. h_dir = os.path.dirname(src) rc_dir = os.path.dirname(obj) try: # first compile .MC to .RC and .H file self.spawn([self.mc, '-h', h_dir, '-r', rc_dir, src]) base, _ = os.path.splitext(os.path.basename (src)) rc_file = os.path.join(rc_dir, base + '.rc') # then compile .RC to .RES file self.spawn([self.rc, "/fo" + obj, rc_file]) except DistutilsExecError as msg: raise CompileError(msg) continue else: # how to handle this file? raise CompileError("Don't know how to compile {} to {}" .format(src, obj)) args = [self.cc] + compile_opts + pp_opts if add_cpp_opts: args.append('/EHsc') args.append(input_opt) args.append("/Fo" + obj) args.extend(extra_postargs) try: self.spawn(args) except DistutilsExecError as msg: raise CompileError(msg) return objects def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): if not self.initialized: self.initialize() objects, output_dir = self._fix_object_args(objects, output_dir) output_filename = self.library_filename(output_libname, output_dir=output_dir) if self._need_link(objects, output_filename): lib_args = objects + ['/OUT:' + output_filename] if debug: pass # XXX what goes here? try: log.debug('Executing "%s" %s', self.lib, ' '.join(lib_args)) self.spawn([self.lib] + lib_args) except DistutilsExecError as msg: raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): if not self.initialized: self.initialize() objects, output_dir = self._fix_object_args(objects, output_dir) fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) libraries, library_dirs, runtime_library_dirs = fixed_args if runtime_library_dirs: self.warn("I don't know what to do with 'runtime_library_dirs': " + str(runtime_library_dirs)) lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if output_dir is not None: output_filename = os.path.join(output_dir, output_filename) if self._need_link(objects, output_filename): ldflags = self._ldflags[target_desc, debug] export_opts = ["/EXPORT:" + sym for sym in (export_symbols or [])] ld_args = (ldflags + lib_opts + export_opts + objects + ['/OUT:' + output_filename]) # The MSVC linker generates .lib and .exp files, which cannot be # suppressed by any linker switches. The .lib files may even be # needed! Make sure they are generated in the temporary build # directory. Since they have different names for debug and release # builds, they can go into the same directory. build_temp = os.path.dirname(objects[0]) if export_symbols is not None: (dll_name, dll_ext) = os.path.splitext( os.path.basename(output_filename)) implib_file = os.path.join( build_temp, self.library_filename(dll_name)) ld_args.append ('/IMPLIB:' + implib_file) if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) output_dir = os.path.dirname(os.path.abspath(output_filename)) self.mkpath(output_dir) try: log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args)) self.spawn([self.linker] + ld_args) except DistutilsExecError as msg: raise LinkError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def spawn(self, cmd): env = dict(os.environ, PATH=self._paths) with self._fallback_spawn(cmd, env) as fallback: return super().spawn(cmd, env=env) return fallback.value @contextlib.contextmanager def _fallback_spawn(self, cmd, env): """ Discovered in pypa/distutils#15, some tools monkeypatch the compiler, so the 'env' kwarg causes a TypeError. Detect this condition and restore the legacy, unsafe behavior. """ bag = type('Bag', (), {})() try: yield bag except TypeError as exc: if "unexpected keyword argument 'env'" not in str(exc): raise else: return warnings.warn( "Fallback spawn triggered. Please update distutils monkeypatch.") with unittest.mock.patch('os.environ', env): bag.value = super().spawn(cmd) # -- Miscellaneous methods ----------------------------------------- # These are all used by the 'gen_lib_options() function, in # ccompiler.py. def library_dir_option(self, dir): return "/LIBPATH:" + dir def runtime_library_dir_option(self, dir): raise DistutilsPlatformError( "don't know how to set runtime library search path for MSVC") def library_option(self, lib): return self.library_filename(lib) def find_library_file(self, dirs, lib, debug=0): # Prefer a debugging library if found (and requested), but deal # with it if we don't have one. if debug: try_names = [lib + "_d", lib] else: try_names = [lib] for dir in dirs: for name in try_names: libfile = os.path.join(dir, self.library_filename(name)) if os.path.isfile(libfile): return libfile else: # Oops, didn't find it in *any* of 'dirs' return None PK!IS^""_distutils/core.pynu["""distutils.core The only module that needs to be imported to use the Distutils; provides the 'setup' function (which is to be called from the setup script). Also indirectly provides the Distribution and Command classes, although they are really defined in distutils.dist and distutils.cmd. """ import os import sys from distutils.debug import DEBUG from distutils.errors import * # Mainly import these so setup scripts can "from distutils.core import" them. from distutils.dist import Distribution from distutils.cmd import Command from distutils.config import PyPIRCCommand from distutils.extension import Extension # This is a barebones help message generated displayed when the user # runs the setup script with no arguments at all. More useful help # is generated with various --help options: global help, list commands, # and per-command help. USAGE = """\ usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: %(script)s --help [cmd1 cmd2 ...] or: %(script)s --help-commands or: %(script)s cmd --help """ def gen_usage (script_name): script = os.path.basename(script_name) return USAGE % vars() # Some mild magic to control the behaviour of 'setup()' from 'run_setup()'. _setup_stop_after = None _setup_distribution = None # Legal keyword arguments for the setup() function setup_keywords = ('distclass', 'script_name', 'script_args', 'options', 'name', 'version', 'author', 'author_email', 'maintainer', 'maintainer_email', 'url', 'license', 'description', 'long_description', 'keywords', 'platforms', 'classifiers', 'download_url', 'requires', 'provides', 'obsoletes', ) # Legal keyword arguments for the Extension constructor extension_keywords = ('name', 'sources', 'include_dirs', 'define_macros', 'undef_macros', 'library_dirs', 'libraries', 'runtime_library_dirs', 'extra_objects', 'extra_compile_args', 'extra_link_args', 'swig_opts', 'export_symbols', 'depends', 'language') def setup (**attrs): """The gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to 'setup()' (as keyword arguments), in config files, and on the command line. The Distribution instance might be an instance of a class supplied via the 'distclass' keyword argument to 'setup'; if no such class is supplied, then the Distribution class (in dist.py) is instantiated. All other arguments to 'setup' (except for 'cmdclass') are used to set attributes of the Distribution instance. The 'cmdclass' argument, if supplied, is a dictionary mapping command names to command classes. Each command encountered on the command line will be turned into a command class, which is in turn instantiated; any class found in 'cmdclass' is used in place of the default, which is (for command 'foo_bar') class 'foo_bar' in module 'distutils.command.foo_bar'. The command class must provide a 'user_options' attribute which is a list of option specifiers for 'distutils.fancy_getopt'. Any command-line options between the current and the next command are used to set attributes of the current command object. When the entire command-line has been successfully parsed, calls the 'run()' method on each command object in turn. This method will be driven entirely by the Distribution object (which each command object has a reference to, thanks to its constructor), and the command-specific options that became attributes of each command object. """ global _setup_stop_after, _setup_distribution # Determine the distribution class -- either caller-supplied or # our Distribution (see below). klass = attrs.get('distclass') if klass: del attrs['distclass'] else: klass = Distribution if 'script_name' not in attrs: attrs['script_name'] = os.path.basename(sys.argv[0]) if 'script_args' not in attrs: attrs['script_args'] = sys.argv[1:] # Create the Distribution instance, using the remaining arguments # (ie. everything except distclass) to initialize it try: _setup_distribution = dist = klass(attrs) except DistutilsSetupError as msg: if 'name' not in attrs: raise SystemExit("error in setup command: %s" % msg) else: raise SystemExit("error in %s setup command: %s" % \ (attrs['name'], msg)) if _setup_stop_after == "init": return dist # Find and parse the config file(s): they will override options from # the setup script, but be overridden by the command line. dist.parse_config_files() if DEBUG: print("options (after parsing config files):") dist.dump_option_dicts() if _setup_stop_after == "config": return dist # Parse the command line and override config files; any # command-line errors are the end user's fault, so turn them into # SystemExit to suppress tracebacks. try: ok = dist.parse_command_line() except DistutilsArgError as msg: raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg) if DEBUG: print("options (after parsing command line):") dist.dump_option_dicts() if _setup_stop_after == "commandline": return dist # And finally, run all the commands found on the command line. if ok: try: dist.run_commands() except KeyboardInterrupt: raise SystemExit("interrupted") except OSError as exc: if DEBUG: sys.stderr.write("error: %s\n" % (exc,)) raise else: raise SystemExit("error: %s" % (exc,)) except (DistutilsError, CCompilerError) as msg: if DEBUG: raise else: raise SystemExit("error: " + str(msg)) return dist # setup () def run_setup (script_name, script_args=None, stop_after="run"): """Run a setup script in a somewhat controlled environment, and return the Distribution instance that drives things. This is useful if you need to find out the distribution meta-data (passed as keyword args from 'script' to 'setup()', or the contents of the config files or command-line. 'script_name' is a file that will be read and run with 'exec()'; 'sys.argv[0]' will be replaced with 'script' for the duration of the call. 'script_args' is a list of strings; if supplied, 'sys.argv[1:]' will be replaced by 'script_args' for the duration of the call. 'stop_after' tells 'setup()' when to stop processing; possible values: init stop after the Distribution instance has been created and populated with the keyword arguments to 'setup()' config stop after config files have been parsed (and their data stored in the Distribution instance) commandline stop after the command-line ('sys.argv[1:]' or 'script_args') have been parsed (and the data stored in the Distribution) run [default] stop after all commands have been run (the same as if 'setup()' had been called in the usual way Returns the Distribution instance, which provides all information used to drive the Distutils. """ if stop_after not in ('init', 'config', 'commandline', 'run'): raise ValueError("invalid value for 'stop_after': %r" % (stop_after,)) global _setup_stop_after, _setup_distribution _setup_stop_after = stop_after save_argv = sys.argv.copy() g = {'__file__': script_name} try: try: sys.argv[0] = script_name if script_args is not None: sys.argv[1:] = script_args with open(script_name, 'rb') as f: exec(f.read(), g) finally: sys.argv = save_argv _setup_stop_after = None except SystemExit: # Hmm, should we do something if exiting with a non-zero code # (ie. error)? pass if _setup_distribution is None: raise RuntimeError(("'distutils.core.setup()' was never called -- " "perhaps '%s' is not a Distutils setup script?") % \ script_name) # I wonder if the setup script's namespace -- g and l -- would be of # any interest to callers? #print "_setup_distribution:", _setup_distribution return _setup_distribution # run_setup () PK!:k[[_distutils/msvccompiler.pynu["""distutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. """ # Written by Perry Stoll # hacked by Robin Becker and Thomas Heller to do a better job of # finding DevStudio (through the registry) import sys, os from distutils.errors import \ DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError from distutils.ccompiler import \ CCompiler, gen_lib_options from distutils import log _can_read_reg = False try: import winreg _can_read_reg = True hkey_mod = winreg RegOpenKeyEx = winreg.OpenKeyEx RegEnumKey = winreg.EnumKey RegEnumValue = winreg.EnumValue RegError = winreg.error except ImportError: try: import win32api import win32con _can_read_reg = True hkey_mod = win32con RegOpenKeyEx = win32api.RegOpenKeyEx RegEnumKey = win32api.RegEnumKey RegEnumValue = win32api.RegEnumValue RegError = win32api.error except ImportError: log.info("Warning: Can't read registry to find the " "necessary compiler setting\n" "Make sure that Python modules winreg, " "win32api or win32con are installed.") pass if _can_read_reg: HKEYS = (hkey_mod.HKEY_USERS, hkey_mod.HKEY_CURRENT_USER, hkey_mod.HKEY_LOCAL_MACHINE, hkey_mod.HKEY_CLASSES_ROOT) def read_keys(base, key): """Return list of registry keys.""" try: handle = RegOpenKeyEx(base, key) except RegError: return None L = [] i = 0 while True: try: k = RegEnumKey(handle, i) except RegError: break L.append(k) i += 1 return L def read_values(base, key): """Return dict of registry keys and values. All names are converted to lowercase. """ try: handle = RegOpenKeyEx(base, key) except RegError: return None d = {} i = 0 while True: try: name, value, type = RegEnumValue(handle, i) except RegError: break name = name.lower() d[convert_mbcs(name)] = convert_mbcs(value) i += 1 return d def convert_mbcs(s): dec = getattr(s, "decode", None) if dec is not None: try: s = dec("mbcs") except UnicodeError: pass return s class MacroExpander: def __init__(self, version): self.macros = {} self.load_macros(version) def set_macro(self, macro, path, key): for base in HKEYS: d = read_values(base, path) if d: self.macros["$(%s)" % macro] = d[key] break def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") try: if version > 7.0: self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") except KeyError as exc: # raise DistutilsPlatformError( """Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""") p = r"Software\Microsoft\NET Framework Setup\Product" for base in HKEYS: try: h = RegOpenKeyEx(base, p) except RegError: continue key = RegEnumKey(h, 0) d = read_values(base, r"%s\%s" % (p, key)) self.macros["$(FrameworkVersion)"] = d["version"] def sub(self, s): for k, v in self.macros.items(): s = s.replace(k, v) return s def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ prefix = "MSC v." i = sys.version.find(prefix) if i == -1: return 6 i = i + len(prefix) s, rest = sys.version[i:].split(" ", 1) majorVersion = int(s[:-2]) - 6 if majorVersion >= 13: # v13 was skipped and should be v14 majorVersion += 1 minorVersion = int(s[2:3]) / 10.0 # I don't think paths are affected by minor version in version 6 if majorVersion == 6: minorVersion = 0 if majorVersion >= 6: return majorVersion + minorVersion # else we don't know what version of the compiler this is return None def get_build_architecture(): """Return the processor architecture. Possible results are "Intel" or "AMD64". """ prefix = " bit (" i = sys.version.find(prefix) if i == -1: return "Intel" j = sys.version.find(")", i) return sys.version[i+len(prefix):j] def normalize_and_reduce_paths(paths): """Return a list of normalized paths with duplicates removed. The current order of paths is maintained. """ # Paths are normalized so things like: /a and /a/ aren't both preserved. reduced_paths = [] for p in paths: np = os.path.normpath(p) # XXX(nnorwitz): O(n**2), if reduced_paths gets long perhaps use a set. if np not in reduced_paths: reduced_paths.append(np) return reduced_paths class MSVCCompiler(CCompiler) : """Concrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.""" compiler_type = 'msvc' # Just set this so CCompiler's constructor doesn't barf. We currently # don't use the 'set_executables()' bureaucracy provided by CCompiler, # as it really isn't necessary for this sort of single-compiler class. # Would be nice to have a consistent interface with UnixCCompiler, # though, so it's worth thinking about. executables = {} # Private class data (need to distinguish C from C++ source for compiler) _c_extensions = ['.c'] _cpp_extensions = ['.cc', '.cpp', '.cxx'] _rc_extensions = ['.rc'] _mc_extensions = ['.mc'] # Needed for the filename generation methods provided by the # base class, CCompiler. src_extensions = (_c_extensions + _cpp_extensions + _rc_extensions + _mc_extensions) res_extension = '.res' obj_extension = '.obj' static_lib_extension = '.lib' shared_lib_extension = '.dll' static_lib_format = shared_lib_format = '%s%s' exe_extension = '.exe' def __init__(self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) self.__version = get_build_version() self.__arch = get_build_architecture() if self.__arch == "Intel": # x86 if self.__version >= 7: self.__root = r"Software\Microsoft\VisualStudio" self.__macros = MacroExpander(self.__version) else: self.__root = r"Software\Microsoft\Devstudio" self.__product = "Visual Studio version %s" % self.__version else: # Win64. Assume this was built with the platform SDK self.__product = "Microsoft SDK compiler %s" % (self.__version + 6) self.initialized = False def initialize(self): self.__paths = [] if "DISTUTILS_USE_SDK" in os.environ and "MSSdk" in os.environ and self.find_exe("cl.exe"): # Assume that the SDK set up everything alright; don't try to be # smarter self.cc = "cl.exe" self.linker = "link.exe" self.lib = "lib.exe" self.rc = "rc.exe" self.mc = "mc.exe" else: self.__paths = self.get_msvc_paths("path") if len(self.__paths) == 0: raise DistutilsPlatformError("Python was built with %s, " "and extensions need to be built with the same " "version of the compiler, but it isn't installed." % self.__product) self.cc = self.find_exe("cl.exe") self.linker = self.find_exe("link.exe") self.lib = self.find_exe("lib.exe") self.rc = self.find_exe("rc.exe") # resource compiler self.mc = self.find_exe("mc.exe") # message compiler self.set_path_env_var('lib') self.set_path_env_var('include') # extend the MSVC path with the current path try: for p in os.environ['path'].split(';'): self.__paths.append(p) except KeyError: pass self.__paths = normalize_and_reduce_paths(self.__paths) os.environ['path'] = ";".join(self.__paths) self.preprocess_options = None if self.__arch == "Intel": self.compile_options = [ '/nologo', '/O2', '/MD', '/W3', '/GX' , '/DNDEBUG'] self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX', '/Z7', '/D_DEBUG'] else: # Win64 self.compile_options = [ '/nologo', '/O2', '/MD', '/W3', '/GS-' , '/DNDEBUG'] self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-', '/Z7', '/D_DEBUG'] self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO'] if self.__version >= 7: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG' ] else: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG' ] self.ldflags_static = [ '/nologo'] self.initialized = True # -- Worker methods ------------------------------------------------ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): # Copied from ccompiler.py, extended to return .res as 'object'-file # for .rc input file if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: (base, ext) = os.path.splitext (src_name) base = os.path.splitdrive(base)[1] # Chop off the drive base = base[os.path.isabs(base):] # If abs, chop off leading / if ext not in self.src_extensions: # Better to raise an exception instead of silently continuing # and later complain about sources and targets having # different lengths raise CompileError ("Don't know how to compile %s" % src_name) if strip_dir: base = os.path.basename (base) if ext in self._rc_extensions: obj_names.append (os.path.join (output_dir, base + self.res_extension)) elif ext in self._mc_extensions: obj_names.append (os.path.join (output_dir, base + self.res_extension)) else: obj_names.append (os.path.join (output_dir, base + self.obj_extension)) return obj_names def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): if not self.initialized: self.initialize() compile_info = self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs) macros, objects, extra_postargs, pp_opts, build = compile_info compile_opts = extra_preargs or [] compile_opts.append ('/c') if debug: compile_opts.extend(self.compile_options_debug) else: compile_opts.extend(self.compile_options) for obj in objects: try: src, ext = build[obj] except KeyError: continue if debug: # pass the full pathname to MSVC in debug mode, # this allows the debugger to find the source file # without asking the user to browse for it src = os.path.abspath(src) if ext in self._c_extensions: input_opt = "/Tc" + src elif ext in self._cpp_extensions: input_opt = "/Tp" + src elif ext in self._rc_extensions: # compile .RC to .RES file input_opt = src output_opt = "/fo" + obj try: self.spawn([self.rc] + pp_opts + [output_opt] + [input_opt]) except DistutilsExecError as msg: raise CompileError(msg) continue elif ext in self._mc_extensions: # Compile .MC to .RC file to .RES file. # * '-h dir' specifies the directory for the # generated include file # * '-r dir' specifies the target directory of the # generated RC file and the binary message resource # it includes # # For now (since there are no options to change this), # we use the source-directory for the include file and # the build directory for the RC file and message # resources. This works at least for win32all. h_dir = os.path.dirname(src) rc_dir = os.path.dirname(obj) try: # first compile .MC to .RC and .H file self.spawn([self.mc] + ['-h', h_dir, '-r', rc_dir] + [src]) base, _ = os.path.splitext (os.path.basename (src)) rc_file = os.path.join (rc_dir, base + '.rc') # then compile .RC to .RES file self.spawn([self.rc] + ["/fo" + obj] + [rc_file]) except DistutilsExecError as msg: raise CompileError(msg) continue else: # how to handle this file? raise CompileError("Don't know how to compile %s to %s" % (src, obj)) output_opt = "/Fo" + obj try: self.spawn([self.cc] + compile_opts + pp_opts + [input_opt, output_opt] + extra_postargs) except DistutilsExecError as msg: raise CompileError(msg) return objects def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): if not self.initialized: self.initialize() (objects, output_dir) = self._fix_object_args(objects, output_dir) output_filename = self.library_filename(output_libname, output_dir=output_dir) if self._need_link(objects, output_filename): lib_args = objects + ['/OUT:' + output_filename] if debug: pass # XXX what goes here? try: self.spawn([self.lib] + lib_args) except DistutilsExecError as msg: raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): if not self.initialized: self.initialize() (objects, output_dir) = self._fix_object_args(objects, output_dir) fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) (libraries, library_dirs, runtime_library_dirs) = fixed_args if runtime_library_dirs: self.warn ("I don't know what to do with 'runtime_library_dirs': " + str (runtime_library_dirs)) lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if output_dir is not None: output_filename = os.path.join(output_dir, output_filename) if self._need_link(objects, output_filename): if target_desc == CCompiler.EXECUTABLE: if debug: ldflags = self.ldflags_shared_debug[1:] else: ldflags = self.ldflags_shared[1:] else: if debug: ldflags = self.ldflags_shared_debug else: ldflags = self.ldflags_shared export_opts = [] for sym in (export_symbols or []): export_opts.append("/EXPORT:" + sym) ld_args = (ldflags + lib_opts + export_opts + objects + ['/OUT:' + output_filename]) # The MSVC linker generates .lib and .exp files, which cannot be # suppressed by any linker switches. The .lib files may even be # needed! Make sure they are generated in the temporary build # directory. Since they have different names for debug and release # builds, they can go into the same directory. if export_symbols is not None: (dll_name, dll_ext) = os.path.splitext( os.path.basename(output_filename)) implib_file = os.path.join( os.path.dirname(objects[0]), self.library_filename(dll_name)) ld_args.append ('/IMPLIB:' + implib_file) if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) self.mkpath(os.path.dirname(output_filename)) try: self.spawn([self.linker] + ld_args) except DistutilsExecError as msg: raise LinkError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) # -- Miscellaneous methods ----------------------------------------- # These are all used by the 'gen_lib_options() function, in # ccompiler.py. def library_dir_option(self, dir): return "/LIBPATH:" + dir def runtime_library_dir_option(self, dir): raise DistutilsPlatformError( "don't know how to set runtime library search path for MSVC++") def library_option(self, lib): return self.library_filename(lib) def find_library_file(self, dirs, lib, debug=0): # Prefer a debugging library if found (and requested), but deal # with it if we don't have one. if debug: try_names = [lib + "_d", lib] else: try_names = [lib] for dir in dirs: for name in try_names: libfile = os.path.join(dir, self.library_filename (name)) if os.path.exists(libfile): return libfile else: # Oops, didn't find it in *any* of 'dirs' return None # Helper methods for using the MSVC registry settings def find_exe(self, exe): """Return path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. """ for p in self.__paths: fn = os.path.join(os.path.abspath(p), exe) if os.path.isfile(fn): return fn # didn't find it; try existing path for p in os.environ['Path'].split(';'): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn return exe def get_msvc_paths(self, path, platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings. The list will be empty if unable to access the registry or appropriate registry keys not found. """ if not _can_read_reg: return [] path = path + " dirs" if self.__version >= 7: key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root, self.__version)) else: key = (r"%s\6.0\Build System\Components\Platforms" r"\Win32 (%s)\Directories" % (self.__root, platform)) for base in HKEYS: d = read_values(base, key) if d: if self.__version >= 7: return self.__macros.sub(d[path]).split(";") else: return d[path].split(";") # MSVC 6 seems to create the registry entries we need only when # the GUI is run. if self.__version == 6: for base in HKEYS: if read_values(base, r"%s\6.0" % self.__root) is not None: self.warn("It seems you have Visual Studio 6 installed, " "but the expected registry settings are not present.\n" "You must at least run the Visual Studio GUI once " "so that these entries are created.") break return [] def set_path_env_var(self, name): """Set environment variable 'name' to an MSVC path type value. This is equivalent to a SET command prior to execution of spawned commands. """ if name == "lib": p = self.get_msvc_paths("library") else: p = self.get_msvc_paths(name) if p: os.environ[name] = ';'.join(p) if get_build_version() >= 8.0: log.debug("Importing new compiler from distutils.msvc9compiler") OldMSVCCompiler = MSVCCompiler from distutils.msvc9compiler import MSVCCompiler # get_build_architecture not really relevant now we support cross-compile from distutils.msvc9compiler import MacroExpander PK!k"# _distutils/dep_util.pynu["""distutils.dep_util Utility functions for simple, timestamp-based dependency of files and groups of files; also, function based entirely on such timestamp dependency analysis.""" import os from distutils.errors import DistutilsFileError def newer (source, target): """Return true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Return false if both exist and 'target' is the same age or younger than 'source'. Raise DistutilsFileError if 'source' does not exist. """ if not os.path.exists(source): raise DistutilsFileError("file '%s' does not exist" % os.path.abspath(source)) if not os.path.exists(target): return 1 from stat import ST_MTIME mtime1 = os.stat(source)[ST_MTIME] mtime2 = os.stat(target)[ST_MTIME] return mtime1 > mtime2 # newer () def newer_pairwise (sources, targets): """Walk two filename lists in parallel, testing if each source is newer than its corresponding target. Return a pair of lists (sources, targets) where source is newer than target, according to the semantics of 'newer()'. """ if len(sources) != len(targets): raise ValueError("'sources' and 'targets' must be same length") # build a pair of lists (sources, targets) where source is newer n_sources = [] n_targets = [] for i in range(len(sources)): if newer(sources[i], targets[i]): n_sources.append(sources[i]) n_targets.append(targets[i]) return (n_sources, n_targets) # newer_pairwise () def newer_group (sources, target, missing='error'): """Return true if 'target' is out-of-date with respect to any file listed in 'sources'. In other words, if 'target' exists and is newer than every file in 'sources', return false; otherwise return true. 'missing' controls what we do when a source file is missing; the default ("error") is to blow up with an OSError from inside 'stat()'; if it is "ignore", we silently drop any missing source files; if it is "newer", any missing source files make us assume that 'target' is out-of-date (this is handy in "dry-run" mode: it'll make you pretend to carry out commands that wouldn't work because inputs are missing, but that doesn't matter because you're not actually going to run the commands). """ # If the target doesn't even exist, then it's definitely out-of-date. if not os.path.exists(target): return 1 # Otherwise we have to find out the hard way: if *any* source file # is more recent than 'target', then 'target' is out-of-date and # we can immediately return true. If we fall through to the end # of the loop, then 'target' is up-to-date and we return false. from stat import ST_MTIME target_mtime = os.stat(target)[ST_MTIME] for source in sources: if not os.path.exists(source): if missing == 'error': # blow up when we stat() the file pass elif missing == 'ignore': # missing source dropped from continue # target's dependency list elif missing == 'newer': # missing source means target is return 1 # out-of-date source_mtime = os.stat(source)[ST_MTIME] if source_mtime > target_mtime: return 1 else: return 0 # newer_group () PK!]II*_distutils/__pycache__/cmd.cpython-311.pycnu[ ,ReExdZddlZddlZddlZddlZddlmZddlmZm Z m Z m Z m Z ddl mZGddZdS) ztdistutils.cmd Provides the Command class, the base class for the command classes in the distutils.command package. N)DistutilsOptionError)utildir_util file_util archive_utildep_utillogceZdZdZgZdZdZdZdZdZ d%d Z d Z e j fd Zd Zd&d Zd&dZdZd&dZdZdZdZdZd'dZd(dZdZdZdZd)dZd*dZ d+dZ d,d Z d'd!Z!d-d"Z" d.d#Z# d/d$Z$dS)0Commanda}Abstract base class for defining command classes, the "worker bees" of the Distutils. A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options are "declared" in 'initialize_options()' and "defined" (given their final values, aka "finalized") in 'finalize_options()', both of which must be defined by every command class. The distinction between the two is necessary because option values might come from the outside world (command line, config file, ...), and any options dependent on other options must be computed *after* these outside influences have been processed -- hence 'finalize_options()'. The "body" of the subroutine, where it does all its work based on the values of its options, is the 'run()' method, which must also be implemented by every command class. cddlm}t||std|jt urt d||_|d|_ |j |_ d|_ d|_ d|_ dS)zCreate and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. r) Distributionz$dist must be a Distribution instancezCommand is an abstract classN)distutils.distr isinstance TypeError __class__r RuntimeError distributioninitialize_options_dry_runverboseforcehelp finalized)selfdistrs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/cmd.py__init__zCommand.__init__3s 0/////$ -- DBCC C >W $ $=>> >  !!! |   c|dkr,t|d|z}|t|j|S|St|)Ndry_run_)getattrrAttributeError)rattrmyvals r __getattr__zCommand.__getattr__csK 9  D#*--E}t0$777  && &r cJ|js|d|_dSNr)rfinalize_optionsrs rensure_finalizedzCommand.ensure_finalizedms)~ $  ! ! # # #r c0td|jz)aSet default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments. This method must be implemented by all command classes. ,abstract method -- subclass %s must overriderrr,s rrzCommand.initialize_options  :T^ K   r c0td|jz)aSet final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'. This method must be implemented by all command classes. r/r0r,s rr+zCommand.finalize_optionss  :T^ K   r Ncddlm}|d|z}|||ztj|dz}|jD]y\}}}||}|ddkr |dd}t||}||d ||ztjzdS) Nr) longopt_xlatezcommand options for '%s':)levelz =z{} = {}) distutils.fancy_getoptr5get_command_nameannounceloggingINFO user_options translater$format)rheaderindentr5optionr#values r dump_optionszCommand.dump_optionss888888 >043H3H3J3JJF fvoW\ :::$"/ X XNVQ%%m44FbzS  D&))E MM&9#3#3FE#B#BB',M W W W W  X Xr c0td|jz)aA command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'. This method must be implemented by all command classes. r/r0r,s rrunz Command.runr1r c0tj||dSNr )rmsgr6s rr;zCommand.announces sr ctddlm}|r/t|tjdSdS)z~Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. r)DEBUGN)distutils.debugrLprintsysstdoutflush)rrJrLs r debug_printzCommand.debug_printsM *)))))   #JJJ J         r ct||}|t||||St|ts$t d||||S)Nz'{}' must be a {} (got `{}`))r$setattrrstrrr@)rrCwhatdefaultvals r_ensure_stringlikezCommand._ensure_stringlikesmdF## ; D&' * * *NC%% &.55fdCHH  r c4||d|dS)zWEnsure that 'option' is a string; if not defined, set it to 'default'. stringN)rY)rrCrWs r ensure_stringzCommand.ensure_strings" ':::::r cPt||}|dSt|tr&t||t jd|dSt|t rtd|D}nd}|s#td ||dS)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+c3@K|]}t|tVdSrI)rrU).0vs r z-Command.ensure_string_list..s,99As++999999r Fz)'{}' must be a list of strings (got {!r})) r$rrUrTresplitlistallrr@)rrCrXoks rensure_string_listzCommand.ensure_string_lists dF## ; F S ! !  D&"(;"<"< = = = = =#t$$ 99S99999 *?FFvsSS  r c||||}|"||std|z||fzdSdS)Nzerror in '%s' option: )rYr)rrCtesterrV error_fmtrWrXs r_ensure_tested_stringzCommand._ensure_tested_stringsX%%fdG<< ?66#;;?&)I5&#F  ???r cT||tjjdddS)z5Ensure that 'option' is the name of an existing file.filenamez$'%s' does not exist or is not a fileN)rkospathisfilerrCs rensure_filenamezCommand.ensure_filenames2 "" BGNJ0V     r cT||tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rkrnroisdirrqs rensure_dirnamezCommand.ensure_dirnames4 ""  GM  7      r cHt|dr|jS|jjS)N command_name)hasattrrwr__name__r,s rr:zCommand.get_command_names( 4 ( ( +$ $>* *r c |j|}||D]4\}}t||t ||t||5dS)a>Set the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'initialize_options()' and 'finalize_options()'. Usually called from 'finalize_options()' for options that depend on some other command rather than another option of the same command. 'src_cmd' is the other command from which option values will be taken (a command object will be created for it if necessary); the remaining arguments are '(src_option,dst_option)' tuples which mean "take the value of 'src_option' in the 'src_cmd' command object, and copy it to 'dst_option' in the current command object". N)rget_command_objr-r$rT)rsrc_cmd option_pairs src_cmd_obj src_option dst_options rset_undefined_optionszCommand.set_undefined_optionss{'77@@ $$&&&(4 L L $ZtZ((0j'+z*J*JKKK L Lr rcd|j||}||S)zWrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object. )rr{r-)rcommandcreatecmd_objs rget_finalized_commandzCommand.get_finalized_command*s3 #33GVDD  """r rc8|j||SrI)rreinitialize_command)rrreinit_subcommandss rrzCommand.reinitialize_command6s 55g?QRRRr c:|j|dS)zRun some other command: uses the 'run_command()' method of Distribution, which creates and finalizes the command object if necessary and then invokes its 'run()' method. N)r run_command)rrs rrzCommand.run_command9s! %%g.....r chg}|jD]'\}}| ||r||(|S)akDetermine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be run for the current distribution. Return a list of command names. ) sub_commandsappend)rcommandscmd_namemethods rget_sub_commandszCommand.get_sub_commands@sI"&"3 * * Xv~~)))r cVtjd||dS)Nzwarning: %s: %s )r warningr:)rrJs rwarnz Command.warnOs) ')>)>)@)@#FFFFFr c@tj||||jdSNr")rexecuter")rfuncargsrJr6s rrzCommand.executeRs# T4dl;;;;;;r c>tj|||jdSr)rmkpathr")rnamemodes rrzCommand.mkpathUs!dDL999999r c Ntj|||||j ||jS)zCopy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't define it.)r)r copy_filerr")rinfileoutfile preserve_modepreserve_timeslinkr6s rrzCommand.copy_fileXs9 "     N L    r c Ntj||||||j |jS)z\Copy an entire directory tree respecting verbose, dry-run, and force flags. r)r copy_treerr")rrrrrpreserve_symlinksr6s rrzCommand.copy_treehs9!      NL    r c:tj|||jS)z$Move a file respecting dry-run flag.r)r move_filer")rsrcdstr6s rrzCommand.move_file~s"3T\BBBBr c8ddlm}||||jdS)z2Spawn an external command respecting dry-run flag.r)spawnrN)distutils.spawnrr")rcmd search_pathr6rs rrz Command.spawns3)))))) c; 555555r c Btj|||||j||S)N)r"ownergroup)r make_archiver")r base_namer@root_dirbase_dirrrs rrzCommand.make_archives5(    L    r c|d|z}t|tr|f}n+t|ttfst d|)d|d|}|jstj ||r| ||||dStj |dS)aSpecial case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the command defined 'self.force', and it is true, then the command is unconditionally run -- does no timestamp checks. Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating {} from {}z, ) rrUrdtuplerr@joinrr newer_grouprr debug)rinfilesrrrexec_msgskip_msgr6s r make_filezCommand.make_files  7'AH gs # # YjGGGdE]33 YWXX X  .55gtyy?Q?QRRH : -gw?? LLtXu 5 5 5 5 5 Ih     r )Nr3rI)r)rr*)r)rrNr)rrrr)rr)NNNN)NNr)%ry __module__ __qualname____doc__rrr(r-rr+rErGr<rLr;rRrYr\rgrkrrrur:rrrrrrrrrrrrrrr rr r so  :L---`'''$         X X X X    #*-.    ;;;; *      +++ LLL*SSSS///   GGG<<<<::::TU    (    ,CCCC6666RV     QR      r r )rrOrnrbr<errorsrr3rrrrr _logr r rr rrs  ((((((??????????????b b b b b b b b b b r PK!@>)-_distutils/__pycache__/errors.cpython-311.pycnu[ ,RedZGddeZGddeZGddeZGddeZGd d eZGd d eZGd deZGddeZ GddeZ GddeZ GddeZ GddeZ GddeZGddeZGddeZGdd eZGd!d"eZGd#d$eZGd%d&eZd'S)(adistutils.errors Provides exceptions used by the Distutils modules. Note that Distutils modules may raise standard exceptions; in particular, SystemExit is usually raised for errors that are obviously the end-user's fault (eg. bad command-line arguments). This module is safe to use in "from ... import *" mode; it only exports symbols whose names start with "Distutils" and end with "Error".ceZdZdZdS)DistutilsErrorzThe root of all Distutils evil.N__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/errors.pyrr s))Dr rceZdZdZdS)DistutilsModuleErrorzUnable to load an expected module, or to find an expected class within some module (in particular, command modules and classes).Nrr r r r r sHH Dr r ceZdZdZdS)DistutilsClassErrorzSome command class (or possibly distribution class, if anyone feels a need to subclass Distribution) is found not to be holding up its end of the bargain, ie. implementing some part of the "command "interface.Nrr r r rrs  Dr rceZdZdZdS)DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.Nrr r r rr"sAADr rceZdZdZdS)DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an error in the command line usage.Nrr r r rr(s(( Dr rceZdZdZdS)DistutilsFileErrorzAny problems in the filesystem: expected file not found, etc. Typically this is for problems that we detect before OSError could be raised.Nrr r r rr/s Dr rceZdZdZdS)DistutilsOptionErroraSyntactic/semantic errors in command options, such as use of mutually conflicting options, or inconsistent options, badly-spelled values, etc. No distinction is made between option values originating in the setup script, the command line, config files, or what-have-you -- but if we *know* something originated in the setup script, we'll raise DistutilsSetupError instead.Nrr r r rr7sBB Dr rceZdZdZdS)DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script, such as invalid keyword arguments to 'setup()'.Nrr r r rrBs77 Dr rceZdZdZdS)DistutilsPlatformErrorzWe don't know how to do something on the current platform (but we do know how to do it on some platform) -- eg. trying to compile C files on a platform not supported by a CCompiler subclass.Nrr r r rrIsDD Dr rceZdZdZdS)DistutilsExecErrorz`Any problems executing an external program (such as the C compiler, when compiling C files).Nrr r r rrQs** Dr rceZdZdZdS)DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this should never be seen if the code is working!).Nrr r r rrXs66 Dr rceZdZdZdS)DistutilsTemplateErrorz%Syntax error in a file list template.Nrr r r r!r!_s////r r!ceZdZdZdS)DistutilsByteCompileErrorzByte compile error.Nrr r r r#r#csr r#ceZdZdZdS)CCompilerErrorz#Some compile/link operation failed.Nrr r r r%r%hs----r r%ceZdZdZdS)PreprocessErrorz.Failure to preprocess one or more C/C++ files.Nrr r r r'r'ls8888r r'ceZdZdZdS) CompileErrorz2Failure to compile one or more C/C++ source files.Nrr r r r)r)ps<<<r1s9DD     Y        >        .        >                        >        .        ^                ^   00000^000 .....Y...99999n999=====>===~  33333~33333r PK!G,G,0_distutils/__pycache__/text_file.cpython-311.pycnu[ ,Re@/,dZddlZGddZdS)ztext_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.NcdeZdZdZddddddddZddZdZd Zdd Zdd Z dd Z d Z dZ dZ dS)TextFileae Provides a file-like object that takes care of all the things you commonly want to do when processing a text file that has some line-by-line syntax: strip comments (as long as "#" is your comment character), skip blank lines, join adjacent lines by escaping the newline (ie. backslash at end of line), strip leading and/or trailing whitespace. All of these are optional and independently controllable. Provides a 'warn()' method so you can generate warning messages that report physical line number, even if the logical line in question spans multiple physical lines. Also provides 'unreadline()' for implementing line-at-a-time lookahead. Constructor is called as: TextFile (filename=None, file=None, **options) It bombs (RuntimeError) if both 'filename' and 'file' are None; 'filename' should be a string, and 'file' a file object (or something that provides 'readline()' and 'close()' methods). It is recommended that you supply at least 'filename', so that TextFile can include it in warning messages. If 'file' is not supplied, TextFile creates its own using 'io.open()'. The options are all boolean, and affect the value returned by 'readline()': strip_comments [default: true] strip from "#" to end-of-line, as well as any whitespace leading up to the "#" -- unless it is escaped by a backslash lstrip_ws [default: false] strip leading whitespace from each line before returning it rstrip_ws [default: true] strip trailing whitespace (including line terminator!) from each line before returning it skip_blanks [default: true} skip lines that are empty *after* stripping comments and whitespace. (If both lstrip_ws and rstrip_ws are false, then some lines may consist of solely whitespace: these will *not* be skipped, even if 'skip_blanks' is true.) join_lines [default: false] if a backslash is the last non-newline character on a line after stripping comments and whitespace, join the following line to it to form one "logical line"; if N consecutive lines end with a backslash, then N+1 physical lines will be joined to form one logical line. collapse_join [default: false] strip leading whitespace from lines that are joined to their predecessor; only matters if (join_lines and not lstrip_ws) errors [default: 'strict'] error handler used to decode the file content Note that since 'rstrip_ws' can strip the trailing newline, the semantics of 'readline()' must differ from those of the builtin file object's 'readline()' method! In particular, 'readline()' returns None for end-of-file: an empty string might just be a blank line (or an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is not.rstrict)strip_comments skip_blanks lstrip_ws rstrip_ws join_lines collapse_joinerrorsNc ||td|jD]:}||vrt||||t|||j|;|D]}||jvrt d|z|||n||_||_d|_g|_ dS)zConstruct a new TextFile object. At least one of 'filename' (a string) and 'file' (a file-like object) must be supplied. They keyword argument options are described above and affect the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r) RuntimeErrordefault_optionskeyssetattrKeyErroropenfilenamefile current_linelinebuf)selfrroptionsopts /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/text_file.py__init__zTextFile.__init__Os   I  ',,.. > >Cg~~c73<0000c4#7#<====<<>> E EC$...=CDDD/ < IIh    $DMDI !D   cb||_t|j|j|_d|_dS)zvOpen a new file named 'filename'. This overrides both the 'filename' and 'file' arguments to the constructor.)r rN)rrr rr)rrs rrz TextFile.openrs1! t{;;; rcf|j}d|_d|_d|_|dS)zfClose the current file and forget everything we know about it (filename, current line number).N)rrrclose)rrs rr!zTextFile.closeys2y    rctg}||j}||jdzt|tt fr&|dt |zn|d|z|t |d|S)Nz, z lines %d-%d: z line %d: )rappendr isinstancelisttuplestrjoin)rmsglineoutmsgs r gen_errorzTextFile.gen_errors <$D dmd*+++ dT5M * * . MM/E$KK7 8 8 8 8 MM+, - - - c#hhwwvrcNtd|||z)Nzerror: ) ValueErrorr-rr*r+s rerrorzTextFile.errors#T^^C%>%>>???rcxtjd|||zdzdS)aPrint (to stderr) a warning message tied to the current logical line in the current file. If the current logical line in the file spans multiple physical lines, the warning refers to the whole range, eg. "lines 3-5". If 'line' supplied, it overrides the current line number; it may be a list or tuple to indicate a range of physical lines, or an integer for a single physical line.z warning:  N)sysstderrwriter-r0s rwarnz TextFile.warns8 t~~c4'@'@@4GHHHHHrc|jr|jd}|jd=|Sd} |j}|dkrd}|jr|r~|d}|dkrnb|dks||dz dkr7|dd krd pd}|d||z}|dkrn|d d}|jr|r||d |S|j r| }||z}t|j tr|j ddz|j d<nZ|j |j dzg|_ nC|dSt|j tr|j ddz|_ n|j dz|_ |jr|jr|}n7|jr| }n|jr|}|dks|d kr |jr|jr5|ddkr |dd}|d dd kr|dd d z}#|S)a=Read and return a single logical line from the current file (or from an internal buffer if lines have previously been "unread" with 'unreadline()'). If the 'join_lines' option is true, this may involve reading multiple physical lines concatenated into a single string. Updates the current line number, so calling 'warn()' after 'readline()' emits a warning about the physical line(s) just read. Returns None on end-of-file, since the empty string can occur if 'rstrip_ws' is true but 'strip_blanks' is not.r#TN#rr\r3z\#z2continuation line immediately precedes end-of-filez\ )rrreadlinerfindstripreplacer r7r lstripr%rr&r r rstripr)rr+ buildup_lineposeols rr=zTextFile.readlines < <#D R K _ 9%%''Drzz"$ 4t$ 4iinn"99AXXcAg$!6!6 8t+5;C#;,Dzz||r)) * <<s33D >< ><IIUVVV''%);;==D#d*d/66S+/+(,(9!(rPsV..  U"U"U"U"U"U"U"U"U"U"rPK!-p!!3_distutils/__pycache__/_collections.cpython-311.pycnu[ ,RetddlZddlZddlZddlZGddeejjZGddeZ dS)Nc8eZdZdZdZdZejZdZ dZ dS) DictStacka A stack of dictionaries that behaves as a view on those dictionaries, giving preference to the last. >>> stack = DictStack([dict(a=1, c=2), dict(b=2, a=2)]) >>> stack['a'] 2 >>> stack['b'] 2 >>> stack['c'] 2 >>> len(stack) 3 >>> stack.push(dict(a=3)) >>> stack['a'] 3 >>> set(stack.keys()) == set(['a', 'b', 'c']) True >>> set(stack.items()) == set([('a', 3), ('b', 2), ('c', 2)]) True >>> dict(**stack) == dict(stack) == dict(a=3, c=2, b=2) True >>> d = stack.pop() >>> stack['a'] 2 >>> d = stack.pop() >>> stack['a'] 1 >>> stack.get('b', None) >>> 'c' in stack True ct|}tttjd|DS)Nc3>K|]}|VdSN)keys).0cs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_collections.py z%DictStack.__iter__..,s*5N5N1affhh5N5N5N5N5N5N)list__iter__iterset itertoolschain from_iterable)selfdictss r rzDictStack.__iter__*sH d##C 555N5N5N5N5NNNOOPPPr cttt|D]}||vr ||cSt |r)reversedtuplerrKeyError)rkeyscopes r __getitem__zDictStack.__getitem__.sWeDMM$$7$78899 " "Ee||Sz!!!smmr cLtjj||Sr) collectionsabcMapping __contains__)rothers r r"zDictStack.__contains__6s&33D%@@@r cTttt|Sr)lenrr)rs r __len__zDictStack.__len__9s4T ##$$$r N) __name__ __module__ __qualname____doc__rrrappendpushr"r&r r rrsjBQQQ ;DAAA%%%%%r rceZdZdZiejfdZedZdZ ddZ dZ dZ e ed d iZGd d eZed ZedZdS)RangeMapaa A dictionary-like object that uses the keys as bounds for a range. Inclusion of the value for that range is determined by the key_match_comparator, which defaults to less-than-or-equal. A value is returned for a key if it is the first key that matches in the sorted list of keys. One may supply keyword parameters to be passed to the sort function used to sort keys (i.e. key, reverse) as sort_params. Let's create a map that maps 1-3 -> 'a', 4-6 -> 'b' >>> r = RangeMap({3: 'a', 6: 'b'}) # boy, that was easy >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') Even float values should work so long as the comparison operator supports it. >>> r[4.5] 'b' But you'll notice that the way rangemap is defined, it must be open-ended on one side. >>> r[0] 'a' >>> r[-1] 'a' One can close the open-end of the RangeMap by using undefined_value >>> r = RangeMap({0: RangeMap.undefined_value, 3: 'a', 6: 'b'}) >>> r[0] Traceback (most recent call last): ... KeyError: 0 One can get the first or last elements in the range by using RangeMap.Item >>> last_item = RangeMap.Item(-1) >>> r[last_item] 'b' .last_item is a shortcut for Item(-1) >>> r[RangeMap.last_item] 'b' Sometimes it's useful to find the bounds for a RangeMap >>> r.bounds() (0, 6) RangeMap supports .get(key, default) >>> r.get(0, 'not found') 'not found' >>> r.get(7, 'not found') 'not found' One often wishes to define the ranges by their left-most values, which requires use of sort params and a key_match_comparator. >>> r = RangeMap({1: 'a', 4: 'b'}, ... sort_params=dict(reverse=True), ... key_match_comparator=operator.ge) >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') That wasn't nearly as easy as before, so an alternate constructor is provided: >>> r = RangeMap.left({1: 'a', 4: 'b', 7: RangeMap.undefined_value}) >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') cXt||||_||_dSr)dict__init__ sort_paramsmatch)rsourcer3key_match_comparators r r2zRangeMap.__init__s) dF###&) r cN||tdtjS)NT)reverse)r3r6)r1operatorge)clsr5s r leftz RangeMap.lefts/s T 2 2 2    r cVt|fi|j}t|tjr|||}nN|||}t||}|tj urt||Sr) sortedrr3 isinstancer/Itemr_find_first_match_r1undefined_valuer)ritem sorted_keysresultrs r rzRangeMap.__getitem__sTYY[[==D,<== dHM * * $%%k$&788FF))+t<rr3r/ first_item last_item)rrDs r boundszRangeMap.boundss=TYY[[==D,<== H/0+h>P2QRRr RangeValueUndefinedr-ceZdZdZdS) RangeMap.Itemz RangeMap ItemN)r'r(r)r*r-r r r@rUsr r@rr)r'r(r)r*r9ler2 classmethodr<rrHrArRtypestrrBintr@rPrQr-r r r/r/>sNN`,.HK****   [       SSS ?dd33455r2>>@@OsaJRIIIr r/) rrJrr9rr r!rr1r/r-r r r\s2%2%2%2%2%ko-2%2%2%lDDDDDtDDDDDr PK!R1VV+_distutils/__pycache__/_log.cpython-311.pycnu[ ,Re+,ddlZejZdS)N)logging getLoggerlog/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_log.pyr s$grPK!6RVV4_distutils/__pycache__/msvc9compiler.cpython-311.pycnu[ ,ReudZddlZddlZddlZddlZddlZddlmZmZm Z m Z m Z ddl m Z mZddlmZddlmZddlZejdeejZejZejZejZejejej ej!fZ"ej#d ko ej$d kZ%e%rd Z&d Z'd Z(ndZ&dZ'dZ(dddZ)GddZ*GddZ+dZ,dZ-dZ.dZ/ddZ0e,Z1Gdde Z2dS) a distutils.msvc9compiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio 2008. The module is compatible with VS 2005 and VS 2008. You can find legacy support for older versions of VS in distutils.msvccompiler. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_lib_options)log) get_platformzmsvc9compiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case.win32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFrameworkx86amd64r z win-amd64ceZdZdZdZeeZdZeeZdZeeZdZe eZdS)Regz-Helper class to read values from the registryctD](}|||}|r||vr ||cS)t|N)HKEYS read_valuesKeyError)clspathkeybaseds /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/msvc9compiler.py get_valuez Reg.get_valueNsN  Dd++A SAXXv smmc t||}n#t$rYdSwxYwg}d} t||}n#t$rYnwxYw|||dz }=|S)zReturn list of registry keys.NrTr) RegOpenKeyExRegError RegEnumKeyappend)rrrhandleLiks r read_keysz Reg.read_keysWs !$,,FF   44     vq))     HHQKKK FA  s !!; AAc, t||}n#t$rYdSwxYwi}d} t||\}}}n#t$rYnIwxYw|}|||||<|dz }k|S)z`Return dict of registry keys and values. All names are converted to lowercase. NrTr)r!r" RegEnumValuelower convert_mbcs) rrrr%rr'namevaluetypes rrzReg.read_valuesjs  !$,,FF   44     $0$;$;!eTT    ::<> NN-t{M J J J NN?K9O P P P P PAA B B$T1--AAH A&&MM$3(?(?@@56y\ 122 B Bs2BB)8D  DDcp|jD]\}}|||}|Sr)rBitemsreplace)rFr6r(vs rsubzMacroExpander.subs;K%%''  DAq !QAArN)r8r9r:rHrKrEr`r>rrr@r@sV""" @@@BBB>rr@cvd}tj|}|dkrdS|t|z}tj|ddd\}}t |dddz }|dkr|dz }t |d d d z }|dkrd }|dkr||zSdS) zReturn the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. zMSC v.N r g$@r)sysrGfindlensplitint)prefixr'r6rest majorVersion minorVersions rget_build_versionrrs F   ABwwq CKKAk!""o##C++GAtq"v;;?Lr q1v;;%Lq ql** 4rcg}|D]:}tj|}||vr||;|S)znReturn a list of normalized paths with duplicates removed. The current order of paths is maintained. )osrnormpathr$)paths reduced_pathsrZnps rnormalize_and_reduce_pathsrysS M %% W  a  ] " "   $ $ $ rc|tj}g}|D]}||vr||tj|}|S)z3Remove duplicate values of an environment variable.)rlrtpathsepr$join)variableoldListnewListr' newVariables rremoveDuplicatesrs`nnRZ((GG  G   NN1   *//'**K rct|z} td|zd}n&#t$rt jdd}YnwxYw|rt j|sd|z}t j |d}|rt j|rt j |t j t j d}t j |}t j|st jd|zdSnt jd|z|st jd dSt j |d }t j|r|St jd dS) zFind the vcvarsall.bat file At first it tries to find the productdir of VS 2008 in the registry. If that fails it falls back to the VS90COMNTOOLS env var. z %s\Setup\VCrNz%Unable to find productdir in registryNzVS%0.f0COMNTOOLSVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz vcvarsall.batUnable to find vcvarsall.bat)rCrrrr debugrtrisdirenvirongetr|pardirabspathisfile)rGrDrNtoolskeytoolsdir vcvarsalls rfind_vcvarsallrs w F]]>F#:LII  9:::   ERW]]:66 E%/:>>(D11  E h// Eh 29dKKJ44J7==,,  7*DEEEt  I88C D D D  '(((t Z99I w~~i  I,--- 4s+ A Act|}hd}i}|tdtjd||t jd||tjtj} |\}}| dkr"t| d| d}| d D]}t |}d |vr!|}| d d \} } | } | |vr;| t"jr | dd } t'| || < |j|jn7#|j|jwxYwt/|t/|kr;t1t3t5||S) z?Launch vcvarsall.bat and read the settings from its environment>librincludelibpathNrz'Calling 'vcvarsall.bat %s' (version=%s)z "{}" {} & set)stdoutstderrrr3 =rrb)rrr r subprocessPopenrYPIPE communicatewaitr2rlrr-stripr,endswithrtr{rrcloserrk ValueErrorstrlistkeys) rGarchr interestingresultpopenrrlinerr/s rquery_vcvarsallrs'w''I777K F$%CDDDI7wGGG  y$//   E **,, ::<<1  (v)>)>?? ?v&&LL&& 6 6D##D))D$::<>"*--'!#2#JE.u55s  6       6{{c+&&&&T&++--0011222 Ms =DG4HceZdZdZdZiZdgZgdZdgZdgZ eezeze zZ dZ dZ d Z d Zd xZZd Zdfd ZddZd dZ d!dZ d"dZ d#dZdZdZdZdZdZdZd$dZdZxZ S)% MSVCCompilerztConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.msvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exerct|||t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF) superrHVERSION_MSVCCompiler__version_MSVCCompiler__root_MSVCCompiler__paths plat_name_MSVCCompiler__arch initialized)rFverbosedry_runforce __class__s rrHzMSVCCompiler.__init__^sP '5111 8    rNcJ|jr Jd|jdkrtd|jz|t}d}||vr"td|dt jvrHdt jvr:|dr%d|_d |_ d |_ d |_ d |_ nj|tks|d krt|}n*ttdzt|z}tt|}|dt j|_|dt jd<|dt jd<t'|jdkrtd|jz|d|_|d |_ |d |_ |d |_ |d |_ t jddD]}|j|n#t,$rYnwxYwt/|j|_d|jt jd<d|_|jdkrgd|_gd|_ngd|_gd|_gd|_|jdkr gd|_dg|_d|_dS)Nzdon't init multiple timesrRz(VC %0.1f is not supported by this modulerz--plat-name must be one of {}DISTUTILS_USE_SDKMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer _rrrrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.;r)/nologo/O2/MD/W3/DNDEBUG)r/Od/MDdr/Z7/D_DEBUG)rrrr/GS-r)rrrrrrr)/DLLrz/INCREMENTAL:NO)rrz/INCREMENTAL:noz/DEBUGrT) rrrr rYrtrfind_execclinkerrrcmcPLAT_TO_VCVARSrrrlr{rrk_MSVCCompiler__productr$rryr|preprocess_optionsrcompile_optionscompile_options_debugldflags_sharedldflags_shared_debugldflags_static)rFrok_plats plat_specvc_envrZs r initializezMSVCCompiler.initializeisB#@@%@@@@ >C  (:T^K   $I' H $ $(/66x@@  2: - -2:%% h''& DG$DK DHDGDGG LNN**i7.B.B*95 #<>>2S8>);TT%Wi88F!&>// ;;DL &u BJu $*9$5BJy !4<  A%%,GIMX mmH--DG-- 33DK}}Y//DHmmH--DGmmH--DG  Z'--c22 ' ' ##A&&&& '    D 1$,??  XXdl33 6"& ;%  #O#O#OD ***D & &$X#W#WD ***D &EDD >Q  (X(X(XD %(ks-AI00 I=<I=c|d}g}|D]s}tj|\}}tj|d}|tj|d}||jvrt d|z|rtj|}||jvr<| tj |||j z||j vr=| tj |||j z8| tj |||j zu|S)NrrzDon't know how to compile %s)rtrsplitext splitdriveisabssrc_extensionsrbasename_rc_extensionsr$r| res_extension_mc_extensions obj_extension)rFsource_filenames strip_dir output_dir obj_namessrc_namerexts robject_filenameszMSVCCompiler.object_filenamessf  J ( V VH'**844KT37%%d++A.D d++--.D$---##AH#LMMM .w''--d)))  j$AS:S!T!TUUUU+++  j$AS:S!T!TUUUU  j$AS:S!T!TUUUUrc |js||||||||} | \}} }} } |pg} | d|r| |jn| |j| D]I} | |\}}n#t$rYwxYw|rtj |}||j vrd|z}n||j vrd|z}n||j vrQ|}d|z} ||jg| z|gz|gzn!#t $r}t#|d}~wwxYw||jvrtj |}tj |} ||jgd|d|gz|gztj tj |\}}tj ||dz}||jgd|zgz|gzn!#t $r}t#|d}~wwxYwt#d||d |z} ||jg| z| z||gz|z*#t $r}t#|d}~wwxYw| S) Nz/cz/Tcz/Tpz/foz-hz-rrz"Don't know how to compile {} to {}z/Fo)rr_setup_compiler$extendrrrrtrr _c_extensions_cpp_extensionsrspawnrrrrdirnamerrrr|rYr)rFsourcesrrB include_dirsr extra_preargsextra_postargsdepends compile_infoobjectspp_optsbuild compile_optsobjsrcr input_opt output_optmsgh_dirrc_dirrrrc_files rcompilezMSVCCompiler.compilesw  OO   **  gw  ;G7%$* D!!!  6    : ; ; ; ;    4 5 5 5A (A (C  :SS     +gooc**d(((!CK ,,,!CK +++ "S[ ,JJy72j\AYKOPPPP),,,&s+++,+++,,-- ,JJyD%v+FF#NOOO g..rw/?/?/D/DEEGD! gll64%<@@GJJyECK=8G9DEEEE),,,&s+++,#8??SIIJ ( WI"#!*-.% %& ( ( ("3''' (s[ B  B-,B-&D)) E3EEB.I I! II!)J:: KKKc|js||||\}}|||}|||rN|d|zgz}|r ||jg|zdS#t$r}t|d}~wwxYwtj d|dS)N)r/OUT:skipping %s (up-to-date)) rr_fix_object_argslibrary_filename _need_linkrrrrr r) rFroutput_libnamerr target_langoutput_filenamelib_argsrs rcreate_static_libzMSVCCompiler.create_static_libJs  OO    $ 5 5gz J J*//:/VV ??7O 4 4 C'O";!<|js||||\}}||||}|\}}}|r%|dt |zt ||||}| tj ||}| ||rD|tj kr"| r|j dd}n!|jdd}n| r|j }n|j}g}|pgD]}|d|z||z|z|zd|zgz}tj|d} |tjtj|\}}tj | ||}|d|z||| || r| |dd<| r|| |tj| ||jg|zn!#t2$r}t5|d}~wwxYw|||}|Y|\}}d||} |dd d ||gdS#t2$r}t5|d}~wwxYwdSt;jd |dS) Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r rz/IMPLIB:z-outputresource:{};{}zmt.exez-nologoz -manifestr )rrr  _fix_lib_argswarnrr rtrr|rr EXECUTABLErrr$rrrr manifest_setup_ldargsrmkpathrrrrmanifest_get_embed_inforYr r)rF target_descrrr libraries library_dirsruntime_library_dirsexport_symbolsrrr build_tempr fixed_argslib_optsldflags export_optssymld_argsdll_namedll_ext implib_filermfinfo mffilenamemfidout_args rlinkzMSVCCompiler.link^sz"  OO    $ 5 5gz J J*'' W=XX 44J)&(g&6&6G$$_55''#7!gll:t7L7LX7V7VWW zK7888  & & G L L L ,+  /~... KK88 9 9 9 % DK=723333% % % %nn$ %11+wGGF!#) D188$OO)JJ)[*gVWWWWW))))#C..() "! I0/ B B B B Bs0I44 J>J  J K%% L/K>>Lctj|tj|dz}|d|zdS)Nz .manifest/MANIFESTFILE:)rtrr|rr$)rFrr r& temp_manifests rrz"MSVCCompiler.manifest_setup_ldargssS ((99KG   '-788888rc|D]5}|dr|ddd}n6dS|tjkrd}nd}||}|dS||fS)Nr0:rrg) startswithrlr r_remove_visual_c_ref)rFrr&argr1r,s rrz$MSVCCompiler.manifest_get_embed_infos   C~~.//  # #q 1 1! 4   4 ). . .DDD 55mDDM  4d""rcz t|} |}|n#|wxYwtjdtj}tj|d|}d}tj|d|}tjdtj}tj||dSt|d} ||||S#|wxYw#t$rYdSwxYw)NzU|)rz*\s*zI|)w) openreadrrerDOTALLr`searchwriteOSError)rF manifest_file manifest_f manifest_bufpatterns rr5z!MSVCCompiler._remove_visual_c_refsP' m,,J #)00   """"   """"jD G 6'2|<D,D))D,, D:9D:c d|zS)Nz /LIBPATH:r>rFdirs rlibrary_dir_optionzMSVCCompiler.library_dir_options S  rc td)Nz>'**#"NNNNN# # 4rc|jD]b}tjtj||}tj|r|cSctjddD]b}tjtj||}tj|r|cSc|S)aReturn path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. Pathr)rrtrr|rrrrl)rFexerZfns rrzMSVCCompiler.find_exe,s  Abgooa00#66Bw~~b!!   F#))#..  Abgooa00#66Bw~~b!!    r)rrrr)rr)NNNrNNN)NrN) NNNNNrNNNN)r)!r8r9r:r; compiler_type executablesrrrrrrrstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionrHrrrrr.rrr5rGrIrKrRr __classcell__)rs@rrrAs33MKFM---OWNWN#_4~EVNMM!!,22)M ! ! ! ! ! !e e e e R8]]]]@NRCCCC2!]C]C]C]C~ 9 9 9###0(((\!!!   ***$rr)r)3r;rtrrir;warningserrorsrrrrr ccompilerr r _logr utilr winregrDeprecationWarning OpenKeyExr!EnumKeyr# EnumValuer+errorr" HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrplatformmaxsize NATIVE_WIN64rCrXrWrrr@rrryrrrrrr>rrrqsz  21111111  4  ^  <      |w&>3;+>  3CGJK>HH6G>K2H  ?.?.?.?.?.?.?.?.D++++++++\4      F''''V    9rPK!e7vii3_distutils/__pycache__/msvccompiler.cpython-311.pycnu[ ,Re\ZdZddlZddlZddlZddlmZmZmZmZm Z ddl m Z m Z ddl mZdZ ddlZdZeZejZejZejZejZnP#e$rH ddlZddlZdZeZejZejZejZejZn#e$rejd YnwxYwYnwxYwerejejej ej!fZ"ej#d e$d Z%d Z&d Z'GddZ(dZ)dZ*dZ+Gdde Z,e)dkr ej-de,Z.ddl/m,Z,ddl/m(Z(dSdS)zdistutils.msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting Make sure that Python modules winreg, win32api or win32con are installed.zmsvccompiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case.c t||}n#t$rYdSwxYwg}d} t||}n#t$rYnwxYw|||dz }=|S)zReturn list of registry keys.NrTr) RegOpenKeyExRegError RegEnumKeyappend)basekeyhandleLiks /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/msvccompiler.py read_keysrJsdC(( tt A A 61%%AA    E    Q  Hs !!; AAc t||}n#t$rYdSwxYwi}d} t||\}}}n#t$rYn=wxYw|}t ||t |<|dz }_|S)zXReturn dict of registry keys and values. All names are converted to lowercase. NrTr)r r RegEnumValuelower convert_mbcs)rrrdrnamevaluetypes r read_valuesr!\s dC(( tt A A  ,VQ 7 7 D%    E zz|| ,U 3 3,t   Q Hs !!? A  A cft|dd}| |d}n#t$rYnwxYw|S)Ndecodembcs)getattr UnicodeError)sdecs rrrrsQ !Xt $ $C  F AA    D  Hs ! ..c&eZdZdZdZdZdZdS) MacroExpanderc>i|_||dSN)macros load_macros)selfversions r__init__zMacroExpander.__init__}s#  !!!!!cjtD]*}t||}|r|||jd|z<dS+dS)Nz$(%s))HKEYSr!r-)r/macropathrrrs r set_macrozMacroExpander.set_macrosR  DD$''A /0v GeO,   r2c6d|z}|d|dzd|d|dzdd}|d|d  |d kr|d |d n|d |d n#t$rtdwxYwd}tD]h} t ||}n#t $rY wxYwt |d}t|d||}|d|j d<idS)Nz%Software\Microsoft\VisualStudio\%0.1f VCInstallDirz \Setup\VC productdir VSInstallDirz \Setup\VSz Software\Microsoft\.NETFramework FrameworkDir installrootg@FrameworkSDKDirzsdkinstallrootv1.1sdkinstallrootaPython was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz{}\{}r0z$(FrameworkVersion)) r7KeyErrorrr4r rrr!formatr-) r/r0vsbasenetprhrrs rr.zMacroExpander.load_macrossh9GC ~v ' > >D  q))    Q""CD(//!S"9"9::A129DK- . . > >s5B B$3C CCcp|jD]\}}|||}|Sr,)r-itemsreplace)r/r'rvs rsubzMacroExpander.subs;K%%''  DAq !QAAr2N)__name__ __module__ __qualname__r1r7r.rJr2rr*r*|sP""">>>:r2r*cvd}tj|}|dkrdS|t|z}tj|ddd\}}t |dddz }|dkr|dz }t |d d d z }|dkrd }|dkr||zSdS) zReturn the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. zMSC v.N r g$@r)sysr0findlensplitint)prefixrr'rest majorVersion minorVersions rget_build_versionr`s F   ABwwq CKKAk!""o##C++GAtq"v;;?Lr q1v;;%Lq ql** 4r2cd}tj|}|dkrdStjd|}tj|t|z|S)zUReturn the processor architecture. Possible results are "Intel" or "AMD64". z bit (rPIntel))rWr0rXrY)r\rjs rget_build_architectureres_ F   ABwww a  A ;q3v;;* ++r2cg}|D]:}tj|}||vr||;|S)znReturn a list of normalized paths with duplicates removed. The current order of paths is maintained. )osr6normpathr)paths reduced_pathsrDnps rnormalize_and_reduce_pathsrlsS M %% W  a  ] " "   $ $ $ r2ceZdZdZdZiZdgZgdZdgZdgZ eezeze zZ dZ dZ d Z d Zd xZZd Zdfd ZdZddZ d dZ d!dZ d"dZdZdZdZd#dZdZd$dZdZxZS)% MSVCCompilerztConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.msvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercht|||t|_t |_|jdkrC|jdkr!d|_t|j|_nd|_d|jz|_ nd|jdzz|_ d|_ dS) NrbzSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %srQF) superr1r`_MSVCCompiler__versionre_MSVCCompiler__arch_MSVCCompiler__rootr*_MSVCCompiler__macros_MSVCCompiler__product initialized)r/verbosedry_runforce __class__s rr1zMSVCCompiler.__init__s '5111*,,,.. ;' ! !~""@ -dn = = = 7$.HDNN9DNQQ  (X(X(XD % %)))D % )ksAF F#"F#c|d}g}|D]s}tj|\}}tj|d}|tj|d}||jvrt d|z|rtj|}||jvr<| tj |||j z||j vr=| tj |||j z8| tj |||j zu|S)NrrzDon't know how to compile %s)rgr6splitext splitdriveisabssrc_extensionsrbasename_rc_extensionsrr res_extension_mc_extensions obj_extension)r/source_filenames strip_dir output_dir obj_namessrc_namerexts robject_filenameszMSVCCompiler.object_filenamesdsf  J ( V VH'**844KT37%%d++A.D d++--.D$---##AH#LMMM .w''--d)))  j$AS:S!T!TUUUU+++  j$AS:S!T!TUUUU  j$AS:S!T!TUUUUr2Nc |js||||||||} | \}} }} } |pg} | d|r| |jn| |j| D]I} | |\}}n#t$rYwxYw|rtj |}||j vrd|z}n||j vrd|z}n||j vrQ|}d|z} ||jg| z|gz|gzn!#t $r}t#|d}~wwxYw||jvrtj |}tj |} ||jgd|d|gz|gztj tj |\}}tj ||dz}||jgd|zgz|gzn!#t $r}t#|d}~wwxYwt#d||d |z} ||jg| z| z||gz|z*#t $r}t#|d}~wwxYw| S) Nz/cz/Tcz/Tpz/foz-hz-rrpz"Don't know how to compile {} to {}z/Fo)ryr_setup_compilerextendrrr@rgr6abspath _c_extensions_cpp_extensionsrspawnrrrrdirnamerrrrrAr)r/sourcesrr- include_dirsdebug extra_preargsextra_postargsdepends compile_infoobjectspp_optsbuild compile_optsobjsrcr input_opt output_optmsgh_dirrc_dirr_rc_files rcompilezMSVCCompiler.compile}sw  OO   **  gw  ;G7%$* D!!!  6    : ; ; ; ;    4 5 5 5A (A (C  :SS     +gooc**d(((!CK ,,,!CK +++ "S[ ,JJy72j\AYKOPPPP),,,&s+++,+++,,-- ,JJyD%v+FF#NOOO g..rw/?/?/D/DEEGD! gll64%<@@GJJyECK=8G9DEEEE),,,&s+++,#8??SIIJ ( WI"#!*-.% %& ( ( ("3''' (s[ B  B-,B-&D)) E3EEB.I I! II!)J:: KKKc|js||||\}}|||}|||rN|d|zgz}|r ||jg|zdS#t$r}t|d}~wwxYwtj d|dS)N)r/OUT:skipping %s (up-to-date)) ryr_fix_object_argslibrary_filename _need_linkrrrrr r) r/routput_libnamerr target_langoutput_filenamelib_argsrs rcreate_static_libzMSVCCompiler.create_static_libs  OO    $ 5 5gz J J*//:/VV ??7O 4 4 C'O";!<W=XX )&(g&6&6G$$_55''#7!gllGOOGAJ//1F1Fx1P1P zK7888 ,+  /~... KK88 9 9 9 % DK=7233333% % % %nn$ % I0/ B B B B Bs<I I:&I55I:c d|zS)Nz /LIBPATH:rNr/dirs rlibrary_dir_optionzMSVCCompiler.library_dir_optionEs S  r2c td)Nz>'**#"NNNNN# # 4r2c|jD]b}tjtj||}tj|r|cSctjddD]b}tjtj||}tj|r|cSc|S)aReturn path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. Pathr)rrgr6rrisfilerrZ)r/exerDfns rrzMSVCCompiler.find_exebs  Abgooa00#66Bw~~b!!   F#))#..  Abgooa00#66Bw~~b!!    r2x86ctsgS|dz}|jdkr!d|j|j}n |jd|d}tD]q}t ||}|r]|jdkr5|j||dcS||dcSr|jdkr9tD]1}t |d|jz| d n2gS) zGet a list of devstudio directories (include, lib or path). Return a list of strings. The list will be empty if unable to access the registry or appropriate registry keys not found. z dirsrrz8{}\{:0.1f}\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz.\6.0\Build System\Components\Platforms\Win32 (z )\DirectoriesrrQz%s\6.0NzIt seems you have Visual Studio 6 installed, but the expected registry settings are not present. You must at least run the Visual Studio GUI once so that these entries are created.) _can_read_regrtrArvr4r!rwrJrZr)r/r6platformrrrs rrzMSVCCompiler.get_msvc_pathsxsL  Ig~ >Q  MTT CC/3kkk888E   . .DD#&&A .>Q&&=,,QtW55;;C@@@@@T7==-----  . >Q    tY%<==III= EJ r2c|dkr|d}n||}|r$d|tj|<dSdS)zSet environment variable 'name' to an MSVC path type value. This is equivalent to a SET command prior to execution of spawned commands. rlibraryrN)rrrgr)r/rrDs rrzMSVCCompiler.set_path_env_varsc 5==##I..AA##D))A  +"xx{{BJt    + +r2)rrr)rr)NNNrNNN)NrN) NNNNNrNNNN)r)r) rKrLrM__doc__ compiler_type executablesrrrrrrrstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionr1rrrrrrrrrrrr __classcell__)r}s@rrnrns33MKFM---OWNWN#_4~EVNMM!!,22)M!!!!!!$O O O f8]]]]@NRCCCC2!OCOCOCOCj!!!   ***$,((((T + + + + + + +r2rng @z3Importing new compiler from distutils.msvc9compiler)rn)r*)0r rWrgwarningserrorsrrrrr ccompilerr r _logr r winreghkey_mod OpenKeyExr EnumKeyr EnumValuererrorr ImportErrorwin32apiwin32coninfo HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTr4rDeprecationWarningrr!rr*r`rerlrnrOldMSVCCompilerdistutils.msvc9compilerrNr2rr+s 21111111  MMMMH#LJ#L|HH     , ( , >     2     *"#"  E 4    $   ,   ,,,,,,,,^4 , , ,   L+L+L+L+L+9L+L+L+^# CICDDD"O44444465555555 s5$AB (BB BB BB B PK!3PwVwV0_distutils/__pycache__/sysconfig.cpython-311.pycnu[ ,ReVIdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dej vZ ejejZejejZejejZejejZdejvr&ejejdZnNejr8ejejejZnejZd Zeed dZ d Z!ej"d kr!e d Z#e#eZe#e Z dZ$e$Z%dZ& e%sej'Z&n #e($rYnwxYwdZ)d$dZ*dZ+dZ,dZ-dZ.dZ/dZ0d%dZ1dZ2dZ3dZ4d&dZ5ej6dZ7ej6dZ8ej6dZ9d&d Z:d!Z;dadS)'aProvide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are also available. Written by: Fred L. Drake, Jr. Email: N)DistutilsPlatformError) py39compat) pass_none__pypy___PYTHON_PROJECT_BASEctj|dtfddDS)z] Return True if the target directory appears to point to an un-installed Python. Modulesc3fK|]+}|V,dSN)joinpathis_file).0fnmoduless /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/sysconfig.py z(_is_python_source_dir..2s=QQ"w##++--QQQQQQ)Setupz Setup.local)pathlibPathr any)drs @r_is_python_source_dirr,sD l1oo&&y11G QQQQ8PQQQ Q QQr_homectj|tj|S)z, Return True if a is a parent of b. )ospathnormcase startswith)dir_adir_bs r _is_parentr#8s8 7  E " " - -bg.>.>u.E.E F FFrntc\ttf}fd|D}t|S)Nc3xK|]4}ttj|d0|V5dS)PCbuildN)r#rrjoin)rprefixrs rrz_fix_pcbuild..EsW  !RW\\&)<<==       r)PREFIX BASE_PREFIXnext)rprefixesmatcheds` r _fix_pcbuildr/AsI;&    "    GQrc`trttSttSr ) _sys_homer project_baserr _python_buildr4Ps&0$Y///  . ..rc0dtjddzS)zReturn a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. z%d.%dN)sys version_infor3rrget_python_versionr:fs S%bqb) ))rc|rtnt}||n|} tdtj}n*#t $rt dtjzwxYw||||S)aReturn the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pyconfig.h). If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. N_get_python_inc_zFI don't know where Python installs its C header files on platform '%s')BASE_EXEC_PREFIXr+globalsrnameKeyErrorr) plat_specificr)default_prefixresolved_prefixgetters rget_python_incrEns*7G%%KN & 2ffO 7bg778    $ !# )    6/6= 9 99s !:'A!ctr0tjdkr tj|dSt |pt||pt|S)Ninclude) IS_PYPYr8r9rrr(_get_python_inc_posix_python_get_python_inc_from_config_get_python_inc_posix_prefixr) spec_prefixrAs r_get_python_inc_posixrQs_/3#f,,w||FI...$]33 0 &}k B B 0 ' / /rctsdS|rtptStjt dd}tj|S)z Assume the executable is in the build directory. The pyconfig.h file should be in the same directory. Since the build directory may not be the source directory, use "srcdir" from the makefile to find the "Include" directory. NsrcdirInclude) python_buildr1r2rrr(get_config_varnormpath)rAincdirs rrLrLsW )(L( W\\.22I > >F 7  F # ##rc4|td|zdzSdS)aj If no prefix was explicitly specified, provide the include directory from the config vars. Useful when cross-compiling, since the config vars may come from the host platform Python installation, while the current Python executable is from the build platform installation. >>> monkeypatch = getfixture('monkeypatch') >>> gpifc = _get_python_inc_from_config >>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower) >>> gpifc(False, '/usr/bin/') >>> gpifc(False, '') >>> gpifc(False, None) 'includepy' >>> gpifc(True, None) 'confincludepy' NCONF INCLUDEPY)rV)rArPs rrMrMs*&f}4{BCCCrctrdnd}|tztz}tj|d|S)NpypypythonrJ)rKr: build_flagsrrr()r)implementation python_dirs rrNrNs>&4VVHN"4"6"66DJ 7<< : 6 66rctrStj|dtjjztj|dzStj|dS)NrJPC)rUrrr(pathseprOs r_get_python_inc_ntres`  GLL + +go gll64(( ) 7<< * **rcJ|r|Stj|dS)N site-packages)rrr() standard_lib libpython early_prefixr)s r _posix_librks&8w||I777rctrltjdkr\|t}|r1tj|dtjdStj|dS|}|#|r|rtpt}n|rtpt}tj dkrj|s|rttdd}nd}trd nd }tj|||tz}t||||Stj d krC|r tj|d Stj|d dStd tj z)aSReturn the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. rGNz lib-pythonrrgposix platlibdirlibr]r^r$Libz?I don't know where Python installs its library on platform '%s')rKr8r9r*rrr(versionr=r+ EXEC_PREFIXr?getattrr:rkr)rArhr)rjlibdirr`ris rget_python_libruss53#f,, >F  F7<< ck!nEE Ew||FO444L ~  ="7'7F;FF"2{>H 2:  D!B  " "Cx"*Y"77HHCx(*HcF"   x/ !    rz ! !h&:&>&>x&N&N !  $ $BJx,@ $ A A A(4%%%g('rc trktjdkr-tjt pt d}nt pt }tj|dStjS)z2Return full pathname of installed pyconfig.h file.r$rcz pyconfig.h) rUrr?rr(r1r2 sysconfigget_config_h_filename)inc_dirs rrrbs`1 7d??gll9#< dCCGG/O2O2O!g-- % #4 ?33%''DGd3!!%%'')),E!+AGGII+.5=Ee||(- /$'JJE*/DJJ *777).DJJJ7$DM??5113d122hBS6S6S#'8D#4//-2T DMMa 0"dHHJJJ   1 a   ggiiDGHHTNNN Hs$!B66#CC-I!I&%I&c$ t|pt|}|rV|\}}|d|||dz||dz}nn|S)aExpand Makefile-style variables -- "${foo}" or "$(foo)" -- in 'string' according to 'vars' (a dictionary mapping variable names to values). Variables not present in 'vars' are silently expanded to the empty string. The variable values in 'vars' should not contain further variable expansions; if 'vars' is the output of 'parse_makefile()', you're fine. Returns a variable-expanded version of 's'. TrrN)rrrspanrr)srrbegrs rexpand_makefile_varsrs    " " tjat jt|r d|DntS)aWith no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. NcBg|]}t|Sr3)rr)rr?s r z#get_config_vars..s& 4 4 4tL  T " " 4 4 4r)rrrcopyradd_ext_suffix)argss rrr sT 0227799 !,///8< N 4 4t 4 4 4 4,Nrc|dkr ddl}|dtdt|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) SOrNz SO is deprecated, use EXT_SUFFIXr7)warningswarnDeprecationWarningrr)r?rs rrVrVsH  t|| 8:LaPPP     & &&r)rN)rrNr )?__doc__rrer8rrrrr5r _functoolsrbuiltin_module_namesrKrrWr)r* exec_prefixrr base_prefixr+base_exec_prefixr=rabspathr2 executabledirnamegetcwdrrsr1r#r?r/r4rUr_abiflagsAttributeErrorr:rErQrLrMrNrerkrurrrrcompilerrrrrrrrVr3rrrs   ******!!!!!! 0 0   #* % %gs// gs// 7##C$899 RZ''7??2:.D#EFFLL ~#wrws~'F'FGG !ry{{ RRR GC$ ' ' GGG7d??  Y  < --L Y''I/// }   #l     D ***::::. $ $ $ DDD.777 + + +8883 3 3 3 lY5Y5Y5x 1 1 1--- 0000rz?@@ rz:;; rz899 j j j j Z   2 OOO$ ' ' ' ' 's: FF  F PK! *_distutils/__pycache__/log.cpython-311.pycnu[ ,RedZddlZddlZddlmZejZejZejZej Z ej Z ejZej Z ej Z ej ZejZejZdZdZGddejZdS) zb A simple log mechanism styled after PEP 282. Retained for compatibility and should not be used. N)logcFtj}tj||SN) _global_loglevelsetLevel)rorigs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/log.py set_thresholdr s  D Kc|dkrttjdS|dkrttjdS|dkrttjdSdS)Nrr)r loggingWARNINFODEBUG)vs r set_verbosityr!sfAvvgl##### agl##### agm$$$$$ r cteZdZdZeffd ZedZejdZe j j Z xZ S)LogzJdistutils.log.Log is deprecated, please use an alternative from `logging`.ctjtjt t |dS)Nr)warningswarnr__doc__super__init____name__)self threshold __class__s r rz Log.__init__-s8 ck""" 33333r c|jSrr)r s r r!z Log.threshold1s zr c0||dSr)r )r rs r r!z Log.threshold5s er )r __module__ __qualname__rrrpropertyr!setterrLoggerwarningr __classcell__)r"s@r rr*sTT!%444444X > !DDDDDr r)rrr_logrrrrrERRORFATALdebuginfor*rerrorfatalr rr)rr r r4s $$$$$$  ||  o %%%"""""'."""""r PK!> E E/_distutils/__pycache__/filelist.cpython-311.pycnu[ ,Re5dZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z GddZ d Z Gd d eZejfd Zd ZddZdS)zsdistutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. N convert_path)DistutilsTemplateErrorDistutilsInternalError)logcneZdZdZddZdZejfdZdZ dZ dZ d Z d Z d Zd ZddZddZdS)FileListaA list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. Instance attributes: dir directory from which files will be taken -- only used if 'allfiles' not supplied to constructor files list of filenames currently being built/filtered/manipulated allfiles complete list of files under consideration (ie. without any filtering applied) Nc"d|_g|_dSN)allfilesfiles)selfwarn debug_prints /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/filelist.py__init__zFileList.__init__ s  c||_dSr )r )rr s r set_allfileszFileList.set_allfiles&s   rc.t||_dSr )findallr )rdirs rrzFileList.findall)s  rc8ddlm}|rt|dSdS)z~Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. r)DEBUGN)distutils.debugrprint)rmsgrs rrzFileList.debug_print,s7 *)))))   #JJJJJ  rc:|j|dSr )rappend)ritems rr zFileList.append7s $rc:|j|dSr )rextend)ritemss rr#zFileList.extend:s %     rctttjj|j}g|_|D]-}|jtjj|.dSr )sortedmapospathsplitrr join)rsortable_files sort_tuples rsortz FileList.sort=saBGM4: > >?? ( 9 9J J  bglJ7 8 8 8 8 9 9rctt|jdz ddD])}|j||j|dz kr|j|=*dS)Nrr)rangelenr)ris rremove_duplicateszFileList.remove_duplicatesFsZs4:*Ar22 " "Az!} 1q5 111JqM " "rc|}|d}dx}x}}|dvr:t|dkrtd|zd|ddD}n|dvrOt|dkrtd |zt|d}d |ddD}nQ|d vr;t|dkrtd |zt|d}ntd |z||||fS)Nr)includeexcludeglobal-includeglobal-excludez&'%s' expects ...c,g|]}t|Sr.0ws r z1FileList._parse_template_line..Y;;;A Q;;;rr)recursive-includerecursive-excludez,'%s' expects
...c,g|]}t|Sr<rr=s rr@z1FileList._parse_template_line..`rAr)graftprunez#'%s' expects a single zunknown action '%s')r*r2rr)rlinewordsactionpatternsr dir_patterns r_parse_template_linezFileList._parse_template_lineNsM q'+++3 O O O5zzA~~,)GHH H#{33rc||\}}}}|dkr^|dd|z|D].}||dst jd|/dS|dkr^|dd|z|D].}||dst jd |/dS|d kr^|d d|z|D].}||d st jd |/dS|dkr^|dd|z|D].}||d st jd|/dS|dkrr|d|d||D]1}|||sd}t j|||2dS|dkrp|d|d||D]/}|||st jd||0dS|dkrH|d|z|d|st jd|dSdS|dkrH|d|z|d|st jd|dSdStd|z)Nr6zinclude  r)anchorz%warning: no files found matching '%s'r7zexclude z9warning: no previously-included files found matching '%s'r8zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr9zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionrBzrecursive-include {} {})prefixz:warning: no files found matching '%s' under directory '%s'rCzrecursive-exclude {} {}zNwarning: no previously-included files matching '%s' found under directory '%s'rFzgraft z+warning: no directories found matching '%s'rGzprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s') rMrr+include_patternrwarningexclude_patternformatr)rrHrJrKrrLpatternrs rprocess_template_linezFileList.process_template_linelsL 04/H/H/N/N,3 Y     Z#((8*<*<< = = =# R R++GA+>>RK GQQQ R Ry   Z#((8*<*<< = = =#  ++GA+>>K2   ' ' '   .(1C1CC D D D#  ++GA+>>K7   ' ' '   .(1C1CC D D D#  ++GA+>>KB   * * *   6==c388HCUCUVV W W W# 3 3++GC+@@3WKWc222  3 3* * *   6==c388HCUCUVV W W W#  ++GC+@@K>    w     X 3 4 4 4''['AA X I;WWWWW X Xw     X 3 4 4 4''['AA  P   )9FB rrrcDd}t||||}|d|jz|j||jD]K}||r4|d|z|j|d}L|S)aSelect strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform- dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found, False otherwise. Fz%include_pattern: applying regex r'%s'Nz adding T)translate_patternrrVr rsearchrr )rrVrPrQis_regex files_found pattern_renames rrRzFileList.include_patterns4 &wII  @:CUUVVV = LLNNNM # #D  && #  d!2333 !!$'''" rcTd}t||||}|d|jztt |jdz ddD]O}||j|r-|d|j|z|j|=d}P|S)aRemove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found, False otherwise. Fz%exclude_pattern: applying regex r'%s'rr0z removing T)rYrrVr1r2rrZ)rrVrPrQr[r\r]r3s rrTzFileList.exclude_patterns &wII  @:CUUVVVs4:*B33 # #A  A// #   1 !=>>>JqM" r)NNrNr)__name__ __module__ __qualname____doc__rrr(curdirrrr r#r.r4rMrWrRrTr<rrr r s   !!!)%%%%   !!!999"""444basedirsrfiles r z#_find_all_simple.. s^%6T4QVIM T4  r) _UniqueDirsfilterr(walkr)isfile)r) all_uniqueresultss r_find_all_simplerssZ##BGDd$C$C$CDDJ:DG "'.' * **rc.eZdZdZdZedZdS)rmz Exclude previously-seen dirs from walk results, avoiding infinite recursion. Ref https://bugs.python.org/issue44497. c|\}}}tj|}|j|jf}||v}|r|dd=||| S)z Given an item from an os.walk result, determine if the item represents a unique dir for this instance and if not, prevent further traversal. N)r(statst_devst_inoadd)r walk_itemrirjrrv candidatefounds r__call__z_UniqueDirs.__call__sb &dEwt}}K, T!  QQQ yrc2t||Sr )rn)clsr$s rrnz_UniqueDirs.filter)scceeU###rN)rarbrcrdr} classmethodrnr<rrrmrmsH   $$[$$$rrmct|}|tjkr5tjtjj|}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rsr(re functoolspartialr)relpathr'list)rrmake_rels rrr.sR S ! !E bi$RW_C@@@He$$ ;;rctj|}tj}tjdkrd}d|z}t jd||}|S)zTranslate a shell-like glob pattern to a regular expression; return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). \z\\\\z\1[^%s]z((?>CHH+DDE f 6T>>CE S__s3xx-G GH &--eYZQTUU  K"))%CJJLL1IJJJ :j ! !!rr`)rdr(rrrutilrerrorsrr_logrr rssetrmrerrrYr<rrrs&  BBBBBBBBqqqqqqqqn+++$$$$$#$$$6    .""""""""""""rPK![++0_distutils/__pycache__/ccompiler.cpython-311.pycnu[ ,ReϸdZddlZddlZddlZddlmZmZmZmZm Z ddl m Z ddl m Z ddl mZddlmZdd lmZmZdd lmZGd d Zd ZddZddddddZdZddZdZdZdS)zdistutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.N) CompileError LinkErrorUnknownFileErrorDistutilsPlatformErrorDistutilsModuleError)spawn) move_file)mkpath) newer_group) split_quotedexecute)logcPeZdZdZdZdZdZdZdZdZ dZ dZ ddddddZ gdZ gZ gZ dDd Zd Zd Zd Zd ZdEdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dEdZ$dZ%dZ&d Z'd!Z( dFd"Z) dGd#Z*d$Z+ dHd%Z,d&Z-d'Z.d(Z/ dId)Z0 dId*Z1 dId+Z2 dJd,Z3d-Z4d.Z5d/Z6 dKd0Z7dLd1Z8dMd3Z9e:d4Z;d5ZdMd7Z?dMd8Z@ dNd:ZAdOd<ZBd=ZCd>ZDdPd?ZEd@ZFdAZGdQdCZHdS)R CCompileraAbstract base class to define the interface that must be implemented by real compiler classes. Also has some utility methods used by several compiler classes. The basic idea behind a compiler abstraction class is that each instance can be used for all the compile/link steps in building a single project. Thus, attributes common to all of those compile and link steps -- include directories, macros to define, libraries to link against, etc. -- are attributes of the compiler instance. To allow for variability in how individual files are treated, most of those attributes may be varied on a per-compilation or per-link basis. Ncc++objc).cz.ccz.cppz.cxxz.m)rrrrc ||_||_||_d|_g|_g|_g|_g|_g|_g|_ |j D]#}| ||j |$dSN) dry_runforceverbose output_dirmacros include_dirs libraries library_dirsruntime_library_dirsobjects executableskeysset_executable)selfrrrkeys /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py__init__zCCompiler.__init__is     %'! #((** < K  DAw$ FAAtr)c|D]~}t|trOt|dvr>t|dts|dt|dtst d|zdzdzdS)zEnsures that every element of 'definitions' is a valid macro definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do nothing if all definitions are OK, raise TypeError otherwise. )rrNrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r1tuplelenr2 TypeError)r% definitionsr8s r'_check_macro_definitionsz"CCompiler._check_macro_definitionss   D4'' II''#DGS11(59!W_tAw,,6E 6=FG&' 6E  r)c|||}||j|=|j||fdS)a_Define a preprocessor macro for all compilations driven by this compiler object. The optional parameter 'value' should be a string; if it is not supplied, then the macro will be defined without an explicit value and the exact outcome depends on the compiler used (XXX true? does ANSI say anything about this?) Nr9rappend)r%r6r4r7s r' define_macrozCCompiler.define_macrosE   T " " = A D%=)))))r)c~||}||j|=|f}|j|dS)aUndefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefinitions). If the macro is redefined/undefined on a per-compilation basis (ie. in the call to 'compile()'), then that takes precedence. NrB)r%r6r7undefns r'undefine_macrozCCompiler.undefine_macrosH   T " " = A 6"""""r)c:|j|dS)zAdd 'dir' to the list of directories that will be searched for header files. The compiler is instructed to search directories in the order in which they are supplied by successive calls to 'add_include_dir()'. N)rrCr%dirs r'add_include_dirzCCompiler.add_include_dir!   %%%%%r)c$|dd|_dS)aySet the list of directories that will be searched to 'dirs' (a list of strings). Overrides any preceding calls to 'add_include_dir()'; subsequence calls to 'add_include_dir()' add to the list passed to 'set_include_dirs()'. This does not affect any list of standard include directories that the compiler may search by default. Nrr%dirss r'set_include_dirszCCompiler.set_include_dirss!Gr)c:|j|dS)aAdd 'libname' to the list of libraries that will be included in all links driven by this compiler object. Note that 'libname' should *not* be the name of a file containing a library, but the name of the library itself: the actual filename will be inferred by the linker, the compiler, or the compiler class (depending on the platform). The linker will be instructed to link against libraries in the order they were supplied to 'add_library()' and/or 'set_libraries()'. It is perfectly valid to duplicate library names; the linker will be instructed to link against libraries as many times as they are mentioned. N)rrC)r%libnames r' add_libraryzCCompiler.add_librarys  g&&&&&r)c$|dd|_dS)zSet the list of libraries to be included in all links driven by this compiler object to 'libnames' (a list of strings). This does not affect any standard system libraries that the linker may include by default. N)r)r%libnamess r' set_librarieszCCompiler.set_librariess "!!!r)c:|j|dS)a'Add 'dir' to the list of directories that will be searched for libraries specified to 'add_library()' and 'set_libraries()'. The linker will be instructed to search for libraries in the order they are supplied to 'add_library_dir()' and/or 'set_library_dirs()'. N)rrCrIs r'add_library_dirzCCompiler.add_library_dirrLr)c$|dd|_dS)zSet the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default. N)rrOs r'set_library_dirszCCompiler.set_library_dirs&s !Gr)c:|j|dS)zlAdd 'dir' to the list of directories that will be searched for shared libraries at runtime. N)r rCrIs r'add_runtime_library_dirz!CCompiler.add_runtime_library_dir-s! !((-----r)c$|dd|_dS)zSet the list of directories to search for shared libraries at runtime to 'dirs' (a list of strings). This does not affect any standard search path that the runtime linker may search by default. N)r rOs r'set_runtime_library_dirsz"CCompiler.set_runtime_library_dirs3s %)G!!!r)c:|j|dS)zAdd 'object' to the list of object files (or analogues, such as explicitly named library files or the output of "resource compilers") to be included in every link driven by this compiler object. N)r!rC)r%objects r'add_link_objectzCCompiler.add_link_object;s F#####r)c$|dd|_dS)zSet the list of object files (or analogues) to be included in every link to 'objects'. This does not affect any standard object files that the linker may include by default (such as system libraries). N)r!)r%r!s r'set_link_objectszCCompiler.set_link_objectsCs qqqz r)c||||\}}}|g}||d|}t|t|ksJt||}i} t t|D]p} || } || } t j| d} |t j | | | f| | <q||||| fS)z;Process arguments and decide which source files to compile.Nr) strip_dirrr) _fix_compile_argsobject_filenamesr=gen_preprocess_optionsrangeospathsplitextr dirname)r%outdirrincdirssourcesdependsextrar!pp_optsbuildr7srcobjexts r'_setup_compilezCCompiler._setup_compilePs"&"8"8"Q"Q =E''1'PP7||s7||++++(99s7||$$ $ $A!*C!*C'""3''*C KK,, - - -sE#JJww55r)c8|dgz}|rdg|dd<|r||dd<|S)Nz-cz-gr)r%rtdebugbeforecc_argss r' _get_cc_argszCCompiler._get_cc_argsgs?TF"  !&GBQBK  ! GBQBKr)c||j}n$t|tstd||j}n1t|t r ||jpgz}ntd||j}nEt|t tfrt ||jpgz}ntd||jjz }|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it with 'self.macros'; ensures that 'include_dirs' is a list, and augments it with 'self.include_dirs'. Guarantees that the returned values are of the correct type, i.e. for 'output_dir' either string or None, and for 'macros' and 'include_dirs' either list or None. N%'output_dir' must be a string or Nonez/'macros' (if supplied) must be a list of tuplesz6'include_dirs' (if supplied) must be a list of strings) rr1r2r>rlistrr<r,)r%rrrs r'rgzCCompiler._fix_compile_argsps  JJJ,, ECDD D >[FF  % % Ot{0b1FFMNN N  ,LL  tUm 4 4 V --1B1HbILLTUU U 33 6<//r)c||||}t|t|ksJ|ifS)a,Decide which source files must be recompiled. Determine the list of object files corresponding to 'sources', and figure out which ones really need to be recompiled. Return a list of all object files and a dictionary telling which source files can be skipped. )r)rhr=)r%rqrrrr!s r' _prep_compilezCCompiler._prep_compilesE''J'GG7||s7||++++{r)ct|ttfstdt|}||j}n$t|t std||fS)zTypecheck and fix up some arguments supplied to various methods. Specifically: ensure that 'objects' is a list; if output_dir is None, replace with self.output_dir. Return fixed versions of 'objects' and 'output_dir'. z,'objects' must be a list or tuple of stringsNr)r1rr<r>rr2)r%r!rs r'_fix_object_argszCCompiler._fix_object_argssq 'D%=11 LJKK Kw--  JJJ,, ECDD D$$r)c||j}nEt|ttfrt||jpgz}nt d||j}nEt|ttfrt||jpgz}nt d||jjz }||j}nEt|ttfrt||jpgz}nt d|||fS)a;Typecheck and fix up some of the arguments supplied to the 'link_*' methods. Specifically: ensure that all arguments are lists, and augment them with their permanent versions (eg. 'self.libraries' augments 'libraries'). Return a tuple with fixed versions of all arguments. Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr1rr<r>rr,r )r%rrr s r' _fix_lib_argszCCompiler._fix_lib_argss'  II  D%= 1 1 SY4>+?R@IIQRR R  ,LL  tUm 4 4 V --1B1HbILLTUU U 33  '#'#< ,tUm < < #'(<#=#=)/R$ S <)=>>r)cl|jrdS|jrt||d}nt||}|S)zjReturn true if we need to relink the files listed in 'objects' to recreate 'output_file'. Tnewer)missing)rrr )r%r! output_filers r' _need_linkzCCompiler._need_linksG : 4| :#G['JJJ#G[99Lr)cNt|ts|g}d}t|j}|D]s}tj|\}}|j|} |j |}||kr|}|}d#t$rYpwxYw|S)z|Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job. N) r1rr=language_orderrkrlrm language_mapgetindexr+) r%rqlangrsourcebaserxextlangextindexs r'detect_languagezCCompiler.detect_languages'4(( iGD'((  F((00ID#'++C00G .44W==e##"D$E     s0$B B"!B"cdS)aPreprocess a single C/C++ source file, named in 'source'. Output will be written to file named 'output_file', or stdout if 'output_file' not supplied. 'macros' is a list of macro definitions as for 'compile()', which will augment the macros set with 'define_macro()' and 'undefine_macro()'. 'include_dirs' is a list of directory names that will be added to the default list. Raises PreprocessError on failure. Nr{)r%rrrr extra_preargsextra_postargss r' preprocesszCCompiler.preprocesss $ r)c |||||||\}} }} } || ||} | D]9} | | \}}n#t$rYwxYw|| ||| || :| S)aK Compile one or more source files. 'sources' must be a list of filenames, most likely C/C++ files, but in reality anything that can be handled by a particular compiler and compiler class (eg. MSVCCompiler can handle resource files in 'sources'). Return a list of object filenames, one per source filename in 'sources'. Depending on the implementation, not all source files will necessarily be compiled, but all corresponding object filenames will be returned. If 'output_dir' is given, object files will be put under it, while retaining their original path component. That is, "foo/bar.c" normally compiles to "foo/bar.o" (for a Unix implementation); if 'output_dir' is "build", then it would compile to "build/foo/bar.o". 'macros', if given, must be a list of macro definitions. A macro definition is either a (name, value) 2-tuple or a (name,) 1-tuple. The former defines a macro; if the value is None, the macro is defined without an explicit value. The 1-tuple case undefines a macro. Later definitions/redefinitions/ undefinitions take precedence. 'include_dirs', if given, must be a list of strings, the directories to add to the default include file search path for this compilation only. 'debug' is a boolean; if true, the compiler will be instructed to output debug symbols in (or alongside) the object file(s). 'extra_preargs' and 'extra_postargs' are implementation- dependent. On platforms that have the notion of a command-line (e.g. Unix, DOS/Windows), they are most likely lists of strings: extra command-line arguments to prepend/append to the compiler command line. On other platforms, consult the implementation class documentation. In any event, they are intended as an escape hatch for those occasions when the abstract compiler framework doesn't cut the mustard. 'depends', if given, is a list of filenames that all targets depend on. If a source file is older than any file in depends, then the source file will be recompiled. This supports dependency tracking, but only at a coarse granularity. Raises CompileError on failure. )ryrKeyError_compile)r%rqrrrr|rrrrr!rtrur~rwrvrxs r'compilezCCompiler.compilesz;?:M:M  gw; ; 7%##GUMBB K KC  :SS     MM#sC.' J J J Js A  AAcdS)zCompile 'src' to product 'obj'.Nr{)r%rwrvrxr~rrts r'rzCCompiler._compile\s  r)cdS)a&Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libraries()', and the libraries supplied as 'libraries' (if any). 'output_libname' should be a library name, not a filename; the filename will be inferred from the library name. 'output_dir' is the directory where the library file will be put. 'debug' is a boolean; if true, debugging information will be included in the library (note that on most platforms, it is the compile step where this matters: the 'debug' flag is included here just for consistency). 'target_lang' is the target language for which the given objects are being compiled. This allows specific linkage time treatment of certain languages. Raises LibError on failure. Nr{)r%r!output_libnamerr| target_langs r'create_static_libzCCompiler.create_static_libbs 2 r) shared_objectshared_library executablect)auLink a bunch of stuff together to create an executable or shared library file. The "bunch of stuff" consists of the list of object files supplied as 'objects'. 'output_filename' should be a filename. If 'output_dir' is supplied, 'output_filename' is relative to it (i.e. 'output_filename' can provide directory components if needed). 'libraries' is a list of libraries to link against. These are library names, not filenames, since they're translated into filenames in a platform-specific way (eg. "foo" becomes "libfoo.a" on Unix and "foo.lib" on DOS/Windows). However, they can include a directory component, which means the linker will look in that specific directory rather than searching all the normal locations. 'library_dirs', if supplied, should be a list of directories to search for libraries that were specified as bare library names (ie. no directory component). These are on top of the system default and those supplied to 'add_library_dir()' and/or 'set_library_dirs()'. 'runtime_library_dirs' is a list of directories that will be embedded into the shared library and used to search for other shared libraries that *it* depends on at run-time. (This may only be relevant on Unix.) 'export_symbols' is a list of symbols that the shared library will export. (This appears to be relevant only on Windows.) 'debug' is as for 'compile()' and 'create_static_lib()', with the slight distinction that it actually matters on most platforms (as opposed to 'create_static_lib()', which includes a 'debug' flag mostly for form's sake). 'extra_preargs' and 'extra_postargs' are as for 'compile()' (except of course that they supply command-line arguments for the particular linker being used). 'target_lang' is the target language for which the given objects are being compiled. This allows specific linkage time treatment of certain languages. Raises LinkError on failure. NotImplementedError)r% target_descr!output_filenamerrrr export_symbolsr|rr build_temprs r'linkzCCompiler.links v"!r)c |tj|||d||||||| | | | dS)Nshared)lib_type)rrSHARED_LIBRARYlibrary_filename) r%r!rrrrr rr|rrrrs r'link_shared_libzCCompiler.link_shared_libsa  $   ! !.8 ! D D              r)c \|tj||||||||| | | | dSr)rr SHARED_OBJECT) r%r!rrrrr rr|rrrrs r'link_shared_objectzCCompiler.link_shared_objectsN  #                r)c |tj|||||||d||| d| dSr)rr EXECUTABLEexecutable_filename) r%r!output_prognamerrrr r|rrrs r'link_executablezCCompiler.link_executables\    $ $_ 5 5              r)ct)zkReturn the compiler option to add 'dir' to the list of directories searched for libraries. rrIs r'library_dir_optionzCCompiler.library_dir_option! "!r)ct)zsReturn the compiler option to add 'dir' to the list of directories searched for runtime libraries. rrIs r'runtime_library_dir_optionz$CCompiler.runtime_library_dir_option'rr)ct)zReturn the compiler option to add 'lib' to the list of libraries linked into the shared library or executable. r)r%libs r'library_optionzCCompiler.library_option-rr)cddl}|g}|g}|g}|g}|d|d\}}tj|d} |D]} | d| z| d|z| n#| wxYw ||g| } n%#t$rYtj|d SwxYw tj|n#tj|wxYw | | d || tjtj |j pd d n1#ttf$rY| D]} tj| d SwxYw | D]} tj| n#| D]} tj| wxYwdS)zReturn a boolean indicating whether funcname is supported on the current platform. The optional arguments can be used to augment the compilation environment. rNrT)textwz#include "%s" z=int main (int argc, char **argv) { %s(); return 0; } rNFza.out)rr)tempfilemkstemprkfdopenwritecloserrremoverrljoinrrr>) r%funcnameincludesrrrrfdfnamefinclr!fns r' has_functionzCCompiler.has_function3s[   H  L  I  L$$T8$$?? E Ib#     6 6-45555 GG      GGIIIIAGGIIII llE7lFFGG    Ie        Ie    BIe       IL !    Ibgll4?#8b'BB C C C C9%      "      D   "  g   "  ts`5BB&*CC> C% C>$C%%C>>DE+1:F7+F<F7FF77Gct)aHSearch the specified list of directories for a static or shared library file 'lib' and return the full path to that file. If 'debug' true, look for a debugging version (if that makes sense on the current platform). Return None if 'lib' wasn't found in any of the specified directories. r)r%rPrr|s r'find_library_filezCCompiler.find_library_fileps "!r)rcJdtfd|DS)Nrc3FK|]}|VdSr)_make_out_path).0src_namerr%rfs r' z-CCompiler.object_filenames..sI      Ix @ @      r))r)r%source_filenamesrfrs` ``r'rhzCCompiler.object_filenamessR  J      ,      r)cLt|j|jSr)dictfromkeyssrc_extensions obj_extension)r%s r'out_extensionszCCompiler.out_extensionss}}T0$2DEEEr)cxtj|\}}||} |j|}n1#t $r$t d||wxYw|rtj|}tj |||zS)Nz"unknown file type '{}' (from '{}')) rkrlrm_make_relativer LookupErrorrformatbasenamer)r%rrfrrrxnew_exts r'rzCCompiler._make_out_pathsG$$X.. c""4(( )#.GG   "4;;CJJ    *7##D))Dw||Jw777s A.A5ctj|d}|tj|dS)z In order to ensure that a filename always honors the indicated output_dir, make sure it's relative. Ref python/cpython#37775. rN)rkrl splitdriveisabs)rno_drives r'rzCCompiler._make_relatives=7%%d++A. h//1122r)c|J|rtj|}tj|||jzSr)rkrlrrshared_lib_extensionr%rrfrs r'shared_object_filenamez CCompiler.shared_object_filenamesI%%%  2w''11Hw||J43L(LMMMr)c|J|rtj|}tj|||jpdzS)Nr)rkrlrr exe_extensionrs r'rzCCompiler.executable_filenamesN%%%  2w''11Hw||JD4F4L"(MNNNr)staticc<|Jd}|t|vrtd|t||dz}t||dz}tj|\}} || |fz} |rd}tj||| S)Nz)"static", "shared", "dylib", "xcode_stub"z'lib_type' must be _lib_format_lib_extensionr)evalr+getattrrkrlsplitr) r%rSrrfrexpectedfmtrxrJrfilenames r'rzCCompiler.library_filenames%%%> 4>> ) )=8==>> >dH}455dH'7788GMM'** T$$  Cw||JX666r)rc.tj|dSr)rr|)r%msglevels r'announcezCCompiler.announces #r)c8ddlm}|rt|dSdS)Nr)DEBUG)distutils.debugrprint)r%rrs r' debug_printzCCompiler.debug_prints5))))))   #JJJJJ  r)cJtjd|zdS)Nz warning: %s )sysstderrr)r%rs r'warnzCCompiler.warns# 3./////r)c4t||||jdSr)rr)r%funcargsrrs r'rzCCompiler.executesdC.....r)c .t|fd|ji|dS)Nr)r r)r%cmdr.s r'r zCCompiler.spawns% c224<2622222r)c0t|||jSN)r)r r)r%rvdsts r'r zCCompiler.move_filesc4<8888r)c4t|||jdSr)r r)r%r6modes r'r zCCompiler.mkpathstT4<000000r))rrrr)NNNNN)NNNrNNN)NrN) NNNNNrNNNN)NNNNrNNN)NNNN)r)rr)rrr)r)Nr)r)Ir- __module__ __qualname____doc__ compiler_typerrstatic_lib_extensionrstatic_lib_formatshared_lib_formatrrrrrr(r/r$r9r@rDrGrKrQrTrWrYr[r]r_rbrdryrrgrrrrrrrrrrrrrrrrrrrrrrhpropertyrr staticmethodrrrrrr rrr r r r{r)r'rrs  *M2NMM L*))NLL"<"<"<"compiler_classr#rCsort print_help)r> compilersr/pretty_printers r'show_compilersrE3s322222I"''))VV+0$x8PQR8STUUUU NN [++N<=====r)c| tj} |t|}t|\}}}n,#t$rd|z}||d|zz}t |wxYw d|z}t |tj|} t| |} n?#t$rtd|zt$rtd|d|dwxYw| d||S) a[Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional Unix interface" (UnixCCompiler class) and Visual C++ (MSVCCompiler class). Note that it's perfectly possible to ask for a Unix compiler object under Windows, and a Microsoft compiler object under Unix -- if you supply a value for 'compiler', 'plat' is ignored. Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz distutils.z4can't compile C/C++ code: unable to load module '%s'z0can't compile C/C++ code: unable to find class 'z ' in module '') rkr6r0r@rr __import__r modulesvars ImportErrorr) platr/rrr module_name class_namelong_descriptionrmoduleklasss r' new_compilerrRDsG |w *  +D11H6DX6N3j"2"2 ***EL  -88C$S))) *  "[0 ;[)V Z(    " B[ P       "" * KKK 9     5w & &&s"3)A ;BrC)rrrtmacrorJs r'ririrs*G225%(( Q#e**-A-A-A-A-A-A-A-AHJOP  u::?? NN6E!H, - - - - ZZ1__Qxva01111 y50111%%v|$$$$ Nr)c*g}|D]*}|||+|D]G}||}t|tr||z}2||H|D]}t j|\}} |rH||g| } | r|| U| d|zn|| ||S)acGenerate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a list of command-line options suitable for use with some compiler (depending on the two format strings passed in). z6no library file corresponding to '%s' found (skipping)) rCrrr1rrkrlrrrr) r/rr rlib_optsrJoptrlib_dirlib_namelib_files r'gen_lib_optionsr[sBH::33C889999#!!11#66 c4  !#~HH OOC  : : gmmC00(  :117)XFFH )))) ORUU OOH33C88 9 9 9 9 Or))NN)NNrrr)rr rkr+errorsrrrrrr file_utilr dir_utilr dep_utilr utilr r_logrrr*r0r@rErRrir[r{r)r'rbs11   !!!!!!''''''''\1\1\1\1\1\1\1\1F8 O E  E">>>"+'+'+'+'\***Z%%%%%r)PK!FkMoo/_distutils/__pycache__/__init__.cpython-311.pycnu[ ,RegddlZddlZejd\ZZZ ejddS#e$rYdSwxYw)N _distutils_system_mod)sys importlibversion partition __version___ import_module ImportError/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/__init__.pyrsy K))#.. Q I344444   DD s:AAPK!8((/_distutils/__pycache__/dir_util.cpython-311.pycnu[ ,RerdZddlZddlZddlmZmZddlmZiad dZ d dZ dd Z d Z dd Z d ZdS)zWdistutils.dir_util Utility functions for manipulating directories and directory trees.N)DistutilsInternalErrorDistutilsFileError)logc t|ts"td|tj|}g}tj|s|dkr|St tj |r|Stj |\}}|g}|r||rztj|s[tj |\}}| d||r!|rtj|[|D])}tj ||}tj |} t | r]|dkrtjd||s t j||ny#t"$rl} | jt$jkrtj|s.t)d|| jdYd} ~ nd} ~ wwxYw||dt| <+|S) aCreate a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout. Return the list of directories actually created. os.makedirs is not used because: a) It's new to Python 1.5.2, and b) it blows up if the directory already exists (in which case it should silently succeed). z*mkpath: 'name' must be a string (got {!r})rrz creating %szcould not create '{}': {}N) isinstancestrrformatospathnormpathisdir _path_createdgetabspathsplitinsertjoinrinfomkdirOSErrorerrnoEEXISTrargsappend) namemodeverbosedry_run created_dirsheadtailtailsdabs_headexcs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/dir_util.pymkpathr+sk( dC  $ 8 ? ? E E    7  D ! !DL w}}Tdbjj..//7==&<4 FE 4 d 3 3w}}T** t Q 4 d 3 3$$w||D!$$7??4((   X & &   a<< H]D ) ) ) & t$$$$    U\11bgmmD6I6I1,3::4"NN21111     % % %"# h sG// I%9A"I  I%c t}|D]R}|tj|tj|St |D]}t||||dS)aCreate all the empty directories under 'base_dir' needed to put 'files' there. 'base_dir' is just the name of a directory which doesn't necessarily exist yet; 'files' is a list of filenames to be interpreted relative to 'base_dir'. 'base_dir' + the directory portion of every file in 'files' will be created if it doesn't already exist. 'mode', 'verbose' and 'dry_run' flags are as for 'mkpath()'. r!r"N)setaddrrrdirnamesortedr+)base_dirfilesr r!r"need_dirfiledirs r* create_treer7WsuuHDD RW\\(BGOOD,A,ABBCCCCh<<sD'7;;;;;<<c ddlm}|s1tj|st d|z tj|} nD#t$r7} |rg} n(t d|| j Yd} ~ nd} ~ wwxYw|st||g} | D]I} tj || } tj || }| drY|r|tj | r]tj| }|dkrtjd |||stj||| |tj| r,| t)| ||||||| "|| |||||| | |K| S) aCopy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is created with 'mkpath()'. The end result of the copy is that every file in 'src' is copied to 'dst', and directories under 'src' are recursively copied to 'dst'. Return the list of files that were copied or might have been copied, using their output name. The return value is unaffected by 'update' or 'dry_run': it is simply the list of all files under 'src', with the names changed to be under 'dst'. 'preserve_mode' and 'preserve_times' are the same as for 'copy_file'; note that they only apply to regular files, not to directories. If 'preserve_symlinks' is true, symlinks will be copied as symlinks (on platforms that support them!); otherwise (the default), the destination of the symlink will be copied. 'update' and 'verbose' are the same as for 'copy_file'. r) copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '{}': {}N)r!z.nfsrzlinking %s -> %sr-)distutils.file_utilr:rrrrlistdirrr strerrorr+r startswithislinkreadlinkrrsymlinkrextend copy_tree)srcdst preserve_modepreserve_timespreserve_symlinksupdater!r"r:nameseoutputsnsrc_namedst_name link_dests r*rCrCksQ:.----- Q27==--Q !IC!OPPP 3   EE$188ajII  EEEE %sG$$$$G '%'%7<<Q''7<<Q'' <<      %!9!9 % H--I!||+XyAAA 0 9h/// NN8 $ $ $ $ W]]8 $ $ % NN!"%##        I     NN8 $ $ $ $ NsA B-B  Bctj|D]}tj||}tj|r0tj|st ||q|tj|f|tj |fdS)zHelper for remove_tree().N) rr<rrrr?_build_cmdtuplerremovermdir)r cmdtuplesfreal_fs r*rRrRs Z  22dA&& 7==  2)?)? 2 FI . . . .   bi0 1 1 1 1 bh%&&&&&r8ch|dkrtjd||rdSg}t|||D]}} |d|dtj|d}|t vrt |=Q#t$r }tjd||Yd}~vd}~wwxYwdS)zRecursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true). rz'removing '%s' (and everything under it)Nrzerror removing %s: %s) rrrRrrrrrwarning) directoryr!r"rUcmdrr)s r* remove_treer\s!|| :IFFFIIy)))AA A CF3q6NNNgooc!f--G-''!'* A A A K/C @ @ @ @ @ @ @ @ AAAsA B B/B**B/ctj|\}}|ddtjkr ||ddz}|S)zTake the full path 'path', and make it a relative path. This is useful to make 'path' the second argument to os.path.join(). rrN)rr splitdrivesep)rdrives r*ensure_relativerasI '$$T**KE4 AaCyBFtABBx Kr8)rrr)rrrrrr)rr)__doc__rrerrorsrr_logrrr+r7rCrRr\rar8r*rfsGG >>>>>>>> EEEEP<<<<. YYYYx'''AAAA2r8PK!vtsO+_distutils/__pycache__/dist.cpython-311.pycnu[ ,Re dZddlZddlZddlZddlZddlZddlZddlmZ ddl Z n #e $rdZ YnwxYwddl m Z m Z mZmZddlmZmZddlmZmZmZddlmZdd lmZejd Zd ZGd d ZGddZdZ dS)z}distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. N)message_from_file)DistutilsOptionErrorDistutilsModuleErrorDistutilsArgErrorDistutilsClassError) FancyGetopttranslate_longopt) check_environ strtobool rfc822_escapelog)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$ct|trngt|tsRt|j}d}|jdit }tj|t|}|S)Nz>Warning: '{fieldname}' should be a list, got type '{typename}') isinstancestrlisttype__name__formatlocalsrwarning)value fieldnametypenamemsgs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/dist.py _ensure_listr &sy%  t $ $;;'Ncj$$688$$ CU  Lc"eZdZdZgdZdZgdZdeDZddiZd+d Z d Z d,d Z d Z dZ d+dZdZdZdZdZddgfdZdZdZdZdZdZdZd-dZd+dZd.dZejfd Zd!Z d"Z!d#Z"d$Z#d%Z$d&Z%d'Z&d(Z'd)Z(d*Z)dS)/ DistributionaThe core of the Distutils. Most of the work hiding behind 'setup' is really done within a Distribution instance, which farms the work out to the Distutils commands specified on the command line. Setup scripts will almost never instantiate Distribution directly, unless the 'setup()' function is totally inadequate to their needs. However, it is conceivable that a setup script might wish to subclass Distribution for some specialized purpose, and then pass the subclass to 'setup()' as the 'distclass' keyword argument. If so, it is necessary to respect the expectations that 'setup' has of Distribution. See the code for 'setup()', in core.py, for details. ))verbosevzrun verbosely (default)r)quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)z no-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon commands: (see '--help-commands' for more) setup.py build will build the package underneath 'build/' setup.py install will install the package ))z help-commandsNzlist all available commands)nameNzprint package name)versionVzprint package version)fullnameNzprint -)authorNzprint the author's name) author-emailNz print the author's email address) maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)contactNz7print the maintainer's name if known, else the author's)z contact-emailNz@print the maintainer's email address if known, else the author's)urlNzprint the URL for this package)licenseNz print the license of the package)licenceNzalias for --license) descriptionNzprint the package description)zlong-descriptionNz"print the long package description) platformsNzprint the list of platforms) classifiersNzprint the list of classifiers)keywordsNzprint the list of keywords)providesNz+print the list of packages/modules provided)requiresNz+print the list of packages/modules required) obsoletesNz0print the list of packages/modules made obsoletec8g|]}t|dSrr ).0xs r zDistribution.xs%MMM-ad33MMMr!r&r$Nc d|_d|_d|_|jD]}t ||dt |_|jjD]+}d|z}t ||t|j|,i|_ d|_ d|_ d|_ i|_ g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r|d}|S|d=|D];\}}| |}|D] \} } d| f|| < >*Wk#33G<> c)7(= >E!!#(#3i )$R'M#&&&&J$$S4Z000$kkmm ' ' c4=&3,77'8GDM6C<88====T]C00'DM34444T3'''D#s++++;d3iiGCM#&&&&"   ''  ~~c**E/))).D&E* r!cV|j|}| ix}|j|<|S)zGet the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary. )rUrf)rsrxdicts rrhzDistribution.get_option_dicts6 #''00 <35 5D4'0 r!rEcddlm}|&t|j}||||z|dz}|s||dzdS|D]}|j|}|||d|zz:||d|zz||}|dD]}||dz|zdS)Nr)pformatz zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:rG)pprintrsortedrUkeysannouncerfsplit) rsheadercommandsindentrcmd_namerzoutlines rdump_option_dictszDistribution.dump_option_dicts(s=""""""  d27799::H   MM&6/ * * *d]F  MM&#:: ; ; ; F  8 8H+//99H f'H8'SSTTTT f'F'QQRRRgh''IIdOO88DMM&4-$"677778 8 8r!ctd|D}tr+|dd|z|S)aFind as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are multiple possible config files: - distutils.cfg in the Distutils installation directory (i.e. where the top-level Distutils __inst__.py file lives) - a file in the user's home directory named .pydistutils.cfg on Unix and pydistutils.cfg on Windows/Mac; may be disabled with the ``--no-user-cfg`` option - setup.cfg in the current directory - a file named by an environment variable cjg|]0}tj|!t|1Sr)ospathisfiler)r@rs rrBz2Distribution.find_config_files..Rs1QQQtBGNN4> > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?s1)C''C+.C+cddlm}tjtjkrgd}ng}t |}||}tr|d|}|D]}tr|d|z| || D]n}| |}| |}|D]?} | dkr7| |vr3| || } | dd} || f|| <@o|d |jvr|jd D]\} \} } |j | } | r t'|| t)|  n4| d vrt'|| t)| nt'|| | z#t*$r} t-| d} ~ wwxYwdSdS) Nr) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-datarz exec-prefixhomeuserrootz"Distribution.parse_config_files():z reading %srrI_global)r$rJ) configparserrrkr base_prefix frozensetrrrreadsectionsrFrhrfreplacerrUrg negative_optrLr ValueErrorr)rs filenamesrignore_optionsparserrsectionrFrzr{r|srcaliasrs rparse_config_fileszDistribution.parse_config_fileskso------ : ( (NN  N">22  ..00I  @ MM> ? ? ?!  H 9 nx7888 KK ! ! !!??,, 8 8 ..11//88"88Cj((S-F-F$jj#66!kk#s33)13 8 OO     t+ + +%)%9(%C%I%I%K%K 4 4!jsC)--c2240e3-?@@@@ 666c9S>>::::c3///!444.s3334 , + 4 4sAG%% H/G>>Hc|}g|_t||jz}||j|ddi||j|}| }tj tj d|jzz ||rdS|r|||}|dS||jr5||t'|jdk|jdS|jst)dd S) aParse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately scanned for Distutils commands and options for that command. Each new command terminates the options for the previous command. The allowed options for a command are determined by the 'user_options' attribute of the command class -- thus, we have to be able to load command classes in order to parse the command line. Any error in that 'options' attribute raises DistutilsGetoptError; any error on the command-line raises DistutilsArgError. If no Distutils commands were found on the command line, raises DistutilsArgError. Return true if command-line was successfully parsed and we should carry on with executing commands; false if no errors but we shouldn't execute commands (currently, this only happens if user asks for help). r5r4)argsobject Nrdisplay_optionsrzno commands suppliedT)_get_toplevel_optionsrr rset_negative_aliasesr set_aliasesgetoptrTget_option_orderlogging getLoggersetLevelWARNr$handle_display_options_parse_command_optsr) _show_helplenr)rstoplevel_optionsrr option_orders rparse_command_linezDistribution.parse_command_lineso. 5577 -0DDEE##D$5666Iy1222}}$"24}@@..00 $$W\B4E%EFFF  & &| 4 4  F ++FD99D|  9  OODM(:(:a(?$-     F} <#$:;; ;tr!c|jdgzS)zReturn the non-display options recognized at the top level. This includes options that are recognized *only* at the top level as well as options recognized for commands. )zcommand-packages=Nz0list of packages that provide distutils commands)global_optionsrss rrz"Distribution._get_toplevel_optionss " &   r!cddlm}|d}t|st d|z|j| ||}n!#t$r}t|d}~wwxYwt||std|zt|drt|jtsd}t||z|j}t|dr.|}||jt|d r/t|jtrt)|j}ng}||j|jz|z||||d d\}} t| d r"| jr||d|g dSt|d rt|jtrjd} |jD]\\} } } }t| || r2d } t9|r |Ftd |d| d]| rdS||}t=| D] \}}d|f||< |S)aParse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options we are about to parse). Returns a new version of 'args' with the next command at the front of the list; will be the empty list if there are no more commands on the command line. Returns None if the user asked for help on this command. rCommandzinvalid command name '%s'Nz&command class %s must subclass Command user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r help_optionsrr)rzinvalid help function z for help option 'z-': must be a callable object (function, etc.)z command line) distutils.cmdr command_rematch SystemExitrappendget_command_classrr issubclassrrnrrrrcopyupdaterfix_help_optionsset_option_tablerrrr)r get_attr_namecallablerhvarsrg)rsrrrrx cmd_classrrroptshelp_option_found help_optionshortdescfuncrzr+rs rrz Distribution._parse_command_optss] *)))))q'(( D87BCC C W%%%  )..w77II# ) ) )#C(( ( ) )W-- %89D  I~ . . 791488 7 > &cIo66 6( 9n - - 8',,..L    6 7 7 7 9n - - *  "D3 3  ,I,BCCLLL   )"8 8< G    ##L111}}T!""X.. t 4  TY  OOFA O L L L F 9n - - *  "D3 3  !" 4=4J  0eT44!5!5k!B!BCC ()%~~11 $tt[[[2 ! ''00!$ZZ--// 5 5MT5,e4HTNN sA,, B 6BB cdD]d}t|j|}|t|tr5d|dD}t |j||edS)zSet final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. r9r7Nc6g|]}|Srstrip)r@elms rrBz1Distribution.finalize_options..ms AAAAAAr!,)rPrNrrrrL)rsrurs rrrzDistribution.finalize_optionscs| . 4 4DDM400E}%%% 4AA C0@0@AAA tU333  4 4r!rchddlm}ddlm}|r_|r|}n|j}||||jdztd|r>||j |dtd|j D]}t|trt||r|} n||} t!| drJt| jt$r0|| jt)| jzn|| j|d| jztdt||jd S) abShow help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the same state, as its option table will be reset to make it generate the correct help text. If 'global_options' is true, lists the global options: --verbose, --dry-run, etc. If 'display_options' is true, lists the "display-only" options: --name, --version, etc. Finally, lists per-command help for every command name or command class in 'commands'. r gen_usagerz Global options:rEzKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:N)distutils.corerrrrrr print_help common_usageprintrrrrrrrnrrrrrrS) rsrrrrrrrFrxklasss rrzDistribution._show_helpps -,,,,,))))))   .4466-  # #G , , ,   d/2EE F F F "III    # #D$8 9 9 9   6    "III}  G'4(( 8Z-I-I 8..w77un-- <*U=OQU2V2V <''&)9%:L)M)MM''(:;;;   9ENJ K K K "IIII ii())*****r!c0ddlm}|jrB|t dt ||jdSd}i}|jD] }d||d<|D]\}}|r||rt|}t|j d|z}|dvr#t d |n6|dvr#t d |nt |d}|S) zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rrrErrDrr)r8r:r;r<rG) rr help_commandsprint_commandsrrSrrfr rPrNr) rsrrany_display_optionsis_display_optionoptionr{r|rs rrz#Distribution.handle_display_optionssU -,,,,,       ! ! ! "III ))D,-- . . .1  * - -F+, fQi ( (& ( (JS# ((,,S11 (',,< v|<<>>333#((5//****PPP$))E**++++%LLL&'#""r!ct|dz|D]c}|j|}|s||} |j}n#t $rd}YnwxYwtd|||fzddS)zZPrint a subset of the list of all commands -- used by 'print_commands()'. :(no description available)z %-*s %sN)rrQrfrr6AttributeError)rsrr max_lengthcmdrr6s rprint_command_listzDistribution.print_command_lists fsl A ACM%%c**E 4..s33 ;#/ ! ; ; ;:  ; ,*c;!?? @ @ @ @ A As A A A cddl}|jj}i}|D]}d||<g}|jD],}||s||-d}||zD]$}t||krt|}%||d||r't||d|dSdS)anPrint out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command class attribute 'description'. rNrzStandard commandszExtra commands) distutils.commandrx__all__rQrrfrrrr)rsr std_commandsis_stdrextra_commandsrs rrzDistribution.print_commandss !    (0   CF3KK=%%'' + +C::c?? +%%c*** .0 & &C3xx*$$ XX   .A:NNN  R GGG  # #N4Dj Q Q Q Q Q R Rr!cddl}|jj}i}|D]}d||<g}|jD],}||s||-g}||zD]e}|j|}|s||} |j}n#t$rd}YnwxYw|||ff|S)a>Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command class attribute 'description'. rNrr ) rrxrrQrrfrrr6r ) rsrrrrrrvrr6s rget_command_listzDistribution.get_command_lists !    (0   CF3KK=%%'' + +C::c?? +%%c*** .0 * *CM%%c**E 4..s33 ;#/ ! ; ; ;:  ; IIsK( ) ) ) ) s B(( B76B7c|j}t|tsD|d}d|dD}d|vr|dd||_|S)z9Return a list of packages from which commands are loaded.NrEcBg|]}|dk|S)rEr)r@pkgs rrBz5Distribution.get_command_packages..!s%HHHCcRiiCIIKKiiir!rzdistutils.commandr)rRrrrinsert)rspkgss rget_command_packagesz!Distribution.get_command_packagessp$$%% )|HH4::c??HHHD"$.. A2333$(D ! r!c |j|}|r|S|D]}d||}|} t |t j|}n#t$rYIwxYw t||}n'#t$rtd|d|d|dwxYw||j|<|cStd|z)aoReturn the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command module ("distutils.command." + command) and fetch the command class from the module. The loaded class is also stored in 'cmdclass' to speed future calls to 'get_command_class()'. Raises DistutilsModuleError if the expected module could not be found, or if that module does not define the expected class. z{}.{}zinvalid command 'z ' (no class 'z ' in module 'z')zinvalid command '%s') rQrfrr __import__rkr ImportErrorrPr r)rsrxrpkgname module_name klass_namemodules rrzDistribution.get_command_class's# !!'**  L0022  G!..'::K J ;'''[1      33!   **ww KKK9  &+DM' "LLL"#9G#CDDDs!A00 A=<A=B$B6cL|j|}|s|rtr|d|z||}||x}|j|<d|j|<|j|}|r||||S)aReturn the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. z.~s!WWWa.q11WWWr!z error in z : command 'z' has no such option '')get_command_namerhrrrgrboolean_optionsr rrrrLr rnrr) rsrd option_dict command_namer sourcer bool_optsneg_opt is_stringrs rr(z!Distribution._set_command_optionsks#3355  ..|<N>N:NOOOOy((Y(K51A1ABBBB[&11K7777..!66<<<9 0 0 0*3/// 03 0 0s=B,, B;:B;?C CCB!E== FFFrcnddlm}t||s|}||}n|}|js|S|d|_d|j|<|||r-| D]}| |||S)aReinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You'll have to re-finalize the command object (by calling 'finalize_options()' or 'ensure_finalized()') before using it for real. 'command' should be a command name (string) or command object. If 'reinit_subcommands' is true, also reinitializes the command's sub-commands, as declared by the 'sub_commands' class attribute (if it has one). See the "install" command for an example. Only reinitializes the sub-commands that actually matter, ie. those whose test predicates return true. Returns the reinitialized command object. rr) rrrr+r0 finalizedinitialize_optionsrer(get_sub_commandsreinitialize_command)rsrxreinit_subcommandsrr3subs rr<z!Distribution.reinitialize_commands& *)))))'7++ 6"L**<88GG"3355L  N""$$$&' l# !!'***  C//11 C C))#/ABBBBr!c0tj||dSNr)rsrlevels rrzDistribution.announces sr!cD|jD]}||dS)zRun each command that was seen on the setup script command line. Uses the list of commands found and cache of command objects created by 'get_command_obj()'. N)r run_command)rsrs r run_commandszDistribution.run_commandss6 = " "C   S ! ! ! ! " "r!c|j|rdStjd|||}||d|j|<dS)aDo whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return silently without doing anything. If the command named by 'command' doesn't even have a command object yet, create one. Then invoke 'run()' on that command object (or an existing one). Nz running %sr)rerfrinfor+ensure_finalizedrun)rsrxr*s rrCzDistribution.run_commandsw =  W % %  F w'''&&w//  """ !" gr!cDt|jp|jpgdkSNr)rrWrZrs rhas_pure_moduleszDistribution.has_pure_moduless#4=9DO9r::Q>>r!c@|jot|jdkSrJ)r]rrs rhas_ext_moduleszDistribution.has_ext_moduless =C(8$9$9A$==r!c@|jot|jdkSrJ)r[rrs rhas_c_librarieszDistribution.has_c_librariess~9#dn"5"5"99r!cR|p|Sr@)rKrMrs r has_moduleszDistribution.has_moduless%$$&&@$*>*>*@*@@r!c@|jot|jdkSrJ)r\rrs r has_headerszDistribution.has_headers|5DL 1 1A 55r!c@|jot|jdkSrJ)rarrs r has_scriptszDistribution.has_scriptsrTr!c@|jot|jdkSrJ)rbrrs rhas_data_fileszDistribution.has_data_filess;3t#7#7!#;;r!c~|o)| o| Sr@)rKrMrOrs ris_purezDistribution.is_puresD  ! ! # # +((*** +((*** r!r@)NNrE)rr>)*r __module__ __qualname____doc__rrrrKrrrhrrrrrrrrrrrrrrrrr+r(r<rINFOrrDrCrKrMrOrQrSrVrXrZrr!rr#r#5s  *NLO6NM_MMMY'L\ \ \ \ |   88884.???$@4@4@4@4HAAAF    aaaF 4 4 4121r0+0+0+0+d%#%#%#NAAA"RRR<F   %E%E%EN:)0)0)0)0V&&&&T#*,"""###(???>>>:::AAA666666<<<     r!r#ceZdZdZdZd#dZdZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZeZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$dS)$rMz]Dummy class to hold the distribution meta-data: name, version, author, and so forth. )r+r,r/ author_emailr1maintainer_emailr3r4r6long_descriptionr9r7r.r2 contact_emailr8 download_urlr:r;r<Nc@|$|t|dSd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_dSr@) read_pkg_fileopenr+r,r/r`r1rar3r4r6rbr9r7r8rdr:r;r<)rsrs rrzDistributionMetadata.__init__"s     tDzz * * * * *DIDLDK $D "DO$(D !DHDL#D $(D ! DM!DN#D  $D  DM DM!DNNNr!ct|fd}fd}d}|d|_|d|_|d|_|d|_d|_|d |_d|_|d |_|d |_ d vr|d |_ nd|_ |d |_ |d|_dvr#|d d|_ |d|_|d|_|dkr2|d|_|d|_|d|_dSd|_d|_d|_dS)z-Reads the metadata values from a file object.c0|}|r|dkr|SdSdSNUNKNOWNr)r+rrs r _read_fieldz7DistributionMetadata.read_pkg_file.._read_field=s3IE )++   ++r!cD|d}|gkrdS|Sr@)get_all)r+valuesrs r _read_listz6DistributionMetadata.read_pkg_file.._read_listBs)[[t,,F||tMr!zmetadata-versionr+r,summaryr/Nr0z home-pager4z download-urlr6r9rplatform classifier1.1r;r:r<)rr+r,r6r/r1r`rar3r4rdrbrr9r7r8r;r:r<)rsfilerlrpmetadata_versionrs @rrfz"DistributionMetadata.read_pkg_file9s%%            12K'' "{9-- &;y11!k(++ 'K77 $;{++"{9-- S + N ; ;D   $D  + M : :&;y11   'K 3399#>>DM#J//%:l33 u $ $&Jz22DM&Jz22DM'Z 44DNNN DM DM!DNNNr!cttj|ddd5}||ddddS#1swxYwYdS)z.Write the PKG-INFO file into the release tree.zPKG-INFOwzUTF-8)encodingN)rgrrrwrite_pkg_file)rsbase_dirpkg_infos rwrite_pkg_infoz#DistributionMetadata.write_pkg_infols  GLL: . .g    *     ) ) ) * * * * * * * * * * * * * * * * * *sAAAcd}|js|js|js|js|jrd}d|zd|zd|zfd}|d||d| |d | |d | |d | |d |j|d t|pd|dd||d||d||d||d||d|dS)z0Write the PKG-INFO format data to a file object.z1.0rtzMetadata-Version: %s z Name: %s z Version: %s cF|r|d|ddSdS)Nz: rG)rm)rr|rus r maybe_writez8DistributionMetadata.write_pkg_file..maybe_writes> 1 f/////00000 1 1r!Summaryz Home-pageAuthorz Author-emailLicensez Download-URL DescriptionrEKeywordsrPlatform ClassifierRequiresProvides ObsoletesN)r:r;r<r8rdrmget_name get_versionget_descriptionget_url get_contactget_contact_email get_licenser get_long_descriptionr get_keywords _write_list get_platformsget_classifiers get_requires get_provides get_obsoletes)rsrur,rs ` rrzz#DistributionMetadata.write_pkg_filessy M } ~      G +g5666 <$--//1222 ?T%5%5%7%77888 1 1 1 1 1  It3355666 K000 Hd..00111 ND$:$:$<$<=== It//11222 ND$5666 M=1J1J1L1L1RPR#S#STTT J):):)<)< = =>>> z4+=+=+?+?@@@ |T-A-A-C-CDDD z4+<+<+>+>??? z4+<+<+>+>??? {D,>,>,@,@AAAAAr!cj|pg}|D]+}|d||,dS)Nz{}: {} )rmr)rsrur+rors rrz DistributionMetadata._write_listsI2 7 7E JJz((u55 6 6 6 6 7 7r!c|jpdSrj)r+rs rrzDistributionMetadata.get_namesy%I%r!c|jpdS)Nz0.0.0)r,rs rrz DistributionMetadata.get_versions|&w&r!cvd||S)Nz{}-{})rrrrs r get_fullnamez!DistributionMetadata.get_fullnames*~~dmmoot/?/?/A/ABBBr!c|jSr@)r/rs r get_authorzDistributionMetadata.get_authors {r!c|jSr@)r`rs rget_author_emailz%DistributionMetadata.get_author_email   r!c|jSr@)r1rs rget_maintainerz#DistributionMetadata.get_maintainers r!c|jSr@)rars rget_maintainer_emailz)DistributionMetadata.get_maintainer_email $$r!c|jp|jSr@)r1r/rs rrz DistributionMetadata.get_contacts-$+-r!c|jp|jSr@)rar`rs rrz&DistributionMetadata.get_contact_emails$9(99r!c|jSr@)r3rs rrzDistributionMetadata.get_urls xr!c|jSr@)r4rs rrz DistributionMetadata.get_licenses |r!c|jSr@)r6rs rrz$DistributionMetadata.get_descriptions r!c|jSr@)rbrs rrz)DistributionMetadata.get_long_descriptionrr!c|jpgSr@)r9rs rrz!DistributionMetadata.get_keywords}""r!c0t|d|_dS)Nr9)r r9rsrs r set_keywordsz!DistributionMetadata.set_keywordss$UJ77 r!c|jSr@)r7rs rrz"DistributionMetadata.get_platformss ~r!c0t|d|_dS)Nr7)r r7rs r set_platformsz"DistributionMetadata.set_platformss%e[99r!c|jpgSr@)r8rs rrz$DistributionMetadata.get_classifierss%2%r!c0t|d|_dS)Nr8)r r8rs rset_classifiersz$DistributionMetadata.set_classifierss'}==r!c|jSr@)rdrs rget_download_urlz%DistributionMetadata.get_download_urlrr!c|jpgSr@)r;rs rrz!DistributionMetadata.get_requiresrr!ctddl}|D]}|j|t||_dSrJ)distutils.versionpredicateversionpredicateVersionPredicaterr;rsrrr%s r set_requiresz!DistributionMetadata.set_requiressH)))) ; ;A  & 7 7 : : : :U  r!c|jpgSr@)r:rs rrz!DistributionMetadata.get_providesrr!crd|D}|D] }ddl}|j|!||_dS)Nc6g|]}|Srr)r@r%s rrBz5DistributionMetadata.set_provides..s ***q***r!r)rrsplit_provisionr:)rsrr%rs r set_providesz!DistributionMetadata.set_providessU**E*** : :A - - - -  & 6 6q 9 9 9 9 r!c|jpgSr@)r<rs rrz"DistributionMetadata.get_obsoletess~##r!ctddl}|D]}|j|t||_dSrJ)rrrrr<rs r set_obsoletesz"DistributionMetadata.set_obsoletessH)))) ; ;A  & 7 7 : : : :er!r@)%rr[r\r]rOrrfr}rzrrrrrrrrrrrr get_licencerrrrrrrrrrrrrrrrr!rrMrMs 0"""".1"1"1"f***%B%B%BN777&&&'''CCC!!!%%%...:::K   %%%###888:::&&&>>>!!!###$$$###$$$%%%%%r!rMcNg}|D]}||dd |S)zConvert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. r)r)rF new_options help_tuples rrrs=K,, :ac?++++ r!)!r]rkrrerrremailrrir"errorsrrrr fancy_getoptr r utilr r r _logrdebugrcompilerr r#rMrrr!rrs  ######OOOOHHH 988888889999999999 RZ4 5 5    F F F F F F F F `x%x%x%x%x%x%x%x%vs '11PK!m['1_distutils/__pycache__/py39compat.cpython-311.pycnu[ ,RefddlZddlZdZejdkoejdkZerendZdS)Ncpddl}|d}|||dS)z? Ensure vars contains 'EXT_SUFFIX'. pypa/distutils#130 rN) EXT_SUFFIXSO)_impextension_suffixesupdate)varsr ext_suffixs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/py39compat.pyadd_ext_suffix_39r sPKKK((**1-JKK  ) WindowscdS)N)r s r rsr )sysplatformr version_infosystemneeds_ext_suffixadd_ext_suffixrr r rsb     #g-P/(/2C2Cy2P&6M""= 2Nrz:invalid short option '%s': must a single character or None=:zinvalid negative alias 'r0z' takes a valuezinvalid alias 'z%': inconsistent with aliased option 'z/' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)rrrrrepeatr len ValueErrorformatr1strrr"rrgetr longopt_rematchr.r)rrlongshorthelprCalias_tos r_grok_option_tablezFancyGetopt._grok_option_tables   'F 1F 1F6{{a$*!eTV!!,2)eT66!!=!D!DV!L!LMMMdC(( CIIMM*S ] 5#(>(>]3u::QR??*68=> !'DK  N ! !$ ' ' 'Bx3(!CKEAbDz'(t$$ .22488'~h/22CG44S *.DN2&'(t$z~~d++H#>$'4>(+CCC..04ttXXX?##D)) *>@DE $(#5#5d#;#;DN4  1&&u---,0a)MF 1F 1rc|tjdd}|t}d}nd}|d|j} t j|||j\}}n&#t j$r}t|d}~wwxYw|D].\}}t|dkr |ddkr|j |d}n-t|dkr|ddd ksJ|dd}|j |} | r| }|j|s3|d ks Jd |j |} | r| }d}nd}|j|} |r.|j | t%|| ddz}t'|| ||j||f0|r||fS|S) aParse command-line options in args. Store as attributes on object. If 'args' is None or not supplied, uses 'sys.argv[1:]'. If 'object' is None or not supplied, creates a new OptionDummy object, stores option values there, and returns a tuple (args, object). If 'object' is supplied, it is modified in place and 'getopt()' just returns 'args'; in both cases, the returned 'args' is a modified copy of the passed-in 'args' list, which is left untouched. NrTF r?rrz--zboolean option can't have value)sysargv OptionDummyrOjoinrgetoptrerrorrrDrrrHrrrrCgetattrsetattrrr") rargsobjectcreated_objectroptsmsgr6valrattrs rrWzFancyGetopt.getopts <8ABB ]]F!NN"N !!!XXdo..  )tZHHJD$$| ) ) )#C(( ( ) 1 1HC3xx1}}Q3oc!f-3xx!||BQB4!""gJNN3''E >#& byyy"Cyyy+//44CCCC>#&D 3t{t,,8fdA..2 FD# & & &   $ $c3Z 0 0 0 0  < KsA::B BBc<|jtd|jS)zReturns the list of (option, value) tuples processed by the previous run of 'getopt()'. Raises RuntimeError if 'getopt()' hasn't been called yet. Nz!'getopt()' hasn't been called yet)r RuntimeError)rs rget_option_orderzFancyGetopt.get_option_orders%   $BCC C$ $rcd}|jD]A}|d}|d}t|}|ddkr|dz }||dz}||kr|}B|dzdzdz}d}||z } d |z} |r|g} nd g} |jD]}|dd \}}} t| | } |ddkr |dd}|?| r"| d ||| dfznm| d ||fznRd||}| r"| d ||| dfzn| d|z| ddD]}| | |z| S)zGenerate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object. rrr@rANr?NrQzOption summary:r=z --%-*s %sz --%-*s z{} (-{})z --%-*s)r rD wrap_textr"rF)rheadermax_optrrKrLell opt_width line_width text_width big_indentlinesrMtext opt_namess r generate_helpzFancyGetopt.generate_help&s'  F!9D1IEd))CBx3Ag AgW}}aK!Oa' 0 )+ 9_  (HEE&'E' / /F &rr D%T:..DBx3AbDz}ALL7D$q'2J!JKKKKLL$!?@@@@ '--dE:: 9LL7ItAw2O!OPPPPLLi!7888ABBx / / Z#-.... / rc| tj}||D]}||dzdS)N )rSstdoutrswrite)rrifilelines r print_helpzFancyGetopt.print_helptsN <:D&&v.. $ $D JJtd{ # # # # $ $rr )NN)__name__ __module__ __qualname____doc__rrr r&r)r.r7r9r;rOrWrdrsrzrrr r s  &&&&P222 4444000 444    ---P1P1P1d;;;;z%%%LLLL\$$$$$$rr cvt|}|||||Sr )r r;rW)options negative_optr\r[parsers r fancy_getoptr{s7  ! !F  --- ==v & &&rc.i|]}t|dS)rQ)ord).0_wschars r rs ? ? ?'CLL# ? ? ?rc|gSt||kr|gS|}|t}t jd|}d|D}g}|rg}d}|r\t|d}||z|kr$||d|d=||z}n|r|dddkr|d=n|\|rQ|dkr6||dd||d|d|d<|dddkr|d=|d|||S)zwrap_text(text : string, width : int) -> [string] Split 'text' into multiple lines of no more than 'width' characters each, and return the list of strings that results. Nz( +|-+)cg|]}||Srr)rchs r zwrap_text..s ( ( (RR (b ( ( (rrr@rQrR)rD expandtabsr,WS_TRANSresplitr"rV)rqwidthchunksrpcur_linecur_lenrks rrhrhs  |  4yyEv ??  D >>( # #D Xj$ ' 'F ( (6 ( ( (F E  ( fQi..C}%%q ***1I!C-% Q3 6 6     !||q !E' 2333"1Ieff-q ay|s""1I  RWWX&&'''A  (D Lrc6|tS)zXConvert a long option name to a valid Python identifier by changing "-" to "_". r+)r6s rtranslate_longoptrs == ' ''rceZdZdZgfdZdS)rUz_Dummy class just used as a place to hold command-line option values as instance attributes.c2|D]}t||ddS)zkCreate a new OptionDummy instance. The attributes listed in 'options' will be initialized to None.N)rZ)rrr6s rrzOptionDummy.__init__s2 % %C D#t $ $ $ $ % %rN)r{r|r}r~rrrrrUrUs7&& "%%%%%%rrU__main__zTra-la-la, supercalifragilisticexpialidocious. How *do* you spell that odd word, anyways? (Someone ask Mary -- she'll know [or she'll say, "How should I know?"].)) (z width: %dru)r~rSstringrrWerrorsrr longopt_patcompilerIrF neg_alias_rerG maketransr-r r whitespacerrhrrUr{rqwprintrVrrrrs ;;;;;;;; + RZ+- . . rz.// [IIJJ  c3'' X$X$X$X$X$X$X$X$v ''' @ ?V-> ? ? ?333l(((%%%%%%%% z D  kAo dii $**++,,, rPK!5P QQ+_distutils/__pycache__/util.cpython-311.pycnu[ ,ReFRdZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z m Z ddl mZddlmZddlmZdZd Zejd krdad Zd Zd ZdZdZdZdZe jdZdZdZ ddZ!dxa"xa#a$dZ%dZ&ddZ'dZ( ddZ)dZ*dS) zudistutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. N)DistutilsPlatformErrorDistutilsByteCompileError)newer)spawn)logctjdkrTtjdkrDdtjvrdSdtjvrdStjdkr_tjdkrOt td r:tj\}}}}}|d d d krd dlm }||||Stj S)z Return a string that identifies the current platform. Use this function to distinguish platform-specific build directories and platform-specific built distributions. )ntz(arm) win-arm32z(arm64) win-arm64)r posixunameNr aixr) aix_platform) sys version_infoosnameversionlowerhasattrr py38compatr sysconfig get_platform)osnamehostreleasermachiners /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/util.pyget_host_platformr#s &  7d??#+++----"{CK--////"{ &  7g  '"g"6"6 68hjj 3FD'7GbqbzU""444444#|FGW===  ! # ##ctjdkrIddddd}tjd}||p t St S)Nr win32z win-amd64r r)x86x64armarm64VSCMD_ARG_TGT_ARCH)rrenvirongetr#)TARGET_TO_PLATtargets r"rr3sg w$     455!!&))@->-@-@@   r$darwinMACOSX_DEPLOYMENT_TARGETc dadS)zFor testing only. Do not call.N)_syscfg_macosx_verr$r"_clear_cached_macosx_verr5Esr$c`t!ddlm}|jtpd}|r|atS)zGet the version of macOS latched in the Python interpreter configuration. Returns the version as a string or None if can't obtain one. Cached.Nr)r)r3 distutilsrget_config_varMACOSX_VERSION_VAR)rvers r"!get_macosx_target_ver_from_syscfgr<KsH!''''''&i&'9::@b  %!$  r$ct}tjt}|rQ|rMt |ddgkr8t |ddgkr#dtzd|d|dz}t ||S|S)aReturn the version of macOS for which we are building. The target version defaults to the version in sysconfig latched at time the Python interpreter was built, unless overridden by an environment variable. If neither source has a value, then None is returned r $z mismatch: now "z" but "z*" during configure; must use 10.3 or later)r<rr,r-r: split_versionr) syscfg_verenv_vermy_msgs r"get_macosx_target_verrDXs344Jjnn/00G  1j))b!W44g&&"a00(((,3GGZZZ,AA  )00 0 r$c@d|dDS)zEConvert a dot-separated string into a list of numbers for comparisonsc,g|]}t|Sr4)int).0ns r" z!split_version..zs ) ) )qCFF ) ) )r$.)split)ss r"r@r@xs ) )AGGCLL ) ) ))r$cLtjdkr|S|s|S|ddkrtd|z|ddkrtd|z|d}d|vr|dd|v|s tjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. /rzpath '%s' cannot be absolutezpath '%s' cannot end with '/'rK)rsep ValueErrorrLremovecurdirpathjoin)pathnamepathss r" convert_pathrY}s v}} {c7(BCCC|s88CDDD NN3  E ,, S ,, y 7< r$ctjdkrgtj|s tj||Stj||ddStjdkrXtj|\}}|ddkr |dd}tj||St dtjd) a Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. rrNr r\znothing known about platform '')rrrUisabsrV splitdriver)new_rootrWdriverUs r" change_rootras  w'w}}X&& 87<<(33 37<<(122,77 7 D**844  7d??8Dw||Hd+++ !L"'!L!L!L M MMr$cDtjdkrddtjvrV ddl}|tjdtjd<n#t tf$rYnwxYwdtjvrttjd<dSdS)aLEnsure that 'os.environ' has all the environment variables we guarantee that users can use in config files, command-line options, etc. Currently this includes: HOME - user's home directory (Unix only) PLAT - description of the current platform, including hardware and OS (see 'get_platform()') rHOMErNPLAT) rrr,pwdgetpwuidgetuid ImportErrorKeyErrorr)rfs r" check_environrks w'fBJ66  JJJ!$bikk!:!:1!=BJv  X&    D  RZ)^^ 6 s=AA21A2c@tttj}|d|D t ||S#t$r}td|d}~wwxYw)a Perform variable substitution on 'string'. Variables are indicated by format-style braces ("{var}"). Variable is substituted by the value found in the 'local_vars' dictionary or in 'os.environ' if it's not in 'local_vars'. 'os.environ' is first checked/augmented to guarantee that it contains certain values: see 'check_environ()'. Raise ValueError for any variables not found in either 'local_vars' or 'os.environ'. c3>K|]\}}|t|fVdSNstr)rHrvalues r" zsubst_vars..s1KKu4U$KKKKKKr$zinvalid variable N) rkdictrr,updateitems _subst_compat format_maprjrR)rM local_varslookupvars r" subst_varsr{sOOO "*  F MMKK 8H8H8J8JKKKKKK4Q**6222 4442S223334s!A<< BBBcd}tjd||}||krddl}|dt|S)zb Replace shell/Perl-style variable substitution with format-style. For compatibility. c4d|ddS)N{r})group)matchs r"_substz_subst_compat.._substs&EKKNN&&&&r$z\$([a-zA-Z_][a-zA-Z_0-9]*)rNz+shell/Perl-style substitions are deprecated)resubwarningswarnDeprecationWarning)rMrreplrs r"rvrvs\ ''' 6/ ; ;D qyy 9     Kr$error: c&|t|zSrnro)excprefixs r"grok_environment_errorrs CHH r$ctjdtjzatjdatjdadS)Nz [^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")rcompilestring whitespace _wordchars_re _squote_re _dquote_rer4r$r" _init_regexrs>J/&2CCDDM011J011JJJr$c"tt|}g}d}|rt||}|}|t |kr||d|n}||tjvr=||d|||d }d}n||dkr|d|||dzdz}|dz}n||dkrt||}n@||dkrt||}ntd||z|td||z|\}}|d|||dz|dz z||dz}|d z }|t |kr||n||S) aSplit a string up according to Unix shell-like rules for quotes and backslashes. In short: words are delimited by spaces, as long as those spaces are not escaped by a backslash, or inside a quoted string. Single and double quotes are equivalent, and the quote characters can be backslash-escaped. The backslash is stripped from any two-character escape sequence, leaving only the escaped character. The quote characters are stripped from any quoted string. Returns a list of words. Nrr[rr\"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?))rrstriprendlenappendrrlstriprr RuntimeErrorrRspan)rMwordsposmrbegs r" split_quotedrs    A E C %   3 ' 'eegg #a&&== LL4C4 ! ! !  S6V& & & LL4C4 ! ! !#$$  ACC sVt^^$3$!C!GII,&A'CCv}}$$Q,,33$$Q,,"#F3#OPPPy !E#!NOOOJS#$3$!C!GcAg-..3448A%%''A+C #a&&== LLOOO K %N Lr$c|6d|j|}|dddkr |dddz}tj||s||dSdS)aPerform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to embody the "external action" being performed), and an optional message to print. Nz{}{!r}z,)r))format__name__rinfo)funcargsmsgverbosedry_runs r"executerAsp {oodmT22 rss8t  ad)c/CHSMMM  d r$c|}|dvrdS|dvrdStd|)zConvert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if 'val' is anything else. )yyesttrueon1r)rInoffalseoff0rzinvalid truth value {!r})rrRr)vals r" strtoboolrTsP ))++C 222q 5 5 5q3::3??@@@r$ctjrtd||dk}|s ddlm}|d\} } n##t $rddlm} d| d} } YnwxYwtjd| |s| tj | d } nt| d } | 5| d | d tt|d z| d |d|d|d|d|d dddn #1swxYwYtjg} | t%j| | t+| |t-tj| fd| z|dSddlm}|D]@}|dddkr|dkr,|dkrdn|}t4j||}nt4j|}|}|rG|dt;||krt=d|d||t;|d}|r tj ||}tj |}|rO|stC||r'tjd|||s ||||*tj"d||BdS)a~Byte-compile a collection of Python source files to .pyc files in a __pycache__ subdirectory. 'py_files' is a list of files to compile; any files that don't end in ".py" are silently skipped. 'optimize' must be one of the following: 0 - don't optimize 1 - normal optimization (like "python -O") 2 - extra optimization (like "python -OO") If 'force' is true, all files are recompiled regardless of timestamps. The source filename encoded in each bytecode file defaults to the filenames listed in 'py_files'; you can modify these with 'prefix' and 'basedir'. 'prefix' is a string that will be stripped off of each source filename, and 'base_dir' is a directory name that will be prepended (after 'prefix' is stripped). You can supply either or both (or neither) of 'prefix' and 'base_dir', as you wish. If 'dry_run' is true, doesn't actually do anything that would affect the filesystem. Byte-compilation is either done directly in this interpreter process with the standard py_compile module, or indirectly by writing a temporary script and executing it. Normally, you should let 'byte_compile()' figure out to use direct compilation or not (see the source for details). The 'direct' flag is used by the script generated in indirect mode; unless you know what you're doing, leave it set to None. zbyte-compiling is disabled.NTr)mkstempz.py)mktempz$writing byte-compilation script '%s'wz2from distutils.util import byte_compile files = [ z, z] z byte_compile(files, optimize=z, force=z, prefix=z , base_dir=z, verbose=z$, dry_run=0, direct=1) )rz removing %s)rr7) optimizationzinvalid prefix: filename z doesn't start with zbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#rdont_write_bytecodertempfilerrirrrrfdopenopenwriterVmaprepr executableextend subprocess"_optim_args_from_interpreter_flagsrrrrS py_compiler importlibutilcache_from_sourcerrRrUbasenamerdebug)py_filesoptimizeforcerbase_dirrrdirectr script_fd script_namerscriptcmdrfileoptcfiledfile cfile_bases r" byte_compilerdsP G'(EFFF~'1} ZY ; ( ( ( ( ( ('.wu~~ $Y  ; ; ; ' ' ' ' ' ''+VVE]] YYY ; 7EEE! $9c22k3//   " UZZD((;(;<=;+FPWXXXXXX '&&&&& Y YDBCCyE!! 1}}$MMbbx!88C8PP!88>>E - #f++ &&00$*44)c&kkmm, 6 Xu55))%00J YYE$..YH6jIII"4eU333IEtZXXXA Y Ys"=AA!A9D&&D*-D*cZ|d}d}||S)zReturn a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline.  z )rLrV)headerlinesrQs r" rfc822_escapers* LL  E C 88E??r$)r)Nrr)rrNNrrN)+__doc__importlib.utilrrrrrrr functoolserrorsrrdep_utilrr_logrr#rplatformr3r:r5r<rDr@rYra lru_cacherkr{rvrrrrrrrrrrr4r$r"rsF   EEEEEEEE$$$:   <8/   @***    :NNN*,,,,444&(+/. . Z222<<<D& A A A$   TYTYTYTYnr$PK!W@@4_distutils/__pycache__/unixccompiler.cpython-311.pycnu[ ,Re<dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z ddlmZmZmZmZddlmZdd lmZd Zd Zd ZGd de ZdS)a9distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library search directories specified with -Ldir * compile handled by 'cc' (or similar) executable with -c option: compiles .c to .o * link static library handled by 'ar' command (possibly with 'ranlib') * link shared library handled by 'cc -shared' N) sysconfig)newer) CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecError CompileErrorLibError LinkError)log)compiler_fixupcd}tj|ddkrd}d||vr|dz }d||v|d|||dfS)z For macOS, split command into 'env' portion (if any) and the rest of the linker command. >>> _split_env(['a', 'b', 'c']) ([], ['a', 'b', 'c']) >>> _split_env(['/usr/bin/env', 'A=3', 'gcc']) (['/usr/bin/env', 'A=3'], ['gcc']) renvr=Nospathbasenamecmdpivots /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/unixccompiler.py _split_envr-sq E wA5((SZ QJESZ vv;EFF ##c|tj|ddk}|d|||dfS)a AIX platforms prefix the compiler with the ld_so_aix script, so split that from the linker command. >>> _split_aix(['a', 'b', 'c']) ([], ['a', 'b', 'c']) >>> _split_aix(['/bin/foo/ld_so_aix', 'gcc']) (['/bin/foo/ld_so_aix'], ['gcc']) r ld_so_aixNrrs r _split_aixr?s= G  SV $ $ 3E vv;EFF ##rcXt|}|d||kr|nd}||dS)a The linker command usually begins with the compiler command (possibly multiple elements), followed by zero or more params for shared library building. If the LDSHARED env variable overrides the linker command, however, the commands may not match. Return the best guess of the linker parameters by stripping the linker command. If the compiler command does not match the linker command, assume the linker command is just the first element. >>> _linker_params('gcc foo bar'.split(), ['gcc']) ['foo', 'bar'] >>> _linker_params('gcc foo bar'.split(), ['other']) ['foo', 'bar'] >>> _linker_params('ccache gcc foo bar'.split(), 'ccache gcc'.split()) ['foo', 'bar'] >>> _linker_params(['gcc'], ['gcc']) [] Nr)len) linker_cmd compiler_cmdc_lenrs r_linker_paramsr$Ms<.   E'<77EEQE eff rc $eZdZdZddgdgdgddgdgddgddZejddd krd ged <gd Zd Zd Z dZ dZ dZ dxZ xZZeZejdkrdZ ddZdZ d dZ d!dZdZdZdZdZedZd"dZdS)# UnixCCompilerunixNccz-sharedarz-cr) preprocessorcompiler compiler_so compiler_cxx linker_so linker_exearchiverranlibdarwinr1)z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.exec$|d||}|\}}}t||} |j| z} |r| d|g|r|| dd<|r| || ||jp|dupt ||} | sdS|r2|tj | | | dS#t$r} t| d} ~ wwxYw)N-or)_fix_compile_argsrr*extendappendforcermkpathrrdirnamespawnr r ) selfsource output_filemacros include_dirs extra_preargsextra_postargs fixed_argsignorepp_optspp_args preprocessmsgs rrIzUnixCCompiler.preprocesssD++D&,GG '1$ (>>#g-  0 NND+. / / /  ('GBQBK  + NN> * * *v ZT;$#6T% :T:T   F  6 KK 44 5 5 5 $ JJw     ! $ $ $s## # $sC11 D;D  Dct|j||z} |||z|d|gz|zdS#t$r}t |d}~wwxYw)Nr6)rr,r=r r ) r>objsrcextcc_argsrDrGr,rJs r_compilezUnixCCompiler._compilesy$T%5w7OPP  $ JJ{W,T3/??.P Q Q Q Q Q! $ $ $s## # $s!= AAArc|||\}}|||}|||r|tj|||j|gz|z|j z|j rB ||j |gzdS#t$r}t|d}~wwxYwdStjd|dS)N) output_dirskipping %s (up-to-date))_fix_object_argslibrary_filename _need_linkr;rrr<r=r0objectsr1r r r debug)r>rWoutput_libnamerRrX target_langoutput_filenamerJs rcreate_static_libzUnixCCompiler.create_static_libs#33GZHH//:/VV ??7O 4 4 C KK88 9 9 9 JJt}'887BT\Q R R R{ ((JJt{o->>?????)((("3--'( ( ( I0/ B B B B Bs*C C(C##C(cP|||\}}||||}|\}}}t||||}t|tt dfst d| tj ||}| ||r\||j z|zd|gz}| rdg|dd<| r| |dd<| r| | | tj| |tjk}|r|jn|jdd}| dkrt|jrmt)|\}}t+|\}}t)|j\}}t)|j\}}t-||}||z|z|z}t/||}|||zdS#t2$r}t5|d}~wwxYwt7jd|dS)Nz%'output_dir' must be a string or Noner6z-grzc++rS)rT _fix_lib_argsr isinstancestrtype TypeErrorrrjoinrVrWr8r;r<r EXECUTABLEr/r.r-rrr$rr=r r r rX)r> target_descrWr[rR libraries library_dirsruntime_library_dirsexport_symbolsrXrCrD build_temprZrElib_optsld_args building_exelinkerr linker_neaix linker_na_compiler_cxx_ne linker_exe_neparamsrJs rlinkzUnixCCompiler.linksX #33GZHH'' dirs rlibrary_dir_optionz UnixCCompiler.library_dir_option czrctjd}tjt j|d}d|vpd|vS)NCCrgcczg++)rget_config_varrrrshlexsplit)r>cc_varr+s r_is_gcczUnixCCompiler._is_gccsK)$//7##EK$7$7$:;; 5EX$55rcxtjdddkr/ddlm}m}|}|r||ddgkrd|zSd|zStjdd d krd |zStjddd kr|rd ndd|zgSt jddkrd|zSd|zS)Nr2r3r)get_macosx_target_ver split_version z -Wl,-rpath,rxfreebsdz -Wl,-rpath=zhp-uxz-Wl,+sz+sGNULDyesz-Wl,--enable-new-dtags,-Rz-Wl,-R)sysplatformdistutils.utilrrrrr)r>rzrrmacosx_target_vers rruntime_library_dir_optionz(UnixCCompiler.runtime_library_dir_options < x ' ' K K K K K K K K 5 5 7 7   "]]3D%E%E"a%P%P$s**cz! \"1"  * * 3& & \"1"  ( ( LLNN4s    #G , , 5 5/4 4c> !rc d|zS)Nz-lry)r>libs rlibrary_optionzUnixCCompiler.library_optionEr|rcvtjd}tjd|}tjdkoA|o?|dp*|do|d }|r;tj | d|ddn|S) a macOS users can specify an alternate SDK using'-isysroot'. Calculate the SDK root if it is specified. Note that, as of Xcode 7, Apple SDKs may contain textual stub libraries with .tbd extensions rather than the normal .dylib shared libraries installed in /. The Apple compiler tool chain handles this transparently but it can cause problems for programs that are being built with an SDK and searching for specific libraries. Callers of find_library_file need to keep in mind that the base filename of the returned SDK library file might have a different extension from that of the library file installed on the running system, for example: /Applications/Xcode.app/Contents/Developer/Platforms/ MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ usr/lib/libedit.tbd vs /usr/lib/libedit.dylib CFLAGSz-isysroot\s*(\S+)r3z/System/z/usr/z /usr/local/rN) rrresearchrr startswithrrrcgroup)rzcflagsmatch apply_roots r _library_rootzUnixCCompiler._library_rootHs*)(33 .77 LH $  z**SNN7++QCNN=4Q4Q0Q 9CKrw||EKKNNCG444KrcfddD}tj|}dtj||D}t t jj|}t|dS)a/ Second-guess the linker with not much hard data to go on: GCC seems to prefer the shared library, so assume that *all* Unix C compilers do, ignoring even GCC's "-static" option. >>> compiler = UnixCCompiler() >>> compiler._library_root = lambda dir: dir >>> monkeypatch = getfixture('monkeypatch') >>> monkeypatch.setattr(os.path, 'exists', lambda d: 'existing' in d) >>> dirs = ('/foo/bar/missing', '/foo/bar/existing') >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/') '/foo/bar/existing/libabc.dylib' >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/') '/foo/bar/existing/libabc.dylib' >>> monkeypatch.setattr(os.path, 'exists', ... lambda d: 'existing' in d and '.a' in d) >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/') '/foo/bar/existing/libabc.a' >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/') '/foo/bar/existing/libabc.a' c3FK|]}|VdS))lib_typeN)rU).0rarr>s r z2UnixCCompiler.find_library_file..sJ    ! !# ! 5 5      rzdylib xcode_stub shared staticc3\K|]'\}}tj||V(dS)N)rrrc)rrootlib_names rrz2UnixCCompiler.find_library_file..sJ  h GLLx ( (      rN) rmapr itertoolsproductfilterrrexistsnext)r>dirsrrX lib_namesrootssearchedfounds` ` rfind_library_filezUnixCCompiler.find_library_fileks.     8>>@@   D&--  "+"3E9"E"E    rw~x00E4   r)NNNNN)NrN) NNNNNrNNNN)r)__name__ __module__ __qualname__ compiler_type executablesrrsrc_extensions obj_extensionstatic_lib_extensionshared_lib_extensiondylib_lib_extensionxcode_stub_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_formatxcode_stub_lib_format exe_extensionrIrPr\rvr{rrr staticmethodrrryrrr&r&isMFvI&f5M  K |BQB8##!) H?>>NM "%?HHH),<, |x #$#$#$#$J$$$NRCCCC:!9C9C9C9C~666 &"&"&"P L L\ LD&!&!&!&!&!&!rr&)__doc__rrrrrrdep_utilr ccompilerrrrerrorsr r r r _logr _macos_compatrrrr$r&ryrrrs6   IIIIIIIIIIIIIIIIIIIIII))))))$$$$$ $ $ $8h!h!h!h!h!Ih!h!h!h!h!rPK!$+9))3_distutils/__pycache__/archive_util.cpython-311.pycnu[ ,Re|!HdZddlZddlmZddlZ ddlZn #e$rdZYnwxYwddlmZddl m Z ddl m Z ddl m Z  dd lmZn #e$rdZYnwxYw dd lmZn #e$rdZYnwxYwd Zd Z ddZddZedgdfedgdfedgdfedgdfedgdfegdfdZdZ d dZdS)!zodistutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).N)warn)DistutilsExecError)spawn)mkpath)log)getpwnam)getgrnamcvt|dS t|}n#t$rd}YnwxYw||dSdS)z"Returns a gid, given a group name.N)r KeyErrornameresults /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/archive_util.py_get_gidr \4<t$  ay 4  ,,cvt|dS t|}n#t$rd}YnwxYw||dSdS)z"Returns an uid, given a user name.Nr )r r rs r_get_uidr-rrgzipcdddddd}dddd d }|%||vrtd |d z} |dkr| ||dz } ttj| |dd l} tj dttfd} |se| | d||z} | || | n#| wxYw|dkrNtdt | ||z} t"jdkr|| | g}n|d| g}t'||| S| S)a=Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or None. ("compress" will be deprecated in Python 3.2) 'owner' and 'group' can be used to define an owner and a group for the archive that is being built. If not provided, the current owner and group will be used. The output tar file will be named 'base_dir' + ".tar", possibly plus the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z"). Returns the output filename. gzbz2xz)rbzip2rNcompressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarrdry_runrzCreating tar archivecH|_|_|_|_|S)N)gidgnameuiduname)tarinfor"groupownerr$s r _set_uid_gidz"make_tarball.._set_uid_gidjs. ?GK!GM ?GK!GMzw|%s)filterz'compress' is deprecated.win32z-f)keys ValueErrorgetrospathdirnametarfilerinforropenaddcloserDeprecationWarningsysplatformr) base_namebase_dirrverboser r(r'tar_compression compress_ext archive_namer3r)tarcompressed_namecmdr"r$s `` @@r make_tarballrD:s& O"F%TRRL 0A0A0C0C C C !   v%L: ((2666  27??< ( ('::::NNNH #$$$ 5//C 5//C ll</(2K)KLL  GGH\G 2 2 2 IIKKKKCIIKKKK: (*<===&h)?? <7 " "\?;CCT<0C c7#### s -DD/c &|dz}ttj||t?|rd}nd} t d|||g|n7#t $rt d|zwxYwtjd|||s t j |d tj }n1#t$r$t j |d tj }YnwxYw|5|tj krhtjtj|d }|||tjd |tj|D]\}} } | D]k} tjtj|| d }|||tjd |l| D]} tjtj|| }tj|r+|||tjd | dddn #1swxYwY|S) avCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. z.ziprNz-rz-rqzipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to itw) compressionrz adding '%s')rr0r1r2zipfilerrrr4ZipFile ZIP_DEFLATED RuntimeError ZIP_STOREDcurdirnormpathjoinwritewalkisfile) r;r<r=r zip_filename zipoptionsrFr1dirpathdirnames filenamesrs r make_zipfilerYsv%L 27??< ( ('::::  JJJ  5*lH=w O O O O O!   %4    6 hOOO : Yo #73G  Y Y YolCWEWXXX Y : :ry((7++BGLL2,F,FGGDIIdD)))H]D11146GH4E4E : :0GXy (66!w// WdB0O0OPP $---5555 )::!w// Wd0K0KLL7>>$//:IIdD111H]D999 : :  : : : : : : : : : : : : : : : s1AA7!B66+C$#C$)FJJ  J )rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)gztarbztarxztarztarrArFc*|D]}|tvr|cSdS)zqReturns the first format from the 'format' list that is unknown. If all formats are known, returns None N)ARCHIVE_FORMATS)formatsformats rcheck_archive_formatsrbs1   ( (MMM ) 4r*cltj}|Jtjd|tj|}|stj|| tj}d|i} t|} n #t$rtd|zwxYw| d} | dD] \} } | | | < |dkr || d<|| d < | ||fi| }|)tjd |tj|n1#|*tjd |tj|wwxYw|S) aCreate an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "tar", "gztar", "bztar", "xztar", or "ztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir into 'root_dir' before creating the archive. 'base_dir' is the directory where we start archiving from; ie. 'base_dir' will be the common prefix of all files and directories in the archive. 'root_dir' and 'base_dir' both default to the current directory. Returns the name of the archive file. 'owner' and 'group' are used when creating a tar archive. By default, uses the current owner and group. Nzchanging into '%s'r zunknown archive format '%s'rrrFr(r'zchanging back to '%s') r0getcwdrdebugr1abspathchdirrNr_r r.)r;raroot_dirr<r=r r(r'save_cwdkwargs format_infofuncargvalfilenames r make_archiverps}4y{{H &111GOOI..   HX   9 !FA%f- AAA6?@@@A q>DNSs  ww4 866v66   I-x 8 8 8 HX      I-x 8 8 8 HX      Os3 BB D.D1)rrrNN)rr)NNrrNN)__doc__r0warningsrr9rI ImportErrorerrorsrrdir_utilr_logrpwdr grpr rrrDrYr_rbrpr*rrzs&   NNNNGGG'&&&&&HHHHHH      SWLLLL^====B124F G235H I/02B C 457L M -.0G H "j )    ::::::s/!!AA AAA#"A#PK!vF1_distutils/__pycache__/py38compat.cpython-311.pycnu[ ,Re dZdS)c ddl}|S#t$rYnwxYwd|||S)Nz{}-{}.{}) _aix_support aix_platform ImportErrorformat)osnameversionreleasers /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/py38compat.pyrrs] ((***        VWg 6 66s  ''N)rr rs77777r PK! ,_distutils/__pycache__/debug.cpython-311.pycnu[ ,ReBddlZejdZdS)NDISTUTILS_DEBUG)osenvirongetDEBUG/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/debug.pyr s(  ())r PK!c ' '+_distutils/__pycache__/core.cpython-311.pycnu[ ,Re$dZddlZddlZddlZddlmZddlmZmZm Z m Z ddl m Z ddl mZddlmZdd lmZgd Zd Zd Zdadad ZdZdZdZddZdS)a#distutils.core The only module that needs to be imported to use the Distutils; provides the 'setup' function (which is to be called from the setup script). Also indirectly provides the Distribution and Command classes, although they are really defined in distutils.dist and distutils.cmd. N)DEBUG)DistutilsSetupErrorDistutilsErrorCCompilerErrorDistutilsArgError) Distribution)Command) PyPIRCCommand) Extension)r r r r setupzusage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: %(script)s --help [cmd1 cmd2 ...] or: %(script)s --help-commands or: %(script)s cmd --help cltj|}tt zS)N)ospathbasenameUSAGElocals) script_namescripts /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/core.py gen_usager*s& W  k * *F 688 ) distclassr script_argsoptionsnameversionauthor author_email maintainermaintainer_emailurllicense descriptionlong_descriptionkeywords platforms classifiers download_urlrequiresprovides obsoletes)rsources include_dirs define_macros undef_macros library_dirs librariesruntime_library_dirs extra_objectsextra_compile_argsextra_link_args swig_optsexport_symbolsdependslanguagec |d}|r|d=nt}d|vr2tjt jd|d<d|vrt jdd|d< ||xa}nQ#t$rD}d|vrtd|ztd |d|d}~wwxYwtd kr|S| tr#td |td kr|S |}n9#t"$r,}tt%|jd |zzd}~wwxYwtr#td|tdkr|S|rt)|S|S)aThe gateway to the Distutils: do everything your setup script needs to do, in a highly flexible and user-driven way. Briefly: create a Distribution instance; find and parse config files; parse the command line; run each Distutils command found there, customized by the options supplied to 'setup()' (as keyword arguments), in config files, and on the command line. The Distribution instance might be an instance of a class supplied via the 'distclass' keyword argument to 'setup'; if no such class is supplied, then the Distribution class (in dist.py) is instantiated. All other arguments to 'setup' (except for 'cmdclass') are used to set attributes of the Distribution instance. The 'cmdclass' argument, if supplied, is a dictionary mapping command names to command classes. Each command encountered on the command line will be turned into a command class, which is in turn instantiated; any class found in 'cmdclass' is used in place of the default, which is (for command 'foo_bar') class 'foo_bar' in module 'distutils.command.foo_bar'. The command class must provide a 'user_options' attribute which is a list of option specifiers for 'distutils.fancy_getopt'. Any command-line options between the current and the next command are used to set attributes of the current command object. When the entire command-line has been successfully parsed, calls the 'run()' method on each command object in turn. This method will be driven entirely by the Distribution object (which each command object has a reference to, thanks to its constructor), and the command-specific options that became attributes of each command object. rrrrrNrzerror in setup command: %szerror in {} setup command: {}initz%options (after parsing config files):configz error: %sz%options (after parsing command line): commandline)getr rrrsysargv_setup_distributionr SystemExitformat_setup_stop_afterparse_config_filesrprintdump_option_dictsparse_command_linerrr run_commands)attrsklassdistmsgoks rr r `sJ IIk " "E  +  E!!!w// <<mE!!"x|mY%*U5\\1dd YYY   9C?@@ @<CCE&MSVWWXX X Y F""   ! 5666    H$$ L  $ $ & & LLL4#344}s7JJKKKL ! 5666    M))  "D!!! Ks05 B C ?C  C-E E8 'E33E8c |n#t$rtdt$ra}tr3t jd|td|d}~wttf$r,}trtdt|zd}~wwxYw|S)zGiven a Distribution object run all the commands, raising ``SystemExit`` errors in the case of failure. This function assumes that either ``sys.argv`` or ``dist.script_args`` is already set accordingly. interruptedz error: {} z error: {}Nzerror: ) rJKeyboardInterruptrCOSErrorrr@stderrwriterDrrstr)rMexcrNs rrJrJs3  (((''' 666  6 J  ]11#66 7 7 7 [//4455 5 N +333  3 YS122 2 3 Ks!"CABC)'CCruncN|dvr"td||atj}|dd} |tjd<||tjdd<t j|5}| dd }t||dddn #1swxYwY|t_dan#|t_dawxYwn#t$rYnwxYwttd |ztS) a.Run a setup script in a somewhat controlled environment, and return the Distribution instance that drives things. This is useful if you need to find out the distribution meta-data (passed as keyword args from 'script' to 'setup()', or the contents of the config files or command-line. 'script_name' is a file that will be read and run with 'exec()'; 'sys.argv[0]' will be replaced with 'script' for the duration of the call. 'script_args' is a list of strings; if supplied, 'sys.argv[1:]' will be replaced by 'script_args' for the duration of the call. 'stop_after' tells 'setup()' when to stop processing; possible values: init stop after the Distribution instance has been created and populated with the keyword arguments to 'setup()' config stop after config files have been parsed (and their data stored in the Distribution instance) commandline stop after the command-line ('sys.argv[1:]' or 'script_args') have been parsed (and the data stored in the Distribution) run [default] stop after all commands have been run (the same as if 'setup()' had been called in the usual way Returns the Distribution instance, which provides all information used to drive the Distutils. )r<r=r>rXz$invalid value for 'stop_after': {!r}__main__)__file____name__rNrz\r\nz\nzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?) ValueErrorrDrEr@rAcopytokenizeopenreadreplaceexecrCrB RuntimeError)rr stop_after save_argvgfcodes r run_setuprjs>AAA?FFzRRSSS# I j99A  %%CHQK&* {++ qvvxx''77T1                !CH $  !CH $  $ $ $ $       "@      sH6C#9C = C# C  C#C C#C7#C33C77 DD)NrX)__doc__rr@r_debugrerrorsrrrrrMr cmdr r=r extensionr __all__rrrErBsetup_keywordsextension_keywordsr rJrjrrrtsK !!!!!!  M L L   2&[[[B6DDDDDDrPK!O/_distutils/__pycache__/dep_util.cpython-311.pycnu[ ,ReV 2dZddlZddlmZdZdZd dZdS) zdistutils.dep_util Utility functions for simple, timestamp-based dependency of files and groups of files; also, function based entirely on such timestamp dependency analysis.N)DistutilsFileErrorc`tj|s/tdtj|ztj|sdSddlm}tj||}tj||}||kS)aReturn true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Return false if both exist and 'target' is the same age or younger than 'source'. Raise DistutilsFileError if 'source' does not exist. zfile '%s' does not existrrST_MTIME)ospathexistsrabspathstatr)sourcetargetrmtime1mtime2s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/dep_util.pynewerr s 7>>& ! !W !;bgoof>U>U!UVVV 7>>& ! !q WV__X &F WV__X &F F?cRt|t|krtdg}g}tt|D]T}t||||r6||||||U||fS)zWalk two filename lists in parallel, testing if each source is newer than its corresponding target. Return a pair of lists (sources, targets) where source is newer than target, according to the semantics of 'newer()'. z+'sources' and 'targets' must be same length)len ValueErrorrangerappend)sourcestargets n_sources n_targetsis rnewer_pairwiser!s  7||s7||##FGGGII 3w<< )) WQZ ( ( )   WQZ ( ( (   WQZ ( ( ( y !!rerrorcDtj|sdSddlm}tj||}|D][}tj|s|dkrn|dkr/|dkrdStj||}||krdS\dS)aReturn true if 'target' is out-of-date with respect to any file listed in 'sources'. In other words, if 'target' exists and is newer than every file in 'sources', return false; otherwise return true. 'missing' controls what we do when a source file is missing; the default ("error") is to blow up with an OSError from inside 'stat()'; if it is "ignore", we silently drop any missing source files; if it is "newer", any missing source files make us assume that 'target' is out-of-date (this is handy in "dry-run" mode: it'll make you pretend to carry out commands that wouldn't work because inputs are missing, but that doesn't matter because you're not actually going to run the commands). rrrrignorer)rr r r r)rrmissingr target_mtimer source_mtimes r newer_groupr%8s 7>>& ! !q 76??8,L  w~~f%% '!!H$$G##qqwvx0 , & &11 'qr)r)__doc__rerrorsrrrr%rrr)sh""  &&&&&&,""".%%%%%%rPK!/0b0b4_distutils/__pycache__/_msvccompiler.cpython-311.pycnu[ ,ReL6dZddlZddlZddlZddlZddlmZeje5ddl Z dddn #1swxYwYddl m Z m Z m Z mZmZddlmZmZddlmZddlmZddlmZd Zd Zd d d ddZdZdZddZd ddddZGddeZ dS)adistutils._msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for Microsoft Visual Studio 2015. The module is compatible with VS 2015 and later. You can find legacy support for older versions in distutils.msvc9compiler and distutils.msvccompiler. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_lib_options)log) get_platform)countcj tjtjdtjtjz}n%#t $rt jdYdSwxYwd}d}|5tD]} tj ||\}}}n#t $rYn{wxYw|rt|tj krdtj |rE tt|}n#t t"f$rYwxYw|dkr ||kr||}}dddn #1swxYwY||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr)winreg OpenKeyExHKEY_LOCAL_MACHINEKEY_READKEY_WOW64_32KEYOSErrorr debugr EnumValueREG_SZospathisdirintfloat ValueError TypeError)key best_versionbest_dirivvc_dirvtversions /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_msvccompiler.py _find_vc2015r+'s  % 6?V%;;     0111zzLH = = = =A  & 0a 8 8 622     =R6=((RW]]6-B-B(!%((mmGG"I.Hb==W|%;%;-4f(L = = = = = = = = = = = = = = =  !!si8;AA&D&8BD& B D&B  4D&C21D&2DD&DD&&D*-D*c tjdptjd}|sdS tjtj|dddddd d d d d dg dd}n##tjttf$rYdSwxYwtj|ddd}tj |rd|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. zProgramFiles(x86) ProgramFilesrzMicrosoft Visual Studio Installerz vswhere.exez-latestz -prereleasez -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuild) renvironget subprocess check_outputrjoinstripCalledProcessErrorrUnicodeDecodeErrorr)rootrs r* _find_vc2017rBDs :>>- . . P"*..2P2PD z& 3[-C"    %''! "  )74F Gzz 7<<dK 9 9D w}}T4x :sABB76B7x86x64armarm64)rC x86_amd64x86_arm x86_arm64c.t\}}|st\}}|stjddStj|d}tj|stjd|dS|dfS)Nz$No suitable Visual C++ version foundrz vcvarsall.batz%s cannot be found)rBr+r rrrr=isfile) plat_spec_r$r# vcvarsalls r*_find_vcvarsallrOvs..KAx 0!- h  8999z X77I 7>>) $ $ & 222z d?ctjdr(dtjDSt |\}}|st d t jd|d|dt j dd }nG#t j $r5}tj |j t d |jd}~wwxYwd d |DD}|S)NDISTUTILS_USE_SDKc>i|]\}}||Slower).0r"values r* z_get_vc_env..s&HHHzsE UHHHrPzUnable to find vcvarsall.batz cmd /u /c "z" z && set)stderrzutf-16lereplace)r4zError executing cHi|]\}}}|| || SrTrU)rWr"rMrXs r*rYz_get_vc_env..sH    CE    U   rPc3@K|]}|dVdS)=N) partition)rWlines r* z_get_vc_env..s.OOddnnS11OOOOOOrP)rgetenvr9itemsrOrr;r<STDOUTdecoder?r erroroutputcmd splitlines)rLrNrMoutexcenvs r* _get_vc_envrmsB y$%%IHHRZ5E5E5G5GHHHH"9--LIq E$%CDDDC% 9) 9 9y 9 9 9$    &I& . .   (CCC #*$%A%A%ABBBC  OOcnn>N>NOOO   C Js!>"   III  JrPrGrHrI)win32z win-amd64z win-arm32z win-arm64cJeZdZdZdZiZdgZgdZdgZdgZ eezeze zZ dZ dZ d Z d Zd xZZd Zdfd ZedZedZddZefdZ ddZ d dZ d!dZfdZejfdZ dZ!dZ"dZ#d"dZ$xZ%S)# MSVCCompilerztConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.msvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercjt|||d|_d|_dS)NF)super__init__ plat_name initialized)selfverbosedry_runforce __class__s r*r~zMSVCCompiler.__init__s4 '5111 rPc||dd|_||dd|_dS)z3 Set class-level include/lib dirs. includelibN) _parse_pathr: include_dirs library_dirs)clsvc_envs r* _configurezMSVCCompiler._configuresN ??6::i+D+DEE??6::eR+@+@AArPcTd|tjDS)NcPg|]#}||tj$SrT)rstriprsep)rWdirs r* z,MSVCCompiler._parse_path..s+KKKssK 26""KKKrP)rorrp)vals r*rzMSVCCompiler._parse_paths$KKcii .C.CKKKKrPNc|jr Jd|t}|tvr$tdt tt|}t |}|std|||dd|_|j tj }td||_ td||_td||_td ||_td ||_td ||_d|_gd |_gd |_gd}gd}g|d|_g|d|_g|ddd|_g|ddd|_g||_g||_t8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|ji |_ d|_dS)Nzdon't init multiple timesz--plat-name must be one of z7Unable to find a compatible Visual Studio installation.rrzcl.exezlink.exezlib.exezrc.exezmc.exezmt.exe)/nologoz/O2/W3z/GLz/DNDEBUGz/MD)rz/Odz/MDdz/Zirz/D_DEBUG)r/INCREMENTAL:NO/LTCG)rrrz /DEBUG:FULLz/MANIFEST:EMBED,ID=1z/DLLz/MANIFEST:EMBED,ID=2z/MANIFESTUAC:NOFT)!rr PLAT_TO_VCVARSrtuplermrr:_pathsrorrprvcclinkerrrcmcmtpreprocess_optionscompile_optionscompile_options_debug ldflags_exeldflags_exe_debugldflags_sharedldflags_shared_debugldflags_staticldflags_static_debugr EXECUTABLE SHARED_OBJECTSHARED_LIBRARY_ldflags)rrrLrrsldflags ldflags_debugs r* initializezMSVCCompiler.initializes#@@%@@@@  $I N * *(EeN.C.CEE  #9- Y'' (L  jj,,  !!"*--He,, E22 Y..He,,He,,He,,"& SRR& & & ":99NNN =W=&<=!I=!I2H!I    #     % % %  #%   % ! )j$4m$4! !4 ($*:  !5 )4+;  !4 ($*@  $d +T-@  $e ,d.A  $d +T-F  %t ,d.A  %u -t/B  %t ,d.G    rPcfitjfdjjzDS)Nc i|] }|j SrT) res_extension)rWextrs r*rYz/MSVCCompiler.out_extensions..Es.T'rP)r}out_extensions_rc_extensions_mc_extensions)rrs`r*rzMSVCCompiler.out_extensionsAsS gg$ .1DD  rPc $|js||||||||} | \}} }} } |pg} | d|r| |jn| |jd}| D]|} | |\}}n#t$rYwxYw|rtj |}||j vrd|z}n||j vr d|z}d}n{||j vrN|}d|z} ||jg| z||gzn!#t $r}t#|d}~wwxYw||jvrtj |}tj |} ||jd|d||gtj tj |\}}tj ||d z}||jd|z|gn!#t $r}t#|d}~wwxYwt#d |d ||jg| z| z}|r|d |||d |z|| ||]#t $r}t#|d}~wwxYw| S)Nz/cFz/Tcz/TpTz/foz-hz-rr{zDon't know how to compile z to z/EHscz/Fo)rr_setup_compileappendextendrrKeyErrorrrrq _c_extensions_cpp_extensionsrspawnrrrrdirnamersplitextbasenamer=r)rsources output_dirmacrosrr extra_preargsextra_postargsdepends compile_infoobjectspp_optsbuild compile_opts add_cpp_optsobjsrcr input_opt output_optmsgh_dirrc_dirbaserMrc_fileargss r*compilezMSVCCompiler.compileKs  OO   **  gw  ;G7%$* D!!!  6    : ; ; ; ;    4 5 5 5 @ (@ (C  :SS     +gooc**d(((!CK ,,,!CK # +++ "S[ ,JJy72j)5LLMMMM),,,&s+++,+++,,-- ,JJudFCHIII g..rw/?/?/D/DEEGD! gll64%<@@GJJg>????),,,&s+++,##N#N#N#N#NOOOG9|+g5D % G$$$ KK " " " KK $ $ $ KK ' ' ' ( 4    % ( ( ("3''' (s[ B"" B/.B/#D** E4EEB"H88 IIIK// L 9LL c|js||||\}}|||}|||r||d|zgz}|r t jd|jd|| |jg|zdS#t$r}t|d}~wwxYwt jd|dS)N)r/OUT:Executing "%s" %s skipping %s (up-to-date)) rr_fix_object_argslibrary_filename _need_linkr rrr=rrr) rroutput_libnamerr target_langoutput_filenamelib_argsrs r*create_static_libzMSVCCompiler.create_static_libs  OO   "33GZHH//:/VV ??7O 4 4 C'O";!<.sNNN:+NNNrPrrz/IMPLIB:rrr)rrr _fix_lib_argswarnstrr rrr=rrrrrrrrrqmkpathr rrrrr)r target_descrrr librariesrruntime_library_dirsexport_symbolsrrr build_tempr fixed_argslib_optsr export_optsld_argsdll_namedll_ext implib_filers r*linkzMSVCCompiler.links"  OO   "33GZHH'' W=XX 44J)&(g&6&6G$$_55''#7!gll:t7L7LX7V7VWW zK7888 ,+  /~...)I)IJJJ KK # # # % -t{CHHWFallback spawn triggered. Please update distutils monkeypatch.z os.environ) typer!rwarningsrmockpatchrr}rrX)rrhrlbagrkrs r*rzMSVCCompiler._fallback_spawn s""d5"b!!## III F    2#c((BBCBBBB   VWWW Z__\3 / / + + c**CI + + + + + + + + + + + + + + + + + +s&$ A AA 'B55B9<B9c d|zS)Nz /LIBPATH:rTrrs r*library_dir_optionzMSVCCompiler.library_dir_option#s S  rPc td)Nz:don't know how to set runtime library search path for MSVC)rr s r*runtime_library_dir_optionz'MSVCCompiler.runtime_library_dir_option&s$ H   rPc,||SN)r)rrs r*library_optionzMSVCCompiler.library_option+s$$S)))rPc|r|dz|g}n|g}|D]_}|D]Z}tj|||}tj|r|ccS[`dS)N_d)rrr=rrK)rdirsrr try_namesrnamelibfiles r*find_library_filezMSVCCompiler.find_library_file.s  tS)III  C! # #',,sD,A,A$,G,GHH7>>'**#"NNNNN# # 4rP)rrrr)NNNrNNN)NrN) NNNNNrNNNN)r)&__name__ __module__ __qualname____doc__ compiler_type executablesrrrrsrc_extensionsr obj_extensionstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionr~ classmethodr staticmethodrrpropertyrrrrr contextlibcontextmanagerrr rrr __classcell__)rs@r*ryrys=33MKFM---OWNWN#_4~EVNMM!!,22)M!!!!!! BB[BLL\LN N N N d    X ^^^^BNRCCCC4!DCDCDCDCL +++++,!!!   ***rPryr)!rrr;r)r unittest.mockrsuppress ImportErrorrr4rrrrr ccompilerr r _logr utilr itertoolsr r+rBPLAT_SPEC_TO_RUNTIMErOrmrvrryrTrPr*r4s Z%%MMM21111111""":'''V  &4, |||||9|||||s :>>PK!9-_distutils/__pycache__/config.cpython-311.pycnu[ ,Re/JdZddlZddlmZddlmZdZGddeZdS) zdistutils.pypirc Provides the PyPIRCCommand class, the base class for the command classes that uses .pypirc in the distutils.command package. N)RawConfigParser)CommandzE[distutils] index-servers = pypi [pypi] username:%s password:%s c`eZdZdZdZdZdZdZdddezfdgZd gZ d Z d Z d Z d Z dZdZdS) PyPIRCCommandz6Base command that knows how to handle the .pypirc filezhttps://upload.pypi.org/legacy/pypiNz repository=rzurl of repository [default: %s]) show-responseNz&display full response text from serverr c|tjtjddS)zReturns rc file path.~z.pypirc)ospathjoin expanduserselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/config.py _get_rc_filezPyPIRCCommand._get_rc_file%s(w||BG..s33Y???c|}tjtj|tjtjzdd5}|t||fzddddS#1swxYwYdS)zCreates a default .pypirc file.iwN)rr fdopenopenO_CREATO_WRONLYwriteDEFAULT_PYPIRC)rusernamepasswordrcfs r _store_pypirczPyPIRCCommand._store_pypirc)s     Yrwr2: #;UCCS I I ;Q GGNh%99 : : : ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s BB Bc|}tj|r|d|z|jp|j}t}||| }d|vr| dd}d| dD}|gkr d|vrdg}niS|D]}d|i}| |d|d<d |jfd |j fd fD]:\} } | || r| || || <5| || <;|dkr||jdfvr|j|d <|cS|d|ks |d |kr|cSnod |vrkd }| |d r| |d }n|j}| |d| |d |||j dSiS)zReads the .pypirc file.zUsing PyPI login from %s distutilsz index-serverscfg|].}|dk|/S))strip).0servers r z.PyPIRCCommand._read_pypirc..<s=||~~++LLNN+++r rr)r repositoryrealm)rNz server-loginr)rrr,r)r-)rr rexistsannouncer,DEFAULT_REPOSITORYrreadsectionsgetsplit DEFAULT_REALM has_option) rr r,configr2 index_servers_serversr)currentkeydefaults r _read_pypirczPyPIRCCommand._read_pypirc/s     7>>"  B  MM4r9 : : :CD,CJ$&&F KKOOO((Hh&& & ; H H "/"5"5d";"; r>>))$*8 " &''F'0G*0**VZ*H*HGJ'&t'>? $"45*)33 W ",,VS993+1::fc+B+BGCLL+2GCLL ''J/;--150G -& )Z77"<0J>>&?7'< 8++'$$V\::9!'FL!A!AJJ!%!8J & 6: > > & 6: > >",$!/  rcddl}|dd}||ddd}||S)z%Read and decode a PyPI HTTP response.rNz content-typez text/plainrcharsetascii)cgi getheader parse_headerr3r1decode)rresponserA content_typeencodings r_read_pypi_responsez!PyPIRCCommand._read_pypi_responsexsd )).,GG ##L11!488GLL}}%%h///rc0d|_d|_d|_dS)zInitialize options.Nr)r,r- show_responsers rinitialize_optionsz PyPIRCCommand.initialize_optionss rcV|j |j|_|j|j|_dSdS)zFinalizes options.N)r,r0r-r5rs rfinalize_optionszPyPIRCCommand.finalize_optionss2 ? ""5DO : +DJJJ  r)__name__ __module__ __qualname____doc__r0r5r,r- user_optionsboolean_optionsrr"r=rHrKrMrrrrs@@:MJ E >ASSTIL ''O@@@;;; GGGR000 ,,,,,rr)rQr configparserrcmdrrrrTrrrWs  ((((((u,u,u,u,u,Gu,u,u,u,u,rPK! 5))0_distutils/__pycache__/file_util.cpython-311.pycnu[ ,Re `dZddlZddlmZddlmZdddd Zdd Z dd Zdd Z dZ dS)zFdistutils.file_util Utility functions for operating on single files. N)DistutilsFileError)logcopyingz hard linkingzsymbolically linking)Nhardsym@c.d}d} t|d}n:#t$r-}td||jd}~wwxYwt j|rP t j|n:#t$r-}td||jd}~wwxYw t|d}n:#t$r-}td||jd}~wwxYw | |}n:#t$r-}td||jd}~wwxYw|snR | |n:#t$r-}td ||jd}~wwxYw |r| |r| dSdS#|r| |r| wwxYw) a5Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. Nrbzcould not open '{}': {}zcould not delete '{}': {}wbzcould not create '{}': {}Tzcould not read from '{}': {}zcould not write to '{}': {}) openOSErrorrformatstrerrorospathexistsunlinkreadwriteclose)srcdst buffer_sizefsrcfdstebufs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/file_util.py_copy_file_contentsr s D D* XT??DD X X X$%>%E%Ec1:%V%VWW W X 7>>#     #   (/66sAJGG   T??DD   $+223 CC     ii ,,   (299#qzJJ     3   (188ajII     JJLLL   JJLLLLL     JJLLL   JJLLLL sG% A(A  A"G%2BG% B>(B99B>>G%CG% D (DD  G%D%$G%% E/(EEG%#E98G%9 F0(F++F00G%%/Hcddlm}ddlm} m} m} m} tj |std|ztj |r@|} tj |tj |}ntj|} |r+|||s|dkrtjd||dfS t"|}n #t$$rt'd|zwxYw|dkrotj |tj |krtjd||| ntjd||||r|dfS|d krjtj|r tj||s* tj|||dfS#t0$rYncwxYwn^|d krXtj|r tj||stj|||dfSt5|||s|r_tj|}|r#tj||| || f|r$tj|| || |dfS) aCopy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. If hardlink fails, falls back to _copy_file_contents(). Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). r)newer)ST_ATIMEST_MTIMEST_MODES_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz %s %s -> %srr)distutils.dep_utilr"statr#r$r%r&rrisfilerisdirjoinbasenamedirnamerdebug _copy_actionKeyError ValueErrorinforsamefilelinkrsymlinkr utimechmod)rr preserve_modepreserve_timesupdater4verbosedry_runr"r#r$r%r&diractionsts r copy_filer@FsR)(((((999999999999 7>>#    BS H    w}}S#gll3 0 0 5 566gooc"" eeCoo a<< I:C @ @ @QxJd# JJJADHIIIJ!|| 7  C BG$4$4S$9$9 9 9 H]FC 5 5 5 5 H]FC 5 5 5Qx s## (8(8c(B(B  S!!!Qx        s## (8(8c(B(B  JsC 8OS!!!00 WS\\  8 HS2h<H6 7 7 7  0 HS''"W+.. / / / 8Os0 C>>DG88 HHc ddlm}m}m}m}m}ddl} |dkrtjd|||r|S||std|z||r*tj |||}n.||r#td |||||s#td ||d } tj||nS#t$rF} | j\} } | | jkrd } n$td ||| Yd} ~ nd} ~ wwxYw| rt%|||  tj|n]#t$rP} | j\} } tj|n#t$rYnwxYwtd |d|d|d| d} ~ wwxYw|S)a%Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? r)rr)r*r,r-Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '{}': destination '{}' already existsz2can't move '{}': destination '{}' not a valid pathFTzcouldn't move '{}' to '{}': {})r;zcouldn't move 'z' to 'z' by copy/delete: delete 'z ' failed: )os.pathrr)r*r,r-errnorr2rrrr+rrenamerargsEXDEVr@r)rrr;r<rr)r*r,r-rCcopy_itrnummsgs r move_filerJsA@@@@@@@@@@@@@LLL!|| "C--- 6#;;N !F!LMMM uSzz gll3 ..   > E Ec3 O O    5    @ G GS Q Q   G  #s V c %+  GG$077S#FF  GGGG #sG,,,,  IcNNNN   JS#  #    $$,/CCccc33@   JsT-D E rXs  &&&&&& @VWW 5555v hhhhX;;;;|     rWPK!fE((0_distutils/__pycache__/extension.cpython-311.pycnu[ ,Re(:dZddlZddlZGddZdZdS)zmdistutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts.Nc<eZdZdZ ddZdZdS) Extensiona Just a collection of attributes that describes an extension module and everything needed to build it (hopefully in a portable way, but there are hooks that let you be as unportable as you need). Instance attributes: name : string the full name of the extension, including any packages -- ie. *not* a filename or pathname, but Python dotted name sources : [string] list of source filenames, relative to the distribution root (where the setup script lives), in Unix form (slash-separated) for portability. Source files may be C, C++, SWIG (.i), platform-specific resource files, or whatever else is recognized by the "build_ext" command as source for a Python extension. include_dirs : [string] list of directories to search for C/C++ header files (in Unix form for portability) define_macros : [(name : string, value : string|None)] list of macros to define; each macro is defined using a 2-tuple, where 'value' is either the string to define it to or None to define it without a particular value (equivalent of "#define FOO" in source or -DFOO on Unix C compiler command line) undef_macros : [string] list of macros to undefine explicitly library_dirs : [string] list of directories to search for C/C++ libraries at link time libraries : [string] list of library names (not filenames or paths) to link against runtime_library_dirs : [string] list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is loaded) extra_objects : [string] list of extra files to link with (eg. object files not implied by 'sources', static library that must be explicitly specified, binary resource files, etc.) extra_compile_args : [string] any extra platform- and compiler-specific information to use when compiling the source files in 'sources'. For platforms and compilers where "command line" makes sense, this is typically a list of command-line arguments, but for other platforms it could be anything. extra_link_args : [string] any extra platform- and compiler-specific information to use when linking object files together to create the extension (or to create a new static Python interpreter). Similar interpretation as for 'extra_compile_args'. export_symbols : [string] list of symbols to be exported from a shared extension. Not used on all platforms, and not generally necessary for Python extensions, which typically export exactly one symbol: "init" + extension_name. swig_opts : [string] any extra options to pass to SWIG if a source file has the .i extension. depends : [string] list of files that the extension depends on language : string extension language (i.e. "c", "c++", "objc"). Will be detected from the source extensions if not provided. optional : boolean specifies that a build failure in the extension should not abort the build process, but simply not install the failing extension. Nc t|tstdt|trt d|Dstd||_||_|pg|_|pg|_|pg|_ |pg|_ |pg|_ |pg|_ | pg|_ | pg|_| pg|_| pg|_| pg|_|pg|_||_||_t+|dkrId|D}dt/|}d|z}t1j|dSdS)Nz'name' must be a stringc3@K|]}t|tVdS)N) isinstancestr).0vs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/extension.py z%Extension.__init__..ms,1V1V*Q2D2D1V1V1V1V1V1Vz#'sources' must be a list of stringsrc,g|]}t|S)repr)r options r z&Extension.__init__..s555tF||555r z, zUnknown Extension options: %s)rrAssertionErrorlistallnamesources include_dirs define_macros undef_macros library_dirs librariesruntime_library_dirs extra_objectsextra_compile_argsextra_link_argsexport_symbols swig_optsdependslanguageoptionallenjoinsortedwarningswarn)selfrrrrrrrrrrr r!r"r#r$r%kwoptionsmsgs r __init__zExtension.__init__Wsz($$$ < !:;; ;7D)) Hc1V1Vg1V1V1V.V.V H !FGG G  (.B*0b(.B(.B"b$8$>B!*0b"4":.4",2"b}"      r77Q;;55"555Giiw00G1G;C M#      ;r c~d|jj|jj|jt |S)Nz<{}.{}({!r}) at {:#x}>)format __class__ __module__ __qualname__rid)r+s r __repr__zExtension.__repr__s8'.. N % N ' I tHH    r )NNNNNNNNNNNNNN)__name__r3r4__doc__r/r6rr r rrso>>L!#////b     r rcddlm}m}m}ddlm}ddlm}||}||ddddd} g} |} | n| | r/| d| d cxkrd krnn| d | zd|| |} || } | d} t| g} d} | ddD]?}| | |d} tj|d}|dd }|d d}|d vr| j |u|dkr| j ||dkri|d}|d kr| j |df| j |d|||d zdf|dkr| j |'|dkr| j |I|dkr| j |k|dkr| j ||dkr| j ||dkr | j} |dkr | j} |dkr | j} |dkr%| j ||s| j} |dvr| j |'| d|zA| |  |n#|wxYw|S)z3Reads a Setup file and returns Extension instances.r)parse_makefileexpand_makefile_vars _variable_rx)TextFile) split_quoted)strip_comments skip_blanks join_lines lstrip_ws rstrip_wsTN*z'%s' lines not handled yet)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz -Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')distutils.sysconfigr:r;r<distutils.text_filer=distutils.utilr>readlinematchr*rappendospathsplitextrrfindrrrrrrr rclose)filenamer:r;r<r=r>varsfile extensionslinewordsmoduleextappend_next_wordwordsuffixswitchvalueequalss r read_setup_filerbs$VVVVVVVVVV,,,,,,++++++ >( # #D 8    DQ L #==??D|!!$'' Aw$r())))c))))) 6=>>>''d33D L&&E1XFFB''C# abb 2 C2 C#/$++D111'+$))$//2acQRROOOK&&t,,,,t^^$++E2222t^^"ZZ__F||)00%????)00%&/5RSCV1WXXXXt^^$++E2222t^^*11$7777t^^M((////t^^$++E2222t^^,33E::::X%%'*'?$$Z'''*':$$\))'*'=$$t^^'..t444 ?+.+>(CCC %,,T2222II:TABBBB   c " " "YL #V  s K9MM)r8rOr)rrbrr r rcsr  z z z z z z z z zgggggr PK!S R1_distutils/__pycache__/_functools.cpython-311.pycnu[ ,ReddlZdZdS)NcFtjfd}|S)z Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) c$| |g|Ri|SdS)N)paramargskwargsfuncs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_functools.pywrapperzpass_none..wrappers1  4////// /  ) functoolswraps)r r s` r pass_noners:_T00000 Nr )r rrr r rs*r PK!443_distutils/__pycache__/bcppcompiler.cpython-311.pycnu[ ,Re9dZddlZddlZddlmZmZmZmZmZddl m Z m Z ddl m Z ddlmZddlmZejd eGd d e ZdS) zdistutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. N)DistutilsExecError CompileErrorLibError LinkErrorUnknownFileError) CCompilergen_preprocess_options) write_file)newer)logzbcppcompiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case.ceZdZdZdZiZdgZgdZeezZdZ dZ dZ dxZ Z d Zdfd Z dd Z ddZ ddZddZddZ ddZxZS) BCPPCompilerzConcrete class that implements an interface to the Borland C/C++ compiler, as defined by the CCompiler abstract class. bcppz.c)z.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exerct|||d|_d|_d|_d|_gd|_gd|_gd|_gd|_ g|_ gd|_ gd|_ dS) Nz bcc32.exez ilink32.exeztlib.exe)/tWMz/O2/q/g0)rz/Odrr)z/Tpd/Gnr/x)rrr)rrrz/r) super__init__cclinkerlibpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugldflags_static ldflags_exeldflags_exe_debug)selfverbosedry_runforce __class__s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/bcppcompiler.pyrzBCPPCompiler.__init__Bs '5111 # "&;;;%A%A%A"999$?$?$?! ...!:!:!:Nc ~|||||||\}} }} } |pg} | d|r| |jn| |j| D]H} | | \}}n#t $rYwxYwt j|}t j| } | t j | |dkr|dkr= | dd| |gn!#t$r}t|d}~wwxYw||jvrd}n||jvrd}nd}d| z} | |jg| z| z||gz|z|gz)#t$r}t|d}~wwxYw| S) Nz-c.res.rcbrcc32z-foz-P-o)_setup_compileappendextendrrKeyErrorospathnormpathmkpathdirnamespawnrr _c_extensions_cpp_extensionsr)r$sources output_dirmacros include_dirsdebug extra_preargsextra_postargsdependsobjectspp_optsbuild compile_optsobjsrcextmsg input_opt output_opts r)compilezBCPPCompiler.compileZsQ;?:M:M  gw; ; 7%%* D!!!  6    : ; ; ; ;    4 5 5 51 (1 (C  :SS    '""3''C'""3''C KK,, - - -f}}e||,JJ%c:;;;;),,,&s+++,d((( ,,,  J ( WI"#!*-.% % e & ( ( ("3''' (sB7 B BBD++ E 5EE --F F:&F55F:cT|||\}}|||}|||rL|dg|z}|r ||jg|zdS#t $r}t |d}~wwxYwtjd|dS)N)r>z/uskipping %s (up-to-date)) _fix_object_argslibrary_filename _need_linkr:rrrr rA) r$rEoutput_libnamer>rA target_langoutput_filenamelib_argsrLs r)create_static_libzBCPPCompiler.create_static_libs!% 5 5gz J J*//:/VV ??7O 4 4 C'.8H  $ DH:011111% $ $ $smm# $ I0/ B B B B BsA22 B<B  Bc|||\}}||||\}}}|r"tjdt || t j||}|||r|tj kr$d}| r|j dd}n3|j dd}n#d}| r|j dd}n|jdd}|d}nt j|\}}t j|\}}t j|d}t j|d|z}dg}|pgD]+}|d||,|t*||fd |zt-t jj|}|g}g}|D]r}t jt j|\}}|d kr||]||s|D]7}|d t j|z8|d |||d |g|d|D]F}|||| }|||1||G|d|d|d |g|d ||| r| |dd<| r|| |t j| ||jg|zdS#t<$r}t?|d}~wwxYwtj d|dS)Nz7I don't know what to do with 'runtime_library_dirs': %sc0w32c0d32r/rz%s.defEXPORTSz {}=_{}z writing %sr,z/L%sz/L.,z,,import32cw32mtrQ)!rR _fix_lib_argsr warningstrr5r6joinrTr EXECUTABLEr#r"r rsplitsplitextr9r2formatexecuter mapr7normcaser3find_library_filer8r:rrrrA) r$ target_descrErWr> libraries library_dirsruntime_library_dirsexport_symbolsrArBrC build_temprV startup_objld_argsdef_fileheadtailmodnamerKtemp_dircontentssymobjects2 resourcesfilebaseellrlibfilerLs r)linkzBCPPCompiler.links|(!% 5 5gz J J*:>:L:L |%9; ; 7L"6   KI())     ! gll:GGO ??7O 4 4a Ci222% 2"4QQQ7GG".qqq1GG% 5"7:GG"1!!!4G%W]]?;; d!w//55 7??71:667<<(W2DEE%;)/RAACOOJ$5$5c3$?$?@@@@ Z(H)=|h?VWWW27+W55H#mGI  ) ) g..rw/?/?/E/EFF s&==$$T****NN4((((# ? ?v(8(8(=(==>>>> NN5 ! ! ! NN7 # # # NNC1 2 2 2 NN4  , ,00sEJJ?NN3''''NN7++++ NN: & & & NN8 $ $ $ NNC? + + + NN3    NN9 % % % ,+  /~... KK88 9 9 9 % DK=7233333% % % %nn$ % I0/ B B B B Bs>P P<(P77P<c|r|dz}|dz|dz||f}n|dz|f}|D]_}|D]Z}tj|||}tj|r|ccS[`dS)N_d_bcpp)r5r6rdrSexists) r$dirsrrAdlib try_namesdirnamers r)rlzBCPPCompiler.find_library_fileDs  -:DwcBIIw,I  C! # #',,sD,A,A$,G,GHH7>>'**#"NNNNN# # 4r*r/c|d}g}|D]J}tjtj|\}}||jddgzvr#t d|||rtj|}|dkr7|tj |||z|dkr8|tj ||dz|tj |||j zL|S)Nr/r-r,z"unknown file type '{}' (from '{}')) r5r6rgrksrc_extensionsrrhbasenamer2rd obj_extension)r$source_filenames strip_dirr> obj_namessrc_namerrKs r)object_filenameszBCPPCompiler.object_filenames^sD  J ( V VH'**27+;+;H+E+EFFKT34.%@AA&8??XNN .w''--f}}  j$*!E!EFFFF  j$-!H!HIIII  j$AS:S!T!TUUUUr*c0|d||\}}}t||}dg|z} || d|z|r|| dd<|r| || ||js|t ||r||r2|tj | | | dS#t$r#} t| t| d} ~ wwxYwdS)Nz cpp32.exer0r)_fix_compile_argsr r2r3r'r r8r5r6r9r:rprintr) r$source output_filer?r@rBrC_rFpp_argsrLs r) preprocesszBCPPCompiler.preprocessws@%)$:$:4$V$V!FL(>>-')  " NN4+- . . .  ('GBQBK  + NN> * * *v : (,fk0J0J, : BGOOK88999 ( 7#####% ( ( (c "3''' ( -,sC&& D0DD)rrr)NNNrNNN)NrN) NNNNNrNNNN)r)rr/)NNNNN)__name__ __module__ __qualname____doc__ compiler_type executablesr;r<rrstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionrrOrYrrlrr __classcell__)r(s@r)rr'spMKFM---O#_4NM!!,22)M;;;;;;6IIII\NRCCCC2!CCCCCCCCR48((((((((r*r)rr5warningserrorsrrrrr ccompilerr r file_utilr dep_utilr _logr warnDeprecationWarningrr*r)rs 98888888!!!!!! 4 o(o(o(o(o(9o(o(o(o(o(r*PK!Jzz4_distutils/__pycache__/_macos_compat.cpython-311.pycnu[ ,RedddlZddlZdZejdkrejdjZdSeZdS)Nc|S)N)cmdargss /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/_macos_compat.pybypass_compiler_fixuprs Jdarwin _osx_support)sys importlibrplatform import_modulecompiler_fixuprr rrsZ <8,Y,^<<KNNN*NNNr PK!vQ,,._distutils/__pycache__/version.cpython-311.pycnu[ ,Re2dZddlZddlZddlZejdZGddZGddeZGdd eZdS) aProvides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVersion. Every version number class implements the following interface: * the 'parse' method takes a string and parses it to some internal representation; if the string is an invalid version number, 'parse' raises a ValueError exception * the class constructor takes an optional string argument which, if supplied, is passed to 'parse' * __str__ reconstructs the string that was passed to 'parse' (or an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) Nc#Ktjd5}tjdtd|VddddS#1swxYwYdS)NT)recorddefaultz)distutils Version classes are deprecated.)actioncategorymessage)warningscatch_warningsfilterwarningsDeprecationWarning)ctxs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/version.pysuppress_known_deprecationr"s   - - -'?     s!AA  A c>eZdZdZd dZdZdZdZdZdZ d Z dS) VersionzAbstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route rich comparisons to _cmp. Ncl|r||tjdtddS)NzHdistutils Version classes are deprecated. Use packaging.version instead.) stacklevel)parser warnr selfvstrings r__init__zVersion.__init__4sJ  JJw     -        c\d|jjt|S)Nz {} ('{}'))format __class____name__strrs r__repr__zVersion.__repr__>s#!!$."93t99EEErcN||}|tur|S|dkSNr_cmpNotImplementedrothercs r__eq__zVersion.__eq__A, IIe     HAv rcN||}|tur|S|dkSr$r%r(s r__lt__zVersion.__lt__G, IIe     H1u rcN||}|tur|S|dkSr$r%r(s r__le__zVersion.__le__Mr,rcN||}|tur|S|dkSr$r%r(s r__gt__zVersion.__gt__Sr/rcN||}|tur|S|dkSr$r%r(s r__ge__zVersion.__ge__Yr,rN) r __module__ __qualname____doc__rr"r+r.r1r3r5rrrr-s     FFF    rrc`eZdZdZejdejejzZdZ dZ dZ dS) StrictVersiona?Version numbering for anal retentives and software idealists. Implements the standard interface for version number classes as described above. A version number consists of two or three dot-separated numeric components, with an optional "pre-release" tag on the end. The pre-release tag consists of the letter 'a' or 'b' followed by a number. If the numeric components of two version numbers are equal, then one with a pre-release tag will always be deemed earlier (lesser) than one without. The following are valid version numbers (shown in the order that would be obtained by sorting according to the supplied cmp function): 0.4 0.4.0 (these two are equivalent) 0.4.1 0.5a1 0.5b3 0.5 0.9.6 1.0 1.0.4a3 1.0.4b1 1.0.4 The following are examples of invalid version numbers: 1 2.7.2.2 1.3.a4 1.3pl1 1.3c4 The rationale for this version numbering system will be explained in the distutils documentation. z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$c|j|}|std|z|ddddd\}}}}}|r+t t t |||g|_n,t t t ||gdz|_|r|dt |f|_dSd|_dS) Nzinvalid version number '%s'r)rr) version_rematch ValueErrorgrouptuplemapintversion prerelease)rrrCmajorminorpatchrJprerelease_nums rrzStrictVersion.parses%%g.. F:WDEE E)rIjoinrGr rJrs r__str__zStrictVersion.__str__s <?a  hhs3 QqS(9::;;GGhhs3 5566G ? M 22S9K5L5LLGrct|tr6t5t|}dddn #1swxYwYnt|tstS|j|jkr|j|jkrdSdS|js |jsdS|jr |jsdS|js |jrdS|jr-|jr&|j|jkrdS|j|jkrdSdSJd)Nr>rFznever get here) isinstancer rr<r'rIrJrr)s rr&zStrictVersion._cmpsd eS ! ! "+-- - -%e,, - - - - - - - - - - - - - - -E=11 "! ! <5= ( (|em++rq +u'7 +1 _ +U%5 +2 +U%5 +1 _ +!1 +%"222q5#333rq ** * * *sAAAN) rr7r8r9recompileVERBOSEASCIIrBrrRr&r:rrr<r<qso!!F4bj286KJ###"   #+#+#+#+#+rr<cVeZdZdZejdejZdZdZ dZ dZ dS) LooseVersionaVersion numbering for anarchists and software realists. Implements the standard interface for version number classes as described above. A version number consists of a series of numbers, separated by either periods or strings of letters. When comparing version numbers, the numeric components will be compared numerically, and the alphabetic components lexically. The following are all valid version numbers, in no particular order: 1.5.1 1.5.2b2 161 3.10a 8.02 3.4j 1996.07.12 3.2.pl0 3.1.1.6 2g6 11g 0.960923 2.2beta29 1.13++ 5.5.kw 2.0b1pl0 In fact, there is no such thing as an invalid version number under this scheme; the rules for comparison are simple and predictable, but may not always give the results you want (for some definition of "want"). z(\d+ | [a-z]+ | \.)c||_d|j|D}t|D](\}} t |||<#t $rY%wxYw||_dS)Nc"g|] }||dk | S)rPr:).0xs r z&LooseVersion.parse..Is#TTTAQT1PS88a888r)r component_resplit enumeraterHrDrI)rr componentsiobjs rrzLooseVersion.parseDs TT!2!8!8!A!ATTT  ++  FAs  #C 1     " sA A! A!c|jSr6)rr!s rrRzLooseVersion.__str__Rs |rc&dt|zS)NzLooseVersion ('%s'))r r!s rr"zLooseVersion.__repr__Us$s4yy00rct|trt|}nt|tstS|j|jkrdS|j|jkrdS|j|jkrdSdS)NrrTr>)rUr r\r'rIrVs rr&zLooseVersion._cmpXs eS ! ! " ''EEE<00 "! ! <5= ( (1 <%- ' '2 <%- ' '1 ( 'rN) rr7r8r9rWrXrYrbrrRr"r&r:rrr\r\!sr>2:4bjAAL " " "111     rr\) r9rWr contextlibcontextmanagerrrr<r\r:rrrms&  00000000Hi+i+i+i+i+Gi+i+i+`BBBBB7BBBBBrPK!eM,_distutils/__pycache__/spawn.cpython-311.pycnu[ ,Re VdZddlZddlZddlZddlmZddlmZddlm Z d dZ d dZ dS) zdistutils.spawn Provides the 'spawn()' function, a front-end to various platform- specific functions for launching another program in a sub-process. Also provides the 'find_executable()' to search the path for a given executable name. N)DistutilsExecError)DEBUG)logct|}tjtj||rdS|rt |d}|||d<||nt tj}tj dkrddl m }m }|}|r|||< tj||} | | j} nP#t"$rC} t$s|d}t'd|| jd| d} ~ wwxYw| r2t$s|d}t'd|| dS) aRun another program, specified as a command list 'cmd', in a new process. 'cmd' is just the argument list for the new process, ie. cmd[0] is the program to run and cmd[1:] are the rest of its arguments. There is no way to run a program with a name different from that of its executable. If 'search_path' is true (the default), the system's executable search path will be used to find the program; otherwise, cmd[0] must be the exact path to the executable. If 'dry_run' is true, the command will not actually be run. Raise DistutilsExecError if running the program fails in any way; just return on success. Nrdarwin)MACOSX_VERSION_VARget_macosx_target_ver)envzcommand {!r} failed: {}z%command {!r} failed with exit code {})listrinfo subprocess list2cmdlinefind_executabledictosenvironsysplatformdistutils.utilr r Popenwait returncodeOSErrorrrformatargs) cmd search_pathverbosedry_runr executabler r macosx_target_verprocexitcodeexcs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/spawn.pyspawnr(s$ s))CHZ $S ) )*** $SV,,  !CF##d2:&6&6C |xLLLLLLLL1133  8&7C" # --- ?  a&C % , ,S#(2, ? ?     a&C 3 : :3 I I     s1C D>DDcRtj|\}}tjdkr |dkr|dz}tj|r|S|[tjdd}|9 tjd}n##ttf$rtj }YnwxYw|sdS| tj }|D]E}tj||}tj|r|cSFdS)zTries to find 'executable' in the directories listed in 'path'. A string listing directories separated by 'os.pathsep'; defaults to os.environ['PATH']. Returns the complete filename or None if not found. win32z.exeNPATHCS_PATH)rpathsplitextrrisfilergetconfstrAttributeError ValueErrordefpathsplitpathsepjoin)r"r-_extpathspfs r'rrKs) W  j ) )FAs cVmm&(  w~~j!! |z~~fd++ < "z),,"J/ " " "z " t JJrz " "E  GLLJ ' ' 7>>!   HHH  4sBB98B9)rrrN)N) __doc__rrrerrorsrdebugr_logrr(rr'rCs &&&&&&6 6 6 6 r""""""rBPK!x5x56_distutils/__pycache__/cygwinccompiler.cpython-311.pycnu[ ,Re. @dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZmZmZmZddlmZmZdd lmZejd gd gd gd gdgdgdgddgejd ZdZdZGdde ZGddeZdZdZdZ dZ!dZ"dZ#dS)adistutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). N) check_output) UnixCCompiler) write_file)DistutilsExecErrorDistutilsPlatformErrorCCompilerError CompileError) LooseVersionsuppress_known_deprecation)RangeMapmsvcr70msvcr71msvcr80msvcr90msvcr100msvcr110msvcr120ucrt vcruntime140) iiixii@iiilictjdtj} t |d}n#t $rYdSwxYw t|S#t$rtd|zwxYw)zaInclude the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. zMSC v\.(\d{4})rNzUnknown MS Compiler version %s ) researchsysversionintgroupAttributeError _msvcr_lookupKeyError ValueError)matchmsc_vers /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/cygwinccompiler.py get_msvcrr%4s I' 5 5Eekk!nn%% FW%% FFF:WDEEEFs"A AA A##BzxUnable to set runtime library search path on Windows, usually indicated by `runtime_library_dirs` parameter to ExtensionceZdZdZdZdZdZdZdZdZ dZ dZ d Z dfd Z ed Zd Z ddZdZfdZefdZxZS)CygwinCCompilerz9Handles the Cygwin port of the GNU C compiler to Windows.cygwinz.oz.az.dll.az.dllzlib%s%szcyg%s%sz.exerc t|||t\}}|d|||t ur|d|ztj dd|_ tj dd|_ |j |_ d}| d|j zd |j zd|j zd |j zd |j | t|_dS) Nz%Python's GCC status: {} (details: {})zPython's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.CCgccCXXzg++-sharedz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz %s -mcygwinz{} -mcygwin {}compiler compiler_so compiler_cxx linker_exe linker_so)super__init__check_config_h debug_printformat CONFIG_H_OKwarnosenvirongetcccxx linker_dllset_executablesr% dll_libraries)selfverbosedry_runforcestatusdetails shared_option __class__s r$r5zCygwinCCompiler.__init__Vs7 '5111(**  3 : :67 K K     $ $ IIOQXY    *..u--:>>%//'!  +dg54tw>/$(:$tw.'..t NN    '[[ctjdtdt5t dcdddS#1swxYwYdS)Nzgcc_version attribute of CygwinCCompiler is deprecated. Instead of returning actual gcc version a fixed value 11.2.0 is returned.) stacklevelz11.2.0)warningsr:DeprecationWarningr r )rCs r$ gcc_versionzCygwinCCompiler.gcc_versionws   X      ( ) ) * *)) * * * * * * * * * * * * * * * * * *sAA A c*|dks|dkr> |dd|d|gdS#t$r}t|d}~wwxYw ||j|z|d|gz|zdS#t$r}t|d}~wwxYw)z:Compiles the source by spawning GCC and windres if needed..rc.reswindresz-iz-oN)spawnrr r0)rCobjsrcextcc_argsextra_postargspp_optsmsgs r$_compilezCygwinCCompiler._compiles %<<3&== ( ItS$<=====% ( ( ("3''' ( ( $w.#tS1AANR& ( ( ("3''' (s,* AAA &A44 B>B  BNctj| pg} tj|pg}tj|pg}|r|t||j|||jks |jdkrtj |d}tj tj |\}}tj ||dz}dtj |zdg}|D]}| ||t||fd|z| || s| dt!j||||||||d| | | | | dS) zLink the objects.Nr+rz.defz LIBRARY %sEXPORTSz writing %sz-s)copyr:_runtime_library_dirs_msgextendrB EXECUTABLEr@r;pathdirnamesplitextbasenamejoinappendexecuterrlink)rC target_descobjectsoutput_filename output_dir libraries library_dirsruntime_library_dirsexport_symbolsdebug extra_preargsr[ build_temp target_langtemp_dirdll_name dll_extensiondef_filecontentssyms r$rlzCygwinCCompiler.links$ -"5266 Iio2.. )GMr**  1 II/ 0 0 0 +,,,  & 4? * *do.F.Fwwqz22H(*(8(8  11)) %X} w||Hh.?@@H%rw'7'7'H'HH)TH% % %$$$$ LLh%9<(;R S S S NN8 $ $ $ '   & & &                  rKc:|tgSN)r:rbrCdirs r$runtime_library_dir_optionz*CygwinCCompiler.runtime_library_dir_options +,,, rKctj|}t|||Sr)r;renormcaser4_make_out_path)rCrp strip_dirsrc_name norm_src_namerJs r$rzCygwinCCompiler._make_out_paths4((22 ww%%j)]KKKrKcLitjfddDS)z3 Add support for rc and res files. c&i|] }||jzS) obj_extension).0rYrCs r$ z2CygwinCCompiler.out_extensions..s#HHHsC$,,HHHrK)rTrS)r4out_extensions)rCrJs`r$rzCygwinCCompiler.out_extensionss9  gg$ HHHHHHH  rKrrr) NNNNNrNNNN)__name__ __module__ __qualname____doc__ compiler_typerstatic_lib_extensionshared_lib_extensiondylib_lib_extensionstatic_lib_formatshared_lib_formatdylib_lib_format exe_extensionr5propertyrQr^rlrrr __classcell__rJs@r$r'r'Is,CCMM# !! M))))))B * *X *(((*!X X X X tLLLLL     X     rKr'c.eZdZdZdZdfd ZdZxZS)Mingw32CCompilerz:Handles the Mingw32 port of the GNU C compiler to Windows.mingw32rc >t|||d}t|jrt d|d|jzd|jzd|jzd|jzd|j|dS)Nr-z1Cygwin gcc cannot be used with --compiler=mingw32z %s -O -Wallz%s -mdll -O -Wallz%sz{} {}r.) r4r5 is_cygwinccr>r rAr?r8r@)rCrDrErFrIrJs r$r5zMingw32CCompiler.__init__s '5111! tw   V !TUU U "TW,+dg5&1dg~nnT_mDD      rKc*ttr)rrbrs r$rz+Mingw32CCompiler.runtime_library_dir_option s$%>???rKr)rrrrrr5rrrs@r$rr s^DDM      "@@@@@@@rKrokznot ok uncertaincddlm}dtjvr tdfSdtjvr tdfS|} t |} d|vr td|zf|Std |zf|S#|wxYw#t$r,}td ||j fcYd }~Sd }~wwxYw) awCheck if the current Python installation appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: - CONFIG_H_OK: all is well, go ahead and compile - CONFIG_H_NOTOK: doesn't look good - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h 'details' is a human-readable string explaining the situation. Note there are two ways to conclude "OK": either 'sys.version' contains the string "GCC" (implying that this Python was built with GCC), or the installed "pyconfig.h" contains the string "__GNUC__". r) sysconfigGCCzsys.version mentions 'GCC'Clangzsys.version mentions 'Clang'__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '{}': {}N) distutilsrrrr9get_config_h_filenameopenreadcloseCONFIG_H_NOTOKOSErrorCONFIG_H_UNCERTAINr8strerror)rfnconfig_hexcs r$r6r6-s4*$#####  888#+:::  ( ( * *B W88 X]]__,,"$>$CC NN    &'IB'NN NN    HNN     WWW"$<$C$CB $U$UVVVVVVVWsB C !B0;C  B0C 0CC C?!C:4C?:C?cttj|dgz}|dS)zCTry to determine if the compiler that would be used is from cygwin.z -dumpmachinescygwin)rshlexsplitstripendswith)r> out_strings r$rr\s?ek"oo0@@AAJ      & &y 1 11rK)$rr;rrrarrO subprocessr unixccompilerr file_utilrerrorsrrr r rr r _collectionsr leftundefined_valuerr%rbr'rr9rrr6r get_versionsrrKr$rs ######((((((!!!!!! >======="""""" kkkklll~&&# . F F F I } } } } } m} } } B@@@@@@@@<  ,W,W,W^222  rKPK!Ժ/7_distutils/__pycache__/versionpredicate.cpython-311.pycnu[ ,ReU dZddlZddlmZddlZejdejZejdZejdZ dZ ej ej ej ejejejd ZGd d Zdad ZdS) zBModule for parsing and testing package version predicate strings. N)versionz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$ct|}|std|z|\}}t j5t j|}dddn #1swxYwY||fS)zVParse a single version comparison. Return (comparison string, StrictVersion) z"bad package restriction syntax: %rN)re_splitComparisonmatch ValueErrorgroupsrsuppress_known_deprecation StrictVersion)predrescompverStrothers /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/versionpredicate.pysplitUprs  " "4 ( (C F=DEEE::<A>)z>=z!=c$eZdZdZdZdZdZdS)VersionPredicateaParse and test package version predicates. >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)') The `name` attribute provides the full dotted name that is given:: >>> v.name 'pyepat.abc' The str() of a `VersionPredicate` provides a normalized human-readable version of the expression:: >>> print(v) pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3) The `satisfied_by()` method can be used to determine with a given version number is included in the set described by the version restrictions:: >>> v.satisfied_by('1.1') True >>> v.satisfied_by('1.4') True >>> v.satisfied_by('1.0') False >>> v.satisfied_by('4444.4') False >>> v.satisfied_by('1555.1b3') False `VersionPredicate` is flexible in accepting extra whitespace:: >>> v = VersionPredicate(' pat( == 0.1 ) ') >>> v.name 'pat' >>> v.satisfied_by('0.1') True >>> v.satisfied_by('0.2') False If any version numbers passed in do not conform to the restrictions of `StrictVersion`, a `ValueError` is raised:: >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)') Traceback (most recent call last): ... ValueError: invalid version number '1.2zb3' It the module or package name given does not conform to what's allowed as a legal module or package name, `ValueError` is raised:: >>> v = VersionPredicate('foo-bar') Traceback (most recent call last): ... ValueError: expected parenthesized list: '-bar' >>> v = VersionPredicate('foo bar (12.21)') Traceback (most recent call last): ... ValueError: expected parenthesized list: 'bar (12.21)' c,|}|stdt|}|std|z|\|_}|}|rt |}|std|z|d}d|dD|_|jstd|zdSg|_dS) z!Parse a version predicate string.zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrc,g|]}t|S)r).0aPreds r z-VersionPredicate.__init__..|sDDDEDDD,zempty parenthesized list in %rN) striprre_validPackagerr namere_parensplitr )selfversionPredicateStrrparenstrs r__init__zVersionPredicate.__init__is  27799" :899 9%%&9:: M58KKLL L <<>> 5   NN5))E L !BU!JKKK,,..#CDDSYYs^^DDDDI9 Y !ADW!WXXX Y YDIIIrc|jr4d|jD}|jdzd|zdzS|jS)Nc>g|]\}}|dzt|zS) )r')rcondvers rrz,VersionPredicate.__str__..s+DDDYT34#:C(DDDrz (z, ))r r!join)r$seqs r__str__zVersionPredicate.__str__sJ 9 DD$)DDDC9t#diinn4s: :9 rcR|jD]\}}t|||sdSdS)zTrue if version is compatible with all the predicates in self. The parameter version must be acceptable to the StrictVersion constructor. It may be either a string or StrictVersion. FT)r compmap)r$rr,r-s r satisfied_byzVersionPredicate.satisfied_bys@   ID#4=#.. uu trN)__name__ __module__ __qualname____doc__r(r1r4rrrrr(sL>>@2rrcttjdtja|}t|}|st d|z|dpd}|r?tj 5tj |}dddn #1swxYwY|d|fS)a9Return the name and optional version number of a provision. The version number, if given, will be returned as a `StrictVersion` instance, otherwise it will be `None`. >>> split_provision('mypkg') ('mypkg', None) >>> split_provision(' mypkg( 1.2 ) ') ('mypkg', StrictVersion ('1.2')) Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %rr) _provision_rxrecompileASCIIrrrgrouprr r )valuemr-s rsplit_provisionrBs Lbh   KKMMEE""A G=EFFF ''!** C -  / 1 1 - -',,C - - - - - - - - - - - - - - - 771::s?sB66B:=B:)r8r<roperatorr=r>r r"rrltleeqgtgener3rr;rBrrrrKs "*GRR 2:) * *RZ HII     + +  + +   iiiiiiiiX rPK!. A_distutils/dist.pynu["""distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ import sys import os import re from email import message_from_file try: import warnings except ImportError: warnings = None from distutils.errors import * from distutils.fancy_getopt import FancyGetopt, translate_longopt from distutils.util import check_environ, strtobool, rfc822_escape from distutils import log from distutils.debug import DEBUG # Regex to define acceptable Distutils command names. This is not *quite* # the same as a Python NAME -- I don't allow leading underscores. The fact # that they're very similar is no coincidence; the default naming scheme is # to look for a Python module named after the command. command_re = re.compile(r'^[a-zA-Z]([a-zA-Z0-9_]*)$') def _ensure_list(value, fieldname): if isinstance(value, str): # a string containing comma separated values is okay. It will # be converted to a list by Distribution.finalize_options(). pass elif not isinstance(value, list): # passing a tuple or an iterator perhaps, warn and convert typename = type(value).__name__ msg = "Warning: '{fieldname}' should be a list, got type '{typename}'" msg = msg.format(**locals()) log.log(log.WARN, msg) value = list(value) return value class Distribution: """The core of the Distutils. Most of the work hiding behind 'setup' is really done within a Distribution instance, which farms the work out to the Distutils commands specified on the command line. Setup scripts will almost never instantiate Distribution directly, unless the 'setup()' function is totally inadequate to their needs. However, it is conceivable that a setup script might wish to subclass Distribution for some specialized purpose, and then pass the subclass to 'setup()' as the 'distclass' keyword argument. If so, it is necessary to respect the expectations that 'setup' has of Distribution. See the code for 'setup()', in core.py, for details. """ # 'global_options' describes the command-line options that may be # supplied to the setup script prior to any actual commands. # Eg. "./setup.py -n" or "./setup.py --quiet" both take advantage of # these global options. This list should be kept to a bare minimum, # since every global option is also valid as a command option -- and we # don't want to pollute the commands with too many options that they # have minimal control over. # The fourth entry for verbose means that it can be repeated. global_options = [ ('verbose', 'v', "run verbosely (default)", 1), ('quiet', 'q', "run quietly (turns verbosity off)"), ('dry-run', 'n', "don't actually do anything"), ('help', 'h', "show detailed help message"), ('no-user-cfg', None, 'ignore pydistutils.cfg in your home directory'), ] # 'common_usage' is a short (2-3 line) string describing the common # usage of the setup script. common_usage = """\ Common commands: (see '--help-commands' for more) setup.py build will build the package underneath 'build/' setup.py install will install the package """ # options that are not propagated to the commands display_options = [ ('help-commands', None, "list all available commands"), ('name', None, "print package name"), ('version', 'V', "print package version"), ('fullname', None, "print -"), ('author', None, "print the author's name"), ('author-email', None, "print the author's email address"), ('maintainer', None, "print the maintainer's name"), ('maintainer-email', None, "print the maintainer's email address"), ('contact', None, "print the maintainer's name if known, else the author's"), ('contact-email', None, "print the maintainer's email address if known, else the author's"), ('url', None, "print the URL for this package"), ('license', None, "print the license of the package"), ('licence', None, "alias for --license"), ('description', None, "print the package description"), ('long-description', None, "print the long package description"), ('platforms', None, "print the list of platforms"), ('classifiers', None, "print the list of classifiers"), ('keywords', None, "print the list of keywords"), ('provides', None, "print the list of packages/modules provided"), ('requires', None, "print the list of packages/modules required"), ('obsoletes', None, "print the list of packages/modules made obsolete") ] display_option_names = [translate_longopt(x[0]) for x in display_options] # negative options are options that exclude other options negative_opt = {'quiet': 'verbose'} # -- Creation/initialization methods ------------------------------- def __init__(self, attrs=None): """Construct a new Distribution instance: initialize all the attributes of a Distribution, and then use 'attrs' (a dictionary mapping attribute names to values) to assign some of those attributes their "real" values. (Any attributes not mentioned in 'attrs' will be assigned to some null value: 0, None, an empty list or dictionary, etc.) Most importantly, initialize the 'command_obj' attribute to the empty dictionary; this will be filled in with real command objects by 'parse_command_line()'. """ # Default values for our command-line options self.verbose = 1 self.dry_run = 0 self.help = 0 for attr in self.display_option_names: setattr(self, attr, 0) # Store the distribution meta-data (name, version, author, and so # forth) in a separate object -- we're getting to have enough # information here (and enough command-line options) that it's # worth it. Also delegate 'get_XXX()' methods to the 'metadata' # object in a sneaky and underhanded (but efficient!) way. self.metadata = DistributionMetadata() for basename in self.metadata._METHOD_BASENAMES: method_name = "get_" + basename setattr(self, method_name, getattr(self.metadata, method_name)) # 'cmdclass' maps command names to class objects, so we # can 1) quickly figure out which class to instantiate when # we need to create a new command object, and 2) have a way # for the setup script to override command classes self.cmdclass = {} # 'command_packages' is a list of packages in which commands # are searched for. The factory for command 'foo' is expected # to be named 'foo' in the module 'foo' in one of the packages # named here. This list is searched from the left; an error # is raised if no named package provides the command being # searched for. (Always access using get_command_packages().) self.command_packages = None # 'script_name' and 'script_args' are usually set to sys.argv[0] # and sys.argv[1:], but they can be overridden when the caller is # not necessarily a setup script run from the command-line. self.script_name = None self.script_args = None # 'command_options' is where we store command options between # parsing them (from config files, the command-line, etc.) and when # they are actually needed -- ie. when the command in question is # instantiated. It is a dictionary of dictionaries of 2-tuples: # command_options = { command_name : { option : (source, value) } } self.command_options = {} # 'dist_files' is the list of (command, pyversion, file) that # have been created by any dist commands run so far. This is # filled regardless of whether the run is dry or not. pyversion # gives sysconfig.get_python_version() if the dist file is # specific to a Python version, 'any' if it is good for all # Python versions on the target platform, and '' for a source # file. pyversion should not be used to specify minimum or # maximum required Python versions; use the metainfo for that # instead. self.dist_files = [] # These options are really the business of various commands, rather # than of the Distribution itself. We provide aliases for them in # Distribution as a convenience to the developer. self.packages = None self.package_data = {} self.package_dir = None self.py_modules = None self.libraries = None self.headers = None self.ext_modules = None self.ext_package = None self.include_dirs = None self.extra_path = None self.scripts = None self.data_files = None self.password = '' # And now initialize bookkeeping stuff that can't be supplied by # the caller at all. 'command_obj' maps command names to # Command instances -- that's how we enforce that every command # class is a singleton. self.command_obj = {} # 'have_run' maps command names to boolean values; it keeps track # of whether we have actually run a particular command, to make it # cheap to "run" a command whenever we think we might need to -- if # it's already been done, no need for expensive filesystem # operations, we just check the 'have_run' dictionary and carry on. # It's only safe to query 'have_run' for a command class that has # been instantiated -- a false value will be inserted when the # command object is created, and replaced with a true value when # the command is successfully run. Thus it's probably best to use # '.get()' rather than a straight lookup. self.have_run = {} # Now we'll use the attrs dictionary (ultimately, keyword args from # the setup script) to possibly override any or all of these # distribution options. if attrs: # Pull out the set of command options and work on them # specifically. Note that this order guarantees that aliased # command options will override any supplied redundantly # through the general options dictionary. options = attrs.get('options') if options is not None: del attrs['options'] for (command, cmd_options) in options.items(): opt_dict = self.get_option_dict(command) for (opt, val) in cmd_options.items(): opt_dict[opt] = ("setup script", val) if 'licence' in attrs: attrs['license'] = attrs['licence'] del attrs['licence'] msg = "'licence' distribution option is deprecated; use 'license'" if warnings is not None: warnings.warn(msg) else: sys.stderr.write(msg + "\n") # Now work on the rest of the attributes. Any attribute that's # not already defined is invalid! for (key, val) in attrs.items(): if hasattr(self.metadata, "set_" + key): getattr(self.metadata, "set_" + key)(val) elif hasattr(self.metadata, key): setattr(self.metadata, key, val) elif hasattr(self, key): setattr(self, key, val) else: msg = "Unknown distribution option: %s" % repr(key) warnings.warn(msg) # no-user-cfg is handled before other command line args # because other args override the config files, and this # one is needed before we can load the config files. # If attrs['script_args'] wasn't passed, assume false. # # This also make sure we just look at the global options self.want_user_cfg = True if self.script_args is not None: for arg in self.script_args: if not arg.startswith('-'): break if arg == '--no-user-cfg': self.want_user_cfg = False break self.finalize_options() def get_option_dict(self, command): """Get the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary. """ dict = self.command_options.get(command) if dict is None: dict = self.command_options[command] = {} return dict def dump_option_dicts(self, header=None, commands=None, indent=""): from pprint import pformat if commands is None: # dump all command option dicts commands = sorted(self.command_options.keys()) if header is not None: self.announce(indent + header) indent = indent + " " if not commands: self.announce(indent + "no commands known yet") return for cmd_name in commands: opt_dict = self.command_options.get(cmd_name) if opt_dict is None: self.announce(indent + "no option dict for '%s' command" % cmd_name) else: self.announce(indent + "option dict for '%s' command:" % cmd_name) out = pformat(opt_dict) for line in out.split('\n'): self.announce(indent + " " + line) # -- Config file finding/parsing methods --------------------------- def find_config_files(self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). There are three possible config files: distutils.cfg in the Distutils installation directory (ie. where the top-level Distutils __inst__.py file lives), a file in the user's home directory named .pydistutils.cfg on Unix and pydistutils.cfg on Windows/Mac; and setup.cfg in the current directory. The file in the user's home directory can be disabled with the --no-user-cfg option. """ files = [] check_environ() # Where to look for the system-wide Distutils config file sys_dir = os.path.dirname(sys.modules['distutils'].__file__) # Look for the system config file sys_file = os.path.join(sys_dir, "distutils.cfg") if os.path.isfile(sys_file): files.append(sys_file) # What to call the per-user config file if os.name == 'posix': user_filename = ".pydistutils.cfg" else: user_filename = "pydistutils.cfg" # And look for the user config file if self.want_user_cfg: user_file = os.path.join(os.path.expanduser('~'), user_filename) if os.path.isfile(user_file): files.append(user_file) # All platforms support local setup.cfg local_file = "setup.cfg" if os.path.isfile(local_file): files.append(local_file) if DEBUG: self.announce("using config files: %s" % ', '.join(files)) return files def parse_config_files(self, filenames=None): from configparser import ConfigParser # Ignore install directory options if we have a venv if sys.prefix != sys.base_prefix: ignore_options = [ 'install-base', 'install-platbase', 'install-lib', 'install-platlib', 'install-purelib', 'install-headers', 'install-scripts', 'install-data', 'prefix', 'exec-prefix', 'home', 'user', 'root'] else: ignore_options = [] ignore_options = frozenset(ignore_options) if filenames is None: filenames = self.find_config_files() if DEBUG: self.announce("Distribution.parse_config_files():") parser = ConfigParser() for filename in filenames: if DEBUG: self.announce(" reading %s" % filename) parser.read(filename) for section in parser.sections(): options = parser.options(section) opt_dict = self.get_option_dict(section) for opt in options: if opt != '__name__' and opt not in ignore_options: val = parser.get(section,opt) opt = opt.replace('-', '_') opt_dict[opt] = (filename, val) # Make the ConfigParser forget everything (so we retain # the original filenames that options come from) parser.__init__() # If there was a "global" section in the config file, use it # to set Distribution options. if 'global' in self.command_options: for (opt, (src, val)) in self.command_options['global'].items(): alias = self.negative_opt.get(opt) try: if alias: setattr(self, alias, not strtobool(val)) elif opt in ('verbose', 'dry_run'): # ugh! setattr(self, opt, strtobool(val)) else: setattr(self, opt, val) except ValueError as msg: raise DistutilsOptionError(msg) # -- Command-line parsing methods ---------------------------------- def parse_command_line(self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternately scanned for Distutils commands and options for that command. Each new command terminates the options for the previous command. The allowed options for a command are determined by the 'user_options' attribute of the command class -- thus, we have to be able to load command classes in order to parse the command line. Any error in that 'options' attribute raises DistutilsGetoptError; any error on the command-line raises DistutilsArgError. If no Distutils commands were found on the command line, raises DistutilsArgError. Return true if command-line was successfully parsed and we should carry on with executing commands; false if no errors but we shouldn't execute commands (currently, this only happens if user asks for help). """ # # We now have enough information to show the Macintosh dialog # that allows the user to interactively specify the "command line". # toplevel_options = self._get_toplevel_options() # We have to parse the command line a bit at a time -- global # options, then the first command, then its options, and so on -- # because each command will be handled by a different class, and # the options that are valid for a particular class aren't known # until we have loaded the command class, which doesn't happen # until we know what the command is. self.commands = [] parser = FancyGetopt(toplevel_options + self.display_options) parser.set_negative_aliases(self.negative_opt) parser.set_aliases({'licence': 'license'}) args = parser.getopt(args=self.script_args, object=self) option_order = parser.get_option_order() log.set_verbosity(self.verbose) # for display options we return immediately if self.handle_display_options(option_order): return while args: args = self._parse_command_opts(parser, args) if args is None: # user asked for help (and got it) return # Handle the cases of --help as a "global" option, ie. # "setup.py --help" and "setup.py --help command ...". For the # former, we show global options (--verbose, --dry-run, etc.) # and display-only options (--name, --version, etc.); for the # latter, we omit the display-only options and show help for # each command listed on the command line. if self.help: self._show_help(parser, display_options=len(self.commands) == 0, commands=self.commands) return # Oops, no commands found -- an end-user error if not self.commands: raise DistutilsArgError("no commands supplied") # All is well: return true return True def _get_toplevel_options(self): """Return the non-display options recognized at the top level. This includes options that are recognized *only* at the top level as well as options recognized for commands. """ return self.global_options + [ ("command-packages=", None, "list of packages that provide distutils commands"), ] def _parse_command_opts(self, parser, args): """Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options we are about to parse). Returns a new version of 'args' with the next command at the front of the list; will be the empty list if there are no more commands on the command line. Returns None if the user asked for help on this command. """ # late import because of mutual dependence between these modules from distutils.cmd import Command # Pull the current command from the head of the command line command = args[0] if not command_re.match(command): raise SystemExit("invalid command name '%s'" % command) self.commands.append(command) # Dig up the command class that implements this command, so we # 1) know that it's a valid command, and 2) know which options # it takes. try: cmd_class = self.get_command_class(command) except DistutilsModuleError as msg: raise DistutilsArgError(msg) # Require that the command class be derived from Command -- want # to be sure that the basic "command" interface is implemented. if not issubclass(cmd_class, Command): raise DistutilsClassError( "command class %s must subclass Command" % cmd_class) # Also make sure that the command object provides a list of its # known options. if not (hasattr(cmd_class, 'user_options') and isinstance(cmd_class.user_options, list)): msg = ("command class %s must provide " "'user_options' attribute (a list of tuples)") raise DistutilsClassError(msg % cmd_class) # If the command class has a list of negative alias options, # merge it in with the global negative aliases. negative_opt = self.negative_opt if hasattr(cmd_class, 'negative_opt'): negative_opt = negative_opt.copy() negative_opt.update(cmd_class.negative_opt) # Check for help_options in command class. They have a different # format (tuple of four) so we need to preprocess them here. if (hasattr(cmd_class, 'help_options') and isinstance(cmd_class.help_options, list)): help_options = fix_help_options(cmd_class.help_options) else: help_options = [] # All commands support the global options too, just by adding # in 'global_options'. parser.set_option_table(self.global_options + cmd_class.user_options + help_options) parser.set_negative_aliases(negative_opt) (args, opts) = parser.getopt(args[1:]) if hasattr(opts, 'help') and opts.help: self._show_help(parser, display_options=0, commands=[cmd_class]) return if (hasattr(cmd_class, 'help_options') and isinstance(cmd_class.help_options, list)): help_option_found=0 for (help_option, short, desc, func) in cmd_class.help_options: if hasattr(opts, parser.get_attr_name(help_option)): help_option_found=1 if callable(func): func() else: raise DistutilsClassError( "invalid help function %r for help option '%s': " "must be a callable object (function, etc.)" % (func, help_option)) if help_option_found: return # Put the options from the command-line into their official # holding pen, the 'command_options' dictionary. opt_dict = self.get_option_dict(command) for (name, value) in vars(opts).items(): opt_dict[name] = ("command line", value) return args def finalize_options(self): """Set final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. """ for attr in ('keywords', 'platforms'): value = getattr(self.metadata, attr) if value is None: continue if isinstance(value, str): value = [elm.strip() for elm in value.split(',')] setattr(self.metadata, attr, value) def _show_help(self, parser, global_options=1, display_options=1, commands=[]): """Show help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the same state, as its option table will be reset to make it generate the correct help text. If 'global_options' is true, lists the global options: --verbose, --dry-run, etc. If 'display_options' is true, lists the "display-only" options: --name, --version, etc. Finally, lists per-command help for every command name or command class in 'commands'. """ # late import because of mutual dependence between these modules from distutils.core import gen_usage from distutils.cmd import Command if global_options: if display_options: options = self._get_toplevel_options() else: options = self.global_options parser.set_option_table(options) parser.print_help(self.common_usage + "\nGlobal options:") print('') if display_options: parser.set_option_table(self.display_options) parser.print_help( "Information display options (just display " + "information, ignore any commands)") print('') for command in self.commands: if isinstance(command, type) and issubclass(command, Command): klass = command else: klass = self.get_command_class(command) if (hasattr(klass, 'help_options') and isinstance(klass.help_options, list)): parser.set_option_table(klass.user_options + fix_help_options(klass.help_options)) else: parser.set_option_table(klass.user_options) parser.print_help("Options for '%s' command:" % klass.__name__) print('') print(gen_usage(self.script_name)) def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ from distutils.core import gen_usage # User just wants a list of commands -- we'll print it out and stop # processing now (ie. if they ran "setup --help-commands foo bar", # we ignore "foo bar"). if self.help_commands: self.print_commands() print('') print(gen_usage(self.script_name)) return 1 # If user supplied any of the "display metadata" options, then # display that metadata in the order in which the user supplied the # metadata options. any_display_options = 0 is_display_option = {} for option in self.display_options: is_display_option[option[0]] = 1 for (opt, val) in option_order: if val and is_display_option.get(opt): opt = translate_longopt(opt) value = getattr(self.metadata, "get_"+opt)() if opt in ['keywords', 'platforms']: print(','.join(value)) elif opt in ('classifiers', 'provides', 'requires', 'obsoletes'): print('\n'.join(value)) else: print(value) any_display_options = 1 return any_display_options def print_command_list(self, commands, header, max_length): """Print a subset of the list of all commands -- used by 'print_commands()'. """ print(header + ":") for cmd in commands: klass = self.cmdclass.get(cmd) if not klass: klass = self.get_command_class(cmd) try: description = klass.description except AttributeError: description = "(no description available)" print(" %-*s %s" % (max_length, cmd, description)) def print_commands(self): """Print out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command class attribute 'description'. """ import distutils.command std_commands = distutils.command.__all__ is_std = {} for cmd in std_commands: is_std[cmd] = 1 extra_commands = [] for cmd in self.cmdclass.keys(): if not is_std.get(cmd): extra_commands.append(cmd) max_length = 0 for cmd in (std_commands + extra_commands): if len(cmd) > max_length: max_length = len(cmd) self.print_command_list(std_commands, "Standard commands", max_length) if extra_commands: print() self.print_command_list(extra_commands, "Extra commands", max_length) def get_command_list(self): """Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in self.cmdclass, but not a standard command). The descriptions come from the command class attribute 'description'. """ # Currently this is only used on Mac OS, for the Mac-only GUI # Distutils interface (by Jack Jansen) import distutils.command std_commands = distutils.command.__all__ is_std = {} for cmd in std_commands: is_std[cmd] = 1 extra_commands = [] for cmd in self.cmdclass.keys(): if not is_std.get(cmd): extra_commands.append(cmd) rv = [] for cmd in (std_commands + extra_commands): klass = self.cmdclass.get(cmd) if not klass: klass = self.get_command_class(cmd) try: description = klass.description except AttributeError: description = "(no description available)" rv.append((cmd, description)) return rv # -- Command class/object methods ---------------------------------- def get_command_packages(self): """Return a list of packages from which commands are loaded.""" pkgs = self.command_packages if not isinstance(pkgs, list): if pkgs is None: pkgs = '' pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != ''] if "distutils.command" not in pkgs: pkgs.insert(0, "distutils.command") self.command_packages = pkgs return pkgs def get_command_class(self, command): """Return the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the dictionary and return it. Otherwise we load the command module ("distutils.command." + command) and fetch the command class from the module. The loaded class is also stored in 'cmdclass' to speed future calls to 'get_command_class()'. Raises DistutilsModuleError if the expected module could not be found, or if that module does not define the expected class. """ klass = self.cmdclass.get(command) if klass: return klass for pkgname in self.get_command_packages(): module_name = "%s.%s" % (pkgname, command) klass_name = command try: __import__(module_name) module = sys.modules[module_name] except ImportError: continue try: klass = getattr(module, klass_name) except AttributeError: raise DistutilsModuleError( "invalid command '%s' (no class '%s' in module '%s')" % (command, klass_name, module_name)) self.cmdclass[command] = klass return klass raise DistutilsModuleError("invalid command '%s'" % command) def get_command_obj(self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. """ cmd_obj = self.command_obj.get(command) if not cmd_obj and create: if DEBUG: self.announce("Distribution.get_command_obj(): " "creating '%s' command object" % command) klass = self.get_command_class(command) cmd_obj = self.command_obj[command] = klass(self) self.have_run[command] = 0 # Set any options that were supplied in config files # or on the command line. (NB. support for error # reporting is lame here: any errors aren't reported # until 'finalize_options()' is called, which means # we won't report the source of the error.) options = self.command_options.get(command) if options: self._set_command_options(cmd_obj, options) return cmd_obj def _set_command_options(self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). """ command_name = command_obj.get_command_name() if option_dict is None: option_dict = self.get_option_dict(command_name) if DEBUG: self.announce(" setting options for '%s' command:" % command_name) for (option, (source, value)) in option_dict.items(): if DEBUG: self.announce(" %s = %s (from %s)" % (option, value, source)) try: bool_opts = [translate_longopt(o) for o in command_obj.boolean_options] except AttributeError: bool_opts = [] try: neg_opt = command_obj.negative_opt except AttributeError: neg_opt = {} try: is_string = isinstance(value, str) if option in neg_opt and is_string: setattr(command_obj, neg_opt[option], not strtobool(value)) elif option in bool_opts and is_string: setattr(command_obj, option, strtobool(value)) elif hasattr(command_obj, option): setattr(command_obj, option, value) else: raise DistutilsOptionError( "error in %s: command '%s' has no such option '%s'" % (source, command_name, option)) except ValueError as msg: raise DistutilsOptionError(msg) def reinitialize_command(self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option values in programmatically, overriding or supplementing user-supplied values from the config files and command line. You'll have to re-finalize the command object (by calling 'finalize_options()' or 'ensure_finalized()') before using it for real. 'command' should be a command name (string) or command object. If 'reinit_subcommands' is true, also reinitializes the command's sub-commands, as declared by the 'sub_commands' class attribute (if it has one). See the "install" command for an example. Only reinitializes the sub-commands that actually matter, ie. those whose test predicates return true. Returns the reinitialized command object. """ from distutils.cmd import Command if not isinstance(command, Command): command_name = command command = self.get_command_obj(command_name) else: command_name = command.get_command_name() if not command.finalized: return command command.initialize_options() command.finalized = 0 self.have_run[command_name] = 0 self._set_command_options(command) if reinit_subcommands: for sub in command.get_sub_commands(): self.reinitialize_command(sub, reinit_subcommands) return command # -- Methods that operate on the Distribution ---------------------- def announce(self, msg, level=log.INFO): log.log(level, msg) def run_commands(self): """Run each command that was seen on the setup script command line. Uses the list of commands found and cache of command objects created by 'get_command_obj()'. """ for cmd in self.commands: self.run_command(cmd) # -- Methods that operate on its Commands -------------------------- def run_command(self, command): """Do whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return silently without doing anything. If the command named by 'command' doesn't even have a command object yet, create one. Then invoke 'run()' on that command object (or an existing one). """ # Already been here, done that? then return silently. if self.have_run.get(command): return log.info("running %s", command) cmd_obj = self.get_command_obj(command) cmd_obj.ensure_finalized() cmd_obj.run() self.have_run[command] = 1 # -- Distribution query methods ------------------------------------ def has_pure_modules(self): return len(self.packages or self.py_modules or []) > 0 def has_ext_modules(self): return self.ext_modules and len(self.ext_modules) > 0 def has_c_libraries(self): return self.libraries and len(self.libraries) > 0 def has_modules(self): return self.has_pure_modules() or self.has_ext_modules() def has_headers(self): return self.headers and len(self.headers) > 0 def has_scripts(self): return self.scripts and len(self.scripts) > 0 def has_data_files(self): return self.data_files and len(self.data_files) > 0 def is_pure(self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries()) # -- Metadata query methods ---------------------------------------- # If you're looking for 'get_name()', 'get_version()', and so forth, # they are defined in a sneaky way: the constructor binds self.get_XXX # to self.metadata.get_XXX. The actual code is in the # DistributionMetadata class, below. class DistributionMetadata: """Dummy class to hold the distribution meta-data: name, version, author, and so forth. """ _METHOD_BASENAMES = ("name", "version", "author", "author_email", "maintainer", "maintainer_email", "url", "license", "description", "long_description", "keywords", "platforms", "fullname", "contact", "contact_email", "classifiers", "download_url", # PEP 314 "provides", "requires", "obsoletes", ) def __init__(self, path=None): if path is not None: self.read_pkg_file(open(path)) else: self.name = None self.version = None self.author = None self.author_email = None self.maintainer = None self.maintainer_email = None self.url = None self.license = None self.description = None self.long_description = None self.keywords = None self.platforms = None self.classifiers = None self.download_url = None # PEP 314 self.provides = None self.requires = None self.obsoletes = None def read_pkg_file(self, file): """Reads the metadata values from a file object.""" msg = message_from_file(file) def _read_field(name): value = msg[name] if value == 'UNKNOWN': return None return value def _read_list(name): values = msg.get_all(name, None) if values == []: return None return values metadata_version = msg['metadata-version'] self.name = _read_field('name') self.version = _read_field('version') self.description = _read_field('summary') # we are filling author only. self.author = _read_field('author') self.maintainer = None self.author_email = _read_field('author-email') self.maintainer_email = None self.url = _read_field('home-page') self.license = _read_field('license') if 'download-url' in msg: self.download_url = _read_field('download-url') else: self.download_url = None self.long_description = _read_field('description') self.description = _read_field('summary') if 'keywords' in msg: self.keywords = _read_field('keywords').split(',') self.platforms = _read_list('platform') self.classifiers = _read_list('classifier') # PEP 314 - these fields only exist in 1.1 if metadata_version == '1.1': self.requires = _read_list('requires') self.provides = _read_list('provides') self.obsoletes = _read_list('obsoletes') else: self.requires = None self.provides = None self.obsoletes = None def write_pkg_info(self, base_dir): """Write the PKG-INFO file into the release tree. """ with open(os.path.join(base_dir, 'PKG-INFO'), 'w', encoding='UTF-8') as pkg_info: self.write_pkg_file(pkg_info) def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ version = '1.0' if (self.provides or self.requires or self.obsoletes or self.classifiers or self.download_url): version = '1.1' file.write('Metadata-Version: %s\n' % version) file.write('Name: %s\n' % self.get_name()) file.write('Version: %s\n' % self.get_version()) file.write('Summary: %s\n' % self.get_description()) file.write('Home-page: %s\n' % self.get_url()) file.write('Author: %s\n' % self.get_contact()) file.write('Author-email: %s\n' % self.get_contact_email()) file.write('License: %s\n' % self.get_license()) if self.download_url: file.write('Download-URL: %s\n' % self.download_url) long_desc = rfc822_escape(self.get_long_description()) file.write('Description: %s\n' % long_desc) keywords = ','.join(self.get_keywords()) if keywords: file.write('Keywords: %s\n' % keywords) self._write_list(file, 'Platform', self.get_platforms()) self._write_list(file, 'Classifier', self.get_classifiers()) # PEP 314 self._write_list(file, 'Requires', self.get_requires()) self._write_list(file, 'Provides', self.get_provides()) self._write_list(file, 'Obsoletes', self.get_obsoletes()) def _write_list(self, file, name, values): for value in values: file.write('%s: %s\n' % (name, value)) # -- Metadata query methods ---------------------------------------- def get_name(self): return self.name or "UNKNOWN" def get_version(self): return self.version or "0.0.0" def get_fullname(self): return "%s-%s" % (self.get_name(), self.get_version()) def get_author(self): return self.author or "UNKNOWN" def get_author_email(self): return self.author_email or "UNKNOWN" def get_maintainer(self): return self.maintainer or "UNKNOWN" def get_maintainer_email(self): return self.maintainer_email or "UNKNOWN" def get_contact(self): return self.maintainer or self.author or "UNKNOWN" def get_contact_email(self): return self.maintainer_email or self.author_email or "UNKNOWN" def get_url(self): return self.url or "UNKNOWN" def get_license(self): return self.license or "UNKNOWN" get_licence = get_license def get_description(self): return self.description or "UNKNOWN" def get_long_description(self): return self.long_description or "UNKNOWN" def get_keywords(self): return self.keywords or [] def set_keywords(self, value): self.keywords = _ensure_list(value, 'keywords') def get_platforms(self): return self.platforms or ["UNKNOWN"] def set_platforms(self, value): self.platforms = _ensure_list(value, 'platforms') def get_classifiers(self): return self.classifiers or [] def set_classifiers(self, value): self.classifiers = _ensure_list(value, 'classifiers') def get_download_url(self): return self.download_url or "UNKNOWN" # PEP 314 def get_requires(self): return self.requires or [] def set_requires(self, value): import distutils.versionpredicate for v in value: distutils.versionpredicate.VersionPredicate(v) self.requires = list(value) def get_provides(self): return self.provides or [] def set_provides(self, value): value = [v.strip() for v in value] for v in value: import distutils.versionpredicate distutils.versionpredicate.split_provision(v) self.provides = value def get_obsoletes(self): return self.obsoletes or [] def set_obsoletes(self, value): import distutils.versionpredicate for v in value: distutils.versionpredicate.VersionPredicate(v) self.obsoletes = list(value) def fix_help_options(options): """Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. """ new_options = [] for help_tuple in options: new_options.append(help_tuple[0:3]) return new_options PK! O_distutils/_functools.pynu[import functools # from jaraco.functools 3.5 def pass_none(func): """ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) """ @functools.wraps(func) def wrapper(param, *args, **kwargs): if param is not None: return func(param, *args, **kwargs) return wrapper PK! ~T~T_distutils/sysconfig.pynu["""Provide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are also available. Written by: Fred L. Drake, Jr. Email: """ import _imp import os import re import sys from .errors import DistutilsPlatformError IS_PYPY = '__pypy__' in sys.builtin_module_names # These are needed in a couple of spots, so just compute them once. PREFIX = os.path.normpath(sys.prefix) EXEC_PREFIX = os.path.normpath(sys.exec_prefix) BASE_PREFIX = os.path.normpath(sys.base_prefix) BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) # Path to the base directory of the project. On Windows the binary may # live in project/PCbuild/win32 or project/PCbuild/amd64. # set for cross builds if "_PYTHON_PROJECT_BASE" in os.environ: project_base = os.path.abspath(os.environ["_PYTHON_PROJECT_BASE"]) else: if sys.executable: project_base = os.path.dirname(os.path.abspath(sys.executable)) else: # sys.executable can be empty if argv[0] has been changed and Python is # unable to retrieve the real program name project_base = os.getcwd() # python_build: (Boolean) if true, we're either building Python or # building an extension with an un-installed Python, so we use # different (hard-wired) directories. def _is_python_source_dir(d): for fn in ("Setup", "Setup.local"): if os.path.isfile(os.path.join(d, "Modules", fn)): return True return False _sys_home = getattr(sys, '_home', None) if os.name == 'nt': def _fix_pcbuild(d): if d and os.path.normcase(d).startswith( os.path.normcase(os.path.join(PREFIX, "PCbuild"))): return PREFIX return d project_base = _fix_pcbuild(project_base) _sys_home = _fix_pcbuild(_sys_home) def _python_build(): if _sys_home: return _is_python_source_dir(_sys_home) return _is_python_source_dir(project_base) python_build = _python_build() # Calculate the build qualifier flags if they are defined. Adding the flags # to the include and lib directories only makes sense for an installation, not # an in-source build. build_flags = '' try: if not python_build: build_flags = sys.abiflags except AttributeError: # It's not a configure-based build, so the sys module doesn't have # this attribute, which is fine. pass def get_python_version(): """Return a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. """ return '%d.%d' % sys.version_info[:2] def get_python_inc(plat_specific=0, prefix=None): """Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pyconfig.h). If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. """ if prefix is None: prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX if os.name == "posix": if IS_PYPY and sys.version_info < (3, 8): return os.path.join(prefix, 'include') if python_build: # Assume the executable is in the build directory. The # pyconfig.h file should be in the same directory. Since # the build directory may not be the source directory, we # must use "srcdir" from the makefile to find the "Include" # directory. if plat_specific: return _sys_home or project_base else: incdir = os.path.join(get_config_var('srcdir'), 'Include') return os.path.normpath(incdir) implementation = 'pypy' if IS_PYPY else 'python' python_dir = implementation + get_python_version() + build_flags return os.path.join(prefix, "include", python_dir) elif os.name == "nt": if python_build: # Include both the include and PC dir to ensure we can find # pyconfig.h return (os.path.join(prefix, "include") + os.path.pathsep + os.path.join(prefix, "PC")) return os.path.join(prefix, "include") else: raise DistutilsPlatformError( "I don't know where Python installs its C header files " "on platform '%s'" % os.name) def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): """Return the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. """ if IS_PYPY and sys.version_info < (3, 8): # PyPy-specific schema if prefix is None: prefix = PREFIX if standard_lib: return os.path.join(prefix, "lib-python", sys.version[0]) return os.path.join(prefix, 'site-packages') if prefix is None: if standard_lib: prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX else: prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": if plat_specific or standard_lib: # Platform-specific modules (any module from a non-pure-Python # module distribution) or standard Python library modules. libdir = getattr(sys, "platlibdir", "lib") else: # Pure Python libdir = "lib" implementation = 'pypy' if IS_PYPY else 'python' libpython = os.path.join(prefix, libdir, implementation + get_python_version()) if standard_lib: return libpython else: return os.path.join(libpython, "site-packages") elif os.name == "nt": if standard_lib: return os.path.join(prefix, "Lib") else: return os.path.join(prefix, "Lib", "site-packages") else: raise DistutilsPlatformError( "I don't know where Python installs its library " "on platform '%s'" % os.name) def customize_compiler(compiler): """Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": if sys.platform == "darwin": # Perform first-time customization of compiler-related # config vars on OS X now that we know we need a compiler. # This is primarily to support Pythons from binary # installers. The kind and paths to build tools on # the user system may vary significantly from the system # that Python itself was built on. Also the user OS # version and build tools may not support the same set # of CPU architectures for universal builds. global _config_vars # Use get_config_var() to ensure _config_vars is initialized. if not get_config_var('CUSTOMIZED_OSX_COMPILER'): import _osx_support _osx_support.customize_compiler(_config_vars) _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ get_config_vars('CC', 'CXX', 'CFLAGS', 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') if 'CC' in os.environ: newcc = os.environ['CC'] if('LDSHARED' not in os.environ and ldshared.startswith(cc)): # If CC is overridden, use that as the default # command for LDSHARED as well ldshared = newcc + ldshared[len(cc):] cc = newcc if 'CXX' in os.environ: cxx = os.environ['CXX'] if 'LDSHARED' in os.environ: ldshared = os.environ['LDSHARED'] if 'CPP' in os.environ: cpp = os.environ['CPP'] else: cpp = cc + " -E" # not always if 'LDFLAGS' in os.environ: ldshared = ldshared + ' ' + os.environ['LDFLAGS'] if 'CFLAGS' in os.environ: cflags = cflags + ' ' + os.environ['CFLAGS'] ldshared = ldshared + ' ' + os.environ['CFLAGS'] if 'CPPFLAGS' in os.environ: cpp = cpp + ' ' + os.environ['CPPFLAGS'] cflags = cflags + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] if 'AR' in os.environ: ar = os.environ['AR'] if 'ARFLAGS' in os.environ: archiver = ar + ' ' + os.environ['ARFLAGS'] else: archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags compiler.set_executables( preprocessor=cpp, compiler=cc_cmd, compiler_so=cc_cmd + ' ' + ccshared, compiler_cxx=cxx, linker_so=ldshared, linker_exe=cc, archiver=archiver) if 'RANLIB' in os.environ and compiler.executables.get('ranlib', None): compiler.set_executables(ranlib=os.environ['RANLIB']) compiler.shared_lib_extension = shlib_suffix def get_config_h_filename(): """Return full pathname of installed pyconfig.h file.""" if python_build: if os.name == "nt": inc_dir = os.path.join(_sys_home or project_base, "PC") else: inc_dir = _sys_home or project_base else: inc_dir = get_python_inc(plat_specific=1) return os.path.join(inc_dir, 'pyconfig.h') def get_makefile_filename(): """Return full pathname of installed Makefile from the Python build.""" if python_build: return os.path.join(_sys_home or project_base, "Makefile") lib_dir = get_python_lib(plat_specific=0, standard_lib=1) config_file = 'config-{}{}'.format(get_python_version(), build_flags) if hasattr(sys.implementation, '_multiarch'): config_file += '-%s' % sys.implementation._multiarch return os.path.join(lib_dir, config_file, 'Makefile') def parse_config_h(fp, g=None): """Parse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ if g is None: g = {} define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n") # while True: line = fp.readline() if not line: break m = define_rx.match(line) if m: n, v = m.group(1, 2) try: v = int(v) except ValueError: pass g[n] = v else: m = undef_rx.match(line) if m: g[m.group(1)] = 0 return g # Regexes needed for parsing Makefile (and similar syntaxes, # like old-style Setup files). _variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)") _findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)") _findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}") def parse_makefile(fn, g=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ from distutils.text_file import TextFile fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape") if g is None: g = {} done = {} notdone = {} while True: line = fp.readline() if line is None: # eof break m = _variable_rx.match(line) if m: n, v = m.group(1, 2) v = v.strip() # `$$' is a literal `$' in make tmpv = v.replace('$$', '') if "$" in tmpv: notdone[n] = v else: try: v = int(v) except ValueError: # insert literal `$' done[n] = v.replace('$$', '$') else: done[n] = v # Variables with a 'PY_' prefix in the makefile. These need to # be made available without that prefix through sysconfig. # Special care is needed to ensure that variable expansion works, even # if the expansion uses the name without a prefix. renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS') # do variable interpolation here while notdone: for name in list(notdone): value = notdone[name] m = _findvar1_rx.search(value) or _findvar2_rx.search(value) if m: n = m.group(1) found = True if n in done: item = str(done[n]) elif n in notdone: # get it on a subsequent round found = False elif n in os.environ: # do it like make: fall back to environment item = os.environ[n] elif n in renamed_variables: if name.startswith('PY_') and name[3:] in renamed_variables: item = "" elif 'PY_' + n in notdone: found = False else: item = str(done['PY_' + n]) else: done[n] = item = "" if found: after = value[m.end():] value = value[:m.start()] + item + after if "$" in after: notdone[name] = value else: try: value = int(value) except ValueError: done[name] = value.strip() else: done[name] = value del notdone[name] if name.startswith('PY_') \ and name[3:] in renamed_variables: name = name[3:] if name not in done: done[name] = value else: # bogus variable reference; just drop it since we can't deal del notdone[name] fp.close() # strip spurious spaces for k, v in done.items(): if isinstance(v, str): done[k] = v.strip() # save the results in the global dictionary g.update(done) return g def expand_makefile_vars(s, vars): """Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in 'string' according to 'vars' (a dictionary mapping variable names to values). Variables not present in 'vars' are silently expanded to the empty string. The variable values in 'vars' should not contain further variable expansions; if 'vars' is the output of 'parse_makefile()', you're fine. Returns a variable-expanded version of 's'. """ # This algorithm does multiple expansion, so if vars['foo'] contains # "${bar}", it will expand ${foo} to ${bar}, and then expand # ${bar}... and so forth. This is fine as long as 'vars' comes from # 'parse_makefile()', which takes care of such expansions eagerly, # according to make's variable expansion semantics. while True: m = _findvar1_rx.search(s) or _findvar2_rx.search(s) if m: (beg, end) = m.span() s = s[0:beg] + vars.get(m.group(1)) + s[end:] else: break return s _config_vars = None def _init_posix(): """Initialize the module as appropriate for POSIX systems.""" # _sysconfigdata is generated at build time, see the sysconfig module name = os.environ.get('_PYTHON_SYSCONFIGDATA_NAME', '_sysconfigdata_{abi}_{platform}_{multiarch}'.format( abi=sys.abiflags, platform=sys.platform, multiarch=getattr(sys.implementation, '_multiarch', ''), )) try: _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0) except ImportError: # Python 3.5 and pypy 7.3.1 _temp = __import__( '_sysconfigdata', globals(), locals(), ['build_time_vars'], 0) build_time_vars = _temp.build_time_vars global _config_vars _config_vars = {} _config_vars.update(build_time_vars) def _init_nt(): """Initialize the module as appropriate for NT""" g = {} # set basic install directories g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1) g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1) # XXX hmmm.. a normal install puts include files here g['INCLUDEPY'] = get_python_inc(plat_specific=0) g['EXT_SUFFIX'] = _imp.extension_suffixes()[0] g['EXE'] = ".exe" g['VERSION'] = get_python_version().replace(".", "") g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable)) global _config_vars _config_vars = g def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. """ global _config_vars if _config_vars is None: func = globals().get("_init_" + os.name) if func: func() else: _config_vars = {} # Normalized versions of prefix and exec_prefix are handy to have; # in fact, these are the standard versions used most places in the # Distutils. _config_vars['prefix'] = PREFIX _config_vars['exec_prefix'] = EXEC_PREFIX if not IS_PYPY: # For backward compatibility, see issue19555 SO = _config_vars.get('EXT_SUFFIX') if SO is not None: _config_vars['SO'] = SO # Always convert srcdir to an absolute path srcdir = _config_vars.get('srcdir', project_base) if os.name == 'posix': if python_build: # If srcdir is a relative path (typically '.' or '..') # then it should be interpreted relative to the directory # containing Makefile. base = os.path.dirname(get_makefile_filename()) srcdir = os.path.join(base, srcdir) else: # srcdir is not meaningful since the installation is # spread about the filesystem. We choose the # directory containing the Makefile since we know it # exists. srcdir = os.path.dirname(get_makefile_filename()) _config_vars['srcdir'] = os.path.abspath(os.path.normpath(srcdir)) # Convert srcdir into an absolute path if it appears necessary. # Normally it is relative to the build directory. However, during # testing, for example, we might be running a non-installed python # from a different directory. if python_build and os.name == "posix": base = project_base if (not os.path.isabs(_config_vars['srcdir']) and base != os.getcwd()): # srcdir is relative and we are not in the same directory # as the executable. Assume executable is in the build # directory and make srcdir absolute. srcdir = os.path.join(base, _config_vars['srcdir']) _config_vars['srcdir'] = os.path.normpath(srcdir) # OS X platforms require special customization to handle # multi-architecture, multi-os-version installers if sys.platform == 'darwin': import _osx_support _osx_support.customize_config_vars(_config_vars) if args: vals = [] for name in args: vals.append(_config_vars.get(name)) return vals else: return _config_vars def get_config_var(name): """Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) """ if name == 'SO': import warnings warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2) return get_config_vars().get(name) PK!>vv_distutils/msvc9compiler.pynu["""distutils.msvc9compiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio 2008. The module is compatible with VS 2005 and VS 2008. You can find legacy support for older versions of VS in distutils.msvccompiler. """ # Written by Perry Stoll # hacked by Robin Becker and Thomas Heller to do a better job of # finding DevStudio (through the registry) # ported to VS2005 and VS 2008 by Christian Heimes import os import subprocess import sys import re from distutils.errors import DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError from distutils.ccompiler import CCompiler, gen_lib_options from distutils import log from distutils.util import get_platform import winreg RegOpenKeyEx = winreg.OpenKeyEx RegEnumKey = winreg.EnumKey RegEnumValue = winreg.EnumValue RegError = winreg.error HKEYS = (winreg.HKEY_USERS, winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_CLASSES_ROOT) NATIVE_WIN64 = (sys.platform == 'win32' and sys.maxsize > 2**32) if NATIVE_WIN64: # Visual C++ is a 32-bit application, so we need to look in # the corresponding registry branch, if we're running a # 64-bit Python on Win64 VS_BASE = r"Software\Wow6432Node\Microsoft\VisualStudio\%0.1f" WINSDK_BASE = r"Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows" NET_BASE = r"Software\Wow6432Node\Microsoft\.NETFramework" else: VS_BASE = r"Software\Microsoft\VisualStudio\%0.1f" WINSDK_BASE = r"Software\Microsoft\Microsoft SDKs\Windows" NET_BASE = r"Software\Microsoft\.NETFramework" # A map keyed by get_platform() return values to values accepted by # 'vcvarsall.bat'. Note a cross-compile may combine these (eg, 'x86_amd64' is # the param to cross-compile on x86 targeting amd64.) PLAT_TO_VCVARS = { 'win32' : 'x86', 'win-amd64' : 'amd64', } class Reg: """Helper class to read values from the registry """ def get_value(cls, path, key): for base in HKEYS: d = cls.read_values(base, path) if d and key in d: return d[key] raise KeyError(key) get_value = classmethod(get_value) def read_keys(cls, base, key): """Return list of registry keys.""" try: handle = RegOpenKeyEx(base, key) except RegError: return None L = [] i = 0 while True: try: k = RegEnumKey(handle, i) except RegError: break L.append(k) i += 1 return L read_keys = classmethod(read_keys) def read_values(cls, base, key): """Return dict of registry keys and values. All names are converted to lowercase. """ try: handle = RegOpenKeyEx(base, key) except RegError: return None d = {} i = 0 while True: try: name, value, type = RegEnumValue(handle, i) except RegError: break name = name.lower() d[cls.convert_mbcs(name)] = cls.convert_mbcs(value) i += 1 return d read_values = classmethod(read_values) def convert_mbcs(s): dec = getattr(s, "decode", None) if dec is not None: try: s = dec("mbcs") except UnicodeError: pass return s convert_mbcs = staticmethod(convert_mbcs) class MacroExpander: def __init__(self, version): self.macros = {} self.vsbase = VS_BASE % version self.load_macros(version) def set_macro(self, macro, path, key): self.macros["$(%s)" % macro] = Reg.get_value(path, key) def load_macros(self, version): self.set_macro("VCInstallDir", self.vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", self.vsbase + r"\Setup\VS", "productdir") self.set_macro("FrameworkDir", NET_BASE, "installroot") try: if version >= 8.0: self.set_macro("FrameworkSDKDir", NET_BASE, "sdkinstallrootv2.0") else: raise KeyError("sdkinstallrootv2.0") except KeyError: raise DistutilsPlatformError( """Python was built with Visual Studio 2008; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2008 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""") if version >= 9.0: self.set_macro("FrameworkVersion", self.vsbase, "clr version") self.set_macro("WindowsSdkDir", WINSDK_BASE, "currentinstallfolder") else: p = r"Software\Microsoft\NET Framework Setup\Product" for base in HKEYS: try: h = RegOpenKeyEx(base, p) except RegError: continue key = RegEnumKey(h, 0) d = Reg.get_value(base, r"%s\%s" % (p, key)) self.macros["$(FrameworkVersion)"] = d["version"] def sub(self, s): for k, v in self.macros.items(): s = s.replace(k, v) return s def get_build_version(): """Return the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. """ prefix = "MSC v." i = sys.version.find(prefix) if i == -1: return 6 i = i + len(prefix) s, rest = sys.version[i:].split(" ", 1) majorVersion = int(s[:-2]) - 6 if majorVersion >= 13: # v13 was skipped and should be v14 majorVersion += 1 minorVersion = int(s[2:3]) / 10.0 # I don't think paths are affected by minor version in version 6 if majorVersion == 6: minorVersion = 0 if majorVersion >= 6: return majorVersion + minorVersion # else we don't know what version of the compiler this is return None def normalize_and_reduce_paths(paths): """Return a list of normalized paths with duplicates removed. The current order of paths is maintained. """ # Paths are normalized so things like: /a and /a/ aren't both preserved. reduced_paths = [] for p in paths: np = os.path.normpath(p) # XXX(nnorwitz): O(n**2), if reduced_paths gets long perhaps use a set. if np not in reduced_paths: reduced_paths.append(np) return reduced_paths def removeDuplicates(variable): """Remove duplicate values of an environment variable. """ oldList = variable.split(os.pathsep) newList = [] for i in oldList: if i not in newList: newList.append(i) newVariable = os.pathsep.join(newList) return newVariable def find_vcvarsall(version): """Find the vcvarsall.bat file At first it tries to find the productdir of VS 2008 in the registry. If that fails it falls back to the VS90COMNTOOLS env var. """ vsbase = VS_BASE % version try: productdir = Reg.get_value(r"%s\Setup\VC" % vsbase, "productdir") except KeyError: log.debug("Unable to find productdir in registry") productdir = None if not productdir or not os.path.isdir(productdir): toolskey = "VS%0.f0COMNTOOLS" % version toolsdir = os.environ.get(toolskey, None) if toolsdir and os.path.isdir(toolsdir): productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC") productdir = os.path.abspath(productdir) if not os.path.isdir(productdir): log.debug("%s is not a valid directory" % productdir) return None else: log.debug("Env var %s is not set or invalid" % toolskey) if not productdir: log.debug("No productdir found") return None vcvarsall = os.path.join(productdir, "vcvarsall.bat") if os.path.isfile(vcvarsall): return vcvarsall log.debug("Unable to find vcvarsall.bat") return None def query_vcvarsall(version, arch="x86"): """Launch vcvarsall.bat and read the settings from its environment """ vcvarsall = find_vcvarsall(version) interesting = {"include", "lib", "libpath", "path"} result = {} if vcvarsall is None: raise DistutilsPlatformError("Unable to find vcvarsall.bat") log.debug("Calling 'vcvarsall.bat %s' (version=%s)", arch, version) popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch), stdout=subprocess.PIPE, stderr=subprocess.PIPE) try: stdout, stderr = popen.communicate() if popen.wait() != 0: raise DistutilsPlatformError(stderr.decode("mbcs")) stdout = stdout.decode("mbcs") for line in stdout.split("\n"): line = Reg.convert_mbcs(line) if '=' not in line: continue line = line.strip() key, value = line.split('=', 1) key = key.lower() if key in interesting: if value.endswith(os.pathsep): value = value[:-1] result[key] = removeDuplicates(value) finally: popen.stdout.close() popen.stderr.close() if len(result) != len(interesting): raise ValueError(str(list(result.keys()))) return result # More globals VERSION = get_build_version() if VERSION < 8.0: raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION) # MACROS = MacroExpander(VERSION) class MSVCCompiler(CCompiler) : """Concrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.""" compiler_type = 'msvc' # Just set this so CCompiler's constructor doesn't barf. We currently # don't use the 'set_executables()' bureaucracy provided by CCompiler, # as it really isn't necessary for this sort of single-compiler class. # Would be nice to have a consistent interface with UnixCCompiler, # though, so it's worth thinking about. executables = {} # Private class data (need to distinguish C from C++ source for compiler) _c_extensions = ['.c'] _cpp_extensions = ['.cc', '.cpp', '.cxx'] _rc_extensions = ['.rc'] _mc_extensions = ['.mc'] # Needed for the filename generation methods provided by the # base class, CCompiler. src_extensions = (_c_extensions + _cpp_extensions + _rc_extensions + _mc_extensions) res_extension = '.res' obj_extension = '.obj' static_lib_extension = '.lib' shared_lib_extension = '.dll' static_lib_format = shared_lib_format = '%s%s' exe_extension = '.exe' def __init__(self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) self.__version = VERSION self.__root = r"Software\Microsoft\VisualStudio" # self.__macros = MACROS self.__paths = [] # target platform (.plat_name is consistent with 'bdist') self.plat_name = None self.__arch = None # deprecated name self.initialized = False def initialize(self, plat_name=None): # multi-init means we would need to check platform same each time... assert not self.initialized, "don't init multiple times" if plat_name is None: plat_name = get_platform() # sanity check for platforms to prevent obscure errors later. ok_plats = 'win32', 'win-amd64' if plat_name not in ok_plats: raise DistutilsPlatformError("--plat-name must be one of %s" % (ok_plats,)) if "DISTUTILS_USE_SDK" in os.environ and "MSSdk" in os.environ and self.find_exe("cl.exe"): # Assume that the SDK set up everything alright; don't try to be # smarter self.cc = "cl.exe" self.linker = "link.exe" self.lib = "lib.exe" self.rc = "rc.exe" self.mc = "mc.exe" else: # On x86, 'vcvars32.bat amd64' creates an env that doesn't work; # to cross compile, you use 'x86_amd64'. # On AMD64, 'vcvars32.bat amd64' is a native build env; to cross # compile use 'x86' (ie, it runs the x86 compiler directly) if plat_name == get_platform() or plat_name == 'win32': # native build or cross-compile to win32 plat_spec = PLAT_TO_VCVARS[plat_name] else: # cross compile from win32 -> some 64bit plat_spec = PLAT_TO_VCVARS[get_platform()] + '_' + \ PLAT_TO_VCVARS[plat_name] vc_env = query_vcvarsall(VERSION, plat_spec) self.__paths = vc_env['path'].split(os.pathsep) os.environ['lib'] = vc_env['lib'] os.environ['include'] = vc_env['include'] if len(self.__paths) == 0: raise DistutilsPlatformError("Python was built with %s, " "and extensions need to be built with the same " "version of the compiler, but it isn't installed." % self.__product) self.cc = self.find_exe("cl.exe") self.linker = self.find_exe("link.exe") self.lib = self.find_exe("lib.exe") self.rc = self.find_exe("rc.exe") # resource compiler self.mc = self.find_exe("mc.exe") # message compiler #self.set_path_env_var('lib') #self.set_path_env_var('include') # extend the MSVC path with the current path try: for p in os.environ['path'].split(';'): self.__paths.append(p) except KeyError: pass self.__paths = normalize_and_reduce_paths(self.__paths) os.environ['path'] = ";".join(self.__paths) self.preprocess_options = None if self.__arch == "x86": self.compile_options = [ '/nologo', '/O2', '/MD', '/W3', '/DNDEBUG'] self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/Z7', '/D_DEBUG'] else: # Win64 self.compile_options = [ '/nologo', '/O2', '/MD', '/W3', '/GS-' , '/DNDEBUG'] self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-', '/Z7', '/D_DEBUG'] self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO'] if self.__version >= 7: self.ldflags_shared_debug = [ '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG' ] self.ldflags_static = [ '/nologo'] self.initialized = True # -- Worker methods ------------------------------------------------ def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): # Copied from ccompiler.py, extended to return .res as 'object'-file # for .rc input file if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: (base, ext) = os.path.splitext (src_name) base = os.path.splitdrive(base)[1] # Chop off the drive base = base[os.path.isabs(base):] # If abs, chop off leading / if ext not in self.src_extensions: # Better to raise an exception instead of silently continuing # and later complain about sources and targets having # different lengths raise CompileError ("Don't know how to compile %s" % src_name) if strip_dir: base = os.path.basename (base) if ext in self._rc_extensions: obj_names.append (os.path.join (output_dir, base + self.res_extension)) elif ext in self._mc_extensions: obj_names.append (os.path.join (output_dir, base + self.res_extension)) else: obj_names.append (os.path.join (output_dir, base + self.obj_extension)) return obj_names def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): if not self.initialized: self.initialize() compile_info = self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs) macros, objects, extra_postargs, pp_opts, build = compile_info compile_opts = extra_preargs or [] compile_opts.append ('/c') if debug: compile_opts.extend(self.compile_options_debug) else: compile_opts.extend(self.compile_options) for obj in objects: try: src, ext = build[obj] except KeyError: continue if debug: # pass the full pathname to MSVC in debug mode, # this allows the debugger to find the source file # without asking the user to browse for it src = os.path.abspath(src) if ext in self._c_extensions: input_opt = "/Tc" + src elif ext in self._cpp_extensions: input_opt = "/Tp" + src elif ext in self._rc_extensions: # compile .RC to .RES file input_opt = src output_opt = "/fo" + obj try: self.spawn([self.rc] + pp_opts + [output_opt] + [input_opt]) except DistutilsExecError as msg: raise CompileError(msg) continue elif ext in self._mc_extensions: # Compile .MC to .RC file to .RES file. # * '-h dir' specifies the directory for the # generated include file # * '-r dir' specifies the target directory of the # generated RC file and the binary message resource # it includes # # For now (since there are no options to change this), # we use the source-directory for the include file and # the build directory for the RC file and message # resources. This works at least for win32all. h_dir = os.path.dirname(src) rc_dir = os.path.dirname(obj) try: # first compile .MC to .RC and .H file self.spawn([self.mc] + ['-h', h_dir, '-r', rc_dir] + [src]) base, _ = os.path.splitext (os.path.basename (src)) rc_file = os.path.join (rc_dir, base + '.rc') # then compile .RC to .RES file self.spawn([self.rc] + ["/fo" + obj] + [rc_file]) except DistutilsExecError as msg: raise CompileError(msg) continue else: # how to handle this file? raise CompileError("Don't know how to compile %s to %s" % (src, obj)) output_opt = "/Fo" + obj try: self.spawn([self.cc] + compile_opts + pp_opts + [input_opt, output_opt] + extra_postargs) except DistutilsExecError as msg: raise CompileError(msg) return objects def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): if not self.initialized: self.initialize() (objects, output_dir) = self._fix_object_args(objects, output_dir) output_filename = self.library_filename(output_libname, output_dir=output_dir) if self._need_link(objects, output_filename): lib_args = objects + ['/OUT:' + output_filename] if debug: pass # XXX what goes here? try: self.spawn([self.lib] + lib_args) except DistutilsExecError as msg: raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): if not self.initialized: self.initialize() (objects, output_dir) = self._fix_object_args(objects, output_dir) fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) (libraries, library_dirs, runtime_library_dirs) = fixed_args if runtime_library_dirs: self.warn ("I don't know what to do with 'runtime_library_dirs': " + str (runtime_library_dirs)) lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if output_dir is not None: output_filename = os.path.join(output_dir, output_filename) if self._need_link(objects, output_filename): if target_desc == CCompiler.EXECUTABLE: if debug: ldflags = self.ldflags_shared_debug[1:] else: ldflags = self.ldflags_shared[1:] else: if debug: ldflags = self.ldflags_shared_debug else: ldflags = self.ldflags_shared export_opts = [] for sym in (export_symbols or []): export_opts.append("/EXPORT:" + sym) ld_args = (ldflags + lib_opts + export_opts + objects + ['/OUT:' + output_filename]) # The MSVC linker generates .lib and .exp files, which cannot be # suppressed by any linker switches. The .lib files may even be # needed! Make sure they are generated in the temporary build # directory. Since they have different names for debug and release # builds, they can go into the same directory. build_temp = os.path.dirname(objects[0]) if export_symbols is not None: (dll_name, dll_ext) = os.path.splitext( os.path.basename(output_filename)) implib_file = os.path.join( build_temp, self.library_filename(dll_name)) ld_args.append ('/IMPLIB:' + implib_file) self.manifest_setup_ldargs(output_filename, build_temp, ld_args) if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) self.mkpath(os.path.dirname(output_filename)) try: self.spawn([self.linker] + ld_args) except DistutilsExecError as msg: raise LinkError(msg) # embed the manifest # XXX - this is somewhat fragile - if mt.exe fails, distutils # will still consider the DLL up-to-date, but it will not have a # manifest. Maybe we should link to a temp file? OTOH, that # implies a build environment error that shouldn't go undetected. mfinfo = self.manifest_get_embed_info(target_desc, ld_args) if mfinfo is not None: mffilename, mfid = mfinfo out_arg = '-outputresource:%s;%s' % (output_filename, mfid) try: self.spawn(['mt.exe', '-nologo', '-manifest', mffilename, out_arg]) except DistutilsExecError as msg: raise LinkError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def manifest_setup_ldargs(self, output_filename, build_temp, ld_args): # If we need a manifest at all, an embedded manifest is recommended. # See MSDN article titled # "How to: Embed a Manifest Inside a C/C++ Application" # (currently at http://msdn2.microsoft.com/en-us/library/ms235591(VS.80).aspx) # Ask the linker to generate the manifest in the temp dir, so # we can check it, and possibly embed it, later. temp_manifest = os.path.join( build_temp, os.path.basename(output_filename) + ".manifest") ld_args.append('/MANIFESTFILE:' + temp_manifest) def manifest_get_embed_info(self, target_desc, ld_args): # If a manifest should be embedded, return a tuple of # (manifest_filename, resource_id). Returns None if no manifest # should be embedded. See http://bugs.python.org/issue7833 for why # we want to avoid any manifest for extension modules if we can) for arg in ld_args: if arg.startswith("/MANIFESTFILE:"): temp_manifest = arg.split(":", 1)[1] break else: # no /MANIFESTFILE so nothing to do. return None if target_desc == CCompiler.EXECUTABLE: # by default, executables always get the manifest with the # CRT referenced. mfid = 1 else: # Extension modules try and avoid any manifest if possible. mfid = 2 temp_manifest = self._remove_visual_c_ref(temp_manifest) if temp_manifest is None: return None return temp_manifest, mfid def _remove_visual_c_ref(self, manifest_file): try: # Remove references to the Visual C runtime, so they will # fall through to the Visual C dependency of Python.exe. # This way, when installed for a restricted user (e.g. # runtimes are not in WinSxS folder, but in Python's own # folder), the runtimes do not need to be in every folder # with .pyd's. # Returns either the filename of the modified manifest or # None if no manifest should be embedded. manifest_f = open(manifest_file) try: manifest_buf = manifest_f.read() finally: manifest_f.close() pattern = re.compile( r"""|)""", re.DOTALL) manifest_buf = re.sub(pattern, "", manifest_buf) pattern = r"\s*" manifest_buf = re.sub(pattern, "", manifest_buf) # Now see if any other assemblies are referenced - if not, we # don't want a manifest embedded. pattern = re.compile( r"""|)""", re.DOTALL) if re.search(pattern, manifest_buf) is None: return None manifest_f = open(manifest_file, 'w') try: manifest_f.write(manifest_buf) return manifest_file finally: manifest_f.close() except OSError: pass # -- Miscellaneous methods ----------------------------------------- # These are all used by the 'gen_lib_options() function, in # ccompiler.py. def library_dir_option(self, dir): return "/LIBPATH:" + dir def runtime_library_dir_option(self, dir): raise DistutilsPlatformError( "don't know how to set runtime library search path for MSVC++") def library_option(self, lib): return self.library_filename(lib) def find_library_file(self, dirs, lib, debug=0): # Prefer a debugging library if found (and requested), but deal # with it if we don't have one. if debug: try_names = [lib + "_d", lib] else: try_names = [lib] for dir in dirs: for name in try_names: libfile = os.path.join(dir, self.library_filename (name)) if os.path.exists(libfile): return libfile else: # Oops, didn't find it in *any* of 'dirs' return None # Helper methods for using the MSVC registry settings def find_exe(self, exe): """Return path to an MSVC executable program. Tries to find the program in several places: first, one of the MSVC program search paths from the registry; next, the directories in the PATH environment variable. If any of those work, return an absolute path that is known to exist. If none of them work, just return the original program name, 'exe'. """ for p in self.__paths: fn = os.path.join(os.path.abspath(p), exe) if os.path.isfile(fn): return fn # didn't find it; try existing path for p in os.environ['Path'].split(';'): fn = os.path.join(os.path.abspath(p),exe) if os.path.isfile(fn): return fn return exe PK!n _distutils/errors.pynu["""distutils.errors Provides exceptions used by the Distutils modules. Note that Distutils modules may raise standard exceptions; in particular, SystemExit is usually raised for errors that are obviously the end-user's fault (eg. bad command-line arguments). This module is safe to use in "from ... import *" mode; it only exports symbols whose names start with "Distutils" and end with "Error".""" class DistutilsError (Exception): """The root of all Distutils evil.""" pass class DistutilsModuleError (DistutilsError): """Unable to load an expected module, or to find an expected class within some module (in particular, command modules and classes).""" pass class DistutilsClassError (DistutilsError): """Some command class (or possibly distribution class, if anyone feels a need to subclass Distribution) is found not to be holding up its end of the bargain, ie. implementing some part of the "command "interface.""" pass class DistutilsGetoptError (DistutilsError): """The option table provided to 'fancy_getopt()' is bogus.""" pass class DistutilsArgError (DistutilsError): """Raised by fancy_getopt in response to getopt.error -- ie. an error in the command line usage.""" pass class DistutilsFileError (DistutilsError): """Any problems in the filesystem: expected file not found, etc. Typically this is for problems that we detect before OSError could be raised.""" pass class DistutilsOptionError (DistutilsError): """Syntactic/semantic errors in command options, such as use of mutually conflicting options, or inconsistent options, badly-spelled values, etc. No distinction is made between option values originating in the setup script, the command line, config files, or what-have-you -- but if we *know* something originated in the setup script, we'll raise DistutilsSetupError instead.""" pass class DistutilsSetupError (DistutilsError): """For errors that can be definitely blamed on the setup script, such as invalid keyword arguments to 'setup()'.""" pass class DistutilsPlatformError (DistutilsError): """We don't know how to do something on the current platform (but we do know how to do it on some platform) -- eg. trying to compile C files on a platform not supported by a CCompiler subclass.""" pass class DistutilsExecError (DistutilsError): """Any problems executing an external program (such as the C compiler, when compiling C files).""" pass class DistutilsInternalError (DistutilsError): """Internal inconsistencies or impossibilities (obviously, this should never be seen if the code is working!).""" pass class DistutilsTemplateError (DistutilsError): """Syntax error in a file list template.""" class DistutilsByteCompileError(DistutilsError): """Byte compile error.""" # Exception classes used by the CCompiler implementation classes class CCompilerError (Exception): """Some compile/link operation failed.""" class PreprocessError (CCompilerError): """Failure to preprocess one or more C/C++ files.""" class CompileError (CCompilerError): """Failure to compile one or more C/C++ source files.""" class LibError (CCompilerError): """Failure to create a static library from one or more C/C++ object files.""" class LinkError (CCompilerError): """Failure to link one or more C/C++ object files into an executable or shared library file.""" class UnknownFileError (CCompilerError): """Attempt to process an unknown file type.""" PK!8700_distutils/version.pynu[# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVersion. Every version number class implements the following interface: * the 'parse' method takes a string and parses it to some internal representation; if the string is an invalid version number, 'parse' raises a ValueError exception * the class constructor takes an optional string argument which, if supplied, is passed to 'parse' * __str__ reconstructs the string that was passed to 'parse' (or an equivalent string -- ie. one that will generate an equivalent version number instance) * __repr__ generates Python code to recreate the version number instance * _cmp compares the current instance with either another instance of the same class or a string (which will be parsed to an instance of the same class, thus must follow the same rules) """ import re class Version: """Abstract base class for version numbering classes. Just provides constructor (__init__) and reproducer (__repr__), because those seem to be the same for all version numbering classes; and route rich comparisons to _cmp. """ def __init__ (self, vstring=None): if vstring: self.parse(vstring) def __repr__ (self): return "%s ('%s')" % (self.__class__.__name__, str(self)) def __eq__(self, other): c = self._cmp(other) if c is NotImplemented: return c return c == 0 def __lt__(self, other): c = self._cmp(other) if c is NotImplemented: return c return c < 0 def __le__(self, other): c = self._cmp(other) if c is NotImplemented: return c return c <= 0 def __gt__(self, other): c = self._cmp(other) if c is NotImplemented: return c return c > 0 def __ge__(self, other): c = self._cmp(other) if c is NotImplemented: return c return c >= 0 # Interface for version-number classes -- must be implemented # by the following classes (the concrete ones -- Version should # be treated as an abstract class). # __init__ (string) - create and take same action as 'parse' # (string parameter is optional) # parse (string) - convert a string representation to whatever # internal representation is appropriate for # this style of version numbering # __str__ (self) - convert back to a string; should be very similar # (if not identical to) the string supplied to parse # __repr__ (self) - generate Python code to recreate # the instance # _cmp (self, other) - compare two version numbers ('other' may # be an unparsed version string, or another # instance of your version class) class StrictVersion (Version): """Version numbering for anal retentives and software idealists. Implements the standard interface for version number classes as described above. A version number consists of two or three dot-separated numeric components, with an optional "pre-release" tag on the end. The pre-release tag consists of the letter 'a' or 'b' followed by a number. If the numeric components of two version numbers are equal, then one with a pre-release tag will always be deemed earlier (lesser) than one without. The following are valid version numbers (shown in the order that would be obtained by sorting according to the supplied cmp function): 0.4 0.4.0 (these two are equivalent) 0.4.1 0.5a1 0.5b3 0.5 0.9.6 1.0 1.0.4a3 1.0.4b1 1.0.4 The following are examples of invalid version numbers: 1 2.7.2.2 1.3.a4 1.3pl1 1.3c4 The rationale for this version numbering system will be explained in the distutils documentation. """ version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$', re.VERBOSE | re.ASCII) def parse (self, vstring): match = self.version_re.match(vstring) if not match: raise ValueError("invalid version number '%s'" % vstring) (major, minor, patch, prerelease, prerelease_num) = \ match.group(1, 2, 4, 5, 6) if patch: self.version = tuple(map(int, [major, minor, patch])) else: self.version = tuple(map(int, [major, minor])) + (0,) if prerelease: self.prerelease = (prerelease[0], int(prerelease_num)) else: self.prerelease = None def __str__ (self): if self.version[2] == 0: vstring = '.'.join(map(str, self.version[0:2])) else: vstring = '.'.join(map(str, self.version)) if self.prerelease: vstring = vstring + self.prerelease[0] + str(self.prerelease[1]) return vstring def _cmp (self, other): if isinstance(other, str): other = StrictVersion(other) elif not isinstance(other, StrictVersion): return NotImplemented if self.version != other.version: # numeric versions don't match # prerelease stuff doesn't matter if self.version < other.version: return -1 else: return 1 # have to compare prerelease # case 1: neither has prerelease; they're equal # case 2: self has prerelease, other doesn't; other is greater # case 3: self doesn't have prerelease, other does: self is greater # case 4: both have prerelease: must compare them! if (not self.prerelease and not other.prerelease): return 0 elif (self.prerelease and not other.prerelease): return -1 elif (not self.prerelease and other.prerelease): return 1 elif (self.prerelease and other.prerelease): if self.prerelease == other.prerelease: return 0 elif self.prerelease < other.prerelease: return -1 else: return 1 else: assert False, "never get here" # end class StrictVersion # The rules according to Greg Stein: # 1) a version number has 1 or more numbers separated by a period or by # sequences of letters. If only periods, then these are compared # left-to-right to determine an ordering. # 2) sequences of letters are part of the tuple for comparison and are # compared lexicographically # 3) recognize the numeric components may have leading zeroes # # The LooseVersion class below implements these rules: a version number # string is split up into a tuple of integer and string components, and # comparison is a simple tuple comparison. This means that version # numbers behave in a predictable and obvious way, but a way that might # not necessarily be how people *want* version numbers to behave. There # wouldn't be a problem if people could stick to purely numeric version # numbers: just split on period and compare the numbers as tuples. # However, people insist on putting letters into their version numbers; # the most common purpose seems to be: # - indicating a "pre-release" version # ('alpha', 'beta', 'a', 'b', 'pre', 'p') # - indicating a post-release patch ('p', 'pl', 'patch') # but of course this can't cover all version number schemes, and there's # no way to know what a programmer means without asking him. # # The problem is what to do with letters (and other non-numeric # characters) in a version number. The current implementation does the # obvious and predictable thing: keep them as strings and compare # lexically within a tuple comparison. This has the desired effect if # an appended letter sequence implies something "post-release": # eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002". # # However, if letters in a version number imply a pre-release version, # the "obvious" thing isn't correct. Eg. you would expect that # "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison # implemented here, this just isn't so. # # Two possible solutions come to mind. The first is to tie the # comparison algorithm to a particular set of semantic rules, as has # been done in the StrictVersion class above. This works great as long # as everyone can go along with bondage and discipline. Hopefully a # (large) subset of Python module programmers will agree that the # particular flavour of bondage and discipline provided by StrictVersion # provides enough benefit to be worth using, and will submit their # version numbering scheme to its domination. The free-thinking # anarchists in the lot will never give in, though, and something needs # to be done to accommodate them. # # Perhaps a "moderately strict" version class could be implemented that # lets almost anything slide (syntactically), and makes some heuristic # assumptions about non-digits in version number strings. This could # sink into special-case-hell, though; if I was as talented and # idiosyncratic as Larry Wall, I'd go ahead and implement a class that # somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is # just as happy dealing with things like "2g6" and "1.13++". I don't # think I'm smart enough to do it right though. # # In any case, I've coded the test suite for this module (see # ../test/test_version.py) specifically to fail on things like comparing # "1.2a2" and "1.2". That's not because the *code* is doing anything # wrong, it's because the simple, obvious design doesn't match my # complicated, hairy expectations for real-world version numbers. It # would be a snap to fix the test suite to say, "Yep, LooseVersion does # the Right Thing" (ie. the code matches the conception). But I'd rather # have a conception that matches common notions about version numbers. class LooseVersion (Version): """Version numbering for anarchists and software realists. Implements the standard interface for version number classes as described above. A version number consists of a series of numbers, separated by either periods or strings of letters. When comparing version numbers, the numeric components will be compared numerically, and the alphabetic components lexically. The following are all valid version numbers, in no particular order: 1.5.1 1.5.2b2 161 3.10a 8.02 3.4j 1996.07.12 3.2.pl0 3.1.1.6 2g6 11g 0.960923 2.2beta29 1.13++ 5.5.kw 2.0b1pl0 In fact, there is no such thing as an invalid version number under this scheme; the rules for comparison are simple and predictable, but may not always give the results you want (for some definition of "want"). """ component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE) def __init__ (self, vstring=None): if vstring: self.parse(vstring) def parse (self, vstring): # I've given up on thinking I can reconstruct the version string # from the parsed tuple -- so I just store the string here for # use by __str__ self.vstring = vstring components = [x for x in self.component_re.split(vstring) if x and x != '.'] for i, obj in enumerate(components): try: components[i] = int(obj) except ValueError: pass self.version = components def __str__ (self): return self.vstring def __repr__ (self): return "LooseVersion ('%s')" % str(self) def _cmp (self, other): if isinstance(other, str): other = LooseVersion(other) elif not isinstance(other, LooseVersion): return NotImplemented if self.version == other.version: return 0 if self.version < other.version: return -1 if self.version > other.version: return 1 # end class LooseVersion PK!w11 _distutils/command/bdist_dumb.pynu["""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" import os from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import remove_tree, ensure_relative from distutils.errors import * from distutils.sysconfig import get_python_version from distutils import log class bdist_dumb(Command): description = "create a \"dumb\" built distribution" user_options = [('bdist-dir=', 'd', "temporary directory for creating the distribution"), ('plat-name=', 'p', "platform name to embed in generated filenames " "(default: %s)" % get_platform()), ('format=', 'f', "archive format to create (tar, gztar, bztar, xztar, " "ztar, zip)"), ('keep-temp', 'k', "keep the pseudo-installation tree around after " + "creating the distribution archive"), ('dist-dir=', 'd', "directory to put final built distributions in"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('relative', None, "build the archive using relative paths " "(default: false)"), ('owner=', 'u', "Owner name used when creating a tar file" " [default: current user]"), ('group=', 'g', "Group name used when creating a tar file" " [default: current group]"), ] boolean_options = ['keep-temp', 'skip-build', 'relative'] default_format = { 'posix': 'gztar', 'nt': 'zip' } def initialize_options(self): self.bdist_dir = None self.plat_name = None self.format = None self.keep_temp = 0 self.dist_dir = None self.skip_build = None self.relative = 0 self.owner = None self.group = None def finalize_options(self): if self.bdist_dir is None: bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'dumb') if self.format is None: try: self.format = self.default_format[os.name] except KeyError: raise DistutilsPlatformError( "don't know how to create dumb built distributions " "on platform %s" % os.name) self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'), ('plat_name', 'plat_name'), ('skip_build', 'skip_build')) def run(self): if not self.skip_build: self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.skip_build = self.skip_build install.warn_dir = 0 log.info("installing to %s", self.bdist_dir) self.run_command('install') # And make an archive relative to the root of the # pseudo-installation tree. archive_basename = "%s.%s" % (self.distribution.get_fullname(), self.plat_name) pseudoinstall_root = os.path.join(self.dist_dir, archive_basename) if not self.relative: archive_root = self.bdist_dir else: if (self.distribution.has_ext_modules() and (install.install_base != install.install_platbase)): raise DistutilsPlatformError( "can't make a dumb built distribution where " "base and platbase are different (%s, %s)" % (repr(install.install_base), repr(install.install_platbase))) else: archive_root = os.path.join(self.bdist_dir, ensure_relative(install.install_base)) # Make the archive filename = self.make_archive(pseudoinstall_root, self.format, root_dir=archive_root, owner=self.owner, group=self.group) if self.distribution.has_ext_modules(): pyversion = get_python_version() else: pyversion = 'any' self.distribution.dist_files.append(('bdist_dumb', pyversion, filename)) if not self.keep_temp: remove_tree(self.bdist_dir, dry_run=self.dry_run) PK!SOVNN'_distutils/command/_framework_compat.pynu[""" Backward compatibility for homebrew builds on macOS. """ import sys import os import functools import subprocess import sysconfig @functools.lru_cache() def enabled(): """ Only enabled for Python 3.9 framework homebrew builds except ensurepip and venv. """ PY39 = (3, 9) < sys.version_info < (3, 10) framework = sys.platform == 'darwin' and sys._framework homebrew = "Cellar" in sysconfig.get_config_var('projectbase') venv = sys.prefix != sys.base_prefix ensurepip = os.environ.get("ENSUREPIP_OPTIONS") return PY39 and framework and homebrew and not venv and not ensurepip schemes = dict( osx_framework_library=dict( stdlib='{installed_base}/{platlibdir}/python{py_version_short}', platstdlib='{platbase}/{platlibdir}/python{py_version_short}', purelib='{homebrew_prefix}/lib/python{py_version_short}/site-packages', platlib='{homebrew_prefix}/{platlibdir}/python{py_version_short}/site-packages', include='{installed_base}/include/python{py_version_short}{abiflags}', platinclude='{installed_platbase}/include/python{py_version_short}{abiflags}', scripts='{homebrew_prefix}/bin', data='{homebrew_prefix}', ) ) @functools.lru_cache() def vars(): if not enabled(): return {} homebrew_prefix = subprocess.check_output(['brew', '--prefix'], text=True).strip() return locals() def scheme(name): """ Override the selected scheme for posix_prefix. """ if not enabled() or not name.endswith('_prefix'): return name return 'osx_framework_library' PK!_distutils/command/build.pynu["""distutils.command.build Implements the Distutils 'build' command.""" import sys, os from distutils.core import Command from distutils.errors import DistutilsOptionError from distutils.util import get_platform def show_compilers(): from distutils.ccompiler import show_compilers show_compilers() class build(Command): description = "build everything needed to install" user_options = [ ('build-base=', 'b', "base directory for build library"), ('build-purelib=', None, "build directory for platform-neutral distributions"), ('build-platlib=', None, "build directory for platform-specific distributions"), ('build-lib=', None, "build directory for all distribution (defaults to either " + "build-purelib or build-platlib"), ('build-scripts=', None, "build directory for scripts"), ('build-temp=', 't', "temporary build directory"), ('plat-name=', 'p', "platform name to build for, if supported " "(default: %s)" % get_platform()), ('compiler=', 'c', "specify the compiler type"), ('parallel=', 'j', "number of parallel build jobs"), ('debug', 'g', "compile extensions and libraries with debugging information"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ('executable=', 'e', "specify final destination interpreter path (build.py)"), ] boolean_options = ['debug', 'force'] help_options = [ ('help-compiler', None, "list available compilers", show_compilers), ] def initialize_options(self): self.build_base = 'build' # these are decided only after 'build_base' has its final value # (unless overridden by the user or client) self.build_purelib = None self.build_platlib = None self.build_lib = None self.build_temp = None self.build_scripts = None self.compiler = None self.plat_name = None self.debug = None self.force = 0 self.executable = None self.parallel = None def finalize_options(self): if self.plat_name is None: self.plat_name = get_platform() else: # plat-name only supported for windows (other platforms are # supported via ./configure flags, if at all). Avoid misleading # other platforms. if os.name != 'nt': raise DistutilsOptionError( "--plat-name only supported on Windows (try " "using './configure --help' on your platform)") plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2]) # Make it so Python 2.x and Python 2.x with --with-pydebug don't # share the same build directories. Doing so confuses the build # process for C modules if hasattr(sys, 'gettotalrefcount'): plat_specifier += '-pydebug' # 'build_purelib' and 'build_platlib' just default to 'lib' and # 'lib.' under the base build directory. We only use one of # them for a given distribution, though -- if self.build_purelib is None: self.build_purelib = os.path.join(self.build_base, 'lib') if self.build_platlib is None: self.build_platlib = os.path.join(self.build_base, 'lib' + plat_specifier) # 'build_lib' is the actual directory that we will use for this # particular module distribution -- if user didn't supply it, pick # one of 'build_purelib' or 'build_platlib'. if self.build_lib is None: if self.distribution.has_ext_modules(): self.build_lib = self.build_platlib else: self.build_lib = self.build_purelib # 'build_temp' -- temporary directory for compiler turds, # "build/temp." if self.build_temp is None: self.build_temp = os.path.join(self.build_base, 'temp' + plat_specifier) if self.build_scripts is None: self.build_scripts = os.path.join(self.build_base, 'scripts-%d.%d' % sys.version_info[:2]) if self.executable is None and sys.executable: self.executable = os.path.normpath(sys.executable) if isinstance(self.parallel, str): try: self.parallel = int(self.parallel) except ValueError: raise DistutilsOptionError("parallel should be an integer") def run(self): # Run all relevant sub-commands. This will be some subset of: # - build_py - pure Python modules # - build_clib - standalone C libraries # - build_ext - Python extensions # - build_scripts - (Python) scripts for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) # -- Predicates for the sub-command list --------------------------- def has_pure_modules(self): return self.distribution.has_pure_modules() def has_c_libraries(self): return self.distribution.has_c_libraries() def has_ext_modules(self): return self.distribution.has_ext_modules() def has_scripts(self): return self.distribution.has_scripts() sub_commands = [('build_py', has_pure_modules), ('build_clib', has_c_libraries), ('build_ext', has_ext_modules), ('build_scripts', has_scripts), ] PK! !_distutils/command/install_lib.pynu["""distutils.command.install_lib Implements the Distutils 'install_lib' command (install all Python modules).""" import os import importlib.util import sys from distutils.core import Command from distutils.errors import DistutilsOptionError # Extension for Python source files. PYTHON_SOURCE_EXTENSION = ".py" class install_lib(Command): description = "install all Python modules (extensions and pure Python)" # The byte-compilation options are a tad confusing. Here are the # possible scenarios: # 1) no compilation at all (--no-compile --no-optimize) # 2) compile .pyc only (--compile --no-optimize; default) # 3) compile .pyc and "opt-1" .pyc (--compile --optimize) # 4) compile "opt-1" .pyc only (--no-compile --optimize) # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more) # 6) compile "opt-2" .pyc only (--no-compile --optimize-more) # # The UI for this is two options, 'compile' and 'optimize'. # 'compile' is strictly boolean, and only decides whether to # generate .pyc files. 'optimize' is three-way (0, 1, or 2), and # decides both whether to generate .pyc files and what level of # optimization to use. user_options = [ ('install-dir=', 'd', "directory to install to"), ('build-dir=','b', "build directory (where to install from)"), ('force', 'f', "force installation (overwrite existing files)"), ('compile', 'c', "compile .py to .pyc [default]"), ('no-compile', None, "don't compile .py files"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('skip-build', None, "skip the build steps"), ] boolean_options = ['force', 'compile', 'skip-build'] negative_opt = {'no-compile' : 'compile'} def initialize_options(self): # let the 'install' command dictate our installation directory self.install_dir = None self.build_dir = None self.force = 0 self.compile = None self.optimize = None self.skip_build = None def finalize_options(self): # Get all the information we need to install pure Python modules # from the umbrella 'install' command -- build (source) directory, # install (target) directory, and whether to compile .py files. self.set_undefined_options('install', ('build_lib', 'build_dir'), ('install_lib', 'install_dir'), ('force', 'force'), ('compile', 'compile'), ('optimize', 'optimize'), ('skip_build', 'skip_build'), ) if self.compile is None: self.compile = True if self.optimize is None: self.optimize = False if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) if self.optimize not in (0, 1, 2): raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") def run(self): # Make sure we have built everything we need first self.build() # Install everything: simply dump the entire contents of the build # directory to the installation directory (that's the beauty of # having a build directory!) outfiles = self.install() # (Optionally) compile .py to .pyc if outfiles is not None and self.distribution.has_pure_modules(): self.byte_compile(outfiles) # -- Top-level worker functions ------------------------------------ # (called from 'run()') def build(self): if not self.skip_build: if self.distribution.has_pure_modules(): self.run_command('build_py') if self.distribution.has_ext_modules(): self.run_command('build_ext') def install(self): if os.path.isdir(self.build_dir): outfiles = self.copy_tree(self.build_dir, self.install_dir) else: self.warn("'%s' does not exist -- no Python modules to install" % self.build_dir) return return outfiles def byte_compile(self, files): if sys.dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile # Get the "--root" directory supplied to the "install" command, # and use it as a prefix to strip off the purported filename # encoded in bytecode files. This is far from complete, but it # should at least generate usable bytecode in RPM distributions. install_root = self.get_finalized_command('install').root if self.compile: byte_compile(files, optimize=0, force=self.force, prefix=install_root, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, force=self.force, prefix=install_root, verbose=self.verbose, dry_run=self.dry_run) # -- Utility methods ----------------------------------------------- def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir): if not has_any: return [] build_cmd = self.get_finalized_command(build_cmd) build_files = build_cmd.get_outputs() build_dir = getattr(build_cmd, cmd_option) prefix_len = len(build_dir) + len(os.sep) outputs = [] for file in build_files: outputs.append(os.path.join(output_dir, file[prefix_len:])) return outputs def _bytecode_filenames(self, py_filenames): bytecode_files = [] for py_file in py_filenames: # Since build_py handles package data installation, the # list of outputs can contain more than just .py files. # Make sure we only report bytecode for the .py files. ext = os.path.splitext(os.path.normcase(py_file))[1] if ext != PYTHON_SOURCE_EXTENSION: continue if self.compile: bytecode_files.append(importlib.util.cache_from_source( py_file, optimization='')) if self.optimize > 0: bytecode_files.append(importlib.util.cache_from_source( py_file, optimization=self.optimize)) return bytecode_files # -- External interface -------------------------------------------- # (called by outsiders) def get_outputs(self): """Return the list of files that would be installed if this command were actually run. Not affected by the "dry-run" flag or whether modules have actually been built yet. """ pure_outputs = \ self._mutate_outputs(self.distribution.has_pure_modules(), 'build_py', 'build_lib', self.install_dir) if self.compile: bytecode_outputs = self._bytecode_filenames(pure_outputs) else: bytecode_outputs = [] ext_outputs = \ self._mutate_outputs(self.distribution.has_ext_modules(), 'build_ext', 'build_lib', self.install_dir) return pure_outputs + bytecode_outputs + ext_outputs def get_inputs(self): """Get the list of files that are input to this command, ie. the files that get installed as they are named in the build tree. The files in this list correspond one-to-one to the output filenames returned by 'get_outputs()'. """ inputs = [] if self.distribution.has_pure_modules(): build_py = self.get_finalized_command('build_py') inputs.extend(build_py.get_outputs()) if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') inputs.extend(build_ext.get_outputs()) return inputs PK!--_distutils/command/register.pynu["""distutils.command.register Implements the Distutils 'register' command (register with the repository). """ # created 2002/10/21, Richard Jones import getpass import io import urllib.parse, urllib.request from warnings import warn from distutils.core import PyPIRCCommand from distutils.errors import * from distutils import log class register(PyPIRCCommand): description = ("register the distribution with the Python package index") user_options = PyPIRCCommand.user_options + [ ('list-classifiers', None, 'list the valid Trove classifiers'), ('strict', None , 'Will stop the registering if the meta-data are not fully compliant') ] boolean_options = PyPIRCCommand.boolean_options + [ 'verify', 'list-classifiers', 'strict'] sub_commands = [('check', lambda self: True)] def initialize_options(self): PyPIRCCommand.initialize_options(self) self.list_classifiers = 0 self.strict = 0 def finalize_options(self): PyPIRCCommand.finalize_options(self) # setting options for the `check` subcommand check_options = {'strict': ('register', self.strict), 'restructuredtext': ('register', 1)} self.distribution.command_options['check'] = check_options def run(self): self.finalize_options() self._set_config() # Run sub commands for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) if self.dry_run: self.verify_metadata() elif self.list_classifiers: self.classifiers() else: self.send_metadata() def check_metadata(self): """Deprecated API.""" warn("distutils.command.register.check_metadata is deprecated, \ use the check command instead", PendingDeprecationWarning) check = self.distribution.get_command_obj('check') check.ensure_finalized() check.strict = self.strict check.restructuredtext = 1 check.run() def _set_config(self): ''' Reads the configuration file and set attributes. ''' config = self._read_pypirc() if config != {}: self.username = config['username'] self.password = config['password'] self.repository = config['repository'] self.realm = config['realm'] self.has_config = True else: if self.repository not in ('pypi', self.DEFAULT_REPOSITORY): raise ValueError('%s not found in .pypirc' % self.repository) if self.repository == 'pypi': self.repository = self.DEFAULT_REPOSITORY self.has_config = False def classifiers(self): ''' Fetch the list of classifiers from the server. ''' url = self.repository+'?:action=list_classifiers' response = urllib.request.urlopen(url) log.info(self._read_pypi_response(response)) def verify_metadata(self): ''' Send the metadata to the package index server to be checked. ''' # send the info to the server and report the result (code, result) = self.post_to_server(self.build_post_data('verify')) log.info('Server response (%s): %s', code, result) def send_metadata(self): ''' Send the metadata to the package index server. Well, do the following: 1. figure who the user is, and then 2. send the data as a Basic auth'ed POST. First we try to read the username/password from $HOME/.pypirc, which is a ConfigParser-formatted file with a section [distutils] containing username and password entries (both in clear text). Eg: [distutils] index-servers = pypi [pypi] username: fred password: sekrit Otherwise, to figure who the user is, we offer the user three choices: 1. use existing login, 2. register as a new user, or 3. set the password to a random string and email the user. ''' # see if we can short-cut and get the username/password from the # config if self.has_config: choice = '1' username = self.username password = self.password else: choice = 'x' username = password = '' # get the user's login info choices = '1 2 3 4'.split() while choice not in choices: self.announce('''\ We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit Your selection [default 1]: ''', log.INFO) choice = input() if not choice: choice = '1' elif choice not in choices: print('Please choose one of the four options!') if choice == '1': # get the username and password while not username: username = input('Username: ') while not password: password = getpass.getpass('Password: ') # set up the authentication auth = urllib.request.HTTPPasswordMgr() host = urllib.parse.urlparse(self.repository)[1] auth.add_password(self.realm, host, username, password) # send the info to the server and report the result code, result = self.post_to_server(self.build_post_data('submit'), auth) self.announce('Server response (%s): %s' % (code, result), log.INFO) # possibly save the login if code == 200: if self.has_config: # sharing the password in the distribution instance # so the upload command can reuse it self.distribution.password = password else: self.announce(('I can store your PyPI login so future ' 'submissions will be faster.'), log.INFO) self.announce('(the login will be stored in %s)' % \ self._get_rc_file(), log.INFO) choice = 'X' while choice.lower() not in 'yn': choice = input('Save your login (y/N)?') if not choice: choice = 'n' if choice.lower() == 'y': self._store_pypirc(username, password) elif choice == '2': data = {':action': 'user'} data['name'] = data['password'] = data['email'] = '' data['confirm'] = None while not data['name']: data['name'] = input('Username: ') while data['password'] != data['confirm']: while not data['password']: data['password'] = getpass.getpass('Password: ') while not data['confirm']: data['confirm'] = getpass.getpass(' Confirm: ') if data['password'] != data['confirm']: data['password'] = '' data['confirm'] = None print("Password and confirm don't match!") while not data['email']: data['email'] = input(' EMail: ') code, result = self.post_to_server(data) if code != 200: log.info('Server response (%s): %s', code, result) else: log.info('You will receive an email shortly.') log.info(('Follow the instructions in it to ' 'complete registration.')) elif choice == '3': data = {':action': 'password_reset'} data['email'] = '' while not data['email']: data['email'] = input('Your email address: ') code, result = self.post_to_server(data) log.info('Server response (%s): %s', code, result) def build_post_data(self, action): # figure the data to send - the metadata plus some additional # information used by the package server meta = self.distribution.metadata data = { ':action': action, 'metadata_version' : '1.0', 'name': meta.get_name(), 'version': meta.get_version(), 'summary': meta.get_description(), 'home_page': meta.get_url(), 'author': meta.get_contact(), 'author_email': meta.get_contact_email(), 'license': meta.get_licence(), 'description': meta.get_long_description(), 'keywords': meta.get_keywords(), 'platform': meta.get_platforms(), 'classifiers': meta.get_classifiers(), 'download_url': meta.get_download_url(), # PEP 314 'provides': meta.get_provides(), 'requires': meta.get_requires(), 'obsoletes': meta.get_obsoletes(), } if data['provides'] or data['requires'] or data['obsoletes']: data['metadata_version'] = '1.1' return data def post_to_server(self, data, auth=None): ''' Post a query to the server, and return a string response. ''' if 'name' in data: self.announce('Registering %s to %s' % (data['name'], self.repository), log.INFO) # Build up the MIME payload for the urllib2 POST data boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = '\n--' + boundary end_boundary = sep_boundary + '--' body = io.StringIO() for key, value in data.items(): # handle multiple entries for the same name if type(value) not in (type([]), type( () )): value = [value] for value in value: value = str(value) body.write(sep_boundary) body.write('\nContent-Disposition: form-data; name="%s"'%key) body.write("\n\n") body.write(value) if value and value[-1] == '\r': body.write('\n') # write an extra newline (lurve Macs) body.write(end_boundary) body.write("\n") body = body.getvalue().encode("utf-8") # build the Request headers = { 'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary, 'Content-length': str(len(body)) } req = urllib.request.Request(self.repository, body, headers) # handle HTTP and include the Basic Auth handler opener = urllib.request.build_opener( urllib.request.HTTPBasicAuthHandler(password_mgr=auth) ) data = '' try: result = opener.open(req) except urllib.error.HTTPError as e: if self.show_response: data = e.fp.read() result = e.code, e.msg except urllib.error.URLError as e: result = 500, str(e) else: if self.show_response: data = self._read_pypi_response(result) result = 200, 'OK' if self.show_response: msg = '\n'.join(('-' * 75, data, '-' * 75)) self.announce(msg, log.INFO) return result PK!_IƂvv8_distutils/command/__pycache__/build_ext.cpython-311.pycnu[ ,Re{dZddlZddlZddlZddlZddlmZddlmZm Z m Z m Z m Z m Z ddlmZmZddlmZddlmZdd lmZdd lmZdd lmZd d lmZddlmZejdZdZ GddeZ!dS)zdistutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).N)Command)DistutilsOptionErrorDistutilsSetupErrorCCompilerErrorDistutilsError CompileErrorDistutilsPlatformError)customize_compilerget_python_version)get_config_h_filename) newer_group) Extension) get_platform)log) py37compat) USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$c&ddlm}|dS)Nrshow_compilers) ccompilerrrs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.pyrr#s(******Nc eZdZdZdejzZdddddezfdd d d ezfd d ddddezfddddddddddgZgdZ ddde fgZ d Z d!Z d"Zd#Zd$Zd%Zd&Zd'Zd(Zejd)Zd*Zd+Zd,Zd-Zd.Zd/Zd0Zd1ZdS)2 build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z build-lib=bz(directory for compiled extension modules)z build-temp=tz1directory for temporary files (build by-products)z plat-name=pz>platform name to cross-compile for, if supported (default: %s))inplaceiziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z libraries=lz!external C libraries to link withz library-dirs=Lz.directories to search for external C libraries)zrpath=Rz7directories to search for shared C libraries at runtime)z link-objects=Oz2extra explicit link objects to include in the link)debuggz'compile/link with debugging information)forcefz2forcibly build everything (ignore file timestamps))z compiler=czspecify the compiler type)z parallel=jznumber of parallel build jobs)swig-cppNz)make SWIG create C++ files (default is C))z swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)userNz#add user include, library and rpath)r r)r+r/r0z help-compilerNzlist available compilersc,d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_d|_d|_dS)Nr) extensions build_lib plat_name build_tempr package include_dirsdefineundef libraries library_dirsrpath link_objectsr)r+compilerswigswig_cpp swig_optsr0parallelselfs rinitialize_optionszbuild_ext.initialize_optionsns               rc Nddlm}|ddddddd d |j|jj|_|jj|_|}|d }|j |jj pg|_ t|j tr)|j tj|_ tjtjkrB|j tjtjd |j | tjj||kr<|j | tjj|d|d|jg|_|jg|_nCt|jtr)|j tj|_|jg|_nCt|jtr)|j tj|_tjdkr|jtjtjdtjtjkrB|jtjtjd|jr+tj|jd|_n*tj|jd|_|j tjt?|jtj|j dkrd}n|j dd}tjtjd}|r tj||}|j|tj!dddkru|j"sT|jtjtjddtGzdn|jd|$drO|j"s.|j|$dn|jd|j%r+|j% d}d |D|_%|j&r|j& d|_&|j'g|_'n|j' d!|_'|j(rtjtRd }tjtRd}tj*|r|j |tj*|r4|j||j|t|j+tr9 tY|j+|_+dS#tZ$rt]d"wxYwdS)#Nr) sysconfigbuild)r3r3)r5r5)r>r>)r)r))r+r+)rBrB)r4r4r) plat_specificincluder:r=ntlibsDebugReleasewin32PCbuildcygwinlibpythonconfig.Py_ENABLE_SHAREDLIBDIR,cg|]}|dfS)1).0symbols r z.build_ext.finalize_options..s???VFC=???r zparallel should be an integer)/ distutilsrGset_undefined_optionsr6 distribution ext_package ext_modulesr2get_python_incr7 isinstancestrsplitospathsepsys exec_prefixbase_exec_prefixappendpathjoinextendensure_string_listr:r;r<nameprefixr)r5dirnamer r4platform python_buildr get_config_varr8r9rAr0risdirrBint ValueErrorr) rDrG py_includeplat_py_includesuffixnew_libdefines user_includeuser_libs rfinalize_optionszbuild_ext.finalize_optionss'''''' ""  & ( $   $ &  < ,8DL+7--// #222CC   $ $ 1 > D"D  d' - - D $ 1 7 7 C CD  ?c2 2 2   $ $RW\\#/9%M%M N N N   !1!1"'/!B!BCCC j ( (   $ $_%:%:27?%K%K L L L  ,,, /// > !DN   $ "D   )3 / / D $ 1 7 7 C CD  : DJJ  C ( ( 6))"*55DJ 7d??   $ $RW\\#/6%J%J K K K#sz11!((c6JF)S)STTTz K"$',,t"H"H"$',,t "J"J   $ $RW__5J5L5L%M%M N N N   $ $S%9 : : :~(( +gll3?I>>G 8',,w77   $ $W - - - < x ' ') .!((GLL E86H6J6J+JH!((---  # #$6 7 7 .) .!(()A)A()K)KLLLL!((--- ; @k'',,G??w???DK : /))#..DJ > !DNN!^11#66DN 9 ,7<< 9==Lw||Iu55Hw}}\** 7!((666w}}X&& ,!((222 !!(+++ dmS ) ) L L #DM 2 2  L L L*+JKKK L L Ls -\\"cvddlm}|jsdS|jrb|d}|j|pg|j |j ||j |j |j|j|_ t!|j t"jdkr6|jt)kr|j |j|j|j |j|j(|jD] \}}|j ||!|j$|jD]}|j ||j|j |j|j |j |j |j|j |j|j |j !|j |"dS)Nr) new_compiler build_clib)r>verbosedry_runr+rK)#rrr2rdhas_c_librariesget_finalized_commandr:rsget_library_namesr;rprr>rrr+r rkrur4r initializer7set_include_dirsr8 define_macror9undefine_macro set_librariesset_library_dirsr<set_runtime_library_dirsr=set_link_objectsbuild_extensions)rDrrruvaluemacros rrunz build_ext.runs3,,,,,,  F   , , . . <33LAAJ N ! !*">">"@"@"FB G G G   $ $Z%: ; ; ;% ]LL*     4=))) 7d??t~?? M $ $T^ 4 4 4   ( M * *4+< = = = ; "!% 8 8 u **47777 : ! 4 4 ,,U3333 > % M ' ' 7 7 7   ( M * *4+< = = = : ! M 2 24: > > >   ( M * *4+< = = = rct|tstdt|D] \}}t|trt|t rt |dkrtd|\}}tjd|t|trt |stdt|tstdt ||d}dD]*}| |}|t|||+| d |_d |vrtjd | d }|rg|_g|_|D]} t| t rt | dvstdt | dkr!|j| dkt | dkr|j| |||< d S)aEnsure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, where the tuples are (ext_name, build_info), which are converted to Extension instances here. Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. z:'ext_modules' option must be a list of Extension instancesrzMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sources)r7r;r: extra_objectsextra_compile_argsextra_link_argsNr<def_filez9'def_file' element of build info dict no longer supportedmacros)rrz9'macros' element of build info dict must be 1- or 2-tuplerr)rhlistr enumeratertuplelenrwarningriextension_name_rematchdictgetsetattrruntime_library_dirs define_macros undef_macrosrp) rDr2r!extext_name build_infokeyvalrrs rcheck_extensions_listzbuild_ext.check_extensions_list\s*d++ %L  ++J J FAs#y)) c5)) SXX]])4 $' Hj K:    x-- 2C2I2I(2S2S )< j$// )8Hj&;<'>C $Z'' R  ^^H--F 8$&!#% # 8 8E&ue44Uv9M9M145zzQ(//a9999Uq)00777JqMMUJ J rc||jg}|jD]}||j|SN)rr2rsr)rD filenamesrs rget_source_fileszbuild_ext.get_source_filessO ""4?333 ? * *C   S[ ) ) ) )rc||jg}|jD]/}|||j0|Sr)rr2rpget_ext_fullpathru)rDoutputsrs r get_outputszbuild_ext.get_outputss\ ""4?333 ? < .s7?B 4c::r) rBrk cpu_countconcurrent.futuresr ImportErrorrr2zip_filter_build_errorsresult)rDworkersrfuturesrfutrs` @rrz$build_ext._build_extensions_parallels- =D lnnG  = = = = = = =   GGG  ?  ) ) + + + F  G 4 4 4 !FJoG 99 ! !S..s33!!JJLLL!!!!!!!!!!!!!!! !  ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sC. ==$AC#(C = C# C C#C C##C'*C'c|jD]D}||5||dddn #1swxYwYEdSr)r2rr)rDrs rrz"build_ext._build_extensions_serials? * *C**3// * *$$S))) * * * * * * * * * * * * * * * * *sAA A c#K dVdS#tttf$rA}|js|d|j|Yd}~dSd}~wwxYw)Nz"building extension "{}" failed: {})rrr optionalwarnformatru)rDres rrzbuild_ext._filter_build_errorss P EEEEE = P P P<  II:AA#(ANN O O O O O O O O O Ps A"6AA"c |j}|t|ttfst d|jzt |}||j}||jz}|j s-t||dstj d|jdStj d|j|||}|jpg}|jdd}|jD]}||f|j||j||j|j ||j}|dd|_|jr||j|jpg}|jp|j|} |j|||||j|j ||!||j |j|  dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension) output_dirrr7r)extra_postargsdepends)r:r;rrexport_symbolsr)r5 target_lang)"rrhrrrrusortedrrr+rrr)info swig_sourcesrrrrpr>compiler5r7_built_objectsrrsrlanguagedetect_languagelink_shared_object get_librariesr;rget_export_symbols) rDrrext_pathr extra_argsrr9objectsrs rrzbuild_ext.build_extensions!+ ?*WtUm"D"D?%-/2x8  //((22CK'  :k'8WEE : IJ#>???##F+++'22 V$$""6****  y,DNN,,)$''' = $ OOF # # #~ #( # #""""" : :F!&)F H(&& 9 9 9 JJx4"88 9 9 9 9rctjdkrdStjdkrMdD]H}tjd|zd}tj|r|cSIdSt dtjz)zReturn the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows. posixr?rK)z1.3z1.2z1.1z c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s')rkrurqrrisfiler )rDversfns rrzbuild_ext.find_swigs 7g  6 W__. " "W\\,"5zBB7>>"%%III"z(#%'W- rc*||}|d}||d}|jsDt jj|dd|gz}tj|j|Sd|dd}|d}tj | |}tj||S)zReturns the path of the filename for a given extension. The file is located in `build_lib` or directly in the package (inplace option). rWrNrbuild_py) get_ext_fullnamerjget_ext_filenamer rkrqrrr3rabspathget_package_dir)rDrfullnamemodpathfilenamer6r package_dirs rrzbuild_ext.get_ext_fullpaths ((22..%%((55| :w|WSbS\XJ%>?H7<<99 9((71R4=))--j99gooh&>&>w&G&GHH w||K222rc.|j|S|jdz|zS)zSReturns the fullname of a given extension name. Adds the `package.` prefixNrW)r6)rDrs rrzbuild_ext.get_ext_fullnames# < O<#%0 0rczddlm}|d}|d}tjj||zS)zConvert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd"). rrzrW EXT_SUFFIX)rGrzrjrkrqrr)rDrrzr ext_suffixs rrzbuild_ext.get_ext_filenamesJ /.....>>#&&#^L11 w|X&33rcv|jdd} |dd|z}nO#t$rBd|ddddz}YnwxYwd |z}||jvr|j||jS) aReturn the list of symbols that a shared extension has to export. This either uses 'ext.export_symbols' or, if it's not provided, "PyInit_" + module_name. Only relevant on Windows, where the .pyd file (DLL) must export the module "PyInit_" function. rWrascii_U_punycode-_PyInit)rurjencodeUnicodeEncodeErrorreplacedecoderrp)rDrrur initfunc_names rrzbuild_ext.get_export_symbolss x~~c""2&  KK 4ZFF" X X XDKK 33;;D$GGNNwWWWFFF X !6)  2 2 2   % %m 4 4 4!!s=A B B ctjdkrYddlm}t |j|s=d}|jr|dz}|tjdz tjdz dzfz}|j|gzSndd l m }d }|d r\ttd rd }nDtjdkrd }n1dtj vr#|ddkrd }n|ddkrd }|r|d}|jd|zgzS|jtjzS)zReturn the list of libraries to link against when building a shared extension. On most platforms, this is just 'ext.libraries'; on Windows, we add the Python library (eg. python20.dll). rOr) MSVCCompilerz python%d%d_dr FrXgetandroidapilevelTrS_PYTHON_HOST_PLATFORMANDROID_API_LEVELrMACHDEP LDVERSIONrU)rmrx _msvccompilerrrhr>r) hexversionr:rGrzhasattrrkenvironr pythonlib)rDrrtemplater(rzlink_libpython ldversions rrzbuild_ext.get_librariessm <7 " " 4 4 4 4 4 4dm\:: 3':/'$H$Nb(^r)T1( } {22 3( 3 2 2 2 2 2"N~011 .3 455 .%)NN\X--%)NN, ::%~&9::a??)-' 22h>>)- >*N;77 }9(<'===}z35555r) __name__ __module__ __qualname__ descriptionrkrlsep_byr user_optionsboolean_optionsr help_optionsrErrrrrrrr contextlibcontextmanagerrrrrrrrrrr]rrrr)sLK($bj 0FGQ   *lnn -     r?s  ?>>>>>>>------""""""!!!!!!BJUVV l 6l 6l 6l 6l 6l 6l 6l 6l 6l 6rPK!rg[ 4_distutils/command/__pycache__/clean.cpython-311.pycnu[ ,Re# RdZddlZddlmZddlmZddlmZGddeZdS) zBdistutils.command.clean Implements the Distutils 'clean' command.N)Command) remove_tree)logc2eZdZdZgdZdgZdZdZdZdS)cleanz-clean up temporary files from 'build' command))z build-base=bz2base build directory (default: 'build.build-base'))z build-lib=Nz>$/ * * P  > > > > > I=t O O O 8 T"ndot?QR T T 7>>),,T 4<@@@@@K GSSSS|  )))$/:::::       s 3D DDN) __name__ __module__ __qualname__ description user_optionsboolean_optionsrrr(rrrr scAKL"gOJJJrr) __doc__rcorerdir_utilrdistutils._logrrr/rrr4s--  """"""?????G?????rPK! >_distutils/command/__pycache__/install_scripts.cpython-311.pycnu[ ,ReRdZddlZddlmZddlmZddlmZGddeZdS) zudistutils.command.install_scripts Implements the Distutils 'install_scripts' command, for installing Python scripts.N)Command)log)ST_MODEc@eZdZdZgdZddgZdZdZdZdZ d Z d S) install_scriptsz%install scripts (Python or otherwise)))z install-dir=dzdirectory to install scripts to)z build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files)) skip-buildNzskip the build stepsr r c>d|_d|_d|_d|_dS)Nr) install_dirr build_dir skip_buildselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/install_scripts.pyinitialize_optionsz"install_scripts.initialize_optionss# cb|dd|dddddS)Nbuild) build_scriptsrinstall)rr)r r )rr)set_undefined_optionsrs rfinalize_optionsz install_scripts.finalize_options!sG ""7,JKKK ""  .  (      rc|js|d||j|j|_t jdkr|D]q}|j rtj d|t j |tdzdz}tj d||t j||pdSdS)Nrposixzchanging mode of %simizchanging mode of %s to %o)r run_command copy_treerroutfilesosname get_outputsdry_runrinfostatrchmod)rfilemodes rrunzinstall_scripts.run*s .   _ - - -t~t7GHH 7g  ((** ) )<)H2D9999WT]]73u<FDH8$EEEHT4((((   ) )rc|jjpgSN) distributionscriptsrs r get_inputszinstall_scripts.get_inputs9s (.B.rc|jpgSr-)r!rs rr$zinstall_scripts.get_outputs<s}""rN) __name__ __module__ __qualname__ description user_optionsboolean_optionsrrr+r0r$rrrrs9KL -O     ) ) )///#####rr) __doc__r"corerdistutils._logrr'rrr8rrr<s /#/#/#/#/#g/#/#/#/#/#rPK!!Jxg((5_distutils/command/__pycache__/upload.cpython-311.pycnu[ ,ReDdZddlZddlZddlZddlZddlmZddlmZm Z m Z ddl m Z ddl mZmZddlmZdd lmZeed deed deed dd ZGddeZdS)zm distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to a package index). N)standard_b64encode)urlopenRequest HTTPError)urlparse)DistutilsErrorDistutilsOptionError) PyPIRCCommand)spawnmd5sha256blake2b) md5_digest sha256_digestblake2_256_digestcXeZdZdZejddgzZejdgzZdZdZdZ dZ d S) uploadzupload binary package to PyPI)signszsign files to upload using gpg)z identity=izGPG identity used to sign filesrcttj|d|_d|_d|_d|_d|_dS)NrF)r initialize_optionsusernamepassword show_responseridentity)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/upload.pyrzupload.initialize_options(s;(...    cTtj||jr|jst d|}|ikr4|d|_|d|_|d|_|d|_ |js|j jr|j j|_dSdSdS)Nz.Must use --sign for --identity to have meaningrr repositoryrealm) r finalize_optionsrrr _read_pypircrrr#r$ distribution)rconfigs r r%zupload.finalize_options0s&t,,, = Y Y&'WXX X""$$ R<<":.DM":.DM$\2DODJ} 7!2!; 7 -6DMMM 7 7 7 7r!c|jjsd}t||jjD]\}}}||||dS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))r' dist_filesr upload_file)rmsgcommand pyversionfilenames r runz upload.run@sk + ,/ 's++ +,0,=,H ; ; (GY   Wi : : : : ; ;r!c t|j\}}}}}} |s|s| rtd|jz|dvrtd|z|jr1ddd|g} |jrd|jg| dd<t | |j t|d } | } | n#| wxYw|j j } id d d dd| d| dtj|| fd|d|ddd| d| d| d| d| d| d| d| d| | | | | d}d |d!<t<D]9\}}| ||  ||<*#tB$rY6wxYw|jrdt|d"zd 5} tj|d"z| f|d#<dddn #1swxYwY|j"d$z|j#z$d%}d&tK|&d%z}d'}d(|$d%z}|d)z}tOj(}|D]\}}d*|z}tS|tTs|g}|D]}tW|tXur|d+|d,zz }|d-}n"t[|$d.}|.||.|$d.|.d/|.||.||/}d00||j}|1|tdj3d1|zt[ti||d2}tk|j||3} tm|}|7}|j8}n`#tr$r} | j:}| j8}Yd} ~ nCd} ~ wtv$r3} |1t[| tdj<d} ~ wwxYw|d4kr|1d50||tdj3|j=rO|>|}!d6?d7|!d7f}|1|tdj3dSdSd80||}|1|tdj<t|)9NzIncompatible url %s)httphttpszunsupported schema gpgz --detach-signz-az --local-userr)dry_runrbz:action file_uploadprotocol_version1nameversioncontentfiletyper.metadata_versionz1.0summary home_pageauthor author_emaillicense descriptionkeywordsplatform classifiers) download_urlprovidesrequires obsoletesrcommentz.asc gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s-- z+ Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s zSubmitting {} to {}z multipart/form-data; boundary=%s)z Content-typezContent-length Authorization)dataheaderszServer response ({}): {} zK---------------------------------------------------------------------------zUpload failed ({}): {})Arr#AssertionErrorrrr r5openreadcloser'metadataget_name get_versionospathbasenameget_descriptionget_url get_contactget_contact_email get_licenceget_long_description get_keywords get_platformsget_classifiersget_download_url get_provides get_requires get_obsoletes_FILE_CONTENT_DIGESTSitems hexdigest ValueErrorrrencoderdecodeioBytesIO isinstancelisttypetuplestrwritegetvalueformatannounceloggingINFOlenrrgetcoder,rcodeOSErrorERRORr_read_pypi_responsejoinr )"rr-r.r/schemanetlocurlparamsquery fragmentsgpg_argsfr<metarR digest_name digest_cons user_passauthboundary sep_boundary end_boundarybodykeyvaluetitler,rSrequestresultstatusreasonetexts" r r+zupload.upload_fileJsG8@8Q8Q5VUI  JU Ji J !6!HII I * * * !6!?@@ @ 9 2h?H} @!/ ?1 (DL 1 1 1 1 4  ffhhG GGIIIIAGGIIII ) }   DMMOO  t''))   ((22G<        t++--    d&&(( D2244! " t''))# $ 44466% & ))++' ( **,,) * 4//11+ ,!1133))++))++++--5   :Y)>(C(C(E(E   $K" $/K$8$8$B$B$D$D[!!     9 Xh'.. X!)+)9)9()C)Cf)Laffhh(W_% X X X X X X X X X X X X X X X]S(4=8@@II ,Y77>>wGGGI 8??7#;#;; #i/ z||**,, " "JCCcIEeT**  " ";;%''.q99E!!HEEJJ--g66E <((( 5<<00111 ;''' 5!!!! " <   }}#**8T_EE c7<(((?I!#d))nn!   $/gFFF W%%F^^%%FZFF   VFUFFFFFF    MM#a&&'- 0 0 0   S== MM*11&&AA7<   ! 1//77ii4 :;; c7<00000 1 1 +11&&AAC MM#w} - - - %% %sTCC6 J J$#J$:LL L *U V'U'' V'4.V""V'N) __name__ __module__ __qualname__rDr user_optionsboolean_optionsrr%r0r+r!r rrs1K -7=1L $3vh>O777 ;;;E&E&E&E&E&r!r)__doc__r]rshashlibr~base64rurllib.requestrrr urllib.parsererrorsr r corer r getattrrmrrr!r rs3 %%%%%%6666666666!!!!!!99999999  ''5$//WWh55 )T::r&r&r&r&r&]r&r&r&r&r&r!PK!S  @_distutils/command/__pycache__/_framework_compat.cpython-311.pycnu[ ,ReN dZddlZddlZddlZddlZddlZejdZeedddddd d d  Z ejdZ dZ dS)z6 Backward compatibility for homebrew builds on macOS. Nc$dtjcxkodknc}tjdko tj}dt jdv}tjtjk}tj d}|o |o|o| o| S)z^ Only enabled for Python 3.9 framework homebrew builds except ensurepip and venv. ) )r darwinCellar projectbaseENSUREPIP_OPTIONS) sys version_infoplatform _framework sysconfigget_config_varprefix base_prefixosenvironget)PY39 frameworkhomebrewvenv ensurepips /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/_framework_compat.pyenabledr s C$ . . . .w . . . .D (;S^I93MBBBH : (D 233I  II I( I4x I MIz6{installed_base}/{platlibdir}/python{py_version_short}z0{platbase}/{platlibdir}/python{py_version_short}z<{homebrew_prefix}/lib/python{py_version_short}/site-packageszE{homebrew_prefix}/{platlibdir}/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z{homebrew_prefix}/binz{homebrew_prefix})stdlib platstdlibpurelibplatlibinclude platincludescriptsdata)osx_framework_libraryctsiStjddgd}t S)Nbrewz--prefixT)text)r subprocess check_outputstriplocals)homebrew_prefixs rvarsr/)sB 99  -vz.BNNNTTVVO 88OrcPtr|ds|SdS)z8 Override the selected scheme for posix_prefix. _prefixr&)rendswith)names rschemer41s. 99DMM)44 " "r) __doc__r r functoolsr*r lru_cacherdictschemesr/r4rrr;s   J J J $$GENWMU'       #####rPK!rr6_distutils/command/__pycache__/install.cpython-311.pycnu[ ,Reu dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddlm Z ddl mZdd lmZmZmZdd lmZdd lmZmZd d lmZddlmZddlmZddlmZdZddddddZddddddddddddeddddddddddddd Z erd!d!d"d#d$de d%<d!d!d&d'd$de d(<e !ej"dZ#d)Z$d*Z%d+Z&d,Z'd-Z(d.Z)d/Z*d0Z+d1Z,d2Z-Gd3d4e Z.dS)5zFdistutils.command.install Implements the Distutils 'install' command.N)log)Command)DEBUG)get_config_vars) write_file) convert_path subst_vars change_root) get_platform)DistutilsOptionErrorDistutilsPlatformError)_framework_compat) _collections) USER_BASE) USER_SITETz{base}/Lib/site-packagesz{base}/Include/{dist_name}z{base}/Scriptsz{base})purelibplatlibheadersscriptsdatazA{base}/lib/{implementation_lower}{py_version_short}/site-packageszN{platbase}/{platlibdir}/{implementation_lower}{py_version_short}/site-packageszM{base}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z {base}/binz!{base}/lib/{implementation_lower}z*{base}/{platlibdir}/{implementation_lower}z1{base}/include/{implementation_lower}/{dist_name}z{base}/site-packagesz{base}/include/{dist_name}) posix_prefix posix_homentpypypypy_ntz {usersite}zF{userbase}/{implementation}{py_version_nodot_plat}/Include/{dist_name}z:{userbase}/{implementation}{py_version_nodot_plat}/Scriptsz {userbase}nt_userzQ{userbase}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z{userbase}/bin posix_userctjt5dtjDcdddS#1swxYwYdS)Nc<i|]}|tj|dS)F)expand) sysconfig get_paths).0schemes /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/install.py z+_load_sysconfig_schemes..es:    I'u===   ) contextlibsuppressAttributeErrorr#get_scheme_namesr)r'_load_sysconfig_schemesr/cs  ^ , ,    #466                     sAA ActpifdttjtDS)z= Extend default schemes with schemes from sysconfig. cxi|]6}|it|i|i7Sr.)INSTALL_SCHEMESget)r%r&sysconfig_schemess r'r(z!_load_schemes..rs`      !!&"-- ##FB//    r))r/set itertoolschainr2)r4s@r' _load_schemesr8ksX 0117R     )//;LMMNN    r)c4ttdrdSdS)Npypy_version_infoPyPyPython)hasattrsysr.r)r'_get_implementationr?{ss'((vxr)ct|tt|}t|t |t |dSN)_inject_headers _load_scheme_resolve_schemevarsupdate _remove_set _scheme_attrs)obnamer&s r'_select_schemerKsQ T<0E0E#F#F G GFHHOOKM&$9$9::;;;;;r)cDfd|DS)z1 Include only attrs that are None in ob. c<i|]\}}t|||SrA)getattr)r%keyvaluerIs r'r(z_remove_set..s. S S S:3'"c:J:J:RC:R:R:Rr))items)rIattrss` r'rGrGs( T S S S S S SSr)c|d\}}} tj|}n1#t$r$t jt |}YnwxYw|S)N_) partitionr#get_preferred_scheme Exceptionfwr& _pypy_hack)rJos_nameseprOresolveds r'rDrDsls++GS#/1#66 ///9Z--../ Os0+AAc*t|SrA)r8)rJs r'rCrCs ??4  r)cvtt|}|d|d|S)z Given a scheme name and the resolved scheme, if the scheme does not include headers, resolve the fallback scheme for the name and use headers from it. pypa/distutils#88 r)rCrY setdefault)rJr&fallbacks r'rBrBs9Jt,,--H i)!4555 Mr)c*fdtDS)z.s( A A Ac s  fSk A A Ar)) SCHEME_KEYS)r&s`r'rHrHs A A A A[ A A AAr)ctjdk}ttdo|}|d }ddtjdkzz}|r|r|n|S)N)r:)_user_homer_ntr)r> version_infor=endswithosrJ)rJPY37old_pypyprefix pypy_names r'rYrYsb  f $Ds/009TH122 2F"'T/22I 5V 5995r)c0eZdZdZgdZgdZer0edddezfedddiZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdefdefd efd!efd"d#fgZdS)$installz'install everything from build directory))zprefix=Nzinstallation prefix)z exec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nzversionsplitrrr, distributionget_name get_version get_fullnamerkrNr?lowerdictreplace HAS_USER_SITErrr DictStackrXrEr# config_varsexpand_basedirsrrprint expand_dirscreate_home_pathrhas_ext_modulesrr convert_pathshandle_extra_pathinstall_libbasepathjoin extra_dirsr change_rootsset_undefined_options)rrrpr}r local_vars compat_varsrs r'finalize_optionszinstall.finalize_optionsMs K 4+ ty    !%!6 '>  9 $+ )9 &K  9  K  y   $ ':  7g   ( GHHH#'  2333 7g         ! ! ! 5666[&&((+ /- H H |HH   HHH *3355 -99;;!.;;==$ '#*:2A2*> > &)9"1")= = *& !#|U;;$7$9$9$?$?$A$A133  $")#x"<"<"D"DS""M"M    ;%)%:Jz "%)%:Jz "'1 WYY Y%>%@%@* M    /000". 6!%!6 :  + % % % % % % . ! ! ! F4()) * * *  +,,, 9 $  ! ! # # #   # 0022 8#'#7  #'#7              #/7<<(8$/JJ 9   5)Y 69    ./// "" 13M     s E++ E:9E:ctsdSddlm}tj|dz|jD]}|d}|ddkr |dd}||jvr4|j|}||}t|| }n%||}t||}tjd||dS) zDumps the list of user options.Nr) longopt_xlate:r=z %s: %s) r fancy_getoptrrdebug user_options negative_opt translaterN)rmsgroptopt_namevals r'rzinstall.dump_dirss  F000000 #)$ 1 1C1vH|s""#AbD>4,,,,X6#--m<<!$111#--m<<dH-- Ij(C 0 0 0 0 1 1r)cP|j|jI|jduo|jduo|jdup|jdup|jdup|jdu}|rtddS|j r@|j td|j x|_|_| ddS|j *|j x|_|_| ddS|j|jtdt!t"dd}t$jt*j|z|_t$jt*j|z|_n|j |j|_|j|_|j|_| d dS) z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedrrz*must not supply exec-prefix without prefix_prefix_additionrr)rrrrrrrrr r{rr select_schemer~rpr}rNr#rmrnormpathr>)rincomplete_schemers r'rzinstall.finalize_unixs   (D,A,M$,5,45,4- '4/ - '4/ -$, ! *8 F 9 /$,,-STTT8<8M MD  5   | , , , , , Y "8< AD  5   | , , , , ,{"#/.D $+96H"#M#M  g..sz::=MM #%7#3#3CO#D#DGW#W  #+'+{D$ $ D $($4D !   ~ . . . . .r)c4|jrM|jtd|jx|_|_|t jdzdS|j*|jx|_|_|ddS|j .t j tj |_ |j x|_|_ |t jdS#t$rtdt jzwxYw)z)Finalizes options for non-posix platformsNrrhrz)I don't know how to install stuff on '%s')r{rrrrrrmrJr~rprrr>KeyErrorrs r'rzinstall.finalize_otherGs 9 $,,-STTT8<8M MD  5   rw0 1 1 1 1 1 Y "8< AD  5   | , , , , ,{" g..sz:: 8< CD  5 ""27+++++   ,?"'I s C00'Dc&t||dSrA)rK)rrJs r'rzinstall.select_scheme]stT"""""r)c|D]y}t||}|etjdkstjdkrtj|}t ||j}t|||zdS)Nrr)rNrmrJr expanduserr rsetattr)rrRattrrs r' _expand_attrszinstall._expand_attrs`s ) )D$%%C7g%%D',,S11C d&677dC(((  ) )r)c4|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)rrrNrrs r'rzinstall.expand_basedirsis% GGGHHHHHr)c4|gddS)z+Calls `os.path.expanduser` on install dirs.)rrrrrrNrrs r'rzinstall.expand_dirsns3     r)c r|D]3}d|z}t||tt||4dS)z!Call `convert_path` over `names`.rcN)rr rNrnamesrJrs r'rzinstall.convert_paths{sP C CD$D D$ WT4-@-@ A A B B B B C Cr)c|j|jj|_|jtjdt |jt r|jd|_t|jdkr|jdx}}n2t|jdkr |j\}}ntdt|}nd}d}||_ ||_ dS) z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,rrrzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr) rrrwarning isinstancestrrlenr r path_filer)rrrs r'rzinstall.handle_extra_paths ? ""/:DO ? & K.   $/3// ="&/"7"7"<"<4?##q(()-);; JJT_%%**(,% ::*B&j11JJIJ#$r)c ~|D]9}d|z}t||t|jt||:dS)z:Change the install directories pointed by name using root.rcN)rr rrNrs r'rzinstall.change_rootssT M MD$D D$ DIwtT7J7J K K L L L L M Mr)c|jsdSttjd}|jD]s\}}t||rLtj |s-| d|ztj |dtdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) r{r rmrrrrQr startswithisdir debug_printmakedirs)rr~rJrs r'rzinstall.create_home_pathsy  FBG..s3344*0022 ) )JD$4yy##D)) )"'--2E2E )  !;d!BCCC D%((( ) )r)c|js\|d|jdj}|jr!|t krtd|D]}|||j r| |j r| }|j rFt|j }tt|D]}|||d||<|t"|j |fd|j zt%t&jjt,j}t%t&jj|}t&jt&j|j}|jr.|j r|js$||vrt5jd|jdSdSdSdS)zRuns the command.rz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r run_commandrget_command_obj plat_namerr rget_sub_commandsrcreate_path_filer get_outputsrrrangeexecutermaprmrrr>normcaserrrr)r build_platcmd_nameoutputsroot_lencountersys_pathrs r'runz install.runs V   W % % %*::7CCMJ} V|~~!=!=,-TUUU--// ' 'H   X & & & & > $  ! ! # # # ; &&((Gy Cty>>$S\\22CCG'.w'7 'BGG$$ LLg&9DKG    rw'22rw'22g&&rw'7'78H'I'IJJ M ^ (,(> 8++ IE        ,+  r)ctj|j|jdz}|jr)|t||jgfd|zdS| d|zdS)zCreates the .pth file.pthz creating %szpath file '%s' not createdN) rmrrrrrrrrr)rfilenames r'rzinstall.create_path_files7<< 4dnv6MNN  ! ? LLX'89=8;S      II2X= > > > > >r)c^g}|D]G}||}|D]}||vr||H|jrG|jr@|t j|j |jdz|S)z.Assembles the outputs of all the sub-commands.r) rget_finalized_commandrappendrrrmrrr)rr r cmdrs r'rzinstall.get_outputss--// - -H,,X66C OO-- - -7**NN8,,, - > Xd4 X NN27<<(UVV W W Wr)cg}|D]>}||}||?|S)z*Returns the inputs of all the sub-commands)rrextend get_inputs)rinputsr rs r'rzinstall.get_inputss[--// , ,H,,X66C MM#..** + + + + r)cf|jp|jS)zSReturns true if the current distribution has any Python modules to install.)rhas_pure_modulesrrs r'has_libzinstall.has_libs/   . . 0 0 WD4E4U4U4W4W r)c4|jS)zLReturns true if the current distribution has any headers to install.)r has_headersrs r'r zinstall.has_headers ,,...r)c4|jS)zMReturns true if the current distribution has any scripts to. install.)r has_scriptsrs r'r#zinstall.has_scriptsr!r)c4|jS)zJReturns true if the current distribution has any data to. install.)rhas_data_filesrs r'has_datazinstall.has_data!s //111r)rrrrinstall_egg_infocdS)NTr.rs r'zinstall.-s$r)) __name__ __module__ __qualname__ descriptionrboolean_optionsrrrrrrrrrrrrrrrrrrrrrrr r#r& sub_commandsr.r)r'rsrss;K:::Lx988O' T>J K    v&&& ),LEEEZp p p j111(//////b,###)))III    CCC !%!%!%FMMM )))000d???    /// /// 222  K( K( " ../ LLLr)rs)/__doc__r>rmr*r#r6distutils._logrcorerrrr file_utilrutilr r r r errorsr rrrrXrsiterrrWINDOWS_SCHEMEr2rFschemesrdr/r8r?rKrGrDrCrBrHrYrsr.r)r'r9s// ''''''""""""8888888888AAAAAAAA%%%%%% *)+  W+37?F  ))/   *)/# 3  FO ""OI 3# %%OL!rz""" C        <<< TTT!!!   BBB 666x x x x x gx x x x x r)PK!^^7_distutils/command/__pycache__/__init__.cpython-311.pycnu[ ,RedZgdZdS)z\distutils.command Package containing implementation of all the standard Distutils commands.)buildbuild_py build_ext build_clib build_scriptscleaninstall install_libinstall_headersinstall_scripts install_datasdistregisterbdist bdist_dumb bdist_rpmcheckuploadN)__doc____all__/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/__init__.pyrs$     rPK!?@?_distutils/command/__pycache__/install_egg_info.cpython-311.pycnu[ ,Re tdZddlZddlZddlZddlmZddlmZddlm Z GddeZ d Z d Z d Z dS) z distutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata. N)Command)dir_util)logcJeZdZdZdZdgZdZedZdZ dZ dZ d S) install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)z install-dir=dzdirectory to install tocd|_dSN) install_dirselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/install_egg_info.pyinitialize_optionsz#install_egg_info.initialize_optionsscdtt|jtt |jgt jddRzS)z_ Allow basename to be overridden by child class. Ref pypa/distutils#2. z%s-%s-py%d.%d.egg-infoNr) to_filename safe_name distributionget_name safe_version get_versionsys version_infor s rbasenamezinstall_egg_info.basenamesu (  $"3"<"<">">?? @ @  T%6%B%B%D%DEE F F+  bqb !+ +   rc|ddtj|j|j|_|jg|_dS)N install_lib)r r )set_undefined_optionsospathjoinr rtargetoutputsr s rfinalize_optionsz!install_egg_info.finalize_options(sD ""=2PQQQgll4#3T]CC  } rc|j}tj|r;tj|st j||jntj|r+| tj |jfd|znStj|j s/| tj |j fd|j ztjd||jsLt|dd5}|jj|ddddS#1swxYwYdSdS)N)dry_runz Removing z Creating z Writing %swzUTF-8)encoding)r"rr isdirislinkr remove_treer&existsexecuteunlinkr makedirsrinfoopenrmetadatawrite_pkg_file)rr"fs rrunzinstall_egg_info.run-s 7==  )?)?    > > > > > W^^F # #  LLT[NK&4H I I I It/00  LL d.0+@P2P    v&&&| =fcG444 =!*99!<<< = = = = = = = = = = = = = = = = = = = =s- EE!Ec|jSr )r#r s r get_outputszinstall_egg_info.get_outputs<s |rN) __name__ __module__ __qualname____doc__ description user_optionsrpropertyrr$r5r7rrrrs33LK8L      X  %%% = = =rrc.tjdd|S)zConvert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. [^A-Za-z0-9.]+-)resubnames rrrEs 6"C . ..rcZ|dd}tjdd|S)zConvert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash.  .rArB)replacerCrD)versions rrrMs, ooc3''G 6"C 1 11rc.|ddS)z|Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. rB_)rJrEs rrrWs <<S ! !!r)r;rrrCcmdrr_logrrrrrr?rrrQs ,,,,,w,,,h///222"""""rPK!􅰬4_distutils/command/__pycache__/check.cpython-311.pycnu[ ,RedZddlZddlmZddlmZeje5ddlZ ddl Z ddl Z ddl Z Gdde j jZdddn #1swxYwYGdd eZdS) zCdistutils.command.check Implements the Distutils 'check' command. N)Command)DistutilsSetupErrorc.eZdZ dfd ZdZxZS)SilentReporterNrasciireplacec dg|_t|||||||dSN)messagessuper__init__) selfsource report_level halt_levelstreamdebugencoding error_handler __class__s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/check.pyrzSilentReporter.__init__sADM GG   j&%=     c|j||||ftjj|g|R||j|d|S)N)leveltype)r appenddocutilsnodessystem_messagelevels)rrmessagechildrenkwargss rr zSilentReporter.system_message sf M %(F!C D D D>0@H$4;u+=LR r)Nrrr )__name__ __module__ __qualname__rr __classcell__)rs@rrrsZ #             rrcPeZdZdZdZgdZgdZdZdZdZ dZ d Z d Z d Z d S) checkz1This command checks the meta-data of the package.z"perform some checks on the package))metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check fails)r+r-r/c>d|_d|_d|_d|_dS)z Sets default values for options.rN)r-r+r/ _warningsrs rinitialize_optionszcheck.initialize_options:s# !  rcdSr r4s rfinalize_optionszcheck.finalize_optionsAs rcL|xjdz c_tj||S)z*Counts the number of warnings that occurs.r2)r3rwarn)rmsgs rr:z check.warnDs$ !|D#&&&rcd|jr||jrjdtvrD |nD#t $r!}t t|d}~wwxYw|jrt d|jr|j dkrt ddSdS)zRuns the command.rNzThe docutils package is needed.rzPlease correct your package.) r+check_metadatar-globalscheck_restructuredtext TypeErrorrstrr/r3)rexcs rrunz check.runIs = "    ! ! !   MWYY&&8//1111 888-c#hh7778 M)*KLLL ; F4>A--%&DEE E F F--sA A4A//A4c|jj}g}dD](}t||ds||)|r-|dd|zdSdS)zEnsures that all required elements of meta-data are supplied. Required fields: name, version Warns if any are missing. )nameversionNzmissing required meta-data: %sz, ) distributionr+getattrrr:join)rr+missingattrs rr=zcheck.check_metadata\s$-% % %D8T400 %t$$$  M II679K9KK L L L L L M Mrc|j}||D]Y}|dd}| |d}nd|d|}||ZdS)z4Checks if the long string fields are reST-compliant.lineNr2z {} (line {}))rGget_long_description_check_rst_datagetformatr:)rdatawarningrNs rr?zcheck.check_restructuredtextns 5577++D11  G2;??6**D|!!*(// DAA IIg       rc |jjpd}tjj}tjtjjjf}d|_ d|_ d|_ t||j |j|j|j|j|j}tj|||}||d |||n8#t.$r+}|jdd|zd ifYd}~nd}~wwxYw|jS) z8Returns warnings when the provided data doesn't compile.zsetup.py) componentsN)rrrr)rrMz!Could not finish the parsing: %s.)rG script_namerparsersrstParserfrontend OptionParserget_default_values tab_widthpep_referencesrfc_referencesrrrwarning_streamrerror_encodingerror_encoding_error_handlerrdocument note_sourceparseAttributeErrorr r)rrS source_pathparsersettingsreporterrfes rrPzcheck._check_rst_dataysz'3Az !%,,..$11 (,352      "&"&!   !  *.,"?   >**8Xk*RR["---  LLx ( ( ( (      $ $81r~sF((((((Z%%0 :p!p!p!p!p!Gp!p!p!p!p!s)AAAPK!EE7_distutils/command/__pycache__/build_py.cpython-311.pycnu[ ,Re@zdZddlZddlZddlZddlZddlmZddlm Z m Z ddl m Z ddl mZGdd eZdS) zHdistutils.command.build_py Implements the Distutils 'build_py' command.N)Command)DistutilsOptionErrorDistutilsFileError) convert_path)logceZdZdZgdZddgZddiZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZddZdZdZdZdZdS)build_pyz5"build" pure Python modules (copy to build directory)))z build-lib=dzdirectory to "build" (copy) to)compileczcompile .py to .pyc) no-compileNz!don't compile .py files [default])z optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz2forcibly build everything (ignore file timestamps)r rrcvd|_d|_d|_d|_d|_d|_d|_d|_dS)Nr) build_lib py_modulespackage package_data package_dirr optimizerselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/build_py.pyinitialize_optionszbuild_py.initialize_options$s@     cH|ddd|jj|_|jj|_|jj|_i|_|jjr;|jjD]\}}t||j|<||_ t|j tsV t|j |_ d|j cxkrdksnJdS#ttf$rtdwxYwdS)Nbuild)rr)rrrrzoptimize must be 0, 1, or 2)set_undefined_options distributionpackagesrrritemsrget_data_files data_files isinstancerint ValueErrorAssertionErrorr)rnamepaths rfinalize_optionszbuild_py.finalize_options.sM "" /1C   )2 +6 -:   ( <"/;AACC < < d)5d);); &&--//$--- J J #DM 2 2 DM....Q......../ J J J*+HIII J  J Js /C>>!Dc|jr||jr(||||ddS)Nr)include_bytecode)r build_modulesr"build_packagesbuild_package_data byte_compile get_outputsrs rrunz build_py.runGsy, ? !    = &    ! ! !  # # % % % $**A*>>?????rc\g}|js|S|jD]}||}tjj|jg|dz}d|rt|dzfd|||D}| ||||f|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples.rc$g|] }|d SN).0fileplens r z+build_py.get_data_files..ws!XXXdeeXXXr) r"get_package_dirosr+joinrsplitlenfind_data_filesappend)rdatarsrc_dir build_dir filenamesr=s @rr$zbuild_py.get_data_fileses} K} B BG**733G '7'--:L:L'LNID (7||a'YXXX1E1Egw1W1WXXXI KK'9i@ A A A A rc h|jdg|j|gz}g|D]t}tjtjtj|t|}fd|DuS)z6Return filenames for package's data files in 'src_dir'cZg|]'}|vtj|%|(Sr:)r@r+isfile)r;fnfiless rr>z,build_py.find_data_files..s0QQQ"E//bgnnR>P>P////r) rgetglobr@r+rAescaperextend)rrrGglobspatternfilelistrOs @rrDzbuild_py.find_data_files{s!%%b"--0A0E0Egr0R0RR  Gy T[11<3H3HIIH LLQQQQhQQQ     rc>|jD]\}}}}|D]}tj||}|tj||tj|||ddS)z$Copy data files into build directoryF preserve_modeN)r%r@r+rAmkpathdirname copy_file)rrrGrHrIfilenametargets rr1zbuild_py.build_package_datas6:o   2GWi%  i:: BGOOF33444GLL(33V5   rc|d}|js|rtjj|SdSg}|r{ |jd|}|d|tjj|S#t $r"|d|d|d=YnwxYw|{|jd}||d||rtjj|SdS)zReturn the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).r6rKr)rBrr@r+rAinsertKeyErrorrP)rrr+tailpdirs rr?zbuild_py.get_package_dirs"}}S!!  w|T**rD /+CHHTNN;D KK4(((7<..  !!!KK48,,,R! "'++B//#KK4(((7<..2s B)B.-B.c\|dkrbtj|std|ztj|std|z|rAtj|d}tj|r|SdS)NrKz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz __init__.py)r@r+existsrisdirrArM)rrrinit_pys r check_packagezbuild_py.check_packages "  7>>+.. (;kI7==-- (-/:;  gll; >>Gw~~g&& trcttj|stjd||dSdS)Nz!file %s (for module %s) not foundFT)r@r+rMrwarning)rmodule module_files r check_modulezbuild_py.check_modules7w~~k**  K;[& Q Q Q54rcJ|||tjtjtj|d}g}tj|jj}|D]}tj|}||kr[tj tj |d}| |||f| d|z|S)Nz*.pyrz excluding %s) rirQr@r+rArRabspathr! script_namesplitextbasenamerE debug_print) rrr module_filesmodules setup_scriptrabs_frls rfind_package_moduleszbuild_py.find_package_moduless 7K000ydk+.F.F!O!OPP wt'8'DEE  @ @AGOOA&&E $$))"'*:*:1*=*=>>qA34444  ,!>????rci}g}|jD]}|d}d|dd}|d} ||\}}n'#t$r||}d}YnwxYw|s7|||} |df||<| r||d| ftj||dz} | || s|||| f|S)aFinds individually-specified Python modules, ie. those listed by module name in 'self.py_modules'. Returns a list of tuples (package, module_base, filename): 'package' is a tuple of the path through package-space to the module; 'module_base' is the bare (no packages, no dots) module name, and 'filename' is the path to the ".py" file (relative to the distribution root) that implements the module. r6rr`r7__init__.py) rrBrArbr?rirEr@r+rn) rr"rvrlr+r module_basercheckedrhrms r find_moduleszbuild_py.find_modulessN o @ @F<<$$DhhtAbDz**Gr(K )1'):&gg   "227;;   C,,WkBB%0!$4!CNNGZ#ABBB ',,{K%4GHHK$$V[99  NNG[+> ? ? ? ?s A!A98A9cg}|jr'|||jrJ|jD]B}||}|||}||C|S)a4Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do.)rrSrr"r?ry)rrvrrms rfind_all_moduleszbuild_py.find_all_moduless  ? 0 NN4,,.. / / / = "= " ""227;; --g{CCq!!!!rc>d|DS)Ncg|] }|d S)r`r:)r;rls rr>z-build_py.get_source_files..0sAAAvr AAAr)rrs rget_source_fileszbuild_py.get_source_files/s"AA)>)>)@)@AAAArc\|gt|z|dzgz}tjj|S)Nr|)listr@r+rA)rrHrrl outfile_paths rget_module_outfilezbuild_py.get_module_outfile2s/!{T']]2fun5EE w|\**rr7c|}g}|D]\}}}|d}||j||}|||r|jr4|t j|d|j dkr9|t j||j |d|j Dz }|S)Nr6rK) optimizationrcbg|],\}}}}|D]"}tj||#-Sr:)r@r+rA)r;rrGrHrIr]s rr>z(build_py.get_outputs..IsW   6)Y%   GLLH - -    r) rrBrrrEr importlibutilcache_from_sourcerr%)rr.rvoutputsrrlrmr]s rr3zbuild_py.get_outputs6s#'')).5   *WfkmmC((G..t~wOOH NN8 $ $ $ <NN!88PR8SS=1$$NN!88$4=9   :>/     rc~t|tr|d}n+t|ttfst d||j||}tj |}| || ||dS)Nr6z:'package' must be a string (dot-separated), list, or tuplerrX) r&strrBrtuple TypeErrorrrr@r+r[rZr\)rrlrmroutfiledirs r build_modulezbuild_py.build_moduleQs gs # # mmC((GGGdE]33 L ))$.'6JJgoog&& C~~k7!~DDDrcn|}|D]\}}}||||dSr9)rr)rrvrrlrms rr/zbuild_py.build_modulesasP##%%.5 < < *Wfk   fk7 ; ; ; ;  < > > F'''''' ":  bf_F <  LFDL     =1   Lj         rN)r7)__name__ __module__ __qualname__ description user_optionsboolean_options negative_optrr,r4r$rDr1r?rirnryrrrrr3rr/r0r2r:rrr r ssKK   L!'*O ),LJJJ2@@@<,   %%%N4   222h BBB+++6EEE <<<@@@(rr )__doc__r@importlib.utilrrrQcorererrorsrrrrdistutils._logrr r:rrrs00  ========GGGGGwGGGGGrPK!{CC9_distutils/command/__pycache__/py37compat.cpython-311.pycnu[ ,ReddlZdZdZejdkr*ejdkrejdddkr eeeneZdS)Nc#Kddlm}|dsdSdtjdz tjdz dz|d VdS) zj On Python 3.7 and earlier, distutils would include the Python library. See pypa/distutils#9. r sysconfigPy_ENABLED_SHAREDNz python{}.{}{}ABIFLAGS) distutilsrget_config_varformatsys hexversionrs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/py37compat.py_pythonlib_compatrs $#####  # #$7 8 8   " 2 %  ,,  cfdS)Nc&|i|S)N)argskwargsf1f2s rzcompose..s 22bb$&9&&9&9#:#:rr)rrs``rcomposers : : : : ::r)darwinraix)rrr version_infoplatformlist pythonlibrrrr$s ";;;  &      RaRE!! GD#$$$   rPK!aL[[8_distutils/command/__pycache__/bdist_rpm.cpython-311.pycnu[ ,ReVdZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z mZddlmZdd lmZGd d eZdS) zwdistutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).N)Command)DEBUG) write_file)DistutilsOptionErrorDistutilsPlatformErrorDistutilsFileErrorDistutilsExecError)get_python_version)logcXeZdZdZgdZgdZddddZdZd Zd Z d Z d Z d Z dZ dS) bdist_rpmzcreate an RPM distribution)))z bdist-base=Nz/base directory for creating built distributions)z rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z dist-dir=dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z spec-onlyNzonly regenerate spec file)z source-onlyNzonly generate source RPM)z binary-onlyNzonly generate binary RPM)z use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow ") [default: maintainer or author from setup script])z packager=NzBRPM packager (eg. "Jane Doe ") [default: vendor])z doc-files=Nz6list of documentation files (space or comma-separated))z changelog=Nz RPM changelog)zicon=Nzname of icon file)z provides=Nz%capabilities provided by this package)z requires=Nz%capabilities required by this package)z conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z obsoletes=Nz*capabilities made obsolete by this package) no-autoreqNz+do not automatically calculate dependencies) keep-tempkz"don't clean up RPM build directory) no-keep-tempNz&clean up RPM build directory [default])use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler) rpm3-modeNz"RPM 3 compatibility mode (default)) rpm2-modeNzRPM 2 compatibility mode)z prep-script=Nz3Specify a script for the PREP phase of RPM building)z build-script=Nz4Specify a script for the BUILD phase of RPM building)z pre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nzfinalize_package_datarBs rDfinalize_optionszbdist_rpm.finalize_optionssB ""7,HIII = > X*+VWWWGLL%@@DM ;  (!n ' _ &J  7g  (NQSQXX     0 &H   0022 '%&D " ""7,DEEE ""$$$$$rFcd|dd|d|jd|jd|d|dt |jtrGdD]D}tj |r#||jvr|j |E|d d |d |d |d | |j |_ |d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|ddS)Nr&zDevelopment/Librariesr)z <>r*r+)READMEz README.txtr'1r(r%r,r-r.r/r0r1r2r3r4r5r6r8r9r:r;r<rA) ensure_stringrS get_contactget_contact_emailensure_string_list isinstancer+listrMrNexistsappend_format_changelogr,ensure_filename)rCreadmes rDrUzbdist_rpm.finalize_package_datas 7$;<<<   ,,....0A0S0S0U0U0U0U W   :&&&  ,,, dnd + + 22 2 27>>&))2fDN.J.JN))&111 9c*** 8$$$ ./// ;'''//?? V$$$ ]+++ ^,,, -... ^,,, _--- ]+++ ^,,, _--- -...  +++  +++  ,,,  0111  ,,, <(((((rFc trctdtd|jtd|jtd|jtd|j|jr|j}||nRi}dD]E}tj |j |||<|||F|d}tj |d|j z}|t ||fd |z|jrdS|j jdd}|d }|jr d g|_nd g|_|d ||j _|d }|d}||||jrWtj |jr||j|nt7d|jzt9jddg} |jr| dn2|j r| dn| d| !dd|j"zg|j#r<| !ddtj $|j zg|j%s| d|j&r| d| |d} | dz} d| zdz} d'| | |} tj(| } g}d} |)}|sna|*+}tY|d ksJ||d!||d }x|-}|rt]d"t_| z |-n#|-wxYw|0| |j1s|j 2rtg}nd#}|j stj |d$|}tj |sJ|4||jtj |j|}|j jd%||f|js|D]}tj |d&|}tj |r|4||jtj |jtj 5|}|j jd%||fdSdSdS)'Nzbefore _get_package_data():zvendor =z packager =z doc_files =z changelog =)SOURCESSPECSBUILDRPMSSRPMSrhz%s.specz writing '%s'sdistbztargztarrrgzicon file '%s' does not existz building RPMsrpmbuildz-bsz-bbz-baz--definez __python %sz _topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z .%{arch}.rpmz%rpm -q --qf '{} {}\n' --specfile '{}'TrrzFailed to execute: %sanyrkrrj)6rprintr)r*r+r,r!rmkpathrMrNrOrrSget_nameexecuter_make_spec_file dist_filesreinitialize_commandr$formats run_commandget_archive_files copy_filer-rar r infor#rbr"extendrr?abspathr=rformatpopenreadlinestripsplitlencloser reprspawndry_runrTr move_filebasename)rCspec_dirrpm_dirr spec_pathsaved_dist_filesrlsource source_dirrpm_cmd nvr_stringsrc_rpm non_src_rpmq_cmdout binary_rpms source_rpmlineellstatus pyversionsrpmfilenamerIs rDrunz bdist_rpm.runs  1 / 0 0 0 *dk * * * , . . . - 0 0 0 - 0 0 0 > (}H KK ! ! ! !GC ( (W\\$-;;  GAJ''''w'HGLL9t7H7Q7Q7S7S+STT  D$8$8$:$:;^i=W    >  F ,7:))'22 > &$IEMM$IEM !!!'7$((**1-Y'  vz*** 9 Vw~~di(( Vty*5555()H49)TUUU !!!,   " NN5 ! ! ! !   " NN5 ! ! ! ! NN5 ! ! ! MDK$?@AAA > X NNJ rwt}7U7U(UV W W W~ & NN9 % % % : & NN9 % % %y!!! 5 z) :-> 8??      huoo KJ (||~~jjll((**3xx1}}}}""3q6***%!$QJ (YY[[F P()@4;;)NOOO P IIKKKKCIIKKKK 7|  0022 ".00 ! # Xw||GG$4jAAw~~d+++++tT]3337<< zBB!,33[)X4VWWW# &C',,wv<'    s B2Q''Q=ctj|jtj|S)N)rMrNrOrr)rCrNs rD _dist_pathzbdist_rpm._dist_paths*w||DM27+;+;D+A+ABBBrFc  d|jzd|jddzd|jzd|jddzdd|jpd zg}t jd }d d | D}d }d}|||}||kr0| d| d|zd z| gd|j r| dn| d| d|j pd zd|jzddg|js/|js| dn| d|jzdD]}t#||}t'|t(r=| d|d|v|)| d|||jr/| d|jz|jr| d|jz|jr0| d d|jz|jr:| d!t4j|jz|jr| d"| dd#|jpdgd$|jt4jt@j!d%}d&|z} |j"rd'| z} d(|z} d)d*d+| fd,d-| fd.d/d0d1d2d3g } | D]\} } }t#|| }|s|r| dd4| zg|rbtG|5}| |$%d dddn #1swxYwY| || gd5|j&r0| d6d|j&z|j'r1| dd7g| |j'|S)8ziGenerate the text of an RPM spec file and return it as a list of strings (one per line). z %define name z%define version -_z%define unmangled_version z%define release z Summary: UNKNOWNzrpm --eval %{__os_install_post} c<g|]}d|zS)z %s \)r).0rs rD z-bdist_rpm._make_spec_file..s% K K K$Y % K K KrFzbrp-python-bytecompile \ z%brp-python-bytecompile %{__python} \ z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post )z Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz BuildArch: %s)VendorPackagerProvidesRequires Conflicts Obsoletesz{}: {} NzUrl: zDistribution: zBuildRequires: zIcon: z AutoReq: 0z %descriptionz{} {}rz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r7r.z&%setup -n %{name}-%{unmangled_version}buildr/installr0)cleanr1zrm -rf $RPM_BUILD_ROOT) verifyscriptr2N)prer3N)postr4N)preunr5N)postunr6N%)rz%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z %changelog)(rSrs get_versionreplacer'get_description subprocess getoutputrO splitlinesrbr}r$ get_licenser&rArTgetattrlowerr_r`rget_urlr%r;r-rMrNrr@get_long_descriptionrrPargvr>openreadrr+r,)rC spec_file vendor_hookproblemfixed fixed_hookfieldvaldef_setup_call def_build install_cmdscript_optionsrpm_optattrdefaultfs rDruzbdist_rpm._make_spec_files> d/88:: : !2!>!>!@!@!H!Hc!R!R R (4+<+H+H+J+J J !5!5c3!?!? ?  4,<<>>K) L  !*+LMM ii K K+2H2H2J2J K K K  09 ((%88  $ $   Q R R R   9JFM N N N        > M   L M M M M   K L L Lt0<<>>K)LDJ&P$      @$4466 6  !4555   _t> ? ? ? > >E$ ..C#t$$ >   !F!FGGGG  !B    (! RW5E5Echqk5R5RSS/  ! C6BI P  N ni 0 (+ 6 ? 3 ( * , .  )7 . . $WdG$%%C .g .  g  .c?a!(()=)=>>>???????????????$$W---        > A   Wsxx'?'?? @ @ @ > -          T^ , , ,s;S##S' *S' c`|s|Sg}|dD]t}|}|ddkr|d|g:|ddkr||\|d|zu|ds|d=|S)zBFormat the changelog correctly and convert it to a list of stringsrr*rrz )rrr}rb)rCr, new_changelogrs rDrczbdist_rpm._format_changelogUs   OO%%++D11 2 2D::<rs  """""" +*****P P P P P P P P P P rFPK!_ ;_distutils/command/__pycache__/install_data.cpython-311.pycnu[ ,Re JdZddlZddlmZddlmZmZGddeZdS)zdistutils.command.install_data Implements the Distutils 'install_data' command, for installing platform-independent data files.N)Command) change_root convert_pathc>eZdZdZgdZdgZdZdZdZdZ dZ d S) install_datazinstall data files))z install-dir=dzIbase directory for installing data files (default: installation base dir))zroot=Nz?aaAQAQAQS >>!T-=>>a $$S))))#1Q4((w}}S))6',,t'7==CCY6%di55C C   Q42::M((----!"!22+D11#'>>$#<#<a ,,S111127 2 2rc|jpgSN)rrs r get_inputszinstall_data.get_inputsPs$"$rc|jSr/)rrs r get_outputszinstall_data.get_outputsSs }rN) __name__ __module__ __qualname__ description user_optionsboolean_optionsrrr-r0r2rrrr s&K   LiO    2 2 2D%%%rr)__doc__r%corerutilrrrr9rrr=s$$ ,,,,,,,,GGGGG7GGGGGrPK!-e??5_distutils/command/__pycache__/config.cpython-311.pycnu[ ,Re3xdZddlZddlZddlmZddlmZddlmZddl m Z dd d Z Gd d eZ dd Z dS)adistutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" in the list of standard commands. Also, this is a good place to put common configure-like tasks: "try to compile this C code", or "figure out where this header file lives". N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++ceZdZdZgdZdZdZdZdZdZ dZ d Z d Z d Z ddZddZddZ ddZ ddZ ddZd d d gfdZddZd S)configzprepare to build) )z compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z libraries=lz!external C libraries to link with)z library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)z dump-sourceNz=dump generated source files before attempting to compile themcvd|_d|_d|_d|_d|_d|_d|_g|_dS)N)compilercc include_dirs libraries library_dirsr dump_source temp_filesselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/config.pyinitialize_optionszconfig.initialize_options.sE    c|j|jjpg|_nCt|jtr)|jt j|_|jg|_n't|jtr |jg|_|j g|_dSt|jtr+|jt j|_dSdSN) r distribution isinstancestrsplitospathseprrrs rfinalize_optionszconfig.finalize_options=s   $ $ 1 > D"D   )3 / / D $ 1 7 7 C CD  > !DNN  , , ."n-DN   $ "D    )3 / / D $ 1 7 7 C CD    D DrcdSr rs rrunz config.runMs rcddlm}m}t|j|s||j|jd|_t |j|jr|j|j|j r|j |j |j r#|j |j dSdSdS)z^Check that 'self.compiler' really is a CCompiler object; if not, make it one. r) CCompiler new_compilerr)rdry_runforceN) ccompilerr,r-r"rr.rrset_include_dirsr set_librariesrset_library_dirs)rr,r-s r_check_compilerzconfig._check_compilerTs 87777777$-33 B(L ADM t} - - -  B ..t/@AAA~ < ++DN;;;  B ..t/@AAAAA B B B BrcJdt|z}t|d5}|r2|D]}|d|z|d|||ddkr|ddddn #1swxYwY|S)N _configtestwz#include <%s>  )LANG_EXTopenwrite)rbodyheaderslangfilenamefileheaders r_gen_temp_sourcefilezconfig._gen_temp_sourcefilehs 8D>1 (C  !D !%;;FJJ069:::: 4   JJt   Bx4 4    ! ! ! ! ! ! ! ! ! ! ! ! ! ! !sA+BBBc||||}d}|j||g|j|||||fS)Nz _configtest.ir)rCrextendr preprocess)rr=r>rr?srcouts r _preprocesszconfig._preprocessts_''gt<< Sz***   c  EEESzrc||||}|jrt|d|z|j|g\}|j||g|j|g|||fS)Nzcompiling '%s':rE)rCr dump_filerobject_filenamesrrFcompile)rr=r>rr?rHobjs r_compilezconfig._compile{s''gt<<   4 c,s2 3 3 3//66 Sz*** se,???Szrcp|||||\}}tjtj|d} |j|g| ||||jj| |jjz} |j | ||| fS)Nr)rr target_lang) rPr%pathsplitextbasenamerlink_executable exe_extensionrappend) rr=r>rrrr?rHrOprogs r_linkz config._links]]4,EE cw 0 0 5 566q9 %% E % &    = & 2$-55D t$$$S$rc|s|j}g|_tjdd||D]'} t j|#t $rY$wxYwdS)Nz removing: %s )rrinfojoinr%removeOSError)r filenamesr@s r_cleanz config._cleans !I DO )!4!4555!  H  (####      sA A A Nrcddlm}|d} |||||n #|$rd}YnwxYw||S)aQConstruct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('body' probably isn't of much use, but what the heck.) r CompileErrorTF)r0rer4rJrbrr=r>rr?reoks rtry_cppzconfig.try_cpps -,,,,,      T7L$ ? ? ? ?   BBB   s7AAc||||||\}}t|trt j|}t |5}d} |} | dkrn|| rd} n4dddn #1swxYwY| | S)aConstruct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If both 'body' and 'headers' are None, preprocesses an empty file -- which can be useful to determine the symbols the preprocessor and compiler set by default. FTN) r4rJr"r#rerNr;readlinesearchrb) rpatternr=r>rr?rHrIrAmatchlines r search_cppzconfig.search_cpps  ##D'<FFS gs # # *j))G #YY $E }}2::>>$'' E                   s(8B,,B03B0cddlm}| |||||d}n #|$rd}YnwxYwt j|rdpd||S)zwTry to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. rrdTFsuccess!failure.)r0rer4rPrr]rbrfs r try_compilezconfig.try_compiles -,,,,,   MM$t < < <BB   BBB  " 0j111  s7AAcddlm}m}| |||||||d} n#||f$rd} YnwxYwt j| rdpd|| S)zTry to compile and link a source file, built from 'body' and 'headers', to executable form. Return true on success, false otherwise. rre LinkErrorTFrsrt)r0rerxr4rZrr]rb) rr=r>rrrr?rerxrgs rtry_linkzconfig.try_links 87777777   JJtWlI|T R R RBBi(   BBB  " 0j111  s; AAc0ddlm}m}| |||||||\} } } || gd} n#||t f$rd} YnwxYwtj| rdpd| | S)zTry to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. rrwTFrsrt) r0rerxr4rZspawnrrr]rb) rr=r>rrrr?rerxrHrOexergs rtry_runzconfig.try_runs 87777777   JJg|Y dMCc JJu   BBi);<   BBB  " 0j111  s6AA'&A'rc~|g}|r|d|z|d|r|d|zn|d|z|dd|dz}||||||S)aDetermine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it. If everything succeeds, returns true; otherwise returns false. The constructed source file starts out by including the header files listed in 'headers'. If 'decl' is true, it then declares 'func' (as "int func()"); you probably shouldn't supply 'headers' and set 'decl' true in the same call, or you might get errors about a conflicting declarations for 'func'. Finally, the constructed 'main()' function either references 'func' or (if 'call' is true) calls it. 'libraries' and 'library_dirs' are used when linking. z int %s ();z int main () {z %s();z %s;}r8)r4rXr^ry) rfuncr>rrrdeclcallr=s r check_funczconfig.check_func$s.   - KK t+ , , , O$$$  ( KK D( ) ) ) ) KK$ ' ' ' Cyy%}}T7L)\RRRrcd||d|||g|z|S)aDetermine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it. 'headers' will be used in constructing the source file to be compiled, but the only effect of this is to check if all the header files listed are available. Any libraries listed in 'other_libraries' will be included in the link, in case 'library' has symbols that depend on other libraries. zint main (void) { })r4ry)rlibraryrr>rother_librariess r check_libzconfig.check_libIsB }} !   I '     rc4|d|g|S)zDetermine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise. z /* No body */)r=r>r)rh)rrBrrr?s r check_headerzconfig.check_headerbs( || 6(   r)NNNr)NNr)NNNNr)NNNNrr)__name__ __module__ __qualname__ description user_optionsrr'r*r4rCrJrPrZrbrhrqruryr}rrrr)rrr r s$KL&   DDD    BBB(      "   *&6( : H  #S#S#S#SP     2      rr c$|tjd|ntj|t|} tj||dS#|wxYw)zjDumps a file content into log.info. If head is not None, will be dumped before the file content. Nz%s)rr]r;readclose)r@headrAs rrLrLlsv  | x      >>D   s &A99Br )__doc__r%rkcorererrorsr sysconfigrdistutils._logrr:r rLr)rrrs   ''''''******f % %R R R R R WR R R j      rPK!+~4_distutils/command/__pycache__/build.cpython-311.pycnu[ ,Re`dZddlZddlZddlmZddlmZddlmZdZ Gdd eZ dS) zBdistutils.command.build Implements the Distutils 'build' command.N)Command)DistutilsOptionError) get_platformc&ddlm}|dS)Nrshow_compilers) ccompilerr rs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/build.pyr r s(******Nc eZdZdZdddddddd d ezfd d d ddg ZddgZdddefgZdZ dZ dZ dZ dZ dZdZde fde fdefdefgZdS) buildz"build everything needed to install)z build-base=bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)z build-temp=tztemporary build directoryz plat-name=pz6platform name to build for, if supported (default: %s))z compiler=czspecify the compiler type)z parallel=jznumber of parallel build jobs)debuggz;compile extensions and libraries with debugging information)forcefz2forcibly build everything (ignore file timestamps))z executable=ez5specify final destination interpreter path (build.py)rrz help-compilerNzlist available compilerscd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ dS)Nrr) build_base build_purelib build_platlib build_lib build_temp build_scriptscompiler plat_namerr executableparallelselfs r initialize_optionszbuild.initialize_options5s_!"!!    r cZ|jt|_ntjdkrt dd|jt jj}tt dr|dz }|j *tj |j d|_ |j-tj |j d|z|_|j2|jr |j|_n |j |_|j-tj |j d|z|_|j?tj |j dt jdd z|_|j:t jr.tj t j|_t/|jt2r9 t5|j|_dS#t6$rt d wxYwdS) NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z.{}-{}gettotalrefcountz-pydebuglibtempz scripts-%d.%drzparallel should be an integer)r!rosnamerformatsysimplementation cache_taghasattrrpathjoinrrr distributionhas_ext_modulesrr version_infor"normpath isinstancer#strint ValueError)r%plat_specifiers r finalize_optionszbuild.finalize_optionsEs > !)^^DNN w$*C "9K9UVV 3* + + ) j (N   %!#dou!E!ED    %!#dou~?U!V!VD  > ! 0022 4!%!3!%!3 ? " gll4?F^>DO dmS ) ) L L #DM 2 2  L L L*+JKKK L L Ls 3HH(c^|D]}||dSN)get_sub_commands run_command)r%cmd_names r runz build.run}s@ --// ' 'H   X & & & & ' 'r c4|jSr@)r5has_pure_modulesr$s r rFzbuild.has_pure_moduless 11333r c4|jSr@)r5has_c_librariesr$s r rHzbuild.has_c_libraries 00222r c4|jSr@)r5r6r$s r r6zbuild.has_ext_modulesrIr c4|jSr@)r5 has_scriptsr$s r rLzbuild.has_scriptss ,,...r build_py build_clib build_extr)__name__ __module__ __qualname__ descriptionr user_optionsboolean_optionsr help_optionsr&r>rDrFrHr6rL sub_commandsr r rrs6K AVW @9   *lnn - 8;ULU-L2(O $ :NKL 6L6L6Lp'''444333333/// %& ' o& +& LLLr r) __doc__r/r,corererrorsrutilrr rrXr r r]s-- )))))) GGGGGGGGGGGr PK!ؘx==7_distutils/command/__pycache__/register.cpython-311.pycnu[ ,Re*.rdZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z Gdde Z dS) zhdistutils.command.register Implements the Distutils 'register' command (register with the repository). N)warn) PyPIRCCommand)logceZdZdZejddgzZejgdzZddfgZdZdZ d Z d Z d Z d Z d ZdZdZddZdS)registerz7register the distribution with the Python package index)list-classifiersNz list the valid Trove classifiers)strictNzBWill stop the registering if the meta-data are not fully compliant)verifyr r checkcdS)NTselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/register.pyzregister.$s4cJtj|d|_d|_dS)Nr)rinitialize_optionslist_classifiersr rs rrzregister.initialize_options&s&(... ! rcdtj|d|jfdd}||jjd<dS)Nr)r)r restructuredtextr )rfinalize_optionsr distributioncommand_options)r check_optionss rrzregister.finalize_options+sG&t,,,"4;/ /  6C)'222rcJ|||D]}|||jr|dS|jr|dS|dSN) r _set_configget_sub_commands run_commanddry_runverify_metadatar classifiers send_metadata)rcmd_names rrunz register.run4s  --// ' 'H   X & & & & < !  " " " " "  " !            rctdt|jd}||j|_d|_|dS)zDeprecated API.zVdistutils.command.register.check_metadata is deprecated; use the check command insteadr rN)rDeprecationWarningrget_command_objensure_finalizedr rr()rr s rcheck_metadatazregister.check_metadataCsh  ,    !11'::    { !" rc>|}|ikr=|d|_|d|_|d|_|d|_d|_d S|jd|jfvrtd|jz|jdkr |j|_d|_d S) z0Reads the configuration file and set attributes.usernamepassword repositoryrealmTpypiz%s not found in .pypircFN) _read_pypircr/r0r1r2 has_configDEFAULT_REPOSITORY ValueError)rconfigs rr zregister._set_configPs""$$ R<<":.DM":.DM$\2DODJ"DOOOvt/F&GGG !:T_!LMMM&(("&"9#DOOOrc|jdz}tj|}t j||dS)z.Fetch the list of classifiers from the server.z?:action=list_classifiersN)r1urllibrequesturlopenrinfo_read_pypi_response)rurlresponses rr%zregister.classifiers`sHo ;;>))#.. ))(3344444rc||d\}}tjd||dS)z???G##" S== / .. / 9"?<88 9>1133D<((99!>>>>/{,-,s]]v&D>@ @DL @4 +d7m"DO6l 3$\22V 6l 3z"d9o55z*E'.|'D'DD$z*Ey/D&-ol&C&CDOy/D #tI66')D$&*DO=>>>z"d9o557m 4 %l 3 3W 7m 4..t44LD&s{{3T6BBBBB=>>>UVVVVV s]]/0DDM7m > %&< = =W 7m >..t44LD& H/v > > > > > ]rc|jj}id|ddd|d|d|d|d|d |d |d | d | d | d| d| d|d|d|}|ds|ds|drd|d<|S)NrRmetadata_versionz1.0rTversionsummary home_pageauthor author_emaillicense descriptionkeywordsplatformr% download_urlprovidesrequires obsoletesz1.1)rmetadataget_name get_versionget_descriptionget_url get_contactget_contact_email get_licenceget_long_description get_keywords get_platformsget_classifiersget_download_url get_provides get_requires get_obsoletes)ractionmetarls rrDzregister.build_post_datas ) v   DMMOO  t''))  t++--     d&&((  D2244  t''))  44466  ))++  **,,  4//11  D1133 ))++! " ))++# $ ++--% (   -tJ/ -4 3D -',D# $ rNc d|vr?|d|d|jtjd}d|z}|dz}t j}|D]\}}t|tgtdfvr|g}|D]}t|}| || d|z| d| ||r!|d d kr| d | || d | d }d |ztt|d} tj|j|| } tjtj|} d} | | } |jr|| }d} n|#tjj$r8} |jr| j}| j| jf} Yd} ~ n5d} ~ wtjj$r} dt| f} Yd} ~ nd} ~ wwxYw|jr8d d|df}||tj| S)z9Post a query to the server, and return a string response.rTzRegistering {} to {}z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z --z--rz* Content-Disposition: form-data; name="%s"z   zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)z Content-typezContent-length) password_mgrrJ)rLOKNizK---------------------------------------------------------------------------)rZrdr1r[r\ioStringIOitemstypestrwritegetvalueencodelenr:r;Request build_openerHTTPBasicAuthHandleropen show_responser>error HTTPErrorfpreadrEmsgURLErrorjoin)rrlrjboundary sep_boundary end_boundarybodykeyvalueheadersreqopenerrFers rrCzregister.post_to_server s T>> MM&--d6lDOLL     I( #d* {}}**,, % %JCE{{488T"XX"666 % %E  <((( H3NOOO 6""" 5!!!%U2Y$..JJt$$$ % <    4}}%%g..N!#d))nn   n$$T_dGDD,, N / /T / B B   [[%%F! 8//77FF|% # # #! #tyy{{VQU]FFFFFF|$ ! ! !#a&&[FFFFFF !   -))XtX677C MM#w| , , , s$IK.JK&J<<Kr)__name__ __module__ __qualname__rur user_optionsboolean_options sub_commandsrrr(r-r r%r$r&rDrCrrrrrsKK -F 1L$3777O //01L CCC ! ! !   $$$ 555 ;;; ???B8888888rr)__doc__r_rr[ urllib.parser:urllib.requestwarningsrcorerdistutils._logrrrrrrs  nnnnn}nnnnnrPK!Z=]]4_distutils/command/__pycache__/sdist.cpython-311.pycnu[ ,ReJdZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z dd l m Z dd lmZdd lmZdd lmZddlmZmZdZGddeZdS)zadistutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).N)glob)warn)Command)dir_util) file_util) archive_util)TextFile)FileList)log) convert_path)DistutilsOptionErrorDistutilsTemplateErrorcddlm}ddlm}g}|D])}|d|zd||df*|||ddS)zoPrint all possible values for the 'formats' option (used by the "--help-formats" command-line option). r) FancyGetopt)ARCHIVE_FORMATSformats=Nz.List of available source distribution formats:) fancy_getoptrr rkeysappendsort print_help)rrformatsformats /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py show_formatsrs+*****......G!&&((PP V+T?63J13MNOOOO LLNNNK##$TUUUUUceZdZdZdZgdZgdZdddefgZdd d Z d efgZ d Z d Z dZ dZdZdZdZedZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"dS)#sdistz6create a source distribution (tarball, zip file, etc.)c|jS)zYCallable used for the check sub-command. Placed here so user_options can view it)metadata_checkselfs rchecking_metadatazsdist.checking_metadata's ""r))z template=tz5name of manifest template file [default: MANIFEST.in])z manifest=mz)name of manifest file [default: MANIFEST]) use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults]) no-defaultsNz"don't include the default file set)pruneNzspecifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])no-pruneNz$don't automatically exclude anything) manifest-onlyozEjust regenerate the manifest and then stop (implies --force-manifest))force-manifestfzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list)) keep-tempkz@keep the distribution tree around after creating archive file(s))z dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r'r)r+r-r/r2z help-formatsNz#list available distribution formatsr'r))r(r*check)READMEz README.txtz README.rstcd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_ d|_ d|_ d|_ dS)Nrgztar) templatemanifest use_defaultsr) manifest_onlyforce_manifestr keep_tempdist_dir archive_filesr!ownergroupr"s rinitialize_optionszsdist.initialize_optionszsl   y  !  rc|jd|_|jd|_|dtj|j}|rt d|z|j d|_dSdS)NMANIFESTz MANIFEST.inrzunknown archive format '%s'dist)r;r:ensure_string_listr check_archive_formatsrrr@)r# bad_formats rfinalize_optionszsdist.finalize_optionss~ = &DM = )DM  ***!7 EE  S&'Dz'QRR R = "DMMM ! rct|_|D]}||||jrdS|dSN)r filelistget_sub_commands run_command get_file_listr=make_distribution)r#cmd_names rrunz sdist.runs!  --// ' 'H   X & & & &     F      rctdt|jd}||dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated, use the check command insteadr5N)rPendingDeprecationWarning distributionget_command_objensure_finalizedrT)r#r5s rcheck_metadatazsdist.check_metadatasW  - %   !11'::     rctj|j}|s\|rH||j|jdS|s| d|jz|j |j r| |r| |jr||j|j|dS)aCFigure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options. Nz?manifest template '%s' does not exist (using default file list))ospathisfiler:_manifest_is_not_generated read_manifestrNrremove_duplicatesrfindallr< add_defaults read_templater)prune_file_listwrite_manifest)r#template_existss rrQzsdist.get_file_listsG'..77 4#B#B#D#D     M   M + + - - - F  IIW-               !    : #  " " "  ''))) rc|||||||dS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scriptsr"s rrczsdist.add_defaultss $$&&& ##%%% !!### %%'''     !!### ""$$$$$rctj|sdStj|}tj|\}}|tj|vS)z Case-sensitive path existence check >>> sdist._cs_path_exists(__file__) True >>> sdist._cs_path_exists(__file__.upper()) False F)r\r]existsabspathsplitlistdir)fspathrr directoryfilenames r_cs_path_existszsdist._cs_path_existss_w~~f%% 5'//&)) gmmG44 82:i0000rc|j|jjg}|D]}t|trj|}d}|D]5}||rd}|j|n6|s+|dd |z||r|j||d|zdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) READMESrW script_name isinstancetuplerxrNrrjoin)r# standardsfnaltsgot_its rrizsdist._add_defaults_standardss\4#4#@A  C CB"e$$ CB++B//!% ,,R000 IIFSWX''++CM((,,,,II4==99E M  ' ' ' ' ( (rcR|d}|jr,|j||jD]D\}}}}|D]:}|jtj ||;EdS)Nbuild_py) get_finalized_commandrWhas_pure_modulesrNrget_source_files data_filesrr\r]r~)r#rpkgsrc_dir build_dir filenamesrws rrkzsdist._add_defaults_python-s--j99   - - / / > M !:!:!>!,,4 M003334 4 4 4 4rc|jrC|d}|j|dSdS)N build_ext)rWhas_ext_modulesrrNrr)r#rs rrmzsdist._add_defaults_extNs^   , , . . ?22;??I M !;!;!=!= > > > > > ? ?rc|jrC|d}|j|dSdS)N build_clib)rWhas_c_librariesrrNrr)r#rs rrnzsdist._add_defaults_c_libsSsa   , , . . @33LAAJ M !!> ? ? ? ? ? @ @rc|jrC|d}|j|dSdS)N build_scripts)rW has_scriptsrrNrr)r#rs rrozsdist._add_defaults_scriptsXsa   ( ( * * C 66GGM M !?!?!A!A B B B B B C Crc tjd|jt|jdddddd} |}|n` |j|nC#ttf$r/}| d|j |j |fzYd}~nd}~wwxYww | dS#| wxYw)zRead and parse manifest template file named by self.template. (usually "MANIFEST.in") The parsing and processing is done by 'self.filelist', which updates itself accordingly. zreading manifest template '%s'r8)strip_comments skip_blanks join_lines lstrip_ws rstrip_ws collapse_joinTNz%s, line %d: %s) r infor:r readlinerNprocess_template_liner ValueErrorrrw current_lineclose)r#r:linemsgs rrdzsdist.read_template]s+ 14=AAA M     ((**< M77====/ ;II)#,h.CSIJ  NN     HNN    s5CA+*C+B+<%B&!C&B++CCc|d}|j}|jd|j|jd|t jdkrd}nd}gd}d|d ||}|j|d dS) avPrune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories buildN)prefixwin32z/|\\/)RCSCVSz\.svnz\.hgz\.gitz\.bzr_darcsz(^|{})({})({}).*|r8)is_regex) rrW get_fullnamerNexclude_pattern build_basesysplatformrr~)r#rbase_dirsepsvcs_dirsvcs_ptrns rrezsdist.prune_file_lists**733$1133 %%d53C%DDD %%d8%<<< <7 " "DDDRRR&--dCHHX4F4FMM %%h%;;;;;rc|rtjd|jzdS|jjdd}|dd|tj |j|fd|jzdS)zWrite the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s') r_r rr;rNrinsertexecuter write_file)r#contents rrfzsdist.write_manifests  * * , ,  H%'+}5    F-%aaa(qFGGG  ]G $ (4= 8     rctj|jsdSt |j} |}|n#|wxYw|dkS)NFz+# file GENERATED by distutils, do NOT edit )r\r]r^r;openrr)r#fp first_lines rr_z sdist._manifest_is_not_generatedsmw~~dm,, 5 $-  J HHJJJJBHHJJJJKKKs A%%A;c,tjd|jt|j5}|D]H}|}|ds|s.|j|I ddddS#1swxYwYdS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'#N)r rr;rstrip startswithrNr)r#r;rs rr`zsdist.read_manifests -t}=== $-  +H  + +zz||??3''t $$T****  + + + + + + + + + + + + + + + + + + +sA B  B B c(||tj|||jt t drd}d|z}nd}d|z}|st jdnt j||D]o}t j |st jd|7t j ||}| ||| p|j j|dS) aCreate the directory tree that will become the source distribution archive. All directories implied by the filenames in 'files' are created under 'base_dir', and then we hard link or copy (if hard linking is unavailable) those files into place. Essentially, this duplicates the developer's source tree, but in a directory named after the distribution, containing only the files to be distributed. dry_runlinkhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r)mkpathr create_treerhasattrr\r warningrr]r^r~ copy_filerWmetadatawrite_pkg_info)r#rrrrfiledests rmake_release_treezsdist.make_release_trees HXudlCCCC 2v   6D.9CCD*X5C  KC D D D D HSMMM 6 6D7>>$'' 6 A4HHHHw||Hd33tT5555 "11(;;;;;rc|j}tj|j|}|||jjg}d|j vrJ|j |j |j d|j D]]}| ||||j|j}| ||jj dd|f^||_|jst'j||jdSdS)aCreate the source distribution(s). First, we create the release tree with 'make_release_tree()'; then, we create all required archive files (according to 'self.formats') from the release tree. Finally, we clean up by blowing away the release tree (unless 'self.keep_temp' is true). The list of archive files created is stored so it can be retrieved later by 'get_archive_files()'. tar)rrBrCrrN)rWrr\r]r~r@rrNrrrpopindex make_archiverBrC dist_filesrAr?r remove_treer)r#r base_namerAfmtrs rrRzsdist.make_distributionsE$1133GLL99  x)<=== DL L   0 01C1CE1J1J K K L L L< E EC$$34:%D   & & &   ( / /"d0C D D D D*~ A  4< @ @ @ @ @ @ A Arc|jS)zzReturn the list of archive files created when the command was run, or None if the command hasn't run yet. )rAr"s rget_archive_fileszsdist.get_archive_filess !!r)#__name__ __module__ __qualname__ descriptionr$ user_optionsboolean_optionsr help_options negative_opt sub_commandsrzrDrKrTrZrQrc staticmethodrxrirjrkrlrmrnrordrerfr_r`rrRrrrrr#sJK### 888LtO DlSL$2wGGL/01L4G. # # #!!!,   '''R%%%,11\1 CCC,((( FFF 444"??? @@@ CCC """H<<<.   ( L L L + + +(<(<("""""rr)__doc__r\rrwarningsrcorer distutilsrrr text_filer rNr distutils._logr utilr errorsrrrrrrrrsALL """""" AAAAAAAA V V Vp"p"p"p"p"Gp"p"p"p"p"rPK! " ":_distutils/command/__pycache__/install_lib.cpython-311.pycnu[ ,Re ZdZddlZddlZddlZddlmZddlmZdZ GddeZ dS) zkdistutils.command.install_lib Implements the Distutils 'install_lib' command (install all Python modules).N)Command)DistutilsOptionErrorz.pycfeZdZdZgdZgdZddiZdZdZdZ d Z d Z d Z d Z d ZdZdZdS) install_libz7install all Python modules (extensions and pure Python)))z install-dir=dzdirectory to install to)z build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default]) no-compileNzdon't compile .py files)z optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]) skip-buildNzskip the build steps)r r rrr cZd|_d|_d|_d|_d|_d|_dS)Nr) install_dir build_dirr r optimize skip_buildselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_optionszinstall_lib.initialize_options7s1   c H|ddddddd|jd|_|jd |_t|jtsP t |j|_|jd vrt dS#t t f$rtd wxYwdS) Ninstall) build_libr)rr)r r )r r )rr)rrTF)rrzoptimize must be 0, 1, or 2)set_undefined_optionsr r isinstanceintAssertionError ValueErrorrrs rfinalize_optionszinstall_lib.finalize_options@s ""  & *  " $ (    < DL = !DM$--- J J #DM 2 2 = 11((21/ J J J*+HIII J  J Js )A>>!Bc||}|0|jr||dSdSdSN)buildr distributionhas_pure_modules byte_compileroutfiless rrunzinstall_lib.run[sb <<>>  D$5$F$F$H$H    h ' ' ' ' '   rc|js^|jr|d|jr|ddSdSdS)Nbuild_py build_ext)rr(r) run_commandhas_ext_modulesrs rr'zinstall_lib.buildks| . 1133 -  ,,, 0022 .  -----  . . . .rctj|jr!||j|j}n|d|jzdS|S)Nz3'%s' does not exist -- no Python modules to install)ospathisdirr copy_treerwarnr+s rrzinstall_lib.installrs` 7== ( ( ~~dnd6FGGHH IIEV    Frc2tjr|ddSddlm}|dj}|jr||d|j||j |j dkr'|||j |j||j |j dSdS)Nz%byte-compiling is disabled, skipping.r)r*rr)rr prefixdry_run)rr r:verboser;) sysdont_write_bytecoder8utilr*get_finalized_commandrootr r r;rr<)rfilesr* install_roots rr*zinstall_lib.byte_compile|s  "  II= > > > F'''''' 11)<<A <  Lj#      =1   Lj#          rc V|sgS||}|}t||}t|ttjz}g}|D]=} |tj|| |d>|Sr&) r@ get_outputsgetattrlenr4sepappendr5join) rhas_any build_cmd cmd_option output_dir build_filesr prefix_lenoutputsfiles r_mutate_outputszinstall_lib._mutate_outputss I..y99 ++-- Iz22 ^^c"&kk1  H HD NN27<< D4EFF G G G Grcg}|D]}tjtj|d}|tkrP|jr4|tj |d|j dkr9|tj ||j |S)Nr) optimizationr) r4r5splitextnormcasePYTHON_SOURCE_EXTENSIONr rI importlibr?cache_from_sourcer)r py_filenamesbytecode_filespy_fileexts r_bytecode_filenameszinstall_lib._bytecode_filenamess#  G'""27#3#3G#<#<==a@C---| %%N44W24NN}q  %%N44dm5 rc ||jdd|j}|jr||}ng}||jdd|j}||z|zS)zReturn the list of files that would be installed if this command were actually run. Not affected by the "dry-run" flag or whether modules have actually been built yet. r/rr0)rSr(r)rr r`r2)r pure_outputsbytecode_outputs ext_outputss rrEzinstall_lib.get_outputss ++   . . 0 0       < "#77 EE  ! **   - - / /       ..<rus!!   )))))) \\\\\'\\\\\rPK!Ga4_distutils/command/__pycache__/bdist.cpython-311.pycnu[ ,Re!dZddlZddlZddlmZddlmZmZddlm Z dZ Gdd e Z Gd d eZ dS) zidistutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).N)Command)DistutilsPlatformErrorDistutilsOptionError) get_platformcddlm}g}tjD]3}|d|zdtj|df4||}|ddS)zAPrint list of available formats (arguments to "--format" option).r) FancyGetoptformats=Nz'List of available distribution formats:) fancy_getoptr bdistformat_commandsappend print_help)r formatsformatpretty_printers /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/bdist.py show_formatsrs******G'VV V+T53H3PQR3STUUUU [))NGHHHHHceZdZdZdS) ListCompatc>tjdtddS)Nz4format_commands is now a dict. append is deprecated.r) stacklevel)warningswarnDeprecationWarning)selfitems rrzListCompat.appends. F       rN)__name__ __module__ __qualname__rrrrrs#     rrc eZdZdZddddezfdddd d gZd gZd d defgZdZ dddZ e ddddddddZ e Z dZdZdZd S)r z$create a built (binary) distribution)z bdist-base=bz4temporary directory for creating built distributionsz plat-name=pz;platform name to embed in generated filenames (default: %s))r Nz/formats for distribution (comma-separated list))z dist-dir=dz=directory to put final built distributions in [default: dist]) skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]r(z help-formatsNz$lists available distribution formats) bdist_rpmgztarzip)posixnt)r+zRPM distribution) bdist_dumbzgzip'ed tar file)r0zbzip2'ed tar file)r0zxz'ed tar file)r0zcompressed tar file)r0ztar file)r0zZIP file)rpmr,bztarxztarztartarr-chd|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_base plat_namerdist_dir skip_buildgroupowner)rs rinitialize_optionszbdist.initialize_options_s7    rc|j:|jrt|_n|dj|_|jG|dj}t j|d|jz|_| d|j I |j t j g|_ n*#t$rtdt j zwxYw|j d|_dSdS)Nbuildzbdist.rz;don't know how to create built distributions on platform %sdist)r8r:rget_finalized_commandr7 build_baseospathjoinensure_string_listrdefault_formatnameKeyErrorrr9)rrBs rfinalize_optionszbdist.finalize_optionshs > ! O!-!%!;!;G!D!D!N ? "33G<<GJ gll:x$.7PQQDO  *** <   $ 3BG <=    ,%')w/  = "DMMM ! s -C 'C2cg}|jD]I} ||j|d*#t$rt d|zwxYwt t |jD]}||}||}||jvr|j||_ |dkr|j |_ |j |_ |||dzdvrd|_ | |dS)Nrzinvalid format '%s'r0r )rrrrIrrangelenreinitialize_commandno_format_optionrr<r; keep_temp run_command)rcommandsricmd_namesub_cmds rrunz bdist.runs1l K KF K 4V ras  AAAAAAAAIII        z'z'z'z'z'Gz'z'z'z'z'rPK!RU<_distutils/command/__pycache__/build_scripts.cpython-311.pycnu[ ,RedZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z dd l mZddlZejd Z eZGd d eZdS) zRdistutils.command.build_scripts Implements the Distutils 'build_scripts' command.N)ST_MODE) sysconfig)Command)newer) convert_path)logz^#!.*python[0-9.]*([ ].*)?$cfeZdZdZgdZdgZdZdZdZdZ dZ d Z d Z d Z ed Zd S) build_scriptsz("build" scripts (copy and fixup #! line)))z build-dir=dzdirectory to "build" (copy) to)forcefz1forcibly build everything (ignore file timestamps)z executable=ez*specify final destination interpreter pathr c>d|_d|_d|_d|_dSN) build_dirscriptsr executableselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/build_scripts.pyinitialize_optionsz build_scripts.initialize_options$s"  cX|dddd|jj|_dS)Nbuild)r r)r r )rr)set_undefined_options distributionrrs rfinalize_optionszbuild_scripts.finalize_options*s9 ""  *  (    (0 rc|jSr)rrs rget_source_fileszbuild_scripts.get_source_files3s |rc@|jsdS|dSr)r copy_scriptsrs rrunzbuild_scripts.run6s)|  F rc||jg}g}|jD]}||||||||fS)a2 Copy each script listed in ``self.scripts``. If a script is marked as a Python script (first line matches 'shebang_pattern', i.e. starts with ``#!`` and contains "python"), then adjust in the copy the first line to refer to the current Python interpreter. )mkpathrr _copy_script _change_modes)routfiles updated_filesscripts rr"zbuild_scripts.copy_scripts;sm DN### l ? ?F   fh > > > > 8$$$&&rcVd}t|}tj|jtj|}|||js't||stj d|dS tj |}| }|s|d|zdSt|}n#t"$r |jsd}YnwxYw|||rTtjd||j|jst(js|j}n[tjt)jddt)jdt)jd}|dpd } d |z| zd z} || |jt|d |j 5} | | | |dddn #1swxYwY|r|dSdS|r||||dS)Nznot copying %s (up-to-date)z%s is an empty file (skipping)zcopying and adjusting %s -> %sBINDIRpythonVERSIONEXEz#! w)encoding) rospathjoinrbasenameappendr rr debugtokenizeopenreadlinewarnshebang_patternmatchOSErrordry_runinfor python_buildrget_config_vargroup_validate_shebangr4write writelines readlinesclose copy_file) rr*r(r) shebang_matchoutfiler first_liner post_interpshebangoutfs rr&zbuild_scripts._copy_scriptNs f%%',,t~rw/?/?/G/GHH   z %"8"8  I3V < < < F > f%%A J  :VCDDD+11*==MM   < AAA  W%%%  , H5vt~ N N N< 3 - !%JJ!#!0:::&4Y???%4U;;;""J,11!44: +k9D@&&w ;;;'3<<<3JJw'''OOAKKMM222333333333333333      NN67 + + + + +s$C77D D=IIIc^tjdkrdS|D]}||dS)Nposix)r5name _change_mode)rr(files rr'zbuild_scripts._change_modessD 7g   F $ $D   d # # # # $ $rc|jrtjd|dStj|t dz}|dzdz}||kr.tjd|||tj||dSdS)Nzchanging mode of %siimz!changing mode of %s from %o to %o)rBr rCr5statrchmod)rrWoldmodenewmodes rrVzbuild_scripts._change_modes <  H*D 1 1 1 F'$--(61U?f, g   H8$ Q Q Q HT7 # # # # #  rc" |dn0#t$r#td|wxYw ||dS#t$r$td||wxYw)Nzutf-8z,The shebang ({!r}) is not encodable to utf-8z?The shebang ({!r}) is not encodable to the script encoding ({}))encodeUnicodeEncodeError ValueErrorformat)rQr4s rrGzbuild_scripts._validate_shebangs  NN7 # # # #!   AHHQQ    NN8 $ $ $ $ $!   ..4fWh.G.G  s-A A .BN)__name__ __module__ __qualname__ description user_optionsboolean_optionsrrr r#r"r&r'rV staticmethodrGrrr r s>KL iO 111 '''&4,4,4,l$$$ $ $ $\rr )__doc__r5rerYr distutilsrcorerdep_utilrutilrdistutils._logr r;compiler? first_line_rer rirrrss55 "*<==  UUUUUGUUUUUrPK!O)o o >_distutils/command/__pycache__/install_headers.cpython-311.pycnu[ ,Re2dZddlmZGddeZdS)zdistutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.)Commandc>eZdZdZddgZdgZdZdZdZdZ d Z d S) install_headerszinstall C/C++ header files)z install-dir=dz$directory to install header files to)forcefz-force installation (overwrite existing files)rc0d|_d|_g|_dS)N) install_dirroutfilesselfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/install_headers.pyinitialize_optionsz"install_headers.initialize_optionss  c4|ddddS)Ninstall)rr )rr)set_undefined_optionsr s rfinalize_optionsz install_headers.finalize_optionss- "" 9;M     rc|jj}|sdS||j|D]:}|||j\}}|j|;dSN) distributionheadersmkpathr copy_filer append)rrheaderout_s rrunzinstall_headers.runs{#+  F D$%%% & &F~~fd.>??HS! M  % % % % & &rc|jjpgSr)rrr s r get_inputszinstall_headers.get_inputs)s (.B.rc|jSr)r r s r get_outputszinstall_headers.get_outputs,s }rN) __name__ __module__ __qualname__ description user_optionsboolean_optionsrrr r"r$rrrr s}.K FGL iO    &&&///rrN)__doc__corerrr+rrr.sW** #####g#####rPK!є9_distutils/command/__pycache__/build_clib.cpython-311.pycnu[ ,Re ddZddlZddlmZddlmZddlmZddlm Z dZ Gd d eZ dS) zdistutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.N)Command)DistutilsSetupError)customize_compiler)logc&ddlm}|dS)Nrshow_compilers) ccompilerr r s /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/build_clib.pyr r s(******NcZeZdZdZgdZddgZdddefgZdZd Z d Z d Z d Z d Z dZdS) build_clibz/build C/C++ libraries used by Python extensions))z build-clib=bz%directory to build C/C++ libraries to)z build-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z compiler=czspecify the compiler typerrz help-compilerNzlist available compilerscd|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr) r build_temp libraries include_dirsdefineundefrrcompilerselfs r initialize_optionszbuild_clib.initialize_options0sJ!     r c\|dddddd|jj|_|jr||j|j|jjpg|_t |jt r+|jtj |_dSdS)Nbuild)rr)rr)rr)rr)rr) set_undefined_options distributionrcheck_library_listr isinstancestrsplitospathseprs r finalize_optionszbuild_clib.finalize_options?s ""  ( ( $      *4 > 4  # #DN 3 3 3   $ $ 1 > D"D  d' - - D $ 1 7 7 C CD    D Dr c|jsdSddlm}||j|j|j|_t |j|j|j|j|j (|j D] \}}|j ||!|j $|j D]}|j || |jdS)Nr) new_compiler)rdry_runr)rr r-rr.rrrset_include_dirsr define_macrorundefine_macrobuild_libraries)rr-namevaluemacros r runzbuild_clib.runZs~  F -,,,,,$ ]DL      4=)))   ( M * *4+< = = = ; "!% 8 8 u **47777 : ! 4 4 ,,U3333 T^,,,,,r ct|tstd|D]}t|ts"t |dkrtd|\}}t|t stdd|vst jdkr&t j|vrtd|dzt|tstdd S) a`Ensure that the list of libraries is valid. `library` is presumably provided as a command option 'libraries'. This method checks that it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. z+'libraries' option must be a list of tuplesrz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N) r&listrtuplelenr'r)sepdict)rrlibr3 build_infos r r%zbuild_clib.check_library_listrs)T** U%&STT T  Cc5)) Xc#hh!mm)*VWWW" D*dC(( ): d{{rv}}4);=@VD j$// )8 %  r c`|jsdSg}|jD]\}}|||S)N)rappend)r lib_nameslib_namer?s r get_library_nameszbuild_clib.get_library_namessK~ 4 &*n ' ' "Xz   X & & & &r c ||jg}|jD]_\}}|d}|t|tt fst d|z||`|S)Nsourcesfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r%rgetr&r9r:rextend)r filenamesrCr?rFs r get_source_fileszbuild_clib.get_source_filess /// &*n & & "Xz nnY//Gj4-&H&H)13;<   W % % % %r c|D]\}}|d}|t|ttfst d|zt|}t jd||d}|d}|j||j |||j }|j |||j |j dS)NrFrGzbuilding '%s' librarymacrosr) output_dirrMrr)rNr) rHr&r9r:rrinforcompilerrcreate_static_libr)rrrCr?rFrMrobjectss r r2zbuild_clib.build_librariess &/   "Xz nnY//Gj4-&H&H)13;< 7mmG H,h 7 7 7  ^^H--F%>>.99Lm++?)j ,G M + +doTZ ,    9  r )__name__ __module__ __qualname__ description user_optionsboolean_optionsr help_optionsr r+r6r%rDrKr2r r rrsCKL(O $ :NKL   DDD6---0###J      r r) __doc__r)corererrorsr sysconfigrdistutils._logrr rrZr r r`s   ((((((****** rrrrrrrrrrr PK!W9_distutils/command/__pycache__/bdist_dumb.cpython-311.pycnu[ ,Re:zdZddlZddlmZddlmZddlmZmZddl m Z ddl m Z dd l mZGd d eZdS) zdistutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).N)Command) get_platform) remove_treeensure_relative)DistutilsPlatformError)get_python_version)logc heZdZdZddddezfdddd d d d g Zgd ZdddZdZdZ dZ dS) bdist_dumbz"create a "dumb" built distribution)z bdist-dir=dz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s))zformat=fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip)) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z dist-dir=r z-directory to put final built distributions in) skip-buildNz2skip rebuilding everything (for testing/debugging))relativeNz7build the archive using relative paths (default: false))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])rrrgztarzip)posixntcd|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_nameformat keep_tempdist_dir skip_buildrownergroup)selfs /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/command/bdist_dumb.pyinitialize_optionszbdist_dumb.initialize_options>sE     c`|j?|dj}tj|d|_|jH |jtj|_n*#t$rtdtjzwxYw| dddddS)Nbdistdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)r r ) rget_finalized_command bdist_baseospathjoinrdefault_formatnameKeyErrorrset_undefined_options)r#r+s r$finalize_optionszbdist_dumb.finalize_optionsIs > !33G<<GJW\\*f==DN ;  "1"':    ,%')w/  ""  $ & (      s A,,'Bc:|js|d|dd}|j|_|j|_d|_t jd|j|dd|j |j }tj |j|}|js|j}n|j rJ|j|jkr:t)dt+|jd t+|jd tj |jt-|j}|||j||j|j }|j rt5}nd }|j jd ||f|jst=|j|jdSdS)Nbuildinstall)reinit_subcommandsrzinstalling to %sz{}.{}zLcan't make a dumb built distribution where base and platbase are different (z, ))root_dirr!r"anyr )dry_run) r run_commandreinitialize_commandrrootwarn_dirr infor distribution get_fullnamerr,r-r.rrhas_ext_modules install_baseinstall_platbaserreprr make_archiver!r"r dist_filesappendrrr<)r#r6archive_basenamepseudoinstall_root archive_rootfilename pyversions r$runzbdist_dumb.run^s &   W % % %++I!+LL~ !_ #T^444 ####>>   * * , ,dn   W\\$-9IJJ} >LL 0022 $(@@@,,G0111148P3Q3Q3Q3QS "w||NOG4H$I$I   $$  K!** %     , , . . *,,III $++\9h,OPPP~ >  = = = = = = > >r&N) __name__ __module__ __qualname__ descriptionr user_optionsboolean_optionsr/r%r3rPr&r$r r s8K Q   *lnn -   LR   ?$LL>==O&e44N      *2>2>2>2>2>r&r )__doc__r,corerutilrdir_utilrrerrorsr sysconfigr distutils._logr r rWr&r$r_s  33333333++++++******@>@>@>@>@>@>@>@>@>@>r&PK!, _distutils/command/clean.pynu["""distutils.command.clean Implements the Distutils 'clean' command.""" # contributed by Bastian Kleineidam , added 2000-03-18 import os from distutils.core import Command from distutils.dir_util import remove_tree from distutils import log class clean(Command): description = "clean up temporary files from 'build' command" user_options = [ ('build-base=', 'b', "base build directory (default: 'build.build-base')"), ('build-lib=', None, "build directory for all modules (default: 'build.build-lib')"), ('build-temp=', 't', "temporary build directory (default: 'build.build-temp')"), ('build-scripts=', None, "build directory for scripts (default: 'build.build-scripts')"), ('bdist-base=', None, "temporary directory for built distributions"), ('all', 'a', "remove all build output, not just temporary by-products") ] boolean_options = ['all'] def initialize_options(self): self.build_base = None self.build_lib = None self.build_temp = None self.build_scripts = None self.bdist_base = None self.all = None def finalize_options(self): self.set_undefined_options('build', ('build_base', 'build_base'), ('build_lib', 'build_lib'), ('build_scripts', 'build_scripts'), ('build_temp', 'build_temp')) self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) def run(self): # remove the build/temp. directory (unless it's already # gone) if os.path.exists(self.build_temp): remove_tree(self.build_temp, dry_run=self.dry_run) else: log.debug("'%s' does not exist -- can't clean it", self.build_temp) if self.all: # remove build directories for directory in (self.build_lib, self.bdist_base, self.build_scripts): if os.path.exists(directory): remove_tree(directory, dry_run=self.dry_run) else: log.warn("'%s' does not exist -- can't clean it", directory) # just for the heck of it, try to remove the base build directory: # we might have emptied it right now, but if not we don't care if not self.dry_run: try: os.rmdir(self.build_base) log.info("removing '%s'", self.build_base) except OSError: pass PK!t=J=J_distutils/command/sdist.pynu["""distutils.command.sdist Implements the Distutils 'sdist' command (create a source distribution).""" import os import sys from glob import glob from warnings import warn from distutils.core import Command from distutils import dir_util from distutils import file_util from distutils import archive_util from distutils.text_file import TextFile from distutils.filelist import FileList from distutils import log from distutils.util import convert_path from distutils.errors import DistutilsTemplateError, DistutilsOptionError def show_formats(): """Print all possible values for the 'formats' option (used by the "--help-formats" command-line option). """ from distutils.fancy_getopt import FancyGetopt from distutils.archive_util import ARCHIVE_FORMATS formats = [] for format in ARCHIVE_FORMATS.keys(): formats.append(("formats=" + format, None, ARCHIVE_FORMATS[format][2])) formats.sort() FancyGetopt(formats).print_help( "List of available source distribution formats:") class sdist(Command): description = "create a source distribution (tarball, zip file, etc.)" def checking_metadata(self): """Callable used for the check sub-command. Placed here so user_options can view it""" return self.metadata_check user_options = [ ('template=', 't', "name of manifest template file [default: MANIFEST.in]"), ('manifest=', 'm', "name of manifest file [default: MANIFEST]"), ('use-defaults', None, "include the default file set in the manifest " "[default; disable with --no-defaults]"), ('no-defaults', None, "don't include the default file set"), ('prune', None, "specifically exclude files/directories that should not be " "distributed (build tree, RCS/CVS dirs, etc.) " "[default; disable with --no-prune]"), ('no-prune', None, "don't automatically exclude anything"), ('manifest-only', 'o', "just regenerate the manifest and then stop " "(implies --force-manifest)"), ('force-manifest', 'f', "forcibly regenerate the manifest and carry on as usual. " "Deprecated: now the manifest is always regenerated."), ('formats=', None, "formats for source distribution (comma-separated list)"), ('keep-temp', 'k', "keep the distribution tree around after creating " + "archive file(s)"), ('dist-dir=', 'd', "directory to put the source distribution archive(s) in " "[default: dist]"), ('metadata-check', None, "Ensure that all required elements of meta-data " "are supplied. Warn if any missing. [default]"), ('owner=', 'u', "Owner name used when creating a tar file [default: current user]"), ('group=', 'g', "Group name used when creating a tar file [default: current group]"), ] boolean_options = ['use-defaults', 'prune', 'manifest-only', 'force-manifest', 'keep-temp', 'metadata-check'] help_options = [ ('help-formats', None, "list available distribution formats", show_formats), ] negative_opt = {'no-defaults': 'use-defaults', 'no-prune': 'prune' } sub_commands = [('check', checking_metadata)] READMES = ('README', 'README.txt', 'README.rst') def initialize_options(self): # 'template' and 'manifest' are, respectively, the names of # the manifest template and manifest file. self.template = None self.manifest = None # 'use_defaults': if true, we will include the default file set # in the manifest self.use_defaults = 1 self.prune = 1 self.manifest_only = 0 self.force_manifest = 0 self.formats = ['gztar'] self.keep_temp = 0 self.dist_dir = None self.archive_files = None self.metadata_check = 1 self.owner = None self.group = None def finalize_options(self): if self.manifest is None: self.manifest = "MANIFEST" if self.template is None: self.template = "MANIFEST.in" self.ensure_string_list('formats') bad_format = archive_util.check_archive_formats(self.formats) if bad_format: raise DistutilsOptionError( "unknown archive format '%s'" % bad_format) if self.dist_dir is None: self.dist_dir = "dist" def run(self): # 'filelist' contains the list of files that will make up the # manifest self.filelist = FileList() # Run sub commands for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) # Do whatever it takes to get the list of files to process # (process the manifest template, read an existing manifest, # whatever). File list is accumulated in 'self.filelist'. self.get_file_list() # If user just wanted us to regenerate the manifest, stop now. if self.manifest_only: return # Otherwise, go ahead and create the source distribution tarball, # or zipfile, or whatever. self.make_distribution() def check_metadata(self): """Deprecated API.""" warn("distutils.command.sdist.check_metadata is deprecated, \ use the check command instead", PendingDeprecationWarning) check = self.distribution.get_command_obj('check') check.ensure_finalized() check.run() def get_file_list(self): """Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options. """ # new behavior when using a template: # the file list is recalculated every time because # even if MANIFEST.in or setup.py are not changed # the user might have added some files in the tree that # need to be included. # # This makes --force the default and only behavior with templates. template_exists = os.path.isfile(self.template) if not template_exists and self._manifest_is_not_generated(): self.read_manifest() self.filelist.sort() self.filelist.remove_duplicates() return if not template_exists: self.warn(("manifest template '%s' does not exist " + "(using default file list)") % self.template) self.filelist.findall() if self.use_defaults: self.add_defaults() if template_exists: self.read_template() if self.prune: self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() self.write_manifest() def add_defaults(self): """Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. """ self._add_defaults_standards() self._add_defaults_optional() self._add_defaults_python() self._add_defaults_data_files() self._add_defaults_ext() self._add_defaults_c_libs() self._add_defaults_scripts() @staticmethod def _cs_path_exists(fspath): """ Case-sensitive path existence check >>> sdist._cs_path_exists(__file__) True >>> sdist._cs_path_exists(__file__.upper()) False """ if not os.path.exists(fspath): return False # make absolute so we always have a directory abspath = os.path.abspath(fspath) directory, filename = os.path.split(abspath) return filename in os.listdir(directory) def _add_defaults_standards(self): standards = [self.READMES, self.distribution.script_name] for fn in standards: if isinstance(fn, tuple): alts = fn got_it = False for fn in alts: if self._cs_path_exists(fn): got_it = True self.filelist.append(fn) break if not got_it: self.warn("standard file not found: should have one of " + ', '.join(alts)) else: if self._cs_path_exists(fn): self.filelist.append(fn) else: self.warn("standard file '%s' not found" % fn) def _add_defaults_optional(self): optional = ['test/test*.py', 'setup.cfg'] for pattern in optional: files = filter(os.path.isfile, glob(pattern)) self.filelist.extend(files) def _add_defaults_python(self): # build_py is used to get: # - python modules # - files defined in package_data build_py = self.get_finalized_command('build_py') # getting python files if self.distribution.has_pure_modules(): self.filelist.extend(build_py.get_source_files()) # getting package_data files # (computed in build_py.data_files by build_py.finalize_options) for pkg, src_dir, build_dir, filenames in build_py.data_files: for filename in filenames: self.filelist.append(os.path.join(src_dir, filename)) def _add_defaults_data_files(self): # getting distribution.data_files if self.distribution.has_data_files(): for item in self.distribution.data_files: if isinstance(item, str): # plain file item = convert_path(item) if os.path.isfile(item): self.filelist.append(item) else: # a (dirname, filenames) tuple dirname, filenames = item for f in filenames: f = convert_path(f) if os.path.isfile(f): self.filelist.append(f) def _add_defaults_ext(self): if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) def _add_defaults_c_libs(self): if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command('build_clib') self.filelist.extend(build_clib.get_source_files()) def _add_defaults_scripts(self): if self.distribution.has_scripts(): build_scripts = self.get_finalized_command('build_scripts') self.filelist.extend(build_scripts.get_source_files()) def read_template(self): """Read and parse manifest template file named by self.template. (usually "MANIFEST.in") The parsing and processing is done by 'self.filelist', which updates itself accordingly. """ log.info("reading manifest template '%s'", self.template) template = TextFile(self.template, strip_comments=1, skip_blanks=1, join_lines=1, lstrip_ws=1, rstrip_ws=1, collapse_join=1) try: while True: line = template.readline() if line is None: # end of file break try: self.filelist.process_template_line(line) # the call above can raise a DistutilsTemplateError for # malformed lines, or a ValueError from the lower-level # convert_path function except (DistutilsTemplateError, ValueError) as msg: self.warn("%s, line %d: %s" % (template.filename, template.current_line, msg)) finally: template.close() def prune_file_list(self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") * the release tree itself (only an issue if we ran "sdist" previously with --keep-temp, or it aborted) * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories """ build = self.get_finalized_command('build') base_dir = self.distribution.get_fullname() self.filelist.exclude_pattern(None, prefix=build.build_base) self.filelist.exclude_pattern(None, prefix=base_dir) if sys.platform == 'win32': seps = r'/|\\' else: seps = '/' vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr', '_darcs'] vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) def write_manifest(self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ if self._manifest_is_not_generated(): log.info("not writing to manually maintained " "manifest file '%s'" % self.manifest) return content = self.filelist.files[:] content.insert(0, '# file GENERATED by distutils, do NOT edit') self.execute(file_util.write_file, (self.manifest, content), "writing manifest file '%s'" % self.manifest) def _manifest_is_not_generated(self): # check for special comment used in 3.1.3 and higher if not os.path.isfile(self.manifest): return False fp = open(self.manifest) try: first_line = fp.readline() finally: fp.close() return first_line != '# file GENERATED by distutils, do NOT edit\n' def read_manifest(self): """Read the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. """ log.info("reading manifest file '%s'", self.manifest) with open(self.manifest) as manifest: for line in manifest: # ignore comments and blank lines line = line.strip() if line.startswith('#') or not line: continue self.filelist.append(line) def make_release_tree(self, base_dir, files): """Create the directory tree that will become the source distribution archive. All directories implied by the filenames in 'files' are created under 'base_dir', and then we hard link or copy (if hard linking is unavailable) those files into place. Essentially, this duplicates the developer's source tree, but in a directory named after the distribution, containing only the files to be distributed. """ # Create all the directories under 'base_dir' necessary to # put 'files' there; the 'mkpath()' is just so we don't die # if the manifest happens to be empty. self.mkpath(base_dir) dir_util.create_tree(base_dir, files, dry_run=self.dry_run) # And walk over the list of files, either making a hard link (if # os.link exists) to each one that doesn't already exist in its # corresponding location under 'base_dir', or copying each file # that's out-of-date in 'base_dir'. (Usually, all files will be # out-of-date, because by default we blow away 'base_dir' when # we're done making the distribution archives.) if hasattr(os, 'link'): # can make hard links on this system link = 'hard' msg = "making hard links in %s..." % base_dir else: # nope, have to copy link = None msg = "copying files to %s..." % base_dir if not files: log.warn("no files to distribute -- empty manifest?") else: log.info(msg) for file in files: if not os.path.isfile(file): log.warn("'%s' not a regular file -- skipping", file) else: dest = os.path.join(base_dir, file) self.copy_file(file, dest, link=link) self.distribution.metadata.write_pkg_info(base_dir) def make_distribution(self): """Create the source distribution(s). First, we create the release tree with 'make_release_tree()'; then, we create all required archive files (according to 'self.formats') from the release tree. Finally, we clean up by blowing away the release tree (unless 'self.keep_temp' is true). The list of archive files created is stored so it can be retrieved later by 'get_archive_files()'. """ # Don't warn about missing meta-data here -- should be (and is!) # done elsewhere. base_dir = self.distribution.get_fullname() base_name = os.path.join(self.dist_dir, base_dir) self.make_release_tree(base_dir, self.filelist.files) archive_files = [] # remember names of files we create # tar archive must be created last to avoid overwrite and remove if 'tar' in self.formats: self.formats.append(self.formats.pop(self.formats.index('tar'))) for fmt in self.formats: file = self.make_archive(base_name, fmt, base_dir=base_dir, owner=self.owner, group=self.group) archive_files.append(file) self.distribution.dist_files.append(('sdist', '', file)) self.archive_files = archive_files if not self.keep_temp: dir_util.remove_tree(base_dir, dry_run=self.dry_run) def get_archive_files(self): """Return the list of archive files created when the command was run, or None if the command hasn't run yet. """ return self.archive_files PK!9R)S+ + &_distutils/command/install_egg_info.pynu["""distutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata.""" from distutils.cmd import Command from distutils import log, dir_util import os, sys, re class install_egg_info(Command): """Install an .egg-info file for the package""" description = "Install package's PKG-INFO metadata as an .egg-info file" user_options = [ ('install-dir=', 'd', "directory to install to"), ] def initialize_options(self): self.install_dir = None def finalize_options(self): self.set_undefined_options('install_lib',('install_dir','install_dir')) basename = "%s-%s-py%d.%d.egg-info" % ( to_filename(safe_name(self.distribution.get_name())), to_filename(safe_version(self.distribution.get_version())), *sys.version_info[:2] ) self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] def run(self): target = self.target if os.path.isdir(target) and not os.path.islink(target): dir_util.remove_tree(target, dry_run=self.dry_run) elif os.path.exists(target): self.execute(os.unlink,(self.target,),"Removing "+target) elif not os.path.isdir(self.install_dir): self.execute(os.makedirs, (self.install_dir,), "Creating "+self.install_dir) log.info("Writing %s", target) if not self.dry_run: with open(target, 'w', encoding='UTF-8') as f: self.distribution.metadata.write_pkg_file(f) def get_outputs(self): return self.outputs # The following routines are taken from setuptools' pkg_resources module and # can be replaced by importing them from pkg_resources once it is included # in the stdlib. def safe_name(name): """Convert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. """ return re.sub('[^A-Za-z0-9.]+', '-', name) def safe_version(version): """Convert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash. """ version = version.replace(' ','.') return re.sub('[^A-Za-z0-9.]+', '-', version) def to_filename(name): """Convert a project or version name to its filename-escaped form Any '-' characters are currently replaced with '_'. """ return name.replace('-','_') PK!m_distutils/command/check.pynu["""distutils.command.check Implements the Distutils 'check' command. """ from distutils.core import Command from distutils.errors import DistutilsSetupError try: # docutils is installed from docutils.utils import Reporter from docutils.parsers.rst import Parser from docutils import frontend from docutils import nodes class SilentReporter(Reporter): def __init__(self, source, report_level, halt_level, stream=None, debug=0, encoding='ascii', error_handler='replace'): self.messages = [] Reporter.__init__(self, source, report_level, halt_level, stream, debug, encoding, error_handler) def system_message(self, level, message, *children, **kwargs): self.messages.append((level, message, children, kwargs)) return nodes.system_message(message, level=level, type=self.levels[level], *children, **kwargs) HAS_DOCUTILS = True except Exception: # Catch all exceptions because exceptions besides ImportError probably # indicate that docutils is not ported to Py3k. HAS_DOCUTILS = False class check(Command): """This command checks the meta-data of the package. """ description = ("perform some checks on the package") user_options = [('metadata', 'm', 'Verify meta-data'), ('restructuredtext', 'r', ('Checks if long string meta-data syntax ' 'are reStructuredText-compliant')), ('strict', 's', 'Will exit with an error if a check fails')] boolean_options = ['metadata', 'restructuredtext', 'strict'] def initialize_options(self): """Sets default values for options.""" self.restructuredtext = 0 self.metadata = 1 self.strict = 0 self._warnings = 0 def finalize_options(self): pass def warn(self, msg): """Counts the number of warnings that occurs.""" self._warnings += 1 return Command.warn(self, msg) def run(self): """Runs the command.""" # perform the various tests if self.metadata: self.check_metadata() if self.restructuredtext: if HAS_DOCUTILS: self.check_restructuredtext() elif self.strict: raise DistutilsSetupError('The docutils package is needed.') # let's raise an error in strict mode, if we have at least # one warning if self.strict and self._warnings > 0: raise DistutilsSetupError('Please correct your package.') def check_metadata(self): """Ensures that all required elements of meta-data are supplied. Required fields: name, version, URL Recommended fields: (author and author_email) or (maintainer and maintainer_email)) Warns if any are missing. """ metadata = self.distribution.metadata missing = [] for attr in ('name', 'version', 'url'): if not (hasattr(metadata, attr) and getattr(metadata, attr)): missing.append(attr) if missing: self.warn("missing required meta-data: %s" % ', '.join(missing)) if metadata.author: if not metadata.author_email: self.warn("missing meta-data: if 'author' supplied, " + "'author_email' should be supplied too") elif metadata.maintainer: if not metadata.maintainer_email: self.warn("missing meta-data: if 'maintainer' supplied, " + "'maintainer_email' should be supplied too") else: self.warn("missing meta-data: either (author and author_email) " + "or (maintainer and maintainer_email) " + "should be supplied") def check_restructuredtext(self): """Checks if the long string fields are reST-compliant.""" data = self.distribution.get_long_description() for warning in self._check_rst_data(data): line = warning[-1].get('line') if line is None: warning = warning[1] else: warning = '%s (line %s)' % (warning[1], line) self.warn(warning) def _check_rst_data(self, data): """Returns warnings when the provided data doesn't compile.""" # the include and csv_table directives need this to be a path source_path = self.distribution.script_name or 'setup.py' parser = Parser() settings = frontend.OptionParser(components=(Parser,)).get_default_values() settings.tab_width = 4 settings.pep_references = None settings.rfc_references = None reporter = SilentReporter(source_path, settings.report_level, settings.halt_level, stream=settings.warning_stream, debug=settings.debug, encoding=settings.error_encoding, error_handler=settings.error_encoding_error_handler) document = nodes.document(settings, reporter, source=source_path) document.note_source(source_path, -1) try: parser.parse(data, document) except AttributeError as e: reporter.messages.append( (-1, 'Could not finish the parsing: %s.' % e, '', {})) return reporter.messages PK!Ch _distutils/command/py37compat.pynu[import sys def _pythonlib_compat(): """ On Python 3.7 and earlier, distutils would include the Python library. See pypa/distutils#9. """ from distutils import sysconfig if not sysconfig.get_config_var('Py_ENABLED_SHARED'): return yield 'python{}.{}{}'.format( sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, sysconfig.get_config_var('ABIFLAGS'), ) def compose(f1, f2): return lambda *args, **kwargs: f1(f2(*args, **kwargs)) pythonlib = ( compose(list, _pythonlib_compat) if sys.version_info < (3, 8) and sys.platform != 'darwin' and sys.platform[:3] != 'aix' else list ) PK!iTkk_distutils/command/install.pynu["""distutils.command.install Implements the Distutils 'install' command.""" import sys import os from distutils import log from distutils.core import Command from distutils.debug import DEBUG from distutils.sysconfig import get_config_vars from distutils.errors import DistutilsPlatformError from distutils.file_util import write_file from distutils.util import convert_path, subst_vars, change_root from distutils.util import get_platform from distutils.errors import DistutilsOptionError from site import USER_BASE from site import USER_SITE HAS_USER_SITE = True WINDOWS_SCHEME = { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', } INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', 'platlib': '$platbase/$platlibdir/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'unix_home': { 'purelib': '$base/lib/python', 'platlib': '$base/$platlibdir/python', 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'nt': WINDOWS_SCHEME, 'pypy': { 'purelib': '$base/site-packages', 'platlib': '$base/site-packages', 'headers': '$base/include/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'pypy_nt': { 'purelib': '$base/site-packages', 'platlib': '$base/site-packages', 'headers': '$base/include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', }, } # user site schemes if HAS_USER_SITE: INSTALL_SCHEMES['nt_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', 'scripts': '$userbase/Python$py_version_nodot/Scripts', 'data' : '$userbase', } INSTALL_SCHEMES['unix_user'] = { 'purelib': '$usersite', 'platlib': '$usersite', 'headers': '$userbase/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$userbase/bin', 'data' : '$userbase', } # The keys to an installation scheme; if any new types of files are to be # installed, be sure to add an entry to every installation scheme above, # and to SCHEME_KEYS here. SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data') class install(Command): description = "install everything from build directory" user_options = [ # Select installation scheme and set base director(y|ies) ('prefix=', None, "installation prefix"), ('exec-prefix=', None, "(Unix only) prefix for platform-specific files"), ('home=', None, "(Unix only) home directory to install under"), # Or, just set the base director(y|ies) ('install-base=', None, "base installation directory (instead of --prefix or --home)"), ('install-platbase=', None, "base installation directory for platform-specific files " + "(instead of --exec-prefix or --home)"), ('root=', None, "install everything relative to this alternate root directory"), # Or, explicitly set the installation scheme ('install-purelib=', None, "installation directory for pure Python module distributions"), ('install-platlib=', None, "installation directory for non-pure module distributions"), ('install-lib=', None, "installation directory for all module distributions " + "(overrides --install-purelib and --install-platlib)"), ('install-headers=', None, "installation directory for C/C++ headers"), ('install-scripts=', None, "installation directory for Python scripts"), ('install-data=', None, "installation directory for data files"), # Byte-compilation options -- see install_lib.py for details, as # these are duplicated from there (but only install_lib does # anything with them). ('compile', 'c', "compile .py to .pyc [default]"), ('no-compile', None, "don't compile .py files"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), # Miscellaneous control options ('force', 'f', "force installation (overwrite any existing files)"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), # Where to install documentation (eventually!) #('doc-format=', None, "format of documentation to generate"), #('install-man=', None, "directory for Unix man pages"), #('install-html=', None, "directory for HTML documentation"), #('install-info=', None, "directory for GNU info files"), ('record=', None, "filename in which to record list of installed files"), ] boolean_options = ['compile', 'force', 'skip-build'] if HAS_USER_SITE: user_options.append(('user', None, "install in user site-package '%s'" % USER_SITE)) boolean_options.append('user') negative_opt = {'no-compile' : 'compile'} def initialize_options(self): """Initializes options.""" # High-level options: these select both an installation base # and scheme. self.prefix = None self.exec_prefix = None self.home = None self.user = 0 # These select only the installation base; it's up to the user to # specify the installation scheme (currently, that means supplying # the --install-{platlib,purelib,scripts,data} options). self.install_base = None self.install_platbase = None self.root = None # These options are the actual installation directories; if not # supplied by the user, they are filled in using the installation # scheme implied by prefix/exec-prefix/home and the contents of # that installation scheme. self.install_purelib = None # for pure module distributions self.install_platlib = None # non-pure (dists w/ extensions) self.install_headers = None # for C/C++ headers self.install_lib = None # set to either purelib or platlib self.install_scripts = None self.install_data = None self.install_userbase = USER_BASE self.install_usersite = USER_SITE self.compile = None self.optimize = None # Deprecated # These two are for putting non-packagized distributions into their # own directory and creating a .pth file if it makes sense. # 'extra_path' comes from the setup file; 'install_path_file' can # be turned off if it makes no sense to install a .pth file. (But # better to install it uselessly than to guess wrong and not # install it when it's necessary and would be used!) Currently, # 'install_path_file' is always true unless some outsider meddles # with it. self.extra_path = None self.install_path_file = 1 # 'force' forces installation, even if target files are not # out-of-date. 'skip_build' skips running the "build" command, # handy if you know it's not necessary. 'warn_dir' (which is *not* # a user option, it's just there so the bdist_* commands can turn # it off) determines whether we warn about installing to a # directory not in sys.path. self.force = 0 self.skip_build = 0 self.warn_dir = 1 # These are only here as a conduit from the 'build' command to the # 'install_*' commands that do the real work. ('build_base' isn't # actually used anywhere, but it might be useful in future.) They # are not user options, because if the user told the install # command where the build directory is, that wouldn't affect the # build command. self.build_base = None self.build_lib = None # Not defined yet because we don't know anything about # documentation yet. #self.install_man = None #self.install_html = None #self.install_info = None self.record = None # -- Option finalizing methods ------------------------------------- # (This is rather more involved than for most commands, # because this is where the policy for installing third- # party Python modules on various platforms given a wide # array of user input is decided. Yes, it's quite complex!) def finalize_options(self): """Finalizes options.""" # This method (and its helpers, like 'finalize_unix()', # 'finalize_other()', and 'select_scheme()') is where the default # installation directories for modules, extension modules, and # anything else we care to install from a Python module # distribution. Thus, this code makes a pretty important policy # statement about how third-party stuff is added to a Python # installation! Note that the actual work of installation is done # by the relatively simple 'install_*' commands; they just take # their orders from the installation directory options determined # here. # Check for errors/inconsistencies in the options; first, stuff # that's wrong on any platform. if ((self.prefix or self.exec_prefix or self.home) and (self.install_base or self.install_platbase)): raise DistutilsOptionError( "must supply either prefix/exec-prefix/home or " + "install-base/install-platbase -- not both") if self.home and (self.prefix or self.exec_prefix): raise DistutilsOptionError( "must supply either home or prefix/exec-prefix -- not both") if self.user and (self.prefix or self.exec_prefix or self.home or self.install_base or self.install_platbase): raise DistutilsOptionError("can't combine user with prefix, " "exec_prefix/home, or install_(plat)base") # Next, stuff that's wrong (or dubious) only on certain platforms. if os.name != "posix": if self.exec_prefix: self.warn("exec-prefix option ignored on this platform") self.exec_prefix = None # Now the interesting logic -- so interesting that we farm it out # to other methods. The goal of these methods is to set the final # values for the install_{lib,scripts,data,...} options, using as # input a heady brew of prefix, exec_prefix, home, install_base, # install_platbase, user-supplied versions of # install_{purelib,platlib,lib,scripts,data,...}, and the # INSTALL_SCHEME dictionary above. Phew! self.dump_dirs("pre-finalize_{unix,other}") if os.name == 'posix': self.finalize_unix() else: self.finalize_other() self.dump_dirs("post-finalize_{unix,other}()") # Expand configuration variables, tilde, etc. in self.install_base # and self.install_platbase -- that way, we can use $base or # $platbase in the other installation directories and not worry # about needing recursive variable expansion (shudder). py_version = sys.version.split()[0] (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix') try: abiflags = sys.abiflags except AttributeError: # sys.abiflags may not be defined on all platforms. abiflags = '' self.config_vars = {'dist_name': self.distribution.get_name(), 'dist_version': self.distribution.get_version(), 'dist_fullname': self.distribution.get_fullname(), 'py_version': py_version, 'py_version_short': '%d.%d' % sys.version_info[:2], 'py_version_nodot': '%d%d' % sys.version_info[:2], 'sys_prefix': prefix, 'prefix': prefix, 'sys_exec_prefix': exec_prefix, 'exec_prefix': exec_prefix, 'abiflags': abiflags, 'platlibdir': getattr(sys, 'platlibdir', 'lib'), } if HAS_USER_SITE: self.config_vars['userbase'] = self.install_userbase self.config_vars['usersite'] = self.install_usersite self.expand_basedirs() self.dump_dirs("post-expand_basedirs()") # Now define config vars for the base directories so we can expand # everything else. self.config_vars['base'] = self.install_base self.config_vars['platbase'] = self.install_platbase if DEBUG: from pprint import pprint print("config vars:") pprint(self.config_vars) # Expand "~" and configuration variables in the installation # directories. self.expand_dirs() self.dump_dirs("post-expand_dirs()") # Create directories in the home dir: if self.user: self.create_home_path() # Pick the actual directory to install all modules to: either # install_purelib or install_platlib, depending on whether this # module distribution is pure or not. Of course, if the user # already specified install_lib, use their selection. if self.install_lib is None: if self.distribution.has_ext_modules(): # has extensions: non-pure self.install_lib = self.install_platlib else: self.install_lib = self.install_purelib # Convert directories from Unix /-separated syntax to the local # convention. self.convert_paths('lib', 'purelib', 'platlib', 'scripts', 'data', 'headers', 'userbase', 'usersite') # Deprecated # Well, we're not actually fully completely finalized yet: we still # have to deal with 'extra_path', which is the hack for allowing # non-packagized module distributions (hello, Numerical Python!) to # get their own directories. self.handle_extra_path() self.install_libbase = self.install_lib # needed for .pth file self.install_lib = os.path.join(self.install_lib, self.extra_dirs) # If a new root directory was supplied, make all the installation # dirs relative to it. if self.root is not None: self.change_roots('libbase', 'lib', 'purelib', 'platlib', 'scripts', 'data', 'headers') self.dump_dirs("after prepending root") # Find out the build directories, ie. where to install from. self.set_undefined_options('build', ('build_base', 'build_base'), ('build_lib', 'build_lib')) # Punt on doc directories for now -- after all, we're punting on # documentation completely! def dump_dirs(self, msg): """Dumps the list of user options.""" if not DEBUG: return from distutils.fancy_getopt import longopt_xlate log.debug(msg + ":") for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] if opt_name in self.negative_opt: opt_name = self.negative_opt[opt_name] opt_name = opt_name.translate(longopt_xlate) val = not getattr(self, opt_name) else: opt_name = opt_name.translate(longopt_xlate) val = getattr(self, opt_name) log.debug(" %s: %s", opt_name, val) def finalize_unix(self): """Finalizes options for posix platforms.""" if self.install_base is not None or self.install_platbase is not None: if ((self.install_lib is None and self.install_purelib is None and self.install_platlib is None) or self.install_headers is None or self.install_scripts is None or self.install_data is None): raise DistutilsOptionError( "install-base or install-platbase supplied, but " "installation scheme is incomplete") return if self.user: if self.install_userbase is None: raise DistutilsPlatformError( "User base directory is not specified") self.install_base = self.install_platbase = self.install_userbase self.select_scheme("unix_user") elif self.home is not None: self.install_base = self.install_platbase = self.home self.select_scheme("unix_home") else: if self.prefix is None: if self.exec_prefix is not None: raise DistutilsOptionError( "must not supply exec-prefix without prefix") self.prefix = os.path.normpath(sys.prefix) self.exec_prefix = os.path.normpath(sys.exec_prefix) else: if self.exec_prefix is None: self.exec_prefix = self.prefix self.install_base = self.prefix self.install_platbase = self.exec_prefix self.select_scheme("unix_prefix") def finalize_other(self): """Finalizes options for non-posix platforms""" if self.user: if self.install_userbase is None: raise DistutilsPlatformError( "User base directory is not specified") self.install_base = self.install_platbase = self.install_userbase self.select_scheme(os.name + "_user") elif self.home is not None: self.install_base = self.install_platbase = self.home self.select_scheme("unix_home") else: if self.prefix is None: self.prefix = os.path.normpath(sys.prefix) self.install_base = self.install_platbase = self.prefix try: self.select_scheme(os.name) except KeyError: raise DistutilsPlatformError( "I don't know how to install stuff on '%s'" % os.name) def select_scheme(self, name): """Sets the install directories by applying the install schemes.""" # it's the caller's problem if they supply a bad name! if (hasattr(sys, 'pypy_version_info') and sys.version_info < (3, 8) and not name.endswith(('_user', '_home'))): if os.name == 'nt': name = 'pypy_nt' else: name = 'pypy' scheme = INSTALL_SCHEMES[name] for key in SCHEME_KEYS: attrname = 'install_' + key if getattr(self, attrname) is None: setattr(self, attrname, scheme[key]) def _expand_attrs(self, attrs): for attr in attrs: val = getattr(self, attr) if val is not None: if os.name == 'posix' or os.name == 'nt': val = os.path.expanduser(val) val = subst_vars(val, self.config_vars) setattr(self, attr, val) def expand_basedirs(self): """Calls `os.path.expanduser` on install_base, install_platbase and root.""" self._expand_attrs(['install_base', 'install_platbase', 'root']) def expand_dirs(self): """Calls `os.path.expanduser` on install dirs.""" self._expand_attrs(['install_purelib', 'install_platlib', 'install_lib', 'install_headers', 'install_scripts', 'install_data',]) def convert_paths(self, *names): """Call `convert_path` over `names`.""" for name in names: attr = "install_" + name setattr(self, attr, convert_path(getattr(self, attr))) def handle_extra_path(self): """Set `path_file` and `extra_dirs` using `extra_path`.""" if self.extra_path is None: self.extra_path = self.distribution.extra_path if self.extra_path is not None: log.warn( "Distribution option extra_path is deprecated. " "See issue27919 for details." ) if isinstance(self.extra_path, str): self.extra_path = self.extra_path.split(',') if len(self.extra_path) == 1: path_file = extra_dirs = self.extra_path[0] elif len(self.extra_path) == 2: path_file, extra_dirs = self.extra_path else: raise DistutilsOptionError( "'extra_path' option must be a list, tuple, or " "comma-separated string with 1 or 2 elements") # convert to local form in case Unix notation used (as it # should be in setup scripts) extra_dirs = convert_path(extra_dirs) else: path_file = None extra_dirs = '' # XXX should we warn if path_file and not extra_dirs? (in which # case the path file would be harmless but pointless) self.path_file = path_file self.extra_dirs = extra_dirs def change_roots(self, *names): """Change the install directories pointed by name using root.""" for name in names: attr = "install_" + name setattr(self, attr, change_root(self.root, getattr(self, attr))) def create_home_path(self): """Create directories under ~.""" if not self.user: return home = convert_path(os.path.expanduser("~")) for name, path in self.config_vars.items(): if path.startswith(home) and not os.path.isdir(path): self.debug_print("os.makedirs('%s', 0o700)" % path) os.makedirs(path, 0o700) # -- Command execution methods ------------------------------------- def run(self): """Runs the command.""" # Obviously have to build before we can install if not self.skip_build: self.run_command('build') # If we built for any other platform, we can't install. build_plat = self.distribution.get_command_obj('build').plat_name # check warn_dir - it is a clue that the 'install' is happening # internally, and not to sys.path, so we don't check the platform # matches what we are running. if self.warn_dir and build_plat != get_platform(): raise DistutilsPlatformError("Can't install when " "cross-compiling") # Run all sub-commands (at least those that need to be run) for cmd_name in self.get_sub_commands(): self.run_command(cmd_name) if self.path_file: self.create_path_file() # write list of installed files, if requested. if self.record: outputs = self.get_outputs() if self.root: # strip any package prefix root_len = len(self.root) for counter in range(len(outputs)): outputs[counter] = outputs[counter][root_len:] self.execute(write_file, (self.record, outputs), "writing list of installed files to '%s'" % self.record) sys_path = map(os.path.normpath, sys.path) sys_path = map(os.path.normcase, sys_path) install_lib = os.path.normcase(os.path.normpath(self.install_lib)) if (self.warn_dir and not (self.path_file and self.install_path_file) and install_lib not in sys_path): log.debug(("modules installed to '%s', which is not in " "Python's module search path (sys.path) -- " "you'll have to change the search path yourself"), self.install_lib) def create_path_file(self): """Creates the .pth file""" filename = os.path.join(self.install_libbase, self.path_file + ".pth") if self.install_path_file: self.execute(write_file, (filename, [self.extra_dirs]), "creating %s" % filename) else: self.warn("path file '%s' not created" % filename) # -- Reporting methods --------------------------------------------- def get_outputs(self): """Assembles the outputs of all the sub-commands.""" outputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) # Add the contents of cmd.get_outputs(), ensuring # that outputs doesn't contain duplicate entries for filename in cmd.get_outputs(): if filename not in outputs: outputs.append(filename) if self.path_file and self.install_path_file: outputs.append(os.path.join(self.install_libbase, self.path_file + ".pth")) return outputs def get_inputs(self): """Returns the inputs of all the sub-commands""" # XXX gee, this looks familiar ;-( inputs = [] for cmd_name in self.get_sub_commands(): cmd = self.get_finalized_command(cmd_name) inputs.extend(cmd.get_inputs()) return inputs # -- Predicates for sub-command list ------------------------------- def has_lib(self): """Returns true if the current distribution has any Python modules to install.""" return (self.distribution.has_pure_modules() or self.distribution.has_ext_modules()) def has_headers(self): """Returns true if the current distribution has any headers to install.""" return self.distribution.has_headers() def has_scripts(self): """Returns true if the current distribution has any scripts to. install.""" return self.distribution.has_scripts() def has_data(self): """Returns true if the current distribution has any data to. install.""" return self.distribution.has_data_files() # 'sub_commands': a list of commands this command might have to run to # get its work done. See cmd.py for more info. sub_commands = [('install_lib', has_lib), ('install_headers', has_headers), ('install_scripts', has_scripts), ('install_data', has_data), ('install_egg_info', lambda self:True), ] PK!jP_distutils/command/upload.pynu[""" distutils.command.upload Implements the Distutils 'upload' subcommand (upload package to a package index). """ import os import io import hashlib from base64 import standard_b64encode from urllib.request import urlopen, Request, HTTPError from urllib.parse import urlparse from distutils.errors import DistutilsError, DistutilsOptionError from distutils.core import PyPIRCCommand from distutils.spawn import spawn from distutils import log # PyPI Warehouse supports MD5, SHA256, and Blake2 (blake2-256) # https://bugs.python.org/issue40698 _FILE_CONTENT_DIGESTS = { "md5_digest": getattr(hashlib, "md5", None), "sha256_digest": getattr(hashlib, "sha256", None), "blake2_256_digest": getattr(hashlib, "blake2b", None), } class upload(PyPIRCCommand): description = "upload binary package to PyPI" user_options = PyPIRCCommand.user_options + [ ('sign', 's', 'sign files to upload using gpg'), ('identity=', 'i', 'GPG identity used to sign files'), ] boolean_options = PyPIRCCommand.boolean_options + ['sign'] def initialize_options(self): PyPIRCCommand.initialize_options(self) self.username = '' self.password = '' self.show_response = 0 self.sign = False self.identity = None def finalize_options(self): PyPIRCCommand.finalize_options(self) if self.identity and not self.sign: raise DistutilsOptionError( "Must use --sign for --identity to have meaning" ) config = self._read_pypirc() if config != {}: self.username = config['username'] self.password = config['password'] self.repository = config['repository'] self.realm = config['realm'] # getting the password from the distribution # if previously set by the register command if not self.password and self.distribution.password: self.password = self.distribution.password def run(self): if not self.distribution.dist_files: msg = ("Must create and upload files in one command " "(e.g. setup.py sdist upload)") raise DistutilsOptionError(msg) for command, pyversion, filename in self.distribution.dist_files: self.upload_file(command, pyversion, filename) def upload_file(self, command, pyversion, filename): # Makes sure the repository URL is compliant schema, netloc, url, params, query, fragments = \ urlparse(self.repository) if params or query or fragments: raise AssertionError("Incompatible url %s" % self.repository) if schema not in ('http', 'https'): raise AssertionError("unsupported schema " + schema) # Sign if requested if self.sign: gpg_args = ["gpg", "--detach-sign", "-a", filename] if self.identity: gpg_args[2:2] = ["--local-user", self.identity] spawn(gpg_args, dry_run=self.dry_run) # Fill in the data - send all the meta-data in case we need to # register a new release f = open(filename,'rb') try: content = f.read() finally: f.close() meta = self.distribution.metadata data = { # action ':action': 'file_upload', 'protocol_version': '1', # identify release 'name': meta.get_name(), 'version': meta.get_version(), # file content 'content': (os.path.basename(filename),content), 'filetype': command, 'pyversion': pyversion, # additional meta-data 'metadata_version': '1.0', 'summary': meta.get_description(), 'home_page': meta.get_url(), 'author': meta.get_contact(), 'author_email': meta.get_contact_email(), 'license': meta.get_licence(), 'description': meta.get_long_description(), 'keywords': meta.get_keywords(), 'platform': meta.get_platforms(), 'classifiers': meta.get_classifiers(), 'download_url': meta.get_download_url(), # PEP 314 'provides': meta.get_provides(), 'requires': meta.get_requires(), 'obsoletes': meta.get_obsoletes(), } data['comment'] = '' # file content digests for digest_name, digest_cons in _FILE_CONTENT_DIGESTS.items(): if digest_cons is None: continue try: data[digest_name] = digest_cons(content).hexdigest() except ValueError: # hash digest not available or blocked by security policy pass if self.sign: with open(filename + ".asc", "rb") as f: data['gpg_signature'] = (os.path.basename(filename) + ".asc", f.read()) # set up the authentication user_pass = (self.username + ":" + self.password).encode('ascii') # The exact encoding of the authentication string is debated. # Anyway PyPI only accepts ascii for both username or password. auth = "Basic " + standard_b64encode(user_pass).decode('ascii') # Build up the MIME payload for the POST data boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = b'\r\n--' + boundary.encode('ascii') end_boundary = sep_boundary + b'--\r\n' body = io.BytesIO() for key, value in data.items(): title = '\r\nContent-Disposition: form-data; name="%s"' % key # handle multiple entries for the same name if not isinstance(value, list): value = [value] for value in value: if type(value) is tuple: title += '; filename="%s"' % value[0] value = value[1] else: value = str(value).encode('utf-8') body.write(sep_boundary) body.write(title.encode('utf-8')) body.write(b"\r\n\r\n") body.write(value) body.write(end_boundary) body = body.getvalue() msg = "Submitting %s to %s" % (filename, self.repository) self.announce(msg, log.INFO) # build the Request headers = { 'Content-type': 'multipart/form-data; boundary=%s' % boundary, 'Content-length': str(len(body)), 'Authorization': auth, } request = Request(self.repository, data=body, headers=headers) # send the data try: result = urlopen(request) status = result.getcode() reason = result.msg except HTTPError as e: status = e.code reason = e.msg except OSError as e: self.announce(str(e), log.ERROR) raise if status == 200: self.announce('Server response (%s): %s' % (status, reason), log.INFO) if self.show_response: text = self._read_pypi_response(result) msg = '\n'.join(('-' * 75, text, '-' * 75)) self.announce(msg, log.INFO) else: msg = 'Upload failed (%s): %s' % (status, reason) self.announce(msg, log.ERROR) raise DistutilsError(msg) PK!d]!T!T_distutils/command/bdist_rpm.pynu["""distutils.command.bdist_rpm Implements the Distutils 'bdist_rpm' command (create RPM source and binary distributions).""" import subprocess, sys, os from distutils.core import Command from distutils.debug import DEBUG from distutils.file_util import write_file from distutils.errors import * from distutils.sysconfig import get_python_version from distutils import log class bdist_rpm(Command): description = "create an RPM distribution" user_options = [ ('bdist-base=', None, "base directory for creating built distributions"), ('rpm-base=', None, "base directory for creating RPMs (defaults to \"rpm\" under " "--bdist-base; must be specified for RPM 2)"), ('dist-dir=', 'd', "directory to put final RPM files in " "(and .spec files if --spec-only)"), ('python=', None, "path to Python interpreter to hard-code in the .spec file " "(default: \"python\")"), ('fix-python', None, "hard-code the exact path to the current Python interpreter in " "the .spec file"), ('spec-only', None, "only regenerate spec file"), ('source-only', None, "only generate source RPM"), ('binary-only', None, "only generate binary RPM"), ('use-bzip2', None, "use bzip2 instead of gzip to create source distribution"), # More meta-data: too RPM-specific to put in the setup script, # but needs to go in the .spec file -- so we make these options # to "bdist_rpm". The idea is that packagers would put this # info in setup.cfg, although they are of course free to # supply it on the command line. ('distribution-name=', None, "name of the (Linux) distribution to which this " "RPM applies (*not* the name of the module distribution!)"), ('group=', None, "package classification [default: \"Development/Libraries\"]"), ('release=', None, "RPM release number"), ('serial=', None, "RPM serial number"), ('vendor=', None, "RPM \"vendor\" (eg. \"Joe Blow \") " "[default: maintainer or author from setup script]"), ('packager=', None, "RPM packager (eg. \"Jane Doe \") " "[default: vendor]"), ('doc-files=', None, "list of documentation files (space or comma-separated)"), ('changelog=', None, "RPM changelog"), ('icon=', None, "name of icon file"), ('provides=', None, "capabilities provided by this package"), ('requires=', None, "capabilities required by this package"), ('conflicts=', None, "capabilities which conflict with this package"), ('build-requires=', None, "capabilities required to build this package"), ('obsoletes=', None, "capabilities made obsolete by this package"), ('no-autoreq', None, "do not automatically calculate dependencies"), # Actions to take when building RPM ('keep-temp', 'k', "don't clean up RPM build directory"), ('no-keep-temp', None, "clean up RPM build directory [default]"), ('use-rpm-opt-flags', None, "compile with RPM_OPT_FLAGS when building from source RPM"), ('no-rpm-opt-flags', None, "do not pass any RPM CFLAGS to compiler"), ('rpm3-mode', None, "RPM 3 compatibility mode (default)"), ('rpm2-mode', None, "RPM 2 compatibility mode"), # Add the hooks necessary for specifying custom scripts ('prep-script=', None, "Specify a script for the PREP phase of RPM building"), ('build-script=', None, "Specify a script for the BUILD phase of RPM building"), ('pre-install=', None, "Specify a script for the pre-INSTALL phase of RPM building"), ('install-script=', None, "Specify a script for the INSTALL phase of RPM building"), ('post-install=', None, "Specify a script for the post-INSTALL phase of RPM building"), ('pre-uninstall=', None, "Specify a script for the pre-UNINSTALL phase of RPM building"), ('post-uninstall=', None, "Specify a script for the post-UNINSTALL phase of RPM building"), ('clean-script=', None, "Specify a script for the CLEAN phase of RPM building"), ('verify-script=', None, "Specify a script for the VERIFY phase of the RPM build"), # Allow a packager to explicitly force an architecture ('force-arch=', None, "Force an architecture onto the RPM build process"), ('quiet', 'q', "Run the INSTALL phase of RPM building in quiet mode"), ] boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode', 'no-autoreq', 'quiet'] negative_opt = {'no-keep-temp': 'keep-temp', 'no-rpm-opt-flags': 'use-rpm-opt-flags', 'rpm2-mode': 'rpm3-mode'} def initialize_options(self): self.bdist_base = None self.rpm_base = None self.dist_dir = None self.python = None self.fix_python = None self.spec_only = None self.binary_only = None self.source_only = None self.use_bzip2 = None self.distribution_name = None self.group = None self.release = None self.serial = None self.vendor = None self.packager = None self.doc_files = None self.changelog = None self.icon = None self.prep_script = None self.build_script = None self.install_script = None self.clean_script = None self.verify_script = None self.pre_install = None self.post_install = None self.pre_uninstall = None self.post_uninstall = None self.prep = None self.provides = None self.requires = None self.conflicts = None self.build_requires = None self.obsoletes = None self.keep_temp = 0 self.use_rpm_opt_flags = 1 self.rpm3_mode = 1 self.no_autoreq = 0 self.force_arch = None self.quiet = 0 def finalize_options(self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) if self.rpm_base is None: if not self.rpm3_mode: raise DistutilsOptionError( "you must specify --rpm-base in RPM 2 mode") self.rpm_base = os.path.join(self.bdist_base, "rpm") if self.python is None: if self.fix_python: self.python = sys.executable else: self.python = "python3" elif self.fix_python: raise DistutilsOptionError( "--python and --fix-python are mutually exclusive options") if os.name != 'posix': raise DistutilsPlatformError("don't know how to create RPM " "distributions on platform %s" % os.name) if self.binary_only and self.source_only: raise DistutilsOptionError( "cannot supply both '--source-only' and '--binary-only'") # don't pass CFLAGS to pure python distributions if not self.distribution.has_ext_modules(): self.use_rpm_opt_flags = 0 self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) self.finalize_package_data() def finalize_package_data(self): self.ensure_string('group', "Development/Libraries") self.ensure_string('vendor', "%s <%s>" % (self.distribution.get_contact(), self.distribution.get_contact_email())) self.ensure_string('packager') self.ensure_string_list('doc_files') if isinstance(self.doc_files, list): for readme in ('README', 'README.txt'): if os.path.exists(readme) and readme not in self.doc_files: self.doc_files.append(readme) self.ensure_string('release', "1") self.ensure_string('serial') # should it be an int? self.ensure_string('distribution_name') self.ensure_string('changelog') # Format changelog correctly self.changelog = self._format_changelog(self.changelog) self.ensure_filename('icon') self.ensure_filename('prep_script') self.ensure_filename('build_script') self.ensure_filename('install_script') self.ensure_filename('clean_script') self.ensure_filename('verify_script') self.ensure_filename('pre_install') self.ensure_filename('post_install') self.ensure_filename('pre_uninstall') self.ensure_filename('post_uninstall') # XXX don't forget we punted on summaries and descriptions -- they # should be handled here eventually! # Now *this* is some meta-data that belongs in the setup script... self.ensure_string_list('provides') self.ensure_string_list('requires') self.ensure_string_list('conflicts') self.ensure_string_list('build_requires') self.ensure_string_list('obsoletes') self.ensure_string('force_arch') def run(self): if DEBUG: print("before _get_package_data():") print("vendor =", self.vendor) print("packager =", self.packager) print("doc_files =", self.doc_files) print("changelog =", self.changelog) # make directories if self.spec_only: spec_dir = self.dist_dir self.mkpath(spec_dir) else: rpm_dir = {} for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'): rpm_dir[d] = os.path.join(self.rpm_base, d) self.mkpath(rpm_dir[d]) spec_dir = rpm_dir['SPECS'] # Spec file goes into 'dist_dir' if '--spec-only specified', # build/rpm. otherwise. spec_path = os.path.join(spec_dir, "%s.spec" % self.distribution.get_name()) self.execute(write_file, (spec_path, self._make_spec_file()), "writing '%s'" % spec_path) if self.spec_only: # stop if requested return # Make a source distribution and copy to SOURCES directory with # optional icon. saved_dist_files = self.distribution.dist_files[:] sdist = self.reinitialize_command('sdist') if self.use_bzip2: sdist.formats = ['bztar'] else: sdist.formats = ['gztar'] self.run_command('sdist') self.distribution.dist_files = saved_dist_files source = sdist.get_archive_files()[0] source_dir = rpm_dir['SOURCES'] self.copy_file(source, source_dir) if self.icon: if os.path.exists(self.icon): self.copy_file(self.icon, source_dir) else: raise DistutilsFileError( "icon file '%s' does not exist" % self.icon) # build package log.info("building RPMs") rpm_cmd = ['rpmbuild'] if self.source_only: # what kind of RPMs? rpm_cmd.append('-bs') elif self.binary_only: rpm_cmd.append('-bb') else: rpm_cmd.append('-ba') rpm_cmd.extend(['--define', '__python %s' % self.python]) if self.rpm3_mode: rpm_cmd.extend(['--define', '_topdir %s' % os.path.abspath(self.rpm_base)]) if not self.keep_temp: rpm_cmd.append('--clean') if self.quiet: rpm_cmd.append('--quiet') rpm_cmd.append(spec_path) # Determine the binary rpm names that should be built out of this spec # file # Note that some of these may not be really built (if the file # list is empty) nvr_string = "%{name}-%{version}-%{release}" src_rpm = nvr_string + ".src.rpm" non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm" q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % ( src_rpm, non_src_rpm, spec_path) out = os.popen(q_cmd) try: binary_rpms = [] source_rpm = None while True: line = out.readline() if not line: break l = line.strip().split() assert(len(l) == 2) binary_rpms.append(l[1]) # The source rpm is named after the first entry in the spec file if source_rpm is None: source_rpm = l[0] status = out.close() if status: raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd)) finally: out.close() self.spawn(rpm_cmd) if not self.dry_run: if self.distribution.has_ext_modules(): pyversion = get_python_version() else: pyversion = 'any' if not self.binary_only: srpm = os.path.join(rpm_dir['SRPMS'], source_rpm) assert(os.path.exists(srpm)) self.move_file(srpm, self.dist_dir) filename = os.path.join(self.dist_dir, source_rpm) self.distribution.dist_files.append( ('bdist_rpm', pyversion, filename)) if not self.source_only: for rpm in binary_rpms: rpm = os.path.join(rpm_dir['RPMS'], rpm) if os.path.exists(rpm): self.move_file(rpm, self.dist_dir) filename = os.path.join(self.dist_dir, os.path.basename(rpm)) self.distribution.dist_files.append( ('bdist_rpm', pyversion, filename)) def _dist_path(self, path): return os.path.join(self.dist_dir, os.path.basename(path)) def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define unmangled_version ' + self.distribution.get_version(), '%define release ' + self.release.replace('-','_'), '', 'Summary: ' + self.distribution.get_description(), ] # Workaround for #14443 which affects some RPM based systems such as # RHEL6 (and probably derivatives) vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}') # Generate a potential replacement value for __os_install_post (whilst # normalizing the whitespace to simplify the test for whether the # invocation of brp-python-bytecompile passes in __python): vendor_hook = '\n'.join([' %s \\' % line.strip() for line in vendor_hook.splitlines()]) problem = "brp-python-bytecompile \\\n" fixed = "brp-python-bytecompile %{__python} \\\n" fixed_hook = vendor_hook.replace(problem, fixed) if fixed_hook != vendor_hook: spec_file.append('# Workaround for http://bugs.python.org/issue14443') spec_file.append('%define __os_install_post ' + fixed_hook + '\n') # put locale summaries into spec file # XXX not supported for now (hard to put a dictionary # in a config file -- arg!) #for locale in self.summaries.keys(): # spec_file.append('Summary(%s): %s' % (locale, # self.summaries[locale])) spec_file.extend([ 'Name: %{name}', 'Version: %{version}', 'Release: %{release}',]) # XXX yuck! this filename is available from the "sdist" command, # but only after it has run: and we create the spec file before # running "sdist", in case of --spec-only. if self.use_bzip2: spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2') else: spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz') spec_file.extend([ 'License: ' + self.distribution.get_license(), 'Group: ' + self.group, 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot', 'Prefix: %{_prefix}', ]) if not self.force_arch: # noarch if no extension modules if not self.distribution.has_ext_modules(): spec_file.append('BuildArch: noarch') else: spec_file.append( 'BuildArch: %s' % self.force_arch ) for field in ('Vendor', 'Packager', 'Provides', 'Requires', 'Conflicts', 'Obsoletes', ): val = getattr(self, field.lower()) if isinstance(val, list): spec_file.append('%s: %s' % (field, ' '.join(val))) elif val is not None: spec_file.append('%s: %s' % (field, val)) if self.distribution.get_url() != 'UNKNOWN': spec_file.append('Url: ' + self.distribution.get_url()) if self.distribution_name: spec_file.append('Distribution: ' + self.distribution_name) if self.build_requires: spec_file.append('BuildRequires: ' + ' '.join(self.build_requires)) if self.icon: spec_file.append('Icon: ' + os.path.basename(self.icon)) if self.no_autoreq: spec_file.append('AutoReq: 0') spec_file.extend([ '', '%description', self.distribution.get_long_description() ]) # put locale descriptions into spec file # XXX again, suppressed because config file syntax doesn't # easily support this ;-( #for locale in self.descriptions.keys(): # spec_file.extend([ # '', # '%description -l ' + locale, # self.descriptions[locale], # ]) # rpm scripts # figure out default build script def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0])) def_build = "%s build" % def_setup_call if self.use_rpm_opt_flags: def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build # insert contents of files # XXX this is kind of misleading: user-supplied options are files # that we open and interpolate into the spec file, but the defaults # are just text that we drop in as-is. Hmmm. install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT ' '--record=INSTALLED_FILES') % def_setup_call script_options = [ ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"), ('build', 'build_script', def_build), ('install', 'install_script', install_cmd), ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"), ('verifyscript', 'verify_script', None), ('pre', 'pre_install', None), ('post', 'post_install', None), ('preun', 'pre_uninstall', None), ('postun', 'post_uninstall', None), ] for (rpm_opt, attr, default) in script_options: # Insert contents of file referred to, if no file is referred to # use 'default' as contents of script val = getattr(self, attr) if val or default: spec_file.extend([ '', '%' + rpm_opt,]) if val: with open(val) as f: spec_file.extend(f.read().split('\n')) else: spec_file.append(default) # files section spec_file.extend([ '', '%files -f INSTALLED_FILES', '%defattr(-,root,root)', ]) if self.doc_files: spec_file.append('%doc ' + ' '.join(self.doc_files)) if self.changelog: spec_file.extend([ '', '%changelog',]) spec_file.extend(self.changelog) return spec_file def _format_changelog(self, changelog): """Format the changelog correctly and convert it to a list of strings """ if not changelog: return changelog new_changelog = [] for line in changelog.strip().split('\n'): line = line.strip() if line[0] == '*': new_changelog.extend(['', line]) elif line[0] == '-': new_changelog.append(line) else: new_changelog.append(' ' + line) # strip trailing newline inserted by first changelog entry if not new_changelog[0]: del new_changelog[0] return new_changelog PK!{{_distutils/command/build_ext.pynu["""distutils.command.build_ext Implements the Distutils 'build_ext' command, for building extension modules (currently limited to C extensions, should accommodate C++ extensions ASAP).""" import contextlib import os import re import sys from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler, get_python_version from distutils.sysconfig import get_config_h_filename from distutils.dep_util import newer_group from distutils.extension import Extension from distutils.util import get_platform from distutils import log from . import py37compat from site import USER_BASE # An extension name is just a dot-separated list of Python NAMEs (ie. # the same as a fully-qualified module name). extension_name_re = re.compile \ (r'^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$') def show_compilers (): from distutils.ccompiler import show_compilers show_compilers() class build_ext(Command): description = "build C/C++ extensions (compile/link to build directory)" # XXX thoughts on how to deal with complex command-line options like # these, i.e. how to make it so fancy_getopt can suck them off the # command line and make it look like setup.py defined the appropriate # lists of tuples of what-have-you. # - each command needs a callback to process its command-line options # - Command.__init__() needs access to its share of the whole # command line (must ultimately come from # Distribution.parse_command_line()) # - it then calls the current command class' option-parsing # callback to deal with weird options like -D, which have to # parse the option text and churn out some custom data # structure # - that data structure (in this case, a list of 2-tuples) # will then be present in the command object by the time # we get to finalize_options() (i.e. the constructor # takes care of both command-line and client options # in between initialize_options() and finalize_options()) sep_by = " (separated by '%s')" % os.pathsep user_options = [ ('build-lib=', 'b', "directory for compiled extension modules"), ('build-temp=', 't', "directory for temporary files (build by-products)"), ('plat-name=', 'p', "platform name to cross-compile for, if supported " "(default: %s)" % get_platform()), ('inplace', 'i', "ignore build-lib and put compiled extensions into the source " + "directory alongside your pure Python modules"), ('include-dirs=', 'I', "list of directories to search for header files" + sep_by), ('define=', 'D', "C preprocessor macros to define"), ('undef=', 'U', "C preprocessor macros to undefine"), ('libraries=', 'l', "external C libraries to link with"), ('library-dirs=', 'L', "directories to search for external C libraries" + sep_by), ('rpath=', 'R', "directories to search for shared C libraries at runtime"), ('link-objects=', 'O', "extra explicit link objects to include in the link"), ('debug', 'g', "compile/link with debugging information"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ('compiler=', 'c', "specify the compiler type"), ('parallel=', 'j', "number of parallel build jobs"), ('swig-cpp', None, "make SWIG create C++ files (default is C)"), ('swig-opts=', None, "list of SWIG command line options"), ('swig=', None, "path to the SWIG executable"), ('user', None, "add user include, library and rpath") ] boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user'] help_options = [ ('help-compiler', None, "list available compilers", show_compilers), ] def initialize_options(self): self.extensions = None self.build_lib = None self.plat_name = None self.build_temp = None self.inplace = 0 self.package = None self.include_dirs = None self.define = None self.undef = None self.libraries = None self.library_dirs = None self.rpath = None self.link_objects = None self.debug = None self.force = None self.compiler = None self.swig = None self.swig_cpp = None self.swig_opts = None self.user = None self.parallel = None def finalize_options(self): from distutils import sysconfig self.set_undefined_options('build', ('build_lib', 'build_lib'), ('build_temp', 'build_temp'), ('compiler', 'compiler'), ('debug', 'debug'), ('force', 'force'), ('parallel', 'parallel'), ('plat_name', 'plat_name'), ) if self.package is None: self.package = self.distribution.ext_package self.extensions = self.distribution.ext_modules # Make sure Python's include directories (for Python.h, pyconfig.h, # etc.) are in the include search path. py_include = sysconfig.get_python_inc() plat_py_include = sysconfig.get_python_inc(plat_specific=1) if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] if isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) # If in a virtualenv, add its include directory # Issue 16116 if sys.exec_prefix != sys.base_exec_prefix: self.include_dirs.append(os.path.join(sys.exec_prefix, 'include')) # Put the Python "system" include dir at the end, so that # any local include dirs take precedence. self.include_dirs.extend(py_include.split(os.path.pathsep)) if plat_py_include != py_include: self.include_dirs.extend( plat_py_include.split(os.path.pathsep)) self.ensure_string_list('libraries') self.ensure_string_list('link_objects') # Life is easier if we're not forever checking for None, so # simplify these options to empty lists if unset if self.libraries is None: self.libraries = [] if self.library_dirs is None: self.library_dirs = [] elif isinstance(self.library_dirs, str): self.library_dirs = self.library_dirs.split(os.pathsep) if self.rpath is None: self.rpath = [] elif isinstance(self.rpath, str): self.rpath = self.rpath.split(os.pathsep) # for extensions under windows use different directories # for Release and Debug builds. # also Python's library directory must be appended to library_dirs if os.name == 'nt': # the 'libs' directory is for binary installs - we assume that # must be the *native* platform. But we don't really support # cross-compiling via a binary install anyway, so we let it go. self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs')) if sys.base_exec_prefix != sys.prefix: # Issue 16116 self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs')) if self.debug: self.build_temp = os.path.join(self.build_temp, "Debug") else: self.build_temp = os.path.join(self.build_temp, "Release") # Append the source distribution include and library directories, # this allows distutils on windows to work in the source tree self.include_dirs.append(os.path.dirname(get_config_h_filename())) _sys_home = getattr(sys, '_home', None) if _sys_home: self.library_dirs.append(_sys_home) # Use the .lib files for the correct architecture if self.plat_name == 'win32': suffix = 'win32' else: # win-amd64 suffix = self.plat_name[4:] new_lib = os.path.join(sys.exec_prefix, 'PCbuild') if suffix: new_lib = os.path.join(new_lib, suffix) self.library_dirs.append(new_lib) # For extensions under Cygwin, Python's library directory must be # appended to library_dirs if sys.platform[:6] == 'cygwin': if not sysconfig.python_build: # building third party extensions self.library_dirs.append(os.path.join(sys.prefix, "lib", "python" + get_python_version(), "config")) else: # building python standard extensions self.library_dirs.append('.') # For building extensions with a shared Python library, # Python's library directory must be appended to library_dirs # See Issues: #1600860, #4366 if (sysconfig.get_config_var('Py_ENABLE_SHARED')): if not sysconfig.python_build: # building third party extensions self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) else: # building python standard extensions self.library_dirs.append('.') # The argument parsing will result in self.define being a string, but # it has to be a list of 2-tuples. All the preprocessor symbols # specified by the 'define' option will be set to '1'. Multiple # symbols can be separated with commas. if self.define: defines = self.define.split(',') self.define = [(symbol, '1') for symbol in defines] # The option for macros to undefine is also a string from the # option parsing, but has to be a list. Multiple symbols can also # be separated with commas here. if self.undef: self.undef = self.undef.split(',') if self.swig_opts is None: self.swig_opts = [] else: self.swig_opts = self.swig_opts.split(' ') # Finally add the user include and library directories if requested if self.user: user_include = os.path.join(USER_BASE, "include") user_lib = os.path.join(USER_BASE, "lib") if os.path.isdir(user_include): self.include_dirs.append(user_include) if os.path.isdir(user_lib): self.library_dirs.append(user_lib) self.rpath.append(user_lib) if isinstance(self.parallel, str): try: self.parallel = int(self.parallel) except ValueError: raise DistutilsOptionError("parallel should be an integer") def run(self): from distutils.ccompiler import new_compiler # 'self.extensions', as supplied by setup.py, is a list of # Extension instances. See the documentation for Extension (in # distutils.extension) for details. # # For backwards compatibility with Distutils 0.8.2 and earlier, we # also allow the 'extensions' list to be a list of tuples: # (ext_name, build_info) # where build_info is a dictionary containing everything that # Extension instances do except the name, with a few things being # differently named. We convert these 2-tuples to Extension # instances as needed. if not self.extensions: return # If we were asked to build any C/C++ libraries, make sure that the # directory where we put them is in the library search path for # linking extensions. if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command('build_clib') self.libraries.extend(build_clib.get_library_names() or []) self.library_dirs.append(build_clib.build_clib) # Setup the CCompiler object that we'll use to do all the # compiling and linking self.compiler = new_compiler(compiler=self.compiler, verbose=self.verbose, dry_run=self.dry_run, force=self.force) customize_compiler(self.compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): self.compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: self.compiler.undefine_macro(macro) if self.libraries is not None: self.compiler.set_libraries(self.libraries) if self.library_dirs is not None: self.compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: self.compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: self.compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() def check_extensions_list(self, extensions): """Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, where the tuples are (ext_name, build_info), which are converted to Extension instances here. Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. """ if not isinstance(extensions, list): raise DistutilsSetupError( "'ext_modules' option must be a list of Extension instances") for i, ext in enumerate(extensions): if isinstance(ext, Extension): continue # OK! (assume type-checking done # by Extension constructor) if not isinstance(ext, tuple) or len(ext) != 2: raise DistutilsSetupError( "each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") ext_name, build_info = ext log.warn("old-style (ext_name, build_info) tuple found in " "ext_modules for extension '%s' " "-- please convert to Extension instance", ext_name) if not (isinstance(ext_name, str) and extension_name_re.match(ext_name)): raise DistutilsSetupError( "first element of each tuple in 'ext_modules' " "must be the extension name (a string)") if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'ext_modules' " "must be a dictionary (build info)") # OK, the (ext_name, build_info) dict is type-safe: convert it # to an Extension instance. ext = Extension(ext_name, build_info['sources']) # Easy stuff: one-to-one mapping from dict elements to # instance attributes. for key in ('include_dirs', 'library_dirs', 'libraries', 'extra_objects', 'extra_compile_args', 'extra_link_args'): val = build_info.get(key) if val is not None: setattr(ext, key, val) # Medium-easy stuff: same syntax/semantics, different names. ext.runtime_library_dirs = build_info.get('rpath') if 'def_file' in build_info: log.warn("'def_file' element of build info dict " "no longer supported") # Non-trivial stuff: 'macros' split into 'define_macros' # and 'undef_macros'. macros = build_info.get('macros') if macros: ext.define_macros = [] ext.undef_macros = [] for macro in macros: if not (isinstance(macro, tuple) and len(macro) in (1, 2)): raise DistutilsSetupError( "'macros' element of build info dict " "must be 1- or 2-tuple") if len(macro) == 1: ext.undef_macros.append(macro[0]) elif len(macro) == 2: ext.define_macros.append(macro) extensions[i] = ext def get_source_files(self): self.check_extensions_list(self.extensions) filenames = [] # Wouldn't it be neat if we knew the names of header files too... for ext in self.extensions: filenames.extend(ext.sources) return filenames def get_outputs(self): # Sanity check the 'extensions' list -- can't assume this is being # done in the same run as a 'build_extensions()' call (in fact, we # can probably assume that it *isn't*!). self.check_extensions_list(self.extensions) # And build the list of output (built) filenames. Note that this # ignores the 'inplace' flag, and assumes everything goes in the # "build" tree. outputs = [] for ext in self.extensions: outputs.append(self.get_ext_fullpath(ext.name)) return outputs def build_extensions(self): # First, sanity-check the 'extensions' list self.check_extensions_list(self.extensions) if self.parallel: self._build_extensions_parallel() else: self._build_extensions_serial() def _build_extensions_parallel(self): workers = self.parallel if self.parallel is True: workers = os.cpu_count() # may return None try: from concurrent.futures import ThreadPoolExecutor except ImportError: workers = None if workers is None: self._build_extensions_serial() return with ThreadPoolExecutor(max_workers=workers) as executor: futures = [executor.submit(self.build_extension, ext) for ext in self.extensions] for ext, fut in zip(self.extensions, futures): with self._filter_build_errors(ext): fut.result() def _build_extensions_serial(self): for ext in self.extensions: with self._filter_build_errors(ext): self.build_extension(ext) @contextlib.contextmanager def _filter_build_errors(self, ext): try: yield except (CCompilerError, DistutilsError, CompileError) as e: if not ext.optional: raise self.warn('building extension "%s" failed: %s' % (ext.name, e)) def build_extension(self, ext): sources = ext.sources if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError( "in 'ext_modules' option (extension '%s'), " "'sources' must be present and must be " "a list of source filenames" % ext.name) # sort to make the resulting .so file build reproducible sources = sorted(sources) ext_path = self.get_ext_fullpath(ext.name) depends = sources + ext.depends if not (self.force or newer_group(depends, ext_path, 'newer')): log.debug("skipping '%s' extension (up-to-date)", ext.name) return else: log.info("building '%s' extension", ext.name) # First, scan the sources for SWIG definition files (.i), run # SWIG on 'em to create .c files, and modify the sources list # accordingly. sources = self.swig_sources(sources, ext) # Next, compile the source code to object files. # XXX not honouring 'define_macros' or 'undef_macros' -- the # CCompiler API needs to change to accommodate this, and I # want to do one thing at a time! # Two possible sources for extra compiler arguments: # - 'extra_compile_args' in Extension object # - CFLAGS environment variable (not particularly # elegant, but people seem to expect it and I # guess it's useful) # The environment variable should take precedence, and # any sensible compiler will give precedence to later # command line args. Hence we combine them in order: extra_args = ext.extra_compile_args or [] macros = ext.define_macros[:] for undef in ext.undef_macros: macros.append((undef,)) objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=ext.include_dirs, debug=self.debug, extra_postargs=extra_args, depends=ext.depends) # XXX outdated variable, kept here in case third-part code # needs it. self._built_objects = objects[:] # Now link the object files together into a "shared object" -- # of course, first we have to figure out all the other things # that go into the mix. if ext.extra_objects: objects.extend(ext.extra_objects) extra_args = ext.extra_link_args or [] # Detect target language, if not provided language = ext.language or self.compiler.detect_language(sources) self.compiler.link_shared_object( objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, runtime_library_dirs=ext.runtime_library_dirs, extra_postargs=extra_args, export_symbols=self.get_export_symbols(ext), debug=self.debug, build_temp=self.build_temp, target_lang=language) def swig_sources(self, sources, extension): """Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files. """ new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. if self.swig_cpp: log.warn("--swig-cpp is deprecated - use --swig-opts=-c++") if self.swig_cpp or ('-c++' in self.swig_opts) or \ ('-c++' in extension.swig_opts): target_ext = '.cpp' else: target_ext = '.c' for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": # SWIG interface file new_sources.append(base + '_wrap' + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.swig or self.find_swig() swig_cmd = [swig, "-python"] swig_cmd.extend(self.swig_opts) if self.swig_cpp: swig_cmd.append("-c++") # Do not override commandline arguments if not self.swig_opts: for o in extension.swig_opts: swig_cmd.append(o) for source in swig_sources: target = swig_targets[source] log.info("swigging %s to %s", source, target) self.spawn(swig_cmd + ["-o", target, source]) return new_sources def find_swig(self): """Return the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows. """ if os.name == "posix": return "swig" elif os.name == "nt": # Look for SWIG in its standard installation directory on # Windows (or so I presume!). If we find it there, great; # if not, act like Unix and assume it's in the PATH. for vers in ("1.3", "1.2", "1.1"): fn = os.path.join("c:\\swig%s" % vers, "swig.exe") if os.path.isfile(fn): return fn else: return "swig.exe" else: raise DistutilsPlatformError( "I don't know how to find (much less run) SWIG " "on platform '%s'" % os.name) # -- Name generators ----------------------------------------------- # (extension names, filenames, whatever) def get_ext_fullpath(self, ext_name): """Returns the path of the filename for a given extension. The file is located in `build_lib` or directly in the package (inplace option). """ fullname = self.get_ext_fullname(ext_name) modpath = fullname.split('.') filename = self.get_ext_filename(modpath[-1]) if not self.inplace: # no further work needed # returning : # build_dir/package/path/filename filename = os.path.join(*modpath[:-1]+[filename]) return os.path.join(self.build_lib, filename) # the inplace option requires to find the package directory # using the build_py command for that package = '.'.join(modpath[0:-1]) build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) # returning # package_dir/filename return os.path.join(package_dir, filename) def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. Adds the `package.` prefix""" if self.package is None: return ext_name else: return self.package + '.' + ext_name def get_ext_filename(self, ext_name): r"""Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd"). """ from distutils.sysconfig import get_config_var ext_path = ext_name.split('.') ext_suffix = get_config_var('EXT_SUFFIX') return os.path.join(*ext_path) + ext_suffix def get_export_symbols(self, ext): """Return the list of symbols that a shared extension has to export. This either uses 'ext.export_symbols' or, if it's not provided, "PyInit_" + module_name. Only relevant on Windows, where the .pyd file (DLL) must export the module "PyInit_" function. """ name = ext.name.split('.')[-1] try: # Unicode module name support as defined in PEP-489 # https://www.python.org/dev/peps/pep-0489/#export-hook-name name.encode('ascii') except UnicodeEncodeError: suffix = 'U_' + name.encode('punycode').replace(b'-', b'_').decode('ascii') else: suffix = "_" + name initfunc_name = "PyInit" + suffix if initfunc_name not in ext.export_symbols: ext.export_symbols.append(initfunc_name) return ext.export_symbols def get_libraries(self, ext): """Return the list of libraries to link against when building a shared extension. On most platforms, this is just 'ext.libraries'; on Windows, we add the Python library (eg. python20.dll). """ # The python library is always needed on Windows. For MSVC, this # is redundant, since the library is mentioned in a pragma in # pyconfig.h that MSVC groks. The other Windows compilers all seem # to need it mentioned explicitly, though, so that's what we do. # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils._msvccompiler import MSVCCompiler if not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' pythonlib = (template % (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) # don't extend ext.libraries, it may be shared with other # extensions, it is a reference to the original list return ext.libraries + [pythonlib] else: # On Android only the main executable and LD_PRELOADs are considered # to be RTLD_GLOBAL, all the dependencies of the main executable # remain RTLD_LOCAL and so the shared libraries must be linked with # libpython when python is built with a shared python library (issue # bpo-21536). # On Cygwin (and if required, other POSIX-like platforms based on # Windows like MinGW) it is simply necessary that all symbols in # shared libraries are resolved at link time. from distutils.sysconfig import get_config_var link_libpython = False if get_config_var('Py_ENABLE_SHARED'): # A native build on an Android device or on Cygwin if hasattr(sys, 'getandroidapilevel'): link_libpython = True elif sys.platform == 'cygwin': link_libpython = True elif '_PYTHON_HOST_PLATFORM' in os.environ: # We are cross-compiling for one of the relevant platforms if get_config_var('ANDROID_API_LEVEL') != 0: link_libpython = True elif get_config_var('MACHDEP') == 'cygwin': link_libpython = True if link_libpython: ldversion = get_config_var('LDVERSION') return ext.libraries + ['python' + ldversion] return ext.libraries + py37compat.pythonlib() PK!7=3=3_distutils/command/config.pynu["""distutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" in the list of standard commands. Also, this is a good place to put common configure-like tasks: "try to compile this C code", or "figure out where this header file lives". """ import os, re from distutils.core import Command from distutils.errors import DistutilsExecError from distutils.sysconfig import customize_compiler from distutils import log LANG_EXT = {"c": ".c", "c++": ".cxx"} class config(Command): description = "prepare to build" user_options = [ ('compiler=', None, "specify the compiler type"), ('cc=', None, "specify the compiler executable"), ('include-dirs=', 'I', "list of directories to search for header files"), ('define=', 'D', "C preprocessor macros to define"), ('undef=', 'U', "C preprocessor macros to undefine"), ('libraries=', 'l', "external C libraries to link with"), ('library-dirs=', 'L', "directories to search for external C libraries"), ('noisy', None, "show every action (compile, link, run, ...) taken"), ('dump-source', None, "dump generated source files before attempting to compile them"), ] # The three standard command methods: since the "config" command # does nothing by default, these are empty. def initialize_options(self): self.compiler = None self.cc = None self.include_dirs = None self.libraries = None self.library_dirs = None # maximal output for now self.noisy = 1 self.dump_source = 1 # list of temporary files generated along-the-way that we have # to clean at some point self.temp_files = [] def finalize_options(self): if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] elif isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) if self.libraries is None: self.libraries = [] elif isinstance(self.libraries, str): self.libraries = [self.libraries] if self.library_dirs is None: self.library_dirs = [] elif isinstance(self.library_dirs, str): self.library_dirs = self.library_dirs.split(os.pathsep) def run(self): pass # Utility methods for actual "config" commands. The interfaces are # loosely based on Autoconf macros of similar names. Sub-classes # may use these freely. def _check_compiler(self): """Check that 'self.compiler' really is a CCompiler object; if not, make it one. """ # We do this late, and only on-demand, because this is an expensive # import. from distutils.ccompiler import CCompiler, new_compiler if not isinstance(self.compiler, CCompiler): self.compiler = new_compiler(compiler=self.compiler, dry_run=self.dry_run, force=1) customize_compiler(self.compiler) if self.include_dirs: self.compiler.set_include_dirs(self.include_dirs) if self.libraries: self.compiler.set_libraries(self.libraries) if self.library_dirs: self.compiler.set_library_dirs(self.library_dirs) def _gen_temp_sourcefile(self, body, headers, lang): filename = "_configtest" + LANG_EXT[lang] with open(filename, "w") as file: if headers: for header in headers: file.write("#include <%s>\n" % header) file.write("\n") file.write(body) if body[-1] != "\n": file.write("\n") return filename def _preprocess(self, body, headers, include_dirs, lang): src = self._gen_temp_sourcefile(body, headers, lang) out = "_configtest.i" self.temp_files.extend([src, out]) self.compiler.preprocess(src, out, include_dirs=include_dirs) return (src, out) def _compile(self, body, headers, include_dirs, lang): src = self._gen_temp_sourcefile(body, headers, lang) if self.dump_source: dump_file(src, "compiling '%s':" % src) (obj,) = self.compiler.object_filenames([src]) self.temp_files.extend([src, obj]) self.compiler.compile([src], include_dirs=include_dirs) return (src, obj) def _link(self, body, headers, include_dirs, libraries, library_dirs, lang): (src, obj) = self._compile(body, headers, include_dirs, lang) prog = os.path.splitext(os.path.basename(src))[0] self.compiler.link_executable([obj], prog, libraries=libraries, library_dirs=library_dirs, target_lang=lang) if self.compiler.exe_extension is not None: prog = prog + self.compiler.exe_extension self.temp_files.append(prog) return (src, obj, prog) def _clean(self, *filenames): if not filenames: filenames = self.temp_files self.temp_files = [] log.info("removing: %s", ' '.join(filenames)) for filename in filenames: try: os.remove(filename) except OSError: pass # XXX these ignore the dry-run flag: what to do, what to do? even if # you want a dry-run build, you still need some sort of configuration # info. My inclination is to make it up to the real config command to # consult 'dry_run', and assume a default (minimal) configuration if # true. The problem with trying to do it here is that you'd have to # return either true or false from all the 'try' methods, neither of # which is correct. # XXX need access to the header search path and maybe default macros. def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('body' probably isn't of much use, but what the heck.) """ from distutils.ccompiler import CompileError self._check_compiler() ok = True try: self._preprocess(body, headers, include_dirs, lang) except CompileError: ok = False self._clean() return ok def search_cpp(self, pattern, body=None, headers=None, include_dirs=None, lang="c"): """Construct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If both 'body' and 'headers' are None, preprocesses an empty file -- which can be useful to determine the symbols the preprocessor and compiler set by default. """ self._check_compiler() src, out = self._preprocess(body, headers, include_dirs, lang) if isinstance(pattern, str): pattern = re.compile(pattern) with open(out) as file: match = False while True: line = file.readline() if line == '': break if pattern.search(line): match = True break self._clean() return match def try_compile(self, body, headers=None, include_dirs=None, lang="c"): """Try to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError self._check_compiler() try: self._compile(body, headers, include_dirs, lang) ok = True except CompileError: ok = False log.info(ok and "success!" or "failure.") self._clean() return ok def try_link(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"): """Try to compile and link a source file, built from 'body' and 'headers', to executable form. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError, LinkError self._check_compiler() try: self._link(body, headers, include_dirs, libraries, library_dirs, lang) ok = True except (CompileError, LinkError): ok = False log.info(ok and "success!" or "failure.") self._clean() return ok def try_run(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"): """Try to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. """ from distutils.ccompiler import CompileError, LinkError self._check_compiler() try: src, obj, exe = self._link(body, headers, include_dirs, libraries, library_dirs, lang) self.spawn([exe]) ok = True except (CompileError, LinkError, DistutilsExecError): ok = False log.info(ok and "success!" or "failure.") self._clean() return ok # -- High-level methods -------------------------------------------- # (these are the ones that are actually likely to be useful # when implementing a real-world config command!) def check_func(self, func, headers=None, include_dirs=None, libraries=None, library_dirs=None, decl=0, call=0): """Determine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it. If everything succeeds, returns true; otherwise returns false. The constructed source file starts out by including the header files listed in 'headers'. If 'decl' is true, it then declares 'func' (as "int func()"); you probably shouldn't supply 'headers' and set 'decl' true in the same call, or you might get errors about a conflicting declarations for 'func'. Finally, the constructed 'main()' function either references 'func' or (if 'call' is true) calls it. 'libraries' and 'library_dirs' are used when linking. """ self._check_compiler() body = [] if decl: body.append("int %s ();" % func) body.append("int main () {") if call: body.append(" %s();" % func) else: body.append(" %s;" % func) body.append("}") body = "\n".join(body) + "\n" return self.try_link(body, headers, include_dirs, libraries, library_dirs) def check_lib(self, library, library_dirs=None, headers=None, include_dirs=None, other_libraries=[]): """Determine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it. 'headers' will be used in constructing the source file to be compiled, but the only effect of this is to check if all the header files listed are available. Any libraries listed in 'other_libraries' will be included in the link, in case 'library' has symbols that depend on other libraries. """ self._check_compiler() return self.try_link("int main (void) { }", headers, include_dirs, [library] + other_libraries, library_dirs) def check_header(self, header, include_dirs=None, library_dirs=None, lang="c"): """Determine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise. """ return self.try_cpp(body="/* No body */", headers=[header], include_dirs=include_dirs) def dump_file(filename, head=None): """Dumps a file content into log.info. If head is not None, will be dumped before the file content. """ if head is None: log.info('%s', filename) else: log.info(head) file = open(filename) try: log.info(file.read()) finally: file.close() PK!v3;VV _distutils/command/build_clib.pynu["""distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.""" # XXX this module has *lots* of code ripped-off quite transparently from # build_ext.py -- not surprisingly really, as the work required to build # a static library from a collection of C source files is not really all # that different from what's required to build a shared object file from # a collection of C source files. Nevertheless, I haven't done the # necessary refactoring to account for the overlap in code between the # two modules, mainly because a number of subtle details changed in the # cut 'n paste. Sigh. import os from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler from distutils import log def show_compilers(): from distutils.ccompiler import show_compilers show_compilers() class build_clib(Command): description = "build C/C++ libraries used by Python extensions" user_options = [ ('build-clib=', 'b', "directory to build C/C++ libraries to"), ('build-temp=', 't', "directory to put temporary build by-products"), ('debug', 'g', "compile with debugging information"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ('compiler=', 'c', "specify the compiler type"), ] boolean_options = ['debug', 'force'] help_options = [ ('help-compiler', None, "list available compilers", show_compilers), ] def initialize_options(self): self.build_clib = None self.build_temp = None # List of libraries to build self.libraries = None # Compilation options for all libraries self.include_dirs = None self.define = None self.undef = None self.debug = None self.force = 0 self.compiler = None def finalize_options(self): # This might be confusing: both build-clib and build-temp default # to build-temp as defined by the "build" command. This is because # I think that C libraries are really just temporary build # by-products, at least from the point of view of building Python # extensions -- but I want to keep my options open. self.set_undefined_options('build', ('build_temp', 'build_clib'), ('build_temp', 'build_temp'), ('compiler', 'compiler'), ('debug', 'debug'), ('force', 'force')) self.libraries = self.distribution.libraries if self.libraries: self.check_library_list(self.libraries) if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] if isinstance(self.include_dirs, str): self.include_dirs = self.include_dirs.split(os.pathsep) # XXX same as for build_ext -- what about 'self.define' and # 'self.undef' ? def run(self): if not self.libraries: return # Yech -- this is cut 'n pasted from build_ext.py! from distutils.ccompiler import new_compiler self.compiler = new_compiler(compiler=self.compiler, dry_run=self.dry_run, force=self.force) customize_compiler(self.compiler) if self.include_dirs is not None: self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name,value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: self.compiler.undefine_macro(macro) self.build_libraries(self.libraries) def check_library_list(self, libraries): """Ensure that the list of libraries is valid. `library` is presumably provided as a command option 'libraries'. This method checks that it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. """ if not isinstance(libraries, list): raise DistutilsSetupError( "'libraries' option must be a list of tuples") for lib in libraries: if not isinstance(lib, tuple) and len(lib) != 2: raise DistutilsSetupError( "each element of 'libraries' must a 2-tuple") name, build_info = lib if not isinstance(name, str): raise DistutilsSetupError( "first element of each tuple in 'libraries' " "must be a string (the library name)") if '/' in name or (os.sep != '/' and os.sep in name): raise DistutilsSetupError("bad library name '%s': " "may not contain directory separators" % lib[0]) if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'libraries' " "must be a dictionary (build info)") def get_library_names(self): # Assume the library list is valid -- 'check_library_list()' is # called from 'finalize_options()', so it should be! if not self.libraries: return None lib_names = [] for (lib_name, build_info) in self.libraries: lib_names.append(lib_name) return lib_names def get_source_files(self): self.check_library_list(self.libraries) filenames = [] for (lib_name, build_info) in self.libraries: sources = build_info.get('sources') if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'sources' must be present and must be " "a list of source filenames" % lib_name) filenames.extend(sources) return filenames def build_libraries(self, libraries): for (lib_name, build_info) in libraries: sources = build_info.get('sources') if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError( "in 'libraries' option (library '%s'), " "'sources' must be present and must be " "a list of source filenames" % lib_name) sources = list(sources) log.info("building '%s' library", lib_name) # First, compile the source code to object files in the library # directory. (This should probably change to putting object # files in a temporary build directory.) macros = build_info.get('macros') include_dirs = build_info.get('include_dirs') objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=include_dirs, debug=self.debug) # Now "link" the object files together into a static library. # (On Unix at least, this isn't really linking -- it just # builds an archive. Whatever.) self.compiler.create_static_lib(objects, lib_name, output_dir=self.build_clib, debug=self.debug) PK!84,KK#_distutils/command/build_scripts.pynu["""distutils.command.build_scripts Implements the Distutils 'build_scripts' command.""" import os, re from stat import ST_MODE from distutils import sysconfig from distutils.core import Command from distutils.dep_util import newer from distutils.util import convert_path from distutils import log import tokenize # check if Python is called on the first line with this expression first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$') class build_scripts(Command): description = "\"build\" scripts (copy and fixup #! line)" user_options = [ ('build-dir=', 'd', "directory to \"build\" (copy) to"), ('force', 'f', "forcibly build everything (ignore file timestamps"), ('executable=', 'e', "specify final destination interpreter path"), ] boolean_options = ['force'] def initialize_options(self): self.build_dir = None self.scripts = None self.force = None self.executable = None self.outfiles = None def finalize_options(self): self.set_undefined_options('build', ('build_scripts', 'build_dir'), ('force', 'force'), ('executable', 'executable')) self.scripts = self.distribution.scripts def get_source_files(self): return self.scripts def run(self): if not self.scripts: return self.copy_scripts() def copy_scripts(self): r"""Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ self.mkpath(self.build_dir) outfiles = [] updated_files = [] for script in self.scripts: adjust = False script = convert_path(script) outfile = os.path.join(self.build_dir, os.path.basename(script)) outfiles.append(outfile) if not self.force and not newer(script, outfile): log.debug("not copying %s (up-to-date)", script) continue # Always open the file, but ignore failures in dry-run mode -- # that way, we'll get accurate feedback if we can read the # script. try: f = open(script, "rb") except OSError: if not self.dry_run: raise f = None else: encoding, lines = tokenize.detect_encoding(f.readline) f.seek(0) first_line = f.readline() if not first_line: self.warn("%s is an empty file (skipping)" % script) continue match = first_line_re.match(first_line) if match: adjust = True post_interp = match.group(1) or b'' if adjust: log.info("copying and adjusting %s -> %s", script, self.build_dir) updated_files.append(outfile) if not self.dry_run: if not sysconfig.python_build: executable = self.executable else: executable = os.path.join( sysconfig.get_config_var("BINDIR"), "python%s%s" % (sysconfig.get_config_var("VERSION"), sysconfig.get_config_var("EXE"))) executable = os.fsencode(executable) shebang = b"#!" + executable + post_interp + b"\n" # Python parser starts to read a script using UTF-8 until # it gets a #coding:xxx cookie. The shebang has to be the # first line of a file, the #coding:xxx cookie cannot be # written before. So the shebang has to be decodable from # UTF-8. try: shebang.decode('utf-8') except UnicodeDecodeError: raise ValueError( "The shebang ({!r}) is not decodable " "from utf-8".format(shebang)) # If the script is encoded to a custom encoding (use a # #coding:xxx cookie), the shebang has to be decodable from # the script encoding too. try: shebang.decode(encoding) except UnicodeDecodeError: raise ValueError( "The shebang ({!r}) is not decodable " "from the script encoding ({})" .format(shebang, encoding)) with open(outfile, "wb") as outf: outf.write(shebang) outf.writelines(f.readlines()) if f: f.close() else: if f: f.close() updated_files.append(outfile) self.copy_file(script, outfile) if os.name == 'posix': for file in outfiles: if self.dry_run: log.info("changing mode of %s", file) else: oldmode = os.stat(file)[ST_MODE] & 0o7777 newmode = (oldmode | 0o555) & 0o7777 if newmode != oldmode: log.info("changing mode of %s from %o to %o", file, oldmode, newmode) os.chmod(file, newmode) # XXX should we modify self.outfiles? return outfiles, updated_files PK!:%_distutils/command/install_scripts.pynu["""distutils.command.install_scripts Implements the Distutils 'install_scripts' command, for installing Python scripts.""" # contributed by Bastian Kleineidam import os from distutils.core import Command from distutils import log from stat import ST_MODE class install_scripts(Command): description = "install scripts (Python or otherwise)" user_options = [ ('install-dir=', 'd', "directory to install scripts to"), ('build-dir=','b', "build directory (where to install from)"), ('force', 'f', "force installation (overwrite existing files)"), ('skip-build', None, "skip the build steps"), ] boolean_options = ['force', 'skip-build'] def initialize_options(self): self.install_dir = None self.force = 0 self.build_dir = None self.skip_build = None def finalize_options(self): self.set_undefined_options('build', ('build_scripts', 'build_dir')) self.set_undefined_options('install', ('install_scripts', 'install_dir'), ('force', 'force'), ('skip_build', 'skip_build'), ) def run(self): if not self.skip_build: self.run_command('build_scripts') self.outfiles = self.copy_tree(self.build_dir, self.install_dir) if os.name == 'posix': # Set the executable bits (owner, group, and world) on # all the scripts we just installed. for file in self.get_outputs(): if self.dry_run: log.info("changing mode of %s", file) else: mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777 log.info("changing mode of %s to %o", file, mode) os.chmod(file, mode) def get_inputs(self): return self.distribution.scripts or [] def get_outputs(self): return self.outfiles or [] PK!;_distutils/command/__init__.pynu["""distutils.command Package containing implementation of all the standard Distutils commands.""" __all__ = ['build', 'build_py', 'build_ext', 'build_clib', 'build_scripts', 'clean', 'install', 'install_lib', 'install_headers', 'install_scripts', 'install_data', 'sdist', 'register', 'bdist', 'bdist_dumb', 'bdist_rpm', 'bdist_wininst', 'check', 'upload', # These two are reserved for future use: #'bdist_sdux', #'bdist_pkgtool', # Note: # bdist_packager is not included because it only provides # an abstract base class ] PK!.o@o@_distutils/command/build_py.pynu["""distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import importlib.util import sys import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path from distutils import log class build_py (Command): description = "\"build\" pure Python modules (copy to build directory)" user_options = [ ('build-lib=', 'd', "directory to \"build\" (copy) to"), ('compile', 'c', "compile .py to .pyc"), ('no-compile', None, "don't compile .py files [default]"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] boolean_options = ['compile', 'force'] negative_opt = {'no-compile' : 'compile'} def initialize_options(self): self.build_lib = None self.py_modules = None self.package = None self.package_data = None self.package_dir = None self.compile = 0 self.optimize = 0 self.force = None def finalize_options(self): self.set_undefined_options('build', ('build_lib', 'build_lib'), ('force', 'force')) # Get the distribution options that are aliases for build_py # options -- list of packages and list of modules. self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules self.package_data = self.distribution.package_data self.package_dir = {} if self.distribution.package_dir: for name, path in self.distribution.package_dir.items(): self.package_dir[name] = convert_path(path) self.data_files = self.get_data_files() # Ick, copied straight from install_lib.py (fancy_getopt needs a # type system! Hell, *everything* needs a type system!!!) if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) assert 0 <= self.optimize <= 2 except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") def run(self): # XXX copy_file by default preserves atime and mtime. IMHO this is # the right thing to do, but perhaps it should be an option -- in # particular, a site administrator might want installed files to # reflect the time of installation rather than the last # modification time before the installed release. # XXX copy_file by default preserves mode, which appears to be the # wrong thing to do: if a file is read-only in the working # directory, we want it to be installed read/write so that the next # installation of the same module distribution can overwrite it # without problems. (This might be a Unix-specific issue.) Thus # we turn off 'preserve_mode' when copying to the build directory, # since the build directory is supposed to be exactly what the # installation will look like (ie. we preserve mode when # installing). # Two options control which modules will be installed: 'packages' # and 'py_modules'. The former lets us work with whole packages, not # specifying individual modules at all; the latter is for # specifying modules one-at-a-time. if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.byte_compile(self.get_outputs(include_bytecode=0)) def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files plen = 0 if src_dir: plen = len(src_dir)+1 # Strip directory from globbed filenames filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ] data.append((package, src_dir, build_dir, filenames)) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" globs = (self.package_data.get('', []) + self.package_data.get(package, [])) files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path filelist = glob.glob(os.path.join(glob.escape(src_dir), convert_path(pattern))) # Files that match more than one pattern are only added once files.extend([fn for fn in filelist if fn not in files and os.path.isfile(fn)]) return files def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) self.copy_file(os.path.join(src_dir, filename), target, preserve_mode=False) def get_package_dir(self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).""" path = package.split('.') if not self.package_dir: if path: return os.path.join(*path) else: return '' else: tail = [] while path: try: pdir = self.package_dir['.'.join(path)] except KeyError: tail.insert(0, path[-1]) del path[-1] else: tail.insert(0, pdir) return os.path.join(*tail) else: # Oops, got all the way through 'path' without finding a # match in package_dir. If package_dir defines a directory # for the root (nameless) package, then fallback on it; # otherwise, we might as well have not consulted # package_dir at all, as we just use the directory implied # by 'tail' (which should be the same as the original value # of 'path' at this point). pdir = self.package_dir.get('') if pdir is not None: tail.insert(0, pdir) if tail: return os.path.join(*tail) else: return '' def check_package(self, package, package_dir): # Empty dir name means current directory, which we can probably # assume exists. Also, os.path.exists and isdir don't know about # my "empty string means current dir" convention, so we have to # circumvent them. if package_dir != "": if not os.path.exists(package_dir): raise DistutilsFileError( "package directory '%s' does not exist" % package_dir) if not os.path.isdir(package_dir): raise DistutilsFileError( "supposed package directory '%s' exists, " "but is not a directory" % package_dir) # Require __init__.py for all but the "root package" if package: init_py = os.path.join(package_dir, "__init__.py") if os.path.isfile(init_py): return init_py else: log.warn(("package init file '%s' not found " + "(or not a regular file)"), init_py) # Either not in a package at all (__init__.py not expected), or # __init__.py doesn't exist -- so don't return the filename. return None def check_module(self, module, module_file): if not os.path.isfile(module_file): log.warn("file %s (for module %s) not found", module_file, module) return False else: return True def find_package_modules(self, package, package_dir): self.check_package(package, package_dir) module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py")) modules = [] setup_script = os.path.abspath(self.distribution.script_name) for f in module_files: abs_f = os.path.abspath(f) if abs_f != setup_script: module = os.path.splitext(os.path.basename(f))[0] modules.append((package, module, f)) else: self.debug_print("excluding %s" % setup_script) return modules def find_modules(self): """Finds individually-specified Python modules, ie. those listed by module name in 'self.py_modules'. Returns a list of tuples (package, module_base, filename): 'package' is a tuple of the path through package-space to the module; 'module_base' is the bare (no packages, no dots) module name, and 'filename' is the path to the ".py" file (relative to the distribution root) that implements the module. """ # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages = {} # List of (package, module, filename) tuples to return modules = [] # We treat modules-in-packages almost the same as toplevel modules, # just the "package" for a toplevel is empty (either an empty # string or empty list, depending on context). Differences: # - don't check for __init__.py in directory for empty package for module in self.py_modules: path = module.split('.') package = '.'.join(path[0:-1]) module_base = path[-1] try: (package_dir, checked) = packages[package] except KeyError: package_dir = self.get_package_dir(package) checked = 0 if not checked: init_py = self.check_package(package, package_dir) packages[package] = (package_dir, 1) if init_py: modules.append((package, "__init__", init_py)) # XXX perhaps we should also check for just .pyc files # (so greedy closed-source bastards can distribute Python # modules too) module_file = os.path.join(package_dir, module_base + ".py") if not self.check_module(module, module_file): continue modules.append((package, module_base, module_file)) return modules def find_all_modules(self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do.""" modules = [] if self.py_modules: modules.extend(self.find_modules()) if self.packages: for package in self.packages: package_dir = self.get_package_dir(package) m = self.find_package_modules(package, package_dir) modules.extend(m) return modules def get_source_files(self): return [module[-1] for module in self.find_all_modules()] def get_module_outfile(self, build_dir, package, module): outfile_path = [build_dir] + list(package) + [module + ".py"] return os.path.join(*outfile_path) def get_outputs(self, include_bytecode=1): modules = self.find_all_modules() outputs = [] for (package, module, module_file) in modules: package = package.split('.') filename = self.get_module_outfile(self.build_lib, package, module) outputs.append(filename) if include_bytecode: if self.compile: outputs.append(importlib.util.cache_from_source( filename, optimization='')) if self.optimize > 0: outputs.append(importlib.util.cache_from_source( filename, optimization=self.optimize)) outputs += [ os.path.join(build_dir, filename) for package, src_dir, build_dir, filenames in self.data_files for filename in filenames ] return outputs def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError( "'package' must be a string (dot-separated), list, or tuple") # Now put the module source file into the "build" area -- this is # easy, we just copy it somewhere under self.build_lib (the build # directory for Python source). outfile = self.get_module_outfile(self.build_lib, package, module) dir = os.path.dirname(outfile) self.mkpath(dir) return self.copy_file(module_file, outfile, preserve_mode=0) def build_modules(self): modules = self.find_modules() for (package, module, module_file) in modules: # Now "build" the module -- ie. copy the source file to # self.build_lib (the build directory for Python source). # (Actually, it gets copied to the directory for this package # under self.build_lib.) self.build_module(module, module_file, package) def build_packages(self): for package in self.packages: # Get list of (package, module, module_file) tuples based on # scanning the package directory. 'package' is only included # in the tuple so that 'find_modules()' and # 'find_package_tuples()' have a consistent interface; it's # ignored here (apart from a sanity check). Also, 'module' is # the *unqualified* module name (ie. no dots, no package -- we # already know its package!), and 'module_file' is the path to # the .py file, relative to the current directory # (ie. including 'package_dir'). package_dir = self.get_package_dir(package) modules = self.find_package_modules(package, package_dir) # Now loop over the modules we found, "building" each one (just # copy it to self.build_lib). for (package_, module, module_file) in modules: assert package == package_ self.build_module(module, module_file, package) def byte_compile(self, files): if sys.dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile prefix = self.build_lib if prefix[-1] != os.sep: prefix = prefix + os.sep # XXX this code is essentially the same as the 'byte_compile() # method of the "install_lib" command, except for the determination # of the 'prefix' string. Hmmm. if self.compile: byte_compile(files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, force=self.force, prefix=prefix, dry_run=self.dry_run) PK!n1_distutils/command/bdist.pynu["""distutils.command.bdist Implements the Distutils 'bdist' command (create a built [binary] distribution).""" import os from distutils.core import Command from distutils.errors import * from distutils.util import get_platform def show_formats(): """Print list of available formats (arguments to "--format" option). """ from distutils.fancy_getopt import FancyGetopt formats = [] for format in bdist.format_commands: formats.append(("formats=" + format, None, bdist.format_command[format][1])) pretty_printer = FancyGetopt(formats) pretty_printer.print_help("List of available distribution formats:") class bdist(Command): description = "create a built (binary) distribution" user_options = [('bdist-base=', 'b', "temporary directory for creating built distributions"), ('plat-name=', 'p', "platform name to embed in generated filenames " "(default: %s)" % get_platform()), ('formats=', None, "formats for distribution (comma-separated list)"), ('dist-dir=', 'd', "directory to put final built distributions in " "[default: dist]"), ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), ('owner=', 'u', "Owner name used when creating a tar file" " [default: current user]"), ('group=', 'g', "Group name used when creating a tar file" " [default: current group]"), ] boolean_options = ['skip-build'] help_options = [ ('help-formats', None, "lists available distribution formats", show_formats), ] # The following commands do not take a format option from bdist no_format_option = ('bdist_rpm',) # This won't do in reality: will need to distinguish RPM-ish Linux, # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS. default_format = {'posix': 'gztar', 'nt': 'zip'} # Establish the preferred order (for the --help-formats option). format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar', 'wininst', 'zip', 'msi'] # And the real information. format_command = {'rpm': ('bdist_rpm', "RPM distribution"), 'gztar': ('bdist_dumb', "gzip'ed tar file"), 'bztar': ('bdist_dumb', "bzip2'ed tar file"), 'xztar': ('bdist_dumb', "xz'ed tar file"), 'ztar': ('bdist_dumb', "compressed tar file"), 'tar': ('bdist_dumb', "tar file"), 'wininst': ('bdist_wininst', "Windows executable installer"), 'zip': ('bdist_dumb', "ZIP file"), 'msi': ('bdist_msi', "Microsoft Installer") } def initialize_options(self): self.bdist_base = None self.plat_name = None self.formats = None self.dist_dir = None self.skip_build = 0 self.group = None self.owner = None def finalize_options(self): # have to finalize 'plat_name' before 'bdist_base' if self.plat_name is None: if self.skip_build: self.plat_name = get_platform() else: self.plat_name = self.get_finalized_command('build').plat_name # 'bdist_base' -- parent of per-built-distribution-format # temporary directories (eg. we'll probably have # "build/bdist./dumb", "build/bdist./rpm", etc.) if self.bdist_base is None: build_base = self.get_finalized_command('build').build_base self.bdist_base = os.path.join(build_base, 'bdist.' + self.plat_name) self.ensure_string_list('formats') if self.formats is None: try: self.formats = [self.default_format[os.name]] except KeyError: raise DistutilsPlatformError( "don't know how to create built distributions " "on platform %s" % os.name) if self.dist_dir is None: self.dist_dir = "dist" def run(self): # Figure out which sub-commands we need to run. commands = [] for format in self.formats: try: commands.append(self.format_command[format][0]) except KeyError: raise DistutilsOptionError("invalid format '%s'" % format) # Reinitialize and run each command. for i in range(len(self.formats)): cmd_name = commands[i] sub_cmd = self.reinitialize_command(cmd_name) if cmd_name not in self.no_format_option: sub_cmd.format = self.formats[i] # passing the owner and group names for tar archiving if cmd_name == 'bdist_dumb': sub_cmd.owner = self.owner sub_cmd.group = self.group # If we're going to need to run this command again, tell it to # keep its temporary files around so subsequent runs go faster. if cmd_name in commands[i+1:]: sub_cmd.keep_temp = 1 self.run_command(cmd_name) PK!   "_distutils/command/install_data.pynu["""distutils.command.install_data Implements the Distutils 'install_data' command, for installing platform-independent data files.""" # contributed by Bastian Kleineidam import os from distutils.core import Command from distutils.util import change_root, convert_path class install_data(Command): description = "install data files" user_options = [ ('install-dir=', 'd', "base directory for installing data files " "(default: installation base dir)"), ('root=', None, "install everything relative to this alternate root directory"), ('force', 'f', "force installation (overwrite existing files)"), ] boolean_options = ['force'] def initialize_options(self): self.install_dir = None self.outfiles = [] self.root = None self.force = 0 self.data_files = self.distribution.data_files self.warn_dir = 1 def finalize_options(self): self.set_undefined_options('install', ('install_data', 'install_dir'), ('root', 'root'), ('force', 'force'), ) def run(self): self.mkpath(self.install_dir) for f in self.data_files: if isinstance(f, str): # it's a simple file, so copy it f = convert_path(f) if self.warn_dir: self.warn("setup script did not provide a directory for " "'%s' -- installing right in '%s'" % (f, self.install_dir)) (out, _) = self.copy_file(f, self.install_dir) self.outfiles.append(out) else: # it's a tuple with path to install to and a list of files dir = convert_path(f[0]) if not os.path.isabs(dir): dir = os.path.join(self.install_dir, dir) elif self.root: dir = change_root(self.root, dir) self.mkpath(dir) if f[1] == []: # If there are no files listed, the user must be # trying to create an empty directory, so add the # directory to the list of output files. self.outfiles.append(dir) else: # Copy files, adding them to the list of output files. for data in f[1]: data = convert_path(data) (out, _) = self.copy_file(data, dir) self.outfiles.append(out) def get_inputs(self): return self.data_files or [] def get_outputs(self): return self.outfiles PK!*Rj&%_distutils/command/install_headers.pynu["""distutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" from distutils.core import Command # XXX force is never used class install_headers(Command): description = "install C/C++ header files" user_options = [('install-dir=', 'd', "directory to install header files to"), ('force', 'f', "force installation (overwrite existing files)"), ] boolean_options = ['force'] def initialize_options(self): self.install_dir = None self.force = 0 self.outfiles = [] def finalize_options(self): self.set_undefined_options('install', ('install_headers', 'install_dir'), ('force', 'force')) def run(self): headers = self.distribution.headers if not headers: return self.mkpath(self.install_dir) for header in headers: (out, _) = self.copy_file(header, self.install_dir) self.outfiles.append(out) def get_inputs(self): return self.distribution.headers or [] def get_outputs(self): return self.outfiles PK! OO_distutils/util.pynu["""distutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. """ import os import re import importlib.util import string import sys from distutils.errors import DistutilsPlatformError from distutils.dep_util import newer from distutils.spawn import spawn from distutils import log from distutils.errors import DistutilsByteCompileError from .py35compat import _optim_args_from_interpreter_flags def get_host_platform(): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. on Linux, the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. """ if os.name == 'nt': if 'amd64' in sys.version.lower(): return 'win-amd64' if '(arm)' in sys.version.lower(): return 'win-arm32' if '(arm64)' in sys.version.lower(): return 'win-arm64' return sys.platform # Set for cross builds explicitly if "_PYTHON_HOST_PLATFORM" in os.environ: return os.environ["_PYTHON_HOST_PLATFORM"] if os.name != "posix" or not hasattr(os, 'uname'): # XXX what about the architecture? NT is Intel or Alpha, # Mac OS is M68k or PPC, etc. return sys.platform # Try to distinguish various flavours of Unix (osname, host, release, version, machine) = os.uname() # Convert the OS name to lowercase, remove '/' characters, and translate # spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') if osname[:5] == "linux": # At least on Linux/Intel, 'machine' is the processor -- # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) elif osname[:5] == "sunos": if release[0] >= "5": # SunOS 5 == Solaris 2 osname = "solaris" release = "%d.%s" % (int(release[0]) - 3, release[2:]) # We can't use "platform.architecture()[0]" because a # bootstrap problem. We use a dict to get an error # if some suspicious happens. bitness = {2147483647:"32bit", 9223372036854775807:"64bit"} machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": from .py38compat import aix_platform return aix_platform(osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+', re.ASCII) m = rel_re.match(release) if m: release = m.group() elif osname[:6] == "darwin": import _osx_support, distutils.sysconfig osname, release, machine = _osx_support.get_platform_osx( distutils.sysconfig.get_config_vars(), osname, release, machine) return "%s-%s-%s" % (osname, release, machine) def get_platform(): if os.name == 'nt': TARGET_TO_PLAT = { 'x86' : 'win32', 'x64' : 'win-amd64', 'arm' : 'win-arm32', 'arm64': 'win-arm64', } return TARGET_TO_PLAT.get(os.environ.get('VSCMD_ARG_TGT_ARCH')) or get_host_platform() else: return get_host_platform() if sys.platform == 'darwin': _syscfg_macosx_ver = None # cache the version pulled from sysconfig MACOSX_VERSION_VAR = 'MACOSX_DEPLOYMENT_TARGET' def _clear_cached_macosx_ver(): """For testing only. Do not call.""" global _syscfg_macosx_ver _syscfg_macosx_ver = None def get_macosx_target_ver_from_syscfg(): """Get the version of macOS latched in the Python interpreter configuration. Returns the version as a string or None if can't obtain one. Cached.""" global _syscfg_macosx_ver if _syscfg_macosx_ver is None: from distutils import sysconfig ver = sysconfig.get_config_var(MACOSX_VERSION_VAR) or '' if ver: _syscfg_macosx_ver = ver return _syscfg_macosx_ver def get_macosx_target_ver(): """Return the version of macOS for which we are building. The target version defaults to the version in sysconfig latched at time the Python interpreter was built, unless overridden by an environment variable. If neither source has a value, then None is returned""" syscfg_ver = get_macosx_target_ver_from_syscfg() env_ver = os.environ.get(MACOSX_VERSION_VAR) if env_ver: # Validate overridden version against sysconfig version, if have both. # Ensure that the deployment target of the build process is not less # than 10.3 if the interpreter was built for 10.3 or later. This # ensures extension modules are built with correct compatibility # values, specifically LDSHARED which can use # '-undefined dynamic_lookup' which only works on >= 10.3. if syscfg_ver and split_version(syscfg_ver) >= [10, 3] and \ split_version(env_ver) < [10, 3]: my_msg = ('$' + MACOSX_VERSION_VAR + ' mismatch: ' 'now "%s" but "%s" during configure; ' 'must use 10.3 or later' % (env_ver, syscfg_ver)) raise DistutilsPlatformError(my_msg) return env_ver return syscfg_ver def split_version(s): """Convert a dot-separated string into a list of numbers for comparisons""" return [int(n) for n in s.split('.')] def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. """ if os.sep == '/': return pathname if not pathname: return pathname if pathname[0] == '/': raise ValueError("path '%s' cannot be absolute" % pathname) if pathname[-1] == '/': raise ValueError("path '%s' cannot end with '/'" % pathname) paths = pathname.split('/') while '.' in paths: paths.remove('.') if not paths: return os.curdir return os.path.join(*paths) # convert_path () def change_root (new_root, pathname): """Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. """ if os.name == 'posix': if not os.path.isabs(pathname): return os.path.join(new_root, pathname) else: return os.path.join(new_root, pathname[1:]) elif os.name == 'nt': (drive, path) = os.path.splitdrive(pathname) if path[0] == '\\': path = path[1:] return os.path.join(new_root, path) else: raise DistutilsPlatformError("nothing known about platform '%s'" % os.name) _environ_checked = 0 def check_environ (): """Ensure that 'os.environ' has all the environment variables we guarantee that users can use in config files, command-line options, etc. Currently this includes: HOME - user's home directory (Unix only) PLAT - description of the current platform, including hardware and OS (see 'get_platform()') """ global _environ_checked if _environ_checked: return if os.name == 'posix' and 'HOME' not in os.environ: try: import pwd os.environ['HOME'] = pwd.getpwuid(os.getuid())[5] except (ImportError, KeyError): # bpo-10496: if the current user identifier doesn't exist in the # password database, do nothing pass if 'PLAT' not in os.environ: os.environ['PLAT'] = get_platform() _environ_checked = 1 def subst_vars (s, local_vars): """Perform shell/Perl-style variable substitution on 'string'. Every occurrence of '$' followed by a name is considered a variable, and variable is substituted by the value found in the 'local_vars' dictionary, or in 'os.environ' if it's not in 'local_vars'. 'os.environ' is first checked/augmented to guarantee that it contains certain values: see 'check_environ()'. Raise ValueError for any variables not found in either 'local_vars' or 'os.environ'. """ check_environ() def _subst (match, local_vars=local_vars): var_name = match.group(1) if var_name in local_vars: return str(local_vars[var_name]) else: return os.environ[var_name] try: return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s) except KeyError as var: raise ValueError("invalid variable '$%s'" % var) # subst_vars () def grok_environment_error (exc, prefix="error: "): # Function kept for backward compatibility. # Used to try clever things with EnvironmentErrors, # but nowadays str(exception) produces good messages. return prefix + str(exc) # Needed by 'split_quoted()' _wordchars_re = _squote_re = _dquote_re = None def _init_regex(): global _wordchars_re, _squote_re, _dquote_re _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace) _squote_re = re.compile(r"'(?:[^'\\]|\\.)*'") _dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"') def split_quoted (s): """Split a string up according to Unix shell-like rules for quotes and backslashes. In short: words are delimited by spaces, as long as those spaces are not escaped by a backslash, or inside a quoted string. Single and double quotes are equivalent, and the quote characters can be backslash-escaped. The backslash is stripped from any two-character escape sequence, leaving only the escaped character. The quote characters are stripped from any quoted string. Returns a list of words. """ # This is a nice algorithm for splitting up a single string, since it # doesn't require character-by-character examination. It was a little # bit of a brain-bender to get it working right, though... if _wordchars_re is None: _init_regex() s = s.strip() words = [] pos = 0 while s: m = _wordchars_re.match(s, pos) end = m.end() if end == len(s): words.append(s[:end]) break if s[end] in string.whitespace: # unescaped, unquoted whitespace: now words.append(s[:end]) # we definitely have a word delimiter s = s[end:].lstrip() pos = 0 elif s[end] == '\\': # preserve whatever is being escaped; # will become part of the current word s = s[:end] + s[end+1:] pos = end+1 else: if s[end] == "'": # slurp singly-quoted string m = _squote_re.match(s, end) elif s[end] == '"': # slurp doubly-quoted string m = _dquote_re.match(s, end) else: raise RuntimeError("this can't happen (bad char '%c')" % s[end]) if m is None: raise ValueError("bad string (mismatched %s quotes?)" % s[end]) (beg, end) = m.span() s = s[:beg] + s[beg+1:end-1] + s[end:] pos = m.end() - 2 if pos >= len(s): words.append(s) break return words # split_quoted () def execute (func, args, msg=None, verbose=0, dry_run=0): """Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to embody the "external action" being performed), and an optional message to print. """ if msg is None: msg = "%s%r" % (func.__name__, args) if msg[-2:] == ',)': # correct for singleton tuple msg = msg[0:-2] + ')' log.info(msg) if not dry_run: func(*args) def strtobool (val): """Convert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if 'val' is anything else. """ val = val.lower() if val in ('y', 'yes', 't', 'true', 'on', '1'): return 1 elif val in ('n', 'no', 'f', 'false', 'off', '0'): return 0 else: raise ValueError("invalid truth value %r" % (val,)) def byte_compile (py_files, optimize=0, force=0, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=None): """Byte-compile a collection of Python source files to .pyc files in a __pycache__ subdirectory. 'py_files' is a list of files to compile; any files that don't end in ".py" are silently skipped. 'optimize' must be one of the following: 0 - don't optimize 1 - normal optimization (like "python -O") 2 - extra optimization (like "python -OO") If 'force' is true, all files are recompiled regardless of timestamps. The source filename encoded in each bytecode file defaults to the filenames listed in 'py_files'; you can modify these with 'prefix' and 'basedir'. 'prefix' is a string that will be stripped off of each source filename, and 'base_dir' is a directory name that will be prepended (after 'prefix' is stripped). You can supply either or both (or neither) of 'prefix' and 'base_dir', as you wish. If 'dry_run' is true, doesn't actually do anything that would affect the filesystem. Byte-compilation is either done directly in this interpreter process with the standard py_compile module, or indirectly by writing a temporary script and executing it. Normally, you should let 'byte_compile()' figure out to use direct compilation or not (see the source for details). The 'direct' flag is used by the script generated in indirect mode; unless you know what you're doing, leave it set to None. """ # Late import to fix a bootstrap issue: _posixsubprocess is built by # setup.py, but setup.py uses distutils. import subprocess # nothing is done if sys.dont_write_bytecode is True if sys.dont_write_bytecode: raise DistutilsByteCompileError('byte-compiling is disabled.') # First, if the caller didn't force us into direct or indirect mode, # figure out which mode we should be in. We take a conservative # approach: choose direct mode *only* if the current interpreter is # in debug mode and optimize is 0. If we're not in debug mode (-O # or -OO), we don't know which level of optimization this # interpreter is running with, so we can't do direct # byte-compilation and be certain that it's the right thing. Thus, # always compile indirectly if the current interpreter is in either # optimize mode, or if either optimization level was requested by # the caller. if direct is None: direct = (__debug__ and optimize == 0) # "Indirect" byte-compilation: write a temporary script and then # run it with the appropriate flags. if not direct: try: from tempfile import mkstemp (script_fd, script_name) = mkstemp(".py") except ImportError: from tempfile import mktemp (script_fd, script_name) = None, mktemp(".py") log.info("writing byte-compilation script '%s'", script_name) if not dry_run: if script_fd is not None: script = os.fdopen(script_fd, "w") else: script = open(script_name, "w") with script: script.write("""\ from distutils.util import byte_compile files = [ """) # XXX would be nice to write absolute filenames, just for # safety's sake (script should be more robust in the face of # chdir'ing before running it). But this requires abspath'ing # 'prefix' as well, and that breaks the hack in build_lib's # 'byte_compile()' method that carefully tacks on a trailing # slash (os.sep really) to make sure the prefix here is "just # right". This whole prefix business is rather delicate -- the # problem is that it's really a directory, but I'm treating it # as a dumb string, so trailing slashes and so forth matter. #py_files = map(os.path.abspath, py_files) #if prefix: # prefix = os.path.abspath(prefix) script.write(",\n".join(map(repr, py_files)) + "]\n") script.write(""" byte_compile(files, optimize=%r, force=%r, prefix=%r, base_dir=%r, verbose=%r, dry_run=0, direct=1) """ % (optimize, force, prefix, base_dir, verbose)) cmd = [sys.executable] cmd.extend(_optim_args_from_interpreter_flags()) cmd.append(script_name) spawn(cmd, dry_run=dry_run) execute(os.remove, (script_name,), "removing %s" % script_name, dry_run=dry_run) # "Direct" byte-compilation: use the py_compile module to compile # right here, right now. Note that the script generated in indirect # mode simply calls 'byte_compile()' in direct mode, a weird sort of # cross-process recursion. Hey, it works! else: from py_compile import compile for file in py_files: if file[-3:] != ".py": # This lets us be lazy and not filter filenames in # the "install_lib" command. continue # Terminology from the py_compile module: # cfile - byte-compiled file # dfile - purported source filename (same as 'file' by default) if optimize >= 0: opt = '' if optimize == 0 else optimize cfile = importlib.util.cache_from_source( file, optimization=opt) else: cfile = importlib.util.cache_from_source(file) dfile = file if prefix: if file[:len(prefix)] != prefix: raise ValueError("invalid prefix: filename %r doesn't start with %r" % (file, prefix)) dfile = dfile[len(prefix):] if base_dir: dfile = os.path.join(base_dir, dfile) cfile_base = os.path.basename(cfile) if direct: if force or newer(file, cfile): log.info("byte-compiling %s to %s", file, cfile_base) if not dry_run: compile(file, cfile, dfile) else: log.debug("skipping byte-compilation of %s to %s", file, cfile_base) # byte_compile () def rfc822_escape (header): """Return a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline. """ lines = header.split('\n') sep = '\n' + 8 * ' ' return sep.join(lines) PK!];F_distutils/_macos_compat.pynu[import sys import importlib def bypass_compiler_fixup(cmd, args): return cmd if sys.platform == 'darwin': compiler_fixup = importlib.import_module('_osx_support').compiler_fixup else: compiler_fixup = bypass_compiler_fixup PK!=&-++_distutils/_log.pynu[import logging log = logging.getLogger() PK!_distutils/py38compat.pynu[def aix_platform(osname, version, release): try: import _aix_support return _aix_support.aix_platform() except ImportError: pass return "%s-%s.%s" % (osname, version, release) PK!3bb_distutils/dir_util.pynu["""distutils.dir_util Utility functions for manipulating directories and directory trees.""" import os import errno from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating /foo/bar/baz" messages in dry-run mode _path_created = {} # I don't use os.makedirs because a) it's new to Python 1.5.2, and # b) it blows up if the directory already exists (I want to silently # succeed in that case). def mkpath(name, mode=0o777, verbose=1, dry_run=0): """Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout. Return the list of directories actually created. """ global _path_created # Detect a common bug -- name is None if not isinstance(name, str): raise DistutilsInternalError( "mkpath: 'name' must be a string (got %r)" % (name,)) # XXX what's the better way to handle verbosity? print as we create # each directory in the path (the current behaviour), or only announce # the creation of the whole path? (quite easy to do the latter since # we're not using a recursive algorithm) name = os.path.normpath(name) created_dirs = [] if os.path.isdir(name) or name == '': return created_dirs if _path_created.get(os.path.abspath(name)): return created_dirs (head, tail) = os.path.split(name) tails = [tail] # stack of lone dirs to create while head and tail and not os.path.isdir(head): (head, tail) = os.path.split(head) tails.insert(0, tail) # push next higher dir onto stack # now 'head' contains the deepest directory that already exists # (that is, the child of 'head' in 'name' is the highest directory # that does *not* exist) for d in tails: #print "head = %s, d = %s: " % (head, d), head = os.path.join(head, d) abs_head = os.path.abspath(head) if _path_created.get(abs_head): continue if verbose >= 1: log.info("creating %s", head) if not dry_run: try: os.mkdir(head, mode) except OSError as exc: if not (exc.errno == errno.EEXIST and os.path.isdir(head)): raise DistutilsFileError( "could not create '%s': %s" % (head, exc.args[-1])) created_dirs.append(head) _path_created[abs_head] = 1 return created_dirs def create_tree(base_dir, files, mode=0o777, verbose=1, dry_run=0): """Create all the empty directories under 'base_dir' needed to put 'files' there. 'base_dir' is just the name of a directory which doesn't necessarily exist yet; 'files' is a list of filenames to be interpreted relative to 'base_dir'. 'base_dir' + the directory portion of every file in 'files' will be created if it doesn't already exist. 'mode', 'verbose' and 'dry_run' flags are as for 'mkpath()'. """ # First get the list of directories to create need_dir = set() for file in files: need_dir.add(os.path.join(base_dir, os.path.dirname(file))) # Now create them for dir in sorted(need_dir): mkpath(dir, mode, verbose=verbose, dry_run=dry_run) def copy_tree(src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is created with 'mkpath()'. The end result of the copy is that every file in 'src' is copied to 'dst', and directories under 'src' are recursively copied to 'dst'. Return the list of files that were copied or might have been copied, using their output name. The return value is unaffected by 'update' or 'dry_run': it is simply the list of all files under 'src', with the names changed to be under 'dst'. 'preserve_mode' and 'preserve_times' are the same as for 'copy_file'; note that they only apply to regular files, not to directories. If 'preserve_symlinks' is true, symlinks will be copied as symlinks (on platforms that support them!); otherwise (the default), the destination of the symlink will be copied. 'update' and 'verbose' are the same as for 'copy_file'. """ from distutils.file_util import copy_file if not dry_run and not os.path.isdir(src): raise DistutilsFileError( "cannot copy tree '%s': not a directory" % src) try: names = os.listdir(src) except OSError as e: if dry_run: names = [] else: raise DistutilsFileError( "error listing files in '%s': %s" % (src, e.strerror)) if not dry_run: mkpath(dst, verbose=verbose) outputs = [] for n in names: src_name = os.path.join(src, n) dst_name = os.path.join(dst, n) if n.startswith('.nfs'): # skip NFS rename files continue if preserve_symlinks and os.path.islink(src_name): link_dest = os.readlink(src_name) if verbose >= 1: log.info("linking %s -> %s", dst_name, link_dest) if not dry_run: os.symlink(link_dest, dst_name) outputs.append(dst_name) elif os.path.isdir(src_name): outputs.extend( copy_tree(src_name, dst_name, preserve_mode, preserve_times, preserve_symlinks, update, verbose=verbose, dry_run=dry_run)) else: copy_file(src_name, dst_name, preserve_mode, preserve_times, update, verbose=verbose, dry_run=dry_run) outputs.append(dst_name) return outputs def _build_cmdtuple(path, cmdtuples): """Helper for remove_tree().""" for f in os.listdir(path): real_f = os.path.join(path,f) if os.path.isdir(real_f) and not os.path.islink(real_f): _build_cmdtuple(real_f, cmdtuples) else: cmdtuples.append((os.remove, real_f)) cmdtuples.append((os.rmdir, path)) def remove_tree(directory, verbose=1, dry_run=0): """Recursively remove an entire directory tree. Any errors are ignored (apart from being reported to stdout if 'verbose' is true). """ global _path_created if verbose >= 1: log.info("removing '%s' (and everything under it)", directory) if dry_run: return cmdtuples = [] _build_cmdtuple(directory, cmdtuples) for cmd in cmdtuples: try: cmd[0](cmd[1]) # remove dir from cache if it's already there abspath = os.path.abspath(cmd[1]) if abspath in _path_created: del _path_created[abspath] except OSError as exc: log.warn("error removing %s: %s", directory, exc) def ensure_relative(path): """Take the full path 'path', and make it a relative path. This is useful to make 'path' the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) if path[0:1] == os.sep: path = drive + path[1:] return path PK!5|!|!_distutils/archive_util.pynu["""distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).""" import os from warnings import warn import sys try: import zipfile except ImportError: zipfile = None from distutils.errors import DistutilsExecError from distutils.spawn import spawn from distutils.dir_util import mkpath from distutils import log try: from pwd import getpwnam except ImportError: getpwnam = None try: from grp import getgrnam except ImportError: getgrnam = None def _get_gid(name): """Returns a gid, given a group name.""" if getgrnam is None or name is None: return None try: result = getgrnam(name) except KeyError: result = None if result is not None: return result[2] return None def _get_uid(name): """Returns an uid, given a user name.""" if getpwnam is None or name is None: return None try: result = getpwnam(name) except KeyError: result = None if result is not None: return result[2] return None def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0, owner=None, group=None): """Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or None. ("compress" will be deprecated in Python 3.2) 'owner' and 'group' can be used to define an owner and a group for the archive that is being built. If not provided, the current owner and group will be used. The output tar file will be named 'base_dir' + ".tar", possibly plus the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z"). Returns the output filename. """ tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', 'xz': 'xz', None: '', 'compress': ''} compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'xz': '.xz', 'compress': '.Z'} # flags for compression program, each element of list will be an argument if compress is not None and compress not in compress_ext.keys(): raise ValueError( "bad value for 'compress': must be None, 'gzip', 'bzip2', " "'xz' or 'compress'") archive_name = base_name + '.tar' if compress != 'compress': archive_name += compress_ext.get(compress, '') mkpath(os.path.dirname(archive_name), dry_run=dry_run) # creating the tarball import tarfile # late import so Python build itself doesn't break log.info('Creating tar archive') uid = _get_uid(owner) gid = _get_gid(group) def _set_uid_gid(tarinfo): if gid is not None: tarinfo.gid = gid tarinfo.gname = group if uid is not None: tarinfo.uid = uid tarinfo.uname = owner return tarinfo if not dry_run: tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress]) try: tar.add(base_dir, filter=_set_uid_gid) finally: tar.close() # compression using `compress` if compress == 'compress': warn("'compress' will be deprecated.", PendingDeprecationWarning) # the option varies depending on the platform compressed_name = archive_name + compress_ext[compress] if sys.platform == 'win32': cmd = [compress, archive_name, compressed_name] else: cmd = [compress, '-f', archive_name] spawn(cmd, dry_run=dry_run) return compressed_name return archive_name def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. """ zip_filename = base_name + ".zip" mkpath(os.path.dirname(zip_filename), dry_run=dry_run) # If zipfile module is not available, try spawning an external # 'zip' command. if zipfile is None: if verbose: zipoptions = "-r" else: zipoptions = "-rq" try: spawn(["zip", zipoptions, zip_filename, base_dir], dry_run=dry_run) except DistutilsExecError: # XXX really should distinguish between "couldn't find # external 'zip' command" and "zip failed". raise DistutilsExecError(("unable to create zip file '%s': " "could neither import the 'zipfile' module nor " "find a standalone zip utility") % zip_filename) else: log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) if not dry_run: try: zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_DEFLATED) except RuntimeError: zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_STORED) with zip: if base_dir != os.curdir: path = os.path.normpath(os.path.join(base_dir, '')) zip.write(path, path) log.info("adding '%s'", path) for dirpath, dirnames, filenames in os.walk(base_dir): for name in dirnames: path = os.path.normpath(os.path.join(dirpath, name, '')) zip.write(path, path) log.info("adding '%s'", path) for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): zip.write(path, path) log.info("adding '%s'", path) return zip_filename ARCHIVE_FORMATS = { 'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"), 'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"), 'xztar': (make_tarball, [('compress', 'xz')], "xz'ed tar-file"), 'ztar': (make_tarball, [('compress', 'compress')], "compressed tar file"), 'tar': (make_tarball, [('compress', None)], "uncompressed tar file"), 'zip': (make_zipfile, [],"ZIP file") } def check_archive_formats(formats): """Returns the first format from the 'format' list that is unknown. If all formats are known, returns None """ for format in formats: if format not in ARCHIVE_FORMATS: return format return None def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None): """Create an archive file (eg. zip or tar). 'base_name' is the name of the file to create, minus any format-specific extension; 'format' is the archive format: one of "zip", "tar", "gztar", "bztar", "xztar", or "ztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir into 'root_dir' before creating the archive. 'base_dir' is the directory where we start archiving from; ie. 'base_dir' will be the common prefix of all files and directories in the archive. 'root_dir' and 'base_dir' both default to the current directory. Returns the name of the archive file. 'owner' and 'group' are used when creating a tar archive. By default, uses the current owner and group. """ save_cwd = os.getcwd() if root_dir is not None: log.debug("changing into '%s'", root_dir) base_name = os.path.abspath(base_name) if not dry_run: os.chdir(root_dir) if base_dir is None: base_dir = os.curdir kwargs = {'dry_run': dry_run} try: format_info = ARCHIVE_FORMATS[format] except KeyError: raise ValueError("unknown archive format '%s'" % format) func = format_info[0] for arg, val in format_info[1]: kwargs[arg] = val if format != 'zip': kwargs['owner'] = owner kwargs['group'] = group try: filename = func(base_name, base_dir, **kwargs) finally: if root_dir is not None: log.debug("changing back to '%s'", save_cwd) os.chdir(save_cwd) return filename PK!_distutils/file_util.pynu["""distutils.file_util Utility functions for operating on single files. """ import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = { None: 'copying', 'hard': 'hard linking', 'sym': 'symbolically linking' } def _copy_file_contents(src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'; both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. """ # Stolen from shutil module in the standard library, but with # custom error-handling added. fsrc = None fdst = None try: try: fsrc = open(src, 'rb') except OSError as e: raise DistutilsFileError("could not open '%s': %s" % (src, e.strerror)) if os.path.exists(dst): try: os.unlink(dst) except OSError as e: raise DistutilsFileError( "could not delete '%s': %s" % (dst, e.strerror)) try: fdst = open(dst, 'wb') except OSError as e: raise DistutilsFileError( "could not create '%s': %s" % (dst, e.strerror)) while True: try: buf = fsrc.read(buffer_size) except OSError as e: raise DistutilsFileError( "could not read from '%s': %s" % (src, e.strerror)) if not buf: break try: fdst.write(buf) except OSError as e: raise DistutilsFileError( "could not write to '%s': %s" % (dst, e.strerror)) finally: if fdst: fdst.close() if fsrc: fsrc.close() def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, link=None, verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. If hardlink fails, falls back to _copy_file_contents(). Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). """ # XXX if the destination file already exists, we clobber it if # copying, but blow up if linking. Hmmm. And I don't know what # macostools.copyfile() does. Should definitely be consistent, and # should probably blow up if destination exists and we would be # changing it (ie. it's not already a hard/soft link to src OR # (not update) and (src newer than dst). from distutils.dep_util import newer from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE if not os.path.isfile(src): raise DistutilsFileError( "can't copy '%s': doesn't exist or not a regular file" % src) if os.path.isdir(dst): dir = dst dst = os.path.join(dst, os.path.basename(src)) else: dir = os.path.dirname(dst) if update and not newer(src, dst): if verbose >= 1: log.debug("not copying %s (output up-to-date)", src) return (dst, 0) try: action = _copy_action[link] except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) if verbose >= 1: if os.path.basename(dst) == os.path.basename(src): log.info("%s %s -> %s", action, src, dir) else: log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) # If linking (hard or symbolic), use the appropriate system call # (Unix only, of course, but that's the caller's responsibility) elif link == 'hard': if not (os.path.exists(dst) and os.path.samefile(src, dst)): try: os.link(src, dst) return (dst, 1) except OSError: # If hard linking fails, fall back on copying file # (some special filesystems don't support hard linking # even under Unix, see issue #8876). pass elif link == 'sym': if not (os.path.exists(dst) and os.path.samefile(src, dst)): os.symlink(src, dst) return (dst, 1) # Otherwise (non-Mac, not linking), copy the file contents and # (optionally) copy the times and mode. _copy_file_contents(src, dst) if preserve_mode or preserve_times: st = os.stat(src) # According to David Ascher , utime() should be done # before chmod() (at least under NT). if preserve_times: os.utime(dst, (st[ST_ATIME], st[ST_MTIME])) if preserve_mode: os.chmod(dst, S_IMODE(st[ST_MODE])) return (dst, 1) # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? """ from os.path import exists, isfile, isdir, basename, dirname import errno if verbose >= 1: log.info("moving %s -> %s", src, dst) if dry_run: return dst if not isfile(src): raise DistutilsFileError("can't move '%s': not a regular file" % src) if isdir(dst): dst = os.path.join(dst, basename(src)) elif exists(dst): raise DistutilsFileError( "can't move '%s': destination '%s' already exists" % (src, dst)) if not isdir(dirname(dst)): raise DistutilsFileError( "can't move '%s': destination '%s' not a valid path" % (src, dst)) copy_it = False try: os.rename(src, dst) except OSError as e: (num, msg) = e.args if num == errno.EXDEV: copy_it = True else: raise DistutilsFileError( "couldn't move '%s' to '%s': %s" % (src, dst, msg)) if copy_it: copy_file(src, dst, verbose=verbose) try: os.unlink(src) except OSError as e: (num, msg) = e.args try: os.unlink(dst) except OSError: pass raise DistutilsFileError( "couldn't move '%s' to '%s' by copy/delete: " "delete '%s' failed: %s" % (src, dst, src, msg)) return dst def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ f = open(filename, "w") try: for line in contents: f.write(line + "\n") finally: f.close() PK!۟FF_distutils/cmd.pynu["""distutils.cmd Provides the Command class, the base class for the command classes in the distutils.command package. """ import sys, os, re from distutils.errors import DistutilsOptionError from distutils import util, dir_util, file_util, archive_util, dep_util from distutils import log class Command: """Abstract base class for defining command classes, the "worker bees" of the Distutils. A useful analogy for command classes is to think of them as subroutines with local variables called "options". The options are "declared" in 'initialize_options()' and "defined" (given their final values, aka "finalized") in 'finalize_options()', both of which must be defined by every command class. The distinction between the two is necessary because option values might come from the outside world (command line, config file, ...), and any options dependent on other options must be computed *after* these outside influences have been processed -- hence 'finalize_options()'. The "body" of the subroutine, where it does all its work based on the values of its options, is the 'run()' method, which must also be implemented by every command class. """ # 'sub_commands' formalizes the notion of a "family" of commands, # eg. "install" as the parent with sub-commands "install_lib", # "install_headers", etc. The parent of a family of commands # defines 'sub_commands' as a class attribute; it's a list of # (command_name : string, predicate : unbound_method | string | None) # tuples, where 'predicate' is a method of the parent command that # determines whether the corresponding command is applicable in the # current situation. (Eg. we "install_headers" is only applicable if # we have any C header files to install.) If 'predicate' is None, # that command is always applicable. # # 'sub_commands' is usually defined at the *end* of a class, because # predicates can be unbound methods, so they must already have been # defined. The canonical example is the "install" command. sub_commands = [] # -- Creation/initialization methods ------------------------------- def __init__(self, dist): """Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated. """ # late import because of mutual dependence between these classes from distutils.dist import Distribution if not isinstance(dist, Distribution): raise TypeError("dist must be a Distribution instance") if self.__class__ is Command: raise RuntimeError("Command is an abstract class") self.distribution = dist self.initialize_options() # Per-command versions of the global flags, so that the user can # customize Distutils' behaviour command-by-command and let some # commands fall back on the Distribution's behaviour. None means # "not defined, check self.distribution's copy", while 0 or 1 mean # false and true (duh). Note that this means figuring out the real # value of each flag is a touch complicated -- hence "self._dry_run" # will be handled by __getattr__, below. # XXX This needs to be fixed. self._dry_run = None # verbose is largely ignored, but needs to be set for # backwards compatibility (I think)? self.verbose = dist.verbose # Some commands define a 'self.force' option to ignore file # timestamps, but methods defined *here* assume that # 'self.force' exists for all commands. So define it here # just to be safe. self.force = None # The 'help' flag is just used for command-line parsing, so # none of that complicated bureaucracy is needed. self.help = 0 # 'finalized' records whether or not 'finalize_options()' has been # called. 'finalize_options()' itself should not pay attention to # this flag: it is the business of 'ensure_finalized()', which # always calls 'finalize_options()', to respect/update it. self.finalized = 0 # XXX A more explicit way to customize dry_run would be better. def __getattr__(self, attr): if attr == 'dry_run': myval = getattr(self, "_" + attr) if myval is None: return getattr(self.distribution, attr) else: return myval else: raise AttributeError(attr) def ensure_finalized(self): if not self.finalized: self.finalize_options() self.finalized = 1 # Subclasses must define: # initialize_options() # provide default values for all options; may be customized by # setup script, by options from config file(s), or by command-line # options # finalize_options() # decide on the final values for all options; this is called # after all possible intervention from the outside world # (command-line, option file, etc.) has been processed # run() # run the command: do whatever it is we're here to do, # controlled by the command's various option values def initialize_options(self): """Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments. This method must be implemented by all command classes. """ raise RuntimeError("abstract method -- subclass %s must override" % self.__class__) def finalize_options(self): """Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'. This method must be implemented by all command classes. """ raise RuntimeError("abstract method -- subclass %s must override" % self.__class__) def dump_options(self, header=None, indent=""): from distutils.fancy_getopt import longopt_xlate if header is None: header = "command options for '%s':" % self.get_command_name() self.announce(indent + header, level=log.INFO) indent = indent + " " for (option, _, _) in self.user_options: option = option.translate(longopt_xlate) if option[-1] == "=": option = option[:-1] value = getattr(self, option) self.announce(indent + "%s = %s" % (option, value), level=log.INFO) def run(self): """A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'. This method must be implemented by all command classes. """ raise RuntimeError("abstract method -- subclass %s must override" % self.__class__) def announce(self, msg, level=1): """If the current verbosity level is of greater than or equal to 'level' print 'msg' to stdout. """ log.log(level, msg) def debug_print(self, msg): """Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. """ from distutils.debug import DEBUG if DEBUG: print(msg) sys.stdout.flush() # -- Option validation methods ------------------------------------- # (these are very handy in writing the 'finalize_options()' method) # # NB. the general philosophy here is to ensure that a particular option # value meets certain type and value constraints. If not, we try to # force it into conformance (eg. if we expect a list but have a string, # split the string on comma and/or whitespace). If we can't force the # option into conformance, raise DistutilsOptionError. Thus, command # classes need do nothing more than (eg.) # self.ensure_string_list('foo') # and they can be guaranteed that thereafter, self.foo will be # a list of strings. def _ensure_stringlike(self, option, what, default=None): val = getattr(self, option) if val is None: setattr(self, option, default) return default elif not isinstance(val, str): raise DistutilsOptionError("'%s' must be a %s (got `%s`)" % (option, what, val)) return val def ensure_string(self, option, default=None): """Ensure that 'option' is a string; if not defined, set it to 'default'. """ self._ensure_stringlike(option, "string", default) def ensure_string_list(self, option): r"""Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. """ val = getattr(self, option) if val is None: return elif isinstance(val, str): setattr(self, option, re.split(r',\s*|\s+', val)) else: if isinstance(val, list): ok = all(isinstance(v, str) for v in val) else: ok = False if not ok: raise DistutilsOptionError( "'%s' must be a list of strings (got %r)" % (option, val)) def _ensure_tested_string(self, option, tester, what, error_fmt, default=None): val = self._ensure_stringlike(option, what, default) if val is not None and not tester(val): raise DistutilsOptionError(("error in '%s' option: " + error_fmt) % (option, val)) def ensure_filename(self, option): """Ensure that 'option' is the name of an existing file.""" self._ensure_tested_string(option, os.path.isfile, "filename", "'%s' does not exist or is not a file") def ensure_dirname(self, option): self._ensure_tested_string(option, os.path.isdir, "directory name", "'%s' does not exist or is not a directory") # -- Convenience methods for commands ------------------------------ def get_command_name(self): if hasattr(self, 'command_name'): return self.command_name else: return self.__class__.__name__ def set_undefined_options(self, src_cmd, *option_pairs): """Set the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'initialize_options()' and 'finalize_options()'. Usually called from 'finalize_options()' for options that depend on some other command rather than another option of the same command. 'src_cmd' is the other command from which option values will be taken (a command object will be created for it if necessary); the remaining arguments are '(src_option,dst_option)' tuples which mean "take the value of 'src_option' in the 'src_cmd' command object, and copy it to 'dst_option' in the current command object". """ # Option_pairs: list of (src_option, dst_option) tuples src_cmd_obj = self.distribution.get_command_obj(src_cmd) src_cmd_obj.ensure_finalized() for (src_option, dst_option) in option_pairs: if getattr(self, dst_option) is None: setattr(self, dst_option, getattr(src_cmd_obj, src_option)) def get_finalized_command(self, command, create=1): """Wrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object. """ cmd_obj = self.distribution.get_command_obj(command, create) cmd_obj.ensure_finalized() return cmd_obj # XXX rename to 'get_reinitialized_command()'? (should do the # same in dist.py, if so) def reinitialize_command(self, command, reinit_subcommands=0): return self.distribution.reinitialize_command(command, reinit_subcommands) def run_command(self, command): """Run some other command: uses the 'run_command()' method of Distribution, which creates and finalizes the command object if necessary and then invokes its 'run()' method. """ self.distribution.run_command(command) def get_sub_commands(self): """Determine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be run for the current distribution. Return a list of command names. """ commands = [] for (cmd_name, method) in self.sub_commands: if method is None or method(self): commands.append(cmd_name) return commands # -- External world manipulation ----------------------------------- def warn(self, msg): log.warn("warning: %s: %s\n", self.get_command_name(), msg) def execute(self, func, args, msg=None, level=1): util.execute(func, args, msg, dry_run=self.dry_run) def mkpath(self, name, mode=0o777): dir_util.mkpath(name, mode, dry_run=self.dry_run) def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1, link=None, level=1): """Copy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't define it.)""" return file_util.copy_file(infile, outfile, preserve_mode, preserve_times, not self.force, link, dry_run=self.dry_run) def copy_tree(self, infile, outfile, preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1): """Copy an entire directory tree respecting verbose, dry-run, and force flags. """ return dir_util.copy_tree(infile, outfile, preserve_mode, preserve_times, preserve_symlinks, not self.force, dry_run=self.dry_run) def move_file (self, src, dst, level=1): """Move a file respecting dry-run flag.""" return file_util.move_file(src, dst, dry_run=self.dry_run) def spawn(self, cmd, search_path=1, level=1): """Spawn an external command respecting dry-run flag.""" from distutils.spawn import spawn spawn(cmd, search_path, dry_run=self.dry_run) def make_archive(self, base_name, format, root_dir=None, base_dir=None, owner=None, group=None): return archive_util.make_archive(base_name, format, root_dir, base_dir, dry_run=self.dry_run, owner=owner, group=group) def make_file(self, infiles, outfile, func, args, exec_msg=None, skip_msg=None, level=1): """Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the command defined 'self.force', and it is true, then the command is unconditionally run -- does no timestamp checks. """ if skip_msg is None: skip_msg = "skipping %s (inputs unchanged)" % outfile # Allow 'infiles' to be a single string if isinstance(infiles, str): infiles = (infiles,) elif not isinstance(infiles, (list, tuple)): raise TypeError( "'infiles' must be a string, or a list or tuple of strings") if exec_msg is None: exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles)) # If 'outfile' must be regenerated (either because it doesn't # exist, is out-of-date, or the 'force' flag is true) then # perform the action that presumably regenerates it if self.force or dep_util.newer_group(infiles, outfile): self.execute(func, args, exec_msg, level) # Otherwise, print the "skip" message else: log.debug(skip_msg) PK!]4:))_distutils/extension.pynu["""distutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts.""" import os import warnings # This class is really only used by the "build_ext" command, so it might # make sense to put it in distutils.command.build_ext. However, that # module is already big enough, and I want to make this class a bit more # complex to simplify some common cases ("foo" module in "foo.c") and do # better error-checking ("foo.c" actually exists). # # Also, putting this in build_ext.py means every setup script would have to # import that large-ish module (indirectly, through distutils.core) in # order to do anything. class Extension: """Just a collection of attributes that describes an extension module and everything needed to build it (hopefully in a portable way, but there are hooks that let you be as unportable as you need). Instance attributes: name : string the full name of the extension, including any packages -- ie. *not* a filename or pathname, but Python dotted name sources : [string] list of source filenames, relative to the distribution root (where the setup script lives), in Unix form (slash-separated) for portability. Source files may be C, C++, SWIG (.i), platform-specific resource files, or whatever else is recognized by the "build_ext" command as source for a Python extension. include_dirs : [string] list of directories to search for C/C++ header files (in Unix form for portability) define_macros : [(name : string, value : string|None)] list of macros to define; each macro is defined using a 2-tuple, where 'value' is either the string to define it to or None to define it without a particular value (equivalent of "#define FOO" in source or -DFOO on Unix C compiler command line) undef_macros : [string] list of macros to undefine explicitly library_dirs : [string] list of directories to search for C/C++ libraries at link time libraries : [string] list of library names (not filenames or paths) to link against runtime_library_dirs : [string] list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is loaded) extra_objects : [string] list of extra files to link with (eg. object files not implied by 'sources', static library that must be explicitly specified, binary resource files, etc.) extra_compile_args : [string] any extra platform- and compiler-specific information to use when compiling the source files in 'sources'. For platforms and compilers where "command line" makes sense, this is typically a list of command-line arguments, but for other platforms it could be anything. extra_link_args : [string] any extra platform- and compiler-specific information to use when linking object files together to create the extension (or to create a new static Python interpreter). Similar interpretation as for 'extra_compile_args'. export_symbols : [string] list of symbols to be exported from a shared extension. Not used on all platforms, and not generally necessary for Python extensions, which typically export exactly one symbol: "init" + extension_name. swig_opts : [string] any extra options to pass to SWIG if a source file has the .i extension. depends : [string] list of files that the extension depends on language : string extension language (i.e. "c", "c++", "objc"). Will be detected from the source extensions if not provided. optional : boolean specifies that a build failure in the extension should not abort the build process, but simply not install the failing extension. """ # When adding arguments to this constructor, be sure to update # setup_keywords in core.py. def __init__(self, name, sources, include_dirs=None, define_macros=None, undef_macros=None, library_dirs=None, libraries=None, runtime_library_dirs=None, extra_objects=None, extra_compile_args=None, extra_link_args=None, export_symbols=None, swig_opts = None, depends=None, language=None, optional=None, **kw # To catch unknown keywords ): if not isinstance(name, str): raise AssertionError("'name' must be a string") if not (isinstance(sources, list) and all(isinstance(v, str) for v in sources)): raise AssertionError("'sources' must be a list of strings") self.name = name self.sources = sources self.include_dirs = include_dirs or [] self.define_macros = define_macros or [] self.undef_macros = undef_macros or [] self.library_dirs = library_dirs or [] self.libraries = libraries or [] self.runtime_library_dirs = runtime_library_dirs or [] self.extra_objects = extra_objects or [] self.extra_compile_args = extra_compile_args or [] self.extra_link_args = extra_link_args or [] self.export_symbols = export_symbols or [] self.swig_opts = swig_opts or [] self.depends = depends or [] self.language = language self.optional = optional # If there are unknown keyword options, warn about them if len(kw) > 0: options = [repr(option) for option in kw] options = ', '.join(sorted(options)) msg = "Unknown Extension options: %s" % options warnings.warn(msg) def __repr__(self): return '<%s.%s(%r) at %#x>' % ( self.__class__.__module__, self.__class__.__qualname__, self.name, id(self)) def read_setup_file(filename): """Reads a Setup file and returns Extension instances.""" from distutils.sysconfig import (parse_makefile, expand_makefile_vars, _variable_rx) from distutils.text_file import TextFile from distutils.util import split_quoted # First pass over the file to gather "VAR = VALUE" assignments. vars = parse_makefile(filename) # Second pass to gobble up the real content: lines of the form # ... [ ...] [ ...] [ ...] file = TextFile(filename, strip_comments=1, skip_blanks=1, join_lines=1, lstrip_ws=1, rstrip_ws=1) try: extensions = [] while True: line = file.readline() if line is None: # eof break if _variable_rx.match(line): # VAR=VALUE, handled in first pass continue if line[0] == line[-1] == "*": file.warn("'%s' lines not handled yet" % line) continue line = expand_makefile_vars(line, vars) words = split_quoted(line) # NB. this parses a slightly different syntax than the old # makesetup script: here, there must be exactly one extension per # line, and it must be the first word of the line. I have no idea # why the old syntax supported multiple extensions per line, as # they all wind up being the same. module = words[0] ext = Extension(module, []) append_next_word = None for word in words[1:]: if append_next_word is not None: append_next_word.append(word) append_next_word = None continue suffix = os.path.splitext(word)[1] switch = word[0:2] ; value = word[2:] if suffix in (".c", ".cc", ".cpp", ".cxx", ".c++", ".m", ".mm"): # hmm, should we do something about C vs. C++ sources? # or leave it up to the CCompiler implementation to # worry about? ext.sources.append(word) elif switch == "-I": ext.include_dirs.append(value) elif switch == "-D": equals = value.find("=") if equals == -1: # bare "-DFOO" -- no value ext.define_macros.append((value, None)) else: # "-DFOO=blah" ext.define_macros.append((value[0:equals], value[equals+2:])) elif switch == "-U": ext.undef_macros.append(value) elif switch == "-C": # only here 'cause makesetup has it! ext.extra_compile_args.append(word) elif switch == "-l": ext.libraries.append(value) elif switch == "-L": ext.library_dirs.append(value) elif switch == "-R": ext.runtime_library_dirs.append(value) elif word == "-rpath": append_next_word = ext.runtime_library_dirs elif word == "-Xlinker": append_next_word = ext.extra_link_args elif word == "-Xcompiler": append_next_word = ext.extra_compile_args elif switch == "-u": ext.extra_link_args.append(word) if not value: append_next_word = ext.extra_link_args elif suffix in (".a", ".so", ".sl", ".o", ".dylib"): # NB. a really faithful emulation of makesetup would # append a .o file to extra_objects only if it # had a slash in it; otherwise, it would s/.o/.c/ # and append it to sources. Hmmmm. ext.extra_objects.append(word) else: file.warn("unrecognized argument '%s'" % word) extensions.append(ext) finally: file.close() return extensions PK!2  _distutils/versionpredicate.pynu["""Module for parsing and testing package version predicate strings. """ import re import distutils.version import operator re_validPackage = re.compile(r"(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)", re.ASCII) # (package) (rest) re_paren = re.compile(r"^\s*\((.*)\)\s*$") # (list) inside of parentheses re_splitComparison = re.compile(r"^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$") # (comp) (version) def splitUp(pred): """Parse a single version comparison. Return (comparison string, StrictVersion) """ res = re_splitComparison.match(pred) if not res: raise ValueError("bad package restriction syntax: %r" % pred) comp, verStr = res.groups() return (comp, distutils.version.StrictVersion(verStr)) compmap = {"<": operator.lt, "<=": operator.le, "==": operator.eq, ">": operator.gt, ">=": operator.ge, "!=": operator.ne} class VersionPredicate: """Parse and test package version predicates. >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)') The `name` attribute provides the full dotted name that is given:: >>> v.name 'pyepat.abc' The str() of a `VersionPredicate` provides a normalized human-readable version of the expression:: >>> print(v) pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3) The `satisfied_by()` method can be used to determine with a given version number is included in the set described by the version restrictions:: >>> v.satisfied_by('1.1') True >>> v.satisfied_by('1.4') True >>> v.satisfied_by('1.0') False >>> v.satisfied_by('4444.4') False >>> v.satisfied_by('1555.1b3') False `VersionPredicate` is flexible in accepting extra whitespace:: >>> v = VersionPredicate(' pat( == 0.1 ) ') >>> v.name 'pat' >>> v.satisfied_by('0.1') True >>> v.satisfied_by('0.2') False If any version numbers passed in do not conform to the restrictions of `StrictVersion`, a `ValueError` is raised:: >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)') Traceback (most recent call last): ... ValueError: invalid version number '1.2zb3' It the module or package name given does not conform to what's allowed as a legal module or package name, `ValueError` is raised:: >>> v = VersionPredicate('foo-bar') Traceback (most recent call last): ... ValueError: expected parenthesized list: '-bar' >>> v = VersionPredicate('foo bar (12.21)') Traceback (most recent call last): ... ValueError: expected parenthesized list: 'bar (12.21)' """ def __init__(self, versionPredicateStr): """Parse a version predicate string. """ # Fields: # name: package name # pred: list of (comparison string, StrictVersion) versionPredicateStr = versionPredicateStr.strip() if not versionPredicateStr: raise ValueError("empty package restriction") match = re_validPackage.match(versionPredicateStr) if not match: raise ValueError("bad package name in %r" % versionPredicateStr) self.name, paren = match.groups() paren = paren.strip() if paren: match = re_paren.match(paren) if not match: raise ValueError("expected parenthesized list: %r" % paren) str = match.groups()[0] self.pred = [splitUp(aPred) for aPred in str.split(",")] if not self.pred: raise ValueError("empty parenthesized list in %r" % versionPredicateStr) else: self.pred = [] def __str__(self): if self.pred: seq = [cond + " " + str(ver) for cond, ver in self.pred] return self.name + " (" + ", ".join(seq) + ")" else: return self.name def satisfied_by(self, version): """True if version is compatible with all the predicates in self. The parameter version must be acceptable to the StrictVersion constructor. It may be either a string or StrictVersion. """ for cond, ver in self.pred: if not compmap[cond](version, ver): return False return True _provision_rx = None def split_provision(value): """Return the name and optional version number of a provision. The version number, if given, will be returned as a `StrictVersion` instance, otherwise it will be `None`. >>> split_provision('mypkg') ('mypkg', None) >>> split_provision(' mypkg( 1.2 ) ') ('mypkg', StrictVersion ('1.2')) """ global _provision_rx if _provision_rx is None: _provision_rx = re.compile( r"([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$", re.ASCII) value = value.strip() m = _provision_rx.match(value) if not m: raise ValueError("illegal provides specification: %r" % value) ver = m.group(2) or None if ver: ver = distutils.version.StrictVersion(ver) return m.group(1), ver PK!%_4_4_distutils/filelist.pynu["""distutils.filelist Provides the FileList class, used for poking about the filesystem and building lists of files. """ import os import re import fnmatch import functools from distutils.util import convert_path from distutils.errors import DistutilsTemplateError, DistutilsInternalError from distutils import log class FileList: """A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. Instance attributes: dir directory from which files will be taken -- only used if 'allfiles' not supplied to constructor files list of filenames currently being built/filtered/manipulated allfiles complete list of files under consideration (ie. without any filtering applied) """ def __init__(self, warn=None, debug_print=None): # ignore argument to FileList, but keep them for backwards # compatibility self.allfiles = None self.files = [] def set_allfiles(self, allfiles): self.allfiles = allfiles def findall(self, dir=os.curdir): self.allfiles = findall(dir) def debug_print(self, msg): """Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true. """ from distutils.debug import DEBUG if DEBUG: print(msg) # Collection methods def append(self, item): self.files.append(item) def extend(self, items): self.files.extend(items) def sort(self): # Not a strict lexical sort! sortable_files = sorted(map(os.path.split, self.files)) self.files = [] for sort_tuple in sortable_files: self.files.append(os.path.join(*sort_tuple)) # Other miscellaneous utility methods def remove_duplicates(self): # Assumes list has been sorted! for i in range(len(self.files) - 1, 0, -1): if self.files[i] == self.files[i - 1]: del self.files[i] # "File template" methods def _parse_template_line(self, line): words = line.split() action = words[0] patterns = dir = dir_pattern = None if action in ('include', 'exclude', 'global-include', 'global-exclude'): if len(words) < 2: raise DistutilsTemplateError( "'%s' expects ..." % action) patterns = [convert_path(w) for w in words[1:]] elif action in ('recursive-include', 'recursive-exclude'): if len(words) < 3: raise DistutilsTemplateError( "'%s' expects ..." % action) dir = convert_path(words[1]) patterns = [convert_path(w) for w in words[2:]] elif action in ('graft', 'prune'): if len(words) != 2: raise DistutilsTemplateError( "'%s' expects a single " % action) dir_pattern = convert_path(words[1]) else: raise DistutilsTemplateError("unknown action '%s'" % action) return (action, patterns, dir, dir_pattern) def process_template_line(self, line): # Parse the line: split it up, make sure the right number of words # is there, and return the relevant words. 'action' is always # defined: it's the first word of the line. Which of the other # three are defined depends on the action; it'll be either # patterns, (dir and patterns), or (dir_pattern). (action, patterns, dir, dir_pattern) = self._parse_template_line(line) # OK, now we know that the action is valid and we have the # right number of words on the line for that action -- so we # can proceed with minimal error-checking. if action == 'include': self.debug_print("include " + ' '.join(patterns)) for pattern in patterns: if not self.include_pattern(pattern, anchor=1): log.warn("warning: no files found matching '%s'", pattern) elif action == 'exclude': self.debug_print("exclude " + ' '.join(patterns)) for pattern in patterns: if not self.exclude_pattern(pattern, anchor=1): log.warn(("warning: no previously-included files " "found matching '%s'"), pattern) elif action == 'global-include': self.debug_print("global-include " + ' '.join(patterns)) for pattern in patterns: if not self.include_pattern(pattern, anchor=0): log.warn(("warning: no files found matching '%s' " "anywhere in distribution"), pattern) elif action == 'global-exclude': self.debug_print("global-exclude " + ' '.join(patterns)) for pattern in patterns: if not self.exclude_pattern(pattern, anchor=0): log.warn(("warning: no previously-included files matching " "'%s' found anywhere in distribution"), pattern) elif action == 'recursive-include': self.debug_print("recursive-include %s %s" % (dir, ' '.join(patterns))) for pattern in patterns: if not self.include_pattern(pattern, prefix=dir): msg = ( "warning: no files found matching '%s' " "under directory '%s'" ) log.warn(msg, pattern, dir) elif action == 'recursive-exclude': self.debug_print("recursive-exclude %s %s" % (dir, ' '.join(patterns))) for pattern in patterns: if not self.exclude_pattern(pattern, prefix=dir): log.warn(("warning: no previously-included files matching " "'%s' found under directory '%s'"), pattern, dir) elif action == 'graft': self.debug_print("graft " + dir_pattern) if not self.include_pattern(None, prefix=dir_pattern): log.warn("warning: no directories found matching '%s'", dir_pattern) elif action == 'prune': self.debug_print("prune " + dir_pattern) if not self.exclude_pattern(None, prefix=dir_pattern): log.warn(("no previously-included directories found " "matching '%s'"), dir_pattern) else: raise DistutilsInternalError( "this cannot happen: invalid action '%s'" % action) # Filtering/selection methods def include_pattern(self, pattern, anchor=1, prefix=None, is_regex=0): """Select strings (presumably filenames) from 'self.files' that match 'pattern', a Unix-style wildcard (glob) pattern. Patterns are not quite the same as implemented by the 'fnmatch' module: '*' and '?' match non-special characters, where "special" is platform- dependent: slash on Unix; colon, slash, and backslash on DOS/Windows; and colon on Mac OS. If 'anchor' is true (the default), then the pattern match is more stringent: "*.py" will match "foo.py" but not "foo/bar.py". If 'anchor' is false, both of these will match. If 'prefix' is supplied, then only filenames starting with 'prefix' (itself a pattern) and ending with 'pattern', with anything in between them, will match. 'anchor' is ignored in this case. If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and 'pattern' is assumed to be either a string containing a regex or a regex object -- no translation is done, the regex is just compiled and used as-is. Selected strings will be added to self.files. Return True if files are found, False otherwise. """ # XXX docstring lying about what the special chars are? files_found = False pattern_re = translate_pattern(pattern, anchor, prefix, is_regex) self.debug_print("include_pattern: applying regex r'%s'" % pattern_re.pattern) # delayed loading of allfiles list if self.allfiles is None: self.findall() for name in self.allfiles: if pattern_re.search(name): self.debug_print(" adding " + name) self.files.append(name) files_found = True return files_found def exclude_pattern( self, pattern, anchor=1, prefix=None, is_regex=0): """Remove strings (presumably filenames) from 'files' that match 'pattern'. Other parameters are the same as for 'include_pattern()', above. The list 'self.files' is modified in place. Return True if files are found, False otherwise. """ files_found = False pattern_re = translate_pattern(pattern, anchor, prefix, is_regex) self.debug_print("exclude_pattern: applying regex r'%s'" % pattern_re.pattern) for i in range(len(self.files)-1, -1, -1): if pattern_re.search(self.files[i]): self.debug_print(" removing " + self.files[i]) del self.files[i] files_found = True return files_found # Utility functions def _find_all_simple(path): """ Find all files under 'path' """ all_unique = _UniqueDirs.filter(os.walk(path, followlinks=True)) results = ( os.path.join(base, file) for base, dirs, files in all_unique for file in files ) return filter(os.path.isfile, results) class _UniqueDirs(set): """ Exclude previously-seen dirs from walk results, avoiding infinite recursion. Ref https://bugs.python.org/issue44497. """ def __call__(self, walk_item): """ Given an item from an os.walk result, determine if the item represents a unique dir for this instance and if not, prevent further traversal. """ base, dirs, files = walk_item stat = os.stat(base) candidate = stat.st_dev, stat.st_ino found = candidate in self if found: del dirs[:] self.add(candidate) return not found @classmethod def filter(cls, items): return filter(cls(), items) def findall(dir=os.curdir): """ Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. """ files = _find_all_simple(dir) if dir == os.curdir: make_rel = functools.partial(os.path.relpath, start=dir) files = map(make_rel, files) return list(files) def glob_to_re(pattern): """Translate a shell-like glob pattern to a regular expression; return a string containing the regex. Differs from 'fnmatch.translate()' in that '*' does not match "special characters" (which are platform-specific). """ pattern_re = fnmatch.translate(pattern) # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, # and by extension they shouldn't match such "special characters" under # any OS. So change all non-escaped dots in the RE to match any # character except the special characters (currently: just os.sep). sep = os.sep if os.sep == '\\': # we're using a regex to manipulate a regex, so we need # to escape the backslash twice sep = r'\\\\' escaped = r'\1[^%s]' % sep pattern_re = re.sub(r'((? .o/.obj) # * library files (shared or static) are named by plugging the # library name and extension into a format string, eg. # "lib%s.%s" % (lib_name, ".a") for Unix static libraries # * executables are named by appending an extension (possibly # empty) to the program name: eg. progname + ".exe" for # Windows # # To reduce redundant code, these methods expect to find # several attributes in the current object (presumably defined # as class attributes): # * src_extensions - # list of C/C++ source file extensions, eg. ['.c', '.cpp'] # * obj_extension - # object file extension, eg. '.o' or '.obj' # * static_lib_extension - # extension for static library files, eg. '.a' or '.lib' # * shared_lib_extension - # extension for shared library/object files, eg. '.so', '.dll' # * static_lib_format - # format string for generating static library filenames, # eg. 'lib%s.%s' or '%s.%s' # * shared_lib_format # format string for generating shared library filenames # (probably same as static_lib_format, since the extension # is one of the intended parameters to the format string) # * exe_extension - # extension for executable files, eg. '' or '.exe' def object_filenames(self, source_filenames, strip_dir=0, output_dir=''): if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: base, ext = os.path.splitext(src_name) base = os.path.splitdrive(base)[1] # Chop off the drive base = base[os.path.isabs(base):] # If abs, chop off leading / if ext not in self.src_extensions: raise UnknownFileError( "unknown file type '%s' (from '%s')" % (ext, src_name)) if strip_dir: base = os.path.basename(base) obj_names.append(os.path.join(output_dir, base + self.obj_extension)) return obj_names def shared_object_filename(self, basename, strip_dir=0, output_dir=''): assert output_dir is not None if strip_dir: basename = os.path.basename(basename) return os.path.join(output_dir, basename + self.shared_lib_extension) def executable_filename(self, basename, strip_dir=0, output_dir=''): assert output_dir is not None if strip_dir: basename = os.path.basename(basename) return os.path.join(output_dir, basename + (self.exe_extension or '')) def library_filename(self, libname, lib_type='static', # or 'shared' strip_dir=0, output_dir=''): assert output_dir is not None if lib_type not in ("static", "shared", "dylib", "xcode_stub"): raise ValueError( "'lib_type' must be \"static\", \"shared\", \"dylib\", or \"xcode_stub\"") fmt = getattr(self, lib_type + "_lib_format") ext = getattr(self, lib_type + "_lib_extension") dir, base = os.path.split(libname) filename = fmt % (base, ext) if strip_dir: dir = '' return os.path.join(output_dir, dir, filename) # -- Utility methods ----------------------------------------------- def announce(self, msg, level=1): log.debug(msg) def debug_print(self, msg): from distutils.debug import DEBUG if DEBUG: print(msg) def warn(self, msg): sys.stderr.write("warning: %s\n" % msg) def execute(self, func, args, msg=None, level=1): execute(func, args, msg, self.dry_run) def spawn(self, cmd, **kwargs): spawn(cmd, dry_run=self.dry_run, **kwargs) def move_file(self, src, dst): return move_file(src, dst, dry_run=self.dry_run) def mkpath (self, name, mode=0o777): mkpath(name, mode, dry_run=self.dry_run) # Map a sys.platform/os.name ('posix', 'nt') to the default compiler # type for that platform. Keys are interpreted as re match # patterns. Order is important; platform mappings are preferred over # OS names. _default_compilers = ( # Platform string mappings # on a cygwin built python we can use gcc like an ordinary UNIXish # compiler ('cygwin.*', 'unix'), # OS name mappings ('posix', 'unix'), ('nt', 'msvc'), ) def get_default_compiler(osname=None, platform=None): """Determine the default compiler to use for the given platform. osname should be one of the standard Python OS names (i.e. the ones returned by os.name) and platform the common value returned by sys.platform for the platform in question. The default values are os.name and sys.platform in case the parameters are not given. """ if osname is None: osname = os.name if platform is None: platform = sys.platform for pattern, compiler in _default_compilers: if re.match(pattern, platform) is not None or \ re.match(pattern, osname) is not None: return compiler # Default to Unix compiler return 'unix' # Map compiler types to (module_name, class_name) pairs -- ie. where to # find the code that implements an interface to this compiler. (The module # is assumed to be in the 'distutils' package.) compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler', "standard UNIX-style compiler"), 'msvc': ('_msvccompiler', 'MSVCCompiler', "Microsoft Visual C++"), 'cygwin': ('cygwinccompiler', 'CygwinCCompiler', "Cygwin port of GNU C Compiler for Win32"), 'mingw32': ('cygwinccompiler', 'Mingw32CCompiler', "Mingw32 port of GNU C Compiler for Win32"), 'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"), } def show_compilers(): """Print list of available compilers (used by the "--help-compiler" options to "build", "build_ext", "build_clib"). """ # XXX this "knows" that the compiler option it's describing is # "--compiler", which just happens to be the case for the three # commands that use it. from distutils.fancy_getopt import FancyGetopt compilers = [] for compiler in compiler_class.keys(): compilers.append(("compiler="+compiler, None, compiler_class[compiler][2])) compilers.sort() pretty_printer = FancyGetopt(compilers) pretty_printer.print_help("List of available compilers:") def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0): """Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional Unix interface" (UnixCCompiler class) and Visual C++ (MSVCCompiler class). Note that it's perfectly possible to ask for a Unix compiler object under Windows, and a Microsoft compiler object under Unix -- if you supply a value for 'compiler', 'plat' is ignored. """ if plat is None: plat = os.name try: if compiler is None: compiler = get_default_compiler(plat) (module_name, class_name, long_description) = compiler_class[compiler] except KeyError: msg = "don't know how to compile C/C++ code on platform '%s'" % plat if compiler is not None: msg = msg + " with '%s' compiler" % compiler raise DistutilsPlatformError(msg) try: module_name = "distutils." + module_name __import__ (module_name) module = sys.modules[module_name] klass = vars(module)[class_name] except ImportError: raise DistutilsModuleError( "can't compile C/C++ code: unable to load module '%s'" % \ module_name) except KeyError: raise DistutilsModuleError( "can't compile C/C++ code: unable to find class '%s' " "in module '%s'" % (class_name, module_name)) # XXX The None is necessary to preserve backwards compatibility # with classes that expect verbose to be the first positional # argument. return klass(None, dry_run, force) def gen_preprocess_options(macros, include_dirs): """Generate C pre-processor options (-D, -U, -I) as used by at least two types of compilers: the typical Unix compiler and Visual C++. 'macros' is the usual thing, a list of 1- or 2-tuples, where (name,) means undefine (-U) macro 'name', and (name,value) means define (-D) macro 'name' to 'value'. 'include_dirs' is just a list of directory names to be added to the header file search path (-I). Returns a list of command-line options suitable for either Unix compilers or Visual C++. """ # XXX it would be nice (mainly aesthetic, and so we don't generate # stupid-looking command lines) to go over 'macros' and eliminate # redundant definitions/undefinitions (ie. ensure that only the # latest mention of a particular macro winds up on the command # line). I don't think it's essential, though, since most (all?) # Unix C compilers only pay attention to the latest -D or -U # mention of a macro on their command line. Similar situation for # 'include_dirs'. I'm punting on both for now. Anyways, weeding out # redundancies like this should probably be the province of # CCompiler, since the data structures used are inherited from it # and therefore common to all CCompiler classes. pp_opts = [] for macro in macros: if not (isinstance(macro, tuple) and 1 <= len(macro) <= 2): raise TypeError( "bad macro definition '%s': " "each element of 'macros' list must be a 1- or 2-tuple" % macro) if len(macro) == 1: # undefine this macro pp_opts.append("-U%s" % macro[0]) elif len(macro) == 2: if macro[1] is None: # define with no explicit value pp_opts.append("-D%s" % macro[0]) else: # XXX *don't* need to be clever about quoting the # macro value here, because we're going to avoid the # shell at all costs when we spawn the command! pp_opts.append("-D%s=%s" % macro) for dir in include_dirs: pp_opts.append("-I%s" % dir) return pp_opts def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries): """Generate linker options for searching library directories and linking with specific libraries. 'libraries' and 'library_dirs' are, respectively, lists of library names (not filenames!) and search directories. Returns a list of command-line options suitable for use with some compiler (depending on the two format strings passed in). """ lib_opts = [] for dir in library_dirs: lib_opts.append(compiler.library_dir_option(dir)) for dir in runtime_library_dirs: opt = compiler.runtime_library_dir_option(dir) if isinstance(opt, list): lib_opts = lib_opts + opt else: lib_opts.append(opt) # XXX it's important that we *not* remove redundant library mentions! # sometimes you really do have to say "-lfoo -lbar -lfoo" in order to # resolve all symbols. I just hope we never have to say "-lfoo obj.o # -lbar" to get things to work -- that's certainly a possibility, but a # pretty nasty way to arrange your C code. for lib in libraries: (lib_dir, lib_name) = os.path.split(lib) if lib_dir: lib_file = compiler.find_library_file([lib_dir], lib_name) if lib_file: lib_opts.append(lib_file) else: compiler.warn("no library file corresponding to " "'%s' found (skipping)" % lib) else: lib_opts.append(compiler.library_option (lib)) return lib_opts PK!F9.:.:_distutils/bcppcompiler.pynu["""distutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. """ # This implementation by Lyle Johnson, based on the original msvccompiler.py # module and using the directions originally published by Gordon Williams. # XXX looks like there's a LOT of overlap between these two classes: # someone should sit down and factor out the common code as # WindowsCCompiler! --GPW import os from distutils.errors import \ DistutilsExecError, \ CompileError, LibError, LinkError, UnknownFileError from distutils.ccompiler import \ CCompiler, gen_preprocess_options from distutils.file_util import write_file from distutils.dep_util import newer from distutils import log class BCPPCompiler(CCompiler) : """Concrete class that implements an interface to the Borland C/C++ compiler, as defined by the CCompiler abstract class. """ compiler_type = 'bcpp' # Just set this so CCompiler's constructor doesn't barf. We currently # don't use the 'set_executables()' bureaucracy provided by CCompiler, # as it really isn't necessary for this sort of single-compiler class. # Would be nice to have a consistent interface with UnixCCompiler, # though, so it's worth thinking about. executables = {} # Private class data (need to distinguish C from C++ source for compiler) _c_extensions = ['.c'] _cpp_extensions = ['.cc', '.cpp', '.cxx'] # Needed for the filename generation methods provided by the # base class, CCompiler. src_extensions = _c_extensions + _cpp_extensions obj_extension = '.obj' static_lib_extension = '.lib' shared_lib_extension = '.dll' static_lib_format = shared_lib_format = '%s%s' exe_extension = '.exe' def __init__ (self, verbose=0, dry_run=0, force=0): CCompiler.__init__ (self, verbose, dry_run, force) # These executables are assumed to all be in the path. # Borland doesn't seem to use any special registry settings to # indicate their installation locations. self.cc = "bcc32.exe" self.linker = "ilink32.exe" self.lib = "tlib.exe" self.preprocess_options = None self.compile_options = ['/tWM', '/O2', '/q', '/g0'] self.compile_options_debug = ['/tWM', '/Od', '/q', '/g0'] self.ldflags_shared = ['/Tpd', '/Gn', '/q', '/x'] self.ldflags_shared_debug = ['/Tpd', '/Gn', '/q', '/x'] self.ldflags_static = [] self.ldflags_exe = ['/Gn', '/q', '/x'] self.ldflags_exe_debug = ['/Gn', '/q', '/x','/r'] # -- Worker methods ------------------------------------------------ def compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): macros, objects, extra_postargs, pp_opts, build = \ self._setup_compile(output_dir, macros, include_dirs, sources, depends, extra_postargs) compile_opts = extra_preargs or [] compile_opts.append ('-c') if debug: compile_opts.extend (self.compile_options_debug) else: compile_opts.extend (self.compile_options) for obj in objects: try: src, ext = build[obj] except KeyError: continue # XXX why do the normpath here? src = os.path.normpath(src) obj = os.path.normpath(obj) # XXX _setup_compile() did a mkpath() too but before the normpath. # Is it possible to skip the normpath? self.mkpath(os.path.dirname(obj)) if ext == '.res': # This is already a binary file -- skip it. continue # the 'for' loop if ext == '.rc': # This needs to be compiled to a .res file -- do it now. try: self.spawn (["brcc32", "-fo", obj, src]) except DistutilsExecError as msg: raise CompileError(msg) continue # the 'for' loop # The next two are both for the real compiler. if ext in self._c_extensions: input_opt = "" elif ext in self._cpp_extensions: input_opt = "-P" else: # Unknown file type -- no extra options. The compiler # will probably fail, but let it just in case this is a # file the compiler recognizes even if we don't. input_opt = "" output_opt = "-o" + obj # Compiler command line syntax is: "bcc32 [options] file(s)". # Note that the source file names must appear at the end of # the command line. try: self.spawn ([self.cc] + compile_opts + pp_opts + [input_opt, output_opt] + extra_postargs + [src]) except DistutilsExecError as msg: raise CompileError(msg) return objects # compile () def create_static_lib (self, objects, output_libname, output_dir=None, debug=0, target_lang=None): (objects, output_dir) = self._fix_object_args (objects, output_dir) output_filename = \ self.library_filename (output_libname, output_dir=output_dir) if self._need_link (objects, output_filename): lib_args = [output_filename, '/u'] + objects if debug: pass # XXX what goes here? try: self.spawn ([self.lib] + lib_args) except DistutilsExecError as msg: raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) # create_static_lib () def link (self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): # XXX this ignores 'build_temp'! should follow the lead of # msvccompiler.py (objects, output_dir) = self._fix_object_args (objects, output_dir) (libraries, library_dirs, runtime_library_dirs) = \ self._fix_lib_args (libraries, library_dirs, runtime_library_dirs) if runtime_library_dirs: log.warn("I don't know what to do with 'runtime_library_dirs': %s", str(runtime_library_dirs)) if output_dir is not None: output_filename = os.path.join (output_dir, output_filename) if self._need_link (objects, output_filename): # Figure out linker args based on type of target. if target_desc == CCompiler.EXECUTABLE: startup_obj = 'c0w32' if debug: ld_args = self.ldflags_exe_debug[:] else: ld_args = self.ldflags_exe[:] else: startup_obj = 'c0d32' if debug: ld_args = self.ldflags_shared_debug[:] else: ld_args = self.ldflags_shared[:] # Create a temporary exports file for use by the linker if export_symbols is None: def_file = '' else: head, tail = os.path.split (output_filename) modname, ext = os.path.splitext (tail) temp_dir = os.path.dirname(objects[0]) # preserve tree structure def_file = os.path.join (temp_dir, '%s.def' % modname) contents = ['EXPORTS'] for sym in (export_symbols or []): contents.append(' %s=_%s' % (sym, sym)) self.execute(write_file, (def_file, contents), "writing %s" % def_file) # Borland C++ has problems with '/' in paths objects2 = map(os.path.normpath, objects) # split objects in .obj and .res files # Borland C++ needs them at different positions in the command line objects = [startup_obj] resources = [] for file in objects2: (base, ext) = os.path.splitext(os.path.normcase(file)) if ext == '.res': resources.append(file) else: objects.append(file) for l in library_dirs: ld_args.append("/L%s" % os.path.normpath(l)) ld_args.append("/L.") # we sometimes use relative paths # list of object files ld_args.extend(objects) # XXX the command-line syntax for Borland C++ is a bit wonky; # certain filenames are jammed together in one big string, but # comma-delimited. This doesn't mesh too well with the # Unix-centric attitude (with a DOS/Windows quoting hack) of # 'spawn()', so constructing the argument list is a bit # awkward. Note that doing the obvious thing and jamming all # the filenames and commas into one argument would be wrong, # because 'spawn()' would quote any filenames with spaces in # them. Arghghh!. Apparently it works fine as coded... # name of dll/exe file ld_args.extend([',',output_filename]) # no map file and start libraries ld_args.append(',,') for lib in libraries: # see if we find it and if there is a bcpp specific lib # (xxx_bcpp.lib) libfile = self.find_library_file(library_dirs, lib, debug) if libfile is None: ld_args.append(lib) # probably a BCPP internal library -- don't warn else: # full name which prefers bcpp_xxx.lib over xxx.lib ld_args.append(libfile) # some default libraries ld_args.append ('import32') ld_args.append ('cw32mt') # def file for export symbols ld_args.extend([',',def_file]) # add resource files ld_args.append(',') ld_args.extend(resources) if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) self.mkpath (os.path.dirname (output_filename)) try: self.spawn ([self.linker] + ld_args) except DistutilsExecError as msg: raise LinkError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) # link () # -- Miscellaneous methods ----------------------------------------- def find_library_file (self, dirs, lib, debug=0): # List of effective library names to try, in order of preference: # xxx_bcpp.lib is better than xxx.lib # and xxx_d.lib is better than xxx.lib if debug is set # # The "_bcpp" suffix is to handle a Python installation for people # with multiple compilers (primarily Distutils hackers, I suspect # ;-). The idea is they'd have one static library for each # compiler they care about, since (almost?) every Windows compiler # seems to have a different format for static libraries. if debug: dlib = (lib + "_d") try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib) else: try_names = (lib + "_bcpp", lib) for dir in dirs: for name in try_names: libfile = os.path.join(dir, self.library_filename(name)) if os.path.exists(libfile): return libfile else: # Oops, didn't find it in *any* of 'dirs' return None # overwrite the one from CCompiler to support rc and res-files def object_filenames (self, source_filenames, strip_dir=0, output_dir=''): if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: # use normcase to make sure '.rc' is really '.rc' and not '.RC' (base, ext) = os.path.splitext (os.path.normcase(src_name)) if ext not in (self.src_extensions + ['.rc','.res']): raise UnknownFileError("unknown file type '%s' (from '%s')" % \ (ext, src_name)) if strip_dir: base = os.path.basename (base) if ext == '.res': # these can go unchanged obj_names.append (os.path.join (output_dir, base + ext)) elif ext == '.rc': # these need to be compiled to .res-files obj_names.append (os.path.join (output_dir, base + '.res')) else: obj_names.append (os.path.join (output_dir, base + self.obj_extension)) return obj_names # object_filenames () def preprocess (self, source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None): (_, macros, include_dirs) = \ self._fix_compile_args(None, macros, include_dirs) pp_opts = gen_preprocess_options(macros, include_dirs) pp_args = ['cpp32.exe'] + pp_opts if output_file is not None: pp_args.append('-o' + output_file) if extra_preargs: pp_args[:0] = extra_preargs if extra_postargs: pp_args.extend(extra_postargs) pp_args.append(source) # We need to preprocess: either we're being forced to, or the # source file is newer than the target (or the target doesn't # exist). if self.force or output_file is None or newer(source, output_file): if output_file: self.mkpath(os.path.dirname(output_file)) try: self.spawn(pp_args) except DistutilsExecError as msg: print(msg) raise CompileError(msg) # preprocess() PK!1xExE_distutils/fancy_getopt.pynu["""distutils.fancy_getopt Wrapper around the standard getopt module that provides the following additional features: * short and long options are tied together * options have help strings, so fancy_getopt could potentially create a complete usage summary * options set attributes of a passed-in object """ import sys, string, re import getopt from distutils.errors import * # Much like command_re in distutils.core, this is close to but not quite # the same as a Python NAME -- except, in the spirit of most GNU # utilities, we use '-' in place of '_'. (The spirit of LISP lives on!) # The similarities to NAME are again not a coincidence... longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)' longopt_re = re.compile(r'^%s$' % longopt_pat) # For recognizing "negative alias" options, eg. "quiet=!verbose" neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat)) # This is used to translate long options to legitimate Python identifiers # (for use as attributes of some object). longopt_xlate = str.maketrans('-', '_') class FancyGetopt: """Wrapper around the standard 'getopt()' module that provides some handy extra functionality: * short and long options are tied together * options have help strings, and help text can be assembled from them * options set attributes of a passed-in object * boolean options can have "negative aliases" -- eg. if --quiet is the "negative alias" of --verbose, then "--quiet" on the command line sets 'verbose' to false """ def __init__(self, option_table=None): # The option table is (currently) a list of tuples. The # tuples may have 3 or four values: # (long_option, short_option, help_string [, repeatable]) # if an option takes an argument, its long_option should have '=' # appended; short_option should just be a single character, no ':' # in any case. If a long_option doesn't have a corresponding # short_option, short_option should be None. All option tuples # must have long options. self.option_table = option_table # 'option_index' maps long option names to entries in the option # table (ie. those 3-tuples). self.option_index = {} if self.option_table: self._build_index() # 'alias' records (duh) alias options; {'foo': 'bar'} means # --foo is an alias for --bar self.alias = {} # 'negative_alias' keeps track of options that are the boolean # opposite of some other option self.negative_alias = {} # These keep track of the information in the option table. We # don't actually populate these structures until we're ready to # parse the command-line, since the 'option_table' passed in here # isn't necessarily the final word. self.short_opts = [] self.long_opts = [] self.short2long = {} self.attr_name = {} self.takes_arg = {} # And 'option_order' is filled up in 'getopt()'; it records the # original order of options (and their values) on the command-line, # but expands short options, converts aliases, etc. self.option_order = [] def _build_index(self): self.option_index.clear() for option in self.option_table: self.option_index[option[0]] = option def set_option_table(self, option_table): self.option_table = option_table self._build_index() def add_option(self, long_option, short_option=None, help_string=None): if long_option in self.option_index: raise DistutilsGetoptError( "option conflict: already an option '%s'" % long_option) else: option = (long_option, short_option, help_string) self.option_table.append(option) self.option_index[long_option] = option def has_option(self, long_option): """Return true if the option table for this parser has an option with long name 'long_option'.""" return long_option in self.option_index def get_attr_name(self, long_option): """Translate long option name 'long_option' to the form it has as an attribute of some object: ie., translate hyphens to underscores.""" return long_option.translate(longopt_xlate) def _check_alias_dict(self, aliases, what): assert isinstance(aliases, dict) for (alias, opt) in aliases.items(): if alias not in self.option_index: raise DistutilsGetoptError(("invalid %s '%s': " "option '%s' not defined") % (what, alias, alias)) if opt not in self.option_index: raise DistutilsGetoptError(("invalid %s '%s': " "aliased option '%s' not defined") % (what, alias, opt)) def set_aliases(self, alias): """Set the aliases for this option parser.""" self._check_alias_dict(alias, "alias") self.alias = alias def set_negative_aliases(self, negative_alias): """Set the negative aliases for this option parser. 'negative_alias' should be a dictionary mapping option names to option names, both the key and value must already be defined in the option table.""" self._check_alias_dict(negative_alias, "negative alias") self.negative_alias = negative_alias def _grok_option_table(self): """Populate the various data structures that keep tabs on the option table. Called by 'getopt()' before it can do anything worthwhile. """ self.long_opts = [] self.short_opts = [] self.short2long.clear() self.repeat = {} for option in self.option_table: if len(option) == 3: long, short, help = option repeat = 0 elif len(option) == 4: long, short, help, repeat = option else: # the option table is part of the code, so simply # assert that it is correct raise ValueError("invalid option tuple: %r" % (option,)) # Type- and value-check the option names if not isinstance(long, str) or len(long) < 2: raise DistutilsGetoptError(("invalid long option '%s': " "must be a string of length >= 2") % long) if (not ((short is None) or (isinstance(short, str) and len(short) == 1))): raise DistutilsGetoptError("invalid short option '%s': " "must a single character or None" % short) self.repeat[long] = repeat self.long_opts.append(long) if long[-1] == '=': # option takes an argument? if short: short = short + ':' long = long[0:-1] self.takes_arg[long] = 1 else: # Is option is a "negative alias" for some other option (eg. # "quiet" == "!verbose")? alias_to = self.negative_alias.get(long) if alias_to is not None: if self.takes_arg[alias_to]: raise DistutilsGetoptError( "invalid negative alias '%s': " "aliased option '%s' takes a value" % (long, alias_to)) self.long_opts[-1] = long # XXX redundant?! self.takes_arg[long] = 0 # If this is an alias option, make sure its "takes arg" flag is # the same as the option it's aliased to. alias_to = self.alias.get(long) if alias_to is not None: if self.takes_arg[long] != self.takes_arg[alias_to]: raise DistutilsGetoptError( "invalid alias '%s': inconsistent with " "aliased option '%s' (one of them takes a value, " "the other doesn't" % (long, alias_to)) # Now enforce some bondage on the long option name, so we can # later translate it to an attribute name on some object. Have # to do this a bit late to make sure we've removed any trailing # '='. if not longopt_re.match(long): raise DistutilsGetoptError( "invalid long option name '%s' " "(must be letters, numbers, hyphens only" % long) self.attr_name[long] = self.get_attr_name(long) if short: self.short_opts.append(short) self.short2long[short[0]] = long def getopt(self, args=None, object=None): """Parse command-line options in args. Store as attributes on object. If 'args' is None or not supplied, uses 'sys.argv[1:]'. If 'object' is None or not supplied, creates a new OptionDummy object, stores option values there, and returns a tuple (args, object). If 'object' is supplied, it is modified in place and 'getopt()' just returns 'args'; in both cases, the returned 'args' is a modified copy of the passed-in 'args' list, which is left untouched. """ if args is None: args = sys.argv[1:] if object is None: object = OptionDummy() created_object = True else: created_object = False self._grok_option_table() short_opts = ' '.join(self.short_opts) try: opts, args = getopt.getopt(args, short_opts, self.long_opts) except getopt.error as msg: raise DistutilsArgError(msg) for opt, val in opts: if len(opt) == 2 and opt[0] == '-': # it's a short option opt = self.short2long[opt[1]] else: assert len(opt) > 2 and opt[:2] == '--' opt = opt[2:] alias = self.alias.get(opt) if alias: opt = alias if not self.takes_arg[opt]: # boolean option? assert val == '', "boolean option can't have value" alias = self.negative_alias.get(opt) if alias: opt = alias val = 0 else: val = 1 attr = self.attr_name[opt] # The only repeating option at the moment is 'verbose'. # It has a negative option -q quiet, which should set verbose = 0. if val and self.repeat.get(attr) is not None: val = getattr(object, attr, 0) + 1 setattr(object, attr, val) self.option_order.append((opt, val)) # for opts if created_object: return args, object else: return args def get_option_order(self): """Returns the list of (option, value) tuples processed by the previous run of 'getopt()'. Raises RuntimeError if 'getopt()' hasn't been called yet. """ if self.option_order is None: raise RuntimeError("'getopt()' hasn't been called yet") else: return self.option_order def generate_help(self, header=None): """Generate help text (a list of strings, one per suggested line of output) from the option table for this FancyGetopt object. """ # Blithely assume the option table is good: probably wouldn't call # 'generate_help()' unless you've already called 'getopt()'. # First pass: determine maximum length of long option names max_opt = 0 for option in self.option_table: long = option[0] short = option[1] l = len(long) if long[-1] == '=': l = l - 1 if short is not None: l = l + 5 # " (-x)" where short == 'x' if l > max_opt: max_opt = l opt_width = max_opt + 2 + 2 + 2 # room for indent + dashes + gutter # Typical help block looks like this: # --foo controls foonabulation # Help block for longest option looks like this: # --flimflam set the flim-flam level # and with wrapped text: # --flimflam set the flim-flam level (must be between # 0 and 100, except on Tuesdays) # Options with short names will have the short name shown (but # it doesn't contribute to max_opt): # --foo (-f) controls foonabulation # If adding the short option would make the left column too wide, # we push the explanation off to the next line # --flimflam (-l) # set the flim-flam level # Important parameters: # - 2 spaces before option block start lines # - 2 dashes for each long option name # - min. 2 spaces between option and explanation (gutter) # - 5 characters (incl. space) for short option name # Now generate lines of help text. (If 80 columns were good enough # for Jesus, then 78 columns are good enough for me!) line_width = 78 text_width = line_width - opt_width big_indent = ' ' * opt_width if header: lines = [header] else: lines = ['Option summary:'] for option in self.option_table: long, short, help = option[:3] text = wrap_text(help, text_width) if long[-1] == '=': long = long[0:-1] # Case 1: no short option at all (makes life easy) if short is None: if text: lines.append(" --%-*s %s" % (max_opt, long, text[0])) else: lines.append(" --%-*s " % (max_opt, long)) # Case 2: we have a short option, so we have to include it # just after the long option else: opt_names = "%s (-%s)" % (long, short) if text: lines.append(" --%-*s %s" % (max_opt, opt_names, text[0])) else: lines.append(" --%-*s" % opt_names) for l in text[1:]: lines.append(big_indent + l) return lines def print_help(self, header=None, file=None): if file is None: file = sys.stdout for line in self.generate_help(header): file.write(line + "\n") def fancy_getopt(options, negative_opt, object, args): parser = FancyGetopt(options) parser.set_negative_aliases(negative_opt) return parser.getopt(args, object) WS_TRANS = {ord(_wschar) : ' ' for _wschar in string.whitespace} def wrap_text(text, width): """wrap_text(text : string, width : int) -> [string] Split 'text' into multiple lines of no more than 'width' characters each, and return the list of strings that results. """ if text is None: return [] if len(text) <= width: return [text] text = text.expandtabs() text = text.translate(WS_TRANS) chunks = re.split(r'( +|-+)', text) chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings lines = [] while chunks: cur_line = [] # list of chunks (to-be-joined) cur_len = 0 # length of current line while chunks: l = len(chunks[0]) if cur_len + l <= width: # can squeeze (at least) this chunk in cur_line.append(chunks[0]) del chunks[0] cur_len = cur_len + l else: # this line is full # drop last chunk if all space if cur_line and cur_line[-1][0] == ' ': del cur_line[-1] break if chunks: # any chunks left to process? # if the current line is still empty, then we had a single # chunk that's too big too fit on a line -- so we break # down and break it up at the line width if cur_len == 0: cur_line.append(chunks[0][0:width]) chunks[0] = chunks[0][width:] # all-whitespace chunks at the end of a line can be discarded # (and we know from the re.split above that if a chunk has # *any* whitespace, it is *all* whitespace) if chunks[0][0] == ' ': del chunks[0] # and store this line in the list-of-all-lines -- as a single # string, of course! lines.append(''.join(cur_line)) return lines def translate_longopt(opt): """Convert a long option name to a valid Python identifier by changing "-" to "_". """ return opt.translate(longopt_xlate) class OptionDummy: """Dummy class just used as a place to hold command-line option values as instance attributes.""" def __init__(self, options=[]): """Create a new OptionDummy instance. The attributes listed in 'options' will be initialized to None.""" for opt in options: setattr(self, opt, None) if __name__ == "__main__": text = """\ Tra-la-la, supercalifragilisticexpialidocious. How *do* you spell that odd word, anyways? (Someone ask Mary -- she'll know [or she'll say, "How should I know?"].)""" for w in (10, 20, 30, 40): print("width: %d" % w) print("\n".join(wrap_text(text, w))) print() PK!`a_distutils/_collections.pynu[import collections import functools import itertools import operator # from jaraco.collections 3.5.1 class DictStack(list, collections.abc.Mapping): """ A stack of dictionaries that behaves as a view on those dictionaries, giving preference to the last. >>> stack = DictStack([dict(a=1, c=2), dict(b=2, a=2)]) >>> stack['a'] 2 >>> stack['b'] 2 >>> stack['c'] 2 >>> len(stack) 3 >>> stack.push(dict(a=3)) >>> stack['a'] 3 >>> set(stack.keys()) == set(['a', 'b', 'c']) True >>> set(stack.items()) == set([('a', 3), ('b', 2), ('c', 2)]) True >>> dict(**stack) == dict(stack) == dict(a=3, c=2, b=2) True >>> d = stack.pop() >>> stack['a'] 2 >>> d = stack.pop() >>> stack['a'] 1 >>> stack.get('b', None) >>> 'c' in stack True """ def __iter__(self): dicts = list.__iter__(self) return iter(set(itertools.chain.from_iterable(c.keys() for c in dicts))) def __getitem__(self, key): for scope in reversed(tuple(list.__iter__(self))): if key in scope: return scope[key] raise KeyError(key) push = list.append def __contains__(self, other): return collections.abc.Mapping.__contains__(self, other) def __len__(self): return len(list(iter(self))) # from jaraco.collections 3.7 class RangeMap(dict): """ A dictionary-like object that uses the keys as bounds for a range. Inclusion of the value for that range is determined by the key_match_comparator, which defaults to less-than-or-equal. A value is returned for a key if it is the first key that matches in the sorted list of keys. One may supply keyword parameters to be passed to the sort function used to sort keys (i.e. key, reverse) as sort_params. Let's create a map that maps 1-3 -> 'a', 4-6 -> 'b' >>> r = RangeMap({3: 'a', 6: 'b'}) # boy, that was easy >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') Even float values should work so long as the comparison operator supports it. >>> r[4.5] 'b' But you'll notice that the way rangemap is defined, it must be open-ended on one side. >>> r[0] 'a' >>> r[-1] 'a' One can close the open-end of the RangeMap by using undefined_value >>> r = RangeMap({0: RangeMap.undefined_value, 3: 'a', 6: 'b'}) >>> r[0] Traceback (most recent call last): ... KeyError: 0 One can get the first or last elements in the range by using RangeMap.Item >>> last_item = RangeMap.Item(-1) >>> r[last_item] 'b' .last_item is a shortcut for Item(-1) >>> r[RangeMap.last_item] 'b' Sometimes it's useful to find the bounds for a RangeMap >>> r.bounds() (0, 6) RangeMap supports .get(key, default) >>> r.get(0, 'not found') 'not found' >>> r.get(7, 'not found') 'not found' One often wishes to define the ranges by their left-most values, which requires use of sort params and a key_match_comparator. >>> r = RangeMap({1: 'a', 4: 'b'}, ... sort_params=dict(reverse=True), ... key_match_comparator=operator.ge) >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') That wasn't nearly as easy as before, so an alternate constructor is provided: >>> r = RangeMap.left({1: 'a', 4: 'b', 7: RangeMap.undefined_value}) >>> r[1], r[2], r[3], r[4], r[5], r[6] ('a', 'a', 'a', 'b', 'b', 'b') """ def __init__(self, source, sort_params={}, key_match_comparator=operator.le): dict.__init__(self, source) self.sort_params = sort_params self.match = key_match_comparator @classmethod def left(cls, source): return cls( source, sort_params=dict(reverse=True), key_match_comparator=operator.ge ) def __getitem__(self, item): sorted_keys = sorted(self.keys(), **self.sort_params) if isinstance(item, RangeMap.Item): result = self.__getitem__(sorted_keys[item]) else: key = self._find_first_match_(sorted_keys, item) result = dict.__getitem__(self, key) if result is RangeMap.undefined_value: raise KeyError(key) return result def get(self, key, default=None): """ Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError. """ try: return self[key] except KeyError: return default def _find_first_match_(self, keys, item): is_match = functools.partial(self.match, item) matches = list(filter(is_match, keys)) if matches: return matches[0] raise KeyError(item) def bounds(self): sorted_keys = sorted(self.keys(), **self.sort_params) return (sorted_keys[RangeMap.first_item], sorted_keys[RangeMap.last_item]) # some special values for the RangeMap undefined_value = type(str('RangeValueUndefined'), (), {})() class Item(int): "RangeMap Item" first_item = Item(0) last_item = Item(-1) PK!188_distutils/unixccompiler.pynu["""distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library search directories specified with -Ldir * compile handled by 'cc' (or similar) executable with -c option: compiles .c to .o * link static library handled by 'ar' command (possibly with 'ranlib') * link shared library handled by 'cc -shared' """ import os, sys, re, shlex from distutils import sysconfig from distutils.dep_util import newer from distutils.ccompiler import \ CCompiler, gen_preprocess_options, gen_lib_options from distutils.errors import \ DistutilsExecError, CompileError, LibError, LinkError from distutils import log if sys.platform == 'darwin': import _osx_support # XXX Things not currently handled: # * optimization/debug/warning flags; we just use whatever's in Python's # Makefile and live with it. Is this adequate? If not, we might # have to have a bunch of subclasses GNUCCompiler, SGICCompiler, # SunCCompiler, and I suspect down that road lies madness. # * even if we don't know a warning flag from an optimization flag, # we need some way for outsiders to feed preprocessor/compiler/linker # flags in to us -- eg. a sysadmin might want to mandate certain flags # via a site config file, or a user might want to set something for # compiling this module distribution only via the setup.py command # line, whatever. As long as these options come from something on the # current system, they can be as system-dependent as they like, and we # should just happily stuff them into the preprocessor/compiler/linker # options and carry on. class UnixCCompiler(CCompiler): compiler_type = 'unix' # These are used by CCompiler in two places: the constructor sets # instance attributes 'preprocessor', 'compiler', etc. from them, and # 'set_executable()' allows any of these to be set. The defaults here # are pretty generic; they will probably have to be set by an outsider # (eg. using information discovered by the sysconfig about building # Python extensions). executables = {'preprocessor' : None, 'compiler' : ["cc"], 'compiler_so' : ["cc"], 'compiler_cxx' : ["cc"], 'linker_so' : ["cc", "-shared"], 'linker_exe' : ["cc"], 'archiver' : ["ar", "-cr"], 'ranlib' : None, } if sys.platform[:6] == "darwin": executables['ranlib'] = ["ranlib"] # Needed for the filename generation methods provided by the base # class, CCompiler. NB. whoever instantiates/uses a particular # UnixCCompiler instance should set 'shared_lib_ext' -- we set a # reasonable common default here, but it's not necessarily used on all # Unices! src_extensions = [".c",".C",".cc",".cxx",".cpp",".m"] obj_extension = ".o" static_lib_extension = ".a" shared_lib_extension = ".so" dylib_lib_extension = ".dylib" xcode_stub_lib_extension = ".tbd" static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" xcode_stub_lib_format = dylib_lib_format if sys.platform == "cygwin": exe_extension = ".exe" def preprocess(self, source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None): fixed_args = self._fix_compile_args(None, macros, include_dirs) ignore, macros, include_dirs = fixed_args pp_opts = gen_preprocess_options(macros, include_dirs) pp_args = self.preprocessor + pp_opts if output_file: pp_args.extend(['-o', output_file]) if extra_preargs: pp_args[:0] = extra_preargs if extra_postargs: pp_args.extend(extra_postargs) pp_args.append(source) # We need to preprocess: either we're being forced to, or we're # generating output to stdout, or there's a target output file and # the source file is newer than the target (or the target doesn't # exist). if self.force or output_file is None or newer(source, output_file): if output_file: self.mkpath(os.path.dirname(output_file)) try: self.spawn(pp_args) except DistutilsExecError as msg: raise CompileError(msg) def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): compiler_so = self.compiler_so if sys.platform == 'darwin': compiler_so = _osx_support.compiler_fixup(compiler_so, cc_args + extra_postargs) try: self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs) except DistutilsExecError as msg: raise CompileError(msg) def create_static_lib(self, objects, output_libname, output_dir=None, debug=0, target_lang=None): objects, output_dir = self._fix_object_args(objects, output_dir) output_filename = \ self.library_filename(output_libname, output_dir=output_dir) if self._need_link(objects, output_filename): self.mkpath(os.path.dirname(output_filename)) self.spawn(self.archiver + [output_filename] + objects + self.objects) # Not many Unices required ranlib anymore -- SunOS 4.x is, I # think the only major Unix that does. Maybe we need some # platform intelligence here to skip ranlib if it's not # needed -- or maybe Python's configure script took care of # it for us, hence the check for leading colon. if self.ranlib: try: self.spawn(self.ranlib + [output_filename]) except DistutilsExecError as msg: raise LibError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): objects, output_dir = self._fix_object_args(objects, output_dir) fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) libraries, library_dirs, runtime_library_dirs = fixed_args lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if not isinstance(output_dir, (str, type(None))): raise TypeError("'output_dir' must be a string or None") if output_dir is not None: output_filename = os.path.join(output_dir, output_filename) if self._need_link(objects, output_filename): ld_args = (objects + self.objects + lib_opts + ['-o', output_filename]) if debug: ld_args[:0] = ['-g'] if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) self.mkpath(os.path.dirname(output_filename)) try: if target_desc == CCompiler.EXECUTABLE: linker = self.linker_exe[:] else: linker = self.linker_so[:] if target_lang == "c++" and self.compiler_cxx: # skip over environment variable settings if /usr/bin/env # is used to set up the linker's environment. # This is needed on OSX. Note: this assumes that the # normal and C++ compiler have the same environment # settings. i = 0 if os.path.basename(linker[0]) == "env": i = 1 while '=' in linker[i]: i += 1 if os.path.basename(linker[i]) == 'ld_so_aix': # AIX platforms prefix the compiler with the ld_so_aix # script, so we need to adjust our linker index offset = 1 else: offset = 0 linker[i+offset] = self.compiler_cxx[i] if sys.platform == 'darwin': linker = _osx_support.compiler_fixup(linker, ld_args) self.spawn(linker + ld_args) except DistutilsExecError as msg: raise LinkError(msg) else: log.debug("skipping %s (up-to-date)", output_filename) # -- Miscellaneous methods ----------------------------------------- # These are all used by the 'gen_lib_options() function, in # ccompiler.py. def library_dir_option(self, dir): return "-L" + dir def _is_gcc(self, compiler_name): return "gcc" in compiler_name or "g++" in compiler_name def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library # is sought. GCC on GNU systems (Linux, FreeBSD, ...) has to # be told to pass the -R option through to the linker, whereas # other compilers and gcc on other systems just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. compiler = os.path.basename(shlex.split(sysconfig.get_config_var("CC"))[0]) if sys.platform[:6] == "darwin": from distutils.util import get_macosx_target_ver, split_version macosx_target_ver = get_macosx_target_ver() if macosx_target_ver and split_version(macosx_target_ver) >= [10, 5]: return "-Wl,-rpath," + dir else: # no support for -rpath on earlier macOS versions return "-L" + dir elif sys.platform[:7] == "freebsd": return "-Wl,-rpath=" + dir elif sys.platform[:5] == "hp-ux": if self._is_gcc(compiler): return ["-Wl,+s", "-L" + dir] return ["+s", "-L" + dir] # For all compilers, `-Wl` is the presumed way to # pass a compiler option to the linker and `-R` is # the way to pass an RPATH. if sysconfig.get_config_var("GNULD") == "yes": # GNU ld needs an extra option to get a RUNPATH # instead of just an RPATH. return "-Wl,--enable-new-dtags,-R" + dir else: return "-Wl,-R" + dir def library_option(self, lib): return "-l" + lib def find_library_file(self, dirs, lib, debug=0): shared_f = self.library_filename(lib, lib_type='shared') dylib_f = self.library_filename(lib, lib_type='dylib') xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub') static_f = self.library_filename(lib, lib_type='static') if sys.platform == 'darwin': # On OSX users can specify an alternate SDK using # '-isysroot', calculate the SDK root if it is specified # (and use it further on) # # Note that, as of Xcode 7, Apple SDKs may contain textual stub # libraries with .tbd extensions rather than the normal .dylib # shared libraries installed in /. The Apple compiler tool # chain handles this transparently but it can cause problems # for programs that are being built with an SDK and searching # for specific libraries. Callers of find_library_file need to # keep in mind that the base filename of the returned SDK library # file might have a different extension from that of the library # file installed on the running system, for example: # /Applications/Xcode.app/Contents/Developer/Platforms/ # MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ # usr/lib/libedit.tbd # vs # /usr/lib/libedit.dylib cflags = sysconfig.get_config_var('CFLAGS') m = re.search(r'-isysroot\s*(\S+)', cflags) if m is None: sysroot = '/' else: sysroot = m.group(1) for dir in dirs: shared = os.path.join(dir, shared_f) dylib = os.path.join(dir, dylib_f) static = os.path.join(dir, static_f) xcode_stub = os.path.join(dir, xcode_stub_f) if sys.platform == 'darwin' and ( dir.startswith('/System/') or ( dir.startswith('/usr/') and not dir.startswith('/usr/local/'))): shared = os.path.join(sysroot, dir[1:], shared_f) dylib = os.path.join(sysroot, dir[1:], dylib_f) static = os.path.join(sysroot, dir[1:], static_f) xcode_stub = os.path.join(sysroot, dir[1:], xcode_stub_f) # We're second-guessing the linker here, with not much hard # data to go on: GCC seems to prefer the shared library, so I'm # assuming that *all* Unix C compilers do. And of course I'm # ignoring even GCC's "-static" option. So sue me. if os.path.exists(dylib): return dylib elif os.path.exists(xcode_stub): return xcode_stub elif os.path.exists(shared): return shared elif os.path.exists(static): return static # Oops, didn't find it in *any* of 'dirs' return None PK!T _itertools.pynu[from setuptools.extern.more_itertools import consume # noqa: F401 # copied from jaraco.itertools 6.1 def ensure_unique(iterable, key=lambda x: x): """ Wrap an iterable to raise a ValueError if non-unique values are encountered. >>> list(ensure_unique('abc')) ['a', 'b', 'c'] >>> consume(ensure_unique('abca')) Traceback (most recent call last): ... ValueError: Duplicate element 'a' encountered. """ seen = set() seen_add = seen.add for element in iterable: k = key(element) if k in seen: raise ValueError(f"Duplicate element {element!r} encountered.") seen_add(k) yield element PK!_reqs.pynu[import setuptools.extern.jaraco.text as text from pkg_resources import Requirement def parse_strings(strs): """ Yield requirement strings for each specification in `strs`. `strs` must be a string, or a (possibly-nested) iterable thereof. """ return text.join_continuation(map(text.drop_comment, text.yield_lines(strs))) def parse(strs): """ Deprecated drop-in replacement for pkg_resources.parse_requirements. """ return map(Requirement, parse_strings(strs)) PK! {AA config.pycnu[ fc@@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZeedZd Zed Zd efd YZd efdYZdefdYZdS(i(tabsolute_importtunicode_literalsN(t defaultdict(tpartial(t import_module(tDistutilsOptionErrortDistutilsFileError(t string_typesc C@sddlm}m}tjj|}tjj|sMtd|ntj}tj tjj |zl|}|r|j ng}||kr|j |n|j |d|t||jd|}Wdtj |Xt|S(u,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict i(t Distributiont _Distributionu%Configuration file %s does not exist.t filenamestignore_option_errorsN(tsetuptools.distRR tostpathtabspathtisfileRtgetcwdtchdirtdirnametfind_config_filestappendtparse_config_filestparse_configurationtcommand_optionstconfiguration_to_dict( tfilepatht find_othersR RR tcurrent_directorytdistR thandlers((s5/usr/lib/python2.7/site-packages/setuptools/config.pytread_configuration s$     cC@stt}x|D]w}|j}|j}x\|jD]Q}t|d|d}|dkrot||}n |}||||su,u c3@sE|];}j|strtjj|rj|VqdS(N(t _assert_localRGR RRt _read_file(RaR(RT(s5/usr/lib/python2.7/site-packages/setuptools/config.pys s(RPRR5tlenRStjoin(RTR+tinclude_directivetspect filepaths((RTs5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_files cC@s,|jtjs(td|ndS(Nu#`file:` directive can not access %s(R5R RR(R((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRbscC@s,tj|dd}|jSWdQXdS(Ntencodinguutf-8(tiotopentread(Rtf((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRcscC@sd}|j|s|S|j|djjd}|j}dj|}|p^d}tjjdt j zt |}t ||}Wdtjdt_X|S(uRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str uattr:uu.u__init__iNi( R5R6R7RStpopRetsysRtinsertR RRR$(RTR+tattr_directivet attrs_patht attr_namet module_nametmodule((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_attrs !   c@sfd}|S(uReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable c@s'|}xD]}||}q W|S(N((R+tparsedtmethod(t parse_methods(s5/usr/lib/python2.7/site-packages/setuptools/config.pyR.Bs ((RTRzR.((Rzs5/usr/lib/python2.7/site-packages/setuptools/config.pyt_get_parser_compound9s cC@sLi}|pd}x0|jD]"\}\}}||||Wt(R4(RTR;t values_parserR+R[t_R]((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_section_to_dictLs cC@sIxB|jD]4\}\}}y|||||d<|d=n|S(Nu*u(RRWRC(R9R;Rxtroot((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_package_data s   cC@s|j||ds   .  ;PK! K K py36compat.pynu[import sys from distutils.errors import DistutilsOptionError from distutils.util import strtobool from distutils.debug import DEBUG class Distribution_parse_config_files: """ Mix-in providing forward-compatibility for functionality to be included by default on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. """ def parse_config_files(self, filenames=None): from configparser import ConfigParser # Ignore install directory options if we have a venv if sys.prefix != sys.base_prefix: ignore_options = [ 'install-base', 'install-platbase', 'install-lib', 'install-platlib', 'install-purelib', 'install-headers', 'install-scripts', 'install-data', 'prefix', 'exec-prefix', 'home', 'user', 'root'] else: ignore_options = [] ignore_options = frozenset(ignore_options) if filenames is None: filenames = self.find_config_files() if DEBUG: self.announce("Distribution.parse_config_files():") parser = ConfigParser(interpolation=None) for filename in filenames: if DEBUG: self.announce(" reading %s" % filename) parser.read(filename) for section in parser.sections(): options = parser.options(section) opt_dict = self.get_option_dict(section) for opt in options: if opt != '__name__' and opt not in ignore_options: val = parser.get(section,opt) opt = opt.replace('-', '_') opt_dict[opt] = (filename, val) # Make the ConfigParser forget everything (so we retain # the original filenames that options come from) parser.__init__() # If there was a "global" section in the config file, use it # to set Distribution options. if 'global' in self.command_options: for (opt, (src, val)) in self.command_options['global'].items(): alias = self.negative_opt.get(opt) try: if alias: setattr(self, alias, not strtobool(val)) elif opt in ('verbose', 'dry_run'): # ugh! setattr(self, opt, strtobool(val)) else: setattr(self, opt, val) except ValueError as msg: raise DistutilsOptionError(msg) if sys.version_info < (3,): # Python 2 behavior is sufficient class Distribution_parse_config_files: pass if False: # When updated behavior is available upstream, # disable override here. class Distribution_parse_config_files: pass PK!Oxarchive_util.pyonu[ fc@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ d efd YZ d Z e ddZe dZe dZe dZeeefZdS(s/Utilities for extracting common archive formatsiN(tDistutilsError(tensure_directorytunpack_archivetunpack_zipfiletunpack_tarfiletdefault_filtertUnrecognizedFormattextraction_driverstunpack_directorycBseZdZRS(s#Couldn't recognize the archive type(t__name__t __module__t__doc__(((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRscCs|S(s@The default progress/filter callback; returns True for all files((tsrctdst((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRscCsZxS|p tD]5}y||||Wntk r=q q XdSq Wtd|dS(sUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Ns!Not a recognized archive type: %s(RR(tfilenamet extract_dirtprogress_filtertdriverstdriver((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRs c Cs:tjj|s%td|nid|f|6}xtj|D]\}}}||\}}xD|D]<} || dtjj|| f|tjj|| RRs..iN(ttarfileR-tTarErrorRt contextlibtclosingtchownR3R)R*RRRR6tislnktissymtlinknamet posixpathtdirnametnormpatht _getmembertisfileRR+tsept_extract_membert ExtractErrortTrue( RRRttarobjtmemberR3t prelim_dsttlinkpathRt final_dst((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRs8   %'  $ (R R%R9RRRAR;tdistutils.errorsRt pkg_resourcesRt__all__RRR6RRRRR(((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyts$         "  % .PK!"unicode_utils.pyonu[ fc@sGddlZddlZddlmZdZdZdZdS(iN(tsixcCsnt|tjr"tjd|Sy4|jd}tjd|}|jd}Wntk rinX|S(NtNFDsutf-8(t isinstanceRt text_typet unicodedatat normalizetdecodetencodet UnicodeError(tpath((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyt decomposes cCsqt|tjr|Stjp%d}|df}x6|D].}y|j|SWq;tk rhq;q;Xq;WdS(sY Ensure that the given path is decoded, NONE when no expected encoding works sutf-8N(RRRtsystgetfilesystemencodingRtUnicodeDecodeError(R tfs_enct candidatestenc((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pytfilesys_decodes   cCs*y|j|SWntk r%dSXdS(s/turn unicode encoding into a functional routineN(RtUnicodeEncodeErrortNone(tstringR((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyt try_encode's (RR tsetuptools.externRR RR(((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyts   PK!x- lib2to3_ex.pycnu[ fc@sxdZddlmZddlmZddlmZmZddl Z defdYZ defd YZdS( sy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. i(t Mixin2to3(tlog(tRefactoringTooltget_fixers_from_packageNtDistutilsRefactoringToolcBs#eZdZdZdZRS(cOstj||dS(N(Rterror(tselftmsgtargstkw((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_errorscGstj||dS(N(Rtinfo(RRR((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_messagescGstj||dS(N(Rtdebug(RRR((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_debugs(t__name__t __module__R R R(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs  RcBs&eZedZdZdZRS(cCs|jjtk rdS|s dStjddj||j|j|rtj rt |j }|j |dtdtqnt j||dS(NsFixing t twritet doctests_only(t distributiontuse_2to3tTrueRR tjoint_Mixin2to3__build_fixer_namest_Mixin2to3__exclude_fixerst setuptoolstrun_2to3_on_doctestsRt fixer_namestrefactort _Mixin2to3trun_2to3(Rtfilestdocteststr((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs   cCs|jr dSg|_x'tjD]}|jjt|q W|jjdk rx-|jjD]}|jjt|q_WndS(N(RRtlib2to3_fixer_packagestextendRRtuse_2to3_fixerstNone(Rtp((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt__build_fixer_names.s  cCsqt|dg}|jjdk r:|j|jjnx0|D](}||jkrA|jj|qAqAWdS(Ntexclude_fixers(tgetattrRtuse_2to3_exclude_fixersR&R$Rtremove(Rtexcluded_fixerst fixer_name((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt__exclude_fixers8s  (RRtFalseRRR(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs  ( t__doc__tdistutils.utilRRt distutilsRtlib2to3.refactorRRRR(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyts   PK!c.g dep_util.pycnu[ fc@sddlmZdZdS(i(t newer_groupcCst|t|kr'tdng}g}xVtt|D]B}t||||rF|j|||j||qFqFW||fS(sWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. s5'sources_group' and 'targets' must be the same length(tlent ValueErrortrangeRtappend(tsources_groupsttargetst n_sourcest n_targetsti((s7/usr/lib/python2.7/site-packages/setuptools/dep_util.pytnewer_pairwise_groupsN(tdistutils.dep_utilRR (((s7/usr/lib/python2.7/site-packages/setuptools/dep_util.pytsPK!<k$jjpy31compat.pyonu[ fc@sddgZyddlmZmZWn0ek rXddlmZmZdZnXyddlmZWn?ek rddl Z ddlZde fd YZnXdS( tget_config_varstget_pathi(RR(Rtget_python_libcCs+|dkrtdnt|dkS(NtplatlibtpurelibsName must be purelib or platlib(RR(t ValueErrorR(tname((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyR s (tTemporaryDirectoryNRcBs)eZdZdZdZdZRS(s Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cCsd|_tj|_dS(N(tNoneRttempfiletmkdtemp(tself((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt__init__s cCs|jS(N(R(R ((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt __enter__!scCs8ytj|jtWntk r*nXd|_dS(N(tshutiltrmtreeRtTruetOSErrorR(R texctypetexcvaluetexctrace((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt__exit__$s  (t__name__t __module__t__doc__R R R(((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyRs  ( t__all__t sysconfigRRt ImportErrortdistutils.sysconfigRR RRtobject(((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyts      PK!g[⣠msvc.pyonu[ fc@sydZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ej dkrddl mZejZnd fd YZeZeejjfZydd lmZWnek rnXd Zd dZdZdZddZdfdYZdfdYZdfdYZdfdYZ dS(s@ Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) iN(t LegacyVersion(t filterfalsei(t get_unpatchedtWindows(twinregRcBs eZdZdZdZdZRS(N(t__name__t __module__tNonet HKEY_USERStHKEY_CURRENT_USERtHKEY_LOCAL_MACHINEtHKEY_CLASSES_ROOT(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR(s(tRegcCsd}|d|f}ytj|d}WnQtk ry&|d|f}tj|d}Wqtk r{d}qXnX|rtjjjj|d}tjj|r|Sntt |S(s+ Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ vcvarsall.bat path: str s-Software\%sMicrosoft\DevDiv\VCForPython\%0.1ftt installdirs Wow6432Node\s vcvarsall.batN( R t get_valuetKeyErrorRtostpathtjointisfileRtmsvc9_find_vcvarsall(tversiontVC_BASEtkeyt productdirt vcvarsall((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR?s  tx86cOsy#tt}|||||SWn'tjjk r<ntk rLnXyt||jSWn,tjjk r}t|||nXdS(s Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ environment: dict N( Rtmsvc9_query_vcvarsallt distutilsterrorstDistutilsPlatformErrort ValueErrortEnvironmentInfot return_envt_augment_exception(tvertarchtargstkwargstorigtexc((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRjs  cCsxytt|SWntjjk r-nXyt|ddjSWn)tjjk rs}t|dnXdS(s' Patched "distutils._msvccompiler._get_vc_env" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Parameters ---------- plat_spec: str Target architecture. Return ------ environment: dict t vc_min_verg,@N(Rtmsvc14_get_vc_envRRRR!R"R#(t plat_specR)((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR+s cOsbdtjkrOddl}t|jtdkrO|jjj||Sntt ||S(s Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) snumpy.distutilsiNs1.11.2( tsystmodulestnumpyRt __version__Rt ccompilertgen_lib_optionsRtmsvc14_gen_lib_options(R&R'tnp((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR3s  R cCs|jd}d|jks1d|jkrd}|jt}d}|dkr|jjddkr|d 7}||d 7}q|d 7}q|d kr|d 7}||d7}q|dkr|d7}qn|f|_dS(sl Add details to the exception message to help guide the user as to what action will resolve it. iRsvisual cs0Microsoft Visual C++ {version:0.1f} is required.s-www.microsoft.com/download/details.aspx?id=%dg"@tia64is* Get it with "Microsoft Windows SDK 7.0": iB s% Get it from http://aka.ms/vcpython27g$@s* Get it with "Microsoft Windows SDK 7.1": iW g,@sj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN(R&tlowertformattlocalstfind(R)RR%tmessagettmplt msdownload((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR#s  $      t PlatformInfocBszeZdZejddjZdZedZ dZ dZ e e dZ e e dZe d ZRS( s Current and Target Architectures informations. Parameters ---------- arch: str Target architecture. tprocessor_architectureR cCs|jjdd|_dS(Ntx64tamd64(R6treplaceR%(tselfR%((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt__init__scCs|j|jjddS(Nt_i(R%R9(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_cpuscCs |jdkS(NR(RE(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_is_x86scCs |jdkS(NR(t current_cpu(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytcurrent_is_x86scCs=|jdkr|rdS|jdkr2|r2dSd|jS(sj Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ subfolder: str ' arget', or '' (see hidex86 parameter) RR R@s\x64s\%s(RG(RBthidex86R?((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt current_dir scCs=|jdkr|rdS|jdkr2|r2dSd|jS(sr Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ subfolder: str '\current', or '' (see hidex86 parameter) RR R@s\x64s\%s(RE(RBRIR?((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_dirscCsB|r dn|j}|j|kr(dS|jjdd|S(so Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current acritecture is not x86. Return ------ subfolder: str '' if target architecture is current architecture, '\current_target' if not. RR s\s\%s_(RGRERKRA(RBtforcex86tcurrent((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt cross_dir5s(RRt__doc__tsafe_envtgetR6RGRCtpropertyRERFRHtFalseRJRKRN(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR=s   t RegistryInfocBseZdZejejejejfZdZ e dZ e dZ e dZ e dZe dZe dZe dZe d Ze d Zed Zd ZRS( s Microsoft Visual Studio related registry informations. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dS(N(tpi(RBt platform_info((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCZscCsdS(s< Microsoft Visual Studio root registry key. t VisualStudio((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt visualstudio]scCstjj|jdS(s; Microsoft Visual Studio SxS registry key. tSxS(RRRRX(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytsxsdscCstjj|jdS(s8 Microsoft Visual C++ VC7 registry key. tVC7(RRRRZ(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytvckscCstjj|jdS(s; Microsoft Visual Studio VS7 registry key. tVS7(RRRRZ(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytvsrscCsdS(s? Microsoft Visual C++ for Python registry key. sDevDiv\VCForPython((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt vc_for_pythonyscCsdS(s- Microsoft SDK registry key. sMicrosoft SDKs((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt microsoft_sdkscCstjj|jdS(s> Microsoft Windows/Platform SDK registry key. R(RRRR`(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt windows_sdkscCstjj|jdS(s< Microsoft .NET Framework SDK registry key. tNETFXSDK(RRRR`(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt netfx_sdkscCsdS(s< Microsoft Windows Kits Roots registry key. sWindows Kits\Installed Roots((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytwindows_kits_rootsscCs:|jjs|rdnd}tjjd|d|S(s  Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str: value R t Wow6432NodetSoftwaret Microsoft(RURHRRR(RBRRtnode64((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt microsofts!cCstj}tj}|j}x|jD]}y||||d|}Wnkttfk r|jjs%y"||||t d|}Wqttfk rq%qXqq%nXytj ||dSWq%ttfk rq%Xq%WdS(s Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str: value iN( RtKEY_READtOpenKeyRitHKEYStOSErrortIOErrorRURHtTruet QueryValueEx(RBRtnameRjtopenkeytmsthkeytbkey((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytlookups"   " (RRRORRR R R RlRCRRRXRZR\R^R_R`RaRcRdRSRiRv(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRTLs"   t SystemInfocBsjeZdZejddZejddZejdeZddZ dZ dZ e dZ e d Zd Zd Ze d Ze d Ze dZe dZe dZe dZe dZe dZe dZe dZe dZe dZe dZdZddZRS(s Microsoft Windows and Visual Studio related system inormations. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. tWinDirR t ProgramFilessProgramFiles(x86)cCs1||_|jj|_|p'|j|_dS(N(triRUt_find_latest_available_vc_vertvc_ver(RBt registry_infoR|((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCs cCsBy|jdSWn)tk r=d}tjj|nXdS(Nis%No Microsoft Visual C++ version found(tfind_available_vc_verst IndexErrorRRR(RBterr((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR{s  c Cs|jj}|jj|jj|jjf}g}xI|jjD];}x2|D]*}y%tj|||dtj}Wnt t fk rqMnXtj |\}}} xdt |D]V} y<t tj|| d} | |kr|j| nWqtk rqXqWx`t |D]R} y8t tj|| } | |kr^|j| nWq!tk rrq!Xq!WqMWq@Wt|S(sC Find all available Microsoft Visual C++ versions. i(RzRiR\R_R^RlRRkRjRmRnt QueryInfoKeytrangetfloatt EnumValuetappendR tEnumKeytsorted( RBRstvckeystvc_versRtRRutsubkeystvaluesRDtiR$((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR~s2 ! %    cCsKd|j}tjj|j|}|jj|jjd|jpJ|S(s4 Microsoft Visual Studio directory. sMicrosoft Visual Studio %0.1fs%0.1f(R|RRRtProgramFilesx86RzRvR^(RBRqtdefault((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VSInstallDir s cCs|j|jp|j}tjj|jjd|j}|jj |d}|rqtjj|dn|}|jj |jj d|jp|}tjj |sd}t j j|n|S(s1 Microsoft Visual C++ directory. s%0.1fRtVCs(Microsoft Visual C++ directory not found(Rt _guess_vct_guess_vc_legacyRRRRzR_R|RvR\tisdirRRR(RBtguess_vctreg_patht python_vct default_vcRtmsg((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCInstallDirs"!(cCs||jdkrdSd}tjj|j|}y*tj|d}tjj||SWntttfk rwnXdS(s* Locate Visual C for 2017 g,@Ns VC\Tools\MSVCi( R|RRRRtlistdirRmRnR(RBRRt vc_exact_ver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR0scCs#d|j}tjj|j|S(s< Locate Visual C for versions prior to 2017 s Microsoft Visual Studio %0.1f\VC(R|RRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR@s cCsc|jdkrdS|jdkr&dS|jdkr9dS|jd krLdS|jdkr_dSdS(sN Microsoft Windows SDK versions for specified MSVC++ version. g"@s7.0s6.1s6.0ag$@s7.1s7.0ag&@s8.0s8.0ag(@s8.1s8.1ag,@s10.0N(s7.0s6.1s6.0a(s7.1s7.0a(s8.0s8.0a(s8.1s8.1a(s10.0s8.1(R|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSdkVersionGscCs|jtjj|jdS(s4 Microsoft Windows SDK last version tlib(t_use_last_dir_nameRRRt WindowsSdkDir(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSdkLastVersionWscCsd}xO|jD]D}tjj|jjd|}|jj|d}|rPqqW| srtjj| rtjj|jjd|j }|jj|d}|rtjj|d}qn| stjj| rKxd|jD]V}||j d }d|}tjj|j |}tjj|r|}qqWn| setjj| rxQ|jD]C}d |}tjj|j |}tjj|ro|}qoqoWn|stjj|j d }n|S( s2 Microsoft Windows SDK directory. R sv%stinstallationfolders%0.1fRtWinSDKt.sMicrosoft SDKs\Windows Kits\%ssMicrosoft SDKs\Windows\v%st PlatformSDK( RRRRRzRaRvRR_R|trfindRyR(RBtsdkdirR$tlocRt install_basetintvertd((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR_s6"  c Cs8|jdkrd}d}n<d}|jdkr9tnt}|jjdtd|}d||jd d f}g}|jd krx9|jD]+}|tjj |j j ||g7}qWnx:|j D]/}|tjj |j j d ||g7}qWx-|D]%}|j j|d }|r Pq q W|S(s= Microsoft Windows SDK executable directory. g&@i#R i(g(@R?RIsWinSDK-NetFx%dTools%ss\t-g,@sv%sAR(R|RoRSRURJRAtNetFxSdkVersionRRRRzRcRRaRv( RBtnetfxverR%RItfxtregpathsR$Rtexecpath((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSDKExecutablePaths$ ,- cCsAd|j}tjj|jj|}|jj|dp@dS(s0 Microsoft Visual F# directory. s%0.1f\Setup\F#RR (R|RRRRzRXRv(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFSharpInstallDirs cCsb|jdkrd}nd}x7|D]/}|jj|jjd|}|r%Pq%q%W|padS(s8 Microsoft Universal CRT SDK directory. g,@t10t81s kitsroot%sR (RR((R|RzRvRd(RBtversR$R((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytUniversalCRTSdkDirs   cCs|jtjj|jdS(s@ Microsoft Universal C Runtime SDK last version R(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytUniversalCRTSdkLastVersionscCs|jdkrdSdSdS(s8 Microsoft .NET Framework SDK versions. g,@s4.6.1s4.6N(s4.6.1s4.6((R|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRscCsXxK|jD]@}tjj|jj|}|jj|d}|r Pq q W|pWdS(s9 Microsoft .NET Framework SDK directory. tkitsinstallationfolderR (RRRRRzRcRv(RBR$RR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt NetFxSdkDirs cCs7tjj|jd}|jj|jjdp6|S(s; Microsoft .NET Framework 32bit directory. sMicrosoft.NET\Frameworktframeworkdir32(RRRRxRzRvR\(RBtguess_fw((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkDir32scCs7tjj|jd}|jj|jjdp6|S(s; Microsoft .NET Framework 64bit directory. sMicrosoft.NET\Framework64tframeworkdir64(RRRRxRzRvR\(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkDir64scCs |jdS(s: Microsoft .NET Framework 32bit versions. i (t_find_dot_net_versions(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkVersion32scCs |jdS(s: Microsoft .NET Framework 64bit versions. i@(R(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkVersion64scCs|jj|jjd|}t|d|}|pM|j|dpMd}|jdkrn|df}nR|jdkr|jd d krd n|d f}n|jd krd}n|jdkrd}n|S(s Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. sframeworkver%dsFrameworkDir%dtvR g(@sv4.0g$@itv4s v4.0.30319sv3.5g"@s v2.0.50727g @sv3.0(sv3.5s v2.0.50727(sv3.0s v2.0.50727(RzRvR\tgetattrRR|R6(RBtbitstreg_vert dot_net_dirR$t frameworkver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs    cs;fdttjD}t|dp:dS(s Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs startings by this prefix c3sE|];}tjjtjj|r|jr|VqdS(N(RRRRt startswith(t.0tdir_name(Rtprefix(s3/usr/lib/python2.7/site-packages/setuptools/msvc.pys )s!R N(treversedRRtnextR(RBRRt matching_dirs((RRs3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs N( RRRORPRQRxRyRRRCR{R~RRRRRRRRRRRRRRRRRRRRR(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRws4       &      R!cBseZdZdddZedZedZedZedZ edZ edZ ed Z ed Z ed Zed Zd ZedZedZedZedZedZedZedZedZedZedZedZedZedZedZdZ ddZ!RS(sY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.0. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. icCsdt||_t|j|_t|j||_|j|kr`d}tjj |ndS(Ns.No suitable Microsoft Visual C++ version found( R=RURTRzRwtsiR|RRR(RBR%R|R*R((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCIs cCs |jjS(s/ Microsoft Visual C++ version. (RR|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR|RscCsddg}|jdkrd|jjdtdt}|dg7}|dg7}|d|g7}ng|D]!}tjj|jj|^qkS( s/ Microsoft Visual Studio Tools s Common7\IDEs Common7\Toolsg,@RIR?s1Common7\IDE\CommonExtensions\Microsoft\TestWindowsTeam Tools\Performance ToolssTeam Tools\Performance Tools%s( R|RURJRoRRRRR(RBtpathst arch_subdirR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVSToolsYs   cCs4tjj|jjdtjj|jjdgS(sL Microsoft Visual C++ & Microsoft Foundation Class Includes tIncludesATLMFC\Include(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCIncludeshscCs|jdkr'|jjdt}n|jjdt}d|d|g}|jdkrs|d|g7}ng|D]!}tjj|jj|^qzS(sM Microsoft Visual C++ & Microsoft Foundation Class Libraries g.@R?RIsLib%ss ATLMFC\Lib%sg,@s Lib\store%s( R|RURKRoRRRRR(RBRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCLibrariespscCs/|jdkrgStjj|jjdgS(sA Microsoft Visual C++ store references Libraries g,@sLib\store\references(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCStoreRefsscCs|j}tjj|jdg}|jdkr9tnt}|jj |}|r}|tjj|jd|g7}n|jdkrd|jj dt}|tjj|j|g7}n|jdkrs|jj rdnd}|tjj|j||jj d tg7}|jj |jjkr|tjj|j||jj d tg7}qn|tjj|jd g7}|S( s, Microsoft Visual C++ Tools t VCPackagesg$@sBin%sg,@RIg.@s bin\HostX86%ss bin\HostX64%sR?tBin(RRRRRR|RoRSRURNRJRHRKRGRE(RBRttoolsRLRRthost_dir((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVCToolss& &" & ,cCs|jdkrJ|jjdtdt}tjj|jjd|gS|jjdt}tjj|jjd}|j }tjj|d||fgSdS(s1 Microsoft Windows SDK Libraries g$@RIR?sLib%sRs%sum%sN( R|RURKRoRRRRRt _sdk_subdir(RBRRtlibver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSLibrariess  cCstjj|jjd}|jdkrC|tjj|dgS|jdkr^|j}nd}tjj|d|tjj|d|tjj|d|gSd S( s/ Microsoft Windows SDK Include tincludeg$@tglg,@R s%sshareds%sums%swinrtN(RRRRRR|R(RBRtsdkver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSIncludess cCstjj|jjd}g}|jdkr@||j7}n|jdkrn|tjj|dg7}n|jdkr||tjj|jjdtjj|ddtjj|d dtjj|d dtjj|jjd d d |jdddg7}n|S(s7 Microsoft Windows SDK Libraries Paths t Referencesg"@g&@sCommonConfiguration\Neutralg,@t UnionMetadatas'Windows.Foundation.UniversalApiContracts1.0.0.0s%Windows.Foundation.FoundationContracts,Windows.Networking.Connectivity.WwanContractt ExtensionSDKssMicrosoft.VCLibss%0.1ftCommonConfigurationtneutral(RRRRRR|R(RBtreftlibpath((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSLibpaths>      cCst|jS(s- Microsoft Windows SDK Tools (tlistt _sdk_tools(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytSdkToolssccs|jdkrG|jdkr$dnd}tjj|jj|Vn|jjs|jjdt }d|}tjj|jj|Vn|jdks|jdkr |jj rd}n|jjd t dt }d |}tjj|jj|Vnl|jdkrvtjj|jjd}|jjdt }|jj }tjj|d ||fVn|jj r|jj Vnd S( s= Microsoft Windows SDK Tools paths generator g.@g&@RsBin\x86R?sBin%sg$@R RIsBin\NETFX 4.0 Tools%ss%s%sN( R|RRRRRRURHRJRoRFRR(RBtbin_dirRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs(    ! cCs|jj}|rd|SdS(s6 Microsoft Windows SDK version subdir s%s\R (RR(RBtucrtver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs cCs/|jdkrgStjj|jjdgS(s- Microsoft Windows SDK Setup g"@tSetup(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytSdkSetup%scCs|j}|j}|jdkrDt}|j o>|j }n6|jpY|j}|jdkpw|jdk}g}|r|g|jD]}t j j |j |^q7}n|r|g|j D]}t j j |j|^q7}n|S(s0 Microsoft .NET Framework Tools g$@R@(RURR|RoRFRHRGRERRRRRRR(RBRURt include32t include64RR$((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFxTools/s  //cCsU|jdks|jj r gS|jjdt}tjj|jjd|gS(s8 Microsoft .Net Framework SDK Libraries g,@R?slib\um%s( R|RRRURKRoRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytNetFxSDKLibrariesGscCs<|jdks|jj r gStjj|jjdgS(s7 Microsoft .Net Framework SDK Includes g,@s include\um(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytNetFxSDKIncludesRscCstjj|jjdgS(s> Microsoft Visual Studio Team System Database s VSTSDB\Deploy(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVsTDb\scCs|jdkrgS|jdkrF|jj}|jjdt}n|jj}d}d|j|f}tjj ||g}|jdkr|tjj ||dg7}n|S(s( Microsoft Build Engine g(@g.@RIR sMSBuild\%0.1f\bin%stRoslyn( R|RRRURJRoRRRR(RBt base_pathRRtbuild((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytMSBuildcs  "cCs/|jdkrgStjj|jjdgS(s. Microsoft HTML Help Workshop g&@sHTML Help Workshop(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytHTMLHelpWorkshopzscCsl|jdkrgS|jjdt}tjj|jjd}|j }tjj|d||fgS(s= Microsoft Universal C Runtime SDK Libraries g,@R?Rs%sucrt%s( R|RURKRoRRRRRt _ucrt_subdir(RBRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt UCRTLibrariess  cCsK|jdkrgStjj|jjd}tjj|d|jgS(s; Microsoft Universal C Runtime SDK Include g,@Rs%sucrt(R|RRRRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt UCRTIncludesscCs|jj}|rd|SdS(sB Microsoft Universal C Runtime SDK version subdir s%s\R (RR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs cCs,|jdkr"|jdkr"gS|jjS(s% Microsoft Visual F# g&@g(@(R|RR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFSharpscCs|jjdt}|jdkr9|jj}d}n|jjjdd}d}|jdkrldn|j}|||j|f}tjj ||S(sA Microsoft Visual C++ runtime redistribuable dll R?is-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dlls\Toolss\Redists.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@( RURKRoR|RRRARRR(RBRt redist_patht vcruntimetdll_ver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVCRuntimeRedists  cCstd|jd|j|j|j|jg|d|jd|j|j|j|j |j g|d|jd|j|j|j |j g|d|jd|j |j|j|j|j|j|j|j|jg |}|jdkrtjj|jr|j|d A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N(tsettaddRRt __contains__(RBtiterableRtseentseen_addtelementtk((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs         N("RRRORRCRRR|RRRRRRRRRRRRRRRRRRRRRRRRoR"RR(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR!1s:   -         - (!RORR-tplatformR tdistutils.errorsRt#setuptools.extern.packaging.versionRtsetuptools.extern.six.movesRtmonkeyRtsystemRtenvironRPRt ImportErrorRRt_msvc9_suppress_errorstdistutils.msvc9compilerR RRR+R3R#R=RTRwR!(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyts:         + / & %[aPK!Dm. . py36compat.pyonu[ fc@sddlZddlmZddlmZddlmZdd dYZejd krtdd dYZne rdd d YZndS(iN(tDistutilsOptionError(t strtobool(tDEBUGtDistribution_parse_config_filescBseZdZddZRS(s Mix-in providing forward-compatibility for functionality to be included by default on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. c CsHddlm}tjtjkrRddddddd d d d d ddg }ng}t|}|dkr|j}ntr|j dn|dd}x|D]}tr|j d|n|j |x|j D]}|j |}|j |}x]|D]U} | dkr| |kr|j|| } | jdd} || f|| s APK!kBB version.pycnu[ fc@s@ddlZyejdjZWnek r;dZnXdS(iNt setuptoolstunknown(t pkg_resourcestget_distributiontversiont __version__t Exception(((s6/usr/lib/python2.7/site-packages/setuptools/version.pyts  PK!q q extern/__init__.pyonu[ fc@s?ddlZdddYZd ZeeedjdS( iNtVendorImportercBsJeZdZdddZedZddZdZdZ RS(s A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. cCs7||_t||_|p-|jdd|_dS(Ntexternt_vendor(t root_nametsettvendored_namestreplacet vendor_pkg(tselfRRR((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt__init__ s ccs|jdVdVdS(sL Search first the vendor package then as a natural package. t.tN(R(R((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt search_paths cCsL|j|jd\}}}|r)dStt|j|jsHdS|S(s Return self when fullname starts with root_name and the target module is one vendored through this importer. R N(t partitionRtanytmapt startswithR(Rtfullnametpathtroottbasettarget((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt find_modules cCs|j|jd\}}}x|jD]l}yR||}t|tj|}|tj|/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt load_module#s      cCs&|tjkr"tjj|ndS(sR Install this importer into sys.meta_path if not already present. N(Rt meta_pathtappend(R((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pytinstall@s(N( t__name__t __module__t__doc__tNoneR tpropertyR RR!R$(((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyRs  tsixt packagingt pyparsingssetuptools._vendor((R*R+R,(RRtnamesR%R$(((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyts DPK!q q extern/__init__.pycnu[ fc@s?ddlZdddYZd ZeeedjdS( iNtVendorImportercBsJeZdZdddZedZddZdZdZ RS(s A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. cCs7||_t||_|p-|jdd|_dS(Ntexternt_vendor(t root_nametsettvendored_namestreplacet vendor_pkg(tselfRRR((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt__init__ s ccs|jdVdVdS(sL Search first the vendor package then as a natural package. t.tN(R(R((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt search_paths cCsL|j|jd\}}}|r)dStt|j|jsHdS|S(s Return self when fullname starts with root_name and the target module is one vendored through this importer. R N(t partitionRtanytmapt startswithR(Rtfullnametpathtroottbasettarget((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt find_modules cCs|j|jd\}}}x|jD]l}yR||}t|tj|}|tj|/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyt load_module#s      cCs&|tjkr"tjj|ndS(sR Install this importer into sys.meta_path if not already present. N(Rt meta_pathtappend(R((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pytinstall@s(N( t__name__t __module__t__doc__tNoneR tpropertyR RR!R$(((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyRs  tsixt packagingt pyparsingssetuptools._vendor((R*R+R,(RRtnamesR%R$(((s>/usr/lib/python2.7/site-packages/setuptools/extern/__init__.pyts DPK!j! __init__.pyonu[ fc@sdZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl ZddlmZddlmZmZddlmZd d lmZd d d ddddgZejjZdZeZdgZde fdYZ!de!fdYZ"e!j#Z$dZ%dZ&ej'j&je&_ej(ej'j)Z*de*fdYZ)dZ+ej,dZ-ej.dS(s@Extensions to the 'distutils' for large or complex distributionsiN(t convert_path(t fnmatchcase(tfiltertmap(t Extension(t DistributiontFeature(tRequirei(tmonkeytsetupRRtCommandRRt find_packagess lib2to3.fixest PackageFindercBsSeZdZeddddZedZedZedZRS( sI Generate a list of all Python packages found within a directory t.t*cCs7t|jt||jdd||j|S(s Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. tez_setups *__pycache__(tlistt_find_packages_iterRt _build_filter(tclstwheretexcludetinclude((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytfind's  c csxtj|dtD]\}}}|}g|(x|D]}tjj||} tjj| |} | jtjjd} d|ks:|j|  rq:n|| r||  r| Vn|j |q:WqWdS(sy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. t followlinksR N( tostwalktTruetpathtjointrelpathtreplacetsept_looks_like_packagetappend( RRRRtroottdirstfilestall_dirstdirt full_pathtrel_pathtpackage((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR>s% cCstjjtjj|dS(s%Does a directory look like a package?s __init__.py(RRtisfileR(R((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR!Zscs fdS(s Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfdDS(Nc3s!|]}td|VqdS(tpatN(R(t.0R,(tname(s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys es(tany(R.(tpatterns(R.s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytet((R0((R0s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR_s((R( t__name__t __module__t__doc__t classmethodRRt staticmethodR!R(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR "s tPEP420PackageFindercBseZedZRS(cCstS(N(R(R((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR!is(R3R4R7R!(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR8hscCsXtjjtd|jD}|jdt|jrT|j|jndS(Ncss-|]#\}}|dkr||fVqdS(tdependency_linkstsetup_requiresN(R9R:((R-tktv((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys us tignore_option_errors( t distutilstcoreRtdicttitemstparse_config_filesRR:tfetch_build_eggs(tattrstdist((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyt_install_setup_requiresqs   cKst|tjj|S(N(RFR>R?R (RD((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR ~s cBs,eZejZeZdZddZRS(cKs'tj||t|j|dS(sj Construct the command for dist, updating vars(self) with any keyword parameters. N(t_Commandt__init__tvarstupdate(tselfREtkw((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyRHsicKs,tj|||}t|j||S(N(RGtreinitialize_commandRIRJ(RKtcommandtreinit_subcommandsRLtcmd((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyRMs(R3R4RGR5tFalsetcommand_consumes_argumentsRHRM(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR s  cCs2dtj|dtD}ttjj|S(s% Find all files under 'path' css:|]0\}}}|D]}tjj||VqqdS(N(RRR(R-tbaseR$R%tfile((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys s R(RRRRRR+(Rtresults((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyt_find_all_simplescCsRt|}|tjkrHtjtjjd|}t||}nt|S(s Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. tstart( RVRtcurdirt functoolstpartialRRRR(R'R%tmake_rel((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytfindalls  (/R5RRYtdistutils.coreR>tdistutils.filelisttdistutils.utilRtfnmatchRtsetuptools.extern.six.movesRRtsetuptools.versiont setuptoolstsetuptools.extensionRtsetuptools.distRRtsetuptools.dependsRR2Rt__all__tversiont __version__tNonetbootstrap_install_fromRtrun_2to3_on_docteststlib2to3_fixer_packagestobjectR R8RR RFR R?t get_unpatchedR RGRVRXR\t patch_all(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyts:        F    PK!jKglob.pycnu[ fc@sdZddlZddlZddlZddlmZdddgZedZedZ d Z d Z d Z d Z d ZejdZejdZdZdZdZdS(s Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. iN(t binary_typetglobtiglobtescapecCstt|d|S(syReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. t recursive(tlistR(tpathnameR((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs cCsAt||}|r=t|r=t|}| s=tn|S(sReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. (t_iglobt _isrecursivetnexttAssertionError(RRtitts((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR s  ccsntjj|\}}t|se|rGtjj|ra|Vqantjj|ra|VndS|s|rt|rx>t||D] }|VqWnxt||D] }|VqWdS||krt|rt ||}n |g}t|r%|rt|rt}q+t}nt }x<|D]4}x+|||D]}tjj ||VqHWq2WdS(N( tostpathtsplitt has_magictlexiststisdirRtglob2tglob1Rtglob0tjoin(RRtdirnametbasenametxtdirst glob_in_dirtname((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR2s4         cCsn|s6t|tr*tjjd}q6tj}nytj|}Wntk r]gSXtj||S(NtASCII( t isinstanceRR tcurdirtencodetlistdirtOSErrortfnmatchtfilter(Rtpatterntnames((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR]s  cCsN|s"tjj|rJ|gSn(tjjtjj||rJ|gSgS(N(R RRRR(RR((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRjs  !ccs;t|st|d Vxt|D] }|Vq(WdS(Ni(RR t _rlistdir(RR%R((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRzs ccs|s6t|tr*ttjd}q6tj}nytj|}Wntjk r`dSXx_|D]W}|V|rtjj||n|}x(t|D]}tjj||VqWqhWdS(NR( RRR RR!terrorRRR'(RR&RRty((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR's  !s([*?[])cCs:t|tr!tj|}ntj|}|dk S(N(RRtmagic_check_bytestsearcht magic_checktNone(R tmatch((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRscCs't|tr|dkS|dkSdS(Ns**(RR(R%((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs cCsVtjj|\}}t|tr<tjd|}ntjd|}||S(s#Escape all special characters. s[\1](R Rt splitdriveRRR*tsubR,(Rtdrive((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs (t__doc__R treR#tsetuptools.extern.sixRt__all__tFalseRRRRRRR'tcompileR,R*RRR(((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyts"      +     PK!I ??package_index.pyonu[ fc@s~dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z ddlm!Z!ddl"m#Z#dd l$m%Z%dd l&m'Z'dd l(m)Z)dd l*m+Z+dd l,m-Z-ej.dZ/ej.dej0Z1ej.dZ2ej.dej0j3Z4dj5Z6ddddgZ7dZ8dZ9e9j:dej;d deZ<dZ=dZ>dZ?e@dZAe@d ZBe@d!ZCe@ee@d"ZDe@d#ZEd$ZFej.d%ej0ZGeFd&ZHd'eIfd(YZJd)eJfd*YZKdefd+YZLej.d,jMZNd-ZOd.ZPdd/ZQd0ZRd1eIfd2YZSd3ejTfd4YZUejVjWd5ZXeQe8eXZXd6ZYd7ZZdS(8s#PyPI and direct package downloadingiN(twraps(tsix(turllibt http_clientt configparsertmap( t CHECKOUT_DISTt Distributiont BINARY_DISTtnormalize_patht SOURCE_DISTt Environmenttfind_distributionst safe_namet safe_versiont to_filenamet Requirementt DEVELOP_DISTtEGG_DIST(t ssl_support(tlog(tDistutilsError(t translate(tget_all_headers(tunescape(tWheels^egg=([-A-Za-z0-9_.+!]+)$shref\s*=\s*['"]?([^'"> ]+)s([^<]+) \s+\(md5\)s([-+.a-z0-9]{2,}):s.tar.gz .tar.bz2 .tar .zip .tgzt PackageIndextdistros_for_urltparse_bdist_wininsttinterpret_distro_nameis<setuptools/{setuptools.__version__} Python-urllib/{py_major}tpy_majorit setuptoolscCs<ytj|SWn$tk r7td|fnXdS(Ns1Not a URL, existing file, or requirement spec: %r(Rtparset ValueErrorR(tspec((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytparse_requirement_arg2s  cCs|j}d\}}}|jdr|jdrL|d }d}q|jddr~|dd!}|d }d}q|jd r|d }d }q|jd d r|dd!}|d }d }qn|||fS(s=Return (base,pyversion) or (None,None) for possible .exe names.exes .win32.exeitwin32s .win32-pyiiis.win-amd64.exeis win-amd64s .win-amd64-pyiN(NNN(tlowertNonetendswitht startswith(tnameR%tbasetpy_vertplat((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR;s$           c Cstjj|}|\}}}}}}tjj|jdd}|dkr|dkrtjj|jdd}nd|kr|jdd\}}n||fS(Nt/issourceforge.nettdownloadit#i(RR turlparsetunquotetsplit( turltpartstschemetservertpatht parameterstquerytfragmentR*((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytegg_info_for_urlSs" ccst|\}}xt|||D] }|Vq%W|rtj|}|rx1t||jd|dtD] }|VqqWqndS(sEYield egg or source distribution objects that might be found at a URLit precedenceN(R;tdistros_for_locationt EGG_FRAGMENTtmatchRtgroupR(R3tmetadataR*R:tdistR?((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR^s "c CsA|jdr|d }n|jdrMd|krMtj|||gS|jdrd|krt|}|jsgStd|d|jd|jd td gS|jd rt|\}}}|d k rt ||||t |Snx>t D]6}|j|r|t | }t |||SqWgS( s:Yield egg or source distribution objects based on basenames.egg.zipis.eggt-s.whltlocationt project_nametversionR<is.exeN(R'Rt from_locationRt is_compatibleRERFRRR&RRt EXTENSIONStlen(RDtbasenameRAtwheeltwin_baseR+tplatformtext((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR=ls.       cCs"tt|tjj||S(sEYield possible egg or source distribution objects based on a filename(R=R tosR7RK(tfilenameRA((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytdistros_for_filenamesc cs|jd}| r4td|dDr4dSxatdt|dD]F}t||dj|| dj||d|d|d|VqNWdS( sGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! RCcss!|]}tjd|VqdS(s py\d\.\d$N(treR?(t.0tp((s</usr/lib/python2.7/site-packages/setuptools/package_index.pys siNit py_versionR<RN(R2tanytrangeRJRtjoin(RDRKRARVR<RNR4RU((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs! ) ccst}|j}|dkrSxmtjj|j|D]}|||Vq7Wn;x8|D]0}||}||krZ|||VqZqZWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(tsettaddR&Rtmovest filterfalset __contains__(titerabletkeytseentseen_addtelementtk((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytunique_everseens         cstfd}|S(ss Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S(N(Re(targstkwargs(tfunc(s</usr/lib/python2.7/site-packages/setuptools/package_index.pytwrappers(R(RhRi((Rhs</usr/lib/python2.7/site-packages/setuptools/package_index.pyt unique_valuesss3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>ccsxtj|D]}|j\}}tttj|jjd}d|ksgd|krx=t j|D])}t j j |t |jdVqwWqqWxjd D]b}|j|}|dkrt j||}|rt j j |t |jdVqqqWdS( sEFind rel="homepage" and rel="download" links in `page`, yielding URLst,thomepageR.is Home PagesDownload URLiN(s Home PagesDownload URL(tRELtfinditertgroupsRZRtstrtstripR%R2tHREFRR turljoint htmldecodeR@tfindtsearch(R3tpageR?ttagtreltrelstpos((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfind_external_linkss'.  tContentCheckercBs)eZdZdZdZdZRS(sP A null content checker that defines the interface for checking content cCsdS(s3 Feed a block of data to the hash. N((tselftblock((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfeedscCstS(sC Check the hash. Return False if validation fails. (tTrue(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytis_validscCsdS(su Call reporter with information about the checker (hash name) substituted into the template. N((R~treporterttemplate((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytreports(t__name__t __module__t__doc__RRR(((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR}s  t HashCheckercBsJeZejdZdZedZdZdZ dZ RS(sK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs(||_tj||_||_dS(N(t hash_namethashlibtnewthashtexpected(R~RR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt__init__ s cCsRtjj|d}|s#tS|jj|}|sBtS||jS(s5Construct a (possibly null) ContentChecker from a URLi(RR R0R}tpatternRvt groupdict(tclsR3R:R?((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfrom_urlscCs|jj|dS(N(Rtupdate(R~R((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscCs|jj|jkS(N(Rt hexdigestR(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR scCs||j}||S(N(R(R~RRtmsg((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR#s ( RRRStcompileRRt classmethodRRRR(((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs    cBsveZdZdd%d&edZedZedZedZ dZ dZ d Z d Z d&d Zd Zd&d ZdZdZdZdZdZeeed&dZeedZdZdZdZdZd&dZdZdZdZdZ dZ!e"edZ#d Z$d!Z%d"Z&d#Z'd$Z(RS('s;A distribution index that scans web pages for download URLsshttps://pypi.python.org/simplet*cOstj||||d|jd |_i|_i|_i|_tjdj t t |j |_ g|_|otjo|ptj}|rtj||_ntjj|_dS(NR-t|(R RR't index_urlt scanned_urlst fetched_urlst package_pagesRSRRYRRR?tallowstto_scanRt is_availabletfind_ca_bundlet opener_fortopenerRtrequestturlopen(R~Rthostst ca_bundlet verify_sslRftkwtuse_ssl((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR+s   '  c Csg||jkr| rdSt|j|s(tfilterRPR7RRt itertoolststarmapt scan_egg_link(R~t search_pathtdirst egg_links((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytscan_egg_linkss c Csttjj||(}ttdttj |}WdQXt |dkr[dS|\}}xQt tjj||D]4}tjj|||_ t |_|j|qWdS(Ni(topenRPR7RYRRR&RRpRqRJR RDR R<R[(R~R7Rt raw_linestlinestegg_patht setup_pathRB((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs' " c sfd}xWtj|D]F}y,|tjj|t|jdWqtk rdqXqW||\}}|rxyt||D]h}t |\}} |j dr| r|r|d||f7}qj |nj |qWt jd|SdSdS(s#Process the contents of a PyPI pagecs|jjrtttjj|tjjd}t|dkrd|dkrt |d}t |d}t j j |ji|%siii(R@(tm((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytRRN(RrRnRR RsRtR@R!R|R;R'tneed_version_infotscan_urltPYPI_MD5tsub( R~R3RwRR?RRtnew_urlR*tfrag((R~s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs$,  cCs|jd|dS(NsPPage at %s links to .py file(s) without version info; an index scan is required.(tscan_all(R~R3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscGsO|j|jkr;|r+|j||n|jdn|j|jdS(Ns6Scanning index of all packages (this may take a while)(RRRRR(R~RRf((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs  cCs|j|j|jd|jj|jsN|j|j|jdn|jj|jss|j|nx3t|jj|jdD]}|j|qWdS(NR-(( RRt unsafe_nameRRR`REtnot_found_in_indexR(R~t requirementR3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt find_packagess%cCsk|j|j|x8||jD])}||kr;|S|jd||q%Wtt|j||S(Ns%s does not match %s(tprescanRR`RtsuperRtobtain(R~Rt installerRB((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs   cCsi|j|jd||jse|jtj|td|jjtj j |fndS(s- checker is a ContentChecker sValidating %%s checksum for %ss7%s validation failed for %s; possible download problem?N( RRRRRPtunlinkRRR)R7RK(R~tcheckerRQttfp((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt check_hashs    cCsrxk|D]c}|jdksJt| sJ|jdsJtt|rZ|j|q|jj|qWdS(s;Add `urls` to the list that will be prescanned for searchessfile:N(RR&RR(RRRtappend(R~turlsR3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytadd_find_links s  cCs2|jr%tt|j|jnd|_dS(s7Scan urls scheduled for prescanning (e.g. --find-links)N(RRRRR&(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs cCsN||jr |jd}}n|jd}}|||j|jdS(Ns#Couldn't retrieve index page for %rs3Couldn't find index page for %r (maybe misspelled?)(R`RRRR(R~RtmethR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR!s   cCst|tst|}|r||j|jd||}t|\}}|jdrx|j|||}n|Stj j |r|St |}nt |j ||ddS(sLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. is.pyRDN(RRRt _download_urlR@R;R't gen_setupRPR7RR#Rtfetch_distributionR&(R~R"ttmpdirR5tfoundR*R:((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR.+s c sFjd|id}dfd}|rfjj|||}n| r|dk r|||}n|dkrjdk rjn||}n|dkr| rj|||}n|dkrjdrdpd|n#jd||jd|jSdS( s|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. sSearching for %scs|dkr}nx||jD]}|jtkrn rn|kr#jd|d|R?RR@R&RFRJRPR7RKtdirnameRYtsetuptools.command.easy_installRtshutiltcopy2RtwriteREtsplitextR( R~RQR:RR?tdRRKtdstRR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs24 !!i c Cs|jd|d}zXtj|}|j|}t|tjjrnt d||j |j fn|j}d}|j }d}d|krt |d} ttt| }|j|||||nt|d}} x`trO|j|} | rK|j| | j| |d7}|j|||||qPqW|j||| WdQX|SWd|r|jnXdS( NsDownloading %ssCan't download %s: %s %siiscontent-lengthsContent-Lengthtwbi(RR&RRRRRRRRRRt dl_blocksizeRtmaxRtintt reporthookRRRRRRR( R~R3RQtfpRRtblocknumtbstsizetsizesRR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt _download_tos:       cCsdS(N((R~R3RQR!tblksizeR#((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscCs|jdrt|Syt||jSWnsttjfk r}djg|jD]}t |^qX}|r|j ||qt d||fnt j jk r}|St j jk r }|r|j ||jqt d||jfntjk rU}|r9|j ||jqt d||jfnNtjtj fk r}|r|j ||qt d||fnXdS(Nsfile:t s%s %ssDownload error for %s: %ss;%s returned a bad status line. The server might be down, %s(R(t local_opentopen_with_authRR!Rt InvalidURLRYRfRpRRRRRtURLErrortreasont BadStatusLinetlinet HTTPExceptiontsocket(R~R3twarningtvtargR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs6 +cCsHt|\}}|rLx7d|krH|jddjdd}qWnd}|jdrn|d }ntjj||}|dks|jd r|j||S|d ks|jd r|j||S|jd r|j ||S|d kr$t j j t j j|dS|j|t|j||SdS(Ns..t.s\t_t__downloaded__s.egg.zipitsvnssvn+tgitsgit+shg+Ri(R;treplaceR'RPR7RYR(t _download_svnt _download_gitt _download_hgRRt url2pathnameR R0RRt_attempt_download(R~R5R3RR)R:RQ((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs$%   cCs|j|tdS(N(RR(R~R3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR8scCsK|j||}d|jddjkrC|j|||S|SdS(NRs content-typeR(R%RR%t_download_html(R~R3RQR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR>;scCst|}xW|D]O}|jrtjd|r^|jtj||j||SPqqW|jtj|td|dS(Ns ([^- ]+ - )?Revision \d+:s���Unexpected HTML page found at ( ���R���Rq���RS���Rv���R���RP���R���R:��R���(���R~���R3���R���RQ���R���R.��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR?��B��s����       c���������C���sl��|�j��d�d��d�}�d�}�|�j���j�d��r;d�|�k�r;t�j�j�|��\�}�}�}�}�}�} �|� r;|�j�d��r;d�|�d �k�r;|�d �j��d�d��\�}�}�t�j�j�|��\�} �} �| �r8d �| �k�r�| �j��d �d��\�} �} �d �| �| �f�}�n �d �| �}�| �}�|�|�|�|�|�| �f�}�t�j�j�|��}�q8q;n��|��j�d �|�|��t �j �d�|�|�|�f��|�S(���NR/���i���i����R���s���svn:t���@s���//R-���i���t���:s��� --username=%s --password=%ss ��� --username=s'���Doing subversion checkout from %s to %ss���svn checkout%s -q %s %s( ���R2���R%���R(���R���R ���R0���t ���splitusert ���urlunparseR���RP���t���system(���R~���R3���RQ���t���credsR5���t���netlocR7���RU���t���qR���t���autht���hostt���usert���pwR4���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR:��Q��s$����!$&  c���������C���s���t��j�j�|���\�}�}�}�}�}�|�j�d�d��d�}�|�j�d�d��d�}�d��}�d�|�k�rz�|�j�d�d��\�}�}�n��t��j�j�|�|�|�|�d�f��}��|��|�f�S(���Nt���+i���iR/���i����R@��R���(���R���R ���t���urlsplitR2���R&���t���rsplitt ���urlunsplit(���R3���t ���pop_prefixR5���RF��R7���R9���R���t���rev(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���_vcs_split_rev_from_urlf��s����! !c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RP��s���Doing git clone from %s to %ss���git clone --quiet %s %ss���Checking out %ss"���(cd %s && git checkout --quiet %s)(���R2���RR��R���R���RP���RD��R&���(���R~���R3���RQ���RQ��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR;��x��s����  c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RP��s���Doing hg clone from %s to %ss���hg clone --quiet %s %ss���Updating to %ss���(cd %s && hg up -C -r %s -q)(���R2���RR��R���R���RP���RD��R&���(���R~���R3���RQ���RQ��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR<����s����  c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����(���R���N()���R���R���R���R&���R���R���t���FalseR���R���R���R���R���R���R���R���R���R���R���R���R���R���R.���R��R��R��R��R%��R��R���R���R���R>��R?��R:��t ���staticmethodRR��R;��R<��R���R���R���(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR���(��sL��� 3   +      #J ) $  #         s!���&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c���������C���s���|��j��d��}�t�|��S(���Ni���(���R@���R���(���R?���t���what(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���decode_entity��s����c���������C���s ���t��t�|���S(���s'���Decode HTML entities in the given text.(���t ���entity_subRV��(���t���text(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRt�����s����c������������s�����f�d���}�|�S(���Nc������������s������f�d���}�|�S(���Nc�������������s?���t��j���}�t��j���z���|��|���SWd��t��j�|��Xd��S(���N(���R0��t���getdefaulttimeoutt���setdefaulttimeout(���Rf���Rg���t ���old_timeout(���Rh���t���timeout(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���_socket_timeout��s ����  (����(���Rh���R]��(���R\��(���Rh���s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR]����s����(����(���R\��R]��(����(���R\��s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���socket_timeout��s���� c���������C���sI���t��j�j�|���}�|�j���}�t�j�|��}�|�j���}�|�j�d�d��S(���sq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False s��� R���(���R���R ���R1���t���encodet���base64t ���encodestringR���R9��(���RH��t���auth_st ���auth_bytest ���encoded_bytest���encoded(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���_encode_auth��s ����   t ���Credentialc�����������B���s)���e��Z�d��Z�d���Z�d���Z�d���Z�RS(���s:��� A username/password pair. Use like a namedtuple. c���������C���s���|�|��_��|�|��_�d��S(���N(���t���usernamet���password(���R~���Rh��Ri��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s���� c���������c���s���|��j��V|��j�Vd��S(���N(���Rh��Ri��(���R~���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���__iter__��s����c���������C���s���d�t��|���S(���Ns���%(username)s:%(password)s(���t���vars(���R~���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���__str__��s����(���R���R���R���R���Rj��Rl��(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRg����s���  t ���PyPIConfigc�����������B���s2���e��Z�d����Z�e�d����Z�d���Z�d���Z�RS(���c���������C���su���t��j�d�d�d�g�d��}�t�j�j�|��|��t�j�j�t�j�j�d��d��}�t�j�j �|��rq�|��j �|��n��d�S(���s%��� Load from ~/.pypirc Rh��Ri��t ���repositoryR���t���~s���.pypircN( ���t���dictt���fromkeysR���t���RawConfigParserR���RP���R7���RY���t ���expanduserR���R���(���R~���t���defaultst���rc(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s ����!c���������C���sM���g��|��j����D]$�}�|��j�|�d��j���r �|�^�q �}�t�t�|��j�|���S(���NRn��(���t���sectionsR���Rq���Rp��R���t���_get_repo_cred(���R~���t���sectiont���sections_with_repositories(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���creds_by_repository��s����$c���������C���sO���|��j��|�d��j���}�|�t�|��j��|�d��j���|��j��|�d��j����f�S(���NRn��Rh��Ri��(���R���Rq���Rg��(���R~���Rx��t���repo(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRw����s����c���������C���s7���x0�|��j��j���D]�\�}�}�|�j�|��r�|�Sq�Wd�S(���s��� If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N(���Rz��t���itemsR(���(���R~���R3���Rn��t���cred(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���find_credential��s����(���R���R���R���t���propertyRz��Rw��R~��(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRm����s���  c���������C���s��t��j�j�|���\�}�}�}�}�}�}�|�j�d��rE�t�j�d���n��|�d �k�rl�t��j�j�|��\�}�} �n�d �}�|�s�t���j �|���} �| �r�t �| ��}�| �j �|��f�} �t �j �d�| ��q�n��|�r&d�t�|��}�|�| �|�|�|�|�f�} �t��j�j�| ��} �t��j�j�| ��}�|�j�d�|��n�t��j�j�|���}�|�j�d�t��|�|��}�|�rt��j�j�|�j��\�}�}�}�}�}�}�|�|�k�r|�| �k�r|�|�|�|�|�|�f�} �t��j�j�| ��|�_�qn��|�S( ���s4���Open a urllib2 request, handling HTTP authenticationRA��s���nonnumeric port: ''t���httpt���httpss*���Authenticating as %s for %s (from .pypirc)s���Basic t ���Authorizations ���User-Agent(���R��R��N(���R���R ���R0���R'���R���R*��RB��R&���Rm��R~��Rp���Rh��R���R���Rf��RC��R���t���Requestt ���add_headert ���user_agentR3���(���R3���R���R5���RF��R7���t���paramsR9���R���RH��RI��R}��R���R4���R���R���R ��t���s2t���h2t���path2t���param2t���query2t���frag2(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR)����s6����$   'c���������C���s���|��S(���N(����(���R3���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���fix_sf_url?��s����c���������C���s��t��j�j�|���\�}�}�}�}�}�}�t��j�j�|��}�t�j�j�|��rX�t��j�j�|���S|�j �d��rPt�j�j �|��rPg��}�x�t�j �|��D]�} �t�j�j �|�| ��} �| �d�k�r�t �| �d���} �| �j���} �Wd�QXPn�t�j�j �| ��r�| �d�7} �n��|�j�d�j�d�| ���q�Wd�} �| �j�d�|��d �d �j �|���} �d�\�}�}�n�d�\�}�}�} �i�d�d�6}�t�j�| ��}�t��j�j�|��|�|�|�|��S(���s7���Read a local path, with special support for directoriesR-���s ���index.htmlt���rNs���<a href="{name}">{name}</a>R)���sB���<html><head><title>{url}{files}R3tfiless itOKisPath not founds Not founds text/htmls content-type(iR(isPath not founds Not found(RR R0RR=RPR7tisfileRR'RRRYRRRtformatRtStringIORR(R3R5R6R7tparamR9RRQRRtfilepathR tbodyRtstatustmessageRt body_stream((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR(Cs,$!  ! ([RtsysRPRSRR0R`RRt functoolsRtsetuptools.externRtsetuptools.extern.six.movesRRRRRt pkg_resourcesRRRR R R R R RRRRRRt distutilsRtdistutils.errorsRtfnmatchRtsetuptools.py27compatRtsetuptools.py33compatRtsetuptools.wheelRRR>tIRrRR?RR2RIt__all__t_SOCKET_TIMEOUTt_tmplRRFRR#RR;R&RR=RRRReRjRmR|tobjectR}RRRRWRVRtR^RfRgRrRmRRR)RR((((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytsv        " X       !  "  !~    &. PK!Oxarchive_util.pycnu[ fc@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ d efd YZ d Z e ddZe dZe dZe dZeeefZdS(s/Utilities for extracting common archive formatsiN(tDistutilsError(tensure_directorytunpack_archivetunpack_zipfiletunpack_tarfiletdefault_filtertUnrecognizedFormattextraction_driverstunpack_directorycBseZdZRS(s#Couldn't recognize the archive type(t__name__t __module__t__doc__(((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRscCs|S(s@The default progress/filter callback; returns True for all files((tsrctdst((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRscCsZxS|p tD]5}y||||Wntk r=q q XdSq Wtd|dS(sUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Ns!Not a recognized archive type: %s(RR(tfilenamet extract_dirtprogress_filtertdriverstdriver((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRs c Cs:tjj|s%td|nid|f|6}xtj|D]\}}}||\}}xD|D]<} || dtjj|| f|tjj|| RRs..iN(ttarfileR-tTarErrorRt contextlibtclosingtchownR3R)R*RRRR6tislnktissymtlinknamet posixpathtdirnametnormpatht _getmembertisfileRR+tsept_extract_membert ExtractErrortTrue( RRRttarobjtmemberR3t prelim_dsttlinkpathRt final_dst((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyRs8   %'  $ (R R%R9RRRAR;tdistutils.errorsRt pkg_resourcesRt__all__RRR6RRRRR(((s;/usr/lib/python2.7/site-packages/setuptools/archive_util.pyts$         "  % .PK!qzdist.pyonu[ fc@sKdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl m Z ddl mZmZmZddlmZddlmZddlmZddlmZdd lmZmZmZdd lmZdd lmZdd l m!Z!dd l"m#Z#ddl$Z$ddl%m&Z&e'de'ddZ(dZ)dZ*dZ+e,e-fZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8d Z9d!Z:e!ej;j<Z=de&e=fd"YZ<d#fd$YZ>dS(%t DistributioniN(t defaultdict(tDistutilsOptionErrortDistutilsPlatformErrortDistutilsSetupError(t rfc822_escape(t StrictVersion(tsix(t packaging(tmaptfiltert filterfalse(tRequire(twindows_support(t get_unpatched(tparse_configurationi(tDistribution_parse_config_filess&setuptools.extern.packaging.specifierss#setuptools.extern.packaging.versioncCstjdtt|S(NsDo not call this function(twarningstwarntDeprecationWarningR(tcls((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_get_unpatched#scCs|js|jrtdS|jdk sR|jdk sRt|dddk r\tdS|js|js|j s|j s|j rtdStdS(Ns2.1tpython_requiress1.2s1.1s1.0( tlong_description_content_typetprovides_extrasRt maintainertNonetmaintainer_emailtgetattrtprovidestrequirest obsoletest classifierst download_url(tdist_md((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytget_metadata_version(s   c Cst|}|jd||jd|j|jd|j|jd|j|jd|j|tdkr|jd|j|jd|jnyd#d$d%d&f}xd|D]\\}}t ||}t j r |j |}n|d"k r|jd||fqqW|jd|j|jrl|jd|jnx(|jjD]}|jd|q|Wt|j}|jd|dj|j} | r|jd| n|tdkr&xA|jD]} |jd| qWn|j|d|j|j|d|j|j|d|j|j|d|j|j|d|jt|dr|jd|jn|jr|jd |jn|jrx%|jD]} |jd!| qWnd"S('s5Write the PKG-INFO format data to a file object. sMetadata-Version: %s s Name: %s s Version: %s s Summary: %s sHome-page: %s s1.2s Author: %s sAuthor-email: %s tAuthortauthors Author-emailt author_emailt MaintainerRsMaintainer-emailRs%s: %s s License: %s sDownload-URL: %s sProject-URL: %s, %s sDescription: %s t,s Keywords: %s s Platform: %s tPlatformt ClassifiertRequirestProvidest ObsoletesRsRequires-Python: %s sDescription-Content-Type: %s sProvides-Extra: %s N(R$R%(s Author-emailR&(R'R(sMaintainer-emailR( R#twritetget_namet get_versiontget_descriptiontget_urlRt get_contacttget_contact_emailRRtPY2t _encode_fieldRt get_licenseR!t project_urlstitemsRtget_long_descriptiontjoint get_keywordst get_platformst _write_listtget_classifierst get_requirest get_providest get_obsoletesthasattrRRR( tselftfiletversiontoptional_fieldstfieldtattrtattr_valt project_urlt long_desctkeywordstplatformtextra((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytwrite_pkg_file7s\       cCs>ttjj|dddd}|j|WdQXdS(s3Write the PKG-INFO file into the release tree. sPKG-INFOtwtencodingsUTF-8N(topentostpathR;RP(RDtbase_dirtpkg_info((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytwrite_pkg_infos cCsTytjjd|}Wn3ttttfk rOtd||fnXdS(Nsx=s4%r must be importable 'module:attrs' string (got %r)(t pkg_resourcest EntryPointtparset TypeErrort ValueErrortAttributeErrortAssertionErrorR(tdistRItvaluetep((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_importablescCs>yWn3ttttfk r9td||fnXdS(s*Verify that value is a string list or Nones%%r must be a list of strings (got %r)N(R\R]R^R_R(R`RIRa((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytassert_string_lists cCs|}t|||xw|D]o}|j|sItdd|n|jd\}}}|r||krtjjd||qqWdS(s(Verify that namespace packages are valids1Distribution contains no modules or packages for snamespace package %rt.s^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN(Rdthas_contents_forRt rpartitiont distutilstlogR(R`RIRat ns_packagestnsptparenttseptchild((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt check_nsps  cCsMy ttjt|jWn&tttfk rHtdnXdS(s+Verify that extras_require mapping is valids'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N( tlistt itertoolststarmapt _check_extraR9R\R]R^R(R`RIRa((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt check_extrass  cCsW|jd\}}}|r@tj|r@td|nttj|dS(Nt:sInvalid environment marker: (t partitionRYtinvalid_markerRRptparse_requirements(ROtreqstnameRmtmarker((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRsscCs=t||kr9d}t|jd|d|ndS(s)Verify that value is True, False, 0, or 1s0{attr!r} must be a boolean value (got {value!r})RIRaN(tboolRtformat(R`RIRattmpl((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt assert_boolscCsy;ttj|t|ttfr:tdnWn=ttfk rz}d}t|j d|d|nXdS(s9Verify that install_requires is a valid requirements listsUnordered types are not allowedsm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}RIterrorN( RpRYRxt isinstancetdicttsetR\R]RR}(R`RIRaRR~((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_requirementsscCsXytjj|Wn=tjjk rS}d}t|jd|d|nXdS(s.Verify that value is a valid version specifiersF{attr!r} must be a string containing valid version specifiers; {error}RIRN(Rt specifierst SpecifierSettInvalidSpecifierRR}(R`RIRaRR~((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_specifiers cCs:ytjj|Wntk r5}t|nXdS(s)Verify that entry_points map is parseableN(RYRZt parse_mapR]R(R`RIRate((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_entry_pointsscCs%t|tjs!tdndS(Nstest_suite must be a string(RRt string_typesR(R`RIRa((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_test_suitescCs}t|trixW|jD]B\}}t|ts;Pnyt|Wqtk r]PqXqWdSnt|ddS(s@Verify that value is a dictionary of package names to glob listsNsI must be a dictionary mapping package names to lists of wildcard patterns(RRR9tstrtiterR\R(R`RIRatktv((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_package_datas  cCs=x6|D].}tjd|stjjd|qqWdS(Ns \w+(\.\w+)*s[WARNING: %r not a valid package name; please use only .-separated package names in setup.py(tretmatchRhRiR(R`RIRatpkgname((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_packagess   cBsLeZdZd"ZdZd"dZdZdZe dZ dZ dZ d"e dZd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'RS(#sDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. cCs| sd|ksd|kr#dStjt|dj}tjjj|}|dk r|jd rtj t|d|_ ||_ ndS(NRzRFsPKG-INFO( RYt safe_nameRtlowert working_settby_keytgetRt has_metadatat safe_versiont_versiont _patched_dist(RDtattrstkeyR`((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytpatch_missing_pkg_infoVscCsUt|d}|s!i|_n|p*i}d|ksEd|krRtjng|_i|_g|_|jdd|_ |j ||j di|_ |jdg|_ |jdg|_x0tjdD]}t|j|jdqWtj||t|jd|j |j_ |j d |j_t|jd t|j_t|jjtjrt|jj|j_n|jjdk rGyft jj!|jj}t|}|jj|kr t"j#d |jj|f||j_nWqGt jj$t%fk rCt"j#d |jjqGXn|j&dS( Nt package_datatfeaturestrequire_featurestsrc_rootR8tdependency_linkstsetup_requiressdistutils.setup_keywordsRRsNormalizing '%s' to '%s'sThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.('RCRtFeaturetwarn_deprecatedRRt dist_filestpopRRRRR8RRRYtiter_entry_pointstvarst setdefaultRzt _Distributiont__init__RtmetadataRRRRRFtnumberstNumberRRtVersionRRtInvalidVersionR\t_finalize_requires(RDRthave_package_dataRbtvertnormalized_version((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRcsP          cCst|ddr$|j|j_nt|ddrxI|jjD]5}|jdd}|rF|jjj|qFqFWn|j |j dS(s Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. Rtextras_requireRuiN( RRRRRtkeystsplitRtaddt_convert_extras_requirementst"_move_install_requirements_markers(RDRO((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCst|ddpi}tt|_xf|jD]X\}}|j|x>tj|D]-}|j|}|j||j |q[Wq4WdS(s Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. RN( RRRRpt_tmp_extras_requireR9RYRxt _suffix_fortappend(RDt spec_ext_reqstsectionRtrtsuffix((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCs|jrdt|jSdS(se For a requirement, return the 'extras_require' suffix for that requirement. Rut(R{R(treq((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRscsd}tddpd}ttj|}t||}t||}ttt|_ x/|D]'}j dt|j j |qsWt fdj jD_dS(sv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j S(N(R{(R((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt is_simple_reqstinstall_requiresRuc3sF|]<\}}|gtj|D]}t|^q%fVqdS(N(R t _clean_reqR(t.0RRR(RD(s3/usr/lib/python2.7/site-packages/setuptools/dist.pys sN((RRRpRYRxR R R RRRR{RRR9R(RDRtspec_inst_reqst inst_reqst simple_reqst complex_reqsR((RDs3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs  % cCs d|_|S(sP Given a Requirement, remove environment markers and return it. N(RR{(RDR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCs7tj|d|t||jd||jdS(sYParses configuration files from various levels and loads configuration. t filenamestignore_option_errorsN(Rtparse_config_filesRtcommand_optionsR(RDRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRscCs)tj|}|jr%|jn|S(s3Process features after parsing command line options(Rtparse_command_lineRt_finalize_features(RDtresult((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs  cCsd|jddS(s;Convert feature name to corresponding option attribute nametwith_t-t_(treplace(RDRz((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_feature_attrnamescCsUtjjtj|d|jdt}x$|D]}tjj|dtq1W|S(sResolve pre-setup requirementst installertreplace_conflictingR(RYRtresolveRxtfetch_build_eggtTrueR(RDRtresolved_distsR`((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytfetch_build_eggss    cCstj||jr#|jnxgtjdD]V}t||jd}|dk r3|j d|j |j ||j|q3q3Wt|ddrg|j D]}t jj|^q|_ n g|_ dS(Nsdistutils.setup_keywordsRtconvert_2to3_doctests(Rtfinalize_optionsRt_set_global_opts_from_featuresRYRRRzRtrequireRtloadRRTRUtabspath(RDRbRatp((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs     +cCstjjtjd}tjj|stj|tj|tjj|d}t|d.}|j d|j d|j dWdQXn|S(Ns.eggss README.txtRQscThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. sAThis directory caches those eggs to prevent repeated downloads. s/However, it is safe to delete this directory. ( RTRUR;tcurdirtexiststmkdirR t hide_fileRSR.(RDt egg_cache_dirtreadme_txt_filenametf((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytget_egg_cache_dirs    cCsddlm}|jidgd6}|jd}|j|jd|jdjD|jr|j}d|kr|dd|}nd|f|d0s Ritsetuptargstxt install_dirtexclude_scriptst always_copytbuild_directoryteditabletupgradet multi_versiont no_reporttuserN( tsetuptools.command.easy_installRt __class__tget_option_dicttcleartupdateR9RRRtFalseRtensure_finalized(RDRRR`toptstlinksRtcmd((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR)s(      c Csg}|jj}x|jjD]\}}|j|d|j||jr%|j}d}d}|j s||}}nd|dd||fd|dd||ff}|j |d||d|(RDRRRtexclude((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR@s  cCs?t|ts%td|fntt|j|dS(Ns.packages: setting must be a list or tuple (%r)(RR;RRpR R9(RDR3((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_exclude_packagessc Cs|jj|_|jj|_|d}|jd}xS||kr||\}}||=ddl}|j|t|d*|d}q:Wtj|||}|j |} t | ddrd|f|j|d<|dk rgSn|S(Nitaliasesiitcommand_consumes_argumentss command lineR( RRRR tshlexRRRt_parse_command_optsR(RR( RDtparserRR)RBtsrctaliasRDtnargst cmd_class((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyREs"   c Cs'i}x|jjD] \}}x|jD]\}\}}|dkrSq/n|jdd}|dkr|j|}|jj}|jt|dixZ|jD](\} } | |kr| }d}PqqWt dn|dkrd}n||j |i|R1R@RARERSR:R^(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRsFB 7                       ( RcBsYeZdZedZeeedddZdZdZ dZ dZ RS( s **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCs d}tj|tdddS(NsrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.t stackleveli(RRR(tmsg((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRsc Ks |j||_||_||_||_t|ttfrO|f}ng|D]}t|trV|^qV|_g|D]}t|ts|^q} | r| |ds\                H          PK!namespaces.pycnu[ fc@sqddlZddlmZddlZddlmZejjZdddYZ de fdYZ dS( iN(tlog(tmapt Installerc Bs_eZdZdZdZdZdZdZdZdZ dZ e dZ RS(s -nspkg.pthcCs|j}|sdStjj|j\}}||j7}|jj|tj d|t |j |}|j rt |dSt|d}|j|WdQXdS(Ns Installing %stwt(t_get_all_ns_packagestostpathtsplitextt _get_targett nspkg_exttoutputstappendRtinfoRt_gen_nspkg_linetdry_runtlisttopent writelines(tselftnsptfilenametexttlinestf((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pytinstall_namespacess    cCsbtjj|j\}}||j7}tjj|sAdStjd|tj|dS(Ns Removing %s( RRRRR texistsRR tremove(RRR((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pytuninstall_namespaces!s  cCs|jS(N(ttarget(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR)ssimport sys, types, oss#has_mfs = sys.version_info > (3, 5)s$p = os.path.join(%(root)s, *%(pth)r)s4importlib = has_mfs and __import__('importlib.util')s-has_mfs and __import__('importlib.machinery')sm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))sCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))s7mp = (m or []) and m.__dict__.setdefault('__path__',[])s(p not in mp) and mp.append(p)s4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS(Ns$sys._getframe(1).f_locals['sitedir']((R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyt _get_rootCscCs|t|}t|jd}|j}|j}|jd\}}}|rd||j7}ndj|tdS(Nt.t;s ( tstrttupletsplitRt _nspkg_tmplt rpartitiont_nspkg_tmpl_multitjointlocals(Rtpkgtpthtroott tmpl_linestparenttseptchild((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR Fs   cCs.|jjpg}ttt|j|S(s,Return sorted list of all package namespaces(t distributiontnamespace_packagestsortedtflattenRt _pkg_names(Rtpkgs((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRQsccs8|jd}x"|r3dj|V|jqWdS(s Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True RN(R"R&tpop(R(tparts((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR3Vs  ( simport sys, types, oss#has_mfs = sys.version_info > (3, 5)s$p = os.path.join(%(root)s, *%(pth)r)s4importlib = has_mfs and __import__('importlib.util')s-has_mfs and __import__('importlib.machinery')sm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))sCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))s7mp = (m or []) and m.__dict__.setdefault('__path__',[])s(p not in mp) and mp.append(p)(s4m and setattr(sys.modules[%(parent)r], %(child)r, m)( t__name__t __module__R RRRR#R%RR Rt staticmethodR3(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR s$     tDevelopInstallercBseZdZdZRS(cCstt|jS(N(treprR tegg_path(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRgscCs|jS(N(tegg_link(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRjs(R7R8RR(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR:fs (( Rt distutilsRt itertoolstsetuptools.extern.six.movesRtchaint from_iterableR2RR:(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyts   [PK!A|<D!D!ssl_support.pyonu[ fc@s/ddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z yddl Z Wnek rdZ nXdddddgZd jjZyejjZejZWnek reZZnXe dk oeeefkZydd l mZmZWnUek ry$dd lmZdd lmZWqek rdZdZqXnXesd efdYZnesddZdZndefdYZdefdYZ ddZ!dZ"e"dZ#dZ$dZ%dS(iN(turllibt http_clienttmaptfilter(tResolutionErrortExtractionErrortVerifyingHTTPSHandlertfind_ca_bundlet is_availablet cert_pathst opener_fors /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem (tCertificateErrortmatch_hostname(R (R R cBseZRS((t__name__t __module__(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR 5sic CsRg}|stS|jd}|d}|d}|jd}||krgtdt|n|s|j|jkS|dkr|jdnY|jds|jdr|jtj |n"|jtj |j dd x$|D]}|jtj |qWtj d d j |d tj } | j|S( spMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 t.iit*s,too many wildcards in certificate DNS name: s[^.]+sxn--s\*s[^.]*s\As\.s\Z(tFalsetsplittcountR treprtlowertappendt startswithtretescapetreplacetcompiletjoint IGNORECASEtmatch( tdnthostnamet max_wildcardstpatstpartstleftmostt remaindert wildcardstfragtpat((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt_dnsname_match;s*    " &cCs[|stdng}|jdd }xC|D];\}}|dkr4t||r_dS|j|q4q4W|sxc|jddD]L}xC|D];\}}|dkrt||rdS|j|qqWqWnt|dkrtd|d jtt|fn;t|dkrKtd ||d fn td dS(s=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. sempty or no certificatetsubjectAltNametDNSNtsubjectt commonNameis&hostname %r doesn't match either of %ss, shostname %r doesn't match %ris=no appropriate commonName or subjectAltName fields were found((( t ValueErrortgetR)RtlenR RRR(tcertR tdnsnamestsantkeytvaluetsub((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR os.  %cBs eZdZdZdZRS(s=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|dS(N(t ca_bundlet HTTPSHandlert__init__(tselfR7((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9s csjfd|S(Ncst|j|S(N(tVerifyingHTTPSConnR7(thosttkw(R:(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytt(tdo_open(R:treq((R:s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt https_opens(R Rt__doc__R9RB(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRs R;cBs eZdZdZdZRS(s@Simple verifying connection: no auth, subclasses, timeouts, etc.cKs tj|||||_dS(N(tHTTPSConnectionR9R7(R:R<R7R=((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9scCs+tj|j|jft|dd}t|drjt|ddrj||_|j|j }n |j}tt drt j d|j }|j |d||_n$t j |dt jd|j |_yt|jj|Wn4tk r&|jjtj|jjnXdS( Ntsource_addresst_tunnelt _tunnel_hosttcreate_default_contexttcafiletserver_hostnamet cert_reqstca_certs(tsockettcreate_connectionR<tporttgetattrtNonethasattrtsockRFRGtsslRHR7t wrap_sockett CERT_REQUIREDR t getpeercertR tshutdownt SHUT_RDWRtclose(R:RSt actual_hosttctx((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytconnects$$!      (R RRCR9R](((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR;s cCs"tjjt|ptjS(s@Get a urlopen() replacement that uses ca_bundle for verification(Rtrequestt build_openerRRtopen(R7((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR s cs"tjfd}|S(Ncs+tds$||_njS(Ntalways_returns(RRRa(targstkwargs(tfunc(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytwrappers(t functoolstwraps(RdRe((Rds:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytoncescsnyddl}Wntk r$dSXd|jffdY}|jd|jd|jS(NitCertFilecs&eZfdZfdZRS(cs't|jtj|jdS(N(tsuperR9tatexittregisterRZ(R:(Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9scs/yt|jWntk r*nXdS(N(RjRZtOSError(R:(Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRZs (R RR9RZ((Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRistCAtROOT(t wincertstoret ImportErrorRQRitaddstoretname(Rpt _wincerts((Ris:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytget_win_certfiles    cCs4ttjjt}tp3t|dp3tS(s*Return an existing CA bundle path, or NoneN( RtostpathtisfileR RutnextRQt_certifi_where(textant_cert_paths((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRs cCs5ytdjSWntttfk r0nXdS(Ntcertifi(t __import__twhereRqRR(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRzs(&RvRMRkRRftsetuptools.extern.six.movesRRRRt pkg_resourcesRRRTRqRQt__all__tstripRR R^R8RDtAttributeErrortobjectRR R tbackports.ssl_match_hostnameR.R)RR;R RhRuRRz(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytsP     "          4 ) (   PK!I ??package_index.pycnu[ fc@s~dZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl mZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZmZm Z ddlm!Z!ddl"m#Z#dd l$m%Z%dd l&m'Z'dd l(m)Z)dd l*m+Z+dd l,m-Z-ej.dZ/ej.dej0Z1ej.dZ2ej.dej0j3Z4dj5Z6ddddgZ7dZ8dZ9e9j:dej;d deZ<dZ=dZ>dZ?e@dZAe@d ZBe@d!ZCe@ee@d"ZDe@d#ZEd$ZFej.d%ej0ZGeFd&ZHd'eIfd(YZJd)eJfd*YZKdefd+YZLej.d,jMZNd-ZOd.ZPdd/ZQd0ZRd1eIfd2YZSd3ejTfd4YZUejVjWd5ZXeQe8eXZXd6ZYd7ZZdS(8s#PyPI and direct package downloadingiN(twraps(tsix(turllibt http_clientt configparsertmap( t CHECKOUT_DISTt Distributiont BINARY_DISTtnormalize_patht SOURCE_DISTt Environmenttfind_distributionst safe_namet safe_versiont to_filenamet Requirementt DEVELOP_DISTtEGG_DIST(t ssl_support(tlog(tDistutilsError(t translate(tget_all_headers(tunescape(tWheels^egg=([-A-Za-z0-9_.+!]+)$shref\s*=\s*['"]?([^'"> ]+)s([^<]+) \s+\(md5\)s([-+.a-z0-9]{2,}):s.tar.gz .tar.bz2 .tar .zip .tgzt PackageIndextdistros_for_urltparse_bdist_wininsttinterpret_distro_nameis<setuptools/{setuptools.__version__} Python-urllib/{py_major}tpy_majorit setuptoolscCs<ytj|SWn$tk r7td|fnXdS(Ns1Not a URL, existing file, or requirement spec: %r(Rtparset ValueErrorR(tspec((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytparse_requirement_arg2s  cCs|j}d\}}}|jdr|jdrL|d }d}q|jddr~|dd!}|d }d}q|jd r|d }d }q|jd d r|dd!}|d }d }qn|||fS(s=Return (base,pyversion) or (None,None) for possible .exe names.exes .win32.exeitwin32s .win32-pyiiis.win-amd64.exeis win-amd64s .win-amd64-pyiN(NNN(tlowertNonetendswitht startswith(tnameR%tbasetpy_vertplat((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR;s$           c Cstjj|}|\}}}}}}tjj|jdd}|dkr|dkrtjj|jdd}nd|kr|jdd\}}n||fS(Nt/issourceforge.nettdownloadit#i(RR turlparsetunquotetsplit( turltpartstschemetservertpatht parameterstquerytfragmentR*((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytegg_info_for_urlSs" ccst|\}}xt|||D] }|Vq%W|rtj|}|rx1t||jd|dtD] }|VqqWqndS(sEYield egg or source distribution objects that might be found at a URLit precedenceN(R;tdistros_for_locationt EGG_FRAGMENTtmatchRtgroupR(R3tmetadataR*R:tdistR?((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR^s "c CsA|jdr|d }n|jdrMd|krMtj|||gS|jdrd|krt|}|jsgStd|d|jd|jd td gS|jd rt|\}}}|d k rt ||||t |Snx>t D]6}|j|r|t | }t |||SqWgS( s:Yield egg or source distribution objects based on basenames.egg.zipis.eggt-s.whltlocationt project_nametversionR<is.exeN(R'Rt from_locationRt is_compatibleRERFRRR&RRt EXTENSIONStlen(RDtbasenameRAtwheeltwin_baseR+tplatformtext((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR=ls.       cCs"tt|tjj||S(sEYield possible egg or source distribution objects based on a filename(R=R tosR7RK(tfilenameRA((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytdistros_for_filenamesc cs|jd}| r4td|dDr4dSxatdt|dD]F}t||dj|| dj||d|d|d|VqNWdS( sGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! RCcss!|]}tjd|VqdS(s py\d\.\d$N(treR?(t.0tp((s</usr/lib/python2.7/site-packages/setuptools/package_index.pys siNit py_versionR<RN(R2tanytrangeRJRtjoin(RDRKRARVR<RNR4RU((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs! ) ccst}|j}|dkrSxmtjj|j|D]}|||Vq7Wn;x8|D]0}||}||krZ|||VqZqZWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(tsettaddR&Rtmovest filterfalset __contains__(titerabletkeytseentseen_addtelementtk((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytunique_everseens         cstfd}|S(ss Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S(N(Re(targstkwargs(tfunc(s</usr/lib/python2.7/site-packages/setuptools/package_index.pytwrappers(R(RhRi((Rhs</usr/lib/python2.7/site-packages/setuptools/package_index.pyt unique_valuesss3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>ccsxtj|D]}|j\}}tttj|jjd}d|ksgd|krx=t j|D])}t j j |t |jdVqwWqqWxjd D]b}|j|}|dkrt j||}|rt j j |t |jdVqqqWdS( sEFind rel="homepage" and rel="download" links in `page`, yielding URLst,thomepageR.is Home PagesDownload URLiN(s Home PagesDownload URL(tRELtfinditertgroupsRZRtstrtstripR%R2tHREFRR turljoint htmldecodeR@tfindtsearch(R3tpageR?ttagtreltrelstpos((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfind_external_linkss'.  tContentCheckercBs)eZdZdZdZdZRS(sP A null content checker that defines the interface for checking content cCsdS(s3 Feed a block of data to the hash. N((tselftblock((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfeedscCstS(sC Check the hash. Return False if validation fails. (tTrue(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytis_validscCsdS(su Call reporter with information about the checker (hash name) substituted into the template. N((R~treporterttemplate((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytreports(t__name__t __module__t__doc__RRR(((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR}s  t HashCheckercBsJeZejdZdZedZdZdZ dZ RS(sK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs(||_tj||_||_dS(N(t hash_namethashlibtnewthashtexpected(R~RR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt__init__ s cCsRtjj|d}|s#tS|jj|}|sBtS||jS(s5Construct a (possibly null) ContentChecker from a URLi(RR R0R}tpatternRvt groupdict(tclsR3R:R?((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytfrom_urlscCs|jj|dS(N(Rtupdate(R~R((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscCs|jj|jkS(N(Rt hexdigestR(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR scCs||j}||S(N(R(R~RRtmsg((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR#s ( RRRStcompileRRt classmethodRRRR(((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs    cBsveZdZdd%d&edZedZedZedZ dZ dZ d Z d Z d&d Zd Zd&d ZdZdZdZdZdZeeed&dZeedZdZdZdZdZd&dZdZdZdZdZ dZ!e"edZ#d Z$d!Z%d"Z&d#Z'd$Z(RS('s;A distribution index that scans web pages for download URLsshttps://pypi.python.org/simplet*cOstj||||d|jd |_i|_i|_i|_tjdj t t |j |_ g|_|otjo|ptj}|rtj||_ntjj|_dS(NR-t|(R RR't index_urlt scanned_urlst fetched_urlst package_pagesRSRRYRRR?tallowstto_scanRt is_availabletfind_ca_bundlet opener_fortopenerRtrequestturlopen(R~Rthostst ca_bundlet verify_sslRftkwtuse_ssl((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR+s   '  c Csg||jkr| rdSt|j|s(tfilterRPR7RRt itertoolststarmapt scan_egg_link(R~t search_pathtdirst egg_links((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytscan_egg_linkss c Csttjj||(}ttdttj |}WdQXt |dkr[dS|\}}xQt tjj||D]4}tjj|||_ t |_|j|qWdS(Ni(topenRPR7RYRRR&RRpRqRJR RDR R<R[(R~R7Rt raw_linestlinestegg_patht setup_pathRB((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs' " c sfd}xWtj|D]F}y,|tjj|t|jdWqtk rdqXqW||\}}|rxyt||D]h}t |\}} |j dr| r|r|d||f7}qj |nj |qWt jd|SdSdS(s#Process the contents of a PyPI pagecs|jjrtttjj|tjjd}t|dkrd|dkrt |d}t |d}t j j |ji|%siii(R@(tm((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytRRN(RrRnRR RsRtR@R!R|R;R'tneed_version_infotscan_urltPYPI_MD5tsub( R~R3RwRR?RRtnew_urlR*tfrag((R~s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs$,  cCs|jd|dS(NsPPage at %s links to .py file(s) without version info; an index scan is required.(tscan_all(R~R3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscGsO|j|jkr;|r+|j||n|jdn|j|jdS(Ns6Scanning index of all packages (this may take a while)(RRRRR(R~RRf((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs  cCs|j|j|jd|jj|jsN|j|j|jdn|jj|jss|j|nx3t|jj|jdD]}|j|qWdS(NR-(( RRt unsafe_nameRRR`REtnot_found_in_indexR(R~t requirementR3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt find_packagess%cCsk|j|j|x8||jD])}||kr;|S|jd||q%Wtt|j||S(Ns%s does not match %s(tprescanRR`RtsuperRtobtain(R~Rt installerRB((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs   cCsi|j|jd||jse|jtj|td|jjtj j |fndS(s- checker is a ContentChecker sValidating %%s checksum for %ss7%s validation failed for %s; possible download problem?N( RRRRRPtunlinkRRR)R7RK(R~tcheckerRQttfp((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt check_hashs    cCsrxk|D]c}|jdksJt| sJ|jdsJtt|rZ|j|q|jj|qWdS(s;Add `urls` to the list that will be prescanned for searchessfile:N(RR&RR(RRRtappend(R~turlsR3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytadd_find_links s  cCs2|jr%tt|j|jnd|_dS(s7Scan urls scheduled for prescanning (e.g. --find-links)N(RRRRR&(R~((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs cCsN||jr |jd}}n|jd}}|||j|jdS(Ns#Couldn't retrieve index page for %rs3Couldn't find index page for %r (maybe misspelled?)(R`RRRR(R~RtmethR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR!s   cCst|tst|}|r||j|jd||}t|\}}|jdrx|j|||}n|Stj j |r|St |}nt |j ||ddS(sLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. is.pyRDN(RRRt _download_urlR@R;R't gen_setupRPR7RR#Rtfetch_distributionR&(R~R"ttmpdirR5tfoundR*R:((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR.+s c sFjd|id}dfd}|rfjj|||}n| r|dk r|||}n|dkrjdk rjn||}n|dkr| rj|||}n|dkrjdrdpd|n#jd||jd|jSdS( s|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. sSearching for %scs|dkr}nx||jD]}|jtkrn rn|kr#jd|d|R?RR@R&RFRJRPR7RKtdirnameRYtsetuptools.command.easy_installRtshutiltcopy2RtwriteREtsplitextR( R~RQR:RR?tdRRKtdstRR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs24 !!i c Cs|jd|d}zXtj|}|j|}t|tjjrnt d||j |j fn|j}d}|j }d}d|krt |d} ttt| }|j|||||nt|d}} x`trO|j|} | rK|j| | j| |d7}|j|||||qPqW|j||| WdQX|SWd|r|jnXdS( NsDownloading %ssCan't download %s: %s %siiscontent-lengthsContent-Lengthtwbi(RR&RRRRRRRRRRt dl_blocksizeRtmaxRtintt reporthookRRRRRRR( R~R3RQtfpRRtblocknumtbstsizetsizesRR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyt _download_tos:       cCsdS(N((R~R3RQR!tblksizeR#((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRscCs|jdrt|Syt||jSWnsttjfk r}djg|jD]}t |^qX}|r|j ||qt d||fnt j jk r}|St j jk r }|r|j ||jqt d||jfntjk rU}|r9|j ||jqt d||jfnNtjtj fk r}|r|j ||qt d||fnXdS(Nsfile:t s%s %ssDownload error for %s: %ss;%s returned a bad status line. The server might be down, %s(R(t local_opentopen_with_authRR!Rt InvalidURLRYRfRpRRRRRtURLErrortreasont BadStatusLinetlinet HTTPExceptiontsocket(R~R3twarningtvtargR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs6 +cCsHt|\}}|rLx7d|krH|jddjdd}qWnd}|jdrn|d }ntjj||}|dks|jd r|j||S|d ks|jd r|j||S|jd r|j ||S|d kr$t j j t j j|dS|j|t|j||SdS(Ns..t.s\t_t__downloaded__s.egg.zipitsvnssvn+tgitsgit+shg+Ri(R;treplaceR'RPR7RYR(t _download_svnt _download_gitt _download_hgRRt url2pathnameR R0RRt_attempt_download(R~R5R3RR)R:RQ((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyRs$%   cCs|j|tdS(N(RR(R~R3((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR8scCsK|j||}d|jddjkrC|j|||S|SdS(NRs content-typeR(R%RR%t_download_html(R~R3RQR((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR>;scCst|}xW|D]O}|jrtjd|r^|jtj||j||SPqqW|jtj|td|dS(Ns ([^- ]+ - )?Revision \d+:s���Unexpected HTML page found at ( ���R���Rq���RS���Rv���R���RP���R���R:��R���(���R~���R3���R���RQ���R���R.��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR?��B��s����       c���������C���sl��|�j��d�d��d�}�d�}�|�j���j�d��r;d�|�k�r;t�j�j�|��\�}�}�}�}�}�} �|� r;|�j�d��r;d�|�d �k�r;|�d �j��d�d��\�}�}�t�j�j�|��\�} �} �| �r8d �| �k�r�| �j��d �d��\�} �} �d �| �| �f�}�n �d �| �}�| �}�|�|�|�|�|�| �f�}�t�j�j�|��}�q8q;n��|��j�d �|�|��t �j �d�|�|�|�f��|�S(���NR/���i���i����R���s���svn:t���@s���//R-���i���t���:s��� --username=%s --password=%ss ��� --username=s'���Doing subversion checkout from %s to %ss���svn checkout%s -q %s %s( ���R2���R%���R(���R���R ���R0���t ���splitusert ���urlunparseR���RP���t���system(���R~���R3���RQ���t���credsR5���t���netlocR7���RU���t���qR���t���autht���hostt���usert���pwR4���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR:��Q��s$����!$&  c���������C���s���t��j�j�|���\�}�}�}�}�}�|�j�d�d��d�}�|�j�d�d��d�}�d��}�d�|�k�rz�|�j�d�d��\�}�}�n��t��j�j�|�|�|�|�d�f��}��|��|�f�S(���Nt���+i���iR/���i����R@��R���(���R���R ���t���urlsplitR2���R&���t���rsplitt ���urlunsplit(���R3���t ���pop_prefixR5���RF��R7���R9���R���t���rev(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���_vcs_split_rev_from_urlf��s����! !c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RP��s���Doing git clone from %s to %ss���git clone --quiet %s %ss���Checking out %ss"���(cd %s && git checkout --quiet %s)(���R2���RR��R���R���RP���RD��R&���(���R~���R3���RQ���RQ��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR;��x��s����  c���������C���s���|�j��d�d��d�}�|��j�|�d�t�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k �r�|��j�d�|��t�j�d�|�|�f��n��|�S( ���NR/���i���i����RP��s���Doing hg clone from %s to %ss���hg clone --quiet %s %ss���Updating to %ss���(cd %s && hg up -C -r %s -q)(���R2���RR��R���R���RP���RD��R&���(���R~���R3���RQ���RQ��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR<����s����  c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����c���������G���s���t��j�|�|��d��S(���N(���R���R���(���R~���R���Rf���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s����(���R���N()���R���R���R���R&���R���R���t���FalseR���R���R���R���R���R���R���R���R���R���R���R���R���R���R.���R��R��R��R��R%��R��R���R���R���R>��R?��R:��t ���staticmethodRR��R;��R<��R���R���R���(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR���(��sL��� 3   +      #J ) $  #         s!���&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c���������C���s���|��j��d��}�t�|��S(���Ni���(���R@���R���(���R?���t���what(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���decode_entity��s����c���������C���s ���t��t�|���S(���s'���Decode HTML entities in the given text.(���t ���entity_subRV��(���t���text(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRt�����s����c������������s�����f�d���}�|�S(���Nc������������s������f�d���}�|�S(���Nc�������������s?���t��j���}�t��j���z���|��|���SWd��t��j�|��Xd��S(���N(���R0��t���getdefaulttimeoutt���setdefaulttimeout(���Rf���Rg���t ���old_timeout(���Rh���t���timeout(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���_socket_timeout��s ����  (����(���Rh���R]��(���R\��(���Rh���s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR]����s����(����(���R\��R]��(����(���R\��s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���socket_timeout��s���� c���������C���sI���t��j�j�|���}�|�j���}�t�j�|��}�|�j���}�|�j�d�d��S(���sq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False s��� R���(���R���R ���R1���t���encodet���base64t ���encodestringR���R9��(���RH��t���auth_st ���auth_bytest ���encoded_bytest���encoded(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���_encode_auth��s ����   t ���Credentialc�����������B���s)���e��Z�d��Z�d���Z�d���Z�d���Z�RS(���s:��� A username/password pair. Use like a namedtuple. c���������C���s���|�|��_��|�|��_�d��S(���N(���t���usernamet���password(���R~���Rh��Ri��(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s���� c���������c���s���|��j��V|��j�Vd��S(���N(���Rh��Ri��(���R~���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���__iter__��s����c���������C���s���d�t��|���S(���Ns���%(username)s:%(password)s(���t���vars(���R~���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���__str__��s����(���R���R���R���R���Rj��Rl��(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRg����s���  t ���PyPIConfigc�����������B���s2���e��Z�d����Z�e�d����Z�d���Z�d���Z�RS(���c���������C���su���t��j�d�d�d�g�d��}�t�j�j�|��|��t�j�j�t�j�j�d��d��}�t�j�j �|��rq�|��j �|��n��d�S(���s%��� Load from ~/.pypirc Rh��Ri��t ���repositoryR���t���~s���.pypircN( ���t���dictt���fromkeysR���t���RawConfigParserR���RP���R7���RY���t ���expanduserR���R���(���R~���t���defaultst���rc(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR�����s ����!c���������C���sM���g��|��j����D]$�}�|��j�|�d��j���r �|�^�q �}�t�t�|��j�|���S(���NRn��(���t���sectionsR���Rq���Rp��R���t���_get_repo_cred(���R~���t���sectiont���sections_with_repositories(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���creds_by_repository��s����$c���������C���sO���|��j��|�d��j���}�|�t�|��j��|�d��j���|��j��|�d��j����f�S(���NRn��Rh��Ri��(���R���Rq���Rg��(���R~���Rx��t���repo(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRw����s����c���������C���s7���x0�|��j��j���D]�\�}�}�|�j�|��r�|�Sq�Wd�S(���s��� If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N(���Rz��t���itemsR(���(���R~���R3���Rn��t���cred(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt���find_credential��s����(���R���R���R���t���propertyRz��Rw��R~��(����(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyRm����s���  c���������C���s��t��j�j�|���\�}�}�}�}�}�}�|�j�d��rE�t�j�d���n��|�d �k�rl�t��j�j�|��\�}�} �n�d �}�|�s�t���j �|���} �| �r�t �| ��}�| �j �|��f�} �t �j �d�| ��q�n��|�r&d�t�|��}�|�| �|�|�|�|�f�} �t��j�j�| ��} �t��j�j�| ��}�|�j�d�|��n�t��j�j�|���}�|�j�d�t��|�|��}�|�rt��j�j�|�j��\�}�}�}�}�}�}�|�|�k�r|�| �k�r|�|�|�|�|�|�f�} �t��j�j�| ��|�_�qn��|�S( ���s4���Open a urllib2 request, handling HTTP authenticationRA��s���nonnumeric port: ''t���httpt���httpss*���Authenticating as %s for %s (from .pypirc)s���Basic t ���Authorizations ���User-Agent(���R��R��N(���R���R ���R0���R'���R���R*��RB��R&���Rm��R~��Rp���Rh��R���R���Rf��RC��R���t���Requestt ���add_headert ���user_agentR3���(���R3���R���R5���RF��R7���t���paramsR9���R���RH��RI��R}��R���R4���R���R���R ��t���s2t���h2t���path2t���param2t���query2t���frag2(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyR)����s6����$   'c���������C���s���|��S(���N(����(���R3���(����(����s<���/usr/lib/python2.7/site-packages/setuptools/package_index.pyt ���fix_sf_url?��s����c���������C���s��t��j�j�|���\�}�}�}�}�}�}�t��j�j�|��}�t�j�j�|��rX�t��j�j�|���S|�j �d��rPt�j�j �|��rPg��}�x�t�j �|��D]�} �t�j�j �|�| ��} �| �d�k�r�t �| �d���} �| �j���} �Wd�QXPn�t�j�j �| ��r�| �d�7} �n��|�j�d�j�d�| ���q�Wd�} �| �j�d�|��d �d �j �|���} �d�\�}�}�n�d�\�}�}�} �i�d�d�6}�t�j�| ��}�t��j�j�|��|�|�|�|��S(���s7���Read a local path, with special support for directoriesR-���s ���index.htmlt���rNs���<a href="{name}">{name}</a>R)���sB���<html><head><title>{url}{files}R3tfiless itOKisPath not founds Not founds text/htmls content-type(iR(isPath not founds Not found(RR R0RR=RPR7tisfileRR'RRRYRRRtformatRtStringIORR(R3R5R6R7tparamR9RRQRRtfilepathR tbodyRtstatustmessageRt body_stream((s</usr/lib/python2.7/site-packages/setuptools/package_index.pyR(Cs,$!  ! ([RtsysRPRSRR0R`RRt functoolsRtsetuptools.externRtsetuptools.extern.six.movesRRRRRt pkg_resourcesRRRR R R R R RRRRRRt distutilsRtdistutils.errorsRtfnmatchRtsetuptools.py27compatRtsetuptools.py33compatRtsetuptools.wheelRRR>tIRrRR?RR2RIt__all__t_SOCKET_TIMEOUTt_tmplRRFRR#RR;R&RR=RRRReRjRmR|tobjectR}RRRRWRVRtR^RfRgRrRmRRR)RR((((s</usr/lib/python2.7/site-packages/setuptools/package_index.pytsv        " X       !  "  !~    &. PK!%Yr r extension.pycnu[ fc@sddlZddlZddlZddlZddlZddlmZddlm Z dZ e Z e ej j ZdefdYZ de fd YZdS( iN(tmapi(t get_unpatchedcCs<d}yt|ddgjtSWntk r7nXtS(s0 Return True if Cython can be imported. sCython.Distutils.build_exttfromlistt build_ext(t __import__RtTruet ExceptiontFalse(t cython_impl((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyt _have_cython s t ExtensioncBs eZdZdZdZRS(s7Extension that uses '.c' files in place of '.pyx' filescOs2|jdt|_tj|||||dS(Ntpy_limited_api(tpopRR t _Extensiont__init__(tselftnametsourcestargstkw((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR#scCsqtr dS|jpd}|jdkr4dnd}tjtjd|}tt||j |_ dS(s Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Ntsc++s.cpps.cs.pyx$( R tlanguagetlowert functoolstpartialtretsubtlistRR(Rtlangt target_extR((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyt_convert_pyx_sources_to_lang)s  (t__name__t __module__t__doc__RR(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR s tLibrarycBseZdZRS(s=Just like a regular Extension, but built as a library instead(RR R!(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR"8s(RRtdistutils.coret distutilstdistutils.errorstdistutils.extensiontsetuptools.extern.six.movesRtmonkeyRR t have_pyrextcoreR R R"(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyts      PK!Mc[py27compat.pyonu[ fc@stdZddlZddlmZdZejr@dZnejdkoXejZergendZ dS(s2 Compatibility Support for Python 2.7 and earlier iN(tsixcCs |j|S(sH Given an HTTPMessage, return all headers matching a given key. (tget_all(tmessagetkey((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pytget_all_headers scCs |j|S(N(t getheaders(RR((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pyRstLinuxcCs|S(N((tx((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pytt( t__doc__tplatformtsetuptools.externRRtPY2tsystemtlinux_py2_asciitstrt rmtree_safe(((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pyts     PK!Xwindows_support.pyonu[ fc@s4ddlZddlZdZedZdS(iNcCstjdkrdS|S(NtWindowsc_sdS(N(tNone(targstkwargs((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pytt(tplatformtsystem(tfunc((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyt windows_onlyscCsqtdtjjj}tjjtjjf|_tjj |_ d}|||}|smtj ndS(s Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. sctypes.wintypesiN( t __import__tctypestwindlltkernel32tSetFileAttributesWtwintypestLPWSTRtDWORDtargtypestBOOLtrestypetWinError(tpathtSetFileAttributestFILE_ATTRIBUTE_HIDDENtret((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyt hide_file s (RR R R(((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyts   PK!Mc[py27compat.pycnu[ fc@stdZddlZddlmZdZejr@dZnejdkoXejZergendZ dS(s2 Compatibility Support for Python 2.7 and earlier iN(tsixcCs |j|S(sH Given an HTTPMessage, return all headers matching a given key. (tget_all(tmessagetkey((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pytget_all_headers scCs |j|S(N(t getheaders(RR((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pyRstLinuxcCs|S(N((tx((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pytt( t__doc__tplatformtsetuptools.externRRtPY2tsystemtlinux_py2_asciitstrt rmtree_safe(((s9/usr/lib/python2.7/site-packages/setuptools/py27compat.pyts     PK!%Yr r extension.pyonu[ fc@sddlZddlZddlZddlZddlZddlmZddlm Z dZ e Z e ej j ZdefdYZ de fd YZdS( iN(tmapi(t get_unpatchedcCs<d}yt|ddgjtSWntk r7nXtS(s0 Return True if Cython can be imported. sCython.Distutils.build_exttfromlistt build_ext(t __import__RtTruet ExceptiontFalse(t cython_impl((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyt _have_cython s t ExtensioncBs eZdZdZdZRS(s7Extension that uses '.c' files in place of '.pyx' filescOs2|jdt|_tj|||||dS(Ntpy_limited_api(tpopRR t _Extensiont__init__(tselftnametsourcestargstkw((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR#scCsqtr dS|jpd}|jdkr4dnd}tjtjd|}tt||j |_ dS(s Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Ntsc++s.cpps.cs.pyx$( R tlanguagetlowert functoolstpartialtretsubtlistRR(Rtlangt target_extR((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyt_convert_pyx_sources_to_lang)s  (t__name__t __module__t__doc__RR(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR s tLibrarycBseZdZRS(s=Just like a regular Extension, but built as a library instead(RR R!(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyR"8s(RRtdistutils.coret distutilstdistutils.errorstdistutils.extensiontsetuptools.extern.six.movesRtmonkeyRR t have_pyrextcoreR R R"(((s8/usr/lib/python2.7/site-packages/setuptools/extension.pyts      PK!g[⣠msvc.pycnu[ fc@sydZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ej dkrddl mZejZnd fd YZeZeejjfZydd lmZWnek rnXd Zd dZdZdZddZdfdYZdfdYZdfdYZdfdYZ dS(s@ Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) iN(t LegacyVersion(t filterfalsei(t get_unpatchedtWindows(twinregRcBs eZdZdZdZdZRS(N(t__name__t __module__tNonet HKEY_USERStHKEY_CURRENT_USERtHKEY_LOCAL_MACHINEtHKEY_CLASSES_ROOT(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR(s(tRegcCsd}|d|f}ytj|d}WnQtk ry&|d|f}tj|d}Wqtk r{d}qXnX|rtjjjj|d}tjj|r|Sntt |S(s+ Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ vcvarsall.bat path: str s-Software\%sMicrosoft\DevDiv\VCForPython\%0.1ftt installdirs Wow6432Node\s vcvarsall.batN( R t get_valuetKeyErrorRtostpathtjointisfileRtmsvc9_find_vcvarsall(tversiontVC_BASEtkeyt productdirt vcvarsall((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR?s  tx86cOsy#tt}|||||SWn'tjjk r<ntk rLnXyt||jSWn,tjjk r}t|||nXdS(s Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ environment: dict N( Rtmsvc9_query_vcvarsallt distutilsterrorstDistutilsPlatformErrort ValueErrortEnvironmentInfot return_envt_augment_exception(tvertarchtargstkwargstorigtexc((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRjs  cCsxytt|SWntjjk r-nXyt|ddjSWn)tjjk rs}t|dnXdS(s' Patched "distutils._msvccompiler._get_vc_env" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Parameters ---------- plat_spec: str Target architecture. Return ------ environment: dict t vc_min_verg,@N(Rtmsvc14_get_vc_envRRRR!R"R#(t plat_specR)((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR+s cOsbdtjkrOddl}t|jtdkrO|jjj||Sntt ||S(s Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) snumpy.distutilsiNs1.11.2( tsystmodulestnumpyRt __version__Rt ccompilertgen_lib_optionsRtmsvc14_gen_lib_options(R&R'tnp((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR3s  R cCs|jd}d|jks1d|jkrd}|jt}d}|dkr|jjddkr|d 7}||d 7}q|d 7}q|d kr|d 7}||d7}q|dkr|d7}qn|f|_dS(sl Add details to the exception message to help guide the user as to what action will resolve it. iRsvisual cs0Microsoft Visual C++ {version:0.1f} is required.s-www.microsoft.com/download/details.aspx?id=%dg"@tia64is* Get it with "Microsoft Windows SDK 7.0": iB s% Get it from http://aka.ms/vcpython27g$@s* Get it with "Microsoft Windows SDK 7.1": iW g,@sj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN(R&tlowertformattlocalstfind(R)RR%tmessagettmplt msdownload((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR#s  $      t PlatformInfocBszeZdZejddjZdZedZ dZ dZ e e dZ e e dZe d ZRS( s Current and Target Architectures informations. Parameters ---------- arch: str Target architecture. tprocessor_architectureR cCs|jjdd|_dS(Ntx64tamd64(R6treplaceR%(tselfR%((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt__init__scCs|j|jjddS(Nt_i(R%R9(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_cpuscCs |jdkS(NR(RE(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_is_x86scCs |jdkS(NR(t current_cpu(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytcurrent_is_x86scCs=|jdkr|rdS|jdkr2|r2dSd|jS(sj Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ subfolder: str ' arget', or '' (see hidex86 parameter) RR R@s\x64s\%s(RG(RBthidex86R?((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt current_dir scCs=|jdkr|rdS|jdkr2|r2dSd|jS(sr Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ subfolder: str '\current', or '' (see hidex86 parameter) RR R@s\x64s\%s(RE(RBRIR?((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt target_dirscCsB|r dn|j}|j|kr(dS|jjdd|S(so Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current acritecture is not x86. Return ------ subfolder: str '' if target architecture is current architecture, '\current_target' if not. RR s\s\%s_(RGRERKRA(RBtforcex86tcurrent((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt cross_dir5s(RRt__doc__tsafe_envtgetR6RGRCtpropertyRERFRHtFalseRJRKRN(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR=s   t RegistryInfocBseZdZejejejejfZdZ e dZ e dZ e dZ e dZe dZe dZe dZe d Ze d Zed Zd ZRS( s Microsoft Visual Studio related registry informations. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dS(N(tpi(RBt platform_info((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCZscCsdS(s< Microsoft Visual Studio root registry key. t VisualStudio((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt visualstudio]scCstjj|jdS(s; Microsoft Visual Studio SxS registry key. tSxS(RRRRX(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytsxsdscCstjj|jdS(s8 Microsoft Visual C++ VC7 registry key. tVC7(RRRRZ(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytvckscCstjj|jdS(s; Microsoft Visual Studio VS7 registry key. tVS7(RRRRZ(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytvsrscCsdS(s? Microsoft Visual C++ for Python registry key. sDevDiv\VCForPython((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt vc_for_pythonyscCsdS(s- Microsoft SDK registry key. sMicrosoft SDKs((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt microsoft_sdkscCstjj|jdS(s> Microsoft Windows/Platform SDK registry key. R(RRRR`(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt windows_sdkscCstjj|jdS(s< Microsoft .NET Framework SDK registry key. tNETFXSDK(RRRR`(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt netfx_sdkscCsdS(s< Microsoft Windows Kits Roots registry key. sWindows Kits\Installed Roots((RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytwindows_kits_rootsscCs:|jjs|rdnd}tjjd|d|S(s  Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str: value R t Wow6432NodetSoftwaret Microsoft(RURHRRR(RBRRtnode64((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt microsofts!cCstj}tj}|j}x|jD]}y||||d|}Wnkttfk r|jjs%y"||||t d|}Wqttfk rq%qXqq%nXytj ||dSWq%ttfk rq%Xq%WdS(s Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str: value iN( RtKEY_READtOpenKeyRitHKEYStOSErrortIOErrorRURHtTruet QueryValueEx(RBRtnameRjtopenkeytmsthkeytbkey((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytlookups"   " (RRRORRR R R RlRCRRRXRZR\R^R_R`RaRcRdRSRiRv(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRTLs"   t SystemInfocBsjeZdZejddZejddZejdeZddZ dZ dZ e dZ e d Zd Zd Ze d Ze d Ze dZe dZe dZe dZe dZe dZe dZe dZe dZe dZe dZdZddZRS(s Microsoft Windows and Visual Studio related system inormations. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. tWinDirR t ProgramFilessProgramFiles(x86)cCs1||_|jj|_|p'|j|_dS(N(triRUt_find_latest_available_vc_vertvc_ver(RBt registry_infoR|((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCs cCsBy|jdSWn)tk r=d}tjj|nXdS(Nis%No Microsoft Visual C++ version found(tfind_available_vc_verst IndexErrorRRR(RBterr((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR{s  c Cs|jj}|jj|jj|jjf}g}xI|jjD];}x2|D]*}y%tj|||dtj}Wnt t fk rqMnXtj |\}}} xdt |D]V} y<t tj|| d} | |kr|j| nWqtk rqXqWx`t |D]R} y8t tj|| } | |kr^|j| nWq!tk rrq!Xq!WqMWq@Wt|S(sC Find all available Microsoft Visual C++ versions. i(RzRiR\R_R^RlRRkRjRmRnt QueryInfoKeytrangetfloatt EnumValuetappendR tEnumKeytsorted( RBRstvckeystvc_versRtRRutsubkeystvaluesRDtiR$((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR~s2 ! %    cCsKd|j}tjj|j|}|jj|jjd|jpJ|S(s4 Microsoft Visual Studio directory. sMicrosoft Visual Studio %0.1fs%0.1f(R|RRRtProgramFilesx86RzRvR^(RBRqtdefault((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VSInstallDir s cCs|j|jp|j}tjj|jjd|j}|jj |d}|rqtjj|dn|}|jj |jj d|jp|}tjj |sd}t j j|n|S(s1 Microsoft Visual C++ directory. s%0.1fRtVCs(Microsoft Visual C++ directory not found(Rt _guess_vct_guess_vc_legacyRRRRzR_R|RvR\tisdirRRR(RBtguess_vctreg_patht python_vct default_vcRtmsg((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCInstallDirs"!(cCs||jdkrdSd}tjj|j|}y*tj|d}tjj||SWntttfk rwnXdS(s* Locate Visual C for 2017 g,@Ns VC\Tools\MSVCi( R|RRRRtlistdirRmRnR(RBRRt vc_exact_ver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR0scCs#d|j}tjj|j|S(s< Locate Visual C for versions prior to 2017 s Microsoft Visual Studio %0.1f\VC(R|RRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR@s cCsc|jdkrdS|jdkr&dS|jdkr9dS|jd krLdS|jdkr_dSdS(sN Microsoft Windows SDK versions for specified MSVC++ version. g"@s7.0s6.1s6.0ag$@s7.1s7.0ag&@s8.0s8.0ag(@s8.1s8.1ag,@s10.0N(s7.0s6.1s6.0a(s7.1s7.0a(s8.0s8.0a(s8.1s8.1a(s10.0s8.1(R|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSdkVersionGscCs|jtjj|jdS(s4 Microsoft Windows SDK last version tlib(t_use_last_dir_nameRRRt WindowsSdkDir(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSdkLastVersionWscCsd}xO|jD]D}tjj|jjd|}|jj|d}|rPqqW| srtjj| rtjj|jjd|j }|jj|d}|rtjj|d}qn| stjj| rKxd|jD]V}||j d }d|}tjj|j |}tjj|r|}qqWn| setjj| rxQ|jD]C}d |}tjj|j |}tjj|ro|}qoqoWn|stjj|j d }n|S( s2 Microsoft Windows SDK directory. R sv%stinstallationfolders%0.1fRtWinSDKt.sMicrosoft SDKs\Windows Kits\%ssMicrosoft SDKs\Windows\v%st PlatformSDK( RRRRRzRaRvRR_R|trfindRyR(RBtsdkdirR$tlocRt install_basetintvertd((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR_s6"  c Cs8|jdkrd}d}n<d}|jdkr9tnt}|jjdtd|}d||jd d f}g}|jd krx9|jD]+}|tjj |j j ||g7}qWnx:|j D]/}|tjj |j j d ||g7}qWx-|D]%}|j j|d }|r Pq q W|S(s= Microsoft Windows SDK executable directory. g&@i#R i(g(@R?RIsWinSDK-NetFx%dTools%ss\t-g,@sv%sAR(R|RoRSRURJRAtNetFxSdkVersionRRRRzRcRRaRv( RBtnetfxverR%RItfxtregpathsR$Rtexecpath((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytWindowsSDKExecutablePaths$ ,- cCsAd|j}tjj|jj|}|jj|dp@dS(s0 Microsoft Visual F# directory. s%0.1f\Setup\F#RR (R|RRRRzRXRv(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFSharpInstallDirs cCsb|jdkrd}nd}x7|D]/}|jj|jjd|}|r%Pq%q%W|padS(s8 Microsoft Universal CRT SDK directory. g,@t10t81s kitsroot%sR (RR((R|RzRvRd(RBtversR$R((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytUniversalCRTSdkDirs   cCs|jtjj|jdS(s@ Microsoft Universal C Runtime SDK last version R(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytUniversalCRTSdkLastVersionscCs|jdkrdSdSdS(s8 Microsoft .NET Framework SDK versions. g,@s4.6.1s4.6N(s4.6.1s4.6((R|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRscCsXxK|jD]@}tjj|jj|}|jj|d}|r Pq q W|pWdS(s9 Microsoft .NET Framework SDK directory. tkitsinstallationfolderR (RRRRRzRcRv(RBR$RR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt NetFxSdkDirs cCs7tjj|jd}|jj|jjdp6|S(s; Microsoft .NET Framework 32bit directory. sMicrosoft.NET\Frameworktframeworkdir32(RRRRxRzRvR\(RBtguess_fw((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkDir32scCs7tjj|jd}|jj|jjdp6|S(s; Microsoft .NET Framework 64bit directory. sMicrosoft.NET\Framework64tframeworkdir64(RRRRxRzRvR\(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkDir64scCs |jdS(s: Microsoft .NET Framework 32bit versions. i (t_find_dot_net_versions(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkVersion32scCs |jdS(s: Microsoft .NET Framework 64bit versions. i@(R(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFrameworkVersion64scCs|jj|jjd|}t|d|}|pM|j|dpMd}|jdkrn|df}nR|jdkr|jd d krd n|d f}n|jd krd}n|jdkrd}n|S(s Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. sframeworkver%dsFrameworkDir%dtvR g(@sv4.0g$@itv4s v4.0.30319sv3.5g"@s v2.0.50727g @sv3.0(sv3.5s v2.0.50727(sv3.0s v2.0.50727(RzRvR\tgetattrRR|R6(RBtbitstreg_vert dot_net_dirR$t frameworkver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs    cs;fdttjD}t|dp:dS(s Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs startings by this prefix c3sE|];}tjjtjj|r|jr|VqdS(N(RRRRt startswith(t.0tdir_name(Rtprefix(s3/usr/lib/python2.7/site-packages/setuptools/msvc.pys )s!R N(treversedRRtnextR(RBRRt matching_dirs((RRs3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs N( RRRORPRQRxRyRRRCR{R~RRRRRRRRRRRRRRRRRRRRR(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRws4       &      R!cBseZdZdddZedZedZedZedZ edZ edZ ed Z ed Z ed Zed Zd ZedZedZedZedZedZedZedZedZedZedZedZedZedZedZdZ ddZ!RS(sY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.0. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. icCsdt||_t|j|_t|j||_|j|kr`d}tjj |ndS(Ns.No suitable Microsoft Visual C++ version found( R=RURTRzRwtsiR|RRR(RBR%R|R*R((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRCIs cCs |jjS(s/ Microsoft Visual C++ version. (RR|(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR|RscCsddg}|jdkrd|jjdtdt}|dg7}|dg7}|d|g7}ng|D]!}tjj|jj|^qkS( s/ Microsoft Visual Studio Tools s Common7\IDEs Common7\Toolsg,@RIR?s1Common7\IDE\CommonExtensions\Microsoft\TestWindowsTeam Tools\Performance ToolssTeam Tools\Performance Tools%s( R|RURJRoRRRRR(RBtpathst arch_subdirR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVSToolsYs   cCs4tjj|jjdtjj|jjdgS(sL Microsoft Visual C++ & Microsoft Foundation Class Includes tIncludesATLMFC\Include(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCIncludeshscCs|jdkr'|jjdt}n|jjdt}d|d|g}|jdkrs|d|g7}ng|D]!}tjj|jj|^qzS(sM Microsoft Visual C++ & Microsoft Foundation Class Libraries g.@R?RIsLib%ss ATLMFC\Lib%sg,@s Lib\store%s( R|RURKRoRRRRR(RBRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCLibrariespscCs/|jdkrgStjj|jjdgS(sA Microsoft Visual C++ store references Libraries g,@sLib\store\references(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt VCStoreRefsscCs|j}tjj|jdg}|jdkr9tnt}|jj |}|r}|tjj|jd|g7}n|jdkrd|jj dt}|tjj|j|g7}n|jdkrs|jj rdnd}|tjj|j||jj d tg7}|jj |jjkr|tjj|j||jj d tg7}qn|tjj|jd g7}|S( s, Microsoft Visual C++ Tools t VCPackagesg$@sBin%sg,@RIg.@s bin\HostX86%ss bin\HostX64%sR?tBin(RRRRRR|RoRSRURNRJRHRKRGRE(RBRttoolsRLRRthost_dir((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVCToolss& &" & ,cCs|jdkrJ|jjdtdt}tjj|jjd|gS|jjdt}tjj|jjd}|j }tjj|d||fgSdS(s1 Microsoft Windows SDK Libraries g$@RIR?sLib%sRs%sum%sN( R|RURKRoRRRRRt _sdk_subdir(RBRRtlibver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSLibrariess  cCstjj|jjd}|jdkrC|tjj|dgS|jdkr^|j}nd}tjj|d|tjj|d|tjj|d|gSd S( s/ Microsoft Windows SDK Include tincludeg$@tglg,@R s%sshareds%sums%swinrtN(RRRRRR|R(RBRtsdkver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSIncludess cCstjj|jjd}g}|jdkr@||j7}n|jdkrn|tjj|dg7}n|jdkr||tjj|jjdtjj|ddtjj|d dtjj|d dtjj|jjd d d |jdddg7}n|S(s7 Microsoft Windows SDK Libraries Paths t Referencesg"@g&@sCommonConfiguration\Neutralg,@t UnionMetadatas'Windows.Foundation.UniversalApiContracts1.0.0.0s%Windows.Foundation.FoundationContracts,Windows.Networking.Connectivity.WwanContractt ExtensionSDKssMicrosoft.VCLibss%0.1ftCommonConfigurationtneutral(RRRRRR|R(RBtreftlibpath((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt OSLibpaths>      cCst|jS(s- Microsoft Windows SDK Tools (tlistt _sdk_tools(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytSdkToolssccs|jdkrG|jdkr$dnd}tjj|jj|Vn|jjs|jjdt }d|}tjj|jj|Vn|jdks|jdkr |jj rd}n|jjd t dt }d |}tjj|jj|Vnl|jdkrvtjj|jjd}|jjdt }|jj }tjj|d ||fVn|jj r|jj Vnd S( s= Microsoft Windows SDK Tools paths generator g.@g&@RsBin\x86R?sBin%sg$@R RIsBin\NETFX 4.0 Tools%ss%s%sN( R|RRRRRRURHRJRoRFRR(RBtbin_dirRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs(    ! cCs|jj}|rd|SdS(s6 Microsoft Windows SDK version subdir s%s\R (RR(RBtucrtver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs cCs/|jdkrgStjj|jjdgS(s- Microsoft Windows SDK Setup g"@tSetup(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytSdkSetup%scCs|j}|j}|jdkrDt}|j o>|j }n6|jpY|j}|jdkpw|jdk}g}|r|g|jD]}t j j |j |^q7}n|r|g|j D]}t j j |j|^q7}n|S(s0 Microsoft .NET Framework Tools g$@R@(RURR|RoRFRHRGRERRRRRRR(RBRURt include32t include64RR$((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFxTools/s  //cCsU|jdks|jj r gS|jjdt}tjj|jjd|gS(s8 Microsoft .Net Framework SDK Libraries g,@R?slib\um%s( R|RRRURKRoRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytNetFxSDKLibrariesGscCs<|jdks|jj r gStjj|jjdgS(s7 Microsoft .Net Framework SDK Includes g,@s include\um(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytNetFxSDKIncludesRscCstjj|jjdgS(s> Microsoft Visual Studio Team System Database s VSTSDB\Deploy(RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVsTDb\scCs|jdkrgS|jdkrF|jj}|jjdt}n|jj}d}d|j|f}tjj ||g}|jdkr|tjj ||dg7}n|S(s( Microsoft Build Engine g(@g.@RIR sMSBuild\%0.1f\bin%stRoslyn( R|RRRURJRoRRRR(RBt base_pathRRtbuild((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytMSBuildcs  "cCs/|jdkrgStjj|jjdgS(s. Microsoft HTML Help Workshop g&@sHTML Help Workshop(R|RRRRR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytHTMLHelpWorkshopzscCsl|jdkrgS|jjdt}tjj|jjd}|j }tjj|d||fgS(s= Microsoft Universal C Runtime SDK Libraries g,@R?Rs%sucrt%s( R|RURKRoRRRRRt _ucrt_subdir(RBRRR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt UCRTLibrariess  cCsK|jdkrgStjj|jjd}tjj|d|jgS(s; Microsoft Universal C Runtime SDK Include g,@Rs%sucrt(R|RRRRRR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyt UCRTIncludesscCs|jj}|rd|SdS(sB Microsoft Universal C Runtime SDK version subdir s%s\R (RR(RBR((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs cCs,|jdkr"|jdkr"gS|jjS(s% Microsoft Visual F# g&@g(@(R|RR(RB((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytFSharpscCs|jjdt}|jdkr9|jj}d}n|jjjdd}d}|jdkrldn|j}|||j|f}tjj ||S(sA Microsoft Visual C++ runtime redistribuable dll R?is-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dlls\Toolss\Redists.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@( RURKRoR|RRRARRR(RBRt redist_patht vcruntimetdll_ver((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pytVCRuntimeRedists  cCstd|jd|j|j|j|jg|d|jd|j|j|j|j |j g|d|jd|j|j|j |j g|d|jd|j |j|j|j|j|j|j|j|jg |}|jdkrtjj|jr|j|d A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N(tsettaddRRt __contains__(RBtiterableRtseentseen_addtelementtk((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyRs         N("RRRORRCRRR|RRRRRRRRRRRRRRRRRRRRRRRRoR"RR(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyR!1s:   -         - (!RORR-tplatformR tdistutils.errorsRt#setuptools.extern.packaging.versionRtsetuptools.extern.six.movesRtmonkeyRtsystemRtenvironRPRt ImportErrorRRt_msvc9_suppress_errorstdistutils.msvc9compilerR RRR+R3R#R=RTRwR!(((s3/usr/lib/python2.7/site-packages/setuptools/msvc.pyts:         + / & %[aPK!x- lib2to3_ex.pyonu[ fc@sxdZddlmZddlmZddlmZmZddl Z defdYZ defd YZdS( sy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. i(t Mixin2to3(tlog(tRefactoringTooltget_fixers_from_packageNtDistutilsRefactoringToolcBs#eZdZdZdZRS(cOstj||dS(N(Rterror(tselftmsgtargstkw((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_errorscGstj||dS(N(Rtinfo(RRR((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_messagescGstj||dS(N(Rtdebug(RRR((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt log_debugs(t__name__t __module__R R R(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs  RcBs&eZedZdZdZRS(cCs|jjtk rdS|s dStjddj||j|j|rtj rt |j }|j |dtdtqnt j||dS(NsFixing t twritet doctests_only(t distributiontuse_2to3tTrueRR tjoint_Mixin2to3__build_fixer_namest_Mixin2to3__exclude_fixerst setuptoolstrun_2to3_on_doctestsRt fixer_namestrefactort _Mixin2to3trun_2to3(Rtfilestdocteststr((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs   cCs|jr dSg|_x'tjD]}|jjt|q W|jjdk rx-|jjD]}|jjt|q_WndS(N(RRtlib2to3_fixer_packagestextendRRtuse_2to3_fixerstNone(Rtp((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt__build_fixer_names.s  cCsqt|dg}|jjdk r:|j|jjnx0|D](}||jkrA|jj|qAqAWdS(Ntexclude_fixers(tgetattrRtuse_2to3_exclude_fixersR&R$Rtremove(Rtexcluded_fixerst fixer_name((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyt__exclude_fixers8s  (RRtFalseRRR(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyRs  ( t__doc__tdistutils.utilRRt distutilsRtlib2to3.refactorRRRR(((s9/usr/lib/python2.7/site-packages/setuptools/lib2to3_ex.pyts   PK!Üv$v$pep425tags.pycnu[ fc@@sdZddlmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ejdZdZd Zd Zd Zd Zeed ZdZdZdZdZdZdeddddZeZdS(s2Generate and work with PEP 425 Compatibility Tags.i(tabsolute_importN(t OrderedDicti(tglibcs(.+)_(\d+)_(\d+)_(.+)cC@sEytj|SWn-tk r@}tjdj|tdSXdS(Ns{}(t sysconfigtget_config_vartIOErrortwarningstwarntformattRuntimeWarningtNone(tvarte((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRs cC@sUttdrd}n9tjjdr3d}ntjdkrKd}nd}|S(s'Return abbreviated implementation name.tpypy_version_infotpptjavatjytclitiptcp(thasattrtsystplatformt startswith(tpyimpl((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_abbr_impls   cC@sDtd}| s"tdkr@djttt}n|S(sReturn implementation version.tpy_version_nodotRt(RRtjointmaptstrtget_impl_version_info(timpl_ver((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_impl_ver(s cC@sKtdkr/tjdtjjtjjfStjdtjdfSdS(sQReturn sys.version_info-like tuple for use in decrementing the minor version.RiiN(RRt version_infoR tmajortminor(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR0s cC@sdjttS(s; Returns the Tag for this specific implementation. s{}{}(RRR!(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_impl_tag;scC@sNt|}|dkrD|r=tjdj|tdn|S||kS(sgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.s?Config variable '{0}' is unset, Python ABI tag may be incorrectiN(RR RRRR (R tfallbacktexpectedRtval((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytget_flagBs   c @smtd}t| r ddhkr ttdr d}d}d}tddddkrvd }ntd fd ddkrd }ntd dddddkotjdkrtjdkrd}ndt|||f}n\|r<|jdr<d|jdd}n-|rc|j ddj dd}nd}|S(sXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).tSOABIRRt maxunicodeRtPy_DEBUGcS@s ttdS(Ntgettotalrefcount(RR(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytXRRtdt WITH_PYMALLOCc@s dkS(NR(((timpl(s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.\RtmtPy_UNICODE_SIZEcS@s tjdkS(Ni(RR+(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.`RR'iitus %s%s%s%s%sscpython-t-it.t_(ii(iiN( RRRRR)R"R!RtsplittreplaceR (tsoabiR/R2R4tabi((R1s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_abi_tagNs8  (      !cC@s tjdkS(Ni(Rtmaxsize(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt_is_running_32bitpscC@stjdkrtj\}}}|jd}|dkrQtrQd}n|dkrotrod}ndj|d|d |Stjjj dd j d d }|d krtrd }n|S(s0Return our platform name 'win32', 'linux_x86_64'tdarwinR6tx86_64ti386tppc64tppcsmacosx_{}_{}_{}iiR7R5t linux_x86_64t linux_i686( RRtmac_verR8R>Rt distutilstutilt get_platformR9(treleaseR7tmachinet split_vertresult((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRIts  ' cC@s`tddhkrtSyddl}t|jSWnttfk rOnXtjddS(NRDREiii( RItFalset _manylinuxtbooltmanylinux1_compatiblet ImportErrortAttributeErrorRthave_compatible_glibc(RO((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytis_manylinux1_compatibles c@sg}fdtdd fdd fdd fd dfg|||rj|j|nx@D]8}||krq|||rq|j|qqqqW|jd |S(sReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. c@s|dkr||fdkS|dkr8||fd kS|dkrT||fd kS|dkrp||fd kS|krx+|D]}|||rtSqWntS( NRCi iRBRAiR@(i i(i i(i i(i i(tTrueRN(R#R$tarchtgarch(t_supports_archtgroups(s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRYs      tfatRARCtintelR@tfat64RBtfat32t universal(RARC(R@RA(R@RB(R@RARC(Rtappend(R#R$RKtarchesRX((RYRZs9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytget_darwin_archess$    " cC@sg}|dkrug}t}|d }xGt|dddD],}|jdjtt||fqBWn|pt}g} |pt}|r|g| dd+nt } ddl } xK| j D]=} | dj dr| j | djdddqqW| jtt| | jd |s6|pMt} | j d rtj| }|r|j\}}}}d j||}g}xjttt|dD]@}x7tt|||D]}|j|||fqWqWqM| g}n9|dkrDtrD| jd d | g}n | g}xC| D];}x2|D]*} |jd||df|| fqaWqTWxj|dD]^}|ddhkrPnx?| D]7}x.|D]&} |jd||f|| fqWqWqWx3|D](} |jd|ddd | fqWn|jd||dfd df|jd||ddfd dfxdt|D]V\}}|jd|fd df|dkr|jd|dd dfqqW|S(scReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. iRiNs.abiR6iitnonetmacosxs {}_{}_%i_%stlinuxt manylinux1s%s%st31t30spy%stany(R RtrangeR`RRRRR<tsettimpt get_suffixesRtaddR8textendtsortedtlistRIt _osx_arch_pattmatchRZRtreversedtintRbRUR9t enumerate(tversionstnoarchRR1R;t supportedR"R#R$tabistabi3sRltsuffixRWRstnamet actual_archttplRaR2tatversionti((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_supportedsh   -  ( #"    ,  , )$( %( t__doc__t __future__Rtdistutils.utilRGRtreRRRt collectionsRRRtcompileRrRRR!RR%RVR)R<R>RIRURbR RNRtimplementation_tag(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyts0          "    = _PK! {AA config.pyonu[ fc@@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZeedZd Zed Zd efd YZd efdYZdefdYZdS(i(tabsolute_importtunicode_literalsN(t defaultdict(tpartial(t import_module(tDistutilsOptionErrortDistutilsFileError(t string_typesc C@sddlm}m}tjj|}tjj|sMtd|ntj}tj tjj |zl|}|r|j ng}||kr|j |n|j |d|t||jd|}Wdtj |Xt|S(u,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict i(t Distributiont _Distributionu%Configuration file %s does not exist.t filenamestignore_option_errorsN(tsetuptools.distRR tostpathtabspathtisfileRtgetcwdtchdirtdirnametfind_config_filestappendtparse_config_filestparse_configurationtcommand_optionstconfiguration_to_dict( tfilepatht find_othersR RR tcurrent_directorytdistR thandlers((s5/usr/lib/python2.7/site-packages/setuptools/config.pytread_configuration s$     cC@stt}x|D]w}|j}|j}x\|jD]Q}t|d|d}|dkrot||}n |}||||su,u c3@sE|];}j|strtjj|rj|VqdS(N(t _assert_localRGR RRt _read_file(RaR(RT(s5/usr/lib/python2.7/site-packages/setuptools/config.pys s(RPRR5tlenRStjoin(RTR+tinclude_directivetspect filepaths((RTs5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_files cC@s,|jtjs(td|ndS(Nu#`file:` directive can not access %s(R5R RR(R((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRbscC@s,tj|dd}|jSWdQXdS(Ntencodinguutf-8(tiotopentread(Rtf((s5/usr/lib/python2.7/site-packages/setuptools/config.pyRcscC@sd}|j|s|S|j|djjd}|j}dj|}|p^d}tjjdt j zt |}t ||}Wdtjdt_X|S(uRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str uattr:uu.u__init__iNi( R5R6R7RStpopRetsysRtinsertR RRR$(RTR+tattr_directivet attrs_patht attr_namet module_nametmodule((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt _parse_attrs !   c@sfd}|S(uReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable c@s'|}xD]}||}q W|S(N((R+tparsedtmethod(t parse_methods(s5/usr/lib/python2.7/site-packages/setuptools/config.pyR.Bs ((RTRzR.((Rzs5/usr/lib/python2.7/site-packages/setuptools/config.pyt_get_parser_compound9s cC@sLi}|pd}x0|jD]"\}\}}||||Wt(R4(RTR;t values_parserR+R[t_R]((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_section_to_dictLs cC@sIxB|jD]4\}\}}y|||||d<|d=n|S(Nu*u(RRWRC(R9R;Rxtroot((s5/usr/lib/python2.7/site-packages/setuptools/config.pyt_parse_package_data s   cC@s|j||ds   .  ;PK!HJMM!_vendor/packaging/_structures.pyonu[ fc@`s^ddlmZmZmZdefdYZeZdefdYZeZdS(i(tabsolute_importtdivisiontprint_functiontInfinitycB`sYeZdZdZdZdZdZdZdZdZ dZ RS( cC`sdS(NR((tself((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__repr__ scC`stt|S(N(thashtrepr(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__hash__ scC`stS(N(tFalse(Rtother((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__lt__scC`stS(N(R (RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__le__scC`st||jS(N(t isinstancet __class__(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__eq__scC`st||j S(N(R R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__ne__scC`stS(N(tTrue(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__gt__scC`stS(N(R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__ge__scC`stS(N(tNegativeInfinity(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__neg__!s( t__name__t __module__RRR R RRRRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyRs        RcB`sYeZdZdZdZdZdZdZdZdZ dZ RS( cC`sdS(Ns -Infinity((R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR)scC`stt|S(N(RR(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR,scC`stS(N(R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR /scC`stS(N(R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR 2scC`st||jS(N(R R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR5scC`st||j S(N(R R(RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR8scC`stS(N(R (RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR;scC`stS(N(R (RR ((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR>scC`stS(N(R(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyRAs( RRRRR R RRRRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR's        N(t __future__RRRtobjectRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyts PK!>;j8j8_vendor/packaging/version.pycnu[ fc@`snddlmZmZmZddlZddlZddlZddlmZddddd gZ ej d d d d dddgZ dZ de fdYZdefdYZdefdYZejdejZidd6dd6dd6dd6dd 6ZdZdZdZdefd YZd!Zejd"Zd#Zd$ZdS(%i(tabsolute_importtdivisiontprint_functionNi(tInfinitytparsetVersiont LegacyVersiontInvalidVersiontVERSION_PATTERNt_VersiontepochtreleasetdevtpretposttlocalcC`s-yt|SWntk r(t|SXdS(s Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. N(RRR(tversion((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRs cB`seZdZRS(sF An invalid version was found, users should refer to PEP 440. (t__name__t __module__t__doc__(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR$st _BaseVersioncB`sPeZdZdZdZdZdZdZdZdZ RS(cC`s t|jS(N(thasht_key(tself((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__hash__,scC`s|j|dS(NcS`s ||kS(N((tsto((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt0t(t_compare(Rtother((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__lt__/scC`s|j|dS(NcS`s ||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR3R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__le__2scC`s|j|dS(NcS`s ||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR6R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__eq__5scC`s|j|dS(NcS`s ||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR9R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__ge__8scC`s|j|dS(NcS`s ||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR<R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__gt__;scC`s|j|dS(NcS`s ||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR?R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__ne__>scC`s&t|tstS||j|jS(N(t isinstanceRtNotImplementedR(RRtmethod((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRAs( RRRRR R!R"R#R$R(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR*s       cB`sneZdZdZdZedZedZedZedZ edZ RS(cC`s%t||_t|j|_dS(N(tstrt_versiont_legacy_cmpkeyR(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__init__JscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__str__NscC`sdjtt|S(Ns(tformattreprR((R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__repr__QscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pytpublicTscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt base_versionXscC`sdS(N(tNone(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR\scC`stS(N(tFalse(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt is_prerelease`scC`stS(N(R3(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pytis_postreleaseds( RRR+R,R/tpropertyR0R1RR4R5(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRHs   s(\d+ | [a-z]+ | \.| -)tctpreviewsfinal-t-trct@cc`sxxltj|D][}tj||}| s|dkrAqn|d dkrb|jdVqd|VqWdVdS(Nt.it 0123456789it*s*final(t_legacy_version_component_retsplitt_legacy_version_replacement_maptgettzfill(Rtpart((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt_parse_version_partsrs cC`sd}g}xt|jD]}|jdr|dkrjx'|rf|ddkrf|jqCWnx'|r|ddkr|jqmWn|j|qWt|}||fS(NiR>s*finals*final-t00000000(REtlowert startswithtpoptappendttuple(RR tpartsRD((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR*s  s v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
cB`seZejdedejejBZdZdZ	dZ
edZedZ
edZedZed	ZRS(
s^\s*s\s*$cC`s[|jj|}|s0tdj|ntd|jdrZt|jdnddtd|jdjdDdt	|jd|jd	d
t	|jd|jdp|jd
dt	|jd|jddt
|jd|_t|jj
|jj|jj|jj|jj|jj|_dS(NsInvalid version: '{0}'R
iRcs`s|]}t|VqdS(N(tint(t.0ti((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sR<R
tpre_ltpre_nRtpost_ltpost_n1tpost_n2Rtdev_ltdev_nR(t_regextsearchRR-R	tgroupRMRKR@t_parse_letter_versiont_parse_local_versionR)t_cmpkeyR
RR
RRRR(RRtmatch((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR+s.*(!					cC`sdjtt|S(Ns(R-R.R((R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR/scC`sSg}|jjdkr7|jdj|jjn|jdjd|jjD|jjdk	r|jdjd|jjDn|jjdk	r|jdj|jjdn|jj	dk	r|jd	j|jj	dn|jj
dk	rF|jd
jdjd|jj
Dndj|S(Nis{0}!R<cs`s|]}t|VqdS(N(R((RNtx((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sRcs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	ss.post{0}is.dev{0}s+{0}cs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	s(R)R
RJR-tjoinRR
R2RRR(RRL((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR,s&)##,cC`st|jdddS(Nt+ii(R(R@(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR0
scC`sjg}|jjdkr7|jdj|jjn|jdjd|jjDdj|S(Nis{0}!R<cs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sR(R)R
RJR-R_R(RRL((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR1s
&cC`s0t|}d|kr,|jdddSdS(NR`i(R(R@(Rtversion_string((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRscC`st|jjp|jjS(N(tboolR)RR
(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR4!scC`st|jjS(N(RbR)R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR5%s(RRtretcompileRtVERBOSEt
IGNORECASERWR+R/R,R6R0R1RR4R5(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRs	#		
cC`s|r|dkrd}n|j}|dkr<d}n?|dkrQd}n*|d
krfd	}n|dkr{d}n|t|fS|r|rd}|t|fSdS(NitalphatatbetatbR7R
R8R:trevtrR(R7R
R8(RkRl(R2RGRM(tlettertnumber((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRZ*s 					
s[\._-]cC`s-|dk	r)tdtj|DSdS(sR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    cs`s3|])}|js!|jn	t|VqdS(N(tisdigitRGRM(RNRD((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	RsN(R2RKt_local_version_seperatorsR@(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR[LscC`sttttjdt|}|dkr[|dkr[|dk	r[t}n|dkrpt}n|dkrt}n|dkrt}n|dkrt}ntd|D}||||||fS(NcS`s
|dkS(Ni((R^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR`Rcs`s7|]-}t|tr$|dfn
t|fVqdS(RN(R%RMR(RNRO((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	s(RKtreversedtlistt	itertoolst	dropwhileR2R(R
RR
RRR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR\Ws&	$
	
	
	
(t
__future__RRRtcollectionsRsRct_structuresRt__all__t
namedtupleR	Rt
ValueErrorRtobjectRRRdReR?RARER*RRRZRpR[R\(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyts0	!&		9k		PK!kVFcc_vendor/packaging/__init__.pyonu[
fc@`sxddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZdddddd	d
dgZ
dS(
i(tabsolute_importtdivisiontprint_functioni(t
__author__t
__copyright__t	__email__t__license__t__summary__t	__title__t__uri__t__version__RRR	R
RRRRN(t
__future__RRRt	__about__RRRRRRR	R
t__all__(((sI/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/__init__.pyts:PK!f_vendor/packaging/_compat.pycnu[
fc@`svddlmZmZmZddlZejddkZejddkZer`efZ	n	e
fZ	dZdS(i(tabsolute_importtdivisiontprint_functionNiic`s5dffdY}tj|ddiS(s/
    Create a base class with a metaclass.
    t	metaclassc`seZfdZRS(c`s||S(N((tclstnamet
this_basestd(tbasestmeta(sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyt__new__s(t__name__t
__module__R
((RR	(sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyRsttemporary_class((ttypeR
(R	RR((RR	sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pytwith_metaclasss(t
__future__RRRtsystversion_infotPY2tPY3tstrtstring_typest
basestringR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyts	PK!b
bb _vendor/packaging/specifiers.pyonu[
fc@`s<ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZdefdYZde
ejefd	YZd
efdYZdefd
YZdZdefdYZejdZdZdZdefdYZdS(i(tabsolute_importtdivisiontprint_functionNi(tstring_typestwith_metaclass(tVersiont
LegacyVersiontparsetInvalidSpecifiercB`seZdZRS(sH
    An invalid specifier was found, users should refer to PEP 440.
    (t__name__t
__module__t__doc__(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRst
BaseSpecifiercB`seZejdZejdZejdZejdZejdZ	e	j
dZ	ejddZejddZ
RS(	cC`sdS(s
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        N((tself((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__str__tcC`sdS(sF
        Returns a hash value for this Specifier like object.
        N((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__hash__RcC`sdS(sq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        N((R
tother((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__eq__$RcC`sdS(su
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        N((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__ne__+RcC`sdS(sg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        N((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytprereleases2RcC`sdS(sd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        N((R
tvalue((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR9RcC`sdS(sR
        Determines if the given item is contained within this specifier.
        N((R
titemR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytcontains@RcC`sdS(s
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        N((R
titerableR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytfilterFRN(R	R
tabctabstractmethodRRRRtabstractpropertyRtsettertNoneRR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRst_IndividualSpecifiercB`seZiZdddZdZdZdZdZdZ	dZ
dZed	Z
ed
ZedZejdZd
ZddZddZRS(RcC`sj|jj|}|s0tdj|n|jdj|jdjf|_||_dS(NsInvalid specifier: '{0}'toperatortversion(t_regextsearchRtformattgrouptstript_spect_prereleases(R
tspecRtmatch((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__init__RscC`sF|jdk	r!dj|jnd}dj|jjt||S(Ns, prereleases={0!r}Rs<{0}({1!r}{2})>(R(RR$Rt	__class__R	tstr(R
tpre((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__repr___s!		cC`sdj|jS(Ns{0}{1}(R$R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRlscC`s
t|jS(N(thashR'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRoscC`s`t|tr:y|j|}WqPtk
r6tSXnt||jsPtS|j|jkS(N(t
isinstanceRR,RtNotImplementedR'(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRrs
cC`s`t|tr:y|j|}WqPtk
r6tSXnt||jsPtS|j|jkS(N(R1RR,RR2R'(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR}s
cC`st|dj|j|S(Ns_compare_{0}(tgetattrR$t
_operators(R
top((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt
_get_operatorscC`s(t|ttfs$t|}n|S(N(R1RRR(R
R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_coerce_versionscC`s|jdS(Ni(R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR scC`s|jdS(Ni(R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR!scC`s|jS(N(R((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
|j|S(N(R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__contains__scC`sW|dkr|j}n|j|}|jr;|r;tS|j|j||jS(N(RRR7t
is_prereleasetFalseR6R R!(R
RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscc`st}g}i|dk	r!|ntd6}xf|D]^}|j|}|j||r2|jr|pn|jr|j|qt}|Vq2q2W|r|rx|D]}|VqWndS(NR(R:RtTrueR7RR9Rtappend(R
RRtyieldedtfound_prereleasestkwR!tparsed_version((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
	

N(R	R
R4RR+R/RRRRR6R7tpropertyR R!RRR8RR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRNs 
	
							tLegacySpecifiercB`seZdZejdedejejBZidd6dd6dd6d	d
6dd6d
d6ZdZ	dZ
dZdZdZ
dZdZRS(s
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        s^\s*s\s*$tequals==t	not_equals!=tless_than_equals<=tgreater_than_equals>=t	less_thantcC`s(t|ts$tt|}n|S(N(R1RR-(R
R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR7scC`s||j|kS(N(R7(R
tprospectiveR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_not_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_less_than_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_greater_than_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_less_thanscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_greater_thans(R	R
t
_regex_strtretcompiletVERBOSEt
IGNORECASER"R4R7RLRMRNRORPRQ(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRBs"

						c`s"tjfd}|S(Nc`s#t|tstS|||S(N(R1RR:(R
RKR)(tfn(sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytwrappeds(t	functoolstwraps(RWRX((RWsK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_require_version_compare
st	SpecifiercB`seZdZejdedejejBZidd6dd6dd6d	d
6dd6d
d6dd6dd6Ze	dZ
e	dZe	dZe	dZ
e	dZe	dZe	dZdZedZejdZRS(s
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=RGRHRIRJt	arbitrarys===cC`sfdjttjdt|d }|d7}|jd||oe|jd||S(Nt.cS`s|jdo|jdS(Ntposttdev(t
startswith(tx((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytsis.*s>=s==(tjointlistt	itertoolst	takewhilet_version_splitR6(R
RKR)tprefix((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_compatibles

cC`s|jdrht|j}t|d }tt|}|t| }t||\}}n't|}|jst|j}n||kS(Ns.*i(tendswithRtpublicRiR-tlent_pad_versiontlocal(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRLs	cC`s|j||S(N(RL(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRMscC`s|t|kS(N(R(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRNscC`s|t|kS(N(R(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyROscC`sXt|}||kstS|jrT|jrTt|jt|jkrTtSntS(N(RR:R9tbase_versionR;(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRPscC`st|}||kstS|jrT|jrTt|jt|jkrTtSn|jdk	rt|jt|jkrtSntS(N(RR:tis_postreleaseRqRpRR;(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRQscC`s"t|jt|jkS(N(R-tlower(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_arbitraryscC`ss|jdk	r|jS|j\}}|dkro|dkrY|jdrY|d }nt|jrotSntS(	Ns==s>=s<=s~=s===s.*i(s==s>=s<=s~=s===(R(RR'RlRR9R;R:(R
R R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
cC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs(R	R
RRRSRTRURVR"R4R[RkRLRMRNRORPRQRtRARR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR\s,^
#	s^([0-9]+)((?:a|b|c|rc)[0-9]+)$cC`s\g}xO|jdD]>}tj|}|rG|j|jq|j|qW|S(NR_(tsplitt
_prefix_regexR#textendtgroupsR<(R!tresultRR*((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRi'sc	C`sgg}}|jttjd||jttjd||j|t|d|j|t|d|jddgtdt|dt|d|jddgtdt|dt|dttj|ttj|fS(NcS`s
|jS(N(tisdigit(Rc((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRd6RcS`s
|jS(N(Rz(Rc((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRd7Riit0(R<RfRgRhRntinserttmaxtchain(tlefttrightt
left_splittright_split((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRo2s
""//tSpecifierSetcB`seZdddZdZdZdZdZdZdZ	dZ
d	Zed
Z
e
jdZ
dZdd
ZddZRS(RcC`sg|jdD]}|jr|j^q}t}xL|D]D}y|jt|WqDtk
r|jt|qDXqDWt||_||_	dS(Nt,(
RuR&tsettaddR\RRBt	frozensett_specsR((R
t
specifiersRtstparsedt	specifier((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR+Os4	

cC`s=|jdk	r!dj|jnd}djt||S(Ns, prereleases={0!r}Rs(R(RR$RR-(R
R.((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR/ds!cC`s djtd|jDS(NRcs`s|]}t|VqdS(N(R-(t.0R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	ns(RetsortedR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRmscC`s
t|jS(N(R0R(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRpscC`st|trt|}nt|ts1tSt}t|j|jB|_|jdkr|jdk	r|j|_nZ|jdk	r|jdkr|j|_n-|j|jkr|j|_ntd|S(NsFCannot combine SpecifierSets with True and False prerelease overrides.(	R1RRR2RRR(Rt
ValueError(R
RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__and__ss		cC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
t|jS(N(RnR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__len__scC`s
t|jS(N(titerR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__iter__scC`s:|jdk	r|jS|js#dStd|jDS(Ncs`s|]}|jVqdS(N(R(RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	s(R(RRtany(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
	cC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
|j|S(N(R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR8sc`sptttfs$tndkr<|jnrPjrPtStfd|j	DS(Nc3`s$|]}|jdVqdS(RN(R(RR(RR(sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	s(
R1RRRRRR9R:tallR(R
RR((RRsK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s|dkr|j}n|jrTx,|jD]!}|j|dt|}q+W|Sg}g}x|D]{}t|ttfst|}n|}t|trqgn|j	r|r|s|j
|qqg|j
|qgW|r|r|dkr|S|SdS(NR(RRRRtboolR1RRRR9R<(R
RRR)tfilteredR>RR@((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs*	
N(R	R
RR+R/RRRRRRRRARRR8RR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRMs						
	
			(t
__future__RRRRRYRgRSt_compatRRR!RRRRRtABCMetatobjectRRRBR[R\RTRvRiRoR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyts""94				PK!90_vendor/packaging/__about__.pyonu[
fc@`srddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS(i(tabsolute_importtdivisiontprint_functiont	__title__t__summary__t__uri__t__version__t
__author__t	__email__t__license__t
__copyright__t	packagings"Core utilities for Python packagess!https://github.com/pypa/packagings16.8s)Donald Stufft and individual contributorssdonald@stufft.ios"BSD or Apache License, Version 2.0sCopyright 2014-2016 %sN(
t
__future__RRRt__all__RRRRRRR	R
(((sJ/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/__about__.pytsPK!:=.._vendor/packaging/markers.pycnu[
fc@`suddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZmZd	d
ddd
gZd	efdYZd
efdYZdefdYZdefdYZdefdYZdefdYZ defdYZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"id#d$6d"d%6dd&6dd'6dd(6dd)6Z#e"j$d+ed,ed-Bed.Bed/Bed0Bed1Bed2Bed3BZ%e%ed4Bed5BZ&e&j$d6ed7ed8BZ'e'j$d9ed:ed;BZ(e"e'BZ)ee)e&e)Z*e*j$d<ed=j+Z,ed>j+Z-eZ.e*ee,e.e-BZ/e.e/e
e(e.>ee.eZ0d?Z1e2d@Z3idAd56dBd46ej4d36ej5d/6ej6d-6ej7d06ej8d.6ej9d26Z:dCZ;eZ<dDZ=dEZ>dFZ?dGZ@defdHYZAdS(Ii(tabsolute_importtdivisiontprint_functionN(tParseExceptiontParseResultststringStartt	stringEnd(t
ZeroOrMoretGrouptForwardtQuotedString(tLiterali(tstring_types(t	SpecifiertInvalidSpecifiert
InvalidMarkertUndefinedComparisontUndefinedEnvironmentNametMarkertdefault_environmentcB`seZdZRS(sE
    An invalid marker was found, users should refer to PEP 508.
    (t__name__t
__module__t__doc__(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscB`seZdZRS(sP
    An invalid operation was attempted on a value that doesn't support it.
    (RRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscB`seZdZRS(s\
    A name was attempted to be used that does not exist inside of the
    environment.
    (RRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR%stNodecB`s,eZdZdZdZdZRS(cC`s
||_dS(N(tvalue(tselfR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__init__.scC`s
t|jS(N(tstrR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__str__1scC`sdj|jjt|S(Ns<{0}({1!r})>(tformatt	__class__RR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__repr__4scC`s
tdS(N(tNotImplementedError(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt	serialize7s(RRRRRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR,s			tVariablecB`seZdZRS(cC`s
t|S(N(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!=s(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR";stValuecB`seZdZRS(cC`s
dj|S(Ns"{0}"(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!Cs(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR#AstOpcB`seZdZRS(cC`s
t|S(N(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!Is(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR$Gstimplementation_versiontplatform_python_implementationtimplementation_nametpython_full_versiontplatform_releasetplatform_versiontplatform_machinetplatform_systemtpython_versiontsys_platformtos_namesos.namessys.platformsplatform.versionsplatform.machinesplatform.python_implementationtpython_implementationtextracC`sttj|d|dS(Ni(R"tALIASEStget(tstltt((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytits===s==s>=s<=s!=s~=t>tst RARB(	RCtlistR@RtAssertionErrortlenRHtjoinR!(tmarkerRGtinnerRK((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRHs!
&cC`s
||kS(N((tlhstrhs((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR7R8cC`s
||kS(N((RSRT((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR7R8cC`sy%tdj|j|g}Wntk
r8nX|j|Stj|j}|dkrtdj	|||n|||S(NR8s#Undefined {0!r} on {1!r} and {2!r}.(
R
RPR!Rtcontainst
_operatorsR3tNoneRR(RStopRTtspectoper((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt_eval_ops%

cC`s:|j|t}|tkr6tdj|n|S(Ns/{0!r} does not exist in evaluation environment.(R3t
_undefinedRR(tenvironmenttnameR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt_get_envs
c	C`s,gg}x|D]}t|tttfs4tt|tr`|djt||qt|tr|\}}}t|trt||j	}|j	}n|j	}t||j	}|djt
|||q|dkst|dkr|jgqqWtd|DS(NiR>R?cs`s|]}t|VqdS(N(tall(RJtitem((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pys	s(R>R?(RCRMR@RRNtappendt_evaluate_markersR"R_RR[tany(	tmarkersR]tgroupsRQRSRXRTt	lhs_valuet	rhs_value((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRcs"	
	 cC`sFdj|}|j}|dkrB||dt|j7}n|S(Ns{0.major}.{0.minor}.{0.micro}tfinali(RtreleaselevelRtserial(tinfotversiontkind((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytformat_full_versions
	cC`sttdr0ttjj}tjj}nd}d}i|d6|d6tjd6tjd6tj	d6tj
d	6tjd
6tjd6tjd6tjd
 d6tjd6S(Ntimplementationt0R8R'R%R/R+R)R,R*R(R&iR-R.(
thasattrtsysRoRpRmR^tostplatformtmachinetreleasetsystemR-R0(tiverR'((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRs"






cB`s/eZdZdZdZddZRS(cC`seyttj||_WnBtk
r`}dj|||j|jd!}t|nXdS(Ns+Invalid marker: {0!r}, parse error at {1!r}i(RDtMARKERtparseStringt_markersRRtlocR(RRQteterr_str((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`s
t|jS(N(RHR|(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`sdjt|S(Ns(RR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`s5t}|dk	r%|j|nt|j|S(s$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N(RRWtupdateRcR|(RR]tcurrent_environment((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytevaluate s		N(RRRRRRWR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRs			(Bt
__future__RRRtoperatorRtRuRstsetuptools.extern.pyparsingRRRRRRR	R
RtLt_compatRt
specifiersR
Rt__all__t
ValueErrorRRRtobjectRR"R#R$tVARIABLER2tsetParseActiontVERSION_CMPt	MARKER_OPtMARKER_VALUEtBOOLOPt
MARKER_VARtMARKER_ITEMtsuppresstLPARENtRPARENtMARKER_EXPRtMARKER_ATOMRzRDtTrueRHtlttleteqtnetgetgtRVR[R\R_RcRoRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyts|""	

	E

		







						PK!90_vendor/packaging/__about__.pycnu[
fc@`srddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS(i(tabsolute_importtdivisiontprint_functiont	__title__t__summary__t__uri__t__version__t
__author__t	__email__t__license__t
__copyright__t	packagings"Core utilities for Python packagess!https://github.com/pypa/packagings16.8s)Donald Stufft and individual contributorssdonald@stufft.ios"BSD or Apache License, Version 2.0sCopyright 2014-2016 %sN(
t
__future__RRRt__all__RRRRRRR	R
(((sJ/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/__about__.pytsPK!&p,,"_vendor/packaging/requirements.pyonu[
fc@`sYddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZmZdd	lmZmZmZd
efdYZeejejZ edj!Z"ed
j!Z#edj!Z$edj!Z%edj!Z&edj!Z'edj!Z(edZ)e ee)e BZ*ee ee*Z+e+dZ,e+Z-eddZ.e(e.Z/e-ee&e-Z0e"e
e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7ee&e7ddde8dZ9e
e$e9e%e9BZ:e:j;de	e:dZ<e<j;de	edZej;de'Z=e=eZ>e<e
e>Z?e/e
e>Z@e,e
e1e@e?BZAeeAeZBd eCfd!YZDdS("i(tabsolute_importtdivisiontprint_functionN(tstringStartt	stringEndtoriginalTextFortParseException(t
ZeroOrMoretWordtOptionaltRegextCombine(tLiteral(tparsei(tMARKER_EXPRtMarker(tLegacySpecifiert	SpecifiertSpecifierSettInvalidRequirementcB`seZdZRS(sJ
    An invalid requirement was found, users should refer to PEP 508.
    (t__name__t
__module__t__doc__(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyRst[t]t(t)t,t;t@s-_.tnames[^ ]+turltextrast
joinStringtadjacentt	_raw_speccC`s
|jpdS(Nt(R#(tstltt((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt6R$t	specifiercC`s|dS(Ni((R%R&R'((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR(9R$tmarkercC`st||j|j!S(N(Rt_original_startt
_original_end(R%R&R'((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR(=R$tRequirementcB`s)eZdZdZdZdZRS(sParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    cC`sytj|}Wn9tk
rN}tdj||j|jd!nX|j|_|jrtj|j}|j	o|j
s|j	r|j
rtdn|j|_n	d|_t|j
r|j
jng|_
t|j|_|jr|jnd|_dS(Ns+Invalid requirement, parse error at "{0!r}"isInvalid URL given(tREQUIREMENTtparseStringRRtformattlocRRturlparsetschemetnetloctNonetsetR tasListRR)R*(tselftrequirement_stringtreqtet
parsed_url((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__init__Xs"!		'cC`s|jg}|jr@|jdjdjt|jn|jrb|jt|jn|jr|jdj|jn|j	r|jdj|j	ndj|S(Ns[{0}]Rs@ {0}s; {0}R$(
RR tappendR0tjointsortedR)tstrRR*(R8tparts((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__str__ms	+			cC`sdjt|S(Ns(R0RA(R8((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__repr__~s(RRRR=RCRD(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR-Ks		(Et
__future__RRRtstringtretsetuptools.extern.pyparsingRRRRRRR	R
RRtLt"setuptools.extern.six.moves.urllibR
R2tmarkersRRt
specifiersRRRt
ValueErrorRt
ascii_letterstdigitstALPHANUMtsuppresstLBRACKETtRBRACKETtLPARENtRPARENtCOMMAt	SEMICOLONtATtPUNCTUATIONtIDENTIFIER_ENDt
IDENTIFIERtNAMEtEXTRAtURItURLtEXTRAS_LISTtEXTRASt
_regex_strtVERBOSEt
IGNORECASEtVERSION_PEP440tVERSION_LEGACYtVERSION_ONEtFalsetVERSION_MANYt
_VERSION_SPECtsetParseActiontVERSION_SPECtMARKER_SEPERATORtMARKERtVERSION_AND_MARKERtURL_AND_MARKERtNAMED_REQUIREMENTR.tobjectR-(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pytsZ"(



PK!HJMM!_vendor/packaging/_structures.pycnu[
fc@`s^ddlmZmZmZdefdYZeZdefdYZeZdS(i(tabsolute_importtdivisiontprint_functiontInfinitycB`sYeZdZdZdZdZdZdZdZdZ	dZ
RS(	cC`sdS(NR((tself((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__repr__	scC`stt|S(N(thashtrepr(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__hash__scC`stS(N(tFalse(Rtother((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__lt__scC`stS(N(R	(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__le__scC`st||jS(N(t
isinstancet	__class__(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__eq__scC`st||jS(N(R
R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__ne__scC`stS(N(tTrue(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__gt__scC`stS(N(R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__ge__scC`stS(N(tNegativeInfinity(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyt__neg__!s(t__name__t
__module__RRRRRRRRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyRs								RcB`sYeZdZdZdZdZdZdZdZdZ	dZ
RS(	cC`sdS(Ns	-Infinity((R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR)scC`stt|S(N(RR(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR,scC`stS(N(R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR/scC`stS(N(R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR2scC`st||jS(N(R
R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR5scC`st||jS(N(R
R(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR8scC`stS(N(R	(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR;scC`stS(N(R	(RR
((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR>scC`stS(N(R(R((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyRAs(RRRRRRRRRRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyR's								N(t
__future__RRRtobjectRR(((sL/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_structures.pyts	PK!-.-._vendor/packaging/markers.pyonu[
fc@`suddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZmZd	d
ddd
gZd	efdYZd
efdYZdefdYZdefdYZdefdYZdefdYZ defdYZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"id#d$6d"d%6dd&6dd'6dd(6dd)6Z#e"j$d+ed,ed-Bed.Bed/Bed0Bed1Bed2Bed3BZ%e%ed4Bed5BZ&e&j$d6ed7ed8BZ'e'j$d9ed:ed;BZ(e"e'BZ)ee)e&e)Z*e*j$d<ed=j+Z,ed>j+Z-eZ.e*ee,e.e-BZ/e.e/e
e(e.>ee.eZ0d?Z1e2d@Z3idAd56dBd46ej4d36ej5d/6ej6d-6ej7d06ej8d.6ej9d26Z:dCZ;eZ<dDZ=dEZ>dFZ?dGZ@defdHYZAdS(Ii(tabsolute_importtdivisiontprint_functionN(tParseExceptiontParseResultststringStartt	stringEnd(t
ZeroOrMoretGrouptForwardtQuotedString(tLiterali(tstring_types(t	SpecifiertInvalidSpecifiert
InvalidMarkertUndefinedComparisontUndefinedEnvironmentNametMarkertdefault_environmentcB`seZdZRS(sE
    An invalid marker was found, users should refer to PEP 508.
    (t__name__t
__module__t__doc__(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscB`seZdZRS(sP
    An invalid operation was attempted on a value that doesn't support it.
    (RRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscB`seZdZRS(s\
    A name was attempted to be used that does not exist inside of the
    environment.
    (RRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR%stNodecB`s,eZdZdZdZdZRS(cC`s
||_dS(N(tvalue(tselfR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__init__.scC`s
t|jS(N(tstrR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__str__1scC`sdj|jjt|S(Ns<{0}({1!r})>(tformatt	__class__RR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt__repr__4scC`s
tdS(N(tNotImplementedError(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt	serialize7s(RRRRRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR,s			tVariablecB`seZdZRS(cC`s
t|S(N(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!=s(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR";stValuecB`seZdZRS(cC`s
dj|S(Ns"{0}"(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!Cs(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR#AstOpcB`seZdZRS(cC`s
t|S(N(R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR!Is(RRR!(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR$Gstimplementation_versiontplatform_python_implementationtimplementation_nametpython_full_versiontplatform_releasetplatform_versiontplatform_machinetplatform_systemtpython_versiontsys_platformtos_namesos.namessys.platformsplatform.versionsplatform.machinesplatform.python_implementationtpython_implementationtextracC`sttj|d|dS(Ni(R"tALIASEStget(tstltt((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytits===s==s>=s<=s!=s~=t>tst RARB(RCtlisttlenR@RHtjoinR!(tmarkerRGtinnerRK((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRHs!
&cC`s
||kS(N((tlhstrhs((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR7R8cC`s
||kS(N((RRRS((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyR7R8cC`sy%tdj|j|g}Wntk
r8nX|j|Stj|j}|dkrtdj	|||n|||S(NR8s#Undefined {0!r} on {1!r} and {2!r}.(
R
ROR!Rtcontainst
_operatorsR3tNoneRR(RRtopRStspectoper((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt_eval_ops%

cC`s:|j|t}|tkr6tdj|n|S(Ns/{0!r} does not exist in evaluation environment.(R3t
_undefinedRR(tenvironmenttnameR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyt_get_envs
c	C`sgg}x|D]}t|trB|djt||qt|tr|\}}}t|trt||j}|j}n|j}t||j}|djt|||q|dkr|jgqqWt	d|DS(NiR?cs`s|]}t|VqdS(N(tall(RJtitem((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pys	s(
RCRMtappendt_evaluate_markersR@R"R^RRZtany(	tmarkersR\tgroupsRPRRRWRSt	lhs_valuet	rhs_value((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRbs	
	 cC`sFdj|}|j}|dkrB||dt|j7}n|S(Ns{0.major}.{0.minor}.{0.micro}tfinali(RtreleaselevelRtserial(tinfotversiontkind((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytformat_full_versions
	cC`sttdr0ttjj}tjj}nd}d}i|d6|d6tjd6tjd6tj	d6tj
d	6tjd
6tjd6tjd6tjd
 d6tjd6S(Ntimplementationt0R8R'R%R/R+R)R,R*R(R&iR-R.(
thasattrtsysRnRoRlR]tostplatformtmachinetreleasetsystemR-R0(tiverR'((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRs"






cB`s/eZdZdZdZddZRS(cC`seyttj||_WnBtk
r`}dj|||j|jd!}t|nXdS(Ns+Invalid marker: {0!r}, parse error at {1!r}i(RDtMARKERtparseStringt_markersRRtlocR(RRPteterr_str((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`s
t|jS(N(RHR{(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`sdjt|S(Ns(RR(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRscC`s5t}|dk	r%|j|nt|j|S(s$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N(RRVtupdateRbR{(RR\tcurrent_environment((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pytevaluate s		N(RRRRRRVR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyRs			(Bt
__future__RRRtoperatorRsRtRrtsetuptools.extern.pyparsingRRRRRRR	R
RtLt_compatRt
specifiersR
Rt__all__t
ValueErrorRRRtobjectRR"R#R$tVARIABLER2tsetParseActiontVERSION_CMPt	MARKER_OPtMARKER_VALUEtBOOLOPt
MARKER_VARtMARKER_ITEMtsuppresstLPARENtRPARENtMARKER_EXPRtMARKER_ATOMRyRDtTrueRHtlttleteqtnetgetgtRURZR[R^RbRnRR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/markers.pyts|""	

	E

		







						PK!5WRR_vendor/packaging/utils.pycnu[
fc@`sDddlmZmZmZddlZejdZdZdS(i(tabsolute_importtdivisiontprint_functionNs[-_.]+cC`stjd|jS(Nt-(t_canonicalize_regextsubtlower(tname((sF/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/utils.pytcanonicalize_names(t
__future__RRRtretcompileRR(((sF/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/utils.pytsPK!f_vendor/packaging/_compat.pyonu[
fc@`svddlmZmZmZddlZejddkZejddkZer`efZ	n	e
fZ	dZdS(i(tabsolute_importtdivisiontprint_functionNiic`s5dffdY}tj|ddiS(s/
    Create a base class with a metaclass.
    t	metaclassc`seZfdZRS(c`s||S(N((tclstnamet
this_basestd(tbasestmeta(sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyt__new__s(t__name__t
__module__R
((RR	(sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyRsttemporary_class((ttypeR
(R	RR((RR	sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pytwith_metaclasss(t
__future__RRRtsystversion_infotPY2tPY3tstrtstring_typest
basestringR(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/_compat.pyts	PK!>;j8j8_vendor/packaging/version.pyonu[
fc@`snddlmZmZmZddlZddlZddlZddlmZddddd	gZ	ej
d
ddd
dddgZdZde
fdYZdefdYZdefdYZejdejZidd6dd6dd6dd6dd
6ZdZdZdZdefd YZd!Zejd"Zd#Zd$ZdS(%i(tabsolute_importtdivisiontprint_functionNi(tInfinitytparsetVersiont
LegacyVersiontInvalidVersiontVERSION_PATTERNt_VersiontepochtreleasetdevtpretposttlocalcC`s-yt|SWntk
r(t|SXdS(s
    Parse the given version string and return either a :class:`Version` object
    or a :class:`LegacyVersion` object depending on if the given version is
    a valid PEP 440 version or a legacy version.
    N(RRR(tversion((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRs
cB`seZdZRS(sF
    An invalid version was found, users should refer to PEP 440.
    (t__name__t
__module__t__doc__(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR$st_BaseVersioncB`sPeZdZdZdZdZdZdZdZdZ	RS(cC`s
t|jS(N(thasht_key(tself((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__hash__,scC`s|j|dS(NcS`s
||kS(N((tsto((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt0t(t_compare(Rtother((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__lt__/scC`s|j|dS(NcS`s
||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR3R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__le__2scC`s|j|dS(NcS`s
||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR6R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__eq__5scC`s|j|dS(NcS`s
||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR9R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__ge__8scC`s|j|dS(NcS`s
||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR<R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__gt__;scC`s|j|dS(NcS`s
||kS(N((RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR?R(R(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__ne__>scC`s&t|tstS||j|jS(N(t
isinstanceRtNotImplementedR(RRtmethod((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRAs(
RRRRR R!R"R#R$R(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR*s							cB`sneZdZdZdZedZedZedZedZ	edZ
RS(cC`s%t||_t|j|_dS(N(tstrt_versiont_legacy_cmpkeyR(RR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__init__JscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__str__NscC`sdjtt|S(Ns(tformattreprR((R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt__repr__QscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pytpublicTscC`s|jS(N(R)(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pytbase_versionXscC`sdS(N(tNone(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR\scC`stS(N(tFalse(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt
is_prerelease`scC`stS(N(R3(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pytis_postreleaseds(RRR+R,R/tpropertyR0R1RR4R5(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRHs			s(\d+ | [a-z]+ | \.| -)tctpreviewsfinal-t-trct@cc`sxxltj|D][}tj||}|s|dkrAqn|d dkrb|jdVqd|VqWdVdS(Nt.it
0123456789it*s*final(t_legacy_version_component_retsplitt_legacy_version_replacement_maptgettzfill(Rtpart((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyt_parse_version_partsrs
cC`sd}g}xt|jD]}|jdr|dkrjx'|rf|ddkrf|jqCWnx'|r|ddkr|jqmWn|j|qWt|}||fS(NiR>s*finals*final-t00000000(REtlowert
startswithtpoptappendttuple(RR
tpartsRD((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR*ss
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
cB`seZejdedejejBZdZdZ	dZ
edZedZ
edZedZed	ZRS(
s^\s*s\s*$cC`s[|jj|}|s0tdj|ntd|jdrZt|jdnddtd|jdjdDdt	|jd|jd	d
t	|jd|jdp|jd
dt	|jd|jddt
|jd|_t|jj
|jj|jj|jj|jj|jj|_dS(NsInvalid version: '{0}'R
iRcs`s|]}t|VqdS(N(tint(t.0ti((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sR<R
tpre_ltpre_nRtpost_ltpost_n1tpost_n2Rtdev_ltdev_nR(t_regextsearchRR-R	tgroupRMRKR@t_parse_letter_versiont_parse_local_versionR)t_cmpkeyR
RR
RRRR(RRtmatch((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR+s.*(!					cC`sdjtt|S(Ns(R-R.R((R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR/scC`sSg}|jjdkr7|jdj|jjn|jdjd|jjD|jjdk	r|jdjd|jjDn|jjdk	r|jdj|jjdn|jj	dk	r|jd	j|jj	dn|jj
dk	rF|jd
jdjd|jj
Dndj|S(Nis{0}!R<cs`s|]}t|VqdS(N(R((RNtx((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sRcs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	ss.post{0}is.dev{0}s+{0}cs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	s(R)R
RJR-tjoinRR
R2RRR(RRL((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR,s&)##,cC`st|jdddS(Nt+ii(R(R@(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR0
scC`sjg}|jjdkr7|jdj|jjn|jdjd|jjDdj|S(Nis{0}!R<cs`s|]}t|VqdS(N(R((RNR^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	sR(R)R
RJR-R_R(RRL((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR1s
&cC`s0t|}d|kr,|jdddSdS(NR`i(R(R@(Rtversion_string((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRscC`st|jjp|jjS(N(tboolR)RR
(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR4!scC`st|jjS(N(RbR)R(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR5%s(RRtretcompileRtVERBOSEt
IGNORECASERWR+R/R,R6R0R1RR4R5(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRs	#		
cC`s|r|dkrd}n|j}|dkr<d}n?|dkrQd}n*|d
krfd	}n|dkr{d}n|t|fS|r|rd}|t|fSdS(NitalphatatbetatbR7R
R8R:trevtrR(R7R
R8(RkRl(R2RGRM(tlettertnumber((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyRZ*s 					
s[\._-]cC`s-|dk	r)tdtj|DSdS(sR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    cs`s3|])}|js!|jn	t|VqdS(N(tisdigitRGRM(RNRD((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	RsN(R2RKt_local_version_seperatorsR@(R((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR[LscC`sttttjdt|}|dkr[|dkr[|dk	r[t}n|dkrpt}n|dkrt}n|dkrt}n|dkrt}ntd|D}||||||fS(NcS`s
|dkS(Ni((R^((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR`Rcs`s7|]-}t|tr$|dfn
t|fVqdS(RN(R%RMR(RNRO((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pys	s(RKtreversedtlistt	itertoolst	dropwhileR2R(R
RR
RRR((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyR\Ws&	$
	
	
	
(t
__future__RRRtcollectionsRsRct_structuresRt__all__t
namedtupleR	Rt
ValueErrorRtobjectRRRdReR?RARER*RRRZRpR[R\(((sH/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/version.pyts0	!&		9k		PK!&p,,"_vendor/packaging/requirements.pycnu[
fc@`sYddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZmZdd	lmZmZmZd
efdYZeejejZ edj!Z"ed
j!Z#edj!Z$edj!Z%edj!Z&edj!Z'edj!Z(edZ)e ee)e BZ*ee ee*Z+e+dZ,e+Z-eddZ.e(e.Z/e-ee&e-Z0e"e
e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7ee&e7ddde8dZ9e
e$e9e%e9BZ:e:j;de	e:dZ<e<j;de	edZej;de'Z=e=eZ>e<e
e>Z?e/e
e>Z@e,e
e1e@e?BZAeeAeZBd eCfd!YZDdS("i(tabsolute_importtdivisiontprint_functionN(tstringStartt	stringEndtoriginalTextFortParseException(t
ZeroOrMoretWordtOptionaltRegextCombine(tLiteral(tparsei(tMARKER_EXPRtMarker(tLegacySpecifiert	SpecifiertSpecifierSettInvalidRequirementcB`seZdZRS(sJ
    An invalid requirement was found, users should refer to PEP 508.
    (t__name__t
__module__t__doc__(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyRst[t]t(t)t,t;t@s-_.tnames[^ ]+turltextrast
joinStringtadjacentt	_raw_speccC`s
|jpdS(Nt(R#(tstltt((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt6R$t	specifiercC`s|dS(Ni((R%R&R'((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR(9R$tmarkercC`st||j|j!S(N(Rt_original_startt
_original_end(R%R&R'((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR(=R$tRequirementcB`s)eZdZdZdZdZRS(sParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    cC`sytj|}Wn9tk
rN}tdj||j|jd!nX|j|_|jrtj|j}|j	o|j
s|j	r|j
rtdn|j|_n	d|_t|j
r|j
jng|_
t|j|_|jr|jnd|_dS(Ns+Invalid requirement, parse error at "{0!r}"isInvalid URL given(tREQUIREMENTtparseStringRRtformattlocRRturlparsetschemetnetloctNonetsetR tasListRR)R*(tselftrequirement_stringtreqtet
parsed_url((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__init__Xs"!		'cC`s|jg}|jr@|jdjdjt|jn|jrb|jt|jn|jr|jdj|jn|j	r|jdj|j	ndj|S(Ns[{0}]Rs@ {0}s; {0}R$(
RR tappendR0tjointsortedR)tstrRR*(R8tparts((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__str__ms	+			cC`sdjt|S(Ns(R0RA(R8((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyt__repr__~s(RRRR=RCRD(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pyR-Ks		(Et
__future__RRRtstringtretsetuptools.extern.pyparsingRRRRRRR	R
RRtLt"setuptools.extern.six.moves.urllibR
R2tmarkersRRt
specifiersRRRt
ValueErrorRt
ascii_letterstdigitstALPHANUMtsuppresstLBRACKETtRBRACKETtLPARENtRPARENtCOMMAt	SEMICOLONtATtPUNCTUATIONtIDENTIFIER_ENDt
IDENTIFIERtNAMEtEXTRAtURItURLtEXTRAS_LISTtEXTRASt
_regex_strtVERBOSEt
IGNORECASEtVERSION_PEP440tVERSION_LEGACYtVERSION_ONEtFalsetVERSION_MANYt
_VERSION_SPECtsetParseActiontVERSION_SPECtMARKER_SEPERATORtMARKERtVERSION_AND_MARKERtURL_AND_MARKERtNAMED_REQUIREMENTR.tobjectR-(((sM/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/requirements.pytsZ"(



PK!5WRR_vendor/packaging/utils.pyonu[
fc@`sDddlmZmZmZddlZejdZdZdS(i(tabsolute_importtdivisiontprint_functionNs[-_.]+cC`stjd|jS(Nt-(t_canonicalize_regextsubtlower(tname((sF/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/utils.pytcanonicalize_names(t
__future__RRRtretcompileRR(((sF/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/utils.pytsPK!kVFcc_vendor/packaging/__init__.pycnu[
fc@`sxddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZdddddd	d
dgZ
dS(
i(tabsolute_importtdivisiontprint_functioni(t
__author__t
__copyright__t	__email__t__license__t__summary__t	__title__t__uri__t__version__RRR	R
RRRRN(t
__future__RRRt	__about__RRRRRRR	R
t__all__(((sI/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/__init__.pyts:PK!b
bb _vendor/packaging/specifiers.pycnu[
fc@`s<ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZdefdYZde
ejefd	YZd
efdYZdefd
YZdZdefdYZejdZdZdZdefdYZdS(i(tabsolute_importtdivisiontprint_functionNi(tstring_typestwith_metaclass(tVersiont
LegacyVersiontparsetInvalidSpecifiercB`seZdZRS(sH
    An invalid specifier was found, users should refer to PEP 440.
    (t__name__t
__module__t__doc__(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRst
BaseSpecifiercB`seZejdZejdZejdZejdZejdZ	e	j
dZ	ejddZejddZ
RS(	cC`sdS(s
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        N((tself((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__str__tcC`sdS(sF
        Returns a hash value for this Specifier like object.
        N((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__hash__RcC`sdS(sq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        N((R
tother((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__eq__$RcC`sdS(su
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        N((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__ne__+RcC`sdS(sg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        N((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytprereleases2RcC`sdS(sd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        N((R
tvalue((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR9RcC`sdS(sR
        Determines if the given item is contained within this specifier.
        N((R
titemR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytcontains@RcC`sdS(s
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        N((R
titerableR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytfilterFRN(R	R
tabctabstractmethodRRRRtabstractpropertyRtsettertNoneRR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRst_IndividualSpecifiercB`seZiZdddZdZdZdZdZdZ	dZ
dZed	Z
ed
ZedZejdZd
ZddZddZRS(RcC`sj|jj|}|s0tdj|n|jdj|jdjf|_||_dS(NsInvalid specifier: '{0}'toperatortversion(t_regextsearchRtformattgrouptstript_spect_prereleases(R
tspecRtmatch((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__init__RscC`sF|jdk	r!dj|jnd}dj|jjt||S(Ns, prereleases={0!r}Rs<{0}({1!r}{2})>(R(RR$Rt	__class__R	tstr(R
tpre((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__repr___s!		cC`sdj|jS(Ns{0}{1}(R$R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRlscC`s
t|jS(N(thashR'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRoscC`s`t|tr:y|j|}WqPtk
r6tSXnt||jsPtS|j|jkS(N(t
isinstanceRR,RtNotImplementedR'(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRrs
cC`s`t|tr:y|j|}WqPtk
r6tSXnt||jsPtS|j|jkS(N(R1RR,RR2R'(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR}s
cC`st|dj|j|S(Ns_compare_{0}(tgetattrR$t
_operators(R
top((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt
_get_operatorscC`s(t|ttfs$t|}n|S(N(R1RRR(R
R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_coerce_versionscC`s|jdS(Ni(R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR scC`s|jdS(Ni(R'(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR!scC`s|jS(N(R((R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
|j|S(N(R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__contains__scC`sW|dkr|j}n|j|}|jr;|r;tS|j|j||jS(N(RRR7t
is_prereleasetFalseR6R R!(R
RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscc`st}g}i|dk	r!|ntd6}xf|D]^}|j|}|j||r2|jr|pn|jr|j|qt}|Vq2q2W|r|rx|D]}|VqWndS(NR(R:RtTrueR7RR9Rtappend(R
RRtyieldedtfound_prereleasestkwR!tparsed_version((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
	

N(R	R
R4RR+R/RRRRR6R7tpropertyR R!RRR8RR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRNs 
	
							tLegacySpecifiercB`seZdZejdedejejBZidd6dd6dd6d	d
6dd6d
d6ZdZ	dZ
dZdZdZ
dZdZRS(s
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        s^\s*s\s*$tequals==t	not_equals!=tless_than_equals<=tgreater_than_equals>=t	less_thantcC`s(t|ts$tt|}n|S(N(R1RR-(R
R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR7scC`s||j|kS(N(R7(R
tprospectiveR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_not_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_less_than_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_greater_than_equalscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_less_thanscC`s||j|kS(N(R7(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_greater_thans(R	R
t
_regex_strtretcompiletVERBOSEt
IGNORECASER"R4R7RLRMRNRORPRQ(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRBs"

						c`s"tjfd}|S(Nc`s#t|tstS|||S(N(R1RR:(R
RKR)(tfn(sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytwrappeds(t	functoolstwraps(RWRX((RWsK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_require_version_compare
st	SpecifiercB`seZdZejdedejejBZidd6dd6dd6d	d
6dd6d
d6dd6dd6Ze	dZ
e	dZe	dZe	dZ
e	dZe	dZe	dZdZedZejdZRS(s
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=RGRHRIRJt	arbitrarys===cC`sfdjttjdt|d }|d7}|jd||oe|jd||S(Nt.cS`s|jdo|jdS(Ntposttdev(t
startswith(tx((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pytsis.*s>=s==(tjointlistt	itertoolst	takewhilet_version_splitR6(R
RKR)tprefix((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_compatibles

cC`s|jdrht|j}t|d }tt|}|t| }t||\}}n't|}|jst|j}n||kS(Ns.*i(tendswithRtpublicRiR-tlent_pad_versiontlocal(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRLs	cC`s|j||S(N(RL(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRMscC`s|t|kS(N(R(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRNscC`s|t|kS(N(R(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyROscC`sXt|}||kstS|jrT|jrTt|jt|jkrTtSntS(N(RR:R9tbase_versionR;(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRPscC`st|}||kstS|jrT|jrTt|jt|jkrTtSn|jdk	rt|jt|jkrtSntS(N(RR:tis_postreleaseRqRpRR;(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRQscC`s"t|jt|jkS(N(R-tlower(R
RKR)((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt_compare_arbitraryscC`ss|jdk	r|jS|j\}}|dkro|dkrY|jdrY|d }nt|jrotSntS(	Ns==s>=s<=s~=s===s.*i(s==s>=s<=s~=s===(R(RR'RlRR9R;R:(R
R R!((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
cC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs(R	R
RRRSRTRURVR"R4R[RkRLRMRNRORPRQRtRARR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR\s,^
#	s^([0-9]+)((?:a|b|c|rc)[0-9]+)$cC`s\g}xO|jdD]>}tj|}|rG|j|jq|j|qW|S(NR_(tsplitt
_prefix_regexR#textendtgroupsR<(R!tresultRR*((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRi'sc	C`sgg}}|jttjd||jttjd||j|t|d|j|t|d|jddgtdt|dt|d|jddgtdt|dt|dttj|ttj|fS(NcS`s
|jS(N(tisdigit(Rc((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRd6RcS`s
|jS(N(Rz(Rc((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRd7Riit0(R<RfRgRhRntinserttmaxtchain(tlefttrightt
left_splittright_split((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRo2s
""//tSpecifierSetcB`seZdddZdZdZdZdZdZdZ	dZ
d	Zed
Z
e
jdZ
dZdd
ZddZRS(RcC`sg|jdD]}|jr|j^q}t}xL|D]D}y|jt|WqDtk
r|jt|qDXqDWt||_||_	dS(Nt,(
RuR&tsettaddR\RRBt	frozensett_specsR((R
t
specifiersRtstparsedt	specifier((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR+Os4	

cC`s=|jdk	r!dj|jnd}djt||S(Ns, prereleases={0!r}Rs(R(RR$RR-(R
R.((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR/ds!cC`s djtd|jDS(NRcs`s|]}t|VqdS(N(R-(t.0R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	ns(RetsortedR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRmscC`s
t|jS(N(R0R(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRpscC`st|trt|}nt|ts1tSt}t|j|jB|_|jdkr|jdk	r|j|_nZ|jdk	r|jdkr|j|_n-|j|jkr|j|_ntd|S(NsFCannot combine SpecifierSets with True and False prerelease overrides.(	R1RRR2RRR(Rt
ValueError(R
RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__and__ss		cC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`set|trt|}n7t|trBtt|}nt|tsUtS|j|jkS(N(R1RRRR-R2R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
t|jS(N(RnR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__len__scC`s
t|jS(N(titerR(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyt__iter__scC`s:|jdk	r|jS|js#dStd|jDS(Ncs`s|]}|jVqdS(N(R(RR((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	s(R(RRtany(R
((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs
	cC`s
||_dS(N(R((R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s
|j|S(N(R(R
R((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyR8sc`sptttfs$tndkr<|jnrPjrPtStfd|j	DS(Nc3`s$|]}|jdVqdS(RN(R(RR(RR(sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pys	s(
R1RRRRRR9R:tallR(R
RR((RRsK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRscC`s|dkr|j}n|jrTx,|jD]!}|j|dt|}q+W|Sg}g}x|D]{}t|ttfst|}n|}t|trqgn|j	r|r|s|j
|qqg|j
|qgW|r|r|dkr|S|SdS(NR(RRRRtboolR1RRRR9R<(R
RRR)tfilteredR>RR@((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRs*	
N(R	R
RR+R/RRRRRRRRARRR8RR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyRMs						
	
			(t
__future__RRRRRYRgRSt_compatRRR!RRRRRtABCMetatobjectRRRBR[R\RTRvRiRoR(((sK/usr/lib/python2.7/site-packages/setuptools/_vendor/packaging/specifiers.pyts""94				PK!nMe_vendor/__init__.pyonu[
fc@sdS(N((((s?/usr/lib/python2.7/site-packages/setuptools/_vendor/__init__.pyttPK!V!o{o{_vendor/six.pycnu[
fcA@@sKdZddlmZddlZddlZddlZddlZddlZdZdZ	ej
ddkZej
ddkZej
dd!dakZ
erefZefZefZeZeZejZnefZeefZeejfZeZeZejjd	r$edcZnVdefd
YZ ye!e Wne"k
rjedeZn
XedgZ[ dZ#dZ$defdYZ%de%fdYZ&dej'fdYZ(de%fdYZ)defdYZ*e*e+Z,de(fdYZ-e)dddde)d d!d"d#d e)d$d!d!d%d$e)d&d'd"d(d&e)d)d'd*e)d+d!d"d,d+e)d-d.d.d/d-e)d0d.d.d-d0e)d1d'd"d2d1e)d3d'e
rd4nd5d6e)d7d'd8e)d9d:d;d<e)ddde)d=d=d>e)d?d?d>e)d@d@d>e)d2d'd"d2d1e)dAd!d"dBdAe)dCd!d!dDdCe&d"d'e&dEdFe&dGdHe&dIdJdKe&dLdMdLe&dNdOdPe&dQdRdSe&dTdUdVe&dWdXdYe&dZd[d\e&d]d^d_e&d`dadbe&dcdddee&dfdgdhe&dididje&dkdkdje&dldldje&dmdmdne&dodpe&dqdre&dsdte&dudvdue&dwdxe&dydzd{e&d|d}d~e&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddd~e&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkr;e.e&ddg7Z.nxJe.D]BZ/e0e-e/j1e/e2e/e&rBe,j3e/de/j1qBqBW[/e.e-_.e-e+dZ4e,j3e4dde(fdYZ5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d<dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6x!e6D]Z/e0e5e/j1e/q0W[/e6e5_.e,j3e5e+dddde(fdYZ7e)ddde)ddde)dddgZ8x!e8D]Z/e0e7e/j1e/qW[/e8e7_.e,j3e7e+dddde(fdYZ9e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddg!Z:x!e:D]Z/e0e9e/j1e/qW[/e:e9_.e,j3e9e+dddde(fdYZ;e)ddde)ddde)ddde)dddgZ<x!e<D]Z/e0e;e/j1e/qW[/e<e;_.e,j3e;e+d	d
dde(fd
YZ=e)dddgZ>x!e>D]Z/e0e=e/j1e/q;W[/e>e=_.e,j3e=e+ddddej'fdYZ?e,j3e?e+dddZ@dZAerdZBdZCdZDdZEdZFdZGn$dZBdZCdZDd ZEd!ZFd"ZGy
eHZIWneJk
r=
d#ZInXeIZHy
eKZKWneJk
rj
d$ZKnXer
d%ZLejMZNd&ZOeZPn7d'ZLd(ZNd)ZOd*efd+YZPeKZKe#eLd,ejQeBZRejQeCZSejQeDZTejQeEZUejQeFZVejQeGZWerd-ZXd.ZYd/ZZd0Z[ej\d1Z]ej\d2Z^ej\d3Z_nQd4ZXd5ZYd6ZZd7Z[ej\d8Z]ej\d9Z^ej\d:Z_e#eXd;e#eYd<e#eZd=e#e[d>erd?Z`d@ZaebZcddldZdedjedAjfZg[dejhdZiejjZkelZmddlnZnenjoZoenjpZpdBZqej
d
d
krdCZrdDZsq4dEZrdFZsnpdGZ`dHZaecZcebZgdIZidJZkejtejuevZmddloZoeojoZoZpdKZqdCZrdDZse#e`dLe#eadMdNZwdOZxdPZyereze4j{dQZ|ddRZ~ndddSZ|e|dTej
d dhkre|dUn)ej
d dikre|dVn	dWZeze4j{dXdZedkrdYZnej
d djkrDeZdZZne#e~d[ej
dd!dkkrejejd\Zn	ejZd]Zd^Zd_ZgZe+Zejd`dk	rge_nejr7xOeejD]>\ZZeej+dkrej1e+kreje=PqqW[[nejje,dS(ls6Utilities for writing code that runs on Python 2 and 3i(tabsolute_importNs'Benjamin Peterson s1.10.0iiitjavaiitXcB@seZdZRS(cC@sdS(NiiI((tself((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__len__>s(t__name__t
__module__R(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR<si?cC@s
||_dS(s Add documentation to a function.N(t__doc__(tfunctdoc((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt_add_docKscC@st|tj|S(s7Import module, returning the module after the last dot.(t
__import__tsystmodules(tname((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt_import_modulePs
t
_LazyDescrcB@seZdZdZRS(cC@s
||_dS(N(R(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__init__XscC@sN|j}t||j|yt|j|jWntk
rInX|S(N(t_resolvetsetattrRtdelattrt	__class__tAttributeError(Rtobjttptresult((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__get__[s
(RRRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRVs	tMovedModulecB@s&eZddZdZdZRS(cC@sJtt|j|tr=|dkr1|}n||_n	||_dS(N(tsuperRRtPY3tNonetmod(RRtoldtnew((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRis	cC@s
t|jS(N(RR(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRrscC@s/|j}t||}t||||S(N(RtgetattrR(Rtattrt_moduletvalue((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__getattr__usN(RRRRRR&(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRgs		t_LazyModulecB@s eZdZdZgZRS(cC@s)tt|j||jj|_dS(N(RR'RRR(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR~scC@s3ddg}|g|jD]}|j^q7}|S(NRR(t_moved_attributesR(RtattrsR#((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__dir__s#(RRRR*R((((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR'|s		tMovedAttributecB@s eZdddZdZRS(cC@stt|j|trp|dkr1|}n||_|dkrd|dkr[|}qd|}n||_n'||_|dkr|}n||_dS(N(RR+RRRRR#(RRtold_modtnew_modtold_attrtnew_attr((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRs						cC@st|j}t||jS(N(RRR"R#(Rtmodule((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRsN(RRRRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR+st_SixMetaPathImportercB@s_eZdZdZdZdZd	dZdZdZ	dZ
dZeZRS(
s
    A meta path importer to import six.moves and its submodules.

    This class implements a PEP302 finder and loader. It should be compatible
    with Python 2.5 and all existing versions of Python3
    cC@s||_i|_dS(N(Rt
known_modules(Rtsix_module_name((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRs	cG@s-x&|D]}||j|jd|(RR6((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt
is_packagescC@s|j|dS(s;Return None

        Required, if is_package is implementedN(R>R(RR6((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytget_codes
N(
RRRRR7R8RR:R>RARDREt
get_source(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR1s								t_MovedItemscB@seZdZgZRS(sLazy loading of moved objects(RRRRB(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRGst	cStringIOtiotStringIOtfiltert	itertoolstbuiltinstifiltertfilterfalsetifilterfalsetinputt__builtin__t	raw_inputtinternRtmaptimaptgetcwdtostgetcwdutgetcwdbtrangetxranget
reload_modulet	importlibtimptreloadtreducet	functoolstshlex_quotetpipestshlextquotetUserDicttcollectionstUserListt
UserStringtziptiziptzip_longesttizip_longesttconfigparsertConfigParsertcopyregtcopy_regtdbm_gnutgdbmsdbm.gnut
_dummy_threadtdummy_threadthttp_cookiejart	cookielibshttp.cookiejarthttp_cookiestCookieshttp.cookiest
html_entitiesthtmlentitydefss
html.entitiesthtml_parsert
HTMLParsershtml.parserthttp_clientthttplibshttp.clienttemail_mime_multipartsemail.MIMEMultipartsemail.mime.multiparttemail_mime_nonmultipartsemail.MIMENonMultipartsemail.mime.nonmultiparttemail_mime_textsemail.MIMETextsemail.mime.texttemail_mime_basesemail.MIMEBasesemail.mime.basetBaseHTTPServershttp.servert
CGIHTTPServertSimpleHTTPServertcPickletpickletqueuetQueuetreprlibtreprtsocketservertSocketServert_threadtthreadttkintertTkinterttkinter_dialogtDialogstkinter.dialogttkinter_filedialogt
FileDialogstkinter.filedialogttkinter_scrolledtexttScrolledTextstkinter.scrolledtextttkinter_simpledialogtSimpleDialogstkinter.simpledialogttkinter_tixtTixstkinter.tixttkinter_ttktttkstkinter.ttkttkinter_constantstTkconstantsstkinter.constantsttkinter_dndtTkdndstkinter.dndttkinter_colorchooserttkColorChooserstkinter.colorchooserttkinter_commondialogttkCommonDialogstkinter.commondialogttkinter_tkfiledialogttkFileDialogttkinter_fontttkFontstkinter.fontttkinter_messageboxttkMessageBoxstkinter.messageboxttkinter_tksimpledialogttkSimpleDialogturllib_parses.moves.urllib_parsesurllib.parseturllib_errors.moves.urllib_errorsurllib.errorturllibs
.moves.urllibturllib_robotparsertrobotparsersurllib.robotparsert
xmlrpc_clientt	xmlrpclibs
xmlrpc.clientt
xmlrpc_servertSimpleXMLRPCServers
xmlrpc.servertwin32twinregt_winregsmoves.s.movestmovestModule_six_moves_urllib_parsecB@seZdZRS(s7Lazy loading of moved objects in six.moves.urllib_parse(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR@stParseResultturlparsetSplitResulttparse_qst	parse_qslt	urldefragturljointurlsplitt
urlunparset
urlunsplitt
quote_plustunquotetunquote_plust	urlencodet
splitquerytsplittagt	splitusert
uses_fragmenttuses_netloctuses_paramst
uses_queryt
uses_relativesmoves.urllib_parsesmoves.urllib.parsetModule_six_moves_urllib_errorcB@seZdZRS(s7Lazy loading of moved objects in six.moves.urllib_error(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRhstURLErrorturllib2t	HTTPErrortContentTooShortErrors.moves.urllib.errorsmoves.urllib_errorsmoves.urllib.errortModule_six_moves_urllib_requestcB@seZdZRS(s9Lazy loading of moved objects in six.moves.urllib_request(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR|sturlopensurllib.requesttinstall_openertbuild_openertpathname2urlturl2pathnamet
getproxiestRequesttOpenerDirectortHTTPDefaultErrorHandlertHTTPRedirectHandlertHTTPCookieProcessortProxyHandlertBaseHandlertHTTPPasswordMgrtHTTPPasswordMgrWithDefaultRealmtAbstractBasicAuthHandlertHTTPBasicAuthHandlertProxyBasicAuthHandlertAbstractDigestAuthHandlertHTTPDigestAuthHandlertProxyDigestAuthHandlertHTTPHandlertHTTPSHandlertFileHandlert
FTPHandlertCacheFTPHandlertUnknownHandlertHTTPErrorProcessorturlretrievet
urlcleanupt	URLopenertFancyURLopenertproxy_bypasss.moves.urllib.requestsmoves.urllib_requestsmoves.urllib.requestt Module_six_moves_urllib_responsecB@seZdZRS(s:Lazy loading of moved objects in six.moves.urllib_response(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRstaddbasesurllib.responsetaddclosehooktaddinfot
addinfourls.moves.urllib.responsesmoves.urllib_responsesmoves.urllib.responset#Module_six_moves_urllib_robotparsercB@seZdZRS(s=Lazy loading of moved objects in six.moves.urllib_robotparser(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRstRobotFileParsers.moves.urllib.robotparsersmoves.urllib_robotparsersmoves.urllib.robotparsertModule_six_moves_urllibcB@sheZdZgZejdZejdZejdZejdZ	ejdZ
dZRS(sICreate a six.moves.urllib namespace that resembles the Python 3 namespacesmoves.urllib_parsesmoves.urllib_errorsmoves.urllib_requestsmoves.urllib_responsesmoves.urllib_robotparsercC@sdddddgS(NtparseterrortrequesttresponseR((R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR*s(RRRRBt	_importerR8RRRRRR*(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRssmoves.urllibcC@stt|j|dS(sAdd an item to six.moves.N(RRGR(tmove((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytadd_movescC@s^ytt|WnFtk
rYytj|=WqZtk
rUtd|fqZXnXdS(sRemove item from six.moves.sno such move, %rN(RRGRRt__dict__R;(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytremove_moves

t__func__t__self__t__closure__t__code__t__defaults__t__globals__tim_functim_selftfunc_closuret	func_codet
func_defaultstfunc_globalscC@s
|jS(N(tnext(tit((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytadvance_iteratorscC@stdt|jDS(Ncs@s|]}d|jkVqdS(t__call__N(R
(t.0tklass((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pys	s(tanyttypet__mro__(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcallablescC@s|S(N((tunbound((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytget_unbound_functionscC@s|S(N((Rtcls((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcreate_unbound_methodscC@s|jS(N(R(R"((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR#"scC@stj|||jS(N(ttypest
MethodTypeR(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcreate_bound_method%scC@stj|d|S(N(R&R'R(RR$((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR%(stIteratorcB@seZdZRS(cC@st|j|S(N(Rt__next__(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR-s(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR)+ss3Get the function out of a possibly unbound functioncK@st|j|S(N(titertkeys(tdtkw((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytiterkeys>scK@st|j|S(N(R+tvalues(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt
itervaluesAscK@st|j|S(N(R+titems(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt	iteritemsDscK@st|j|S(N(R+tlists(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt	iterlistsGsR,R0R2cK@s
|j|S(N(R/(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR/PscK@s
|j|S(N(R1(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR1SscK@s
|j|S(N(R3(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR3VscK@s
|j|S(N(R5(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR5Ystviewkeyst
viewvaluest	viewitemss1Return an iterator over the keys of a dictionary.s3Return an iterator over the values of a dictionary.s?Return an iterator over the (key, value) pairs of a dictionary.sBReturn an iterator over the (key, [values]) pairs of a dictionary.cC@s
|jdS(Nslatin-1(tencode(ts((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytbkscC@s|S(N((R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytunss>BtassertCountEqualtassertRaisesRegexptassertRegexpMatchestassertRaisesRegextassertRegexcC@s|S(N((R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR;scC@st|jdddS(Ns\\s\\\\tunicode_escape(tunicodetreplace(R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR<scC@st|dS(Ni(tord(tbs((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytbyte2intscC@st||S(N(RE(tbufti((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt
indexbytesstassertItemsEqualsByte literalsText literalcO@st|t||S(N(R"t_assertCountEqual(Rtargstkwargs((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR=scO@st|t||S(N(R"t_assertRaisesRegex(RRMRN((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR@scO@st|t||S(N(R"t_assertRegex(RRMRN((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRAstexeccC@sC|dkr|}n|j|k	r9|j|n|dS(N(Rt
__traceback__twith_traceback(RR%ttb((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytreraises
cB@sc|dkrBejd}|j}|dkr<|j}n~n|dkrW|}nddUdS(sExecute code in a namespace.isexec _code_ in _globs_, _locs_N(RRt	_getframet	f_globalstf_locals(t_code_t_globs_t_locs_tframe((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytexec_s		s9def reraise(tp, value, tb=None):
    raise tp, value, tb
srdef raise_from(value, from_value):
    if from_value is None:
        raise value
    raise value from from_value
sCdef raise_from(value, from_value):
    raise value from from_value
cC@s
|dS(N((R%t
from_value((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt
raise_fromstprintc
@s|jdtjdkr%dSfd}t}|jdd}|dk	rt|trpt}qt|tst	dqn|jdd}|dk	rt|trt}qt|tst	dqn|rt	dn|s0x*|D]}t|tr
t}Pq
q
Wn|rQtd	}td
}nd	}d
}|dkrr|}n|dkr|}nx7t
|D])\}	}|	r||n||qW||dS(s4The new-style print function for Python 2.4 and 2.5.tfileNc@st|tst|}nttrt|trjdk	rtdd}|dkrrd}n|jj|}nj	|dS(Nterrorststrict(
R?t
basestringtstrRaRCtencodingRR"R9twrite(tdataRb(tfp(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRgs	tsepssep must be None or a stringtendsend must be None or a strings$invalid keyword arguments to print()s
t (tpopRtstdoutRtFalseR?RCtTrueRet	TypeErrort	enumerate(
RMRNRgtwant_unicodeRjRktargtnewlinetspaceRI((Ris:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytprint_sL		
		
cO@sW|jdtj}|jdt}t|||rS|dk	rS|jndS(NRatflush(tgetRRnRmRot_printRRx(RMRNRiRx((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRws

sReraise an exception.c@sfd}|S(Nc@s(tj|}|_|S(N(Rbtwrapst__wrapped__(tf(tassignedtupdatedtwrapped(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytwrappers	((RR~RR((R~RRs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR{sc@s5dffdY}tj|ddiS(s%Create a base class with a metaclass.t	metaclassc@seZfdZRS(c@s||S(N((R$Rt
this_basesR-(tbasestmeta(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__new__'s(RRR((RR(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR%sttemporary_class((RR(RRR((RRs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytwith_metaclass sc@sfd}|S(s6Class decorator for creating a class with a metaclass.c@s|jj}|jd}|dk	rft|trE|g}nx|D]}|j|qLWn|jdd|jdd|j|j|S(Nt	__slots__R
t__weakref__(	R
tcopyRyRR?ReRmRt	__bases__(R$t	orig_varstslotst	slots_var(R(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR.s
((RR((Rs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt
add_metaclass,scC@sJtrFd|jkr+td|jn|j|_d|_n|S(s
    A decorator that defines __unicode__ and __str__ methods under Python 2.
    Under Python 3 it does nothing.

    To support Python 2 and 3 with a single code base, define a __str__ method
    returning text and apply this decorator to the class.
    t__str__sY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cS@s|jjdS(Nsutf-8(t__unicode__R9(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytJt(tPY2R
t
ValueErrorRRR(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytpython_2_unicode_compatible<st__spec__(iiIiIill(ii(ii(ii(ii(Rt
__future__RRbRLtoperatorRR&t
__author__t__version__tversion_infoRRtPY34Retstring_typestintt
integer_typesRtclass_typest	text_typetbytestbinary_typetmaxsizetMAXSIZERdtlongt	ClassTypeRCtplatformt
startswithtobjectRtlent
OverflowErrorR
RRRt
ModuleTypeR'R+R1RRRGR(R#RRR?R7RRt_urllib_parse_moved_attributesRt_urllib_error_moved_attributesRt _urllib_request_moved_attributesRt!_urllib_response_moved_attributesRt$_urllib_robotparser_moved_attributesRR	Rt
_meth_funct
_meth_selft
_func_closuret
_func_codet_func_defaultst
_func_globalsRRt	NameErrorR!R#R'R(R%R)t
attrgettertget_method_functiontget_method_selftget_function_closuretget_function_codetget_function_defaultstget_function_globalsR/R1R3R5tmethodcallerR6R7R8R;R<tchrtunichrtstructtStructtpacktint2bytet
itemgetterRGtgetitemRJR+t	iterbytesRIRJtBytesIORLRORPtpartialRVRER=R@RAR"RMR]RRUR_RwRztWRAPPER_ASSIGNMENTStWRAPPER_UPDATESR{RRRRBt__package__tglobalsRyRtsubmodule_search_locationst	meta_pathRrRItimportertappend(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyts				
		>			
	
	

	

	

	

	

			





															

											


			

	5
					
	PK!IE_vendor/pyparsing.pyonu[
fci@sdZdZdZdZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZyddlmZWn!ek
rddlmZnXydd	l
mZWn?ek
r=ydd	lmZWnek
r9eZnXnXd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrgiZee	jds ZedtdskZere	jZ e!Z"e#Z$e!Z%e&e'e(e)e*ee+e,e-e.e/gZ0nre	j1Z e2Z3duZ%gZ0ddl4Z4xEdvj5D]7Z6ye0j7e8e4e6Wne9k
rZq$nXq$We:dwe3dxDZ;dyZ<dze=fd{YZ>ej?ej@ZAd|ZBeBd}ZCeAeBZDe#d~ZEdjFdejGDZHd!eIfdYZJd#eJfdYZKd%eJfdYZLd'eLfdYZMd*eIfdYZNde=fdYZOd&e=fdYZPe
jQjRePdZSdZTdZUdZVdZWdZXdZYddZZd(e=fdYZ[d0e[fdYZ\de\fdYZ]de\fdYZ^de\fdYZ_e_Z`e_e[_ade\fdYZbde_fdYZcdebfdYZddpe\fdYZed3e\fdYZfd+e\fdYZgd)e\fdYZhd
e\fdYZid2e\fdYZjde\fdYZkdekfdYZldekfdYZmdekfdYZnd.ekfdYZod-ekfdYZpd5ekfdYZqd4ekfdYZrd$e[fdYZsd
esfdYZtd esfdYZudesfdYZvdesfdYZwd"e[fdYZxdexfdYZydexfdYZzdexfdYZ{de{fdYZ|d6e{fdYZ}de=fdYZ~e~ZdexfdYZd,exfdYZdexfdYZdefdYZd1exfdYZdefdYZdefdYZdefdYZd/efdYZde=fdYZdZdedZedZdZdZdZdZeedZdZedZdZdZe]jdGZemjdMZenjdLZeojdeZepjddZefeEdddjdZegdjdZegdjdZeeBeBefeHddddxBegdejBZeeedeZe_dedjdee|eeBjddZdZdZdZdZdZedZedZdZdZdZdZe=e_ddZe>Ze=e_e=e_ededdZeZeegddjdZeegddjdZeegddegddBjdZee`dejjdZddeejdZedZedZedZeefeAeDdjd\ZZeedj5dZegddjFejdjdZdZeegddjdZegdjdZegd	jjd
ZegdjdZeegddeBjd
ZeZegdjdZee|efeHddeefde_denjjdZeeejeBddjd>ZdrfdYZedkrecdZecdZefeAeDdZeeddejeZeeejdZdeBZeeddejeZeeejdZededeedZejdejjdejjdejjd ddlZejjeejejjd!ndS("sS
pyparsing module - Classes and methods to define and execute parsing grammars

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments
s2.1.10s07 Oct 2016 01:31 UTCs*Paul McGuire iN(tref(tdatetime(tRLock(tOrderedDicttAndtCaselessKeywordtCaselessLiteralt
CharsNotIntCombinetDicttEachtEmptyt
FollowedBytForwardt
GoToColumntGrouptKeywordtLineEndt	LineStarttLiteralt
MatchFirsttNoMatchtNotAnyt	OneOrMoretOnlyOncetOptionaltOrtParseBaseExceptiontParseElementEnhancetParseExceptiontParseExpressiontParseFatalExceptiontParseResultstParseSyntaxExceptiont
ParserElementtQuotedStringtRecursiveGrammarExceptiontRegextSkipTot	StringEndtStringStarttSuppresstTokentTokenConvertertWhitetWordtWordEndt	WordStartt
ZeroOrMoret	alphanumstalphast
alphas8bittanyCloseTagt
anyOpenTagt
cStyleCommenttcoltcommaSeparatedListtcommonHTMLEntitytcountedArraytcppStyleCommenttdblQuotedStringtdblSlashCommentt
delimitedListtdictOftdowncaseTokenstemptythexnumsthtmlCommenttjavaStyleCommenttlinetlineEndt	lineStarttlinenotmakeHTMLTagstmakeXMLTagstmatchOnlyAtColtmatchPreviousExprtmatchPreviousLiteralt
nestedExprtnullDebugActiontnumstoneOftopAssoctoperatorPrecedencet
printablestpunc8bittpythonStyleCommenttquotedStringtremoveQuotestreplaceHTMLEntitytreplaceWitht
restOfLinetsglQuotedStringtsranget	stringEndtstringStartttraceParseActiont
unicodeStringtupcaseTokenst
withAttributet
indentedBlocktoriginalTextFortungroupt
infixNotationtlocatedExprt	withClasst
CloseMatchttokenMaptpyparsing_commoniicCs}t|tr|Syt|SWnUtk
rxt|jtjd}td}|jd|j	|SXdS(sDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        txmlcharrefreplaces&#\d+;cSs#dtt|ddd!dS(Ns\uiii(thextint(tt((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyttN(
t
isinstancetunicodetstrtUnicodeEncodeErrortencodetsystgetdefaultencodingR%tsetParseActionttransformString(tobjtrett
xmlcharref((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_ustrs
s6sum len sorted reversed list tuple set any all min maxccs|]}|VqdS(N((t.0ty((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	sicCsRd}ddjD}x/t||D]\}}|j||}q,W|S(s/Escape &, <, >, ", ', etc. in a string of data.s&><"'css|]}d|dVqdS(t&t;N((Rts((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	ssamp gt lt quot apos(tsplittziptreplace(tdatatfrom_symbolst
to_symbolstfrom_tto_((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_xml_escapes
t
_ConstantscBseZRS((t__name__t
__module__(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRst
0123456789tABCDEFabcdefi\Rrccs$|]}|tjkr|VqdS(N(tstringt
whitespace(Rtc((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	scBs_eZdZdd
d
dZedZdZdZdZ	ddZ
d	ZRS(s7base exception class for all parsing runtime exceptionsicCs[||_|dkr*||_d|_n||_||_||_|||f|_dS(NRr(tloctNonetmsgtpstrt
parserElementtargs(tselfRRRtelem((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__init__s					cCs||j|j|j|jS(s
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        (RRRR(tclstpe((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_from_exceptionscCsm|dkrt|j|jS|dkr>t|j|jS|dkr]t|j|jSt|dS(ssupported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        RHR7tcolumnREN(R7R(RHRRR7REtAttributeError(Rtaname((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__getattr__scCs d|j|j|j|jfS(Ns"%s (at char %d), (line:%d, col:%d)(RRRHR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__str__scCs
t|S(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__repr__ss>!} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been found(RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR!scBs eZdZdZdZRS(sZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs
||_dS(N(tparseElementTrace(RtparseElementList((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsd|jS(NsRecursiveGrammarException: %s(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s(RRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR$s	t_ParseResultsWithOffsetcBs,eZdZdZdZdZRS(cCs||f|_dS(N(ttup(Rtp1tp2((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR$scCs|j|S(N(R(Rti((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__getitem__&scCst|jdS(Ni(treprR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR(scCs|jd|f|_dS(Ni(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	setOffset*s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR#s			cBseZdZd-d-eedZd-d-eeedZdZedZ	dZ
dZdZdZ
e
Zd	Zd
ZdZdZd
ZereZeZeZn-eZeZeZdZdZdZdZdZd-dZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'ddZ(d Z)d!Z*d"Z+d-e,ded#Z-d$Z.d%Z/dd&ed'Z0d(Z1d)Z2d*Z3d+Z4d,Z5RS(.sI
    Structured parse results, to provide multiple means of access to the parsed data:
       - as a list (C{len(results)})
       - by list index (C{results[0], results[1]}, etc.)
       - by attribute (C{results.} - see L{ParserElement.setResultsName})

    Example::
        integer = Word(nums)
        date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))
        # equivalent form:
        # date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

        # parseString returns a ParseResults object
        result = date_str.parseString("1999/12/31")

        def test(s, fn=repr):
            print("%s -> %s" % (s, fn(eval(s))))
        test("list(result)")
        test("result[0]")
        test("result['month']")
        test("result.day")
        test("'month' in result")
        test("'minutes' in result")
        test("result.dump()", str)
    prints::
        list(result) -> ['1999', '/', '12', '/', '31']
        result[0] -> '1999'
        result['month'] -> '12'
        result.day -> '31'
        'month' in result -> True
        'minutes' in result -> False
        result.dump() -> ['1999', '/', '12', '/', '31']
        - day: 31
        - month: 12
        - year: 1999
    cCs/t||r|Stj|}t|_|S(N(Rstobjectt__new__tTruet_ParseResults__doinit(RttoklisttnametasListtmodaltretobj((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs
	cCs|jrt|_d|_d|_i|_||_||_|dkrTg}n||trp||_	n-||t
rt||_	n|g|_	t|_n|dk	r|r|sd|j|s(R(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_itervaluesscsfdjDS(Nc3s|]}||fVqdS(N((RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(R(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
_iteritemsscCst|jS(sVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).(RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytkeysscCst|jS(sXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).(Rt
itervalues(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytvaluesscCst|jS(sfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).(Rt	iteritems(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs
t|jS(sSince keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names.(tboolR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pythaskeysscOs|sdg}nxI|jD];\}}|dkrJ|d|f}qtd|qWt|dtst|dks|d|kr|d}||}||=|S|d}|SdS(s
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # Use pop() in a parse action to remove named result (note that corresponding value is not
            # removed from list form of results)
            def remove_LABEL(tokens):
                tokens.pop("LABEL")
                return tokens
            patt.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        itdefaultis-pop() got an unexpected keyword argument '%s'iN(RRRsRoR(RRtkwargsRRtindexR}tdefaultvalue((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpops"


cCs||kr||S|SdS(si
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        N((RtkeytdefaultValue((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsw|jj||x]|jjD]L\}}x=t|D]/\}\}}t||||k|| ['0', '123', '321']

            # use a parse action to insert the parse location in the front of the parsed results
            def insert_locn(locn, tokens):
                tokens.insert(0, locn)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        N(RtinsertRRRR(RRtinsStrRRRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR2scCs|jj|dS(s
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            
            # use a parse action to compute the sum of the parsed integers, and add it to the end
            def append_sum(tokens):
                tokens.append(sum(map(int, tokens)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        N(Rtappend(Rtitem((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRFscCs0t|tr||7}n|jj|dS(s
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # use a parse action to append the reverse of the matched strings, to make a palindrome
            def make_palindrome(tokens):
                tokens.extend(reversed([t[::-1] for t in tokens]))
                return ''.join(tokens)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        N(RsR Rtextend(Rtitemseq((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs

cCs|j2|jjdS(s7
        Clear all elements and results names.
        N(RRtclear(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRfscCsy||SWntk
r dSX||jkr}||jkrR|j|ddStg|j|D]}|d^qcSndSdS(NRrii(RRRR (RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRms
+cCs|j}||7}|S(N(R(RtotherR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__add__{s
c	s|jrt|jfd}|jj}g|D]<\}}|D])}|t|d||df^qMq=}xJ|D]?\}}|||st](RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsRrcCsog}xb|jD]W}|r2|r2|j|nt|trT||j7}q|jt|qW|S(N(RRRsR t
_asStringListR(RtseptoutR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs5g|jD]'}t|tr+|jn|^q
S(s
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # ->  ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # ->  ['sldkj', 'lsdkj', 'sldkj']
        (RRsR R(Rtres((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscsGtr|j}n	|j}fdtfd|DS(s
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # ->  (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # ->  {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        csMt|trE|jr%|jSg|D]}|^q,Sn|SdS(N(RsR RtasDict(R|R(ttoItem(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs

 c3s'|]\}}||fVqdS(N((RRR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(tPY_3RRR(Rtitem_fn((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
		cCsPt|j}|jj|_|j|_|jj|j|j|_|S(sA
        Returns a new copy of a C{ParseResults} object.
        (R RRRRRR
R(RR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsd}g}td|jjD}|d}|sPd}d}d}nd	}	|d	k	rk|}	n|jr|j}	n|	s|rdSd}	n|||d|	dg7}x	t|jD]\}
}t|trI|
|kr||j	||
|o|d	k||g7}q||j	d	|o6|d	k||g7}qd	}|
|krh||
}n|s|rzqqd}nt
t|}
|||d|d|
d|dg	7}qW|||d|	dg7}dj|S(
s
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        s
css2|](\}}|D]}|d|fVqqdS(iN((RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s	s  RrtITEMtsgss
%s%s- %s: s  icss|]}t|tVqdS(N(RsR (Rtvv((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	sss
%s%s[%d]:
%s%s%sRr(
RRRRtsortedRRsR tdumpRtanyRR(RR$tdepthtfullRtNLRRRRR1((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR3Ps, B?cOstj|j||dS(s
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        N(tpprintR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR8}scCsC|j|jj|jdk	r-|jp0d|j|jffS(N(RRRRRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__getstate__s
cCsm|d|_|d\|_}}|_i|_|jj||dk	r`t||_n	d|_dS(Nii(RRRRR
RRR(RtstateR/tinAccumNames((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__setstate__s
	cCs|j|j|j|jfS(N(RRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__getnewargs__scCs tt|t|jS(N(RRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsN(6RRRRRRRsRRRRRRRt__nonzero__RRRRRRRRRRRRRRRRRRRRR
RRRRRRRRRR!R-R0R3R8R9R<R=R(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR -sh&	'		
														4												#	=		%-			
	cCsW|}d|ko#t|knr@||ddkr@dS||jdd|S(sReturns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   iis
(Rtrfind(RtstrgR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR7s
cCs|jdd|dS(sReturns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   s
ii(tcount(RR@((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRHs
cCsR|jdd|}|jd|}|dkrB||d|!S||dSdS(sfReturns the line of text containing loc within a string, counting newlines as line separators.
       s
iiN(R?tfind(RR@tlastCRtnextCR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyREs
cCsAdt|dt|dt||t||fGHdS(NsMatch s at loc s(%d,%d)(RRHR7(tinstringRtexpr((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultStartDebugActionscCs'dt|dt|jGHdS(NsMatched s -> (RRuR(REtstartloctendlocRFttoks((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultSuccessDebugActionscCsdt|GHdS(NsException raised:(R(RERRFtexc((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultExceptionDebugActionscGsdS(sG'Do-nothing' debug action, to suppress debugging output during parsing.N((R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyROsicstkrfdSdgtgtd dkrVdd}ddntj}tjd}|d	dd
}|d|d|ffd}d
}y"tdtdj}Wntk
rt	}nX||_|S(Ncs
|S(N((RtlRp(tfunc(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRriiiicSsJtdkrdnd}tjd||d|}|j|jfgS(	Niiiiitlimiti(iii(tsystem_versiont	tracebackt
extract_stacktfilenameRH(RPRt
frame_summary((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRSscSs2tj|d|}|d}|j|jfgS(NRPi(RRt
extract_tbRTRH(ttbRPtframesRU((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRVs
iRPiicsxy&|d}td<|SWqtk
rdrInAz:tjd}|dddd ksnWd~Xdkrdcd7Rt	__class__(ii(
tsingleArgBuiltinsRRQRRRSRVtgetattrRt	ExceptionRu(ROR[RSt	LINE_DIFFt	this_lineR]t	func_name((RVRZRORPR[R\s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_trim_aritys*
					
	cBseZdZdZeZedZedZedZ	dZ
dZedZe
dZd	Zd
ZdZdZd
ZdZe
dZdZe
e
dZdZdZdefdYZedFk	rdefdYZndefdYZiZe Z!ddgZ"e
e
dZ#eZ$edZ%eZ&eddZ'edZ(e)edZ*d Z+e)d!Z,e)ed"Z-d#Z.d$Z/d%Z0d&Z1d'Z2d(Z3d)Z4d*Z5d+Z6d,Z7d-Z8d.Z9d/Z:dFd0Z;d1Z<d2Z=d3Z>d4Z?d5Z@d6ZAe
d7ZBd8ZCd9ZDd:ZEd;ZFgd<ZGed=ZHd>ZId?ZJd@ZKdAZLdBZMe
dCZNe
dDe
e
edEZORS(Gs)Abstract base level parser element class.s 
	
cCs
|t_dS(s
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space,  and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        N(R"tDEFAULT_WHITE_CHARS(tchars((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDefaultWhitespaceChars=s
cCs
|t_dS(s
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        N(R"t_literalStringClass(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytinlineLiteralsUsingLscCst|_d|_d|_d|_||_t|_t	j
|_t|_t
|_t
|_t|_t
|_t
|_t|_d|_t|_d|_d|_t|_t
|_dS(NRr(NNN(RtparseActionRt
failActiontstrReprtresultsNamet
saveAsListRtskipWhitespaceR"Rft
whiteCharstcopyDefaultWhiteCharsRtmayReturnEmptytkeepTabstignoreExprstdebugtstreamlinedt
mayIndexErrorterrmsgtmodalResultstdebugActionstretcallPreparset
callDuringTry(Rtsavelist((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRas(																cCsEtj|}|j|_|j|_|jrAtj|_n|S(s$
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        (RRkRuRrR"RfRq(Rtcpy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRxs

	cCs>||_d|j|_t|dr:|j|j_n|S(sf
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        s	Expected t	exception(RRyRRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetNames
	cCsE|j}|jdr.|d }t}n||_||_|S(sP
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        t*i(RtendswithRRnRz(RRtlistAllMatchestnewself((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetResultsNames
		
csa|r9|jttfd}|_||_n$t|jdr]|jj|_n|S(sMethod to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        cs)ddl}|j||||S(Ni(tpdbt	set_trace(RERt	doActionstcallPreParseR(t_parseMethod(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytbreakers
t_originalParseMethod(t_parseRRR(Rt	breakFlagR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetBreaks		cOs7tttt||_|jdt|_|S(s
        Define action to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}} for more information
        on parsing strings containing C{}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        R~(RtmapReRkRRR~(RtfnsR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRzs"cOsF|jtttt|7_|jp<|jdt|_|S(s
        Add parse action to expression's list of parse actions. See L{I{setParseAction}}.
        
        See examples in L{I{copy}}.
        R~(RkRRReR~RR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytaddParseActions$cs|jdd|jdtr*tntx3|D]+fd}|jj|q7W|jp~|jdt|_|S(sAdd a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        tmessagesfailed user-defined conditiontfatalcs7tt|||s3||ndS(N(RRe(RRNRp(texc_typetfnR(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpasR~(RRRRRkRR~(RRRR((RRRs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytaddConditions
cCs
||_|S(sDefine action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately.(Rl(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
setFailActions
	cCsnt}xa|rit}xN|jD]C}y)x"|j||\}}t}q+WWqtk
raqXqWq	W|S(N(RRRuRR(RRERt
exprsFoundtetdummy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_skipIgnorables#s	
cCsp|jr|j||}n|jrl|j}t|}x-||krh|||krh|d7}q?Wn|S(Ni(RuRRpRqR(RRERtwttinstrlen((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpreParse0s			cCs
|gfS(N((RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	parseImpl<scCs|S(N((RRERt	tokenlist((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	postParse?sc	Cs|j}|s|jr,|jdr?|jd|||n|rc|jrc|j||}n|}|}yUy|j|||\}}Wn/tk
rt|t||j	|nXWqt
k
r(}	|jdr|jd||||	n|jr"|j||||	nqXn|rP|jrP|j||}n|}|}|jsw|t|kry|j|||\}}Wqtk
rt|t||j	|qXn|j|||\}}|j|||}t
||jd|jd|j}
|jrf|s7|jrf|ryrxk|jD]`}||||
}|dk	rJt
||jd|jot|t
tfd|j}
qJqJWWqct
k
r}	|jdr|jd||||	nqcXqfxn|jD]`}||||
}|dk	rt
||jd|joMt|t
tfd|j}
qqWn|r|jdr|jd|||||
qn||
fS(NiiRRi(RvRlR{R}RRRRRRyRRxRR RnRoRzRkR~RRsR(RRERRRt	debuggingtprelocttokensStartttokensterrt	retTokensR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
_parseNoCacheCsp	

&
	

%$	

	
#cCsNy|j||dtdSWn)tk
rIt|||j|nXdS(NRi(RRRRRy(RRER((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyttryParses
cCs7y|j||Wnttfk
r.tSXtSdS(N(RRRRR(RRER((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcanParseNexts
t_UnboundedCachecBseZdZRS(csit|_fd}fd}fd}tj|||_tj|||_tj|||_dS(Ncsj|S(N(R(RR(tcachetnot_in_cache(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscs||})
         - define your parse action using the full C{(s,loc,toks)} signature, and
           reference the input string using the parse action's C{s} argument
         - explictly expand the tabs in your input string before calling
           C{parseString}
        
        Example::
            Word('a').parseString('aaaaabaaa')  # -> ['aaaaa']
            Word('a').parseString('aaaaabaaa', parseAll=True)  # -> Exception: Expected end of text
        iN(
R"RRwt
streamlineRuRtt
expandtabsRRRR'Rtverbose_stacktrace(RREtparseAllRRRtseRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytparseString#s$
	
		
ccs|js|jnx|jD]}|jq W|jsRt|j}nt|}d}|j}|j}t	j
d}	yx||kra|	|kray.|||}
|||
dt\}}Wntk
r|
d}qX||krT|	d7}	||
|fV|rK|||}
|
|kr>|}qQ|d7}q^|}q|
d}qWWn(t
k
r}t	jrq|nXdS(s
        Scan the input string for expression matches.  Each match will return the
        matching tokens, start location, and end location.  May be called with optional
        C{maxMatches} argument, to clip scanning after 'n' matches are found.  If
        C{overlap} is specified, then overlapping matches will be reported.

        Note that the start and end locations are reported relative to the string
        being parsed.  See L{I{parseString}} for more information on parsing
        strings with embedded tabs.

        Example::
            source = "sldjf123lsdjjkf345sldkjf879lkjsfd987"
            print(source)
            for tokens,start,end in Word(alphas).scanString(source):
                print(' '*start + '^'*(end-start))
                print(' '*start + tokens[0])
        
        prints::
        
            sldjf123lsdjjkf345sldkjf879lkjsfd987
            ^^^^^
            sldjf
                    ^^^^^^^
                    lsdjjkf
                              ^^^^^^
                              sldkjf
                                       ^^^^^^
                                       lkjsfd
        iRiN(RwRRuRtRRRRRR"RRRRR(RREt
maxMatchestoverlapRRRt
preparseFntparseFntmatchesRtnextLocRtnextlocRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
scanStringUsB	
			


	
		c	Cs%g}d}t|_yx|j|D]}\}}}|j|||!|rt|trs||j7}qt|tr||7}q|j|n|}q(W|j||g|D]}|r|^q}djt	t
t|SWn(tk
r }t
jrq!|nXdS(sf
        Extension to C{L{scanString}}, to modify matching text with modified tokens that may
        be returned from a parse action.  To use C{transformString}, define a grammar and
        attach a parse action to it that modifies the returned token list.
        Invoking C{transformString()} on a target string will then scan for matches,
        and replace the matched text patterns according to the logic in the parse
        action.  C{transformString()} returns the resulting transformed string.
        
        Example::
            wd = Word(alphas)
            wd.setParseAction(lambda toks: toks[0].title())
            
            print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york."))
        Prints::
            Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York.
        iRrN(RRtRRRsR RRRRRt_flattenRR"R(	RRERtlastERpRRtoRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR{s(	

 	cCsey6tg|j||D]\}}}|^qSWn(tk
r`}tjrWqa|nXdS(s~
        Another extension to C{L{scanString}}, simplifying the access to the tokens found
        to match the given parse expression.  May be called with optional
        C{maxMatches} argument, to clip searching after 'n' matches are found.
        
        Example::
            # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters
            cap_word = Word(alphas.upper(), alphas.lower())
            
            print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))
        prints::
            ['More', 'Iron', 'Lead', 'Gold', 'I']
        N(R RRR"R(RRERRpRRRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsearchStrings6	c	csfd}d}xJ|j|d|D]3\}}}|||!V|rO|dVn|}q"W||VdS(s[
        Generator method to split a string using the given expression as a separator.
        May be called with optional C{maxsplit} argument, to limit the number of splits;
        and the optional C{includeSeparators} argument (default=C{False}), if the separating
        matching text should be included in the split results.
        
        Example::        
            punc = oneOf(list(".,;:/-!?"))
            print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
        prints::
            ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
        iRN(R(	RREtmaxsplittincludeSeparatorstsplitstlastRpRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
%
cCsdt|tr!tj|}nt|tsTtjdt|tdddSt	||gS(s
        Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
        converts them to L{Literal}s by default.
        
        Example::
            greet = Word(alphas) + "," + Word(alphas) + "!"
            hello = "Hello, World!"
            print (hello, "->", greet.parseString(hello))
        Prints::
            Hello, World! -> ['Hello', ',', 'World', '!']
        s4Cannot combine element of type %s with ParserElementt
stackleveliN(
RsRR"RitwarningstwarnRt
SyntaxWarningRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s
cCs\t|tr!tj|}nt|tsTtjdt|tdddS||S(s]
        Implementation of + operator when left operand is not a C{L{ParserElement}}
        s4Cannot combine element of type %s with ParserElementRiN(	RsRR"RiRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
cCsmt|tr!tj|}nt|tsTtjdt|tdddSt	|t	j
|gS(sQ
        Implementation of - operator, returns C{L{And}} with error stop
        s4Cannot combine element of type %s with ParserElementRiN(RsRR"RiRRRRRRt
_ErrorStop(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__sub__s
cCs\t|tr!tj|}nt|tsTtjdt|tdddS||S(s]
        Implementation of - operator when left operand is not a C{L{ParserElement}}
        s4Cannot combine element of type %s with ParserElementRiN(	RsRR"RiRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rsub__ s
csEt|tr|d}}n-t|tr7|dd }|dd
kr_d|df}nt|dtr|dd
kr|ddkrtS|ddkrtS|dtSqLt|dtrt|dtr|\}}||8}qLtdt|dt|dntdt||dkrgtdn|dkrtdn||kodknrtdn|rfd	|r
|dkr|}qt	g||}qA|}n(|dkr.}nt	g|}|S(s
        Implementation of * operator, allows use of C{expr * 3} in place of
        C{expr + expr + expr}.  Expressions may also me multiplied by a 2-integer
        tuple, similar to C{{min,max}} multipliers in regular expressions.  Tuples
        may also include C{None} as in:
         - C{expr*(n,None)} or C{expr*(n,)} is equivalent
              to C{expr*n + L{ZeroOrMore}(expr)}
              (read as "at least n instances of C{expr}")
         - C{expr*(None,n)} is equivalent to C{expr*(0,n)}
              (read as "0 to n instances of C{expr}")
         - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)}
         - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)}

        Note that C{expr*(None,n)} does not raise an exception if
        more than n exprs exist in the input stream; that is,
        C{expr*(None,n)} does not enforce a maximum number of expr
        occurrences.  If this behavior is desired, then write
        C{expr*(None,n) + ~expr}
        iiis7cannot multiply 'ParserElement' and ('%s','%s') objectss0cannot multiply 'ParserElement' and '%s' objectss/cannot multiply ParserElement by negative values@second tuple value must be greater or equal to first tuple values+cannot multiply ParserElement by 0 or (0,0)cs2|dkr$t|dStSdS(Ni(R(tn(tmakeOptionalListR(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR]sN(NN(
RsRottupleRR0RRRt
ValueErrorR(RR	tminElementstoptElementsR}((RRs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__mul__,sD#

&
) 	cCs
|j|S(N(R(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rmul__pscCsdt|tr!tj|}nt|tsTtjdt|tdddSt	||gS(sI
        Implementation of | operator - returns C{L{MatchFirst}}
        s4Cannot combine element of type %s with ParserElementRiN(
RsRR"RiRRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__or__ss
cCs\t|tr!tj|}nt|tsTtjdt|tdddS||BS(s]
        Implementation of | operator when left operand is not a C{L{ParserElement}}
        s4Cannot combine element of type %s with ParserElementRiN(	RsRR"RiRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ror__s
cCsdt|tr!tj|}nt|tsTtjdt|tdddSt	||gS(sA
        Implementation of ^ operator - returns C{L{Or}}
        s4Cannot combine element of type %s with ParserElementRiN(
RsRR"RiRRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__xor__s
cCs\t|tr!tj|}nt|tsTtjdt|tdddS||AS(s]
        Implementation of ^ operator when left operand is not a C{L{ParserElement}}
        s4Cannot combine element of type %s with ParserElementRiN(	RsRR"RiRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rxor__s
cCsdt|tr!tj|}nt|tsTtjdt|tdddSt	||gS(sC
        Implementation of & operator - returns C{L{Each}}
        s4Cannot combine element of type %s with ParserElementRiN(
RsRR"RiRRRRRR
(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__and__s
cCs\t|tr!tj|}nt|tsTtjdt|tdddS||@S(s]
        Implementation of & operator when left operand is not a C{L{ParserElement}}
        s4Cannot combine element of type %s with ParserElementRiN(	RsRR"RiRRRRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rand__s
cCs
t|S(sE
        Implementation of ~ operator - returns C{L{NotAny}}
        (R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
__invert__scCs'|dk	r|j|S|jSdS(s

        Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}.
        
        If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be
        passed as C{True}.
           
        If C{name} is omitted, same as calling C{L{copy}}.

        Example::
            # these are equivalent
            userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
            userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")             
        N(RRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__call__s
cCs
t|S(s
        Suppresses the output of this C{ParserElement}; useful to keep punctuation from
        cluttering up returned output.
        (R)(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsuppressscCs
t|_|S(s
        Disables the skipping of whitespace before matching the characters in the
        C{ParserElement}'s defined pattern.  This is normally only used internally by
        the pyparsing module, but may be needed in some whitespace-sensitive grammars.
        (RRp(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytleaveWhitespaces	cCst|_||_t|_|S(s8
        Overrides the default whitespace chars
        (RRpRqRRr(RRg((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetWhitespaceCharss			cCs
t|_|S(s
        Overrides default behavior to expand C{}s to spaces before parsing the input string.
        Must be called before C{parseString} when the input grammar contains elements that
        match C{} characters.
        (RRt(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
parseWithTabss	cCsrt|trt|}nt|trR||jkrn|jj|qnn|jjt|j|S(s
        Define expression to be ignored (e.g., comments) while doing pattern
        matching; may be called repeatedly, to define multiple comment or other
        ignorable patterns.
        
        Example::
            patt = OneOrMore(Word(alphas))
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
            
            patt.ignore(cStyleComment)
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd']
        (RsRR)RuRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytignores
cCs1|p	t|pt|ptf|_t|_|S(sT
        Enable display of debugging messages while doing pattern matching.
        (RGRKRMR{RRv(RtstartActiont
successActiontexceptionAction((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDebugActions
s
			cCs)|r|jtttn	t|_|S(s
        Enable display of debugging messages while doing pattern matching.
        Set C{flag} to True to enable, False to disable.

        Example::
            wd = Word(alphas).setName("alphaword")
            integer = Word(nums).setName("numword")
            term = wd | integer
            
            # turn on debugging for wd
            wd.setDebug()

            OneOrMore(term).parseString("abc 123 xyz 890")
        
        prints::
            Match alphaword at loc 0(1,1)
            Matched alphaword -> ['abc']
            Match alphaword at loc 3(1,4)
            Exception raised:Expected alphaword (at char 4), (line:1, col:5)
            Match alphaword at loc 7(1,8)
            Matched alphaword -> ['xyz']
            Match alphaword at loc 11(1,12)
            Exception raised:Expected alphaword (at char 12), (line:1, col:13)
            Match alphaword at loc 15(1,16)
            Exception raised:Expected alphaword (at char 15), (line:1, col:16)

        The output shown is that produced by the default debug actions - custom debug actions can be
        specified using L{setDebugActions}. Prior to attempting
        to match the C{wd} expression, the debugging message C{"Match  at loc (,)"}
        is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"}
        message is shown. Also note the use of L{setName} to assign a human-readable name to the expression,
        which makes debugging and exception messages easier to understand - for instance, the default
        name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}.
        (RRGRKRMRRv(Rtflag((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDebugs#	cCs|jS(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR@scCs
t|S(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRCscCst|_d|_|S(N(RRwRRm(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRFs		cCsdS(N((RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckRecursionKscCs|jgdS(sj
        Check defined expressions for valid structure, check for infinite recursive definitions.
        N(R(Rt
validateTrace((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytvalidateNscCsy|j}Wn5tk
rGt|d}|j}WdQXnXy|j||SWn(tk
r}tjr}q|nXdS(s
        Execute the parse expression on the given file or filename.
        If a filename is specified (instead of a file object),
        the entire file is opened, read, and closed before parsing.
        trN(treadRtopenRRR"R(Rtfile_or_filenameRt
file_contentstfRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	parseFileTs
	cCsdt|tr1||kp0t|t|kSt|trM|j|Stt||kSdS(N(RsR"tvarsRRtsuper(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__eq__hs
"
cCs||kS(N((RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ne__pscCstt|S(N(thashtid(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__hash__sscCs
||kS(N((RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__req__vscCs||kS(N((RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rne__yscCs:y!|jt|d|tSWntk
r5tSXdS(s
        Method for quick testing of a parser against a test string. Good for simple 
        inline microtests of sub expressions while building up larger parser.
           
        Parameters:
         - testString - to test against this expression for a match
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests
            
        Example::
            expr = Word(nums)
            assert expr.matches("100")
        RN(RRRRR(Rt
testStringR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR|s


t#cCsyt|tr6tttj|jj}nt|trTt|}ng}g}t	}	x|D]}
|dk	r|j|
ts|r|
r|j
|
qmn|
sqmndj||
g}g}yQ|
jdd}
|j|
d|}|j
|jd||	o%|}	Wntk
r}
t|
trPdnd}d|
kr|j
t|
j|
|j
dt|
j|
dd	|n|j
d|
jd	||j
d
t|
|	o|}	|
}n<tk
r*}|j
dt||	o|}	|}nX|rX|rG|j
dndj|GHn|j
|
|fqmW|	|fS(
s3
        Execute the parse expression on a series of test strings, showing each
        test, the parsed results or where the parse failed. Quick and easy way to
        run a parse expression against a list of sample strings.
           
        Parameters:
         - tests - a list of separate test strings, or a multiline string of test strings
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests           
         - comment - (default=C{'#'}) - expression for indicating embedded comments in the test 
              string; pass None to disable comment filtering
         - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline;
              if False, only dump nested list
         - printResults - (default=C{True}) prints test output to stdout
         - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing

        Returns: a (success, results) tuple, where success indicates that all tests succeeded
        (or failed if C{failureTests} is True), and the results contain a list of lines of each 
        test's output
        
        Example::
            number_expr = pyparsing_common.number.copy()

            result = number_expr.runTests('''
                # unsigned integer
                100
                # negative integer
                -100
                # float with scientific notation
                6.02e23
                # integer with scientific notation
                1e-12
                ''')
            print("Success" if result[0] else "Failed!")

            result = number_expr.runTests('''
                # stray character
                100Z
                # missing leading digit before '.'
                -.100
                # too many '.'
                3.14.159
                ''', failureTests=True)
            print("Success" if result[0] else "Failed!")
        prints::
            # unsigned integer
            100
            [100]

            # negative integer
            -100
            [-100]

            # float with scientific notation
            6.02e23
            [6.02e+23]

            # integer with scientific notation
            1e-12
            [1e-12]

            Success
            
            # stray character
            100Z
               ^
            FAIL: Expected end of text (at char 3), (line:1, col:4)

            # missing leading digit before '.'
            -.100
            ^
            FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1)

            # too many '.'
            3.14.159
                ^
            FAIL: Expected end of text (at char 4), (line:1, col:5)

            Success

        Each test string must be on a single line. If you want to test a string that spans multiple
        lines, create a test like this::

            expr.runTest(r"this is a test\n of strings that spans \n 3 lines")
        
        (Note that this is a raw string literal, you must include the leading 'r'.)
        s
s\nRR6s(FATAL)Rrt it^sFAIL: sFAIL-EXCEPTION: N(RsRRRRuRtrstript
splitlinesRRRRRRRRRR3RRRERR7Ra(RttestsRtcommenttfullDumptprintResultstfailureTestst
allResultstcommentstsuccessRpRtresultRRRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytrunTestssNW'
+
,	
N(PRRRRfRRtstaticmethodRhRjRRRRRRRzRRRRRRRRRRRRRRRRRRRRRRRRRt_MAX_INTRR{RRR
RRRRRRRRRRRRRRRRRRRRRRRRRR	RR
RRRRR"(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR"8s			&	
		
	
		H			"2G	+					D																	
)									cBseZdZdZRS(sT
    Abstract C{ParserElement} subclass, for defining atomic matching patterns.
    cCstt|jdtdS(NR(RR*RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s(RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR*	scBseZdZdZRS(s,
    An empty token, will always match.
    cCs2tt|jd|_t|_t|_dS(NR(RRRRRRsRRx(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s		(RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	scBs#eZdZdZedZRS(s(
    A token that will never match.
    cCs;tt|jd|_t|_t|_d|_dS(NRsUnmatchable token(	RRRRRRsRRxRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR*	s
			cCst|||j|dS(N(RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR1	s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR&	s	cBs#eZdZdZedZRS(s
    Token to exactly match a specified string.
    
    Example::
        Literal('blah').parseString('blah')  # -> ['blah']
        Literal('blah').parseString('blahfooblah')  # -> ['blah']
        Literal('blah').parseString('bla')  # -> Exception: Expected "blah"
    
    For case-insensitive matching, use L{CaselessLiteral}.
    
    For keyword matching (force word break before and after the matched string),
    use L{Keyword} or L{CaselessKeyword}.
    cCstt|j||_t||_y|d|_Wn0tk
rntj	dt
ddt|_nXdt
|j|_d|j|_t|_t|_dS(Nis2null string passed to Literal; use Empty() insteadRis"%s"s	Expected (RRRtmatchRtmatchLentfirstMatchCharRRRRRR^RRRyRRsRx(RtmatchString((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRC	s	
	

	cCsg|||jkrK|jdks7|j|j|rK||j|jfSt|||j|dS(Ni(R'R&t
startswithR%RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRV	s$(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR5	s
	cBsKeZdZedZdedZedZ	dZ
edZRS(s\
    Token to exactly match a specified string as a keyword, that is, it must be
    immediately followed by a non-keyword character.  Compare with C{L{Literal}}:
     - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}.
     - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'}
    Accepts two optional constructor arguments in addition to the keyword string:
     - C{identChars} is a string of characters that would be valid identifier characters,
          defaulting to all alphanumerics + "_" and "$"
     - C{caseless} allows case-insensitive matching, default is C{False}.
       
    Example::
        Keyword("start").parseString("start")  # -> ['start']
        Keyword("start").parseString("starting")  # -> Exception

    For case-insensitive matching, use L{CaselessKeyword}.
    s_$cCstt|j|dkr+tj}n||_t||_y|d|_Wn't	k
r}t
jdtddnXd|j|_
d|j
|_t|_t|_||_|r|j|_|j}nt||_dS(Nis2null string passed to Keyword; use Empty() insteadRis"%s"s	Expected (RRRRtDEFAULT_KEYWORD_CHARSR%RR&R'RRRRRRyRRsRxtcaselesstuppert
caselessmatchRt
identChars(RR(R.R+((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq	s&	
				cCsb|jr||||j!j|jkrF|t||jkse|||jj|jkrF|dks||dj|jkrF||j|jfSn|||jkrF|jdks|j|j|rF|t||jks|||j|jkrF|dks2||d|jkrF||j|jfSt	|||j
|dS(Nii(R+R&R,R-RR.R%R'R)RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s	#9)$3#cCs%tt|j}tj|_|S(N(RRRR*R.(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	scCs
|t_dS(s,Overrides the default Keyword chars
        N(RR*(Rg((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDefaultKeywordChars	sN(
RRRR1R*RRRRRRR#R/(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR^	s
	cBs#eZdZdZedZRS(sl
    Token to match a specified string, ignoring case of letters.
    Note: the matched results will always be in the case of the given
    match string, NOT the case of the input text.

    Example::
        OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD']
        
    (Contrast with example for L{CaselessKeyword}.)
    cCsItt|j|j||_d|j|_d|j|_dS(Ns'%s's	Expected (RRRR,treturnStringRRy(RR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s	cCsS||||j!j|jkr7||j|jfSt|||j|dS(N(R&R,R%R0RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s#(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s
	cBs&eZdZddZedZRS(s
    Caseless version of L{Keyword}.

    Example::
        OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD']
        
    (Contrast with example for L{CaselessLiteral}.)
    cCs#tt|j||dtdS(NR+(RRRR(RR(R.((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	scCs||||j!j|jkrp|t||jks\|||jj|jkrp||j|jfSt|||j|dS(N(R&R,R-RR.R%RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s#9N(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	scBs&eZdZddZedZRS(sx
    A variation on L{Literal} which matches "close" matches, that is, 
    strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters:
     - C{match_string} - string to be matched
     - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match
    
    The results from a successful parse will contain the matched text from the input string and the following named results:
     - C{mismatches} - a list of the positions within the match_string where mismatches were found
     - C{original} - the original match_string used to compare against the input string
    
    If C{mismatches} is an empty list, then the match was an exact match.
    
    Example::
        patt = CloseMatch("ATCATCGAATGGA")
        patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']})
        patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1)

        # exact match
        patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']})

        # close match allowing up to 2 mismatches
        patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2)
        patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']})
    icCs]tt|j||_||_||_d|j|jf|_t|_t|_	dS(Ns&Expected %r (with up to %d mismatches)(
RRjRRtmatch_stringt
maxMismatchesRyRRxRs(RR1R2((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s				cCs|}t|}|t|j}||kr|j}d}g}	|j}
xtt|||!|jD]J\}}|\}}
||
kro|	j|t|	|
krPqqoqoW|d}t|||!g}|j|d<|	|d<||fSnt|||j|dS(Niitoriginalt
mismatches(	RR1R2RRRR RRy(RRERRtstartRtmaxlocR1tmatch_stringlocR4R2ts_mtsrctmattresults((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR	s(		,




(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRj	s	cBs>eZdZddddeddZedZdZRS(s	
    Token for matching words composed of allowed character sets.
    Defined with string containing all allowed initial characters,
    an optional string containing allowed body characters (if omitted,
    defaults to the initial character set), and an optional minimum,
    maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction. An optional
    C{excludeChars} parameter can list characters that might be found in 
    the input C{bodyChars} string; useful to define a word of all printables
    except for one or two characters, for instance.
    
    L{srange} is useful for defining custom character set strings for defining 
    C{Word} expressions, using range notation from regular expression character sets.
    
    A common mistake is to use C{Word} to match a specific literal string, as in 
    C{Word("Address")}. Remember that C{Word} uses the string argument to define
    I{sets} of matchable characters. This expression would match "Add", "AAA",
    "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'.
    To match an exact literal string, use L{Literal} or L{Keyword}.

    pyparsing includes helper strings for building Words:
     - L{alphas}
     - L{nums}
     - L{alphanums}
     - L{hexnums}
     - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.)
     - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.)
     - L{printables} (any non-whitespace character)

    Example::
        # a word composed of digits
        integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9"))
        
        # a word with a leading capital, and zero or more lowercase
        capital_word = Word(alphas.upper(), alphas.lower())

        # hostnames are alphanumeric, with leading alpha, and '-'
        hostname = Word(alphas, alphanums+'-')
        
        # roman numeral (not a strict parser, accepts invalid mix of characters)
        roman = Word("IVXLCDM")
        
        # any string of non-whitespace characters, except for ','
        csv_value = Word(printables, excludeChars=",")
    iicstt|jrcdjfd|D}|rcdjfd|D}qcn||_t||_|r||_t||_n||_t||_|dk|_	|dkrt
dn||_|dkr||_n	t
|_|dkr)||_||_nt||_d|j|_t|_||_d|j|jkr}|dkr}|dkr}|dkr}|j|jkrd	t|j|_net|jdkrd
tj|jt|jf|_n%dt|jt|jf|_|jrDd|jd|_nytj|j|_Wq}tk
ryd|_q}XndS(
NRrc3s!|]}|kr|VqdS(N((RR(texcludeChars(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	7
sc3s!|]}|kr|VqdS(N((RR(R<(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	9
siisZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permitteds	Expected Rs[%s]+s%s[%s]*s	[%s][%s]*s\b(RR-RRt
initCharsOrigRt	initCharst
bodyCharsOrigt	bodyCharstmaxSpecifiedRtminLentmaxLenR$RRRyRRxt	asKeywordt_escapeRegexRangeCharstreStringRR|tescapetcompileRaR(RR>R@tmintmaxtexactRDR<((R<s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR4
sT%								:	
c
Cs|jr[|jj||}|s?t|||j|n|j}||jfS|||jkrt|||j|n|}|d7}t|}|j}||j	}t
||}x*||kr|||kr|d7}qWt}	|||jkrt
}	n|jrG||krG|||krGt
}	n|jr|dkrp||d|ks||kr|||krt
}	qn|	rt|||j|n||||!fS(Nii(R|R%RRytendtgroupR>RR@RCRIRRBRRARD(
RRERRR!R5Rt	bodycharsR6tthrowException((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRj
s6	
	
	%		<cCsytt|jSWntk
r*nX|jdkrd}|j|jkr}d||j||jf|_qd||j|_n|jS(NcSs&t|dkr|d dS|SdS(Nis...(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt
charsAsStr
ss	W:(%s,%s)sW:(%s)(RR-RRaRmRR=R?(RRP((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s
	(N(	RRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR-
s.6#cBsDeZdZeejdZddZedZ	dZ
RS(s
    Token for matching strings that match a given regular expression.
    Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.
    If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as 
    named parse results.

    Example::
        realnum = Regex(r"[+-]?\d+\.\d*")
        date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)')
        # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression
        roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})")
    s[A-Z]icCs3tt|jt|tr|sAtjdtddn||_||_	y+t
j|j|j	|_
|j|_Wqt
jk
rtjd|tddqXnIt|tjr||_
t||_|_||_	ntdt||_d|j|_t|_t|_dS(sThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.s0null string passed to Regex; use Empty() insteadRis$invalid pattern (%s) passed to RegexsCRegex may only be constructed with a string or a compiled RE objects	Expected N(RR%RRsRRRRtpatterntflagsR|RHRFt
sre_constantsterrortcompiledREtypeRuRRRRyRRxRRs(RRQRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s.			


		cCs|jj||}|s6t|||j|n|j}|j}t|j}|rx|D]}||||eZdZddeededZedZdZRS(s
    Token for matching strings that are delimited by quoting characters.
    
    Defined with the following parameters:
        - quoteChar - string of one or more characters defining the quote delimiting string
        - escChar - character to escape quotes, typically backslash (default=C{None})
        - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None})
        - multiline - boolean indicating whether quotes can span multiple lines (default=C{False})
        - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True})
        - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar)
        - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True})

    Example::
        qs = QuotedString('"')
        print(qs.searchString('lsjdf "This is the quote" sldjf'))
        complex_qs = QuotedString('{{', endQuoteChar='}}')
        print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf'))
        sql_qs = QuotedString('"', escQuote='""')
        print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf'))
    prints::
        [['This is the quote']]
        [['This is the "quote"']]
        [['This is the quote with "embedded" quotes']]
    c	sttj|j}|sGtjdtddtn|dkr\|}n4|j}|stjdtddtn|_	t
|_|d_|_
t
|_|_|_|_|_|rTtjtjB_dtjj	tj
d|dk	rDt|pGdf_nPd_dtjj	tj
d|dk	rt|pdf_t
j
d	krjd
djfdtt
j
d	dd
Dd7_n|r*jdtj|7_n|rhjdtj|7_tjjd_njdtjj
7_y+tjjj_j_Wn4tj k
rtjdjtddnXt!_"dj"_#t$_%t&_'dS(Ns$quoteChar cannot be the empty stringRis'endQuoteChar cannot be the empty stringis%s(?:[^%s%s]Rrs%s(?:[^%s\n\r%s]is|(?:s)|(?:c3s<|]2}dtjj| tj|fVqdS(s%s[^%s]N(R|RGtendQuoteCharRE(RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	/sit)s|(?:%s)s|(?:%s.)s(.)s)*%ss$invalid pattern (%s) passed to Regexs	Expected ((RR#RRRRRtSyntaxErrorRt	quoteCharRtquoteCharLentfirstQuoteCharRXtendQuoteCharLentescChartescQuotetunquoteResultstconvertWhitespaceEscapesR|t	MULTILINEtDOTALLRRRGRERQRRtescCharReplacePatternRHRFRSRTRRRyRRxRRs(RR[R_R`t	multilineRaRXRb((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsf		
					(	%E
	c	CsT|||jkr(|jj||p+d}|sOt|||j|n|j}|j}|jrJ||j	|j
!}t|trJd|kr|j
ridd6dd6dd6dd	6}x/|jD]\}}|j||}qWn|jr tj|jd
|}n|jrG|j|j|j}qGqJn||fS(Ns\s	s\ts
s\nss\fs
s\rs\g<1>(R]R|R%RRRyRLRMRaR\R^RsRRbRRR_RReR`RX(	RRERRR!R}tws_maptwslittwschar((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRGs*.	
		!cCs]ytt|jSWntk
r*nX|jdkrVd|j|jf|_n|jS(Ns.quoted string, starting with %s ending with %s(RR#RRaRmRR[RX(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRjs
N(	RRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR#
sA#cBs5eZdZddddZedZdZRS(s
    Token for matching words composed of characters I{not} in a given set (will
    include whitespace in matched characters if not listed in the provided exclusion set - see example).
    Defined with string containing all disallowed characters, and an optional
    minimum, maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction.

    Example::
        # define a comma-separated-value as anything that is not a ','
        csv_value = CharsNotIn(',')
        print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213"))
    prints::
        ['dkls', 'lsdkjf', 's12 34', '@!#', '213']
    iicCstt|jt|_||_|dkr@tdn||_|dkra||_n	t	|_|dkr||_||_nt
||_d|j|_|jdk|_
t|_dS(Nisfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedis	Expected (RRRRRptnotCharsRRBRCR$RRRyRsRx(RRjRIRJRK((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs 					cCs|||jkr.t|||j|n|}|d7}|j}t||jt|}x*||kr|||kr|d7}qfW|||jkrt|||j|n||||!fS(Ni(RjRRyRIRCRRB(RRERRR5tnotcharstmaxlen((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
	cCsytt|jSWntk
r*nX|jdkryt|jdkrfd|jd |_qyd|j|_n|jS(Nis
!W:(%s...)s!W:(%s)(RRRRaRmRRRj(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRvscBsXeZdZidd6dd6dd6dd6d	d
6Zddd
d
dZedZRS(s
    Special matching class for matching whitespace.  Normally, whitespace is ignored
    by pyparsing grammars.  This class is included when some whitespace structures
    are significant.  Define with a string containing the whitespace characters to be
    matched; default is C{" \t\r\n"}.  Also takes optional C{min}, C{max}, and C{exact} arguments,
    as defined for the C{L{Word}} class.
    sRss	ss
ss
sss 	
iicsttj|_jdjfdjDdjdjD_t_	dj_
|_|dkr|_n	t
_|dkr|_|_ndS(NRrc3s$|]}|jkr|VqdS(N(t
matchWhite(RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	scss|]}tj|VqdS(N(R,t	whiteStrs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	ss	Expected i(RR,RRmRRRqRRRsRyRBRCR$(RtwsRIRJRK((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	)				cCs|||jkr.t|||j|n|}|d7}||j}t|t|}x-||kr|||jkr|d7}qcW|||jkrt|||j|n||||!fS(Ni(RmRRyRCRIRRB(RRERRR5R6((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs

"(RRRRnRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR,s
t_PositionTokencBseZdZRS(cCs8tt|j|jj|_t|_t|_	dS(N(
RRpRR^RRRRsRRx(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	(RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRpscBs,eZdZdZdZedZRS(sb
    Token to advance to a specific column of input text; useful for tabular report scraping.
    cCs tt|j||_dS(N(RRRR7(Rtcolno((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCst|||jkrt|}|jrB|j||}nxE||kr||jrt|||jkr|d7}qEWn|S(Ni(R7RRuRtisspace(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	7cCs^t||}||jkr6t||d|n||j|}|||!}||fS(NsText not in expected column(R7R(RRERRtthiscoltnewlocR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs			cBs#eZdZdZedZRS(s
    Matches if current position is at the beginning of a line within the parse string
    
    Example::
    
        test = '''        AAA this line
        AAA and this line
          AAA but not this one
        B AAA and definitely not this one
        '''

        for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
            print(t)
    
    Prints::
        ['AAA', ' this line']
        ['AAA', ' and this line']    

    cCs tt|jd|_dS(NsExpected start of line(RRRRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR&scCs;t||dkr|gfSt|||j|dS(Ni(R7RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR*s
(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cBs#eZdZdZedZRS(sU
    Matches if current position is at the end of a line within the parse string
    cCs<tt|j|jtjjddd|_dS(Ns
RrsExpected end of line(RRRRR"RfRRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR3scCs|t|krK||dkr0|ddfSt|||j|n8|t|krk|dgfSt|||j|dS(Ns
i(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR8s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR/s	cBs#eZdZdZedZRS(sM
    Matches if current position is at the beginning of the parse string
    cCs tt|jd|_dS(NsExpected start of text(RR(RRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRGscCsL|dkrB||j|dkrBt|||j|qBn|gfS(Ni(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRKs(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR(Cs	cBs#eZdZdZedZRS(sG
    Matches if current position is at the end of the parse string
    cCs tt|jd|_dS(NsExpected end of text(RR'RRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRVscCs|t|kr-t|||j|nT|t|krM|dgfS|t|kri|gfSt|||j|dS(Ni(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZs
(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR'Rs	cBs&eZdZedZedZRS(sp
    Matches if the current position is at the beginning of a Word, and
    is not preceded by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of
    the string being parsed, or at the beginning of a line.
    cCs/tt|jt||_d|_dS(NsNot at the start of a word(RR/RRt	wordCharsRy(RRu((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRlscCs^|dkrT||d|jks6|||jkrTt|||j|qTn|gfS(Nii(RuRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqs
(RRRRTRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR/dscBs&eZdZedZedZRS(sZ
    Matches if the current position is at the end of a Word, and
    is not followed by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of
    the string being parsed, or at the end of a line.
    cCs8tt|jt||_t|_d|_dS(NsNot at the end of a word(RR.RRRuRRpRy(RRu((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cCsvt|}|dkrl||krl|||jksN||d|jkrlt|||j|qln|gfS(Nii(RRuRRy(RRERRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs(RRRRTRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR.xscBsqeZdZedZdZdZdZdZdZ	dZ
edZgd	Zd
Z
RS(s^
    Abstract subclass of ParserElement, for combining and post-processing parsed tokens.
    cCstt|j|t|tr4t|}nt|tr[tj|g|_	nt|t
jrt|}td|Drt
tj|}nt||_	n3yt||_	Wntk
r|g|_	nXt|_dS(Ncss|]}t|tVqdS(N(RsR(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(RRRRsRRRR"RitexprsRtIterabletallRRRR}(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
cCs|j|S(N(Rv(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs|jj|d|_|S(N(RvRRRm(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cCsPt|_g|jD]}|j^q|_x|jD]}|jq8W|S(s~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on
           all contained expressions.(RRpRvRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
	%cCst|trb||jkrtt|j|x(|jD]}|j|jdq>Wqn>tt|j|x%|jD]}|j|jdqW|S(Ni(RsR)RuRRRRv(RR	R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsfytt|jSWntk
r*nX|jdkr_d|jjt|j	f|_n|jS(Ns%s:(%s)(
RRRRaRmRR^RRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
%cCswtt|jx|jD]}|jqWt|jdkr`|jd}t||jr|jr|jdkr|j
r|j|jdg|_d|_|j|jO_|j
|j
O_
n|jd}t||jr`|jr`|jdkr`|j
r`|jd |j|_d|_|j|jO_|j
|j
O_
q`ndt||_|S(Niiiis	Expected (RRRRvRRsR^RkRnRRvRmRsRxRRy(RRR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs0


	


	cCstt|j||}|S(N(RRR(RRRR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs@||g}x|jD]}|j|qW|jgdS(N(RvRR(RRttmpR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs>tt|j}g|jD]}|j^q|_|S(N(RRRRv(RR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs%(RRRRRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs						
	"cBsWeZdZdefdYZedZedZdZdZ	dZ
RS(s

    Requires all given C{ParseExpression}s to be found in the given order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'+'} operator.
    May also be constructed using the C{'-'} operator, which will suppress backtracking.

    Example::
        integer = Word(nums)
        name_expr = OneOrMore(Word(alphas))

        expr = And([integer("id"),name_expr("name"),integer("age")])
        # more easily written as:
        expr = integer("id") + name_expr("name") + integer("age")
    RcBseZdZRS(cOs3ttj|j||d|_|jdS(Nt-(RRRRRR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s	(RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
scCsltt|j||td|jD|_|j|jdj|jdj|_t	|_
dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	
si(RRRRxRvRsRRqRpRR}(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s
c	Cs?|jdj|||dt\}}t}x|jdD]}t|tjr`t}q<n|ry|j|||\}}Wqtk
rqtk
r}d|_
tj|qtk
rt|t
||j|qXn|j|||\}}|s$|jr<||7}q<q<W||fS(NiRi(RvRRRsRRRR!RRt
__traceback__RRRRyR(	RRERRt
resultlistt	errorStopRt
exprtokensR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s((
	
%cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR5
scCs@||g}x+|jD] }|j||jsPqqWdS(N(RvRRs(RRtsubRecCheckListR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR:
s

	cCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRt{Rcss|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	F
st}(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRA
s
*(RRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs		cBsAeZdZedZedZdZdZdZ	RS(s
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the expression that matches the longest string will be used.
    May be constructed using the C{'^'} operator.

    Example::
        # construct Or using '^' operator
        
        number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789"))
    prints::
        [['123'], ['3.1416'], ['789']]
    cCsNtt|j|||jrAtd|jD|_n	t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	\
s(RRRRvR4RsR(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRY
s	cCsd}d}g}x|jD]}y|j||}Wntk
rw}	d|	_|	j|kr|	}|	j}qqtk
rt||krt|t||j|}t|}qqX|j	||fqW|rh|j
ddxn|D]c\}
}y|j|||SWqtk
r`}	d|	_|	j|kra|	}|	j}qaqXqWn|dk	r|j|_|nt||d|dS(NiRcSs	|dS(Ni((tx((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqu
Rrs no defined alternatives to match(
RRvRRR{RRRRyRtsortRR(RRERRt	maxExcLoctmaxExceptionRRtloc2Rt_((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR`
s<	
		cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ixor__
scCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs ^ css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	
sR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s
*cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s(
RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRK
s
&			cBsAeZdZedZedZdZdZdZ	RS(s
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the first one listed is the one that will match.
    May be constructed using the C{'|'} operator.

    Example::
        # construct MatchFirst using '|' operator
        
        # watch the order of expressions to match
        number = Word(nums) | Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789")) #  Fail! -> [['123'], ['3'], ['1416'], ['789']]

        # put more selective expression first
        number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums)
        print(number.searchString("123 3.1416 789")) #  Better -> [['123'], ['3.1416'], ['789']]
    cCsNtt|j|||jrAtd|jD|_n	t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	
s(RRRRvR4RsR(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s	c	Csd}d}x|jD]}y|j|||}|SWqtk
ro}|j|kr|}|j}qqtk
rt||krt|t||j|}t|}qqXqW|dk	r|j|_|nt||d|dS(Nis no defined alternatives to match(	RRvRRRRRRyR(	RRERRRRRR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s$
	cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ior__
scCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs | css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	
sR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s
*cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s(
RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR
s			cBs8eZdZedZedZdZdZRS(sm
    Requires all given C{ParseExpression}s to be found, but in any order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'&'} operator.

    Example::
        color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN")
        shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON")
        integer = Word(nums)
        shape_attr = "shape:" + shape_type("shape")
        posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn")
        color_attr = "color:" + color("color")
        size_attr = "size:" + integer("size")

        # use Each (using operator '&') to accept attributes in any order 
        # (shape and posn are required, color and size are optional)
        shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr)

        shape_spec.runTests('''
            shape: SQUARE color: BLACK posn: 100, 120
            shape: CIRCLE size: 50 color: BLUE posn: 50,80
            color:GREEN size:20 shape:TRIANGLE posn:20,40
            '''
            )
    prints::
        shape: SQUARE color: BLACK posn: 100, 120
        ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']]
        - color: BLACK
        - posn: ['100', ',', '120']
          - x: 100
          - y: 120
        - shape: SQUARE


        shape: CIRCLE size: 50 color: BLUE posn: 50,80
        ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']]
        - color: BLUE
        - posn: ['50', ',', '80']
          - x: 50
          - y: 80
        - shape: CIRCLE
        - size: 50


        color: GREEN size: 20 shape: TRIANGLE posn: 20,40
        ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']]
        - color: GREEN
        - posn: ['20', ',', '40']
          - x: 20
          - y: 40
        - shape: TRIANGLE
        - size: 20
    cCsKtt|j||td|jD|_t|_t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(	RR
RRxRvRsRRptinitExprGroups(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cCs4|jrLtd|jD|_g|jD]}t|tr/|j^q/}g|jD]%}|jr]t|tr]|^q]}|||_g|jD]}t|t	r|j^q|_
g|jD]}t|tr|j^q|_g|jD]$}t|tt	tfs|^q|_
|j
|j7_
t|_n|}|j
}|j}	g}
t}x|r_||	|j
|j}g}
x|D]}y|j||}Wntk
r|
j|qX|
j|jjt||||kr|j|q||	kr|	j|qqWt|
t|krut}ququW|rdjd|D}t||d|n|
g|jD]*}t|tr|j|	kr|^q7}
g}x6|
D].}|j|||\}}|j|qWt|tg}||fS(Ncss3|])}t|trt|j|fVqdS(N(RsRRRF(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	ss, css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	=ss*Missing one or more required elements (%s)(RRRvtopt1mapRsRRFRst	optionalsR0tmultioptionalsRt
multirequiredtrequiredRRRRRRRtremoveRRRtsumR (RRERRRtopt1topt2ttmpLocttmpReqdttmpOptt
matchOrdertkeepMatchingttmpExprstfailedtmissingR|R;tfinalResults((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsP	.5
117

	

"
>
cCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs & css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	PsR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRKs
*cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs(RRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR

s
51		cBs_eZdZedZedZdZdZdZ	dZ
gdZdZRS(	sa
    Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens.
    cCstt|j|t|trattjtrItj|}qatjt	|}n||_
d|_|dk	r|j
|_
|j|_|j|j|j|_|j|_|j|_|jj|jndS(N(RRRRsRt
issubclassR"RiR*RRFRRmRxRsRRqRpRoR}RuR(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR^s		cCsG|jdk	r+|jj|||dtStd||j|dS(NRRr(RFRRRRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRpscCs>t|_|jj|_|jdk	r:|jjn|S(N(RRpRFRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRvs
	cCst|trc||jkrtt|j||jdk	r`|jj|jdq`qn?tt|j||jdk	r|jj|jdn|S(Ni(RsR)RuRRRRFR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR}s cCs6tt|j|jdk	r2|jjn|S(N(RRRRFR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsV||kr"t||gn||g}|jdk	rR|jj|ndS(N(R$RFRR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
cCsA||g}|jdk	r0|jj|n|jgdS(N(RFRRR(RRRy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsuytt|jSWntk
r*nX|jdkrn|jdk	rnd|jjt	|jf|_n|jS(Ns%s:(%s)(
RRRRaRmRRFR^RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
%(
RRRRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZs				cBs#eZdZdZedZRS(s
    Lookahead matching of the given parse expression.  C{FollowedBy}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression matches at the current
    position.  C{FollowedBy} always returns a null token list.

    Example::
        # use FollowedBy to match a label only if it is followed by a ':'
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint()
    prints::
        [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']]
    cCs#tt|j|t|_dS(N(RRRRRs(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs|jj|||gfS(N(RFR(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cBs,eZdZdZedZdZRS(s
    Lookahead to disallow matching with the given parse expression.  C{NotAny}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression does I{not} match at the current
    position.  Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny}
    always returns a null token list.  May be constructed using the '~' operator.

    Example::
        
    cCsBtt|j|t|_t|_dt|j|_	dS(NsFound unwanted token, (
RRRRRpRRsRRFRy(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs		cCs:|jj||r0t|||j|n|gfS(N(RFRRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRs~{R(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
	t_MultipleMatchcBs eZddZedZRS(cCsftt|j|t|_|}t|trFtj|}n|dk	rY|nd|_
dS(N(RRRRRoRsRR"RiRt	not_ender(RRFtstopOntender((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs	cCs|jj}|j}|jdk	}|r9|jj}n|rO|||n||||dt\}}y|j}	xo|r|||n|	r|||}
n|}
|||
|\}}|s|jr~||7}q~q~WWnt	t
fk
rnX||fS(NR(RFRRRRRRRuRRR(RRERRtself_expr_parsetself_skip_ignorablestcheck_endert
try_not_enderRthasIgnoreExprsRt	tmptokens((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs,	N(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscBseZdZdZRS(s
    Repetition of one or more of the given expression.
    
    Parameters:
     - expr - expression that must match one or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: BLACK"
        OneOrMore(attr_expr).parseString(text).pprint()  # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']]

        # use stopOn attribute for OneOrMore to avoid reading label string as part of the data
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']]
        
        # could also be written as
        (attr_expr * (1,)).parseString(text).pprint()
    cCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRRs}...(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR!s
(RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscBs/eZdZddZedZdZRS(sw
    Optional repetition of zero or more of the given expression.
    
    Parameters:
     - expr - expression that must match zero or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example: similar to L{OneOrMore}
    cCs)tt|j|d|t|_dS(NR(RR0RRRs(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR6scCsEy tt|j|||SWnttfk
r@|gfSXdS(N(RR0RRR(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR:s cCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRRs]...(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR@s
N(RRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR0*st
_NullTokencBs eZdZeZdZRS(cCstS(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRJscCsdS(NRr((R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRMs(RRRR>R(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRIs	cBs/eZdZedZedZdZRS(sa
    Optional matching of the given expression.

    Parameters:
     - expr - expression that must match zero or more times
     - default (optional) - value to be returned if the optional expression is not found.

    Example::
        # US postal code can be a 5-digit zip, plus optional 4-digit qualifier
        zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4)))
        zip.runTests('''
            # traditional ZIP code
            12345
            
            # ZIP+4 form
            12101-0001
            
            # invalid ZIP
            98765-
            ''')
    prints::
        # traditional ZIP code
        12345
        ['12345']

        # ZIP+4 form
        12101-0001
        ['12101-0001']

        # invalid ZIP
        98765-
             ^
        FAIL: Expected end of text (at char 5), (line:1, col:6)
    cCsAtt|j|dt|jj|_||_t|_dS(NR(	RRRRRFRoRRRs(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRts	cCsy(|jj|||dt\}}Wnottfk
r|jtk	r|jjrt|jg}|j||jj ['3', '.', '1416']
        # will also erroneously match the following
        print(real.parseString('3. 1416')) # -> ['3', '.', '1416']

        real = Combine(Word(nums) + '.' + Word(nums))
        print(real.parseString('3.1416')) # -> ['3.1416']
        # no match when there are internal spaces
        print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...)
    RrcCsQtt|j||r)|jn||_t|_||_t|_dS(N(	RRRRtadjacentRRpt
joinStringR}(RRFRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRrs
			cCs6|jrtj||ntt|j||S(N(RR"RRR(RR	((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR|s	cCse|j}|2|tdj|j|jgd|j7}|jr]|jr]|gS|SdS(NRrR(RR RRRRzRnR(RRERRtretToks((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs1(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRas
	cBs eZdZdZdZRS(s
    Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions.

    Example::
        ident = Word(alphas)
        num = Word(nums)
        term = ident | num
        func = ident + Optional(delimitedList(term))
        print(func.parseString("fn a,b,100"))  # -> ['fn', 'a', 'b', '100']

        func = ident + Group(Optional(delimitedList(term)))
        print(func.parseString("fn a,b,100"))  # -> ['fn', ['a', 'b', '100']]
    cCs#tt|j|t|_dS(N(RRRRRo(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs|gS(N((RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs(RRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs
	cBs eZdZdZdZRS(sW
    Converter to return a repetitive expression as a list, but also as a dictionary.
    Each element can also be referenced using the first token in the expression as its key.
    Useful for tabular report scraping when the first column can be used as a item key.

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        # print attributes as plain groups
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names
        result = Dict(OneOrMore(Group(attr_expr))).parseString(text)
        print(result.dump())
        
        # access named fields as dict entries, or output as dict
        print(result['shape'])        
        print(result.asDict())
    prints::
        ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap']

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'}
    See more examples at L{ParseResults} of accessing fields by results name.
    cCs#tt|j|t|_dS(N(RR	RRRo(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsTx9t|D]+\}}t|dkr1q
n|d}t|trct|dj}nt|dkrtd|||nX|S(ss
    Decorator for debugging parse actions. 
    
    When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
    When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised.

    Example::
        wd = Word(alphas)

        @traceParseAction
        def remove_duplicate_chars(tokens):
            return ''.join(sorted(set(''.join(tokens)))

        wds = OneOrMore(wd).setParseAction(remove_duplicate_chars)
        print(wds.parseString("slkdjs sld sldd sdlf sdljf"))
    prints::
        >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {}))
        <>entering %s(line: '%s', %d, %r)
s< ['aa', 'bb', 'cc']
        delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    s [Rs]...N(RRR0RR)(RFtdelimtcombinetdlName((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR>9s
,!cstfd}|dkrBttjd}n|j}|jd|j|dt|jdt	dS(s:
    Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
        integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    
    If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value.

    Example::
        countedArray(Word(alphas)).parseString('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2))
        countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef')  # -> ['ab', 'cd']
    cs;|d}|r,ttg|p5tt>gS(Ni(RRRA(RRNRpR(t	arrayExprRF(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcountFieldParseAction_s
-cSst|dS(Ni(Ro(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqdRrtarrayLenR~s(len) s...N(
R
RR-RPRzRRRRR(RFtintExprR((RRFs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR:Ls	
cCsMg}x@|D]8}t|tr8|jt|q
|j|q
W|S(N(RsRRRR(tLR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRks
csFtfd}|j|dtjdt|S(s*
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousLiteral(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches a
    previous literal, will also match the leading C{"1:1"} in C{"1:10"}.
    If this is not desired, use C{matchPreviousExpr}.
    Do I{not} use with packrat parsing enabled.
    csc|rTt|dkr'|d>q_t|j}td|D>nt>dS(Niicss|]}t|VqdS(N(R(Rttt((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(RRRRR(RRNRpttflat(trep(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcopyTokenToRepeatersR~s(prev) (R
RRRR(RFR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRMts

	
cs\t|j}|Kfd}|j|dtjdt|S(sS
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousExpr(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches by
    expressions, will I{not} match the leading C{"1:1"} in C{"1:10"};
    the expressions are evaluated first, and then compared, so
    C{"1"} is compared with C{"10"}.
    Do I{not} use with packrat parsing enabled.
    cs8t|jfd}j|dtdS(Ncs7t|j}|kr3tdddndS(NRri(RRR(RRNRpttheseTokens(tmatchTokens(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytmustMatchTheseTokenssR~(RRRzR(RRNRpR(R(Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsR~s(prev) (R
RRRRR(RFte2R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRLs	
cCsUx$dD]}|j|t|}qW|jdd}|jdd}t|S(Ns\^-]s
s\ns	s\t(Rt_bslashR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyREs

c
sD|r!d}d}tnd}d}tg}t|tr]|j}n7t|tjr~t|}ntj	dt
dd|stSd}x|t|d	krV||}xt
||d	D]f\}}	||	|r
|||d	=Pq|||	r|||d	=|j||	|	}PqqW|d	7}qW|r|ryt|td
j|krtdd
jd|Djd
j|Stdjd|Djd
j|SWqtk
rtj	dt
ddqXntfd|Djd
j|S(s
    Helper to quickly define a set of alternative Literals, and makes sure to do
    longest-first testing when there is a conflict, regardless of the input order,
    but returns a C{L{MatchFirst}} for best performance.

    Parameters:
     - strs - a string of space-delimited literals, or a collection of string literals
     - caseless - (default=C{False}) - treat all literals as caseless
     - useRegex - (default=C{True}) - as an optimization, will generate a Regex
          object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or
          if creating a C{Regex} raises an exception)

    Example::
        comp_oper = oneOf("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.searchString("B = 12  AA=23 B<=AA AA>12"))
    prints::
        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    cSs|j|jkS(N(R,(Rtb((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs|jj|jS(N(R,R)(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs
||kS(N((RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs
|j|S(N(R)(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrs6Invalid argument to oneOf, expected string or iterableRiiiRrs[%s]css|]}t|VqdS(N(RE(Rtsym((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	ss | t|css|]}tj|VqdS(N(R|RG(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	ss7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdS(N((RR(tparseElementClass(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	s(RRRsRRRRwRRRRRRRRRR%RRaR(
tstrsR+tuseRegextisequaltmaskstsymbolsRtcurRR	((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRQsL						

!
!33
	cCsttt||S(s
    Helper to easily and clearly define a dictionary by specifying the respective patterns
    for the key and value.  Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
    in the proper order.  The key pattern can include delimiting markers or punctuation,
    as long as they are suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the C{Dict} results can include named token
    fields.

    Example::
        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)

        # similar to Dict, but simpler call format
        result = dictOf(attr_label, attr_value).parseString(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.asDict())
    prints::
        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    (R	R0R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR?s!cCs|tjd}|j}t|_|d||d}|rVd}n	d}|j||j|_|S(s
    Helper to return the original, untokenized text for a given expression.  Useful to
    restore the parsed fields of an HTML start tag into the raw tag text itself, or to
    revert separate tokens with intervening whitespace back to the original matching
    input text. By default, returns astring containing the original parsed text.  
       
    If the optional C{asString} argument is passed as C{False}, then the return value is a 
    C{L{ParseResults}} containing any results names that were originally matched, and a 
    single token containing the original matched text from the input string.  So if 
    the expression passed to C{L{originalTextFor}} contains expressions with defined
    results names, you must set C{asString} to C{False} if you want to preserve those
    results name values.

    Example::
        src = "this is test  bold text  normal text "
        for tag in ("b","i"):
            opener,closer = makeHTMLTags(tag)
            patt = originalTextFor(opener + SkipTo(closer) + closer)
            print(patt.searchString(src)[0])
    prints::
        [' bold text ']
        ['text']
    cSs|S(N((RRRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq8Rrt_original_startt
_original_endcSs||j|j!S(N(RR(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq=RrcSs'||jd|jd!g|(dS(NRR(R(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytextractText?s(RRzRRR}Ru(RFtasStringt	locMarkertendlocMarkert	matchExprR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRe s		
cCst|jdS(sp
    Helper to undo pyparsing's default grouping of And expressions, even
    if all but one are non-empty.
    cSs|dS(Ni((Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqJRr(R+Rz(RF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRfEscCsEtjd}t|d|d|jjdS(s
    Helper to decorate a returned token with its starting and ending locations in the input string.
    This helper adds the following results names:
     - locn_start = location where matched expression begins
     - locn_end = location where matched expression ends
     - value = the actual parsed results

    Be careful if the input text contains C{} characters, you may want to call
    C{L{ParserElement.parseWithTabs}}

    Example::
        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)
    prints::
        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSs|S(N((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq`Rrt
locn_startRtlocn_end(RRzRRR(RFtlocator((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRhLss\[]-*.$+^?()~ RKcCs|ddS(Nii((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqkRrs\\0?[xX][0-9a-fA-F]+cCs tt|djddS(Nis\0xi(tunichrRotlstrip(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqlRrs	\\0[0-7]+cCstt|dddS(Niii(RRo(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqmRrR<s\]s\wRzRRtnegatetbodyRcsOdy-djfdtj|jDSWntk
rJdSXdS(s
    Helper to easily define string ranges for use in Word construction.  Borrows
    syntax from regexp '[]' string range definitions::
        srange("[0-9]")   -> "0123456789"
        srange("[a-z]")   -> "abcdefghijklmnopqrstuvwxyz"
        srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
    The input string must be enclosed in []'s, and the returned string is the expanded
    character set joined into a single string.
    The values enclosed in the []'s may be:
     - a single character
     - an escaped character with a leading backslash (such as C{\-} or C{\]})
     - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) 
         (C{\0x##} is also supported for backwards compatibility) 
     - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
     - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
     - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
    cSsKt|ts|Sdjdtt|dt|ddDS(NRrcss|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	sii(RsR RRtord(tp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrRrc3s|]}|VqdS(N((Rtpart(t	_expanded(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	sN(Rt_reBracketExprRRRa(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR]rs
	-
csfd}|S(st
    Helper method for defining parse actions that require matching at a specific
    column in the input text.
    cs2t||kr.t||dndS(Nsmatched token not at column %d(R7R(R@tlocnRJ(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	verifyCols((RR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRKscs
fdS(s
    Helper method for common parse actions that simply return a literal value.  Especially
    useful when used with C{L{transformString}()}.

    Example::
        num = Word(nums).setParseAction(lambda toks: int(toks[0]))
        na = oneOf("N/A NA").setParseAction(replaceWith(math.nan))
        term = na | num
        
        OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234]
    csgS(N((RRNRp(treplStr(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRr((R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZscCs|ddd!S(s
    Helper parse action for removing quotation marks from parsed quoted strings.

    Example::
        # by default, quotation marks are included in parsed results
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]

        # use removeQuotes to strip quotation marks from parsed results
        quotedString.setParseAction(removeQuotes)
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
    iii((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRXscsafd}y"tdtdj}Wntk
rSt}nX||_|S(sG
    Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional 
    args are passed, they are forwarded to the given function as additional arguments after
    the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
    parsed data to an integer using base 16.

    Example (compare the last to example in L{ParserElement.transformString}::
        hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16))
        hex_ints.runTests('''
            00 11 22 aa FF 0a 0d 1a
            ''')
        
        upperword = Word(alphas).setParseAction(tokenMap(str.upper))
        OneOrMore(upperword).runTests('''
            my kingdom for a horse
            ''')

        wd = Word(alphas).setParseAction(tokenMap(str.title))
        OneOrMore(wd).setParseAction(' '.join).runTests('''
            now is the winter of our discontent made glorious summer by this sun of york
            ''')
    prints::
        00 11 22 aa FF 0a 0d 1a
        [0, 17, 34, 170, 255, 10, 13, 26]

        my kingdom for a horse
        ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE']

        now is the winter of our discontent made glorious summer by this sun of york
        ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York']
    cs g|D]}|^qS(N((RRNRpttokn(RRO(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsRR^(R`RRaRu(RORRRd((RROs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRks 	
	cCst|jS(N(RR,(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCst|jS(N(Rtlower(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCs<t|tr+|}t|d|}n	|j}tttd}|rtjj	t
}td|dtt
t|td|tddtgjdj	d	td
}ndjdtD}tjj	t
t|B}td|dtt
t|j	tttd|tddtgjdj	d
td
}ttd|d
}|jddj|jddjjjd|}|jddj|jddjjjd|}||_||_||fS(sRInternal helper to construct opening and closing tag expressions, given a tag nameR+s_-:Rttagt=t/RRAcSs|ddkS(NiR((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrR Rrcss!|]}|dkr|VqdS(R N((RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys	scSs|ddkS(NiR((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrsRLs(RsRRRR-R2R1R<RRzRXR)R	R0RRRRRRTRWR@Rt_LRttitleRRR(ttagStrtxmltresnamettagAttrNamettagAttrValuetopenTagtprintablesLessRAbracktcloseTag((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt	_makeTagss"	o{AA		cCs
t|tS(s 
    Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches
    tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.

    Example::
        text = 'More info at the pyparsing wiki page'
        # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple
        a,a_end = makeHTMLTags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end
        
        for link in link_expr.searchString(text):
            # attributes in the  tag (like "href" shown here) are also accessible as named results
            print(link.link_text, '->', link.href)
    prints::
        pyparsing -> http://pyparsing.wikispaces.com
    (RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRIscCs
t|tS(s
    Helper to construct opening and closing tag expressions for XML, given a tag name. Matches
    tags only in the given upper/lower case.

    Example: similar to L{makeHTMLTags}
    (RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRJscsT|r|n|jgD]\}}||f^q#fd}|S(s<
    Helper to create a validating parse action to be used with start tags created
    with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
    with a required attribute value, to avoid false matches on common tags such as
    C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 csx~D]v\}}||kr8t||d|n|tjkr|||krt||d||||fqqWdS(Nsno matching attribute s+attribute '%s' has value '%s', must be '%s'(RRct ANY_VALUE(RRNRtattrNamet attrValue(tattrs(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRRs   (R(RtattrDictRRR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRcs 2  %cCs'|rd|nd}ti||6S(s Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 s%s:classtclass(Rc(t classnamet namespacet classattr((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRi\s t(RYcCs<t}||||B}xt|D]\}}|d d \}} } } | dkrdd|nd|} | dkr|d kst|dkrtdn|\} }ntj| }| tjkr| dkr t||t |t |}q| dkrx|d k rQt|||t |t ||}qt||t |t |}q| dkrt|| |||t || |||}qtdn+| tj kr| dkr)t |t st |}nt|j|t ||}q| dkr|d k rpt|||t |t ||}qt||t |t |}q| dkrt|| |||t || |||}qtdn td | r |j| n||j| |BK}|}q(W||K}|S( s Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] iis%s terms %s%s termis@if numterms=3, opExpr must be a tuple or list of two expressionsis6operator must be unary (1), binary (2), or ternary (3)s2operator must indicate right or left associativityN(N(R RRRRRRRtLEFTR RRtRIGHTRsRRFRz(tbaseExprtopListtlpartrparR}tlastExprRtoperDeftopExprtaritytrightLeftAssocRttermNametopExpr1topExpr2tthisExprR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRgsR;    '  /'   $  /'     s4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*t"s string enclosed in double quotess4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*t's string enclosed in single quotess*quotedString using single or double quotestusunicode string literalcCs!||krtdn|d krt|trt|trt|dkrt|dkr|d k rtt|t||tj ddj d}q|t j t||tj j d}q|d k r9tt|t |t |ttj ddj d}qttt |t |ttj ddj d}qtdnt}|d k r|tt|t||B|Bt|K}n.|tt|t||Bt|K}|jd ||f|S( s~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] s.opening and closing strings cannot be the sameiRKcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq9RrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq<RrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqBRrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqFRrsOopening and closing arguments must be strings if no content expression is givensnested %s%s expressionN(RRRsRRRRRR"RfRzRARRR RR)R0R(topenertclosertcontentRR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRNs4:  $  $    5.c s5fd}fd}fd}ttjdj}ttj|jd}tj|jd}tj|jd} |rtt||t|t|t|| } n0tt|t|t|t|} |j t t| jdS( s Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] css|t|krdSt||}|dkro|dkrZt||dnt||dndS(Nisillegal nestingsnot a peer entry(RR7RR(RRNRptcurCol(t indentStack(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckPeerIndentscsEt||}|dkr/j|nt||ddS(Nisnot a subentry(R7RR(RRNRpR+(R,(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckSubIndentscsn|t|krdSt||}oH|dkoH|dks`t||dnjdS(Niisnot an unindent(RR7RR(RRNRpR+(R,(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt checkUnindents &s tINDENTRrtUNINDENTsindented block( RRRRR RzRRRRR( tblockStatementExprR,R$R-R.R/R7R0tPEERtUNDENTtsmExpr((R,s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRdQsN"8 $s#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]s[\0xa1-\0xbf\0xd7\0xf7]s_:sany tagsgt lt amp nbsp quot aposs><& "'s &(?PRs);scommon HTML entitycCstj|jS(sRHelper parser action to replace common HTML entities with their special characters(t_htmlEntityMapRtentity(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRYss/\*(?:[^*]|\*(?!/))*s*/sC style commentss HTML comments.*s rest of lines//(?:\\\n|[^\n])*s // commentsC++ style comments#.*sPython style comments t commaItemRcBseZdZeeZeeZee j dj eZ ee j dj eedZedj dj eZej edej ej dZejdeeeed jeBj d Zejeed j d j eZed j dj eZeeBeBjZedj dj eZeededj dZedj dZedj dZ e de dj dZ!ee de d8dee de d9j dZ"e"j#ddej d Z$e%e!e$Be"Bj d!j d!Z&ed"j d#Z'e(d$d%Z)e(d&d'Z*ed(j d)Z+ed*j d+Z,ed,j d-Z-e.je/jBZ0e(d.Z1e%e2e3d/e4ee5d0d/ee6d1jj d2Z7e8ee9j:e7Bd3d4j d5Z;e(ed6Z<e(ed7Z=RS(:s Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (L{integers}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] tintegers hex integeris[+-]?\d+ssigned integerRtfractioncCs|d|dS(Nii((Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrRzs"fraction or mixed integer-fractions [+-]?\d+\.\d*s real numbers+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)s$real number with scientific notations[+-]?\d+\.?\d*([eE][+-]?\d+)?tfnumberRt identifiersK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}s IPv4 addresss[0-9a-fA-F]{1,4}t hex_integerRisfull IPv6 addressiis::sshort IPv6 addresscCstd|DdkS(Ncss'|]}tjj|rdVqdS(iN(Rlt _ipv6_partR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys si(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrs::ffff:smixed IPv6 addresss IPv6 addresss:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}s MAC addresss%Y-%m-%dcsfd}|S(s Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] csPytj|djSWn+tk rK}t||t|nXdS(Ni(RtstrptimetdateRRRu(RRNRptve(tfmt(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcvt_fns((RBRC((RBs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt convertToDatess%Y-%m-%dT%H:%M:%S.%fcsfd}|S(s Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] csJytj|dSWn+tk rE}t||t|nXdS(Ni(RR?RRRu(RRNRpRA(RB(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRCs((RBRC((RBs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytconvertToDatetimess7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?s ISO8601 dates(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?sISO8601 datetimes2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}tUUIDcCstjj|dS(s Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' i(Rlt_html_stripperR{(RRNR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt stripHTMLTagss RR<s R8RRrscomma separated listcCst|jS(N(RR,(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCst|jS(N(RR(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRr(ii(ii(>RRRRkRotconvertToIntegertfloattconvertToFloatR-RPRRzR9RBR=R%tsigned_integerR:RRRt mixed_integerRtrealtsci_realRtnumberR;R2R1R<t ipv4_addressR>t_full_ipv6_addresst_short_ipv6_addressRt_mixed_ipv6_addressRt ipv6_addresst mac_addressR#RDREt iso8601_datetiso8601_datetimetuuidR5R4RGRHRRRRTR,t _commasepitemR>RWRtcomma_separated_listRbR@(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRlsL  '/-  ;&J+t__main__tselecttfroms_$RRtcolumnsRttablestcommandsK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual s] 100 -100 +100 3.14159 6.02e23 1e-12 s 100 FF s6 12345678-1234-5678-1234-567812345678 (Rt __version__t__versionTime__t __author__RtweakrefRRRRxRR|RSRR8RRRRt_threadRt ImportErrort threadingRRt ordereddictRt__all__Rt version_infoRQRtmaxsizeR$RuRtchrRRRRR2treversedRRR4RxRIRJR_tmaxinttxrangeRt __builtin__RtfnameRR`RRRRRRtascii_uppercasetascii_lowercaseR2RPRBR1RRt printableRTRaRRRR!R$RR tMutableMappingtregisterR7RHRERGRKRMROReR"R*R RRRRiRRRRjR-R%R#RR,RpRRRR(R'R/R.RRRRR RR RRRR0RRRR&R RR+RRR R)RR`RR>R:RRMRLRERRQR?ReRfRhRRARGRFR_R^Rzt _escapedPunct_escapedHexChart_escapedOctChartUNICODEt _singleChart _charRangeRRR]RKRZRXRkRbR@R RIRJRcR RiRRRRRgRSR<R\RWRaRNRdR3RUR5R4RRR6RR9RYR6RCRR[R=R;RDRVRRZR8RlRt selectTokent fromTokentidentt columnNametcolumnNameListt columnSpect tableNamet tableNameListt simpleSQLR"RPR;R=RYRF(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt=s              *         8      @ & A=IG3pLOD|M &# @sQ,A ,    I # %  !4@    ,   ?  #   k%Z r  (, #8+    $     PK!V!o{o{_vendor/six.pyonu[ fcA@@sKdZddlmZddlZddlZddlZddlZddlZdZdZ ej ddkZ ej ddkZ ej dd!dakZ e refZefZefZeZeZejZnefZeefZeejfZeZeZejjd r$edcZnVd efd YZ ye!e Wne"k rjedeZn XedgZ[ dZ#dZ$defdYZ%de%fdYZ&dej'fdYZ(de%fdYZ)defdYZ*e*e+Z,de(fdYZ-e)dddde)d d!d"d#d e)d$d!d!d%d$e)d&d'd"d(d&e)d)d'd*e)d+d!d"d,d+e)d-d.d.d/d-e)d0d.d.d-d0e)d1d'd"d2d1e)d3d'e rd4nd5d6e)d7d'd8e)d9d:d;d<e)ddde)d=d=d>e)d?d?d>e)d@d@d>e)d2d'd"d2d1e)dAd!d"dBdAe)dCd!d!dDdCe&d"d'e&dEdFe&dGdHe&dIdJdKe&dLdMdLe&dNdOdPe&dQdRdSe&dTdUdVe&dWdXdYe&dZd[d\e&d]d^d_e&d`dadbe&dcdddee&dfdgdhe&dididje&dkdkdje&dldldje&dmdmdne&dodpe&dqdre&dsdte&dudvdue&dwdxe&dydzd{e&d|d}d~e&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddd~e&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkr;e.e&ddg7Z.nxJe.D]BZ/e0e-e/j1e/e2e/e&rBe,j3e/de/j1qBqBW[/e.e-_.e-e+dZ4e,j3e4dde(fdYZ5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d<dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6x!e6D]Z/e0e5e/j1e/q0W[/e6e5_.e,j3e5e+dddde(fdYZ7e)ddde)ddde)dddgZ8x!e8D]Z/e0e7e/j1e/qW[/e8e7_.e,j3e7e+dddde(fdYZ9e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddg!Z:x!e:D]Z/e0e9e/j1e/q W[/e:e9_.e,j3e9e+dddde(fdYZ;e)ddde)ddde)ddde)dddgZ<x!e<D]Z/e0e;e/j1e/q W[/e<e;_.e,j3e;e+d d d d e(fd YZ=e)dddgZ>x!e>D]Z/e0e=e/j1e/q; W[/e>e=_.e,j3e=e+ddddej'fdYZ?e,j3e?e+dddZ@dZAe r dZBdZCdZDdZEdZFdZGn$dZBdZCdZDd ZEd!ZFd"ZGy eHZIWneJk r= d#ZInXeIZHy eKZKWneJk rj d$ZKnXe r d%ZLejMZNd&ZOeZPn7d'ZLd(ZNd)ZOd*efd+YZPeKZKe#eLd,ejQeBZRejQeCZSejQeDZTejQeEZUejQeFZVejQeGZWe rd-ZXd.ZYd/ZZd0Z[ej\d1Z]ej\d2Z^ej\d3Z_nQd4ZXd5ZYd6ZZd7Z[ej\d8Z]ej\d9Z^ej\d:Z_e#eXd;e#eYd<e#eZd=e#e[d>e rd?Z`d@ZaebZcddldZdedjedAjfZg[dejhdZiejjZkelZmddlnZnenjoZoenjpZpdBZqej d d krdCZrdDZsq4dEZrdFZsnpdGZ`dHZaecZcebZgdIZidJZkejtejuevZmddloZoeojoZoZpdKZqdCZrdDZse#e`dLe#eadMdNZwdOZxdPZye reze4j{dQZ|ddRZ~ndddSZ|e|dTej d dhkre|dUn)ej d dikre|dVn dWZeze4j{dXdZedkrdYZnej d djkrDeZdZZne#e~d[ej dd!dkkrejejd\Zn ejZd]Zd^Zd_ZgZe+Zejd`dk rge_nejr7xOeejD]>\ZZeej+dkrej1e+kreje=PqqW[[nejje,dS(ls6Utilities for writing code that runs on Python 2 and 3i(tabsolute_importNs'Benjamin Peterson s1.10.0iiitjavaiitXcB@seZdZRS(cC@sdS(NiiI((tself((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__len__>s(t__name__t __module__R(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR<si?cC@s ||_dS(s Add documentation to a function.N(t__doc__(tfunctdoc((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt_add_docKscC@st|tj|S(s7Import module, returning the module after the last dot.(t __import__tsystmodules(tname((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt_import_modulePs t _LazyDescrcB@seZdZdZRS(cC@s ||_dS(N(R(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__init__XscC@sN|j}t||j|yt|j|jWntk rInX|S(N(t_resolvetsetattrRtdelattrt __class__tAttributeError(Rtobjttptresult((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__get__[s  (RRRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRVs t MovedModulecB@s&eZddZdZdZRS(cC@sJtt|j|tr=|dkr1|}n||_n ||_dS(N(tsuperRRtPY3tNonetmod(RRtoldtnew((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRis    cC@s t|jS(N(RR(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRrscC@s/|j}t||}t||||S(N(RtgetattrR(Rtattrt_moduletvalue((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt __getattr__us N(RRRRRR&(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRgs t _LazyModulecB@s eZdZdZgZRS(cC@s)tt|j||jj|_dS(N(RR'RRR(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR~scC@s3ddg}|g|jD]}|j^q7}|S(NRR(t_moved_attributesR(RtattrsR#((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__dir__s #(RRRR*R((((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR'|s  tMovedAttributecB@s eZdddZdZRS(cC@stt|j|trp|dkr1|}n||_|dkrd|dkr[|}qd|}n||_n'||_|dkr|}n||_dS(N(RR+RRRRR#(RRtold_modtnew_modtold_attrtnew_attr((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRs           cC@st|j}t||jS(N(RRR"R#(Rtmodule((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRsN(RRRRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR+st_SixMetaPathImportercB@s_eZdZdZdZdZd dZdZdZ dZ dZ e Z RS( s A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 cC@s||_i|_dS(N(Rt known_modules(Rtsix_module_name((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRs cG@s-x&|D]}||j|jd|(RR6((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt is_packagescC@s|j|dS(s;Return None Required, if is_package is implementedN(R>R(RR6((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytget_codes N( RRRRR7R8RR:R>RARDREt get_source(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR1s       t _MovedItemscB@seZdZgZRS(sLazy loading of moved objects(RRRRB(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRGst cStringIOtiotStringIOtfiltert itertoolstbuiltinstifiltert filterfalset ifilterfalsetinputt __builtin__t raw_inputtinternR tmaptimaptgetcwdtostgetcwdutgetcwdbtrangetxranget reload_modulet importlibtimptreloadtreducet functoolst shlex_quotetpipestshlextquotetUserDictt collectionstUserListt UserStringtziptizipt zip_longestt izip_longestt configparsert ConfigParsertcopyregtcopy_regtdbm_gnutgdbmsdbm.gnut _dummy_threadt dummy_threadthttp_cookiejart cookielibshttp.cookiejart http_cookiestCookies http.cookiest html_entitiesthtmlentitydefss html.entitiest html_parsert HTMLParsers html.parsert http_clientthttplibs http.clienttemail_mime_multipartsemail.MIMEMultipartsemail.mime.multiparttemail_mime_nonmultipartsemail.MIMENonMultipartsemail.mime.nonmultiparttemail_mime_textsemail.MIMETextsemail.mime.texttemail_mime_basesemail.MIMEBasesemail.mime.basetBaseHTTPServers http.servert CGIHTTPServertSimpleHTTPServertcPickletpickletqueuetQueuetreprlibtreprt socketservert SocketServert_threadtthreadttkintertTkinterttkinter_dialogtDialogstkinter.dialogttkinter_filedialogt FileDialogstkinter.filedialogttkinter_scrolledtextt ScrolledTextstkinter.scrolledtextttkinter_simpledialogt SimpleDialogstkinter.simpledialogt tkinter_tixtTixs tkinter.tixt tkinter_ttktttks tkinter.ttkttkinter_constantst Tkconstantsstkinter.constantst tkinter_dndtTkdnds tkinter.dndttkinter_colorchooserttkColorChooserstkinter.colorchooserttkinter_commondialogttkCommonDialogstkinter.commondialogttkinter_tkfiledialogt tkFileDialogt tkinter_fontttkFonts tkinter.fontttkinter_messageboxt tkMessageBoxstkinter.messageboxttkinter_tksimpledialogttkSimpleDialogt urllib_parses.moves.urllib_parses urllib.parset urllib_errors.moves.urllib_errors urllib.errorturllibs .moves.urllibturllib_robotparsert robotparsersurllib.robotparsert xmlrpc_clientt xmlrpclibs xmlrpc.clientt xmlrpc_servertSimpleXMLRPCServers xmlrpc.servertwin32twinregt_winregsmoves.s.movestmovestModule_six_moves_urllib_parsecB@seZdZRS(s7Lazy loading of moved objects in six.moves.urllib_parse(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR@st ParseResultturlparset SplitResulttparse_qst parse_qslt urldefragturljointurlsplitt urlunparset urlunsplitt quote_plustunquotet unquote_plust urlencodet splitquerytsplittagt splitusert uses_fragmentt uses_netloct uses_paramst uses_queryt uses_relativesmoves.urllib_parsesmoves.urllib.parsetModule_six_moves_urllib_errorcB@seZdZRS(s7Lazy loading of moved objects in six.moves.urllib_error(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRhstURLErrorturllib2t HTTPErrortContentTooShortErrors.moves.urllib.errorsmoves.urllib_errorsmoves.urllib.errortModule_six_moves_urllib_requestcB@seZdZRS(s9Lazy loading of moved objects in six.moves.urllib_request(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR|sturlopensurllib.requesttinstall_openert build_openert pathname2urlt url2pathnamet getproxiestRequesttOpenerDirectortHTTPDefaultErrorHandlertHTTPRedirectHandlertHTTPCookieProcessort ProxyHandlert BaseHandlertHTTPPasswordMgrtHTTPPasswordMgrWithDefaultRealmtAbstractBasicAuthHandlertHTTPBasicAuthHandlertProxyBasicAuthHandlertAbstractDigestAuthHandlertHTTPDigestAuthHandlertProxyDigestAuthHandlert HTTPHandlert HTTPSHandlert FileHandlert FTPHandlertCacheFTPHandlertUnknownHandlertHTTPErrorProcessort urlretrievet urlcleanupt URLopenertFancyURLopenert proxy_bypasss.moves.urllib.requestsmoves.urllib_requestsmoves.urllib.requestt Module_six_moves_urllib_responsecB@seZdZRS(s:Lazy loading of moved objects in six.moves.urllib_response(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRstaddbasesurllib.responset addclosehooktaddinfot addinfourls.moves.urllib.responsesmoves.urllib_responsesmoves.urllib.responset#Module_six_moves_urllib_robotparsercB@seZdZRS(s=Lazy loading of moved objects in six.moves.urllib_robotparser(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRstRobotFileParsers.moves.urllib.robotparsersmoves.urllib_robotparsersmoves.urllib.robotparsertModule_six_moves_urllibcB@sheZdZgZejdZejdZejdZejdZ ejdZ dZ RS(sICreate a six.moves.urllib namespace that resembles the Python 3 namespacesmoves.urllib_parsesmoves.urllib_errorsmoves.urllib_requestsmoves.urllib_responsesmoves.urllib_robotparsercC@sdddddgS(NtparseterrortrequesttresponseR((R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR*s( RRRRBt _importerR8RRRRRR*(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRss moves.urllibcC@stt|j|dS(sAdd an item to six.moves.N(RRGR(tmove((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytadd_movescC@s^ytt|WnFtk rYytj|=WqZtk rUtd|fqZXnXdS(sRemove item from six.moves.sno such move, %rN(RRGRRt__dict__R;(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt remove_moves  t__func__t__self__t __closure__t__code__t __defaults__t __globals__tim_functim_selft func_closuret func_codet func_defaultst func_globalscC@s |jS(N(tnext(tit((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytadvance_iterator scC@stdt|jDS(Ncs@s|]}d|jkVqdS(t__call__N(R (t.0tklass((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pys s(tanyttypet__mro__(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcallablescC@s|S(N((tunbound((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytget_unbound_functionscC@s|S(N((Rtcls((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcreate_unbound_methodscC@s|jS(N(R(R"((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR#"scC@stj|||jS(N(ttypest MethodTypeR(RR((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytcreate_bound_method%scC@stj|d|S(N(R&R'R(RR$((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR%(stIteratorcB@seZdZRS(cC@st|j|S(N(Rt__next__(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR-s(RRR(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR)+ss3Get the function out of a possibly unbound functioncK@st|j|S(N(titertkeys(tdtkw((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytiterkeys>scK@st|j|S(N(R+tvalues(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt itervaluesAscK@st|j|S(N(R+titems(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt iteritemsDscK@st|j|S(N(R+tlists(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt iterlistsGsR,R0R2cK@s |j|S(N(R/(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR/PscK@s |j|S(N(R1(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR1SscK@s |j|S(N(R3(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR3VscK@s |j|S(N(R5(R-R.((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR5Ystviewkeyst viewvaluest viewitemss1Return an iterator over the keys of a dictionary.s3Return an iterator over the values of a dictionary.s?Return an iterator over the (key, value) pairs of a dictionary.sBReturn an iterator over the (key, [values]) pairs of a dictionary.cC@s |jdS(Nslatin-1(tencode(ts((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytbkscC@s|S(N((R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytunss>BtassertCountEqualtassertRaisesRegexptassertRegexpMatchestassertRaisesRegext assertRegexcC@s|S(N((R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR;scC@st|jdddS(Ns\\s\\\\tunicode_escape(tunicodetreplace(R:((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR<scC@st|dS(Ni(tord(tbs((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytbyte2intscC@st||S(N(RE(tbufti((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt indexbytesstassertItemsEquals Byte literals Text literalcO@st|t||S(N(R"t_assertCountEqual(Rtargstkwargs((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR=scO@st|t||S(N(R"t_assertRaisesRegex(RRMRN((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR@scO@st|t||S(N(R"t _assertRegex(RRMRN((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRAstexeccC@sC|dkr|}n|j|k r9|j|n|dS(N(Rt __traceback__twith_traceback(RR%ttb((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytreraises   cB@sc|dkrBejd}|j}|dkr<|j}n~n|dkrW|}nddUdS(sExecute code in a namespace.isexec _code_ in _globs_, _locs_N(RR t _getframet f_globalstf_locals(t_code_t_globs_t_locs_tframe((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytexec_s      s9def reraise(tp, value, tb=None): raise tp, value, tb srdef raise_from(value, from_value): if from_value is None: raise value raise value from from_value sCdef raise_from(value, from_value): raise value from from_value cC@s |dS(N((R%t from_value((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt raise_fromstprintc @s|jdtjdkr%dSfd}t}|jdd}|dk rt|trpt}qt|tst dqn|jdd}|dk rt|trt}qt|tst dqn|rt dn|s0x*|D]}t|tr t}Pq q Wn|rQtd }td }n d }d }|dkrr|}n|dkr|}nx7t |D])\} }| r||n||qW||dS( s4The new-style print function for Python 2.4 and 2.5.tfileNc@st|tst|}nttrt|trjdk rtdd}|dkrrd}n|jj|}nj |dS(Nterrorststrict( R?t basestringtstrRaRCtencodingRR"R9twrite(tdataRb(tfp(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRgs  tsepssep must be None or a stringtendsend must be None or a strings$invalid keyword arguments to print()s t ( tpopR tstdoutRtFalseR?RCtTrueRet TypeErrort enumerate( RMRNRgt want_unicodeRjRktargtnewlinetspaceRI((Ris:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytprint_sL              cO@sW|jdtj}|jdt}t|||rS|dk rS|jndS(NRatflush(tgetR RnRmRot_printRRx(RMRNRiRx((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyRw s  sReraise an exception.c@sfd}|S(Nc@s(tj|}|_|S(N(Rbtwrapst __wrapped__(tf(tassignedtupdatedtwrapped(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytwrappers ((RR~RR((R~RRs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR{sc@s5dffdY}tj|ddiS(s%Create a base class with a metaclass.t metaclassc@seZfdZRS(c@s||S(N((R$Rt this_basesR-(tbasestmeta(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt__new__'s(RRR((RR(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR%sttemporary_class((RR(RRR((RRs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytwith_metaclass sc@sfd}|S(s6Class decorator for creating a class with a metaclass.c@s|jj}|jd}|dk rft|trE|g}nx|D]}|j|qLWn|jdd|jdd|j|j|S(Nt __slots__R t __weakref__( R tcopyRyRR?ReRmRt __bases__(R$t orig_varstslotst slots_var(R(s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyR.s   ((RR((Rs:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyt add_metaclass,s cC@sJtrFd|jkr+td|jn|j|_d|_n|S(s A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. t__str__sY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cS@s|jjdS(Nsutf-8(t __unicode__R9(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytJt(tPY2R t ValueErrorRRR(R((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pytpython_2_unicode_compatible<s t__spec__(iiIiIill(ii(ii(ii(ii(Rt __future__RRbRLtoperatorR R&t __author__t __version__t version_infoRRtPY34Ret string_typestintt integer_typesRt class_typest text_typetbytest binary_typetmaxsizetMAXSIZERdtlongt ClassTypeRCtplatformt startswithtobjectRtlent OverflowErrorR RRRt ModuleTypeR'R+R1RRRGR(R#RRR?R7RRt_urllib_parse_moved_attributesRt_urllib_error_moved_attributesRt _urllib_request_moved_attributesRt!_urllib_response_moved_attributesRt$_urllib_robotparser_moved_attributesRR R t _meth_funct _meth_selft _func_closuret _func_codet_func_defaultst _func_globalsRRt NameErrorR!R#R'R(R%R)t attrgettertget_method_functiontget_method_selftget_function_closuretget_function_codetget_function_defaultstget_function_globalsR/R1R3R5t methodcallerR6R7R8R;R<tchrtunichrtstructtStructtpacktint2bytet itemgetterRGtgetitemRJR+t iterbytesRIRJtBytesIORLRORPtpartialRVRER=R@RAR"RMR]RRUR_RwRztWRAPPER_ASSIGNMENTStWRAPPER_UPDATESR{RRRRBt __package__tglobalsRyRtsubmodule_search_locationst meta_pathRrRItimportertappend(((s:/usr/lib/python2.7/site-packages/setuptools/_vendor/six.pyts               >                                                                                 5         PK!IE_vendor/pyparsing.pycnu[ fci@sdZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZyddlmZWn!ek rddlmZnXydd l mZWn?ek r=ydd lmZWnek r9eZnXnXd d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrgiZee jds ZedtdskZere jZ e!Z"e#Z$e!Z%e&e'e(e)e*ee+e,e-e.e/g Z0nre j1Z e2Z3duZ%gZ0ddl4Z4xEdvj5D]7Z6ye0j7e8e4e6Wne9k rZq$nXq$We:dwe3dxDZ;dyZ<dze=fd{YZ>ej?ej@ZAd|ZBeBd}ZCeAeBZDe#d~ZEdjFdejGDZHd!eIfdYZJd#eJfdYZKd%eJfdYZLd'eLfdYZMd*eIfdYZNde=fdYZOd&e=fdYZPe jQjRePdZSdZTdZUdZVdZWdZXdZYddZZd(e=fdYZ[d0e[fdYZ\de\fdYZ]de\fdYZ^de\fdYZ_e_Z`e_e[_ade\fdYZbd e_fdYZcd ebfdYZddpe\fdYZed3e\fdYZfd+e\fdYZgd)e\fdYZhd e\fdYZid2e\fdYZjde\fdYZkdekfdYZldekfdYZmdekfdYZnd.ekfdYZod-ekfdYZpd5ekfdYZqd4ekfdYZrd$e[fdYZsd esfdYZtd esfdYZudesfdYZvdesfdYZwd"e[fdYZxdexfdYZydexfdYZzdexfdYZ{de{fdYZ|d6e{fdYZ}de=fdYZ~e~ZdexfdYZd,exfdYZdexfdYZdefdYZd1exfdYZdefdYZdefdYZdefdYZd/efdYZde=fdYZdZdedZedZdZdZdZdZeedZdZedZdZdZe]jdGZemjdMZenjdLZeojdeZepjddZefeEdddjdZegdjdZegdjdZeeBeBefeHddddxBegde jBZeeedeZe_dedjdee|eeBjddZdZdZdZdZdZedZedZdZdZdZdZe=e_ddZe>Ze=e_e=e_ededdZeZeegddjdZeegddjdZeegddegddBjdZee`dejjdZddeejdZedZedZedZeefeAeDdjd\ZZeedj5dZegddjFejdjdZdZeegddjdZegdjdZegd jjd Zegd jd ZeegddeBjd ZeZegdjdZee|efeHddeefde_denjjdZeeejeBddjd>ZdrfdYZedkrecdZecdZefeAeDdZeeddejeZeeejdZdeBZeeddejeZeeejdZededeedZejdejjdejjdejjd ddlZejjeejejjd!ndS("sS pyparsing module - Classes and methods to define and execute parsing grammars The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements (L{'+'} operator gives L{And} expressions, strings are auto-converted to L{Literal} expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments s2.1.10s07 Oct 2016 01:31 UTCs*Paul McGuire iN(tref(tdatetime(tRLock(t OrderedDicttAndtCaselessKeywordtCaselessLiteralt CharsNotIntCombinetDicttEachtEmptyt FollowedBytForwardt GoToColumntGrouptKeywordtLineEndt LineStarttLiteralt MatchFirsttNoMatchtNotAnyt OneOrMoretOnlyOncetOptionaltOrtParseBaseExceptiontParseElementEnhancetParseExceptiontParseExpressiontParseFatalExceptiont ParseResultstParseSyntaxExceptiont ParserElementt QuotedStringtRecursiveGrammarExceptiontRegextSkipTot StringEndt StringStarttSuppresstTokentTokenConvertertWhitetWordtWordEndt WordStartt ZeroOrMoret alphanumstalphast alphas8bitt anyCloseTagt anyOpenTagt cStyleCommenttcoltcommaSeparatedListtcommonHTMLEntityt countedArraytcppStyleCommenttdblQuotedStringtdblSlashCommentt delimitedListtdictOftdowncaseTokenstemptythexnumst htmlCommenttjavaStyleCommenttlinetlineEndt lineStarttlinenot makeHTMLTagst makeXMLTagstmatchOnlyAtColtmatchPreviousExprtmatchPreviousLiteralt nestedExprtnullDebugActiontnumstoneOftopAssoctoperatorPrecedencet printablestpunc8bittpythonStyleCommentt quotedStringt removeQuotestreplaceHTMLEntityt replaceWitht restOfLinetsglQuotedStringtsranget stringEndt stringStartttraceParseActiont unicodeStringt upcaseTokenst withAttributet indentedBlocktoriginalTextFortungroupt infixNotationt locatedExprt withClasst CloseMatchttokenMaptpyparsing_commoniicCs}t|tr|Syt|SWnUtk rxt|jtjd}td}|jd|j |SXdS(sDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. txmlcharrefreplaces&#\d+;cSs#dtt|ddd!dS(Ns\uiii(thextint(tt((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyttN( t isinstancetunicodetstrtUnicodeEncodeErrortencodetsystgetdefaultencodingR%tsetParseActionttransformString(tobjtrett xmlcharref((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_ustrs  s6sum len sorted reversed list tuple set any all min maxccs|] }|VqdS(N((t.0ty((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sicCsRd}ddjD}x/t||D]\}}|j||}q,W|S(s/Escape &, <, >, ", ', etc. in a string of data.s&><"'css|]}d|dVqdS(t&t;N((Rts((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys ssamp gt lt quot apos(tsplittziptreplace(tdatat from_symbolst to_symbolstfrom_tto_((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _xml_escapes t _ConstantscBseZRS((t__name__t __module__(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRst 0123456789t ABCDEFabcdefi\Rrccs$|]}|tjkr|VqdS(N(tstringt whitespace(Rtc((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys scBs_eZdZdd d dZedZdZdZdZ ddZ d Z RS( s7base exception class for all parsing runtime exceptionsicCs[||_|dkr*||_d|_n||_||_||_|||f|_dS(NRr(tloctNonetmsgtpstrt parserElementtargs(tselfRRRtelem((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__init__s       cCs||j|j|j|jS(s internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses (RRRR(tclstpe((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_from_exceptionscCsm|dkrt|j|jS|dkr>t|j|jS|dkr]t|j|jSt|dS(ssupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text RHR7tcolumnREN(R7R(RHRRR7REtAttributeError(Rtaname((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt __getattr__s   cCs d|j|j|j|jfS(Ns"%s (at char %d), (line:%d, col:%d)(RRRHR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__str__scCs t|S(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__repr__ss>!} ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been found(RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR!scBs eZdZdZdZRS(sZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs ||_dS(N(tparseElementTrace(RtparseElementList((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs d|jS(NsRecursiveGrammarException: %s(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s(RRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR$s t_ParseResultsWithOffsetcBs,eZdZdZdZdZRS(cCs||f|_dS(N(ttup(Rtp1tp2((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR$scCs |j|S(N(R(Rti((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt __getitem__&scCst|jdS(Ni(treprR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR(scCs|jd|f|_dS(Ni(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt setOffset*s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR#s   cBseZdZd-d-eedZd-d-eeedZdZedZ dZ dZ dZ dZ e Zd Zd Zd Zd Zd ZereZeZeZn-eZeZeZdZdZdZdZdZd-dZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'ddZ(d Z)d!Z*d"Z+d-e,ded#Z-d$Z.d%Z/dd&ed'Z0d(Z1d)Z2d*Z3d+Z4d,Z5RS(.sI Structured parse results, to provide multiple means of access to the parsed data: - as a list (C{len(results)}) - by list index (C{results[0], results[1]}, etc.) - by attribute (C{results.} - see L{ParserElement.setResultsName}) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 cCs/t||r|Stj|}t|_|S(N(Rstobjectt__new__tTruet_ParseResults__doinit(RttoklisttnametasListtmodaltretobj((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs  cCs|jrt|_d|_d|_i|_||_||_|dkrTg}n||trp||_ n-||t rt||_ n |g|_ t |_ n|dk r|r|sd|j|s(R(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _itervaluesscsfdjDS(Nc3s|]}||fVqdS(N((RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(R(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _iteritemsscCst|jS(sVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).(RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytkeysscCst|jS(sXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).(Rt itervalues(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytvaluesscCst|jS(sfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).(Rt iteritems(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs t|jS(sSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.(tboolR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pythaskeysscOs|sdg}nxI|jD];\}}|dkrJ|d|f}qtd|qWt|dtst|dks|d|kr|d}||}||=|S|d}|SdS(s Removes and returns item at specified index (default=C{last}). Supports both C{list} and C{dict} semantics for C{pop()}. If passed no argument or an integer argument, it will use C{list} semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use C{dict} semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in C{dict.pop()}. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] itdefaultis-pop() got an unexpected keyword argument '%s'iN(RRRsRoR(RRtkwargsRRtindexR}t defaultvalue((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpops"     cCs||kr||S|SdS(si Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None N((Rtkeyt defaultValue((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs cCsw|jj||x]|jjD]L\}}x=t|D]/\}\}}t||||k|| ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N(RtinsertRRRR(RRtinsStrRRRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR2scCs|jj|dS(s Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N(Rtappend(Rtitem((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRFs cCs0t|tr||7}n|jj|dS(s Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N(RsR Rtextend(Rtitemseq((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs  cCs|j2|jjdS(s7 Clear all elements and results names. N(RRtclear(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRfscCsy ||SWntk r dSX||jkr}||jkrR|j|ddStg|j|D]}|d^qcSndSdS(NRrii(RRRR (RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRms  +cCs|j}||7}|S(N(R(RtotherR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__add__{s  c s|jrt|jfd}|jj}g|D]<\}}|D])}|t|d||df^qMq=}xJ|D]?\}}|||st](RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsRrcCsog}xb|jD]W}|r2|r2|j|nt|trT||j7}q|jt|qW|S(N(RRRsR t _asStringListR(RtseptoutR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs cCs5g|jD]'}t|tr+|jn|^q S(s Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] (RRsR R(Rtres((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscsGtr|j}n |j}fdtfd|DS(s Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} csMt|trE|jr%|jSg|D]}|^q,Sn|SdS(N(RsR RtasDict(R|R(ttoItem(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs    c3s'|]\}}||fVqdS(N((RRR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(tPY_3RRR(Rtitem_fn((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs    cCsPt|j}|jj|_|j|_|jj|j|j|_|S(sA Returns a new copy of a C{ParseResults} object. (R RRRRRR R(RR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs   c Csd}g}td|jjD}|d}|sPd}d}d}nd } |d k rk|} n|jr|j} n| s|rdSd} n|||d| dg7}x t|jD]\} } t| trI| |kr|| j || |o|d k||g7}q|| j d |o6|d k||g7}qd } | |krh|| } n| s|rzqqd} nt t | } |||d| d| d| dg 7}qW|||d| dg7}dj |S( s (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. s css2|](\}}|D]}|d|fVqqdS(iN((RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s s RrtITEMtsgss %s%s- %s: s icss|]}t|tVqdS(N(RsR (Rtvv((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sss %s%s[%d]: %s%s%sRr( RRRRtsortedRRsR tdumpRtanyRR( RR$tdepthtfullRtNLRRRRR1((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR3Ps,  B?cOstj|j||dS(s Pretty-printer for parsed results as a list, using the C{pprint} module. Accepts additional positional or keyword args as defined for the C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N(tpprintR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR8}scCsC|j|jj|jdk r-|jp0d|j|jffS(N(RRRRRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt __getstate__s  cCsm|d|_|d\|_}}|_i|_|jj||dk r`t||_n d|_dS(Nii(RRRRR RRR(RtstateR/t inAccumNames((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt __setstate__s   cCs|j|j|j|jfS(N(RRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__getnewargs__scCs tt|t|jS(N(RRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsN(6RRRRRRRsRRRRRRRt __nonzero__RRRRRRRRRRRRRRRRRRRRR RRRRRRRRRR!R-R0R3R8R9R<R=R(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR -sh& '              4             # =  %-   cCsW|}d|ko#t|knr@||ddkr@dS||jdd|S(sReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. iis (Rtrfind(RtstrgR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR7s cCs|jdd|dS(sReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. s ii(tcount(RR@((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRHs cCsR|jdd|}|jd|}|dkrB||d|!S||dSdS(sfReturns the line of text containing loc within a string, counting newlines as line separators. s iiN(R?tfind(RR@tlastCRtnextCR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyREs  cCsAdt|dt|dt||t||fGHdS(NsMatch s at loc s(%d,%d)(RRHR7(tinstringRtexpr((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultStartDebugActionscCs'dt|dt|jGHdS(NsMatched s -> (RRuR(REtstartloctendlocRFttoks((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultSuccessDebugActionscCsdt|GHdS(NsException raised:(R(RERRFtexc((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_defaultExceptionDebugActionscGsdS(sG'Do-nothing' debug action, to suppress debugging output during parsing.N((R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyROsics tkrfdSdgtgtd dkrVdd}ddntj}tjd}|d dd }|d|d |ffd }d }y"tdtdj}Wntk rt }nX||_|S(Ncs |S(N((RtlRp(tfunc(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRriiiicSsJtdkrdnd}tjd| |d|}|j|jfgS( Niiiiitlimiti(iii(tsystem_versiont tracebackt extract_stacktfilenameRH(RPR t frame_summary((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRSscSs2tj|d|}|d}|j|jfgS(NRPi(RRt extract_tbRTRH(ttbRPtframesRU((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRVs iRPiicsxy&|d}td<|SWqtk rdrInAz:tjd}|dddd ksnWd~Xdkrdcd7Rt __class__(ii( tsingleArgBuiltinsRRQRRRSRVtgetattrRt ExceptionRu(ROR[RSt LINE_DIFFt this_lineR]t func_name((RVRZRORPR[R\s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _trim_aritys*          cBseZdZdZeZedZedZedZ dZ dZ edZ e dZd Zd Zd Zd Zd ZdZe dZdZe e dZdZdZdefdYZedFk rdefdYZndefdYZiZe Z!ddgZ"e e dZ#eZ$edZ%eZ&eddZ'edZ(e)edZ*d Z+e)d!Z,e)ed"Z-d#Z.d$Z/d%Z0d&Z1d'Z2d(Z3d)Z4d*Z5d+Z6d,Z7d-Z8d.Z9d/Z:dFd0Z;d1Z<d2Z=d3Z>d4Z?d5Z@d6ZAe d7ZBd8ZCd9ZDd:ZEd;ZFgd<ZGed=ZHd>ZId?ZJd@ZKdAZLdBZMe dCZNe dDe e edEZORS(Gs)Abstract base level parser element class.s cCs |t_dS(s Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N(R"tDEFAULT_WHITE_CHARS(tchars((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDefaultWhitespaceChars=s cCs |t_dS(s Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N(R"t_literalStringClass(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytinlineLiteralsUsingLscCst|_d|_d|_d|_||_t|_t j |_ t|_ t |_t |_t|_t |_t |_t|_d|_t|_d|_d|_t|_t |_dS(NRr(NNN(Rt parseActionRt failActiontstrReprt resultsNamet saveAsListRtskipWhitespaceR"Rft whiteCharstcopyDefaultWhiteCharsRtmayReturnEmptytkeepTabst ignoreExprstdebugt streamlinedt mayIndexErrorterrmsgt modalResultst debugActionstret callPreparset callDuringTry(Rtsavelist((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRas(                   cCsEtj|}|j|_|j|_|jrAtj|_n|S(s$ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of C{expr.copy()} is just C{expr()}:: integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") (RRkRuRrR"RfRq(Rtcpy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRxs    cCs>||_d|j|_t|dr:|j|j_n|S(sf Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) s Expected t exception(RRyRRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetNames  cCsE|j}|jdr.|d }t}n||_| |_|S(sP Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, C{expr("name")} in place of C{expr.setResultsName("name")} - see L{I{__call__}<__call__>}. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") t*i(RtendswithRRnRz(RRtlistAllMatchestnewself((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetResultsNames     csa|r9|jttfd}|_||_n$t|jdr]|jj|_n|S(sMethod to invoke the Python pdb debugger when this element is about to be parsed. Set C{breakFlag} to True to enable, False to disable. cs)ddl}|j||||S(Ni(tpdbt set_trace(RERt doActionst callPreParseR(t _parseMethod(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytbreakers  t_originalParseMethod(t_parseRRR(Rt breakFlagR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetBreaks   cOs7tttt||_|jdt|_|S(s  Define action to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] R~(RtmapReRkRRR~(RtfnsR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRzs"cOsF|jtttt|7_|jp<|jdt|_|S(s Add parse action to expression's list of parse actions. See L{I{setParseAction}}. See examples in L{I{copy}}. R~(RkRRReR~RR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytaddParseActions$cs|jdd|jdtr*tntx3|D]+fd}|jj|q7W|jp~|jdt|_|S(sAdd a boolean predicate function to expression's list of parse actions. See L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, functions passed to C{addCondition} need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) tmessagesfailed user-defined conditiontfatalcs7tt|||s3||ndS(N(RRe(RRNRp(texc_typetfnR(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpasR~(RRRRRkRR~(RRRR((RRRs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt addConditions cCs ||_|S(s Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments C{fn(s,loc,expr,err)} where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw C{L{ParseFatalException}} if it is desired to stop parsing immediately.(Rl(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt setFailActions cCsnt}xa|rit}xN|jD]C}y)x"|j||\}}t}q+WWqtk raqXqWq W|S(N(RRRuRR(RRERt exprsFoundtetdummy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt_skipIgnorables#s   cCsp|jr|j||}n|jrl|j}t|}x-||krh|||krh|d7}q?Wn|S(Ni(RuRRpRqR(RRERtwttinstrlen((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytpreParse0s    cCs |gfS(N((RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt parseImpl<scCs|S(N((RRERt tokenlist((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt postParse?sc Cs|j}|s|jr,|jdr?|jd|||n|rc|jrc|j||}n|}|}yUy|j|||\}}Wn/tk rt|t||j |nXWqt k r(} |jdr|jd|||| n|jr"|j|||| nqXn|rP|jrP|j||}n|}|}|j sw|t|kry|j|||\}}Wqtk rt|t||j |qXn|j|||\}}|j |||}t ||jd|jd|j} |jrf|s7|jrf|ryrxk|jD]`} | ||| }|dk rJt ||jd|jot|t tfd|j} qJqJWWqct k r} |jdr|jd|||| nqcXqfxn|jD]`} | ||| }|dk rt ||jd|joMt|t tfd|j} qqWn|r|jdr|jd||||| qn|| fS(NiiRRi(RvRlR{R}RRRRRRyRRxRR RnRoRzRkR~RRsR( RRERRRt debuggingtpreloct tokensStartttokensterrt retTokensR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _parseNoCacheCsp   &    %$       #cCsNy|j||dtdSWn)tk rIt|||j|nXdS(NRi(RRRRRy(RRER((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyttryParses cCs7y|j||Wnttfk r.tSXtSdS(N(RRRRR(RRER((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt canParseNexts t_UnboundedCachecBseZdZRS(csit|_fd}fd}fd}tj|||_tj|||_tj|||_dS(Ncsj|S(N(R(RR(tcachet not_in_cache(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscs||}) - define your parse action using the full C{(s,loc,toks)} signature, and reference the input string using the parse action's C{s} argument - explictly expand the tabs in your input string before calling C{parseString} Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text iN( R"RRwt streamlineRuRtt expandtabsRRR R'Rtverbose_stacktrace(RREtparseAllRRRtseRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt parseString#s$      ccs|js|jnx|jD]}|jq W|jsRt|j}nt|}d}|j}|j}t j d} yx||kra| |kray.|||} ||| dt \} } Wnt k r| d}qX| |krT| d7} | | | fV|rK|||} | |kr>| }qQ|d7}q^| }q| d}qWWn(t k r}t jrq|nXdS(s Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See L{I{parseString}} for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd iRiN(RwRRuRtRRRRRR"RRRRR(RREt maxMatchestoverlapRRRt preparseFntparseFntmatchesRtnextLocRtnextlocRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt scanStringUsB               c Cs%g}d}t|_yx|j|D]}\}}}|j|||!|rt|trs||j7}qt|tr||7}q|j|n|}q(W|j||g|D]}|r|^q}djt t t |SWn(t k r }t jrq!|nXdS(sf Extension to C{L{scanString}}, to modify matching text with modified tokens that may be returned from a parse action. To use C{transformString}, define a grammar and attach a parse action to it that modifies the returned token list. Invoking C{transformString()} on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. C{transformString()} returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) Prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. iRrN(RRtRRRsR RRRRRt_flattenRR"R( RRERtlastERpRRtoRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR{s(     cCsey6tg|j||D]\}}}|^qSWn(tk r`}tjrWqa|nXdS(s~ Another extension to C{L{scanString}}, simplifying the access to the tokens found to match the given parse expression. May be called with optional C{maxMatches} argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) prints:: ['More', 'Iron', 'Lead', 'Gold', 'I'] N(R RRR"R(RRERRpRRRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt searchStrings 6 c csfd}d}xJ|j|d|D]3\}}}|||!V|rO|dVn|}q"W||VdS(s[ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] iRN(R( RREtmaxsplittincludeSeparatorstsplitstlastRpRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs %   cCsdt|tr!tj|}nt|tsTtjdt|tdddSt ||gS(s Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement converts them to L{Literal}s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) Prints:: Hello, World! -> ['Hello', ',', 'World', '!'] s4Cannot combine element of type %s with ParserElementt stackleveliN( RsRR"RitwarningstwarnRt SyntaxWarningRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  cCs\t|tr!tj|}nt|tsTtjdt|tdddS||S(s] Implementation of + operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs cCsmt|tr!tj|}nt|tsTtjdt|tdddSt |t j |gS(sQ Implementation of - operator, returns C{L{And}} with error stop s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRRRt _ErrorStop(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__sub__s cCs\t|tr!tj|}nt|tsTtjdt|tdddS||S(s] Implementation of - operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rsub__ s csEt|tr|d}}n-t|tr7|d d }|dd kr_d|df}nt|dtr|dd kr|ddkrtS|ddkrtS|dtSqLt|dtrt|dtr|\}}||8}qLtdt|dt|dntdt||dkrgtdn|dkrtdn||kodknrtdn|rfd |r |dkr|}qt g||}qA|}n(|dkr.}nt g|}|S( s Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is equivalent to C{expr*n + L{ZeroOrMore}(expr)} (read as "at least n instances of C{expr}") - C{expr*(None,n)} is equivalent to C{expr*(0,n)} (read as "0 to n instances of C{expr}") - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} Note that C{expr*(None,n)} does not raise an exception if more than n exprs exist in the input stream; that is, C{expr*(None,n)} does not enforce a maximum number of expr occurrences. If this behavior is desired, then write C{expr*(None,n) + ~expr} iiis7cannot multiply 'ParserElement' and ('%s','%s') objectss0cannot multiply 'ParserElement' and '%s' objectss/cannot multiply ParserElement by negative values@second tuple value must be greater or equal to first tuple values+cannot multiply ParserElement by 0 or (0,0)cs2|dkr$t|dStSdS(Ni(R(tn(tmakeOptionalListR(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR]s N(NN( RsRottupleRR0RRRt ValueErrorR(RR t minElementst optElementsR}((RRs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__mul__,sD#  &  )      cCs |j|S(N(R(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rmul__pscCsdt|tr!tj|}nt|tsTtjdt|tdddSt ||gS(sI Implementation of | operator - returns C{L{MatchFirst}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__or__ss cCs\t|tr!tj|}nt|tsTtjdt|tdddS||BS(s] Implementation of | operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ror__s cCsdt|tr!tj|}nt|tsTtjdt|tdddSt ||gS(sA Implementation of ^ operator - returns C{L{Or}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__xor__s cCs\t|tr!tj|}nt|tsTtjdt|tdddS||AS(s] Implementation of ^ operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rxor__s cCsdt|tr!tj|}nt|tsTtjdt|tdddSt ||gS(sC Implementation of & operator - returns C{L{Each}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRRR (RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__and__s cCs\t|tr!tj|}nt|tsTtjdt|tdddS||@S(s] Implementation of & operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RsRR"RiRRRRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rand__s cCs t|S(sE Implementation of ~ operator - returns C{L{NotAny}} (R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt __invert__scCs'|dk r|j|S|jSdS(s  Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be passed as C{True}. If C{name} is omitted, same as calling C{L{copy}}. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") N(RRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__call__s  cCs t|S(s Suppresses the output of this C{ParserElement}; useful to keep punctuation from cluttering up returned output. (R)(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsuppressscCs t|_|S(s Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. (RRp(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytleaveWhitespaces cCst|_||_t|_|S(s8 Overrides the default whitespace chars (RRpRqRRr(RRg((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetWhitespaceCharss   cCs t|_|S(s Overrides default behavior to expand C{}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{} characters. (RRt(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt parseWithTabss cCsrt|trt|}nt|trR||jkrn|jj|qnn|jjt|j|S(s Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] (RsRR)RuRR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytignores cCs1|p t|pt|ptf|_t|_|S(sT Enable display of debugging messages while doing pattern matching. (RGRKRMR{RRv(Rt startActiont successActiontexceptionAction((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDebugActions s    cCs)|r|jtttn t|_|S(s Enable display of debugging messages while doing pattern matching. Set C{flag} to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using L{setDebugActions}. Prior to attempting to match the C{wd} expression, the debugging message C{"Match at loc (,)"} is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. (RRGRKRMRRv(Rtflag((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDebugs# cCs|jS(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR@scCs t|S(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRCscCst|_d|_|S(N(RRwRRm(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRFs  cCsdS(N((RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckRecursionKscCs|jgdS(sj Check defined expressions for valid structure, check for infinite recursive definitions. N(R(Rt validateTrace((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytvalidateNscCsy|j}Wn5tk rGt|d}|j}WdQXnXy|j||SWn(tk r}tjr}q|nXdS(s Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. trN(treadRtopenRRR"R(Rtfile_or_filenameRt file_contentstfRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt parseFileTs  cCsdt|tr1||kp0t|t|kSt|trM|j|Stt||kSdS(N(RsR"tvarsRRtsuper(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__eq__hs " cCs ||k S(N((RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ne__pscCstt|S(N(thashtid(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__hash__sscCs ||kS(N((RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__req__vscCs ||k S(N((RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__rne__yscCs:y!|jt|d|tSWntk r5tSXdS(s Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests Example:: expr = Word(nums) assert expr.matches("100") RN(RRRRR(Rt testStringR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR|s  t#cCsyt|tr6tttj|jj}nt|trTt|}ng}g}t } x|D]} |d k r|j | t s|r| r|j | qmn| sqmndj|| g} g}yQ| jdd} |j| d|} | j | jd|| o%| } Wntk r} t| trPdnd}d| kr| j t| j| | j dt| j| dd |n| j d| jd || j d t| | o|} | } n<tk r*}| j d t|| o|} |} nX|rX|rG| j dndj| GHn|j | | fqmW| |fS( s3 Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - comment - (default=C{'#'}) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default=C{True}) prints test output to stdout - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if C{failureTests} is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) s s\nRR6s(FATAL)Rrt it^sFAIL: sFAIL-EXCEPTION: N(RsRRRRuRtrstript splitlinesRRRRRRRRRR3RRRERR7Ra(RttestsRtcommenttfullDumpt printResultst failureTestst allResultstcommentstsuccessRpRtresultRRRL((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytrunTestssNW' +  ,    N(PRRRRfRRt staticmethodRhRjRRRRRRRzRRRRRRRRRRRRRRRRRRRRRRRRRt_MAX_INTRR{RRR RRRRRRRRRRRRRRRRRRRRRRRRRR R R RRRRR"(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR"8s      &   H     " 2G +   D      )            cBseZdZdZRS(sT Abstract C{ParserElement} subclass, for defining atomic matching patterns. cCstt|jdtdS(NR(R R*RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s(RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR* scBseZdZdZRS(s, An empty token, will always match. cCs2tt|jd|_t|_t|_dS(NR (R R RRRRsRRx(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  (RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR  scBs#eZdZdZedZRS(s( A token that will never match. cCs;tt|jd|_t|_t|_d|_dS(NRsUnmatchable token( R RRRRRsRRxRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR* s    cCst|||j|dS(N(RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR1 s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR& s cBs#eZdZdZedZRS(s Token to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use L{CaselessLiteral}. For keyword matching (force word break before and after the matched string), use L{Keyword} or L{CaselessKeyword}. cCstt|j||_t||_y|d|_Wn0tk rntj dt ddt |_ nXdt |j|_d|j|_t|_t|_dS(Nis2null string passed to Literal; use Empty() insteadRis"%s"s Expected (R RRtmatchRtmatchLentfirstMatchCharRRRRR R^RRRyRRsRx(Rt matchString((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRC s      cCsg|||jkrK|jdks7|j|j|rK||j|jfSt|||j|dS(Ni(R'R&t startswithR%RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRV s$(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR5 s  cBsKeZdZedZdedZedZ dZ e dZ RS(s\ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with C{L{Literal}}: - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} Accepts two optional constructor arguments in addition to the keyword string: - C{identChars} is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - C{caseless} allows case-insensitive matching, default is C{False}. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use L{CaselessKeyword}. s_$cCstt|j|dkr+tj}n||_t||_y|d|_Wn't k r}t j dt ddnXd|j|_ d|j |_t|_t|_||_|r|j|_|j}nt||_dS(Nis2null string passed to Keyword; use Empty() insteadRis"%s"s Expected (R RRRtDEFAULT_KEYWORD_CHARSR%RR&R'RRRRRRyRRsRxtcaselesstuppert caselessmatchRt identChars(RR(R.R+((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq s&        cCsb|jr||||j!j|jkrF|t||jkse|||jj|jkrF|dks||dj|jkrF||j|jfSn|||jkrF|jdks|j|j|rF|t||jks|||j|jkrF|dks2||d|jkrF||j|jfSt |||j |dS(Nii( R+R&R,R-RR.R%R'R)RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s #9)$3#cCs%tt|j}tj|_|S(N(R RRR*R.(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cCs |t_dS(s,Overrides the default Keyword chars N(RR*(Rg((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytsetDefaultKeywordChars sN( RRRR1R*RRRRRRR#R/(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR^ s    cBs#eZdZdZedZRS(sl Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for L{CaselessKeyword}.) cCsItt|j|j||_d|j|_d|j|_dS(Ns'%s's Expected (R RRR,t returnStringRRy(RR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cCsS||||j!j|jkr7||j|jfSt|||j|dS(N(R&R,R%R0RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s#(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  cBs&eZdZddZedZRS(s Caseless version of L{Keyword}. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for L{CaselessLiteral}.) cCs#tt|j||dtdS(NR+(R RRR(RR(R.((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCs||||j!j|jkrp|t||jks\|||jj|jkrp||j|jfSt|||j|dS(N(R&R,R-RR.R%RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s#9N(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cBs&eZdZddZedZRS(sx A variation on L{Literal} which matches "close" matches, that is, strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - C{match_string} - string to be matched - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - C{mismatches} - a list of the positions within the match_string where mismatches were found - C{original} - the original match_string used to compare against the input string If C{mismatches} is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) icCs]tt|j||_||_||_d|j|jf|_t|_t|_ dS(Ns&Expected %r (with up to %d mismatches)( R RjRRt match_stringt maxMismatchesRyRRxRs(RR1R2((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s    cCs|}t|}|t|j}||kr|j}d}g} |j} xtt|||!|jD]J\}} | \} } | | kro| j|t| | krPqqoqoW|d}t|||!g}|j|d<| |d<||fSnt|||j|dS(Niitoriginalt mismatches( RR1R2RRRR RRy(RRERRtstartRtmaxlocR1tmatch_stringlocR4R2ts_mtsrctmattresults((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s(    ,        (RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRj s cBs>eZdZddddeddZedZdZRS(s Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. An optional C{excludeChars} parameter can list characters that might be found in the input C{bodyChars} string; useful to define a word of all printables except for one or two characters, for instance. L{srange} is useful for defining custom character set strings for defining C{Word} expressions, using range notation from regular expression character sets. A common mistake is to use C{Word} to match a specific literal string, as in C{Word("Address")}. Remember that C{Word} uses the string argument to define I{sets} of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use L{Literal} or L{Keyword}. pyparsing includes helper strings for building Words: - L{alphas} - L{nums} - L{alphanums} - L{hexnums} - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - L{printables} (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") iicstt|jrcdjfd|D}|rcdjfd|D}qcn||_t||_|r||_t||_n||_t||_|dk|_ |dkrt dn||_ |dkr||_ n t |_ |dkr)||_ ||_ nt||_d|j|_t|_||_d|j|jkr}|dkr}|dkr}|dkr}|j|jkrd t|j|_net|jdkrd tj|jt|jf|_n%d t|jt|jf|_|jrDd |jd |_nytj|j|_Wq}tk ryd|_q}XndS( NRrc3s!|]}|kr|VqdS(N((RR(t excludeChars(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys 7 sc3s!|]}|kr|VqdS(N((RR(R<(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys 9 siisZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permitteds Expected Rs[%s]+s%s[%s]*s [%s][%s]*s\b(R R-RRt initCharsOrigRt initCharst bodyCharsOrigt bodyCharst maxSpecifiedRtminLentmaxLenR$RRRyRRxt asKeywordt_escapeRegexRangeCharstreStringRR|tescapetcompileRaR(RR>R@tmintmaxtexactRDR<((R<s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR4 sT%             :   c Cs|jr[|jj||}|s?t|||j|n|j}||jfS|||jkrt|||j|n|}|d7}t|}|j}||j }t ||}x*||kr|||kr|d7}qWt } |||j krt } n|jrG||krG|||krGt } n|jr|dkrp||d|ks||kr|||krt } qn| rt|||j|n||||!fS(Nii(R|R%RRytendtgroupR>RR@RCRIRRBRRARD( RRERRR!R5Rt bodycharsR6tthrowException((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRj s6       %  < cCsytt|jSWntk r*nX|jdkrd}|j|jkr}d||j||jf|_qd||j|_n|jS(NcSs&t|dkr|d dS|SdS(Nis...(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt charsAsStr s s W:(%s,%s)sW:(%s)(R R-RRaRmRR=R?(RRP((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  (N( RRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR- s.6 #cBsDeZdZeejdZddZedZ dZ RS(s Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module. If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") s[A-Z]icCs3tt|jt|tr|sAtjdtddn||_||_ y+t j |j|j |_ |j|_ Wqt jk rtjd|tddqXnIt|tjr||_ t||_|_ ||_ n tdt||_d|j|_t|_t|_dS(sThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.s0null string passed to Regex; use Empty() insteadRis$invalid pattern (%s) passed to RegexsCRegex may only be constructed with a string or a compiled RE objects Expected N(R R%RRsRRRRtpatterntflagsR|RHRFt sre_constantsterrortcompiledREtypeRuRRRRyRRxRRs(RRQRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s.          cCs|jj||}|s6t|||j|n|j}|j}t|j}|rx|D]}||||eZdZddeededZedZdZRS(s Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=C{None}) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] c sttj|j}|sGtjdtddtn|dkr\|}n4|j}|stjdtddtn|_ t |_ |d_ |_ t |_|_|_|_|_|rTtjtjB_dtjj tj d|dk rDt|pGdf_nPd_dtjj tj d|dk rt|pdf_t j d krjd d jfd tt j d dd Dd7_n|r*jdtj|7_n|rhjdtj|7_tjjd_njdtjj 7_y+tjjj_j_Wn4tj k rtjdjtddnXt!_"dj"_#t$_%t&_'dS(Ns$quoteChar cannot be the empty stringRis'endQuoteChar cannot be the empty stringis %s(?:[^%s%s]Rrs%s(?:[^%s\n\r%s]is|(?:s)|(?:c3s<|]2}dtjj| tj|fVqdS(s%s[^%s]N(R|RGt endQuoteCharRE(RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys / sit)s|(?:%s)s|(?:%s.)s(.)s)*%ss$invalid pattern (%s) passed to Regexs Expected ((R R#RRRRRt SyntaxErrorRt quoteCharRt quoteCharLentfirstQuoteCharRXtendQuoteCharLentescChartescQuotetunquoteResultstconvertWhitespaceEscapesR|t MULTILINEtDOTALLRRRGRERQRRtescCharReplacePatternRHRFRSRTRRRyRRxRRs(RR[R_R`t multilineRaRXRb((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR sf             ( %E  c CsT|||jkr(|jj||p+d}|sOt|||j|n|j}|j}|jrJ||j |j !}t |t rJd|kr|j ridd6dd6dd6dd 6}x/|jD]\}}|j||}qWn|jr tj|jd |}n|jrG|j|j|j}qGqJn||fS( Ns\s s\ts s\ns s\fs s\rs\g<1>(R]R|R%RRRyRLRMRaR\R^RsRRbRRR_RReR`RX( RRERRR!R}tws_maptwslittwschar((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRG s*.      !cCs]ytt|jSWntk r*nX|jdkrVd|j|jf|_n|jS(Ns.quoted string, starting with %s ending with %s(R R#RRaRmRR[RX(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRj s N( RRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR# sA #cBs5eZdZddddZedZdZRS(s Token for matching words composed of characters I{not} in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] iicCstt|jt|_||_|dkr@tdn||_|dkra||_n t |_|dkr||_||_nt ||_ d|j |_ |jdk|_ t|_dS(Nisfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedis Expected (R RRRRptnotCharsRRBRCR$RRRyRsRx(RRjRIRJRK((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s           cCs|||jkr.t|||j|n|}|d7}|j}t||jt|}x*||kr|||kr|d7}qfW|||jkrt|||j|n||||!fS(Ni(RjRRyRIRCRRB(RRERRR5tnotcharstmaxlen((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  cCsytt|jSWntk r*nX|jdkryt|jdkrfd|jd |_qyd|j|_n|jS(Nis !W:(%s...)s!W:(%s)(R RRRaRmRRRj(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s (RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRv s cBsXeZdZidd6dd6dd6dd6d d 6Zd d d d dZedZRS(s Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is C{" \t\r\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, as defined for the C{L{Word}} class. sRss ss ss ss s iicsttj|_jdjfdjDdjdjD_t_ dj_ |_ |dkr|_ n t _ |dkr|_ |_ ndS(NRrc3s$|]}|jkr|VqdS(N(t matchWhite(RR(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys scss|]}tj|VqdS(N(R,t whiteStrs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys ss Expected i(R R,RRmRRRqRRRsRyRBRCR$(RtwsRIRJRK((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s )       cCs|||jkr.t|||j|n|}|d7}||j}t|t|}x-||kr|||jkr|d7}qcW|||jkrt|||j|n||||!fS(Ni(RmRRyRCRIRRB(RRERRR5R6((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  "(RRRRnRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR, s t_PositionTokencBseZdZRS(cCs8tt|j|jj|_t|_t|_ dS(N( R RpRR^RRRRsRRx(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s (RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRp scBs,eZdZdZdZedZRS(sb Token to advance to a specific column of input text; useful for tabular report scraping. cCs tt|j||_dS(N(R RRR7(Rtcolno((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCst|||jkrt|}|jrB|j||}nxE||kr||jrt|||jkr|d7}qEWn|S(Ni(R7RRuRtisspace(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  7cCs^t||}||jkr6t||d|n||j|}|||!}||fS(NsText not in expected column(R7R(RRERRtthiscoltnewlocR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  (RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  cBs#eZdZdZedZRS(s Matches if current position is at the beginning of a line within the parse string Example:: test = ''' AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) Prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cCs tt|jd|_dS(NsExpected start of line(R RRRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR& scCs;t||dkr|gfSt|||j|dS(Ni(R7RRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR* s (RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cBs#eZdZdZedZRS(sU Matches if current position is at the end of a line within the parse string cCs<tt|j|jtjjddd|_dS(Ns RrsExpected end of line(R RRRR"RfRRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR3 scCs|t|krK||dkr0|ddfSt|||j|n8|t|krk|dgfSt|||j|dS(Ns i(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR8 s(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR/ s cBs#eZdZdZedZRS(sM Matches if current position is at the beginning of the parse string cCs tt|jd|_dS(NsExpected start of text(R R(RRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRG scCsL|dkrB||j|dkrBt|||j|qBn|gfS(Ni(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRK s (RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR(C s cBs#eZdZdZedZRS(sG Matches if current position is at the end of the parse string cCs tt|jd|_dS(NsExpected end of text(R R'RRy(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRV scCs|t|kr-t|||j|nT|t|krM|dgfS|t|kri|gfSt|||j|dS(Ni(RRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZ s (RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR'R s cBs&eZdZedZedZRS(sp Matches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of the string being parsed, or at the beginning of a line. cCs/tt|jt||_d|_dS(NsNot at the start of a word(R R/RRt wordCharsRy(RRu((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRl scCs^|dkrT||d|jks6|||jkrTt|||j|qTn|gfS(Nii(RuRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq s  (RRRRTRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR/d s cBs&eZdZedZedZRS(sZ Matches if the current position is at the end of a Word, and is not followed by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of the string being parsed, or at the end of a line. cCs8tt|jt||_t|_d|_dS(NsNot at the end of a word(R R.RRRuRRpRy(RRu((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cCsvt|}|dkrl||krl|||jksN||d|jkrlt|||j|qln|gfS(Nii(RRuRRy(RRERRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  (RRRRTRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR.x s cBsqeZdZedZdZdZdZdZdZ dZ edZ gd Z d Z RS( s^ Abstract subclass of ParserElement, for combining and post-processing parsed tokens. cCstt|j|t|tr4t|}nt|tr[tj|g|_ nt|t j rt|}t d|Drt tj|}nt||_ n3yt||_ Wntk r|g|_ nXt|_dS(Ncss|]}t|tVqdS(N(RsR(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(R RRRsRRRR"RitexprsRtIterabletallRRRR}(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  cCs |j|S(N(Rv(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCs|jj|d|_|S(N(RvRRRm(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cCsPt|_g|jD]}|j^q|_x|jD]}|jq8W|S(s~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on all contained expressions.(RRpRvRR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s  %cCst|trb||jkrtt|j|x(|jD]}|j|jdq>Wqn>tt|j|x%|jD]}|j|jdqW|S(Ni(RsR)RuR RRRv(RR R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCsfytt|jSWntk r*nX|jdkr_d|jjt|j f|_n|jS(Ns%s:(%s)( R RRRaRmRR^RRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s %cCswtt|jx|jD]}|jqWt|jdkr`|jd}t||jr|j r|jdkr|j r|j|jdg|_d|_ |j |j O_ |j |j O_ n|jd}t||jr`|j r`|jdkr`|j r`|jd |j|_d|_ |j |j O_ |j |j O_ q`ndt||_|S(Niiiis Expected (R RRRvRRsR^RkRnRRvRmRsRxRRy(RRR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s0        cCstt|j||}|S(N(R RR(RRRR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCs@||g}x|jD]}|j|qW|jgdS(N(RvRR(RRttmpR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCs>tt|j}g|jD]}|j^q|_|S(N(R RRRv(RR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s%(RRRRRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s    "  cBsWeZdZdefdYZedZedZdZdZ dZ RS(s  Requires all given C{ParseExpression}s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the C{'+'} operator. May also be constructed using the C{'-'} operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"),name_expr("name"),integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") RcBseZdZRS(cOs3ttj|j||d|_|jdS(Nt-(R RRRRR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s (RRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR scCsltt|j||td|jD|_|j|jdj|jdj|_t |_ dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys  si( R RRRxRvRsRRqRpRR}(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s c Cs?|jdj|||dt\}}t}x|jdD]}t|tjr`t}q<n|ry|j|||\}}Wqtk rqtk r}d|_ tj |qt k rt|t ||j|qXn|j|||\}}|s$|jr<||7}q<q<W||fS(NiRi(RvRRRsRRRR!RRt __traceback__RRRRyR( RRERRt resultlistt errorStopRt exprtokensR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s((   %cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR5 scCs@||g}x+|jD] }|j||jsPqqWdS(N(RvRRs(RRtsubRecCheckListR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR: s   cCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRt{Rcss|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys F st}(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRA s *( RRRR RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s    cBsAeZdZedZedZdZdZdZ RS(s Requires that at least one C{ParseExpression} is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the C{'^'} operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] cCsNtt|j|||jrAtd|jD|_n t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys \ s(R RRRvR4RsR(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRY s c Csd}d}g}x|jD]}y|j||}Wntk rw} d| _| j|kr| }| j}qqtk rt||krt|t||j|}t|}qqX|j ||fqW|rh|j ddxn|D]c\} }y|j |||SWqtk r`} d| _| j|kra| }| j}qaqXqWn|dk r|j|_ |nt||d|dS(NiRcSs |d S(Ni((tx((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqu Rrs no defined alternatives to match( RRvRRR{RRRRyRtsortRR( RRERRt maxExcLoct maxExceptionRRtloc2Rt_((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR` s<      cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ixor__ scCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs ^ css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s *cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s( RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRK s    &  cBsAeZdZedZedZdZdZdZ RS(s Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] cCsNtt|j|||jrAtd|jD|_n t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(R RRRvR4RsR(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s c Csd}d}x|jD]}y|j|||}|SWqtk ro}|j|kr|}|j}qqtk rt||krt|t||j|}t|}qqXqW|dk r|j|_|nt||d|dS(Nis no defined alternatives to match( RRvRRRRRRyR( RRERRRRRR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s$    cCs.t|tr!tj|}n|j|S(N(RsRR"RiR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt__ior__ scCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs | css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s *cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s( RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s     cBs8eZdZedZedZdZdZRS(sm Requires all given C{ParseExpression}s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the C{'&'} operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 cCsKtt|j||td|jD|_t|_t|_dS(Ncss|]}|jVqdS(N(Rs(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s( R R RRxRvRsRRptinitExprGroups(RRvR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs cCs4|jrLtd|jD|_g|jD]}t|tr/|j^q/}g|jD]%}|jr]t|t r]|^q]}|||_g|jD]}t|t r|j^q|_ g|jD]}t|t r|j^q|_ g|jD]$}t|tt t fs|^q|_ |j |j 7_ t|_n|}|j }|j} g} t} x| r_|| |j |j } g} x| D]}y|j||}Wntk r| j|qX| j|jjt||||kr|j|q|| kr| j|qqWt| t| krut} ququW|rdjd|D}t||d|n| g|jD]*}t|tr|j| kr|^q7} g}x6| D].}|j|||\}}|j|qWt|tg}||fS(Ncss3|])}t|trt|j|fVqdS(N(RsRRRF(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys ss, css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys =ss*Missing one or more required elements (%s)(RRRvtopt1mapRsRRFRst optionalsR0tmultioptionalsRt multirequiredtrequiredRRRRRRRtremoveRRRtsumR (RRERRRtopt1topt2ttmpLocttmpReqdttmpOptt matchOrdert keepMatchingttmpExprstfailedtmissingR|R;t finalResults((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsP .5 117      "   > cCsVt|dr|jS|jdkrOddjd|jDd|_n|jS(NRRs & css|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys PsR(RRRmRRRv(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRKs *cCs3||g}x|jD]}|j|qWdS(N(RvR(RRRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRTs(RRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s 5  1 cBs_eZdZedZedZdZdZdZ dZ gdZ dZ RS( sa Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. cCstt|j|t|trattjtrItj|}qatjt |}n||_ d|_ |dk r|j |_ |j|_|j|j|j|_|j|_|j|_|jj|jndS(N(R RRRsRt issubclassR"RiR*RRFRRmRxRsRRqRpRoR}RuR(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR^s        cCsG|jdk r+|jj|||dtStd||j|dS(NRRr(RFRRRRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRpscCs>t|_|jj|_|jdk r:|jjn|S(N(RRpRFRRR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRvs  cCst|trc||jkrtt|j||jdk r`|jj|jdq`qn?tt|j||jdk r|jj|jdn|S(Ni(RsR)RuR RRRFR(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR}s cCs6tt|j|jdk r2|jjn|S(N(R RRRFR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsV||kr"t||gn||g}|jdk rR|jj|ndS(N(R$RFRR(RRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs  cCsA||g}|jdk r0|jj|n|jgdS(N(RFRRR(RRRy((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsuytt|jSWntk r*nX|jdkrn|jdk rnd|jjt |jf|_n|jS(Ns%s:(%s)( R RRRaRmRRFR^RR(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs %( RRRRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZs      cBs#eZdZdZedZRS(s Lookahead matching of the given parse expression. C{FollowedBy} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. C{FollowedBy} always returns a null token list. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cCs#tt|j|t|_dS(N(R R RRRs(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs|jj|||gfS(N(RFR(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR s cBs,eZdZdZedZdZRS(s Lookahead to disallow matching with the given parse expression. C{NotAny} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression does I{not} match at the current position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} always returns a null token list. May be constructed using the '~' operator. Example:: cCsBtt|j|t|_t|_dt|j|_ dS(NsFound unwanted token, ( R RRRRpRRsRRFRy(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs  cCs:|jj||r0t|||j|n|gfS(N(RFRRRy(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRs~{R(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs (RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs   t_MultipleMatchcBs eZddZedZRS(cCsftt|j|t|_|}t|trFtj|}n|dk rY|nd|_ dS(N( R RRRRoRsRR"RiRt not_ender(RRFtstopOntender((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs  c Cs|jj}|j}|jdk }|r9|jj}n|rO|||n||||dt\}}y|j } xo|r|||n| r|||} n|} ||| |\}} | s| jr~|| 7}q~q~WWnt t fk rnX||fS(NR( RFRRRRRRRuRRR( RRERRtself_expr_parsetself_skip_ignorablest check_endert try_not_enderRthasIgnoreExprsRt tmptokens((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs,   N(RRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs cBseZdZdZRS(s Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRRs}...(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR!s (RRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscBs/eZdZddZedZdZRS(sw Optional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to L{OneOrMore} cCs)tt|j|d|t|_dS(NR(R R0RRRs(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR6scCsEy tt|j|||SWnttfk r@|gfSXdS(N(R R0RRR(RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR:s cCsIt|dr|jS|jdkrBdt|jd|_n|jS(NRRs]...(RRRmRRRF(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR@s N(RRRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR0*s   t _NullTokencBs eZdZeZdZRS(cCstS(N(R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRJscCsdS(NRr((R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRMs(RRRR>R(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRIs cBs/eZdZedZedZdZRS(sa Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cCsAtt|j|dt|jj|_||_t|_dS(NR( R RRRRFRoRRRs(RRFR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRts cCsy(|jj|||dt\}}Wnottfk r|jtk r|jjrt|jg}|j||jj ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) RrcCsQtt|j||r)|jn||_t|_||_t|_dS(N( R RRRtadjacentRRpt joinStringR}(RRFRR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRrs    cCs6|jrtj||ntt|j||S(N(RR"RR R(RR ((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR|s cCse|j}|2|tdj|j|jgd|j7}|jr]|jr]|gS|SdS(NRrR(RR RRRRzRnR(RRERRtretToks((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs  1(RRRRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRas cBs eZdZdZdZRS(s Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a,b,100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a,b,100")) # -> ['fn', ['a', 'b', '100']] cCs#tt|j|t|_dS(N(R RRRRo(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCs|gS(N((RRERR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs(RRRRR(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRs  cBs eZdZdZdZRS(sW Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at L{ParseResults} of accessing fields by results name. cCs#tt|j|t|_dS(N(R R RRRo(RRF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRscCsTx9t|D]+\}}t|dkr1q n|d}t|trct|dj}nt|dkrtd|||nX|S(ss Decorator for debugging parse actions. When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) s< ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] s [Rs]...N(RRR0RR)(RFtdelimtcombinetdlName((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR>9s ,!cstfd}|dkrBttjd}n |j}|jd|j|dt|jdt dS(s: Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs;|d}|r,ttg|p5tt>gS(Ni(RRRA(RRNRpR(t arrayExprRF(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcountFieldParseAction_s -cSst|dS(Ni(Ro(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqdRrtarrayLenR~s(len) s...N( R RR-RPRzRRRRR(RFtintExprR((RRFs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR:Ls    cCsMg}x@|D]8}t|tr8|jt|q |j|q W|S(N(RsRRRR(tLR}R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRks  csFtfd}|j|dtjdt|S(s* Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches a previous literal, will also match the leading C{"1:1"} in C{"1:10"}. If this is not desired, use C{matchPreviousExpr}. Do I{not} use with packrat parsing enabled. csc|rTt|dkr'|d>q_t|j}td|D>n t>dS(Niicss|]}t|VqdS(N(R(Rttt((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(RRRRR (RRNRpttflat(trep(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcopyTokenToRepeaters R~s(prev) (R RRRR(RFR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRMts  cs\t|j}|Kfd}|j|dtjdt|S(sS Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches by expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; the expressions are evaluated first, and then compared, so C{"1"} is compared with C{"10"}. Do I{not} use with packrat parsing enabled. cs8t|jfd}j|dtdS(Ncs7t|j}|kr3tdddndS(NRri(RRR(RRNRpt theseTokens(t matchTokens(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytmustMatchTheseTokenss R~(RRRzR(RRNRpR(R(Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsR~s(prev) (R RRRRR(RFte2R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRLs   cCsUx$dD]}|j|t|}qW|jdd}|jdd}t|S(Ns\^-]s s\ns s\t(Rt_bslashR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyREs  c sD|r!d}d}tnd}d}tg}t|tr]|j}n7t|tjr~t|}ntj dt dd|st Sd}x|t |d krV||}xt ||d D]f\}} || |r |||d =Pq||| r|||d =|j|| | }PqqW|d 7}qW| r|ryt |t d j|krtd d jd |Djd j|Stdjd|Djd j|SWqtk rtj dt ddqXntfd|Djd j|S(s Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a C{L{MatchFirst}} for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default=C{False}) - treat all literals as caseless - useRegex - (default=C{True}) - as an optimization, will generate a Regex object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or if creating a C{Regex} raises an exception) Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] cSs|j|jkS(N(R,(R tb((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs|jj|jS(N(R,R)(R R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs ||kS(N((R R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcSs |j|S(N(R)(R R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrs6Invalid argument to oneOf, expected string or iterableRiiiRrs[%s]css|]}t|VqdS(N(RE(Rtsym((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys ss | t|css|]}tj|VqdS(N(R|RG(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys ss7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdS(N((RR(tparseElementClass(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys s(RRRsRRRRwRRRRRRRRRR%RRaR( tstrsR+tuseRegextisequaltmaskstsymbolsRtcurRR ((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRQsL        ! !33  cCsttt||S(s Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the C{Dict} results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} (R R0R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR?s!cCs|tjd}|j}t|_|d||d}|rVd}n d}|j||j|_|S(s Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional C{asString} argument is passed as C{False}, then the return value is a C{L{ParseResults}} containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to C{L{originalTextFor}} contains expressions with defined results names, you must set C{asString} to C{False} if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|S(N((RRRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq8Rrt_original_startt _original_endcSs||j|j!S(N(RR(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq=RrcSs'||jd|jd!g|(dS(NRR(R(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt extractText?s(R RzRRR}Ru(RFtasStringt locMarkert endlocMarkert matchExprR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRe s      cCst|jdS(sp Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dS(Ni((Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqJRr(R+Rz(RF((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRfEscCsEtjd}t|d|d|jjdS(s Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains C{} characters, you may want to call C{L{ParserElement.parseWithTabs}} Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|S(N((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq`Rrt locn_startRtlocn_end(R RzRRR(RFtlocator((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRhLss\[]-*.$+^?()~ RKcCs |ddS(Nii((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqkRrs\\0?[xX][0-9a-fA-F]+cCs tt|djddS(Nis\0xi(tunichrRotlstrip(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqlRrs \\0[0-7]+cCstt|dddS(Niii(RRo(RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqmRrR<s\]s\wRzRRtnegatetbodyRcsOdy-djfdtj|jDSWntk rJdSXdS(s Helper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as C{\-} or C{\]}) - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) (C{\0x##} is also supported for backwards compatibility) - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) cSsKt|ts|Sdjdtt|dt|ddDS(NRrcss|]}t|VqdS(N(R(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sii(RsR RRtord(tp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrRrc3s|]}|VqdS(N((Rtpart(t _expanded(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys sN(Rt_reBracketExprRRRa(R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyR]rs  - csfd}|S(st Helper method for defining parse actions that require matching at a specific column in the input text. cs2t||kr.t||dndS(Nsmatched token not at column %d(R7R(R@tlocnRJ(R(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt verifyCols((RR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRKscs fdS(s Helper method for common parse actions that simply return a literal value. Especially useful when used with C{L{transformString}()}. Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgS(N((RRNRp(treplStr(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRr((R((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRZs cCs|ddd!S(s Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] iii((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRXs csafd}y"tdtdj}Wntk rSt}nX||_|S(sG Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the parsed data to an integer using base 16. Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] cs g|D]}|^qS(N((RRNRpttokn(RRO(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRsRR^(R`RRaRu(RORRRd((RROs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRks    cCst|jS(N(RR,(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCst|jS(N(Rtlower(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCs<t|tr+|}t|d| }n |j}tttd}|rtjj t }t d|dt t t|t d|tddtgjdj d t d }nd jd tD}tjj t t|B}t d|dt t t|j ttt d|tddtgjdj d t d }ttd|d }|jdd j|jddjjjd|}|jdd j|jddjjjd|}||_||_||fS(sRInternal helper to construct opening and closing tag expressions, given a tag nameR+s_-:Rttagt=t/RRAcSs|ddkS(NiR((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrR Rrcss!|]}|dkr|VqdS(R N((RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys scSs|ddkS(NiR((RRNRp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrsRLs(RsRRRR-R2R1R<RRzRXR)R R0RRRRRRTRWR@Rt_LRttitleRRR(ttagStrtxmltresnamet tagAttrNamet tagAttrValuetopenTagtprintablesLessRAbracktcloseTag((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt _makeTagss" o{AA  cCs t|tS(s  Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> http://pyparsing.wikispaces.com (R R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRIscCs t|tS(s Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to L{makeHTMLTags} (R R(R((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRJscsT|r|n |jgD]\}}||f^q#fd}|S(s< Helper to create a validating parse action to be used with start tags created with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 csx~D]v\}}||kr8t||d|n|tjkr|||krt||d||||fqqWdS(Nsno matching attribute s+attribute '%s' has value '%s', must be '%s'(RRct ANY_VALUE(RRNRtattrNamet attrValue(tattrs(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRRs   (R(RtattrDictRRR((Rs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRcs 2  %cCs'|rd|nd}ti||6S(s Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 s%s:classtclass(Rc(t classnamet namespacet classattr((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRi\s t(RYcCs<t}||||B}xt|D]\}}|d d \}} } } | dkrdd|nd|} | dkr|d kst|dkrtdn|\} }ntj| }| tjkr| dkr t||t |t |}q| dkrx|d k rQt|||t |t ||}qt||t |t |}q| dkrt|| |||t || |||}qtdn+| tj kr| dkr)t |t st |}nt|j|t ||}q| dkr|d k rpt|||t |t ||}qt||t |t |}q| dkrt|| |||t || |||}qtdn td | r |j| n||j| |BK}|}q(W||K}|S( s Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] iis%s terms %s%s termis@if numterms=3, opExpr must be a tuple or list of two expressionsis6operator must be unary (1), binary (2), or ternary (3)s2operator must indicate right or left associativityN(N(R RRRRRRRtLEFTR RRtRIGHTRsRRFRz(tbaseExprtopListtlpartrparR}tlastExprRtoperDeftopExprtaritytrightLeftAssocRttermNametopExpr1topExpr2tthisExprR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRgsR;    '  /'   $  /'     s4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*t"s string enclosed in double quotess4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*t's string enclosed in single quotess*quotedString using single or double quotestusunicode string literalcCs!||krtdn|d krt|trt|trt|dkrt|dkr|d k rtt|t||tj ddj d}q|t j t||tj j d}q|d k r9tt|t |t |ttj ddj d}qttt |t |ttj ddj d}qtdnt}|d k r|tt|t||B|Bt|K}n.|tt|t||Bt|K}|jd ||f|S( s~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] s.opening and closing strings cannot be the sameiRKcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq9RrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRq<RrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqBRrcSs|djS(Ni(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqFRrsOopening and closing arguments must be strings if no content expression is givensnested %s%s expressionN(RRRsRRRRRR"RfRzRARRR RR)R0R(topenertclosertcontentRR}((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRNs4:  $  $    5.c s5fd}fd}fd}ttjdj}ttj|jd}tj|jd}tj|jd} |rtt||t|t|t|| } n0tt|t|t|t|} |j t t| jdS( s Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] css|t|krdSt||}|dkro|dkrZt||dnt||dndS(Nisillegal nestingsnot a peer entry(RR7RR(RRNRptcurCol(t indentStack(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckPeerIndentscsEt||}|dkr/j|nt||ddS(Nisnot a subentry(R7RR(RRNRpR+(R,(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcheckSubIndentscsn|t|krdSt||}oH|dkoH|dks`t||dnjdS(Niisnot an unindent(RR7RR(RRNRpR+(R,(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt checkUnindents &s tINDENTRrtUNINDENTsindented block( RRRRR RzRRRRR( tblockStatementExprR,R$R-R.R/R7R0tPEERtUNDENTtsmExpr((R,s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRdQsN"8 $s#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]s[\0xa1-\0xbf\0xd7\0xf7]s_:sany tagsgt lt amp nbsp quot aposs><& "'s &(?PRs);scommon HTML entitycCstj|jS(sRHelper parser action to replace common HTML entities with their special characters(t_htmlEntityMapRtentity(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRYss/\*(?:[^*]|\*(?!/))*s*/sC style commentss HTML comments.*s rest of lines//(?:\\\n|[^\n])*s // commentsC++ style comments#.*sPython style comments t commaItemRcBseZdZeeZeeZee j dj eZ ee j dj eedZedj dj eZej edej ej dZejdeeeed jeBj d Zejeed j d j eZed j dj eZeeBeBjZedj dj eZeededj dZedj dZedj dZ e de dj dZ!ee de d8dee de d9j dZ"e"j#ddej d Z$e%e!e$Be"Bj d!j d!Z&ed"j d#Z'e(d$d%Z)e(d&d'Z*ed(j d)Z+ed*j d+Z,ed,j d-Z-e.je/jBZ0e(d.Z1e%e2e3d/e4ee5d0d/ee6d1jj d2Z7e8ee9j:e7Bd3d4j d5Z;e(ed6Z<e(ed7Z=RS(:s Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (L{integers}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] tintegers hex integeris[+-]?\d+ssigned integerRtfractioncCs|d|dS(Nii((Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrRzs"fraction or mixed integer-fractions [+-]?\d+\.\d*s real numbers+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)s$real number with scientific notations[+-]?\d+\.?\d*([eE][+-]?\d+)?tfnumberRt identifiersK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}s IPv4 addresss[0-9a-fA-F]{1,4}t hex_integerRisfull IPv6 addressiis::sshort IPv6 addresscCstd|DdkS(Ncss'|]}tjj|rdVqdS(iN(Rlt _ipv6_partR(RR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pys si(R(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrs::ffff:smixed IPv6 addresss IPv6 addresss:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}s MAC addresss%Y-%m-%dcsfd}|S(s Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] csPytj|djSWn+tk rK}t||t|nXdS(Ni(RtstrptimetdateRRRu(RRNRptve(tfmt(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytcvt_fns((RBRC((RBs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt convertToDatess%Y-%m-%dT%H:%M:%S.%fcsfd}|S(s Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] csJytj|dSWn+tk rE}t||t|nXdS(Ni(RR?RRRu(RRNRpRA(RB(s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRCs((RBRC((RBs@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pytconvertToDatetimess7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?s ISO8601 dates(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?sISO8601 datetimes2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}tUUIDcCstjj|dS(s Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' i(Rlt_html_stripperR{(RRNR((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt stripHTMLTagss RR<s R8RRrscomma separated listcCst|jS(N(RR,(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRrcCst|jS(N(RR(Rp((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRqRr(ii(ii(>RRRRkRotconvertToIntegertfloattconvertToFloatR-RPRRzR9RBR=R%tsigned_integerR:RRRt mixed_integerRtrealtsci_realRtnumberR;R2R1R<t ipv4_addressR>t_full_ipv6_addresst_short_ipv6_addressRt_mixed_ipv6_addressRt ipv6_addresst mac_addressR#RDREt iso8601_datetiso8601_datetimetuuidR5R4RGRHRRRRTR,t _commasepitemR>RWRtcomma_separated_listRbR@(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyRlsL  '/-  ;&J+t__main__tselecttfroms_$RRtcolumnsRttablestcommandsK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual s] 100 -100 +100 3.14159 6.02e23 1e-12 s 100 FF s6 12345678-1234-5678-1234-567812345678 (Rt __version__t__versionTime__t __author__RtweakrefRRRRxRR|RSRR8RRRRt_threadRt ImportErrort threadingRRt ordereddictRt__all__Rt version_infoRQRtmaxsizeR$RuRtchrRRRRR2treversedRRR4RxRIRJR_tmaxinttxrangeRt __builtin__RtfnameRR`RRRRRRtascii_uppercasetascii_lowercaseR2RPRBR1RRt printableRTRaRRRR!R$RR tMutableMappingtregisterR7RHRERGRKRMROReR"R*R RRRRiRRRRjR-R%R#RR,RpRRRR(R'R/R.RRRRR RR RRRR0RRRR&R RR+RRR R)RR`RR>R:RRMRLRERRQR?ReRfRhRRARGRFR_R^Rzt _escapedPunct_escapedHexChart_escapedOctChartUNICODEt _singleChart _charRangeRRR]RKRZRXRkRbR@R RIRJRcR RiRRRRRgRSR<R\RWRaRNRdR3RUR5R4RRR6RR9RYR6RCRR[R=R;RDRVRRZR8RlRt selectTokent fromTokentidentt columnNametcolumnNameListt columnSpect tableNamet tableNameListt simpleSQLR"RPR;R=RYRF(((s@/usr/lib/python2.7/site-packages/setuptools/_vendor/pyparsing.pyt=s              *         8      @ & A=IG3pLOD|M &# @sQ,A ,    I # %  !4@    ,   ?  #   k%Z r  (, #8+    $     PK!nMe_vendor/__init__.pycnu[ fc@sdS(N((((s?/usr/lib/python2.7/site-packages/setuptools/_vendor/__init__.pyttPK!I launch.pyonu[ fc@sAdZddlZddlZdZedkr=endS(s[ Launch the Python script on the command line after setuptools is bootstrapped via import. iNcBseejd}ed|dddd }ejdej(eede}||j}|j dd}e ||d }||Ud S( sP Run the script in sys.argv[1] as if it had been invoked naturally. it__file__t__name__t__main__t__doc__topens\r\ns\ntexecN( t __builtins__tsystargvtdicttNonetgetattrttokenizeRtreadtreplacetcompile(t script_namet namespacetopen_tscriptt norm_scripttcode((s5/usr/lib/python2.7/site-packages/setuptools/launch.pytrun s  R(RR RRR(((s5/usr/lib/python2.7/site-packages/setuptools/launch.pyts     PK! II sandbox.pyonu[ fc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejjdrddljjjjZnejejZy eZWnek r dZnXeZddl m!Z!ddlm"Z"ddd d gZ#dd Z$ej%dd Z&ej%d Z'ej%dZ(ej%dZ)de*fdYZ+dd!dYZ,ej%dZ-dZ.ej%dZ/ej%dZ0dZ1dZ2dZ3dd"dYZ4e5edrNej6gZ7ngZ7de4fdYZ8ej9ej:gdj;D]Z<e=ee<d^qZ>d e!fd YZ?dS(#iN(tsix(tbuiltinstmaptjava(tDistutilsError(t working_settAbstractSandboxtDirectorySandboxtSandboxViolationt run_setupcBs_d}e||}|j}WdQX|dkr?|}ne||d}|||UdS(s. Python 3 implementation of execfile. trbNtexec(topentreadtNonetcompile(tfilenametglobalstlocalstmodetstreamtscripttcode((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt _execfile#s  ccs>tj}|dk r#|tj(nz |VWd|tj(XdS(N(tsystargvR(trepltsaved((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_argv0s     ccs%tj}z |VWd|tj(XdS(N(Rtpath(R((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_path;s  ccsBtjj|dttj}|t_z dVWd|t_XdS(sL Monkey-patch tempfile.tempdir with replacement, ensuring it exists texist_okN(t pkg_resourcest py31compattmakedirstTruettempfilettempdir(t replacementR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt override_tempDs    ccs7tj}tj|z |VWdtj|XdS(N(tostgetcwdtchdir(ttargetR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytpushdUs    tUnpickleableExceptioncBseZdZedZRS(sP An exception representing another Exception that could not be pickled. cCsay tj|tj|fSWn:tk r\ddlm}|j||t|SXdS(s Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. i(R-N(tpickletdumpst Exceptiontsetuptools.sandboxR-tdumptrepr(ttypetexctcls((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR2ds   (t__name__t __module__t__doc__t staticmethodR2(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR-_stExceptionSavercBs)eZdZdZdZdZRS(s^ A Context Manager that will save an exception, serialized, and restore it later. cCs|S(N((tself((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt __enter__xscCs,|s dStj|||_||_tS(N(R-R2t_savedt_tbR#(R<R4R5ttb((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt__exit__{s  cCsKdt|krdSttj|j\}}tj|||jdS(s"restore and re-raise any exceptionR>N(tvarsRR.tloadsR>RtreraiseR?(R<R4R5((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytresumes(R7R8R9R=RARE(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR;rs  c#sgtjjt }VWdQXtjjfdtjD}t||jdS(s Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3s1|]'}|kr|jd r|VqdS(s encodings.N(t startswith(t.0tmod_name(R(s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pys s (RtmodulestcopyR;tupdatet_clear_modulesRE(t saved_exct del_modules((Rs6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_moduless   cCs%xt|D]}tj|=q WdS(N(tlistRRI(t module_namesRH((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRLsccs*tj}z |VWdtj|XdS(N(R t __getstate__t __setstate__(R((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytsave_pkg_resources_states  ccstjj|d}tqtattJt:t|'t |t ddVWdQXWdQXWdQXWdQXWdQXWdQXdS(Nttempt setuptools( R(RtjoinRTROthide_setuptoolsRRR'R,t __import__(t setup_dirttemp_dir((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt setup_contexts       cCs"tjd}t|j|S(sH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True s1(setuptools|pkg_resources|distutils|Cython)(\.|$)(treRtbooltmatch(RHtpattern((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt _needs_hidingscCs tttj}t|dS(s% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N(tfilterRaRRIRL(RI((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRXsc Cstjjtjj|}t|y|gt|tj(tjjd|t j t j j dt |tr|n|jtj}t|'td|dd}t||WdQXWn/tk r}|jr|jdrqnXWdQXdS(s8Run a distutils setup script, sandboxed in its directoryicSs |jS(N(tactivate(tdist((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyttt__file__R7t__main__N(R(RtabspathtdirnameR\RPRRtinsertRt__init__t callbackstappendt isinstancetstrtencodetgetfilesystemencodingRtdictRt SystemExittargs(t setup_scriptRuRZt dunder_filetnstv((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR s   cBseZdZeZdZdZdZdZdZ dZ x<ddd gD]+Z e e e rXe e ee sc3s!|]}tj|VqdS(N(R]R_(RGR`(R(s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pys s(Rt_exception_patternst itertoolstchaintany(R<Rt start_matchestpattern_matchest candidates((Rs6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs     cOsH||jkrD|j| rD|j|tjj|||n|S(sCalled for path inputs(t write_opsRRR(RR(R<RRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs%cOsF|j| s |j| r<|j|||||n||fS(s?Called for path pairs like rename, link, and symlink operations(RR(R<RRRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs icOsR|t@r9|j| r9|jd|||||ntj|||||S(sCalled for low-level os.open()sos.open(t WRITE_FLAGSRRR|R (R<RtflagsRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR s(R7R8R9RstfromkeysRRt _EXCEPTIONSRlRRRRRRRRR (((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR~s       s4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYicBs,eZdZejdjZdZRS(sEA setup script attempted to modify the filesystem outside the sandboxs SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs%|j\}}}|jjtS(N(RuttmpltformatR(R<tcmdRutkwargs((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt__str__s(R7R8R9ttextwraptdedenttlstripRR(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs (((@R(RR$toperatort functoolsRR]t contextlibR.Rtsetuptools.externRtsetuptools.extern.six.movesRRtpkg_resources.py31compatR tplatformRFt$org.python.modules.posix.PosixModuletpythonRItposixt PosixModuleR|RRRt NameErrorRR Rtdistutils.errorsRRt__all__RtcontextmanagerRRR'R,R0R-R;RORLRTR\RaRXR RR}RRRtreducetor_tsplittaRRR(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyts^                      wV +PK!Gi2command/setopt.pyonu[ fc@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ d d Z e d Zd e fdYZd efdYZdS(i(t convert_path(tlog(tDistutilsOptionErrorN(t configparser(tCommandt config_filet edit_configt option_basetsetopttlocalcCs|dkrdS|dkr>tjjtjjtjdS|dkrtjdkr_dpbd}tjjtd |St d |d S( sGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" R s setup.cfgtglobals distutils.cfgtusertposixt.ts~/%spydistutils.cfgs7config_file() type must be 'local', 'global', or 'user'N( tostpathtjointdirnamet distutilst__file__tnamet expanduserRt ValueError(tkindtdot((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRs    c Cstjd|tj}|j|gx+|jD]\}}|d krttjd|||j|q9|j |stjd|||j |nx|jD]\}}|d kr&tjd||||j |||j |sRtjd|||j|qRqtjd|||||j |||qWq9Wtjd||st|d}|j|Wd QXnd S( sYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. sReading configuration from %ssDeleting section [%s] from %ssAdding new section [%s] to %ssDeleting %s.%s from %ss#Deleting empty [%s] section from %ssSetting %s.%s to %r in %ss Writing %stwN(RtdebugRtRawConfigParsertreadtitemstNonetinfotremove_sectiont has_sectiont add_sectiont remove_optiontoptionstsettopentwrite( tfilenametsettingstdry_runtoptstsectionR%toptiontvaluetf((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR!s8      cBs;eZdZd d dgZddgZd Zd ZRS(s<Abstract base class for commands that mess with config filess global-configtgs0save options to the site-wide distutils.cfg files user-configtus7save options to the current user's pydistutils.cfg files filename=R0s-configuration file to use (default=setup.cfg)cCsd|_d|_d|_dS(N(Rt global_configt user_configR)(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytinitialize_options\s  cCsg}|jr%|jtdn|jrD|jtdn|jdk rf|j|jn|s|jtdnt|dkrtd|n|\|_dS(NR R R is/Must specify only one configuration file option(R3tappendRR4R)RtlenR(R5t filenames((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytfinalize_optionsas   (s global-configR1s0save options to the site-wide distutils.cfg file(s user-configR2s7save options to the current user's pydistutils.cfg file(s filename=R0s-configuration file to use (default=setup.cfg)(t__name__t __module__t__doc__t user_optionstboolean_optionsR6R:(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRLs   cBsXeZdZdZddddgejZejd gZdZdZdZ RS(s#Save command-line options to a files1set an option in setup.cfg or another config filescommand=tcscommand to set an option forsoption=tos option to sets set-value=tssvalue of the optiontremovetrsremove (unset) the valuecCs5tj|d|_d|_d|_d|_dS(N(RR6RtcommandR.t set_valueRC(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR6s     cCsftj||jdks+|jdkr:tdn|jdkrb|j rbtdndS(Ns%Must specify --command *and* --options$Must specify --set-value or --remove(RR:RERR.RRFRC(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR:s  cCs=t|jii|j|jjdd6|j6|jdS(Nt-t_(RR)RFR.treplaceRER+(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytruns #(scommand=R@scommand to set an option for(soption=RAs option to set(s set-value=RBsvalue of the option(RCRDsremove (unset) the value( R;R<R=t descriptionRR>R?R6R:RJ(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRss   (tdistutils.utilRRRtdistutils.errorsRRtsetuptools.extern.six.movesRt setuptoolsRt__all__RtFalseRRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyts    +'PK!PJ command/rotate.pycnu[ fc@sddlmZddlmZddlmZddlZddlZddlm Z ddl m Z de fdYZ dS( i(t convert_path(tlog(tDistutilsOptionErrorN(tsix(tCommandtrotatecBsDeZdZdZdddgZgZd Zd Zd ZRS(sDelete older distributionss2delete older distributions, keeping N newest filessmatch=tmspatterns to match (required)s dist-dir=tds%directory where the distributions areskeep=tks(number of matching distributions to keepcCsd|_d|_d|_dS(N(tNonetmatchtdist_dirtkeep(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytinitialize_optionss  cCs|jdkrtdn|jdkr<tdnyt|j|_Wntk rqtdnXt|jtjrg|jj dD]}t |j ^q|_n|j dddS(NsQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')s$Must specify number of files to keeps--keep must be an integert,tbdistR (R R ( R R RR tintt ValueErrort isinstanceRt string_typestsplitRtstriptset_undefined_options(R tp((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytfinalize_optionss  7cCs1|jdddlm}x |jD]}|jjd|}|tjj|j|}g|D]}tjj ||f^qi}|j |j t j dt||||j}x_|D]W\}}t j d||jstjj|rtj|q%tj|qqWq'WdS(Ntegg_infoi(tglobt*s%d file(s) matching %ss Deleting %s(t run_commandRR t distributiontget_nametostpathtjoinR tgetmtimetsorttreverseRtinfotlenR tdry_runtisdirtshutiltrmtreetunlink(R Rtpatterntfilestftt((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytrun/s  +    (smatch=Rspatterns to match (required)(s dist-dir=Rs%directory where the distributions are(skeep=Rs(number of matching distributions to keep( t__name__t __module__t__doc__t descriptiont user_optionstboolean_optionsRRR1(((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pyR s   ( tdistutils.utilRt distutilsRtdistutils.errorsRR R*tsetuptools.externRt setuptoolsRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pyts  PK!~command/register.pycnu[ fc@s/ddljjZdejfdYZdS(iNtregistercBseZejjZdZRS(cCs!|jdtjj|dS(Ntegg_info(t run_commandtorigRtrun(tself((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pyRs (t__name__t __module__RRt__doc__R(((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pyRs (tdistutils.command.registertcommandRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pytsPK!PJ command/rotate.pyonu[ fc@sddlmZddlmZddlmZddlZddlZddlm Z ddl m Z de fdYZ dS( i(t convert_path(tlog(tDistutilsOptionErrorN(tsix(tCommandtrotatecBsDeZdZdZdddgZgZd Zd Zd ZRS(sDelete older distributionss2delete older distributions, keeping N newest filessmatch=tmspatterns to match (required)s dist-dir=tds%directory where the distributions areskeep=tks(number of matching distributions to keepcCsd|_d|_d|_dS(N(tNonetmatchtdist_dirtkeep(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytinitialize_optionss  cCs|jdkrtdn|jdkr<tdnyt|j|_Wntk rqtdnXt|jtjrg|jj dD]}t |j ^q|_n|j dddS(NsQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')s$Must specify number of files to keeps--keep must be an integert,tbdistR (R R ( R R RR tintt ValueErrort isinstanceRt string_typestsplitRtstriptset_undefined_options(R tp((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytfinalize_optionss  7cCs1|jdddlm}x |jD]}|jjd|}|tjj|j|}g|D]}tjj ||f^qi}|j |j t j dt||||j}x_|D]W\}}t j d||jstjj|rtj|q%tj|qqWq'WdS(Ntegg_infoi(tglobt*s%d file(s) matching %ss Deleting %s(t run_commandRR t distributiontget_nametostpathtjoinR tgetmtimetsorttreverseRtinfotlenR tdry_runtisdirtshutiltrmtreetunlink(R Rtpatterntfilestftt((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pytrun/s  +    (smatch=Rspatterns to match (required)(s dist-dir=Rs%directory where the distributions are(skeep=Rs(number of matching distributions to keep( t__name__t __module__t__doc__t descriptiont user_optionstboolean_optionsRRR1(((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pyR s   ( tdistutils.utilRt distutilsRtdistutils.errorsRR R*tsetuptools.externRt setuptoolsRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/rotate.pyts  PK!-υcommand/upload_docs.pyonu[ fc@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd Zd efd YZdS(spupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). i(tstandard_b64encode(tlog(tDistutilsOptionErrorN(tsix(t http_clientturllib(titer_entry_pointsi(tuploadcCs%tjrdnd}|jd|S(Ntsurrogateescapetstrictsutf-8(RtPY3tencode(tsterrors((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt_encodest upload_docscBseZdZdZdddejfddgZejZd Zd efgZ d Z d Z d Z dZ edZedZdZRS(shttps://pypi.python.org/pypi/sUpload documentation to PyPIs repository=trsurl of repository [default: %s]s show-responses&display full response text from servers upload-dir=sdirectory to uploadcCs1|jdkr-xtddD]}tSWndS(Nsdistutils.commandst build_sphinx(t upload_dirtNoneRtTrue(tselftep((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt has_sphinx/sRcCs#tj|d|_d|_dS(N(Rtinitialize_optionsRRt target_dir(R((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyR6s  cCstj||jdkrs|jrF|jd}|j|_q|jd}tj j |j d|_n|j d|j|_d|j krtjdn|jd|jdS(NRtbuildtdocsRspypi.python.orgs3Upload_docs command is deprecated. Use RTD instead.sUsing upload directory %s(Rtfinalize_optionsRRRtget_finalized_commandtbuilder_target_dirRtostpathtjoint build_basetensure_dirnamet repositoryRtwarntannounce(RRR((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyR;s    c Cstj|d}z|j|jxtj|jD]\}}}||jkry| ryd}t||jnxj|D]b}tjj||}|t |jj tjj } tjj| |} |j || qWq8WWd|j XdS(Ntws'no files found in upload directory '%s'(tzipfiletZipFiletmkpathRRtwalkRR R!tlentlstriptseptwritetclose( Rtfilenametzip_filetroottdirstfilesttmpltnametfulltrelativetdest((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pytcreate_zipfileKs" "cCsx!|jD]}|j|q Wtj}|jjj}tjj |d|}z|j ||j |Wdt j |XdS(Ns%s.zip(tget_sub_commandst run_commandttempfiletmkdtempt distributiontmetadatatget_nameRR R!R;t upload_filetshutiltrmtree(Rtcmd_namettmp_dirR7R2((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pytrun[s  ccs|\}}d|}t|ts1|g}nx|D]x}t|trl|d|d7}|d}n t|}|Vt|VdV|V|r8|ddkr8dVq8q8WdS( Ns* Content-Disposition: form-data; name="%s"s; filename="%s"iis is s (t isinstancetlistttupleR(titemt sep_boundarytkeytvaluesttitletvalue((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt _build_partis       c Csd}d|}|d}|df}tj|jd|}t||j}tjj|}tj||} d|jd} dj | | fS( s= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--s RMs multipart/form-data; boundary=%stasciit( t functoolstpartialRRtmaptitemst itertoolstchaint from_iterabletdecodeR!( tclstdatatboundaryRMt end_boundaryt end_itemstbuildert part_groupstpartst body_itemst content_type((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt_build_multipart}s     cCst|d}|j}WdQX|jj}idd6|jd6tjj||fd6}t|j d|j }t |}t j r|jd}nd|}|j|\}} d |j} |j| tjtjj|j\} } } }}}| d kr(tj| }n.| d krFtj| }ntd | d }yw|j|jd| | }|jd||jdtt||jd||j |j!|Wn0t"j#k r}|jt|tj$dSX|j%}|j&dkrMd|j&|j'f} |j| tjn|j&dkr|j(d}|dkrd|j}nd|} |j| tjn)d|j&|j'f} |j| tj$|j*rdd|jddfGHndS(Ntrbt doc_uploads:actionR7tcontentt:RSsBasic sSubmitting documentation to %sthttpthttpssunsupported schema RTtPOSTs Content-typesContent-lengtht AuthorizationisServer response (%s): %si-tLocationshttps://pythonhosted.org/%s/sUpload successful. Visit %ssUpload failed (%s): %st-iK(+topentreadR@RARBRR tbasenameRtusernametpasswordRRR R\RgR$R&RtINFORtparseturlparseRtHTTPConnectiontHTTPSConnectiontAssertionErrortconnectt putrequestt putheadertstrR,t endheaderstsendtsocketterrortERRORt getresponsetstatustreasont getheaderRt show_response(RR1tfRjtmetaR^t credentialstauthtbodytcttmsgtschematnetlocturltparamstqueryt fragmentstconnRfteRtlocation((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyRCs`      '        N(s show-responseNs&display full response text from server(s upload-dir=Nsdirectory to upload(t__name__t __module__tDEFAULT_REPOSITORYt descriptionRRt user_optionstboolean_optionsRt sub_commandsRRR;RHt staticmethodRRt classmethodRgRC(((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyRs"        (t__doc__tbase64Rt distutilsRtdistutils.errorsRRRR(R>RDRYRUtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRRR(((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyts         PK! command/py36compat.pyonu[ fc@sddlZddlmZddlmZddlmZddlmZdd dYZe ejdrdd d YZndS( iN(tglob(t convert_path(tsdist(tfiltertsdist_add_defaultscBseeZdZdZedZdZdZdZdZ dZ dZ d Z RS( s Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCsJ|j|j|j|j|j|j|jdS(s9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N(t_add_defaults_standardst_add_defaults_optionalt_add_defaults_pythont_add_defaults_data_filest_add_defaults_extt_add_defaults_c_libst_add_defaults_scripts(tself((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyt add_defaultss      cCsStjj|stStjj|}tjj|\}}|tj|kS(s Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False (tostpathtexiststFalsetabspathtsplittlistdir(tfspathRt directorytfilename((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyt_cs_path_exists(s cCs|j|jjg}x|D]}t|tr|}t}x7|D]/}|j|rDt}|jj |PqDqDW|s|j ddj |qq|j|r|jj |q|j d|qWdS(Ns,standard file not found: should have one of s, sstandard file '%s' not found( tREADMESt distributiont script_namet isinstancettupleRRtTruetfilelisttappendtwarntjoin(R t standardstfntaltstgot_it((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR9s    cCsLddg}x9|D]1}ttjjt|}|jj|qWdS(Ns test/test*.pys setup.cfg(RRRtisfileRRtextend(R toptionaltpatterntfiles((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRNs  cCs|jd}|jjr7|jj|jnxM|jD]B\}}}}x-|D]%}|jjtj j ||qZWqAWdS(Ntbuild_py( tget_finalized_commandRthas_pure_modulesRR(tget_source_filest data_filesR RRR"(R R,tpkgtsrc_dirt build_dirt filenamesR((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRTs  cCs|jjrx|jjD]}t|tret|}tjj|r|j j |qq|\}}x?|D]7}t|}tjj|rx|j j |qxqxWqWndS(N( Rthas_data_filesR0RtstrRRRR'RR (R titemtdirnameR4tf((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRds    cCs;|jjr7|jd}|jj|jndS(Nt build_ext(Rthas_ext_modulesR-RR(R/(R R:((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR uscCs;|jjr7|jd}|jj|jndS(Nt build_clib(Rthas_c_librariesR-RR(R/(R R<((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR zscCs;|jjr7|jd}|jj|jndS(Nt build_scripts(Rt has_scriptsR-RR(R/(R R>((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR s( t__name__t __module__t__doc__R t staticmethodRRRRRR R R (((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR s       RcBseZRS((R@RA(((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRs((( RRtdistutils.utilRtdistutils.commandRtsetuptools.extern.six.movesRRthasattr(((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyts |PK!ѽUrYYcommand/install.pyonu[ fc@sddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ de jfdYZge jj D]Z e dejkre ^qeje_ dS(i(tDistutilsArgErrorNtinstallcBseZdZejjddgZejjddgZddfddfgZe eZ d Z d Z d Z d Zed ZdZRS(s7Use easy_install to install the package, w/dependenciessold-and-unmanageablesTry not to use this!s!single-version-externally-manageds5used by system package builders to create 'flat' eggstinstall_egg_infocCstS(N(tTrue(tself((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pytttinstall_scriptscCstS(N(R(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyRRcCs&tjj|d|_d|_dS(N(torigRtinitialize_optionstNonetold_and_unmanageablet!single_version_externally_managed(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR s cCsXtjj||jr%t|_n/|jrT|j rT|j rTtdqTndS(NsAYou must specify --record or --root when building system packages(RRtfinalize_optionstrootRR trecordR(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR %s   cCs8|js|jr"tjj|Sd|_d|_dS(NR(RR RRthandle_extra_pathR t path_filet extra_dirs(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR0s cCsX|js|jr"tjj|S|jtjsJtjj|n |jdS(N( R R RRtrunt_called_from_setuptinspectt currentframetdo_egg_install(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR:s cCs|d krKd}tj|tjdkrGd}tj|ntStj|d}|d \}tj|}|j j dd}|dko|j d kS( s Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. s4Call stack not available. bdist_* commands may fail.t IronPythons6For best results, pass -X:Frames to enable call stack.iit__name__Rsdistutils.distt run_commandsN( R twarningstwarntplatformtpython_implementationRRtgetouterframest getframeinfot f_globalstgettfunction(t run_frametmsgtrestcallertinfot caller_module((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyREs    cCs|jjd}||jddd|jd|j}|jd|_|jjtjd|j d|jj dj g}t j r|jd t j n||_|jdt _ dS( Nt easy_installtargstxRRt.s*.eggt bdist_eggi(t distributiontget_command_classRRtensure_finalizedtalways_copy_fromt package_indextscantglobt run_commandtget_command_objt egg_outputt setuptoolstbootstrap_install_fromtinsertR+RR (RR*tcmdR+((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR`s$      N(sold-and-unmanageableNsTry not to use this!(s!single-version-externally-managedNs5used by system package builders to create 'flat' eggs(Rt __module__t__doc__RRt user_optionsR tboolean_optionst new_commandstdictt_ncR R RRt staticmethodRR(((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyRs         i(tdistutils.errorsRRR5RRtdistutils.command.installtcommandRRR9t_installt sub_commandsR<RCRA(((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyts      l/PK!n[rrcommand/__init__.pyonu[ fc@sdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrdejds   PK! +K K command/install_scripts.pyonu[ fc@ssddlmZddljjZddlZddlZddlm Z m Z m Z dejfdYZdS(i(tlogN(t Distributiont PathMetadatatensure_directorytinstall_scriptscBs,eZdZdZdZddZRS(s;Do normal script install, plus any egg_info wrapper scriptscCstjj|t|_dS(N(torigRtinitialize_optionstFalsetno_ep(tself((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR sc Csfddljj}|jd|jjr>tjj|n g|_ |j rTdS|j d}t |j t|j |j|j|j}|j d}t|dd}|j d}t|dt}|j}|rd}|j}n|tjkr|g}n|j}|jjj|} x-|j|| jD]} |j| qKWdS(Nitegg_infot build_scriptst executablet bdist_wininstt _is_runnings python.exe(tsetuptools.command.easy_installtcommandt easy_installt run_commandt distributiontscriptsRRtruntoutfilesRtget_finalized_commandRtegg_baseRR tegg_namet egg_versiontgetattrtNoneRt ScriptWritertWindowsScriptWritertsysR tbesttcommand_spec_classt from_paramtget_argst as_headert write_script( R teitei_cmdtdisttbs_cmdt exec_paramtbw_cmdt is_wininsttwritertcmdtargs((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyRs2        ttc Gsddlm}m}tjd||jtjj|j|}|j j ||}|j st |t |d|} | j|| j||d|ndS(s1Write an executable file to the scripts directoryi(tchmodt current_umasksInstalling %s script to %stwiN(RR1R2Rtinfot install_dirtostpathtjoinRtappendtdry_runRtopentwritetclose( R t script_nametcontentstmodetignoredR1R2ttargettmasktf((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR%3s     (t__name__t __module__t__doc__RRR%(((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR s  #( t distutilsRt!distutils.command.install_scriptsRRRR6Rt pkg_resourcesRRR(((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyts   PK!tddcommand/upload.pycnu[ fc@s9ddlZddlmZdejfdYZdS(iN(tuploadRcBs)eZdZdZdZdZRS(sa Override default upload behavior to obtain password in a variety of different ways. cCsPtjj||jp"tj|_|jpF|jpF|j|_dS(N( torigRtfinalize_optionstusernametgetpasstgetusertpasswordt_load_password_from_keyringt_prompt_for_password(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR s    cCs>y&td}|j|j|jSWntk r9nXdS(sM Attempt to load password from keyring. Suppress Exceptions. tkeyringN(t __import__t get_passwordt repositoryRt Exception(R R ((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyRs   cCs,ytjSWnttfk r'nXdS(sH Prompt for a password on the tty. Suppress Exceptions. N(RRtKeyboardInterrupt(R ((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR#s(t__name__t __module__t__doc__RRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyRs  (Rtdistutils.commandRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyts PK!хcommand/dist_info.pycnu[ fc@sLdZddlZddlmZddlmZdefdYZdS(sD Create a dist_info directory As defined in the wheel specification iN(tCommand(tlogt dist_infocBs2eZdZdgZdZdZdZRS(screate a .dist-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dS(N(tNonetegg_base(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pytinitialize_optionsscCsdS(N((R((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pytfinalize_optionsscCs|jd}|j|_|j|j|jtd d}tjdjt j j ||jd}|j |j|dS(Ntegg_infos .egg-infos .dist-infos creating '{}'t bdist_wheel( tget_finalized_commandRRtrunR tlenRtinfotformattostpathtabspathtegg2dist(RR t dist_info_dirR ((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyR s   "(s egg-base=RsLdirectory containing .egg-info directories (default: top of the source tree)(t__name__t __module__t descriptiont user_optionsRRR (((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyR s    (t__doc__Rtdistutils.coreRt distutilsRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyts PK!'zzcommand/bdist_rpm.pycnu[ fc@s/ddljjZdejfdYZdS(iNt bdist_rpmcBs eZdZdZdZRS(sf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs!|jdtjj|dS(Ntegg_info(t run_commandtorigRtrun(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyRs c Cs|jj}|jdd}tjj|}d|}d|}g|D]<}|jddjddjdd j||^qN}|j|d }d |}|j|||S( Nt-t_s%define version sSource0: %{name}-%{version}.tars)Source0: %{name}-%{unmangled_version}.tarssetup.py install s5setup.py install --single-version-externally-managed s%setups&%setup -n %{name}-%{unmangled_version}is%define unmangled_version (t distributiont get_versiontreplaceRRt_make_spec_filetindextinsert( Rtversiont rpmversiontspectline23tline24tlinet insert_loctunmangled_version((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyR s   F (t__name__t __module__t__doc__RR (((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyRs  (tdistutils.command.bdist_rpmtcommandRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pytsPK!Gl((command/test.pyonu[ fc@s:ddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd e fd YZd efd YZd efdYZ dS(iN(tDistutilsErrortDistutilsOptionError(tlog(t TestLoader(tsix(tmaptfilter( tresource_listdirtresource_existstnormalize_patht working_sett_namespace_packagestevaluate_markertadd_activation_listenertrequiret EntryPoint(tCommandtScanningLoadercBseZdZddZRS(cCstj|t|_dS(N(Rt__init__tsett_visited(tself((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs cCs7||jkrd S|jj|g}|jtj||t|drg|j|jnt|dr xt|j dD]|}|j dr|dkr|j d|d }n-t |j |dr|j d|}nq|j|j |qWnt |d kr+|j|S|d Sd S( sReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. tadditional_testst__path__ts.pys __init__.pyt.is /__init__.pyiiN(RtNonetaddtappendRtloadTestsFromModulethasattrRRt__name__tendswithRtloadTestsFromNametlent suiteClass(Rtmoduletpatterntteststfilet submodule((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs$ N(Rt __module__RRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs tNonDataPropertycBseZdZddZRS(cCs ||_dS(N(tfget(RR+((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR>scCs|dkr|S|j|S(N(RR+(Rtobjtobjtype((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt__get__As N(RR)RRR.(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR*=s ttestcBseZdZdZdddgZd Zd Zed ZdZ dZ e j gdZ ee j dZedZdZdZedZedZRS(s.Command to run unit tests after in-place builds#run unit tests after in-place builds test-module=tms$Run 'test_suite' in specified modules test-suite=tss9Run single test, case or suite (e.g. 'module.test_suite')s test-runner=trsTest runner to usecCs(d|_d|_d|_d|_dS(N(Rt test_suitet test_modulet test_loadert test_runner(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytinitialize_optionsSs   cCs|jr'|jr'd}t|n|jdkrj|jdkrW|jj|_qj|jd|_n|jdkrt|jdd|_n|jdkrd|_n|jdkrt|jdd|_ndS(Ns1You may specify a module or a suite, but not boths .test_suiteR5s&setuptools.command.test:ScanningLoaderR6(R3R4RRt distributionR5tgetattrR6(Rtmsg((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytfinalize_optionsYs cCst|jS(N(tlistt _test_args(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt test_argslsccsJ|j r!tjdkr!dVn|jr2dVn|jrF|jVndS(Niitdiscovers --verbose(ii(R3tsyst version_infotverbose(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR=ps   cCs|j |WdQXdS(sI Backward compatibility for project_on_sys_path context. N(tproject_on_sys_path(Rtfunc((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytwith_project_on_sys_pathxs c cstjot|jdt}|r|jddd|jd|jd}t|j }|jdd||jd|jddd|jdn-|jd|jddd|jd|jd}t j }t j j }zut|j}t j jd|tjtd td |j|jf|j|g dVWdQXWd|t j (t j jt j j|tjXdS( Ntuse_2to3tbuild_pytinplaceitegg_infotegg_baset build_exticSs |jS(N(tactivate(tdist((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytRs%s==%s(RtPY3R9R8tFalsetreinitialize_commandt run_commandtget_finalized_commandR t build_libR@tpathtmodulestcopyRJtinsertR RR Rtegg_namet egg_versiontpaths_on_pythonpathtcleartupdate( Rt include_distst with_2to3tbpy_cmdt build_pathtei_cmdtold_patht old_modulest project_path((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRCs8         ccst}tjjd|}tjjdd}zXtjj|}td||g}tjj|}|r|tjds (tfetch_build_eggstinstall_requirest tests_requiretextras_requiretitemst itertoolstchain(RMtir_dttr_dter_d((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt install_distss c Cs|j|j}dj|j}|jrB|jd|dS|jd|ttjd|}|j |"|j |j WdQXWdQXdS(Nt sskipping "%s" (dry run)s running "%s"tlocation( RR8Rlt_argvtdry_runtannounceRtoperatort attrgetterR[RCt run_tests(Rtinstalled_diststcmdRn((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytruns  c CsEtjrt|jdtr|jjdd}|tkrg}|tj kre|j |n|d7}x0tj D]%}|j |ry|j |qyqyWt t tj j|qntjdd|jd|j|jd|j|jdt}|jjsAd|j}|j|tjt|ndS(NRFRit testLoadert testRunnertexitsTest failed: %s(RROR9R8RPR3tsplitR R@RVRRvR<Rt __delitem__tunittesttmainRRt_resolve_as_epR5R6tresultt wasSuccessfulRRtERRORR(RR$t del_modulestnameR/R:((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs(    cCsdg|jS(NR(R>(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRscCs0|dkrdStjd|}|jS(su Load the indicated attribute value, called, as a as if it were specified as an entry point. Nsx=(RRtparsetresolve(tvaltparsed((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs (s test-module=R0s$Run 'test_suite' in specified module(s test-suite=R1s9Run single test, case or suite (e.g. 'module.test_suite')(s test-runner=R2sTest runner to use(RR)t__doc__t descriptiont user_optionsR7R;R*R>R=REt contextlibtcontextmanagerRCt staticmethodR[RRRtpropertyRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR/Gs(     -  (!RhRR@RRRtdistutils.errorsRRt distutilsRRtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRR R R R R RRt setuptoolsRRRgR*R/(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyts      @) PK!x(Lcommand/sdist.pyonu[ fc@sddlmZddljjZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZddZde ejfd YZdS( i(tlogN(tsixi(tsdist_add_defaultstccs@x9tjdD](}x|j|D] }|Vq)WqWdS(s%Find all files under revision controlssetuptools.file_findersN(t pkg_resourcestiter_entry_pointstload(tdirnameteptitem((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt walk_revctrlstsdistcBs/eZdZd"ddddfd#gZiZd d d d gZedeDZdZ dZ dZ dZ e ejdZdZejd$kpd%ejkod&knpd'ejkod(knZereZndZdZdZdZdZd ZRS()s=Smart sdist that finds anything supported by revision controlsformats=s6formats for source distribution (comma-separated list)s keep-temptks1keep the distribution tree around after creating sarchive file(s)s dist-dir=tdsFdirectory to put the source distribution archive(s) in [default: dist]Rs.rsts.txts.mdccs|]}dj|VqdS(s README{0}N(tformat(t.0text((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pys )scCs|jd|jd}|j|_|jjtjj|jd|jx!|j D]}|j|qaW|j t |j dg}x<|j D]1}dd|f}||kr|j|qqWdS(Ntegg_infos SOURCES.txtt dist_filesR R(t run_commandtget_finalized_commandtfilelisttappendtostpathtjoinRt check_readmetget_sub_commandstmake_distributiontgetattrt distributiont archive_files(tselftei_cmdtcmd_nameRtfiletdata((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pytrun+s  "   cCstjj||jdS(N(torigR tinitialize_optionst_default_to_gztar(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR'>scCs#tjdkrdSdg|_dS(Niiitbetaitgztar(iiiR)i(tsyst version_infotformats(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR(CscCs'|jtjj|WdQXdS(s% Workaround for #516 N(t_remove_os_linkR&R R(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRIs ccssdddY}ttd|}y t`Wntk rBnXz dVWd||k rnttd|nXdS(sG In a context, remove and restore os.link if it exists tNoValuecBseZRS((t__name__t __module__(((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR/WstlinkN((RRR2t Exceptiontsetattr(R/torig_val((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR.Ps    cCs[ytjj|Wn@tk rVtj\}}}|jjjdj nXdS(Nttemplate( R&R t read_templateR3R+texc_infottb_nextttb_frametf_localstclose(R t_ttb((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt__read_template_hackes  iiiiiicCs|jjr|jd}|jj|j|jjsxR|jD]D\}}}}|jjg|D]}tj j ||^qlqJWqndS(sgetting python filestbuild_pyN( Rthas_pure_modulesRRtextendtget_source_filestinclude_package_datat data_filesRRR(R R@R=tsrc_dirt filenamestfilename((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt_add_defaults_python|s  cCsOy*tjrtj|n tjWntk rJtjdnXdS(Ns&data_files contains unexpected objects(RtPY2Rt_add_defaults_data_filestsupert TypeErrorRtwarn(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRKs   cCsKxD|jD]}tjj|r dSq W|jddj|jdS(Ns,standard file not found: should have one of s, (tREADMESRRtexistsRNR(R tf((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRs cCstjj|||tjj|d}ttdrltjj|rltj||j d|n|j dj |dS(Ns setup.cfgR2R( R&R tmake_release_treeRRRthasattrRPtunlinkt copy_fileRtsave_version_info(R tbase_dirtfilestdest((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRRs ! cCsStjj|jstStj|jd}|j}WdQX|djkS(Ntrbs+# file GENERATED by distutils, do NOT edit ( RRtisfiletmanifesttFalsetiotopentreadlinetencode(R tfpt first_line((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt_manifest_is_not_generateds cCstjd|jt|jd}x|D]}tjryy|jd}Wqytk rutjd|q,qyXn|j }|j ds,| rq,n|j j |q,W|j dS(sRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. sreading manifest file '%s'RZsUTF-8s"%r not UTF-8 decodable -- skippingt#N(RtinfoR\R_RtPY3tdecodetUnicodeDecodeErrorRNtstript startswithRRR<(R R\tline((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt read_manifests     N(sformats=Ns6formats for source distribution (comma-separated list)(s dist-dir=R sFdirectory to put the source distribution archive(s) in [default: dist](iii(ii(iii(ii(iii(R0R1t__doc__tNonet user_optionst negative_opttREADME_EXTENSIONSttupleROR%R'R(Rt staticmethodt contextlibtcontextmanagerR.t_sdist__read_template_hackR+R,thas_leaky_handleR7RIRKRRRRdRm(((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR s:         (t distutilsRtdistutils.command.sdisttcommandR R&RR+R^Rutsetuptools.externRt py36compatRRtlistt_default_revctrlR (((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyts      PK!command/develop.pycnu[ fc@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl m Z mZmZddlmZddlmZddlZd ejefd YZd efd YZdS( i(t convert_path(tlog(tDistutilsErrortDistutilsOptionErrorN(tsix(t Distributiont PathMetadatatnormalize_path(t easy_install(t namespacestdevelopcBseZdZdZejddgZejdgZeZ dZ dZ d Z e d Zd Zd Zd ZdZRS(sSet up package for developments%install package in 'development mode't uninstalltusUninstall this source packages egg-path=s-Set the path to be used in the .egg-link filecCsA|jr)t|_|j|jn |j|jdS(N(R tTruet multi_versiontuninstall_linktuninstall_namespacestinstall_for_developmenttwarn_deprecated_options(tself((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytruns      cCs5d|_d|_tj|d|_d|_dS(Nt.(tNoneR tegg_pathRtinitialize_optionst setup_pathtalways_copy_from(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR's     cCs|jd}|jrCd}|j|jf}t||n|jg|_tj||j|j |j j t j d|jd}t jj|j||_|j|_|jdkrt jj|j|_nt|j}tt jj|j|j}||kr9td|nt|t|t jj|jd|j|_|j|j|j|j|_dS(Ntegg_infos-Please rename %r to %r before using 'develop's*.eggs .egg-linksA--egg-path must be a relative path from the install directory to t project_name(tget_finalized_commandtbroken_egg_infoRRtegg_nametargsRtfinalize_optionstexpand_basedirst expand_dirst package_indextscantglobtostpathtjoint install_dirtegg_linktegg_baseRRtabspathRRRRtdistt_resolve_setup_pathR(RteittemplateR t egg_link_fnttargetR((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR!.s<        cCs|jtjdjd}|tjkrGd|jdd}nttjj|||}|ttjkrt d|ttjn|S(s Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. t/s../isGCan't get a consistent path to setup script from installation directory( treplaceR'tseptrstriptcurdirtcountRR(R)R(R,R*Rt path_to_setuptresolved((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR/XscCstjrt|jdtr|jddd|jd|jd}t|j }|jdd||jd|jddd|jd|jd}||_ ||j _ t ||j|j _n-|jd|jddd|jd|jtjr7|jtjdt_n|jtjd |j|j|jst|jd "}|j|j d |jWdQXn|jd|j |j dS( Ntuse_2to3tbuild_pytinplaceiRR,t build_extisCreating %s (link to %s)tws ( RtPY3tgetattrt distributiontFalsetreinitialize_commandt run_commandRRt build_libRR.tlocationRRt _providertinstall_site_pyt setuptoolstbootstrap_install_fromRRtinstall_namespacesRtinfoR+R,tdry_runtopentwriteRtprocess_distributiontno_deps(Rtbpy_cmdt build_pathtei_cmdtf((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRks4            $cCstjj|jrtjd|j|jt|j}g|D]}|j^qD}|j ||j g|j |j gfkrtj d|dS|j stj|jqn|j s|j|jn|jjrtj dndS(NsRemoving %s (link to %s)s$Link points to %s: uninstall aborteds5Note: you must uninstall or replace scripts manually!(R'R(texistsR+RRNR,RPR7tcloseRRtwarnROtunlinkt update_pthR.RCtscripts(Rt egg_link_filetlinetcontents((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRs     cCs||jk rtj||S|j|x~|jjp>gD]j}tjjt |}tjj |}t j |}|j }WdQX|j||||q?WdS(N(R.Rtinstall_egg_scriptstinstall_wrapper_scriptsRCR]R'R(R-RtbasenametioRPtreadtinstall_script(RR.t script_namet script_pathtstrmt script_text((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRas cCst|}tj||S(N(tVersionlessRequirementRRb(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRbs (R R sUninstall this source packageN(s egg-path=Ns-Set the path to be used in the .egg-link file(t__name__t __module__t__doc__t descriptionRt user_optionsRtboolean_optionsRDtcommand_consumes_argumentsRRR!t staticmethodR/RRRaRb(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR s   * /  RkcBs)eZdZdZdZdZRS(sz Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS(N(t_VersionlessRequirement__dist(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt__init__scCst|j|S(N(RBRt(Rtname((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt __getattr__scCs|jS(N(R(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytas_requirements(RlRmRnRuRwRx(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRks   (tdistutils.utilRt distutilsRtdistutils.errorsRRR'R&Rdtsetuptools.externRt pkg_resourcesRRRtsetuptools.command.easy_installRRKR tDevelopInstallerR tobjectRk(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyts    PK!gcommand/upload_docs.pycnu[ fc@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd Zd efd YZdS(spupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). i(tstandard_b64encode(tlog(tDistutilsOptionErrorN(tsix(t http_clientturllib(titer_entry_pointsi(tuploadcCs%tjrdnd}|jd|S(Ntsurrogateescapetstrictsutf-8(RtPY3tencode(tsterrors((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt_encodest upload_docscBseZdZdZdddejfddgZejZd Zd efgZ d Z d Z d Z dZ edZedZdZRS(shttps://pypi.python.org/pypi/sUpload documentation to PyPIs repository=trsurl of repository [default: %s]s show-responses&display full response text from servers upload-dir=sdirectory to uploadcCs1|jdkr-xtddD]}tSWndS(Nsdistutils.commandst build_sphinx(t upload_dirtNoneRtTrue(tselftep((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt has_sphinx/sRcCs#tj|d|_d|_dS(N(Rtinitialize_optionsRRt target_dir(R((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyR6s  cCstj||jdkrs|jrF|jd}|j|_q|jd}tj j |j d|_n|j d|j|_d|j krtjdn|jd|jdS(NRtbuildtdocsRspypi.python.orgs3Upload_docs command is deprecated. Use RTD instead.sUsing upload directory %s(Rtfinalize_optionsRRRtget_finalized_commandtbuilder_target_dirRtostpathtjoint build_basetensure_dirnamet repositoryRtwarntannounce(RRR((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyR;s    c Cstj|d}z|j|jxtj|jD]\}}}||jkry| ryd}t||jnxj|D]b}tjj||}|t |jj tjj } tjj| |} |j || qWq8WWd|j XdS(Ntws'no files found in upload directory '%s'(tzipfiletZipFiletmkpathRRtwalkRR R!tlentlstriptseptwritetclose( Rtfilenametzip_filetroottdirstfilesttmpltnametfulltrelativetdest((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pytcreate_zipfileKs" "cCsx!|jD]}|j|q Wtj}|jjj}tjj |d|}z|j ||j |Wdt j |XdS(Ns%s.zip(tget_sub_commandst run_commandttempfiletmkdtempt distributiontmetadatatget_nameRR R!R;t upload_filetshutiltrmtree(Rtcmd_namettmp_dirR7R2((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pytrun[s  ccs|\}}d|}t|ts1|g}nx|D]x}t|trl|d|d7}|d}n t|}|Vt|VdV|V|r8|ddkr8dVq8q8WdS( Ns* Content-Disposition: form-data; name="%s"s; filename="%s"iis is s (t isinstancetlistttupleR(titemt sep_boundarytkeytvaluesttitletvalue((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt _build_partis       c Csd}d|}|d}|df}tj|jd|}t||j}tjj|}tj||} d|jd} dj | | fS( s= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--s RMs multipart/form-data; boundary=%stasciit( t functoolstpartialRRtmaptitemst itertoolstchaint from_iterabletdecodeR!( tclstdatatboundaryRMt end_boundaryt end_itemstbuildert part_groupstpartst body_itemst content_type((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyt_build_multipart}s     cCst|d}|j}WdQX|jj}idd6|jd6tjj||fd6}t|j d|j }t |}t j r|jd}nd|}|j|\}} d |j} |j| tjtjj|j\} } } }}}| r| r| s%t| d krCtj| }n.| d kratj| }ntd | d }yw|j|jd| | }|jd||jdtt||jd||j |j!|Wn0t"j#k r }|jt|tj$dSX|j%}|j&dkrhd|j&|j'f} |j| tjn|j&dkr|j(d}|dkrd|j}nd|} |j| tjn)d|j&|j'f} |j| tj$|j*rdd|jddfGHndS(Ntrbt doc_uploads:actionR7tcontentt:RSsBasic sSubmitting documentation to %sthttpthttpssunsupported schema RTtPOSTs Content-typesContent-lengtht AuthorizationisServer response (%s): %si-tLocationshttps://pythonhosted.org/%s/sUpload successful. Visit %ssUpload failed (%s): %st-iK(+topentreadR@RARBRR tbasenameRtusernametpasswordRRR R\RgR$R&RtINFORtparseturlparsetAssertionErrorRtHTTPConnectiontHTTPSConnectiontconnectt putrequestt putheadertstrR,t endheaderstsendtsocketterrortERRORt getresponsetstatustreasont getheaderRt show_response(RR1tfRjtmetaR^t credentialstauthtbodytcttmsgtschematnetlocturltparamstqueryt fragmentstconnRfteRtlocation((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyRCsb      '        N(s show-responseNs&display full response text from server(s upload-dir=Nsdirectory to upload(t__name__t __module__tDEFAULT_REPOSITORYt descriptionRRt user_optionstboolean_optionsRt sub_commandsRRR;RHt staticmethodRRt classmethodRgRC(((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyRs"        (t__doc__tbase64Rt distutilsRtdistutils.errorsRRRR(R>RDRYRUtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRRR(((sB/usr/lib/python2.7/site-packages/setuptools/command/upload_docs.pyts         PK!&99command/easy_install.pycnu[ fc@sedZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4m<Z<m=Z=ddl>m?Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOdd lPZ@ejQdde@jRddddddgZSdZTd ZUe'jVrd!ZWd"ZXnd#ZWd$ZXd%ZYde,fd&YZZd'Z[d(Z\d)Z]d*Z^d+Z_deGfd,YZ`d-e`fd.YZaejbjcd/d0d1kreaZ`nd2Zdd3Zed4Zfd5Zgehd6Zid7Zjd8Zkd9ejlkrekZmn d:Zmd;d<Znd=Zod>Zpd?Zqydd@lmrZsWnetk rzdAZsnXdBZrdCeufdDYZvevjwZxdEevfdFYZydGezfdHYZ{dIe{fdJYZ|dKe|fdLYZ}e{j~Z~e{jZdMZdNZeeedOZdPZdQZehdRZe"jdSZd S(Ts% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html i(tglob(t get_platform(t convert_patht subst_vars(tDistutilsArgErrortDistutilsOptionErrortDistutilsErrortDistutilsPlatformError(tINSTALL_SCHEMESt SCHEME_KEYS(tlogtdir_util(t first_line_re(tfind_executableN(tsix(t configparsertmap(tCommand(t run_setup(tget_pathtget_config_vars(t rmtree_safe(tsetopt(tunpack_archive(t PackageIndextparse_requirement_argt URL_SCHEME(t bdist_eggtegg_info(tWheel(t yield_linestnormalize_pathtresource_stringtensure_directorytget_distributiontfind_distributionst Environmentt Requirementt Distributiont PathMetadatat EggMetadatat WorkingSettDistributionNotFoundtVersionConflictt DEVELOP_DISTtdefaulttcategorytsamefilet easy_installtPthDistributionstextract_wininst_cfgtmaintget_exe_prefixescCstjddkS(NtPi(tstructtcalcsize(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_64bitIscCstjj|o!tjj|}ttjdo9|}|rUtjj||Stjjtjj|}tjjtjj|}||kS(s Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. R/(tostpathtexiststhasattrR/tnormpathtnormcase(tp1tp2t both_existt use_samefiletnorm_p1tnorm_p2((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR/Ms$cCs|S(N((ts((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _to_ascii_scCs1ytj|dtSWntk r,tSXdS(Ntascii(Rt text_typetTruet UnicodeErrortFalse(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytisasciibs  cCs |jdS(NRG(tencode(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFjscCs.y|jdtSWntk r)tSXdS(NRG(RMRIRJRK(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRLms   cCstj|jjddS(Ns s; (ttextwraptdedenttstriptreplace(ttext((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytutcBsreZdZdZeZdddddddddddddddddddddgZdddd dd-d0d6d9g Ze j rd=e j Z ej d>de fej d>nidd'6ZeZd?Zd@ZdAZedBZdCZdDZdEZdFZdGZdHZdIZdJZdKZej dLj!Z"ej dMj!Z#ej dNj!Z$dOZ%dPZ&dQZ'dRZ(dSZ)dTZ*e+j,dUZ-e.dVZ/e.dWZ0dXZ1edYZ2dZZ3d[Z4d\Z5dd]Z6ed^Z7d_dd`Z8daZ9dbZ:dcZ;ddZ<deZ=dfZ>ej dgj!Z?ej dhZ@didjZAej dkj!ZBdlZCdmZDdnZEdoZFdpZGdqZHdrZIdsZJej dtj!ZKduZLdvZMdwZNeOdxeOdydzd{d|ZPeOdyd}d{d~ZQdZRRS(s'Manage a download/build/install processs Find/get/install Python packagessprefix=sinstallation prefixszip-oktzsinstall package as a zipfiles multi-versiontms%make apps have to require() a versiontupgradetUs1force upgrade (searches PyPI for latest versions)s install-dir=tdsinstall package to DIRs script-dir=REsinstall scripts to DIRsexclude-scriptstxsDon't install scriptss always-copytas'Copy all needed packages to install dirs index-url=tis base URL of Python Package Indexs find-links=tfs(additional URL(s) to search for packagessbuild-directory=tbs/download/extract/build in DIR; keep the resultss optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]srecord=s3filename in which to record list of installed filess always-unziptZs*don't install as a zipfile, no matter whats site-dirs=tSs)list of directories where .pth files workteditabletes+Install specified packages in editable formsno-depstNsdon't install dependenciess allow-hosts=tHs$pattern(s) that hostnames must matchslocal-snapshots-oktls(allow building eggs from local checkoutstversions"print version information and exits no-find-linkss9Don't load find-links defined in packages being installeds!install in user site-package '%s'tusercCsd|_d|_|_d|_|_|_d|_d|_d|_ d|_ d|_ |_ d|_ |_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tj rtj!|_"tj#|_$nd|_"d|_$d|_%d|_&d|_'|_(d|_)i|_*t+|_,d|_-|j.j/|_/|j.j0||j.j1ddS(NiR0(2RhtNonetzip_oktlocal_snapshots_okt install_dirt script_dirtexclude_scriptst index_urlt find_linkstbuild_directorytargstoptimizetrecordRWt always_copyt multi_versionRbtno_depst allow_hoststroottprefixt no_reportRgtinstall_purelibtinstall_platlibtinstall_headerst install_libtinstall_scriptst install_datat install_basetinstall_platbasetsitetENABLE_USER_SITEt USER_BASEtinstall_userbaset USER_SITEtinstall_usersitet no_find_linkst package_indextpth_filetalways_copy_fromt site_dirstinstalled_projectsRKtsitepy_installedt_dry_runt distributiontverboset_set_command_optionstget_option_dict(tself((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinitialize_optionssF                         cCs*d|D}tt|j|dS(Ncss9|]/}tjj|s-tjj|r|VqdS(N(R9R:R;tislink(t.0tfilename((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys s(tlistRt _delete_path(Rtblockerstextant_blockers((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytdelete_blockersscCsetjd||jrdStjj|o?tjj| }|rNtntj}||dS(Ns Deleting %s( R tinfotdry_runR9R:tisdirRtrmtreetunlink(RR:tis_treetremover((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs  %cCs=tjd }td}d}|jtGHtdS(sT Render the Setuptools version and installation details, then exit. it setuptoolss=setuptools {dist.version} from {dist.location} (Python {ver})N(tsysRgR"tformattlocalst SystemExit(tvertdistttmpl((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_render_versions   c Cs|jo|jtjjd}tdd\}}i |jjd6|jjd6|jjd6|d6|dd!d 6|d|d d 6|d 6|d6|d 6|d6t tddd6|_ t j r|j |j d<|j|j dt<|j;|_;d|j;kod knst=nWqt=k rt(d"qXn|j*r|j> rt?d#n|j@st?d$ng|_AdS()NiRzt exec_prefixt dist_namet dist_versiont dist_fullnamet py_versionitpy_version_shortitpy_version_nodott sys_prefixtsys_exec_prefixtabiflagsRTtuserbasetusersiteRlRmRqRRRtinstallRtt,s"%s (in --site-dirs) does not exists$ (in --site-dirs) is not on sys.pathshttps://pypi.python.org/simplet*t search_paththostsRss--optimize must be 0, 1, or 2s9Must specify a build directory (-b) when using --editables:No urls, filenames, or requirements specified (see --help)(RlRl(RlRm(RtRt(RsRs(BRgRRtsplitRRtget_namet get_versiont get_fullnametgetattrt config_varsRRRRt_fix_install_dir_for_user_sitetexpand_basedirst expand_dirst_expandRmRiRlRRKtset_undefined_optionsRhR|RRRR:t get_site_dirst all_site_dirsRR9t expanduserRPRR twarnRtappendRbtcheck_site_dirRot shadow_pathtinsertRxRt create_indexR$t local_indexRpt isinstanceRt string_typesRktscan_egg_linkstadd_find_linksRstintt ValueErrorRqRRrtoutputs( RRRzRR=RERRYt path_itemR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytfinalize_optionss          4    . !        cCs|j stj rdS|j|jdkrFd}t|n|j|_|_t j j ddd}|j |dS(s; Fix the install_dir if "--user" was used. Ns$User base directory is not specifiedtposixtunixt_user( RhRRtcreate_home_pathRRiRRRR9tnameRQt select_scheme(Rtmsgt scheme_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRms cCsx|D]y}t||}|dk rtjdksFtjdkr[tjj|}nt||j}t|||qqWdS(NRtnt( RRiR9RR:RRRtsetattr(Rtattrstattrtval((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _expand_attrs|s  cCs|jdddgdS(sNCalls `os.path.expanduser` on install_base, install_platbase and root.RRRyN(R(R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCs)ddddddg}|j|dS(s+Calls `os.path.expanduser` on install dirs.R|R}RR~RRN(R(Rtdirs((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs cCs|j|jjkr(tj|jnzx%|jD]}|j||j q5W|jr|j}|j rt |j }x/t t |D]}||||||jr dSx*tjj|D]}|j|q#WdS(N(Rnt ScriptWritertbesttget_argst write_script(RRRr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR)s cCspt|j}t||}|rS|j|t}tj||}n|j|t|ddS(s/Generate a legacy script wrapper and install itR^N( R6RRtis_python_scriptt_load_templateRRat get_headerRdRF(RRR*t script_texttdev_pathRt is_scripttbody((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR's cCs=d}|r!|jdd}ntd|}|jdS(s There are a couple of template scripts in the package. This function loads one of them and prepares it for use. s script.tmpls.tmpls (dev).tmplRsutf-8(RQR tdecode(RiRt raw_bytes((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRf&s ttc Cs|jg|D]}tjj|j|^q tjd||jtjj|j|}|j||jrzdSt }t |tjj |rtj |nt |d|}|j|WdQXt|d|dS(s1Write an executable file to the scripts directorysInstalling %s script to %sNRi(RR9R:RRmR RR/Rt current_umaskR!R;RRRtchmod( RR*R_tmodeRRZttargettmaskR]((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRd5s,    cCs|jjdr(|j||gS|jjdrP|j||gS|jjdrx|j||gS|}tjj|r|jd rt|||j n'tjj |rtjj |}n|j |r|j r|dk r|j|||}ntjj|d}tjj|sttjj|dd}|stdtjj |nt|dkrtd tjj |n|d }n|jrtj|j||gS|j||SdS( Ns.eggs.exes.whls.pyssetup.pyRs"Couldn't find a setup script in %sisMultiple setup scripts in %si(RRCt install_eggt install_exet install_wheelR9R:tisfileRtunpack_progressRtabspatht startswithRqRiR`RR;RRRRbR Rtreport_editabletbuild_and_install(RRR\R7R]t setup_scripttsetups((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyREIs<"  cCs[tjj|r3t|tjj|d}nttj|}tj |d|S(NsEGG-INFOtmetadata( R9R:RR'RR(t zipimportt zipimporterR&t from_filename(Rtegg_pathR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFus cCs%tjj|jtjj|}tjj|}|jsLt|n|j|}t ||s tjj |rtjj | rt j |d|jn2tjj|r|jtj|fd|nyt}tjj |r*|j|rtjd}}qtjd}}ng|j|rY|j||jd}}n8t}|j|rtjd}}ntjd}}|j|||f|dtjj|tjj|ft|d|Wq tk rt|dtq Xn|j||j|S(NRs Removing tMovingtCopyingt Extractings %s to %stfix_zipimporter_caches(R9R:RRlR!RyRR!RFR/RRR t remove_treeR;RRRKRzRZR[tcopytreeRXtmkpathtunpack_and_compileRItcopy2Rtupdate_dist_cachesRR/(RRR7t destinationRtnew_dist_is_zippedR]RV((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRt}sT   %      cCst|}|dkr+td|ntdd|jddd|jdddt}tjj||j d}||_ |d}tjj|d }tjj|d }t |t |||_ |j||tjj|st|d } | jd xU|jdD]D\} } | d kr*| jd| jddj| fq*q*W| jntjj|d} |jgtj|D]} tjj| | d^qtj||d|jd|j|j||S(Ns(%s is not a valid distutils Windows .exeRDRRRgtplatforms.eggs.tmpsEGG-INFOsPKG-INFORsMetadata-Version: 1.0 ttarget_versions%s: %s t_t-R$iRR(R2RiRR&tgetRR9R:Rtegg_nameR@R!R't _providert exe_to_eggR;RRtitemsRQttitleRRRaRcRt make_zipfileRRRt(RR\R7tcfgRRtegg_tmpt _egg_infotpkg_infR]tktvRmRr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRus<       0 3c st|ggifd}t||g}xD]}|jjdrV|jd}|d}tj|dd|d=%(version)s") # this version or higher s Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) t Installedc Csd}|jr\|j r\|d|j7}|jtttjkr\|d|j7}q\n|j }|j }|j }d}|t S(s9Helpful installation message for display to package userss %(what)s %(eggloc)s%(extras)ss RT( RvR{t_easy_install__mv_warningRlRRRR:t_easy_install__id_warningR@RDRgR( RtreqRtwhatRtegglocRRgtextras((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyROCs   sR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs-tjj|}tj}d|jtS(Ns (R9R:RRRt_easy_install__editable_msgR(RRR}Rtpython((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR{\s cCstjjdttjjdtt|}|jdkrid|jd}|jdd|n"|jdkr|jddn|jr|jdd nt j d |t |dd j |yt ||Wn-tk r}td |jdfnXdS( Nsdistutils.command.bdist_eggsdistutils.command.egg_infoiRiiRs-qs-ns Running %s %st sSetup script exited with %s(Rtmodulest setdefaultRRRRRRR RRRRRRRr(RR}R]RrR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas   $c Csddg}tjdddtjj|}z|jtjj||j||j|||t|g}g}x?|D]7}x.||D]"}|j|j |j |qWqW| r|j rt j d|n|SWdt|t j|jXdS(NRs --dist-dirRzs egg-dist-tmp-tdirs+No eggs found in %s (setup script problem?)(R3R4R9R:Rt_set_fetcher_optionsRRR$RtR@RR RRRR( RR}R]Rrtdist_dirtall_eggsteggsR1R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR|us$    $   c Cs|jjdj}d }i}xF|jD]8\}}||krOq1n|d||jdd egg path translations for a given .exe filesPURELIB/RTsPLATLIB/pywin32_system32sPLATLIB/sSCRIPTS/sEGG-INFO/scripts/sDATA/lib/site-packagesRiisPKG-INFOis .egg-infois EGG-INFO/s.pths -nspkg.pthtPURELIBtPLATLIBs\Rs%s/%s/N(sPURELIB/RT(sPLATLIB/pywin32_system32RT(sPLATLIB/RT(sSCRIPTS/sEGG-INFO/scripts/(sDATA/lib/site-packagesRT(R-R.(RtZipFiletinfolistRRRRCRRtupperRRtPY3RlRRPRQRzRRRtsorttreverse( t exe_filenameRRURRRR_tpthRZty((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR4s>  "#" 3 +  cBs\eZdZeZddZdZdZedZ dZ dZ dZ RS( s)A .pth file with Distribution paths in itcCs||_ttt||_ttjj|j|_|j t j |gddx6t |jD]%}tt|jt|tqoWdS(N(RRRRRR9R:Rtbasedirt_loadR$t__init__RiRRRMR#RI(RRRR:((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR:)s  cCsg|_t}tj|j}tjj|jr3t |jd}x|D]}|j drpt }qOn|j }|jj ||j sO|jj drqOnttjj|j|}|jdcCs7yt||dWnttfk r.tSXtSdS(s%Is this string a valid Python script?texecN(RUt SyntaxErrort TypeErrorRKRI(RRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt is_pythonqs cCsVy1tj|dd}|jd}WdQXWnttfk rK|SX|dkS(sCDetermine if the specified executable is a .sh (contains a #! line)Rslatin-1iNs#!(RRRRR(Rtfptmagic((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_sh{s cCstj|gS(s@Quote a command line argument according to Windows parsing rules(t subprocesst list2cmdline(RZ((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt nt_quote_argscCsb|jds|jdr"tSt||r5tS|jdr^d|jdjkStS(sMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. s.pys.pyws#!Ri(RCRIRxRzt splitlinesRRK(RhR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRes(RpcGsdS(N((Rr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_chmodscCsQtjd||yt||Wn&tjk rL}tjd|nXdS(Nschanging mode of %s to %oschmod failed: %s(R RRR9terror(R:RqRc((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRps t CommandSpeccBseZdZgZeZedZedZedZ edZ edZ dZ e dZdZe d Ze d ZRS( sm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S(sV Choose the best CommandSpec class based on environmental conditions. ((RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbscCs(tjjtj}tjjd|S(Nt__PYVENV_LAUNCHER__(R9R:R=RRRR(RNt_default((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_sys_executablescCsOt||r|St|tr,||S|dkrB|jS|j|S(sg Construct a CommandSpec from a parameter to build_scripts, which may be None. N(RRRitfrom_environmentt from_string(RNtparam((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt from_params   cCs||jgS(N(R(RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCstj||j}||S(s} Construct a command spec from a simple string representing a command line parseable by shlex.split. (tshlexRt split_args(RNtstringR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCsMtj|j||_tj|}t|sIdg|jd*ndS(Ns-xi(RRt_extract_optionstoptionsR|R}RL(RRhtcmdline((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinstall_optionss cCsQ|djd}tj|}|rA|jdpDdnd}|jS(sH Extract any options from the first line of the script. s iiRT(RRVtmatchtgroupRP(t orig_scripttfirstRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs!cCs|j|t|jS(N(t_renderRR(R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt as_headerscCsDd}x7|D]/}|j|r |j|r |dd!Sq W|S(Ns"'ii(RzRC(titemt_QUOTEStq((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _strip_quotess  cCs%tjd|D}d|dS(Ncss$|]}tj|jVqdS(N(RRRP(RR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys ss#!s (R|R}(RR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs(RRRRRRRORbRRRRRRRRRR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs   tWindowsCommandSpeccBseZedeZRS(R(RRRRKR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRsRacBseZdZejdjZeZe d e dZ e d e dZ e d dZedZe dZe dZe dZe d d d ZRS( s` Encapsulates behavior around writing entry point scripts for console and gui apps. s # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) cCsMtjdt|rtntj}|jd||}|j||S(Ns Use get_argsRT(twarningsRtDeprecationWarningtWindowsScriptWriterRaRbtget_script_headerRc(RNRRtwininsttwritertheader((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytget_script_argsscCsNtjdt|rd}n|jjj|}|j||jS(NsUse get_headers python.exe(RRRtcommand_spec_classRbRRR(RNRhRRtcmd((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR!s   c cs|dkr|j}nt|j}xdD]}|d}xn|j|jD]W\}}|j||jt}|j ||||} x| D] } | VqWqZWq4WdS(s Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. tconsoletguit_scriptsN(RR( RiRgR6RRt get_entry_mapRt_ensure_safe_nameRRt_get_script_args( RNRRRttype_RRtepRhRrR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRc+s   "  cCs+tjd|}|r'tdndS(s? Prevent paths in *_scripts entry point names. s[\\/]s+Path separators not allowed in script namesN(RTtsearchR(Rt has_path_sep((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR=scCs*tjdt|r tjS|jS(NsUse best(RRRRRb(RNt force_windows((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt get_writerFscCs?tjdks-tjdkr7tjdkr7tjS|SdS(sD Select the best ScriptWriter for this environment. twin32tjavaRN(RRR9Rt_nameRRb(RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbLs- ccs|||fVdS(N((RNRRRRh((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRVsRTcCs/|jjj|}|j||jS(s;Create a #! line, getting options (if any) from script_text(RRbRRR(RNRhRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRg[s N(RRRRNRORRRRRORiRKRRRcRRRRbRRg(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas     RcBsYeZeZedZedZedZedZe dZ RS(cCstjdt|jS(NsUse best(RRRRb(RN((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRfscCs2tdtd|}tjjdd}||S(sC Select the best ScriptWriter suitable for Windows RtnaturaltSETUPTOOLS_LAUNCHER(RtWindowsExecutableLauncherWriterR9RR(RNt writer_lookuptlauncher((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbls  c cstdddd|}|tjdjjdkr`djt}tj|t nddd d d dd g}|j ||j ||}g|D]}||^q} ||||d | fVdS(s For Windows, add a .py extensionRs.pyaRs.pywtPATHEXTt;sK{ext} not listed in PATHEXT; scripts will not be recognized as executables.s.pys -script.pys.pycs.pyos.exeRnN( RR9RRRRRRRt UserWarningRNt_adjust_header( RNRRRRhtextRRRZR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRys"  cCsud}d}|dkr(||}}ntjtj|tj}|jd|d|}|j|rq|S|S(s Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). s pythonw.exes python.exeRRtrepl(RTRUtescapet IGNORECASEtsubt _use_header(RNRt orig_headerRSRt pattern_obt new_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs cCs/|dd!jd}tjdkp.t|S(s Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. iit"R(RPRRR (Rt clean_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs ( RRRRRORRbRRRR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRcs  RcBseZedZRS(c cs|dkr$d}d}dg}nd}d}dddg}|j||}g|D]} || ^qX} ||||d | fV|d t|d fVts|d } | t|d fVnd S(sG For Windows, add a .py extension and an .exe launcher Rs -script.pyws.pywtclis -script.pys.pys.pycs.pyoRns.exeR^s .exe.manifestN(Rtget_win_launcherR8tload_launcher_manifest( RNRRRRht launcher_typeRRthdrRZRtm_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs    (RRROR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCsGd|}tr(|jdd}n|jdd}td|S(s Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. s%s.exet.s-64.s-32.R(R8RQR (ttypet launcher_fn((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs   cCs>tjtd}tjr&|tS|jdtSdS(Nslauncher manifest.xmlsutf-8(RR RRtPY2tvarsRl(Rtmanifest((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs  cCstj|||S(N(RZR(R:t ignore_errorstonerror((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCs tjd}tj||S(Ni(R9tumask(ttmp((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRos cCsMddl}tjj|jd}|tjd s"                 d             A ) ) 'l   R          T `A      PK! 99command/easy_install.pyonu[ fc@sedZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4m<Z<m=Z=ddl>m?Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOdd lPZ@ejQdde@jRddddddgZSdZTd ZUe'jVrd!ZWd"ZXnd#ZWd$ZXd%ZYde,fd&YZZd'Z[d(Z\d)Z]d*Z^d+Z_deGfd,YZ`d-e`fd.YZaejbjcd/d0d1kreaZ`nd2Zdd3Zed4Zfd5Zgehd6Zid7Zjd8Zkd9ejlkrekZmn d:Zmd;d<Znd=Zod>Zpd?Zqydd@lmrZsWnetk rzdAZsnXdBZrdCeufdDYZvevjwZxdEevfdFYZydGezfdHYZ{dIe{fdJYZ|dKe|fdLYZ}e{j~Z~e{jZdMZdNZeeedOZdPZdQZehdRZe"jdSZd S(Ts% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html i(tglob(t get_platform(t convert_patht subst_vars(tDistutilsArgErrortDistutilsOptionErrortDistutilsErrortDistutilsPlatformError(tINSTALL_SCHEMESt SCHEME_KEYS(tlogtdir_util(t first_line_re(tfind_executableN(tsix(t configparsertmap(tCommand(t run_setup(tget_pathtget_config_vars(t rmtree_safe(tsetopt(tunpack_archive(t PackageIndextparse_requirement_argt URL_SCHEME(t bdist_eggtegg_info(tWheel(t yield_linestnormalize_pathtresource_stringtensure_directorytget_distributiontfind_distributionst Environmentt Requirementt Distributiont PathMetadatat EggMetadatat WorkingSettDistributionNotFoundtVersionConflictt DEVELOP_DISTtdefaulttcategorytsamefilet easy_installtPthDistributionstextract_wininst_cfgtmaintget_exe_prefixescCstjddkS(NtPi(tstructtcalcsize(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_64bitIscCstjj|o!tjj|}ttjdo9|}|rUtjj||Stjjtjj|}tjjtjj|}||kS(s Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. R/(tostpathtexiststhasattrR/tnormpathtnormcase(tp1tp2t both_existt use_samefiletnorm_p1tnorm_p2((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR/Ms$cCs|S(N((ts((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _to_ascii_scCs1ytj|dtSWntk r,tSXdS(Ntascii(Rt text_typetTruet UnicodeErrortFalse(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytisasciibs  cCs |jdS(NRG(tencode(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFjscCs.y|jdtSWntk r)tSXdS(NRG(RMRIRJRK(RE((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRLms   cCstj|jjddS(Ns s; (ttextwraptdedenttstriptreplace(ttext((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytutcBsreZdZdZeZdddddddddddddddddddddgZdddd dd-d0d6d9g Ze j rd=e j Z ej d>de fej d>nidd'6ZeZd?Zd@ZdAZedBZdCZdDZdEZdFZdGZdHZdIZdJZdKZej dLj!Z"ej dMj!Z#ej dNj!Z$dOZ%dPZ&dQZ'dRZ(dSZ)dTZ*e+j,dUZ-e.dVZ/e.dWZ0dXZ1edYZ2dZZ3d[Z4d\Z5dd]Z6ed^Z7d_dd`Z8daZ9dbZ:dcZ;ddZ<deZ=dfZ>ej dgj!Z?ej dhZ@didjZAej dkj!ZBdlZCdmZDdnZEdoZFdpZGdqZHdrZIdsZJej dtj!ZKduZLdvZMdwZNeOdxeOdydzd{d|ZPeOdyd}d{d~ZQdZRRS(s'Manage a download/build/install processs Find/get/install Python packagessprefix=sinstallation prefixszip-oktzsinstall package as a zipfiles multi-versiontms%make apps have to require() a versiontupgradetUs1force upgrade (searches PyPI for latest versions)s install-dir=tdsinstall package to DIRs script-dir=REsinstall scripts to DIRsexclude-scriptstxsDon't install scriptss always-copytas'Copy all needed packages to install dirs index-url=tis base URL of Python Package Indexs find-links=tfs(additional URL(s) to search for packagessbuild-directory=tbs/download/extract/build in DIR; keep the resultss optimize=tOslalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]srecord=s3filename in which to record list of installed filess always-unziptZs*don't install as a zipfile, no matter whats site-dirs=tSs)list of directories where .pth files workteditabletes+Install specified packages in editable formsno-depstNsdon't install dependenciess allow-hosts=tHs$pattern(s) that hostnames must matchslocal-snapshots-oktls(allow building eggs from local checkoutstversions"print version information and exits no-find-linkss9Don't load find-links defined in packages being installeds!install in user site-package '%s'tusercCsd|_d|_|_d|_|_|_d|_d|_d|_ d|_ d|_ |_ d|_ |_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tj rtj!|_"tj#|_$nd|_"d|_$d|_%d|_&d|_'|_(d|_)i|_*t+|_,d|_-|j.j/|_/|j.j0||j.j1ddS(NiR0(2RhtNonetzip_oktlocal_snapshots_okt install_dirt script_dirtexclude_scriptst index_urlt find_linkstbuild_directorytargstoptimizetrecordRWt always_copyt multi_versionRbtno_depst allow_hoststroottprefixt no_reportRgtinstall_purelibtinstall_platlibtinstall_headerst install_libtinstall_scriptst install_datat install_basetinstall_platbasetsitetENABLE_USER_SITEt USER_BASEtinstall_userbaset USER_SITEtinstall_usersitet no_find_linkst package_indextpth_filetalways_copy_fromt site_dirstinstalled_projectsRKtsitepy_installedt_dry_runt distributiontverboset_set_command_optionstget_option_dict(tself((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinitialize_optionssF                         cCs*d|D}tt|j|dS(Ncss9|]/}tjj|s-tjj|r|VqdS(N(R9R:R;tislink(t.0tfilename((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys s(tlistRt _delete_path(Rtblockerstextant_blockers((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytdelete_blockersscCsetjd||jrdStjj|o?tjj| }|rNtntj}||dS(Ns Deleting %s( R tinfotdry_runR9R:tisdirRtrmtreetunlink(RR:tis_treetremover((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs  %cCs=tjd }td}d}|jtGHtdS(sT Render the Setuptools version and installation details, then exit. it setuptoolss=setuptools {dist.version} from {dist.location} (Python {ver})N(tsysRgR"tformattlocalst SystemExit(tvertdistttmpl((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_render_versions   c Cs|jo|jtjjd}tdd\}}i |jjd6|jjd6|jjd6|d6|dd!d 6|d|d d 6|d 6|d6|d 6|d6t tddd6|_ t j r|j |j d<|j|j dt<|j;|_;d|j;kod knst=nWqt=k rt(d"qXn|j*r|j> rt?d#n|j@st?d$ng|_AdS()NiRzt exec_prefixt dist_namet dist_versiont dist_fullnamet py_versionitpy_version_shortitpy_version_nodott sys_prefixtsys_exec_prefixtabiflagsRTtuserbasetusersiteRlRmRqRRRtinstallRtt,s"%s (in --site-dirs) does not exists$ (in --site-dirs) is not on sys.pathshttps://pypi.python.org/simplet*t search_paththostsRss--optimize must be 0, 1, or 2s9Must specify a build directory (-b) when using --editables:No urls, filenames, or requirements specified (see --help)(RlRl(RlRm(RtRt(RsRs(BRgRRtsplitRRtget_namet get_versiont get_fullnametgetattrt config_varsRRRRt_fix_install_dir_for_user_sitetexpand_basedirst expand_dirst_expandRmRiRlRRKtset_undefined_optionsRhR|RRRR:t get_site_dirst all_site_dirsRR9t expanduserRPRR twarnRtappendRbtcheck_site_dirRot shadow_pathtinsertRxRt create_indexR$t local_indexRpt isinstanceRt string_typesRktscan_egg_linkstadd_find_linksRstintt ValueErrorRqRRrtoutputs( RRRzRR=RERRYt path_itemR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytfinalize_optionss          4    . !        cCs|j stj rdS|j|jdkrFd}t|n|j|_|_t j j ddd}|j |dS(s; Fix the install_dir if "--user" was used. Ns$User base directory is not specifiedtposixtunixt_user( RhRRtcreate_home_pathRRiRRRR9tnameRQt select_scheme(Rtmsgt scheme_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRms cCsx|D]y}t||}|dk rtjdksFtjdkr[tjj|}nt||j}t|||qqWdS(NRtnt( RRiR9RR:RRRtsetattr(Rtattrstattrtval((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _expand_attrs|s  cCs|jdddgdS(sNCalls `os.path.expanduser` on install_base, install_platbase and root.RRRyN(R(R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCs)ddddddg}|j|dS(s+Calls `os.path.expanduser` on install dirs.R|R}RR~RRN(R(Rtdirs((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs cCs|j|jjkr(tj|jnzx%|jD]}|j||j q5W|jr|j}|j rt |j }x/t t |D]}||||||jr dSx*tjj|D]}|j|q#WdS(N(Rnt ScriptWritertbesttget_argst write_script(RRRr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR)s cCspt|j}t||}|rS|j|t}tj||}n|j|t|ddS(s/Generate a legacy script wrapper and install itR^N( R6RRtis_python_scriptt_load_templateRRat get_headerRdRF(RRR*t script_texttdev_pathRt is_scripttbody((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR's cCs=d}|r!|jdd}ntd|}|jdS(s There are a couple of template scripts in the package. This function loads one of them and prepares it for use. s script.tmpls.tmpls (dev).tmplRsutf-8(RQR tdecode(RiRt raw_bytes((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRf&s ttc Cs|jg|D]}tjj|j|^q tjd||jtjj|j|}|j||jrzdSt }t |tjj |rtj |nt |d|}|j|WdQXt|d|dS(s1Write an executable file to the scripts directorysInstalling %s script to %sNRi(RR9R:RRmR RR/Rt current_umaskR!R;RRRtchmod( RR*R_tmodeRRZttargettmaskR]((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRd5s,    cCs|jjdr(|j||gS|jjdrP|j||gS|jjdrx|j||gS|}tjj|r|jd rt|||j n'tjj |rtjj |}n|j |r|j r|dk r|j|||}ntjj|d}tjj|sttjj|dd}|stdtjj |nt|dkrtd tjj |n|d }n|jrtj|j||gS|j||SdS( Ns.eggs.exes.whls.pyssetup.pyRs"Couldn't find a setup script in %sisMultiple setup scripts in %si(RRCt install_eggt install_exet install_wheelR9R:tisfileRtunpack_progressRtabspatht startswithRqRiR`RR;RRRRbR Rtreport_editabletbuild_and_install(RRR\R7R]t setup_scripttsetups((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyREIs<"  cCs[tjj|r3t|tjj|d}nttj|}tj |d|S(NsEGG-INFOtmetadata( R9R:RR'RR(t zipimportt zipimporterR&t from_filename(Rtegg_pathR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRFus cCs%tjj|jtjj|}tjj|}|jsLt|n|j|}t ||s tjj |rtjj | rt j |d|jn2tjj|r|jtj|fd|nyt}tjj |r*|j|rtjd}}qtjd}}ng|j|rY|j||jd}}n8t}|j|rtjd}}ntjd}}|j|||f|dtjj|tjj|ft|d|Wq tk rt|dtq Xn|j||j|S(NRs Removing tMovingtCopyingt Extractings %s to %stfix_zipimporter_caches(R9R:RRlR!RyRR!RFR/RRR t remove_treeR;RRRKRzRZR[tcopytreeRXtmkpathtunpack_and_compileRItcopy2Rtupdate_dist_cachesRR/(RRR7t destinationRtnew_dist_is_zippedR]RV((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRt}sT   %      cCst|}|dkr+td|ntdd|jddd|jdddt}tjj||j d}||_ |d}tjj|d }tjj|d }t |t |||_ |j||tjj|st|d } | jd xU|jdD]D\} } | d kr*| jd| jddj| fq*q*W| jntjj|d} |jgtj|D]} tjj| | d^qtj||d|jd|j|j||S(Ns(%s is not a valid distutils Windows .exeRDRRRgtplatforms.eggs.tmpsEGG-INFOsPKG-INFORsMetadata-Version: 1.0 ttarget_versions%s: %s t_t-R$iRR(R2RiRR&tgetRR9R:Rtegg_nameR@R!R't _providert exe_to_eggR;RRtitemsRQttitleRRRaRcRt make_zipfileRRRt(RR\R7tcfgRRtegg_tmpt _egg_infotpkg_infR]tktvRmRr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRus<       0 3c st|ggifd}t||g}xD]}|jjdrV|jd}|d}tj|dd|d=%(version)s") # this version or higher s Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) t Installedc Csd}|jr\|j r\|d|j7}|jtttjkr\|d|j7}q\n|j }|j }|j }d}|t S(s9Helpful installation message for display to package userss %(what)s %(eggloc)s%(extras)ss RT( RvR{t_easy_install__mv_warningRlRRRR:t_easy_install__id_warningR@RDRgR( RtreqRtwhatRtegglocRRgtextras((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyROCs   sR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs-tjj|}tj}d|jtS(Ns (R9R:RRRt_easy_install__editable_msgR(RRR}Rtpython((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR{\s cCstjjdttjjdtt|}|jdkrid|jd}|jdd|n"|jdkr|jddn|jr|jdd nt j d |t |dd j |yt ||Wn-tk r}td |jdfnXdS( Nsdistutils.command.bdist_eggsdistutils.command.egg_infoiRiiRs-qs-ns Running %s %st sSetup script exited with %s(Rtmodulest setdefaultRRRRRRR RRRRRRRr(RR}R]RrR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas   $c Csddg}tjdddtjj|}z|jtjj||j||j|||t|g}g}x?|D]7}x.||D]"}|j|j |j |qWqW| r|j rt j d|n|SWdt|t j|jXdS(NRs --dist-dirRzs egg-dist-tmp-tdirs+No eggs found in %s (setup script problem?)(R3R4R9R:Rt_set_fetcher_optionsRRR$RtR@RR RRRR( RR}R]Rrtdist_dirtall_eggsteggsR1R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR|us$    $   c Cs|jjdj}d }i}xF|jD]8\}}||krOq1n|d||jdd egg path translations for a given .exe filesPURELIB/RTsPLATLIB/pywin32_system32sPLATLIB/sSCRIPTS/sEGG-INFO/scripts/sDATA/lib/site-packagesRiisPKG-INFOis .egg-infois EGG-INFO/s.pths -nspkg.pthtPURELIBtPLATLIBs\Rs%s/%s/N(sPURELIB/RT(sPLATLIB/pywin32_system32RT(sPLATLIB/RT(sSCRIPTS/sEGG-INFO/scripts/(sDATA/lib/site-packagesRT(R+R,(RtZipFiletinfolistRRRRCRRtupperRRtPY3RlRRPRQRzRRRtsorttreverse( t exe_filenameRRURRRR_tpthRZty((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR4s>  "#" 3 +  cBs\eZdZeZddZdZdZedZ dZ dZ dZ RS( s)A .pth file with Distribution paths in itcCs||_ttt||_ttjj|j|_|j t j |gddx6t |jD]%}tt|jt|tqoWdS(N(RRRRR R9R:Rtbasedirt_loadR$t__init__RiRRRMR#RI(RRR R:((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR8)s  cCsg|_t}tj|j}tjj|jr3t |jd}x|D]}|j drpt }qOn|j }|jj ||j sO|jj drqOnttjj|j|}|jdcCs7yt||dWnttfk r.tSXtSdS(s%Is this string a valid Python script?texecN(RSt SyntaxErrort TypeErrorRKRI(RRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt is_pythonqs cCsVy1tj|dd}|jd}WdQXWnttfk rK|SX|dkS(sCDetermine if the specified executable is a .sh (contains a #! line)Rslatin-1iNs#!(RRRRR(Rtfptmagic((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytis_sh{s cCstj|gS(s@Quote a command line argument according to Windows parsing rules(t subprocesst list2cmdline(RX((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt nt_quote_argscCsb|jds|jdr"tSt||r5tS|jdr^d|jdjkStS(sMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. s.pys.pyws#!Ri(RCRIRvRzt splitlinesRRK(RhR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRes(RpcGsdS(N((Rr((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_chmodscCsQtjd||yt||Wn&tjk rL}tjd|nXdS(Nschanging mode of %s to %oschmod failed: %s(R RR~R9terror(R:RqRc((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRps t CommandSpeccBseZdZgZeZedZedZedZ edZ edZ dZ e dZdZe d Ze d ZRS( sm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S(sV Choose the best CommandSpec class based on environmental conditions. ((RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbscCs(tjjtj}tjjd|S(Nt__PYVENV_LAUNCHER__(R9R:R=RRRR(RLt_default((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt_sys_executablescCsOt||r|St|tr,||S|dkrB|jS|j|S(sg Construct a CommandSpec from a parameter to build_scripts, which may be None. N(RRRitfrom_environmentt from_string(RLtparam((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt from_params   cCs||jgS(N(R(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCstj||j}||S(s} Construct a command spec from a simple string representing a command line parseable by shlex.split. (tshlexRt split_args(RLtstringR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCsMtj|j||_tj|}t|sIdg|jd*ndS(Ns-xi(RRt_extract_optionstoptionsRzR{RL(RRhtcmdline((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytinstall_optionss cCsQ|djd}tj|}|rA|jdpDdnd}|jS(sH Extract any options from the first line of the script. s iiRT(R}RTtmatchtgroupRP(t orig_scripttfirstRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs!cCs|j|t|jS(N(t_renderRR(R((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt as_headerscCsDd}x7|D]/}|j|r |j|r |dd!Sq W|S(Ns"'ii(RzRC(titemt_QUOTEStq((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt _strip_quotess  cCs%tjd|D}d|dS(Ncss$|]}tj|jVqdS(N(RRRP(RR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pys ss#!s (RzR{(RR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs(RRRRRRRMRbRRRRRRRRRR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs   tWindowsCommandSpeccBseZedeZRS(R(RRRRKR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRsRacBseZdZejdjZeZe d e dZ e d e dZ e d dZedZe dZe dZe dZe d d d ZRS( s` Encapsulates behavior around writing entry point scripts for console and gui apps. s # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) cCsMtjdt|rtntj}|jd||}|j||S(Ns Use get_argsRT(twarningsRtDeprecationWarningtWindowsScriptWriterRaRbtget_script_headerRc(RLRRtwininsttwritertheader((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pytget_script_argsscCsNtjdt|rd}n|jjj|}|j||jS(NsUse get_headers python.exe(RRRtcommand_spec_classRbRRR(RLRhRRtcmd((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR!s   c cs|dkr|j}nt|j}xdD]}|d}xn|j|jD]W\}}|j||jt}|j ||||} x| D] } | VqWqZWq4WdS(s Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. tconsoletguit_scriptsN(RR( RiRgR6RRt get_entry_mapRt_ensure_safe_nameRRt_get_script_args( RLRRRttype_RRtepRhRrR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRc+s   "  cCs+tjd|}|r'tdndS(s? Prevent paths in *_scripts entry point names. s[\\/]s+Path separators not allowed in script namesN(RRtsearchR(Rt has_path_sep((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyR=scCs*tjdt|r tjS|jS(NsUse best(RRRRRb(RLt force_windows((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyt get_writerFscCs?tjdks-tjdkr7tjdkr7tjS|SdS(sD Select the best ScriptWriter for this environment. twin32tjavaRN(RRR9Rt_nameRRb(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbLs- ccs|||fVdS(N((RLRRRRh((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRVsRTcCs/|jjj|}|j||jS(s;Create a #! line, getting options (if any) from script_text(RRbRRR(RLRhRR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRg[s N(RRRRNRORRRRRMRiRKRRRcRRRRbRRg(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRas     RcBsYeZeZedZedZedZedZe dZ RS(cCstjdt|jS(NsUse best(RRRRb(RL((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRfscCs2tdtd|}tjjdd}||S(sC Select the best ScriptWriter suitable for Windows RtnaturaltSETUPTOOLS_LAUNCHER(RtWindowsExecutableLauncherWriterR9RR(RLt writer_lookuptlauncher((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRbls  c cstdddd|}|tjdjjdkr`djt}tj|t nddd d d dd g}|j ||j ||}g|D]}||^q} ||||d | fVdS(s For Windows, add a .py extensionRs.pyaRs.pywtPATHEXTt;sK{ext} not listed in PATHEXT; scripts will not be recognized as executables.s.pys -script.pys.pycs.pyos.exeRnN( RR9RRRRRRRt UserWarningRNt_adjust_header( RLRRRRhtextRRRZR((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRys"  cCsud}d}|dkr(||}}ntjtj|tj}|jd|d|}|j|rq|S|S(s Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). s pythonw.exes python.exeRRtrepl(RRRStescapet IGNORECASEtsubt _use_header(RLRt orig_headerRQRt pattern_obt new_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs cCs/|dd!jd}tjdkp.t|S(s Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. iit"R(RPRRR (Rt clean_header((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs ( RRRRRMRRbRRRR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRcs  RcBseZedZRS(c cs|dkr$d}d}dg}nd}d}dddg}|j||}g|D]} || ^qX} ||||d | fV|d t|d fVts|d } | t|d fVnd S(sG For Windows, add a .py extension and an .exe launcher Rs -script.pyws.pywtclis -script.pys.pys.pycs.pyoRns.exeR^s .exe.manifestN(Rtget_win_launcherR8tload_launcher_manifest( RLRRRRht launcher_typeRRthdrRZRtm_name((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs    (RRRMR(((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCsGd|}tr(|jdd}n|jdd}td|S(s Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. s%s.exet.s-64.s-32.R(R8RQR (ttypet launcher_fn((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs   cCs>tjtd}tjr&|tS|jdtSdS(Nslauncher manifest.xmlsutf-8(RR RRtPY2tvarsRl(Rtmanifest((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRs  cCstj|||S(N(RZR(R:t ignore_errorstonerror((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRscCs tjd}tj||S(Ni(R9tumask(ttmp((sC/usr/lib/python2.7/site-packages/setuptools/command/easy_install.pyRos cCsMddl}tjj|jd}|tjd s"                 d             A ) ) 'l   R          T `A      PK!Pz{U  command/alias.pycnu[ fc@shddlmZddlmZddlmZmZmZdZdefdYZ dZ dS( i(tDistutilsOptionError(tmap(t edit_configt option_baset config_filecCsJx$dD]}||krt|SqW|j|gkrFt|S|S(s4Quote an argument for later parsing by shlex.split()t"t's\t#(RRs\R(treprtsplit(targtc((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pytshquotes    taliascBsUeZdZdZeZdgejZejdgZdZ dZ dZ RS( s3Define a shortcut that invokes one or more commandss0define a shortcut to invoke one or more commandstremovetrsremove (unset) the aliascCs#tj|d|_d|_dS(N(Rtinitialize_optionstNonetargsR(tself((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyRs  cCs>tj||jr:t|jdkr:tdndS(NisFMust specify exactly one argument (the alias name) when using --remove(Rtfinalize_optionsRtlenRR(R((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyR#s cCs |jjd}|jsNdGHdGHx"|D]}dt||fGHq,WdSt|jdkr|j\}|jrd}q||krdt||fGHdSd|GHdSn,|jd}djtt |jd}t |j ii||6d6|j dS( NtaliasessCommand Aliasess---------------ssetup.py aliasis No alias definition found for %rit ( t distributiontget_option_dictRt format_aliasRRRtjoinRR Rtfilenametdry_run(RRR tcommand((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pytrun+s&        (RRsremove (unset) the alias( t__name__t __module__t__doc__t descriptiontTruetcommand_consumes_argumentsRt user_optionstboolean_optionsRRR(((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyR s   cCs{||\}}|tdkr+d}n@|tdkrFd}n%|tdkrad}n d|}||d|S( Ntglobals--global-config tusers--user-config tlocalts --filename=%rR(R(tnameRtsourceR((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyRFs    N( tdistutils.errorsRtsetuptools.extern.six.movesRtsetuptools.command.setoptRRRR R R(((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyts  4PK!500command/build_ext.pyonu[ fc @s%ddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZddlmZddlmZdd lmZyddlmZed Wnek reZnXe d dd l mZd ZeZeZdZ ej!dkr;e"ZnIej#dkry#ddl$Z$e%e$dZZWqek rqXndZ&dZ'defdYZesej#dkrddddddddddd Z)n-dZ ddddddddddd Z)dZ*dS(iN(t build_ext(t copy_file(t new_compiler(tcustomize_compilertget_config_var(tDistutilsError(tlog(tLibrary(tsixsCython.Compiler.MaintLDSHARED(t _config_varscCsstjdkretj}z,dtd>RcCsNxGdtjDD]/\}}}d|kr6|S|dkr|SqWdS(s;Return the file extension for an abi3-compliant Extension()css(|]}|dtjkr|VqdS(iN(timpt C_EXTENSION(t.0R((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys Css.abi3s.pydN(Rt get_suffixes(tsuffixt_((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytget_abi3_suffixAs &  RcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z ed ZRS( cCs@|jd}|_tj|||_|r<|jndS(s;Build extensions in build directory, then copy if --inplaceiN(tinplacet _build_exttruntcopy_extensions_to_source(tselft old_inplace((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR'Ks   c Cs|jd}x|jD]}|j|j}|j|}|jd}dj|d }|j|}tj j|tj j |}tj j|j |} t | |d|j d|j|jr|j|ptj|tqqWdS(Ntbuild_pyt.itverbosetdry_run(tget_finalized_commandt extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet build_libRR-R.t _needs_stubt write_stubtcurdirtTrue( R)R+texttfullnametfilenametmodpathtpackaget package_dirt dest_filenamet src_filename((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR(Ss   cCstj||}||jkr|j|}tjoLt|doLt}|rtd}|t| }|t}nt |t rt j j |\}}|jj|tStr|jrt j j|\}}t j j|d|Sn|S(Ntpy_limited_apit EXT_SUFFIXsdl-(R&R3text_mapRtPY3tgetattrR$t_get_config_var_837tlent isinstanceRR7R8tsplitexttshlib_compilertlibrary_filenametlibtypet use_stubst_links_to_dynamicR4R5(R)R@RAR?tuse_abi3tso_exttfntd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR3is"    cCs,tj|d|_g|_i|_dS(N(R&tinitialize_optionstNoneRPtshlibsRI(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRY~s   cCstj||jpg|_|j|jg|jD]}t|tr9|^q9|_|jrs|jnx&|jD]}|j|j |_ q}Wx#|jD]}|j }||j |<||j |j dd<|jr|j |pt}|otot|t }||_||_|j|}|_tjjtjj|j|}|r||jkr|jj|n|rtrtj|jkr|jjtjqqWdS(NR,i(R&tfinalize_optionsR0tcheck_extensions_listRNRR[tsetup_shlib_compilerR1R2t _full_nameRIR4tlinks_to_dynamictFalseRSRTR;R3t _file_nameR7R8tdirnameR5R:t library_dirstappendR=truntime_library_dirs(R)R?R@tltdtnsRAtlibdir((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR\s.       $cCsdtd|jd|jd|j}|_t||jdk rW|j|jn|j dk rx*|j D]\}}|j ||qpWn|j dk rx!|j D]}|j |qWn|j dk r|j|j n|jdk r |j|jn|jdk r,|j|jn|jdk rN|j|jntj||_dS(NRR.tforce(RRR.RjRPRt include_dirsRZtset_include_dirstdefinet define_macrotundeftundefine_macrot librariest set_librariesRdtset_library_dirstrpathtset_runtime_library_dirst link_objectstset_link_objectstlink_shared_objectt__get__(R)RR2tvaluetmacro((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR^s(% cCs&t|tr|jStj||S(N(RNRtexport_symbolsR&tget_export_symbols(R)R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR}scCs|j|j}z`t|tr4|j|_ntj|||jrr|jdj }|j ||nWd||_XdS(NR+( t_convert_pyx_sources_to_langRRNRRPR&tbuild_extensionR;R/R:R<(R)R?t _compilertcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRs   csntjg|jD]}|j^qdj|jjdd dgtfd|jDS(s?Return true if 'ext' links to a dynamic lib in the same packageR,iRc3s|]}|kVqdS(N((R tlibname(tlibnamestpkg(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys s(tdicttfromkeysR[R_R5R4tanyRq(R)R?tlib((RRs@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR`s(&cCstj||jS(N(R&t get_outputst_build_ext__get_stubs_outputs(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRscsEfdjD}tj|j}td|DS(Nc3s<|]2}|jrtjjj|jjdVqdS(R,N(R;R7R8R5R:R_R4(R R?(R)(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys scss|]\}}||VqdS(N((R tbasetfnext((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys s(R0t itertoolstproductt!_build_ext__get_output_extensionstlist(R)t ns_ext_basestpairs((R)s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_stubs_outputss  ccs(dVdV|jdjr$dVndS(Ns.pys.pycR+s.pyo(R/toptimize(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_output_extensionsscCstjd|j|tjj||jjdd}|rftjj|rft|dn|j st |d}|j djddd t d d tjj |jd d dt ddddt dddt ddddg|jn|rddlm}||gdddtd|j |jd j}|dkr||gd|dtd|j ntjj|r|j rtj|qndS(!Ns writing stub loader for %s to %sR,s.pys already exists! Please delete.tws sdef __bootstrap__():s- global __bootstrap__, __file__, __loader__s% import sys, os, pkg_resources, imps, dls: __file__ = pkg_resources.resource_filename(__name__,%r)s del __bootstrap__s if '__loader__' in globals():s del __loader__s# old_flags = sys.getdlopenflags()s old_dir = os.getcwd()s try:s( os.chdir(os.path.dirname(__file__))s$ sys.setdlopenflags(dl.RTLD_NOW)s( imp.load_dynamic(__name__,__file__)s finally:s" sys.setdlopenflags(old_flags)s os.chdir(old_dir)s__bootstrap__()Ri(t byte_compileRiRjR.t install_lib(RtinfoR_R7R8R5R4texistsRR.topentwritetif_dlR9Rbtclosetdistutils.utilRR>R/Rtunlink(R)t output_dirR?tcompilet stub_filetfRR((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR<sP        (t__name__t __module__R'R(R3RYR\R^R}RR`RRRRaR<(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRJs         ic Cs8|j|j||||||||| | | | dS(N(tlinktSHARED_LIBRARY( R)tobjectstoutput_libnameRRqRdRfR|tdebugt extra_preargstextra_postargst build_tempt target_lang((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRxs    tstaticc Csrtjj|\}} tjj| \}}|jdjdrU|d}n|j||||| dS(NtxRi(R7R8R4RORQt startswithtcreate_static_lib(R)RRRRqRdRfR|RRRRRRAR9R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRx,s  cCs"tjdkrd}nt|S(s In https://github.com/pypa/setuptools/pull/837, we discovered Python 3.3.0 exposes the extension suffix under the name 'SO'. iiR (iii(Rt version_infoR(R2((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRLDs (+R7RRRtdistutils.command.build_extRt _du_build_exttdistutils.file_utilRtdistutils.ccompilerRtdistutils.sysconfigRRtdistutils.errorsRt distutilsRtsetuptools.extensionRtsetuptools.externRtCython.Distutils.build_extR&t __import__t ImportErrorR RRRaRRSRRRR>R2tdlthasattrRR$RZRxRL(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytsX                   PK!%command/install_lib.pycnu[ fc@s]ddlZddlZddlmZmZddljjZdejfdYZdS(iN(tproducttstarmapt install_libcBsneZdZdZdZdZedZdZedZ ddddd Z d Z RS( s9Don't add compiled flags to filenames of non-Python filescCs6|j|j}|dk r2|j|ndS(N(tbuildtinstalltNonet byte_compile(tselftoutfiles((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytrun s   csGfdjD}t|j}ttj|S(s Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s+|]!}j|D] }|VqqdS(N(t _all_packages(t.0tns_pkgtpkg(R(sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pys s(t_get_SVEM_NSPsRt_gen_exclusion_pathstsetRt_exclude_pkg_path(Rt all_packagest excl_specs((RsB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytget_exclusionss cCs,|jd|g}tjj|j|S(sw Given a package name and exclusion path within that package, compute the full exclusion path. t.(tsplittostpathtjoint install_dir(RR texclusion_pathtparts((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRsccs.x'|r)|V|jd\}}}qWdS(sn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] RN(t rpartition(tpkg_nametseptchild((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR 's cCs<|jjsgS|jd}|j}|r8|jjSgS(s Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. R(t distributiontnamespace_packagestget_finalized_commandt!single_version_externally_managed(Rt install_cmdtsvem((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR1s   ccsidVdVdVttds"dStjjddtj}|dV|d V|d V|d VdS( sk Generate file paths to be excluded for namespace packages (bytecode cache files). s __init__.pys __init__.pycs __init__.pyotget_tagNt __pycache__s __init__.s.pycs.pyos .opt-1.pycs .opt-2.pyc(thasattrtimpRRRR'(tbase((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRAs   iic s|r|r| st|jsAtjj|||Sddlm}ddlmgfd}||||S(Ni(tunpack_directory(tlogcsP|kr jd|tSjd|tjj|j||S(Ns/Skipping installation of %s (namespace package)scopying %s -> %s(twarntFalsetinfoRRtdirnametappend(tsrctdst(texcludeR-R(sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytpfgs   ( tAssertionErrorRtorigRt copy_treetsetuptools.archive_utilR,t distutilsR-( Rtinfiletoutfilet preserve_modetpreserve_timestpreserve_symlinkstlevelR,R6((R5R-RsB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR9Vs  cCsKtjj|}|j}|rGg|D]}||kr+|^q+S|S(N(R8Rt get_outputsR(RtoutputsR5tf((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRBts  #( t__name__t __module__t__doc__R RRt staticmethodR RRR9RB(((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRs    ( RR*t itertoolsRRtdistutils.command.install_libtcommandRR8(((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyts  PK!command/bdist_wininst.pycnu[ fc@s/ddljjZdejfdYZdS(iNt bdist_wininstcBseZddZdZRS(icCs1|jj||}|dkr-d|_n|S(sj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 tinstallt install_lib(RRN(t distributiontreinitialize_commandtNoneR(tselftcommandtreinit_subcommandstcmd((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyRs     cCs.t|_ztjj|Wdt|_XdS(N(tTruet _is_runningtorigRtruntFalse(R((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyR s (t__name__t __module__RR (((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyRs (tdistutils.command.bdist_wininstRRR (((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pytsPK!~command/register.pyonu[ fc@s/ddljjZdejfdYZdS(iNtregistercBseZejjZdZRS(cCs!|jdtjj|dS(Ntegg_info(t run_commandtorigRtrun(tself((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pyRs (t__name__t __module__RRt__doc__R(((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pyRs (tdistutils.command.registertcommandRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/register.pytsPK!U(e(ecommand/egg_info.pyonu[ fc@s@dZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+dZ,defdYZ-defdYZdefdYZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6e7d Z8d!Z9d"Z:dS(#sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsi(tFileList(tDistutilsInternalError(t convert_path(tlogN(tsix(tmap(tCommand(tsdist(t walk_revctrl(t edit_config(t bdist_egg(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filename(tglob(t packagingcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkr|r|d7}qG|d||f7}qGnd}t|} x|| krA||} | dkr||d7}nJ| d kr||7}n1| d kr!|d} | | krB|| d krB| d} n| | krk|| d krk| d} nx*| | kr|| d kr| d} qnW| | kr|tj| 7}q4||d| !} d} | dd krd } | d} n| tj| 7} |d| f7}| }n|tj| 7}|d7}qW|sG||7}qGqGW|d7}tj|dtj tj BS(s Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. ts[^%s]is**s.*s (?:%s+%s)*it*t?t[t!t]t^s[%s]s\Ztflags( tsplittostpathtseptretescapet enumeratetlentcompilet MULTILINEtDOTALL(RtpattchunksR t valid_chartctchunkt last_chunktit chunk_lentchartinner_itinnert char_class((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyttranslate_pattern$sV                tegg_infocBseZdZddddgZdgZidd 6Zd ZedZej dZdZ dZ e dZ dZdZdZdZdZdZdZRS(s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-datetDs"Don't include date stamp [default]cCsLd|_d|_d|_d|_d|_d|_t|_d|_ dS(Ni( tNonetegg_namet egg_versiontegg_baseR5t tag_buildttag_datetFalsetbroken_egg_infotvtags(tself((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytinitialize_optionss       cCsdS(N((RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyttag_svn_revisionscCsdS(N((RCtvalue((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyREscCs@tj}|j|diR?R5N(t collectionst OrderedDictttagsR tdict(RCtfilenameR5((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytsave_version_infos  cCst|jj|_|j|_|j|_t|j}yKt |t j j }|ridnd}t t||j|jfWn3tk rtjjd|j|jfnX|jdkr|jj}|pijdtj|_n|jdt|jd|_|jtjkrXtjj|j|j|_nd|jkrt|jn|j|jj_ |jj }|dk r|j!|jj"kr|j|_#t|j|_$d|j_ ndS(Ns%s==%ss%s===%ss2Invalid distribution name or version syntax: %s-%sRR=s .egg-infot-(%R t distributiontget_nameR;RIRBttagged_versionR<R t isinstanceRtversiontVersiontlistR t ValueErrort distutilsterrorstDistutilsOptionErrorR=R:t package_dirtgetRtcurdirtensure_dirnameRR5Rtjointcheck_broken_egg_infotmetadatat _patched_disttkeytlowert_versiont_parsed_version(RCtparsed_versiont is_versiontspectdirstpd((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytfinalize_optionss8!   ! !  $ cCsl|r|j|||nLtjj|rh|dkrX| rXtjd||dS|j|ndS(sWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). s$%s not set in setup(), but %s existsN(t write_fileRRtexistsR:Rtwarnt delete_file(RCtwhatRKtdatatforce((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_or_delete_files  cCsdtjd||tjr.|jd}n|js`t|d}|j||jndS(sWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. swriting %s to %ssutf-8twbN( RtinfoRtPY3tencodetdry_runtopentwritetclose(RCRoRKRptf((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRks   cCs-tjd||js)tj|ndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RRtRwRtunlink(RCRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRns cCsE|jj}|jr4|j|jr4t|St||jS(N(RNt get_versionRBtendswithR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRPs cCs|j|j|jj}xXtdD]J}|jd||j}|||jtj j |j|jq)Wtj j |jd}tj j |r|j |n|j dS(Nsegg_info.writerst installersnative_libs.txt(tmkpathR5RNtfetch_build_eggRtrequiretresolvetnameRRR]RlRnt find_sources(RCRteptwritertnl((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytrun s  ,cCsBd}|jr||j7}n|jr>|tjd7}n|S(NRs-%Y%m%d(R>R?ttimetstrftime(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRIs   cCsJtjj|jd}t|j}||_|j|j|_dS(s"Generate SOURCES.txt manifest files SOURCES.txtN( RRR]R5tmanifest_makerRNtmanifestRtfilelist(RCtmanifest_filenametmm((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR s   cCs|jd}|jtjkr:tjj|j|}ntjj|rtjddddd||j |j |_ ||_ ndS(Ns .egg-infoRMiNs Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ( R;R=RR[RR]RlRRmR5RA(RCtbei((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR^(s   (s egg-base=R6sLdirectory containing .egg-info directories (default: top of the source tree)(stag-dateR7s0Add date stamp (e.g. 20050528) to version number(s tag-build=R8s-Specify explicit tag to add to version number(sno-dateR9s"Don't include date stamp [default](t__name__t __module__t descriptiont user_optionstboolean_optionst negative_optRDtpropertyREtsetterRLRjR@RrRkRnRPRRIRR^(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR5ws*     /       RcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(cCs|j|\}}}}|dkrw|jddj|x|D](}|j|sHtjd|qHqHWnx|dkr|jddj|xO|D](}|j|stjd|qqWn|dkr/|jd dj|x|D](}|j|stjd |qqWn|d kr|jd dj|x|D](}|j|s\tjd |q\q\Wnd|dkr|jd|dj|fx5|D].}|j ||stjd||qqWn|dkr[|jd|dj|fx|D].}|j ||s&tjd||q&q&Wn|dkr|jd||j |stjd|qnR|dkr|jd||j |stjd|qnt d|dS(Ntincludesinclude t s%warning: no files found matching '%s'texcludesexclude s9warning: no previously-included files found matching '%s'sglobal-includesglobal-include s>warning: no files found matching '%s' anywhere in distributionsglobal-excludesglobal-exclude sRwarning: no previously-included files matching '%s' found anywhere in distributionsrecursive-includesrecursive-include %s %ss:warning: no files found matching '%s' under directory '%s'srecursive-excludesrecursive-exclude %s %ssNwarning: no previously-included files matching '%s' found under directory '%s'tgraftsgraft s+warning: no directories found matching '%s'tprunesprune s6no previously-included directories found matching '%s's'this cannot happen: invalid action '%s'(t_parse_template_linet debug_printR]RRRmRtglobal_includetglobal_excludetrecursive_includetrecursive_excludeRRR(RCtlinetactiontpatternstdirt dir_patterntpattern((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytprocess_template_line;sd                         cCsrt}xett|jdddD]D}||j|r&|jd|j||j|=t}q&q&W|S(s Remove all files from the file list that match the predicate. Return True if any matching files were removed iis removing (R@trangeR$tfilesRtTrue(RCt predicatetfoundR.((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt _remove_filess&  cCsHgt|D]}tjj|s |^q }|j|t|S(s#Include files that match 'pattern'.(RRRtisdirtextendtbool(RCRR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs1 cCst|}|j|jS(s#Exclude files that match 'pattern'.(R4Rtmatch(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs cCsftjj|d|}gt|dtD]}tjj|s+|^q+}|j|t|S(sN Include all files anywhere in 'dir/' that match the pattern. s**t recursive(RRR]RRRRR(RCRRt full_patternR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  cCs.ttjj|d|}|j|jS(sM Exclude any file anywhere in 'dir/' that match the pattern. s**(R4RRR]RR(RCRRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsOgt|D]%}tjj|D] }|^q#q }|j|t|S(sInclude all files from 'dir/'.(RRVRtfindallRR(RCRt match_dirtitemR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs % cCs+ttjj|d}|j|jS(sFilter out files from 'dir/'.s**(R4RRR]RR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsy|jdkr|jnttjjd|}g|jD]}|j|rA|^qA}|j|t |S(s Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. s**N( tallfilesR:RR4RRR]RRR(RCRRR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  + cCs+ttjjd|}|j|jS(sD Exclude all files anywhere that match the pattern. s**(R4RRR]RR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsN|jdr|d }nt|}|j|rJ|jj|ndS(Ns i(R~Rt _safe_pathRtappend(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs   cCs |jjt|j|dS(N(RRtfilterR(RCtpaths((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCs"tt|j|j|_dS(s Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N(RTRRR(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_repairscCsd}tj|}|dkr6tjd|tStj|d}|dkrktj||dtSy,tjj |stjj |rt SWn*t k rtj||t j nXdS(Ns!'%s' not %s encodable -- skippings''%s' in unexpected encoding -- skippingsutf-8(t unicode_utilstfilesys_decodeR:RRmR@t try_encodeRRRlRtUnicodeEncodeErrortsystgetfilesystemencoding(RCRtenc_warntu_patht utf8_path((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  $ (RRRRRRRRRRRRRRRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR8s I        RcBseeZdZdZdZdZdZdZdZe dZ dZ d Z RS( s MANIFEST.incCs(d|_d|_d|_d|_dS(Ni(t use_defaultsRt manifest_onlytforce_manifest(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRDs   cCsdS(N((RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRjscCst|_tjj|js.|jn|jtjj|jrZ|j n|j |jj |jj |jdS(N( RRRRRlRtwrite_manifestt add_defaultsttemplatet read_templatetprune_file_listtsorttremove_duplicates(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs       cCs"tj|}|jtjdS(Nt/(RRtreplaceRR (RCR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_manifest_normalizescCsb|jjg|jjD]}|j|^q}d|j}|jt|j|f|dS(so Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. swriting manifest file '%s'N(RRRRRtexecuteRk(RCR{Rtmsg((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs ( cCs&|j|s"tj||ndS(N(t_should_suppress_warningRRm(RCR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRm$scCstjd|S(s; suppress missing-file warnings from sdist sstandard file .*not found(R!R(R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR(scCstj||jj|j|jj|jtt}|r[|jj|n"t j j |jr}|j n|j d}|jj|jdS(NR5(RRRRRRRTRRRRRlt read_manifesttget_finalized_commandRR5(RCtrcfilestei_cmd((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR/s  cCsy|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS(Ntbuilds(^|s)(RCS|CVS|\.svn)tis_regexi( RRNt get_fullnameRRt build_baseR!R"RR texclude_pattern(RCRtbase_dirR ((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR;s( RRRRDRjRRRRmt staticmethodRRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs     cCsGdj|}|jd}t|d}|j|WdQXdS(s{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. s sutf-8RsN(R]RvRxRy(RKtcontentsR{((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRkEscCstjd||js|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j|j |ndS(Ns writing %stzip_safe(RRtRwRNR_R<RRR;Rtwrite_pkg_infoR5tgetattrR:R twrite_safety_flag(tcmdtbasenameRKR_toldvertoldnametsafe((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRRs  cCs&tjj|r"tjdndS(NssWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.(RRRlRRm(RRRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwarn_depends_obsoleteescCs;t|p d}d}t||}|j|dS(NcSs|dS(Ns ((R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytoR((RRt writelines(tstreamtreqstlinest append_cr((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_write_requirementsms cCs|j}tj}t||j|jp1i}x>t|D]0}|jdjt t|||qAW|j d||j dS(Ns [{extra}] t requirements( RNRtStringIORtinstall_requirestextras_requiretsortedRytformattvarsRrtgetvalue(RRRKtdistRpRtextra((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_requirementsts  cCs<tj}t||jj|jd||jdS(Nssetup-requirements(tioRRRNtsetup_requiresRrR(RRRKRp((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_setup_requirementss cCsetjg|jjD]}|jddd^q}|jd|djt|ddS(Nt.iistop-level namess (RJtfromkeysRNtiter_distribution_namesRRkR]R(RRRKtktpkgs((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_toplevel_namess2cCst|||tdS(N(t write_argR(RRRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt overwrite_argscCsgtjj|d}t|j|d}|dk rMdj|d}n|j||||dS(Nis (RRtsplitextRRNR:R]Rr(RRRKRqtargnameRF((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR s  cCs|jj}t|tjs*|dkr3|}n|dk rg}xt|jD]n\}}t|tjstj ||}dj tt t |j }n|jd||fqXWdj |}n|jd||tdS(Ns s [%s] %s Rs entry points(RNt entry_pointsRQRt string_typesR:RtitemsRt parse_groupR]RtstrtvaluesRRrR(RRRKRRptsectionR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt write_entriess   'cCs}tjdttjjdrytjdC}x9|D]1}tj d|}|r;t |j dSq;WWdQXndS(sd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. s$get_pkg_info_revision is deprecated.sPKG-INFOsVersion:.*-r(\d+)\s*$iNi( twarningsRmtDeprecationWarningRRRlRRxR!Rtinttgroup(R{RR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytget_pkg_info_revisions  (;t__doc__tdistutils.filelistRt _FileListtdistutils.errorsRtdistutils.utilRRVRRR!RRRRRGtsetuptools.externRtsetuptools.extern.six.movesRt setuptoolsRtsetuptools.command.sdistRRtsetuptools.command.setoptR tsetuptools.commandR t pkg_resourcesR R R RRRRRtsetuptools.unicode_utilsRtsetuptools.globRRR4R5RRkRRRRRR R R@R RR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytsN         : SI       PK!'zzcommand/bdist_rpm.pyonu[ fc@s/ddljjZdejfdYZdS(iNt bdist_rpmcBs eZdZdZdZRS(sf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs!|jdtjj|dS(Ntegg_info(t run_commandtorigRtrun(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyRs c Cs|jj}|jdd}tjj|}d|}d|}g|D]<}|jddjddjdd j||^qN}|j|d }d |}|j|||S( Nt-t_s%define version sSource0: %{name}-%{version}.tars)Source0: %{name}-%{unmangled_version}.tarssetup.py install s5setup.py install --single-version-externally-managed s%setups&%setup -n %{name}-%{unmangled_version}is%define unmangled_version (t distributiont get_versiontreplaceRRt_make_spec_filetindextinsert( Rtversiont rpmversiontspectline23tline24tlinet insert_loctunmangled_version((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyR s   F (t__name__t __module__t__doc__RR (((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pyRs  (tdistutils.command.bdist_rpmtcommandRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_rpm.pytsPK!]  command/build_clib.pyonu[ fc@s_ddljjZddlmZddlmZddlm Z dejfdYZdS(iN(tDistutilsSetupError(tlog(tnewer_pairwise_groupt build_clibcBseZdZdZRS(sv Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Cs4x-|D]%\}}|jd}|dksDt|ttf rWtd|nt|}tjd||jdt}t|tstd|ng}|jdt}t|ttfstd|nx{|D]s}|g} | j ||j|t} t| ttfsMtd|n| j | |j | qW|j j |d|j } t|| ggfkr|jd} |jd } |jd }|j j|d|j d| d | d |d |j}n|j j| |d|jd |jqWdS( Ntsourcessfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenamessbuilding '%s' librarytobj_depss\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list'tt output_dirtmacrost include_dirstcflagstextra_postargstdebug(tgettNonet isinstancetlistttupleRRtinfotdicttextendtappendtcompilertobject_filenamest build_tempRtcompileR tcreate_static_libR(tselft librariestlib_namet build_infoRRt dependenciest global_depstsourcetsrc_depst extra_depstexpected_objectsRR R tobjects((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pytbuild_librariess`"               (t__name__t __module__t__doc__R&(((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pyRs( tdistutils.command.build_clibtcommandRtorigtdistutils.errorsRt distutilsRtsetuptools.dep_utilR(((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pytsPK!iGGcommand/bdist_egg.pyonu[ fc@sdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZy#dd lmZmZd ZWn0ek r9ddlm Z mZdZnXdZ!dZ"dZ#defdYZ$e%j&dj'Z(dZ)dZ*dZ+ide,6de-6Z.dZ/dZ0dZ1ddd d!gZ2d"d"e,d#d$Z3dS(%s6setuptools.command.bdist_egg Build .egg distributionsi(tDistutilsSetupError(t remove_treetmkpath(tlog(tCodeTypeN(tsix(tget_build_platformt Distributiontensure_directory(t EntryPoint(tLibrary(tCommand(tget_pathtget_python_versioncCs tdS(Ntpurelib(R (((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt _get_purelibs(tget_python_libR cCs ttS(N(RtFalse(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRscCsEd|kr%tjj|d}n|jdrA|d }n|S(Nt.itmodulei(tostpathtsplitexttendswith(tfilename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt strip_module#s   ccsIxBtj|D]1\}}}|j|j|||fVqWdS(sbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N(Rtwalktsort(tdirtbasetdirstfiles((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt sorted_walk+s  cCsBtjdj}t|d}|j||WdQXdS(NsR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() tw(ttextwraptdedenttlstriptopentwrite(tresourcetpyfilet_stub_templatetf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt write_stub5st bdist_eggcBseZdZddddefdd d d d fd d!gZd ddgZdZdZdZ dZ dZ dZ dZ dZdZdZdZRS("screate an "egg" distributions bdist-dir=tbs1temporary directory for creating the distributions plat-name=tps;platform name to embed in generated filenames (default: %s)sexclude-source-filess+remove all .py files from the generated eggs keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archives dist-dir=tds-directory to put final built distributions ins skip-builds2skip rebuilding everything (for testing/debugging)cCsCd|_d|_d|_d|_d|_d|_d|_dS(Ni(tNonet bdist_dirt plat_namet keep_temptdist_dirt skip_buildt egg_outputtexclude_source_files(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytinitialize_optionsZs      cCs|jd}|_|j|_|jdkr^|jdj}tjj|d|_n|j dkr|t |_ n|j dd|j dkrt dd|j|jt|jjo|j j}tjj|j|d|_ ndS(Ntegg_infotbdistteggR5s.egg(R5R5(tget_finalized_commandtei_cmdR;R2R1t bdist_baseRRtjoinR3Rtset_undefined_optionsR7Rtegg_namet egg_versionR t distributionthas_ext_modulesR5(R9R?R@tbasename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytfinalize_optionscs !cCs_|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |d|df}qqn|jj j|qVWz0tjd|j|jdddddWd||j_ XdS( Ntinstalliiisinstalling package data to %st install_datatforcetroot(R2R>t install_libRRtnormcasetrealpathRREt data_filest isinstancettupletlentisabst startswithtseptappendRtinfot call_commandR1(R9t site_packagestoldtitemROt normalized((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytdo_install_data{s ! !'cCs |jgS(N(R7(R9((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt get_outputsscKsmx!tD]}|j||jqW|jd|j|jd|j|j||}|j||S(s8Invoke reinitialized command `cmdname` with keyword argsR6tdry_run(tINSTALL_DIRECTORY_ATTRSt setdefaultR2R6R`treinitialize_commandt run_command(R9tcmdnametkwtdirnametcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRYs  c Cs|jdtjd|j|jd}|j}d|_|jjrj|j rj|jdn|j ddd}||_|j \}}g|_ g}xt |D]\}}tjj|\} } tjj|jt| d} |j j| tjd ||jsAttjj|| n|j| |jtjd ||tjj#|rtjd||jstj$|qnt%tjj| d |j&tjj'tjj|j(dr3tj)dn|j*rI|j+nt,|j-| d|j.d|jd|j/|j0st1|jd|jnt2|jdgjdt3|j-fdS(NR;sinstalling library code to %sRIt build_clibRMtwarn_diris.pyscreating stub loader for %st/sEGG-INFOtscriptssinstalling scripts to %stinstall_scriptst install_dirtno_episnative_libs.txts writing %stwts s removing %ss depends.txtsxWARNING: 'depends.txt' will not be used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.tverboseR`tmodet dist_filesR,(4RdRRXR2R>RLR1REthas_c_librariesR6RYtget_ext_outputststubst enumerateRRRRARRWR`R+RGtreplaceRVt byte_compileRPR^RRltcopy_metadata_toRR%R&tclosetisfiletunlinktwrite_safety_flagtzip_safetexistsR;twarnR8t zap_pyfilest make_zipfileR7Rqt gen_headerR4RtgetattrR (R9tinstcmdtold_rootRht all_outputst ext_outputst to_compileR.text_nameRtextR(t archive_rootR;t script_dirt native_libst libs_file((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytrunsz                   $    c Cs-tjdxt|jD]\}}}x|D]}tjj||}|jdr}tjd|tj |n|jdr3|}d}t j ||}tjj|tj |j dd} tjd|| fytj| Wntk r nXtj|| q3q3WqWdS( Ns+Removing .py files from temporary directorys.pys Deleting %st __pycache__s#(?P.+)\.(?P[^.]+)\.pyctnames.pycsRenaming file from [%s] to [%s](RRXtwalk_eggR2RRRARtdebugR}tretmatchtpardirtgrouptremovetOSErrortrename( R9RRRRRtpath_oldtpatterntmtpath_new((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs*    cCsEt|jdd}|dk r%|Stjdt|j|jS(NRs4zip_safe flag not set; analyzing archive contents...(RRER1RRt analyze_eggR2Rv(R9tsafe((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR s   c Cs!tj|jjpd}|jdijd}|dkrFdS|j sY|jrotd|fnt j d }|j }dj |j}|jd}t jj|j}d t}|jstt jj|jd |jt|jd} | j|| jnd S( Ntssetuptools.installationt eggsecutableR!sGeggsecutable entry point (%r) cannot have 'extras' or refer to a moduleiRisH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi R`ta(R t parse_mapREt entry_pointstgetR1tattrstextrasRtsystversiont module_nameRARRRGR7tlocalsR`RRgR%R&R{( R9tepmteptpyvertpkgtfullRRGtheaderR*((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs*      "  cCstjj|j}tjj|d}xb|jjjD]Q}|j|r:tjj||t |}t ||j ||q:q:WdS(s*Copy metadata (egg info) to the target_dirRN( RRtnormpathR;RAR?tfilelistRRURSRt copy_file(R9t target_dirt norm_egg_infotprefixRttarget((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRz:s c Csg}g}id|j6}xt|jD]\}}}xH|D]@}tjj|djtkrB|j|||qBqBWx3|D]+}|||d|tjj||t extensionsRQR tget_ext_fullnameRtget_ext_filenameRGRUR( R9RRtpathsRRRRt build_cmdRtfullname((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRuFs( " -$(s bdist-dir=R-s1temporary directory for creating the distributionN(sexclude-source-filesNs+remove all .py files from the generated egg(s dist-dir=R0s-directory to put final built distributions in(s skip-buildNs2skip rebuilding everything (for testing/debugging)(t__name__t __module__t descriptionRR1t user_optionstboolean_optionsR:RHR^R_RYRRRRRzRu(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR,Cs4       Q   ' s.dll .so .dylib .pydccset|}t|\}}}d|kr=|jdn|||fVx|D] }|VqRWdS(s@Walk an unpacked egg's contents, skipping the metadata directorysEGG-INFON(R tnextR(tegg_dirtwalkerRRRtbdf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRfs   c CsxBtjD]4\}}tjjtjj|d|r |Sq WtsRtSt}xt |D]\}}}xn|D]f}|j ds{|j drq{q{|j ds|j dr{t ||||o|}q{q{WqeW|S(NsEGG-INFOs.pys.pyws.pycs.pyo( t safety_flagstitemsRRRRAtcan_scanRtTrueRRt scan_module( RRvtflagtfnRRRRR((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRqs$  &cCsxtjD]\}}tjj||}tjj|rq|dks^t||krtj|qq |dk r t||kr t |d}|j d|j q q WdS(NRps ( RRRRRARR1tboolR}R%R&R{(RRRRR*((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR~s szip-safes not-zip-safec Cstjj||}|d |kr)tS|t|djtjd}||r[dp^dtjj|d}tj dkrd}ntj dkrd }nd }t |d }|j |t j |} |jt} tjt| } x<d d gD].} | | kr tjd|| t} q q Wd| krxZdddddddddddg D].} | | krotjd|| t} qoqoWn| S(s;Check whether module possibly uses unsafe-for-zipfile stuffiiRRiiiii itrbt__file__t__path__s%s: module references %stinspectt getsourcet getabsfilet getsourcefiletgetfilegetsourcelinest findsourcet getcommentst getframeinfotgetinnerframestgetouterframeststackttraces"%s: module MAY be using inspect.%s(ii(ii(RRRARRSRxRVRRt version_infoR%treadtmarshaltloadR{tdicttfromkeyst iter_symbolsRRR( RRRRvRRRtskipR*tcodeRtsymbolstbad((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs:#*          ccsyx|jD] }|Vq WxY|jD]N}t|tjrC|Vq#t|tr#xt|D] }|Vq_Wq#q#WdS(sBYield names and strings used by `code` and its nested code objectsN(tco_namest co_constsRQRt string_typesRR(RRtconst((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs cCsDtjjd r&tjdkr&tStjdtjddS(Ntjavatclis1Unable to analyze compiled code on this platform.sfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py(RtplatformRURRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs" RMRnRJt install_baseiR!c sddl}ttjj|dtjd|fd}|r\|jn|j}s|j ||d|} x-t D]\} } } || | | qW| j n0x-t D]\} } } |d| | qW|S(sqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. iNR`s#creating '%s' and adding '%s' to itcsx|D]y}tjjtjj||}tjj|r|td}sm|j||ntjd|qqWdS(Nis adding '%s'( RRRRAR|RSR&RR(tzRgtnamesRRR.(tbase_dirR`(s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytvisits !t compression( tzipfileRRRRgRRXt ZIP_DEFLATEDt ZIP_STOREDtZipFileR R{R1( t zip_filenameRRqR`tcompressRrRRRRRgRR((RR`s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs   (4t__doc__tdistutils.errorsRtdistutils.dir_utilRRt distutilsRttypesRRRRR"Rtsetuptools.externRt pkg_resourcesRRRR tsetuptools.extensionR t setuptoolsR t sysconfigR R Rt ImportErrortdistutils.sysconfigRRR R+R,RRtsplitRRRR~RRRRRRRaR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytsL          !    $  PK!]  command/build_clib.pycnu[ fc@s_ddljjZddlmZddlmZddlm Z dejfdYZdS(iN(tDistutilsSetupError(tlog(tnewer_pairwise_groupt build_clibcBseZdZdZRS(sv Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Cs4x-|D]%\}}|jd}|dksDt|ttf rWtd|nt|}tjd||jdt}t|tstd|ng}|jdt}t|ttfstd|nx{|D]s}|g} | j ||j|t} t| ttfsMtd|n| j | |j | qW|j j |d|j } t|| ggfkr|jd} |jd } |jd }|j j|d|j d| d | d |d |j}n|j j| |d|jd |jqWdS( Ntsourcessfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenamessbuilding '%s' librarytobj_depss\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list'tt output_dirtmacrost include_dirstcflagstextra_postargstdebug(tgettNonet isinstancetlistttupleRRtinfotdicttextendtappendtcompilertobject_filenamest build_tempRtcompileR tcreate_static_libR(tselft librariestlib_namet build_infoRRt dependenciest global_depstsourcetsrc_depst extra_depstexpected_objectsRR R tobjects((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pytbuild_librariess`"               (t__name__t __module__t__doc__R&(((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pyRs( tdistutils.command.build_clibtcommandRtorigtdistutils.errorsRt distutilsRtsetuptools.dep_utilR(((sA/usr/lib/python2.7/site-packages/setuptools/command/build_clib.pytsPK!command/install_lib.pyonu[ fc@s]ddlZddlZddlmZmZddljjZdejfdYZdS(iN(tproducttstarmapt install_libcBsneZdZdZdZdZedZdZedZ ddddd Z d Z RS( s9Don't add compiled flags to filenames of non-Python filescCs6|j|j}|dk r2|j|ndS(N(tbuildtinstalltNonet byte_compile(tselftoutfiles((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytrun s   csGfdjD}t|j}ttj|S(s Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s+|]!}j|D] }|VqqdS(N(t _all_packages(t.0tns_pkgtpkg(R(sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pys s(t_get_SVEM_NSPsRt_gen_exclusion_pathstsetRt_exclude_pkg_path(Rt all_packagest excl_specs((RsB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytget_exclusionss cCs,|jd|g}tjj|j|S(sw Given a package name and exclusion path within that package, compute the full exclusion path. t.(tsplittostpathtjoint install_dir(RR texclusion_pathtparts((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRsccs.x'|r)|V|jd\}}}qWdS(sn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] RN(t rpartition(tpkg_nametseptchild((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR 's cCs<|jjsgS|jd}|j}|r8|jjSgS(s Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. R(t distributiontnamespace_packagestget_finalized_commandt!single_version_externally_managed(Rt install_cmdtsvem((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR1s   ccsidVdVdVttds"dStjjddtj}|dV|d V|d V|d VdS( sk Generate file paths to be excluded for namespace packages (bytecode cache files). s __init__.pys __init__.pycs __init__.pyotget_tagNt __pycache__s __init__.s.pycs.pyos .opt-1.pycs .opt-2.pyc(thasattrtimpRRRR'(tbase((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRAs   iic sw|js(tjj|||Sddlm}ddlmgfd}||||S(Ni(tunpack_directory(tlogcsP|kr jd|tSjd|tjj|j||S(Ns/Skipping installation of %s (namespace package)scopying %s -> %s(twarntFalsetinfoRRtdirnametappend(tsrctdst(texcludeR-R(sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pytpfgs   (RtorigRt copy_treetsetuptools.archive_utilR,t distutilsR-( Rtinfiletoutfilet preserve_modetpreserve_timestpreserve_symlinkstlevelR,R6((R5R-RsB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyR8Vs  cCsKtjj|}|j}|rGg|D]}||kr+|^q+S|S(N(R7Rt get_outputsR(RtoutputsR5tf((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRAts  #( t__name__t __module__t__doc__R RRt staticmethodR RRR8RA(((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyRs    ( RR*t itertoolsRRtdistutils.command.install_libtcommandRR7(((sB/usr/lib/python2.7/site-packages/setuptools/command/install_lib.pyts  PK!iGGcommand/bdist_egg.pycnu[ fc@sdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZy#dd lmZmZd ZWn0ek r9ddlm Z mZdZnXdZ!dZ"dZ#defdYZ$e%j&dj'Z(dZ)dZ*dZ+ide,6de-6Z.dZ/dZ0dZ1ddd d!gZ2d"d"e,d#d$Z3dS(%s6setuptools.command.bdist_egg Build .egg distributionsi(tDistutilsSetupError(t remove_treetmkpath(tlog(tCodeTypeN(tsix(tget_build_platformt Distributiontensure_directory(t EntryPoint(tLibrary(tCommand(tget_pathtget_python_versioncCs tdS(Ntpurelib(R (((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt _get_purelibs(tget_python_libR cCs ttS(N(RtFalse(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRscCsEd|kr%tjj|d}n|jdrA|d }n|S(Nt.itmodulei(tostpathtsplitexttendswith(tfilename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt strip_module#s   ccsIxBtj|D]1\}}}|j|j|||fVqWdS(sbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N(Rtwalktsort(tdirtbasetdirstfiles((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt sorted_walk+s  cCsBtjdj}t|d}|j||WdQXdS(NsR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() tw(ttextwraptdedenttlstriptopentwrite(tresourcetpyfilet_stub_templatetf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt write_stub5st bdist_eggcBseZdZddddefdd d d d fd d!gZd ddgZdZdZdZ dZ dZ dZ dZ dZdZdZdZRS("screate an "egg" distributions bdist-dir=tbs1temporary directory for creating the distributions plat-name=tps;platform name to embed in generated filenames (default: %s)sexclude-source-filess+remove all .py files from the generated eggs keep-temptks/keep the pseudo-installation tree around after s!creating the distribution archives dist-dir=tds-directory to put final built distributions ins skip-builds2skip rebuilding everything (for testing/debugging)cCsCd|_d|_d|_d|_d|_d|_d|_dS(Ni(tNonet bdist_dirt plat_namet keep_temptdist_dirt skip_buildt egg_outputtexclude_source_files(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytinitialize_optionsZs      cCs|jd}|_|j|_|jdkr^|jdj}tjj|d|_n|j dkr|t |_ n|j dd|j dkrt dd|j|jt|jjo|j j}tjj|j|d|_ ndS(Ntegg_infotbdistteggR5s.egg(R5R5(tget_finalized_commandtei_cmdR;R2R1t bdist_baseRRtjoinR3Rtset_undefined_optionsR7Rtegg_namet egg_versionR t distributionthas_ext_modulesR5(R9R?R@tbasename((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytfinalize_optionscs !cCs_|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |d|df}qqn|jj j|qVWz0tjd|j|jdddddWd||j_ XdS( Ntinstalliiisinstalling package data to %st install_datatforcetroot(R2R>t install_libRRtnormcasetrealpathRREt data_filest isinstancettupletlentisabst startswithtseptappendRtinfot call_commandR1(R9t site_packagestoldtitemROt normalized((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytdo_install_data{s ! !'cCs |jgS(N(R7(R9((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyt get_outputsscKsmx!tD]}|j||jqW|jd|j|jd|j|j||}|j||S(s8Invoke reinitialized command `cmdname` with keyword argsR6tdry_run(tINSTALL_DIRECTORY_ATTRSt setdefaultR2R6R`treinitialize_commandt run_command(R9tcmdnametkwtdirnametcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRYs  c Cs|jdtjd|j|jd}|j}d|_|jjrj|j rj|jdn|j ddd}||_|j \}}g|_ g}xt |D]\}}tjj|\} } tjj|jt| d} |j j| tjd ||jsAttjj|| n|j| |jtjd ||tjj#|rtjd||jstj$|qnt%tjj| d |j&tjj'tjj|j(dr3tj)dn|j*rI|j+nt,|j-| d|j.d|jd|j/|j0st1|jd|jnt2|jdgjdt3|j-fdS(NR;sinstalling library code to %sRIt build_clibRMtwarn_diris.pyscreating stub loader for %st/sEGG-INFOtscriptssinstalling scripts to %stinstall_scriptst install_dirtno_episnative_libs.txts writing %stwts s removing %ss depends.txtsxWARNING: 'depends.txt' will not be used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.tverboseR`tmodet dist_filesR,(4RdRRXR2R>RLR1REthas_c_librariesR6RYtget_ext_outputststubst enumerateRRRRARRWR`R+RGtreplaceRVt byte_compileRPR^RRltcopy_metadata_toRR%R&tclosetisfiletunlinktwrite_safety_flagtzip_safetexistsR;twarnR8t zap_pyfilest make_zipfileR7Rqt gen_headerR4RtgetattrR (R9tinstcmdtold_rootRht all_outputst ext_outputst to_compileR.text_nameRtextR(t archive_rootR;t script_dirt native_libst libs_file((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytrunsz                   $    c Cs-tjdxt|jD]\}}}x|D]}tjj||}|jdr}tjd|tj |n|jdr3|}d}t j ||}tjj|tj |j dd} tjd|| fytj| Wntk r nXtj|| q3q3WqWdS( Ns+Removing .py files from temporary directorys.pys Deleting %st __pycache__s#(?P.+)\.(?P[^.]+)\.pyctnames.pycsRenaming file from [%s] to [%s](RRXtwalk_eggR2RRRARtdebugR}tretmatchtpardirtgrouptremovetOSErrortrename( R9RRRRRtpath_oldtpatterntmtpath_new((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs*    cCsEt|jdd}|dk r%|Stjdt|j|jS(NRs4zip_safe flag not set; analyzing archive contents...(RRER1RRt analyze_eggR2Rv(R9tsafe((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR s   c Cs!tj|jjpd}|jdijd}|dkrFdS|j sY|jrotd|fnt j d }|j }dj |j}|jd}t jj|j}d t}|jstt jj|jd |jt|jd} | j|| jnd S( Ntssetuptools.installationt eggsecutableR!sGeggsecutable entry point (%r) cannot have 'extras' or refer to a moduleiRisH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi R`ta(R t parse_mapREt entry_pointstgetR1tattrstextrasRtsystversiont module_nameRARRRGR7tlocalsR`RRgR%R&R{( R9tepmteptpyvertpkgtfullRRGtheaderR*((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs*      "  cCstjj|j}tjj|d}xb|jjjD]Q}|j|r:tjj||t |}t ||j ||q:q:WdS(s*Copy metadata (egg info) to the target_dirRN( RRtnormpathR;RAR?tfilelistRRURSRt copy_file(R9t target_dirt norm_egg_infotprefixRttarget((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRz:s c Csg}g}id|j6}xt|jD]\}}}xH|D]@}tjj|djtkrB|j|||qBqBWx3|D]+}|||d|tjj||t extensionsRQR tget_ext_fullnameRtget_ext_filenameRGRUR( R9RRtpathsRRRRt build_cmdRtfullname((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRuFs( " -$(s bdist-dir=R-s1temporary directory for creating the distributionN(sexclude-source-filesNs+remove all .py files from the generated egg(s dist-dir=R0s-directory to put final built distributions in(s skip-buildNs2skip rebuilding everything (for testing/debugging)(t__name__t __module__t descriptionRR1t user_optionstboolean_optionsR:RHR^R_RYRRRRRzRu(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR,Cs4       Q   ' s.dll .so .dylib .pydccset|}t|\}}}d|kr=|jdn|||fVx|D] }|VqRWdS(s@Walk an unpacked egg's contents, skipping the metadata directorysEGG-INFON(R tnextR(tegg_dirtwalkerRRRtbdf((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRfs   c CsxBtjD]4\}}tjjtjj|d|r |Sq WtsRtSt}xt |D]\}}}xn|D]f}|j ds{|j drq{q{|j ds|j dr{t ||||o|}q{q{WqeW|S(NsEGG-INFOs.pys.pyws.pycs.pyo( t safety_flagstitemsRRRRAtcan_scanRtTrueRRt scan_module( RRvtflagtfnRRRRR((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRqs$  &cCsxtjD]\}}tjj||}tjj|rq|dks^t||krtj|qq |dk r t||kr t |d}|j d|j q q WdS(NRps ( RRRRRARR1tboolR}R%R&R{(RRRRR*((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyR~s szip-safes not-zip-safec Cstjj||}|d |kr)tS|t|djtjd}||r[dp^dtjj|d}tj dkrd}ntj dkrd }nd }t |d }|j |t j |} |jt} tjt| } x<d d gD].} | | kr tjd|| t} q q Wd| krxZdddddddddddg D].} | | krotjd|| t} qoqoWn| S(s;Check whether module possibly uses unsafe-for-zipfile stuffiiRRiiiii itrbt__file__t__path__s%s: module references %stinspectt getsourcet getabsfilet getsourcefiletgetfilegetsourcelinest findsourcet getcommentst getframeinfotgetinnerframestgetouterframeststackttraces"%s: module MAY be using inspect.%s(ii(ii(RRRARRSRxRVRRt version_infoR%treadtmarshaltloadR{tdicttfromkeyst iter_symbolsRRR( RRRRvRRRtskipR*tcodeRtsymbolstbad((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs:#*          ccsyx|jD] }|Vq WxY|jD]N}t|tjrC|Vq#t|tr#xt|D] }|Vq_Wq#q#WdS(sBYield names and strings used by `code` and its nested code objectsN(tco_namest co_constsRQRt string_typesRR(RRtconst((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs cCsDtjjd r&tjdkr&tStjdtjddS(Ntjavatclis1Unable to analyze compiled code on this platform.sfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py(RtplatformRURRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs" RMRnRJt install_baseiR!c sddl}ttjj|dtjd|fd}|r\|jn|j}s|j ||d|} x-t D]\} } } || | | qW| j n0x-t D]\} } } |d| | qW|S(sqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. iNR`s#creating '%s' and adding '%s' to itcsx|D]y}tjjtjj||}tjj|r|td}sm|j||ntjd|qqWdS(Nis adding '%s'( RRRRAR|RSR&RR(tzRgtnamesRRR.(tbase_dirR`(s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytvisits !t compression( tzipfileRRRRgRRXt ZIP_DEFLATEDt ZIP_STOREDtZipFileR R{R1( t zip_filenameRRqR`tcompressRrRRRRRgRR((RR`s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pyRs   (4t__doc__tdistutils.errorsRtdistutils.dir_utilRRt distutilsRttypesRRRRR"Rtsetuptools.externRt pkg_resourcesRRRR tsetuptools.extensionR t setuptoolsR t sysconfigR R Rt ImportErrortdistutils.sysconfigRRR R+R,RRtsplitRRRR~RRRRRRRaR(((s@/usr/lib/python2.7/site-packages/setuptools/command/bdist_egg.pytsL          !    $  PK!(q q command/install_egg_info.pycnu[ fc@s~ddlmZmZddlZddlmZddlmZddlmZddl Z dej efdYZ dS(i(tlogtdir_utilN(tCommand(t namespaces(tunpack_archivetinstall_egg_infocBsJeZdZdZd gZdZdZdZdZdZ RS( s.Install an .egg-info directory for the packages install-dir=tdsdirectory to install tocCs d|_dS(N(tNonet install_dir(tself((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytinitialize_optionsscCs{|jdd|jd}tjdd|j|jjd}|j|_t j j |j ||_ g|_dS(Nt install_libRtegg_infos .egg-info(RR(tset_undefined_optionstget_finalized_commandt pkg_resourcest DistributionRtegg_namet egg_versionR tsourcetostpathtjoinRttargettoutputs(R tei_cmdtbasename((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytfinalize_optionss  cCs|jdtjj|jrTtjj|j rTtj|jd|jn;tjj |jr|j tj |jfd|jn|jst j |jn|j |jdd|j|jf|jdS(NR tdry_runs Removing sCopying %s to %s((t run_commandRRtisdirRtislinkRt remove_treeRtexiststexecutetunlinkRtensure_directorytcopytreeRtinstall_namespaces(R ((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytrun!s +&  cCs|jS(N(R(R ((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyt get_outputs.scs)fd}tjj|dS(Ncs[x1dD])}|j|s,d||krdSqWjj|tjd|||S(Ns.svn/sCVS/t/sCopying %s to %s(s.svn/sCVS/(t startswithRRtappendRtdebug(tsrctdsttskip(R (sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytskimmer3s  (RRR(R R0((R sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyR%1s (s install-dir=Rsdirectory to install to( t__name__t __module__t__doc__t descriptiont user_optionsR RR'R(R%(((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyR s   ( t distutilsRRRt setuptoolsRRtsetuptools.archive_utilRRt InstallerR(((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyts   PK!Gl((command/test.pycnu[ fc@s:ddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd e fd YZd efd YZd efdYZ dS(iN(tDistutilsErrortDistutilsOptionError(tlog(t TestLoader(tsix(tmaptfilter( tresource_listdirtresource_existstnormalize_patht working_sett_namespace_packagestevaluate_markertadd_activation_listenertrequiret EntryPoint(tCommandtScanningLoadercBseZdZddZRS(cCstj|t|_dS(N(Rt__init__tsett_visited(tself((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs cCs7||jkrd S|jj|g}|jtj||t|drg|j|jnt|dr xt|j dD]|}|j dr|dkr|j d|d }n-t |j |dr|j d|}nq|j|j |qWnt |d kr+|j|S|d Sd S( sReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. tadditional_testst__path__ts.pys __init__.pyt.is /__init__.pyiiN(RtNonetaddtappendRtloadTestsFromModulethasattrRRt__name__tendswithRtloadTestsFromNametlent suiteClass(Rtmoduletpatterntteststfilet submodule((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs$ N(Rt __module__RRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs tNonDataPropertycBseZdZddZRS(cCs ||_dS(N(tfget(RR+((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR>scCs|dkr|S|j|S(N(RR+(Rtobjtobjtype((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt__get__As N(RR)RRR.(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR*=s ttestcBseZdZdZdddgZd Zd Zed ZdZ dZ e j gdZ ee j dZedZdZdZedZedZRS(s.Command to run unit tests after in-place builds#run unit tests after in-place builds test-module=tms$Run 'test_suite' in specified modules test-suite=tss9Run single test, case or suite (e.g. 'module.test_suite')s test-runner=trsTest runner to usecCs(d|_d|_d|_d|_dS(N(Rt test_suitet test_modulet test_loadert test_runner(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytinitialize_optionsSs   cCs|jr'|jr'd}t|n|jdkrj|jdkrW|jj|_qj|jd|_n|jdkrt|jdd|_n|jdkrd|_n|jdkrt|jdd|_ndS(Ns1You may specify a module or a suite, but not boths .test_suiteR5s&setuptools.command.test:ScanningLoaderR6(R3R4RRt distributionR5tgetattrR6(Rtmsg((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytfinalize_optionsYs cCst|jS(N(tlistt _test_args(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt test_argslsccsJ|j r!tjdkr!dVn|jr2dVn|jrF|jVndS(Niitdiscovers --verbose(ii(R3tsyst version_infotverbose(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR=ps   cCs|j |WdQXdS(sI Backward compatibility for project_on_sys_path context. N(tproject_on_sys_path(Rtfunc((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytwith_project_on_sys_pathxs c cstjot|jdt}|r|jddd|jd|jd}t|j }|jdd||jd|jddd|jdn-|jd|jddd|jd|jd}t j }t j j }zut|j}t j jd|tjtd td |j|jf|j|g dVWdQXWd|t j (t j jt j j|tjXdS( Ntuse_2to3tbuild_pytinplaceitegg_infotegg_baset build_exticSs |jS(N(tactivate(tdist((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytRs%s==%s(RtPY3R9R8tFalsetreinitialize_commandt run_commandtget_finalized_commandR t build_libR@tpathtmodulestcopyRJtinsertR RR Rtegg_namet egg_versiontpaths_on_pythonpathtcleartupdate( Rt include_distst with_2to3tbpy_cmdt build_pathtei_cmdtold_patht old_modulest project_path((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRCs8         ccst}tjjd|}tjjdd}zXtjj|}td||g}tjj|}|r|tjds (tfetch_build_eggstinstall_requirest tests_requiretextras_requiretitemst itertoolstchain(RMtir_dttr_dter_d((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt install_distss c Cs|j|j}dj|j}|jrB|jd|dS|jd|ttjd|}|j |"|j |j WdQXWdQXdS(Nt sskipping "%s" (dry run)s running "%s"tlocation( RR8Rlt_argvtdry_runtannounceRtoperatort attrgetterR[RCt run_tests(Rtinstalled_diststcmdRn((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytruns  c CsEtjrt|jdtr|jjdd}|tkrg}|tj kre|j |n|d7}x0tj D]%}|j |ry|j |qyqyWt t tj j|qntjdd|jd|j|jd|j|jdt}|jjsAd|j}|j|tjt|ndS(NRFRit testLoadert testRunnertexitsTest failed: %s(RROR9R8RPR3tsplitR R@RVRRvR<Rt __delitem__tunittesttmainRRt_resolve_as_epR5R6tresultt wasSuccessfulRRtERRORR(RR$t del_modulestnameR/R:((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs(    cCsdg|jS(NR(R>(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRscCs0|dkrdStjd|}|jS(su Load the indicated attribute value, called, as a as if it were specified as an entry point. Nsx=(RRtparsetresolve(tvaltparsed((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs (s test-module=R0s$Run 'test_suite' in specified module(s test-suite=R1s9Run single test, case or suite (e.g. 'module.test_suite')(s test-runner=R2sTest runner to use(RR)t__doc__t descriptiont user_optionsR7R;R*R>R=REt contextlibtcontextmanagerRCt staticmethodR[RRRtpropertyRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR/Gs(     -  (!RhRR@RRRtdistutils.errorsRRt distutilsRRtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRR R R R R RRt setuptoolsRRRgR*R/(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyts      @) PK!command/develop.pyonu[ fc@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl m Z mZmZddlmZddlmZddlZd ejefd YZd efd YZdS( i(t convert_path(tlog(tDistutilsErrortDistutilsOptionErrorN(tsix(t Distributiont PathMetadatatnormalize_path(t easy_install(t namespacestdevelopcBseZdZdZejddgZejdgZeZ dZ dZ d Z e d Zd Zd Zd ZdZRS(sSet up package for developments%install package in 'development mode't uninstalltusUninstall this source packages egg-path=s-Set the path to be used in the .egg-link filecCsA|jr)t|_|j|jn |j|jdS(N(R tTruet multi_versiontuninstall_linktuninstall_namespacestinstall_for_developmenttwarn_deprecated_options(tself((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytruns      cCs5d|_d|_tj|d|_d|_dS(Nt.(tNoneR tegg_pathRtinitialize_optionst setup_pathtalways_copy_from(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR's     cCs|jd}|jrCd}|j|jf}t||n|jg|_tj||j|j |j j t j d|jd}t jj|j||_|j|_|jdkrt jj|j|_nt|j}tt jj|j|j}||kr9td|nt|t|t jj|jd|j|_|j|j|j|j|_dS(Ntegg_infos-Please rename %r to %r before using 'develop's*.eggs .egg-linksA--egg-path must be a relative path from the install directory to t project_name(tget_finalized_commandtbroken_egg_infoRRtegg_nametargsRtfinalize_optionstexpand_basedirst expand_dirst package_indextscantglobtostpathtjoint install_dirtegg_linktegg_baseRRtabspathRRRRtdistt_resolve_setup_pathR(RteittemplateR t egg_link_fnttargetR((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR!.s<        cCs|jtjdjd}|tjkrGd|jdd}nttjj|||}|ttjkrt d|ttjn|S(s Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. t/s../isGCan't get a consistent path to setup script from installation directory( treplaceR'tseptrstriptcurdirtcountRR(R)R(R,R*Rt path_to_setuptresolved((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR/XscCstjrt|jdtr|jddd|jd|jd}t|j }|jdd||jd|jddd|jd|jd}||_ ||j _ t ||j|j _n-|jd|jddd|jd|jtjr7|jtjdt_n|jtjd |j|j|jst|jd "}|j|j d |jWdQXn|jd|j |j dS( Ntuse_2to3tbuild_pytinplaceiRR,t build_extisCreating %s (link to %s)tws ( RtPY3tgetattrt distributiontFalsetreinitialize_commandt run_commandRRt build_libRR.tlocationRRt _providertinstall_site_pyt setuptoolstbootstrap_install_fromRRtinstall_namespacesRtinfoR+R,tdry_runtopentwriteRtprocess_distributiontno_deps(Rtbpy_cmdt build_pathtei_cmdtf((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRks4            $cCstjj|jrtjd|j|jt|j}g|D]}|j^qD}|j ||j g|j |j gfkrtj d|dS|j stj|jqn|j s|j|jn|jjrtj dndS(NsRemoving %s (link to %s)s$Link points to %s: uninstall aborteds5Note: you must uninstall or replace scripts manually!(R'R(texistsR+RRNR,RPR7tcloseRRtwarnROtunlinkt update_pthR.RCtscripts(Rt egg_link_filetlinetcontents((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRs     cCs||jk rtj||S|j|x~|jjp>gD]j}tjjt |}tjj |}t j |}|j }WdQX|j||||q?WdS(N(R.Rtinstall_egg_scriptstinstall_wrapper_scriptsRCR]R'R(R-RtbasenametioRPtreadtinstall_script(RR.t script_namet script_pathtstrmt script_text((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRas cCst|}tj||S(N(tVersionlessRequirementRRb(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRbs (R R sUninstall this source packageN(s egg-path=Ns-Set the path to be used in the .egg-link file(t__name__t __module__t__doc__t descriptionRt user_optionsRtboolean_optionsRDtcommand_consumes_argumentsRRR!t staticmethodR/RRRaRb(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyR s   * /  RkcBs)eZdZdZdZdZRS(sz Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS(N(t_VersionlessRequirement__dist(RR.((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt__init__scCst|j|S(N(RBRt(Rtname((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyt __getattr__scCs|jS(N(R(R((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pytas_requirements(RlRmRnRuRwRx(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyRks   (tdistutils.utilRt distutilsRtdistutils.errorsRRR'R&Rdtsetuptools.externRt pkg_resourcesRRRtsetuptools.command.easy_installRRKR tDevelopInstallerR tobjectRk(((s>/usr/lib/python2.7/site-packages/setuptools/command/develop.pyts    PK!8 ))command/build_py.pyonu[ fc@sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn$ek rdd dYZnXd ejefd YZdd Zd ZdS(i(tglob(t convert_pathN(tsix(tmaptfiltert filterfalse(t Mixin2to3RcBseZedZRS(cCsdS(s do nothingN((tselftfilestdoctests((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun_2to3t(t__name__t __module__tTrueR (((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRstbuild_pycBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZedZRS(sXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsftjj||jj|_|jjp.i|_d|jkrP|jd=ng|_g|_dS(Nt data_files( torigRtfinalize_optionst distributiont package_datatexclude_package_datat__dict__t_build_py__updated_filest_build_py__doctests_2to3(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR!s    cCs|j r|j rdS|jr.|jn|jrN|j|jn|j|jt|j|jt|j|j t|j t j j |dddS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei(t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR RtFalseRRt byte_compileRRt get_outputs(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun+s     cCs5|dkr"|j|_|jStjj||S(slazily compute data filesR(t_get_data_filesRRRt __getattr__(Rtattr((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR$?s cCsqtjr-t|tjr-|jd}ntjj||||\}}|rg|jj |n||fS(Nt.( RtPY2t isinstancet string_typestsplitRRt build_moduleRtappend(Rtmodulet module_filetpackagetoutfiletcopied((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR+FscCs)|jtt|j|jp"dS(s?Generate list of '(package,src_dir,build_dir,filenames)' tuples((tanalyze_manifesttlistRt_get_pkg_data_filesR(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR#Ps cCsx|j|}tjj|jg|jd}g|j||D]}tjj||^qG}||||fS(NR&(tget_package_dirtostpathtjoint build_libR*tfind_data_filestrelpath(RR/tsrc_dirt build_dirtfilet filenames((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR4Us %1cCs|j|j||}tt|}tjj|}ttj j |}tj|j j |g|}|j |||S(s6Return filenames for package's data files in 'src_dir'(t_get_platform_patternsRRRt itertoolstchaint from_iterableRR6R7tisfiletmanifest_filestgettexclude_data_files(RR/R<tpatternstglobs_expandedt globs_matchest glob_filesR((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR:cs  c Csx|jD]\}}}}x|D]}tjj||}|jtjj|tjj||}|j||\}} tjj|}| r#||jj kr#|j j |q#q#Wq WdS(s$Copy data files into build directoryN( RR6R7R8tmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsRR,( RR/R<R=R?tfilenamettargettsrcfiletoutfR1((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRts c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|sc3s!|]}|kr|VqdS(N((R|tfn(tbad(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys s(R3R@RRARBRCtsett_unique_everseen(RR/R<RRHt match_groupstmatchestkeepers((RRs?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRGs       cs>tj|jdg|j|g}fd|DS(s yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. R c3s*|] }tjjt|VqdS(N(R6R7R8R(R|R}(R<(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys s(RARBRF(tspecR/R<t raw_patterns((R<s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR@s  (R R t__doc__RR"R$R+R#R4R:RR2RfRkRxR5RGt staticmethodR@(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs            ccst}|j}|dkrMxgt|j|D]}|||Vq1Wn;x8|D]0}||}||krT|||VqTqTWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(RtaddR[Rt __contains__(titerabletkeytseentseen_addtelementtk((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs         cCsOtjj|s|Sddlm}tjdj|}||dS(Ni(tDistutilsSetupErrors Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. (R6R7tisabstdistutils.errorsRttextwraptdedenttlstrip(R7Rtmsg((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRWs ((Rtdistutils.utilRtdistutils.command.build_pytcommandRRR6R{RRnRRqRAtsetuptools.externRtsetuptools.extern.six.movesRRRtsetuptools.lib2to3_exRt ImportErrorR[RRW(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyts"        PK!Gi2command/setopt.pycnu[ fc@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ d d Z e d Zd e fdYZd efdYZdS(i(t convert_path(tlog(tDistutilsOptionErrorN(t configparser(tCommandt config_filet edit_configt option_basetsetopttlocalcCs|dkrdS|dkr>tjjtjjtjdS|dkrtjdkr_dpbd}tjjtd |St d |d S( sGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" R s setup.cfgtglobals distutils.cfgtusertposixt.ts~/%spydistutils.cfgs7config_file() type must be 'local', 'global', or 'user'N( tostpathtjointdirnamet distutilst__file__tnamet expanduserRt ValueError(tkindtdot((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRs    c Cstjd|tj}|j|gx+|jD]\}}|d krttjd|||j|q9|j |stjd|||j |nx|jD]\}}|d kr&tjd||||j |||j |sRtjd|||j|qRqtjd|||||j |||qWq9Wtjd||st|d}|j|Wd QXnd S( sYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. sReading configuration from %ssDeleting section [%s] from %ssAdding new section [%s] to %ssDeleting %s.%s from %ss#Deleting empty [%s] section from %ssSetting %s.%s to %r in %ss Writing %stwN(RtdebugRtRawConfigParsertreadtitemstNonetinfotremove_sectiont has_sectiont add_sectiont remove_optiontoptionstsettopentwrite( tfilenametsettingstdry_runtoptstsectionR%toptiontvaluetf((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR!s8      cBs;eZdZd d dgZddgZd Zd ZRS(s<Abstract base class for commands that mess with config filess global-configtgs0save options to the site-wide distutils.cfg files user-configtus7save options to the current user's pydistutils.cfg files filename=R0s-configuration file to use (default=setup.cfg)cCsd|_d|_d|_dS(N(Rt global_configt user_configR)(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytinitialize_options\s  cCsg}|jr%|jtdn|jrD|jtdn|jdk rf|j|jn|s|jtdnt|dkrtd|n|\|_dS(NR R R is/Must specify only one configuration file option(R3tappendRR4R)RtlenR(R5t filenames((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytfinalize_optionsas   (s global-configR1s0save options to the site-wide distutils.cfg file(s user-configR2s7save options to the current user's pydistutils.cfg file(s filename=R0s-configuration file to use (default=setup.cfg)(t__name__t __module__t__doc__t user_optionstboolean_optionsR6R:(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRLs   cBsXeZdZdZddddgejZejd gZdZdZdZ RS(s#Save command-line options to a files1set an option in setup.cfg or another config filescommand=tcscommand to set an option forsoption=tos option to sets set-value=tssvalue of the optiontremovetrsremove (unset) the valuecCs5tj|d|_d|_d|_d|_dS(N(RR6RtcommandR.t set_valueRC(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR6s     cCsftj||jdks+|jdkr:tdn|jdkrb|j rbtdndS(Ns%Must specify --command *and* --options$Must specify --set-value or --remove(RR:RERR.RRFRC(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR:s  cCs=t|jii|j|jjdd6|j6|jdS(Nt-t_(RR)RFR.treplaceRER+(R5((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pytruns #(scommand=R@scommand to set an option for(soption=RAs option to set(s set-value=RBsvalue of the option(RCRDsremove (unset) the value( R;R<R=t descriptionRR>R?R6R:RJ(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyRss   (tdistutils.utilRRRtdistutils.errorsRRtsetuptools.extern.six.movesRt setuptoolsRt__all__RtFalseRRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/setopt.pyts    +'PK!ѽUrYYcommand/install.pycnu[ fc@sddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ de jfdYZge jj D]Z e dejkre ^qeje_ dS(i(tDistutilsArgErrorNtinstallcBseZdZejjddgZejjddgZddfddfgZe eZ d Z d Z d Z d Zed ZdZRS(s7Use easy_install to install the package, w/dependenciessold-and-unmanageablesTry not to use this!s!single-version-externally-manageds5used by system package builders to create 'flat' eggstinstall_egg_infocCstS(N(tTrue(tself((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pytttinstall_scriptscCstS(N(R(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyRRcCs&tjj|d|_d|_dS(N(torigRtinitialize_optionstNonetold_and_unmanageablet!single_version_externally_managed(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR s cCsXtjj||jr%t|_n/|jrT|j rT|j rTtdqTndS(NsAYou must specify --record or --root when building system packages(RRtfinalize_optionstrootRR trecordR(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR %s   cCs8|js|jr"tjj|Sd|_d|_dS(NR(RR RRthandle_extra_pathR t path_filet extra_dirs(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR0s cCsX|js|jr"tjj|S|jtjsJtjj|n |jdS(N( R R RRtrunt_called_from_setuptinspectt currentframetdo_egg_install(R((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR:s cCs|d krKd}tj|tjdkrGd}tj|ntStj|d}|d \}tj|}|j j dd}|dko|j d kS( s Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. s4Call stack not available. bdist_* commands may fail.t IronPythons6For best results, pass -X:Frames to enable call stack.iit__name__Rsdistutils.distt run_commandsN( R twarningstwarntplatformtpython_implementationRRtgetouterframest getframeinfot f_globalstgettfunction(t run_frametmsgtrestcallertinfot caller_module((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyREs    cCs|jjd}||jddd|jd|j}|jd|_|jjtjd|j d|jj dj g}t j r|jd t j n||_|jdt _ dS( Nt easy_installtargstxRRt.s*.eggt bdist_eggi(t distributiontget_command_classRRtensure_finalizedtalways_copy_fromt package_indextscantglobt run_commandtget_command_objt egg_outputt setuptoolstbootstrap_install_fromtinsertR+RR (RR*tcmdR+((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyR`s$      N(sold-and-unmanageableNsTry not to use this!(s!single-version-externally-managedNs5used by system package builders to create 'flat' eggs(Rt __module__t__doc__RRt user_optionsR tboolean_optionst new_commandstdictt_ncR R RRt staticmethodRR(((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyRs         i(tdistutils.errorsRRR5RRtdistutils.command.installtcommandRRR9t_installt sub_commandsR<RCRA(((s>/usr/lib/python2.7/site-packages/setuptools/command/install.pyts      l/PK!хcommand/dist_info.pyonu[ fc@sLdZddlZddlmZddlmZdefdYZdS(sD Create a dist_info directory As defined in the wheel specification iN(tCommand(tlogt dist_infocBs2eZdZdgZdZdZdZRS(screate a .dist-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dS(N(tNonetegg_base(tself((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pytinitialize_optionsscCsdS(N((R((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pytfinalize_optionsscCs|jd}|j|_|j|j|jtd d}tjdjt j j ||jd}|j |j|dS(Ntegg_infos .egg-infos .dist-infos creating '{}'t bdist_wheel( tget_finalized_commandRRtrunR tlenRtinfotformattostpathtabspathtegg2dist(RR t dist_info_dirR ((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyR s   "(s egg-base=RsLdirectory containing .egg-info directories (default: top of the source tree)(t__name__t __module__t descriptiont user_optionsRRR (((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyR s    (t__doc__Rtdistutils.coreRt distutilsRR(((s@/usr/lib/python2.7/site-packages/setuptools/command/dist_info.pyts PK!x(Lcommand/sdist.pycnu[ fc@sddlmZddljjZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZddZde ejfd YZdS( i(tlogN(tsixi(tsdist_add_defaultstccs@x9tjdD](}x|j|D] }|Vq)WqWdS(s%Find all files under revision controlssetuptools.file_findersN(t pkg_resourcestiter_entry_pointstload(tdirnameteptitem((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt walk_revctrlstsdistcBs/eZdZd"ddddfd#gZiZd d d d gZedeDZdZ dZ dZ dZ e ejdZdZejd$kpd%ejkod&knpd'ejkod(knZereZndZdZdZdZdZd ZRS()s=Smart sdist that finds anything supported by revision controlsformats=s6formats for source distribution (comma-separated list)s keep-temptks1keep the distribution tree around after creating sarchive file(s)s dist-dir=tdsFdirectory to put the source distribution archive(s) in [default: dist]Rs.rsts.txts.mdccs|]}dj|VqdS(s README{0}N(tformat(t.0text((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pys )scCs|jd|jd}|j|_|jjtjj|jd|jx!|j D]}|j|qaW|j t |j dg}x<|j D]1}dd|f}||kr|j|qqWdS(Ntegg_infos SOURCES.txtt dist_filesR R(t run_commandtget_finalized_commandtfilelisttappendtostpathtjoinRt check_readmetget_sub_commandstmake_distributiontgetattrt distributiont archive_files(tselftei_cmdtcmd_nameRtfiletdata((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pytrun+s  "   cCstjj||jdS(N(torigR tinitialize_optionst_default_to_gztar(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR'>scCs#tjdkrdSdg|_dS(Niiitbetaitgztar(iiiR)i(tsyst version_infotformats(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR(CscCs'|jtjj|WdQXdS(s% Workaround for #516 N(t_remove_os_linkR&R R(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRIs ccssdddY}ttd|}y t`Wntk rBnXz dVWd||k rnttd|nXdS(sG In a context, remove and restore os.link if it exists tNoValuecBseZRS((t__name__t __module__(((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR/WstlinkN((RRR2t Exceptiontsetattr(R/torig_val((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR.Ps    cCs[ytjj|Wn@tk rVtj\}}}|jjjdj nXdS(Nttemplate( R&R t read_templateR3R+texc_infottb_nextttb_frametf_localstclose(R t_ttb((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt__read_template_hackes  iiiiiicCs|jjr|jd}|jj|j|jjsxR|jD]D\}}}}|jjg|D]}tj j ||^qlqJWqndS(sgetting python filestbuild_pyN( Rthas_pure_modulesRRtextendtget_source_filestinclude_package_datat data_filesRRR(R R@R=tsrc_dirt filenamestfilename((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt_add_defaults_python|s  cCsOy*tjrtj|n tjWntk rJtjdnXdS(Ns&data_files contains unexpected objects(RtPY2Rt_add_defaults_data_filestsupert TypeErrorRtwarn(R ((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRKs   cCsKxD|jD]}tjj|r dSq W|jddj|jdS(Ns,standard file not found: should have one of s, (tREADMESRRtexistsRNR(R tf((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRs cCstjj|||tjj|d}ttdrltjj|rltj||j d|n|j dj |dS(Ns setup.cfgR2R( R&R tmake_release_treeRRRthasattrRPtunlinkt copy_fileRtsave_version_info(R tbase_dirtfilestdest((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyRRs ! cCsStjj|jstStj|jd}|j}WdQX|djkS(Ntrbs+# file GENERATED by distutils, do NOT edit ( RRtisfiletmanifesttFalsetiotopentreadlinetencode(R tfpt first_line((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt_manifest_is_not_generateds cCstjd|jt|jd}x|D]}tjryy|jd}Wqytk rutjd|q,qyXn|j }|j ds,| rq,n|j j |q,W|j dS(sRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. sreading manifest file '%s'RZsUTF-8s"%r not UTF-8 decodable -- skippingt#N(RtinfoR\R_RtPY3tdecodetUnicodeDecodeErrorRNtstript startswithRRR<(R R\tline((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyt read_manifests     N(sformats=Ns6formats for source distribution (comma-separated list)(s dist-dir=R sFdirectory to put the source distribution archive(s) in [default: dist](iii(ii(iii(ii(iii(R0R1t__doc__tNonet user_optionst negative_opttREADME_EXTENSIONSttupleROR%R'R(Rt staticmethodt contextlibtcontextmanagerR.t_sdist__read_template_hackR+R,thas_leaky_handleR7RIRKRRRRdRm(((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyR s:         (t distutilsRtdistutils.command.sdisttcommandR R&RR+R^Rutsetuptools.externRt py36compatRRtlistt_default_revctrlR (((s</usr/lib/python2.7/site-packages/setuptools/command/sdist.pyts      PK!Zٻ311command/build_ext.pycnu[ fc @s%ddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZddlmZddlmZdd lmZyddlmZed Wnek reZnXe d dd l mZd ZeZeZdZ ej!dkr;e"ZnIej#dkry#ddl$Z$e%e$dZZWqek rqXndZ&dZ'defdYZesej#dkrddddddddddd Z)n-dZ ddddddddddd Z)dZ*dS(iN(t build_ext(t copy_file(t new_compiler(tcustomize_compilertget_config_var(tDistutilsError(tlog(tLibrary(tsixsCython.Compiler.MaintLDSHARED(t _config_varscCsstjdkretj}z,dtd>RcCsNxGdtjDD]/\}}}d|kr6|S|dkr|SqWdS(s;Return the file extension for an abi3-compliant Extension()css(|]}|dtjkr|VqdS(iN(timpt C_EXTENSION(t.0R((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys Css.abi3s.pydN(Rt get_suffixes(tsuffixt_((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytget_abi3_suffixAs &  RcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z ed ZRS( cCs@|jd}|_tj|||_|r<|jndS(s;Build extensions in build directory, then copy if --inplaceiN(tinplacet _build_exttruntcopy_extensions_to_source(tselft old_inplace((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR'Ks   c Cs|jd}x|jD]}|j|j}|j|}|jd}dj|d }|j|}tj j|tj j |}tj j|j |} t | |d|j d|j|jr|j|ptj|tqqWdS(Ntbuild_pyt.itverbosetdry_run(tget_finalized_commandt extensionstget_ext_fullnametnametget_ext_filenametsplittjointget_package_dirtostpathtbasenamet build_libRR-R.t _needs_stubt write_stubtcurdirtTrue( R)R+texttfullnametfilenametmodpathtpackaget package_dirt dest_filenamet src_filename((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR(Ss   cCstj||}||jkr|j|}tjoLt|doLt}|rtd}|t| }|t}nt |t rt j j |\}}|jj|tStr|jrt j j|\}}t j j|d|Sn|S(Ntpy_limited_apit EXT_SUFFIXsdl-(R&R3text_mapRtPY3tgetattrR$t_get_config_var_837tlent isinstanceRR7R8tsplitexttshlib_compilertlibrary_filenametlibtypet use_stubst_links_to_dynamicR4R5(R)R@RAR?tuse_abi3tso_exttfntd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR3is"    cCs,tj|d|_g|_i|_dS(N(R&tinitialize_optionstNoneRPtshlibsRI(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRY~s   cCstj||jpg|_|j|jg|jD]}t|tr9|^q9|_|jrs|jnx&|jD]}|j|j |_ q}Wx#|jD]}|j }||j |<||j |j dd<|jr|j |pt}|otot|t }||_||_|j|}|_tjjtjj|j|}|r||jkr|jj|n|rtrtj|jkr|jjtjqqWdS(NR,i(R&tfinalize_optionsR0tcheck_extensions_listRNRR[tsetup_shlib_compilerR1R2t _full_nameRIR4tlinks_to_dynamictFalseRSRTR;R3t _file_nameR7R8tdirnameR5R:t library_dirstappendR=truntime_library_dirs(R)R?R@tltdtnsRAtlibdir((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR\s.       $cCsdtd|jd|jd|j}|_t||jdk rW|j|jn|j dk rx*|j D]\}}|j ||qpWn|j dk rx!|j D]}|j |qWn|j dk r|j|j n|jdk r |j|jn|jdk r,|j|jn|jdk rN|j|jntj||_dS(NRR.tforce(RRR.RjRPRt include_dirsRZtset_include_dirstdefinet define_macrotundeftundefine_macrot librariest set_librariesRdtset_library_dirstrpathtset_runtime_library_dirst link_objectstset_link_objectstlink_shared_objectt__get__(R)RR2tvaluetmacro((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR^s(% cCs&t|tr|jStj||S(N(RNRtexport_symbolsR&tget_export_symbols(R)R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR}scCs|j|j}z`t|tr4|j|_ntj|||jrr|jdj }|j ||nWd||_XdS(NR+( t_convert_pyx_sources_to_langRRNRRPR&tbuild_extensionR;R/R:R<(R)R?t _compilertcmd((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRs   csntjg|jD]}|j^qdj|jjdd dgtfd|jDS(s?Return true if 'ext' links to a dynamic lib in the same packageR,iRc3s|]}|kVqdS(N((R tlibname(tlibnamestpkg(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys s(tdicttfromkeysR[R_R5R4tanyRq(R)R?tlib((RRs@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR`s(&cCstj||jS(N(R&t get_outputst_build_ext__get_stubs_outputs(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRscsEfdjD}tj|j}td|DS(Nc3s<|]2}|jrtjjj|jjdVqdS(R,N(R;R7R8R5R:R_R4(R R?(R)(s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys scss|]\}}||VqdS(N((R tbasetfnext((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pys s(R0t itertoolstproductt!_build_ext__get_output_extensionstlist(R)t ns_ext_basestpairs((R)s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_stubs_outputss  ccs(dVdV|jdjr$dVndS(Ns.pys.pycR+s.pyo(R/toptimize(R)((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyt__get_output_extensionsscCstjd|j|tjj||jjdd}|rftjj|rft|dn|j st |d}|j djddd t d d tjj |jd d dt ddddt dddt ddddg|jn|rddlm}||gdddtd|j |jd j}|dkr||gd|dtd|j ntjj|r|j rtj|qndS(!Ns writing stub loader for %s to %sR,s.pys already exists! Please delete.tws sdef __bootstrap__():s- global __bootstrap__, __file__, __loader__s% import sys, os, pkg_resources, imps, dls: __file__ = pkg_resources.resource_filename(__name__,%r)s del __bootstrap__s if '__loader__' in globals():s del __loader__s# old_flags = sys.getdlopenflags()s old_dir = os.getcwd()s try:s( os.chdir(os.path.dirname(__file__))s$ sys.setdlopenflags(dl.RTLD_NOW)s( imp.load_dynamic(__name__,__file__)s finally:s" sys.setdlopenflags(old_flags)s os.chdir(old_dir)s__bootstrap__()Ri(t byte_compileRiRjR.t install_lib(RtinfoR_R7R8R5R4texistsRR.topentwritetif_dlR9Rbtclosetdistutils.utilRR>R/Rtunlink(R)t output_dirR?tcompilet stub_filetfRR((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyR<sP        (t__name__t __module__R'R(R3RYR\R^R}RR`RRRRaR<(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRJs         ic Cs8|j|j||||||||| | | | dS(N(tlinktSHARED_LIBRARY( R)tobjectstoutput_libnameRRqRdRfR|tdebugt extra_preargstextra_postargst build_tempt target_lang((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRxs    tstaticc Cs|dksttjj|\}} tjj| \}}|jdjdrg|d}n|j||||| dS(NtxRi( RZtAssertionErrorR7R8R4RORQt startswithtcreate_static_lib(R)RRRRqRdRfR|RRRRRRAR9R?((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRx,s  cCs"tjdkrd}nt|S(s In https://github.com/pypa/setuptools/pull/837, we discovered Python 3.3.0 exposes the extension suffix under the name 'SO'. iiR (iii(Rt version_infoR(R2((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pyRLDs (+R7RRRtdistutils.command.build_extRt _du_build_exttdistutils.file_utilRtdistutils.ccompilerRtdistutils.sysconfigRRtdistutils.errorsRt distutilsRtsetuptools.extensionRtsetuptools.externRtCython.Distutils.build_extR&t __import__t ImportErrorR RRRaRRSRRRR>R2tdlthasattrRR$RZRxRL(((s@/usr/lib/python2.7/site-packages/setuptools/command/build_ext.pytsX                   PK! command/py36compat.pycnu[ fc@sddlZddlmZddlmZddlmZddlmZdd dYZe ejdrdd d YZndS( iN(tglob(t convert_path(tsdist(tfiltertsdist_add_defaultscBseeZdZdZedZdZdZdZdZ dZ dZ d Z RS( s Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCsJ|j|j|j|j|j|j|jdS(s9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N(t_add_defaults_standardst_add_defaults_optionalt_add_defaults_pythont_add_defaults_data_filest_add_defaults_extt_add_defaults_c_libst_add_defaults_scripts(tself((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyt add_defaultss      cCsStjj|stStjj|}tjj|\}}|tj|kS(s Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False (tostpathtexiststFalsetabspathtsplittlistdir(tfspathRt directorytfilename((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyt_cs_path_exists(s cCs|j|jjg}x|D]}t|tr|}t}x7|D]/}|j|rDt}|jj |PqDqDW|s|j ddj |qq|j|r|jj |q|j d|qWdS(Ns,standard file not found: should have one of s, sstandard file '%s' not found( tREADMESt distributiont script_namet isinstancettupleRRtTruetfilelisttappendtwarntjoin(R t standardstfntaltstgot_it((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR9s    cCsLddg}x9|D]1}ttjjt|}|jj|qWdS(Ns test/test*.pys setup.cfg(RRRtisfileRRtextend(R toptionaltpatterntfiles((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRNs  cCs|jd}|jjr7|jj|jnxM|jD]B\}}}}x-|D]%}|jjtj j ||qZWqAWdS(Ntbuild_py( tget_finalized_commandRthas_pure_modulesRR(tget_source_filest data_filesR RRR"(R R,tpkgtsrc_dirt build_dirt filenamesR((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRTs  cCs|jjrx|jjD]}t|tret|}tjj|r|j j |qq|\}}x?|D]7}t|}tjj|rx|j j |qxqxWqWndS(N( Rthas_data_filesR0RtstrRRRR'RR (R titemtdirnameR4tf((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRds    cCs;|jjr7|jd}|jj|jndS(Nt build_ext(Rthas_ext_modulesR-RR(R/(R R:((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR uscCs;|jjr7|jd}|jj|jndS(Nt build_clib(Rthas_c_librariesR-RR(R/(R R<((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR zscCs;|jjr7|jd}|jj|jndS(Nt build_scripts(Rt has_scriptsR-RR(R/(R R>((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR s( t__name__t __module__t__doc__R t staticmethodRRRRRR R R (((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyR s       RcBseZRS((R@RA(((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyRs((( RRtdistutils.utilRtdistutils.commandRtsetuptools.extern.six.movesRRthasattr(((sA/usr/lib/python2.7/site-packages/setuptools/command/py36compat.pyts |PK!Pz{U  command/alias.pyonu[ fc@shddlmZddlmZddlmZmZmZdZdefdYZ dZ dS( i(tDistutilsOptionError(tmap(t edit_configt option_baset config_filecCsJx$dD]}||krt|SqW|j|gkrFt|S|S(s4Quote an argument for later parsing by shlex.split()t"t's\t#(RRs\R(treprtsplit(targtc((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pytshquotes    taliascBsUeZdZdZeZdgejZejdgZdZ dZ dZ RS( s3Define a shortcut that invokes one or more commandss0define a shortcut to invoke one or more commandstremovetrsremove (unset) the aliascCs#tj|d|_d|_dS(N(Rtinitialize_optionstNonetargsR(tself((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyRs  cCs>tj||jr:t|jdkr:tdndS(NisFMust specify exactly one argument (the alias name) when using --remove(Rtfinalize_optionsRtlenRR(R((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyR#s cCs |jjd}|jsNdGHdGHx"|D]}dt||fGHq,WdSt|jdkr|j\}|jrd}q||krdt||fGHdSd|GHdSn,|jd}djtt |jd}t |j ii||6d6|j dS( NtaliasessCommand Aliasess---------------ssetup.py aliasis No alias definition found for %rit ( t distributiontget_option_dictRt format_aliasRRRtjoinRR Rtfilenametdry_run(RRR tcommand((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pytrun+s&        (RRsremove (unset) the alias( t__name__t __module__t__doc__t descriptiontTruetcommand_consumes_argumentsRt user_optionstboolean_optionsRRR(((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyR s   cCs{||\}}|tdkr+d}n@|tdkrFd}n%|tdkrad}n d|}||d|S( Ntglobals--global-config tusers--user-config tlocalts --filename=%rR(R(tnameRtsourceR((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyRFs    N( tdistutils.errorsRtsetuptools.extern.six.movesRtsetuptools.command.setoptRRRR R R(((s</usr/lib/python2.7/site-packages/setuptools/command/alias.pyts  4PK!8 ))command/build_py.pycnu[ fc@sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn$ek rdd dYZnXd ejefd YZdd Zd ZdS(i(tglob(t convert_pathN(tsix(tmaptfiltert filterfalse(t Mixin2to3RcBseZedZRS(cCsdS(s do nothingN((tselftfilestdoctests((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun_2to3t(t__name__t __module__tTrueR (((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRstbuild_pycBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZedZRS(sXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsftjj||jj|_|jjp.i|_d|jkrP|jd=ng|_g|_dS(Nt data_files( torigRtfinalize_optionst distributiont package_datatexclude_package_datat__dict__t_build_py__updated_filest_build_py__doctests_2to3(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR!s    cCs|j r|j rdS|jr.|jn|jrN|j|jn|j|jt|j|jt|j|j t|j t j j |dddS(s?Build modules, packages, and copy data files to build directoryNtinclude_bytecodei(t py_modulestpackagest build_modulestbuild_packagestbuild_package_dataR RtFalseRRt byte_compileRRt get_outputs(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pytrun+s     cCs5|dkr"|j|_|jStjj||S(slazily compute data filesR(t_get_data_filesRRRt __getattr__(Rtattr((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR$?s cCsqtjr-t|tjr-|jd}ntjj||||\}}|rg|jj |n||fS(Nt.( RtPY2t isinstancet string_typestsplitRRt build_moduleRtappend(Rtmodulet module_filetpackagetoutfiletcopied((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR+FscCs)|jtt|j|jp"dS(s?Generate list of '(package,src_dir,build_dir,filenames)' tuples((tanalyze_manifesttlistRt_get_pkg_data_filesR(R((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR#Ps cCsx|j|}tjj|jg|jd}g|j||D]}tjj||^qG}||||fS(NR&(tget_package_dirtostpathtjoint build_libR*tfind_data_filestrelpath(RR/tsrc_dirt build_dirtfilet filenames((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR4Us %1cCs|j|j||}tt|}tjj|}ttj j |}tj|j j |g|}|j |||S(s6Return filenames for package's data files in 'src_dir'(t_get_platform_patternsRRRt itertoolstchaint from_iterableRR6R7tisfiletmanifest_filestgettexclude_data_files(RR/R<tpatternstglobs_expandedt globs_matchest glob_filesR((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR:cs  c Csx|jD]\}}}}x|D]}tjj||}|jtjj|tjj||}|j||\}} tjj|}| r#||jj kr#|j j |q#q#Wq WdS(s$Copy data files into build directoryN( RR6R7R8tmkpathtdirnamet copy_filetabspathRtconvert_2to3_doctestsRR,( RR/R<R=R?tfilenamettargettsrcfiletoutfR1((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRts c Cs\i|_}|jjsdSi}x0|jp2dD]}||t|j|sc3s!|]}|kr|VqdS(N((R|tfn(tbad(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys s(R3R@RRARBRCtsett_unique_everseen(RR/R<RRHt match_groupstmatchestkeepers((RRs?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRGs       cs>tj|jdg|j|g}fd|DS(s yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. R c3s*|] }tjjt|VqdS(N(R6R7R8R(R|R}(R<(s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pys s(RARBRF(tspecR/R<t raw_patterns((R<s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyR@s  (R R t__doc__RR"R$R+R#R4R:RR2RfRkRxR5RGt staticmethodR@(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs            ccst}|j}|dkrMxgt|j|D]}|||Vq1Wn;x8|D]0}||}||krT|||VqTqTWdS(sHList unique elements, preserving order. Remember all elements ever seen.N(RtaddR[Rt __contains__(titerabletkeytseentseen_addtelementtk((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRs         cCsOtjj|s|Sddlm}tjdj|}||dS(Ni(tDistutilsSetupErrors Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. (R6R7tisabstdistutils.errorsRttextwraptdedenttlstrip(R7Rtmsg((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyRWs ((Rtdistutils.utilRtdistutils.command.build_pytcommandRRR6R{RRnRRqRAtsetuptools.externRtsetuptools.extern.six.movesRRRtsetuptools.lib2to3_exRt ImportErrorR[RRW(((s?/usr/lib/python2.7/site-packages/setuptools/command/build_py.pyts"        PK!(q q command/install_egg_info.pyonu[ fc@s~ddlmZmZddlZddlmZddlmZddlmZddl Z dej efdYZ dS(i(tlogtdir_utilN(tCommand(t namespaces(tunpack_archivetinstall_egg_infocBsJeZdZdZd gZdZdZdZdZdZ RS( s.Install an .egg-info directory for the packages install-dir=tdsdirectory to install tocCs d|_dS(N(tNonet install_dir(tself((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytinitialize_optionsscCs{|jdd|jd}tjdd|j|jjd}|j|_t j j |j ||_ g|_dS(Nt install_libRtegg_infos .egg-info(RR(tset_undefined_optionstget_finalized_commandt pkg_resourcest DistributionRtegg_namet egg_versionR tsourcetostpathtjoinRttargettoutputs(R tei_cmdtbasename((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytfinalize_optionss  cCs|jdtjj|jrTtjj|j rTtj|jd|jn;tjj |jr|j tj |jfd|jn|jst j |jn|j |jdd|j|jf|jdS(NR tdry_runs Removing sCopying %s to %s((t run_commandRRtisdirRtislinkRt remove_treeRtexiststexecutetunlinkRtensure_directorytcopytreeRtinstall_namespaces(R ((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytrun!s +&  cCs|jS(N(R(R ((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyt get_outputs.scs)fd}tjj|dS(Ncs[x1dD])}|j|s,d||krdSqWjj|tjd|||S(Ns.svn/sCVS/t/sCopying %s to %s(s.svn/sCVS/(t startswithRRtappendRtdebug(tsrctdsttskip(R (sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pytskimmer3s  (RRR(R R0((R sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyR%1s (s install-dir=Rsdirectory to install to( t__name__t __module__t__doc__t descriptiont user_optionsR RR'R(R%(((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyR s   ( t distutilsRRRt setuptoolsRRtsetuptools.archive_utilRRt InstallerR(((sG/usr/lib/python2.7/site-packages/setuptools/command/install_egg_info.pyts   PK!command/bdist_wininst.pyonu[ fc@s/ddljjZdejfdYZdS(iNt bdist_wininstcBseZddZdZRS(icCs1|jj||}|dkr-d|_n|S(sj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 tinstallt install_lib(RRN(t distributiontreinitialize_commandtNoneR(tselftcommandtreinit_subcommandstcmd((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyRs     cCs.t|_ztjj|Wdt|_XdS(N(tTruet _is_runningtorigRtruntFalse(R((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyR s (t__name__t __module__RR (((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pyRs (tdistutils.command.bdist_wininstRRR (((sD/usr/lib/python2.7/site-packages/setuptools/command/bdist_wininst.pytsPK!tddcommand/upload.pyonu[ fc@s9ddlZddlmZdejfdYZdS(iN(tuploadRcBs)eZdZdZdZdZRS(sa Override default upload behavior to obtain password in a variety of different ways. cCsPtjj||jp"tj|_|jpF|jpF|j|_dS(N( torigRtfinalize_optionstusernametgetpasstgetusertpasswordt_load_password_from_keyringt_prompt_for_password(tself((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR s    cCs>y&td}|j|j|jSWntk r9nXdS(sM Attempt to load password from keyring. Suppress Exceptions. tkeyringN(t __import__t get_passwordt repositoryRt Exception(R R ((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyRs   cCs,ytjSWnttfk r'nXdS(sH Prompt for a password on the tty. Suppress Exceptions. N(RRtKeyboardInterrupt(R ((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyR#s(t__name__t __module__t__doc__RRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyRs  (Rtdistutils.commandRR(((s=/usr/lib/python2.7/site-packages/setuptools/command/upload.pyts PK!ACiicommand/saveopts.pyonu[ fc@s0ddlmZmZdefdYZdS(i(t edit_configt option_basetsaveoptscBseZdZdZdZRS(s#Save command-line options to a files7save supplied options to setup.cfg or other config filecCs|j}i}xt|jD]i}|dkr1qnxN|j|jD]7\}\}}|dkrG||j|i|sPK!U(e(ecommand/egg_info.pycnu[ fc@s@dZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+dZ,defdYZ-defdYZdefdYZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6e7d Z8d!Z9d"Z:dS(#sUsetuptools.command.egg_info Create a distribution's .egg-info directory and contentsi(tFileList(tDistutilsInternalError(t convert_path(tlogN(tsix(tmap(tCommand(tsdist(t walk_revctrl(t edit_config(t bdist_egg(tparse_requirementst safe_namet parse_versiont safe_versiont yield_linest EntryPointtiter_entry_pointst to_filename(tglob(t packagingcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkr|r|d7}qG|d||f7}qGnd}t|} x|| krA||} | dkr||d7}nJ| d kr||7}n1| d kr!|d} | | krB|| d krB| d} n| | krk|| d krk| d} nx*| | kr|| d kr| d} qnW| | kr|tj| 7}q4||d| !} d} | dd krd } | d} n| tj| 7} |d| f7}| }n|tj| 7}|d7}qW|sG||7}qGqGW|d7}tj|dtj tj BS(s Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. ts[^%s]is**s.*s (?:%s+%s)*it*t?t[t!t]t^s[%s]s\Ztflags( tsplittostpathtseptretescapet enumeratetlentcompilet MULTILINEtDOTALL(RtpattchunksR t valid_chartctchunkt last_chunktit chunk_lentchartinner_itinnert char_class((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyttranslate_pattern$sV                tegg_infocBseZdZddddgZdgZidd 6Zd ZedZej dZdZ dZ e dZ dZdZdZdZdZdZdZRS(s+create a distribution's .egg-info directorys egg-base=tesLdirectory containing .egg-info directories (default: top of the source tree)stag-datetds0Add date stamp (e.g. 20050528) to version numbers tag-build=tbs-Specify explicit tag to add to version numbersno-datetDs"Don't include date stamp [default]cCsLd|_d|_d|_d|_d|_d|_t|_d|_ dS(Ni( tNonetegg_namet egg_versiontegg_baseR5t tag_buildttag_datetFalsetbroken_egg_infotvtags(tself((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytinitialize_optionss       cCsdS(N((RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyttag_svn_revisionscCsdS(N((RCtvalue((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyREscCs@tj}|j|diR?R5N(t collectionst OrderedDictttagsR tdict(RCtfilenameR5((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytsave_version_infos  cCst|jj|_|j|_|j|_t|j}yKt |t j j }|ridnd}t t||j|jfWn3tk rtjjd|j|jfnX|jdkr|jj}|pijdtj|_n|jdt|jd|_|jtjkrXtjj|j|j|_nd|jkrt|jn|j|jj_ |jj }|dk r|j!|jj"kr|j|_#t|j|_$d|j_ ndS(Ns%s==%ss%s===%ss2Invalid distribution name or version syntax: %s-%sRR=s .egg-infot-(%R t distributiontget_nameR;RIRBttagged_versionR<R t isinstanceRtversiontVersiontlistR t ValueErrort distutilsterrorstDistutilsOptionErrorR=R:t package_dirtgetRtcurdirtensure_dirnameRR5Rtjointcheck_broken_egg_infotmetadatat _patched_disttkeytlowert_versiont_parsed_version(RCtparsed_versiont is_versiontspectdirstpd((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytfinalize_optionss8!   ! !  $ cCsl|r|j|||nLtjj|rh|dkrX| rXtjd||dS|j|ndS(sWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). s$%s not set in setup(), but %s existsN(t write_fileRRtexistsR:Rtwarnt delete_file(RCtwhatRKtdatatforce((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_or_delete_files  cCsdtjd||tjr.|jd}n|js`t|d}|j||jndS(sWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. swriting %s to %ssutf-8twbN( RtinfoRtPY3tencodetdry_runtopentwritetclose(RCRoRKRptf((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRks   cCs-tjd||js)tj|ndS(s8Delete `filename` (if not a dry run) after announcing its deleting %sN(RRtRwRtunlink(RCRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRns cCsE|jj}|jr4|j|jr4t|St||jS(N(RNt get_versionRBtendswithR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRPs cCs|j|j|jj}xXtdD]J}|jd||j}|||jtj j |j|jq)Wtj j |jd}tj j |r|j |n|j dS(Nsegg_info.writerst installersnative_libs.txt(tmkpathR5RNtfetch_build_eggRtrequiretresolvetnameRRR]RlRnt find_sources(RCRteptwritertnl((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytrun s  ,cCsBd}|jr||j7}n|jr>|tjd7}n|S(NRs-%Y%m%d(R>R?ttimetstrftime(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRIs   cCsJtjj|jd}t|j}||_|j|j|_dS(s"Generate SOURCES.txt manifest files SOURCES.txtN( RRR]R5tmanifest_makerRNtmanifestRtfilelist(RCtmanifest_filenametmm((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR s   cCs|jd}|jtjkr:tjj|j|}ntjj|rtjddddd||j |j |_ ||_ ndS(Ns .egg-infoRMiNs Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ( R;R=RR[RR]RlRRmR5RA(RCtbei((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR^(s   (s egg-base=R6sLdirectory containing .egg-info directories (default: top of the source tree)(stag-dateR7s0Add date stamp (e.g. 20050528) to version number(s tag-build=R8s-Specify explicit tag to add to version number(sno-dateR9s"Don't include date stamp [default](t__name__t __module__t descriptiont user_optionstboolean_optionst negative_optRDtpropertyREtsetterRLRjR@RrRkRnRPRRIRR^(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR5ws*     /       RcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(cCs|j|\}}}}|dkrw|jddj|x|D](}|j|sHtjd|qHqHWnx|dkr|jddj|xO|D](}|j|stjd|qqWn|dkr/|jd dj|x|D](}|j|stjd |qqWn|d kr|jd dj|x|D](}|j|s\tjd |q\q\Wnd|dkr|jd|dj|fx5|D].}|j ||stjd||qqWn|dkr[|jd|dj|fx|D].}|j ||s&tjd||q&q&Wn|dkr|jd||j |stjd|qnR|dkr|jd||j |stjd|qnt d|dS(Ntincludesinclude t s%warning: no files found matching '%s'texcludesexclude s9warning: no previously-included files found matching '%s'sglobal-includesglobal-include s>warning: no files found matching '%s' anywhere in distributionsglobal-excludesglobal-exclude sRwarning: no previously-included files matching '%s' found anywhere in distributionsrecursive-includesrecursive-include %s %ss:warning: no files found matching '%s' under directory '%s'srecursive-excludesrecursive-exclude %s %ssNwarning: no previously-included files matching '%s' found under directory '%s'tgraftsgraft s+warning: no directories found matching '%s'tprunesprune s6no previously-included directories found matching '%s's'this cannot happen: invalid action '%s'(t_parse_template_linet debug_printR]RRRmRtglobal_includetglobal_excludetrecursive_includetrecursive_excludeRRR(RCtlinetactiontpatternstdirt dir_patterntpattern((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytprocess_template_line;sd                         cCsrt}xett|jdddD]D}||j|r&|jd|j||j|=t}q&q&W|S(s Remove all files from the file list that match the predicate. Return True if any matching files were removed iis removing (R@trangeR$tfilesRtTrue(RCt predicatetfoundR.((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt _remove_filess&  cCsHgt|D]}tjj|s |^q }|j|t|S(s#Include files that match 'pattern'.(RRRtisdirtextendtbool(RCRR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs1 cCst|}|j|jS(s#Exclude files that match 'pattern'.(R4Rtmatch(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs cCsftjj|d|}gt|dtD]}tjj|s+|^q+}|j|t|S(sN Include all files anywhere in 'dir/' that match the pattern. s**t recursive(RRR]RRRRR(RCRRt full_patternR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  cCs.ttjj|d|}|j|jS(sM Exclude any file anywhere in 'dir/' that match the pattern. s**(R4RRR]RR(RCRRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsOgt|D]%}tjj|D] }|^q#q }|j|t|S(sInclude all files from 'dir/'.(RRVRtfindallRR(RCRt match_dirtitemR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs % cCs+ttjj|d}|j|jS(sFilter out files from 'dir/'.s**(R4RRR]RR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsy|jdkr|jnttjjd|}g|jD]}|j|rA|^qA}|j|t |S(s Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. s**N( tallfilesR:RR4RRR]RRR(RCRRR{R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  + cCs+ttjjd|}|j|jS(sD Exclude all files anywhere that match the pattern. s**(R4RRR]RR(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCsN|jdr|d }nt|}|j|rJ|jj|ndS(Ns i(R~Rt _safe_pathRtappend(RCRR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs   cCs |jjt|j|dS(N(RRtfilterR(RCtpaths((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRscCs"tt|j|j|_dS(s Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N(RTRRR(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_repairscCsd}tj|}|dkr6tjd|tStj|d}|dkrktj||dtSy,tjj |stjj |rt SWn*t k rtj||t j nXdS(Ns!'%s' not %s encodable -- skippings''%s' in unexpected encoding -- skippingsutf-8(t unicode_utilstfilesys_decodeR:RRmR@t try_encodeRRRlRtUnicodeEncodeErrortsystgetfilesystemencoding(RCRtenc_warntu_patht utf8_path((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs  $ (RRRRRRRRRRRRRRRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR8s I        RcBseeZdZdZdZdZdZdZdZe dZ dZ d Z RS( s MANIFEST.incCs(d|_d|_d|_d|_dS(Ni(t use_defaultsRt manifest_onlytforce_manifest(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRDs   cCsdS(N((RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRjscCst|_tjj|js.|jn|jtjj|jrZ|j n|j |jj |jj |jdS(N( RRRRRlRtwrite_manifestt add_defaultsttemplatet read_templatetprune_file_listtsorttremove_duplicates(RC((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs       cCs"tj|}|jtjdS(Nt/(RRtreplaceRR (RCR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_manifest_normalizescCsb|jjg|jjD]}|j|^q}d|j}|jt|j|f|dS(so Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. swriting manifest file '%s'N(RRRRRtexecuteRk(RCR{Rtmsg((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs ( cCs&|j|s"tj||ndS(N(t_should_suppress_warningRRm(RCR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRm$scCstjd|S(s; suppress missing-file warnings from sdist sstandard file .*not found(R!R(R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR(scCstj||jj|j|jj|jtt}|r[|jj|n"t j j |jr}|j n|j d}|jj|jdS(NR5(RRRRRRRTRRRRRlt read_manifesttget_finalized_commandRR5(RCtrcfilestei_cmd((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR/s  cCsy|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS(Ntbuilds(^|s)(RCS|CVS|\.svn)tis_regexi( RRNt get_fullnameRRt build_baseR!R"RR texclude_pattern(RCRtbase_dirR ((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR;s( RRRRDRjRRRRmt staticmethodRRR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRs     cCsGdj|}|jd}t|d}|j|WdQXdS(s{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. s sutf-8RsN(R]RvRxRy(RKtcontentsR{((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRkEscCstjd||js|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j|j |ndS(Ns writing %stzip_safe(RRtRwRNR_R<RRR;Rtwrite_pkg_infoR5tgetattrR:R twrite_safety_flag(tcmdtbasenameRKR_toldvertoldnametsafe((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyRRs  cCs&tjj|r"tjdndS(NssWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.(RRRlRRm(RRRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwarn_depends_obsoleteescCs;t|p d}d}t||}|j|dS(NcSs|dS(Ns ((R((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytoR((RRt writelines(tstreamtreqstlinest append_cr((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt_write_requirementsms cCs|j}tj}t||j|jp1i}x>t|D]0}|jdjt t|||qAW|j d||j dS(Ns [{extra}] t requirements( RNRtStringIORtinstall_requirestextras_requiretsortedRytformattvarsRrtgetvalue(RRRKtdistRpRtextra((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_requirementsts  cCs<tj}t||jj|jd||jdS(Nssetup-requirements(tioRRRNtsetup_requiresRrR(RRRKRp((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_setup_requirementss cCsetjg|jjD]}|jddd^q}|jd|djt|ddS(Nt.iistop-level namess (RJtfromkeysRNtiter_distribution_namesRRkR]R(RRRKtktpkgs((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytwrite_toplevel_namess2cCst|||tdS(N(t write_argR(RRRK((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt overwrite_argscCsgtjj|d}t|j|d}|dk rMdj|d}n|j||||dS(Nis (RRtsplitextRRNR:R]Rr(RRRKRqtargnameRF((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyR s  cCs|jj}t|tjs*|dkr3|}n|dk rg}xt|jD]n\}}t|tjstj ||}dj tt t |j }n|jd||fqXWdj |}n|jd||tdS(Ns s [%s] %s Rs entry points(RNt entry_pointsRQRt string_typesR:RtitemsRt parse_groupR]RtstrtvaluesRRrR(RRRKRRptsectionR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pyt write_entriess   'cCs}tjdttjjdrytjdC}x9|D]1}tj d|}|r;t |j dSq;WWdQXndS(sd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. s$get_pkg_info_revision is deprecated.sPKG-INFOsVersion:.*-r(\d+)\s*$iNi( twarningsRmtDeprecationWarningRRRlRRxR!Rtinttgroup(R{RR((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytget_pkg_info_revisions  (;t__doc__tdistutils.filelistRt _FileListtdistutils.errorsRtdistutils.utilRRVRRR!RRRRRGtsetuptools.externRtsetuptools.extern.six.movesRt setuptoolsRtsetuptools.command.sdistRRtsetuptools.command.setoptR tsetuptools.commandR t pkg_resourcesR R R RRRRRtsetuptools.unicode_utilsRtsetuptools.globRRR4R5RRkRRRRRR R R@R RR(((s?/usr/lib/python2.7/site-packages/setuptools/command/egg_info.pytsN         : SI       PK! +K K command/install_scripts.pycnu[ fc@ssddlmZddljjZddlZddlZddlm Z m Z m Z dejfdYZdS(i(tlogN(t Distributiont PathMetadatatensure_directorytinstall_scriptscBs,eZdZdZdZddZRS(s;Do normal script install, plus any egg_info wrapper scriptscCstjj|t|_dS(N(torigRtinitialize_optionstFalsetno_ep(tself((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR sc Csfddljj}|jd|jjr>tjj|n g|_ |j rTdS|j d}t |j t|j |j|j|j}|j d}t|dd}|j d}t|dt}|j}|rd}|j}n|tjkr|g}n|j}|jjj|} x-|j|| jD]} |j| qKWdS(Nitegg_infot build_scriptst executablet bdist_wininstt _is_runnings python.exe(tsetuptools.command.easy_installtcommandt easy_installt run_commandt distributiontscriptsRRtruntoutfilesRtget_finalized_commandRtegg_baseRR tegg_namet egg_versiontgetattrtNoneRt ScriptWritertWindowsScriptWritertsysR tbesttcommand_spec_classt from_paramtget_argst as_headert write_script( R teitei_cmdtdisttbs_cmdt exec_paramtbw_cmdt is_wininsttwritertcmdtargs((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyRs2        ttc Gsddlm}m}tjd||jtjj|j|}|j j ||}|j st |t |d|} | j|| j||d|ndS(s1Write an executable file to the scripts directoryi(tchmodt current_umasksInstalling %s script to %stwiN(RR1R2Rtinfot install_dirtostpathtjoinRtappendtdry_runRtopentwritetclose( R t script_nametcontentstmodetignoredR1R2ttargettmasktf((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR%3s     (t__name__t __module__t__doc__RRR%(((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyR s  #( t distutilsRt!distutils.command.install_scriptsRRRR6Rt pkg_resourcesRRR(((sF/usr/lib/python2.7/site-packages/setuptools/command/install_scripts.pyts   PK!n[rrcommand/__init__.pycnu[ fc@sdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrdejds   PK!ACiicommand/saveopts.pycnu[ fc@s0ddlmZmZdefdYZdS(i(t edit_configt option_basetsaveoptscBseZdZdZdZRS(s#Save command-line options to a files7save supplied options to setup.cfg or other config filecCs|j}i}xt|jD]i}|dkr1qnxN|j|jD]7\}\}}|dkrG||j|i|sPK!Ʌu wheel.pycnu[ fc@sdZddlmZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z ddlm ZddlmZddlmZejd ejjZd Zd Zd efd YZdS(sWheels support.i(t get_platformN(t Distributiont PathMetadatat parse_version(tPY3(R(t pep425tags(twrite_requirementss^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$stry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c CsOxtj|D]\}}}tjj||}xK|D]C}tjj||}tjj|||}tj||q;Wxttt|D]e\} } tjj|| }tjj||| }tjj |stj|||| =qqWqWx@tj|dt D])\}}}| s:t tj |qWdS(sDMove everything under `src_dir` to `dst_dir`, and delete the former.ttopdownN( tostwalktpathtrelpathtjointrenamestreversedtlistt enumeratetexiststTruetAssertionErrortrmdir( tsrc_dirtdst_dirtdirpathtdirnamest filenamestsubdirtftsrctdsttntd((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pytunpacks %% tWheelcBs5eZdZdZdZdZdZRS(cCswttjj|}|dkr7td|n||_x0|jjD]\}}t |||qSWdS(Nsinvalid wheel name: %r( t WHEEL_NAMERR tbasenametNonet ValueErrortfilenamet groupdicttitemstsetattr(tselfR&tmatchtktv((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt__init__7s   cCs7tj|jjd|jjd|jjdS(s>List tags (py_version, abi, platform) supported by this wheel.t.(t itertoolstproductt py_versiontsplittabitplatform(R*((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyttags?scs/tjtfd|jDtS(s5Is the wheel is compatible with the current platform?c3s!|]}|krtVqdS(N(R(t.0tt(tsupported_tags(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys Hs(Rt get_supportedtnextR6tFalse(R*((R9s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt is_compatibleEs cCsAtd|jd|jd|jdkr-dntjdS(Nt project_nametversionR5tanys.egg(RR>R?R5R$Rtegg_name(R*((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyRAJs$c stj|jd|j|jf}d|d|fd}|d}|d}t|jd}td|kotd knstd |ntj |j |tj j |t j|d t|d tttjfd jD}tj j |d}tj|tjtj j |dtj j |dtdtdd|} t| jddtj j |dtj j |tj j d} tj j| rtj j |dd} tj | xstj| D]b} | jdrtjtj j | | q\tjtj j | | tj j | | q\Wtj| nx:t tj jfdd!DD]} t!| |qWtj jr1tjntj j |d}tj j|rt"|}|j#j$}WdQXx|D]}tj j ||j$d}tj j |d}tj j|rtj j| rt"|d }|j%t&WdQXqqWnWdQXdS("s"Install wheel as an egg directory.s%s-%ss %s.dist-infos%s.datacscjd|fD}tr7|jjdn |j}tjjj|SWdQXdS(Ns%s/%ssutf-8(topenRtreadtdecodetemailtparsertParsertparsestr(tnametfptvalue(t dist_infotzf(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt get_metadataVs'tWHEELtMETADATAs Wheel-Versions1.0s2.0dev0s$unsupported wheel format version: %stmetadatacSsd|_t|S(N(R$tmarkertstr(treq((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pytraw_reqls c sJi|]@}ttfdtj|fD|qS(c3s!|]}|kr|VqdS(N((R7RT(tinstall_requires(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys rs(Rtsortedtmaptrequires(R7textra(tdistRVRU(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys qs sEGG-INFOsPKG-INFOtattrsRVtextras_requiretegg_infos requires.txttscriptss.pycc3s$|]}tjj|VqdS(N(RR R (R7R(t dist_data(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys stdatatheaderstpurelibtplatlibsnamespace_packages.txtNR/s __init__.pytw(RaRbRcRd('tzipfiletZipFileR&R>R?RtgetR%Rtmkdirt extractallR R Rt from_locationRRRWRXRYtextrastrenametSetuptoolsDistributiontdictRtget_command_objR$RtlistdirtendswithtunlinkRtfilterR RBRCR3twritetNAMESPACE_PACKAGE_INIT(R*tdestination_eggdirt dist_basenameRNtwheel_metadatat dist_metadatat wheel_versionR]R^t setup_disttdist_data_scriptstegg_info_scriptstentryRtnamespace_packagesRJtmodtmod_dirtmod_init((R[R`RLRVRURMs4/usr/lib/python2.7/site-packages/setuptools/wheel.pytinstall_as_eggPsr    (    !        %(t__name__t __module__R.R6R=RAR(((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyR!5s     (t__doc__tdistutils.utilRRER0RtreRft pkg_resourcesRRRtsetuptools.extern.sixRt setuptoolsRnRtsetuptools.command.egg_infoRtcompiletVERBOSER+R"RvR tobjectR!(((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyts"      PK!KcSS depends.pycnu[ fc@sddlZddlZddlZddlmZddlmZmZmZmZddl m Z dddd gZ ddd YZ dd Zddd Zdd ZdZedS(iN(t StrictVersion(t PKG_DIRECTORYt PY_COMPILEDt PY_SOURCEt PY_FROZENi(tBytecodetRequiret find_moduletget_module_constanttextract_constantcBsYeZdZdd d dZdZdZd ddZd dZd dZ RS( s7A prerequisite to building or installing a distributiontcCsn|dkr!|dk r!t}n|dk rQ||}|dkrQd}qQn|jjt|`dS(Nt __version__(tNoneRt__dict__tupdatetlocalstself(Rtnametrequested_versiontmodulethomepaget attributetformat((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt__init__s     cCs*|jdk r#d|j|jfS|jS(s0Return full package/distribution name, w/versions%s-%sN(RR R(R((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt full_name scCs=|jdkp<|jdkp<t|dko<||jkS(s%Is 'version' sufficiently up-to-date?tunknownN(RR RtstrR(Rtversion((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt version_ok&sRcCs|jdkr]y6t|j|\}}}|r@|jn|SWq]tk rYdSXnt|j|j||}|dk r||k r|jdk r|j|S|S(sGet 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 RRtcloset ImportErrorRR(Rtpathstdefaulttftptitv((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt get_version+s   ' cCs|j|dk S(s/Return true if dependency is present on 'paths'N(R%R (RR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt is_presentFscCs,|j|}|dkrtS|j|S(s>Return true if dependency is present and up-to-date on 'paths'N(R%R tFalseR(RRR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt is_currentJs N( t__name__t __module__t__doc__R RRRR%R&R((((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRs   c Cs|jd}x|r|jd}tj||\}}\}}}} |tkrv|pgdg}|g}q|rtd||fqqW| S(s7Just like 'imp.find_module()', but with package supportt.iRsCan't find %r in %s(tsplittpoptimpRRR( RRtpartstpartR!tpathtsuffixtmodetkindtinfo((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRRs (  c Csy%t||\}}\}}}Wntk r9dSXz|tkrh|jdtj|} n|tkrtj |} no|t krt |j|d} nH|t j krtj||||||fntt j ||dSWd|r |jnXt| ||S(sFind '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'.itexecN(RRR RtreadtmarshaltloadRR/tget_frozen_objectRtcompiletsystmodulest load_moduletgetattrRR ( RtsymbolR RR!R2R3R4R5tcode((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRes$%     "c Cs||jkrdSt|jj|}d}d}d}|}xpt|D]b}|j} |j} | |kr|j| }qP| |kr| |ks| |kr|S|}qPWdS(sExtract 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'. iZiaidN(tco_namesR tlisttindexRtopcodetargt co_consts( RBRAR tname_idxt STORE_NAMEt STORE_GLOBALt LOAD_CONSTtconstt byte_codetopRG((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyR s    $cCsXtjjd r&tjdkr&dSd}x%|D]}t|=tj|q3WdS(s Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. tjavatcliNR R(R R(R=tplatformt startswithtglobalst__all__tremove(t incompatibleR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt_update_globalss "  ((R=R/R9tdistutils.versionRRRRRt py33compatRRURR RRR RX(((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyts   "C " $ PK!K  monkey.pyonu[ fc@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ dZdZdZdZd Zd Zd Zd Zd ZdS(s Monkey patching of distutils. iN(t import_module(tsixcCs-tjdkr |f|jStj|S(sm Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. tJython(tplatformtpython_implementationt __bases__tinspecttgetmro(tcls((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt_get_mros cCsCt|tjrtnt|tjr0tnd}||S(NcSsdS(N(tNone(titem((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt*t(t isinstanceRt class_typestget_unpatched_classttypest FunctionTypetget_unpatched_function(R tlookup((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt get_unpatched&s cCsQdt|D}t|}|jjdsMd|}t|n|S(sProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css'|]}|jjds|VqdS(t setuptoolsN(t __module__t startswith(t.0R((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pys 6st distutilss(distutils has already been patched by %r(R tnextRRtAssertionError(Rtexternal_basestbasetmsg((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR/s  cCsWtjtj_tjd k}|r6tjtj_ntjd kpd tjko_dknpdtjko~dknpdtjkodkn}|rd }|tjj _ nt t x/tj tjtjfD]}tj j|_qWtjjtj_tjjtj_d tjkrLtjjtjd _ntdS(Niiiii iiishttps://upload.pypi.org/legacy/sdistutils.command.build_ext(iii(iii (ii(iii(ii(iii(ii(iii(RtCommandRtcoretsyst version_infotfindalltfilelisttconfigt PyPIRCCommandtDEFAULT_REPOSITORYt+_patch_distribution_metadata_write_pkg_filet+_patch_distribution_metadata_write_pkg_infotdisttcmdt Distributiont extensiont Extensiontmodulest#patch_for_msvc_specialized_compiler(thas_issue_12885tneeds_warehouset warehousetmodule((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_allAs(cCstjjtjj_dS(sDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN(RR+twrite_pkg_fileRtDistributionMetadata(((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR)kscCsFdtjd kodkn}|s-dStjjtjj_dS(s Workaround issue #197 - Python 3 prior to 3.2.2 uses an environment-local encoding to save the pkg_info. Monkey-patch its write_pkg_info method to correct this undesirable behavior. iiN(i(iii(R"R#RR+twrite_pkg_infoRR8(tenvironment_local((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR*rs#cCs9t||}t|jd|t|||dS(s Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. t unpatchedN(tgetattrtvarst setdefaulttsetattr(t replacementt target_modt func_nametoriginal((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_funcscCs t|dS(NR;(R<(t candidate((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyRscstdtjdkr"dSfd}tj|d}tj|d}y$t|dt|dWntk rnXyt|d Wntk rnXyt|d Wntk rnXdS( s\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. ssetuptools.msvctWindowsNcsqd|krdnd}||jd}t|}t|}t||sdt|n|||fS(sT Prepare the parameters for patch_func to patch indicated function. tmsvc9tmsvc9_tmsvc14_t_(tlstripR<Rthasattrt ImportError(tmod_nameRBt repl_prefixt repl_nametrepltmod(tmsvc(s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_paramss sdistutils.msvc9compilersdistutils._msvccompilertfind_vcvarsalltquery_vcvarsallt _get_vc_envtgen_lib_options(RRtsystemt functoolstpartialRDRM(RTRGtmsvc14((RSs5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR1s&     (t__doc__R"tdistutils.filelistRRRRZt importlibRRtsetuptools.externRRt__all__R RRR6R)R*RDRR1(((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyts&          *    PK!namespaces.pyonu[ fc@sqddlZddlmZddlZddlmZejjZdddYZ de fdYZ dS( iN(tlog(tmapt Installerc Bs_eZdZdZdZdZdZdZdZdZ dZ e dZ RS(s -nspkg.pthcCs|j}|sdStjj|j\}}||j7}|jj|tj d|t |j |}|j rt |dSt|d}|j|WdQXdS(Ns Installing %stwt(t_get_all_ns_packagestostpathtsplitextt _get_targett nspkg_exttoutputstappendRtinfoRt_gen_nspkg_linetdry_runtlisttopent writelines(tselftnsptfilenametexttlinestf((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pytinstall_namespacess    cCsbtjj|j\}}||j7}tjj|sAdStjd|tj|dS(Ns Removing %s( RRRRR texistsRR tremove(RRR((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pytuninstall_namespaces!s  cCs|jS(N(ttarget(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR)ssimport sys, types, oss#has_mfs = sys.version_info > (3, 5)s$p = os.path.join(%(root)s, *%(pth)r)s4importlib = has_mfs and __import__('importlib.util')s-has_mfs and __import__('importlib.machinery')sm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))sCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))s7mp = (m or []) and m.__dict__.setdefault('__path__',[])s(p not in mp) and mp.append(p)s4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS(Ns$sys._getframe(1).f_locals['sitedir']((R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyt _get_rootCscCs|t|}t|jd}|j}|j}|jd\}}}|rd||j7}ndj|tdS(Nt.t;s ( tstrttupletsplitRt _nspkg_tmplt rpartitiont_nspkg_tmpl_multitjointlocals(Rtpkgtpthtroott tmpl_linestparenttseptchild((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR Fs   cCs.|jjpg}ttt|j|S(s,Return sorted list of all package namespaces(t distributiontnamespace_packagestsortedtflattenRt _pkg_names(Rtpkgs((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRQsccs8|jd}x"|r3dj|V|jqWdS(s Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True RN(R"R&tpop(R(tparts((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR3Vs  ( simport sys, types, oss#has_mfs = sys.version_info > (3, 5)s$p = os.path.join(%(root)s, *%(pth)r)s4importlib = has_mfs and __import__('importlib.util')s-has_mfs and __import__('importlib.machinery')sm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))sCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))s7mp = (m or []) and m.__dict__.setdefault('__path__',[])s(p not in mp) and mp.append(p)(s4m and setattr(sys.modules[%(parent)r], %(child)r, m)( t__name__t __module__R RRRR#R%RR Rt staticmethodR3(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR s$     tDevelopInstallercBseZdZdZRS(cCstt|jS(N(treprR tegg_path(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRgscCs|jS(N(tegg_link(R((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyRjs(R7R8RR(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyR:fs (( Rt distutilsRt itertoolstsetuptools.extern.six.movesRtchaint from_iterableR2RR:(((s9/usr/lib/python2.7/site-packages/setuptools/namespaces.pyts   [PK!\'py33compat.pycnu[ fc@sddlZddlZddlZyddlZWnek rMdZnXddlmZddlm Z ej ddZ de fdYZ eede Zeed e jjZdS( iN(tsix(t html_parsertOpArgs opcode argtBytecode_compatcBseZdZdZRS(cCs ||_dS(N(tcode(tselfR((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyt__init__sccstjd|jj}t|jj}d}d}x||kr||}|tjkr||d||dd|}|d7}|tjkrtjd}||d}q9qnd }|d7}t ||Vq9Wd S( s>Yield '(op,arg)' pair for each operation in code object 'code'tbiiiiiiiN( tarrayRtco_codetlentdist HAVE_ARGUMENTt EXTENDED_ARGRt integer_typestNoneR(Rtbytesteoftptrt extended_argtoptargt long_type((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyt__iter__s  "    (t__name__t __module__RR(((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyRs tBytecodetunescape(R Rt collectionsthtmlt ImportErrorRtsetuptools.externRtsetuptools.extern.six.movesRt namedtupleRtobjectRtgetattrRt HTMLParserR(((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyts     "PK!A|<D!D!ssl_support.pycnu[ fc@s/ddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z yddl Z Wnek rdZ nXdddddgZd jjZyejjZejZWnek reZZnXe dk oeeefkZydd l mZmZWnUek ry$dd lmZdd lmZWqek rdZdZqXnXesd efdYZnesddZdZndefdYZdefdYZ ddZ!dZ"e"dZ#dZ$dZ%dS(iN(turllibt http_clienttmaptfilter(tResolutionErrortExtractionErrortVerifyingHTTPSHandlertfind_ca_bundlet is_availablet cert_pathst opener_fors /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem (tCertificateErrortmatch_hostname(R (R R cBseZRS((t__name__t __module__(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR 5sic CsRg}|stS|jd}|d}|d}|jd}||krgtdt|n|s|j|jkS|dkr|jdnY|jds|jdr|jtj |n"|jtj |j dd x$|D]}|jtj |qWtj d d j |d tj } | j|S( spMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 t.iit*s,too many wildcards in certificate DNS name: s[^.]+sxn--s\*s[^.]*s\As\.s\Z(tFalsetsplittcountR treprtlowertappendt startswithtretescapetreplacetcompiletjoint IGNORECASEtmatch( tdnthostnamet max_wildcardstpatstpartstleftmostt remaindert wildcardstfragtpat((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt_dnsname_match;s*    " &cCs[|stdng}|jdd }xC|D];\}}|dkr4t||r_dS|j|q4q4W|sxc|jddD]L}xC|D];\}}|dkrt||rdS|j|qqWqWnt|dkrtd|d jtt|fn;t|dkrKtd ||d fn td dS(s=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. sempty or no certificatetsubjectAltNametDNSNtsubjectt commonNameis&hostname %r doesn't match either of %ss, shostname %r doesn't match %ris=no appropriate commonName or subjectAltName fields were found((( t ValueErrortgetR)RtlenR RRR(tcertR tdnsnamestsantkeytvaluetsub((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR os.  %cBs eZdZdZdZRS(s=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|dS(N(t ca_bundlet HTTPSHandlert__init__(tselfR7((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9s csjfd|S(Ncst|j|S(N(tVerifyingHTTPSConnR7(thosttkw(R:(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytt(tdo_open(R:treq((R:s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyt https_opens(R Rt__doc__R9RB(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRs R;cBs eZdZdZdZRS(s@Simple verifying connection: no auth, subclasses, timeouts, etc.cKs tj|||||_dS(N(tHTTPSConnectionR9R7(R:R<R7R=((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9scCs+tj|j|jft|dd}t|drjt|ddrj||_|j|j }n |j}tt drt j d|j }|j |d||_n$t j |dt jd|j |_yt|jj|Wn4tk r&|jjtj|jjnXdS( Ntsource_addresst_tunnelt _tunnel_hosttcreate_default_contexttcafiletserver_hostnamet cert_reqstca_certs(tsockettcreate_connectionR<tporttgetattrtNonethasattrtsockRFRGtsslRHR7t wrap_sockett CERT_REQUIREDR t getpeercertR tshutdownt SHUT_RDWRtclose(R:RSt actual_hosttctx((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytconnects$$!      (R RRCR9R](((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR;s cCs"tjjt|ptjS(s@Get a urlopen() replacement that uses ca_bundle for verification(Rtrequestt build_openerRRtopen(R7((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR s cs"tjfd}|S(Ncs+tds$||_njS(Ntalways_returns(RRRa(targstkwargs(tfunc(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytwrappers(t functoolstwraps(RdRe((Rds:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytoncescsnyddl}Wntk r$dSXd|jffdY}|jd|jd|jS(NitCertFilecs&eZfdZfdZRS(cs't|jtj|jdS(N(tsuperR9tatexittregisterRZ(R:(Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyR9scs/yt|jWntk r*nXdS(N(RjRZtOSError(R:(Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRZs (R RR9RZ((Ri(s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRistCAtROOT(t wincertstoret ImportErrorRQRitaddstoretname(Rpt _wincerts((Ris:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytget_win_certfiles    cCs4ttjjt}tp3t|dp3tS(s*Return an existing CA bundle path, or NoneN( RtostpathtisfileR RutnextRQt_certifi_where(textant_cert_paths((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRs cCs5ytdjSWntttfk r0nXdS(Ntcertifi(t __import__twhereRqRR(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pyRzs(&RvRMRkRRftsetuptools.extern.six.movesRRRRt pkg_resourcesRRRTRqRQt__all__tstripRR R^R8RDtAttributeErrortobjectRR R tbackports.ssl_match_hostnameR.R)RR;R RhRuRRz(((s:/usr/lib/python2.7/site-packages/setuptools/ssl_support.pytsP     "          4 ) (   PK!KcSS depends.pyonu[ fc@sddlZddlZddlZddlmZddlmZmZmZmZddl m Z dddd gZ ddd YZ dd Zddd Zdd ZdZedS(iN(t StrictVersion(t PKG_DIRECTORYt PY_COMPILEDt PY_SOURCEt PY_FROZENi(tBytecodetRequiret find_moduletget_module_constanttextract_constantcBsYeZdZdd d dZdZdZd ddZd dZd dZ RS( s7A prerequisite to building or installing a distributiontcCsn|dkr!|dk r!t}n|dk rQ||}|dkrQd}qQn|jjt|`dS(Nt __version__(tNoneRt__dict__tupdatetlocalstself(Rtnametrequested_versiontmodulethomepaget attributetformat((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt__init__s     cCs*|jdk r#d|j|jfS|jS(s0Return full package/distribution name, w/versions%s-%sN(RR R(R((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt full_name scCs=|jdkp<|jdkp<t|dko<||jkS(s%Is 'version' sufficiently up-to-date?tunknownN(RR RtstrR(Rtversion((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt version_ok&sRcCs|jdkr]y6t|j|\}}}|r@|jn|SWq]tk rYdSXnt|j|j||}|dk r||k r|jdk r|j|S|S(sGet 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 RRtcloset ImportErrorRR(Rtpathstdefaulttftptitv((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt get_version+s   ' cCs|j|dk S(s/Return true if dependency is present on 'paths'N(R%R (RR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt is_presentFscCs,|j|}|dkrtS|j|S(s>Return true if dependency is present and up-to-date on 'paths'N(R%R tFalseR(RRR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt is_currentJs N( t__name__t __module__t__doc__R RRRR%R&R((((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRs   c Cs|jd}x|r|jd}tj||\}}\}}}} |tkrv|pgdg}|g}q|rtd||fqqW| S(s7Just like 'imp.find_module()', but with package supportt.iRsCan't find %r in %s(tsplittpoptimpRRR( RRtpartstpartR!tpathtsuffixtmodetkindtinfo((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRRs (  c Csy%t||\}}\}}}Wntk r9dSXz|tkrh|jdtj|} n|tkrtj |} no|t krt |j|d} nH|t j krtj||||||fntt j ||dSWd|r |jnXt| ||S(sFind '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'.itexecN(RRR RtreadtmarshaltloadRR/tget_frozen_objectRtcompiletsystmodulest load_moduletgetattrRR ( RtsymbolR RR!R2R3R4R5tcode((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyRes$%     "c Cs||jkrdSt|jj|}d}d}d}|}xpt|D]b}|j} |j} | |kr|j| }qP| |kr| |ks| |kr|S|}qPWdS(sExtract 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'. iZiaidN(tco_namesR tlisttindexRtopcodetargt co_consts( RBRAR tname_idxt STORE_NAMEt STORE_GLOBALt LOAD_CONSTtconstt byte_codetopRG((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyR s    $cCsXtjjd r&tjdkr&dSd}x%|D]}t|=tj|q3WdS(s Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. tjavatcliNR R(R R(R=tplatformt startswithtglobalst__all__tremove(t incompatibleR((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyt_update_globalss "  ((R=R/R9tdistutils.versionRRRRRt py33compatRRURR RRR RX(((s6/usr/lib/python2.7/site-packages/setuptools/depends.pyts   "C " $ PK!ʏ glibc.pyonu[ fc@@s\ddlmZddlZddlZddlZdZdZdZdZdS(i(tabsolute_importNcC@sktjd}y |j}Wntk r0dSXtj|_|}t|tsg|j d}n|S(s9Returns glibc version string, or None if not using glibc.tasciiN( tctypestCDLLtNonetgnu_get_libc_versiontAttributeErrortc_char_ptrestypet isinstancetstrtdecode(tprocess_namespaceRt version_str((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytglibc_version_string s    cC@sdtjd|}|s0tjd|ttSt|jd|koct|jd|kS(Ns$(?P[0-9]+)\.(?P[0-9]+)s=Expected glibc version with 2 components major.minor, got: %stmajortminor(tretmatchtwarningstwarntRuntimeWarningtFalsetinttgroup(R trequired_majort minimum_minortm((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytcheck_glibc_version$s  cC@s)t}|dkrtSt|||S(N(RRRR(RRR ((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pythave_compatible_glibc4s  cC@s't}|dkrdSd|fSdS(sTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. ttglibcN(RR(RR(t glibc_version((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytlibc_verLs  ( t __future__RRRRRRRR!(((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pyts      PK!c.g dep_util.pyonu[ fc@sddlmZdZdS(i(t newer_groupcCst|t|kr'tdng}g}xVtt|D]B}t||||rF|j|||j||qFqFW||fS(sWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. s5'sources_group' and 'targets' must be the same length(tlent ValueErrortrangeRtappend(tsources_groupsttargetst n_sourcest n_targetsti((s7/usr/lib/python2.7/site-packages/setuptools/dep_util.pytnewer_pairwise_groupsN(tdistutils.dep_utilRR (((s7/usr/lib/python2.7/site-packages/setuptools/dep_util.pytsPK!gLsbuild_meta.pycnu[ fc@sdZddlZddlZddlZddlZddlZddlZddlZdefdYZ dej j fdYZ ddZ d Z d Zd Zdd Zdd ZddZdddZddZdS(s-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. iNtSetupRequirementsErrorcBseZdZRS(cCs ||_dS(N(t specifiers(tselfR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt__init__(s(t__name__t __module__R(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR'st DistributioncBs)eZdZeejdZRS(cCst|dS(N(R(RR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytfetch_build_eggs-sccs5tjj}|tj_z dVWd|tj_XdS(sw Replace distutils.dist.Distribution with this class for the duration of this context. N(t distutilstcoreR(tclstorig((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytpatch0s    (RRRt classmethodt contextlibtcontextmanagerR (((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR,s ssetup.pycBsa|}d}eede|}|jjdd}|je||deUdS(Nt__main__topens\r\ns\ntexec(tgetattrttokenizeRtreadtreplacetclosetcompiletlocals(t setup_scriptt__file__Rtftcode((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _run_setup@s  cCs |p i}|jdg|S(Ns--global-option(t setdefault(tconfig_settings((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _fix_configKs cCs|t|}ddg}tjd dg|dt_ytj tWdQXWn tk rw}||j7}nX|S(Nt setuptoolstwheelitegg_infos--global-option(R!tsystargvRR RRR(R t requirementste((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_build_requiresQs   cCsAgtj|D]-}tjjtjj||r|^qS(N(tostlistdirtpathtisdirtjoin(ta_dirtname((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_immediate_subdirectories`scCst|}t|S(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_wheeles cCst|}t|S(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_sdistjs cCs tjd dd|gt_t|}xtrgtj|D]}|jdrC|^qC}t|dkrtt|dkrtj j |tj|d}q-nt|dkst Pq-W||krt j tj j ||d|t j|dtn|dS(Nit dist_infos --egg-bases .dist-infoit ignore_errors(R%R&RtTrueR*R+tendswithtlenR1R,R.tAssertionErrortshutiltmovetrmtree(tmetadata_directoryR tdist_info_directoryRt dist_infos((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt prepare_metadata_for_build_wheelos&   cCst|}tjj|}tjd dg|dt_t|dkrptj|tj d|ngtj |D]}|j dr|^q}t |dkst |dS(Nit bdist_wheels--global-optiontdists.whli(R!R*R,tabspathR%R&RR:R<tcopytreeR+R7R8R9(twheel_directoryR R=Rtwheels((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_wheels   cCst|}tjj|}tjd dg|dt_t|dkrptj|tj d|ngtj |D]}|j dr|^q}t |dkst |dS(Nitsdists--global-optionRBs.tar.gzi(R!R*R,RCR%R&RR:R<RDR+R7R8R9(tsdist_directoryR Rtsdists((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_sdists   (t__doc__R*R%RR:RR"Rt BaseExceptionRRBRRR!R)R1tNoneR2R3R@RGRK(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyts&              PK!Hglob.pyonu[ fc@sdZddlZddlZddlZddlmZdddgZedZedZ d Z d Z d Z d Z d ZejdZejdZdZdZdZdS(s Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. iN(t binary_typetglobtiglobtescapecCstt|d|S(syReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. t recursive(tlistR(tpathnameR((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs cCs4t||}|r0t|r0t|}n|S(sReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. (t_iglobt _isrecursivetnext(RRtitts((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR s  ccsntjj|\}}t|se|rGtjj|ra|Vqantjj|ra|VndS|s|rt|rx>t||D] }|VqWnxt||D] }|VqWdS||krt|rt ||}n |g}t|r%|rt|rt}q+t}nt }x<|D]4}x+|||D]}tjj ||VqHWq2WdS(N( tostpathtsplitt has_magictlexiststisdirRtglob2tglob1Rtglob0tjoin(RRtdirnametbasenametxtdirst glob_in_dirtname((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR2s4         cCsn|s6t|tr*tjjd}q6tj}nytj|}Wntk r]gSXtj||S(NtASCII( t isinstanceRR tcurdirtencodetlistdirtOSErrortfnmatchtfilter(Rtpatterntnames((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR]s  cCsN|s"tjj|rJ|gSn(tjjtjj||rJ|gSgS(N(R R RRR(RR((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRjs  !ccs)|d Vxt|D] }|VqWdS(Ni(t _rlistdir(RR$R((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRzs ccs|s6t|tr*ttjd}q6tj}nytj|}Wntjk r`dSXx_|D]W}|V|rtjj||n|}x(t|D]}tjj||VqWqhWdS(NR( RRR RR terrorR RR&(RR%RR ty((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyR&s  !s([*?[])cCs:t|tr!tj|}ntj|}|dk S(N(RRtmagic_check_bytestsearcht magic_checktNone(R tmatch((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRscCs't|tr|dkS|dkSdS(Ns**(RR(R$((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs cCsVtjj|\}}t|tr<tjd|}ntjd|}||S(s#Escape all special characters. s[\1](R R t splitdriveRRR)tsubR+(Rtdrive((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyRs (t__doc__R treR"tsetuptools.extern.sixRt__all__tFalseRRRRRRR&tcompileR+R)RRR(((s3/usr/lib/python2.7/site-packages/setuptools/glob.pyts"      +     PK!\'py33compat.pyonu[ fc@sddlZddlZddlZyddlZWnek rMdZnXddlmZddlm Z ej ddZ de fdYZ eede Zeed e jjZdS( iN(tsix(t html_parsertOpArgs opcode argtBytecode_compatcBseZdZdZRS(cCs ||_dS(N(tcode(tselfR((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyt__init__sccstjd|jj}t|jj}d}d}x||kr||}|tjkr||d||dd|}|d7}|tjkrtjd}||d}q9qnd }|d7}t ||Vq9Wd S( s>Yield '(op,arg)' pair for each operation in code object 'code'tbiiiiiiiN( tarrayRtco_codetlentdist HAVE_ARGUMENTt EXTENDED_ARGRt integer_typestNoneR(Rtbytesteoftptrt extended_argtoptargt long_type((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyt__iter__s  "    (t__name__t __module__RR(((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyRs tBytecodetunescape(R Rt collectionsthtmlt ImportErrorRtsetuptools.externRtsetuptools.extern.six.movesRt namedtupleRtobjectRtgetattrRt HTMLParserR(((s9/usr/lib/python2.7/site-packages/setuptools/py33compat.pyts     "PK!ʏ glibc.pycnu[ fc@@s\ddlmZddlZddlZddlZdZdZdZdZdS(i(tabsolute_importNcC@sktjd}y |j}Wntk r0dSXtj|_|}t|tsg|j d}n|S(s9Returns glibc version string, or None if not using glibc.tasciiN( tctypestCDLLtNonetgnu_get_libc_versiontAttributeErrortc_char_ptrestypet isinstancetstrtdecode(tprocess_namespaceRt version_str((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytglibc_version_string s    cC@sdtjd|}|s0tjd|ttSt|jd|koct|jd|kS(Ns$(?P[0-9]+)\.(?P[0-9]+)s=Expected glibc version with 2 components major.minor, got: %stmajortminor(tretmatchtwarningstwarntRuntimeWarningtFalsetinttgroup(R trequired_majort minimum_minortm((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytcheck_glibc_version$s  cC@s)t}|dkrtSt|||S(N(RRRR(RRR ((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pythave_compatible_glibc4s  cC@s't}|dkrdSd|fSdS(sTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. ttglibcN(RR(RR(t glibc_version((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pytlibc_verLs  ( t __future__RRRRRRRR!(((s4/usr/lib/python2.7/site-packages/setuptools/glibc.pyts      PK!kBB version.pyonu[ fc@s@ddlZyejdjZWnek r;dZnXdS(iNt setuptoolstunknown(t pkg_resourcestget_distributiontversiont __version__t Exception(((s6/usr/lib/python2.7/site-packages/setuptools/version.pyts  PK!K  monkey.pycnu[ fc@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ dZdZdZdZd Zd Zd Zd Zd ZdS(s Monkey patching of distutils. iN(t import_module(tsixcCs-tjdkr |f|jStj|S(sm Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. tJython(tplatformtpython_implementationt __bases__tinspecttgetmro(tcls((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt_get_mros cCsCt|tjrtnt|tjr0tnd}||S(NcSsdS(N(tNone(titem((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt*t(t isinstanceRt class_typestget_unpatched_classttypest FunctionTypetget_unpatched_function(R tlookup((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt get_unpatched&s cCsQdt|D}t|}|jjdsMd|}t|n|S(sProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css'|]}|jjds|VqdS(t setuptoolsN(t __module__t startswith(t.0R((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pys 6st distutilss(distutils has already been patched by %r(R tnextRRtAssertionError(Rtexternal_basestbasetmsg((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR/s  cCsWtjtj_tjd k}|r6tjtj_ntjd kpd tjko_dknpdtjko~dknpdtjkodkn}|rd }|tjj _ nt t x/tj tjtjfD]}tj j|_qWtjjtj_tjjtj_d tjkrLtjjtjd _ntdS(Niiiii iiishttps://upload.pypi.org/legacy/sdistutils.command.build_ext(iii(iii (ii(iii(ii(iii(ii(iii(RtCommandRtcoretsyst version_infotfindalltfilelisttconfigt PyPIRCCommandtDEFAULT_REPOSITORYt+_patch_distribution_metadata_write_pkg_filet+_patch_distribution_metadata_write_pkg_infotdisttcmdt Distributiont extensiont Extensiontmodulest#patch_for_msvc_specialized_compiler(thas_issue_12885tneeds_warehouset warehousetmodule((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_allAs(cCstjjtjj_dS(sDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN(RR+twrite_pkg_fileRtDistributionMetadata(((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR)kscCsFdtjd kodkn}|s-dStjjtjj_dS(s Workaround issue #197 - Python 3 prior to 3.2.2 uses an environment-local encoding to save the pkg_info. Monkey-patch its write_pkg_info method to correct this undesirable behavior. iiN(i(iii(R"R#RR+twrite_pkg_infoRR8(tenvironment_local((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR*rs#cCs9t||}t|jd|t|||dS(s Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. t unpatchedN(tgetattrtvarst setdefaulttsetattr(t replacementt target_modt func_nametoriginal((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_funcscCs t|dS(NR;(R<(t candidate((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyRscstdtjdkr"dSfd}tj|d}tj|d}y$t|dt|dWntk rnXyt|d Wntk rnXyt|d Wntk rnXdS( s\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. ssetuptools.msvctWindowsNcsqd|krdnd}||jd}t|}t|}t||sdt|n|||fS(sT Prepare the parameters for patch_func to patch indicated function. tmsvc9tmsvc9_tmsvc14_t_(tlstripR<Rthasattrt ImportError(tmod_nameRBt repl_prefixt repl_nametrepltmod(tmsvc(s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyt patch_paramss sdistutils.msvc9compilersdistutils._msvccompilertfind_vcvarsalltquery_vcvarsallt _get_vc_envtgen_lib_options(RRtsystemt functoolstpartialRDRM(RTRGtmsvc14((RSs5/usr/lib/python2.7/site-packages/setuptools/monkey.pyR1s&     (t__doc__R"tdistutils.filelistRRRRZt importlibRRtsetuptools.externRRt__all__R RRR6R)R*RDRR1(((s5/usr/lib/python2.7/site-packages/setuptools/monkey.pyts&          *    PK!I launch.pycnu[ fc@sAdZddlZddlZdZedkr=endS(s[ Launch the Python script on the command line after setuptools is bootstrapped via import. iNcBseejd}ed|dddd }ejdej(eede}||j}|j dd}e ||d }||Ud S( sP Run the script in sys.argv[1] as if it had been invoked naturally. it__file__t__name__t__main__t__doc__topens\r\ns\ntexecN( t __builtins__tsystargvtdicttNonetgetattrttokenizeRtreadtreplacetcompile(t script_namet namespacetopen_tscriptt norm_scripttcode((s5/usr/lib/python2.7/site-packages/setuptools/launch.pytrun s  R(RR RRR(((s5/usr/lib/python2.7/site-packages/setuptools/launch.pyts     PK!Xwindows_support.pycnu[ fc@s4ddlZddlZdZedZdS(iNcCstjdkrdS|S(NtWindowsc_sdS(N(tNone(targstkwargs((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pytt(tplatformtsystem(tfunc((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyt windows_onlyscCsqtdtjjj}tjjtjjf|_tjj |_ d}|||}|smtj ndS(s Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. sctypes.wintypesiN( t __import__tctypestwindlltkernel32tSetFileAttributesWtwintypestLPWSTRtDWORDtargtypestBOOLtrestypetWinError(tpathtSetFileAttributestFILE_ATTRIBUTE_HIDDENtret((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyt hide_file s (RR R R(((s>/usr/lib/python2.7/site-packages/setuptools/windows_support.pyts   PK!Dm. . py36compat.pycnu[ fc@sddlZddlmZddlmZddlmZdd dYZejd krtdd dYZne rdd d YZndS(iN(tDistutilsOptionError(t strtobool(tDEBUGtDistribution_parse_config_filescBseZdZddZRS(s Mix-in providing forward-compatibility for functionality to be included by default on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. c CsHddlm}tjtjkrRddddddd d d d d ddg }ng}t|}|dkr|j}ntr|j dn|dd}x|D]}tr|j d|n|j |x|j D]}|j |}|j |}x]|D]U} | dkr| |kr|j|| } | jdd} || f|| s APK!0msite-patch.pycnu[ fc@s&dZedkr"e[ndS(cCsddl}ddl}|jjd}|dksL|jdkrU| rUg}n|j|j}t|di}|j t |}|j j t }x|D]}||ks| rqn|j|}|dk r|j d}|dk r|jdPqqy.ddl} | j d|g\} } } Wntk rRqnX| dkreqnz| jd| | | Wd| jXPqWtdtg|j D]}t|ddf^q} t|dd }d |_x|D]}t|qW|j|7_t|d \}}d}g}x|j D]}t|\}}||kr|dkrt |}n|| ks|dkr|j|qA|j|||d7}qAW||j (dS( Nit PYTHONPATHtwin32tpath_importer_cachetsites$Couldn't find the real 'site' moduleit __egginserti(tsystostenvirontgettNonetplatformtsplittpathseptgetattrtpathtlentdirnamet__file__t find_modulet load_moduletimpt ImportErrortclosetdicttmakepathRt addsitedirtappendtinsert(RRRtpictstdpathtmydirtitemtimportertloaderRtstreamRtdescrt known_pathstoldpostdtndt insert_attnew_pathtptnp((s9/usr/lib/python2.7/site-packages/setuptools/site-patch.pyt__boots`  "      "    2  RN(R,t__name__(((s9/usr/lib/python2.7/site-packages/setuptools/site-patch.pyts G PK!Üv$v$pep425tags.pyonu[ fc@@sdZddlmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ejdZdZd Zd Zd Zd Zeed ZdZdZdZdZdZdeddddZeZdS(s2Generate and work with PEP 425 Compatibility Tags.i(tabsolute_importN(t OrderedDicti(tglibcs(.+)_(\d+)_(\d+)_(.+)cC@sEytj|SWn-tk r@}tjdj|tdSXdS(Ns{}(t sysconfigtget_config_vartIOErrortwarningstwarntformattRuntimeWarningtNone(tvarte((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRs cC@sUttdrd}n9tjjdr3d}ntjdkrKd}nd}|S(s'Return abbreviated implementation name.tpypy_version_infotpptjavatjytclitiptcp(thasattrtsystplatformt startswith(tpyimpl((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_abbr_impls   cC@sDtd}| s"tdkr@djttt}n|S(sReturn implementation version.tpy_version_nodotRt(RRtjointmaptstrtget_impl_version_info(timpl_ver((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_impl_ver(s cC@sKtdkr/tjdtjjtjjfStjdtjdfSdS(sQReturn sys.version_info-like tuple for use in decrementing the minor version.RiiN(RRt version_infoR tmajortminor(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR0s cC@sdjttS(s; Returns the Tag for this specific implementation. s{}{}(RRR!(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_impl_tag;scC@sNt|}|dkrD|r=tjdj|tdn|S||kS(sgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.s?Config variable '{0}' is unset, Python ABI tag may be incorrectiN(RR RRRR (R tfallbacktexpectedRtval((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytget_flagBs   c @smtd}t| r ddhkr ttdr d}d}d}tddddkrvd }ntd fd ddkrd }ntd dddddkotjdkrtjdkrd}ndt|||f}n\|r<|jdr<d|jdd}n-|rc|j ddj dd}nd}|S(sXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).tSOABIRRt maxunicodeRtPy_DEBUGcS@s ttdS(Ntgettotalrefcount(RR(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytXRRtdt WITH_PYMALLOCc@s dkS(NR(((timpl(s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.\RtmtPy_UNICODE_SIZEcS@s tjdkS(Ni(RR+(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyR.`RR'iitus %s%s%s%s%sscpython-t-it.t_(ii(iiN( RRRRR)R"R!RtsplittreplaceR (tsoabiR/R2R4tabi((R1s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_abi_tagNs8  (      !cC@s tjdkS(Ni(Rtmaxsize(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt_is_running_32bitpscC@stjdkrtj\}}}|jd}|dkrQtrQd}n|dkrotrod}ndj|d|d |Stjjj dd j d d }|d krtrd }n|S(s0Return our platform name 'win32', 'linux_x86_64'tdarwinR6tx86_64ti386tppc64tppcsmacosx_{}_{}_{}iiR7R5t linux_x86_64t linux_i686( RRtmac_verR8R>Rt distutilstutilt get_platformR9(treleaseR7tmachinet split_vertresult((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRIts  ' cC@s`tddhkrtSyddl}t|jSWnttfk rOnXtjddS(NRDREiii( RItFalset _manylinuxtbooltmanylinux1_compatiblet ImportErrortAttributeErrorRthave_compatible_glibc(RO((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytis_manylinux1_compatibles c@sg}fdtdd fdd fdd fd dfg|||rj|j|nx@D]8}||krq|||rq|j|qqqqW|jd |S(sReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. c@s|dkr||fdkS|dkr8||fd kS|dkrT||fd kS|dkrp||fd kS|krx+|D]}|||rtSqWntS( NRCi iRBRAiR@(i i(i i(i i(i i(tTrueRN(R#R$tarchtgarch(t_supports_archtgroups(s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyRYs      tfatRARCtintelR@tfat64RBtfat32t universal(RARC(R@RA(R@RB(R@RARC(Rtappend(R#R$RKtarchesRX((RYRZs9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pytget_darwin_archess$    " cC@sg}|dkrug}t}|d }xGt|dddD],}|jdjtt||fqBWn|pt}g} |pt}|r|g| dd+nt } ddl } xK| j D]=} | dj dr| j | djdddqqW| jtt| | jd |s6|pMt} | j d rtj| }|r|j\}}}}d j||}g}xjttt|dD]@}x7tt|||D]}|j|||fqWqWqM| g}n9|dkrDtrD| jd d | g}n | g}xC| D];}x2|D]*} |jd||df|| fqaWqTWxj|dD]^}|ddhkrPnx?| D]7}x.|D]&} |jd||f|| fqWqWqWx3|D](} |jd|ddd | fqWn|jd||dfd df|jd||ddfd dfxdt|D]V\}}|jd|fd df|dkr|jd|dd dfqqW|S(scReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. iRiNs.abiR6iitnonetmacosxs {}_{}_%i_%stlinuxt manylinux1s%s%st31t30spy%stany(R RtrangeR`RRRRR<tsettimpt get_suffixesRtaddR8textendtsortedtlistRIt _osx_arch_pattmatchRZRtreversedtintRbRUR9t enumerate(tversionstnoarchRR1R;t supportedR"R#R$tabistabi3sRltsuffixRWRstnamet actual_archttplRaR2tatversionti((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyt get_supportedsh   -  ( #"    ,  , )$( %( t__doc__t __future__Rtdistutils.utilRGRtreRRRt collectionsRRRtcompileRrRRR!RR%RVR)R<R>RIRURbR RNRtimplementation_tag(((s9/usr/lib/python2.7/site-packages/setuptools/pep425tags.pyts0          "    = _PK! II sandbox.pycnu[ fc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejjdrddljjjjZnejejZy eZWnek r dZnXeZddl m!Z!ddlm"Z"ddd d gZ#dd Z$ej%dd Z&ej%d Z'ej%dZ(ej%dZ)de*fdYZ+dd!dYZ,ej%dZ-dZ.ej%dZ/ej%dZ0dZ1dZ2dZ3dd"dYZ4e5edrNej6gZ7ngZ7de4fdYZ8ej9ej:gdj;D]Z<e=ee<d^qZ>d e!fd YZ?dS(#iN(tsix(tbuiltinstmaptjava(tDistutilsError(t working_settAbstractSandboxtDirectorySandboxtSandboxViolationt run_setupcBs_d}e||}|j}WdQX|dkr?|}ne||d}|||UdS(s. Python 3 implementation of execfile. trbNtexec(topentreadtNonetcompile(tfilenametglobalstlocalstmodetstreamtscripttcode((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt _execfile#s  ccs>tj}|dk r#|tj(nz |VWd|tj(XdS(N(tsystargvR(trepltsaved((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_argv0s     ccs%tj}z |VWd|tj(XdS(N(Rtpath(R((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_path;s  ccsBtjj|dttj}|t_z dVWd|t_XdS(sL Monkey-patch tempfile.tempdir with replacement, ensuring it exists texist_okN(t pkg_resourcest py31compattmakedirstTruettempfilettempdir(t replacementR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt override_tempDs    ccs7tj}tj|z |VWdtj|XdS(N(tostgetcwdtchdir(ttargetR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytpushdUs    tUnpickleableExceptioncBseZdZedZRS(sP An exception representing another Exception that could not be pickled. cCsay tj|tj|fSWn:tk r\ddlm}|j||t|SXdS(s Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. i(R-N(tpickletdumpst Exceptiontsetuptools.sandboxR-tdumptrepr(ttypetexctcls((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR2ds   (t__name__t __module__t__doc__t staticmethodR2(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR-_stExceptionSavercBs)eZdZdZdZdZRS(s^ A Context Manager that will save an exception, serialized, and restore it later. cCs|S(N((tself((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt __enter__xscCs,|s dStj|||_||_tS(N(R-R2t_savedt_tbR#(R<R4R5ttb((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt__exit__{s  cCsKdt|krdSttj|j\}}tj|||jdS(s"restore and re-raise any exceptionR>N(tvarsRR.tloadsR>RtreraiseR?(R<R4R5((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytresumes(R7R8R9R=RARE(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR;rs  c#sgtjjt }VWdQXtjjfdtjD}t||jdS(s Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3s1|]'}|kr|jd r|VqdS(s encodings.N(t startswith(t.0tmod_name(R(s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pys s (RtmodulestcopyR;tupdatet_clear_modulesRE(t saved_exct del_modules((Rs6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt save_moduless   cCs%xt|D]}tj|=q WdS(N(tlistRRI(t module_namesRH((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRLsccs*tj}z |VWdtj|XdS(N(R t __getstate__t __setstate__(R((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pytsave_pkg_resources_states  ccstjj|d}tqtattJt:t|'t |t ddVWdQXWdQXWdQXWdQXWdQXWdQXdS(Nttempt setuptools( R(RtjoinRTROthide_setuptoolsRRR'R,t __import__(t setup_dirttemp_dir((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt setup_contexts       cCs"tjd}t|j|S(sH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True s1(setuptools|pkg_resources|distutils|Cython)(\.|$)(treRtbooltmatch(RHtpattern((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt _needs_hidingscCs tttj}t|dS(s% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N(tfilterRaRRIRL(RI((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRXsc Cstjjtjj|}t|y|gt|tj(tjjd|t j t j j dt |tr|n|jtj}t|'td|dd}t||WdQXWn/tk r}|jr|jdrqnXWdQXdS(s8Run a distutils setup script, sandboxed in its directoryicSs |jS(N(tactivate(tdist((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyttt__file__R7t__main__N(R(RtabspathtdirnameR\RPRRtinsertRt__init__t callbackstappendt isinstancetstrtencodetgetfilesystemencodingRtdictRt SystemExittargs(t setup_scriptRuRZt dunder_filetnstv((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR s   cBseZdZeZdZdZdZdZdZ dZ x<ddd gD]+Z e e e rXe e ee sc3s!|]}tj|VqdS(N(R]R_(RGR`(R(s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pys s(Rt_exception_patternst itertoolstchaintany(R<Rt start_matchestpattern_matchest candidates((Rs6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs     cOsH||jkrD|j| rD|j|tjj|||n|S(sCalled for path inputs(t write_opsRRR(RR(R<RRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs%cOsF|j| s |j| r<|j|||||n||fS(s?Called for path pairs like rename, link, and symlink operations(RR(R<RRRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs icOsR|t@r9|j| r9|jd|||||ntj|||||S(sCalled for low-level os.open()sos.open(t WRITE_FLAGSRRR|R (R<RtflagsRRuR((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR s(R7R8R9RstfromkeysRRt _EXCEPTIONSRlRRRRRRRRR (((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyR~s       s4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYicBs,eZdZejdjZdZRS(sEA setup script attempted to modify the filesystem outside the sandboxs SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs%|j\}}}|jjtS(N(RuttmpltformatR(R<tcmdRutkwargs((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyt__str__s(R7R8R9ttextwraptdedenttlstripRR(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyRs (((@R(RR$toperatort functoolsRR]t contextlibR.Rtsetuptools.externRtsetuptools.extern.six.movesRRtpkg_resources.py31compatR tplatformRFt$org.python.modules.posix.PosixModuletpythonRItposixt PosixModuleR|RRRt NameErrorRR Rtdistutils.errorsRRt__all__RtcontextmanagerRRR'R,R0R-R;RORLRTR\RaRXR RR}RRRtreducetor_tsplittaRRR(((s6/usr/lib/python2.7/site-packages/setuptools/sandbox.pyts^                      wV +PK!zzbuild_meta.pyonu[ fc@sdZddlZddlZddlZddlZddlZddlZddlZdefdYZ dej j fdYZ ddZ d Z d Zd Zdd Zdd ZddZdddZddZdS(s-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. iNtSetupRequirementsErrorcBseZdZRS(cCs ||_dS(N(t specifiers(tselfR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt__init__(s(t__name__t __module__R(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR'st DistributioncBs)eZdZeejdZRS(cCst|dS(N(R(RR((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytfetch_build_eggs-sccs5tjj}|tj_z dVWd|tj_XdS(sw Replace distutils.dist.Distribution with this class for the duration of this context. N(t distutilstcoreR(tclstorig((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytpatch0s    (RRRt classmethodt contextlibtcontextmanagerR (((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyR,s ssetup.pycBsa|}d}eede|}|jjdd}|je||deUdS(Nt__main__topens\r\ns\ntexec(tgetattrttokenizeRtreadtreplacetclosetcompiletlocals(t setup_scriptt__file__Rtftcode((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _run_setup@s  cCs |p i}|jdg|S(Ns--global-option(t setdefault(tconfig_settings((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt _fix_configKs cCs|t|}ddg}tjd dg|dt_ytj tWdQXWn tk rw}||j7}nX|S(Nt setuptoolstwheelitegg_infos--global-option(R!tsystargvRR RRR(R t requirementste((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_build_requiresQs   cCsAgtj|D]-}tjjtjj||r|^qS(N(tostlistdirtpathtisdirtjoin(ta_dirtname((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt_get_immediate_subdirectories`scCst|}t|S(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_wheeles cCst|}t|S(N(R!R)(R ((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pytget_requires_for_build_sdistjs cCstjd dd|gt_t|}xtrgtj|D]}|jdrC|^qC}t|dkrtt|dkrtj j |tj|d}q-nPq-W||krt j tj j ||d|t j |dtn|dS(Nit dist_infos --egg-bases .dist-infoit ignore_errors(R%R&RtTrueR*R+tendswithtlenR1R,R.tshutiltmovetrmtree(tmetadata_directoryR tdist_info_directoryRt dist_infos((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt prepare_metadata_for_build_wheelos$   cCst|}tjj|}tjd dg|dt_t|dkrptj|tj d|ngtj |D]}|j dr|^q}|dS(Nit bdist_wheels--global-optiontdists.whli( R!R*R,tabspathR%R&RR9R;tcopytreeR+R7(twheel_directoryR R<Rtwheels((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_wheels   cCst|}tjj|}tjd dg|dt_t|dkrptj|tj d|ngtj |D]}|j dr|^q}|dS(Nitsdists--global-optionRAs.tar.gzi( R!R*R,RBR%R&RR9R;RCR+R7(tsdist_directoryR Rtsdists((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyt build_sdists   (t__doc__R*R%RR9RR"Rt BaseExceptionRRARRR!R)R1tNoneR2R3R?RFRJ(((s9/usr/lib/python2.7/site-packages/setuptools/build_meta.pyts&              PK!o9ydist.pycnu[ fc@sKdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl m Z ddl mZmZmZddlmZddlmZddlmZddlmZdd lmZmZmZdd lmZdd lmZdd l m!Z!dd l"m#Z#ddl$Z$ddl%m&Z&e'de'ddZ(dZ)dZ*dZ+e,e-fZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8d Z9d!Z:e!ej;j<Z=de&e=fd"YZ<d#fd$YZ>dS(%t DistributioniN(t defaultdict(tDistutilsOptionErrortDistutilsPlatformErrortDistutilsSetupError(t rfc822_escape(t StrictVersion(tsix(t packaging(tmaptfiltert filterfalse(tRequire(twindows_support(t get_unpatched(tparse_configurationi(tDistribution_parse_config_filess&setuptools.extern.packaging.specifierss#setuptools.extern.packaging.versioncCstjdtt|S(NsDo not call this function(twarningstwarntDeprecationWarningR(tcls((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_get_unpatched#scCs|js|jrtdS|jdk sR|jdk sRt|dddk r\tdS|js|js|j s|j s|j rtdStdS(Ns2.1tpython_requiress1.2s1.1s1.0( tlong_description_content_typetprovides_extrasRt maintainertNonetmaintainer_emailtgetattrtprovidestrequirest obsoletest classifierst download_url(tdist_md((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytget_metadata_version(s   c Cst|}|jd||jd|j|jd|j|jd|j|jd|j|tdkr|jd|j|jd|jnyd#d$d%d&f}xd|D]\\}}t ||}t j r |j |}n|d"k r|jd||fqqW|jd|j|jrl|jd|jnx(|jjD]}|jd|q|Wt|j}|jd|dj|j} | r|jd| n|tdkr&xA|jD]} |jd| qWn|j|d|j|j|d|j|j|d|j|j|d|j|j|d|jt|dr|jd|jn|jr|jd |jn|jrx%|jD]} |jd!| qWnd"S('s5Write the PKG-INFO format data to a file object. sMetadata-Version: %s s Name: %s s Version: %s s Summary: %s sHome-page: %s s1.2s Author: %s sAuthor-email: %s tAuthortauthors Author-emailt author_emailt MaintainerRsMaintainer-emailRs%s: %s s License: %s sDownload-URL: %s sProject-URL: %s, %s sDescription: %s t,s Keywords: %s s Platform: %s tPlatformt ClassifiertRequirestProvidest ObsoletesRsRequires-Python: %s sDescription-Content-Type: %s sProvides-Extra: %s N(R$R%(s Author-emailR&(R'R(sMaintainer-emailR( R#twritetget_namet get_versiontget_descriptiontget_urlRt get_contacttget_contact_emailRRtPY2t _encode_fieldRt get_licenseR!t project_urlstitemsRtget_long_descriptiontjoint get_keywordst get_platformst _write_listtget_classifierst get_requirest get_providest get_obsoletesthasattrRRR( tselftfiletversiontoptional_fieldstfieldtattrtattr_valt project_urlt long_desctkeywordstplatformtextra((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytwrite_pkg_file7s\       cCs>ttjj|dddd}|j|WdQXdS(s3Write the PKG-INFO file into the release tree. sPKG-INFOtwtencodingsUTF-8N(topentostpathR;RP(RDtbase_dirtpkg_info((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytwrite_pkg_infos cCsdy*tjjd|}|j s)tWn3ttttfk r_td||fnXdS(Nsx=s4%r must be importable 'module:attrs' string (got %r)( t pkg_resourcest EntryPointtparsetextrastAssertionErrort TypeErrort ValueErrortAttributeErrorR(tdistRItvaluetep((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_importablescCsYydj||kstWn3ttttfk rTtd||fnXdS(s*Verify that value is a string list or Nonets%%r must be a list of strings (got %r)N(R;R]R^R_R`R(RaRIRb((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytassert_string_lists cCs|}t|||xw|D]o}|j|sItdd|n|jd\}}}|r||krtjjd||qqWdS(s(Verify that namespace packages are valids1Distribution contains no modules or packages for snamespace package %rt.s^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN(Rfthas_contents_forRt rpartitiont distutilstlogR(RaRIRbt ns_packagestnsptparenttseptchild((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt check_nsps  cCsMy ttjt|jWn&tttfk rHtdnXdS(s+Verify that extras_require mapping is valids'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N( tlistt itertoolststarmapt _check_extraR9R^R_R`R(RaRIRb((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt check_extrass  cCsW|jd\}}}|r@tj|r@td|nttj|dS(Nt:sInvalid environment marker: (t partitionRYtinvalid_markerRRrtparse_requirements(ROtreqstnameRotmarker((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRuscCs=t||kr9d}t|jd|d|ndS(s)Verify that value is True, False, 0, or 1s0{attr!r} must be a boolean value (got {value!r})RIRbN(tboolRtformat(RaRIRbttmpl((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt assert_boolscCsy;ttj|t|ttfr:tdnWn=ttfk rz}d}t|j d|d|nXdS(s9Verify that install_requires is a valid requirements listsUnordered types are not allowedsm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}RIterrorN( RrRYRzt isinstancetdicttsetR^R_RR(RaRIRbRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_requirementsscCsXytjj|Wn=tjjk rS}d}t|jd|d|nXdS(s.Verify that value is a valid version specifiersF{attr!r} must be a string containing valid version specifiers; {error}RIRN(Rt specifierst SpecifierSettInvalidSpecifierRR(RaRIRbRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_specifiers cCs:ytjj|Wntk r5}t|nXdS(s)Verify that entry_points map is parseableN(RYRZt parse_mapR_R(RaRIRbte((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_entry_pointsscCs%t|tjs!tdndS(Nstest_suite must be a string(RRt string_typesR(RaRIRb((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_test_suitescCs}t|trixW|jD]B\}}t|ts;Pnyt|Wqtk r]PqXqWdSnt|ddS(s@Verify that value is a dictionary of package names to glob listsNsI must be a dictionary mapping package names to lists of wildcard patterns(RRR9tstrtiterR^R(RaRIRbtktv((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_package_datas  cCs=x6|D].}tjd|stjjd|qqWdS(Ns \w+(\.\w+)*s[WARNING: %r not a valid package name; please use only .-separated package names in setup.py(tretmatchRjRkR(RaRIRbtpkgname((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_packagess   cBsLeZdZd"ZdZd"dZdZdZe dZ dZ dZ d"e dZd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'RS(#sDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. cCs| sd|ksd|kr#dStjt|dj}tjjj|}|dk r|jd rtj t|d|_ ||_ ndS(NR|RFsPKG-INFO( RYt safe_nameRtlowert working_settby_keytgetRt has_metadatat safe_versiont_versiont _patched_dist(RDtattrstkeyRa((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytpatch_missing_pkg_infoVscCsUt|d}|s!i|_n|p*i}d|ksEd|krRtjng|_i|_g|_|jdd|_ |j ||j di|_ |jdg|_ |jdg|_x0tjdD]}t|j|jdqWtj||t|jd|j |j_ |j d |j_t|jd t|j_t|jjtjrt|jj|j_n|jjdk rGyft jj!|jj}t|}|jj|kr t"j#d |jj|f||j_nWqGt jj$t%fk rCt"j#d |jjqGXn|j&dS( Nt package_datatfeaturestrequire_featurestsrc_rootR8tdependency_linkstsetup_requiressdistutils.setup_keywordsRRsNormalizing '%s' to '%s'sThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.('RCRtFeaturetwarn_deprecatedRRt dist_filestpopRRRRR8RRRYtiter_entry_pointstvarst setdefaultR|t _Distributiont__init__RtmetadataRRRRRFtnumberstNumberRRtVersionRRtInvalidVersionR^t_finalize_requires(RDRthave_package_dataRctvertnormalized_version((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRcsP          cCst|ddr$|j|j_nt|ddrxI|jjD]5}|jdd}|rF|jjj|qFqFWn|j |j dS(s Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. Rtextras_requireRwiN( RRRRRtkeystsplitRtaddt_convert_extras_requirementst"_move_install_requirements_markers(RDRO((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCst|ddpi}tt|_xf|jD]X\}}|j|x>tj|D]-}|j|}|j||j |q[Wq4WdS(s Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. RN( RRRRrt_tmp_extras_requireR9RYRzt _suffix_fortappend(RDt spec_ext_reqstsectionRtrtsuffix((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCs|jrdt|jSdS(se For a requirement, return the 'extras_require' suffix for that requirement. RwRe(R}R(treq((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRscsd}tddpd}ttj|}t||}t||}ttt|_ x/|D]'}j dt|j j |qsWt fdj jD_dS(sv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j S(N(R}(R((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt is_simple_reqstinstall_requiresRwc3sF|]<\}}|gtj|D]}t|^q%fVqdS(N(R t _clean_reqR(t.0RRR(RD(s3/usr/lib/python2.7/site-packages/setuptools/dist.pys sN((RRRrRYRzR R R RRRR}RRR9R(RDRtspec_inst_reqst inst_reqst simple_reqst complex_reqsR((RDs3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs  % cCs d|_|S(sP Given a Requirement, remove environment markers and return it. N(RR}(RDR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs cCs7tj|d|t||jd||jdS(sYParses configuration files from various levels and loads configuration. t filenamestignore_option_errorsN(Rtparse_config_filesRtcommand_optionsR(RDRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRscCs)tj|}|jr%|jn|S(s3Process features after parsing command line options(Rtparse_command_lineRt_finalize_features(RDtresult((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs  cCsd|jddS(s;Convert feature name to corresponding option attribute nametwith_t-t_(treplace(RDR|((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_feature_attrnamescCsUtjjtj|d|jdt}x$|D]}tjj|dtq1W|S(sResolve pre-setup requirementst installertreplace_conflictingR(RYRtresolveRztfetch_build_eggtTrueR(RDRtresolved_distsRa((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytfetch_build_eggss    cCstj||jr#|jnxgtjdD]V}t||jd}|dk r3|j d|j |j ||j|q3q3Wt|ddrg|j D]}t jj|^q|_ n g|_ dS(Nsdistutils.setup_keywordsRtconvert_2to3_doctests(Rtfinalize_optionsRt_set_global_opts_from_featuresRYRRR|RtrequireRtloadRRTRUtabspath(RDRcRbtp((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs     +cCstjjtjd}tjj|stj|tj|tjj|d}t|d.}|j d|j d|j dWdQXn|S(Ns.eggss README.txtRQscThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. sAThis directory caches those eggs to prevent repeated downloads. s/However, it is safe to delete this directory. ( RTRUR;tcurdirtexiststmkdirR t hide_fileRSR.(RDt egg_cache_dirtreadme_txt_filenametf((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytget_egg_cache_dirs    cCsddlm}|jidgd6}|jd}|j|jd|jdjD|jr|j}d|kr|dd|}nd|f|d0s Ritsetuptargstxt install_dirtexclude_scriptst always_copytbuild_directoryteditabletupgradet multi_versiont no_reporttuserN( tsetuptools.command.easy_installRt __class__tget_option_dicttcleartupdateR9RRRtFalseRtensure_finalized(RDRRRatoptstlinksRtcmd((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR)s(      c Csg}|jj}x|jjD]\}}|j|d|j||jr%|j}d}d}|j s||}}nd|dd||fd|dd||ff}|j |d||d|R#((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR2s  %cKsZxS|jD]E\}}t|d|d}|rB||q |j||q WdS(sRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. t _exclude_N(R9RRR?(RDRRRtexclude((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRAs  cCs?t|ts%td|fntt|j|dS(Ns.packages: setting must be a list or tuple (%r)(RR<RRrR R:(RDR4((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_exclude_packagessc Cs|jj|_|jj|_|d}|jd}xS||kr||\}}||=ddl}|j|t|d*|d}q:Wtj|||}|j |} t | ddrd|f|j|d<|dk rgSn|S(Nitaliasesiitcommand_consumes_argumentss command lineR( R RRR tshlexRRRt_parse_command_optsR)RR( RDtparserRR*RCtsrctaliasREtnargst cmd_class((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRFs"   c Cs'i}x|jjD] \}}x|jD]\}\}}|dkrSq/n|jdd}|dkr|j|}|jj}|jt|dixZ|jD](\} } | |kr| }d}PqqWt dn|dkrd}n||j |i|`_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCs d}tj|tdddS(NsrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.t stackleveli(RRR(tmsg((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRsc Ks |j||_||_||_||_t|ttfrO|f}ng|D]}t|trV|^qV|_g|D]}t|ts|^q} | r| |d((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR&s  cCsFx?|jD]4}|j|s td|j||fq q WdS(sVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. sg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN(RpRhRR(RDRaR>((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs ((( RhRiRjRkRR RRRR%R&R(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRs7    (?t__all__RRTRRt distutils.logRjtdistutils.coret distutils.cmdtdistutils.distRst collectionsRtdistutils.errorsRRRtdistutils.utilRtdistutils.versionRtsetuptools.externRRtsetuptools.extern.six.movesR R R tsetuptools.dependsR t setuptoolsR tsetuptools.monkeyRtsetuptools.configRRYt py36compatRt __import__RR#RPRXRVRrR<RdRfRqRvRuRRRRRRRtcoreRRR(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyts\                H          PK!"unicode_utils.pycnu[ fc@sGddlZddlZddlmZdZdZdZdS(iN(tsixcCsnt|tjr"tjd|Sy4|jd}tjd|}|jd}Wntk rinX|S(NtNFDsutf-8(t isinstanceRt text_typet unicodedatat normalizetdecodetencodet UnicodeError(tpath((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyt decomposes cCsqt|tjr|Stjp%d}|df}x6|D].}y|j|SWq;tk rhq;q;Xq;WdS(sY Ensure that the given path is decoded, NONE when no expected encoding works sutf-8N(RRRtsystgetfilesystemencodingRtUnicodeDecodeError(R tfs_enct candidatestenc((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pytfilesys_decodes   cCs*y|j|SWntk r%dSXdS(s/turn unicode encoding into a functional routineN(RtUnicodeEncodeErrortNone(tstringR((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyt try_encode's (RR tsetuptools.externRR RR(((s</usr/lib/python2.7/site-packages/setuptools/unicode_utils.pyts   PK!0msite-patch.pyonu[ fc@s&dZedkr"e[ndS(cCsddl}ddl}|jjd}|dksL|jdkrU| rUg}n|j|j}t|di}|j t |}|j j t }x|D]}||ks| rqn|j|}|dk r|j d}|dk r|jdPqqy.ddl} | j d|g\} } } Wntk rRqnX| dkreqnz| jd| | | Wd| jXPqWtdtg|j D]}t|ddf^q} t|dd }d |_x|D]}t|qW|j|7_t|d \}}d}g}x|j D]}t|\}}||kr|dkrt |}n|| ks|dkr|j|qA|j|||d7}qAW||j (dS( Nit PYTHONPATHtwin32tpath_importer_cachetsites$Couldn't find the real 'site' moduleit __egginserti(tsystostenvirontgettNonetplatformtsplittpathseptgetattrtpathtlentdirnamet__file__t find_modulet load_moduletimpt ImportErrortclosetdicttmakepathRt addsitedirtappendtinsert(RRRtpictstdpathtmydirtitemtimportertloaderRtstreamRtdescrt known_pathstoldpostdtndt insert_attnew_pathtptnp((s9/usr/lib/python2.7/site-packages/setuptools/site-patch.pyt__boots`  "      "    2  RN(R,t__name__(((s9/usr/lib/python2.7/site-packages/setuptools/site-patch.pyts G PK! h3G wheel.pyonu[ fc@sdZddlmZddlZddlZddlZddlZddlZddlm Z m Z m Z ddl m Z ddlm ZddlmZddlmZejd ejjZd Zd Zd efd YZdS(sWheels support.i(t get_platformN(t Distributiont PathMetadatat parse_version(tPY3(R(t pep425tags(twrite_requirementss^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$stry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c CsBxtj|D]\}}}tjj||}xK|D]C}tjj||}tjj|||}tj||q;Wxttt|D]e\} } tjj|| }tjj||| }tjj |stj|||| =qqWqWx3tj|dt D]\}}}tj |qWdS(sDMove everything under `src_dir` to `dst_dir`, and delete the former.ttopdownN( tostwalktpathtrelpathtjointrenamestreversedtlistt enumeratetexiststTruetrmdir( tsrc_dirtdst_dirtdirpathtdirnamest filenamestsubdirtftsrctdsttntd((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pytunpacks %%tWheelcBs5eZdZdZdZdZdZRS(cCswttjj|}|dkr7td|n||_x0|jjD]\}}t |||qSWdS(Nsinvalid wheel name: %r( t WHEEL_NAMERR tbasenametNonet ValueErrortfilenamet groupdicttitemstsetattr(tselfR%tmatchtktv((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt__init__7s   cCs7tj|jjd|jjd|jjdS(s>List tags (py_version, abi, platform) supported by this wheel.t.(t itertoolstproductt py_versiontsplittabitplatform(R)((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyttags?scs/tjtfd|jDtS(s5Is the wheel is compatible with the current platform?c3s!|]}|krtVqdS(N(R(t.0tt(tsupported_tags(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys Hs(Rt get_supportedtnextR5tFalse(R)((R8s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt is_compatibleEs cCsAtd|jd|jd|jdkr-dntjdS(Nt project_nametversionR4tanys.egg(RR=R>R4R#Rtegg_name(R)((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyR@Js$c stj|jd|j|jf}d|d|fd}|d}|d}t|jd}td|kotd knstd |ntj |j |tj j |t j|d t|d tttjfd jD}tj j |d}tj|tjtj j |dtj j |dtdtdd|} t| jddtj j |dtj j |tj j d} tj j| rtj j |dd} tj | xstj| D]b} | jdrtjtj j | | q\tjtj j | | tj j | | q\Wtj| nx:t tj jfdd!DD]} t!| |qWtj jr1tjntj j |d}tj j|rt"|}|j#j$}WdQXx|D]}tj j ||j$d}tj j |d}tj j|rtj j| rt"|d }|j%t&WdQXqqWnWdQXdS("s"Install wheel as an egg directory.s%s-%ss %s.dist-infos%s.datacscjd|fD}tr7|jjdn |j}tjjj|SWdQXdS(Ns%s/%ssutf-8(topenRtreadtdecodetemailtparsertParsertparsestr(tnametfptvalue(t dist_infotzf(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyt get_metadataVs'tWHEELtMETADATAs Wheel-Versions1.0s2.0dev0s$unsupported wheel format version: %stmetadatacSsd|_t|S(N(R#tmarkertstr(treq((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pytraw_reqls c sJi|]@}ttfdtj|fD|qS(c3s!|]}|kr|VqdS(N((R6RS(tinstall_requires(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys rs(Rtsortedtmaptrequires(R6textra(tdistRURT(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys qs sEGG-INFOsPKG-INFOtattrsRUtextras_requiretegg_infos requires.txttscriptss.pycc3s$|]}tjj|VqdS(N(RR R (R6R(t dist_data(s4/usr/lib/python2.7/site-packages/setuptools/wheel.pys stdatatheaderstpurelibtplatlibsnamespace_packages.txtNR.s __init__.pytw(R`RaRbRc('tzipfiletZipFileR%R=R>RtgetR$Rtmkdirt extractallR R Rt from_locationRRRVRWRXtextrastrenametSetuptoolsDistributiontdictRtget_command_objR#RtlistdirtendswithtunlinkRtfilterRRARBR2twritetNAMESPACE_PACKAGE_INIT(R)tdestination_eggdirt dist_basenameRMtwheel_metadatat dist_metadatat wheel_versionR\R]t setup_disttdist_data_scriptstegg_info_scriptstentryRtnamespace_packagesRItmodtmod_dirtmod_init((RZR_RKRURTRLs4/usr/lib/python2.7/site-packages/setuptools/wheel.pytinstall_as_eggPsr    (    !        %(t__name__t __module__R-R5R<R@R(((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyR 5s     (t__doc__tdistutils.utilRRDR/RtreRet pkg_resourcesRRRtsetuptools.extern.sixRt setuptoolsRmRtsetuptools.command.egg_infoRtcompiletVERBOSER*R!RuRtobjectR (((s4/usr/lib/python2.7/site-packages/setuptools/wheel.pyts"      PK!j! __init__.pycnu[ fc@sdZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl ZddlmZddlmZmZddlmZd d lmZd d d ddddgZejjZdZeZdgZde fdYZ!de!fdYZ"e!j#Z$dZ%dZ&ej'j&je&_ej(ej'j)Z*de*fdYZ)dZ+ej,dZ-ej.dS(s@Extensions to the 'distutils' for large or complex distributionsiN(t convert_path(t fnmatchcase(tfiltertmap(t Extension(t DistributiontFeature(tRequirei(tmonkeytsetupRRtCommandRRt find_packagess lib2to3.fixest PackageFindercBsSeZdZeddddZedZedZedZRS( sI Generate a list of all Python packages found within a directory t.t*cCs7t|jt||jdd||j|S(s Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. tez_setups *__pycache__(tlistt_find_packages_iterRt _build_filter(tclstwheretexcludetinclude((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytfind's  c csxtj|dtD]\}}}|}g|(x|D]}tjj||} tjj| |} | jtjjd} d|ks:|j|  rq:n|| r||  r| Vn|j |q:WqWdS(sy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. t followlinksR N( tostwalktTruetpathtjointrelpathtreplacetsept_looks_like_packagetappend( RRRRtroottdirstfilestall_dirstdirt full_pathtrel_pathtpackage((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR>s% cCstjjtjj|dS(s%Does a directory look like a package?s __init__.py(RRtisfileR(R((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR!Zscs fdS(s Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfdDS(Nc3s!|]}td|VqdS(tpatN(R(t.0R,(tname(s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys es(tany(R.(tpatterns(R.s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytet((R0((R0s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR_s((R( t__name__t __module__t__doc__t classmethodRRt staticmethodR!R(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR "s tPEP420PackageFindercBseZedZRS(cCstS(N(R(R((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR!is(R3R4R7R!(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR8hscCsXtjjtd|jD}|jdt|jrT|j|jndS(Ncss-|]#\}}|dkr||fVqdS(tdependency_linkstsetup_requiresN(R9R:((R-tktv((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys us tignore_option_errors( t distutilstcoreRtdicttitemstparse_config_filesRR:tfetch_build_eggs(tattrstdist((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyt_install_setup_requiresqs   cKst|tjj|S(N(RFR>R?R (RD((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR ~s cBs,eZejZeZdZddZRS(cKs'tj||t|j|dS(sj Construct the command for dist, updating vars(self) with any keyword parameters. N(t_Commandt__init__tvarstupdate(tselfREtkw((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyRHsicKs,tj|||}t|j||S(N(RGtreinitialize_commandRIRJ(RKtcommandtreinit_subcommandsRLtcmd((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyRMs(R3R4RGR5tFalsetcommand_consumes_argumentsRHRM(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyR s  cCs2dtj|dtD}ttjj|S(s% Find all files under 'path' css:|]0\}}}|D]}tjj||VqqdS(N(RRR(R-tbaseR$R%tfile((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pys s R(RRRRRR+(Rtresults((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyt_find_all_simplescCsRt|}|tjkrHtjtjjd|}t||}nt|S(s Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. tstart( RVRtcurdirt functoolstpartialRRRR(R'R%tmake_rel((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pytfindalls  (/R5RRYtdistutils.coreR>tdistutils.filelisttdistutils.utilRtfnmatchRtsetuptools.extern.six.movesRRtsetuptools.versiont setuptoolstsetuptools.extensionRtsetuptools.distRRtsetuptools.dependsRR2Rt__all__tversiont __version__tNonetbootstrap_install_fromRtrun_2to3_on_docteststlib2to3_fixer_packagestobjectR R8RR RFR R?t get_unpatchedR RGRVRXR\t patch_all(((s7/usr/lib/python2.7/site-packages/setuptools/__init__.pyts:        F    PK!<k$jjpy31compat.pycnu[ fc@sddgZyddlmZmZWn0ek rXddlmZmZdZnXyddlmZWn?ek rddl Z ddlZde fd YZnXdS( tget_config_varstget_pathi(RR(Rtget_python_libcCs+|dkrtdnt|dkS(NtplatlibtpurelibsName must be purelib or platlib(RR(t ValueErrorR(tname((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyR s (tTemporaryDirectoryNRcBs)eZdZdZdZdZRS(s Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cCsd|_tj|_dS(N(tNoneRttempfiletmkdtemp(tself((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt__init__s cCs|jS(N(R(R ((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt __enter__!scCs8ytj|jtWntk r*nXd|_dS(N(tshutiltrmtreeRtTruetOSErrorR(R texctypetexcvaluetexctrace((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyt__exit__$s  (t__name__t __module__t__doc__R R R(((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyRs  ( t__all__t sysconfigRRt ImportErrortdistutils.sysconfigRR RRtobject(((s9/usr/lib/python2.7/site-packages/setuptools/py31compat.pyts      PK!81 1 *extern/__pycache__/__init__.cpython-36.pycnu[3 vh @s.ddlZGdddZdZeeedjdS) Nc@sDeZdZdZfdfddZeddZd ddZd d Zd d Z dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|jdd|_dS)NZexternZ_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrrr /usr/lib/python3.6/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)r)rr r r search_paths zVendorImporter.search_pathcCs8|j|jd\}}}|rdStt|j|js4dS|S)z Return self when fullname starts with root_name and the target module is one vendored through this importer. r N) partitionranymap startswithr)rfullnamepathrootbasetargetr r r find_modules zVendorImporter.find_modulec Cs|j|jd\}}}xp|jD]T}y:||}t|tj|}|tj|<tjdkrZtj|=|Stk rpYqXqWtdjft dS)zK Iterate over the search path to locate and load fullname. r zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N)rr) rrr __import__sysmodules version_info ImportErrorformatlocals)rrrrrprefixZextantmodr r r load_module#s     zVendorImporter.load_modulecCs|tjkrtjj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappend)rr r r install@s zVendorImporter.install)N) __name__ __module__ __qualname____doc__r propertyrrr#r&r r r r rs   rsix packaging pyparsingzsetuptools._vendor)r,r-r.)rrnamesr'r&r r r r sDPK!81 1 0extern/__pycache__/__init__.cpython-36.opt-1.pycnu[3 vh @s.ddlZGdddZdZeeedjdS) Nc@sDeZdZdZfdfddZeddZd ddZd d Zd d Z dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|jdd|_dS)NZexternZ_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrrr /usr/lib/python3.6/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)r)rr r r search_paths zVendorImporter.search_pathcCs8|j|jd\}}}|rdStt|j|js4dS|S)z Return self when fullname starts with root_name and the target module is one vendored through this importer. r N) partitionranymap startswithr)rfullnamepathrootbasetargetr r r find_modules zVendorImporter.find_modulec Cs|j|jd\}}}xp|jD]T}y:||}t|tj|}|tj|<tjdkrZtj|=|Stk rpYqXqWtdjft dS)zK Iterate over the search path to locate and load fullname. r zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N)rr) rrr __import__sysmodules version_info ImportErrorformatlocals)rrrrrprefixZextantmodr r r load_module#s     zVendorImporter.load_modulecCs|tjkrtjj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappend)rr r r install@s zVendorImporter.install)N) __name__ __module__ __qualname____doc__r propertyrrr#r&r r r r rs   rsix packaging pyparsingzsetuptools._vendor)r,r-r.)rrnamesr'r&r r r r sDPK!7+__pycache__/namespaces.cpython-36.opt-1.pycnu[3 vh @sRddlZddlmZddlZddlmZejjZGdddZ Gddde Z dS)N)log)mapc @sTeZdZdZddZddZddZdZdZddZ ddZ ddZ e ddZ dS) Installerz -nspkg.pthc Cs|j}|sdStjj|j\}}||j7}|jj|tj d|t |j |}|j rdt |dSt|d}|j|WdQRXdS)Nz Installing %sZwt)_get_all_ns_packagesospathsplitext _get_target nspkg_extZoutputsappendrinfor_gen_nspkg_lineZdry_runlistopen writelines)selfZnspfilenameextlinesfr /usr/lib/python3.6/namespaces.pyinstall_namespacess     zInstaller.install_namespacescCsHtjj|j\}}||j7}tjj|s.dStjd|tj|dS)Nz Removing %s) rrrr r existsrr remove)rrrrrruninstall_namespaces!s    zInstaller.uninstall_namespacescCs|jS)N)target)rrrrr )szInstaller._get_targetimport sys, types, os#has_mfs = sys.version_info > (3, 5)$p = os.path.join(%(root)s, *%(pth)r)4importlib = has_mfs and __import__('importlib.util')-has_mfs and __import__('importlib.machinery')m = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))Cm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))7mp = (m or []) and m.__dict__.setdefault('__path__',[])(p not in mp) and mp.append(p)4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']r)rrrr _get_rootCszInstaller._get_rootcCsVt|}t|jd}|j}|j}|jd\}}}|rB||j7}dj|tdS)N.; ) strtuplesplitr' _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgZpthrootZ tmpl_linesparentsepZchildrrrr Fs zInstaller._gen_nspkg_linecCs |jjp g}ttt|j|S)z,Return sorted list of all package namespaces)Z distributionZnamespace_packagessortedflattenr _pkg_names)rZpkgsrrrrQs zInstaller._get_all_ns_packagesccs,|jd}x|r&dj|V|jq WdS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r(N)r-r1pop)r3partsrrrr9Vs  zInstaller._pkg_namesN) rrrr r!r"r#r$r%)r&)__name__ __module__ __qualname__r rrr r.r0r'r r staticmethodr9rrrrr s$ rc@seZdZddZddZdS)DevelopInstallercCstt|jS)N)reprr+Zegg_path)rrrrr'gszDevelopInstaller._get_rootcCs|jS)N)Zegg_link)rrrrr jszDevelopInstaller._get_targetN)r<r=r>r'r rrrrr@fsr@) rZ distutilsr itertoolsZsetuptools.extern.six.movesrchain from_iterabler8rr@rrrrs   [PK!WƖ%__pycache__/site-patch.cpython-36.pycnu[3 vh @sddZedkre[dS)cCsddl}ddl}|jjd}|dks4|jdkr:| r:g}n |j|j}t|di}|jt |d}|jj t }x|D]}||ksv| rqv|j|}|dk r|j d}|dk r|j dPqvy ddl} | j d|g\} } } Wntk rwvYnX| dkrqvz| j d| | | Wd| jXPqvWtdtdd|jD} t|d d}d|_x|D]}t|qXW|j|7_t|d\}}d}g}xl|jD]b}t|\}}||kr|dkrt |}|| ks|dkr|j|n|j|||d 7}qW||jdd<dS) N PYTHONPATHZwin32path_importer_cachesitez$Couldn't find the real 'site' modulecSsg|]}t|ddfqS))makepath).0itemr /usr/lib/python3.6/site-patch.py )sz__boot.. __egginsertr)sysosenvirongetplatformsplitpathsepgetattrpathlendirname__file__ find_module load_moduleimp ImportErrorclosedictr addsitedirrappendinsert)r rrZpicZstdpathZmydirrZimporterloaderrstreamrZdescr known_pathsZoldposdZndZ insert_atnew_pathpZnpr r r __boots`               r(rN)r(__name__r r r r sGPK!߼]J%__pycache__/glob.cpython-36.opt-1.pycnu[3 vhW@sdZddlZddlZddlZddlmZdddgZdddZdd dZd d Z d d Z ddZ ddZ ddZ ejdZejdZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. N) binary_typeglobiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamerr /usr/lib/python3.6/glob.pyrs cCs"t||}|rt|rt|}|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenext)rritsr r r r s  ccs tjj|\}}t|sF|r0tjj|rB|Vntjj|rB|VdS|s|rrt|rrx4t||D] }|VqbWnxt||D] }|Vq~WdS||krt|rt ||}n|g}t|r|rt|rt}qt}nt }x0|D](}x"|||D]}tjj ||VqWqWdS)N) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirsZ glob_in_dirnamer r r r 2s4        r c CsR|s"t|trtjjd}ntj}ytj|}Wntk rDgSXtj||S)NASCII) isinstancerrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesr r r r]s rcCs8|stjj|r4|gSntjjtjj||r4|gSgS)N)rrrrr)rrr r r rjs  rccs*|ddVxt|D] }|VqWdS)Nr) _rlistdir)rr'rr r r rzsrc cs|s"t|trttjd}ntj}ytj|}Wntjk rFdSXxJ|D]B}|V|rjtjj||n|}x t|D]}tjj||VqxWqNWdS)Nr) r rrr!r#errorrrr))rr(rryr r r r)s  r)z([*?[])s([*?[])cCs(t|trtj|}n tj|}|dk S)N)r rmagic_check_bytessearch magic_check)rmatchr r r rs   rcCst|tr|dkS|dkSdS)Ns**z**)r r)r'r r r r s r cCs<tjj|\}}t|tr(tjd|}n tjd|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver rr,subr.)rZdriver r r rs   )F)F)__doc__rrer%Zsetuptools.extern.sixr__all__rrr rrrr)compiler.r,rr rr r r r s"    +   PK!ㄙ%__pycache__/msvc.cpython-36.opt-1.pycnu[3 vh @sdZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ej dkrpddl mZejZnGd d d ZeZeejjfZydd lmZWnek rYnXd d Zd ddZddZddZd!ddZGdddZGdddZGdddZGdddZ dS)"a@ Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) N) LegacyVersion) filterfalse) get_unpatchedWindows)winregc@seZdZdZdZdZdZdS)rN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/usr/lib/python3.6/msvc.pyr(sr)RegcCsd}|d|f}ytj|d}WnJtk rjy|d|f}tj|d}Wntk rdd}YnXYnX|rtjjjj|d}tjj|r|Stt|S)a+ Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ vcvarsall.bat path: str z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f installdirz Wow6432Node\Nz vcvarsall.bat) rZ get_valueKeyErrorospathjoinisfilermsvc9_find_vcvarsall)versionZVC_BASEkey productdir vcvarsallrrrr?s   rx86cOsytt}|||f||Stjjk r2Yntk rDYnXyt||jStjjk r}zt|||WYdd}~XnXdS)a Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ environment: dict N) rmsvc9_query_vcvarsall distutilserrorsDistutilsPlatformError ValueErrorEnvironmentInfo return_env_augment_exception)verarchargskwargsZorigexcrrrrjs rcCsny tt|Stjjk r$YnXyt|ddjStjjk rh}zt|dWYdd}~XnXdS)a' Patched "distutils._msvccompiler._get_vc_env" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Parameters ---------- plat_spec: str Target architecture. Return ------ environment: dict g,@) vc_min_verN)rmsvc14_get_vc_envr r!r"r$r%r&)Z plat_specr+rrrr-s  r-cOsBdtjkr4ddl}t|jtdkr4|jjj||Stt ||S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesZnumpyr __version__r Z ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r)r*Znprrrr1s  r1rcCs|jd}d|jks"d|jkrd}|jft}d}|dkrr|jjddkrh|d 7}||d 7}q|d 7}n.|d kr|d 7}||d7}n|dkr|d7}|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rrzvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rz* Get it with "Microsoft Windows SDK 7.0": iB z% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN)r)lowerformatlocalsfind)r+rr(messageZtmplZ msdownloadrrrr&s   r&c@sbeZdZdZejddjZddZe ddZ dd Z d d Z dd dZ dddZdddZdS) PlatformInfoz Current and Target Architectures informations. Parameters ---------- arch: str Target architecture. Zprocessor_architecturercCs|jjdd|_dS)Nx64amd64)r3replacer()selfr(rrr__init__szPlatformInfo.__init__cCs|j|jjdddS)N_r)r(r6)r<rrr target_cpuszPlatformInfo.target_cpucCs |jdkS)Nr)r?)r<rrr target_is_x86szPlatformInfo.target_is_x86cCs |jdkS)Nr) current_cpu)r<rrrcurrent_is_x86szPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ subfolder: str ' arget', or '' (see hidex86 parameter) rrr:z\x64z\%s)rA)r<hidex86r9rrr current_dir szPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ subfolder: str '\current', or '' (see hidex86 parameter) rrr:z\x64z\%s)r?)r<rCr9rrr target_dirszPlatformInfo.target_dircCs0|rdn|j}|j|krdS|jjdd|S)ao Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current acritecture is not x86. Return ------ subfolder: str '' if target architecture is current architecture, '\current_target' if not. rr\z\%s_)rAr?rEr;)r<forcex86Zcurrentrrr cross_dir5szPlatformInfo.cross_dirN)FF)FF)F)rr r __doc__safe_envgetr3rAr=propertyr?r@rBrDrErHrrrrr8s   r8c@seZdZdZejejejejfZ ddZ e ddZ e ddZ e dd Ze d d Ze d d Ze ddZe ddZe ddZe ddZdddZddZdS) RegistryInfoz Microsoft Visual Studio related registry informations. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dS)N)pi)r<Z platform_inforrrr=ZszRegistryInfo.__init__cCsdS)z< Microsoft Visual Studio root registry key. Z VisualStudior)r<rrr visualstudio]szRegistryInfo.visualstudiocCstjj|jdS)z; Microsoft Visual Studio SxS registry key. ZSxS)rrrrO)r<rrrsxsdszRegistryInfo.sxscCstjj|jdS)z8 Microsoft Visual C++ VC7 registry key. ZVC7)rrrrP)r<rrrvckszRegistryInfo.vccCstjj|jdS)z; Microsoft Visual Studio VS7 registry key. ZVS7)rrrrP)r<rrrvsrszRegistryInfo.vscCsdS)z? Microsoft Visual C++ for Python registry key. zDevDiv\VCForPythonr)r<rrr vc_for_pythonyszRegistryInfo.vc_for_pythoncCsdS)z- Microsoft SDK registry key. zMicrosoft SDKsr)r<rrr microsoft_sdkszRegistryInfo.microsoft_sdkcCstjj|jdS)z> Microsoft Windows/Platform SDK registry key. r)rrrrT)r<rrr windows_sdkszRegistryInfo.windows_sdkcCstjj|jdS)z< Microsoft .NET Framework SDK registry key. ZNETFXSDK)rrrrT)r<rrr netfx_sdkszRegistryInfo.netfx_sdkcCsdS)z< Microsoft Windows Kits Roots registry key. zWindows Kits\Installed Rootsr)r<rrrwindows_kits_rootsszRegistryInfo.windows_kits_rootsFcCs(|jjs|rdnd}tjjd|d|S)a  Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str: value rZ Wow6432NodeZSoftwareZ Microsoft)rNrBrrr)r<rrZnode64rrr microsoftszRegistryInfo.microsoftcCstj}tj}|j}x|jD]}y||||d|}WnZttfk r|jjsy||||dd|}Wqttfk rwYqXnwYnXytj ||dSttfk rYqXqWdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str: value rTN) rKEY_READOpenKeyrXHKEYSOSErrorIOErrorrNrBZ QueryValueEx)r<rnamerYZopenkeymshkeybkeyrrrlookups"   zRegistryInfo.lookupN)F)rr r rIrr r r rr[r=rLrOrPrQrRrSrTrUrVrWrXrbrrrrrMLs"          rMc@s$eZdZdZejddZejddZejdeZd3ddZ d d Z d d Z e d dZ e ddZddZddZe ddZe ddZe ddZe ddZe ddZe dd Ze d!d"Ze d#d$Ze d%d&Ze d'd(Ze d)d*Ze d+d,Ze d-d.Zd/d0Zd4d1d2ZdS)5 SystemInfoz Microsoft Windows and Visual Studio related system inormations. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirr ProgramFileszProgramFiles(x86)NcCs"||_|jj|_|p|j|_dS)N)rirN_find_latest_available_vc_vervc_ver)r<Z registry_inforhrrrr=s zSystemInfo.__init__c Cs6y |jdStk r0d}tjj|YnXdS)Nrz%No Microsoft Visual C++ version foundr2)find_available_vc_vers IndexErrorr r!r")r<errrrrrgs  z(SystemInfo._find_latest_available_vc_verc Cs6|jj}|jj|jj|jjf}g}x|jjD]}x|D]}ytj|||dtj}Wnt t fk rpw8YnXtj |\}}} xPt |D]D} y*t tj|| d} | |kr|j| Wqtk rYqXqWxPt |D]D} y(t tj|| } | |kr|j| Wqtk r YqXqWq8Wq.Wt|S)zC Find all available Microsoft Visual C++ versions. r)rfrXrQrSrRr[rrZrYr\r]Z QueryInfoKeyrangefloatZ EnumValueappendr#ZEnumKeysorted) r<r_ZvckeysZvc_versr`rraZsubkeysvaluesr>ir'rrrris2   z!SystemInfo.find_available_vc_verscCs6d|j}tjj|j|}|jj|jjd|jp4|S)z4 Microsoft Visual Studio directory. zMicrosoft Visual Studio %0.1fz%0.1f)rhrrrProgramFilesx86rfrbrR)r<r^defaultrrr VSInstallDir s zSystemInfo.VSInstallDircCs|j|jp|j}tjj|jjd|j}|jj |d}|rNtjj|dn|}|jj |jj d|jpl|}tjj |sd}t j j||S)z1 Microsoft Visual C++ directory. z%0.1frZVCz(Microsoft Visual C++ directory not found)rt _guess_vc_guess_vc_legacyrrrrfrSrhrbrQisdirr r!r")r<guess_vcZreg_pathZ python_vcZ default_vcrmsgrrr VCInstallDirs  zSystemInfo.VCInstallDirc Cs^|jdkrdSd}tjj|j|}ytj|d}tjj||Stttfk rXYnXdS)z* Locate Visual C for 2017 g,@Nz VC\Tools\MSVCrr2) rhrrrrtlistdirr\r]rj)r<rsrxZ vc_exact_verrrrru0s zSystemInfo._guess_vccCsd|j}tjj|j|S)z< Locate Visual C for versions prior to 2017 z Microsoft Visual Studio %0.1f\VC)rhrrrrr)r<rsrrrrv@s zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jd kr8dS|jdkrFdSdS)zN Microsoft Windows SDK versions for specified MSVC++ version. g"@7.06.16.0ag$@7.17.0ag&@8.08.0ag(@8.18.1ag,@10.0N)r|r}r~)rr)rr)rr)rr)rh)r<rrrWindowsSdkVersionGs     zSystemInfo.WindowsSdkVersioncCs|jtjj|jdS)z4 Microsoft Windows SDK last version lib)_use_last_dir_namerrr WindowsSdkDir)r<rrrWindowsSdkLastVersionWs z SystemInfo.WindowsSdkLastVersioncCsTd}x8|jD].}tjj|jjd|}|jj|d}|r Pq W| sRtjj| rtjj|jjd|j }|jj|d}|rtjj|d}| stjj| rxH|jD]>}|d|j d}d |}tjj|j |}tjj|r|}qW| stjj| r:x:|jD]0}d |}tjj|j |}tjj|r|}qW|sPtjj|j d }|S) z2 Microsoft Windows SDK directory. rzv%sinstallationfolderz%0.1frZWinSDKN.zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZ PlatformSDK) rrrrrfrUrbrwrSrhrfindrerz)r<sdkdirr'locrZ install_baseZintverdrrrr_s6     zSystemInfo.WindowsSdkDirc Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d ||jd d f}g}|jd krx(|jD]}|tjj|jj ||g7}qdWx,|j D]"}|tjj|jj d ||g7}qWx |D]}|jj |d}|rPqW|S)z= Microsoft Windows SDK executable directory. g&@#r(g(@TF)r9rCzWinSDK-NetFx%dTools%srF-g,@zv%sAr) rhrNrDr;NetFxSdkVersionrrrrfrVrrUrb) r<Znetfxverr(rCZfxZregpathsr'rZexecpathrrrWindowsSDKExecutablePaths$    " z#SystemInfo.WindowsSDKExecutablePathcCs.d|j}tjj|jj|}|jj|dp,dS)z0 Microsoft Visual F# directory. z%0.1f\Setup\F#rr)rhrrrrfrOrb)r<rrrrFSharpInstallDirs zSystemInfo.FSharpInstallDircCsF|jdkrd}nf}x(|D] }|jj|jjd|}|rPqW|pDdS)z8 Microsoft Universal CRT SDK directory. g,@1081z kitsroot%sr)rr)rhrfrbrW)r<Zversr'rrrrUniversalCRTSdkDirs    zSystemInfo.UniversalCRTSdkDircCs|jtjj|jdS)z@ Microsoft Universal C Runtime SDK last version r)rrrrr)r<rrrUniversalCRTSdkLastVersions z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSfSdS)z8 Microsoft .NET Framework SDK versions. g,@4.6.14.6N)rr)rh)r<rrrrs zSystemInfo.NetFxSdkVersioncCs>x4|jD]*}tjj|jj|}|jj|d}|rPqW|p)sz0SystemInfo._use_last_dir_name..Nr)reversedrr{next)r<rrZ matching_dirsr)rrrrs zSystemInfo._use_last_dir_name)N)r) rr r rIrJrKrdrerrr=rgrirLrtrzrurvrrrrrrrrrrrrrrrrrrrrcs4         &     rcc@sReZdZdZd=ddZeddZedd Zed d Zed d Z eddZ eddZ eddZ eddZ eddZeddZddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zd>d7d8Zd9d:Zd?d;d<Z dS)@r$aY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.0. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. NrcCsBt||_t|j|_t|j||_|j|kr>d}tjj |dS)Nz.No suitable Microsoft Visual C++ version found) r8rNrMrfrcsirhr r!r")r<r(rhr,rkrrrr=Is    zEnvironmentInfo.__init__cCs|jjS)z/ Microsoft Visual C++ version. )rrh)r<rrrrhRszEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd d |DS) z/ Microsoft Visual Studio Tools z Common7\IDEz Common7\Toolsg,@T)rCr9z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjjjj|qSr)rrrrrt)rr)r<rr fsz+EnvironmentInfo.VSTools..)rhrNrD)r<paths arch_subdirr)r<rVSToolsYs   zEnvironmentInfo.VSToolscCs$tjj|jjdtjj|jjdgS)zL Microsoft Visual C++ & Microsoft Foundation Class Includes ZIncludezATLMFC\Include)rrrrrz)r<rrr VCIncludeshszEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd d |DS) zM Microsoft Visual C++ & Microsoft Foundation Class Libraries g.@T)r9)rCzLib%sz ATLMFC\Lib%sg,@z Lib\store%scsg|]}tjjjj|qSr)rrrrrz)rr)r<rrr~sz/EnvironmentInfo.VCLibraries..)rhrNrE)r<rrr)r<r VCLibrariesps  zEnvironmentInfo.VCLibrariescCs"|jdkrgStjj|jjdgS)zA Microsoft Visual C++ store references Libraries g,@zLib\store\references)rhrrrrrz)r<rrr VCStoreRefss zEnvironmentInfo.VCStoreRefscCs|j}tjj|jdg}|jdkr&dnd}|jj|}|rT|tjj|jd|g7}|jdkrd|jjdd}|tjj|j|g7}n|jdkr|jj rd nd }|tjj|j||jj dd g7}|jj |jj kr|tjj|j||jjdd g7}n|tjj|jd g7}|S) z, Microsoft Visual C++ Tools Z VCPackagesg$@TFzBin%sg,@)rCg.@z bin\HostX86%sz bin\HostX64%s)r9Bin) rrrrrzrhrNrHrDrBrErAr?)r<rtoolsrGrrZhost_dirrrrVCToolss&   zEnvironmentInfo.VCToolscCst|jdkr2|jjddd}tjj|jjd|gS|jjdd}tjj|jjd}|j}tjj|d||fgSdS) z1 Microsoft Windows SDK Libraries g$@T)rCr9zLib%s)r9rz%sum%sN) rhrNrErrrrr _sdk_subdir)r<rrZlibverrrr OSLibrariess zEnvironmentInfo.OSLibrariescCs|tjj|jjd}|jdkr.|tjj|dgS|jdkr@|j}nd}tjj|d|tjj|d|tjj|d|gSd S) z/ Microsoft Windows SDK Include includeg$@Zglg,@rz%ssharedz%sumz%swinrtN)rrrrrrhr)r<rsdkverrrr OSIncludess  zEnvironmentInfo.OSIncludescCstjj|jjd}g}|jdkr*||j7}|jdkrH|tjj|dg7}|jdkr||tjj|jjdtjj|ddtjj|d dtjj|d dtjj|jjd d d |jdddg7}|S)z7 Microsoft Windows SDK Libraries Paths Z Referencesg"@g&@zCommonConfiguration\Neutralg,@Z UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrrrrrhr)r<reflibpathrrr OSLibpaths>     zEnvironmentInfo.OSLibpathcCs t|jS)z- Microsoft Windows SDK Tools )list _sdk_tools)r<rrrSdkToolsszEnvironmentInfo.SdkToolsccs|jdkr0|jdkrdnd}tjj|jj|V|jjsd|jjdd}d|}tjj|jj|V|jdksx|jdkr|jj rd }n|jjddd }d |}tjj|jj|VnL|jdkrtjj|jjd}|jjdd}|jj }tjj|d ||fV|jj r|jj Vd S)z= Microsoft Windows SDK Tools paths generator g.@g&@rzBin\x86T)r9zBin%sg$@r)rCr9zBin\NETFX 4.0 Tools%sz%s%sN) rhrrrrrrNrBrDr@rr)r<Zbin_dirrrrrrrrs(     zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)z6 Microsoft Windows SDK version subdir z%s\r)rr)r<ucrtverrrrrszEnvironmentInfo._sdk_subdircCs"|jdkrgStjj|jjdgS)z- Microsoft Windows SDK Setup g"@ZSetup)rhrrrrr)r<rrrSdkSetup%s zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}|j o,|j }n$|jp>|j}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)z0 Microsoft .NET Framework Tools g$@Tr:csg|]}tjjj|qSr)rrrr)rr')rrrr@sz+EnvironmentInfo.FxTools..csg|]}tjjj|qSr)rrrr)rr')rrrrCs) rNrrhr@rBrAr?rr)r<rNZ include32Z include64rr)rrFxTools/s     zEnvironmentInfo.FxToolscCs>|jdks|jj rgS|jjdd}tjj|jjd|gS)z8 Microsoft .Net Framework SDK Libraries g,@T)r9zlib\um%s)rhrrrNrErrr)r<rrrrNetFxSDKLibrariesGsz!EnvironmentInfo.NetFxSDKLibrariescCs,|jdks|jj rgStjj|jjdgS)z7 Microsoft .Net Framework SDK Includes g,@z include\um)rhrrrrr)r<rrrNetFxSDKIncludesRsz EnvironmentInfo.NetFxSDKIncludescCstjj|jjdgS)z> Microsoft Visual Studio Team System Database z VSTSDB\Deploy)rrrrrt)r<rrrVsTDb\szEnvironmentInfo.VsTDbcCs~|jdkrgS|jdkr0|jj}|jjdd}n |jj}d}d|j|f}tjj||g}|jdkrz|tjj||dg7}|S)z( Microsoft Build Engine g(@g.@T)rCrzMSBuild\%0.1f\bin%sZRoslyn) rhrrrrNrDrtrrr)r< base_pathrrZbuildrrrMSBuildcs   zEnvironmentInfo.MSBuildcCs"|jdkrgStjj|jjdgS)z. Microsoft HTML Help Workshop g&@zHTML Help Workshop)rhrrrrrr)r<rrrHTMLHelpWorkshopzs z EnvironmentInfo.HTMLHelpWorkshopcCsL|jdkrgS|jjdd}tjj|jjd}|j}tjj|d||fgS)z= Microsoft Universal C Runtime SDK Libraries g,@T)r9rz%sucrt%s) rhrNrErrrrr _ucrt_subdir)r<rrrrrr UCRTLibrariess  zEnvironmentInfo.UCRTLibrariescCs6|jdkrgStjj|jjd}tjj|d|jgS)z; Microsoft Universal C Runtime SDK Include g,@rz%sucrt)rhrrrrrr)r<rrrr UCRTIncludess zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)zB Microsoft Universal C Runtime SDK version subdir z%s\r)rr)r<rrrrrszEnvironmentInfo._ucrt_subdircCs |jdkr|jdkrgS|jjS)z% Microsoft Visual F# g&@g(@)rhrr)r<rrrFSharpszEnvironmentInfo.FSharpcCsl|jjdd}|jdkr&|jj}d}n|jjjdd}d}|jdkrHdn|j}|||j|f}tjj||S) zA Microsoft Visual C++ runtime redistribuable dll T)r9z-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllz\Toolsz\Redistz.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@) rNrErhrrzr;rrr)r<rZ redist_pathZ vcruntimeZdll_verrrrVCRuntimeRedists zEnvironmentInfo.VCRuntimeRedistTcCst|jd|j|j|j|jg||jd|j|j|j|j |j g||jd|j|j|j |j g||jd|j |j|j|j|j|j|j|j|jg |d}|jdkrtjj|jr|j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. rrrr)rrrrZpy_vcruntime_redist)dict _build_pathsrrrrrrrrrrrrrrrrrrrrhrrrr)r<existsenvrrrr%sD   zEnvironmentInfo.return_envc Csxtjj|}tj|djtj}tj||}|rBtt tj j |n|}|sbd|j }t jj||j|} tjj| S)a Given an environment variable name and specified paths, return a pathsep-separated string of paths containing unique, extant, directories from those paths and from the environment variable. Raise an error if no paths are resolved. rz %s environment variable is empty) itertoolschain from_iterablerJrKsplitrpathseprfilterrrwupperr r!r"_unique_everseenr) r<r^Zspec_path_listsrZ spec_pathsZ env_pathsrZ extant_pathsryZ unique_pathsrrrrs     zEnvironmentInfo._build_pathsccsjt}|j}|dkr:xPt|j|D]}|||Vq"Wn,x*|D]"}||}||kr@|||Vq@WdS)z List unique elements, preserving order. Remember all elements ever seen. _unique_everseen('AAAABBBCCDAABBB') --> A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N)setaddr __contains__)r<iterablerseenZseen_addelementkrrrrs   z EnvironmentInfo._unique_everseen)Nr)T)N)!rr r rIr=rLrhrrrrrrrrrrrrrrrrrrrrrrrr%rrrrrrr$1s:       -        -r$)r)r)!rIrr.platformrZdistutils.errorsr Z#setuptools.extern.packaging.versionrZsetuptools.extern.six.movesrZmonkeyrsystemrenvironrJr ImportErrorr!r"Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrrr-r1r&r8rMrcr$rrrrs>      + /& %[bPK!S }==,__pycache__/ssl_support.cpython-36.opt-1.pycnu[3 vh,!"@sddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z y ddl Z Wnek rtdZ YnXdddddgZd jjZyejjZejZWnek reZZYnXe dk oeeefkZydd l mZmZWnRek r:ydd lmZdd lmZWnek r4dZdZYnXYnXesRGd ddeZesjdddZddZGdddeZGdddeZd ddZ ddZ!e!ddZ"ddZ#ddZ$dS)!N)urllib http_clientmapfilter)ResolutionErrorExtractionErrorVerifyingHTTPSHandlerfind_ca_bundle is_available cert_paths opener_fora /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem )CertificateErrormatch_hostname)r )rc@s eZdZdS)r N)__name__ __module__ __qualname__rr!/usr/lib/python3.6/ssl_support.pyr 5sr c Csg}|s dS|jd}|d}|dd}|jd}||krLtdt||s`|j|jkS|dkrt|jdn>|jd s|jd r|jtj|n|jtj|j d d x|D]}|jtj|qWtj d d j |dtj } | j |S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsZfragZpatrrr_dnsname_match;s*     r&cCs|s tdg}|jdf}x0|D](\}}|dkr"t||r@dS|j|q"W|sxF|jdfD]6}x0|D](\}}|dkrjt||rdS|j|qjWq`Wt|dkrtd|d jtt|fn*t|dkrtd ||d fntd dS) a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. zempty or no certificateZsubjectAltNameZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetr&rlenr r!rr)Zcertr$ZdnsnamesZsankeyvaluesubrrrros.     rc@s eZdZdZddZddZdS)rz=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|dS)N) ca_bundle HTTPSHandler__init__)selfr-rrrr/szVerifyingHTTPSHandler.__init__csjfdd|S)Ncst|jf|S)N)VerifyingHTTPSConnr-)hostkw)r0rrsz2VerifyingHTTPSHandler.https_open..)Zdo_open)r0Zreqr)r0r https_opensz VerifyingHTTPSHandler.https_openN)rrr__doc__r/r5rrrrrsc@s eZdZdZddZddZdS)r1z@Simple verifying connection: no auth, subclasses, timeouts, etc.cKstj||f|||_dS)N)HTTPSConnectionr/r-)r0r2r-r3rrrr/szVerifyingHTTPSConn.__init__c Cstj|j|jft|dd}t|drHt|ddrH||_|j|j}n|j}tt drxt j |j d}|j ||d|_nt j |t j |j d|_yt|jj|Wn.tk r|jjtj|jjYnXdS)NZsource_address_tunnel _tunnel_hostcreate_default_context)Zcafile)Zserver_hostname)Z cert_reqsZca_certs)socketZcreate_connectionr2Zportgetattrhasattrsockr8r9sslr:r-Z wrap_socketZ CERT_REQUIREDrZ getpeercertr ZshutdownZ SHUT_RDWRclose)r0r>Z actual_hostZctxrrrconnects$  zVerifyingHTTPSConn.connectN)rrrr6r/rArrrrr1sr1cCstjjt|ptjS)z@Get a urlopen() replacement that uses ca_bundle for verification)rrequestZ build_openerrr open)r-rrrr scstjfdd}|S)Ncstds||_jS)Nalways_returns)r=rD)argskwargs)funcrrwrappers  zonce..wrapper) functoolswraps)rGrHr)rGroncesrKc sXy ddl}Wntk r dSXGfddd|j}|jd|jd|jS)Nrcs,eZdZfddZfddZZS)z"get_win_certfile..CertFilecst|jtj|jdS)N)superr/atexitregisterr@)r0)CertFile __class__rrr/sz+get_win_certfile..CertFile.__init__c s,yt|jWntk r&YnXdS)N)rLr@OSError)r0)rOrPrrr@sz(get_win_certfile..CertFile.close)rrrr/r@ __classcell__r)rO)rPrrOsrOZCAZROOT) wincertstore ImportErrorrOZaddstorename)rSZ _wincertsr)rOrget_win_certfiles    rVcCs$ttjjt}tp"t|dp"tS)z*Return an existing CA bundle path, or NoneN)rospathisfiler rVnext_certifi_where)Zextant_cert_pathsrrrr s c Cs,y tdjStttfk r&YnXdS)NZcertifi) __import__whererTrrrrrrr[s r[)r)N)%rWr;rMrrIZsetuptools.extern.six.movesrrrrZ pkg_resourcesrrr?rT__all__striprr rBr.r7AttributeErrorobjectr r rZbackports.ssl_match_hostnamer'r&rr1r rKrVr r[rrrrsP      4) (   PK!dkS  __pycache__/glibc.cpython-36.pycnu[3 vhJ @sHddlmZddlZddlZddlZddZddZddZd d ZdS) )absolute_importNc CsPtjd}y |j}Wntk r(dSXtj|_|}t|tsL|jd}|S)z9Returns glibc version string, or None if not using glibc.Nascii) ctypesZCDLLgnu_get_libc_versionAttributeErrorZc_char_pZrestype isinstancestrdecode)Zprocess_namespacer version_strr /usr/lib/python3.6/glibc.pyglibc_version_string s    r cCsHtjd|}|s$tjd|tdSt|jd|koFt|jd|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFmajorminor)rematchwarningswarnRuntimeWarningintgroup)r required_major minimum_minormr r r check_glibc_version$s  rcCst}|dkrdSt|||S)NF)r r)rrr r r r have_compatible_glibc4srcCst}|dkrdSd|fSdS)zTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. NZglibc)rr)r )Z glibc_versionr r r libc_verLsr) Z __future__rrrrr rrrr r r r s PK!(__pycache__/version.cpython-36.opt-1.pycnu[3 vh @s6ddlZyejdjZWnek r0dZYnXdS)NZ setuptoolsunknown)Z pkg_resourcesZget_distributionversion __version__ Exceptionrr/usr/lib/python3.6/version.pysPK!h~}}(__pycache__/package_index.cpython-36.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddlm"Z"ddl#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.ej/dZ0ej/dej1Z2ej/dZ3ej/dej1j4Z5dj6Z7ddddgZ8dZ9dZ:e:j;ejddZ?ddZ@dEd dZAdFd!d"ZBdGd#d$ZCdedfd%dZDdHd&d'ZEd(d)ZFej/d*ej1ZGeFd+d,ZHGd-d.d.eIZJGd/d0d0eJZKGd1ddeZLej/d2jMZNd3d4ZOd5d6ZPdId7d8ZQd9d:ZRGd;d<dd>ejTZUejVjWfd?d@ZXeQe9eXZXdAdBZYdCdDZZdS)Jz#PyPI and direct package downloadingN)wraps)six)urllib http_client configparsermap) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST) ssl_support)log)DistutilsError) translate)get_all_headers)unescape)Wheelz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+) \s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezsz(interpret_distro_name..r9Nr7) py_versionrHrV)r?anyrangerTr join)rPrUrMr^rHrVrAr\r&r&r'rs  $ccsnt}|j}|dkr>xTtjj|j|D]}|||Vq&Wn,x*|D]"}||}||krD|||VqDWdS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrZmoves filterfalse __contains__)iterablekeyseenZseen_addelementkr&r&r'unique_everseens  rkcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S)N)rk)argskwargs)funcr&r'wrapperszunique_values..wrapper)r)rnror&)rnr' unique_valuessrpz3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>ccsxvtj|D]h}|j\}}tttj|jjd}d|ksFd|kr x,t j|D]}t j j |t |jdVqRWq WxHdD]@}|j|}|d kr~t j||}|r~t j j |t |jdVq~WdS) zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager8r7 Home PageDownload URLN)rrrsr;)RELfinditergroupsrbrstrstripr0r?HREFrr#urljoin htmldecoderLfindsearch)r@pagerKtagZrelZrelsposr&r&r'find_external_linkss "   rc@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr&)selfblockr&r&r'feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr&)rr&r&r'is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr&)rreportertemplater&r&r'reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr&r&r&r'rsrc@sBeZdZejdZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_tj||_||_dS)N) hash_namehashlibnewhashexpected)rrrr&r&r'__init__s zHashChecker.__init__cCs>tjj|d}|stS|jj|}|s0tS|f|jS)z5Construct a (possibly null) ContentChecker from a URLr7r;)rr#r=rpatternr} groupdict)clsr@rFrKr&r&r'from_urls zHashChecker.from_urlcCs|jj|dS)N)rupdate)rrr&r&r'rszHashChecker.feedcCs|jj|jkS)N)rZ hexdigestr)rr&r&r'r!szHashChecker.is_validcCs||j}||S)N)r)rrrmsgr&r&r'r$s zHashChecker.reportN) rrrrZcompilerr classmethodrrrrr&r&r&r'rs rcs<eZdZdZdKddZdLd d ZdMd d ZdNd dZddZddZ ddZ ddZ dOddZ ddZ dPfdd ZddZdd Zd!d"Zd#d$Zd%d&ZdQd'd(ZdRd)d*Zd+d,Zd-Zd.d/Zd0d1ZdSd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&Z'S)Urz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOstj|f|||dd|jd |_i|_i|_i|_tjdj t t |j |_ g|_|ortjor|prtj}|rtj||_n tjj|_dS)Nr6|)r rr1 index_url scanned_urls fetched_urls package_pagesrZrrarrrKallowsto_scanrZ is_availableZfind_ca_bundleZ opener_foropenerrrequesturlopen)rrZhostsZ ca_bundleZ verify_sslrlkwZuse_sslr&r&r'r,s zPackageIndex.__init__Fc Cs||jkr| rdSd|j|<t|s4|j|dStt|}|r^|j|sRdS|jd||sr| sr||jkrtt|j |dS|j|sd|j|<dS|j d|d|j|<d}|j |||}|dkrdSd|j|j <d|j jddjkr|jdS|j }|j}t|tsRt|tjjr4d }n|j jd pDd }|j|d }|jx6tj|D](} tjj|t| jd } |j| qfW|j |j!rt"|d ddkr|j#||}dS)z.)filterrWrDrr itertoolsstarmap scan_egg_link)rZ search_pathdirsZ egg_linksr&r&r'scan_egg_linksszPackageIndex.scan_egg_linksc Csttjj||}ttdttj|}WdQRXt |dkrDdS|\}}x>t tjj||D](}tjj|f||_ t |_ |j|q`WdS)Nr9)openrWrDrarrrrwrxrTrrPr rHrc)rrDrZ raw_lineslinesZegg_pathZ setup_pathrNr&r&r'rs  zPackageIndex.scan_egg_linkc sfdd}xHtj|D]:}y |tjj|t|jdWqtk rPYqXqW||\}}|rxXt||D]J}t |\}} |j dr| r|r|d||f7}n j |j |qrWt jdd|SdSd S) z#Process the contents of a PyPI pagecs|jjrtttjj|tjdjd}t|dkrd|dkrt |d}t |d}dj j |j i|<t|t|fSdS)Nr6r9r:r7rT)NN)r2rrrrr#r>rTr?rrr setdefaultr0r)rrApkgver)rr&r'scans "  z(PackageIndex.process_index..scanr7z.pyz #egg=%s-%scSsd|jdddS)Nz%sr7r!r9)rL)mr&r&r'sz,PackageIndex.process_index..rN)ryrurr#rzr{rLr$rrGr1need_version_infoscan_urlPYPI_MD5sub) rr@r~rrKrrnew_urlr4fragr&)rr'rs$       zPackageIndex.process_indexcCs|jd|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_all)rr@r&r&r'rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||jd|j|jdS)Nz6Scanning index of all packages (this may take a while))rrrrr)rrrlr&r&r'rs  zPackageIndex.scan_allcCs~|j|j|jd|jj|js:|j|j|jd|jj|jsR|j|x&t|jj|jfD]}|j|qhWdS)Nr6) rr unsafe_namerrrgrQnot_found_in_indexr)r requirementr@r&r&r' find_packagess zPackageIndex.find_packagescsR|j|j|x,||jD]}||kr.|S|jd||qWtt|j||S)Nz%s does not match %s)prescanrrgrsuperrobtain)rrZ installerrN) __class__r&r'rs zPackageIndex.obtaincCsL|j|jd||jsH|jtj|td|jjtj j |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrWunlinkrrr3rDrU)rcheckerrXtfpr&r&r' check_hashs  zPackageIndex.check_hashcCsTxN|D]F}|jdks4t| s4|jds4tt|r@|j|q|jj|qWdS)z;Add `urls` to the list that will be prescanned for searchesNzfile:)rrr2rrrappend)rZurlsr@r&r&r'add_find_links s      zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrr)rr&r&r'rszPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|jdS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rgrrrr)rrmethrr&r&r'r"s   zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR|j|jd||}t|\}}|jdrN|j|||}|Stj j |rb|St |}t |j ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r7z.pyrPN)rrr _download_urlrLrGr1 gen_setuprWrDrr(rfetch_distribution)rr%tmpdirrBfoundr4rFr&r&r'r8,s    zPackageIndex.downloadc sjd|id}d fdd }|rHjj|||}| r`|dk r`|||}|dkrjdk rzj||}|dkr| rj|||}|dkrˆjdrdpd|njd||j|jd SdS) a|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. zSearching for %sNcs|dkr }x||jD]t}|jtkrJ rJ|krjd|d|<q||ko`|jtkp` }|rj|j}||_tj j |jr|SqWdS)Nz&Skipping development or system egg: %sr7) rgrHrrr r8rPdownload_locationrWrDr)ZreqenvrNZtestloc) develop_okrskippedsourcerr&r'r|fs z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rP)N)rrrrrcloner) rrr force_scanrrZ local_indexrNr|r&)rrrrrr'rNs0       zPackageIndex.fetch_distributioncCs"|j||||}|dk r|jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)rrP)rrrrrrNr&r&r'fetchszPackageIndex.fetchc Cstj|}|r*ddt||jddDp,g}t|dkrtjj|}tjj||krtjj ||}ddl m }|||st j |||}ttjj |dd2} | jd|dj|djtjj|dfWdQRX|S|rtd ||fntd dS) NcSsg|]}|jr|qSr&)rR)r[dr&r&r' sz*PackageIndex.gen_setup..r7r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rJrKrrLrTrWrDrUdirnameraZsetuptools.command.easy_installrshutilZcopy2rwriterQrRsplitextr) rrXrFrrKrrUdstrrr&r&r'rs2       zPackageIndex.gen_setupi c Cs|jd|d}ztj|}|j|}t|tjjrJtd||j |j f|j}d}|j }d}d|krt |d} t tt| }|j|||||t|dZ} xD|j|} | r|j| | j| |d7}|j|||||qPqW|j||| WdQRX|S|r|jXdS) NzDownloading %szCan't download %s: %s %srr7zcontent-lengthzContent-Lengthwbr;)rrrrrrrrrrr dl_blocksizermaxrint reporthookrrrr rr) rr@rXfprrblocknumZbssizeZsizesrrr&r&r' _download_tos:        zPackageIndex._download_tocCsdS)Nr&)rr@rXrZblksizerr&r&r'rszPackageIndex.reporthookcCs|jdrt|Sy t||jSttjfk r}z>djdd|jD}|r^|j ||nt d||fWYdd}~Xnt j j k r}z|Sd}~Xnt j jk r}z,|r|j ||jnt d||jfWYdd}~Xntjk r8}z.|r|j ||jnt d||jfWYdd}~XnPtjtj fk r}z*|rf|j ||nt d||fWYdd}~XnXdS)Nzfile: cSsg|] }t|qSr&)rw)r[argr&r&r'rsz)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r2 local_openopen_with_authrr$r InvalidURLrarlrrrrrZURLErrorreasonZ BadStatusLinelineZ HTTPExceptionsocket)rr@Zwarningvrr&r&r'rs6  "zPackageIndex.open_urlcCst|\}}|r4x&d|kr0|jddjdd}qWnd}|jdrN|dd}tjj||}|jt|sztdj |d |d ks|jd r|j ||S|d ks|jd r|j ||S|jdr|j ||S|dkrt jjt jj|dS|j|d|j||SdS)Nz...\_Z__downloaded__z.egg.zipr,zInvalid filename {filename})rXsvnzsvn+gitzgit+zhg+rr9Tr/)rGreplacer1rWrDrar2rwr$format _download_svn _download_git _download_hgrr url2pathnamer#r=r_attempt_download)rrBr@rr3rFrXr&r&r'rs(         zPackageIndex._download_urlcCs|j|ddS)NT)r)rr@r&r&r'r=szPackageIndex.scan_urlcCs6|j||}d|jddjkr.|j|||S|SdS)Nrz content-typer)rrr0_download_html)rr@rXrr&r&r'r)@s zPackageIndex._attempt_downloadcCslt|}x@|D]8}|jrtjd|rD|jtj||j||SPqW|jtj|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rx���rZ���r}���r���rW���r���r%��r���)r���r@���r���rX���r���r��r&���r&���r'���r*��G��s����     zPackageIndex._download_htmlc�������������C���s��|j�ddd�}g�}|j�jdrd|krtjj|\}}}}}} | �r|jdrd|dd��kr|dd��j�dd\}}tjj|\} } | rd | kr| j�d d\} } d | �d | �g}n d | �g}| }|||||| f}tjj|}|�jd ||�t j d dg|�d||g��|S�)Nr:���r7���r���zsvn:@z//r6���r9���:z --username=z --password=z'Doing subversion checkout from %s to %sr!��checkoutz-q) r?���r0���r2���r���r#���r=��� splituser urlunparser��� subprocess check_call)r���r@���rX���ZcredsrB���netlocrD���r\���qr���authhostuserZpwrA���r&���r&���r'���r%��V��s$����   zPackageIndex._download_svnc�������������C���sp���t�jj|�\}}}}}|jddd�}|jddd�}d�}d|krR|jdd\}}t�jj||||df}�|�|fS�)N+r7���r:���r���r+��r���r;���)r���r#���Zurlsplitr?���rsplitZ urlunsplit)r@��� pop_prefixrB���r2��rD���rE���r���revr&���r&���r'���_vcs_split_rev_from_urlk��s����z$PackageIndex._vcs_split_rev_from_urlc�������������C���sr���|j�ddd�}|�j|dd\}}|�jd||�tjddd ||g�|d�k rn|�jd |�tjdd |d d |g�|S�) Nr:���r7���r���T)r9��zDoing git clone from %s to %sr"��r���z--quietzChecking out %sz-Cr-��)r?���r;��r���r0��r1��)r���r@���rX���r:��r&���r&���r'���r&��}��s���� zPackageIndex._download_gitc���������� ���C���sv���|j�ddd�}|�j|dd\}}|�jd||�tjddd ||g�|d�k rr|�jd |�tjdd |d d d|dg�|S�)Nr:���r7���r���T)r9��zDoing hg clone from %s to %sZhgr���z--quietzUpdating to %sz--cwdZupz-Cz-rz-q)r?���r;��r���r0��r1��)r���r@���rX���r:��r&���r&���r'���r'����s���� zPackageIndex._download_hgc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.debugc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.infoc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.warnr���)r���r<��NT)F)F)F)N)N)FFFN)FF)N)F)(r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r8���r���r��r���r ��r��r��r���r���r���r)��r*��r%�� staticmethodr;��r&��r'��r���r���r��� __classcell__r&���r&���)r���r'���r���)��sL����  3   +   #� J )$ #!   z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�������������C���s���|�j�d}t|S�)Nr7���)rL���r���)rK���Zwhatr&���r&���r'��� decode_entity��s���� r?��c�������������C���s ���t�t|�S�)z'Decode HTML entities in the given text.) entity_subr?��)textr&���r&���r'���r{�����s����r{���c����������������s����fdd}|S�)Nc����������������s����fdd}|S�)Nc����������� ������s.���t�j�}t�j�z �|�|S�t�j|�X�d�S�)N)r��ZgetdefaulttimeoutZsetdefaulttimeout)rl���rm���Z old_timeout)rn���timeoutr&���r'���_socket_timeout��s ����  z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr&���)rn���rC��)rB��)rn���r'���rC����s����z'socket_timeout.<locals>._socket_timeoutr&���)rB��rC��r&���)rB��r'���socket_timeout��s���� rD��c�������������C���s2���t�jj|�}|j�}tj|}|j�}|jddS�)aq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r���r#���r>���encodebase64Z encodestringr���r#��)r4��Zauth_sZ auth_bytesZ encoded_bytesZencodedr&���r&���r'��� _encode_auth��s ����  rH��c���������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�������������C���s���||�_�||�_d�S�)N)usernamepassword)r���rJ��rK��r&���r&���r'���r�����s����zCredential.__init__c�������������c���s���|�j�V��|�jV��d�S�)N)rJ��rK��)r���r&���r&���r'���__iter__��s����zCredential.__iter__c�������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)vars)r���r&���r&���r'���__str__��s����zCredential.__str__N)r���r���r���r���r���rL��rN��r&���r&���r&���r'���rI����s���rI��c���������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�������������C���sP���t�jdddgd}tjj|�|�tjjtjjdd}tjj |rL|�j |�dS�)z% Load from ~/.pypirc rJ��rK�� repositoryr���~z.pypircN) dictfromkeysr���RawConfigParserr���rW���rD���ra��� expanduserr���r���)r���ZdefaultsZrcr&���r&���r'���r�����s ���� zPyPIConfig.__init__c����������������s&����fdd�j��D�}tt�j|S�)Nc����������������s ���g�|�]}�j�|d�j�r|qS�)rP��)r���rx���)r[���section)r���r&���r'���r����s����z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrR��r���_get_repo_cred)r���Zsections_with_repositoriesr&���)r���r'���creds_by_repository��s����zPyPIConfig.creds_by_repositoryc�������������C���s6���|�j�|dj�}|t|�j�|dj�|�j�|dj�fS�)NrP��rJ��rK��)r���rx���rI��)r���rV��Zrepor&���r&���r'���rW����s����zPyPIConfig._get_repo_credc�������������C���s*���x$|�j�j�D�]\}}|j|r |S�q W�dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)rX��itemsr2���)r���r@���rP��credr&���r&���r'���find_credential��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyrX��rW��r[��r&���r&���r&���r'���rO����s��� rO��c�������������C���s:��t�jj|�\}}}}}}|jdr,tjd|d krFt�jj|\}} nd}|s~t�j|�} | r~t | }| j |�f} t j d | ��|rdt |�}|| ||||f} t�jj| } t�jj| }|jd|�n t�jj|�}|jd t�||}|r6t�jj|j\}}}}}}||kr6|| kr6||||||f} t�jj| |_|S�) z4Open a urllib2 request, handling HTTP authenticationr,��znonnumeric port: ''httphttpsN*Authenticating as %s for %s (from .pypirc)zBasic Z Authorizationz User-Agent)r]��r^��)r_��)r���r#���r=���r1���r���r��r.��rO��r[��rw���rJ��r���r���rH��r/��r���ZRequestZ add_header user_agentr@���)r@���r���rB���r2��rD���ZparamsrE���r���r4��r5��rZ��r���rA���r���r���r��s2Zh2Zpath2Zparam2Zquery2Zfrag2r&���r&���r'���r�� ��s6����         r��c�������������C���s���|�S�)Nr&���)r@���r&���r&���r'��� fix_sf_url>��s����rb��c���������� ���C���s��t�jj|�\}}}}}}t�jj|}tjj|r<t�jj|�S�|j drtjj |rg�}xtj |D�]b} tjj || } | dkrt | d} | j�} W�dQ�R�X�P�ntjj | r| d7�} |jdj| d�qbW�d} | j|�dj |d } d\}}n d\}}} ddi}tj| }t�jj|�||||S�)z7Read a local path, with special support for directoriesr6���z index.htmlrNz<a href="{name}">{name}</a>)r3���zB<html><head><title>{url}{files}rE)r@filesOKPath not found Not foundz content-typez text/html)rerf)rgrhri)rr#r=rr(rWrDisfilerr1rrrarrrr$rStringIOrr)r@rBrCrDZparamrErrXrdrfilepathrZbodyrZstatusmessagerZ body_streamr&r&r'rBs,        r)N)N)N)N)r )[rr0sysrWrZrrrGrr functoolsrZsetuptools.externrZsetuptools.extern.six.movesrrrrr"Z pkg_resourcesrr r r r r rrrrrrrrZ distutilsrZdistutils.errorsrZfnmatchrZsetuptools.py27compatrZsetuptools.py33compatrZsetuptools.wheelrrrJIryrrKrr?rS__all__Z_SOCKET_TIMEOUTZ_tmplr$rRr`r(rrGrrIrYrrkrprtrobjectrrrrr@r?r{rDrHrIrTrOrrrrbrr&r&r&r's|  <           !  "   !~  &. PK!θ:f66%__pycache__/py33compat.cpython-36.pycnu[3 vh @sddlZddlZddlZy ddlZWnek r<dZYnXddlmZddlmZej ddZ Gddde Z e ede Ze ed ejjZdS) N)six) html_parserOpArgz opcode argc@seZdZddZddZdS)Bytecode_compatcCs ||_dS)N)code)selfrr /usr/lib/python3.6/py33compat.py__init__szBytecode_compat.__init__ccstjd|jj}t|jj}d}d}x||kr||}|tjkr||d||dd|}|d7}|tjkrtjd }||d}q&n d}|d7}t ||Vq&WdS) z>Yield '(op,arg)' pair for each operation in code object 'code'briN) arrayrco_codelendisZ HAVE_ARGUMENTZ EXTENDED_ARGrZ integer_typesr)rbyteseofZptrZ extended_argopargZ long_typerrr __iter__s        zBytecode_compat.__iter__N)__name__ __module__ __qualname__r rrrrr rsrBytecodeunescape)rr collectionsZhtml ImportErrorZsetuptools.externrZsetuptools.extern.six.movesr namedtuplerobjectrgetattrrZ HTMLParserrrrrr s     " PK!f::'__pycache__/config.cpython-36.opt-1.pycnu[3 vhVF@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZddlmZdd d Zd d ZdddZGdddeZGdddeZGdddeZdS))absolute_importunicode_literalsN) defaultdict)partial) import_module)DistutilsOptionErrorDistutilsFileError) LegacyVersionparse) string_typesFc Csddlm}m}tjj|}tjj|s4td|tj}tj tjj |zJ|}|rb|j ng}||krx|j ||j ||dt||j|d}Wdtj |Xt|S)a,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict r) Distribution _Distributionz%Configuration file %s does not exist.) filenames)ignore_option_errorsN)Zsetuptools.distr r ospathabspathisfilergetcwdchdirdirnameZfind_config_filesappendZparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersrr r Zcurrent_directoryZdistrhandlersr/usr/lib/python3.6/config.pyread_configurations$      rcCsltt}x^|D]V}|j}|j}xD|jD]:}t|d|d}|dkrNt||}n|}||||<q&WqW|S)zReturns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict zget_%sN)rdictsection_prefix target_obj set_optionsgetattr)rZ config_dictZhandlerZ obj_aliasr"Zoptiongettervaluerrrr=s   rcCs6t|||}|jt|j|||j}|j||fS)aPerforms additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list )ConfigOptionsHandlerr ConfigMetadataHandlermetadata package_dir)Z distributionrroptionsmetarrrrZs rc@seZdZdZdZiZd!ddZeddZdd Z e d"d d Z e d dZ e ddZ e ddZeddZeddZe d#ddZe ddZe d$ddZddZdd ZdS)% ConfigHandlerz1Handles metadata supplied in configuration files.NFcCsbi}|j}x:|jD].\}}|j|s(q|j|djd}|||<qW||_||_||_g|_dS)N.) r!items startswithreplacestriprr"sectionsr#)selfr"r+rr4r! section_namesection_optionsrrr__init__s  zConfigHandler.__init__cCstd|jjdS)z.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError __class____name__)r5rrrparsersszConfigHandler.parsersc Cst}|j}|jj||}t|||}||kr6t||r>dSd}|jj|}|ry ||}Wn tk r~d}|jszYnX|rdSt|d|d}|dkrt |||n|||j j |dS)NFTzset_%s) tupler"aliasesgetr$KeyErrorr< Exceptionrsetattrr#r) r5Z option_namer&unknownr"Z current_valueZ skip_optionparsersetterrrr __setitem__s0   zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |j}n |j|}dd|DS)zRepresents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list  cSsg|]}|jr|jqSr)r3).0chunkrrr sz-ConfigHandler._parse_list..) isinstancelist splitlinessplit)clsr& separatorrrr _parse_lists   zConfigHandler._parse_listcCsTd}i}xF|j|D]8}|j|\}}}||krsz,ConfigHandler._parse_file..rGrHc3s2|]*}j|sdrtjj|rj|VqdS)TN) _assert_localrrr _read_file)rIr)rPrrr` s)rLr r1lenrOjoin)rPr&Zinclude_directivespecZ filepathsr)rPr _parse_files   zConfigHandler._parse_filecCs|jtjstd|dS)Nz#`file:` directive can not access %s)r1rrr)rrrrraszConfigHandler._assert_localc Cs"tj|dd }|jSQRXdS)Nzutf-8)encoding)ioopenread)rfrrrrbszConfigHandler._read_filec Csd}|j|s|S|j|djjd}|j}dj|}|p@d}tj}|r|d|kr||d}|jdd} t | dkrtj jtj| d}| d}q|}nd|krtj jtj|d}t j j d|zt |} t| |}Wdt j ddt _ X|S) zRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str zattr:r.r/r8r/N)r1r2r3rOpoprdrrrsplitrcrsysinsertrr$) rPr&r*Zattr_directiveZ attrs_pathZ attr_nameZ module_name parent_pathZ custom_pathpartsmodulerrr _parse_attrs0        zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable cs|}xD] }||}q W|S)Nr)r&parsedmethod) parse_methodsrrr Qs  z1ConfigHandler._get_parser_compound..parser)rPrxr r)rxr_get_parser_compoundHs z"ConfigHandler._get_parser_compoundcCs:i}|pdd}x$|jD]\}\}}||||<qW|S)zParses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict cSs|S)Nr)rYrrrfsz6ConfigHandler._parse_section_to_dict..)r0)rPr7Z values_parserr&rW_rYrrr_parse_section_to_dict[s  z$ConfigHandler._parse_section_to_dictc Cs@x:|jD].\}\}}y |||<Wq tk r6Yq Xq WdS)zQParses configuration file section. :param dict section_options: N)r0r@)r5r7namer{r&rrr parse_sectionks  zConfigHandler.parse_sectioncCsfx`|jjD]R\}}d}|r$d|}t|d|jddd}|dkrVtd|j|f||q WdS)zTParses configuration file items from one or more related sections. r.z_%szparse_section%sr/__Nz0Unsupported distribution option section: [%s.%s])r4r0r$r2rr!)r5r6r7Zmethod_postfixZsection_parser_methodrrrr wszConfigHandler.parse)F)rG)N)N)r; __module__ __qualname____doc__r!r>r8propertyr<rF classmethodrRrZr_rf staticmethodrarbruryr|r~r rrrrr-ts(  &     ,   r-csHeZdZdZdddddZdZdfd d Zed d Zd dZ Z S)r(r)Zurl description classifiers platforms)Z home_pageZsummaryZ classifierplatformFNcstt|j|||||_dS)N)superr(r8r*)r5r"r+rr*)r:rrr8szConfigMetadataHandler.__init__c Cs8|j}|j}|j}||||||j||||||j|d S)z.Metadata item name to parser function mapping.) rkeywordsZprovidesZrequiresZ obsoletesrlicenserZlong_descriptionversionZ project_urls)rRrfrZry_parse_version)r5 parse_listZ parse_file parse_dictrrrr<s zConfigMetadataHandler.parserscCs|j|}||kr<|j}tt|tr8td||f|S|j||j}t|rX|}t|t st |dr~dj t t |}nd|}|S)zSParses `version` option value. :param value: :rtype: str z7Version loaded from %s does not comply with PEP 440: %s__iter__r/z%s)rfr3rLr r rrur*callabler hasattrrdmapstr)r5r&rrrrrs    z$ConfigMetadataHandler._parse_version)FN) r;rrr!r>Z strict_moder8rr<r __classcell__rr)r:rr(s r(c@sTeZdZdZeddZddZddZdd Zd d Z d d Z ddZ ddZ dS)r'r+cCsL|j}t|jdd}|j}|j}|||||||||||||||j|j|dS)z.Metadata item name to parser function mapping.;)rQ)Zzip_safeZuse_2to3Zinclude_package_datar*Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requireZpackages entry_pointsZ py_modules)rRrr_rZ_parse_packagesrf)r5rZparse_list_semicolonZ parse_boolrrrrr<s*zConfigOptionsHandler.parserscCsBd}|j|s|j|S|j|jjdi}ddlm}|f|S)zTParses `packages` option value. :param value: :rtype: list zfind:z packages.findr) find_packages)r1rRparse_section_packages__findr4r?Z setuptoolsr)r5r&Zfind_directive find_kwargsrrrrrs   z$ConfigOptionsHandler._parse_packagescsT|j||j}dddgtfdd|jD}|jd}|dk rP|d|d<|S)zParses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: whereincludeexcludecs$g|]\}}|kr|r||fqSrr)rIkv) valid_keysrrrKszEConfigOptionsHandler.parse_section_packages__find..Nr)r|rRr r0r?)r5r7Z section_datarrr)rrrs    z1ConfigOptionsHandler.parse_section_packages__findcCs|j||j}||d<dS)z`Parses `entry_points` configuration file section. :param dict section_options: rN)r|rR)r5r7rvrrrparse_section_entry_points%sz/ConfigOptionsHandler.parse_section_entry_pointscCs.|j||j}|jd}|r*||d<|d=|S)N*r.)r|rRr?)r5r7rvrootrrr_parse_package_data-s  z(ConfigOptionsHandler._parse_package_datacCs|j||d<dS)z`Parses `package_data` configuration file section. :param dict section_options: Z package_dataN)r)r5r7rrrparse_section_package_data7sz/ConfigOptionsHandler.parse_section_package_datacCs|j||d<dS)zhParses `exclude_package_data` configuration file section. :param dict section_options: Zexclude_package_dataN)r)r5r7rrr"parse_section_exclude_package_data>sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}|j|||d<dS)zbParses `extras_require` configuration file section. :param dict section_options: r)rQZextras_requireN)rrRr|)r5r7rrrrparse_section_extras_requireFsz1ConfigOptionsHandler.parse_section_extras_requireN) r;rrr!rr<rrrrrrrrrrrr's  r')FF)F)Z __future__rrrhrrp collectionsr functoolsr importlibrZdistutils.errorsrrZ#setuptools.extern.packaging.versionr r Zsetuptools.extern.sixr rrrobjectr-r(r'rrrrs"     . MPK!f::!__pycache__/config.cpython-36.pycnu[3 vhVF@sddlmZmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZddlmZmZddlmZdd d Zd d ZdddZGdddeZGdddeZGdddeZdS))absolute_importunicode_literalsN) defaultdict)partial) import_module)DistutilsOptionErrorDistutilsFileError) LegacyVersionparse) string_typesFc Csddlm}m}tjj|}tjj|s4td|tj}tj tjj |zJ|}|rb|j ng}||krx|j ||j ||dt||j|d}Wdtj |Xt|S)a,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict r) Distribution _Distributionz%Configuration file %s does not exist.) filenames)ignore_option_errorsN)Zsetuptools.distr r ospathabspathisfilergetcwdchdirdirnameZfind_config_filesappendZparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersrr r Zcurrent_directoryZdistrhandlersr/usr/lib/python3.6/config.pyread_configurations$      rcCsltt}x^|D]V}|j}|j}xD|jD]:}t|d|d}|dkrNt||}n|}||||<q&WqW|S)zReturns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict zget_%sN)rdictsection_prefix target_obj set_optionsgetattr)rZ config_dictZhandlerZ obj_aliasr"Zoptiongettervaluerrrr=s   rcCs6t|||}|jt|j|||j}|j||fS)aPerforms additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list )ConfigOptionsHandlerr ConfigMetadataHandlermetadata package_dir)Z distributionrroptionsmetarrrrZs rc@seZdZdZdZiZd!ddZeddZdd Z e d"d d Z e d dZ e ddZ e ddZeddZeddZe d#ddZe ddZe d$ddZddZdd ZdS)% ConfigHandlerz1Handles metadata supplied in configuration files.NFcCsbi}|j}x:|jD].\}}|j|s(q|j|djd}|||<qW||_||_||_g|_dS)N.) r!items startswithreplacestriprr"sectionsr#)selfr"r+rr4r! section_namesection_optionsrrr__init__s  zConfigHandler.__init__cCstd|jjdS)z.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError __class____name__)r5rrrparsersszConfigHandler.parsersc Cst}|j}|jj||}t|||}||kr6t||r>dSd}|jj|}|ry ||}Wn tk r~d}|jszYnX|rdSt|d|d}|dkrt |||n|||j j |dS)NFTzset_%s) tupler"aliasesgetr$KeyErrorr< Exceptionrsetattrr#r) r5Z option_namer&unknownr"Z current_valueZ skip_optionparsersetterrrr __setitem__s0   zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |j}n |j|}dd|DS)zRepresents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list  cSsg|]}|jr|jqSr)r3).0chunkrrr sz-ConfigHandler._parse_list..) isinstancelist splitlinessplit)clsr& separatorrrr _parse_lists   zConfigHandler._parse_listcCsTd}i}xF|j|D]8}|j|\}}}||krsz,ConfigHandler._parse_file..rGrHc3s2|]*}j|sdrtjj|rj|VqdS)TN) _assert_localrrr _read_file)rIr)rPrrr` s)rLr r1lenrOjoin)rPr&Zinclude_directivespecZ filepathsr)rPr _parse_files   zConfigHandler._parse_filecCs|jtjstd|dS)Nz#`file:` directive can not access %s)r1rrr)rrrrraszConfigHandler._assert_localc Cs"tj|dd }|jSQRXdS)Nzutf-8)encoding)ioopenread)rfrrrrbszConfigHandler._read_filec Csd}|j|s|S|j|djjd}|j}dj|}|p@d}tj}|r|d|kr||d}|jdd} t | dkrtj jtj| d}| d}q|}nd|krtj jtj|d}t j j d|zt |} t| |}Wdt j ddt _ X|S) zRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str zattr:r.r/r8r/N)r1r2r3rOpoprdrrrsplitrcrsysinsertrr$) rPr&r*Zattr_directiveZ attrs_pathZ attr_nameZ module_name parent_pathZ custom_pathpartsmodulerrr _parse_attrs0        zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable cs|}xD] }||}q W|S)Nr)r&parsedmethod) parse_methodsrrr Qs  z1ConfigHandler._get_parser_compound..parser)rPrxr r)rxr_get_parser_compoundHs z"ConfigHandler._get_parser_compoundcCs:i}|pdd}x$|jD]\}\}}||||<qW|S)zParses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict cSs|S)Nr)rYrrrfsz6ConfigHandler._parse_section_to_dict..)r0)rPr7Z values_parserr&rW_rYrrr_parse_section_to_dict[s  z$ConfigHandler._parse_section_to_dictc Cs@x:|jD].\}\}}y |||<Wq tk r6Yq Xq WdS)zQParses configuration file section. :param dict section_options: N)r0r@)r5r7namer{r&rrr parse_sectionks  zConfigHandler.parse_sectioncCsfx`|jjD]R\}}d}|r$d|}t|d|jddd}|dkrVtd|j|f||q WdS)zTParses configuration file items from one or more related sections. r.z_%szparse_section%sr/__Nz0Unsupported distribution option section: [%s.%s])r4r0r$r2rr!)r5r6r7Zmethod_postfixZsection_parser_methodrrrr wszConfigHandler.parse)F)rG)N)N)r; __module__ __qualname____doc__r!r>r8propertyr<rF classmethodrRrZr_rf staticmethodrarbruryr|r~r rrrrr-ts(  &     ,   r-csHeZdZdZdddddZdZdfd d Zed d Zd dZ Z S)r(r)Zurl description classifiers platforms)Z home_pageZsummaryZ classifierplatformFNcstt|j|||||_dS)N)superr(r8r*)r5r"r+rr*)r:rrr8szConfigMetadataHandler.__init__c Cs8|j}|j}|j}||||||j||||||j|d S)z.Metadata item name to parser function mapping.) rkeywordsZprovidesZrequiresZ obsoletesrlicenserZlong_descriptionversionZ project_urls)rRrfrZry_parse_version)r5 parse_listZ parse_file parse_dictrrrr<s zConfigMetadataHandler.parserscCs|j|}||kr<|j}tt|tr8td||f|S|j||j}t|rX|}t|t st |dr~dj t t |}nd|}|S)zSParses `version` option value. :param value: :rtype: str z7Version loaded from %s does not comply with PEP 440: %s__iter__r/z%s)rfr3rLr r rrur*callabler hasattrrdmapstr)r5r&rrrrrs    z$ConfigMetadataHandler._parse_version)FN) r;rrr!r>Z strict_moder8rr<r __classcell__rr)r:rr(s r(c@sTeZdZdZeddZddZddZdd Zd d Z d d Z ddZ ddZ dS)r'r+cCsL|j}t|jdd}|j}|j}|||||||||||||||j|j|dS)z.Metadata item name to parser function mapping.;)rQ)Zzip_safeZuse_2to3Zinclude_package_datar*Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requireZpackages entry_pointsZ py_modules)rRrr_rZ_parse_packagesrf)r5rZparse_list_semicolonZ parse_boolrrrrr<s*zConfigOptionsHandler.parserscCsBd}|j|s|j|S|j|jjdi}ddlm}|f|S)zTParses `packages` option value. :param value: :rtype: list zfind:z packages.findr) find_packages)r1rRparse_section_packages__findr4r?Z setuptoolsr)r5r&Zfind_directive find_kwargsrrrrrs   z$ConfigOptionsHandler._parse_packagescsT|j||j}dddgtfdd|jD}|jd}|dk rP|d|d<|S)zParses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: whereincludeexcludecs$g|]\}}|kr|r||fqSrr)rIkv) valid_keysrrrKszEConfigOptionsHandler.parse_section_packages__find..Nr)r|rRr r0r?)r5r7Z section_datarrr)rrrs    z1ConfigOptionsHandler.parse_section_packages__findcCs|j||j}||d<dS)z`Parses `entry_points` configuration file section. :param dict section_options: rN)r|rR)r5r7rvrrrparse_section_entry_points%sz/ConfigOptionsHandler.parse_section_entry_pointscCs.|j||j}|jd}|r*||d<|d=|S)N*r.)r|rRr?)r5r7rvrootrrr_parse_package_data-s  z(ConfigOptionsHandler._parse_package_datacCs|j||d<dS)z`Parses `package_data` configuration file section. :param dict section_options: Z package_dataN)r)r5r7rrrparse_section_package_data7sz/ConfigOptionsHandler.parse_section_package_datacCs|j||d<dS)zhParses `exclude_package_data` configuration file section. :param dict section_options: Zexclude_package_dataN)r)r5r7rrr"parse_section_exclude_package_data>sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}|j|||d<dS)zbParses `extras_require` configuration file section. :param dict section_options: r)rQZextras_requireN)rrRr|)r5r7rrrrparse_section_extras_requireFsz1ConfigOptionsHandler.parse_section_extras_requireN) r;rrr!rr<rrrrrrrrrrrr's  r')FF)F)Z __future__rrrhrrp collectionsr functoolsr importlibrZdistutils.errorsrrZ#setuptools.extern.packaging.versionr r Zsetuptools.extern.sixr rrrobjectr-r(r'rrrrs"     . MPK!Ȩ¼\\"__pycache__/depends.cpython-36.pycnu[3 vh@sddlZddlZddlZddlmZddlmZmZmZmZddl m Z dddd gZ Gd ddZ dd dZ dd dZdd d ZddZedS)N) StrictVersion) PKG_DIRECTORY PY_COMPILED PY_SOURCE PY_FROZEN)BytecodeRequire find_moduleget_module_constantextract_constantc@sHeZdZdZdddZddZdd Zdd d 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 rclose ImportErrorr r)rpathsdefaultfpivrrr get_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|t j krtj ||||||ftt j ||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_objectrcompilesysmodules load_modulegetattrr r ) rsymbolr#r"r$r5r6r7r8coderrrr es$     c Cs||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 r r rWrrrrs   C  " $PK!%__pycache__/build_meta.cpython-36.pycnu[3 vh'@sdZddlZddlZddlZddlZddlZddlZddlZGdddeZ Gdddej j Z ddd Z d d Z d d ZddZdddZdddZdddZdddZdddZdS) a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. Nc@seZdZddZdS)SetupRequirementsErrorcCs ||_dS)N) specifiers)selfrr /usr/lib/python3.6/build_meta.py__init__(szSetupRequirementsError.__init__N)__name__ __module__ __qualname__rrrrrr'src@s&eZdZddZeejddZdS) DistributioncCs t|dS)N)r)rrrrrfetch_build_eggs-szDistribution.fetch_build_eggsc cs*tjj}|tj_z dVWd|tj_XdS)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilsZcorer )clsZorigrrrpatch0s  zDistribution.patchN)rr r r classmethod contextlibcontextmanagerrrrrrr ,sr setup.pycCsH|}d}ttdt|}|jjdd}|jtt||dtdS)N__main__openz\r\nz\nexec) getattrtokenizerreadreplaceclosercompilelocals)Z setup_script__file__rfcoderrr _run_setup@s r!cCs|pi}|jdg|S)Nz--global-option) setdefault)config_settingsrrr _fix_configKs r$cCs~t|}ddg}tjdddg|dt_ytj tWdQRXWn,tk rx}z||j7}WYdd}~XnX|S)N setuptoolsZwheelZegg_infoz--global-option)r$sysargvr rr!rr)r#Z requirementserrr_get_build_requiresQs  r*csfddtjDS)Ncs&g|]}tjjtjj|r|qSr)ospathisdirjoin).0name)a_dirrr asz1_get_immediate_subdirectories..)r+listdir)r1r)r1r_get_immediate_subdirectories`sr4cCst|}t|S)N)r$r*)r#rrrget_requires_for_build_wheelesr5cCst|}t|S)N)r$r*)r#rrrget_requires_for_build_sdistjsr6cCstjdddd|gt_t|}x`ddtj|D}t|dkrptt|dkrptjj|tj|d}q&t|dkst Pq&W||krt j tjj||d|t j |dd|dS) Nr&Z dist_infoz --egg-basecSsg|]}|jdr|qS)z .dist-info)endswith)r/rrrrr2usz4prepare_metadata_for_build_wheel..rT) ignore_errors) r'r(r!r+r3lenr4r,r.AssertionErrorshutilZmovermtree)metadata_directoryr#Zdist_info_directoryZ dist_infosrrr prepare_metadata_for_build_wheelos$ r>cCst|}tjj|}tjdddg|dt_t|dkrVtj|tj d|ddtj |D}t |dkszt |dS)Nr&Z bdist_wheelz--global-optiondistcSsg|]}|jdr|qS)z.whl)r7)r/rrrrr2szbuild_wheel..r) r$r+r,abspathr'r(r!r;r<copytreer3r9r:)Zwheel_directoryr#r=Zwheelsrrr build_wheels    rBcCst|}tjj|}tjdddg|dt_t|dkrVtj|tj d|ddtj |D}t |dkszt |dS)Nr&Zsdistz--global-optionr?cSsg|]}|jdr|qS)z.tar.gz)r7)r/rrrrr2szbuild_sdist..r) r$r+r,r@r'r(r!r;r<rAr3r9r:)Zsdist_directoryr#Zsdistsrrr build_sdists    rC)r)N)N)N)NN)N)__doc__r+r'rr;rr%r BaseExceptionrr?r r!r$r*r4r5r6r>rBrCrrrrs&     PK!Ȩ¼\\(__pycache__/depends.cpython-36.opt-1.pycnu[3 vh@sddlZddlZddlZddlmZddlmZmZmZmZddl m Z dddd gZ Gd ddZ dd dZ dd dZdd d ZddZedS)N) StrictVersion) PKG_DIRECTORY PY_COMPILED PY_SOURCE PY_FROZEN)BytecodeRequire find_moduleget_module_constantextract_constantc@sHeZdZdZdddZddZdd Zdd d 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 rclose ImportErrorr r)rpathsdefaultfpivrrr get_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|t j krtj ||||||ftt j ||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_objectrcompilesysmodules load_modulegetattrr r ) rsymbolr#r"r$r5r6r7r8coderrrr es$     c Cs||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 r r rWrrrrs   C  " $PK!!__pycache__/monkey.cpython-36.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ ddZddZd d Zd d Zd dZddZddZddZdS)z Monkey patching of distutils. N) import_module)sixcCs"tjdkr|f|jStj|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. ZJython)platformZpython_implementation __bases__inspectZgetmro)clsr/usr/lib/python3.6/monkey.py_get_mros  r cCs0t|tjrtnt|tjr tndd}||S)NcSsdS)Nr)itemrrr *szget_unpatched..) isinstancerZ class_typesget_unpatched_classtypes FunctionTypeget_unpatched_function)r lookuprrr get_unpatched&srcCs:ddt|D}t|}|jjds6d|}t||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css|]}|jjds|VqdS) setuptoolsN) __module__ startswith).0rrrr 6sz&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextrrAssertionError)rZexternal_basesbasemsgrrr r/s  rcCstjtj_tjd k}|r"tjtj_tjd kpxd tjko@dknpxdtjkoZdknpxdtjkotdkn}|rd }|tjj _ t x"tj tjtj fD]}tj j|_qWtjjtj_tjjtj_d tjkrtjjtjd _tdS)N rzhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rrr)r r!r")rr)rrr!)rr#)rr#r$)rr)rrr)rZCommandrZcoresys version_infofindallZfilelistconfigZ PyPIRCCommandZDEFAULT_REPOSITORY+_patch_distribution_metadata_write_pkg_filedistcmdZ Distribution extensionZ Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehousemodulerrr patch_allAs&        r0cCstjjtjj_dS)zDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN)rr*Zwrite_pkg_filerZDistributionMetadatarrrr r)jsr)cCs*t||}t|jd|t|||dS)z Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. unpatchedN)getattrvars setdefaultsetattr)Z replacementZ target_mod func_nameoriginalrrr patch_funcqs r8cCs t|dS)Nr1)r2) candidaterrr rsrcstdtjdkrdSfdd}tj|d}tj|d}yt|dt|d Wntk rlYnXyt|d Wntk rYnXyt|d Wntk rYnXdS) z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcZWindowsNcsLd|kr dnd}||jd}t|}t|}t||sBt||||fS)zT Prepare the parameters for patch_func to patch indicated function. msvc9Zmsvc9_Zmsvc14__)lstripr2rhasattr ImportError)Zmod_namer6Z repl_prefixZ repl_namereplmod)msvcrr patch_paramss  z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ _get_vc_envZgen_lib_options)rrsystem functoolspartialr8r>)rBr:Zmsvc14r)rAr r.s&    r.)__doc__r%Zdistutils.filelistrrrrD importlibrrZsetuptools.externrr__all__r rrr0r)r8rr.rrrr s$   )PK!%__pycache__/py27compat.cpython-36.pycnu[3 vh@sTdZddlZddlmZddZejr.ddZejdko>ejZerHendd Z dS) z2 Compatibility Support for Python 2.7 and earlier N)sixcCs |j|S)zH Given an HTTPMessage, return all headers matching a given key. )Zget_all)messagekeyr /usr/lib/python3.6/py27compat.pyget_all_headers srcCs |j|S)N)Z getheaders)rrrrrrsZLinuxcCs|S)Nr)xrrrsr ) __doc__platformZsetuptools.externrrZPY2systemZlinux_py2_asciistrZ rmtree_saferrrrs  PK!ㄙ__pycache__/msvc.cpython-36.pycnu[3 vh @sdZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ej dkrpddl mZejZnGd d d ZeZeejjfZydd lmZWnek rYnXd d Zd ddZddZddZd!ddZGdddZGdddZGdddZGdddZ dS)"a@ Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) N) LegacyVersion) filterfalse) get_unpatchedWindows)winregc@seZdZdZdZdZdZdS)rN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/usr/lib/python3.6/msvc.pyr(sr)RegcCsd}|d|f}ytj|d}WnJtk rjy|d|f}tj|d}Wntk rdd}YnXYnX|rtjjjj|d}tjj|r|Stt|S)a+ Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ vcvarsall.bat path: str z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f installdirz Wow6432Node\Nz vcvarsall.bat) rZ get_valueKeyErrorospathjoinisfilermsvc9_find_vcvarsall)versionZVC_BASEkey productdir vcvarsallrrrr?s   rx86cOsytt}|||f||Stjjk r2Yntk rDYnXyt||jStjjk r}zt|||WYdd}~XnXdS)a Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ environment: dict N) rmsvc9_query_vcvarsall distutilserrorsDistutilsPlatformError ValueErrorEnvironmentInfo return_env_augment_exception)verarchargskwargsZorigexcrrrrjs rcCsny tt|Stjjk r$YnXyt|ddjStjjk rh}zt|dWYdd}~XnXdS)a' Patched "distutils._msvccompiler._get_vc_env" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 14.0: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Parameters ---------- plat_spec: str Target architecture. Return ------ environment: dict g,@) vc_min_verN)rmsvc14_get_vc_envr r!r"r$r%r&)Z plat_specr+rrrr-s  r-cOsBdtjkr4ddl}t|jtdkr4|jjj||Stt ||S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesZnumpyr __version__r Z ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r)r*Znprrrr1s  r1rcCs|jd}d|jks"d|jkrd}|jft}d}|dkrr|jjddkrh|d 7}||d 7}q|d 7}n.|d kr|d 7}||d7}n|dkr|d7}|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rrzvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rz* Get it with "Microsoft Windows SDK 7.0": iB z% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN)r)lowerformatlocalsfind)r+rr(messageZtmplZ msdownloadrrrr&s   r&c@sbeZdZdZejddjZddZe ddZ dd Z d d Z dd dZ dddZdddZdS) PlatformInfoz Current and Target Architectures informations. Parameters ---------- arch: str Target architecture. Zprocessor_architecturercCs|jjdd|_dS)Nx64amd64)r3replacer()selfr(rrr__init__szPlatformInfo.__init__cCs|j|jjdddS)N_r)r(r6)r<rrr target_cpuszPlatformInfo.target_cpucCs |jdkS)Nr)r?)r<rrr target_is_x86szPlatformInfo.target_is_x86cCs |jdkS)Nr) current_cpu)r<rrrcurrent_is_x86szPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ subfolder: str ' arget', or '' (see hidex86 parameter) rrr:z\x64z\%s)rA)r<hidex86r9rrr current_dir szPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ subfolder: str '\current', or '' (see hidex86 parameter) rrr:z\x64z\%s)r?)r<rCr9rrr target_dirszPlatformInfo.target_dircCs0|rdn|j}|j|krdS|jjdd|S)ao Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current acritecture is not x86. Return ------ subfolder: str '' if target architecture is current architecture, '\current_target' if not. rr\z\%s_)rAr?rEr;)r<forcex86Zcurrentrrr cross_dir5szPlatformInfo.cross_dirN)FF)FF)F)rr r __doc__safe_envgetr3rAr=propertyr?r@rBrDrErHrrrrr8s   r8c@seZdZdZejejejejfZ ddZ e ddZ e ddZ e dd Ze d d Ze d d Ze ddZe ddZe ddZe ddZdddZddZdS) RegistryInfoz Microsoft Visual Studio related registry informations. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dS)N)pi)r<Z platform_inforrrr=ZszRegistryInfo.__init__cCsdS)z< Microsoft Visual Studio root registry key. Z VisualStudior)r<rrr visualstudio]szRegistryInfo.visualstudiocCstjj|jdS)z; Microsoft Visual Studio SxS registry key. ZSxS)rrrrO)r<rrrsxsdszRegistryInfo.sxscCstjj|jdS)z8 Microsoft Visual C++ VC7 registry key. ZVC7)rrrrP)r<rrrvckszRegistryInfo.vccCstjj|jdS)z; Microsoft Visual Studio VS7 registry key. ZVS7)rrrrP)r<rrrvsrszRegistryInfo.vscCsdS)z? Microsoft Visual C++ for Python registry key. zDevDiv\VCForPythonr)r<rrr vc_for_pythonyszRegistryInfo.vc_for_pythoncCsdS)z- Microsoft SDK registry key. zMicrosoft SDKsr)r<rrr microsoft_sdkszRegistryInfo.microsoft_sdkcCstjj|jdS)z> Microsoft Windows/Platform SDK registry key. r)rrrrT)r<rrr windows_sdkszRegistryInfo.windows_sdkcCstjj|jdS)z< Microsoft .NET Framework SDK registry key. ZNETFXSDK)rrrrT)r<rrr netfx_sdkszRegistryInfo.netfx_sdkcCsdS)z< Microsoft Windows Kits Roots registry key. zWindows Kits\Installed Rootsr)r<rrrwindows_kits_rootsszRegistryInfo.windows_kits_rootsFcCs(|jjs|rdnd}tjjd|d|S)a  Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str: value rZ Wow6432NodeZSoftwareZ Microsoft)rNrBrrr)r<rrZnode64rrr microsoftszRegistryInfo.microsoftcCstj}tj}|j}x|jD]}y||||d|}WnZttfk r|jjsy||||dd|}Wqttfk rwYqXnwYnXytj ||dSttfk rYqXqWdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str: value rTN) rKEY_READOpenKeyrXHKEYSOSErrorIOErrorrNrBZ QueryValueEx)r<rnamerYZopenkeymshkeybkeyrrrlookups"   zRegistryInfo.lookupN)F)rr r rIrr r r rr[r=rLrOrPrQrRrSrTrUrVrWrXrbrrrrrMLs"          rMc@s$eZdZdZejddZejddZejdeZd3ddZ d d Z d d Z e d dZ e ddZddZddZe ddZe ddZe ddZe ddZe ddZe dd Ze d!d"Ze d#d$Ze d%d&Ze d'd(Ze d)d*Ze d+d,Ze d-d.Zd/d0Zd4d1d2ZdS)5 SystemInfoz Microsoft Windows and Visual Studio related system inormations. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirr ProgramFileszProgramFiles(x86)NcCs"||_|jj|_|p|j|_dS)N)rirN_find_latest_available_vc_vervc_ver)r<Z registry_inforhrrrr=s zSystemInfo.__init__c Cs6y |jdStk r0d}tjj|YnXdS)Nrz%No Microsoft Visual C++ version foundr2)find_available_vc_vers IndexErrorr r!r")r<errrrrrgs  z(SystemInfo._find_latest_available_vc_verc Cs6|jj}|jj|jj|jjf}g}x|jjD]}x|D]}ytj|||dtj}Wnt t fk rpw8YnXtj |\}}} xPt |D]D} y*t tj|| d} | |kr|j| Wqtk rYqXqWxPt |D]D} y(t tj|| } | |kr|j| Wqtk r YqXqWq8Wq.Wt|S)zC Find all available Microsoft Visual C++ versions. r)rfrXrQrSrRr[rrZrYr\r]Z QueryInfoKeyrangefloatZ EnumValueappendr#ZEnumKeysorted) r<r_ZvckeysZvc_versr`rraZsubkeysvaluesr>ir'rrrris2   z!SystemInfo.find_available_vc_verscCs6d|j}tjj|j|}|jj|jjd|jp4|S)z4 Microsoft Visual Studio directory. zMicrosoft Visual Studio %0.1fz%0.1f)rhrrrProgramFilesx86rfrbrR)r<r^defaultrrr VSInstallDir s zSystemInfo.VSInstallDircCs|j|jp|j}tjj|jjd|j}|jj |d}|rNtjj|dn|}|jj |jj d|jpl|}tjj |sd}t j j||S)z1 Microsoft Visual C++ directory. z%0.1frZVCz(Microsoft Visual C++ directory not found)rt _guess_vc_guess_vc_legacyrrrrfrSrhrbrQisdirr r!r")r<guess_vcZreg_pathZ python_vcZ default_vcrmsgrrr VCInstallDirs  zSystemInfo.VCInstallDirc Cs^|jdkrdSd}tjj|j|}ytj|d}tjj||Stttfk rXYnXdS)z* Locate Visual C for 2017 g,@Nz VC\Tools\MSVCrr2) rhrrrrtlistdirr\r]rj)r<rsrxZ vc_exact_verrrrru0s zSystemInfo._guess_vccCsd|j}tjj|j|S)z< Locate Visual C for versions prior to 2017 z Microsoft Visual Studio %0.1f\VC)rhrrrrr)r<rsrrrrv@s zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jd kr8dS|jdkrFdSdS)zN Microsoft Windows SDK versions for specified MSVC++ version. g"@7.06.16.0ag$@7.17.0ag&@8.08.0ag(@8.18.1ag,@10.0N)r|r}r~)rr)rr)rr)rr)rh)r<rrrWindowsSdkVersionGs     zSystemInfo.WindowsSdkVersioncCs|jtjj|jdS)z4 Microsoft Windows SDK last version lib)_use_last_dir_namerrr WindowsSdkDir)r<rrrWindowsSdkLastVersionWs z SystemInfo.WindowsSdkLastVersioncCsTd}x8|jD].}tjj|jjd|}|jj|d}|r Pq W| sRtjj| rtjj|jjd|j }|jj|d}|rtjj|d}| stjj| rxH|jD]>}|d|j d}d |}tjj|j |}tjj|r|}qW| stjj| r:x:|jD]0}d |}tjj|j |}tjj|r|}qW|sPtjj|j d }|S) z2 Microsoft Windows SDK directory. rzv%sinstallationfolderz%0.1frZWinSDKN.zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZ PlatformSDK) rrrrrfrUrbrwrSrhrfindrerz)r<sdkdirr'locrZ install_baseZintverdrrrr_s6     zSystemInfo.WindowsSdkDirc Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d ||jd d f}g}|jd krx(|jD]}|tjj|jj ||g7}qdWx,|j D]"}|tjj|jj d ||g7}qWx |D]}|jj |d}|rPqW|S)z= Microsoft Windows SDK executable directory. g&@#r(g(@TF)r9rCzWinSDK-NetFx%dTools%srF-g,@zv%sAr) rhrNrDr;NetFxSdkVersionrrrrfrVrrUrb) r<Znetfxverr(rCZfxZregpathsr'rZexecpathrrrWindowsSDKExecutablePaths$    " z#SystemInfo.WindowsSDKExecutablePathcCs.d|j}tjj|jj|}|jj|dp,dS)z0 Microsoft Visual F# directory. z%0.1f\Setup\F#rr)rhrrrrfrOrb)r<rrrrFSharpInstallDirs zSystemInfo.FSharpInstallDircCsF|jdkrd}nf}x(|D] }|jj|jjd|}|rPqW|pDdS)z8 Microsoft Universal CRT SDK directory. g,@1081z kitsroot%sr)rr)rhrfrbrW)r<Zversr'rrrrUniversalCRTSdkDirs    zSystemInfo.UniversalCRTSdkDircCs|jtjj|jdS)z@ Microsoft Universal C Runtime SDK last version r)rrrrr)r<rrrUniversalCRTSdkLastVersions z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSfSdS)z8 Microsoft .NET Framework SDK versions. g,@4.6.14.6N)rr)rh)r<rrrrs zSystemInfo.NetFxSdkVersioncCs>x4|jD]*}tjj|jj|}|jj|d}|rPqW|p)sz0SystemInfo._use_last_dir_name..Nr)reversedrr{next)r<rrZ matching_dirsr)rrrrs zSystemInfo._use_last_dir_name)N)r) rr r rIrJrKrdrerrr=rgrirLrtrzrurvrrrrrrrrrrrrrrrrrrrrcs4         &     rcc@sReZdZdZd=ddZeddZedd Zed d Zed d Z eddZ eddZ eddZ eddZ eddZeddZddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zd>d7d8Zd9d:Zd?d;d<Z dS)@r$aY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.0. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. NrcCsBt||_t|j|_t|j||_|j|kr>d}tjj |dS)Nz.No suitable Microsoft Visual C++ version found) r8rNrMrfrcsirhr r!r")r<r(rhr,rkrrrr=Is    zEnvironmentInfo.__init__cCs|jjS)z/ Microsoft Visual C++ version. )rrh)r<rrrrhRszEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd d |DS) z/ Microsoft Visual Studio Tools z Common7\IDEz Common7\Toolsg,@T)rCr9z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjjjj|qSr)rrrrrt)rr)r<rr fsz+EnvironmentInfo.VSTools..)rhrNrD)r<paths arch_subdirr)r<rVSToolsYs   zEnvironmentInfo.VSToolscCs$tjj|jjdtjj|jjdgS)zL Microsoft Visual C++ & Microsoft Foundation Class Includes ZIncludezATLMFC\Include)rrrrrz)r<rrr VCIncludeshszEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd d |DS) zM Microsoft Visual C++ & Microsoft Foundation Class Libraries g.@T)r9)rCzLib%sz ATLMFC\Lib%sg,@z Lib\store%scsg|]}tjjjj|qSr)rrrrrz)rr)r<rrr~sz/EnvironmentInfo.VCLibraries..)rhrNrE)r<rrr)r<r VCLibrariesps  zEnvironmentInfo.VCLibrariescCs"|jdkrgStjj|jjdgS)zA Microsoft Visual C++ store references Libraries g,@zLib\store\references)rhrrrrrz)r<rrr VCStoreRefss zEnvironmentInfo.VCStoreRefscCs|j}tjj|jdg}|jdkr&dnd}|jj|}|rT|tjj|jd|g7}|jdkrd|jjdd}|tjj|j|g7}n|jdkr|jj rd nd }|tjj|j||jj dd g7}|jj |jj kr|tjj|j||jjdd g7}n|tjj|jd g7}|S) z, Microsoft Visual C++ Tools Z VCPackagesg$@TFzBin%sg,@)rCg.@z bin\HostX86%sz bin\HostX64%s)r9Bin) rrrrrzrhrNrHrDrBrErAr?)r<rtoolsrGrrZhost_dirrrrVCToolss&   zEnvironmentInfo.VCToolscCst|jdkr2|jjddd}tjj|jjd|gS|jjdd}tjj|jjd}|j}tjj|d||fgSdS) z1 Microsoft Windows SDK Libraries g$@T)rCr9zLib%s)r9rz%sum%sN) rhrNrErrrrr _sdk_subdir)r<rrZlibverrrr OSLibrariess zEnvironmentInfo.OSLibrariescCs|tjj|jjd}|jdkr.|tjj|dgS|jdkr@|j}nd}tjj|d|tjj|d|tjj|d|gSd S) z/ Microsoft Windows SDK Include includeg$@Zglg,@rz%ssharedz%sumz%swinrtN)rrrrrrhr)r<rsdkverrrr OSIncludess  zEnvironmentInfo.OSIncludescCstjj|jjd}g}|jdkr*||j7}|jdkrH|tjj|dg7}|jdkr||tjj|jjdtjj|ddtjj|d dtjj|d dtjj|jjd d d |jdddg7}|S)z7 Microsoft Windows SDK Libraries Paths Z Referencesg"@g&@zCommonConfiguration\Neutralg,@Z UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrrrrrhr)r<reflibpathrrr OSLibpaths>     zEnvironmentInfo.OSLibpathcCs t|jS)z- Microsoft Windows SDK Tools )list _sdk_tools)r<rrrSdkToolsszEnvironmentInfo.SdkToolsccs|jdkr0|jdkrdnd}tjj|jj|V|jjsd|jjdd}d|}tjj|jj|V|jdksx|jdkr|jj rd }n|jjddd }d |}tjj|jj|VnL|jdkrtjj|jjd}|jjdd}|jj }tjj|d ||fV|jj r|jj Vd S)z= Microsoft Windows SDK Tools paths generator g.@g&@rzBin\x86T)r9zBin%sg$@r)rCr9zBin\NETFX 4.0 Tools%sz%s%sN) rhrrrrrrNrBrDr@rr)r<Zbin_dirrrrrrrrs(     zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)z6 Microsoft Windows SDK version subdir z%s\r)rr)r<ucrtverrrrrszEnvironmentInfo._sdk_subdircCs"|jdkrgStjj|jjdgS)z- Microsoft Windows SDK Setup g"@ZSetup)rhrrrrr)r<rrrSdkSetup%s zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}|j o,|j }n$|jp>|j}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)z0 Microsoft .NET Framework Tools g$@Tr:csg|]}tjjj|qSr)rrrr)rr')rrrr@sz+EnvironmentInfo.FxTools..csg|]}tjjj|qSr)rrrr)rr')rrrrCs) rNrrhr@rBrAr?rr)r<rNZ include32Z include64rr)rrFxTools/s     zEnvironmentInfo.FxToolscCs>|jdks|jj rgS|jjdd}tjj|jjd|gS)z8 Microsoft .Net Framework SDK Libraries g,@T)r9zlib\um%s)rhrrrNrErrr)r<rrrrNetFxSDKLibrariesGsz!EnvironmentInfo.NetFxSDKLibrariescCs,|jdks|jj rgStjj|jjdgS)z7 Microsoft .Net Framework SDK Includes g,@z include\um)rhrrrrr)r<rrrNetFxSDKIncludesRsz EnvironmentInfo.NetFxSDKIncludescCstjj|jjdgS)z> Microsoft Visual Studio Team System Database z VSTSDB\Deploy)rrrrrt)r<rrrVsTDb\szEnvironmentInfo.VsTDbcCs~|jdkrgS|jdkr0|jj}|jjdd}n |jj}d}d|j|f}tjj||g}|jdkrz|tjj||dg7}|S)z( Microsoft Build Engine g(@g.@T)rCrzMSBuild\%0.1f\bin%sZRoslyn) rhrrrrNrDrtrrr)r< base_pathrrZbuildrrrMSBuildcs   zEnvironmentInfo.MSBuildcCs"|jdkrgStjj|jjdgS)z. Microsoft HTML Help Workshop g&@zHTML Help Workshop)rhrrrrrr)r<rrrHTMLHelpWorkshopzs z EnvironmentInfo.HTMLHelpWorkshopcCsL|jdkrgS|jjdd}tjj|jjd}|j}tjj|d||fgS)z= Microsoft Universal C Runtime SDK Libraries g,@T)r9rz%sucrt%s) rhrNrErrrrr _ucrt_subdir)r<rrrrrr UCRTLibrariess  zEnvironmentInfo.UCRTLibrariescCs6|jdkrgStjj|jjd}tjj|d|jgS)z; Microsoft Universal C Runtime SDK Include g,@rz%sucrt)rhrrrrrr)r<rrrr UCRTIncludess zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)zB Microsoft Universal C Runtime SDK version subdir z%s\r)rr)r<rrrrrszEnvironmentInfo._ucrt_subdircCs |jdkr|jdkrgS|jjS)z% Microsoft Visual F# g&@g(@)rhrr)r<rrrFSharpszEnvironmentInfo.FSharpcCsl|jjdd}|jdkr&|jj}d}n|jjjdd}d}|jdkrHdn|j}|||j|f}tjj||S) zA Microsoft Visual C++ runtime redistribuable dll T)r9z-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllz\Toolsz\Redistz.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@) rNrErhrrzr;rrr)r<rZ redist_pathZ vcruntimeZdll_verrrrVCRuntimeRedists zEnvironmentInfo.VCRuntimeRedistTcCst|jd|j|j|j|jg||jd|j|j|j|j |j g||jd|j|j|j |j g||jd|j |j|j|j|j|j|j|j|jg |d}|jdkrtjj|jr|j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. rrrr)rrrrZpy_vcruntime_redist)dict _build_pathsrrrrrrrrrrrrrrrrrrrrhrrrr)r<existsenvrrrr%sD   zEnvironmentInfo.return_envc Csxtjj|}tj|djtj}tj||}|rBtt tj j |n|}|sbd|j }t jj||j|} tjj| S)a Given an environment variable name and specified paths, return a pathsep-separated string of paths containing unique, extant, directories from those paths and from the environment variable. Raise an error if no paths are resolved. rz %s environment variable is empty) itertoolschain from_iterablerJrKsplitrpathseprfilterrrwupperr r!r"_unique_everseenr) r<r^Zspec_path_listsrZ spec_pathsZ env_pathsrZ extant_pathsryZ unique_pathsrrrrs     zEnvironmentInfo._build_pathsccsjt}|j}|dkr:xPt|j|D]}|||Vq"Wn,x*|D]"}||}||kr@|||Vq@WdS)z List unique elements, preserving order. Remember all elements ever seen. _unique_everseen('AAAABBBCCDAABBB') --> A B C D _unique_everseen('ABBCcAD', str.lower) --> A B C D N)setaddr __contains__)r<iterablerseenZseen_addelementkrrrrs   z EnvironmentInfo._unique_everseen)Nr)T)N)!rr r rIr=rLrhrrrrrrrrrrrrrrrrrrrrrrrr%rrrrrrr$1s:       -        -r$)r)r)!rIrr.platformrZdistutils.errorsr Z#setuptools.extern.packaging.versionrZsetuptools.extern.six.movesrZmonkeyrsystemrenvironrJr ImportErrorr!r"Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrrr-r1r&r8rMrcr$rrrrs>      + /& %[bPK!^f%__pycache__/dist.cpython-36.opt-1.pycnu[3 vhu@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl m Z ddl mZmZmZddlmZddlmZddlmZddlmZdd lmZmZmZdd lmZdd lmZdd l m!Z!dd l"m#Z#ddl$Z$ddl%m&Z&e'de'dddZ(ddZ)ddZ*e+e,fZ-ddZ.ddZ/ddZ0ddZ1d d!Z2d"d#Z3d$d%Z4d&d'Z5d(d)Z6d*d+Z7d,d-Z8d.d/Z9e!ej:j;ZZ parse_maprAr)rDr8rEerrrcheck_entry_pointssrfcCst|tjstddS)Nztest_suite must be a string)r`r Z string_typesr)rDr8rErrrcheck_test_suites rgc Csdt|trTxH|jD]8\}}t|ts(Py t|Wqtk rJPYqXqWdSt|ddS)z@Verify that value is a dictionary of package names to glob listsNzI must be a dictionary mapping package names to lists of wildcard patterns)r`rar2striterr@r)rDr8rEkvrrrcheck_package_datas    rlcCs,x&|D]}tjd|stjjd|qWdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrLrMr)rDr8rEZpkgnamerrrcheck_packagess   roc@s0eZdZdZdeedZdZddZdGddZ dd Z d d Z e d d Z ddZddZdHddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Z d5d6Z!d7d8Z"d9d:Z#d;d<Z$d=d>Z%d?d@Z&dAdBZ'dCdDZ(dEdFZ)dS)IraDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. N)rr1rcCsp| sd|ksd|krdStjt|dj}tjjj|}|dk rl|jd rltjt|d|_ ||_ dS)NrYr7zPKG-INFO) r=Z safe_namerhlower working_setZby_keygetZ has_metadataZ safe_versionZ_version _patched_dist)r5attrskeyrDrrrpatch_missing_pkg_infoSsz#Distribution.patch_missing_pkg_infoc std}|si_|pi}d|ks,d|kr4tjg_i_g_|jdd_j ||jdg_ |jdg_ x$t j dD]}tj|jdqWtjfdd |jDx\jjD]N\}}x6jj|fD]}||kr||}PqW|r|nd}tj||qWtjjtjr>tjjj_jjdk ryHtjjjj}t|} jj| krtj d jj| f| j_Wn0tjj!t"fk rtj d jjYnXj#dS) N package_datafeaturesrequire_featuressrc_rootdependency_linkssetup_requireszdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA).0rjrk)r5rr qsz)Distribution.__init__..zNormalizing '%s' to '%s'zThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)$r4rwFeaturewarn_deprecatedryrxZ dist_filespoprzrvr{r|r=iter_entry_pointsvars setdefaultrY _Distribution__init__r2r}metadata__dict__setattrr`r7numbersNumberrhr ZVersionrrZInvalidVersionr@_finalize_requires) r5rtZhave_package_datarFZoptiondefaultsourcerEZverZnormalized_versionr)r5rr`sR    zDistribution.__init__cCsjt|ddr|j|j_t|ddrVx2|jjD]$}|jdd}|r.|jjj|q.W|j|j dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. rNextras_requirerVr) r rrrkeyssplitradd_convert_extras_requirements"_move_install_requirements_markers)r5r;rrrrs   zDistribution._finalize_requirescCspt|ddpi}tt|_xP|jD]D\}}|j|x0tj|D]"}|j|}|j||j|qBWq$WdS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r rrQ_tmp_extras_requirer2r=rX _suffix_forappend)r5Z spec_ext_reqsZsectionrkrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rV)rZrh)reqrrrrszDistribution._suffix_forcsdd}tddpf}ttj|}t||}t||}ttt|_x&|D]}j dt|j j |qPWt fddj j D_dS)zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j S)N)rZ)rrrr is_simple_reqszFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrVc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rh)r~rrrr szMDistribution._move_install_requirements_markers...N)r _clean_req)r~rjrk)r5rr szBDistribution._move_install_requirements_markers..)r rQr=rXr r r rhrrrZrrar2r)r5rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrr)r5rrs     z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. N)rZ)r5rrrrrszDistribution._clean_reqFcCs*tj||dt||j|d|jdS)zYParses configuration files from various levels and loads configuration. ) filenames)ignore_option_errorsN)rparse_config_filesrcommand_optionsr)r5rrrrrrszDistribution.parse_config_filescCstj|}|jr|j|S)z3Process features after parsing command line options)rparse_command_linerx_finalize_features)r5resultrrrrs zDistribution.parse_command_linecCsd|jddS)z;Convert feature name to corresponding option attribute nameZwith_-_)replace)r5rYrrr_feature_attrnameszDistribution._feature_attrnamecCs<tjjtj||jdd}x|D]}tjj|ddq W|S)zResolve pre-setup requirementsT) installerZreplace_conflicting)r)r=rqresolverXfetch_build_eggr)r5r!Zresolved_distsrDrrrfetch_build_eggss zDistribution.fetch_build_eggscCstj||jr|jxHtjdD]:}t||jd}|dk r$|j|j d|j ||j|q$Wt|ddrdd|j D|_ ng|_ dS)Nzdistutils.setup_keywords)rconvert_2to3_doctestscSsg|]}tjj|qSr)ospathabspath)r~prrrrsz1Distribution.finalize_options..) rfinalize_optionsrx_set_global_opts_from_featuresr=rr rYrequirerloadr)r5rFrErrrrs  zDistribution.finalize_optionsc Csvtjjtjd}tjj|srtj|tj|tjj|d}t|d$}|j d|j d|j dWdQRX|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) rrr3curdirexistsmkdirrZ hide_fileopenr/)r5Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirs      zDistribution.get_egg_cache_dirc Csddlm}|jddgi}|jd}|j|jdd|jdjD|jr|jdd}d|krx|dd |}d |f|d<|j}||d g|d d dd d d d d d }|j |j|S)z Fetch an egg needed for buildingr) easy_installZ script_argsrcss"|]\}}|dkr||fVqdS) find_links site_dirs index_urloptimize allow_hostsN)rrrrrrr)r~rjrkrrrr1sz/Distribution.fetch_build_egg..NrrZsetupxTF) args install_dirZexclude_scriptsZ always_copyZbuild_directoryZeditableZupgradeZ multi_versionZ no_reportuser) Zsetuptools.command.easy_installr __class__get_option_dictclearupdater2r{rZensure_finalized)r5rrrDoptsZlinksrcmdrrrr*s(   zDistribution.fetch_build_eggc Csg}|jj}x|jjD]\}}|j|d|j||jr|j}d}d}|js^||}}d|dd||fd|dd||ff}|j |d||d|<qW||j |_ |_ ||_|_ dS)z;Add --with-X/--without-X options based on optional featuresNz (default)rzwith-zinclude zwithout-zexclude ) negative_optcopyrxr2 _set_featurevalidateoptional descriptioninclude_by_defaultextendglobal_optionsZfeature_optionsZfeature_negopt) r5ZgonorYfeaturedescrZincdefZexcdefnewrrrrGs"     z+Distribution._set_global_opts_from_featurescCsxJ|jjD]<\}}|j|}|s2|dkr |jr |j||j|dq Wx6|jjD](\}}|j|sX|j||j|dqXWdS)z9Add/remove features and resolve dependencies between themNrr)rxr2feature_is_includedr include_inr exclude_from)r5rYrZenabledrrrrbs    zDistribution._finalize_featurescCs`||jkr|j|Stjd|}x:|D]&}|j|jd|j|j|<}|SWtj||SdS)z(Pluggable version of get_command_class()zdistutils.commands)rN)cmdclassr=rrrrrget_command_class)r5commandZepsrFrrrrrss    zDistribution.get_command_classcCs>x2tjdD]$}|j|jkr |j}||j|j<q Wtj|S)Nzdistutils.commands)r=rrYrrrprint_commands)r5rFrrrrrs  zDistribution.print_commandscCs>x2tjdD]$}|j|jkr |j}||j|j<q Wtj|S)Nzdistutils.commands)r=rrYrrrget_command_list)r5rFrrrrrs  zDistribution.get_command_listcCst||j||dS)zSet feature's inclusion statusN)rr)r5rYZstatusrrrrszDistribution._set_featurecCst||j|S)zAReturn 1 if feature is included, 0 if excluded, 'None' if unknown)r r)r5rYrrrrsz Distribution.feature_is_includedcCsF|j|dkr&|j|j}t|d|j|j||j|ddS)z)Request inclusion of feature named 'name'rz2 is required, but was excluded or is not availablerN)rrxrrrr)r5rYrrrrinclude_features   zDistribution.include_featurecKsDx>|jD]2\}}t|d|d}|r0||q |j||q WdS)aAdd items to distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. Z _include_N)r2r _include_misc)r5rtrjrkincluderrrrs  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagerIcs$g|]}|kr|j r|qSr) startswith)r~r)packagepfxrrrsz0Distribution.exclude_package..cs$g|]}|kr|j r|qSr)r)r~r)rrrrrscs(g|] }|jkr|jj r|qSr)rYr)r~r)rrrrrsN)packages py_modules ext_modules)r5rr)rrrexclude_packageszDistribution.exclude_packagecCs4|d}x&|jD]}||ks(|j|rdSqWdS)z.)r`sequencerr rBr)r5rYrEoldr)rEr _exclude_miscs  zDistribution._exclude_miscc st|tstd||fyt||Wn tk rHtd|YnXdkr`t|||n:ttsxt|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|kr|qSrr)r~r)rrrrsz.Distribution._include_misc..)r`rrr rBr)r5rYrErr)rrrs   zDistribution._include_misccKsDx>|jD]2\}}t|d|d}|r0||q |j||q WdS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. Z _exclude_N)r2r r)r5rtrjrkexcluderrrrs  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))r`rrrQr r)r5rrrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|jd}xB||krh||\}}||=ddl}|j|d|dd<|d}q(Wtj|||}|j|} t | ddrd|f|j|d<|dk rgS|S)NraliasesTrZcommand_consumes_argumentsz command liner) rrrrshlexrr_parse_command_optsrr ) r5parserrrrsrcaliasrnargsZ cmd_classrrrr s"        z Distribution._parse_command_optsc Csi}x|jjD]\}}x|jD]\}\}}|dkr8q"|jdd}|dkr|j|}|jj}|jt|dix<|jD]\} } | |kr|| }d}Pq|Wtdn |dkrd}||j |i|<q"WqW|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. z command linerrrrNzShouldn't be able to get herer) rr2rZget_command_objrrrr rCr) r5drroptrvalZcmdobjZneg_optnegposrrrget_cmdline_options:s(     z Distribution.get_cmdline_optionsccsx|jp fD] }|Vq Wx|jp$fD] }|Vq&WxH|jp>fD]:}t|trX|\}}n|j}|jdrt|dd}|Vq@WdS)z@Yield all packages, modules, and extension names in distributionmoduleNi)rrrr`tuplerYendswith)r5ZpkgrZextrYZ buildinforrrrbs      z$Distribution.iter_distribution_namescCsddl}tjs|jr tj||Sddl}t|j|j sBtj||S|jj j dkr^tj||S|jj }|jj }|j dkr|dp~d}|jj}|j |jjd||||_z tj||S|j |jj|||||_XdS)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rNutf-8utf8Zwin32 )rr )sysr r0Z help_commandsrhandle_display_optionsior`stdout TextIOWrapperencodingrperrorsr:line_bufferingdetach)r5Z option_orderr r rrnewlinerrrrr ts$     z#Distribution.handle_display_options)N)NF)*__name__ __module__ __qualname____doc__rarbr}rsrvrrr staticmethodrrrrrrrrrrrrrrrrrrrrrJrrrrrrrr rrrrrsLB ;      (c@sPeZdZdZeddZdddfffddZdd Zd d Zd d Z ddZ dS)ra **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCsd}tj|tdddS)NzrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.) stacklevel)rrr)msgrrrrszFeature.warn_deprecatedFTc Ks|j||_||_||_||_t|ttfr4|f}dd|D|_dd|D}|r^||d<t|trn|f}||_ ||_ | r| r| rt ddS)NcSsg|]}t|tr|qSr)r`rh)r~rrrrrsz$Feature.__init__..cSsg|]}t|ts|qSr)r`rh)r~rrrrrsryzgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.) rrstandard availablerr`rhrryremoveextrasr) r5rrrrryrr Zerrrrrs$ zFeature.__init__cCs |jo |jS)z+Should this feature be included by default?)rr)r5rrrrszFeature.include_by_defaultcCs@|jst|jd|jf|jx|jD]}|j|q*WdS)aEnsure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. z3 is required, but is not available on this platformN)rrrrr ryr)r5rDrrrrrs   zFeature.include_incCs2|jf|j|jr.x|jD]}|j|qWdS)a2Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. N)rr rr)r5rDrrrrrs  zFeature.exclude_fromcCs2x,|jD]"}|j|std|j||fqWdS)aVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. zg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN)rrJrr)r5rDrrrrrs  zFeature.validateN) rrrrrrrrrrrrrrrrs7 r)>__all__rmrrrZ distutils.logrLZdistutils.coreZ distutils.cmdZdistutils.distrR collectionsrZdistutils.errorsrrrZdistutils.utilrZdistutils.versionrZsetuptools.externr r Zsetuptools.extern.six.movesr r r Zsetuptools.dependsrZ setuptoolsrZsetuptools.monkeyrZsetuptools.configrr=Z py36compatr __import__rr#r<rrQrrGrHrPrUrTr^rcrdrfrgrlroZcorerrrrrrrs`          G     PK!$LL(__pycache__/unicode_utils.cpython-36.pycnu[3 vh@s8ddlZddlZddlmZddZddZddZdS) N)sixc CsVt|tjrtjd|Sy$|jd}tjd|}|jd}Wntk rPYnX|S)NZNFDzutf-8) isinstancer text_type unicodedataZ normalizedecodeencode UnicodeError)pathr #/usr/lib/python3.6/unicode_utils.py decomposes    r c CsXt|tjr|Stjpd}|df}x.|D]&}y |j|Stk rNw*Yq*Xq*WdS)zY Ensure that the given path is decoded, NONE when no expected encoding works zutf-8N)rrrsysgetfilesystemencodingrUnicodeDecodeError)r Zfs_encZ candidatesencr r r filesys_decodes    rc Cs$y |j|Stk rdSXdS)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrr r r try_encode's r)rr Zsetuptools.externrr rrr r r r s   PK!$LL.__pycache__/unicode_utils.cpython-36.opt-1.pycnu[3 vh@s8ddlZddlZddlmZddZddZddZdS) N)sixc CsVt|tjrtjd|Sy$|jd}tjd|}|jd}Wntk rPYnX|S)NZNFDzutf-8) isinstancer text_type unicodedataZ normalizedecodeencode UnicodeError)pathr #/usr/lib/python3.6/unicode_utils.py decomposes    r c CsXt|tjr|Stjpd}|df}x.|D]&}y |j|Stk rNw*Yq*Xq*WdS)zY Ensure that the given path is decoded, NONE when no expected encoding works zutf-8N)rrrsysgetfilesystemencodingrUnicodeDecodeError)r Zfs_encZ candidatesencr r r filesys_decodes    rc Cs$y |j|Stk rdSXdS)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrr r r try_encode's r)rr Zsetuptools.externrr rrr r r r s   PK!2vv+__pycache__/build_meta.cpython-36.opt-1.pycnu[3 vh'@sdZddlZddlZddlZddlZddlZddlZddlZGdddeZ Gdddej j Z ddd Z d d Z d d ZddZdddZdddZdddZdddZdddZdS) a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. Nc@seZdZddZdS)SetupRequirementsErrorcCs ||_dS)N) specifiers)selfrr /usr/lib/python3.6/build_meta.py__init__(szSetupRequirementsError.__init__N)__name__ __module__ __qualname__rrrrrr'src@s&eZdZddZeejddZdS) DistributioncCs t|dS)N)r)rrrrrfetch_build_eggs-szDistribution.fetch_build_eggsc cs*tjj}|tj_z dVWd|tj_XdS)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilsZcorer )clsZorigrrrpatch0s  zDistribution.patchN)rr r r classmethod contextlibcontextmanagerrrrrrr ,sr setup.pycCsH|}d}ttdt|}|jjdd}|jtt||dtdS)N__main__openz\r\nz\nexec) getattrtokenizerreadreplaceclosercompilelocals)Z setup_script__file__rfcoderrr _run_setup@s r!cCs|pi}|jdg|S)Nz--global-option) setdefault)config_settingsrrr _fix_configKs r$cCs~t|}ddg}tjdddg|dt_ytj tWdQRXWn,tk rx}z||j7}WYdd}~XnX|S)N setuptoolsZwheelZegg_infoz--global-option)r$sysargvr rr!rr)r#Z requirementserrr_get_build_requiresQs  r*csfddtjDS)Ncs&g|]}tjjtjj|r|qSr)ospathisdirjoin).0name)a_dirrr asz1_get_immediate_subdirectories..)r+listdir)r1r)r1r_get_immediate_subdirectories`sr4cCst|}t|S)N)r$r*)r#rrrget_requires_for_build_wheelesr5cCst|}t|S)N)r$r*)r#rrrget_requires_for_build_sdistjsr6cCstjdddd|gt_t|}xPddtj|D}t|dkrptt|dkrptjj|tj|d}q&Pq&W||krt j tjj||d|t j |dd|dS) Nr&Z dist_infoz --egg-basecSsg|]}|jdr|qS)z .dist-info)endswith)r/rrrrr2usz4prepare_metadata_for_build_wheel..rT) ignore_errors) r'r(r!r+r3lenr4r,r.shutilZmovermtree)metadata_directoryr#Zdist_info_directoryZ dist_infosrrr prepare_metadata_for_build_wheelos" r=cCsrt|}tjj|}tjdddg|dt_t|dkrVtj|tj d|ddtj |D}|dS)Nr&Z bdist_wheelz--global-optiondistcSsg|]}|jdr|qS)z.whl)r7)r/rrrrr2szbuild_wheel..r) r$r+r,abspathr'r(r!r:r;copytreer3)Zwheel_directoryr#r<Zwheelsrrr build_wheels    rAcCsrt|}tjj|}tjdddg|dt_t|dkrVtj|tj d|ddtj |D}|dS)Nr&Zsdistz--global-optionr>cSsg|]}|jdr|qS)z.tar.gz)r7)r/rrrrr2szbuild_sdist..r) r$r+r,r?r'r(r!r:r;r@r3)Zsdist_directoryr#Zsdistsrrr build_sdists    rB)r)N)N)N)NN)N)__doc__r+r'rr:rr%r BaseExceptionrr>r r!r$r*r4r5r6r=rArBrrrrs&     PK!Q!__pycache__/launch.cpython-36.pycnu[3 vh@s.dZddlZddlZddZedkr*edS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. NcCsrttjd}t|ddd}tjddtjdd<ttdt}||j}|jdd}t ||d}t ||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizerreadreplacecompiler)Z script_name namespaceZopen_ZscriptZ norm_scriptcoder/usr/lib/python3.6/launch.pyrun s     rr)rrr rrrrrrs PK!"__pycache__/version.cpython-36.pycnu[3 vh @s6ddlZyejdjZWnek r0dZYnXdS)NZ setuptoolsunknown)Z pkg_resourcesZget_distributionversion __version__ Exceptionrr/usr/lib/python3.6/version.pysPK!4< < %__pycache__/lib2to3_ex.cpython-36.pycnu[3 vh@sXdZddlmZddlmZddlmZmZddl Z GdddeZ Gdd d eZdS) zy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. ) Mixin2to3)log)RefactoringToolget_fixers_from_packageNc@s$eZdZddZddZddZdS)DistutilsRefactoringToolcOstj|f|dS)N)rerror)selfmsgargskwr /usr/lib/python3.6/lib2to3_ex.py log_errorsz"DistutilsRefactoringTool.log_errorcGstj|f|dS)N)rinfo)rr r r r r log_messagesz$DistutilsRefactoringTool.log_messagecGstj|f|dS)N)rdebug)rr r r r r log_debugsz"DistutilsRefactoringTool.log_debugN)__name__ __module__ __qualname__rrrr r r r rsrc@s&eZdZd ddZddZddZdS) rFcCsr|jjdk rdS|sdStjddj||j|j|rbtjrnt |j }|j |dddn t j ||dS)NTzFixing  )writeZ doctests_only) distributionZuse_2to3rrjoin_Mixin2to3__build_fixer_names_Mixin2to3__exclude_fixers setuptoolsZrun_2to3_on_doctestsr fixer_namesZrefactor _Mixin2to3run_2to3)rfilesZdoctestsrr r r rs  zMixin2to3.run_2to3cCsb|jr dSg|_xtjD]}|jjt|qW|jjdk r^x |jjD]}|jjt|qFWdS)N)rrZlib2to3_fixer_packagesextendrrZuse_2to3_fixers)rpr r r Z__build_fixer_names.s  zMixin2to3.__build_fixer_namescCsNt|dg}|jjdk r&|j|jjx"|D]}||jkr,|jj|q,WdS)NZexclude_fixers)getattrrZuse_2to3_exclude_fixersr"rremove)rZexcluded_fixersZ fixer_namer r r Z__exclude_fixers8s     zMixin2to3.__exclude_fixersN)F)rrrrrrr r r r rs  r) __doc__Zdistutils.utilrrZ distutilsrZlib2to3.refactorrrrrr r r r s    PK!4< < +__pycache__/lib2to3_ex.cpython-36.opt-1.pycnu[3 vh@sXdZddlmZddlmZddlmZmZddl Z GdddeZ Gdd d eZdS) zy Customized Mixin2to3 support: - adds support for converting doctests This module raises an ImportError on Python 2. ) Mixin2to3)log)RefactoringToolget_fixers_from_packageNc@s$eZdZddZddZddZdS)DistutilsRefactoringToolcOstj|f|dS)N)rerror)selfmsgargskwr /usr/lib/python3.6/lib2to3_ex.py log_errorsz"DistutilsRefactoringTool.log_errorcGstj|f|dS)N)rinfo)rr r r r r log_messagesz$DistutilsRefactoringTool.log_messagecGstj|f|dS)N)rdebug)rr r r r r log_debugsz"DistutilsRefactoringTool.log_debugN)__name__ __module__ __qualname__rrrr r r r rsrc@s&eZdZd ddZddZddZdS) rFcCsr|jjdk rdS|sdStjddj||j|j|rbtjrnt |j }|j |dddn t j ||dS)NTzFixing  )writeZ doctests_only) distributionZuse_2to3rrjoin_Mixin2to3__build_fixer_names_Mixin2to3__exclude_fixers setuptoolsZrun_2to3_on_doctestsr fixer_namesZrefactor _Mixin2to3run_2to3)rfilesZdoctestsrr r r rs  zMixin2to3.run_2to3cCsb|jr dSg|_xtjD]}|jjt|qW|jjdk r^x |jjD]}|jjt|qFWdS)N)rrZlib2to3_fixer_packagesextendrrZuse_2to3_fixers)rpr r r Z__build_fixer_names.s  zMixin2to3.__build_fixer_namescCsNt|dg}|jjdk r&|j|jjx"|D]}||jkr,|jj|q,WdS)NZexclude_fixers)getattrrZuse_2to3_exclude_fixersr"rremove)rZexcluded_fixersZ fixer_namer r r Z__exclude_fixers8s     zMixin2to3.__exclude_fixersN)F)rrrrrrr r r r rs  r) __doc__Zdistutils.utilrrZ distutilsrZlib2to3.refactorrrrrr r r r s    PK!B1rr$__pycache__/extension.cpython-36.pycnu[3 vh@s|ddlZddlZddlZddlZddlZddlmZddlm Z ddZ e Z e ej j ZGdddeZ Gd d d e ZdS) N)map) get_unpatchedc Cs2d}yt|dgdjdStk r,YnXdS)z0 Return True if Cython can be imported. zCython.Distutils.build_ext build_ext)fromlistTF) __import__r Exception)Z cython_implr /usr/lib/python3.6/extension.py _have_cython sr c@s eZdZdZddZddZdS) Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs(|jdd|_tj|||f||dS)Npy_limited_apiF)popr _Extension__init__)selfnamesourcesargskwr r r r#szExtension.__init__cCsNtr dS|jpd}|jdkr$dnd}tjtjd|}tt||j |_ dS)z Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Nzc++z.cppz.cz.pyx$) r Zlanguagelower functoolspartialresublistrr)rZlangZ target_extrr r r _convert_pyx_sources_to_lang)s  z&Extension._convert_pyx_sources_to_langN)__name__ __module__ __qualname____doc__rrr r r r r sr c@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)rrr r!r r r r r"8sr")rrZdistutils.coreZ distutilsZdistutils.errorsZdistutils.extensionZsetuptools.extern.six.movesrZmonkeyrr Z have_pyrexZcorer rr"r r r r s   PK!\ƏƏ__pycache__/dist.cpython-36.pycnu[3 vhu@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Z ddl m Z ddl mZmZmZddlmZddlmZddlmZddlmZdd lmZmZmZdd lmZdd lmZdd l m!Z!dd l"m#Z#ddl$Z$ddl%m&Z&e'de'dddZ(ddZ)ddZ*e+e,fZ-ddZ.ddZ/ddZ0ddZ1d d!Z2d"d#Z3d$d%Z4d&d'Z5d(d)Z6d*d+Z7d,d-Z8d.d/Z9e!ej:j;ZZ parse_maprCr)rEr8rFerrrcheck_entry_pointssrhcCst|tjstddS)Nztest_suite must be a string)rbr Z string_typesr)rEr8rFrrrcheck_test_suites ric Csdt|trTxH|jD]8\}}t|ts(Py t|Wqtk rJPYqXqWdSt|ddS)z@Verify that value is a dictionary of package names to glob listsNzI must be a dictionary mapping package names to lists of wildcard patterns)rbrcr2striterrBr)rEr8rFkvrrrcheck_package_datas    rncCs,x&|D]}tjd|stjjd|qWdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrNrOr)rEr8rFZpkgnamerrrcheck_packagess   rqc@s0eZdZdZdeedZdZddZdGddZ dd Z d d Z e d d Z ddZddZdHddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Z d5d6Z!d7d8Z"d9d:Z#d;d<Z$d=d>Z%d?d@Z&dAdBZ'dCdDZ(dEdFZ)dS)IraDistribution with support for features, tests, and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'features' **deprecated** -- a dictionary mapping option names to 'setuptools.Feature' objects. Features are a portion of the distribution that can be included or excluded based on user options, inter-feature dependencies, and availability on the current system. Excluded features are omitted from all setup commands, including source and binary distributions, so you can create multiple distributions from the same source tree. Feature names should be valid Python identifiers, except that they may contain the '-' (minus) sign. Features can be included or excluded via the command line options '--with-X' and '--without-X', where 'X' is the name of the feature. Whether a feature is included by default, and whether you are allowed to control this from the command line, is determined by the Feature object. See the 'Feature' class for more information. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. They are used by the feature subsystem to configure the distribution for the included and excluded features. N)rr1rcCsp| sd|ksd|krdStjt|dj}tjjj|}|dk rl|jd rltjt|d|_ ||_ dS)Nr[r7zPKG-INFO) r=Z safe_namerjlower working_setZby_keygetZ has_metadataZ safe_versionZ_version _patched_dist)r5attrskeyrErrrpatch_missing_pkg_infoSsz#Distribution.patch_missing_pkg_infoc std}|si_|pi}d|ks,d|kr4tjg_i_g_|jdd_j ||jdg_ |jdg_ x$t j dD]}tj|jdqWtjfdd |jDx\jjD]N\}}x6jj|fD]}||kr||}PqW|r|nd}tj||qWtjjtjr>tjjj_jjdk ryHtjjjj}t|} jj| krtj d jj| f| j_Wn0tjj!t"fk rtj d jjYnXj#dS) N package_datafeaturesrequire_featuressrc_rootdependency_linkssetup_requireszdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA).0rlrm)r5rr qsz)Distribution.__init__..zNormalizing '%s' to '%s'zThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)$r4ryFeaturewarn_deprecatedr{rzZ dist_filespopr|rxr}r~r=iter_entry_pointsvars setdefaultr[ _Distribution__init__r2rmetadata__dict__setattrrbr7numbersNumberrjr ZVersionrrZInvalidVersionrB_finalize_requires) r5rvZhave_package_datarGZoptiondefaultsourcerFZverZnormalized_versionr)r5rr`sR    zDistribution.__init__cCsjt|ddr|j|j_t|ddrVx2|jjD]$}|jdd}|r.|jjj|q.W|j|j dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. rNextras_requirerXr) r rrrkeyssplitradd_convert_extras_requirements"_move_install_requirements_markers)r5r;rrrrs   zDistribution._finalize_requirescCspt|ddpi}tt|_xP|jD]D\}}|j|x0tj|D]"}|j|}|j||j|qBWq$WdS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r rrS_tmp_extras_requirer2r=rZ _suffix_forappend)r5Z spec_ext_reqsZsectionrmrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rXrI)r\rj)reqrrrrszDistribution._suffix_forcsdd}tddpf}ttj|}t||}t||}ttt|_x&|D]}j dt|j j |qPWt fddj j D_dS)zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j S)N)r\)rrrr is_simple_reqszFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrXc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rj)rrrrr szMDistribution._move_install_requirements_markers...N)r _clean_req)rrlrm)r5rr szBDistribution._move_install_requirements_markers..)r rSr=rZr r r rjrrr\rrcr2r)r5rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrr)r5rrs     z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. N)r\)r5rrrrrszDistribution._clean_reqFcCs*tj||dt||j|d|jdS)zYParses configuration files from various levels and loads configuration. ) filenames)ignore_option_errorsN)rparse_config_filesrcommand_optionsr)r5rrrrrrszDistribution.parse_config_filescCstj|}|jr|j|S)z3Process features after parsing command line options)rparse_command_linerz_finalize_features)r5resultrrrrs zDistribution.parse_command_linecCsd|jddS)z;Convert feature name to corresponding option attribute nameZwith_-_)replace)r5r[rrr_feature_attrnameszDistribution._feature_attrnamecCs<tjjtj||jdd}x|D]}tjj|ddq W|S)zResolve pre-setup requirementsT) installerZreplace_conflicting)r)r=rsresolverZfetch_build_eggr)r5r!Zresolved_distsrErrrfetch_build_eggss zDistribution.fetch_build_eggscCstj||jr|jxHtjdD]:}t||jd}|dk r$|j|j d|j ||j|q$Wt|ddrdd|j D|_ ng|_ dS)Nzdistutils.setup_keywords)rconvert_2to3_doctestscSsg|]}tjj|qSr)ospathabspath)rprrrrsz1Distribution.finalize_options..) rfinalize_optionsrz_set_global_opts_from_featuresr=rr r[requirerloadr)r5rGrFrrrrs  zDistribution.finalize_optionsc Csvtjjtjd}tjj|srtj|tj|tjj|d}t|d$}|j d|j d|j dWdQRX|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) rrr3curdirexistsmkdirrZ hide_fileopenr/)r5Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirs      zDistribution.get_egg_cache_dirc Csddlm}|jddgi}|jd}|j|jdd|jdjD|jr|jdd}d|krx|dd |}d |f|d<|j}||d g|d d dd d d d d d }|j |j|S)z Fetch an egg needed for buildingr) easy_installZ script_argsrcss"|]\}}|dkr||fVqdS) find_links site_dirs index_urloptimize allow_hostsN)rrrrrrr)rrlrmrrrr1sz/Distribution.fetch_build_egg..NrrZsetupxTF) args install_dirZexclude_scriptsZ always_copyZbuild_directoryZeditableZupgradeZ multi_versionZ no_reportuser) Zsetuptools.command.easy_installr __class__get_option_dictclearupdater2r}rZensure_finalized)r5rrrEoptsZlinksrcmdrrrr*s(   zDistribution.fetch_build_eggc Csg}|jj}x|jjD]\}}|j|d|j||jr|j}d}d}|js^||}}d|dd||fd|dd||ff}|j |d||d|<qW||j |_ |_ ||_|_ dS)z;Add --with-X/--without-X options based on optional featuresNz (default)rIzwith-zinclude zwithout-zexclude ) negative_optcopyrzr2 _set_featurevalidateoptional descriptioninclude_by_defaultextendglobal_optionsZfeature_optionsZfeature_negopt) r5Zgonor[featuredescrZincdefZexcdefnewrrrrGs"     z+Distribution._set_global_opts_from_featurescCsxJ|jjD]<\}}|j|}|s2|dkr |jr |j||j|dq Wx6|jjD](\}}|j|sX|j||j|dqXWdS)z9Add/remove features and resolve dependencies between themNrr)rzr2feature_is_includedr include_inr exclude_from)r5r[rZenabledrrrrbs    zDistribution._finalize_featurescCs`||jkr|j|Stjd|}x:|D]&}|j|jd|j|j|<}|SWtj||SdS)z(Pluggable version of get_command_class()zdistutils.commands)rN)cmdclassr=rrrrrget_command_class)r5commandZepsrGrrrrrss    zDistribution.get_command_classcCs>x2tjdD]$}|j|jkr |j}||j|j<q Wtj|S)Nzdistutils.commands)r=rr[rrrprint_commands)r5rGrrrrrs  zDistribution.print_commandscCs>x2tjdD]$}|j|jkr |j}||j|j<q Wtj|S)Nzdistutils.commands)r=rr[rrrget_command_list)r5rGrrrrrs  zDistribution.get_command_listcCst||j||dS)zSet feature's inclusion statusN)rr)r5r[ZstatusrrrrszDistribution._set_featurecCst||j|S)zAReturn 1 if feature is included, 0 if excluded, 'None' if unknown)r r)r5r[rrrrsz Distribution.feature_is_includedcCsF|j|dkr&|j|j}t|d|j|j||j|ddS)z)Request inclusion of feature named 'name'rz2 is required, but was excluded or is not availablerN)rrzrrrr)r5r[rrrrinclude_features   zDistribution.include_featurecKsDx>|jD]2\}}t|d|d}|r0||q |j||q WdS)aAdd items to distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. Z _include_N)r2r _include_misc)r5rvrlrmincluderrrrs  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagerKcs$g|]}|kr|j r|qSr) startswith)rr)packagepfxrrrsz0Distribution.exclude_package..cs$g|]}|kr|j r|qSr)r)rr)rrrrrscs(g|] }|jkr|jj r|qSr)r[r)rr)rrrrrsN)packages py_modules ext_modules)r5rr)rrrexclude_packageszDistribution.exclude_packagecCs4|d}x&|jD]}||ks(|j|rdSqWdS)z.)rbsequencerr rDr)r5r[rFoldr)rFr _exclude_miscs  zDistribution._exclude_miscc st|tstd||fyt||Wn tk rHtd|YnXdkr`t|||n:ttsxt|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|kr|qSrr)rr)rrrrsz.Distribution._include_misc..)rbrrr rDr)r5r[rFrr)rrrs   zDistribution._include_misccKsDx>|jD]2\}}t|d|d}|r0||q |j||q WdS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. Z _exclude_N)r2r r)r5rvrlrmexcluderrrrs  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rbrrrSr r)r5rrrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|jd}xB||krh||\}}||=ddl}|j|d|dd<|d}q(Wtj|||}|j|} t | ddrd|f|j|d<|dk rgS|S)NraliasesTrZcommand_consumes_argumentsz command liner) rrrrshlexrr_parse_command_optsrr ) r5parserrrrsrcaliasrnargsZ cmd_classrrrr s"        z Distribution._parse_command_optsc Csi}x|jjD]\}}x|jD]\}\}}|dkr8q"|jdd}|dkr|j|}|jj}|jt|dix<|jD]\} } | |kr|| }d}Pq|Wtdn |dkrd}||j |i|<q"WqW|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. z command linerrrrNzShouldn't be able to get herer) rr2rZget_command_objrrrr rAr) r5drroptrvalZcmdobjZneg_optnegposrrrget_cmdline_options:s(     z Distribution.get_cmdline_optionsccsx|jp fD] }|Vq Wx|jp$fD] }|Vq&WxH|jp>fD]:}t|trX|\}}n|j}|jdrt|dd}|Vq@WdS)z@Yield all packages, modules, and extension names in distributionmoduleNi)rrrrbtupler[endswith)r5ZpkgrZextr[Z buildinforrrrbs      z$Distribution.iter_distribution_namescCsddl}tjs|jr tj||Sddl}t|j|j sBtj||S|jj j dkr^tj||S|jj }|jj }|j dkr|dp~d}|jj}|j |jjd||||_z tj||S|j |jj|||||_XdS)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rNutf-8utf8Zwin32 )r r )sysr r0Z help_commandsrhandle_display_optionsiorbstdout TextIOWrapperencodingrrerrorsr:line_bufferingdetach)r5Z option_orderr rrrnewlinerrrrr ts$     z#Distribution.handle_display_options)N)NF)*__name__ __module__ __qualname____doc__rcrdrrurxrrr staticmethodrrrrrrrrrrrrrrrrrrrrrLrrrrrrrr rrrrrsLB ;      (c@sPeZdZdZeddZdddfffddZdd Zd d Zd d Z ddZ dS)ra **deprecated** -- The `Feature` facility was never completely implemented or supported, `has reported issues `_ and will be removed in a future version. A subset of the distribution that can be excluded if unneeded/wanted Features are created using these keyword arguments: 'description' -- a short, human readable description of the feature, to be used in error messages, and option help messages. 'standard' -- if true, the feature is included by default if it is available on the current system. Otherwise, the feature is only included if requested via a command line '--with-X' option, or if another included feature requires it. The default setting is 'False'. 'available' -- if true, the feature is available for installation on the current system. The default setting is 'True'. 'optional' -- if true, the feature's inclusion can be controlled from the command line, using the '--with-X' or '--without-X' options. If false, the feature's inclusion status is determined automatically, based on 'availabile', 'standard', and whether any other feature requires it. The default setting is 'True'. 'require_features' -- a string or sequence of strings naming features that should also be included if this feature is included. Defaults to empty list. May also contain 'Require' objects that should be added/removed from the distribution. 'remove' -- a string or list of strings naming packages to be removed from the distribution if this feature is *not* included. If the feature *is* included, this argument is ignored. This argument exists to support removing features that "crosscut" a distribution, such as defining a 'tests' feature that removes all the 'tests' subpackages provided by other features. The default for this argument is an empty list. (Note: the named package(s) or modules must exist in the base distribution when the 'setup()' function is initially called.) other keywords -- any other keyword arguments are saved, and passed to the distribution's 'include()' and 'exclude()' methods when the feature is included or excluded, respectively. So, for example, you could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be added or removed from the distribution as appropriate. A feature must include at least one 'requires', 'remove', or other keyword argument. Otherwise, it can't affect the distribution in any way. Note also that you can subclass 'Feature' to create your own specialized feature types that modify the distribution in other ways when included or excluded. See the docstrings for the various methods here for more detail. Aside from the methods, the only feature attributes that distributions look at are 'description' and 'optional'. cCsd}tj|tdddS)NzrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.) stacklevel)rrr)msgrrrrszFeature.warn_deprecatedFTc Ks|j||_||_||_||_t|ttfr4|f}dd|D|_dd|D}|r^||d<t|trn|f}||_ ||_ | r| r| rt ddS)NcSsg|]}t|tr|qSr)rbrj)rrrrrrsz$Feature.__init__..cSsg|]}t|ts|qSr)rbrj)rrrrrrsr{zgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.) rrstandard availablerrbrjrr{remover@r) r5rrrrr{r r@Zerrrrrs$ zFeature.__init__cCs |jo |jS)z+Should this feature be included by default?)rr)r5rrrrszFeature.include_by_defaultcCs@|jst|jd|jf|jx|jD]}|j|q*WdS)aEnsure feature and its requirements are included in distribution You may override this in a subclass to perform additional operations on the distribution. Note that this method may be called more than once per feature, and so should be idempotent. z3 is required, but is not available on this platformN)rrrrr@r{r)r5rErrrrrs   zFeature.include_incCs2|jf|j|jr.x|jD]}|j|qWdS)a2Ensure feature is excluded from distribution You may override this in a subclass to perform additional operations on the distribution. This method will be called at most once per feature, and only after all included features have been asked to include themselves. N)rr@r r)r5rErrrrrs  zFeature.exclude_fromcCs2x,|jD]"}|j|std|j||fqWdS)aVerify that feature makes sense in context of distribution This method is called by the distribution just before it parses its command line. It checks to ensure that the 'remove' attribute, if any, contains only valid package/module names that are present in the base distribution when 'setup()' is called. You may override it in a subclass to perform any other required validation of the feature against a target distribution. zg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN)r rLrr)r5rErrrrrs  zFeature.validateN) rrrrrrrrrrrrrrrrs7 r)>__all__rorrrZ distutils.logrNZdistutils.coreZ distutils.cmdZdistutils.distrT collectionsrZdistutils.errorsrrrZdistutils.utilrZdistutils.versionrZsetuptools.externr r Zsetuptools.extern.six.movesr r r Zsetuptools.dependsrZ setuptoolsrZsetuptools.monkeyrZsetuptools.configrr=Z py36compatr __import__rr#r<rrSrrHrJrRrWrVr`rerfrhrirnrqZcorerrrrrrrs`          G     PK!S }==&__pycache__/ssl_support.cpython-36.pycnu[3 vh,!"@sddlZddlZddlZddlZddlZddlmZmZmZm Z ddl m Z m Z y ddl Z Wnek rtdZ YnXdddddgZd jjZyejjZejZWnek reZZYnXe dk oeeefkZydd l mZmZWnRek r:ydd lmZdd lmZWnek r4dZdZYnXYnXesRGd ddeZesjdddZddZGdddeZGdddeZd ddZ ddZ!e!ddZ"ddZ#ddZ$dS)!N)urllib http_clientmapfilter)ResolutionErrorExtractionErrorVerifyingHTTPSHandlerfind_ca_bundle is_available cert_paths opener_fora /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt /usr/share/ssl/certs/ca-bundle.crt /usr/local/share/certs/ca-root.crt /etc/ssl/cert.pem /System/Library/OpenSSL/certs/cert.pem /usr/local/share/certs/ca-root-nss.crt /etc/ssl/ca-bundle.pem )CertificateErrormatch_hostname)r )rc@s eZdZdS)r N)__name__ __module__ __qualname__rr!/usr/lib/python3.6/ssl_support.pyr 5sr c Csg}|s dS|jd}|d}|dd}|jd}||krLtdt||s`|j|jkS|dkrt|jdn>|jd s|jd r|jtj|n|jtj|j d d x|D]}|jtj|qWtj d d j |dtj } | j |S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsZfragZpatrrr_dnsname_match;s*     r&cCs|s tdg}|jdf}x0|D](\}}|dkr"t||r@dS|j|q"W|sxF|jdfD]6}x0|D](\}}|dkrjt||rdS|j|qjWq`Wt|dkrtd|d jtt|fn*t|dkrtd ||d fntd dS) a=Verify that *cert* (in decoded format as returned by SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 and RFC 6125 rules are followed, but IP addresses are not accepted for *hostname*. CertificateError is raised on failure. On success, the function returns nothing. zempty or no certificateZsubjectAltNameZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetr&rlenr r!rr)Zcertr$ZdnsnamesZsankeyvaluesubrrrros.     rc@s eZdZdZddZddZdS)rz=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|dS)N) ca_bundle HTTPSHandler__init__)selfr-rrrr/szVerifyingHTTPSHandler.__init__csjfdd|S)Ncst|jf|S)N)VerifyingHTTPSConnr-)hostkw)r0rrsz2VerifyingHTTPSHandler.https_open..)Zdo_open)r0Zreqr)r0r https_opensz VerifyingHTTPSHandler.https_openN)rrr__doc__r/r5rrrrrsc@s eZdZdZddZddZdS)r1z@Simple verifying connection: no auth, subclasses, timeouts, etc.cKstj||f|||_dS)N)HTTPSConnectionr/r-)r0r2r-r3rrrr/szVerifyingHTTPSConn.__init__c Cstj|j|jft|dd}t|drHt|ddrH||_|j|j}n|j}tt drxt j |j d}|j ||d|_nt j |t j |j d|_yt|jj|Wn.tk r|jjtj|jjYnXdS)NZsource_address_tunnel _tunnel_hostcreate_default_context)Zcafile)Zserver_hostname)Z cert_reqsZca_certs)socketZcreate_connectionr2Zportgetattrhasattrsockr8r9sslr:r-Z wrap_socketZ CERT_REQUIREDrZ getpeercertr ZshutdownZ SHUT_RDWRclose)r0r>Z actual_hostZctxrrrconnects$  zVerifyingHTTPSConn.connectN)rrrr6r/rArrrrr1sr1cCstjjt|ptjS)z@Get a urlopen() replacement that uses ca_bundle for verification)rrequestZ build_openerrr open)r-rrrr scstjfdd}|S)Ncstds||_jS)Nalways_returns)r=rD)argskwargs)funcrrwrappers  zonce..wrapper) functoolswraps)rGrHr)rGroncesrKc sXy ddl}Wntk r dSXGfddd|j}|jd|jd|jS)Nrcs,eZdZfddZfddZZS)z"get_win_certfile..CertFilecst|jtj|jdS)N)superr/atexitregisterr@)r0)CertFile __class__rrr/sz+get_win_certfile..CertFile.__init__c s,yt|jWntk r&YnXdS)N)rLr@OSError)r0)rOrPrrr@sz(get_win_certfile..CertFile.close)rrrr/r@ __classcell__r)rO)rPrrOsrOZCAZROOT) wincertstore ImportErrorrOZaddstorename)rSZ _wincertsr)rOrget_win_certfiles    rVcCs$ttjjt}tp"t|dp"tS)z*Return an existing CA bundle path, or NoneN)rospathisfiler rVnext_certifi_where)Zextant_cert_pathsrrrr s c Cs,y tdjStttfk r&YnXdS)NZcertifi) __import__whererTrrrrrrr[s r[)r)N)%rWr;rMrrIZsetuptools.extern.six.movesrrrrZ pkg_resourcesrrr?rT__all__striprr rBr.r7AttributeErrorobjectr r rZbackports.ssl_match_hostnamer'r&rr1r rKrVr r[rrrrsP      4) (   PK!WƖ+__pycache__/site-patch.cpython-36.opt-1.pycnu[3 vh @sddZedkre[dS)cCsddl}ddl}|jjd}|dks4|jdkr:| r:g}n |j|j}t|di}|jt |d}|jj t }x|D]}||ksv| rqv|j|}|dk r|j d}|dk r|j dPqvy ddl} | j d|g\} } } Wntk rwvYnX| dkrqvz| j d| | | Wd| jXPqvWtdtdd|jD} t|d d}d|_x|D]}t|qXW|j|7_t|d\}}d}g}xl|jD]b}t|\}}||kr|dkrt |}|| ks|dkr|j|n|j|||d 7}qW||jdd<dS) N PYTHONPATHZwin32path_importer_cachesitez$Couldn't find the real 'site' modulecSsg|]}t|ddfqS))makepath).0itemr /usr/lib/python3.6/site-patch.py )sz__boot.. __egginsertr)sysosenvirongetplatformsplitpathsepgetattrpathlendirname__file__ find_module load_moduleimp ImportErrorclosedictr addsitedirrappendinsert)r rrZpicZstdpathZmydirrZimporterloaderrstreamrZdescr known_pathsZoldposdZndZ insert_atnew_pathpZnpr r r __boots`               r(rN)r(__name__r r r r sGPK!'__pycache__/monkey.cpython-36.opt-1.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl m Z ddl Z gZ ddZddZd d Zd d Zd dZddZddZddZdS)z Monkey patching of distutils. N) import_module)sixcCs"tjdkr|f|jStj|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. ZJython)platformZpython_implementation __bases__inspectZgetmro)clsr/usr/lib/python3.6/monkey.py_get_mros  r cCs0t|tjrtnt|tjr tndd}||S)NcSsdS)Nr)itemrrr *szget_unpatched..) isinstancerZ class_typesget_unpatched_classtypes FunctionTypeget_unpatched_function)r lookuprrr get_unpatched&srcCs:ddt|D}t|}|jjds6d|}t||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css|]}|jjds|VqdS) setuptoolsN) __module__ startswith).0rrrr 6sz&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextrrAssertionError)rZexternal_basesbasemsgrrr r/s  rcCstjtj_tjd k}|r"tjtj_tjd kpxd tjko@dknpxdtjkoZdknpxdtjkotdkn}|rd }|tjj _ t x"tj tjtj fD]}tj j|_qWtjjtj_tjjtj_d tjkrtjjtjd _tdS)N rzhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rrr)r r!r")rr)rrr!)rr#)rr#r$)rr)rrr)rZCommandrZcoresys version_infofindallZfilelistconfigZ PyPIRCCommandZDEFAULT_REPOSITORY+_patch_distribution_metadata_write_pkg_filedistcmdZ Distribution extensionZ Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehousemodulerrr patch_allAs&        r0cCstjjtjj_dS)zDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN)rr*Zwrite_pkg_filerZDistributionMetadatarrrr r)jsr)cCs*t||}t|jd|t|||dS)z Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. unpatchedN)getattrvars setdefaultsetattr)Z replacementZ target_mod func_nameoriginalrrr patch_funcqs r8cCs t|dS)Nr1)r2) candidaterrr rsrcstdtjdkrdSfdd}tj|d}tj|d}yt|dt|d Wntk rlYnXyt|d Wntk rYnXyt|d Wntk rYnXdS) z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcZWindowsNcsLd|kr dnd}||jd}t|}t|}t||sBt||||fS)zT Prepare the parameters for patch_func to patch indicated function. msvc9Zmsvc9_Zmsvc14__)lstripr2rhasattr ImportError)Zmod_namer6Z repl_prefixZ repl_namereplmod)msvcrr patch_paramss  z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ _get_vc_envZgen_lib_options)rrsystem functoolspartialr8r>)rBr:Zmsvc14r)rAr r.s&    r.)__doc__r%Zdistutils.filelistrrrrD importlibrrZsetuptools.externrr__all__r rrr0r)r8rr.rrrr s$   )PK! ii+__pycache__/pep425tags.cpython-36.opt-1.pycnu[3 vhy*@sdZddlmZddlZddlmZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZejdZd d Zd d Zd dZddZddZd#ddZddZddZddZddZddZd$d!d"ZeZdS)%z2Generate and work with PEP 425 Compatibility Tags.)absolute_importN)log) OrderedDict)glibcz(.+)_(\d+)_(\d+)_(.+)cCsBy tj|Stk r<}ztjdj|tdSd}~XnXdS)Nz{}) sysconfigget_config_varIOErrorwarningswarnformatRuntimeWarning)varer /usr/lib/python3.6/pep425tags.pyrs  rcCs:ttdrd}n&tjjdr"d}ntjdkr2d}nd}|S)z'Return abbreviated implementation name.pypy_version_infoppjavaZjyZcliZipcp)hasattrsysplatform startswith)Zpyimplrrr get_abbr_impls   rcCs.td}| stdkr*djttt}|S)zReturn implementation version.py_version_nodotr)rrjoinmapstrget_impl_version_info)Zimpl_verrrr get_impl_ver)sr!cCs:tdkr"tjdtjjtjjfStjdtjdfSdS)zQReturn sys.version_info-like tuple for use in decrementing the minor version.rrrN)rr version_informajorminorrrrrr 1s  r cCsdjttS)z; Returns the Tag for this specific implementation. z{}{})r rr!rrrr get_impl_tag<sr%TcCs.t|}|dkr&|r tjd||S||kS)zgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)rrdebug)rZfallbackexpectedr valrrrget_flagCsr)cstd}t| rdkrttdrd}d}d}tddddkd rLd }td fd ddkd rjd }tdddddkotjdkdrtjdkrd}dt|||f}n@|r|jdrd|jdd}n|r|j ddj dd}nd}|S)zXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).SOABIrr maxunicoderPy_DEBUGcSs ttdS)Ngettotalrefcount)rrrrrrYszget_abi_tag..)r d WITH_PYMALLOCcsdkS)Nrrr)implrrr.]smZPy_UNICODE_SIZEcSs tjdkS)Ni)rr+rrrrr.as)r'r uz %s%s%s%s%szcpython--r._N>rr)r4r4)r4r4) rrrrr)r"r!rsplitreplace)Zsoabir/r2r5abir)r1r get_abi_tagOs8    r<cCs tjdkS)Ni)rmaxsizerrrr_is_running_32bitqsr>cCstjdkr^tj\}}}|jd}|dkr6tr6d}n|dkrHtrHd}dj|d|d |Stjjj dd j d d }|d krtrd }|S)z0Return our platform name 'win32', 'linux_x86_64'darwinr7x86_64i386ppc64ppczmacosx_{}_{}_{}rrr8r6 linux_x86_64 linux_i686) rrZmac_verr9r>r distutilsutil get_platformr:)releaser8machineZ split_verresultrrrrHus  rHc CsFtdkrdSyddl}t|jSttfk r8YnXtjddS)NrDrEFr>rDrE)rH _manylinuxboolZmanylinux1_compatible ImportErrorAttributeErrorrZhave_compatible_glibc)rNrrris_manylinux1_compatibles  rRcsvg}fddtd dddg|||r8|j|x.D]&}||kr>|||r>|j|q>W|jd |S)zReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. cs~|dkr||fd kS|dkr(||fd kS|dkr<||fd kS|dkrP||fd kS|krzx |D]}|||rbdSqbWd S)NrC rMrBrAr3r@TF)rSrM)rSrM)rSr3)rSrMr)r#r$archgarch)_supports_archgroupsrrrVs     z)get_darwin_arches.._supports_archfatrArCintelr@fat64rBfat32Z universalrArC)rXr\r@rA)rYr]r@rB)rZr^r@rArC)r[r_)rappend)r#r$rJarchesrUr)rVrWrget_darwin_archess$    rbFcCsg}|dkrXg}t}|dd}x4t|dddD] }|jdjtt||fq4W|p`t}g} |pnt}|r|g| dd<t} ddl } x8| j D],} | dj dr| j | dj dddqW| jtt| | jd|sx|pt} | j d rtj| }|r|j\}}}}d j||}g}xTttt|dD]4}x,tt|||D]}|j|||fq^WqHWn| g}n*|dkrtr| jd d | g}n| g}x:| D]2}x*|D]"} |jd ||df|| fqWqWxZ|ddD]J}|dkrPx6| D].}x&|D]} |jd ||f|| fqWqWqWx*|D]"} |jd|ddd| fqRW|jd ||dfddf|jd ||ddfddfxNt|D]B\}}|jd|fddf|dkr|jd|dddfqW|S)acReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. Nrrrz.abir7rLZnoneZmacosxz {}_{}_%i_%slinuxZ manylinux1z%s%s3130zpy%sanyrgrgrg>rdre)r ranger`rrrrr<setimpZ get_suffixesraddr9extendsortedlistrH _osx_arch_patmatchrWr reversedintrbrRr: enumerate)ZversionsZnoarchrr1r;Z supportedr"r#r$ZabisZabi3srjsuffixrTrpnameZ actual_archZtplrar2aversionirrr get_supportedsh            (   * "  ry)TT)NFNNN)__doc__Z __future__rZdistutils.utilrFrrrerrr collectionsrrrcompilerorrr!r r%r)r<r>rHrRrbryZimplementation_tagrrrrs2        "= _PK!dkS &__pycache__/glibc.cpython-36.opt-1.pycnu[3 vhJ @sHddlmZddlZddlZddlZddZddZddZd d ZdS) )absolute_importNc CsPtjd}y |j}Wntk r(dSXtj|_|}t|tsL|jd}|S)z9Returns glibc version string, or None if not using glibc.Nascii) ctypesZCDLLgnu_get_libc_versionAttributeErrorZc_char_pZrestype isinstancestrdecode)Zprocess_namespacer version_strr /usr/lib/python3.6/glibc.pyglibc_version_string s    r cCsHtjd|}|s$tjd|tdSt|jd|koFt|jd|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFmajorminor)rematchwarningswarnRuntimeWarningintgroup)r required_major minimum_minormr r r check_glibc_version$s  rcCst}|dkrdSt|||S)NF)r r)rrr r r r have_compatible_glibc4srcCst}|dkrdSd|fSdS)zTry to determine the glibc version Returns a tuple of strings (lib, version) which default to empty strings in case the lookup fails. NZglibc)rr)r )Z glibc_versionr r r libc_verLsr) Z __future__rrrrr rrrr r r r s PK!SB&=&="__pycache__/sandbox.cpython-36.pycnu[3 vh7 @sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejjdrddljjjjZn ejejZyeZWnek rdZYnXeZddlm Z ddlm!Z!ddd d gZ"d-d d Z#ej$d.d dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d Z2Gd&ddZ3e4ed'rej5gZ6ngZ6Gd(dde3Z7ej8ej9d)d*d+j:DZ;Gd,d d e Z)r;r2r3rrrresumes zExceptionSaver.resumeN)r5r6r7r8r<r@rCrrrrr:rs r:c #sVtjjt }VWdQRXtjjfddtjD}t||jdS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3s&|]}|kr|jd r|VqdS)z encodings.N) startswith).0mod_name)rrr szsave_modules..)rmodulescopyr:update_clear_modulesrC) saved_excZ del_modulesr)rr save_moduless  rMcCsxt|D] }tj|=q WdS)N)listrrH)Z module_namesrFrrrrKsrKc cs$tj}z |VWdtj|XdS)N)r" __getstate__ __setstate__)rrrrsave_pkg_resources_states rQc,cstjj|d}txtfttNt<t|(t |t ddVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)NZtempZ setuptools) r&rjoinrQrMhide_setuptoolsr rr%r* __import__) setup_dirZtemp_dirrrr setup_contexts  rVcCstjd}t|j|S)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rFpatternrrr _needs_hidings r[cCstttj}t|dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N)filterr[rrHrK)rHrrrrSs rScCstjjtjj|}t|y|gt|tjdd<tjjd|t j t j j ddt |trl|n |jtj}t|t|dd}t||WdQRXWn4tk r}z|jr|jdrʂWYdd}~XnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|jS)N)Zactivate)Zdistrrrszrun_setup..__main__)__file__r5)r&rabspathdirnamerVrNrrinsertr__init__Z callbacksappend isinstancestrencodegetfilesystemencodingr dictr SystemExitargs)Z setup_scriptrkrUZ dunder_filensvrrrr s   c@s2eZdZdZdZddZddZddZd d Zd d Z d dZ x$d9D]Z e e e rFe e ee <qFWd:ddZer~edeZedeZx$d;D]Z e e e ree ee <qWd)d*Zx$drzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs&g|]}|jd rt|r|qS)_)rDhasattr)rEname)r;rr sz,AbstractSandbox.__init__..)dir_os_attrs)r;r)r;rrcszAbstractSandbox.__init__cCs&x |jD]}tt|t||qWdS)N)rtsetattrr&getattr)r;sourcerprrr_copy s zAbstractSandbox._copycCs(|j|tr|jt_|jt_d|_dS)NT)rx_filerfile_openr_active)r;rrrr<s  zAbstractSandbox.__enter__cCs$d|_trtt_tt_|jtdS)NF)r|ryrrzr{rrxrs)r;exc_type exc_value tracebackrrrr@s zAbstractSandbox.__exit__c Cs||SQRXdS)zRun 'func' under os sandboxingNr)r;funcrrrrunszAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||S)N)r| _remap_pair)r;srcdstrkkw)rporiginalrrwrap&sz3AbstractSandbox._mk_dual_path_wrapper..wrap)rvrs)rprr)rprr_mk_dual_path_wrapper#s z%AbstractSandbox._mk_dual_path_wrapperrenamelinksymlinkNcs p ttfdd}|S)Ncs*|jr|j|f||}|f||S)N)r| _remap_input)r;rrkr)rprrrr4sz5AbstractSandbox._mk_single_path_wrapper..wrap)rvrs)rprrr)rprr_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperrzrstatlistdirr(chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstat startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}|j|f||S|f||S)N)r|r _remap_output)r;rrkr)rprrrrIsz4AbstractSandbox._mk_single_with_return..wrap)rvrs)rprr)rprr_mk_single_with_returnFs z&AbstractSandbox._mk_single_with_returnreadlinktempnamcsttfdd}|S)Ncs ||}|jr|j|S|S)N)r|r)r;rkrZretval)rprrrrXs  z'AbstractSandbox._mk_query..wrap)rvrs)rprr)rprr _mk_queryUs zAbstractSandbox._mk_queryr'tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r;rrrr_validate_pathdszAbstractSandbox._validate_pathcOs |j|S)zCalled for path inputs)r)r; operationrrkrrrrrhszAbstractSandbox._remap_inputcCs |j|S)zCalled for path outputs)r)r;rrrrrrlszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r)r;rrrrkrrrrrpszAbstractSandbox._remap_pair)rrr)N)rrr(rrrrrrrrrrrrrrrr)rr)r'r)r5r6r7r8r|rcrxr<r@rrrprorsrrryr{rrrrrrrrrrrsB          devnullc@seZdZdZejdddddddd d d d d dg ZdgZefddZ ddZ e rXd'ddZ d(ddZ ddZ ddZddZdd Zd!d"Zd)d$d%Zd&S)*r z.) r&rrr_sandboxrR_prefix _exceptionsrrc)r;Zsandbox exceptionsrrrrcs  zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r )r/r )r;rrkrr rrr _violations zDirectorySandbox._violationrcOs<|dkr*|j| r*|jd||f||t||f||S)Nrrtr rUUrz)rrr rr)_okrry)r;rrrkrrrrryszDirectorySandbox._filecOs<|dkr*|j| r*|jd||f||t||f||S)Nrrr rrr)rrr rr)rrr{)r;rrrkrrrrr{szDirectorySandbox._opencCs|jddS)Nr)r)r;rrrrszDirectorySandbox.tmpnamc CsN|j}z:d|_tjjtjj|}|j|p@||jkp@|j|jS||_XdS)NF) r|r&rrr _exemptedrrDr)r;rZactiverrrrrs   zDirectorySandbox._okcs<fdd|jD}fdd|jD}tj||}t|S)Nc3s|]}j|VqdS)N)rD)rEZ exception)filepathrrrGsz-DirectorySandbox._exempted..c3s|]}tj|VqdS)N)rWrY)rErZ)rrrrGs)r_exception_patterns itertoolschainany)r;rZ start_matchesZpattern_matchesZ candidatesr)rrrs      zDirectorySandbox._exemptedcOs6||jkr2|j| r2|j|tjj|f|||S)zCalled for path inputs) write_opsrrr&rr)r;rrrkrrrrrszDirectorySandbox._remap_inputcOs6|j| s|j| r.|j|||f||||fS)z?Called for path pairs like rename, link, and symlink operations)rr)r;rrrrkrrrrrszDirectorySandbox._remap_paircOsB|t@r,|j| r,|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open) WRITE_FLAGSrrrsr)r;rzflagsrrkrrrrrszDirectorySandbox.openN)r)r)r)r5r6r7r8rifromkeysrr _EXCEPTIONSrcrryr{rrrrrrrrrrr ~s      cCsg|]}tt|dqS)r)rvrs)rEarrrrqsrqz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZejdjZddZdS)r zEA setup script attempted to modify the filesystem outside the sandboxa SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs|j\}}}|jjftS)N)rktmplformatr)r;cmdrkkwargsrrr__str__s zSandboxViolation.__str__N) r5r6r7r8textwrapdedentlstriprrrrrrr s )N)N)=r&rr$operator functoolsrrW contextlibr,rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr"platformrDZ$org.python.modules.posix.PosixModulepythonrHposixZ PosixModulersrprzry NameErrorrr{Zdistutils.errorsrr__all__rcontextmanagerrr r%r*r.r+r:rMrKrQrVr[rSr rrorrr reduceor_splitrr rrrrs^             w  V PK!)__pycache__/dep_util.cpython-36.opt-1.pycnu[3 vh@sddlmZddZdS)) newer_groupcCslt|t|krtdg}g}xBtt|D]2}t||||r.|j|||j||q.W||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)Zsources_groupsZtargetsZ n_sourcesZ n_targetsir/usr/lib/python3.6/dep_util.pynewer_pairwise_groupsr N)Zdistutils.dep_utilrr rrrr s PK!QOy%__pycache__/py31compat.cpython-36.pycnu[3 vh@sddgZyddlmZmZWn,ek rHddlmZmZddZYnXyddlmZWn4ek rddl Z ddlZGdd d e ZYnXdS) get_config_varsget_path)rr)rget_python_libcCs|dkrtdt|dkS)NplatlibpurelibzName must be purelib or platlib)rr) ValueErrorr)namer /usr/lib/python3.6/py31compat.pyr s)TemporaryDirectoryNc@s(eZdZdZddZddZddZdS) r z Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cCsd|_tj|_dS)N)rtempfileZmkdtemp)selfr r r __init__szTemporaryDirectory.__init__cCs|jS)N)r)r r r r __enter__!szTemporaryDirectory.__enter__c Cs2ytj|jdWntk r&YnXd|_dS)NT)shutilZrmtreerOSError)r exctypeZexcvalueZexctracer r r __exit__$s zTemporaryDirectory.__exit__N)__name__ __module__ __qualname____doc__rrrr r r r r sr ) __all__ sysconfigrr ImportErrorZdistutils.sysconfigrr r robjectr r r r sPK!θ:f66+__pycache__/py33compat.cpython-36.opt-1.pycnu[3 vh @sddlZddlZddlZy ddlZWnek r<dZYnXddlmZddlmZej ddZ Gddde Z e ede Ze ed ejjZdS) N)six) html_parserOpArgz opcode argc@seZdZddZddZdS)Bytecode_compatcCs ||_dS)N)code)selfrr /usr/lib/python3.6/py33compat.py__init__szBytecode_compat.__init__ccstjd|jj}t|jj}d}d}x||kr||}|tjkr||d||dd|}|d7}|tjkrtjd }||d}q&n d}|d7}t ||Vq&WdS) z>Yield '(op,arg)' pair for each operation in code object 'code'briN) arrayrco_codelendisZ HAVE_ARGUMENTZ EXTENDED_ARGrZ integer_typesr)rbyteseofZptrZ extended_argopargZ long_typerrr __iter__s        zBytecode_compat.__iter__N)__name__ __module__ __qualname__r rrrrr rsrBytecodeunescape)rr collectionsZhtml ImportErrorZsetuptools.externrZsetuptools.extern.six.movesr namedtuplerobjectrgetattrrZ HTMLParserrrrrr s     " PK!U%% __pycache__/wheel.cpython-36.pycnu[3 vhb@sdZddlmZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z ddl mZddlmZddlm ZddlmZdd lmZejd ejjZd Zd d ZGdddeZdS)zWheels support.) get_platformN) Distribution PathMetadata parse_version)canonicalize_name)PY3)r) pep425tags)write_requirementsz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$ztry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c Csxtj|D]\}}}tjj||}x6|D].}tjj||}tjj|||}tj||q*WxXttt|D]D\} } tjj|| }tjj||| }tjj |sntj|||| =qnWq Wx0tj|ddD]\}}}| st tj |qWdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsAssertionErrorrmdir) Zsrc_dirZdst_dirdirpathZdirnames filenamessubdirfsrcdstndr/usr/lib/python3.6/wheel.pyunpack!s    r!c@s<eZdZddZddZddZddZd d Zd d Zd S)WheelcCsTttjj|}|dkr$td|||_x$|jjD]\}}t|||q8WdS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr&matchkvrrr __init__9s  zWheel.__init__cCs&tj|jjd|jjd|jjdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproduct py_versionsplitabiplatform)r*rrr tagsAs z Wheel.tagscs$tjtfdd|jDdS)z5Is the wheel is compatible with the current platform?c3s|]}|krdVqdS)TNr).0t)supported_tagsrr Jsz&Wheel.is_compatible..F)rZ get_supportednextr6)r*r)r9r is_compatibleGszWheel.is_compatiblecCs*t|j|j|jdkrdntdjdS)Nany) project_nameversionr5z.egg)rr>r?r5regg_name)r*rrr r@LszWheel.egg_namecCsJx<|jD]0}tj|}|jdr t|jt|jr |Sq WtddS)Nz .dist-infoz.unsupported wheel format. .dist-info not found)Znamelist posixpathdirnameendswithr startswithr>r%)r*zfmemberrBrrr get_dist_infoRs   zWheel.get_dist_infocstj|jd|j|jf}|jd|fdd}|d}|d}t|jd}td|koxtd knstd |t j |j |t j j |tj|t|d d d tttjfddjD}t j j |d}t j|t jt j j |dt j j |dtt|dd} t| jddt j j |dt j j |t j j d} t j j| rt j j |dd} t j | xVt j| D]H} | jdrt jt j j | | n t jt j j | | t j j | | qWt j| x0t t j jfddd#DD]} t!| |q$Wt j jrPt jt j j |d}t j j|rt"|}|j#j$}WdQRXxr|D]j}t j j |f|j$d }t j j |d!}t j j|rt j j| rt"|d"}|j%t&WdQRXqWWdQRXdS)$z"Install wheel as an egg directory.z%s-%sz%s.datac sHjtj|,}tr&|jjdn|j}tjjj |SQRXdS)Nzutf-8) openrArrreaddecodeemailparserZParserZparsestr)namefpvalue) dist_inforErr get_metadatabsz*Wheel.install_as_egg..get_metadataZWHEELZMETADATAz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|S)N)Zmarkerstr)reqrrr raw_reqxsz%Wheel.install_as_egg..raw_reqc s6i|].}ttfddtj|fD|qS)c3s|]}|kr|VqdS)Nr)r7rS)install_requiresrr r:~sz2Wheel.install_as_egg...)rsortedmaprequires)r7Zextra)distrUrTrr |sz(Wheel.install_as_egg..zEGG-INFOzPKG-INFO)rUextras_require)Zattrsegg_infoNz requires.txtscriptsz.pycc3s|]}tjj|VqdS)N)r r r)r7r) dist_datarr r:sz'Wheel.install_as_egg..dataheaderspurelibplatlibznamespace_packages.txtr/z __init__.pyw)r_r`rarb)'zipfileZZipFiler&r>r?rGrgetr%r mkdirZ extractallr rrZ from_locationrrrVrWrXZextrasrenameSetuptoolsDistributiondictr Zget_command_objrlistdirrCunlinkrfilterr!rHrIr3writeNAMESPACE_PACKAGE_INIT)r*Zdestination_eggdirZ dist_basenamerQZwheel_metadataZ dist_metadataZ wheel_versionr[r\Z setup_distZdist_data_scriptsZegg_info_scriptsentryrZnamespace_packagesrNmodZmod_dirZmod_initr)rYr^rPrUrTrEr install_as_egg\sr                  zWheel.install_as_eggN) __name__ __module__ __qualname__r.r6r<r@rGrqrrrr r"7s  r")__doc__Zdistutils.utilrrKr0r rArerdZ pkg_resourcesrrrZ!setuptools.extern.packaging.utilsrZsetuptools.extern.sixrZ setuptoolsrhrZsetuptools.command.egg_infor compileVERBOSEr+r#rnr!objectr"rrrr s&       PK! ii%__pycache__/pep425tags.cpython-36.pycnu[3 vhy*@sdZddlmZddlZddlmZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZejdZd d Zd d Zd dZddZddZd#ddZddZddZddZddZddZd$d!d"ZeZdS)%z2Generate and work with PEP 425 Compatibility Tags.)absolute_importN)log) OrderedDict)glibcz(.+)_(\d+)_(\d+)_(.+)cCsBy tj|Stk r<}ztjdj|tdSd}~XnXdS)Nz{}) sysconfigget_config_varIOErrorwarningswarnformatRuntimeWarning)varer /usr/lib/python3.6/pep425tags.pyrs  rcCs:ttdrd}n&tjjdr"d}ntjdkr2d}nd}|S)z'Return abbreviated implementation name.pypy_version_infoppjavaZjyZcliZipcp)hasattrsysplatform startswith)Zpyimplrrr get_abbr_impls   rcCs.td}| stdkr*djttt}|S)zReturn implementation version.py_version_nodotr)rrjoinmapstrget_impl_version_info)Zimpl_verrrr get_impl_ver)sr!cCs:tdkr"tjdtjjtjjfStjdtjdfSdS)zQReturn sys.version_info-like tuple for use in decrementing the minor version.rrrN)rr version_informajorminorrrrrr 1s  r cCsdjttS)z; Returns the Tag for this specific implementation. z{}{})r rr!rrrr get_impl_tag<sr%TcCs.t|}|dkr&|r tjd||S||kS)zgUse a fallback method for determining SOABI flags if the needed config var is unset or unavailable.Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)rrdebug)rZfallbackexpectedr valrrrget_flagCsr)cstd}t| rdkrttdrd}d}d}tddddkd rLd }td fd ddkd rjd }tdddddkotjdkdrtjdkrd}dt|||f}n@|r|jdrd|jdd}n|r|j ddj dd}nd}|S)zXReturn the ABI tag based on SOABI (if available) or emulate SOABI (CPython 2, PyPy).SOABIrr maxunicoderPy_DEBUGcSs ttdS)Ngettotalrefcount)rrrrrrYszget_abi_tag..)r d WITH_PYMALLOCcsdkS)Nrrr)implrrr.]smZPy_UNICODE_SIZEcSs tjdkS)Ni)rr+rrrrr.as)r'r uz %s%s%s%s%szcpython--r._N>rr)r4r4)r4r4) rrrrr)r"r!rsplitreplace)Zsoabir/r2r5abir)r1r get_abi_tagOs8    r<cCs tjdkS)Ni)rmaxsizerrrr_is_running_32bitqsr>cCstjdkr^tj\}}}|jd}|dkr6tr6d}n|dkrHtrHd}dj|d|d |Stjjj dd j d d }|d krtrd }|S)z0Return our platform name 'win32', 'linux_x86_64'darwinr7x86_64i386ppc64ppczmacosx_{}_{}_{}rrr8r6 linux_x86_64 linux_i686) rrZmac_verr9r>r distutilsutil get_platformr:)releaser8machineZ split_verresultrrrrHus  rHc CsFtdkrdSyddl}t|jSttfk r8YnXtjddS)NrDrEFr>rDrE)rH _manylinuxboolZmanylinux1_compatible ImportErrorAttributeErrorrZhave_compatible_glibc)rNrrris_manylinux1_compatibles  rRcsvg}fddtd dddg|||r8|j|x.D]&}||kr>|||r>|j|q>W|jd |S)zReturn a list of supported arches (including group arches) for the given major, minor and machine architecture of an macOS machine. cs~|dkr||fd kS|dkr(||fd kS|dkr<||fd kS|dkrP||fd kS|krzx |D]}|||rbdSqbWd S)NrC rMrBrAr3r@TF)rSrM)rSrM)rSr3)rSrMr)r#r$archgarch)_supports_archgroupsrrrVs     z)get_darwin_arches.._supports_archfatrArCintelr@fat64rBfat32Z universalrArC)rXr\r@rA)rYr]r@rB)rZr^r@rArC)r[r_)rappend)r#r$rJarchesrUr)rVrWrget_darwin_archess$    rbFcCsg}|dkrXg}t}|dd}x4t|dddD] }|jdjtt||fq4W|p`t}g} |pnt}|r|g| dd<t} ddl } x8| j D],} | dj dr| j | dj dddqW| jtt| | jd|sx|pt} | j d rtj| }|r|j\}}}}d j||}g}xTttt|dD]4}x,tt|||D]}|j|||fq^WqHWn| g}n*|dkrtr| jd d | g}n| g}x:| D]2}x*|D]"} |jd ||df|| fqWqWxZ|ddD]J}|dkrPx6| D].}x&|D]} |jd ||f|| fqWqWqWx*|D]"} |jd|ddd| fqRW|jd ||dfddf|jd ||ddfddfxNt|D]B\}}|jd|fddf|dkr|jd|dddfqW|S)acReturn a list of supported tags for each version specified in `versions`. :param versions: a list of string versions, of the form ["33", "32"], or None. The first version will be assumed to support our ABI. :param platform: specify the exact platform you want valid tags for, or None. If None, use the local system platform. :param impl: specify the exact implementation you want valid tags for, or None. If None, use the local interpreter impl. :param abi: specify the exact abi you want valid tags for, or None. If None, use the local interpreter abi. Nrrrz.abir7rLZnoneZmacosxz {}_{}_%i_%slinuxZ manylinux1z%s%s3130zpy%sanyrgrgrg>rdre)r ranger`rrrrr<setimpZ get_suffixesraddr9extendsortedlistrH _osx_arch_patmatchrWr reversedintrbrRr: enumerate)ZversionsZnoarchrr1r;Z supportedr"r#r$ZabisZabi3srjsuffixrTrpnameZ actual_archZtplrar2aversionirrr get_supportedsh            (   * "  ry)TT)NFNNN)__doc__Z __future__rZdistutils.utilrFrrrerrr collectionsrrrcompilerorrr!r r%r)r<r>rHrRrbryZimplementation_tagrrrrs2        "= _PK!W۾__pycache__/glob.cpython-36.pycnu[3 vhW@sdZddlZddlZddlZddlmZdddgZdddZdd dZd d Z d d Z ddZ ddZ ddZ ejdZejdZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * `bytes` changed to `six.binary_type`. * Hidden files are not ignored. N) binary_typeglobiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamerr /usr/lib/python3.6/glob.pyrs cCs,t||}|r(t|r(t|}| s(t|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenextAssertionError)rritsr r r r s   ccs tjj|\}}t|sF|r0tjj|rB|Vntjj|rB|VdS|s|rrt|rrx4t||D] }|VqbWnxt||D] }|Vq~WdS||krt|rt ||}n|g}t|r|rt|rt}qt}nt }x0|D](}x"|||D]}tjj ||VqWqWdS)N) ospathsplit has_magiclexistsisdirr glob2glob1r glob0join)rrdirnamebasenamexdirsZ glob_in_dirnamer r r r 2s4        r c CsR|s"t|trtjjd}ntj}ytj|}Wntk rDgSXtj||S)NASCII) isinstancerrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesr r r r]s rcCs8|stjj|r4|gSntjjtjj||r4|gSgS)N)rrrrr)rrr r r rjs  rccs6t|s t|ddVxt|D] }|Vq$WdS)Nr)r r _rlistdir)rr(rr r r rzs rc cs|s"t|trttjd}ntj}ytj|}Wntjk rFdSXxJ|D]B}|V|rjtjj||n|}x t|D]}tjj||VqxWqNWdS)Nr ) r!rrr"r$errorrrr*)rr)rryr r r r*s  r*z([*?[])s([*?[])cCs(t|trtj|}n tj|}|dk S)N)r!rmagic_check_bytessearch magic_check)rmatchr r r rs   rcCst|tr|dkS|dkSdS)Ns**z**)r!r)r(r r r r s r cCs<tjj|\}}t|tr(tjd|}n tjd|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver!rr-subr/)rZdriver r r rs   )F)F)__doc__rrer&Zsetuptools.extern.sixr__all__rrr rrrr*compiler/r-rr rr r r r s"    +   PK!3bZZ+__pycache__/py36compat.cpython-36.opt-1.pycnu[3 vhK @sVddlZddlmZddlmZddlmZGdddZejd krRGdddZdS) N)DistutilsOptionError) strtobool)DEBUGc@seZdZdZdddZdS)Distribution_parse_config_filesz Mix-in providing forward-compatibility for functionality to be included by default on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. NcCsddlm}tjtjkr8ddddddd d d d d ddg }ng}t|}|dkrT|j}trb|jd|dd}x|D]}tr|jd||j |xf|j D]Z}|j |}|j |}x@|D]8} | dkr| |kr|j || } | jdd} || f|| <qWqW|jqrWd|jkrx|jdjD]\} \} } |jj | } yF| rVt|| t|  n(| dkrrt|| t| n t|| | Wn,tk r} zt| WYdd} ~ XnXq"WdS)Nr) ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootz"Distribution.parse_config_files():)Z interpolationz reading %s__name__-_globalverbosedry_run)rr)Z configparserrsysr base_prefix frozensetZfind_config_filesrZannouncereadZsectionsoptionsZget_option_dictgetreplace__init__Zcommand_optionsitemsZ negative_optsetattrr ValueErrorr)self filenamesrZignore_optionsparserfilenameZsectionrZopt_dictoptvalsrcaliasmsgr% /usr/lib/python3.6/py36compat.pyparse_config_filessJ                z2Distribution_parse_config_files.parse_config_files)N)r __module__ __qualname____doc__r'r%r%r%r&rsrc@s eZdZdS)rN)r r(r)r%r%r%r&rJs)r+) rZdistutils.errorsrZdistutils.utilrZdistutils.debugrr version_infor%r%r%r&s   A PK!B1rr*__pycache__/extension.cpython-36.opt-1.pycnu[3 vh@s|ddlZddlZddlZddlZddlZddlmZddlm Z ddZ e Z e ej j ZGdddeZ Gd d d e ZdS) N)map) get_unpatchedc Cs2d}yt|dgdjdStk r,YnXdS)z0 Return True if Cython can be imported. zCython.Distutils.build_ext build_ext)fromlistTF) __import__r Exception)Z cython_implr /usr/lib/python3.6/extension.py _have_cython sr c@s eZdZdZddZddZdS) Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs(|jdd|_tj|||f||dS)Npy_limited_apiF)popr _Extension__init__)selfnamesourcesargskwr r r r#szExtension.__init__cCsNtr dS|jpd}|jdkr$dnd}tjtjd|}tt||j |_ dS)z Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Nzc++z.cppz.cz.pyx$) r Zlanguagelower functoolspartialresublistrr)rZlangZ target_extrr r r _convert_pyx_sources_to_lang)s  z&Extension._convert_pyx_sources_to_langN)__name__ __module__ __qualname____doc__rrr r r r r sr c@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)rrr r!r r r r r"8sr")rrZdistutils.coreZ distutilsZdistutils.errorsZdistutils.extensionZsetuptools.extern.six.movesrZmonkeyrr Z have_pyrexZcorer rr"r r r r s   PK!7%__pycache__/namespaces.cpython-36.pycnu[3 vh @sRddlZddlmZddlZddlmZejjZGdddZ Gddde Z dS)N)log)mapc @sTeZdZdZddZddZddZdZdZddZ ddZ ddZ e ddZ dS) Installerz -nspkg.pthc Cs|j}|sdStjj|j\}}||j7}|jj|tj d|t |j |}|j rdt |dSt|d}|j|WdQRXdS)Nz Installing %sZwt)_get_all_ns_packagesospathsplitext _get_target nspkg_extZoutputsappendrinfor_gen_nspkg_lineZdry_runlistopen writelines)selfZnspfilenameextlinesfr /usr/lib/python3.6/namespaces.pyinstall_namespacess     zInstaller.install_namespacescCsHtjj|j\}}||j7}tjj|s.dStjd|tj|dS)Nz Removing %s) rrrr r existsrr remove)rrrrrruninstall_namespaces!s    zInstaller.uninstall_namespacescCs|jS)N)target)rrrrr )szInstaller._get_targetimport sys, types, os#has_mfs = sys.version_info > (3, 5)$p = os.path.join(%(root)s, *%(pth)r)4importlib = has_mfs and __import__('importlib.util')-has_mfs and __import__('importlib.machinery')m = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))Cm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))7mp = (m or []) and m.__dict__.setdefault('__path__',[])(p not in mp) and mp.append(p)4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']r)rrrr _get_rootCszInstaller._get_rootcCsVt|}t|jd}|j}|j}|jd\}}}|rB||j7}dj|tdS)N.; ) strtuplesplitr' _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgZpthrootZ tmpl_linesparentsepZchildrrrr Fs zInstaller._gen_nspkg_linecCs |jjp g}ttt|j|S)z,Return sorted list of all package namespaces)Z distributionZnamespace_packagessortedflattenr _pkg_names)rZpkgsrrrrQs zInstaller._get_all_ns_packagesccs,|jd}x|r&dj|V|jq WdS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r(N)r-r1pop)r3partsrrrr9Vs  zInstaller._pkg_namesN) rrrr r!r"r#r$r%)r&)__name__ __module__ __qualname__r rrr r.r0r'r r staticmethodr9rrrrr s$ rc@seZdZddZddZdS)DevelopInstallercCstt|jS)N)reprr+Zegg_path)rrrrr'gszDevelopInstaller._get_rootcCs|jS)N)Zegg_link)rrrrr jszDevelopInstaller._get_targetN)r<r=r>r'r rrrrr@fsr@) rZ distutilsr itertoolsZsetuptools.extern.six.movesrchain from_iterabler8rr@rrrrs   [PK!SB&=&=(__pycache__/sandbox.cpython-36.opt-1.pycnu[3 vh7 @sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZddlZejjdrddljjjjZn ejejZyeZWnek rdZYnXeZddlm Z ddlm!Z!ddd d gZ"d-d d Z#ej$d.d dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d Z2Gd&ddZ3e4ed'rej5gZ6ngZ6Gd(dde3Z7ej8ej9d)d*d+j:DZ;Gd,d d e Z)r;r2r3rrrresumes zExceptionSaver.resumeN)r5r6r7r8r<r@rCrrrrr:rs r:c #sVtjjt }VWdQRXtjjfddtjD}t||jdS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3s&|]}|kr|jd r|VqdS)z encodings.N) startswith).0mod_name)rrr szsave_modules..)rmodulescopyr:update_clear_modulesrC) saved_excZ del_modulesr)rr save_moduless  rMcCsxt|D] }tj|=q WdS)N)listrrH)Z module_namesrFrrrrKsrKc cs$tj}z |VWdtj|XdS)N)r" __getstate__ __setstate__)rrrrsave_pkg_resources_states rQc,cstjj|d}txtfttNt<t|(t |t ddVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)NZtempZ setuptools) r&rjoinrQrMhide_setuptoolsr rr%r* __import__) setup_dirZtemp_dirrrr setup_contexts  rVcCstjd}t|j|S)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rFpatternrrr _needs_hidings r[cCstttj}t|dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. N)filterr[rrHrK)rHrrrrSs rScCstjjtjj|}t|y|gt|tjdd<tjjd|t j t j j ddt |trl|n |jtj}t|t|dd}t||WdQRXWn4tk r}z|jr|jdrʂWYdd}~XnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|jS)N)Zactivate)Zdistrrrszrun_setup..__main__)__file__r5)r&rabspathdirnamerVrNrrinsertr__init__Z callbacksappend isinstancestrencodegetfilesystemencodingr dictr SystemExitargs)Z setup_scriptrkrUZ dunder_filensvrrrr s   c@s2eZdZdZdZddZddZddZd d Zd d Z d dZ x$d9D]Z e e e rFe e ee <qFWd:ddZer~edeZedeZx$d;D]Z e e e ree ee <qWd)d*Zx$drzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs&g|]}|jd rt|r|qS)_)rDhasattr)rEname)r;rr sz,AbstractSandbox.__init__..)dir_os_attrs)r;r)r;rrcszAbstractSandbox.__init__cCs&x |jD]}tt|t||qWdS)N)rtsetattrr&getattr)r;sourcerprrr_copy s zAbstractSandbox._copycCs(|j|tr|jt_|jt_d|_dS)NT)rx_filerfile_openr_active)r;rrrr<s  zAbstractSandbox.__enter__cCs$d|_trtt_tt_|jtdS)NF)r|ryrrzr{rrxrs)r;exc_type exc_value tracebackrrrr@s zAbstractSandbox.__exit__c Cs||SQRXdS)zRun 'func' under os sandboxingNr)r;funcrrrrunszAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||S)N)r| _remap_pair)r;srcdstrkkw)rporiginalrrwrap&sz3AbstractSandbox._mk_dual_path_wrapper..wrap)rvrs)rprr)rprr_mk_dual_path_wrapper#s z%AbstractSandbox._mk_dual_path_wrapperrenamelinksymlinkNcs p ttfdd}|S)Ncs*|jr|j|f||}|f||S)N)r| _remap_input)r;rrkr)rprrrr4sz5AbstractSandbox._mk_single_path_wrapper..wrap)rvrs)rprrr)rprr_mk_single_path_wrapper1sz'AbstractSandbox._mk_single_path_wrapperrzrstatlistdirr(chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstat startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}|j|f||S|f||S)N)r|r _remap_output)r;rrkr)rprrrrIsz4AbstractSandbox._mk_single_with_return..wrap)rvrs)rprr)rprr_mk_single_with_returnFs z&AbstractSandbox._mk_single_with_returnreadlinktempnamcsttfdd}|S)Ncs ||}|jr|j|S|S)N)r|r)r;rkrZretval)rprrrrXs  z'AbstractSandbox._mk_query..wrap)rvrs)rprr)rprr _mk_queryUs zAbstractSandbox._mk_queryr'tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r;rrrr_validate_pathdszAbstractSandbox._validate_pathcOs |j|S)zCalled for path inputs)r)r; operationrrkrrrrrhszAbstractSandbox._remap_inputcCs |j|S)zCalled for path outputs)r)r;rrrrrrlszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r)r;rrrrkrrrrrpszAbstractSandbox._remap_pair)rrr)N)rrr(rrrrrrrrrrrrrrrr)rr)r'r)r5r6r7r8r|rcrxr<r@rrrprorsrrryr{rrrrrrrrrrrsB          devnullc@seZdZdZejdddddddd d d d d dg ZdgZefddZ ddZ e rXd'ddZ d(ddZ ddZ ddZddZdd Zd!d"Zd)d$d%Zd&S)*r z.) r&rrr_sandboxrR_prefix _exceptionsrrc)r;Zsandbox exceptionsrrrrcs  zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r )r/r )r;rrkrr rrr _violations zDirectorySandbox._violationrcOs<|dkr*|j| r*|jd||f||t||f||S)Nrrtr rUUrz)rrr rr)_okrry)r;rrrkrrrrryszDirectorySandbox._filecOs<|dkr*|j| r*|jd||f||t||f||S)Nrrr rrr)rrr rr)rrr{)r;rrrkrrrrr{szDirectorySandbox._opencCs|jddS)Nr)r)r;rrrrszDirectorySandbox.tmpnamc CsN|j}z:d|_tjjtjj|}|j|p@||jkp@|j|jS||_XdS)NF) r|r&rrr _exemptedrrDr)r;rZactiverrrrrs   zDirectorySandbox._okcs<fdd|jD}fdd|jD}tj||}t|S)Nc3s|]}j|VqdS)N)rD)rEZ exception)filepathrrrGsz-DirectorySandbox._exempted..c3s|]}tj|VqdS)N)rWrY)rErZ)rrrrGs)r_exception_patterns itertoolschainany)r;rZ start_matchesZpattern_matchesZ candidatesr)rrrs      zDirectorySandbox._exemptedcOs6||jkr2|j| r2|j|tjj|f|||S)zCalled for path inputs) write_opsrrr&rr)r;rrrkrrrrrszDirectorySandbox._remap_inputcOs6|j| s|j| r.|j|||f||||fS)z?Called for path pairs like rename, link, and symlink operations)rr)r;rrrrkrrrrrszDirectorySandbox._remap_paircOsB|t@r,|j| r,|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open) WRITE_FLAGSrrrsr)r;rzflagsrrkrrrrrszDirectorySandbox.openN)r)r)r)r5r6r7r8rifromkeysrr _EXCEPTIONSrcrryr{rrrrrrrrrrr ~s      cCsg|]}tt|dqS)r)rvrs)rEarrrrqsrqz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZejdjZddZdS)r zEA setup script attempted to modify the filesystem outside the sandboxa SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs|j\}}}|jjftS)N)rktmplformatr)r;cmdrkkwargsrrr__str__s zSandboxViolation.__str__N) r5r6r7r8textwrapdedentlstriprrrrrrr s )N)N)=r&rr$operator functoolsrrW contextlibr,rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr"platformrDZ$org.python.modules.posix.PosixModulepythonrHposixZ PosixModulersrprzry NameErrorrr{Zdistutils.errorsrr__all__rcontextmanagerrr r%r*r.r+r:rMrKrQrVr[rSr rrorrr reduceor_splitrr rrrrs^             w  V PK!QOy+__pycache__/py31compat.cpython-36.opt-1.pycnu[3 vh@sddgZyddlmZmZWn,ek rHddlmZmZddZYnXyddlmZWn4ek rddl Z ddlZGdd d e ZYnXdS) get_config_varsget_path)rr)rget_python_libcCs|dkrtdt|dkS)NplatlibpurelibzName must be purelib or platlib)rr) ValueErrorr)namer /usr/lib/python3.6/py31compat.pyr s)TemporaryDirectoryNc@s(eZdZdZddZddZddZdS) r z Very simple temporary directory context manager. Will try to delete afterward, but will also ignore OS and similar errors on deletion. cCsd|_tj|_dS)N)rtempfileZmkdtemp)selfr r r __init__szTemporaryDirectory.__init__cCs|jS)N)r)r r r r __enter__!szTemporaryDirectory.__enter__c Cs2ytj|jdWntk r&YnXd|_dS)NT)shutilZrmtreerOSError)r exctypeZexcvalueZexctracer r r __exit__$s zTemporaryDirectory.__exit__N)__name__ __module__ __qualname____doc__rrrr r r r r sr ) __all__ sysconfigrr ImportErrorZdistutils.sysconfigrr r robjectr r r r sPK!3bZZ%__pycache__/py36compat.cpython-36.pycnu[3 vhK @sVddlZddlmZddlmZddlmZGdddZejd krRGdddZdS) N)DistutilsOptionError) strtobool)DEBUGc@seZdZdZdddZdS)Distribution_parse_config_filesz Mix-in providing forward-compatibility for functionality to be included by default on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. NcCsddlm}tjtjkr8ddddddd d d d d ddg }ng}t|}|dkrT|j}trb|jd|dd}x|D]}tr|jd||j |xf|j D]Z}|j |}|j |}x@|D]8} | dkr| |kr|j || } | jdd} || f|| <qWqW|jqrWd|jkrx|jdjD]\} \} } |jj | } yF| rVt|| t|  n(| dkrrt|| t| n t|| | Wn,tk r} zt| WYdd} ~ XnXq"WdS)Nr) ConfigParserz install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootz"Distribution.parse_config_files():)Z interpolationz reading %s__name__-_globalverbosedry_run)rr)Z configparserrsysr base_prefix frozensetZfind_config_filesrZannouncereadZsectionsoptionsZget_option_dictgetreplace__init__Zcommand_optionsitemsZ negative_optsetattrr ValueErrorr)self filenamesrZignore_optionsparserfilenameZsectionrZopt_dictoptvalsrcaliasmsgr% /usr/lib/python3.6/py36compat.pyparse_config_filessJ                z2Distribution_parse_config_files.parse_config_files)N)r __module__ __qualname____doc__r'r%r%r%r&rsrc@s eZdZdS)rN)r r(r)r%r%r%r&rJs)r+) rZdistutils.errorsrZdistutils.utilrZdistutils.debugrr version_infor%r%r%r&s   A PK!h~}}.__pycache__/package_index.cpython-36.opt-1.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddlm"Z"ddl#m$Z$dd l%m&Z&dd l'm(Z(dd l)m*Z*dd l+m,Z,dd l-m.Z.ej/dZ0ej/dej1Z2ej/dZ3ej/dej1j4Z5dj6Z7ddddgZ8dZ9dZ:e:j;ejddZ?ddZ@dEd dZAdFd!d"ZBdGd#d$ZCdedfd%dZDdHd&d'ZEd(d)ZFej/d*ej1ZGeFd+d,ZHGd-d.d.eIZJGd/d0d0eJZKGd1ddeZLej/d2jMZNd3d4ZOd5d6ZPdId7d8ZQd9d:ZRGd;d<dd>ejTZUejVjWfd?d@ZXeQe9eXZXdAdBZYdCdDZZdS)Jz#PyPI and direct package downloadingN)wraps)six)urllib http_client configparsermap) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST) ssl_support)log)DistutilsError) translate)get_all_headers)unescape)Wheelz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+) \s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezsz(interpret_distro_name..r9Nr7) py_versionrHrV)r?anyrangerTr join)rPrUrMr^rHrVrAr\r&r&r'rs  $ccsnt}|j}|dkr>xTtjj|j|D]}|||Vq&Wn,x*|D]"}||}||krD|||VqDWdS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrZmoves filterfalse __contains__)iterablekeyseenZseen_addelementkr&r&r'unique_everseens  rkcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst||S)N)rk)argskwargs)funcr&r'wrapperszunique_values..wrapper)r)rnror&)rnr' unique_valuessrpz3<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>ccsxvtj|D]h}|j\}}tttj|jjd}d|ksFd|kr x,t j|D]}t j j |t |jdVqRWq WxHdD]@}|j|}|d kr~t j||}|r~t j j |t |jdVq~WdS) zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager8r7 Home PageDownload URLN)rrrsr;)RELfinditergroupsrbrstrstripr0r?HREFrr#urljoin htmldecoderLfindsearch)r@pagerKtagZrelZrelsposr&r&r'find_external_linkss "   rc@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr&)selfblockr&r&r'feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr&)rr&r&r'is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr&)rreportertemplater&r&r'reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr&r&r&r'rsrc@sBeZdZejdZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_tj||_||_dS)N) hash_namehashlibnewhashexpected)rrrr&r&r'__init__s zHashChecker.__init__cCs>tjj|d}|stS|jj|}|s0tS|f|jS)z5Construct a (possibly null) ContentChecker from a URLr7r;)rr#r=rpatternr} groupdict)clsr@rFrKr&r&r'from_urls zHashChecker.from_urlcCs|jj|dS)N)rupdate)rrr&r&r'rszHashChecker.feedcCs|jj|jkS)N)rZ hexdigestr)rr&r&r'r!szHashChecker.is_validcCs||j}||S)N)r)rrrmsgr&r&r'r$s zHashChecker.reportN) rrrrZcompilerr classmethodrrrrr&r&r&r'rs rcs<eZdZdZdKddZdLd d ZdMd d ZdNd dZddZddZ ddZ ddZ dOddZ ddZ dPfdd ZddZdd Zd!d"Zd#d$Zd%d&ZdQd'd(ZdRd)d*Zd+d,Zd-Zd.d/Zd0d1ZdSd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&Z'S)Urz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOstj|f|||dd|jd |_i|_i|_i|_tjdj t t |j |_ g|_|ortjor|prtj}|rtj||_n tjj|_dS)Nr6|)r rr1 index_url scanned_urls fetched_urls package_pagesrZrrarrrKallowsto_scanrZ is_availableZfind_ca_bundleZ opener_foropenerrrequesturlopen)rrZhostsZ ca_bundleZ verify_sslrlkwZuse_sslr&r&r'r,s zPackageIndex.__init__Fc Cs||jkr| rdSd|j|<t|s4|j|dStt|}|r^|j|sRdS|jd||sr| sr||jkrtt|j |dS|j|sd|j|<dS|j d|d|j|<d}|j |||}|dkrdSd|j|j <d|j jddjkr|jdS|j }|j}t|tsRt|tjjr4d }n|j jd pDd }|j|d }|jx6tj|D](} tjj|t| jd } |j| qfW|j |j!rt"|d ddkr|j#||}dS)z.)filterrWrDrr itertoolsstarmap scan_egg_link)rZ search_pathdirsZ egg_linksr&r&r'scan_egg_linksszPackageIndex.scan_egg_linksc Csttjj||}ttdttj|}WdQRXt |dkrDdS|\}}x>t tjj||D](}tjj|f||_ t |_ |j|q`WdS)Nr9)openrWrDrarrrrwrxrTrrPr rHrc)rrDrZ raw_lineslinesZegg_pathZ setup_pathrNr&r&r'rs  zPackageIndex.scan_egg_linkc sfdd}xHtj|D]:}y |tjj|t|jdWqtk rPYqXqW||\}}|rxXt||D]J}t |\}} |j dr| r|r|d||f7}n j |j |qrWt jdd|SdSd S) z#Process the contents of a PyPI pagecs|jjrtttjj|tjdjd}t|dkrd|dkrt |d}t |d}dj j |j i|<t|t|fSdS)Nr6r9r:r7rT)NN)r2rrrrr#r>rTr?rrr setdefaultr0r)rrApkgver)rr&r'scans "  z(PackageIndex.process_index..scanr7z.pyz #egg=%s-%scSsd|jdddS)Nz%sr7r!r9)rL)mr&r&r'sz,PackageIndex.process_index..rN)ryrurr#rzr{rLr$rrGr1need_version_infoscan_urlPYPI_MD5sub) rr@r~rrKrrnew_urlr4fragr&)rr'rs$       zPackageIndex.process_indexcCs|jd|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_all)rr@r&r&r'rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||jd|j|jdS)Nz6Scanning index of all packages (this may take a while))rrrrr)rrrlr&r&r'rs  zPackageIndex.scan_allcCs~|j|j|jd|jj|js:|j|j|jd|jj|jsR|j|x&t|jj|jfD]}|j|qhWdS)Nr6) rr unsafe_namerrrgrQnot_found_in_indexr)r requirementr@r&r&r' find_packagess zPackageIndex.find_packagescsR|j|j|x,||jD]}||kr.|S|jd||qWtt|j||S)Nz%s does not match %s)prescanrrgrsuperrobtain)rrZ installerrN) __class__r&r'rs zPackageIndex.obtaincCsL|j|jd||jsH|jtj|td|jjtj j |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrWunlinkrrr3rDrU)rcheckerrXtfpr&r&r' check_hashs  zPackageIndex.check_hashcCsTxN|D]F}|jdks4t| s4|jds4tt|r@|j|q|jj|qWdS)z;Add `urls` to the list that will be prescanned for searchesNzfile:)rrr2rrrappend)rZurlsr@r&r&r'add_find_links s      zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrr)rr&r&r'rszPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|jdS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rgrrrr)rrmethrr&r&r'r"s   zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR|j|jd||}t|\}}|jdrN|j|||}|Stj j |rb|St |}t |j ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r7z.pyrPN)rrr _download_urlrLrGr1 gen_setuprWrDrr(rfetch_distribution)rr%tmpdirrBfoundr4rFr&r&r'r8,s    zPackageIndex.downloadc sjd|id}d fdd }|rHjj|||}| r`|dk r`|||}|dkrjdk rzj||}|dkr| rj|||}|dkrˆjdrdpd|njd||j|jd SdS) a|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. zSearching for %sNcs|dkr }x||jD]t}|jtkrJ rJ|krjd|d|<q||ko`|jtkp` }|rj|j}||_tj j |jr|SqWdS)Nz&Skipping development or system egg: %sr7) rgrHrrr r8rPdownload_locationrWrDr)ZreqenvrNZtestloc) develop_okrskippedsourcerr&r'r|fs z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rP)N)rrrrrcloner) rrr force_scanrrZ local_indexrNr|r&)rrrrrr'rNs0       zPackageIndex.fetch_distributioncCs"|j||||}|dk r|jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)rrP)rrrrrrNr&r&r'fetchszPackageIndex.fetchc Cstj|}|r*ddt||jddDp,g}t|dkrtjj|}tjj||krtjj ||}ddl m }|||st j |||}ttjj |dd2} | jd|dj|djtjj|dfWdQRX|S|rtd ||fntd dS) NcSsg|]}|jr|qSr&)rR)r[dr&r&r' sz*PackageIndex.gen_setup..r7r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rJrKrrLrTrWrDrUdirnameraZsetuptools.command.easy_installrshutilZcopy2rwriterQrRsplitextr) rrXrFrrKrrUdstrrr&r&r'rs2       zPackageIndex.gen_setupi c Cs|jd|d}ztj|}|j|}t|tjjrJtd||j |j f|j}d}|j }d}d|krt |d} t tt| }|j|||||t|dZ} xD|j|} | r|j| | j| |d7}|j|||||qPqW|j||| WdQRX|S|r|jXdS) NzDownloading %szCan't download %s: %s %srr7zcontent-lengthzContent-Lengthwbr;)rrrrrrrrrrr dl_blocksizermaxrint reporthookrrrr rr) rr@rXfprrblocknumZbssizeZsizesrrr&r&r' _download_tos:        zPackageIndex._download_tocCsdS)Nr&)rr@rXrZblksizerr&r&r'rszPackageIndex.reporthookcCs|jdrt|Sy t||jSttjfk r}z>djdd|jD}|r^|j ||nt d||fWYdd}~Xnt j j k r}z|Sd}~Xnt j jk r}z,|r|j ||jnt d||jfWYdd}~Xntjk r8}z.|r|j ||jnt d||jfWYdd}~XnPtjtj fk r}z*|rf|j ||nt d||fWYdd}~XnXdS)Nzfile: cSsg|] }t|qSr&)rw)r[argr&r&r'rsz)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r2 local_openopen_with_authrr$r InvalidURLrarlrrrrrZURLErrorreasonZ BadStatusLinelineZ HTTPExceptionsocket)rr@Zwarningvrr&r&r'rs6  "zPackageIndex.open_urlcCst|\}}|r4x&d|kr0|jddjdd}qWnd}|jdrN|dd}tjj||}|jt|sztdj |d |d ks|jd r|j ||S|d ks|jd r|j ||S|jdr|j ||S|dkrt jjt jj|dS|j|d|j||SdS)Nz...\_Z__downloaded__z.egg.zipr,zInvalid filename {filename})rXsvnzsvn+gitzgit+zhg+rr9Tr/)rGreplacer1rWrDrar2rwr$format _download_svn _download_git _download_hgrr url2pathnamer#r=r_attempt_download)rrBr@rr3rFrXr&r&r'rs(         zPackageIndex._download_urlcCs|j|ddS)NT)r)rr@r&r&r'r=szPackageIndex.scan_urlcCs6|j||}d|jddjkr.|j|||S|SdS)Nrz content-typer)rrr0_download_html)rr@rXrr&r&r'r)@s zPackageIndex._attempt_downloadcCslt|}x@|D]8}|jrtjd|rD|jtj||j||SPqW|jtj|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rx���rZ���r}���r���rW���r���r%��r���)r���r@���r���rX���r���r��r&���r&���r'���r*��G��s����     zPackageIndex._download_htmlc�������������C���s��|j�ddd�}g�}|j�jdrd|krtjj|\}}}}}} | �r|jdrd|dd��kr|dd��j�dd\}}tjj|\} } | rd | kr| j�d d\} } d | �d | �g}n d | �g}| }|||||| f}tjj|}|�jd ||�t j d dg|�d||g��|S�)Nr:���r7���r���zsvn:@z//r6���r9���:z --username=z --password=z'Doing subversion checkout from %s to %sr!��checkoutz-q) r?���r0���r2���r���r#���r=��� splituser urlunparser��� subprocess check_call)r���r@���rX���ZcredsrB���netlocrD���r\���qr���authhostuserZpwrA���r&���r&���r'���r%��V��s$����   zPackageIndex._download_svnc�������������C���sp���t�jj|�\}}}}}|jddd�}|jddd�}d�}d|krR|jdd\}}t�jj||||df}�|�|fS�)N+r7���r:���r���r+��r���r;���)r���r#���Zurlsplitr?���rsplitZ urlunsplit)r@��� pop_prefixrB���r2��rD���rE���r���revr&���r&���r'���_vcs_split_rev_from_urlk��s����z$PackageIndex._vcs_split_rev_from_urlc�������������C���sr���|j�ddd�}|�j|dd\}}|�jd||�tjddd ||g�|d�k rn|�jd |�tjdd |d d |g�|S�) Nr:���r7���r���T)r9��zDoing git clone from %s to %sr"��r���z--quietzChecking out %sz-Cr-��)r?���r;��r���r0��r1��)r���r@���rX���r:��r&���r&���r'���r&��}��s���� zPackageIndex._download_gitc���������� ���C���sv���|j�ddd�}|�j|dd\}}|�jd||�tjddd ||g�|d�k rr|�jd |�tjdd |d d d|dg�|S�)Nr:���r7���r���T)r9��zDoing hg clone from %s to %sZhgr���z--quietzUpdating to %sz--cwdZupz-Cz-rz-q)r?���r;��r���r0��r1��)r���r@���rX���r:��r&���r&���r'���r'����s���� zPackageIndex._download_hgc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.debugc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.infoc�������������G���s���t�j|f|��d�S�)N)r���r���)r���r���rl���r&���r&���r'���r�����s����zPackageIndex.warnr���)r���r<��NT)F)F)F)N)N)FFFN)FF)N)F)(r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r8���r���r��r���r ��r��r��r���r���r���r)��r*��r%�� staticmethodr;��r&��r'��r���r���r��� __classcell__r&���r&���)r���r'���r���)��sL����  3   +   #� J )$ #!   z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�������������C���s���|�j�d}t|S�)Nr7���)rL���r���)rK���Zwhatr&���r&���r'��� decode_entity��s���� r?��c�������������C���s ���t�t|�S�)z'Decode HTML entities in the given text.) entity_subr?��)textr&���r&���r'���r{�����s����r{���c����������������s����fdd}|S�)Nc����������������s����fdd}|S�)Nc����������� ������s.���t�j�}t�j�z �|�|S�t�j|�X�d�S�)N)r��ZgetdefaulttimeoutZsetdefaulttimeout)rl���rm���Z old_timeout)rn���timeoutr&���r'���_socket_timeout��s ����  z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr&���)rn���rC��)rB��)rn���r'���rC����s����z'socket_timeout.<locals>._socket_timeoutr&���)rB��rC��r&���)rB��r'���socket_timeout��s���� rD��c�������������C���s2���t�jj|�}|j�}tj|}|j�}|jddS�)aq�� A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r���r#���r>���encodebase64Z encodestringr���r#��)r4��Zauth_sZ auth_bytesZ encoded_bytesZencodedr&���r&���r'��� _encode_auth��s ����  rH��c���������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�������������C���s���||�_�||�_d�S�)N)usernamepassword)r���rJ��rK��r&���r&���r'���r�����s����zCredential.__init__c�������������c���s���|�j�V��|�jV��d�S�)N)rJ��rK��)r���r&���r&���r'���__iter__��s����zCredential.__iter__c�������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)vars)r���r&���r&���r'���__str__��s����zCredential.__str__N)r���r���r���r���r���rL��rN��r&���r&���r&���r'���rI����s���rI��c���������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�������������C���sP���t�jdddgd}tjj|�|�tjjtjjdd}tjj |rL|�j |�dS�)z% Load from ~/.pypirc rJ��rK�� repositoryr���~z.pypircN) dictfromkeysr���RawConfigParserr���rW���rD���ra��� expanduserr���r���)r���ZdefaultsZrcr&���r&���r'���r�����s ���� zPyPIConfig.__init__c����������������s&����fdd�j��D�}tt�j|S�)Nc����������������s ���g�|�]}�j�|d�j�r|qS�)rP��)r���rx���)r[���section)r���r&���r'���r����s����z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)ZsectionsrR��r���_get_repo_cred)r���Zsections_with_repositoriesr&���)r���r'���creds_by_repository��s����zPyPIConfig.creds_by_repositoryc�������������C���s6���|�j�|dj�}|t|�j�|dj�|�j�|dj�fS�)NrP��rJ��rK��)r���rx���rI��)r���rV��Zrepor&���r&���r'���rW����s����zPyPIConfig._get_repo_credc�������������C���s*���x$|�j�j�D�]\}}|j|r |S�q W�dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)rX��itemsr2���)r���r@���rP��credr&���r&���r'���find_credential��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyrX��rW��r[��r&���r&���r&���r'���rO����s��� rO��c�������������C���s:��t�jj|�\}}}}}}|jdr,tjd|d krFt�jj|\}} nd}|s~t�j|�} | r~t | }| j |�f} t j d | ��|rdt |�}|| ||||f} t�jj| } t�jj| }|jd|�n t�jj|�}|jd t�||}|r6t�jj|j\}}}}}}||kr6|| kr6||||||f} t�jj| |_|S�) z4Open a urllib2 request, handling HTTP authenticationr,��znonnumeric port: ''httphttpsN*Authenticating as %s for %s (from .pypirc)zBasic Z Authorizationz User-Agent)r]��r^��)r_��)r���r#���r=���r1���r���r��r.��rO��r[��rw���rJ��r���r���rH��r/��r���ZRequestZ add_header user_agentr@���)r@���r���rB���r2��rD���ZparamsrE���r���r4��r5��rZ��r���rA���r���r���r��s2Zh2Zpath2Zparam2Zquery2Zfrag2r&���r&���r'���r�� ��s6����         r��c�������������C���s���|�S�)Nr&���)r@���r&���r&���r'��� fix_sf_url>��s����rb��c���������� ���C���s��t�jj|�\}}}}}}t�jj|}tjj|r<t�jj|�S�|j drtjj |rg�}xtj |D�]b} tjj || } | dkrt | d} | j�} W�dQ�R�X�P�ntjj | r| d7�} |jdj| d�qbW�d} | j|�dj |d } d\}}n d\}}} ddi}tj| }t�jj|�||||S�)z7Read a local path, with special support for directoriesr6���z index.htmlrNz<a href="{name}">{name}</a>)r3���zB<html><head><title>{url}{files}rE)r@filesOKPath not found Not foundz content-typez text/html)rerf)rgrhri)rr#r=rr(rWrDisfilerr1rrrarrrr$rStringIOrr)r@rBrCrDZparamrErrXrdrfilepathrZbodyrZstatusmessagerZ body_streamr&r&r'rBs,        r)N)N)N)N)r )[rr0sysrWrZrrrGrr functoolsrZsetuptools.externrZsetuptools.extern.six.movesrrrrr"Z pkg_resourcesrr r r r r rrrrrrrrZ distutilsrZdistutils.errorsrZfnmatchrZsetuptools.py27compatrZsetuptools.py33compatrZsetuptools.wheelrrrJIryrrKrr?rS__all__Z_SOCKET_TIMEOUTZ_tmplr$rRr`r(rrGrrIrYrrkrprtrobjectrrrrr@r?r{rDrHrIrTrOrrrrbrr&r&r&r's|  <           !  "   !~  &. PK!rh*__pycache__/windows_support.cpython-36.pycnu[3 vh@s(ddlZddlZddZeddZdS)NcCstjdkrddS|S)NZWindowsc_sdS)N)argskwargsrr%/usr/lib/python3.6/windows_support.pyszwindows_only..)platformsystem)funcrrr windows_onlys r cCsLtdtjjj}tjjtjjf|_tjj |_ d}|||}|sHtj dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. zctypes.wintypesN) __import__ctypesZwindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDZargtypesZBOOLZrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr hide_file s    r)rr r rrrrrsPK! $_KK#__pycache__/__init__.cpython-36.pycnu[3 vhD@s2dZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl ZddlmZddlmZmZddlmZd d lmZd d d ddddgZejjZdZdZdgZGdddeZGdddeZ ej!Z"ddZ#dd Z$ej%j$je$_ej&ej%j'Z(Gddde(Z'ddZ)ej*fddZ+ej,dS) z@Extensions to the 'distutils' for large or complex distributionsN) convert_path) fnmatchcase)filtermap) Extension) DistributionFeature)Require)monkeysetuprrCommandrr find_packagesTz lib2to3.fixesc@sHeZdZdZedfd fddZeddZedd Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs&t|jt||jd||j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. ez_setup *__pycache__)rr)list_find_packages_iterr _build_filter)clswhereexcludeincluder/usr/lib/python3.6/__init__.pyfind's zPackageFinder.findc csxtj|ddD]\}}}|dd}g|dd<xp|D]h}tjj||} tjj| |} | jtjjd} d|ks8|j|  r~q8|| r||  r| V|j|q8WqWdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T) followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rrrrrootdirsfilesZall_dirsdir full_pathZrel_pathpackagerrrr>s   z!PackageFinder._find_packages_itercCstjjtjj|dS)z%Does a directory look like a package?z __init__.py)rr!isfiler")r!rrrr&Zsz!PackageFinder._looks_like_packagecs fddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s|]}t|dVqdS))patN)r).0r/)namerr esz@PackageFinder._build_filter....)any)r1)patterns)r1resz-PackageFinder._build_filter..r)r4r)r4rr_szPackageFinder._build_filterN)r) __name__ __module__ __qualname____doc__ classmethodrr staticmethodr&rrrrrr"s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTr)r!rrrr&isz'PEP420PackageFinder._looks_like_packageN)r6r7r8r;r&rrrrr<hsr<cCs@tjjtdd|jD}|jdd|jr<|j|jdS)Ncss"|]\}}|dkr||fVqdS)dependency_linkssetup_requiresN)r=r>r)r0kvrrrr2usz*_install_setup_requires..T)Zignore_option_errors) distutilscorerdictitemsZparse_config_filesr>Zfetch_build_eggs)attrsdistrrr_install_setup_requiresqs  rGcKst|tjjf|S)N)rGrArBr )rErrrr ~sc@s(eZdZejZdZddZdddZdS) r FcKstj||t|j|dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfrFkwrrrrIs zCommand.__init__rcKs tj|||}t|j||S)N)rHreinitialize_commandrJrK)rLZcommandZreinit_subcommandsrMcmdrrrrNszCommand.reinitialize_commandN)r)r6r7r8rHr9Zcommand_consumes_argumentsrIrNrrrrr scCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tjj||VqqdS)N)rr!r")r0baser)r*filerrrr2sz#_find_all_simple..T)r)rr rr!r.)r!resultsrrr_find_all_simplesrScCs6t|}|tjkr.tjtjj|d}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rSrcurdir functoolspartialr!r#rr)r+r*Zmake_relrrrfindalls   rX)-r9rrVZdistutils.corerAZdistutils.filelistZdistutils.utilrZfnmatchrZsetuptools.extern.six.movesrrZsetuptools.versionZ setuptoolsZsetuptools.extensionrZsetuptools.distrrZsetuptools.dependsr r __all__version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesobjectrr<rrrGr rBZ get_unpatchedr rHrSrUrXZ patch_allrrrrs:      F    PK!o-__pycache__/archive_util.cpython-36.opt-1.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ Gd d d eZ d dZ e dfddZe fdd Ze fddZe fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__rr"/usr/lib/python3.6/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsc CsNxH|ptD]0}y||||Wntk r4w Yq XdSq Wtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r)filename extract_dirprogress_filterZdriversZdriverrrrrsc Cstjj|std||d|fi}xtj|D]\}}}||\}}x4|D],} || dtjj|| f|tjj|| <qLWx\|D]T} tjj|| } ||| | } | sqt| tjj|| } tj| | tj | | qWq0WdS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirrwalkjoinrshutilZcopyfileZcopystat) rrrpathsbasedirsfilesrrdftargetrrrr ?s      ,  c Cstj|std|ftj|}x|jD]}|j}|jds.d|jdkrRq.tj j |f|jd}|||}|szq.|j drt |n4t ||j |j}t|d}|j|WdQRX|jd?} | r.tj|| q.WWdQRXdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z%s is not a zip filerz..wbN)zipfileZ is_zipfilerZZipFileZinfolistr startswithsplitrrrendswithrreadopenwriteZ external_attrchmod) rrrzinfonamer$datar#Zunix_attributesrrrrZs(        c Cshytj|}Wn$tjk r2td|fYnXtj|dd|_x |D]}|j}|jd oxd|j dkrTt j j |f|j d}xV|dk r|j s|jr|j}|jrtj|j}tj ||}tj|}|j|}qW|dk rT|js|jrT|||} | rT| jt jr,| dd } y|j|| WqTtjk rTYqTXqTWdSQRXdS) zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z/%s is not a compressed or uncompressed tar filecWsdS)Nr)argsrrrsz unpack_tarfile..rz..NT)tarfiler,ZTarErrorr contextlibclosingchownr1r(r)rrrZislnkZissymZlinkname posixpathdirnamenormpathZ _getmemberisfilerr*sepZ_extract_memberZ ExtractError) rrrZtarobjmemberr1Z prelim_dstZlinkpathrZ final_dstrrrrs8       )rr'r7rrr;r8Zdistutils.errorsrZ pkg_resourcesr__all__rrrr rrr rrrrs$    "  % .PK! $_KK)__pycache__/__init__.cpython-36.opt-1.pycnu[3 vhD@s2dZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl ZddlmZddlmZmZddlmZd d lmZd d d ddddgZejjZdZdZdgZGdddeZGdddeZ ej!Z"ddZ#dd Z$ej%j$je$_ej&ej%j'Z(Gddde(Z'ddZ)ej*fddZ+ej,dS) z@Extensions to the 'distutils' for large or complex distributionsN) convert_path) fnmatchcase)filtermap) Extension) DistributionFeature)Require)monkeysetuprrCommandrr find_packagesTz lib2to3.fixesc@sHeZdZdZedfd fddZeddZedd Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs&t|jt||jd||j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. ez_setup *__pycache__)rr)list_find_packages_iterr _build_filter)clswhereexcludeincluder/usr/lib/python3.6/__init__.pyfind's zPackageFinder.findc csxtj|ddD]\}}}|dd}g|dd<xp|D]h}tjj||} tjj| |} | jtjjd} d|ks8|j|  r~q8|| r||  r| V|j|q8WqWdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T) followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rrrrrootdirsfilesZall_dirsdir full_pathZrel_pathpackagerrrr>s   z!PackageFinder._find_packages_itercCstjjtjj|dS)z%Does a directory look like a package?z __init__.py)rr!isfiler")r!rrrr&Zsz!PackageFinder._looks_like_packagecs fddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s|]}t|dVqdS))patN)r).0r/)namerr esz@PackageFinder._build_filter....)any)r1)patterns)r1resz-PackageFinder._build_filter..r)r4r)r4rr_szPackageFinder._build_filterN)r) __name__ __module__ __qualname____doc__ classmethodrr staticmethodr&rrrrrr"s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTr)r!rrrr&isz'PEP420PackageFinder._looks_like_packageN)r6r7r8r;r&rrrrr<hsr<cCs@tjjtdd|jD}|jdd|jr<|j|jdS)Ncss"|]\}}|dkr||fVqdS)dependency_linkssetup_requiresN)r=r>r)r0kvrrrr2usz*_install_setup_requires..T)Zignore_option_errors) distutilscorerdictitemsZparse_config_filesr>Zfetch_build_eggs)attrsdistrrr_install_setup_requiresqs  rGcKst|tjjf|S)N)rGrArBr )rErrrr ~sc@s(eZdZejZdZddZdddZdS) r FcKstj||t|j|dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_Command__init__varsupdate)selfrFkwrrrrIs zCommand.__init__rcKs tj|||}t|j||S)N)rHreinitialize_commandrJrK)rLZcommandZreinit_subcommandsrMcmdrrrrNszCommand.reinitialize_commandN)r)r6r7r8rHr9Zcommand_consumes_argumentsrIrNrrrrr scCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tjj||VqqdS)N)rr!r")r0baser)r*filerrrr2sz#_find_all_simple..T)r)rr rr!r.)r!resultsrrr_find_all_simplesrScCs6t|}|tjkr.tjtjj|d}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rSrcurdir functoolspartialr!r#rr)r+r*Zmake_relrrrfindalls   rX)-r9rrVZdistutils.corerAZdistutils.filelistZdistutils.utilrZfnmatchrZsetuptools.extern.six.movesrrZsetuptools.versionZ setuptoolsZsetuptools.extensionrZsetuptools.distrrZsetuptools.dependsr r __all__version __version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesobjectrr<rrrGr rBZ get_unpatchedr rHrSrUrXZ patch_allrrrrs:      F    PK!#__pycache__/dep_util.cpython-36.pycnu[3 vh@sddlmZddZdS)) newer_groupcCslt|t|krtdg}g}xBtt|D]2}t||||r.|j|||j||q.W||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)Zsources_groupsZtargetsZ n_sourcesZ n_targetsir/usr/lib/python3.6/dep_util.pynewer_pairwise_groupsr N)Zdistutils.dep_utilrr rrrr s PK!o'__pycache__/archive_util.cpython-36.pycnu[3 vh@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddddd d d gZ Gd d d eZ d dZ e dfddZe fdd Ze fddZe fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__rr"/usr/lib/python3.6/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsc CsNxH|ptD]0}y||||Wntk r4w Yq XdSq Wtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r)filename extract_dirprogress_filterZdriversZdriverrrrrsc Cstjj|std||d|fi}xtj|D]\}}}||\}}x4|D],} || dtjj|| f|tjj|| <qLWx\|D]T} tjj|| } ||| | } | sqt| tjj|| } tj| | tj | | qWq0WdS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirrwalkjoinrshutilZcopyfileZcopystat) rrrpathsbasedirsfilesrrdftargetrrrr ?s      ,  c Cstj|std|ftj|}x|jD]}|j}|jds.d|jdkrRq.tj j |f|jd}|||}|szq.|j drt |n4t ||j |j}t|d}|j|WdQRX|jd?} | r.tj|| q.WWdQRXdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z%s is not a zip filerz..wbN)zipfileZ is_zipfilerZZipFileZinfolistr startswithsplitrrrendswithrreadopenwriteZ external_attrchmod) rrrzinfonamer$datar#Zunix_attributesrrrrZs(        c Cshytj|}Wn$tjk r2td|fYnXtj|dd|_x |D]}|j}|jd oxd|j dkrTt j j |f|j d}xV|dk r|j s|jr|j}|jrtj|j}tj ||}tj|}|j|}qW|dk rT|js|jrT|||} | rT| jt jr,| dd } y|j|| WqTtjk rTYqTXqTWdSQRXdS) zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z/%s is not a compressed or uncompressed tar filecWsdS)Nr)argsrrrsz unpack_tarfile..rz..NT)tarfiler,ZTarErrorr contextlibclosingchownr1r(r)rrrZislnkZissymZlinkname posixpathdirnamenormpathZ _getmemberisfilerr*sepZ_extract_memberZ ExtractError) rrrZtarobjmemberr1Z prelim_dstZlinkpathrZ final_dstrrrrs8       )rr'r7rrr;r8Zdistutils.errorsrZ pkg_resourcesr__all__rrrr rrr rrrrs$    "  % .PK!+__pycache__/py27compat.cpython-36.opt-1.pycnu[3 vh@sTdZddlZddlmZddZejr.ddZejdko>ejZerHendd Z dS) z2 Compatibility Support for Python 2.7 and earlier N)sixcCs |j|S)zH Given an HTTPMessage, return all headers matching a given key. )Zget_all)messagekeyr /usr/lib/python3.6/py27compat.pyget_all_headers srcCs |j|S)N)Z getheaders)rrrrrrsZLinuxcCs|S)Nr)xrrrsr ) __doc__platformZsetuptools.externrrZPY2systemZlinux_py2_asciistrZ rmtree_saferrrrs  PK!Q'__pycache__/launch.cpython-36.opt-1.pycnu[3 vh@s.dZddlZddlZddZedkr*edS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. NcCsrttjd}t|ddd}tjddtjdd<ttdt}||j}|jdd}t ||d}t ||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizerreadreplacecompiler)Z script_name namespaceZopen_ZscriptZ norm_scriptcoder/usr/lib/python3.6/launch.pyrun s     rr)rrr rrrrrrs PK!rh0__pycache__/windows_support.cpython-36.opt-1.pycnu[3 vh@s(ddlZddlZddZeddZdS)NcCstjdkrddS|S)NZWindowsc_sdS)N)argskwargsrr%/usr/lib/python3.6/windows_support.pyszwindows_only..)platformsystem)funcrrr windows_onlys r cCsLtdtjjj}tjjtjjf|_tjj |_ d}|||}|sHtj dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. zctypes.wintypesN) __import__ctypesZwindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDZargtypesZBOOLZrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr hide_file s    r)rr r rrrrrsPK!!  &__pycache__/wheel.cpython-36.opt-1.pycnu[3 vhb@sdZddlmZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z ddl mZddlmZddlm ZddlmZdd lmZejd ejjZd Zd d ZGdddeZdS)zWheels support.) get_platformN) Distribution PathMetadata parse_version)canonicalize_name)PY3)r) pep425tags)write_requirementsz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$ztry: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) c Csxtj|D]\}}}tjj||}x6|D].}tjj||}tjj|||}tj||q*WxXttt|D]D\} } tjj|| }tjj||| }tjj |sntj|||| =qnWq Wx&tj|ddD]\}}}tj |qWdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsrmdir) Zsrc_dirZdst_dirdirpathZdirnames filenamessubdirfsrcdstndr/usr/lib/python3.6/wheel.pyunpack!s   r c@s<eZdZddZddZddZddZd d Zd d Zd S)WheelcCsTttjj|}|dkr$td|||_x$|jjD]\}}t|||q8WdS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr%matchkvrrr__init__9s  zWheel.__init__cCs&tj|jjd|jjd|jjdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproduct py_versionsplitabiplatform)r)rrrtagsAs z Wheel.tagscs$tjtfdd|jDdS)z5Is the wheel is compatible with the current platform?c3s|]}|krdVqdS)TNr).0t)supported_tagsrr Jsz&Wheel.is_compatible..F)rZ get_supportednextr5)r)r)r8r is_compatibleGszWheel.is_compatiblecCs*t|j|j|jdkrdntdjdS)Nany) project_nameversionr4z.egg)rr=r>r4regg_name)r)rrrr?LszWheel.egg_namecCsJx<|jD]0}tj|}|jdr t|jt|jr |Sq WtddS)Nz .dist-infoz.unsupported wheel format. .dist-info not found)Znamelist posixpathdirnameendswithr startswithr=r$)r)zfmemberrArrr get_dist_infoRs   zWheel.get_dist_infocstj|jd|j|jf}|jd|fdd}|d}|d}t|jd}td|koxtd knstd |t j |j |t j j |tj|t|d d d tttjfddjD}t j j |d}t j|t jt j j |dt j j |dtt|dd} t| jddt j j |dt j j |t j j d} t j j| rt j j |dd} t j | xVt j| D]H} | jdrt jt j j | | n t jt j j | | t j j | | qWt j| x0t t j jfddd#DD]} t!| |q$Wt j jrPt jt j j |d}t j j|rt"|}|j#j$}WdQRXxr|D]j}t j j |f|j$d }t j j |d!}t j j|rt j j| rt"|d"}|j%t&WdQRXqWWdQRXdS)$z"Install wheel as an egg directory.z%s-%sz%s.datac sHjtj|,}tr&|jjdn|j}tjjj |SQRXdS)Nzutf-8) openr@rrreaddecodeemailparserZParserZparsestr)namefpvalue) dist_inforDrr get_metadatabsz*Wheel.install_as_egg..get_metadataZWHEELZMETADATAz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)ZmetadatacSsd|_t|S)N)Zmarkerstr)reqrrrraw_reqxsz%Wheel.install_as_egg..raw_reqc s6i|].}ttfddtj|fD|qS)c3s|]}|kr|VqdS)Nr)r6rR)install_requiresrrr9~sz2Wheel.install_as_egg...)rsortedmaprequires)r6Zextra)distrTrSrr |sz(Wheel.install_as_egg..zEGG-INFOzPKG-INFO)rTextras_require)Zattrsegg_infoNz requires.txtscriptsz.pycc3s|]}tjj|VqdS)N)r r r)r6r) dist_datarrr9sz'Wheel.install_as_egg..dataheaderspurelibplatlibznamespace_packages.txtr.z __init__.pyw)r^r_r`ra)'zipfileZZipFiler%r=r>rFrgetr$r mkdirZ extractallr rrZ from_locationrrrUrVrWZextrasrenameSetuptoolsDistributiondictr Zget_command_objrlistdirrBunlinkrfilterr rGrHr2writeNAMESPACE_PACKAGE_INIT)r)Zdestination_eggdirZ dist_basenamerPZwheel_metadataZ dist_metadataZ wheel_versionrZr[Z setup_distZdist_data_scriptsZegg_info_scriptsentryrZnamespace_packagesrMmodZmod_dirZmod_initr)rXr]rOrTrSrDrinstall_as_egg\sr                  zWheel.install_as_eggN) __name__ __module__ __qualname__r-r5r;r?rFrprrrrr!7s  r!)__doc__Zdistutils.utilrrJr/r r@rercZ pkg_resourcesrrrZ!setuptools.extern.packaging.utilsrZsetuptools.extern.sixrZ setuptoolsrgrZsetuptools.command.egg_infor compileVERBOSEr*r"rmr objectr!rrrrs&       PK!4_)):_vendor/packaging/__pycache__/version.cpython-36.opt-1.pycnu[3 vh$-@sddlmZmZmZddlZddlZddlZddlmZddddd gZ ej d d d d dddgZ ddZ Gddde ZGdddeZGdddeZejdejZddddddZddZddZdZGd ddeZd!d"Zejd#Zd$d%Zd&d'ZdS)()absolute_importdivisionprint_functionN)InfinityparseVersion LegacyVersionInvalidVersionVERSION_PATTERN_Versionepochreleasedevprepostlocalc Cs&yt|Stk r t|SXdS)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. N)rr r )versionr/usr/lib/python3.6/version.pyrsc@seZdZdZdS)r zF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrrrr $sc@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS) _BaseVersioncCs t|jS)N)hash_key)selfrrr__hash__,sz_BaseVersion.__hash__cCs|j|ddS)NcSs||kS)Nr)sorrr0sz%_BaseVersion.__lt__..)_compare)rotherrrr__lt__/sz_BaseVersion.__lt__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!3sz%_BaseVersion.__le__..)r")rr#rrr__le__2sz_BaseVersion.__le__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!6sz%_BaseVersion.__eq__..)r")rr#rrr__eq__5sz_BaseVersion.__eq__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!9sz%_BaseVersion.__ge__..)r")rr#rrr__ge__8sz_BaseVersion.__ge__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!<sz%_BaseVersion.__gt__..)r")rr#rrr__gt__;sz_BaseVersion.__gt__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!?sz%_BaseVersion.__ne__..)r")rr#rrr__ne__>sz_BaseVersion.__ne__cCst|tstS||j|jS)N) isinstancerNotImplementedr)rr#methodrrrr"As z_BaseVersion._compareN) rrrrr$r%r&r'r(r)r"rrrrr*src@s`eZdZddZddZddZeddZed d Zed d Z ed dZ eddZ dS)r cCst||_t|j|_dS)N)str_version_legacy_cmpkeyr)rrrrr__init__Js zLegacyVersion.__init__cCs|jS)N)r.)rrrr__str__NszLegacyVersion.__str__cCsdjtt|S)Nz)formatreprr-)rrrr__repr__QszLegacyVersion.__repr__cCs|jS)N)r.)rrrrpublicTszLegacyVersion.publiccCs|jS)N)r.)rrrr base_versionXszLegacyVersion.base_versioncCsdS)Nr)rrrrr\szLegacyVersion.localcCsdS)NFr)rrrr is_prerelease`szLegacyVersion.is_prereleasecCsdS)NFr)rrrris_postreleasedszLegacyVersion.is_postreleaseN) rrrr0r1r4propertyr5r6rr7r8rrrrr Hs    z(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccsbxVtj|D]H}tj||}| s |dkr,q |dddkrJ|jdVq d|Vq WdVdS)N.r 0123456789*z*final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)rpartrrr_parse_version_partsrs rIcCsd}g}xlt|jD]\}|jdrh|dkrJx|rH|ddkrH|jq.Wx|rf|ddkrf|jqLW|j|qWt|}||fS) NrrBz*finalz*final-Z00000000rJrJ)rIlower startswithpopappendtuple)rr partsrHrrrr/s   r/a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@s|eZdZejdedejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZdS)rz^\s*z\s*$c	Cs|jj|}|stdj|t|jdr8t|jdndtdd|jdjdDt	|jd|jd	t	|jd
|jdp|jdt	|jd
|jdt
|jdd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'r
rcss|]}t|VqdS)N)int).0irrr	sz#Version.__init__..rr?Zpre_lZpre_nZpost_lZpost_n1Zpost_n2Zdev_lZdev_nr)r
rrrrr)_regexsearchr
r2rgrouprQrOrD_parse_letter_version_parse_local_versionr._cmpkeyr
rrrrrr)rrmatchrrrr0s.

zVersion.__init__cCsdjtt|S)Nz)r2r3r-)rrrrr4szVersion.__repr__cCsg}|jjdkr$|jdj|jj|jdjdd|jjD|jjdk	rl|jdjdd|jjD|jjdk	r|jdj|jjd	|jjdk	r|jd
j|jjd	|jj	dk	r|jdjdjdd|jj	Ddj|S)
Nrz{0}!r?css|]}t|VqdS)N)r-)rRxrrrrTsz"Version.__str__..css|]}t|VqdS)N)r-)rRr\rrrrTsz.post{0}rz.dev{0}z+{0}css|]}t|VqdS)N)r-)rRr\rrrrTs)
r.r
rNr2joinrrrrr)rrPrrrr1s zVersion.__str__cCst|jdddS)N+rr)r-rD)rrrrr5
szVersion.publiccCsLg}|jjdkr$|jdj|jj|jdjdd|jjDdj|S)Nrz{0}!r?css|]}t|VqdS)N)r-)rRr\rrrrTsz'Version.base_version..r])r.r
rNr2r^r)rrPrrrr6s
zVersion.base_versioncCs$t|}d|kr |jdddSdS)Nr_r)r-rD)rZversion_stringrrrrsz
Version.localcCst|jjp|jjS)N)boolr.rr)rrrrr7!szVersion.is_prereleasecCst|jjS)N)r`r.r)rrrrr8%szVersion.is_postreleaseN)rrrrecompilerVERBOSE
IGNORECASErUr0r4r1r9r5r6rr7r8rrrrrs
#
cCsx|rZ|dkrd}|j}|dkr&d}n(|dkr4d}n|d
krBd	}n|dkrNd}|t|fS|rt|rtd}|t|fSdS)NrZalphaaZbetabr:rr<r>revrr)r:rr<)rgrh)rKrQ)ZletterZnumberrrrrX*s 
rXz[\._-]cCs$|dk	r tddtj|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|js|jnt|VqdS)N)isdigitrKrQ)rRrHrrrrTRsz'_parse_local_version..)rO_local_version_seperatorsrD)rrrrrYLsrYcCsttttjddt|}|dkr@|dkr@|dk	r@t}n|dkrLt}|dkrZt}|dkrft}|dkrvt}ntdd|D}||||||fS)NcSs|dkS)Nrr)r\rrrr!`sz_cmpkey..css*|]"}t|tr|dfnt|fVqdS)r]N)r*rQr)rRrSrrrrTsz_cmpkey..)rOreversedlist	itertools	dropwhiler)r
rrrrrrrrrZWs&		
rZ)Z
__future__rrrcollectionsrmraZ_structuresr__all__
namedtuplerr
ValueErrorr
objectrr	rbrcrCrErIr/rrrXrjrYrZrrrrs.!
9k
PK!w6_vendor/packaging/__pycache__/__about__.cpython-36.pycnu[3

vh@sPddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS))absolute_importdivisionprint_function	__title____summary____uri____version__
__author__	__email____license__
__copyright__Z	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz16.8z)Donald Stufft and individual contributorszdonald@stufft.ioz"BSD or Apache License, Version 2.0zCopyright 2014-2016 %sN)
Z
__future__rrr__all__rrrrr	r
rrrr/usr/lib/python3.6/__about__.pys

PK!B!!:_vendor/packaging/__pycache__/markers.cpython-36.opt-1.pycnu[3

vh/ 	@s@ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZmZd	d
ddd
gZGdd	d	eZGdd
d
eZGdddeZGdddeZGdddeZGdddeZ GdddeZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"d#d"ddddd+Z#e"j$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&j$d8d-ed9ed:BZ'e'j$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*j$d>d-ed?j+Z,ed@j+Z-eZ.e*ee,e.e-BZ/e.e/e
e(e.>ee.eZ0dAdBZ1dSdDdEZ2dFd-dGd-ej3ej4ej5ej6ej7ej8dHZ9dIdJZ:eZ;dKdLZdQd
Z?GdRddeZ@dS)T)absolute_importdivisionprint_functionN)ParseExceptionParseResultsstringStart	stringEnd)
ZeroOrMoreGroupForwardQuotedString)Literal)string_types)	SpecifierInvalidSpecifier
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rr/usr/lib/python3.6/markers.pyrsc@seZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    N)rrrrrrrrrsc@seZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    N)rrrrrrrrr%sc@s,eZdZddZddZddZddZd	S)
NodecCs
||_dS)N)value)selfrrrr__init__.sz
Node.__init__cCs
t|jS)N)strr)rrrr__str__1szNode.__str__cCsdj|jjt|S)Nz<{0}({1!r})>)format	__class__rr!)rrrr__repr__4sz
Node.__repr__cCstdS)N)NotImplementedError)rrrr	serialize7szNode.serializeN)rrrr r"r%r'rrrrr,src@seZdZddZdS)VariablecCst|S)N)r!)rrrrr'=szVariable.serializeN)rrrr'rrrrr(;sr(c@seZdZddZdS)ValuecCs
dj|S)Nz"{0}")r#)rrrrr'CszValue.serializeN)rrrr'rrrrr)Asr)c@seZdZddZdS)OpcCst|S)N)r!)rrrrr'IszOp.serializeN)rrrr'rrrrr*Gsr*implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_namezos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationpython_implementationZextra)zos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationr6cCsttj|d|dS)Nr)r(ALIASESget)sltrrrisr<z===z==z>=z<=z!=z~=>sz(_coerce_parse_result..)
isinstancer)resultsrrrrGs
rGTcCst|tr4t|dkr4t|dttfr4t|dSt|trndd|D}|rZdj|Sddj|dSn"t|trdjdd	|DS|SdS)
Nrrcss|]}t|ddVqdS)F)firstN)_format_marker)rHmrrr	sz!_format_marker.. rErFcSsg|]}|jqSr)r')rHrOrrrrJsz"_format_marker..)rKlistlenrDrNjoin)markerrMinnerrrrrNs


rNcCs||kS)Nr)lhsrhsrrrr<scCs||kS)Nr)rWrXrrrr<s)r?znot inr>z<=z==z!=z>=r=c
Cslytdj|j|g}Wntk
r.YnX|j|Stj|j}|dkrbtdj||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.)	rrTr'rcontains
_operatorsr8rr#)rWoprXspecZoperrrr_eval_ops
r^cCs&|j|t}|tkr"tdj||S)Nz/{0!r} does not exist in evaluation environment.)r8
_undefinedrr#)environmentnamerrrr_get_envs
rbc	Csgg}x|D]}t|tr0|djt||qt|tr|\}}}t|trbt||j}|j}n|j}t||j}|djt|||q|dkr|jgqWt	dd|DS)NrrCcss|]}t|VqdS)N)all)rHitemrrrrPsz$_evaluate_markers..re)
rKrRappend_evaluate_markersrDr(rbrr^any)	Zmarkersr`groupsrUrWr\rXZ	lhs_valueZ	rhs_valuerrrrgs




rgcCs2dj|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r#releaselevelr!serial)infoversionZkindrrrformat_full_versions

rocCslttdr ttjj}tjj}nd}d}||tjtjtj	tj
tjtjtjtjddtjdS)Nimplementation0rY)r-r+r5r1r/r2r0r.r,r3r4)
hasattrsysrorprnraosplatformmachinereleasesystemr3r6)Ziverr-rrrrs 

c@s.eZdZddZddZddZd
dd	ZdS)rcCs`yttj||_WnFtk
rZ}z*dj|||j|jd}t|WYdd}~XnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rGMARKERZparseString_markersrr#locr)rrUeZerr_strrrrr szMarker.__init__cCs
t|jS)N)rNr|)rrrrr"szMarker.__str__cCsdjt|S)Nz)r#r!)rrrrr%szMarker.__repr__NcCs$t}|dk	r|j|t|j|S)a$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N)rupdatergr|)rr`Zcurrent_environmentrrrevaluate s	
zMarker.evaluate)N)rrrr r"r%rrrrrrs)T)AZ
__future__rrroperatorrurvrtZsetuptools.extern.pyparsingrrrrr	r
rrr
LZ_compatrZ
specifiersrr__all__
ValueErrorrrrobjectrr(r)r*ZVARIABLEr7ZsetParseActionZVERSION_CMPZ	MARKER_OPZMARKER_VALUEZBOOLOPZ
MARKER_VARZMARKER_ITEMsuppressZLPARENZRPARENZMARKER_EXPRZMARKER_ATOMr{rGrNltleeqnegegtr[r^r_rbrgrorrrrrrsx
	6


PK!w<_vendor/packaging/__pycache__/__about__.cpython-36.opt-1.pycnu[3

vh@sPddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS))absolute_importdivisionprint_function	__title____summary____uri____version__
__author__	__email____license__
__copyright__Z	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz16.8z)Donald Stufft and individual contributorszdonald@stufft.ioz"BSD or Apache License, Version 2.0zCopyright 2014-2016 %sN)
Z
__future__rrr__all__rrrrr	r
rrrr/usr/lib/python3.6/__about__.pys

PK!4_))4_vendor/packaging/__pycache__/version.cpython-36.pycnu[3

vh$-@sddlmZmZmZddlZddlZddlZddlmZddddd	gZ	ej
d
ddd
dddgZddZGddde
ZGdddeZGdddeZejdejZddddddZddZddZdZGd ddeZd!d"Zejd#Zd$d%Zd&d'ZdS)()absolute_importdivisionprint_functionN)InfinityparseVersion
LegacyVersionInvalidVersionVERSION_PATTERN_VersionepochreleasedevprepostlocalcCs&yt|Stk
r t|SXdS)z
    Parse the given version string and return either a :class:`Version` object
    or a :class:`LegacyVersion` object depending on if the given version is
    a valid PEP 440 version or a legacy version.
    N)rr
r	)versionr/usr/lib/python3.6/version.pyrsc@seZdZdZdS)r
zF
    An invalid version was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rrrrr
$sc@sLeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
dS)_BaseVersioncCs
t|jS)N)hash_key)selfrrr__hash__,sz_BaseVersion.__hash__cCs|j|ddS)NcSs||kS)Nr)sorrr0sz%_BaseVersion.__lt__..)_compare)rotherrrr__lt__/sz_BaseVersion.__lt__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!3sz%_BaseVersion.__le__..)r")rr#rrr__le__2sz_BaseVersion.__le__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!6sz%_BaseVersion.__eq__..)r")rr#rrr__eq__5sz_BaseVersion.__eq__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!9sz%_BaseVersion.__ge__..)r")rr#rrr__ge__8sz_BaseVersion.__ge__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!<sz%_BaseVersion.__gt__..)r")rr#rrr__gt__;sz_BaseVersion.__gt__cCs|j|ddS)NcSs||kS)Nr)rr rrrr!?sz%_BaseVersion.__ne__..)r")rr#rrr__ne__>sz_BaseVersion.__ne__cCst|tstS||j|jS)N)
isinstancerNotImplementedr)rr#methodrrrr"As
z_BaseVersion._compareN)rrrrr$r%r&r'r(r)r"rrrrr*src@s`eZdZddZddZddZeddZed	d
ZeddZ	ed
dZ
eddZdS)r	cCst||_t|j|_dS)N)str_version_legacy_cmpkeyr)rrrrr__init__Js
zLegacyVersion.__init__cCs|jS)N)r.)rrrr__str__NszLegacyVersion.__str__cCsdjtt|S)Nz)formatreprr-)rrrr__repr__QszLegacyVersion.__repr__cCs|jS)N)r.)rrrrpublicTszLegacyVersion.publiccCs|jS)N)r.)rrrrbase_versionXszLegacyVersion.base_versioncCsdS)Nr)rrrrr\szLegacyVersion.localcCsdS)NFr)rrrr
is_prerelease`szLegacyVersion.is_prereleasecCsdS)NFr)rrrris_postreleasedszLegacyVersion.is_postreleaseN)rrrr0r1r4propertyr5r6rr7r8rrrrr	Hsz(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccsbxVtj|D]H}tj||}|s|dkr,q|dddkrJ|jdVqd|VqWdVdS)N.r
0123456789*z*final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)rpartrrr_parse_version_partsrsrIcCsd}g}xlt|jD]\}|jdrh|dkrJx|rH|ddkrH|jq.Wx|rf|ddkrf|jqLW|j|qWt|}||fS)	NrrBz*finalz*final-Z00000000rJrJ)rIlower
startswithpopappendtuple)rr
partsrHrrrr/s
r/a
    v?
    (?:
        (?:(?P[0-9]+)!)?                           # epoch
        (?P[0-9]+(?:\.[0-9]+)*)                  # release segment
        (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@s|eZdZejdedejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZdS)rz^\s*z\s*$c	Cs|jj|}|stdj|t|jdr8t|jdndtdd|jdjdDt	|jd|jd	t	|jd
|jdp|jdt	|jd
|jdt
|jdd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'r
rcss|]}t|VqdS)N)int).0irrr	sz#Version.__init__..rr?Zpre_lZpre_nZpost_lZpost_n1Zpost_n2Zdev_lZdev_nr)r
rrrrr)_regexsearchr
r2rgrouprQrOrD_parse_letter_version_parse_local_versionr._cmpkeyr
rrrrrr)rrmatchrrrr0s.

zVersion.__init__cCsdjtt|S)Nz)r2r3r-)rrrrr4szVersion.__repr__cCsg}|jjdkr$|jdj|jj|jdjdd|jjD|jjdk	rl|jdjdd|jjD|jjdk	r|jdj|jjd	|jjdk	r|jd
j|jjd	|jj	dk	r|jdjdjdd|jj	Ddj|S)
Nrz{0}!r?css|]}t|VqdS)N)r-)rRxrrrrTsz"Version.__str__..css|]}t|VqdS)N)r-)rRr\rrrrTsz.post{0}rz.dev{0}z+{0}css|]}t|VqdS)N)r-)rRr\rrrrTs)
r.r
rNr2joinrrrrr)rrPrrrr1s zVersion.__str__cCst|jdddS)N+rr)r-rD)rrrrr5
szVersion.publiccCsLg}|jjdkr$|jdj|jj|jdjdd|jjDdj|S)Nrz{0}!r?css|]}t|VqdS)N)r-)rRr\rrrrTsz'Version.base_version..r])r.r
rNr2r^r)rrPrrrr6s
zVersion.base_versioncCs$t|}d|kr |jdddSdS)Nr_r)r-rD)rZversion_stringrrrrsz
Version.localcCst|jjp|jjS)N)boolr.rr)rrrrr7!szVersion.is_prereleasecCst|jjS)N)r`r.r)rrrrr8%szVersion.is_postreleaseN)rrrrecompilerVERBOSE
IGNORECASErUr0r4r1r9r5r6rr7r8rrrrrs
#
cCsx|rZ|dkrd}|j}|dkr&d}n(|dkr4d}n|d
krBd	}n|dkrNd}|t|fS|rt|rtd}|t|fSdS)NrZalphaaZbetabr:rr<r>revrr)r:rr<)rgrh)rKrQ)ZletterZnumberrrrrX*s 
rXz[\._-]cCs$|dk	r tddtj|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|js|jnt|VqdS)N)isdigitrKrQ)rRrHrrrrTRsz'_parse_local_version..)rO_local_version_seperatorsrD)rrrrrYLsrYcCsttttjddt|}|dkr@|dkr@|dk	r@t}n|dkrLt}|dkrZt}|dkrft}|dkrvt}ntdd|D}||||||fS)NcSs|dkS)Nrr)r\rrrr!`sz_cmpkey..css*|]"}t|tr|dfnt|fVqdS)r]N)r*rQr)rRrSrrrrTsz_cmpkey..)rOreversedlist	itertools	dropwhiler)r
rrrrrrrrrZWs&		
rZ)Z
__future__rrrcollectionsrmraZ_structuresr__all__
namedtuplerr
ValueErrorr
objectrr	rbrcrCrErIr/rrrXrjrYrZrrrrs.!
9k
PK!\Ov9_vendor/packaging/__pycache__/requirements.cpython-36.pycnu[3

vh@srddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZmZdd	lmZmZmZGd
ddeZeejejZ edj!Z"ed
j!Z#edj!Z$edj!Z%edj!Z&edj!Z'edj!Z(edZ)e ee)e BZ*ee ee*Z+e+dZ,e+Z-eddZ.e(e.Z/e-ee&e-Z0e"e
e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7ee&e7ddddZ8e
e$e8e%e8BZ9e9j:dde	e9dZ;e;j:dde	edZej:d de'Ze/e
e=Z?e,e
e1e?e>BZ@ee@eZAGd!d"d"eBZCdS)#)absolute_importdivisionprint_functionN)stringStart	stringEndoriginalTextForParseException)
ZeroOrMoreWordOptionalRegexCombine)Literal)parse)MARKER_EXPRMarker)LegacySpecifier	SpecifierSpecifierSetc@seZdZdZdS)InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rr"/usr/lib/python3.6/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)Z
joinStringZadjacent	_raw_speccCs
|jpdS)N)r')sltrrr6sr,	specifiercCs|dS)Nrr)r)r*r+rrrr,9smarkercCst||j|jS)N)rZ_original_startZ
_original_end)r)r*r+rrrr,=sc@s(eZdZdZddZddZddZdS)	RequirementzParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    cCsytj|}Wn@tk
rN}z$tdj||j|jdWYdd}~XnX|j|_|jrtj|j}|j	ot|j
s|j	r|j
rtd|j|_nd|_t|jr|jj
ng|_t|j|_|jr|jnd|_dS)Nz+Invalid requirement, parse error at "{0!r}"zInvalid URL given)REQUIREMENTZparseStringrrformatlocr$r%urlparseschemeZnetlocsetr&ZasListrr-r.)selfZrequirement_stringZreqeZ
parsed_urlrrr__init__Xs"*
zRequirement.__init__cCsz|jg}|jr*|jdjdjt|j|jr@|jt|j|jrX|jdj|j|j	rp|jdj|j	dj|S)Nz[{0}]r!z@ {0}z; {0}r()
r$r&appendr2joinsortedr-strr%r.)r7partsrrr__str__mszRequirement.__str__cCsdjt|S)Nz)r2r=)r7rrr__repr__~szRequirement.__repr__N)rrrrr9r?r@rrrrr/Ksr/)DZ
__future__rrrstringreZsetuptools.extern.pyparsingrrrrr	r
rrr
rLZ"setuptools.extern.six.moves.urllibrr4ZmarkersrrZ
specifiersrrr
ValueErrorrZ
ascii_lettersZdigitsZALPHANUMsuppressZLBRACKETZRBRACKETZLPARENZRPARENCOMMAZ	SEMICOLONATZPUNCTUATIONZIDENTIFIER_ENDZ
IDENTIFIERNAMEZEXTRAZURIZURLZEXTRAS_LISTZEXTRASZ
_regex_strVERBOSE
IGNORECASEZVERSION_PEP440ZVERSION_LEGACYZVERSION_ONEZVERSION_MANYZ
_VERSION_SPECZsetParseActionZVERSION_SPECZMARKER_SEPERATORZMARKERZVERSION_AND_MARKERZURL_AND_MARKERZNAMED_REQUIREMENTr1objectr/rrrrsZ
PK!{

>_vendor/packaging/__pycache__/_structures.cpython-36.opt-1.pycnu[3

vh@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)InfinitycCsdS)Nr)selfrr!/usr/lib/python3.6/_structures.py__repr__	szInfinity.__repr__cCstt|S)N)hashrepr)rrrr__hash__szInfinity.__hash__cCsdS)NFr)rotherrrr__lt__szInfinity.__lt__cCsdS)NFr)rr
rrr__le__szInfinity.__le__cCst||jS)N)
isinstance	__class__)rr
rrr__eq__szInfinity.__eq__cCst||jS)N)rr)rr
rrr__ne__szInfinity.__ne__cCsdS)NTr)rr
rrr__gt__szInfinity.__gt__cCsdS)NTr)rr
rrr__ge__szInfinity.__ge__cCstS)N)NegativeInfinity)rrrr__neg__!szInfinity.__neg__N)__name__
__module____qualname__r	rrrrrrrrrrrrrsrc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)rcCsdS)Nz	-Infinityr)rrrrr	)szNegativeInfinity.__repr__cCstt|S)N)r
r)rrrrr,szNegativeInfinity.__hash__cCsdS)NTr)rr
rrrr/szNegativeInfinity.__lt__cCsdS)NTr)rr
rrrr2szNegativeInfinity.__le__cCst||jS)N)rr)rr
rrrr5szNegativeInfinity.__eq__cCst||jS)N)rr)rr
rrrr8szNegativeInfinity.__ne__cCsdS)NFr)rr
rrrr;szNegativeInfinity.__gt__cCsdS)NFr)rr
rrrr>szNegativeInfinity.__ge__cCstS)N)r)rrrrrAszNegativeInfinity.__neg__N)rrrr	rrrrrrrrrrrrr'srN)Z
__future__rrrobjectrrrrrrsPK!098_vendor/packaging/__pycache__/utils.cpython-36.opt-1.pycnu[3

vh@s2ddlmZmZmZddlZejdZddZdS))absolute_importdivisionprint_functionNz[-_.]+cCstjd|jS)N-)_canonicalize_regexsublower)namer
/usr/lib/python3.6/utils.pycanonicalize_namesr)Z
__future__rrrrecompilerrr
r
r
rs
PK!tsMM7_vendor/packaging/__pycache__/specifiers.cpython-36.pycnu[3

vhym@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGdddeZGdd	d	e
ejeZGd
ddeZGdd
d
eZddZGdddeZejdZddZddZGdddeZdS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)Version
LegacyVersionparsec@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rr /usr/lib/python3.6/specifiers.pyrsrc@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr)selfrrr__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nr)rrrr__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr)rotherrrr__eq__$szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nr)rrrrr__ne__+szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rrrrprereleases2szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rvaluerrrr9sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr)ritemrrrrcontains@szBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterablerrrrfilterFszBaseSpecifier.filter)N)N)rr
rabcabstractmethodrrrrabstractpropertyrsetterrrrrrrrsrc@seZdZiZd ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZeddZejddZddZd!ddZd"ddZdS)#_IndividualSpecifierNcCsF|jj|}|stdj||jdj|jdjf|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecrmatchrrr__init__Rsz_IndividualSpecifier.__init__cCs0|jdk	rdj|jnd}dj|jjt||S)Nz, prereleases={0!r}r$z<{0}({1!r}{2})>)r-r)r	__class__rstr)rprerrr__repr___sz_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r)r,)rrrrrlsz_IndividualSpecifier.__str__cCs
t|jS)N)hashr,)rrrrrosz_IndividualSpecifier.__hash__cCsLt|tr0y|j|}Wq@tk
r,tSXnt||js@tS|j|jkS)N)
isinstancerr1rNotImplementedr,)rrrrrrrs
z_IndividualSpecifier.__eq__cCsLt|tr0y|j|}Wq@tk
r,tSXnt||js@tS|j|jkS)N)r6rr1rr7r,)rrrrrr}s
z_IndividualSpecifier.__ne__cCst|dj|j|S)Nz_compare_{0})getattrr)
_operators)roprrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|S)N)r6r	rr
)rr&rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr)r,)rrrrr%sz_IndividualSpecifier.operatorcCs
|jdS)Nr)r,)rrrrr&sz_IndividualSpecifier.versioncCs|jS)N)r-)rrrrrsz _IndividualSpecifier.prereleasescCs
||_dS)N)r-)rrrrrrscCs
|j|S)N)r)rrrrr__contains__sz!_IndividualSpecifier.__contains__cCs<|dkr|j}|j|}|jr(|r(dS|j|j||jS)NF)rr<
is_prereleaser;r%r&)rrrrrrrs
z_IndividualSpecifier.containsccsd}g}d|dk	r|ndi}xL|D]D}|j|}|j|f|r"|jr\|pL|jr\|j|q"d}|Vq"W|r|rx|D]
}|VqzWdS)NFrT)r<rr>rappend)rrrZyieldedfound_prereleaseskwr&parsed_versionrrrrs




z_IndividualSpecifier.filter)r$N)N)N)rr
rr9r0r4rrrrr;r<propertyr%r&rr"r=rrrrrrr#Ns 



r#c@sveZdZdZejdedejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        z^\s*z\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)z==z!=z<=z>=<>cCst|tstt|}|S)N)r6r	r2)rr&rrrr<s
zLegacySpecifier._coerce_versioncCs||j|kS)N)r<)rprospectiver.rrr_compare_equalszLegacySpecifier._compare_equalcCs||j|kS)N)r<)rrMr.rrr_compare_not_equalsz"LegacySpecifier._compare_not_equalcCs||j|kS)N)r<)rrMr.rrr_compare_less_than_equalsz(LegacySpecifier._compare_less_than_equalcCs||j|kS)N)r<)rrMr.rrr_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs||j|kS)N)r<)rrMr.rrr_compare_less_thansz"LegacySpecifier._compare_less_thancCs||j|kS)N)r<)rrMr.rrr_compare_greater_thansz%LegacySpecifier._compare_greater_thanN)rr
r
_regex_strrecompileVERBOSE
IGNORECASEr'r9r<rNrOrPrQrRrSrrrrrDs 
rDcstjfdd}|S)Ncst|tsdS|||S)NF)r6r)rrMr.)fnrrwrappeds
z)_require_version_compare..wrapped)	functoolswraps)rYrZr)rYr_require_version_compare
sr]c	@seZdZdZejdedejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=rKrLz===cCsNdjttjddt|dd}|d7}|jd||oL|jd||S)	N.cSs|jdo|jdS)NZpostZdev)
startswith)xrrrsz/Specifier._compare_compatible..rz.*z>=z==)joinlist	itertools	takewhile_version_splitr;)rrMr.prefixrrr_compare_compatibles
zSpecifier._compare_compatiblecCsp|jdrPt|j}t|dd}tt|}|dt|}t||\}}nt|}|jsht|j}||kS)Nz.*)endswithrZpublicrhr2len_pad_versionlocal)rrMr.rrrrNs


zSpecifier._compare_equalcCs|j||S)N)rN)rrMr.rrrrOszSpecifier._compare_not_equalcCs|t|kS)N)r)rrMr.rrrrPsz"Specifier._compare_less_than_equalcCs|t|kS)N)r)rrMr.rrrrQsz%Specifier._compare_greater_than_equalcCs>t|}||ksdS|jr:|jr:t|jt|jkr:dSdS)NFT)rr>base_version)rrMr.rrrrRszSpecifier._compare_less_thancCs`t|}||ksdS|jr:|jr:t|jt|jkr:dS|jdk	r\t|jt|jkr\dSdS)NFT)rZis_postreleaserqrp)rrMr.rrrrSs
zSpecifier._compare_greater_thancCst|jt|jkS)N)r2lower)rrMr.rrr_compare_arbitraryszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|d
krN|dkr@|jdr@|dd}t|jrNdSd	S)N==>=<=~====z.*rkTF)rtrurvrwrxrl)r-r,rmr
r>)rr%r&rrrrs


zSpecifier.prereleasescCs
||_dS)N)r-)rrrrrrsN)rr
rrTrUrVrWrXr'r9r]rjrNrOrPrQrRrSrsrCrr"rrrrr^s*^#r^z^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCsDg}x:|jdD],}tj|}|r2|j|jq|j|qW|S)Nr_)split
_prefix_regexr(extendgroupsr?)r&resultrr/rrrrh's
rhc	Csgg}}|jttjdd||jttjdd||j|t|dd|j|t|dd|jddgtdt|dt|d|jddgtdt|dt|dttj|ttj|fS)NcSs|jS)N)isdigit)rarrrrb6sz_pad_version..cSs|jS)N)r~)rarrrrb7srr0)r?rerfrgrninsertmaxchain)leftrightZ
left_splitZright_splitrrrro2s
&&roc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr$NcCsrdd|jdD}t}xB|D]:}y|jt|Wq tk
rX|jt|Yq Xq Wt||_||_dS)NcSsg|]}|jr|jqSr)r+).0srrr
Rsz)SpecifierSet.__init__..,)	rysetaddr^rrD	frozenset_specsr-)rZ
specifiersrZparsed	specifierrrrr0Os

zSpecifierSet.__init__cCs*|jdk	rdj|jnd}djt||S)Nz, prereleases={0!r}r$z)r-r)rr2)rr3rrrr4dszSpecifierSet.__repr__cCsdjtdd|jDS)Nrcss|]}t|VqdS)N)r2)rrrrr	nsz'SpecifierSet.__str__..)rdsortedr)rrrrrmszSpecifierSet.__str__cCs
t|jS)N)r5r)rrrrrpszSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r6rrr7rrr-
ValueError)rrrrrr__and__ss





zSpecifierSet.__and__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkS)N)r6rrr#r2r7r)rrrrrrs



zSpecifierSet.__eq__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkS)N)r6rrr#r2r7r)rrrrrrs



zSpecifierSet.__ne__cCs
t|jS)N)rnr)rrrr__len__szSpecifierSet.__len__cCs
t|jS)N)iterr)rrrr__iter__szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd|jDS)Ncss|]}|jVqdS)N)r)rrrrrrsz+SpecifierSet.prereleases..)r-rany)rrrrrs

zSpecifierSet.prereleasescCs
||_dS)N)r-)rrrrrrscCs
|j|S)N)r)rrrrrr=szSpecifierSet.__contains__csNtttfstdkr$|jr4jr4dStfdd|jDS)NFc3s|]}|jdVqdS))rN)r)rr)rrrrrsz(SpecifierSet.contains..)r6r	rr
rr>allr)rrrr)rrrrszSpecifierSet.containscCs|dkr|j}|jr:x |jD]}|j|t|d}qW|Sg}g}xZ|D]R}t|ttfsdt|}n|}t|trtqH|jr|r|s|j	|qH|j	|qHW|r|r|dkr|S|SdS)N)r)
rrrboolr6r	rr
r>r?)rrrr.Zfilteredr@rrBrrrrs*


zSpecifierSet.filter)r$N)N)N)rr
rr0r4rrrrrrrrCrr"r=rrrrrrrMs
	


r)Z
__future__rrrrr[rfrUZ_compatrrr&rr	r
rrABCMetaobjectrr#rDr]r^rVrzrhrorrrrrs&9	4	
PK!\Ov?_vendor/packaging/__pycache__/requirements.cpython-36.opt-1.pycnu[3

vh@srddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZmZdd	lmZmZmZGd
ddeZeejejZ edj!Z"ed
j!Z#edj!Z$edj!Z%edj!Z&edj!Z'edj!Z(edZ)e ee)e BZ*ee ee*Z+e+dZ,e+Z-eddZ.e(e.Z/e-ee&e-Z0e"e
e0e#dZ1eej2ej3ej4BZ5eej2ej3ej4BZ6e5e6AZ7ee7ee&e7ddddZ8e
e$e8e%e8BZ9e9j:dde	e9dZ;e;j:dde	edZej:d de'Ze/e
e=Z?e,e
e1e?e>BZ@ee@eZAGd!d"d"eBZCdS)#)absolute_importdivisionprint_functionN)stringStart	stringEndoriginalTextForParseException)
ZeroOrMoreWordOptionalRegexCombine)Literal)parse)MARKER_EXPRMarker)LegacySpecifier	SpecifierSpecifierSetc@seZdZdZdS)InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rr"/usr/lib/python3.6/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)Z
joinStringZadjacent	_raw_speccCs
|jpdS)N)r')sltrrr6sr,	specifiercCs|dS)Nrr)r)r*r+rrrr,9smarkercCst||j|jS)N)rZ_original_startZ
_original_end)r)r*r+rrrr,=sc@s(eZdZdZddZddZddZdS)	RequirementzParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    cCsytj|}Wn@tk
rN}z$tdj||j|jdWYdd}~XnX|j|_|jrtj|j}|j	ot|j
s|j	r|j
rtd|j|_nd|_t|jr|jj
ng|_t|j|_|jr|jnd|_dS)Nz+Invalid requirement, parse error at "{0!r}"zInvalid URL given)REQUIREMENTZparseStringrrformatlocr$r%urlparseschemeZnetlocsetr&ZasListrr-r.)selfZrequirement_stringZreqeZ
parsed_urlrrr__init__Xs"*
zRequirement.__init__cCsz|jg}|jr*|jdjdjt|j|jr@|jt|j|jrX|jdj|j|j	rp|jdj|j	dj|S)Nz[{0}]r!z@ {0}z; {0}r()
r$r&appendr2joinsortedr-strr%r.)r7partsrrr__str__mszRequirement.__str__cCsdjt|S)Nz)r2r=)r7rrr__repr__~szRequirement.__repr__N)rrrrr9r?r@rrrrr/Ksr/)DZ
__future__rrrstringreZsetuptools.extern.pyparsingrrrrr	r
rrr
rLZ"setuptools.extern.six.moves.urllibrr4ZmarkersrrZ
specifiersrrr
ValueErrorrZ
ascii_lettersZdigitsZALPHANUMsuppressZLBRACKETZRBRACKETZLPARENZRPARENCOMMAZ	SEMICOLONATZPUNCTUATIONZIDENTIFIER_ENDZ
IDENTIFIERNAMEZEXTRAZURIZURLZEXTRAS_LISTZEXTRASZ
_regex_strVERBOSE
IGNORECASEZVERSION_PEP440ZVERSION_LEGACYZVERSION_ONEZVERSION_MANYZ
_VERSION_SPECZsetParseActionZVERSION_SPECZMARKER_SEPERATORZMARKERZVERSION_AND_MARKERZURL_AND_MARKERZNAMED_REQUIREMENTr1objectr/rrrrsZ
PK!{

8_vendor/packaging/__pycache__/_structures.cpython-36.pycnu[3

vh@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)InfinitycCsdS)Nr)selfrr!/usr/lib/python3.6/_structures.py__repr__	szInfinity.__repr__cCstt|S)N)hashrepr)rrrr__hash__szInfinity.__hash__cCsdS)NFr)rotherrrr__lt__szInfinity.__lt__cCsdS)NFr)rr
rrr__le__szInfinity.__le__cCst||jS)N)
isinstance	__class__)rr
rrr__eq__szInfinity.__eq__cCst||jS)N)rr)rr
rrr__ne__szInfinity.__ne__cCsdS)NTr)rr
rrr__gt__szInfinity.__gt__cCsdS)NTr)rr
rrr__ge__szInfinity.__ge__cCstS)N)NegativeInfinity)rrrr__neg__!szInfinity.__neg__N)__name__
__module____qualname__r	rrrrrrrrrrrrrsrc@sTeZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZdS)rcCsdS)Nz	-Infinityr)rrrrr	)szNegativeInfinity.__repr__cCstt|S)N)r
r)rrrrr,szNegativeInfinity.__hash__cCsdS)NTr)rr
rrrr/szNegativeInfinity.__lt__cCsdS)NTr)rr
rrrr2szNegativeInfinity.__le__cCst||jS)N)rr)rr
rrrr5szNegativeInfinity.__eq__cCst||jS)N)rr)rr
rrrr8szNegativeInfinity.__ne__cCsdS)NFr)rr
rrrr;szNegativeInfinity.__gt__cCsdS)NFr)rr
rrrr>szNegativeInfinity.__ge__cCstS)N)r)rrrrrAszNegativeInfinity.__neg__N)rrrr	rrrrrrrrrrrrr'srN)Z
__future__rrrobjectrrrrrrsPK!1EŜ:_vendor/packaging/__pycache__/_compat.cpython-36.opt-1.pycnu[3

vh\@sVddlmZmZmZddlZejddkZejddkZerDefZ	ne
fZ	ddZdS))absolute_importdivisionprint_functionNcs&Gfddd}tj|dfiS)z/
    Create a base class with a metaclass.
    cseZdZfddZdS)z!with_metaclass..metaclasscs||S)N)clsnameZ
this_basesd)basesmetar/usr/lib/python3.6/_compat.py__new__sz)with_metaclass..metaclass.__new__N)__name__
__module____qualname__rr)rrrr
	metaclasssrZtemporary_class)typer)rrrr)rrr
with_metaclasssr)Z
__future__rrrsysversion_infoZPY2ZPY3strZstring_typesZ
basestringrrrrr
sPK!1EŜ4_vendor/packaging/__pycache__/_compat.cpython-36.pycnu[3

vh\@sVddlmZmZmZddlZejddkZejddkZerDefZ	ne
fZ	ddZdS))absolute_importdivisionprint_functionNcs&Gfddd}tj|dfiS)z/
    Create a base class with a metaclass.
    cseZdZfddZdS)z!with_metaclass..metaclasscs||S)N)clsnameZ
this_basesd)basesmetar/usr/lib/python3.6/_compat.py__new__sz)with_metaclass..metaclass.__new__N)__name__
__module____qualname__rr)rrrr
	metaclasssrZtemporary_class)typer)rrrr)rrr
with_metaclasssr)Z
__future__rrrsysversion_infoZPY2ZPY3strZstring_typesZ
basestringrrrrr
sPK!ckX5_vendor/packaging/__pycache__/__init__.cpython-36.pycnu[3

vh@sTddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZdddddd	d
dgZ
dS)
)absolute_importdivisionprint_function)
__author__
__copyright__	__email____license____summary__	__title____uri____version__rr
rr
rrr	rN)Z
__future__rrr	__about__rrrr	r
rrr
__all__rr/usr/lib/python3.6/__init__.pys(
PK!tsMM=_vendor/packaging/__pycache__/specifiers.cpython-36.opt-1.pycnu[3

vhym@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGdddeZGdd	d	e
ejeZGd
ddeZGdd
d
eZddZGdddeZejdZddZddZGdddeZdS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)Version
LegacyVersionparsec@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rr /usr/lib/python3.6/specifiers.pyrsrc@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr)selfrrr__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nr)rrrr__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr)rotherrrr__eq__$szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nr)rrrrr__ne__+szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rrrrprereleases2szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rvaluerrrr9sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr)ritemrrrrcontains@szBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterablerrrrfilterFszBaseSpecifier.filter)N)N)rr
rabcabstractmethodrrrrabstractpropertyrsetterrrrrrrrsrc@seZdZiZd ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZeddZejddZddZd!ddZd"ddZdS)#_IndividualSpecifierNcCsF|jj|}|stdj||jdj|jdjf|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecrmatchrrr__init__Rsz_IndividualSpecifier.__init__cCs0|jdk	rdj|jnd}dj|jjt||S)Nz, prereleases={0!r}r$z<{0}({1!r}{2})>)r-r)r	__class__rstr)rprerrr__repr___sz_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r)r,)rrrrrlsz_IndividualSpecifier.__str__cCs
t|jS)N)hashr,)rrrrrosz_IndividualSpecifier.__hash__cCsLt|tr0y|j|}Wq@tk
r,tSXnt||js@tS|j|jkS)N)
isinstancerr1rNotImplementedr,)rrrrrrrs
z_IndividualSpecifier.__eq__cCsLt|tr0y|j|}Wq@tk
r,tSXnt||js@tS|j|jkS)N)r6rr1rr7r,)rrrrrr}s
z_IndividualSpecifier.__ne__cCst|dj|j|S)Nz_compare_{0})getattrr)
_operators)roprrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|S)N)r6r	rr
)rr&rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr)r,)rrrrr%sz_IndividualSpecifier.operatorcCs
|jdS)Nr)r,)rrrrr&sz_IndividualSpecifier.versioncCs|jS)N)r-)rrrrrsz _IndividualSpecifier.prereleasescCs
||_dS)N)r-)rrrrrrscCs
|j|S)N)r)rrrrr__contains__sz!_IndividualSpecifier.__contains__cCs<|dkr|j}|j|}|jr(|r(dS|j|j||jS)NF)rr<
is_prereleaser;r%r&)rrrrrrrs
z_IndividualSpecifier.containsccsd}g}d|dk	r|ndi}xL|D]D}|j|}|j|f|r"|jr\|pL|jr\|j|q"d}|Vq"W|r|rx|D]
}|VqzWdS)NFrT)r<rr>rappend)rrrZyieldedfound_prereleaseskwr&parsed_versionrrrrs




z_IndividualSpecifier.filter)r$N)N)N)rr
rr9r0r4rrrrr;r<propertyr%r&rr"r=rrrrrrr#Ns 



r#c@sveZdZdZejdedejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        z^\s*z\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)z==z!=z<=z>=<>cCst|tstt|}|S)N)r6r	r2)rr&rrrr<s
zLegacySpecifier._coerce_versioncCs||j|kS)N)r<)rprospectiver.rrr_compare_equalszLegacySpecifier._compare_equalcCs||j|kS)N)r<)rrMr.rrr_compare_not_equalsz"LegacySpecifier._compare_not_equalcCs||j|kS)N)r<)rrMr.rrr_compare_less_than_equalsz(LegacySpecifier._compare_less_than_equalcCs||j|kS)N)r<)rrMr.rrr_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs||j|kS)N)r<)rrMr.rrr_compare_less_thansz"LegacySpecifier._compare_less_thancCs||j|kS)N)r<)rrMr.rrr_compare_greater_thansz%LegacySpecifier._compare_greater_thanN)rr
r
_regex_strrecompileVERBOSE
IGNORECASEr'r9r<rNrOrPrQrRrSrrrrrDs 
rDcstjfdd}|S)Ncst|tsdS|||S)NF)r6r)rrMr.)fnrrwrappeds
z)_require_version_compare..wrapped)	functoolswraps)rYrZr)rYr_require_version_compare
sr]c	@seZdZdZejdedejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=rKrLz===cCsNdjttjddt|dd}|d7}|jd||oL|jd||S)	N.cSs|jdo|jdS)NZpostZdev)
startswith)xrrrsz/Specifier._compare_compatible..rz.*z>=z==)joinlist	itertools	takewhile_version_splitr;)rrMr.prefixrrr_compare_compatibles
zSpecifier._compare_compatiblecCsp|jdrPt|j}t|dd}tt|}|dt|}t||\}}nt|}|jsht|j}||kS)Nz.*)endswithrZpublicrhr2len_pad_versionlocal)rrMr.rrrrNs


zSpecifier._compare_equalcCs|j||S)N)rN)rrMr.rrrrOszSpecifier._compare_not_equalcCs|t|kS)N)r)rrMr.rrrrPsz"Specifier._compare_less_than_equalcCs|t|kS)N)r)rrMr.rrrrQsz%Specifier._compare_greater_than_equalcCs>t|}||ksdS|jr:|jr:t|jt|jkr:dSdS)NFT)rr>base_version)rrMr.rrrrRszSpecifier._compare_less_thancCs`t|}||ksdS|jr:|jr:t|jt|jkr:dS|jdk	r\t|jt|jkr\dSdS)NFT)rZis_postreleaserqrp)rrMr.rrrrSs
zSpecifier._compare_greater_thancCst|jt|jkS)N)r2lower)rrMr.rrr_compare_arbitraryszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|d
krN|dkr@|jdr@|dd}t|jrNdSd	S)N==>=<=~====z.*rkTF)rtrurvrwrxrl)r-r,rmr
r>)rr%r&rrrrs


zSpecifier.prereleasescCs
||_dS)N)r-)rrrrrrsN)rr
rrTrUrVrWrXr'r9r]rjrNrOrPrQrRrSrsrCrr"rrrrr^s*^#r^z^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCsDg}x:|jdD],}tj|}|r2|j|jq|j|qW|S)Nr_)split
_prefix_regexr(extendgroupsr?)r&resultrr/rrrrh's
rhc	Csgg}}|jttjdd||jttjdd||j|t|dd|j|t|dd|jddgtdt|dt|d|jddgtdt|dt|dttj|ttj|fS)NcSs|jS)N)isdigit)rarrrrb6sz_pad_version..cSs|jS)N)r~)rarrrrb7srr0)r?rerfrgrninsertmaxchain)leftrightZ
left_splitZright_splitrrrro2s
&&roc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr$NcCsrdd|jdD}t}xB|D]:}y|jt|Wq tk
rX|jt|Yq Xq Wt||_||_dS)NcSsg|]}|jr|jqSr)r+).0srrr
Rsz)SpecifierSet.__init__..,)	rysetaddr^rrD	frozenset_specsr-)rZ
specifiersrZparsed	specifierrrrr0Os

zSpecifierSet.__init__cCs*|jdk	rdj|jnd}djt||S)Nz, prereleases={0!r}r$z)r-r)rr2)rr3rrrr4dszSpecifierSet.__repr__cCsdjtdd|jDS)Nrcss|]}t|VqdS)N)r2)rrrrr	nsz'SpecifierSet.__str__..)rdsortedr)rrrrrmszSpecifierSet.__str__cCs
t|jS)N)r5r)rrrrrpszSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r6rrr7rrr-
ValueError)rrrrrr__and__ss





zSpecifierSet.__and__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkS)N)r6rrr#r2r7r)rrrrrrs



zSpecifierSet.__eq__cCsFt|trt|}n&t|tr,tt|}nt|ts:tS|j|jkS)N)r6rrr#r2r7r)rrrrrrs



zSpecifierSet.__ne__cCs
t|jS)N)rnr)rrrr__len__szSpecifierSet.__len__cCs
t|jS)N)iterr)rrrr__iter__szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd|jDS)Ncss|]}|jVqdS)N)r)rrrrrrsz+SpecifierSet.prereleases..)r-rany)rrrrrs

zSpecifierSet.prereleasescCs
||_dS)N)r-)rrrrrrscCs
|j|S)N)r)rrrrrr=szSpecifierSet.__contains__csNtttfstdkr$|jr4jr4dStfdd|jDS)NFc3s|]}|jdVqdS))rN)r)rr)rrrrrsz(SpecifierSet.contains..)r6r	rr
rr>allr)rrrr)rrrrszSpecifierSet.containscCs|dkr|j}|jr:x |jD]}|j|t|d}qW|Sg}g}xZ|D]R}t|ttfsdt|}n|}t|trtqH|jr|r|s|j	|qH|j	|qHW|r|r|dkr|S|SdS)N)r)
rrrboolr6r	rr
r>r?)rrrr.Zfilteredr@rrBrrrrs*


zSpecifierSet.filter)r$N)N)N)rr
rr0r4rrrrrrrrCrr"r=rrrrrrrMs
	


r)Z
__future__rrrrr[rfrUZ_compatrrr&rr	r
rrABCMetaobjectrr#rDr]r^rVrzrhrorrrrrs&9	4	
PK!ckX;_vendor/packaging/__pycache__/__init__.cpython-36.opt-1.pycnu[3

vh@sTddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZdddddd	d
dgZ
dS)
)absolute_importdivisionprint_function)
__author__
__copyright__	__email____license____summary__	__title____uri____version__rr
rr
rrr	rN)Z
__future__rrr	__about__rrrr	r
rrr
__all__rr/usr/lib/python3.6/__init__.pys(
PK! \I0a"a"4_vendor/packaging/__pycache__/markers.cpython-36.pycnu[3

vh/ 	@s@ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZmZd	d
ddd
gZGdd	d	eZGdd
d
eZGdddeZGdddeZGdddeZGdddeZ GdddeZ!ededBedBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*BZ"d#d"ddddd+Z#e"j$d,d-ed.ed/Bed0Bed1Bed2Bed3Bed4Bed5BZ%e%ed6Bed7BZ&e&j$d8d-ed9ed:BZ'e'j$d;d-ed<ed=BZ(e"e'BZ)ee)e&e)Z*e*j$d>d-ed?j+Z,ed@j+Z-eZ.e*ee,e.e-BZ/e.e/e
e(e.>ee.eZ0dAdBZ1dSdDdEZ2dFd-dGd-ej3ej4ej5ej6ej7ej8dHZ9dIdJZ:eZ;dKdLZdQd
Z?GdRddeZ@dS)T)absolute_importdivisionprint_functionN)ParseExceptionParseResultsstringStart	stringEnd)
ZeroOrMoreGroupForwardQuotedString)Literal)string_types)	SpecifierInvalidSpecifier
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rr/usr/lib/python3.6/markers.pyrsc@seZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    N)rrrrrrrrrsc@seZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    N)rrrrrrrrr%sc@s,eZdZddZddZddZddZd	S)
NodecCs
||_dS)N)value)selfrrrr__init__.sz
Node.__init__cCs
t|jS)N)strr)rrrr__str__1szNode.__str__cCsdj|jjt|S)Nz<{0}({1!r})>)format	__class__rr!)rrrr__repr__4sz
Node.__repr__cCstdS)N)NotImplementedError)rrrr	serialize7szNode.serializeN)rrrr r"r%r'rrrrr,src@seZdZddZdS)VariablecCst|S)N)r!)rrrrr'=szVariable.serializeN)rrrr'rrrrr(;sr(c@seZdZddZdS)ValuecCs
dj|S)Nz"{0}")r#)rrrrr'CszValue.serializeN)rrrr'rrrrr)Asr)c@seZdZddZdS)OpcCst|S)N)r!)rrrrr'IszOp.serializeN)rrrr'rrrrr*Gsr*implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_namezos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationpython_implementationZextra)zos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationr6cCsttj|d|dS)Nr)r(ALIASESget)sltrrrisr<z===z==z>=z<=z!=z~=>sz(_coerce_parse_result..)
isinstancer)resultsrrrrGs
rGTcCst|tttfstt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rndj|Sddj|dSn"t|trdjdd	|DS|SdS)
Nrrcss|]}t|ddVqdS)F)firstN)_format_marker)rHmrrr	sz!_format_marker.. rErFcSsg|]}|jqSr)r')rHrOrrrrJsz"_format_marker..)rKlistrDrAssertionErrorlenrNjoin)markerrMinnerrrrrNs


rNcCs||kS)Nr)lhsrhsrrrr<scCs||kS)Nr)rXrYrrrr<s)r?znot inr>z<=z==z!=z>=r=c
Cslytdj|j|g}Wntk
r.YnX|j|Stj|j}|dkrbtdj||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.)	rrUr'rcontains
_operatorsr8rr#)rXoprYspecZoperrrr_eval_ops
r_cCs&|j|t}|tkr"tdj||S)Nz/{0!r} does not exist in evaluation environment.)r8
_undefinedrr#)environmentnamerrrr_get_envs
rcc	Csgg}x|D]}t|tttfs$tt|trD|djt||qt|tr|\}}}t|trvt||j	}|j	}n|j	}t||j	}|djt
|||q|dkst|dkr|jgqWtdd|DS)	NrrBrCcss|]}t|VqdS)N)all)rHitemrrrrPsz$_evaluate_markers..rf)rBrC)rKrRrDrrSappend_evaluate_markersr(rcrr_any)	ZmarkersragroupsrVrXr]rYZ	lhs_valueZ	rhs_valuerrrrhs"




rhcCs2dj|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r#releaselevelr!serial)infoversionZkindrrrformat_full_versions

rpcCslttdr ttjj}tjj}nd}d}||tjtjtj	tj
tjtjtjtjddtjdS)Nimplementation0rZ)r-r+r5r1r/r2r0r.r,r3r4)
hasattrsysrprqrorbosplatformmachinereleasesystemr3r6)Ziverr-rrrrs 

c@s.eZdZddZddZddZd
dd	ZdS)rcCs`yttj||_WnFtk
rZ}z*dj|||j|jd}t|WYdd}~XnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rGMARKERZparseString_markersrr#locr)rrVeZerr_strrrrr szMarker.__init__cCs
t|jS)N)rNr})rrrrr"szMarker.__str__cCsdjt|S)Nz)r#r!)rrrrr%szMarker.__repr__NcCs$t}|dk	r|j|t|j|S)a$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N)rupdaterhr})rraZcurrent_environmentrrrevaluate s	
zMarker.evaluate)N)rrrr r"r%rrrrrrs)T)AZ
__future__rrroperatorrvrwruZsetuptools.extern.pyparsingrrrrr	r
rrr
LZ_compatrZ
specifiersrr__all__
ValueErrorrrrobjectrr(r)r*ZVARIABLEr7ZsetParseActionZVERSION_CMPZ	MARKER_OPZMARKER_VALUEZBOOLOPZ
MARKER_VARZMARKER_ITEMsuppressZLPARENZRPARENZMARKER_EXPRZMARKER_ATOMr|rGrNltleeqnegegtr\r_r`rcrhrprrrrrrsx
	6


PK!092_vendor/packaging/__pycache__/utils.cpython-36.pycnu[3

vh@s2ddlmZmZmZddlZejdZddZdS))absolute_importdivisionprint_functionNz[-_.]+cCstjd|jS)N-)_canonicalize_regexsublower)namer
/usr/lib/python3.6/utils.pycanonicalize_namesr)Z
__future__rrrrecompilerrr
r
r
rs
PK!Z_Z_&_vendor/__pycache__/six.cpython-36.pycnu[3

vhuI@srdZddlmZddlZddlZddlZddlZddlZdZdZ	ej
ddkZej
ddkZej
dddzkZ
erefZefZefZeZeZejZnefZeefZeejfZeZeZejjd	red|ZnLGdd
d
eZ ye!e Wn e"k
red~ZYnXedZ[ ddZ#ddZ$GdddeZ%Gddde%Z&Gdddej'Z(Gddde%Z)GdddeZ*e*e+Z,Gddde(Z-e)ddd d!e)d"d#d$d%d"e)d&d#d#d'd&e)d(d)d$d*d(e)d+d)d,e)d-d#d$d.d-e)d/d0d0d1d/e)d2d0d0d/d2e)d3d)d$d4d3e)d5d)e
rd6nd7d8e)d9d)d:e)d;de)d!d!d e)d?d?d@e)dAdAd@e)dBdBd@e)d4d)d$d4d3e)dCd#d$dDdCe)dEd#d#dFdEe&d$d)e&dGdHe&dIdJe&dKdLdMe&dNdOdNe&dPdQdRe&dSdTdUe&dVdWdXe&dYdZd[e&d\d]d^e&d_d`dae&dbdcdde&dedfdge&dhdidje&dkdkdle&dmdmdle&dndndle&dododpe&dqdre&dsdte&dudve&dwdxdwe&dydze&d{d|d}e&d~dde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkrZe.e&ddg7Z.x:e.D]2Z/e0e-e/j1e/e2e/e&r`e,j3e/de/j1q`W[/e.e-_.e-e+dZ4e,j3e4dGddde(Z5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d>dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6xe6D]Z/e0e5e/j1e/qW[/e6e5_.e,j3e5e+dddӃGddՄde(Z7e)ddde)ddde)dddgZ8xe8D]Z/e0e7e/j1e/q$W[/e8e7_.e,j3e7e+ddd܃Gddބde(Z9e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddg!Z:xe:D]Z/e0e9e/j1e/qW[/e:e9_.e,j3e9e+dddGddde(Z;e)ddde)ddde)d	dde)d
ddgZxe>D]Z/e0e=e/j1e/qW[/e>e=_.e,j3e=e+dddGdddej'Z?e,j3e?e+ddddZ@ddZAe	rjdZBdZCdZDdZEdZFd ZGn$d!ZBd"ZCd#ZDd$ZEd%ZFd&ZGyeHZIWn"eJk
	rd'd(ZIYnXeIZHyeKZKWn"eJk
	rd)d*ZKYnXe
rd+d,ZLejMZNd-d.ZOeZPn>d/d,ZLd0d1ZNd2d.ZOGd3d4d4eZPeKZKe#eLd5ejQeBZRejQeCZSejQeDZTejQeEZUejQeFZVejQeGZWe
rd6d7ZXd8d9ZYd:d;ZZd<d=Z[ej\d>Z]ej\d?Z^ej\d@Z_nTdAd7ZXdBd9ZYdCd;ZZdDd=Z[ej\dEZ]ej\dFZ^ej\dGZ_e#eXdHe#eYdIe#eZdJe#e[dKerdLdMZ`dNdOZaebZcddldZdedjedPjfZg[dejhdZiejjZkelZmddlnZnenjoZoenjpZpdQZqej
d
d
krdRZrdSZsndTZrdUZsnjdVdMZ`dWdOZaecZcebZgdXdYZidZd[ZkejtejuevZmddloZoeojoZoZpd\ZqdRZrdSZse#e`d]e#ead^d_dQZwd`dTZxdadUZyereze4j{dbZ|ddcddZ}nddedfZ|e|dgej
dddk
re|dhn.ej
dddk
r8e|dindjdkZ~eze4j{dldZedk
rjdmdnZej
dddk
reZdodnZe#e}dpej
dddk
rejejfdqdrZnejZdsdtZdudvZdwdxZgZe+Zejdydk	rge_ejrbx>eejD]0\ZZeej+dkr*ej1e+kr*eje=Pq*W[[ejje,dS(z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.10.0javac@seZdZddZdS)XcCsdS)Nrrl)selfr
r
/usr/lib/python3.6/six.py__len__>sz	X.__len__N)__name__
__module____qualname__r
r
r
r
rr	<sr	?cCs
||_dS)z Add documentation to a function.N)__doc__)funcdocr
r
r_add_docKsrcCst|tj|S)z7Import module, returning the module after the last dot.)
__import__sysmodules)namer
r
r_import_modulePsrc@seZdZddZddZdS)
_LazyDescrcCs
||_dS)N)r)rrr
r
r__init__Xsz_LazyDescr.__init__cCsB|j}t||j|yt|j|jWntk
r<YnX|S)N)_resolvesetattrrdelattr	__class__AttributeError)robjtpresultr
r
r__get__[sz_LazyDescr.__get__N)rrrrr%r
r
r
rrVsrcs.eZdZdfdd	ZddZddZZS)	MovedModuleNcs2tt|j|tr(|dkr |}||_n||_dS)N)superr&rPY3mod)rroldnew)r r
rriszMovedModule.__init__cCs
t|jS)N)rr))rr
r
rrrszMovedModule._resolvecCs"|j}t||}t||||S)N)rgetattrr)rattr_modulevaluer
r
r__getattr__us
zMovedModule.__getattr__)N)rrrrrr0
__classcell__r
r
)r rr&gs	r&cs(eZdZfddZddZgZZS)_LazyModulecstt|j||jj|_dS)N)r'r2rr r)rr)r r
rr~sz_LazyModule.__init__cCs ddg}|dd|jD7}|S)NrrcSsg|]
}|jqSr
)r).0r-r
r
r
sz'_LazyModule.__dir__..)_moved_attributes)rZattrsr
r
r__dir__sz_LazyModule.__dir__)rrrrr6r5r1r
r
)r rr2|sr2cs&eZdZdfdd	ZddZZS)MovedAttributeNcsdtt|j|trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dS)N)r'r7rr(r)r-)rrZold_modZnew_modZold_attrZnew_attr)r r
rrszMovedAttribute.__init__cCst|j}t||jS)N)rr)r,r-)rmoduler
r
rrs
zMovedAttribute._resolve)NN)rrrrrr1r
r
)r rr7sr7c@sVeZdZdZddZddZddZdd	d
ZddZd
dZ	ddZ
ddZeZdS)_SixMetaPathImporterz
    A meta path importer to import six.moves and its submodules.

    This class implements a PEP302 finder and loader. It should be compatible
    with Python 2.5 and all existing versions of Python3
    cCs||_i|_dS)N)r
known_modules)rZsix_module_namer
r
rrsz_SixMetaPathImporter.__init__cGs&x |D]}||j|jd|<qWdS)N.)r:r)rr)Z	fullnamesfullnamer
r
r_add_modules
z _SixMetaPathImporter._add_modulecCs|j|jd|S)Nr;)r:r)rr<r
r
r_get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdS)N)r:)rr<pathr
r
rfind_modules
z _SixMetaPathImporter.find_modulecCs0y
|j|Stk
r*td|YnXdS)Nz!This loader does not know module )r:KeyErrorImportError)rr<r
r
rZ__get_modules
z!_SixMetaPathImporter.__get_modulecCsRy
tj|Stk
rYnX|j|}t|tr>|j}n||_|tj|<|S)N)rrrA _SixMetaPathImporter__get_module
isinstancer&r
__loader__)rr<r)r
r
rload_modules




z _SixMetaPathImporter.load_modulecCst|j|dS)z
        Return true, if the named module is a package.

        We need this method to get correct spec objects with
        Python 3.4 (see PEP451)
        __path__)hasattrrC)rr<r
r
r
is_packagesz_SixMetaPathImporter.is_packagecCs|j|dS)z;Return None

        Required, if is_package is implementedN)rC)rr<r
r
rget_codes
z_SixMetaPathImporter.get_code)N)
rrrrrr=r>r@rCrFrIrJ
get_sourcer
r
r
rr9s
	r9c@seZdZdZgZdS)_MovedItemszLazy loading of moved objectsN)rrrrrGr
r
r
rrLsrLZ	cStringIOioStringIOfilter	itertoolsbuiltinsZifilterfilterfalseZifilterfalseinputZ__builtin__Z	raw_inputinternrmapimapgetcwdosZgetcwdugetcwdbrangeZxrangeZ
reload_module	importlibZimpreloadreduce	functoolsZshlex_quoteZpipesZshlexZquoteUserDictcollectionsUserList
UserStringzipZizipzip_longestZizip_longestZconfigparserZConfigParsercopyregZcopy_regZdbm_gnuZgdbmzdbm.gnuZ
_dummy_threadZdummy_threadZhttp_cookiejarZ	cookielibzhttp.cookiejarZhttp_cookiesZCookiezhttp.cookiesZ
html_entitiesZhtmlentitydefsz
html.entitiesZhtml_parserZ
HTMLParserzhtml.parserZhttp_clientZhttplibzhttp.clientZemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartZemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartZemail_mime_textzemail.MIMETextzemail.mime.textZemail_mime_basezemail.MIMEBasezemail.mime.baseZBaseHTTPServerzhttp.serverZ
CGIHTTPServerZSimpleHTTPServerZcPicklepickleZqueueZQueuereprlibreprZsocketserverZSocketServer_threadZthreadZtkinterZTkinterZtkinter_dialogZDialogztkinter.dialogZtkinter_filedialogZ
FileDialogztkinter.filedialogZtkinter_scrolledtextZScrolledTextztkinter.scrolledtextZtkinter_simpledialogZSimpleDialogztkinter.simpledialogZtkinter_tixZTixztkinter.tixZtkinter_ttkZttkztkinter.ttkZtkinter_constantsZTkconstantsztkinter.constantsZtkinter_dndZTkdndztkinter.dndZtkinter_colorchooserZtkColorChooserztkinter.colorchooserZtkinter_commondialogZtkCommonDialogztkinter.commondialogZtkinter_tkfiledialogZtkFileDialogZtkinter_fontZtkFontztkinter.fontZtkinter_messageboxZtkMessageBoxztkinter.messageboxZtkinter_tksimpledialogZtkSimpleDialogZurllib_parsez.moves.urllib_parsezurllib.parseZurllib_errorz.moves.urllib_errorzurllib.errorZurllibz
.moves.urllibZurllib_robotparserrobotparserzurllib.robotparserZ
xmlrpc_clientZ	xmlrpclibz
xmlrpc.clientZ
xmlrpc_serverZSimpleXMLRPCServerz
xmlrpc.serverZwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseN)rrrrr
r
r
rrn@srnZParseResultZurlparseZSplitResultZparse_qsZ	parse_qslZ	urldefragZurljoinZurlsplitZ
urlunparseZ
urlunsplitZ
quote_plusZunquoteZunquote_plusZ	urlencodeZ
splitqueryZsplittagZ	splituserZ
uses_fragmentZuses_netlocZuses_paramsZ
uses_queryZ
uses_relativezmoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorN)rrrrr
r
r
rrohsroZURLErrorZurllib2Z	HTTPErrorZContentTooShortErrorz.moves.urllib.errorzmoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestN)rrrrr
r
r
rrp|srpZurlopenzurllib.requestZinstall_openerZbuild_openerZpathname2urlZurl2pathnameZ
getproxiesZRequestZOpenerDirectorZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZBaseHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerZFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerZHTTPErrorProcessorZurlretrieveZ
urlcleanupZ	URLopenerZFancyURLopenerZproxy_bypassz.moves.urllib.requestzmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseN)rrrrr
r
r
rrqsrqZaddbasezurllib.responseZaddclosehookZaddinfoZ
addinfourlz.moves.urllib.responsezmoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserN)rrrrr
r
r
rrrsrrZRobotFileParserz.moves.urllib.robotparserzmoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZejdZejdZejdZ	ejdZ
ejdZddZd	S)
Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacezmoves.urllib_parsezmoves.urllib_errorzmoves.urllib_requestzmoves.urllib_responsezmoves.urllib_robotparsercCsdddddgS)Nparseerrorrequestresponserjr
)rr
r
rr6szModule_six_moves_urllib.__dir__N)
rrrrrG	_importerr>rtrurvrwrjr6r
r
r
rrss




rszmoves.urllibcCstt|j|dS)zAdd an item to six.moves.N)rrLr)Zmover
r
radd_movesrycCsXytt|WnDtk
rRytj|=Wn"tk
rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)rrLr!rm__dict__rA)rr
r
rremove_movesr{__func____self____closure____code____defaults____globals__im_funcZim_selfZfunc_closureZ	func_codeZ
func_defaultsZfunc_globalscCs|jS)N)next)itr
r
radvance_iteratorsrcCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)rz)r3klassr
r
r	szcallable..)anytype__mro__)r"r
r
rcallablesrcCs|S)Nr
)unboundr
r
rget_unbound_functionsrcCs|S)Nr
)rclsr
r
rcreate_unbound_methodsrcCs|jS)N)r)rr
r
rr"scCstj|||jS)N)types
MethodTyper )rr"r
r
rcreate_bound_method%srcCstj|d|S)N)rr)rrr
r
rr(sc@seZdZddZdS)IteratorcCst|j|S)N)r__next__)rr
r
rr-sz
Iterator.nextN)rrrrr
r
r
rr+srz3Get the function out of a possibly unbound functioncKst|jf|S)N)iterkeys)dkwr
r
riterkeys>srcKst|jf|S)N)rvalues)rrr
r
r
itervaluesAsrcKst|jf|S)N)ritems)rrr
r
r	iteritemsDsrcKst|jf|S)N)rZlists)rrr
r
r	iterlistsGsrrrrcKs|jf|S)N)r)rrr
r
rrPscKs|jf|S)N)r)rrr
r
rrSscKs|jf|S)N)r)rrr
r
rrVscKs|jf|S)N)r)rrr
r
rrYsviewkeys
viewvalues	viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs
|jdS)Nzlatin-1)encode)sr
r
rbksrcCs|S)Nr
)rr
r
runsrz>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesassertRaisesRegexassertRegexcCs|S)Nr
)rr
r
rrscCst|jdddS)Nz\\z\\\\Zunicode_escape)unicodereplace)rr
r
rrscCst|dS)Nr)ord)Zbsr
r
rbyte2intsrcCst||S)N)r)Zbufir
r
r
indexbytessrZassertItemsEqualzByte literalzText literalcOst|t||S)N)r,_assertCountEqual)rargskwargsr
r
rrscOst|t||S)N)r,_assertRaisesRegex)rrrr
r
rrscOst|t||S)N)r,_assertRegex)rrrr
r
rrsexeccCs*|dkr|}|j|k	r"|j||dS)N)
__traceback__with_traceback)r#r/tbr
r
rreraises


rcCsB|dkr*tjd}|j}|dkr&|j}~n|dkr6|}tddS)zExecute code in a namespace.Nrzexec _code_ in _globs_, _locs_)r	_getframe	f_globalsf_localsr)Z_code_Z_globs_Z_locs_framer
r
rexec_s
rz9def reraise(tp, value, tb=None):
    raise tp, value, tb
zrdef raise_from(value, from_value):
    if from_value is None:
        raise value
    raise value from from_value
zCdef raise_from(value, from_value):
    raise value from from_value
cCs|dS)Nr
)r/Z
from_valuer
r
r
raise_fromsrprintc
s6|jdtjdkrdSfdd}d}|jdd}|dk	r`t|trNd}nt|ts`td|jd	d}|dk	rt|trd}nt|tstd
|rtd|sx|D]}t|trd}PqW|rtd}td
}nd}d
}|dkr|}|dkr|}x,t|D] \}	}|	r||||qW||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk	rVtdd}|dkrHd}|jj|}j|dS)Nerrorsstrict)	rD
basestringstrrrencodingr,rwrite)datar)fpr
rrs



zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()
 )poprstdoutrDrr	TypeError	enumerate)
rrrZwant_unicoderrargnewlineZspacerr
)rrprint_sL







rcOs<|jdtj}|jdd}t|||r8|dk	r8|jdS)NrflushF)getrrr_printr)rrrrr
r
rrs

zReraise an exception.csfdd}|S)Ncstj|}|_|S)N)r^wraps__wrapped__)f)assignedupdatedwrappedr
rwrapperszwraps..wrapperr
)rrrrr
)rrrrrsrcs&Gfddd}tj|dfiS)z%Create a base class with a metaclass.cseZdZfddZdS)z!with_metaclass..metaclasscs||S)Nr
)rrZ
this_basesr)basesmetar
r__new__'sz)with_metaclass..metaclass.__new__N)rrrrr
)rrr
r	metaclass%srZtemporary_class)rr)rrrr
)rrrwith_metaclass srcsfdd}|S)z6Class decorator for creating a class with a metaclass.csl|jj}|jd}|dk	rDt|tr,|g}x|D]}|j|q2W|jdd|jdd|j|j|S)N	__slots__rz__weakref__)rzcopyrrDrrr	__bases__)rZ	orig_varsslotsZ	slots_var)rr
rr.s



zadd_metaclass..wrapperr
)rrr
)rr
add_metaclass,srcCs2tr.d|jkrtd|j|j|_dd|_|S)a
    A decorator that defines __unicode__ and __str__ methods under Python 2.
    Under Python 3 it does nothing.

    To support Python 2 and 3 with a single code base, define a __str__ method
    returning text and apply this decorator to the class.
    __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|jjdS)Nzutf-8)__unicode__r)rr
r
rJsz-python_2_unicode_compatible..)PY2rz
ValueErrorrrr)rr
r
rpython_2_unicode_compatible<s


r__spec__)rrlilill)N)NN)rr)rr)rr)rr)rZ
__future__rr^rPoperatorrr
__author____version__version_inforr(ZPY34rZstring_typesintZ
integer_typesrZclass_typesZ	text_typebytesZbinary_typemaxsizeZMAXSIZErZlongZ	ClassTyperplatform
startswithobjectr	len
OverflowErrorrrrr&
ModuleTyper2r7r9rrxrLr5r-rrrDr=rmrnZ_urllib_parse_moved_attributesroZ_urllib_error_moved_attributesrpZ _urllib_request_moved_attributesrqZ!_urllib_response_moved_attributesrrZ$_urllib_robotparser_moved_attributesrsryr{Z
_meth_funcZ
_meth_selfZ
_func_closureZ
_func_codeZ_func_defaultsZ
_func_globalsrr	NameErrorrrrrrr
attrgetterZget_method_functionZget_method_selfZget_function_closureZget_function_codeZget_function_defaultsZget_function_globalsrrrrmethodcallerrrrrrchrZunichrstructStructpackZint2byte
itemgetterrgetitemrrZ	iterbytesrMrNBytesIOrrrpartialrVrrrrr,rQrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrrrrrG__package__globalsrrsubmodule_search_locations	meta_pathrrZimporterappendr
r
r
rs

>












































































































5PK!0
KK,_vendor/__pycache__/pyparsing.cpython-36.pycnu[3

vh@sdZdZdZdZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZyddlmZWn ek
rddlmZYnXydd	l
mZWn>ek
rydd	lmZWnek
rdZYnXYnXd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrgiZee	jddsZeddskZer"e	jZe Z!e"Z#e Z$e%e&e'e(e)ee*e+e,e-e.gZ/nbe	j0Ze1Z2dtduZ$gZ/ddl3Z3xBdvj4D]6Z5ye/j6e7e3e5Wne8k
r|wJYnXqJWe9dwdxe2dyDZ:dzd{Z;Gd|d}d}e<Z=ej>ej?Z@d~ZAeAdZBe@eAZCe"dZDdjEddxejFDZGGdd!d!eHZIGdd#d#eIZJGdd%d%eIZKGdd'd'eKZLGdd*d*eHZMGddde<ZNGdd&d&e<ZOe
jPjQeOdd=ZRddNZSddKZTddZUddZVddZWddUZXd/ddZYGdd(d(e<ZZGdd0d0eZZ[Gddde[Z\Gddde[Z]Gddde[Z^e^Z_e^eZ_`Gddde[ZaGddde^ZbGdddeaZcGddpdpe[ZdGdd3d3e[ZeGdd+d+e[ZfGdd)d)e[ZgGdd
d
e[ZhGdd2d2e[ZiGddde[ZjGdddejZkGdddejZlGdddejZmGdd.d.ejZnGdd-d-ejZoGdd5d5ejZpGdd4d4ejZqGdd$d$eZZrGdd
d
erZsGdd d erZtGddderZuGddderZvGdd"d"eZZwGdddewZxGdddewZyGdddewZzGdddezZ{Gdd6d6ezZ|Gddde<Z}e}Z~GdddewZGdd,d,ewZGdddewZGdddeZGdd1d1ewZGdddeZGdddeZGdddeZGdd/d/eZGddde<ZddfZd0ddDZd1dd@Zdd΄ZddSZddRZdd҄Zd2ddWZddEZd3ddkZddlZddnZe\jdGZeljdMZemjdLZenjdeZeojddZeeeDdddڍjdd܄Zefd݃jdd܄Zefd߃jdd܄ZeeBeBeeeGddydBefdejBZeeedeZe^dedjdee{eeBjddZddcZddQZdd`Zdd^ZddqZedd܄Zedd܄ZddZddOZddPZddiZe<e_d4ddoZe=Ze<e_e<e_ededfddmZeZeefddjdZeefddjdZeefddefddBjdZee_dejjdZdddejfddTZd5ddjZedZedZeeee@eCdjd\ZZeed	j4d
ZefddjEejÃd
jdZĐdd_ZeefddjdZefdjdZefdjȃjdZefdjdZeefddeBjdZeZefdjdZee{eeeGdɐdeeede^dɃemj΃jdZeeejeBddjd>ZGd drdrZeҐd!krebd"Zebd#Zeee@eCd$ZeeՐd%dӐd&jeZeeeփjd'Zאd(eBZeeՐd%dӐd&jeZeeeكjd)ZeӐd*eؐd'eeڐd)Zejܐd+ejjܐd,ejjܐd,ejjܐd-ddlZejjeejejjܐd.dS(6aS
pyparsing module - Classes and methods to define and execute parsing grammars

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments
z2.1.10z07 Oct 2016 01:31 UTCz*Paul McGuire N)ref)datetime)RLock)OrderedDictAndCaselessKeywordCaselessLiteral
CharsNotInCombineDictEachEmpty
FollowedByForward
GoToColumnGroupKeywordLineEnd	LineStartLiteral
MatchFirstNoMatchNotAny	OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalExceptionParseResultsParseSyntaxException
ParserElementQuotedStringRecursiveGrammarExceptionRegexSkipTo	StringEndStringStartSuppressTokenTokenConverterWhiteWordWordEnd	WordStart
ZeroOrMore	alphanumsalphas
alphas8bitanyCloseTag
anyOpenTag
cStyleCommentcolcommaSeparatedListcommonHTMLEntitycountedArraycppStyleCommentdblQuotedStringdblSlashComment
delimitedListdictOfdowncaseTokensemptyhexnumshtmlCommentjavaStyleCommentlinelineEnd	lineStartlinenomakeHTMLTagsmakeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral
nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence
printablespunc8bitpythonStyleCommentquotedStringremoveQuotesreplaceHTMLEntityreplaceWith
restOfLinesglQuotedStringsrange	stringEndstringStarttraceParseAction
unicodeStringupcaseTokens
withAttribute
indentedBlockoriginalTextForungroup
infixNotationlocatedExpr	withClass
CloseMatchtokenMappyparsing_commoncCs`t|tr|Syt|Stk
rZt|jtjd}td}|jdd|j	|SXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexint)trw/usr/lib/python3.6/pyparsing.pysz_ustr..N)

isinstanceZunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr'setParseActiontransformString)objretZ
xmlcharrefrwrwrx_ustrs
rz6sum len sorted reversed list tuple set any all min maxccs|]
}|VqdS)Nrw).0yrwrwrx	srrrcCs>d}dddjD}x"t||D]\}}|j||}q"W|S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nrw)rsrwrwrxrsz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZfrom_symbolsZ
to_symbolsZfrom_Zto_rwrwrx_xml_escapes
rc@seZdZdS)
_ConstantsN)__name__
__module____qualname__rwrwrwrxrsr
0123456789ZABCDEFabcdef\ccs|]}|tjkr|VqdS)N)stringZ
whitespace)rcrwrwrxrsc@sPeZdZdZdddZeddZdd	Zd
dZdd
Z	dddZ
ddZdS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n||_||_||_|||f|_dS)Nr)locmsgpstr
parserElementargs)selfrrrelemrwrwrx__init__szParseBaseException.__init__cCs||j|j|j|jS)z
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)clsperwrwrx_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        rJr9columnrGN)r9r)rJrrr9rGAttributeError)rZanamerwrwrx__getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrJr)rrwrwrx__str__szParseBaseException.__str__cCst|S)N)r)rrwrwrx__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been foundN)rrrrrwrwrwrxr#sc@s eZdZdZddZddZdS)r&zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs
||_dS)N)parseElementTrace)rparseElementListrwrwrxrsz"RecursiveGrammarException.__init__cCs
d|jS)NzRecursiveGrammarException: %s)r)rrwrwrxr sz!RecursiveGrammarException.__str__N)rrrrrrrwrwrwrxr&sc@s,eZdZddZddZddZddZd	S)
_ParseResultsWithOffsetcCs||f|_dS)N)tup)rZp1Zp2rwrwrxr$sz _ParseResultsWithOffset.__init__cCs
|j|S)N)r)rirwrwrx__getitem__&sz#_ParseResultsWithOffset.__getitem__cCst|jdS)Nr)reprr)rrwrwrxr(sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dS)Nr)r)rrrwrwrx	setOffset*sz!_ParseResultsWithOffset.setOffsetN)rrrrrrrrwrwrwrxr#src@seZdZdZd[ddZddddefddZdd	Zefd
dZdd
Z	ddZ
ddZddZeZ
ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName})

    Example::
        integer = Word(nums)
        date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))
        # equivalent form:
        # date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

        # parseString returns a ParseResults object
        result = date_str.parseString("1999/12/31")

        def test(s, fn=repr):
            print("%s -> %s" % (s, fn(eval(s))))
        test("list(result)")
        test("result[0]")
        test("result['month']")
        test("result.day")
        test("'month' in result")
        test("'minutes' in result")
        test("result.dump()", str)
    prints::
        list(result) -> ['1999', '/', '12', '/', '31']
        result[0] -> '1999'
        result['month'] -> '12'
        result.day -> '31'
        'month' in result -> True
        'minutes' in result -> False
        result.dump() -> ['1999', '/', '12', '/', '31']
        - day: 31
        - month: 12
        - year: 1999
    NTcCs"t||r|Stj|}d|_|S)NT)rzobject__new___ParseResults__doinit)rtoklistnameasListmodalZretobjrwrwrxrTs


zParseResults.__new__c
Cs`|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t	|_
|dk	o|r\|sd|j|<||trt|}||_||t
dttfo|ddgfks\||tr|g}|r&||trt|jd||<ntt|dd||<|||_n6y|d||<Wn$tttfk
rZ|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrurr
basestringr"rcopyKeyError	TypeError
IndexError)rrrrrrzrwrwrxr]sB



$
zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrrrcSsg|]}|dqS)rrw)rvrwrwrx
sz,ParseResults.__getitem__..rs)rzruslicerrrr")rrrwrwrxrs


zParseResults.__getitem__cCs||tr0|jj|t|g|j|<|d}nD||ttfrN||j|<|}n&|jj|tt|dg|j|<|}||trt||_	dS)Nr)
rrgetrrurrr"wkrefr)rkrrzsubrwrwrx__setitem__s


"
zParseResults.__setitem__c
Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt|j|}|jx^|j	j
D]F\}}x<|D]4}x.t|D]"\}\}}	t||	|	|k||<qWq|WqnWn|j	|=dS)Nrrr)
rzrurlenrrrangeindicesreverseritems	enumerater)
rrZmylenZremovedroccurrencesjrvaluepositionrwrwrx__delitem__s


$zParseResults.__delitem__cCs
||jkS)N)r)rrrwrwrx__contains__szParseResults.__contains__cCs
t|jS)N)rr)rrwrwrx__len__szParseResults.__len__cCs
|jS)N)r)rrwrwrx__bool__szParseResults.__bool__cCs
t|jS)N)iterr)rrwrwrx__iter__szParseResults.__iter__cCst|jdddS)Nrrrs)rr)rrwrwrx__reversed__szParseResults.__reversed__cCs$t|jdr|jjSt|jSdS)Niterkeys)hasattrrrr)rrwrwrx	_iterkeyss
zParseResults._iterkeyscsfddjDS)Nc3s|]}|VqdS)Nrw)rr)rrwrxrsz+ParseResults._itervalues..)r)rrw)rrx_itervaluesszParseResults._itervaluescsfddjDS)Nc3s|]}||fVqdS)Nrw)rr)rrwrxrsz*ParseResults._iteritems..)r)rrw)rrx
_iteritemsszParseResults._iteritemscCst|jS)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rr)rrwrwrxkeysszParseResults.keyscCst|jS)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r
itervalues)rrwrwrxvaluesszParseResults.valuescCst|jS)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r	iteritems)rrwrwrxrszParseResults.itemscCs
t|jS)zSince keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names.)boolr)rrwrwrxhaskeysszParseResults.haskeyscOs|s
dg}x6|jD]*\}}|dkr2|d|f}qtd|qWt|dtsht|dksh|d|kr|d}||}||=|S|d}|SdS)a
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # Use pop() in a parse action to remove named result (note that corresponding value is not
            # removed from list form of results)
            def remove_LABEL(tokens):
                tokens.pop("LABEL")
                return tokens
            patt.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        rrdefaultrz-pop() got an unexpected keyword argument '%s'Nrs)rrrzrur)rrkwargsrrindexrZdefaultvaluerwrwrxpops"zParseResults.popcCs||kr||S|SdS)ai
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        Nrw)rkeydefaultValuerwrwrxrszParseResults.getcCsZ|jj||xF|jjD]8\}}x.t|D]"\}\}}t||||k||<q,WqWdS)a
        Inserts new element at location index in the list of parsed tokens.
        
        Similar to C{list.insert()}.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']

            # use a parse action to insert the parse location in the front of the parsed results
            def insert_locn(locn, tokens):
                tokens.insert(0, locn)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        N)rinsertrrrr)rrZinsStrrrrrrrwrwrxr2szParseResults.insertcCs|jj|dS)a
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            
            # use a parse action to compute the sum of the parsed integers, and add it to the end
            def append_sum(tokens):
                tokens.append(sum(map(int, tokens)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        N)rappend)ritemrwrwrxrFszParseResults.appendcCs$t|tr||7}n|jj|dS)a
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # use a parse action to append the reverse of the matched strings, to make a palindrome
            def make_palindrome(tokens):
                tokens.extend(reversed([t[::-1] for t in tokens]))
                return ''.join(tokens)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        N)rzr"rextend)rZitemseqrwrwrxrTs

zParseResults.extendcCs|jdd=|jjdS)z7
        Clear all elements and results names.
        N)rrclear)rrwrwrxrfszParseResults.clearcCsfy||Stk
rdSX||jkr^||jkrD|j|ddStdd|j|DSndSdS)NrrrrcSsg|]}|dqS)rrw)rrrwrwrxrwsz,ParseResults.__getattr__..rs)rrrr")rrrwrwrxrms

zParseResults.__getattr__cCs|j}||7}|S)N)r)rotherrrwrwrx__add__{szParseResults.__add__cs|jrnt|jfdd|jj}fdd|D}x4|D],\}}|||<t|dtr>t||d_q>W|j|j7_|jj	|j|S)Ncs|dkrS|S)Nrrw)a)offsetrwrxrysz'ParseResults.__iadd__..c	s4g|],\}}|D]}|t|d|dfqqS)rrr)r)rrvlistr)	addoffsetrwrxrsz)ParseResults.__iadd__..r)
rrrrrzr"rrrupdate)rrZ
otheritemsZotherdictitemsrrrw)rrrx__iadd__s


zParseResults.__iadd__cCs&t|tr|dkr|jS||SdS)Nr)rzrur)rrrwrwrx__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrr)rrwrwrxrszParseResults.__repr__cCsddjdd|jDdS)N[z, css(|] }t|trt|nt|VqdS)N)rzr"rr)rrrwrwrxrsz'ParseResults.__str__..])rr)rrwrwrxrszParseResults.__str__rcCsPg}xF|jD]<}|r"|r"|j|t|tr:||j7}q|jt|qW|S)N)rrrzr"
_asStringListr)rsepoutrrwrwrxr
s

zParseResults._asStringListcCsdd|jDS)a
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # ->  ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # ->  ['sldkj', 'lsdkj', 'sldkj']
        cSs"g|]}t|tr|jn|qSrw)rzr"r)rresrwrwrxrsz'ParseResults.asList..)r)rrwrwrxrszParseResults.asListcs6tr|j}n|j}fddtfdd|DS)a
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # ->  (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # ->  {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        cs6t|tr.|jr|jSfdd|DSn|SdS)Ncsg|]}|qSrwrw)rr)toItemrwrxrsz7ParseResults.asDict..toItem..)rzr"rasDict)r)rrwrxrs

z#ParseResults.asDict..toItemc3s|]\}}||fVqdS)Nrw)rrr)rrwrxrsz&ParseResults.asDict..)PY_3rrr)rZitem_fnrw)rrxrs
	zParseResults.asDictcCs8t|j}|jj|_|j|_|jj|j|j|_|S)zA
        Returns a new copy of a C{ParseResults} object.
        )r"rrrrrrr)rrrwrwrxrs
zParseResults.copyFcCsPd}g}tdd|jjD}|d}|s8d}d}d}d}	|dk	rJ|}	n|jrV|j}	|	sf|rbdSd}	|||d|	d	g7}xt|jD]\}
}t|tr|
|kr||j||
|o|dk||g7}n||jd|o|dk||g7}qd}|
|kr||
}|s
|rqnd}t	t
|}
|||d|d	|
d
|d	g	7}qW|||d
|	d	g7}dj|S)z
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        
css(|] \}}|D]}|d|fVqqdS)rrNrw)rrrrrwrwrxrsz%ParseResults.asXML..z  rNZITEM<>z.z
%s%s- %s: z  rrcss|]}t|tVqdS)N)rzr")rvvrwrwrxrssz
%s%s[%d]:
%s%s%sr)
rrrrsortedrrzr"dumpranyrr)rrdepthfullrNLrrrrrrwrwrxrPs,

4.zParseResults.dumpcOstj|jf||dS)a
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        N)pprintr)rrrrwrwrxr"}szParseResults.pprintcCs.|j|jj|jdk	r|jp d|j|jffS)N)rrrrrr)rrwrwrx__getstate__s
zParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|jj||dk	rDt||_nd|_dS)Nrrr)rrrrrrr)rstaterZinAccumNamesrwrwrx__setstate__s
zParseResults.__setstate__cCs|j|j|j|jfS)N)rrrr)rrwrwrx__getnewargs__szParseResults.__getnewargs__cCstt|t|jS)N)rrrr)rrwrwrxrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrrzrrrrrrr__nonzero__rrrrrrrrrrrrrrrrrrrrrrrrrr
rrrrrrrr"r#r%r&rrwrwrwrxr"-sh&
	'	
4

#
=%
-
cCsF|}d|kot|knr4||ddkr4dS||jdd|S)aReturns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   rrrr)rrfind)rstrgrrwrwrxr9s
cCs|jdd|dS)aReturns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   rrrr)count)rr)rwrwrxrJs
cCsF|jdd|}|jd|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators.
       rrrrN)r(find)rr)ZlastCRZnextCRrwrwrxrGs
cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrJr9)instringrexprrwrwrx_defaultStartDebugActionsr/cCs$tdt|dt|jdS)NzMatched z -> )r,rr{r)r-startlocZendlocr.toksrwrwrx_defaultSuccessDebugActionsr2cCstdt|dS)NzException raised:)r,r)r-rr.excrwrwrx_defaultExceptionDebugActionsr4cGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nrw)rrwrwrxrQsrqcstkrfddSdgdgtdddkrFddd	}dd
dntj}tjd}|dd
d}|d|d|ffdd}d}ytdtdj}Wntk
rt}YnX||_|S)Ncs|S)Nrw)rlrv)funcrwrxrysz_trim_arity..rFrqrocSs8tdkrdnd	}tj||dd|}|j|jfgS)
Nror7rrqrr)limit)ror7r)system_version	traceback
extract_stackfilenamerJ)r8r
frame_summaryrwrwrxr=sz"_trim_arity..extract_stackcSs$tj||d}|d}|j|jfgS)N)r8rrrs)r<
extract_tbr>rJ)tbr8Zframesr?rwrwrxr@sz_trim_arity..extract_tb)r8rrcsxy |dd}dd<|Stk
rdr>n4z.tjd}|dddddksjWd~Xdkrdd7<wYqXqWdS)NrTrrrq)r8rsrs)rr~exc_info)rrrA)r@
foundArityr6r8maxargspa_call_line_synthrwrxwrappers"z_trim_arity..wrapperzr	__class__)ror7)r)rrs)	singleArgBuiltinsr;r<r=r@getattrr	Exceptionr{)r6rEr=Z	LINE_DIFFZ	this_linerG	func_namerw)r@rDr6r8rErFrx_trim_aritys*
rMcseZdZdZdZdZeddZeddZddd	Z	d
dZ
dd
ZdddZdddZ
ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+k	rGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r$z)Abstract base level parser element class.z 
	
FcCs
|t_dS)a
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space,  and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        N)r$DEFAULT_WHITE_CHARS)charsrwrwrxsetDefaultWhitespaceChars=s
z'ParserElement.setDefaultWhitespaceCharscCs
|t_dS)a
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        N)r$_literalStringClass)rrwrwrxinlineLiteralsUsingLsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_	d|_
d|_d|_t|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)rparseAction
failActionstrReprresultsName
saveAsListskipWhitespacer$rN
whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabsignoreExprsdebugstreamlined
mayIndexErrorerrmsgmodalResultsdebugActionsrecallPreparse
callDuringTry)rsavelistrwrwrxras(zParserElement.__init__cCs<tj|}|jdd|_|jdd|_|jr8tj|_|S)a$
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        N)rrSr]rZr$rNrY)rZcpyrwrwrxrxs
zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        z	Expected 	exception)rrarrhr)rrrwrwrxsetNames


zParserElement.setNamecCs4|j}|jdr"|dd}d}||_||_|S)aP
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        *NrrTrs)rendswithrVrb)rrlistAllMatchesZnewselfrwrwrxsetResultsNames
zParserElement.setResultsNameTcs@|r&|jdfdd	}|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        Tcsddl}|j||||S)Nr)pdbZ	set_trace)r-r	doActionscallPreParsern)_parseMethodrwrxbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parsersr)rZ	breakFlagrrrw)rqrxsetBreaks
zParserElement.setBreakcOs&tttt||_|jdd|_|S)a
        Define action to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}} for more information
        on parsing strings containing C{}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        rfF)rmaprMrSrrf)rfnsrrwrwrxrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|jdd|_|S)z
        Add parse action to expression's list of parse actions. See L{I{setParseAction}}.
        
        See examples in L{I{copy}}.
        rfF)rSrrvrMrfr)rrwrrwrwrxaddParseActionszParserElement.addParseActioncsb|jdd|jddrtntx(|D] fdd}|jj|q&W|jpZ|jdd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        messagezfailed user-defined conditionfatalFcs$tt|||s ||dS)N)rrM)rr5rv)exc_typefnrrwrxpasz&ParserElement.addCondition..parf)rr!rrSrrf)rrwrr}rw)r{r|rrxaddConditions
zParserElement.addConditioncCs
||_|S)aDefine action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately.)rT)rr|rwrwrx
setFailActions
zParserElement.setFailActioncCsZd}xP|rTd}xB|jD]8}yx|j||\}}d}qWWqtk
rLYqXqWqW|S)NTF)r]rtr)rr-rZ
exprsFoundeZdummyrwrwrx_skipIgnorables#szParserElement._skipIgnorablescCsL|jr|j||}|jrH|j}t|}x ||krF|||krF|d7}q(W|S)Nrr)r]rrXrYr)rr-rZwtinstrlenrwrwrxpreParse0szParserElement.preParsecCs|gfS)Nrw)rr-rrorwrwrx	parseImpl<szParserElement.parseImplcCs|S)Nrw)rr-r	tokenlistrwrwrx	postParse?szParserElement.postParsec"Cs|j}|s|jr|jdr,|jd||||rD|jrD|j||}n|}|}yDy|j|||\}}Wn(tk
rt|t||j	|YnXWnXt
k
r}	z<|jdr|jd||||	|jr|j||||	WYdd}	~	XnXn|o|jr|j||}n|}|}|js$|t|krhy|j|||\}}Wn*tk
rdt|t||j	|YnXn|j|||\}}|j|||}t
||j|j|jd}
|jr|s|jr|rVyRxL|jD]B}||||
}|dk	rt
||j|jot|t
tf|jd}
qWWnFt
k
rR}	z(|jdr@|jd||||	WYdd}	~	XnXnNxL|jD]B}||||
}|dk	r^t
||j|jot|t
tf|jd}
q^W|r|jdr|jd|||||
||
fS)Nrrq)rrrr)r^rTrcrerrrrrrarr`rr"rVrWrbrSrfrzr)rr-rrorpZ	debuggingprelocZtokensStarttokenserrZ	retTokensr|rwrwrx
_parseNoCacheCsp





zParserElement._parseNoCachecCs>y|j||dddStk
r8t|||j|YnXdS)NF)ror)rtr!rra)rr-rrwrwrxtryParseszParserElement.tryParsecCs2y|j||Wnttfk
r(dSXdSdS)NFT)rrr)rr-rrwrwrxcanParseNexts
zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecsdit|_fdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncsj|S)N)r)rr)cachenot_in_cacherwrxrsz3ParserElement._UnboundedCache.__init__..getcs||<dS)Nrw)rrr)rrwrxsetsz3ParserElement._UnboundedCache.__init__..setcsjdS)N)r)r)rrwrxrsz5ParserElement._UnboundedCache.__init__..clear)rrtypes
MethodTyperrr)rrrrrw)rrrxrsz&ParserElement._UnboundedCache.__init__N)rrrrrwrwrwrx_UnboundedCachesrNc@seZdZddZdS)zParserElement._FifoCachecsht|_tfdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncsj|S)N)r)rr)rrrwrxrsz.ParserElement._FifoCache.__init__..getcs"||<tkrjddS)NF)rpopitem)rrr)rsizerwrxrsz.ParserElement._FifoCache.__init__..setcsjdS)N)r)r)rrwrxrsz0ParserElement._FifoCache.__init__..clear)rr_OrderedDictrrrrr)rrrrrrw)rrrrxrsz!ParserElement._FifoCache.__init__N)rrrrrwrwrwrx
_FifoCachesrc@seZdZddZdS)zParserElement._FifoCachecsvt|_itjgfdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncsj|S)N)r)rr)rrrwrxrsz.ParserElement._FifoCache.__init__..getcs2||<tkr$jjdj|dS)N)rrpopleftr)rrr)rkey_fiforrwrxrsz.ParserElement._FifoCache.__init__..setcsjjdS)N)r)r)rrrwrxrsz0ParserElement._FifoCache.__init__..clear)	rrcollectionsdequerrrrr)rrrrrrw)rrrrrxrsz!ParserElement._FifoCache.__init__N)rrrrrwrwrwrxrsrcCsd\}}|||||f}tjtj}|j|}	|	|jkrtj|d7<y|j||||}	Wn8tk
r}
z|j||
j	|
j
WYdd}
~
XqX|j||	d|	djf|	Sn4tj|d7<t|	t
r|	|	d|	djfSWdQRXdS)Nrrr)rrr)r$packrat_cache_lock
packrat_cacherrpackrat_cache_statsrrrrHrrrzrK)rr-rrorpZHITZMISSlookuprrrrwrwrx_parseCaches$


zParserElement._parseCachecCs(tjjdgttjtjdd<dS)Nr)r$rrrrrwrwrwrx
resetCaches
zParserElement.resetCachecCs8tjs4dt_|dkr tjt_ntj|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic.
           Repeated parse attempts at the same string location (which happens
           often in many complex grammars) can immediately return a cached value,
           instead of re-executing parsing/validating code.  Memoizing is done of
           both valid results and parsing exceptions.
           
           Parameters:
            - cache_size_limit - (default=C{128}) - if an integer value is provided
              will limit the size of the packrat cache; if None is passed, then
              the cache size will be unbounded; if 0 is passed, the cache will
              be effectively disabled.
            
           This speedup may break existing programs that use parse actions that
           have side-effects.  For this reason, packrat parsing is disabled when
           you first import pyparsing.  To activate the packrat feature, your
           program must call the class method C{ParserElement.enablePackrat()}.  If
           your program uses C{psyco} to "compile as you go", you must call
           C{enablePackrat} before calling C{psyco.full()}.  If you do not do this,
           Python will crash.  For best results, call C{enablePackrat()} immediately
           after importing pyparsing.
           
           Example::
               import pyparsing
               pyparsing.ParserElement.enablePackrat()
        TN)r$_packratEnabledrrrrrt)Zcache_size_limitrwrwrx
enablePackratszParserElement.enablePackratcCstj|js|jx|jD]}|jqW|js<|j}y<|j|d\}}|rv|j||}t	t
}|j||Wn0tk
r}ztjrn|WYdd}~XnX|SdS)aB
        Execute the parse expression with the given string.
        This is the main interface to the client code, once the complete
        expression has been built.

        If you want the grammar to require that the entire input string be
        successfully parsed, then set C{parseAll} to True (equivalent to ending
        the grammar with C{L{StringEnd()}}).

        Note: C{parseString} implicitly calls C{expandtabs()} on the input string,
        in order to report proper column numbers in parse actions.
        If the input string contains tabs and
        the grammar uses parse actions that use the C{loc} argument to index into the
        string being parsed, you can ensure you have a consistent view of the input
        string by:
         - calling C{parseWithTabs} on your grammar before calling C{parseString}
           (see L{I{parseWithTabs}})
         - define your parse action using the full C{(s,loc,toks)} signature, and
           reference the input string using the parse action's C{s} argument
         - explictly expand the tabs in your input string before calling
           C{parseString}
        
        Example::
            Word('a').parseString('aaaaabaaa')  # -> ['aaaaa']
            Word('a').parseString('aaaaabaaa', parseAll=True)  # -> Exception: Expected end of text
        rN)
r$rr_
streamliner]r\
expandtabsrtrr
r)rverbose_stacktrace)rr-parseAllrrrZser3rwrwrxparseString#s$zParserElement.parseStringccs@|js|jx|jD]}|jqW|js8t|j}t|}d}|j}|j}t	j
d}	yx||kon|	|kry |||}
|||
dd\}}Wntk
r|
d}Yq`X||kr|	d7}	||
|fV|r|||}
|
|kr|}q|d7}n|}q`|
d}q`WWn4tk
r:}zt	j
r&n|WYdd}~XnXdS)a
        Scan the input string for expression matches.  Each match will return the
        matching tokens, start location, and end location.  May be called with optional
        C{maxMatches} argument, to clip scanning after 'n' matches are found.  If
        C{overlap} is specified, then overlapping matches will be reported.

        Note that the start and end locations are reported relative to the string
        being parsed.  See L{I{parseString}} for more information on parsing
        strings with embedded tabs.

        Example::
            source = "sldjf123lsdjjkf345sldkjf879lkjsfd987"
            print(source)
            for tokens,start,end in Word(alphas).scanString(source):
                print(' '*start + '^'*(end-start))
                print(' '*start + tokens[0])
        
        prints::
        
            sldjf123lsdjjkf345sldkjf879lkjsfd987
            ^^^^^
            sldjf
                    ^^^^^^^
                    lsdjjkf
                              ^^^^^^
                              sldkjf
                                       ^^^^^^
                                       lkjsfd
        rF)rprrN)r_rr]r\rrrrrtr$rrrr)rr-
maxMatchesZoverlaprrrZ
preparseFnZparseFnmatchesrZnextLocrZnextlocr3rwrwrx
scanStringUsB


zParserElement.scanStringcCsg}d}d|_yxh|j|D]Z\}}}|j||||rrt|trT||j7}nt|trh||7}n
|j||}qW|j||ddd|D}djtt	t
|Stk
r}ztj
rȂn|WYdd}~XnXdS)af
        Extension to C{L{scanString}}, to modify matching text with modified tokens that may
        be returned from a parse action.  To use C{transformString}, define a grammar and
        attach a parse action to it that modifies the returned token list.
        Invoking C{transformString()} on a target string will then scan for matches,
        and replace the matched text patterns according to the logic in the parse
        action.  C{transformString()} returns the resulting transformed string.
        
        Example::
            wd = Word(alphas)
            wd.setParseAction(lambda toks: toks[0].title())
            
            print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york."))
        Prints::
            Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York.
        rTNcSsg|]}|r|qSrwrw)rorwrwrxrsz1ParserElement.transformString..r)r\rrrzr"rrrrvr_flattenrr$r)rr-rZlastErvrrr3rwrwrxrs(



zParserElement.transformStringcCsPytdd|j||DStk
rJ}ztjr6n|WYdd}~XnXdS)a~
        Another extension to C{L{scanString}}, simplifying the access to the tokens found
        to match the given parse expression.  May be called with optional
        C{maxMatches} argument, to clip searching after 'n' matches are found.
        
        Example::
            # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters
            cap_word = Word(alphas.upper(), alphas.lower())
            
            print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))
        prints::
            ['More', 'Iron', 'Lead', 'Gold', 'I']
        cSsg|]\}}}|qSrwrw)rrvrrrwrwrxrsz.ParserElement.searchString..N)r"rrr$r)rr-rr3rwrwrxsearchStringszParserElement.searchStringc	csXd}d}x<|j||dD]*\}}}|||V|r>|dV|}qW||dVdS)a[
        Generator method to split a string using the given expression as a separator.
        May be called with optional C{maxsplit} argument, to limit the number of splits;
        and the optional C{includeSeparators} argument (default=C{False}), if the separating
        matching text should be included in the split results.
        
        Example::        
            punc = oneOf(list(".,;:/-!?"))
            print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
        prints::
            ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
        r)rN)r)	rr-maxsplitZincludeSeparatorsZsplitsZlastrvrrrwrwrxrs

zParserElement.splitcCsFt|trtj|}t|ts:tjdt|tdddSt||gS)a
        Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
        converts them to L{Literal}s by default.
        
        Example::
            greet = Word(alphas) + "," + Word(alphas) + "!"
            hello = "Hello, World!"
            print (hello, "->", greet.parseString(hello))
        Prints::
            Hello, World! -> ['Hello', ',', 'World', '!']
        z4Cannot combine element of type %s with ParserElementrq)
stacklevelN)	rzrr$rQwarningswarnr
SyntaxWarningr)rrrwrwrxrs



zParserElement.__add__cCsBt|trtj|}t|ts:tjdt|tdddS||S)z]
        Implementation of + operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrxrs



zParserElement.__radd__cCsLt|trtj|}t|ts:tjdt|tdddSt|tj	|gS)zQ
        Implementation of - operator, returns C{L{And}} with error stop
        z4Cannot combine element of type %s with ParserElementrq)rN)
rzrr$rQrrrrr
_ErrorStop)rrrwrwrx__sub__s



zParserElement.__sub__cCsBt|trtj|}t|ts:tjdt|tdddS||S)z]
        Implementation of - operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rsub__ s



zParserElement.__rsub__cst|tr|d}}nt|tr|ddd}|ddkrHd|df}t|dtr|ddkr|ddkrvtS|ddkrtS|dtSnJt|dtrt|dtr|\}}||8}ntdt|dt|dntdt||dkrtd|dkrtd||ko2dknrBtd	|rfd
d|r|dkrt|}ntg||}n|}n|dkr}ntg|}|S)
a
        Implementation of * operator, allows use of C{expr * 3} in place of
        C{expr + expr + expr}.  Expressions may also me multiplied by a 2-integer
        tuple, similar to C{{min,max}} multipliers in regular expressions.  Tuples
        may also include C{None} as in:
         - C{expr*(n,None)} or C{expr*(n,)} is equivalent
              to C{expr*n + L{ZeroOrMore}(expr)}
              (read as "at least n instances of C{expr}")
         - C{expr*(None,n)} is equivalent to C{expr*(0,n)}
              (read as "0 to n instances of C{expr}")
         - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)}
         - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)}

        Note that C{expr*(None,n)} does not raise an exception if
        more than n exprs exist in the input stream; that is,
        C{expr*(None,n)} does not enforce a maximum number of expr
        occurrences.  If this behavior is desired, then write
        C{expr*(None,n) + ~expr}
        rNrqrrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdS)Nrr)r)n)makeOptionalListrrwrxr]sz/ParserElement.__mul__..makeOptionalList)NN)	rzrutupler2rrr
ValueErrorr)rrZminElementsZoptElementsrrw)rrrx__mul__,sD







zParserElement.__mul__cCs
|j|S)N)r)rrrwrwrx__rmul__pszParserElement.__rmul__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zI
        Implementation of | operator - returns C{L{MatchFirst}}
        z4Cannot combine element of type %s with ParserElementrq)rN)	rzrr$rQrrrrr)rrrwrwrx__or__ss



zParserElement.__or__cCsBt|trtj|}t|ts:tjdt|tdddS||BS)z]
        Implementation of | operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__ror__s



zParserElement.__ror__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zA
        Implementation of ^ operator - returns C{L{Or}}
        z4Cannot combine element of type %s with ParserElementrq)rN)	rzrr$rQrrrrr)rrrwrwrx__xor__s



zParserElement.__xor__cCsBt|trtj|}t|ts:tjdt|tdddS||AS)z]
        Implementation of ^ operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rxor__s



zParserElement.__rxor__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zC
        Implementation of & operator - returns C{L{Each}}
        z4Cannot combine element of type %s with ParserElementrq)rN)	rzrr$rQrrrrr)rrrwrwrx__and__s



zParserElement.__and__cCsBt|trtj|}t|ts:tjdt|tdddS||@S)z]
        Implementation of & operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rand__s



zParserElement.__rand__cCst|S)zE
        Implementation of ~ operator - returns C{L{NotAny}}
        )r)rrwrwrx
__invert__szParserElement.__invert__cCs|dk	r|j|S|jSdS)a

        Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}.
        
        If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be
        passed as C{True}.
           
        If C{name} is omitted, same as calling C{L{copy}}.

        Example::
            # these are equivalent
            userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
            userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")             
        N)rmr)rrrwrwrx__call__s
zParserElement.__call__cCst|S)z
        Suppresses the output of this C{ParserElement}; useful to keep punctuation from
        cluttering up returned output.
        )r+)rrwrwrxsuppressszParserElement.suppresscCs
d|_|S)a
        Disables the skipping of whitespace before matching the characters in the
        C{ParserElement}'s defined pattern.  This is normally only used internally by
        the pyparsing module, but may be needed in some whitespace-sensitive grammars.
        F)rX)rrwrwrxleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8
        Overrides the default whitespace chars
        TF)rXrYrZ)rrOrwrwrxsetWhitespaceCharssz ParserElement.setWhitespaceCharscCs
d|_|S)z
        Overrides default behavior to expand C{}s to spaces before parsing the input string.
        Must be called before C{parseString} when the input grammar contains elements that
        match C{} characters.
        T)r\)rrwrwrx
parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|jj|n|jjt|j|S)a
        Define expression to be ignored (e.g., comments) while doing pattern
        matching; may be called repeatedly, to define multiple comment or other
        ignorable patterns.
        
        Example::
            patt = OneOrMore(Word(alphas))
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
            
            patt.ignore(cStyleComment)
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd']
        )rzrr+r]rr)rrrwrwrxignores


zParserElement.ignorecCs"|pt|pt|ptf|_d|_|S)zT
        Enable display of debugging messages while doing pattern matching.
        T)r/r2r4rcr^)rZstartActionZ
successActionZexceptionActionrwrwrxsetDebugActions
s
zParserElement.setDebugActionscCs|r|jtttnd|_|S)a
        Enable display of debugging messages while doing pattern matching.
        Set C{flag} to True to enable, False to disable.

        Example::
            wd = Word(alphas).setName("alphaword")
            integer = Word(nums).setName("numword")
            term = wd | integer
            
            # turn on debugging for wd
            wd.setDebug()

            OneOrMore(term).parseString("abc 123 xyz 890")
        
        prints::
            Match alphaword at loc 0(1,1)
            Matched alphaword -> ['abc']
            Match alphaword at loc 3(1,4)
            Exception raised:Expected alphaword (at char 4), (line:1, col:5)
            Match alphaword at loc 7(1,8)
            Matched alphaword -> ['xyz']
            Match alphaword at loc 11(1,12)
            Exception raised:Expected alphaword (at char 12), (line:1, col:13)
            Match alphaword at loc 15(1,16)
            Exception raised:Expected alphaword (at char 15), (line:1, col:16)

        The output shown is that produced by the default debug actions - custom debug actions can be
        specified using L{setDebugActions}. Prior to attempting
        to match the C{wd} expression, the debugging message C{"Match  at loc (,)"}
        is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"}
        message is shown. Also note the use of L{setName} to assign a human-readable name to the expression,
        which makes debugging and exception messages easier to understand - for instance, the default
        name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}.
        F)rr/r2r4r^)rflagrwrwrxsetDebugs#zParserElement.setDebugcCs|jS)N)r)rrwrwrxr@szParserElement.__str__cCst|S)N)r)rrwrwrxrCszParserElement.__repr__cCsd|_d|_|S)NT)r_rU)rrwrwrxrFszParserElement.streamlinecCsdS)Nrw)rrrwrwrxcheckRecursionKszParserElement.checkRecursioncCs|jgdS)zj
        Check defined expressions for valid structure, check for infinite recursive definitions.
        N)r)r
validateTracerwrwrxvalidateNszParserElement.validatecCsy|j}Wn2tk
r>t|d}|j}WdQRXYnXy|j||Stk
r|}ztjrhn|WYdd}~XnXdS)z
        Execute the parse expression on the given file or filename.
        If a filename is specified (instead of a file object),
        the entire file is opened, read, and closed before parsing.
        rN)readropenrrr$r)rZfile_or_filenamerZ
file_contentsfr3rwrwrx	parseFileTszParserElement.parseFilecsHt|tr"||kp t|t|kSt|tr6|j|Stt||kSdS)N)rzr$varsrrsuper)rr)rHrwrx__eq__hs



zParserElement.__eq__cCs
||kS)Nrw)rrrwrwrx__ne__pszParserElement.__ne__cCstt|S)N)hashid)rrwrwrx__hash__sszParserElement.__hash__cCs||kS)Nrw)rrrwrwrx__req__vszParserElement.__req__cCs
||kS)Nrw)rrrwrwrx__rne__yszParserElement.__rne__cCs0y|jt||ddStk
r*dSXdS)a
        Method for quick testing of a parser against a test string. Good for simple 
        inline microtests of sub expressions while building up larger parser.
           
        Parameters:
         - testString - to test against this expression for a match
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests
            
        Example::
            expr = Word(nums)
            assert expr.matches("100")
        )rTFN)rrr)rZ
testStringrrwrwrxr|s

zParserElement.matches#cCst|tr"tttj|jj}t|tr4t|}g}g}d}	x|D]}
|dk	rb|j	|
dsl|rx|
rx|j
|
qH|
s~qHdj||
g}g}y:|
jdd}
|j
|
|d}|j
|j|d|	o|}	Wntk
rx}
zt|
trdnd	}d|
kr0|j
t|
j|
|j
d
t|
j|
dd|n|j
d
|
jd||j
d
t|
|	ob|}	|
}WYdd}
~
XnDtk
r}z&|j
dt||	o|}	|}WYdd}~XnX|r|r|j
d	tdj||j
|
|fqHW|	|fS)a3
        Execute the parse expression on a series of test strings, showing each
        test, the parsed results or where the parse failed. Quick and easy way to
        run a parse expression against a list of sample strings.
           
        Parameters:
         - tests - a list of separate test strings, or a multiline string of test strings
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests           
         - comment - (default=C{'#'}) - expression for indicating embedded comments in the test 
              string; pass None to disable comment filtering
         - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline;
              if False, only dump nested list
         - printResults - (default=C{True}) prints test output to stdout
         - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing

        Returns: a (success, results) tuple, where success indicates that all tests succeeded
        (or failed if C{failureTests} is True), and the results contain a list of lines of each 
        test's output
        
        Example::
            number_expr = pyparsing_common.number.copy()

            result = number_expr.runTests('''
                # unsigned integer
                100
                # negative integer
                -100
                # float with scientific notation
                6.02e23
                # integer with scientific notation
                1e-12
                ''')
            print("Success" if result[0] else "Failed!")

            result = number_expr.runTests('''
                # stray character
                100Z
                # missing leading digit before '.'
                -.100
                # too many '.'
                3.14.159
                ''', failureTests=True)
            print("Success" if result[0] else "Failed!")
        prints::
            # unsigned integer
            100
            [100]

            # negative integer
            -100
            [-100]

            # float with scientific notation
            6.02e23
            [6.02e+23]

            # integer with scientific notation
            1e-12
            [1e-12]

            Success
            
            # stray character
            100Z
               ^
            FAIL: Expected end of text (at char 3), (line:1, col:4)

            # missing leading digit before '.'
            -.100
            ^
            FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1)

            # too many '.'
            3.14.159
                ^
            FAIL: Expected end of text (at char 4), (line:1, col:5)

            Success

        Each test string must be on a single line. If you want to test a string that spans multiple
        lines, create a test like this::

            expr.runTest(r"this is a test\n of strings that spans \n 3 lines")
        
        (Note that this is a raw string literal, you must include the leading 'r'.)
        TNFrz\n)r)r z(FATAL)r rr^zFAIL: zFAIL-EXCEPTION: )rzrrrvr{rrstrip
splitlinesrrrrrrrrr!rGrr9rKr,)rZtestsrZcommentZfullDumpZprintResultsZfailureTestsZ
allResultsZcommentssuccessrvrresultrrzr3rwrwrxrunTestssNW



$


zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)TrTTF)OrrrrrNrstaticmethodrPrRrrrirmrurrxr~rrrrrrrrrrrrrrrrrrtrrrr_MAX_INTrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
__classcell__rwrw)rHrxr$8s


&




H
"
2G+D
			

)

cs eZdZdZfddZZS)r,zT
    Abstract C{ParserElement} subclass, for defining atomic matching patterns.
    cstt|jdddS)NF)rg)rr,r)r)rHrwrxr	szToken.__init__)rrrrrrrwrw)rHrxr,	scs eZdZdZfddZZS)r
z,
    An empty token, will always match.
    cs$tt|jd|_d|_d|_dS)Nr
TF)rr
rrr[r`)r)rHrwrxr	szEmpty.__init__)rrrrrrrwrw)rHrxr
	scs*eZdZdZfddZdddZZS)rz(
    A token that will never match.
    cs*tt|jd|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrr[r`ra)r)rHrwrxr*	s
zNoMatch.__init__TcCst|||j|dS)N)rra)rr-rrorwrwrxr1	szNoMatch.parseImpl)T)rrrrrrrrwrw)rHrxr&	scs*eZdZdZfddZdddZZS)ra
    Token to exactly match a specified string.
    
    Example::
        Literal('blah').parseString('blah')  # -> ['blah']
        Literal('blah').parseString('blahfooblah')  # -> ['blah']
        Literal('blah').parseString('bla')  # -> Exception: Expected "blah"
    
    For case-insensitive matching, use L{CaselessLiteral}.
    
    For keyword matching (force word break before and after the matched string),
    use L{Keyword} or L{CaselessKeyword}.
    cstt|j||_t||_y|d|_Wn*tk
rVtj	dt
ddt|_YnXdt
|j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrq)rz"%s"z	Expected F)rrrmatchrmatchLenfirstMatchCharrrrrr
rHrrrar[r`)rmatchString)rHrwrxrC	s

zLiteral.__init__TcCsJ|||jkr6|jdks&|j|j|r6||j|jfSt|||j|dS)Nrr)rr
startswithrrra)rr-rrorwrwrxrV	szLiteral.parseImpl)T)rrrrrrrrwrw)rHrxr5	s
csLeZdZdZedZdfdd	Zddd	Zfd
dZe	dd
Z
ZS)ra\
    Token to exactly match a specified string as a keyword, that is, it must be
    immediately followed by a non-keyword character.  Compare with C{L{Literal}}:
     - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}.
     - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'}
    Accepts two optional constructor arguments in addition to the keyword string:
     - C{identChars} is a string of characters that would be valid identifier characters,
          defaulting to all alphanumerics + "_" and "$"
     - C{caseless} allows case-insensitive matching, default is C{False}.
       
    Example::
        Keyword("start").parseString("start")  # -> ['start']
        Keyword("start").parseString("starting")  # -> Exception

    For case-insensitive matching, use L{CaselessKeyword}.
    z_$NFcstt|j|dkrtj}||_t||_y|d|_Wn$tk
r^t	j
dtddYnXd|j|_d|j|_
d|_d|_||_|r|j|_|j}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrq)rz"%s"z	Expected F)rrrDEFAULT_KEYWORD_CHARSrrrrrrrrrrar[r`caselessupper
caselessmatchr
identChars)rrrr)rHrwrxrq	s&

zKeyword.__init__TcCs|jr|||||jj|jkr|t||jksL|||jj|jkr|dksj||dj|jkr||j|jfSnv|||jkr|jdks|j|j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt	|||j
|dS)Nrrr)rrrrrrrrrrra)rr-rrorwrwrxr	s*&zKeyword.parseImplcstt|j}tj|_|S)N)rrrrr)rr)rHrwrxr	szKeyword.copycCs
|t_dS)z,Overrides the default Keyword chars
        N)rr)rOrwrwrxsetDefaultKeywordChars	szKeyword.setDefaultKeywordChars)NF)T)rrrrr3rrrrrrrrwrw)rHrxr^	s
cs*eZdZdZfddZdddZZS)ral
    Token to match a specified string, ignoring case of letters.
    Note: the matched results will always be in the case of the given
    match string, NOT the case of the input text.

    Example::
        OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD']
        
    (Contrast with example for L{CaselessKeyword}.)
    cs6tt|j|j||_d|j|_d|j|_dS)Nz'%s'z	Expected )rrrrreturnStringrra)rr)rHrwrxr	szCaselessLiteral.__init__TcCs@||||jj|jkr,||j|jfSt|||j|dS)N)rrrrrra)rr-rrorwrwrxr	szCaselessLiteral.parseImpl)T)rrrrrrrrwrw)rHrxr	s
cs,eZdZdZdfdd	Zd	ddZZS)
rz
    Caseless version of L{Keyword}.

    Example::
        OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD']
        
    (Contrast with example for L{CaselessLiteral}.)
    Ncstt|j||dddS)NT)r)rrr)rrr)rHrwrxr	szCaselessKeyword.__init__TcCsj||||jj|jkrV|t||jksF|||jj|jkrV||j|jfSt|||j|dS)N)rrrrrrrra)rr-rrorwrwrxr	s*zCaselessKeyword.parseImpl)N)T)rrrrrrrrwrw)rHrxr	scs,eZdZdZdfdd	Zd	ddZZS)
rlax
    A variation on L{Literal} which matches "close" matches, that is, 
    strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters:
     - C{match_string} - string to be matched
     - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match
    
    The results from a successful parse will contain the matched text from the input string and the following named results:
     - C{mismatches} - a list of the positions within the match_string where mismatches were found
     - C{original} - the original match_string used to compare against the input string
    
    If C{mismatches} is an empty list, then the match was an exact match.
    
    Example::
        patt = CloseMatch("ATCATCGAATGGA")
        patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']})
        patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1)

        # exact match
        patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']})

        # close match allowing up to 2 mismatches
        patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2)
        patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']})
    rrcsBtt|j||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F)	rrlrrmatch_string
maxMismatchesrar`r[)rrr)rHrwrxr	szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g}	|j}
xtt||||jD]0\}}|\}}
||
krP|	j|t|	|
krPPqPW|d}t|||g}|j|d<|	|d<||fSt|||j|dS)Nrrroriginal
mismatches)	rrrrrrr"rra)rr-rrostartrmaxlocrZmatch_stringlocrrZs_msrcmatresultsrwrwrxr	s("

zCloseMatch.parseImpl)rr)T)rrrrrrrrwrw)rHrxrl	s	cs8eZdZdZd
fdd	Zdd	d
ZfddZZS)r/a	
    Token for matching words composed of allowed character sets.
    Defined with string containing all allowed initial characters,
    an optional string containing allowed body characters (if omitted,
    defaults to the initial character set), and an optional minimum,
    maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction. An optional
    C{excludeChars} parameter can list characters that might be found in 
    the input C{bodyChars} string; useful to define a word of all printables
    except for one or two characters, for instance.
    
    L{srange} is useful for defining custom character set strings for defining 
    C{Word} expressions, using range notation from regular expression character sets.
    
    A common mistake is to use C{Word} to match a specific literal string, as in 
    C{Word("Address")}. Remember that C{Word} uses the string argument to define
    I{sets} of matchable characters. This expression would match "Add", "AAA",
    "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'.
    To match an exact literal string, use L{Literal} or L{Keyword}.

    pyparsing includes helper strings for building Words:
     - L{alphas}
     - L{nums}
     - L{alphanums}
     - L{hexnums}
     - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.)
     - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.)
     - L{printables} (any non-whitespace character)

    Example::
        # a word composed of digits
        integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9"))
        
        # a word with a leading capital, and zero or more lowercase
        capital_word = Word(alphas.upper(), alphas.lower())

        # hostnames are alphanumeric, with leading alpha, and '-'
        hostname = Word(alphas, alphanums+'-')
        
        # roman numeral (not a strict parser, accepts invalid mix of characters)
        roman = Word("IVXLCDM")
        
        # any string of non-whitespace characters, except for ','
        csv_value = Word(printables, excludeChars=",")
    NrrrFcstt|jrFdjfdd|D}|rFdjfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_	|dkrt
d||_|dkr||_nt
|_|dkr||_||_t||_d|j|_d	|_||_d
|j|jkr|dkr|dkr|dkr|j|jkr8dt|j|_nHt|jdkrfdtj|jt|jf|_nd
t|jt|jf|_|jrd|jd|_ytj|j|_Wntk
rd|_YnXdS)Nrc3s|]}|kr|VqdS)Nrw)rr)excludeCharsrwrxr7
sz Word.__init__..c3s|]}|kr|VqdS)Nrw)rr)rrwrxr9
srrrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedz	Expected Frz[%s]+z%s[%s]*z	[%s][%s]*z\b)rr/rr
initCharsOrigr	initChars
bodyCharsOrig	bodyCharsmaxSpecifiedrminLenmaxLenrrrrar`	asKeyword_escapeRegexRangeCharsreStringrrdescapecompilerK)rrrminmaxexactrr)rH)rrxr4
sT



0
z
Word.__init__Tc
CsD|jr<|jj||}|s(t|||j||j}||jfS|||jkrZt|||j||}|d7}t|}|j}||j	}t
||}x ||kr|||kr|d7}qWd}	|||jkrd}	|jr||kr|||krd}	|j
r|dkr||d|ks||kr|||krd}	|	r4t|||j|||||fS)NrrFTr)rdrrraendgrouprrrrrrrr)
rr-rrorrrZ	bodycharsrZthrowExceptionrwrwrxrj
s6

4zWord.parseImplcstytt|jStk
r"YnX|jdkrndd}|j|jkr^d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)Nz...)r)rrwrwrx
charsAsStr
sz Word.__str__..charsAsStrz	W:(%s,%s)zW:(%s))rr/rrKrUrr)rr)rHrwrxr
s
zWord.__str__)NrrrrFN)T)rrrrrrrrrwrw)rHrxr/
s.6
#csFeZdZdZeejdZdfdd	ZdddZ	fd	d
Z
ZS)
r'a
    Token for matching strings that match a given regular expression.
    Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.
    If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as 
    named parse results.

    Example::
        realnum = Regex(r"[+-]?\d+\.\d*")
        date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)')
        # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression
        roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})")
    z[A-Z]rcstt|jt|tr|s,tjdtdd||_||_	yt
j|j|j	|_
|j|_Wqt
jk
rtjd|tddYqXn2t|tjr||_
t||_|_||_	ntdt||_d|j|_d|_d|_d	S)
zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrq)rz$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectz	Expected FTN)rr'rrzrrrrpatternflagsrdr
r
sre_constantserrorcompiledREtyper{rrrrar`r[)rrr)rHrwrxr
s.





zRegex.__init__TcCsd|jj||}|s"t|||j||j}|j}t|j}|r\x|D]}||||<qHW||fS)N)rdrrrar	groupdictr"r)rr-rrordrrrwrwrxr
s
zRegex.parseImplcsDytt|jStk
r"YnX|jdkr>dt|j|_|jS)NzRe:(%s))rr'rrKrUrr)r)rHrwrxr
s
z
Regex.__str__)r)T)rrrrrrdr
rrrrrrwrw)rHrxr'
s
"

cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
r%a
    Token for matching strings that are delimited by quoting characters.
    
    Defined with the following parameters:
        - quoteChar - string of one or more characters defining the quote delimiting string
        - escChar - character to escape quotes, typically backslash (default=C{None})
        - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None})
        - multiline - boolean indicating whether quotes can span multiple lines (default=C{False})
        - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True})
        - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar)
        - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True})

    Example::
        qs = QuotedString('"')
        print(qs.searchString('lsjdf "This is the quote" sldjf'))
        complex_qs = QuotedString('{{', endQuoteChar='}}')
        print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf'))
        sql_qs = QuotedString('"', escQuote='""')
        print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf'))
    prints::
        [['This is the quote']]
        [['This is the "quote"']]
        [['This is the quote with "embedded" quotes']]
    NFTcsNttj|j}|s0tjdtddt|dkr>|}n"|j}|s`tjdtddt|_t	|_
|d_|_t	|_
|_|_|_|_|rtjtjB_dtjjtjd|dk	rt|pdf_n.)z|(?:%s)z|(?:%s.)z(.)z)*%sz$invalid pattern (%s) passed to Regexz	Expected FTrs)%rr%rrrrrSyntaxError	quoteCharrquoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesrd	MULTILINEDOTALLrr	rrrrescCharReplacePatternr
rrrrrrar`r[)rrr r!Z	multiliner"rr#)rH)rrxrsf




6

zQuotedString.__init__c	Cs|||jkr|jj||pd}|s4t|||j||j}|j}|jr||j|j	}t
|trd|kr|jrddddd}x |j
D]\}}|j||}qW|jrtj|jd|}|jr|j|j|j}||fS)N\	r
)z\tz\nz\fz\rz\g<1>)rrdrrrarrr"rrrzrr#rrr rr&r!r)	rr-rrorrZws_mapZwslitZwscharrwrwrxrGs( 
zQuotedString.parseImplcsFytt|jStk
r"YnX|jdkr@d|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr%rrKrUrr)r)rHrwrxrjs
zQuotedString.__str__)NNFTNT)T)rrrrrrrrrwrw)rHrxr%
sA
#cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
r	a
    Token for matching words composed of characters I{not} in a given set (will
    include whitespace in matched characters if not listed in the provided exclusion set - see example).
    Defined with string containing all disallowed characters, and an optional
    minimum, maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction.

    Example::
        # define a comma-separated-value as anything that is not a ','
        csv_value = CharsNotIn(',')
        print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213"))
    prints::
        ['dkls', 'lsdkjf', 's12 34', '@!#', '213']
    rrrcstt|jd|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t	||_
d|j
|_|jdk|_d|_
dS)NFrrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrz	Expected )rr	rrXnotCharsrrrrrrrar[r`)rr+rrr
)rHrwrxrs 
zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}x ||krd|||krd|d7}qFW|||jkrt|||j|||||fS)Nrr)r+rrarrrr)rr-rrorZnotcharsmaxlenrwrwrxrs
zCharsNotIn.parseImplcsdytt|jStk
r"YnX|jdkr^t|jdkrRd|jdd|_nd|j|_|jS)Nrz
!W:(%s...)z!W:(%s))rr	rrKrUrr+)r)rHrwrxrs
zCharsNotIn.__str__)rrrr)T)rrrrrrrrrwrw)rHrxr	vs
cs<eZdZdZddddddZdfdd	ZdddZZS)r.a
    Special matching class for matching whitespace.  Normally, whitespace is ignored
    by pyparsing grammars.  This class is included when some whitespace structures
    are significant.  Define with a string containing the whitespace characters to be
    matched; default is C{" \t\r\n"}.  Also takes optional C{min}, C{max}, and C{exact} arguments,
    as defined for the C{L{Word}} class.
    zzzzz)rr(rr*r) 	
rrrcsttj|_jdjfddjDdjddjD_d_dj_	|_
|dkrt|_nt_|dkr|_|_
dS)Nrc3s|]}|jkr|VqdS)N)
matchWhite)rr)rrwrxrsz!White.__init__..css|]}tj|VqdS)N)r.	whiteStrs)rrrwrwrxrsTz	Expected r)
rr.rr.rrrYrr[rarrr)rZwsrrr
)rH)rrxrs zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}x"||krd|||jkrd|d7}qDW|||jkrt|||j|||||fS)Nrr)r.rrarrrr)rr-rrorrrwrwrxrs
zWhite.parseImpl)r-rrrr)T)rrrrr/rrrrwrw)rHrxr.scseZdZfddZZS)_PositionTokencs(tt|j|jj|_d|_d|_dS)NTF)rr0rrHrrr[r`)r)rHrwrxrs
z_PositionToken.__init__)rrrrrrwrw)rHrxr0sr0cs2eZdZdZfddZddZd	ddZZS)
rzb
    Token to advance to a specific column of input text; useful for tabular report scraping.
    cstt|j||_dS)N)rrrr9)rcolno)rHrwrxrszGoToColumn.__init__cCs`t|||jkr\t|}|jr*|j||}x0||krZ||jrZt|||jkrZ|d7}q,W|S)Nrr)r9rr]risspace)rr-rrrwrwrxrs&zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected column)r9r)rr-rroZthiscolZnewlocrrwrwrxrs

zGoToColumn.parseImpl)T)rrrrrrrrrwrw)rHrxrs	cs*eZdZdZfddZdddZZS)ra
    Matches if current position is at the beginning of a line within the parse string
    
    Example::
    
        test = '''        AAA this line
        AAA and this line
          AAA but not this one
        B AAA and definitely not this one
        '''

        for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
            print(t)
    
    Prints::
        ['AAA', ' this line']
        ['AAA', ' and this line']    

    cstt|jd|_dS)NzExpected start of line)rrrra)r)rHrwrxr&szLineStart.__init__TcCs*t||dkr|gfSt|||j|dS)Nrr)r9rra)rr-rrorwrwrxr*szLineStart.parseImpl)T)rrrrrrrrwrw)rHrxrscs*eZdZdZfddZdddZZS)rzU
    Matches if current position is at the end of a line within the parse string
    cs,tt|j|jtjjddd|_dS)NrrzExpected end of line)rrrrr$rNrra)r)rHrwrxr3szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nrrr)rrra)rr-rrorwrwrxr8szLineEnd.parseImpl)T)rrrrrrrrwrw)rHrxr/scs*eZdZdZfddZdddZZS)r*zM
    Matches if current position is at the beginning of the parse string
    cstt|jd|_dS)NzExpected start of text)rr*rra)r)rHrwrxrGszStringStart.__init__TcCs0|dkr(||j|dkr(t|||j||gfS)Nr)rrra)rr-rrorwrwrxrKszStringStart.parseImpl)T)rrrrrrrrwrw)rHrxr*Cscs*eZdZdZfddZdddZZS)r)zG
    Matches if current position is at the end of the parse string
    cstt|jd|_dS)NzExpected end of text)rr)rra)r)rHrwrxrVszStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dS)Nrr)rrra)rr-rrorwrwrxrZszStringEnd.parseImpl)T)rrrrrrrrwrw)rHrxr)Rscs.eZdZdZeffdd	ZdddZZS)r1ap
    Matches if the current position is at the beginning of a Word, and
    is not preceded by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of
    the string being parsed, or at the beginning of a line.
    cs"tt|jt||_d|_dS)NzNot at the start of a word)rr1rr	wordCharsra)rr3)rHrwrxrls
zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfS)Nrrr)r3rra)rr-rrorwrwrxrqs
zWordStart.parseImpl)T)rrrrrVrrrrwrw)rHrxr1dscs.eZdZdZeffdd	ZdddZZS)r0aZ
    Matches if the current position is at the end of a Word, and
    is not followed by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of
    the string being parsed, or at the end of a line.
    cs(tt|jt||_d|_d|_dS)NFzNot at the end of a word)rr0rrr3rXra)rr3)rHrwrxrs
zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfS)Nrrr)rr3rra)rr-rrorrwrwrxrszWordEnd.parseImpl)T)rrrrrVrrrrwrw)rHrxr0xscseZdZdZdfdd	ZddZddZd	d
ZfddZfd
dZ	fddZ
dfdd	ZgfddZfddZ
ZS)r z^
    Abstract subclass of ParserElement, for combining and post-processing parsed tokens.
    Fcstt|j|t|tr"t|}t|tr.F)rr rrzrrrr$rQexprsrIterableallrvrre)rr4rg)rHrwrxrs

zParseExpression.__init__cCs
|j|S)N)r4)rrrwrwrxrszParseExpression.__getitem__cCs|jj|d|_|S)N)r4rrU)rrrwrwrxrszParseExpression.appendcCs4d|_dd|jD|_x|jD]}|jq W|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on
           all contained expressions.FcSsg|]}|jqSrw)r)rrrwrwrxrsz3ParseExpression.leaveWhitespace..)rXr4r)rrrwrwrxrs
zParseExpression.leaveWhitespacecszt|trF||jkrvtt|j|xP|jD]}|j|jdq,Wn0tt|j|x|jD]}|j|jdq^W|S)Nrrrsrs)rzr+r]rr rr4)rrr)rHrwrxrs

zParseExpression.ignorecsLytt|jStk
r"YnX|jdkrFd|jjt|jf|_|jS)Nz%s:(%s))	rr rrKrUrHrrr4)r)rHrwrxrs
zParseExpression.__str__cs0tt|jx|jD]}|jqWt|jdkr|jd}t||jr|jr|jdkr|j	r|jdd|jdg|_d|_
|j|jO_|j|jO_|jd}t||jo|jo|jdko|j	r|jdd|jdd|_d|_
|j|jO_|j|jO_dt
||_|S)Nrqrrrz	Expected rsrs)rr rr4rrzrHrSrVr^rUr[r`rra)rrr)rHrwrxrs0




zParseExpression.streamlinecstt|j||}|S)N)rr rm)rrrlr)rHrwrxrmszParseExpression.setResultsNamecCs:|dd|g}x|jD]}|j|qW|jgdS)N)r4rr)rrtmprrwrwrxrszParseExpression.validatecs$tt|j}dd|jD|_|S)NcSsg|]}|jqSrw)r)rrrwrwrxrsz(ParseExpression.copy..)rr rr4)rr)rHrwrxrszParseExpression.copy)F)F)rrrrrrrrrrrrmrrrrwrw)rHrxr s	
"csTeZdZdZGdddeZdfdd	ZdddZd	d
ZddZ	d
dZ
ZS)ra

    Requires all given C{ParseExpression}s to be found in the given order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'+'} operator.
    May also be constructed using the C{'-'} operator, which will suppress backtracking.

    Example::
        integer = Word(nums)
        name_expr = OneOrMore(Word(alphas))

        expr = And([integer("id"),name_expr("name"),integer("age")])
        # more easily written as:
        expr = integer("id") + name_expr("name") + integer("age")
    cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|jdS)N-)rrrrrr)rrr)rHrwrxr
szAnd._ErrorStop.__init__)rrrrrrwrw)rHrxr
srTcsRtt|j||tdd|jD|_|j|jdj|jdj|_d|_	dS)Ncss|]}|jVqdS)N)r[)rrrwrwrxr
szAnd.__init__..rT)
rrrr6r4r[rrYrXre)rr4rg)rHrwrxr
s
zAnd.__init__c	Cs|jdj|||dd\}}d}x|jddD]}t|tjrFd}q0|ry|j|||\}}Wqtk
rvYqtk
r}zd|_tj|WYdd}~Xqt	k
rt|t
||j|YqXn|j|||\}}|s|jr0||7}q0W||fS)NrF)rprrT)
r4rtrzrrr#r
__traceback__rrrrar)	rr-rro
resultlistZ	errorStoprZ
exprtokensrrwrwrxr
s(z
And.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrxr5
s

zAnd.__iadd__cCs8|dd|g}x |jD]}|j||jsPqWdS)N)r4rr[)rrsubRecCheckListrrwrwrxr:
s

zAnd.checkRecursioncCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nr{rcss|]}t|VqdS)N)r)rrrwrwrxrF
szAnd.__str__..})rrrUrr4)rrwrwrxrA
s


 zAnd.__str__)T)T)rrrrr
rrrrrrrrwrw)rHrxrs
csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the expression that matches the longest string will be used.
    May be constructed using the C{'^'} operator.

    Example::
        # construct Or using '^' operator
        
        number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789"))
    prints::
        [['123'], ['3.1416'], ['789']]
    Fcs:tt|j|||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdS)N)r[)rrrwrwrxr\
szOr.__init__..T)rrrr4rr[)rr4rg)rHrwrxrY
szOr.__init__TcCsTd}d}g}x|jD]}y|j||}Wnvtk
rd}	z d|	_|	j|krT|	}|	j}WYdd}	~	Xqtk
rt||krt|t||j|}t|}YqX|j||fqW|r*|j	dddx`|D]X\}
}y|j
|||Stk
r$}	z"d|	_|	j|kr|	}|	j}WYdd}	~	XqXqW|dk	rB|j|_|nt||d|dS)NrrcSs
|dS)Nrrw)xrwrwrxryu
szOr.parseImpl..)rz no defined alternatives to matchrs)r4rrr9rrrrarsortrtr)rr-rro	maxExcLocmaxExceptionrrZloc2r_rwrwrxr`
s<

zOr.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrx__ixor__
s

zOr.__ixor__cCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z ^ css|]}t|VqdS)N)r)rrrwrwrxr
szOr.__str__..r=)rrrUrr4)rrwrwrxr
s


 z
Or.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxr
szOr.checkRecursion)F)T)
rrrrrrrCrrrrwrw)rHrxrK
s

&	csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the first one listed is the one that will match.
    May be constructed using the C{'|'} operator.

    Example::
        # construct MatchFirst using '|' operator
        
        # watch the order of expressions to match
        number = Word(nums) | Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789")) #  Fail! -> [['123'], ['3'], ['1416'], ['789']]

        # put more selective expression first
        number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums)
        print(number.searchString("123 3.1416 789")) #  Better -> [['123'], ['3.1416'], ['789']]
    Fcs:tt|j|||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdS)N)r[)rrrwrwrxr
sz&MatchFirst.__init__..T)rrrr4rr[)rr4rg)rHrwrxr
szMatchFirst.__init__Tc	Csd}d}x|jD]}y|j|||}|Stk
r\}z|j|krL|}|j}WYdd}~Xqtk
rt||krt|t||j|}t|}YqXqW|dk	r|j|_|nt||d|dS)Nrrz no defined alternatives to matchrs)r4rtrrrrrar)	rr-rror@rArrrrwrwrxr
s$
zMatchFirst.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrx__ior__
s

zMatchFirst.__ior__cCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z | css|]}t|VqdS)N)r)rrrwrwrxr
sz%MatchFirst.__str__..r=)rrrUrr4)rrwrwrxr
s


 zMatchFirst.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxr
szMatchFirst.checkRecursion)F)T)
rrrrrrrDrrrrwrw)rHrxr
s
	cs<eZdZdZdfdd	ZdddZddZd	d
ZZS)
ram
    Requires all given C{ParseExpression}s to be found, but in any order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'&'} operator.

    Example::
        color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN")
        shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON")
        integer = Word(nums)
        shape_attr = "shape:" + shape_type("shape")
        posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn")
        color_attr = "color:" + color("color")
        size_attr = "size:" + integer("size")

        # use Each (using operator '&') to accept attributes in any order 
        # (shape and posn are required, color and size are optional)
        shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr)

        shape_spec.runTests('''
            shape: SQUARE color: BLACK posn: 100, 120
            shape: CIRCLE size: 50 color: BLUE posn: 50,80
            color:GREEN size:20 shape:TRIANGLE posn:20,40
            '''
            )
    prints::
        shape: SQUARE color: BLACK posn: 100, 120
        ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']]
        - color: BLACK
        - posn: ['100', ',', '120']
          - x: 100
          - y: 120
        - shape: SQUARE


        shape: CIRCLE size: 50 color: BLUE posn: 50,80
        ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']]
        - color: BLUE
        - posn: ['50', ',', '80']
          - x: 50
          - y: 80
        - shape: CIRCLE
        - size: 50


        color: GREEN size: 20 shape: TRIANGLE posn: 20,40
        ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']]
        - color: GREEN
        - posn: ['20', ',', '40']
          - x: 20
          - y: 40
        - shape: TRIANGLE
        - size: 20
    Tcs8tt|j||tdd|jD|_d|_d|_dS)Ncss|]}|jVqdS)N)r[)rrrwrwrxrsz Each.__init__..T)rrrr6r4r[rXinitExprGroups)rr4rg)rHrwrxrsz
Each.__init__c
s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d	|_|}|jdd}|jddg}d
}	x|	rp||j|j}
g}x~|
D]v}y|j||}Wn t	k
r|j
|YqX|j
|jjt||||krD|j
|q|krj
|qWt|t|
krd	}	qW|rdjdd|D}
t	||d
|
|fdd|jD7}g}x*|D]"}|j|||\}}|j
|qWt|tg}||fS)Ncss&|]}t|trt|j|fVqdS)N)rzrrr.)rrrwrwrxrsz!Each.parseImpl..cSsg|]}t|tr|jqSrw)rzrr.)rrrwrwrxrsz"Each.parseImpl..cSs"g|]}|jrt|tr|qSrw)r[rzr)rrrwrwrxrscSsg|]}t|tr|jqSrw)rzr2r.)rrrwrwrxr scSsg|]}t|tr|jqSrw)rzrr.)rrrwrwrxr!scSs g|]}t|tttfs|qSrw)rzrr2r)rrrwrwrxr"sFTz, css|]}t|VqdS)N)r)rrrwrwrxr=sz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSrw)rzrr.)rr)tmpOptrwrxrAs)rErr4Zopt1mapZ	optionalsZmultioptionalsZ
multirequiredZrequiredrrrrrremoverrrtsumr")rr-rroZopt1Zopt2ZtmpLocZtmpReqdZ
matchOrderZkeepMatchingZtmpExprsZfailedrZmissingr:rZfinalResultsrw)rFrxrsP



zEach.parseImplcCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z & css|]}t|VqdS)N)r)rrrwrwrxrPszEach.__str__..r=)rrrUrr4)rrwrwrxrKs


 zEach.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxrTszEach.checkRecursion)T)T)	rrrrrrrrrrwrw)rHrxr
s
5
1	csleZdZdZdfdd	ZdddZdd	Zfd
dZfdd
ZddZ	gfddZ
fddZZS)rza
    Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens.
    Fcstt|j|t|tr@ttjtr2tj|}ntjt	|}||_
d|_|dk	r|j|_|j
|_
|j|j|j|_|j|_|j|_|jj|jdS)N)rrrrzr
issubclassr$rQr,rr.rUr`r[rrYrXrWrer]r)rr.rg)rHrwrxr^s
zParseElementEnhance.__init__TcCs2|jdk	r|jj|||ddStd||j|dS)NF)rpr)r.rtrra)rr-rrorwrwrxrps
zParseElementEnhance.parseImplcCs*d|_|jj|_|jdk	r&|jj|S)NF)rXr.rr)rrwrwrxrvs


z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|j||jdk	rn|jj|jdn,tt|j||jdk	rn|jj|jd|S)Nrrrsrs)rzr+r]rrrr.)rr)rHrwrxr}s



zParseElementEnhance.ignorecs&tt|j|jdk	r"|jj|S)N)rrrr.)r)rHrwrxrs

zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk	r>|jj|dS)N)r&r.r)rrr;rwrwrxrs

z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdk	r(|jj||jgdS)N)r.rr)rrr7rwrwrxrs
zParseElementEnhance.validatecsVytt|jStk
r"YnX|jdkrP|jdk	rPd|jjt|jf|_|jS)Nz%s:(%s))	rrrrKrUr.rHrr)r)rHrwrxrszParseElementEnhance.__str__)F)T)
rrrrrrrrrrrrrrwrw)rHrxrZs
cs*eZdZdZfddZdddZZS)ra
    Lookahead matching of the given parse expression.  C{FollowedBy}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression matches at the current
    position.  C{FollowedBy} always returns a null token list.

    Example::
        # use FollowedBy to match a label only if it is followed by a ':'
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint()
    prints::
        [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']]
    cstt|j|d|_dS)NT)rrrr[)rr.)rHrwrxrszFollowedBy.__init__TcCs|jj|||gfS)N)r.r)rr-rrorwrwrxrszFollowedBy.parseImpl)T)rrrrrrrrwrw)rHrxrscs2eZdZdZfddZd	ddZddZZS)
ra
    Lookahead to disallow matching with the given parse expression.  C{NotAny}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression does I{not} match at the current
    position.  Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny}
    always returns a null token list.  May be constructed using the '~' operator.

    Example::
        
    cs0tt|j|d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrrXr[rr.ra)rr.)rHrwrxrszNotAny.__init__TcCs&|jj||rt|||j||gfS)N)r.rrra)rr-rrorwrwrxrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{r=)rrrUrr.)rrwrwrxrs


zNotAny.__str__)T)rrrrrrrrrwrw)rHrxrs

cs(eZdZdfdd	ZdddZZS)	_MultipleMatchNcsFtt|j|d|_|}t|tr.tj|}|dk	r<|nd|_dS)NT)	rrJrrWrzrr$rQ	not_ender)rr.stopOnZender)rHrwrxrs

z_MultipleMatch.__init__TcCs|jj}|j}|jdk	}|r$|jj}|r2|||||||dd\}}yZ|j}	xJ|rb||||	rr|||}
n|}
|||
|\}}|s|jrT||7}qTWWnttfk
rYnX||fS)NF)rp)	r.rtrrKrr]rrr)rr-rroZself_expr_parseZself_skip_ignorablesZcheck_enderZ
try_not_enderrZhasIgnoreExprsrZ	tmptokensrwrwrxrs,



z_MultipleMatch.parseImpl)N)T)rrrrrrrwrw)rHrxrJsrJc@seZdZdZddZdS)ra
    Repetition of one or more of the given expression.
    
    Parameters:
     - expr - expression that must match one or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: BLACK"
        OneOrMore(attr_expr).parseString(text).pprint()  # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']]

        # use stopOn attribute for OneOrMore to avoid reading label string as part of the data
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']]
        
        # could also be written as
        (attr_expr * (1,)).parseString(text).pprint()
    cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr<z}...)rrrUrr.)rrwrwrxr!s


zOneOrMore.__str__N)rrrrrrwrwrwrxrscs8eZdZdZd
fdd	Zdfdd	Zdd	ZZS)r2aw
    Optional repetition of zero or more of the given expression.
    
    Parameters:
     - expr - expression that must match zero or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example: similar to L{OneOrMore}
    Ncstt|j||dd|_dS)N)rLT)rr2rr[)rr.rL)rHrwrxr6szZeroOrMore.__init__Tcs6ytt|j|||Sttfk
r0|gfSXdS)N)rr2rrr)rr-rro)rHrwrxr:szZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz]...)rrrUrr.)rrwrwrxr@s


zZeroOrMore.__str__)N)T)rrrrrrrrrwrw)rHrxr2*sc@s eZdZddZeZddZdS)
_NullTokencCsdS)NFrw)rrwrwrxrJsz_NullToken.__bool__cCsdS)Nrrw)rrwrwrxrMsz_NullToken.__str__N)rrrrr'rrwrwrwrxrMIsrMcs6eZdZdZeffdd	Zd	ddZddZZS)
raa
    Optional matching of the given expression.

    Parameters:
     - expr - expression that must match zero or more times
     - default (optional) - value to be returned if the optional expression is not found.

    Example::
        # US postal code can be a 5-digit zip, plus optional 4-digit qualifier
        zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4)))
        zip.runTests('''
            # traditional ZIP code
            12345
            
            # ZIP+4 form
            12101-0001
            
            # invalid ZIP
            98765-
            ''')
    prints::
        # traditional ZIP code
        12345
        ['12345']

        # ZIP+4 form
        12101-0001
        ['12101-0001']

        # invalid ZIP
        98765-
             ^
        FAIL: Expected end of text (at char 5), (line:1, col:6)
    cs.tt|j|dd|jj|_||_d|_dS)NF)rgT)rrrr.rWrr[)rr.r)rHrwrxrts
zOptional.__init__TcCszy|jj|||dd\}}WnTttfk
rp|jtk	rh|jjr^t|jg}|j||jj<ql|jg}ng}YnX||fS)NF)rp)r.rtrrr_optionalNotMatchedrVr")rr-rrorrwrwrxrzs


zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrr	)rrrUrr.)rrwrwrxrs


zOptional.__str__)T)	rrrrrNrrrrrwrw)rHrxrQs"
cs,eZdZdZd	fdd	Zd
ddZZS)r(a	
    Token for skipping over all undefined text until the matched expression is found.

    Parameters:
     - expr - target expression marking the end of the data to be skipped
     - include - (default=C{False}) if True, the target expression is also parsed 
          (the skipped text and target expression are returned as a 2-element list).
     - ignore - (default=C{None}) used to define grammars (typically quoted strings and 
          comments) that might contain false matches to the target expression
     - failOn - (default=C{None}) define expressions that are not allowed to be 
          included in the skipped test; if found before the target expression is found, 
          the SkipTo is not a match

    Example::
        report = '''
            Outstanding Issues Report - 1 Jan 2000

               # | Severity | Description                               |  Days Open
            -----+----------+-------------------------------------------+-----------
             101 | Critical | Intermittent system crash                 |          6
              94 | Cosmetic | Spelling error on Login ('log|n')         |         14
              79 | Minor    | System slow when running too many reports |         47
            '''
        integer = Word(nums)
        SEP = Suppress('|')
        # use SkipTo to simply match everything up until the next SEP
        # - ignore quoted strings, so that a '|' character inside a quoted string does not match
        # - parse action will call token.strip() for each matched token, i.e., the description body
        string_data = SkipTo(SEP, ignore=quotedString)
        string_data.setParseAction(tokenMap(str.strip))
        ticket_expr = (integer("issue_num") + SEP 
                      + string_data("sev") + SEP 
                      + string_data("desc") + SEP 
                      + integer("days_open"))
        
        for tkt in ticket_expr.searchString(report):
            print tkt.dump()
    prints::
        ['101', 'Critical', 'Intermittent system crash', '6']
        - days_open: 6
        - desc: Intermittent system crash
        - issue_num: 101
        - sev: Critical
        ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14']
        - days_open: 14
        - desc: Spelling error on Login ('log|n')
        - issue_num: 94
        - sev: Cosmetic
        ['79', 'Minor', 'System slow when running too many reports', '47']
        - days_open: 47
        - desc: System slow when running too many reports
        - issue_num: 79
        - sev: Minor
    FNcs`tt|j|||_d|_d|_||_d|_t|t	rFt
j||_n||_dt
|j|_dS)NTFzNo match found for )rr(r
ignoreExprr[r`includeMatchrrzrr$rQfailOnrr.ra)rrincluderrQ)rHrwrxrs
zSkipTo.__init__TcCs,|}t|}|j}|jj}|jdk	r,|jjnd}|jdk	rB|jjnd}	|}
x|
|kr|dk	rh|||
rhP|	dk	rx*y|	||
}
Wqrtk
rPYqrXqrWy|||
dddWn tt	fk
r|
d7}
YqLXPqLWt|||j
||
}|||}t|}|jr$||||dd\}}
||
7}||fS)NF)rorprr)rp)
rr.rtrQrrOrrrrrar"rP)rr-rror0rr.Z
expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ
skipresultrrwrwrxrs<

zSkipTo.parseImpl)FNN)T)rrrrrrrrwrw)rHrxr(s6
csbeZdZdZdfdd	ZddZddZd	d
ZddZgfd
dZ	ddZ
fddZZS)raK
    Forward declaration of an expression to be defined later -
    used for recursive grammars, such as algebraic infix notation.
    When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator.

    Note: take care when assigning to C{Forward} not to overlook precedence of operators.
    Specifically, '|' has a lower precedence than '<<', so that::
        fwdExpr << a | b | c
    will actually be evaluated as::
        (fwdExpr << a) | b | c
    thereby leaving b and c out as parseable alternatives.  It is recommended that you
    explicitly group the values inserted into the C{Forward}::
        fwdExpr << (a | b | c)
    Converting to use the '<<=' operator instead will avoid this problem.

    See L{ParseResults.pprint} for an example of a recursive parser created using
    C{Forward}.
    Ncstt|j|dddS)NF)rg)rrr)rr)rHrwrxrszForward.__init__cCsjt|trtj|}||_d|_|jj|_|jj|_|j|jj	|jj
|_
|jj|_|jj
|jj|S)N)rzrr$rQr.rUr`r[rrYrXrWr]r)rrrwrwrx
__lshift__s





zForward.__lshift__cCs||>S)Nrw)rrrwrwrx__ilshift__'szForward.__ilshift__cCs
d|_|S)NF)rX)rrwrwrxr*szForward.leaveWhitespacecCs$|js d|_|jdk	r |jj|S)NT)r_r.r)rrwrwrxr.s


zForward.streamlinecCs>||kr0|dd|g}|jdk	r0|jj||jgdS)N)r.rr)rrr7rwrwrxr5s

zForward.validatecCs>t|dr|jS|jjdSd}Wd|j|_X|jjd|S)Nrz: ...Nonez: )rrrHrZ_revertClass_ForwardNoRecurser.r)rZ	retStringrwrwrxr<s

zForward.__str__cs.|jdk	rtt|jSt}||K}|SdS)N)r.rrr)rr)rHrwrxrMs

zForward.copy)N)
rrrrrrSrTrrrrrrrwrw)rHrxrs
c@seZdZddZdS)rVcCsdS)Nz...rw)rrwrwrxrVsz_ForwardNoRecurse.__str__N)rrrrrwrwrwrxrVUsrVcs"eZdZdZdfdd	ZZS)r-zQ
    Abstract subclass of C{ParseExpression}, for converting parsed results.
    Fcstt|j|d|_dS)NF)rr-rrW)rr.rg)rHrwrxr]szTokenConverter.__init__)F)rrrrrrrwrw)rHrxr-Yscs6eZdZdZd
fdd	ZfddZdd	ZZS)r
a
    Converter to concatenate all matching tokens to a single string.
    By default, the matching patterns must also be contiguous in the input string;
    this can be disabled by specifying C{'adjacent=False'} in the constructor.

    Example::
        real = Word(nums) + '.' + Word(nums)
        print(real.parseString('3.1416')) # -> ['3', '.', '1416']
        # will also erroneously match the following
        print(real.parseString('3. 1416')) # -> ['3', '.', '1416']

        real = Combine(Word(nums) + '.' + Word(nums))
        print(real.parseString('3.1416')) # -> ['3.1416']
        # no match when there are internal spaces
        print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...)
    rTcs8tt|j||r|j||_d|_||_d|_dS)NT)rr
rradjacentrX
joinStringre)rr.rXrW)rHrwrxrrszCombine.__init__cs(|jrtj||ntt|j||S)N)rWr$rrr
)rr)rHrwrxr|szCombine.ignorecCsP|j}|dd=|tdj|j|jg|jd7}|jrH|jrH|gS|SdS)Nr)r)rr"rr
rXrbrVr)rr-rrZretToksrwrwrxrs
"zCombine.postParse)rT)rrrrrrrrrwrw)rHrxr
as
cs(eZdZdZfddZddZZS)ra
    Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions.

    Example::
        ident = Word(alphas)
        num = Word(nums)
        term = ident | num
        func = ident + Optional(delimitedList(term))
        print(func.parseString("fn a,b,100"))  # -> ['fn', 'a', 'b', '100']

        func = ident + Group(Optional(delimitedList(term)))
        print(func.parseString("fn a,b,100"))  # -> ['fn', ['a', 'b', '100']]
    cstt|j|d|_dS)NT)rrrrW)rr.)rHrwrxrszGroup.__init__cCs|gS)Nrw)rr-rrrwrwrxrszGroup.postParse)rrrrrrrrwrw)rHrxrs
cs(eZdZdZfddZddZZS)raW
    Converter to return a repetitive expression as a list, but also as a dictionary.
    Each element can also be referenced using the first token in the expression as its key.
    Useful for tabular report scraping when the first column can be used as a item key.

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        # print attributes as plain groups
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names
        result = Dict(OneOrMore(Group(attr_expr))).parseString(text)
        print(result.dump())
        
        # access named fields as dict entries, or output as dict
        print(result['shape'])        
        print(result.asDict())
    prints::
        ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap']

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'}
    See more examples at L{ParseResults} of accessing fields by results name.
    cstt|j|d|_dS)NT)rrrrW)rr.)rHrwrxrsz
Dict.__init__cCsxt|D]\}}t|dkr q
|d}t|trBt|dj}t|dkr^td|||<q
t|dkrt|dtrt|d|||<q
|j}|d=t|dkst|tr|j	rt||||<q
t|d|||<q
W|j
r|gS|SdS)Nrrrrrq)rrrzrurrrr"rrrV)rr-rrrtokZikeyZ	dictvaluerwrwrxrs$
zDict.postParse)rrrrrrrrwrw)rHrxrs#c@s eZdZdZddZddZdS)r+aV
    Converter for ignoring the results of a parsed expression.

    Example::
        source = "a, b, c,d"
        wd = Word(alphas)
        wd_list1 = wd + ZeroOrMore(',' + wd)
        print(wd_list1.parseString(source))

        # often, delimiters that are useful during parsing are just in the
        # way afterward - use Suppress to keep them out of the parsed output
        wd_list2 = wd + ZeroOrMore(Suppress(',') + wd)
        print(wd_list2.parseString(source))
    prints::
        ['a', ',', 'b', ',', 'c', ',', 'd']
        ['a', 'b', 'c', 'd']
    (See also L{delimitedList}.)
    cCsgS)Nrw)rr-rrrwrwrxrszSuppress.postParsecCs|S)Nrw)rrwrwrxrszSuppress.suppressN)rrrrrrrwrwrwrxr+sc@s(eZdZdZddZddZddZdS)	rzI
    Wrapper for parse actions, to ensure they are only called once.
    cCst||_d|_dS)NF)rMcallablecalled)rZ
methodCallrwrwrxrs
zOnlyOnce.__init__cCs.|js|j|||}d|_|St||ddS)NTr)r[rZr)rrr5rvrrwrwrxrs
zOnlyOnce.__call__cCs
d|_dS)NF)r[)rrwrwrxreset
szOnlyOnce.resetN)rrrrrrr\rwrwrwrxrscs:tfdd}yj|_Wntk
r4YnX|S)as
    Decorator for debugging parse actions. 
    
    When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
    When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised.

    Example::
        wd = Word(alphas)

        @traceParseAction
        def remove_duplicate_chars(tokens):
            return ''.join(sorted(set(''.join(tokens)))

        wds = OneOrMore(wd).setParseAction(remove_duplicate_chars)
        print(wds.parseString("slkdjs sld sldd sdlf sdljf"))
    prints::
        >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {}))
        <>entering %s(line: '%s', %d, %r)
z<.z)rMrr)rr`rw)rrxrb
s
,FcCs`t|dt|dt|d}|rBt|t||j|S|tt||j|SdS)a
    Helper to define a delimited list of expressions - the delimiter defaults to ','.
    By default, the list elements and delimiters can have intervening whitespace, and
    comments, but this can be overridden by passing C{combine=True} in the constructor.
    If C{combine} is set to C{True}, the matching tokens are returned as a single token
    string, with the delimiters included; otherwise, the matching tokens are returned
    as a list of tokens, with the delimiters suppressed.

    Example::
        delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc']
        delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    z [rz]...N)rr
r2rir+)r.ZdelimcombineZdlNamerwrwrxr@9s
$csjtfdd}|dkr0ttjdd}n|j}|jd|j|dd|jd	td
S)a:
    Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
        integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    
    If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value.

    Example::
        countedArray(Word(alphas)).parseString('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2))
        countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef')  # -> ['ab', 'cd']
    cs.|d}|r ttg|p&tt>gS)Nr)rrrC)rr5rvr)	arrayExprr.rwrxcountFieldParseAction_s"z+countedArray..countFieldParseActionNcSst|dS)Nr)ru)rvrwrwrxrydszcountedArray..ZarrayLenT)rfz(len) z...)rr/rRrrrirxr)r.ZintExprrdrw)rcr.rxr<Ls
cCs:g}x0|D](}t|tr(|jt|q
|j|q
W|S)N)rzrrrr)Lrrrwrwrxrks

rcs6tfdd}|j|ddjdt|S)a*
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousLiteral(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches a
    previous literal, will also match the leading C{"1:1"} in C{"1:10"}.
    If this is not desired, use C{matchPreviousExpr}.
    Do I{not} use with packrat parsing enabled.
    csP|rBt|dkr|d>qLt|j}tdd|D>n
t>dS)Nrrrcss|]}t|VqdS)N)r)rttrwrwrxrszDmatchPreviousLiteral..copyTokenToRepeater..)rrrrr
)rr5rvZtflat)reprwrxcopyTokenToRepeatersz1matchPreviousLiteral..copyTokenToRepeaterT)rfz(prev) )rrxrir)r.rhrw)rgrxrOts


csFt|j}|Kfdd}|j|ddjdt|S)aS
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousExpr(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches by
    expressions, will I{not} match the leading C{"1:1"} in C{"1:10"};
    the expressions are evaluated first, and then compared, so
    C{"1"} is compared with C{"10"}.
    Do I{not} use with packrat parsing enabled.
    cs*t|jfdd}j|dddS)Ncs$t|j}|kr tddddS)Nrr)rrr)rr5rvZtheseTokens)matchTokensrwrxmustMatchTheseTokensszLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensT)rf)rrr)rr5rvrj)rg)rirxrhsz.matchPreviousExpr..copyTokenToRepeaterT)rfz(prev) )rrrxrir)r.Ze2rhrw)rgrxrNscCs>xdD]}|j|t|}qW|jdd}|jdd}t|S)Nz\^-]rz\nr(z\t)r_bslashr)rrrwrwrxrs

rTc
s|rdd}dd}tndd}dd}tg}t|trF|j}n&t|tjr\t|}ntj	dt
dd|svtSd	}x|t|d
kr||}xnt
||d
dD]N\}}	||	|r|||d
=Pq|||	r|||d
=|j||	|	}PqW|d
7}q|W|r|ryht|tdj|krZtd
djdd|Djdj|Stdjdd|Djdj|SWn&tk
rtj	dt
ddYnXtfdd|Djdj|S)a
    Helper to quickly define a set of alternative Literals, and makes sure to do
    longest-first testing when there is a conflict, regardless of the input order,
    but returns a C{L{MatchFirst}} for best performance.

    Parameters:
     - strs - a string of space-delimited literals, or a collection of string literals
     - caseless - (default=C{False}) - treat all literals as caseless
     - useRegex - (default=C{True}) - as an optimization, will generate a Regex
          object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or
          if creating a C{Regex} raises an exception)

    Example::
        comp_oper = oneOf("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.searchString("B = 12  AA=23 B<=AA AA>12"))
    prints::
        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    cSs|j|jkS)N)r)rbrwrwrxryszoneOf..cSs|jj|jS)N)rr)rrlrwrwrxryscSs||kS)Nrw)rrlrwrwrxryscSs
|j|S)N)r)rrlrwrwrxrysz6Invalid argument to oneOf, expected string or iterablerq)rrrrNrz[%s]css|]}t|VqdS)N)r)rsymrwrwrxrszoneOf..z | |css|]}tj|VqdS)N)rdr	)rrmrwrwrxrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdS)Nrw)rrm)parseElementClassrwrxrs)rrrzrrrr5rrrrrrrrrr'rirKr)
ZstrsrZuseRegexZisequalZmasksZsymbolsrZcurrrrw)rorxrSsL





((cCsttt||S)a
    Helper to easily and clearly define a dictionary by specifying the respective patterns
    for the key and value.  Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
    in the proper order.  The key pattern can include delimiting markers or punctuation,
    as long as they are suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the C{Dict} results can include named token
    fields.

    Example::
        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)

        # similar to Dict, but simpler call format
        result = dictOf(attr_label, attr_value).parseString(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.asDict())
    prints::
        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    )rr2r)rrrwrwrxrAs!cCs^tjdd}|j}d|_|d||d}|r@dd}ndd}|j||j|_|S)	a
    Helper to return the original, untokenized text for a given expression.  Useful to
    restore the parsed fields of an HTML start tag into the raw tag text itself, or to
    revert separate tokens with intervening whitespace back to the original matching
    input text. By default, returns astring containing the original parsed text.  
       
    If the optional C{asString} argument is passed as C{False}, then the return value is a 
    C{L{ParseResults}} containing any results names that were originally matched, and a 
    single token containing the original matched text from the input string.  So if 
    the expression passed to C{L{originalTextFor}} contains expressions with defined
    results names, you must set C{asString} to C{False} if you want to preserve those
    results name values.

    Example::
        src = "this is test  bold text  normal text "
        for tag in ("b","i"):
            opener,closer = makeHTMLTags(tag)
            patt = originalTextFor(opener + SkipTo(closer) + closer)
            print(patt.searchString(src)[0])
    prints::
        [' bold text ']
        ['text']
    cSs|S)Nrw)rrrvrwrwrxry8sz!originalTextFor..F_original_start
_original_endcSs||j|jS)N)rprq)rr5rvrwrwrxry=scSs&||jd|jdg|dd<dS)Nrprq)r)rr5rvrwrwrxextractText?sz$originalTextFor..extractText)r
rrrer])r.ZasStringZ	locMarkerZendlocMarker	matchExprrrrwrwrxrg s

cCst|jddS)zp
    Helper to undo pyparsing's default grouping of And expressions, even
    if all but one are non-empty.
    cSs|dS)Nrrw)rvrwrwrxryJszungroup..)r-r)r.rwrwrxrhEscCs4tjdd}t|d|d|jjdS)a
    Helper to decorate a returned token with its starting and ending locations in the input string.
    This helper adds the following results names:
     - locn_start = location where matched expression begins
     - locn_end = location where matched expression ends
     - value = the actual parsed results

    Be careful if the input text contains C{} characters, you may want to call
    C{L{ParserElement.parseWithTabs}}

    Example::
        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)
    prints::
        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSs|S)Nrw)rr5rvrwrwrxry`szlocatedExpr..Z
locn_startrZlocn_end)r
rrrr)r.ZlocatorrwrwrxrjLsz\[]-*.$+^?()~ )r
cCs|ddS)Nrrrrw)rr5rvrwrwrxryksryz\\0?[xX][0-9a-fA-F]+cCstt|djddS)Nrz\0x)unichrrulstrip)rr5rvrwrwrxrylsz	\\0[0-7]+cCstt|ddddS)Nrrr)ruru)rr5rvrwrwrxrymsz\])rr
z\wr8rrZnegatebodyr	csBddy djfddtj|jDStk
r<dSXdS)a
    Helper to easily define string ranges for use in Word construction.  Borrows
    syntax from regexp '[]' string range definitions::
        srange("[0-9]")   -> "0123456789"
        srange("[a-z]")   -> "abcdefghijklmnopqrstuvwxyz"
        srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
    The input string must be enclosed in []'s, and the returned string is the expanded
    character set joined into a single string.
    The values enclosed in the []'s may be:
     - a single character
     - an escaped character with a leading backslash (such as C{\-} or C{\]})
     - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) 
         (C{\0x##} is also supported for backwards compatibility) 
     - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
     - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
     - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
    cSs<t|ts|Sdjddtt|dt|ddDS)Nrcss|]}t|VqdS)N)ru)rrrwrwrxrsz+srange....rrr)rzr"rrord)prwrwrxryszsrange..rc3s|]}|VqdS)Nrw)rpart)	_expandedrwrxrszsrange..N)r_reBracketExprrrxrK)rrw)r|rxr_rs
 csfdd}|S)zt
    Helper method for defining parse actions that require matching at a specific
    column in the input text.
    cs"t||krt||ddS)Nzmatched token not at column %d)r9r)r)Zlocnr1)rrwrx	verifyColsz!matchOnlyAtCol..verifyColrw)rr~rw)rrxrMscsfddS)a
    Helper method for common parse actions that simply return a literal value.  Especially
    useful when used with C{L{transformString}()}.

    Example::
        num = Word(nums).setParseAction(lambda toks: int(toks[0]))
        na = oneOf("N/A NA").setParseAction(replaceWith(math.nan))
        term = na | num
        
        OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234]
    csgS)Nrw)rr5rv)replStrrwrxryszreplaceWith..rw)rrw)rrxr\scCs|dddS)a
    Helper parse action for removing quotation marks from parsed quoted strings.

    Example::
        # by default, quotation marks are included in parsed results
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]

        # use removeQuotes to strip quotation marks from parsed results
        quotedString.setParseAction(removeQuotes)
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
    rrrrsrw)rr5rvrwrwrxrZscsNfdd}ytdtdj}Wntk
rBt}YnX||_|S)aG
    Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional 
    args are passed, they are forwarded to the given function as additional arguments after
    the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
    parsed data to an integer using base 16.

    Example (compare the last to example in L{ParserElement.transformString}::
        hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16))
        hex_ints.runTests('''
            00 11 22 aa FF 0a 0d 1a
            ''')
        
        upperword = Word(alphas).setParseAction(tokenMap(str.upper))
        OneOrMore(upperword).runTests('''
            my kingdom for a horse
            ''')

        wd = Word(alphas).setParseAction(tokenMap(str.title))
        OneOrMore(wd).setParseAction(' '.join).runTests('''
            now is the winter of our discontent made glorious summer by this sun of york
            ''')
    prints::
        00 11 22 aa FF 0a 0d 1a
        [0, 17, 34, 170, 255, 10, 13, 26]

        my kingdom for a horse
        ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE']

        now is the winter of our discontent made glorious summer by this sun of york
        ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York']
    csfdd|DS)Ncsg|]}|fqSrwrw)rZtokn)rr6rwrxrsz(tokenMap..pa..rw)rr5rv)rr6rwrxr}sztokenMap..parrH)rJrrKr{)r6rr}rLrw)rr6rxrms cCst|jS)N)rr)rvrwrwrxryscCst|jS)N)rlower)rvrwrwrxryscCst|tr|}t||d}n|j}tttd}|rtjj	t
}td|dtt
t|td|tddgdjd	j	d
dtd}nd
jddtD}tjj	t
t|B}td|dtt
t|j	tttd|tddgdjd	j	ddtd}ttd|d}|jdd
j|jddjjjd|}|jdd
j|jddjjjd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag name)rz_-:rtag=/F)rrCcSs|ddkS)Nrrrw)rr5rvrwrwrxrysz_makeTags..rrcss|]}|dkr|VqdS)rNrw)rrrwrwrxrsz_makeTags..cSs|ddkS)Nrrrw)rr5rvrwrwrxryszrz)rzrrrr/r4r3r>rrrZr+rr2rrrmrrVrYrBr
_Lrtitlerrir)tagStrZxmlZresnameZtagAttrNameZtagAttrValueZopenTagZprintablesLessRAbrackZcloseTagrwrwrx	_makeTagss"
T\..rcCs
t|dS)a 
    Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches
    tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.

    Example::
        text = 'More info at the pyparsing wiki page'
        # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple
        a,a_end = makeHTMLTags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end
        
        for link in link_expr.searchString(text):
            # attributes in the  tag (like "href" shown here) are also accessible as named results
            print(link.link_text, '->', link.href)
    prints::
        pyparsing -> http://pyparsing.wikispaces.com
    F)r)rrwrwrxrKscCs
t|dS)z
    Helper to construct opening and closing tag expressions for XML, given a tag name. Matches
    tags only in the given upper/lower case.

    Example: similar to L{makeHTMLTags}
    T)r)rrwrwrxrLscs8|r|ddn|jddDfdd}|S)a<
    Helper to create a validating parse action to be used with start tags created
    with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
    with a required attribute value, to avoid false matches on common tags such as
    C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSrwrw)rrrrwrwrxrQsz!withAttribute..cs^xXD]P\}}||kr&t||d||tjkr|||krt||d||||fqWdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')rre ANY_VALUE)rr5rZattrNameZ attrValue)attrsrwrxr}Rs zwithAttribute..pa)r)rZattrDictr}rw)rrxres 2 cCs|r d|nd}tf||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)re)Z classname namespaceZ classattrrwrwrxrk\s (rcCst}||||B}x`t|D]R\}}|d dd\}} } } | dkrTd|nd|} | dkr|dksxt|dkrtd|\} }tj| }| tjkrd| dkrt||t|t |}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkrZt|| |||t|| |||}ntd n| tj krH| dkrt |t st |}t|j |t||}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkr>t|| |||t|| |||}ntd ntd | r`|j| ||j| |BK}|}q"W||K}|S) a Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] Nrroz%s termz %s%s termrqz@if numterms=3, opExpr must be a tuple or list of two expressionsrrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)N)rrrrrirTLEFTrrrRIGHTrzrr.r)ZbaseExprZopListZlparZrparrZlastExprrZoperDefZopExprZarityZrightLeftAssocr}ZtermNameZopExpr1ZopExpr2ZthisExprrsrwrwrxrisR;    &       &   z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr(t|to,t|tr t|dkrt|dkr|dk rtt|t||tjddj dd}n$t j t||tjj dd}nx|dk rtt|t |t |ttjddj dd}n4ttt |t |ttjddj d d}ntd t }|dk rb|tt|t||B|Bt|K}n$|tt|t||Bt|K}|jd ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrr)r cSs |djS)Nr)r)rvrwrwrxry9sznestedExpr..cSs |djS)Nr)r)rvrwrwrxry<scSs |djS)Nr)r)rvrwrwrxryBscSs |djS)Nr)r)rvrwrwrxryFszOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rrzrrr rr r$rNrrCrrrrr+r2ri)openerZcloserZcontentrOrrwrwrxrPs4:     *$c sfdd}fdd}fdd}ttjdj}ttj|jd}tj|jd }tj|jd } |rtt||t|t|t|| } n$tt|t|t|t|} |j t t| jd S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrrzillegal nestingznot a peer entryrsrs)rr9r!r)rr5rvcurCol) indentStackrwrxcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"j|n t||ddS)Nrrznot a subentryrs)r9rr)rr5rvr)rrwrxcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}o4|dko4|dksBt||djdS)Nrrrqznot an unindentrsr:)rr9rr)rr5rvr)rrwrx checkUnindents    z$indentedBlock..checkUnindentz INDENTrZUNINDENTzindented block) rrrrr rrirrrrk) ZblockStatementExprrrrrrr!rZPEERZUNDENTZsmExprrw)rrxrfQsN   ,z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prnz);zcommon HTML entitycCs tj|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentity)rvrwrwrxr[sz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style comment)rz commaItem)rc@seZdZdZeeZeeZe e j dj eZ e ej dj eedZedj dj eZej edej ej dZejd d eeeed jeBj d Zejeed j dj eZedj dj eZeeBeBjZedj dj eZe ededj dZedj dZ edj dZ!e!de!dj dZ"ee!de!d>dee!de!d?j dZ#e#j$d d d!e j d"Z%e&e"e%Be#Bj d#j d#Z'ed$j d%Z(e)d@d'd(Z*e)dAd*d+Z+ed,j d-Z,ed.j d/Z-ed0j d1Z.e/je0jBZ1e)d2d3Z2e&e3e4d4e5e e6d4d5ee7d6jj d7Z8e9ee:j;e8Bd8d9j d:Zd=S)Brna Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (L{integers}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrtz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrrrsrw)rvrwrwrxryszpyparsing_common.r8z"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberrB identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 addressrrBz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tjj|rdVqdS)rrN)rn _ipv6_partr)rrfrwrwrxrsz,pyparsing_common...rw)rH)rvrwrwrxrysz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] csLytj|djStk rF}zt||t|WYdd}~XnXdS)Nr)rstrptimeZdaterrr{)rr5rvve)fmtrwrxcvt_fnsz.pyparsing_common.convertToDate..cvt_fnrw)rrrw)rrx convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] csHytj|dStk rB}zt||t|WYdd}~XnXdS)Nr)rrrrr{)rr5rvr)rrwrxrsz2pyparsing_common.convertToDatetime..cvt_fnrw)rrrw)rrxconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstjj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rn_html_stripperr)rr5rrwrwrx stripHTMLTagss zpyparsing_common.stripHTMLTagsra)rz rr)rzcomma separated listcCs t|jS)N)rr)rvrwrwrxryscCs t|jS)N)rr)rvrwrwrxrysN)rrB)rrB)r)r)?rrrrrmruZconvertToIntegerfloatZconvertToFloatr/rRrirrrDrr'Zsigned_integerrrxrrZ mixed_integerrHrealZsci_realrnumberrr4r3rZ ipv4_addressrZ_full_ipv6_addressZ_short_ipv6_addressr~Z_mixed_ipv6_addressr Z ipv6_addressZ mac_addressrrrZ iso8601_dateZiso8601_datetimeuuidr7r6rrrrrrVr. _commasepitemr@rYrZcomma_separated_listrdrBrwrwrwrxrnsN"" 2   8__main__Zselectfromz_$r])rbcolumnsrjZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rq)raF)N)FT)T)r)T)r __version__Z__versionTime__ __author__rweakrefrrrr~rrdrrr"r<rr_threadr ImportErrorZ threadingrrZ ordereddict__all__r version_infor;rmaxsizerr{rchrrurrHrrreversedrrrr6r r rIZmaxintZxrangerZ __builtin__rZfnamerrJrrrrrrZascii_uppercaseZascii_lowercaser4rRrDr3rkrZ printablerVrKrrr!r#r&rr"MutableMappingregisterr9rJrGr/r2r4rQrMr$r,r rrrrQrrrrlr/r'r%r r.r0rrrr*r)r1r0r rrrr rrrrJrr2rMrNrr(rrVr-r rr r+rrbr@r<rrOrNrrSrArgrhrjrirCrIrHrar`rZ _escapedPuncZ_escapedHexCharZ_escapedOctCharUNICODEZ _singleCharZ _charRangermr}r_rMr\rZrmrdrBrrKrLrerrkrTrrrirUr>r^rYrcrPrfr5rWr7r6rrrrr;r[r8rErr]r?r=rFrXrrr:rnrZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLrrrrrrrwrwrwrx=s                 8      @d &A= I G3pLOD|M &#@sQ,A,    I# %     &0 ,   ? #k Zr   (  0     "PK!Z_Z_,_vendor/__pycache__/six.cpython-36.opt-1.pycnu[3 vhuI@srdZddlmZddlZddlZddlZddlZddlZdZdZ ej ddkZ ej ddkZ ej dddzkZ e refZefZefZeZeZejZnefZeefZeejfZeZeZejjd red|ZnLGd d d eZ ye!e Wn e"k r ed~ZYn XedZ[ ddZ#ddZ$GdddeZ%Gddde%Z&Gdddej'Z(Gddde%Z)GdddeZ*e*e+Z,Gddde(Z-e)ddd d!e)d"d#d$d%d"e)d&d#d#d'd&e)d(d)d$d*d(e)d+d)d,e)d-d#d$d.d-e)d/d0d0d1d/e)d2d0d0d/d2e)d3d)d$d4d3e)d5d)e rd6nd7d8e)d9d)d:e)d;de)d!d!d e)d?d?d@e)dAdAd@e)dBdBd@e)d4d)d$d4d3e)dCd#d$dDdCe)dEd#d#dFdEe&d$d)e&dGdHe&dIdJe&dKdLdMe&dNdOdNe&dPdQdRe&dSdTdUe&dVdWdXe&dYdZd[e&d\d]d^e&d_d`dae&dbdcdde&dedfdge&dhdidje&dkdkdle&dmdmdle&dndndle&dododpe&dqdre&dsdte&dudve&dwdxdwe&dydze&d{d|d}e&d~dde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&ddde&de+dde&de+dde&de+de+de&ddde&ddde&dddg>Z.ejdkrZe.e&ddg7Z.x:e.D]2Z/e0e-e/j1e/e2e/e&r`e,j3e/de/j1q`W[/e.e-_.e-e+dZ4e,j3e4dGddde(Z5e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)d>dde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddgZ6xe6D]Z/e0e5e/j1e/qW[/e6e5_.e,j3e5e+dddӃGddՄde(Z7e)ddde)ddde)dddgZ8xe8D]Z/e0e7e/j1e/q$W[/e8e7_.e,j3e7e+ddd܃Gddބde(Z9e)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)ddde)dddg!Z:xe:D]Z/e0e9e/j1e/qW[/e:e9_.e,j3e9e+dddGddde(Z;e)ddde)ddde)d dde)d ddgZxe>D]Z/e0e=e/j1e/qW[/e>e=_.e,j3e=e+dddGdddej'Z?e,j3e?e+ddddZ@ddZAe rjdZBdZCdZDdZEdZFd ZGn$d!ZBd"ZCd#ZDd$ZEd%ZFd&ZGyeHZIWn"eJk rd'd(ZIYnXeIZHyeKZKWn"eJk rd)d*ZKYnXe rd+d,ZLejMZNd-d.ZOeZPn>d/d,ZLd0d1ZNd2d.ZOGd3d4d4eZPeKZKe#eLd5ejQeBZRejQeCZSejQeDZTejQeEZUejQeFZVejQeGZWe rd6d7ZXd8d9ZYd:d;ZZd<d=Z[ej\d>Z]ej\d?Z^ej\d@Z_nTdAd7ZXdBd9ZYdCd;ZZdDd=Z[ej\dEZ]ej\dFZ^ej\dGZ_e#eXdHe#eYdIe#eZdJe#e[dKe rdLdMZ`dNdOZaebZcddldZdedjedPjfZg[dejhdZiejjZkelZmddlnZnenjoZoenjpZpdQZqej d d k rdRZrdSZsn dTZrdUZsnjdVdMZ`dWdOZaecZcebZgdXdYZidZd[ZkejtejuevZmddloZoeojoZoZpd\ZqdRZrdSZse#e`d]e#ead^d_dQZwd`dTZxdadUZye reze4j{dbZ|ddcddZ}nddedfZ|e|dgej dddk re|dhn.ej dddk r8e|din djdkZ~eze4j{dldZedk rjdmdnZej dddk reZdodnZe#e}dpej dddk rejejfdqdrZnejZdsdtZdudvZdwdxZgZe+Zejdydk rge_ejrbx>eejD]0\ZZeej+dkr*ej1e+kr*eje=Pq*W[[ejje,dS(z6Utilities for writing code that runs on Python 2 and 3)absolute_importNz'Benjamin Peterson z1.10.0javac@seZdZddZdS)XcCsdS)Nrrl)selfr r /usr/lib/python3.6/six.py__len__>sz X.__len__N)__name__ __module__ __qualname__r r r r r r <sr ?cCs ||_dS)z Add documentation to a function.N)__doc__)funcdocr r r _add_docKsrcCst|tj|S)z7Import module, returning the module after the last dot.) __import__sysmodules)namer r r _import_modulePsrc@seZdZddZddZdS) _LazyDescrcCs ||_dS)N)r)r rr r r __init__Xsz_LazyDescr.__init__c CsB|j}t||j|yt|j|jWntk r<YnX|S)N)_resolvesetattrrdelattr __class__AttributeError)r objtpresultr r r __get__[sz_LazyDescr.__get__N)rrrrr%r r r r rVsrcs.eZdZdfdd ZddZddZZS) MovedModuleNcs2tt|j|tr(|dkr |}||_n||_dS)N)superr&rPY3mod)r roldnew)r r r ris zMovedModule.__init__cCs t|jS)N)rr))r r r r rrszMovedModule._resolvecCs"|j}t||}t||||S)N)rgetattrr)r attr_modulevaluer r r __getattr__us  zMovedModule.__getattr__)N)rrrrrr0 __classcell__r r )r r r&gs r&cs(eZdZfddZddZgZZS) _LazyModulecstt|j||jj|_dS)N)r'r2rr r)r r)r r r r~sz_LazyModule.__init__cCs ddg}|dd|jD7}|S)NrrcSsg|] }|jqSr )r).0r-r r r sz'_LazyModule.__dir__..)_moved_attributes)r Zattrsr r r __dir__sz_LazyModule.__dir__)rrrrr6r5r1r r )r r r2|s r2cs&eZdZdfdd ZddZZS)MovedAttributeNcsdtt|j|trH|dkr |}||_|dkr@|dkr<|}n|}||_n||_|dkrZ|}||_dS)N)r'r7rr(r)r-)r rZold_modZnew_modZold_attrZnew_attr)r r r rszMovedAttribute.__init__cCst|j}t||jS)N)rr)r,r-)r moduler r r rs zMovedAttribute._resolve)NN)rrrrrr1r r )r r r7sr7c@sVeZdZdZddZddZddZdd d Zd d Zd dZ ddZ ddZ e Z dS)_SixMetaPathImporterz A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 cCs||_i|_dS)N)r known_modules)r Zsix_module_namer r r rsz_SixMetaPathImporter.__init__cGs&x |D]}||j|jd|<qWdS)N.)r:r)r r)Z fullnamesfullnamer r r _add_modules z _SixMetaPathImporter._add_modulecCs|j|jd|S)Nr;)r:r)r r<r r r _get_modulesz _SixMetaPathImporter._get_moduleNcCs||jkr|SdS)N)r:)r r<pathr r r find_modules z _SixMetaPathImporter.find_modulec Cs0y |j|Stk r*td|YnXdS)Nz!This loader does not know module )r:KeyError ImportError)r r<r r r Z __get_modules z!_SixMetaPathImporter.__get_modulec CsRy tj|Stk rYnX|j|}t|tr>|j}n||_|tj|<|S)N)rrrA _SixMetaPathImporter__get_module isinstancer&r __loader__)r r<r)r r r load_modules     z _SixMetaPathImporter.load_modulecCst|j|dS)z Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) __path__)hasattrrC)r r<r r r is_packagesz_SixMetaPathImporter.is_packagecCs|j|dS)z;Return None Required, if is_package is implementedN)rC)r r<r r r get_codes z_SixMetaPathImporter.get_code)N) rrrrrr=r>r@rCrFrIrJ get_sourcer r r r r9s  r9c@seZdZdZgZdS) _MovedItemszLazy loading of moved objectsN)rrrrrGr r r r rLsrLZ cStringIOioStringIOfilter itertoolsbuiltinsZifilter filterfalseZ ifilterfalseinputZ __builtin__Z raw_inputinternrmapimapgetcwdosZgetcwdugetcwdbrangeZxrangeZ reload_module importlibZimpreloadreduce functoolsZ shlex_quoteZpipesZshlexZquoteUserDict collectionsUserList UserStringzipZizip zip_longestZ izip_longestZ configparserZ ConfigParsercopyregZcopy_regZdbm_gnuZgdbmzdbm.gnuZ _dummy_threadZ dummy_threadZhttp_cookiejarZ cookielibzhttp.cookiejarZ http_cookiesZCookiez http.cookiesZ html_entitiesZhtmlentitydefsz html.entitiesZ html_parserZ HTMLParserz html.parserZ http_clientZhttplibz http.clientZemail_mime_multipartzemail.MIMEMultipartzemail.mime.multipartZemail_mime_nonmultipartzemail.MIMENonMultipartzemail.mime.nonmultipartZemail_mime_textzemail.MIMETextzemail.mime.textZemail_mime_basezemail.MIMEBasezemail.mime.baseZBaseHTTPServerz http.serverZ CGIHTTPServerZSimpleHTTPServerZcPicklepickleZqueueZQueuereprlibreprZ socketserverZ SocketServer_threadZthreadZtkinterZTkinterZtkinter_dialogZDialogztkinter.dialogZtkinter_filedialogZ FileDialogztkinter.filedialogZtkinter_scrolledtextZ ScrolledTextztkinter.scrolledtextZtkinter_simpledialogZ SimpleDialogztkinter.simpledialogZ tkinter_tixZTixz tkinter.tixZ tkinter_ttkZttkz tkinter.ttkZtkinter_constantsZ Tkconstantsztkinter.constantsZ tkinter_dndZTkdndz tkinter.dndZtkinter_colorchooserZtkColorChooserztkinter.colorchooserZtkinter_commondialogZtkCommonDialogztkinter.commondialogZtkinter_tkfiledialogZ tkFileDialogZ tkinter_fontZtkFontz tkinter.fontZtkinter_messageboxZ tkMessageBoxztkinter.messageboxZtkinter_tksimpledialogZtkSimpleDialogZ urllib_parsez.moves.urllib_parsez urllib.parseZ urllib_errorz.moves.urllib_errorz urllib.errorZurllibz .moves.urllibZurllib_robotparser robotparserzurllib.robotparserZ xmlrpc_clientZ xmlrpclibz xmlrpc.clientZ xmlrpc_serverZSimpleXMLRPCServerz xmlrpc.serverZwin32winreg_winregzmoves.z.movesmovesc@seZdZdZdS)Module_six_moves_urllib_parsez7Lazy loading of moved objects in six.moves.urllib_parseN)rrrrr r r r rn@srnZ ParseResultZurlparseZ SplitResultZparse_qsZ parse_qslZ urldefragZurljoinZurlsplitZ urlunparseZ urlunsplitZ quote_plusZunquoteZ unquote_plusZ urlencodeZ splitqueryZsplittagZ splituserZ uses_fragmentZ uses_netlocZ uses_paramsZ uses_queryZ uses_relativezmoves.urllib_parsezmoves.urllib.parsec@seZdZdZdS)Module_six_moves_urllib_errorz7Lazy loading of moved objects in six.moves.urllib_errorN)rrrrr r r r rohsroZURLErrorZurllib2Z HTTPErrorZContentTooShortErrorz.moves.urllib.errorzmoves.urllib_errorzmoves.urllib.errorc@seZdZdZdS)Module_six_moves_urllib_requestz9Lazy loading of moved objects in six.moves.urllib_requestN)rrrrr r r r rp|srpZurlopenzurllib.requestZinstall_openerZ build_openerZ pathname2urlZ url2pathnameZ getproxiesZRequestZOpenerDirectorZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZ ProxyHandlerZ BaseHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZ HTTPHandlerZ HTTPSHandlerZ FileHandlerZ FTPHandlerZCacheFTPHandlerZUnknownHandlerZHTTPErrorProcessorZ urlretrieveZ urlcleanupZ URLopenerZFancyURLopenerZ proxy_bypassz.moves.urllib.requestzmoves.urllib_requestzmoves.urllib.requestc@seZdZdZdS) Module_six_moves_urllib_responsez:Lazy loading of moved objects in six.moves.urllib_responseN)rrrrr r r r rqsrqZaddbasezurllib.responseZ addclosehookZaddinfoZ addinfourlz.moves.urllib.responsezmoves.urllib_responsezmoves.urllib.responsec@seZdZdZdS)#Module_six_moves_urllib_robotparserz=Lazy loading of moved objects in six.moves.urllib_robotparserN)rrrrr r r r rrsrrZRobotFileParserz.moves.urllib.robotparserzmoves.urllib_robotparserzmoves.urllib.robotparserc@sNeZdZdZgZejdZejdZejdZ ejdZ ejdZ ddZ d S) Module_six_moves_urllibzICreate a six.moves.urllib namespace that resembles the Python 3 namespacezmoves.urllib_parsezmoves.urllib_errorzmoves.urllib_requestzmoves.urllib_responsezmoves.urllib_robotparsercCsdddddgS)Nparseerrorrequestresponserjr )r r r r r6szModule_six_moves_urllib.__dir__N) rrrrrG _importerr>rtrurvrwrjr6r r r r rss     rsz moves.urllibcCstt|j|dS)zAdd an item to six.moves.N)rrLr)Zmover r r add_movesrycCsXytt|WnDtk rRy tj|=Wn"tk rLtd|fYnXYnXdS)zRemove item from six.moves.zno such move, %rN)rrLr!rm__dict__rA)rr r r remove_moves r{__func____self__ __closure____code__ __defaults__ __globals__im_funcZim_selfZ func_closureZ func_codeZ func_defaultsZ func_globalscCs|jS)N)next)itr r r advance_iterator srcCstddt|jDS)Ncss|]}d|jkVqdS)__call__N)rz)r3klassr r r szcallable..)anytype__mro__)r"r r r callablesrcCs|S)Nr )unboundr r r get_unbound_functionsrcCs|S)Nr )rclsr r r create_unbound_methodsrcCs|jS)N)r)rr r r r"scCstj|||jS)N)types MethodTyper )rr"r r r create_bound_method%srcCstj|d|S)N)rr)rrr r r r(sc@seZdZddZdS)IteratorcCst|j|S)N)r__next__)r r r r r-sz Iterator.nextN)rrrrr r r r r+srz3Get the function out of a possibly unbound functioncKst|jf|S)N)iterkeys)dkwr r r iterkeys>srcKst|jf|S)N)rvalues)rrr r r itervaluesAsrcKst|jf|S)N)ritems)rrr r r iteritemsDsrcKst|jf|S)N)rZlists)rrr r r iterlistsGsrrrrcKs |jf|S)N)r)rrr r r rPscKs |jf|S)N)r)rrr r r rSscKs |jf|S)N)r)rrr r r rVscKs |jf|S)N)r)rrr r r rYsviewkeys viewvalues viewitemsz1Return an iterator over the keys of a dictionary.z3Return an iterator over the values of a dictionary.z?Return an iterator over the (key, value) pairs of a dictionary.zBReturn an iterator over the (key, [values]) pairs of a dictionary.cCs |jdS)Nzlatin-1)encode)sr r r bksrcCs|S)Nr )rr r r unsrz>BassertCountEqualZassertRaisesRegexpZassertRegexpMatchesassertRaisesRegex assertRegexcCs|S)Nr )rr r r rscCst|jdddS)Nz\\z\\\\Zunicode_escape)unicodereplace)rr r r rscCs t|dS)Nr)ord)Zbsr r r byte2intsrcCs t||S)N)r)Zbufir r r indexbytessrZassertItemsEqualz Byte literalz Text literalcOst|t||S)N)r,_assertCountEqual)r argskwargsr r r rscOst|t||S)N)r,_assertRaisesRegex)r rrr r r rscOst|t||S)N)r, _assertRegex)r rrr r r rsexeccCs*|dkr|}|j|k r"|j||dS)N) __traceback__with_traceback)r#r/tbr r r reraises   rcCsB|dkr*tjd}|j}|dkr&|j}~n |dkr6|}tddS)zExecute code in a namespace.Nrzexec _code_ in _globs_, _locs_)r _getframe f_globalsf_localsr)Z_code_Z_globs_Z_locs_framer r r exec_s rz9def reraise(tp, value, tb=None): raise tp, value, tb zrdef raise_from(value, from_value): if from_value is None: raise value raise value from from_value zCdef raise_from(value, from_value): raise value from from_value cCs|dS)Nr )r/Z from_valuer r r raise_fromsrprintc s6|jdtjdkrdSfdd}d}|jdd}|dk r`t|trNd}nt|ts`td|jd d}|dk rt|trd}nt|tstd |rtd |sx|D]}t|trd}PqW|rtd }td }nd }d }|dkr|}|dkr|}x,t|D] \} }| r||||qW||dS)z4The new-style print function for Python 2.4 and 2.5.fileNcsdt|tst|}ttrVt|trVjdk rVtdd}|dkrHd}|jj|}j|dS)Nerrorsstrict) rD basestringstrrrencodingr,rwrite)datar)fpr r rs     zprint_..writeFsepTzsep must be None or a stringendzend must be None or a stringz$invalid keyword arguments to print()  )poprstdoutrDrr TypeError enumerate) rrrZ want_unicoderrargnewlineZspacerr )rr print_sL           rcOs<|jdtj}|jdd}t|||r8|dk r8|jdS)NrflushF)getrrr_printr)rrrrr r r r s    zReraise an exception.csfdd}|S)Ncstj|}|_|S)N)r^wraps __wrapped__)f)assignedupdatedwrappedr r wrapperszwraps..wrapperr )rrrrr )rrrr rsrcs&Gfddd}tj|dfiS)z%Create a base class with a metaclass.cseZdZfddZdS)z!with_metaclass..metaclasscs ||S)Nr )rrZ this_basesr)basesmetar r __new__'sz)with_metaclass..metaclass.__new__N)rrrrr )rrr r metaclass%srZtemporary_class)rr)rrrr )rrr with_metaclass srcsfdd}|S)z6Class decorator for creating a class with a metaclass.csl|jj}|jd}|dk rDt|tr,|g}x|D]}|j|q2W|jdd|jdd|j|j|S)N __slots__rz __weakref__)rzcopyrrDrrr __bases__)rZ orig_varsslotsZ slots_var)rr r r.s      zadd_metaclass..wrapperr )rrr )rr add_metaclass,s rcCs2tr.d|jkrtd|j|j|_dd|_|S)a A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. __str__zY@python_2_unicode_compatible cannot be applied to %s because it doesn't define __str__().cSs|jjdS)Nzutf-8) __unicode__r)r r r r Jsz-python_2_unicode_compatible..)PY2rz ValueErrorrrr)rr r r python_2_unicode_compatible<s   r__spec__)rrlilill)N)NN)rr)rr)rr)rr)rZ __future__rr^rPoperatorrr __author__ __version__ version_inforr(ZPY34rZ string_typesintZ integer_typesrZ class_typesZ text_typebytesZ binary_typemaxsizeZMAXSIZErZlongZ ClassTyperplatform startswithobjectr len OverflowErrorrrrr& ModuleTyper2r7r9rrxrLr5r-rrrDr=rmrnZ_urllib_parse_moved_attributesroZ_urllib_error_moved_attributesrpZ _urllib_request_moved_attributesrqZ!_urllib_response_moved_attributesrrZ$_urllib_robotparser_moved_attributesrsryr{Z _meth_funcZ _meth_selfZ _func_closureZ _func_codeZ_func_defaultsZ _func_globalsrr NameErrorrrrrrr attrgetterZget_method_functionZget_method_selfZget_function_closureZget_function_codeZget_function_defaultsZget_function_globalsrrrr methodcallerrrrrrchrZunichrstructStructpackZint2byte itemgetterrgetitemrrZ iterbytesrMrNBytesIOrrrpartialrVrrrrr,rQrrrrrWRAPPER_ASSIGNMENTSWRAPPER_UPDATESrrrrrG __package__globalsrrsubmodule_search_locations meta_pathrrZimporterappendr r r r s     >                                                                                                                                                          5     PK!-Kqq+_vendor/__pycache__/__init__.cpython-36.pycnu[3 vh@sdS)Nrrr/usr/lib/python3.6/__init__.pysPK!-Kqq1_vendor/__pycache__/__init__.cpython-36.opt-1.pycnu[3 vh@sdS)Nrrr/usr/lib/python3.6/__init__.pysPK!0 KK2_vendor/__pycache__/pyparsing.cpython-36.opt-1.pycnu[3 vh@s dZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZyddlmZWn ek rddlmZYnXydd l mZWn>ek rydd lmZWnek rdZYnXYnXd d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrgiZee jddsZeddskZer"e jZe Z!e"Z#e Z$e%e&e'e(e)ee*e+e,e-e.g Z/nbe j0Ze1Z2dtduZ$gZ/ddl3Z3xBdvj4D]6Z5ye/j6e7e3e5Wne8k r|wJYnXqJWe9dwdxe2dyDZ:dzd{Z;Gd|d}d}e<Z=ej>ej?Z@d~ZAeAdZBe@eAZCe"dZDdjEddxejFDZGGdd!d!eHZIGdd#d#eIZJGdd%d%eIZKGdd'd'eKZLGdd*d*eHZMGddde<ZNGdd&d&e<ZOe jPjQeOdd=ZRddNZSddKZTddZUddZVddZWddUZXd/ddZYGdd(d(e<ZZGdd0d0eZZ[Gddde[Z\Gddde[Z]Gddde[Z^e^Z_e^eZ_`Gddde[ZaGdd d e^ZbGdd d eaZcGddpdpe[ZdGdd3d3e[ZeGdd+d+e[ZfGdd)d)e[ZgGdd d e[ZhGdd2d2e[ZiGddde[ZjGdddejZkGdddejZlGdddejZmGdd.d.ejZnGdd-d-ejZoGdd5d5ejZpGdd4d4ejZqGdd$d$eZZrGdd d erZsGdd d erZtGddderZuGddderZvGdd"d"eZZwGdddewZxGdddewZyGdddewZzGdddezZ{Gdd6d6ezZ|Gddde<Z}e}Z~GdddewZGdd,d,ewZGdddewZGdddeZGdd1d1ewZGdddeZGdddeZGdddeZGdd/d/eZGddde<ZddfZd0ddDZd1dd@Zdd΄ZddSZddRZdd҄Zd2ddWZddEZd3ddkZddlZddnZe\jdGZeljdMZemjdLZenjdeZeojddZeeeDdddڍjdd܄Zefd݃jdd܄Zefd߃jdd܄ZeeBeBeeeGddydBefde jBZeeedeZe^dedjdee{eeBjddZddcZddQZdd`Zdd^ZddqZedd܄Zedd܄ZddZddOZddPZddiZe<e_d4ddoZe=Ze<e_e<e_ededfddmZeZeefddjdZeefddjdZeefddefddBjdZee_dejjdZdddejfddTZd5ddjZedZedZeeee@eCdjd\ZZeed j4d Zefd d jEejÃd jdZĐdd_ZeefddjdZefdjdZefdjȃjdZefdjdZeefddeBjdZeZefdjdZee{eeeGdɐdeeede^dɃemj΃jdZeeejeBddjd>ZGd drdrZeҐd!k rebd"Zebd#Zeee@eCd$ZeeՐd%dӐd&jeZeeeփjd'Zאd(eBZeeՐd%dӐd&jeZeeeكjd)ZeӐd*eؐd'eeڐd)Zejܐd+ejjܐd,ejjܐd,ejjܐd-ddlZejjeejejjܐd.dS(6aS pyparsing module - Classes and methods to define and execute parsing grammars The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements (L{'+'} operator gives L{And} expressions, strings are auto-converted to L{Literal} expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments z2.1.10z07 Oct 2016 01:31 UTCz*Paul McGuire N)ref)datetime)RLock) OrderedDictAndCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroupKeywordLineEnd LineStartLiteral MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMore alphanumsalphas alphas8bit anyCloseTag anyOpenTag cStyleCommentcolcommaSeparatedListcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOfdowncaseTokensemptyhexnums htmlCommentjavaStyleCommentlinelineEnd lineStartlineno makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence printablespunc8bitpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedStringsrange stringEnd stringStarttraceParseAction unicodeString upcaseTokens withAttribute indentedBlockoriginalTextForungroup infixNotation locatedExpr withClass CloseMatchtokenMappyparsing_commonc Cs`t|tr|Syt|Stk rZt|jtjd}td}|jdd|j |SXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexint)trw/usr/lib/python3.6/pyparsing.pysz_ustr..N) isinstanceZunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr'setParseActiontransformString)objretZ xmlcharrefrwrwrx_ustrs rz6sum len sorted reversed list tuple set any all min maxccs|] }|VqdS)Nrw).0yrwrwrx srrrcCs>d}dddjD}x"t||D]\}}|j||}q"W|S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nrw)rsrwrwrxrsz_xml_escape..zamp gt lt quot apos)splitzipreplace)dataZ from_symbolsZ to_symbolsZfrom_Zto_rwrwrx _xml_escapes rc@s eZdZdS) _ConstantsN)__name__ __module__ __qualname__rwrwrwrxrsr 0123456789Z ABCDEFabcdef\ccs|]}|tjkr|VqdS)N)stringZ whitespace)rcrwrwrxrsc@sPeZdZdZdddZeddZdd Zd d Zd d Z dddZ ddZ dS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n ||_||_||_|||f|_dS)Nr)locmsgpstr parserElementargs)selfrrrelemrwrwrx__init__szParseBaseException.__init__cCs||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clsperwrwrx_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text rJr9columnrGN)r9r)rJrrr9rGAttributeError)rZanamerwrwrx __getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrJr)rrwrwrx__str__szParseBaseException.__str__cCst|S)N)r)rrwrwrx__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been foundN)rrrrrwrwrwrxr#sc@s eZdZdZddZddZdS)r&zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs ||_dS)N)parseElementTrace)rparseElementListrwrwrxrsz"RecursiveGrammarException.__init__cCs d|jS)NzRecursiveGrammarException: %s)r)rrwrwrxr sz!RecursiveGrammarException.__str__N)rrrrrrrwrwrwrxr&sc@s,eZdZddZddZddZddZd S) _ParseResultsWithOffsetcCs||f|_dS)N)tup)rZp1Zp2rwrwrxr$sz _ParseResultsWithOffset.__init__cCs |j|S)N)r)rirwrwrx __getitem__&sz#_ParseResultsWithOffset.__getitem__cCst|jdS)Nr)reprr)rrwrwrxr(sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dS)Nr)r)rrrwrwrx setOffset*sz!_ParseResultsWithOffset.setOffsetN)rrrrrrrrwrwrwrxr#src@seZdZdZd[ddZddddefddZdd Zefd d Zd d Z ddZ ddZ ddZ e Z ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName}) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 NTcCs"t||r|Stj|}d|_|S)NT)rzobject__new___ParseResults__doinit)rtoklistnameasListmodalZretobjrwrwrxrTs   zParseResults.__new__c Cs`|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t |_ |dk o|r\|sd|j|<||t rt |}||_||t dttfo|ddgfks\||tr|g}|r&||trt|jd||<ntt|dd||<|||_n6y|d||<Wn$tttfk rZ|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrurr basestringr"rcopyKeyError TypeError IndexError)rrrrrrzrwrwrxr]sB     $   zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrrrcSsg|] }|dqS)rrw)rvrwrwrx sz,ParseResults.__getitem__..rs)rzruslicerrrr")rrrwrwrxrs   zParseResults.__getitem__cCs||tr0|jj|t|g|j|<|d}nD||ttfrN||j|<|}n&|jj|tt|dg|j|<|}||trt||_ dS)Nr) rrgetrrurrr"wkrefr)rkrrzsubrwrwrx __setitem__s   " zParseResults.__setitem__c Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt|j|}|jx^|j j D]F\}}x<|D]4}x.t |D]"\}\}} t || | |k||<qWq|WqnWn|j |=dS)Nrrr) rzrurlenrrrangeindicesreverseritems enumerater) rrZmylenZremovedr occurrencesjrvaluepositionrwrwrx __delitem__s   $zParseResults.__delitem__cCs ||jkS)N)r)rrrwrwrx __contains__szParseResults.__contains__cCs t|jS)N)rr)rrwrwrx__len__szParseResults.__len__cCs |j S)N)r)rrwrwrx__bool__szParseResults.__bool__cCs t|jS)N)iterr)rrwrwrx__iter__szParseResults.__iter__cCst|jdddS)Nrrrs)rr)rrwrwrx __reversed__szParseResults.__reversed__cCs$t|jdr|jjSt|jSdS)Niterkeys)hasattrrrr)rrwrwrx _iterkeyss  zParseResults._iterkeyscsfddjDS)Nc3s|]}|VqdS)Nrw)rr)rrwrxrsz+ParseResults._itervalues..)r)rrw)rrx _itervaluesszParseResults._itervaluescsfddjDS)Nc3s|]}||fVqdS)Nrw)rr)rrwrxrsz*ParseResults._iteritems..)r)rrw)rrx _iteritemsszParseResults._iteritemscCs t|jS)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rr)rrwrwrxkeysszParseResults.keyscCs t|jS)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r itervalues)rrwrwrxvaluesszParseResults.valuescCs t|jS)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r iteritems)rrwrwrxrszParseResults.itemscCs t|jS)zSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)boolr)rrwrwrxhaskeysszParseResults.haskeyscOs|s dg}x6|jD]*\}}|dkr2|d|f}qtd|qWt|dtsht|dksh|d|kr|d}||}||=|S|d}|SdS)a Removes and returns item at specified index (default=C{last}). Supports both C{list} and C{dict} semantics for C{pop()}. If passed no argument or an integer argument, it will use C{list} semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use C{dict} semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in C{dict.pop()}. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] rrdefaultrz-pop() got an unexpected keyword argument '%s'Nrs)rrrzrur)rrkwargsrrindexrZ defaultvaluerwrwrxpops"  zParseResults.popcCs||kr||S|SdS)ai Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None Nrw)rkey defaultValuerwrwrxrszParseResults.getcCsZ|jj||xF|jjD]8\}}x.t|D]"\}\}}t||||k||<q,WqWdS)a Inserts new element at location index in the list of parsed tokens. Similar to C{list.insert()}. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N)rinsertrrrr)rrZinsStrrrrrrrwrwrxr2szParseResults.insertcCs|jj|dS)a Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N)rappend)ritemrwrwrxrFs zParseResults.appendcCs$t|tr||7}n |jj|dS)a Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)rzr"rextend)rZitemseqrwrwrxrTs  zParseResults.extendcCs|jdd=|jjdS)z7 Clear all elements and results names. N)rrclear)rrwrwrxrfs zParseResults.clearc Csfy||Stk rdSX||jkr^||jkrD|j|ddStdd|j|DSndSdS)NrrrrcSsg|] }|dqS)rrw)rrrwrwrxrwsz,ParseResults.__getattr__..rs)rrrr")rrrwrwrxrms  zParseResults.__getattr__cCs|j}||7}|S)N)r)rotherrrwrwrx__add__{szParseResults.__add__cs|jrnt|jfdd|jj}fdd|D}x4|D],\}}|||<t|dtr>t||d_q>W|j|j7_|jj |j|S)Ncs|dkr S|S)Nrrw)a)offsetrwrxrysz'ParseResults.__iadd__..c s4g|],\}}|D]}|t|d|dfqqS)rrr)r)rrvlistr) addoffsetrwrxrsz)ParseResults.__iadd__..r) rrrrrzr"rrrupdate)rrZ otheritemsZotherdictitemsrrrw)rrrx__iadd__s    zParseResults.__iadd__cCs&t|tr|dkr|jS||SdS)Nr)rzrur)rrrwrwrx__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrr)rrwrwrxrszParseResults.__repr__cCsddjdd|jDdS)N[z, css(|] }t|trt|nt|VqdS)N)rzr"rr)rrrwrwrxrsz'ParseResults.__str__..])rr)rrwrwrxrszParseResults.__str__rcCsPg}xF|jD]<}|r"|r"|j|t|tr:||j7}q |jt|q W|S)N)rrrzr" _asStringListr)rsepoutrrwrwrxr s   zParseResults._asStringListcCsdd|jDS)a Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cSs"g|]}t|tr|jn|qSrw)rzr"r)rresrwrwrxrsz'ParseResults.asList..)r)rrwrwrxrszParseResults.asListcs6tr |j}n|j}fddtfdd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} cs6t|tr.|jr|jSfdd|DSn|SdS)Ncsg|] }|qSrwrw)rr)toItemrwrxrsz7ParseResults.asDict..toItem..)rzr"rasDict)r)rrwrxrs  z#ParseResults.asDict..toItemc3s|]\}}||fVqdS)Nrw)rrr)rrwrxrsz&ParseResults.asDict..)PY_3rrr)rZitem_fnrw)rrxrs  zParseResults.asDictcCs8t|j}|jj|_|j|_|jj|j|j|_|S)zA Returns a new copy of a C{ParseResults} object. )r"rrrrrrr)rrrwrwrxrs   zParseResults.copyFc CsPd}g}tdd|jjD}|d}|s8d}d}d}d} |dk rJ|} n |jrV|j} | sf|rbdSd} |||d| d g7}xt|jD]\} } t| tr| |kr|| j|| |o|dk||g7}n|| jd|o|dk||g7}qd} | |kr|| } | s |rqnd} t t | } |||d| d | d | d g 7}qW|||d | d g7}dj |S) z (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.  css(|] \}}|D]}|d|fVqqdS)rrNrw)rrrrrwrwrxrsz%ParseResults.asXML..z rNZITEM<>z.z %s%s- %s: z rrcss|]}t|tVqdS)N)rzr")rvvrwrwrxrssz %s%s[%d]: %s%s%sr) rrrrsortedrrzr"dumpranyrr) rrdepthfullr NLrrrrrrwrwrxrPs,   4.zParseResults.dumpcOstj|jf||dS)a Pretty-printer for parsed results as a list, using the C{pprint} module. Accepts additional positional or keyword args as defined for the C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintr)rrrrwrwrxr"}szParseResults.pprintcCs.|j|jj|jdk r|jp d|j|jffS)N)rrrrrr)rrwrwrx __getstate__s zParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|jj||dk rDt||_nd|_dS)Nrrr)rrrrrrr)rstaterZ inAccumNamesrwrwrx __setstate__s   zParseResults.__setstate__cCs|j|j|j|jfS)N)rrrr)rrwrwrx__getnewargs__szParseResults.__getnewargs__cCstt|t|jS)N)rrrr)rrwrwrxrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrrzrrrrrrr __nonzero__rrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrr"r#r%r&rrwrwrwrxr"-sh& ' 4  # =% - cCsF|}d|kot|knr4||ddkr4dS||jdd|S)aReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrrr)rrfind)rstrgrrwrwrxr9s cCs|jdd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrrr)count)rr)rwrwrxrJs cCsF|jdd|}|jd|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators. rrrrN)r(find)rr)ZlastCRZnextCRrwrwrxrGs  cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrJr9)instringrexprrwrwrx_defaultStartDebugActionsr/cCs$tdt|dt|jdS)NzMatched z -> )r,rr{r)r-startlocZendlocr.toksrwrwrx_defaultSuccessDebugActionsr2cCstdt|dS)NzException raised:)r,r)r-rr.excrwrwrx_defaultExceptionDebugActionsr4cGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nrw)rrwrwrxrQsrqc stkrfddSdgdgtdddkrFddd }dd d n tj}tjd }|dd d}|d|d|ffdd}d}ytdtdj}Wntk rt}YnX||_|S)Ncs|S)Nrw)rlrv)funcrwrxrysz_trim_arity..rFrqrocSs8tdkr dnd }tj| |dd|}|j|jfgS) Nror7rrqrr)limit)ror7r)system_version traceback extract_stackfilenamerJ)r8r frame_summaryrwrwrxr=sz"_trim_arity..extract_stackcSs$tj||d}|d}|j|jfgS)N)r8rrrs)r< extract_tbr>rJ)tbr8Zframesr?rwrwrxr@sz_trim_arity..extract_tb)r8rrcsxy |dd}dd<|Stk rdr>n4z.tjd}|dddddksjWd~Xdkrdd7<wYqXqWdS)NrTrrrq)r8rsrs)rr~exc_info)rrrA)r@ foundArityr6r8maxargspa_call_line_synthrwrxwrappers"  z_trim_arity..wrapperzr __class__)ror7)r)rrs) singleArgBuiltinsr;r<r=r@getattrr Exceptionr{)r6rEr=Z LINE_DIFFZ this_linerG func_namerw)r@rDr6r8rErFrx _trim_aritys*   rMcseZdZdZdZdZeddZeddZddd Z d d Z d d Z dddZ dddZ ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+k rGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r$z)Abstract base level parser element class.z FcCs |t_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N)r$DEFAULT_WHITE_CHARS)charsrwrwrxsetDefaultWhitespaceChars=s z'ParserElement.setDefaultWhitespaceCharscCs |t_dS)a Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N)r$_literalStringClass)rrwrwrxinlineLiteralsUsingLsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_ d|_ d|_ d|_ t|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)r parseAction failActionstrRepr resultsName saveAsListskipWhitespacer$rN whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResults debugActionsre callPreparse callDuringTry)rsavelistrwrwrxras(zParserElement.__init__cCs<tj|}|jdd|_|jdd|_|jr8tj|_|S)a$ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of C{expr.copy()} is just C{expr()}:: integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") N)rrSr]rZr$rNrY)rZcpyrwrwrxrxs  zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) z Expected exception)rrarrhr)rrrwrwrxsetNames    zParserElement.setNamecCs4|j}|jdr"|dd}d}||_| |_|S)aP Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, C{expr("name")} in place of C{expr.setResultsName("name")} - see L{I{__call__}<__call__>}. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") *NrrTrs)rendswithrVrb)rrlistAllMatchesZnewselfrwrwrxsetResultsNames  zParserElement.setResultsNameTcs@|r&|jdfdd }|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is about to be parsed. Set C{breakFlag} to True to enable, False to disable. Tcsddl}|j||||S)Nr)pdbZ set_trace)r-r doActions callPreParsern) _parseMethodrwrxbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parsersr)rZ breakFlagrrrw)rqrxsetBreaks  zParserElement.setBreakcOs&tttt||_|jdd|_|S)a  Define action to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] rfF)rmaprMrSrrf)rfnsrrwrwrxrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|jdd|_|S)z Add parse action to expression's list of parse actions. See L{I{setParseAction}}. See examples in L{I{copy}}. rfF)rSrrvrMrfr)rrwrrwrwrxaddParseActionszParserElement.addParseActioncsb|jdd|jddrtntx(|D] fdd}|jj|q&W|jpZ|jdd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, functions passed to C{addCondition} need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) messagezfailed user-defined conditionfatalFcs$tt|||s ||dS)N)rrM)rr5rv)exc_typefnrrwrxpasz&ParserElement.addCondition..parf)rr!rrSrrf)rrwrr}rw)r{r|rrx addConditions  zParserElement.addConditioncCs ||_|S)a Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments C{fn(s,loc,expr,err)} where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw C{L{ParseFatalException}} if it is desired to stop parsing immediately.)rT)rr|rwrwrx setFailActions zParserElement.setFailActionc CsZd}xP|rTd}xB|jD]8}yx|j||\}}d}qWWqtk rLYqXqWqW|S)NTF)r]rtr)rr-rZ exprsFoundeZdummyrwrwrx_skipIgnorables#s  zParserElement._skipIgnorablescCsL|jr|j||}|jrH|j}t|}x ||krF|||krF|d7}q(W|S)Nrr)r]rrXrYr)rr-rZwtinstrlenrwrwrxpreParse0s  zParserElement.preParsecCs|gfS)Nrw)rr-rrorwrwrx parseImpl<szParserElement.parseImplcCs|S)Nrw)rr-r tokenlistrwrwrx postParse?szParserElement.postParsec "Cs|j}|s|jr|jdr,|jd||||rD|jrD|j||}n|}|}yDy|j|||\}}Wn(tk rt|t||j |YnXWnXt k r} z<|jdr|jd|||| |jr|j|||| WYdd} ~ XnXn|o|jr|j||}n|}|}|j s$|t|krhy|j|||\}}Wn*tk rdt|t||j |YnXn|j|||\}}|j |||}t ||j|j|jd} |jr|s|jr|rVyRxL|jD]B} | ||| }|dk rt ||j|jot|t tf|jd} qWWnFt k rR} z(|jdr@|jd|||| WYdd} ~ XnXnNxL|jD]B} | ||| }|dk r^t ||j|jot|t tf|jd} q^W|r|jdr|jd||||| || fS)Nrrq)rrrr)r^rTrcrerrrrrrarr`rr"rVrWrbrSrfrzr) rr-rrorpZ debuggingprelocZ tokensStarttokenserrZ retTokensr|rwrwrx _parseNoCacheCsp             zParserElement._parseNoCachec Cs>y|j||dddStk r8t|||j|YnXdS)NF)ror)rtr!rra)rr-rrwrwrxtryParseszParserElement.tryParsec Cs2y|j||Wnttfk r(dSXdSdS)NFT)rrr)rr-rrwrwrx canParseNexts zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecsdit|_fdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncs j|S)N)r)rr)cache not_in_cacherwrxrsz3ParserElement._UnboundedCache.__init__..getcs ||<dS)Nrw)rrr)rrwrxsetsz3ParserElement._UnboundedCache.__init__..setcs jdS)N)r)r)rrwrxrsz5ParserElement._UnboundedCache.__init__..clear)rrtypes MethodTyperrr)rrrrrw)rrrxrs   z&ParserElement._UnboundedCache.__init__N)rrrrrwrwrwrx_UnboundedCachesrNc@seZdZddZdS)zParserElement._FifoCachecsht|_tfdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncs j|S)N)r)rr)rrrwrxrsz.ParserElement._FifoCache.__init__..getcs"||<tkrjddS)NF)rpopitem)rrr)rsizerwrxrs z.ParserElement._FifoCache.__init__..setcs jdS)N)r)r)rrwrxrsz0ParserElement._FifoCache.__init__..clear)rr _OrderedDictrrrrr)rrrrrrw)rrrrxrs  z!ParserElement._FifoCache.__init__N)rrrrrwrwrwrx _FifoCachesrc@seZdZddZdS)zParserElement._FifoCachecsvt|_itjgfdd}fdd}fdd}tj|||_tj|||_tj|||_dS)Ncs j|S)N)r)rr)rrrwrxrsz.ParserElement._FifoCache.__init__..getcs2||<tkr$jjdj|dS)N)rrpopleftr)rrr)rkey_fiforrwrxrs z.ParserElement._FifoCache.__init__..setcsjjdS)N)r)r)rrrwrxrsz0ParserElement._FifoCache.__init__..clear) rr collectionsdequerrrrr)rrrrrrw)rrrrrxrs  z!ParserElement._FifoCache.__init__N)rrrrrwrwrwrxrsrc Csd\}}|||||f}tjtj}|j|} | |jkrtj|d7<y|j||||} Wn8tk r} z|j|| j | j WYdd} ~ XqX|j|| d| dj f| Sn4tj|d7<t | t r| | d| dj fSWdQRXdS)Nrrr)rrr)r$packrat_cache_lock packrat_cacherrpackrat_cache_statsrrrrHrrrzrK) rr-rrorpZHITZMISSlookuprrrrwrwrx _parseCaches$   zParserElement._parseCachecCs(tjjdgttjtjdd<dS)Nr)r$rrrrrwrwrwrx resetCaches zParserElement.resetCachecCs8tjs4dt_|dkr tjt_n tj|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default=C{128}) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method C{ParserElement.enablePackrat()}. If your program uses C{psyco} to "compile as you go", you must call C{enablePackrat} before calling C{psyco.full()}. If you do not do this, Python will crash. For best results, call C{enablePackrat()} immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enablePackrat() TN)r$_packratEnabledrrrrrt)Zcache_size_limitrwrwrx enablePackrats   zParserElement.enablePackratcCstj|js|jx|jD] }|jqW|js<|j}y<|j|d\}}|rv|j||}t t }|j||Wn0t k r}ztj rn|WYdd}~XnX|SdS)aB Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. If you want the grammar to require that the entire input string be successfully parsed, then set C{parseAll} to True (equivalent to ending the grammar with C{L{StringEnd()}}). Note: C{parseString} implicitly calls C{expandtabs()} on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the C{loc} argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling C{parseWithTabs} on your grammar before calling C{parseString} (see L{I{parseWithTabs}}) - define your parse action using the full C{(s,loc,toks)} signature, and reference the input string using the parse action's C{s} argument - explictly expand the tabs in your input string before calling C{parseString} Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text rN) r$rr_ streamliner]r\ expandtabsrtrr r)rverbose_stacktrace)rr-parseAllrrrZser3rwrwrx parseString#s$    zParserElement.parseStringccs@|js|jx|jD] }|jqW|js8t|j}t|}d}|j}|j}t j d} yx||kon| |kry |||} ||| dd\} } Wnt k r| d}Yq`X| |kr| d7} | | | fV|r|||} | |kr| }q|d7}n| }q`| d}q`WWn4t k r:}zt j r&n|WYdd}~XnXdS)a Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See L{I{parseString}} for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rF)rprrN)r_rr]r\rrrrrtr$rrrr)rr- maxMatchesZoverlaprrrZ preparseFnZparseFnmatchesrZnextLocrZnextlocr3rwrwrx scanStringUsB       zParserElement.scanStringcCsg}d}d|_yxh|j|D]Z\}}}|j||||rrt|trT||j7}nt|trh||7}n |j||}qW|j||ddd|D}djtt t |St k r}zt j rȂn|WYdd}~XnXdS)af Extension to C{L{scanString}}, to modify matching text with modified tokens that may be returned from a parse action. To use C{transformString}, define a grammar and attach a parse action to it that modifies the returned token list. Invoking C{transformString()} on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. C{transformString()} returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) Prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTNcSsg|] }|r|qSrwrw)rorwrwrxrsz1ParserElement.transformString..r)r\rrrzr"rrrrvr_flattenrr$r)rr-r ZlastErvrrr3rwrwrxrs(    zParserElement.transformStringcCsPytdd|j||DStk rJ}ztjr6n|WYdd}~XnXdS)a~ Another extension to C{L{scanString}}, simplifying the access to the tokens found to match the given parse expression. May be called with optional C{maxMatches} argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) prints:: ['More', 'Iron', 'Lead', 'Gold', 'I'] cSsg|]\}}}|qSrwrw)rrvrrrwrwrxrsz.ParserElement.searchString..N)r"rrr$r)rr-rr3rwrwrx searchStrings zParserElement.searchStringc csXd}d}x<|j||dD]*\}}}|||V|r>|dV|}qW||dVdS)a[ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)rN)r) rr-maxsplitZincludeSeparatorsZsplitsZlastrvrrrwrwrxrs  zParserElement.splitcCsFt|trtj|}t|ts:tjdt|tdddSt||gS)a Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement converts them to L{Literal}s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) Prints:: Hello, World! -> ['Hello', ',', 'World', '!'] z4Cannot combine element of type %s with ParserElementrq) stacklevelN) rzrr$rQwarningswarnr SyntaxWarningr)rrrwrwrxrs    zParserElement.__add__cCsBt|trtj|}t|ts:tjdt|tdddS||S)z] Implementation of + operator when left operand is not a C{L{ParserElement}} z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrxrs    zParserElement.__radd__cCsLt|trtj|}t|ts:tjdt|tdddSt|tj |gS)zQ Implementation of - operator, returns C{L{And}} with error stop z4Cannot combine element of type %s with ParserElementrq)rN) rzrr$rQrrrrr _ErrorStop)rrrwrwrx__sub__s    zParserElement.__sub__cCsBt|trtj|}t|ts:tjdt|tdddS||S)z] Implementation of - operator when left operand is not a C{L{ParserElement}} z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rsub__ s    zParserElement.__rsub__cst|tr|d}}nt|tr|d dd}|ddkrHd|df}t|dtr|ddkr|ddkrvtS|ddkrtS|dtSnJt|dtrt|dtr|\}}||8}ntdt|dt|dntdt||dkr td|dkrtd||ko2dknrBtd |rfd d |r|dkrt|}ntg||}n|}n|dkr}ntg|}|S) a Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is equivalent to C{expr*n + L{ZeroOrMore}(expr)} (read as "at least n instances of C{expr}") - C{expr*(None,n)} is equivalent to C{expr*(0,n)} (read as "0 to n instances of C{expr}") - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} Note that C{expr*(None,n)} does not raise an exception if more than n exprs exist in the input stream; that is, C{expr*(None,n)} does not enforce a maximum number of expr occurrences. If this behavior is desired, then write C{expr*(None,n) + ~expr} rNrqrrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdS)Nrr)r)n)makeOptionalListrrwrxr]sz/ParserElement.__mul__..makeOptionalList)NN) rzrutupler2rrr ValueErrorr)rrZ minElementsZ optElementsrrw)rrrx__mul__,sD             zParserElement.__mul__cCs |j|S)N)r)rrrwrwrx__rmul__pszParserElement.__rmul__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zI Implementation of | operator - returns C{L{MatchFirst}} z4Cannot combine element of type %s with ParserElementrq)rN) rzrr$rQrrrrr)rrrwrwrx__or__ss    zParserElement.__or__cCsBt|trtj|}t|ts:tjdt|tdddS||BS)z] Implementation of | operator when left operand is not a C{L{ParserElement}} z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__ror__s    zParserElement.__ror__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zA Implementation of ^ operator - returns C{L{Or}} z4Cannot combine element of type %s with ParserElementrq)rN) rzrr$rQrrrrr)rrrwrwrx__xor__s    zParserElement.__xor__cCsBt|trtj|}t|ts:tjdt|tdddS||AS)z] Implementation of ^ operator when left operand is not a C{L{ParserElement}} z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rxor__s    zParserElement.__rxor__cCsFt|trtj|}t|ts:tjdt|tdddSt||gS)zC Implementation of & operator - returns C{L{Each}} z4Cannot combine element of type %s with ParserElementrq)rN) rzrr$rQrrrrr )rrrwrwrx__and__s    zParserElement.__and__cCsBt|trtj|}t|ts:tjdt|tdddS||@S)z] Implementation of & operator when left operand is not a C{L{ParserElement}} z4Cannot combine element of type %s with ParserElementrq)rN)rzrr$rQrrrr)rrrwrwrx__rand__s    zParserElement.__rand__cCst|S)zE Implementation of ~ operator - returns C{L{NotAny}} )r)rrwrwrx __invert__szParserElement.__invert__cCs|dk r|j|S|jSdS)a  Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be passed as C{True}. If C{name} is omitted, same as calling C{L{copy}}. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") N)rmr)rrrwrwrx__call__s zParserElement.__call__cCst|S)z Suppresses the output of this C{ParserElement}; useful to keep punctuation from cluttering up returned output. )r+)rrwrwrxsuppressszParserElement.suppresscCs d|_|S)a Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. F)rX)rrwrwrxleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8 Overrides the default whitespace chars TF)rXrYrZ)rrOrwrwrxsetWhitespaceCharssz ParserElement.setWhitespaceCharscCs d|_|S)z Overrides default behavior to expand C{}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{} characters. T)r\)rrwrwrx parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|jj|n|jjt|j|S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] )rzrr+r]rr)rrrwrwrxignores   zParserElement.ignorecCs"|pt|p t|ptf|_d|_|S)zT Enable display of debugging messages while doing pattern matching. T)r/r2r4rcr^)rZ startActionZ successActionZexceptionActionrwrwrxsetDebugActions s  zParserElement.setDebugActionscCs|r|jtttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set C{flag} to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using L{setDebugActions}. Prior to attempting to match the C{wd} expression, the debugging message C{"Match at loc (,)"} is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. F)rr/r2r4r^)rflagrwrwrxsetDebugs#zParserElement.setDebugcCs|jS)N)r)rrwrwrxr@szParserElement.__str__cCst|S)N)r)rrwrwrxrCszParserElement.__repr__cCsd|_d|_|S)NT)r_rU)rrwrwrxrFszParserElement.streamlinecCsdS)Nrw)rrrwrwrxcheckRecursionKszParserElement.checkRecursioncCs|jgdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)r)r validateTracerwrwrxvalidateNszParserElement.validatecCsy |j}Wn2tk r>t|d}|j}WdQRXYnXy |j||Stk r|}ztjrhn|WYdd}~XnXdS)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rN)readropenrrr$r)rZfile_or_filenamerZ file_contentsfr3rwrwrx parseFileTs   zParserElement.parseFilecsHt|tr"||kp t|t|kSt|tr6|j|Stt||kSdS)N)rzr$varsrrsuper)rr)rHrwrx__eq__hs    zParserElement.__eq__cCs ||k S)Nrw)rrrwrwrx__ne__pszParserElement.__ne__cCs tt|S)N)hashid)rrwrwrx__hash__sszParserElement.__hash__cCs||kS)Nrw)rrrwrwrx__req__vszParserElement.__req__cCs ||k S)Nrw)rrrwrwrx__rne__yszParserElement.__rne__c Cs0y|jt||ddStk r*dSXdS)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests Example:: expr = Word(nums) assert expr.matches("100") )rTFN)rrr)rZ testStringrrwrwrxr|s zParserElement.matches#cCst|tr"tttj|jj}t|tr4t|}g}g}d} x|D]} |dk rb|j | dsl|rx| rx|j | qH| s~qHdj || g} g}y:| j dd} |j | |d} | j | j|d| o| } Wntk rx} zt| trdnd }d| kr0| j t| j| | j d t| j| d d |n| j d | jd || j d t| | ob|} | } WYdd} ~ XnDtk r}z&| j dt|| o|} |} WYdd}~XnX|r|r| j d tdj | |j | | fqHW| |fS)a3 Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - comment - (default=C{'#'}) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default=C{True}) prints test output to stdout - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if C{failureTests} is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) TNFrz\n)r)r z(FATAL)r rr^zFAIL: zFAIL-EXCEPTION: )rzrrrvr{rrstrip splitlinesrrrrrrrrr!rGrr9rKr,)rZtestsrZcommentZfullDumpZ printResultsZ failureTestsZ allResultsZcommentssuccessrvr resultrrzr3rwrwrxrunTestssNW     $   zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)TrTTF)OrrrrrNr staticmethodrPrRrrrirmrurrxr~rrrrrrrrrrrrrrrrrrtrrrr_MAX_INTrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr __classcell__rwrw)rHrxr$8s     &     H   " 2G+    D           )    cs eZdZdZfddZZS)r,zT Abstract C{ParserElement} subclass, for defining atomic matching patterns. cstt|jdddS)NF)rg)rr,r)r)rHrwrxr szToken.__init__)rrrrrrrwrw)rHrxr, scs eZdZdZfddZZS)r z, An empty token, will always match. cs$tt|jd|_d|_d|_dS)Nr TF)rr rrr[r`)r)rHrwrxr szEmpty.__init__)rrrrrrrwrw)rHrxr  scs*eZdZdZfddZdddZZS)rz( A token that will never match. cs*tt|jd|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrr[r`ra)r)rHrwrxr* s zNoMatch.__init__TcCst|||j|dS)N)rra)rr-rrorwrwrxr1 szNoMatch.parseImpl)T)rrrrrrrrwrw)rHrxr& s cs*eZdZdZfddZdddZZS)ra Token to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use L{CaselessLiteral}. For keyword matching (force word break before and after the matched string), use L{Keyword} or L{CaselessKeyword}. c stt|j||_t||_y|d|_Wn*tk rVtj dt ddt |_ YnXdt |j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrq)rz"%s"z Expected F)rrrmatchrmatchLenfirstMatchCharrrrrr rHrrrar[r`)r matchString)rHrwrxrC s    zLiteral.__init__TcCsJ|||jkr6|jdks&|j|j|r6||j|jfSt|||j|dS)Nrr)rr startswithrrra)rr-rrorwrwrxrV szLiteral.parseImpl)T)rrrrrrrrwrw)rHrxr5 s  csLeZdZdZedZdfdd Zddd Zfd d Ze d d Z Z S)ra\ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with C{L{Literal}}: - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} Accepts two optional constructor arguments in addition to the keyword string: - C{identChars} is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - C{caseless} allows case-insensitive matching, default is C{False}. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use L{CaselessKeyword}. z_$NFc stt|j|dkrtj}||_t||_y|d|_Wn$tk r^t j dt ddYnXd|j|_ d|j |_ d|_d|_||_|r|j|_|j}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrq)rz"%s"z Expected F)rrrDEFAULT_KEYWORD_CHARSrrrrrrrrrrar[r`caselessupper caselessmatchr identChars)rrrr)rHrwrxrq s&    zKeyword.__init__TcCs|jr|||||jj|jkr|t||jksL|||jj|jkr|dksj||dj|jkr||j|jfSnv|||jkr|jdks|j|j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt |||j |dS)Nrrr) rrrrrrrrrrra)rr-rrorwrwrxr s*&zKeyword.parseImplcstt|j}tj|_|S)N)rrrrr)rr)rHrwrxr sz Keyword.copycCs |t_dS)z,Overrides the default Keyword chars N)rr)rOrwrwrxsetDefaultKeywordChars szKeyword.setDefaultKeywordChars)NF)T) rrrrr3rrrrrrrrwrw)rHrxr^ s   cs*eZdZdZfddZdddZZS)ral Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for L{CaselessKeyword}.) cs6tt|j|j||_d|j|_d|j|_dS)Nz'%s'z Expected )rrrr returnStringrra)rr)rHrwrxr s zCaselessLiteral.__init__TcCs@||||jj|jkr,||j|jfSt|||j|dS)N)rrrrrra)rr-rrorwrwrxr szCaselessLiteral.parseImpl)T)rrrrrrrrwrw)rHrxr s  cs,eZdZdZdfdd Zd ddZZS) rz Caseless version of L{Keyword}. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for L{CaselessLiteral}.) Ncstt|j||dddS)NT)r)rrr)rrr)rHrwrxr szCaselessKeyword.__init__TcCsj||||jj|jkrV|t||jksF|||jj|jkrV||j|jfSt|||j|dS)N)rrrrrrrra)rr-rrorwrwrxr s*zCaselessKeyword.parseImpl)N)T)rrrrrrrrwrw)rHrxr scs,eZdZdZdfdd Zd ddZZS) rlax A variation on L{Literal} which matches "close" matches, that is, strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - C{match_string} - string to be matched - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - C{mismatches} - a list of the positions within the match_string where mismatches were found - C{original} - the original match_string used to compare against the input string If C{mismatches} is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) rrcsBtt|j||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F) rrlrr match_string maxMismatchesrar`r[)rrr)rHrwrxr szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g} |j} xtt||||jD]0\}} | \} } | | krP| j|t| | krPPqPW|d}t|||g}|j|d<| |d<||fSt|||j|dS)Nrrroriginal mismatches) rrrrrrr"rra)rr-rrostartrmaxlocrZmatch_stringlocrrZs_msrcmatresultsrwrwrxr s("   zCloseMatch.parseImpl)rr)T)rrrrrrrrwrw)rHrxrl s cs8eZdZdZd fdd Zdd d Zfd d ZZS)r/a Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. An optional C{excludeChars} parameter can list characters that might be found in the input C{bodyChars} string; useful to define a word of all printables except for one or two characters, for instance. L{srange} is useful for defining custom character set strings for defining C{Word} expressions, using range notation from regular expression character sets. A common mistake is to use C{Word} to match a specific literal string, as in C{Word("Address")}. Remember that C{Word} uses the string argument to define I{sets} of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use L{Literal} or L{Keyword}. pyparsing includes helper strings for building Words: - L{alphas} - L{nums} - L{alphanums} - L{hexnums} - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - L{printables} (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") NrrrFc stt|jrFdjfdd|D}|rFdjfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_ |dkrt d||_ |dkr||_ nt |_ |dkr||_ ||_ t||_d|j|_d |_||_d |j|jkr|dkr|dkr|dkr|j|jkr8d t|j|_nHt|jdkrfd tj|jt|jf|_nd t|jt|jf|_|jrd|jd|_ytj|j|_Wntk rd|_YnXdS)Nrc3s|]}|kr|VqdS)Nrw)rr) excludeCharsrwrxr7 sz Word.__init__..c3s|]}|kr|VqdS)Nrw)rr)rrwrxr9 srrrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedz Expected Frz[%s]+z%s[%s]*z [%s][%s]*z\b)rr/rr initCharsOrigr initChars bodyCharsOrig bodyChars maxSpecifiedrminLenmaxLenrrrrar` asKeyword_escapeRegexRangeCharsreStringrrdescapecompilerK)rrrminmaxexactrr)rH)rrxr4 sT      0 z Word.__init__Tc CsD|jr<|jj||}|s(t|||j||j}||jfS|||jkrZt|||j||}|d7}t|}|j}||j }t ||}x ||kr|||kr|d7}qWd} |||j krd} |j r||kr|||krd} |j r|dkr||d|ks||kr|||krd} | r4t|||j|||||fS)NrrFTr)rdrrraendgrouprrrrr rrr) rr-rrorrrZ bodycharsrZthrowExceptionrwrwrxrj s6    4zWord.parseImplc stytt|jStk r"YnX|jdkrndd}|j|jkr^d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)Nz...)r)rrwrwrx charsAsStr s z Word.__str__..charsAsStrz W:(%s,%s)zW:(%s))rr/rrKrUrr)rr)rHrwrxr s  z Word.__str__)NrrrrFN)T)rrrrrrrrrwrw)rHrxr/ s.6 #csFeZdZdZeejdZd fdd Zd ddZ fd d Z Z S) r'a Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module. If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") z[A-Z]rc stt|jt|tr|s,tjdtdd||_||_ yt j |j|j |_ |j|_ Wqt jk rtjd|tddYqXn2t|tjr||_ t||_|_ ||_ ntdt||_d|j|_d|_d|_d S) zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrq)rz$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectz Expected FTN)rr'rrzrrrrpatternflagsrdr r sre_constantserrorcompiledREtyper{rrrrar`r[)rrr)rHrwrxr s.         zRegex.__init__TcCsd|jj||}|s"t|||j||j}|j}t|j}|r\x|D]}||||<qHW||fS)N)rdrrrar groupdictr"r)rr-rrordrrrwrwrxr s  zRegex.parseImplc sDytt|jStk r"YnX|jdkr>dt|j|_|jS)NzRe:(%s))rr'rrKrUrr)r)rHrwrxr s z Regex.__str__)r)T) rrrrrrdr rrrrrrwrw)rHrxr' s  " cs8eZdZdZd fdd Zd ddZfd d ZZS) r%a Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=C{None}) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] NFTc sNttj|j}|s0tjdtddt|dkr>|}n"|j}|s`tjdtddt|_t |_ |d_ |_ t |_ |_|_|_|_|rtjtjB_dtjjtj d|dk rt|pdf_n.)z|(?:%s)z|(?:%s.)z(.)z)*%sz$invalid pattern (%s) passed to Regexz Expected FTrs)%rr%rrrrr SyntaxError quoteCharr quoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesrd MULTILINEDOTALLrr rrrrescCharReplacePatternr rrrrrrar`r[)rrr r!Z multiliner"rr#)rH)rrxr sf       6     zQuotedString.__init__c Cs|||jkr|jj||pd}|s4t|||j||j}|j}|jr||j|j }t |t rd|kr|j rddddd}x |j D]\}}|j||}qW|jrtj|jd|}|jr|j|j|j}||fS)N\ r  )z\tz\nz\fz\rz\g<1>)rrdrrrarrr"rrrzrr#rrr rr&r!r) rr-rrorrZws_mapZwslitZwscharrwrwrxrG s(  zQuotedString.parseImplc sFytt|jStk r"YnX|jdkr@d|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr%rrKrUrr)r)rHrwrxrj s zQuotedString.__str__)NNFTNT)T)rrrrrrrrrwrw)rHrxr% sA #cs8eZdZdZd fdd Zd ddZfd d ZZS) r a Token for matching words composed of characters I{not} in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] rrrcstt|jd|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t ||_ d|j |_ |jdk|_ d|_ dS)NFrrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrz Expected )rr rrXnotCharsrrrrrrrar[r`)rr+r r r )rHrwrxr s    zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}x ||krd|||krd|d7}qFW|||jkrt|||j|||||fS)Nrr)r+rrar rrr)rr-rrorZnotcharsmaxlenrwrwrxr s   zCharsNotIn.parseImplc sdytt|jStk r"YnX|jdkr^t|jdkrRd|jdd|_n d|j|_|jS)Nrz !W:(%s...)z!W:(%s))rr rrKrUrr+)r)rHrwrxr s  zCharsNotIn.__str__)rrrr)T)rrrrrrrrrwrw)rHrxr v s cs<eZdZdZddddddZdfd d ZdddZZS)r.a Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is C{" \t\r\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, as defined for the C{L{Word}} class. zzzzz)rr(rr*r) rrrcsttj|_jdjfddjDdjddjD_d_dj_ |_ |dkrt|_ nt _ |dkr|_ |_ dS)Nrc3s|]}|jkr|VqdS)N) matchWhite)rr)rrwrxr sz!White.__init__..css|]}tj|VqdS)N)r. whiteStrs)rrrwrwrxr sTz Expected r) rr.rr.rrrYrr[rarrr)rZwsr r r )rH)rrxr s  zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}x"||krd|||jkrd|d7}qDW|||jkrt|||j|||||fS)Nrr)r.rrarr rr)rr-rrorrrwrwrxr s  zWhite.parseImpl)r-rrrr)T)rrrrr/rrrrwrw)rHrxr. scseZdZfddZZS)_PositionTokencs(tt|j|jj|_d|_d|_dS)NTF)rr0rrHrrr[r`)r)rHrwrxr s z_PositionToken.__init__)rrrrrrwrw)rHrxr0 sr0cs2eZdZdZfddZddZd ddZZS) rzb Token to advance to a specific column of input text; useful for tabular report scraping. cstt|j||_dS)N)rrrr9)rcolno)rHrwrxr szGoToColumn.__init__cCs`t|||jkr\t|}|jr*|j||}x0||krZ||jrZt|||jkrZ|d7}q,W|S)Nrr)r9rr]risspace)rr-rrrwrwrxr s & zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected column)r9r)rr-rroZthiscolZnewlocrrwrwrxr s    zGoToColumn.parseImpl)T)rrrrrrrrrwrw)rHrxr s  cs*eZdZdZfddZdddZZS)ra Matches if current position is at the beginning of a line within the parse string Example:: test = ''' AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) Prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cstt|jd|_dS)NzExpected start of line)rrrra)r)rHrwrxr& szLineStart.__init__TcCs*t||dkr|gfSt|||j|dS)Nrr)r9rra)rr-rrorwrwrxr* szLineStart.parseImpl)T)rrrrrrrrwrw)rHrxr s cs*eZdZdZfddZdddZZS)rzU Matches if current position is at the end of a line within the parse string cs,tt|j|jtjjddd|_dS)NrrzExpected end of line)rrrrr$rNrra)r)rHrwrxr3 szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nrrr)rrra)rr-rrorwrwrxr8 s     zLineEnd.parseImpl)T)rrrrrrrrwrw)rHrxr/ s cs*eZdZdZfddZdddZZS)r*zM Matches if current position is at the beginning of the parse string cstt|jd|_dS)NzExpected start of text)rr*rra)r)rHrwrxrG szStringStart.__init__TcCs0|dkr(||j|dkr(t|||j||gfS)Nr)rrra)rr-rrorwrwrxrK szStringStart.parseImpl)T)rrrrrrrrwrw)rHrxr*C s cs*eZdZdZfddZdddZZS)r)zG Matches if current position is at the end of the parse string cstt|jd|_dS)NzExpected end of text)rr)rra)r)rHrwrxrV szStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dS)Nrr)rrra)rr-rrorwrwrxrZ s    zStringEnd.parseImpl)T)rrrrrrrrwrw)rHrxr)R s cs.eZdZdZeffdd ZdddZZS)r1ap Matches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of the string being parsed, or at the beginning of a line. cs"tt|jt||_d|_dS)NzNot at the start of a word)rr1rr wordCharsra)rr3)rHrwrxrl s zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfS)Nrrr)r3rra)rr-rrorwrwrxrq s zWordStart.parseImpl)T)rrrrrVrrrrwrw)rHrxr1d scs.eZdZdZeffdd ZdddZZS)r0aZ Matches if the current position is at the end of a Word, and is not followed by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of the string being parsed, or at the end of a line. cs(tt|jt||_d|_d|_dS)NFzNot at the end of a word)rr0rrr3rXra)rr3)rHrwrxr s zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfS)Nrrr)rr3rra)rr-rrorrwrwrxr s zWordEnd.parseImpl)T)rrrrrVrrrrwrw)rHrxr0x scseZdZdZdfdd ZddZddZd d Zfd d Zfd dZ fddZ dfdd Z gfddZ fddZ ZS)r z^ Abstract subclass of ParserElement, for combining and post-processing parsed tokens. Fc stt|j|t|tr"t|}t|tr.F)rr rrzrrrr$rQexprsrIterableallrvrre)rr4rg)rHrwrxr s     zParseExpression.__init__cCs |j|S)N)r4)rrrwrwrxr szParseExpression.__getitem__cCs|jj|d|_|S)N)r4rrU)rrrwrwrxr s zParseExpression.appendcCs4d|_dd|jD|_x|jD] }|jq W|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on all contained expressions.FcSsg|] }|jqSrw)r)rrrwrwrxr sz3ParseExpression.leaveWhitespace..)rXr4r)rrrwrwrxr s   zParseExpression.leaveWhitespacecszt|trF||jkrvtt|j|xP|jD]}|j|jdq,Wn0tt|j|x|jD]}|j|jdq^W|S)Nrrrsrs)rzr+r]rr rr4)rrr)rHrwrxr s    zParseExpression.ignorec sLytt|jStk r"YnX|jdkrFd|jjt|jf|_|jS)Nz%s:(%s)) rr rrKrUrHrrr4)r)rHrwrxr s zParseExpression.__str__cs0tt|jx|jD] }|jqWt|jdkr|jd}t||jr|j r|jdkr|j r|jdd|jdg|_d|_ |j |j O_ |j |j O_ |jd}t||jo|j o|jdko|j r|jdd|jdd|_d|_ |j |j O_ |j |j O_ dt ||_|S)Nrqrrrz Expected rsrs)rr rr4rrzrHrSrVr^rUr[r`rra)rrr)rHrwrxr s0         zParseExpression.streamlinecstt|j||}|S)N)rr rm)rrrlr)rHrwrxrm szParseExpression.setResultsNamecCs:|dd|g}x|jD]}|j|qW|jgdS)N)r4rr)rrtmprrwrwrxr s zParseExpression.validatecs$tt|j}dd|jD|_|S)NcSsg|] }|jqSrw)r)rrrwrwrxr sz(ParseExpression.copy..)rr rr4)rr)rHrwrxr szParseExpression.copy)F)F)rrrrrrrrrrrrmrrrrwrw)rHrxr s " csTeZdZdZGdddeZdfdd ZdddZd d Zd d Z d dZ Z S)ra  Requires all given C{ParseExpression}s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the C{'+'} operator. May also be constructed using the C{'-'} operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"),name_expr("name"),integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|jdS)N-)rrrrrr)rrr)rHrwrxr szAnd._ErrorStop.__init__)rrrrrrwrw)rHrxr srTcsRtt|j||tdd|jD|_|j|jdj|jdj|_d|_ dS)Ncss|] }|jVqdS)N)r[)rrrwrwrxr szAnd.__init__..rT) rrrr6r4r[rrYrXre)rr4rg)rHrwrxr s z And.__init__c Cs|jdj|||dd\}}d}x|jddD]}t|tjrFd}q0|ry|j|||\}}Wqtk rvYqtk r}zd|_tj|WYdd}~Xqt k rt|t ||j |YqXn|j|||\}}|s|j r0||7}q0W||fS)NrF)rprrT) r4rtrzrrr#r __traceback__rrrrar) rr-rro resultlistZ errorStoprZ exprtokensrrwrwrxr s(   z And.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrxr5 s  z And.__iadd__cCs8|dd|g}x |jD]}|j||jsPqWdS)N)r4rr[)rrsubRecCheckListrrwrwrxr: s   zAnd.checkRecursioncCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nr{rcss|]}t|VqdS)N)r)rrrwrwrxrF szAnd.__str__..})rrrUrr4)rrwrwrxrA s    z And.__str__)T)T) rrrrr rrrrrrrrwrw)rHrxr s csDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the C{'^'} operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Fcs:tt|j|||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdS)N)r[)rrrwrwrxr\ szOr.__init__..T)rrrr4rr[)rr4rg)rHrwrxrY sz Or.__init__Tc CsTd}d}g}x|jD]}y|j||}Wnvtk rd} z d| _| j|krT| }| j}WYdd} ~ Xqtk rt||krt|t||j|}t|}YqX|j||fqW|r*|j dddx`|D]X\} }y|j |||Stk r$} z"d| _| j|kr| }| j}WYdd} ~ XqXqW|dk rB|j|_ |nt||d|dS)NrrcSs |d S)Nrrw)xrwrwrxryu szOr.parseImpl..)rz no defined alternatives to matchrs) r4rrr9rrrrarsortrtr) rr-rro maxExcLoc maxExceptionrrZloc2r_rwrwrxr` s<     z Or.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrx__ixor__ s  z Or.__ixor__cCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z ^ css|]}t|VqdS)N)r)rrrwrwrxr szOr.__str__..r=)rrrUrr4)rrwrwrxr s    z Or.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxr s zOr.checkRecursion)F)T) rrrrrrrCrrrrwrw)rHrxrK s   & csDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Fcs:tt|j|||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdS)N)r[)rrrwrwrxr sz&MatchFirst.__init__..T)rrrr4rr[)rr4rg)rHrwrxr szMatchFirst.__init__Tc Csd}d}x|jD]}y|j|||}|Stk r\}z|j|krL|}|j}WYdd}~Xqtk rt||krt|t||j|}t|}YqXqW|dk r|j|_|nt||d|dS)Nrrz no defined alternatives to matchrs)r4rtrrrrrar) rr-rror@rArrrrwrwrxr s$   zMatchFirst.parseImplcCst|trtj|}|j|S)N)rzrr$rQr)rrrwrwrx__ior__ s  zMatchFirst.__ior__cCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z | css|]}t|VqdS)N)r)rrrwrwrxr sz%MatchFirst.__str__..r=)rrrUrr4)rrwrwrxr s    zMatchFirst.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxr s zMatchFirst.checkRecursion)F)T) rrrrrrrDrrrrwrw)rHrxr s   cs<eZdZdZd fdd Zd ddZddZd d ZZS) r am Requires all given C{ParseExpression}s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the C{'&'} operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Tcs8tt|j||tdd|jD|_d|_d|_dS)Ncss|] }|jVqdS)N)r[)rrrwrwrxrsz Each.__init__..T)rr rr6r4r[rXinitExprGroups)rr4rg)rHrwrxrsz Each.__init__c s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d |_|}|jdd}|jddg}d } x| rp||j|j} g} x~| D]v} y| j||}Wn t k r| j | YqX|j |jj t | | | |krD|j | q| krj | qWt| t| krd } qW|rd jd d|D} t ||d | |fdd|jD7}g}x*|D]"} | j|||\}}|j |qWt|tg}||fS)Ncss&|]}t|trt|j|fVqdS)N)rzrrr.)rrrwrwrxrsz!Each.parseImpl..cSsg|]}t|tr|jqSrw)rzrr.)rrrwrwrxrsz"Each.parseImpl..cSs"g|]}|jrt|t r|qSrw)r[rzr)rrrwrwrxrscSsg|]}t|tr|jqSrw)rzr2r.)rrrwrwrxr scSsg|]}t|tr|jqSrw)rzrr.)rrrwrwrxr!scSs g|]}t|tttfs|qSrw)rzrr2r)rrrwrwrxr"sFTz, css|]}t|VqdS)N)r)rrrwrwrxr=sz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSrw)rzrr.)rr)tmpOptrwrxrAs)rErr4Zopt1mapZ optionalsZmultioptionalsZ multirequiredZrequiredrrrrrremoverrrtsumr")rr-rroZopt1Zopt2ZtmpLocZtmpReqdZ matchOrderZ keepMatchingZtmpExprsZfailedrZmissingr:rZ finalResultsrw)rFrxrsP     zEach.parseImplcCs@t|dr|jS|jdkr:ddjdd|jDd|_|jS)Nrr<z & css|]}t|VqdS)N)r)rrrwrwrxrPszEach.__str__..r=)rrrUrr4)rrwrwrxrKs    z Each.__str__cCs0|dd|g}x|jD]}|j|qWdS)N)r4r)rrr;rrwrwrxrTs zEach.checkRecursion)T)T) rrrrrrrrrrwrw)rHrxr s 5 1 csleZdZdZdfdd ZdddZdd Zfd d Zfd d ZddZ gfddZ fddZ Z S)rza Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. Fcstt|j|t|tr@ttjtr2tj|}ntjt |}||_ d|_ |dk r|j |_ |j |_ |j|j|j|_|j|_|j|_|jj|jdS)N)rrrrzr issubclassr$rQr,rr.rUr`r[rrYrXrWrer]r)rr.rg)rHrwrxr^s    zParseElementEnhance.__init__TcCs2|jdk r|jj|||ddStd||j|dS)NF)rpr)r.rtrra)rr-rrorwrwrxrps zParseElementEnhance.parseImplcCs*d|_|jj|_|jdk r&|jj|S)NF)rXr.rr)rrwrwrxrvs    z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|j||jdk rn|jj|jdn,tt|j||jdk rn|jj|jd|S)Nrrrsrs)rzr+r]rrrr.)rr)rHrwrxr}s    zParseElementEnhance.ignorecs&tt|j|jdk r"|jj|S)N)rrrr.)r)rHrwrxrs  zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk r>|jj|dS)N)r&r.r)rrr;rwrwrxrs  z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdk r(|jj||jgdS)N)r.rr)rrr7rwrwrxrs  zParseElementEnhance.validatec sVytt|jStk r"YnX|jdkrP|jdk rPd|jjt|jf|_|jS)Nz%s:(%s)) rrrrKrUr.rHrr)r)rHrwrxrszParseElementEnhance.__str__)F)T) rrrrrrrrrrrrrrwrw)rHrxrZs   cs*eZdZdZfddZdddZZS)ra Lookahead matching of the given parse expression. C{FollowedBy} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. C{FollowedBy} always returns a null token list. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cstt|j|d|_dS)NT)rrrr[)rr.)rHrwrxrszFollowedBy.__init__TcCs|jj|||gfS)N)r.r)rr-rrorwrwrxrszFollowedBy.parseImpl)T)rrrrrrrrwrw)rHrxrs cs2eZdZdZfddZd ddZddZZS) ra Lookahead to disallow matching with the given parse expression. C{NotAny} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression does I{not} match at the current position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} always returns a null token list. May be constructed using the '~' operator. Example:: cs0tt|j|d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrrXr[rr.ra)rr.)rHrwrxrszNotAny.__init__TcCs&|jj||rt|||j||gfS)N)r.rrra)rr-rrorwrwrxrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{r=)rrrUrr.)rrwrwrxrs   zNotAny.__str__)T)rrrrrrrrrwrw)rHrxrs   cs(eZdZdfdd ZdddZZS) _MultipleMatchNcsFtt|j|d|_|}t|tr.tj|}|dk r<|nd|_dS)NT) rrJrrWrzrr$rQ not_ender)rr.stopOnZender)rHrwrxrs   z_MultipleMatch.__init__Tc Cs|jj}|j}|jdk }|r$|jj}|r2|||||||dd\}}yZ|j } xJ|rb|||| rr|||} n|} ||| |\}} | s| jrT|| 7}qTWWnttfk rYnX||fS)NF)rp) r.rtrrKrr]rrr) rr-rroZself_expr_parseZself_skip_ignorablesZ check_enderZ try_not_enderrZhasIgnoreExprsrZ tmptokensrwrwrxrs,      z_MultipleMatch.parseImpl)N)T)rrrrrrrwrw)rHrxrJsrJc@seZdZdZddZdS)ra Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrr<z}...)rrrUrr.)rrwrwrxr!s   zOneOrMore.__str__N)rrrrrrwrwrwrxrscs8eZdZdZd fdd Zd fdd Zdd ZZS) r2aw Optional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to L{OneOrMore} Ncstt|j||dd|_dS)N)rLT)rr2rr[)rr.rL)rHrwrxr6szZeroOrMore.__init__Tc s6ytt|j|||Sttfk r0|gfSXdS)N)rr2rrr)rr-rro)rHrwrxr:szZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz]...)rrrUrr.)rrwrwrxr@s   zZeroOrMore.__str__)N)T)rrrrrrrrrwrw)rHrxr2*s c@s eZdZddZeZddZdS) _NullTokencCsdS)NFrw)rrwrwrxrJsz_NullToken.__bool__cCsdS)Nrrw)rrwrwrxrMsz_NullToken.__str__N)rrrrr'rrwrwrwrxrMIsrMcs6eZdZdZeffdd Zd ddZddZZS) raa Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cs.tt|j|dd|jj|_||_d|_dS)NF)rgT)rrrr.rWrr[)rr.r)rHrwrxrts zOptional.__init__Tc Cszy|jj|||dd\}}WnTttfk rp|jtk rh|jjr^t|jg}|j||jj<ql|jg}ng}YnX||fS)NF)rp)r.rtrrr_optionalNotMatchedrVr")rr-rrorrwrwrxrzs    zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrr )rrrUrr.)rrwrwrxrs   zOptional.__str__)T) rrrrrNrrrrrwrw)rHrxrQs" cs,eZdZdZd fdd Zd ddZZS) r(a Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default=C{False}) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default=C{None}) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default=C{None}) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor FNcs`tt|j|||_d|_d|_||_d|_t|t rFt j ||_ n||_ dt |j|_dS)NTFzNo match found for )rr(r ignoreExprr[r` includeMatchrrzrr$rQfailOnrr.ra)rrincluderrQ)rHrwrxrs zSkipTo.__init__Tc Cs,|}t|}|j}|jj}|jdk r,|jjnd}|jdk rB|jjnd} |} x| |kr|dk rh||| rhP| dk rx*y| || } Wqrtk rPYqrXqrWy||| dddWn tt fk r| d7} YqLXPqLWt|||j || }|||} t | } |j r$||||dd\}} | | 7} || fS)NF)rorprr)rp) rr.rtrQrrOrrrrrar"rP)rr-rror0rr.Z expr_parseZself_failOn_canParseNextZself_ignoreExpr_tryParseZtmplocZskiptextZ skipresultrrwrwrxrs<    zSkipTo.parseImpl)FNN)T)rrrrrrrrwrw)rHrxr(s6 csbeZdZdZdfdd ZddZddZd d Zd d Zgfd dZ ddZ fddZ Z S)raK Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator. Note: take care when assigning to C{Forward} not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the C{Forward}:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See L{ParseResults.pprint} for an example of a recursive parser created using C{Forward}. Ncstt|j|dddS)NF)rg)rrr)rr)rHrwrxrszForward.__init__cCsjt|trtj|}||_d|_|jj|_|jj|_|j|jj |jj |_ |jj |_ |j j |jj |S)N)rzrr$rQr.rUr`r[rrYrXrWr]r)rrrwrwrx __lshift__s      zForward.__lshift__cCs||>S)Nrw)rrrwrwrx __ilshift__'szForward.__ilshift__cCs d|_|S)NF)rX)rrwrwrxr*szForward.leaveWhitespacecCs$|js d|_|jdk r |jj|S)NT)r_r.r)rrwrwrxr.s   zForward.streamlinecCs>||kr0|dd|g}|jdk r0|jj||jgdS)N)r.rr)rrr7rwrwrxr5s   zForward.validatec Cs>t|dr|jS|jjdSd}Wd|j|_X|jjd|S)Nrz: ...Nonez: )rrrHrZ _revertClass_ForwardNoRecurser.r)rZ retStringrwrwrxr<s   zForward.__str__cs.|jdk rtt|jSt}||K}|SdS)N)r.rrr)rr)rHrwrxrMs  z Forward.copy)N) rrrrrrSrTrrrrrrrwrw)rHrxrs  c@seZdZddZdS)rVcCsdS)Nz...rw)rrwrwrxrVsz_ForwardNoRecurse.__str__N)rrrrrwrwrwrxrVUsrVcs"eZdZdZdfdd ZZS)r-zQ Abstract subclass of C{ParseExpression}, for converting parsed results. Fcstt|j|d|_dS)NF)rr-rrW)rr.rg)rHrwrxr]szTokenConverter.__init__)F)rrrrrrrwrw)rHrxr-Yscs6eZdZdZd fdd ZfddZdd ZZS) r a Converter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying C{'adjacent=False'} in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) rTcs8tt|j||r|j||_d|_||_d|_dS)NT)rr rradjacentrX joinStringre)rr.rXrW)rHrwrxrrszCombine.__init__cs(|jrtj||ntt|j||S)N)rWr$rrr )rr)rHrwrxr|szCombine.ignorecCsP|j}|dd=|tdj|j|jg|jd7}|jrH|jrH|gS|SdS)Nr)r)rr"rr rXrbrVr)rr-rrZretToksrwrwrxrs  "zCombine.postParse)rT)rrrrrrrrrwrw)rHrxr as cs(eZdZdZfddZddZZS)ra Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a,b,100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a,b,100")) # -> ['fn', ['a', 'b', '100']] cstt|j|d|_dS)NT)rrrrW)rr.)rHrwrxrszGroup.__init__cCs|gS)Nrw)rr-rrrwrwrxrszGroup.postParse)rrrrrrrrwrw)rHrxrs  cs(eZdZdZfddZddZZS)r aW Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at L{ParseResults} of accessing fields by results name. cstt|j|d|_dS)NT)rr rrW)rr.)rHrwrxrsz Dict.__init__cCsxt|D]\}}t|dkr q |d}t|trBt|dj}t|dkr^td|||<q t|dkrt|dt rt|d|||<q |j}|d=t|dkst|tr|j rt||||<q t|d|||<q W|j r|gS|SdS)Nrrrrrq) rrrzrurrrr"rrrV)rr-rrrtokZikeyZ dictvaluerwrwrxrs$   zDict.postParse)rrrrrrrrwrw)rHrxr s# c@s eZdZdZddZddZdS)r+aV Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also L{delimitedList}.) cCsgS)Nrw)rr-rrrwrwrxrszSuppress.postParsecCs|S)Nrw)rrwrwrxrszSuppress.suppressN)rrrrrrrwrwrwrxr+sc@s(eZdZdZddZddZddZdS) rzI Wrapper for parse actions, to ensure they are only called once. cCst||_d|_dS)NF)rMcallablecalled)rZ methodCallrwrwrxrs zOnlyOnce.__init__cCs.|js|j|||}d|_|St||ddS)NTr)r[rZr)rrr5rvrrwrwrxrs zOnlyOnce.__call__cCs d|_dS)NF)r[)rrwrwrxreset szOnlyOnce.resetN)rrrrrrr\rwrwrwrxrsc s:tfdd}y j|_Wntk r4YnX|S)as Decorator for debugging parse actions. When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) z<.z)rMrr)rr`rw)rrxrb s  ,FcCs`t|dt|dt|d}|rBt|t||j|S|tt||j|SdS)a Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing C{combine=True} in the constructor. If C{combine} is set to C{True}, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. Example:: delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z [rz]...N)rr r2rir+)r.ZdelimcombineZdlNamerwrwrxr@9s $csjtfdd}|dkr0ttjdd}n|j}|jd|j|dd|jd td S) a: Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs.|d}|r ttg|p&tt>gS)Nr)rrrC)rr5rvr) arrayExprr.rwrxcountFieldParseAction_s"z+countedArray..countFieldParseActionNcSs t|dS)Nr)ru)rvrwrwrxrydszcountedArray..ZarrayLenT)rfz(len) z...)rr/rRrrrirxr)r.ZintExprrdrw)rcr.rxr<Ls cCs:g}x0|D](}t|tr(|jt|q |j|q W|S)N)rzrrrr)Lrrrwrwrxrks   rcs6tfdd}|j|ddjdt|S)a* Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches a previous literal, will also match the leading C{"1:1"} in C{"1:10"}. If this is not desired, use C{matchPreviousExpr}. Do I{not} use with packrat parsing enabled. csP|rBt|dkr|d>qLt|j}tdd|D>n t>dS)Nrrrcss|]}t|VqdS)N)r)rttrwrwrxrszDmatchPreviousLiteral..copyTokenToRepeater..)rrrrr )rr5rvZtflat)reprwrxcopyTokenToRepeaters   z1matchPreviousLiteral..copyTokenToRepeaterT)rfz(prev) )rrxrir)r.rhrw)rgrxrOts  csFt|j}|Kfdd}|j|ddjdt|S)aS Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches by expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; the expressions are evaluated first, and then compared, so C{"1"} is compared with C{"10"}. Do I{not} use with packrat parsing enabled. cs*t|jfdd}j|dddS)Ncs$t|j}|kr tddddS)Nrr)rrr)rr5rvZ theseTokens) matchTokensrwrxmustMatchTheseTokenss zLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensT)rf)rrr)rr5rvrj)rg)rirxrhs  z.matchPreviousExpr..copyTokenToRepeaterT)rfz(prev) )rrrxrir)r.Ze2rhrw)rgrxrNs cCs>xdD]}|j|t|}qW|jdd}|jdd}t|S)Nz\^-]rz\nr(z\t)r_bslashr)rrrwrwrxrs    rTc s|rdd}dd}tndd}dd}tg}t|trF|j}n&t|tjr\t|}ntj dt dd|svt Sd }x|t |d kr||}xnt ||d d D]N\}} || |r|||d =Pq||| r|||d =|j|| | }PqW|d 7}q|W| r|ryht |t d j|krZtd d jdd|Djdj|Stdjdd|Djdj|SWn&tk rtj dt ddYnXtfdd|Djdj|S)a Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a C{L{MatchFirst}} for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default=C{False}) - treat all literals as caseless - useRegex - (default=C{True}) - as an optimization, will generate a Regex object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or if creating a C{Regex} raises an exception) Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] cSs|j|jkS)N)r)rbrwrwrxryszoneOf..cSs|jj|jS)N)rr)rrlrwrwrxryscSs||kS)Nrw)rrlrwrwrxryscSs |j|S)N)r)rrlrwrwrxrysz6Invalid argument to oneOf, expected string or iterablerq)rrrrNrz[%s]css|]}t|VqdS)N)r)rsymrwrwrxrszoneOf..z | |css|]}tj|VqdS)N)rdr )rrmrwrwrxrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdS)Nrw)rrm)parseElementClassrwrxrs)rrrzrrrr5rrrrrrrrrr'rirKr) ZstrsrZuseRegexZisequalZmasksZsymbolsrZcurrrrw)rorxrSsL         ((cCsttt||S)a Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the C{Dict} results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )r r2r)rrrwrwrxrAs!cCs^tjdd}|j}d|_|d||d}|r@dd}ndd}|j||j|_|S) a Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional C{asString} argument is passed as C{False}, then the return value is a C{L{ParseResults}} containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to C{L{originalTextFor}} contains expressions with defined results names, you must set C{asString} to C{False} if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|S)Nrw)rrrvrwrwrxry8sz!originalTextFor..F_original_start _original_endcSs||j|jS)N)rprq)rr5rvrwrwrxry=scSs&||jd|jdg|dd<dS)Nrprq)r)rr5rvrwrwrx extractText?sz$originalTextFor..extractText)r rrrer])r.ZasStringZ locMarkerZ endlocMarker matchExprrrrwrwrxrg s  cCst|jddS)zp Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dS)Nrrw)rvrwrwrxryJszungroup..)r-r)r.rwrwrxrhEscCs4tjdd}t|d|d|jjdS)a Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains C{} characters, you may want to call C{L{ParserElement.parseWithTabs}} Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|S)Nrw)rr5rvrwrwrxry`szlocatedExpr..Z locn_startrZlocn_end)r rrrr)r.ZlocatorrwrwrxrjLsz\[]-*.$+^?()~ )r cCs |ddS)Nrrrrw)rr5rvrwrwrxryksryz\\0?[xX][0-9a-fA-F]+cCstt|djddS)Nrz\0x)unichrrulstrip)rr5rvrwrwrxrylsz \\0[0-7]+cCstt|ddddS)Nrrr)ruru)rr5rvrwrwrxrymsz\])rr z\wr8rrZnegatebodyr c sBddy djfddtj|jDStk r<dSXdS)a Helper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as C{\-} or C{\]}) - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) (C{\0x##} is also supported for backwards compatibility) - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) cSs<t|ts|Sdjddtt|dt|ddDS)Nrcss|]}t|VqdS)N)ru)rrrwrwrxrsz+srange....rrr)rzr"rrord)prwrwrxryszsrange..rc3s|]}|VqdS)Nrw)rpart) _expandedrwrxrszsrange..N)r_reBracketExprrrxrK)rrw)r|rxr_rs  csfdd}|S)zt Helper method for defining parse actions that require matching at a specific column in the input text. cs"t||krt||ddS)Nzmatched token not at column %d)r9r)r)Zlocnr1)rrwrx verifyColsz!matchOnlyAtCol..verifyColrw)rr~rw)rrxrMs cs fddS)a Helper method for common parse actions that simply return a literal value. Especially useful when used with C{L{transformString}()}. Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgS)Nrw)rr5rv)replStrrwrxryszreplaceWith..rw)rrw)rrxr\s cCs|dddS)a Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rrrrsrw)rr5rvrwrwrxrZs c sNfdd}ytdtdj}Wntk rBt}YnX||_|S)aG Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the parsed data to an integer using base 16. Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] csfdd|DS)Ncsg|]}|fqSrwrw)rZtokn)rr6rwrxrsz(tokenMap..pa..rw)rr5rv)rr6rwrxr}sztokenMap..parrH)rJrrKr{)r6rr}rLrw)rr6rxrms cCs t|jS)N)rr)rvrwrwrxryscCs t|jS)N)rlower)rvrwrwrxryscCst|tr|}t|| d}n|j}tttd}|rtjj t }t d|dt t t|t d|tddgdjd j d d t d }nd jddtD}tjj t t|B}t d|dt t t|j ttt d|tddgdjd j dd t d }ttd|d }|jdd j|jddjjjd|}|jdd j|jddjjjd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag name)rz_-:rtag=/F)rrCcSs |ddkS)Nrrrw)rr5rvrwrwrxrysz_makeTags..rrcss|]}|dkr|VqdS)rNrw)rrrwrwrxrsz_makeTags..cSs |ddkS)Nrrrw)rr5rvrwrwrxryszrz)rzrrrr/r4r3r>rrrZr+r r2rrrmrrVrYrBr _Lrtitlerrir)tagStrZxmlZresnameZ tagAttrNameZ tagAttrValueZopenTagZprintablesLessRAbrackZcloseTagrwrwrx _makeTagss" T\..rcCs t|dS)a  Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> http://pyparsing.wikispaces.com F)r)rrwrwrxrKscCs t|dS)z Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to L{makeHTMLTags} T)r)rrwrwrxrLscs8|r|ddn|jddDfdd}|S)a< Helper to create a validating parse action to be used with start tags created with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSrwrw)rrrrwrwrxrQsz!withAttribute..cs^xXD]P\}}||kr&t||d||tjkr|||krt||d||||fqWdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')rre ANY_VALUE)rr5rZattrNameZ attrValue)attrsrwrxr}Rs zwithAttribute..pa)r)rZattrDictr}rw)rrxres 2 cCs|r d|nd}tf||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)re)Z classname namespaceZ classattrrwrwrxrk\s (rcCst}||||B}x`t|D]R\}}|d dd\}} } } | dkrTd|nd|} | dkr|dksxt|dkrtd|\} }tj| }| tjkrd| dkrt||t|t |}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkrZt|| |||t|| |||}ntd n| tj krH| dkrt |t st |}t|j |t||}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkr>t|| |||t|| |||}ntd ntd | r`|j| ||j| |BK}|}q"W||K}|S) a Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] Nrroz%s termz %s%s termrqz@if numterms=3, opExpr must be a tuple or list of two expressionsrrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)N)rrrrrirTLEFTrrrRIGHTrzrr.r)ZbaseExprZopListZlparZrparrZlastExprrZoperDefZopExprZarityZrightLeftAssocr}ZtermNameZopExpr1ZopExpr2ZthisExprrsrwrwrxrisR;    &       &   z4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dkr(t|to,t|tr t|dkrt|dkr|dk rtt|t||tjddj dd}n$t j t||tjj dd}nx|dk rtt|t |t |ttjddj dd}n4ttt |t |ttjddj d d}ntd t }|dk rb|tt|t||B|Bt|K}n$|tt|t||Bt|K}|jd ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrr)r cSs |djS)Nr)r)rvrwrwrxry9sznestedExpr..cSs |djS)Nr)r)rvrwrwrxry<scSs |djS)Nr)r)rvrwrwrxryBscSs |djS)Nr)r)rvrwrwrxryFszOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rrzrrr rr r$rNrrCrrrrr+r2ri)openerZcloserZcontentrOrrwrwrxrPs4:     *$c sfdd}fdd}fdd}ttjdj}ttj|jd}tj|jd }tj|jd } |rtt||t|t|t|| } n$tt|t|t|t|} |j t t| jd S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrrzillegal nestingznot a peer entryrsrs)rr9r!r)rr5rvcurCol) indentStackrwrxcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"j|n t||ddS)Nrrznot a subentryrs)r9rr)rr5rvr)rrwrxcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}o4|dko4|dksBt||djdS)Nrrrqznot an unindentrsr:)rr9rr)rr5rvr)rrwrx checkUnindents    z$indentedBlock..checkUnindentz INDENTrZUNINDENTzindented block) rrrrr rrirrrrk) ZblockStatementExprrrrrrr!rZPEERZUNDENTZsmExprrw)rrxrfQsN   ,z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prnz);zcommon HTML entitycCs tj|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprZentity)rvrwrwrxr[sz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style comment)rz commaItem)rc@seZdZdZeeZeeZe e j dj eZ e ej dj eedZedj dj eZej edej ej dZejd d eeeed jeBj d Zejeed j dj eZedj dj eZeeBeBjZedj dj eZe ededj dZedj dZ edj dZ!e!de!dj dZ"ee!de!d>dee!de!d?j dZ#e#j$d d d!e j d"Z%e&e"e%Be#Bj d#j d#Z'ed$j d%Z(e)d@d'd(Z*e)dAd*d+Z+ed,j d-Z,ed.j d/Z-ed0j d1Z.e/je0jBZ1e)d2d3Z2e&e3e4d4e5e e6d4d5ee7d6jj d7Z8e9ee:j;e8Bd8d9j d:Zd=S)Brna Here are some common low-level expressions that may be useful in jump-starting parser development: - numeric forms (L{integers}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrtz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrrrsrw)rvrwrwrxryszpyparsing_common.r8z"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberrB identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 addressrrBz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tjj|rdVqdS)rrN)rn _ipv6_partr)rrfrwrwrxrsz,pyparsing_common...rw)rH)rvrwrwrxrysz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] csLytj|djStk rF}zt||t|WYdd}~XnXdS)Nr)rstrptimeZdaterrr{)rr5rvve)fmtrwrxcvt_fnsz.pyparsing_common.convertToDate..cvt_fnrw)rrrw)rrx convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] csHytj|dStk rB}zt||t|WYdd}~XnXdS)Nr)rrrrr{)rr5rvr)rrwrxrsz2pyparsing_common.convertToDatetime..cvt_fnrw)rrrw)rrxconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstjj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rn_html_stripperr)rr5rrwrwrx stripHTMLTagss zpyparsing_common.stripHTMLTagsra)rz rr)rzcomma separated listcCs t|jS)N)rr)rvrwrwrxryscCs t|jS)N)rr)rvrwrwrxrysN)rrB)rrB)r)r)?rrrrrmruZconvertToIntegerfloatZconvertToFloatr/rRrirrrDrr'Zsigned_integerrrxrrZ mixed_integerrHrealZsci_realrnumberrr4r3rZ ipv4_addressrZ_full_ipv6_addressZ_short_ipv6_addressr~Z_mixed_ipv6_addressr Z ipv6_addressZ mac_addressrrrZ iso8601_dateZiso8601_datetimeuuidr7r6rrrrrrVr. _commasepitemr@rYrZcomma_separated_listrdrBrwrwrwrxrnsN"" 2   8__main__Zselectfromz_$r])rbcolumnsrjZtablesZcommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rq)raF)N)FT)T)r)T)r __version__Z__versionTime__ __author__rweakrefrrrr~rrdrrr"r<rr_threadr ImportErrorZ threadingrrZ ordereddict__all__r version_infor;rmaxsizerr{rchrrurrHrrreversedrrrr6r r rIZmaxintZxrangerZ __builtin__rZfnamerrJrrrrrrZascii_uppercaseZascii_lowercaser4rRrDr3rkrZ printablerVrKrrr!r#r&rr"MutableMappingregisterr9rJrGr/r2r4rQrMr$r,r rrrrQrrrrlr/r'r%r r.r0rrrr*r)r1r0r rrrr rrrrJrr2rMrNrr(rrVr-r rr r+rrbr@r<rrOrNrrSrArgrhrjrirCrIrHrar`rZ _escapedPuncZ_escapedHexCharZ_escapedOctCharUNICODEZ _singleCharZ _charRangermr}r_rMr\rZrmrdrBrrKrLrerrkrTrrrirUr>r^rYrcrPrfr5rWr7r6rrrrr;r[r8rErr]r?r=rFrXrrr:rnrZ selectTokenZ fromTokenZidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLrrrrrrrwrwrwrx=s                 8      @d &A= I G3pLOD|M &#@sQ,A,    I# %     &0 ,   ? #k Zr   (  0     "PK!ޅ&/command/__pycache__/setopt.cpython-36.opt-1.pycnu[3 vh@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd dZ dddZ Gdd d e ZGdd d eZdS)) convert_path)log)DistutilsOptionErrorN) configparser)Command config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjjtjjtjdS|dkrZtjdkrBdpDd}tjjtd |St d |d S) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)Zkinddotr/usr/lib/python3.6/setopt.pyrsFc Cs.tjd|tj}|j|gx|jD]\}}|dkrTtjd|||j|q*|j|svtjd|||j |x||jD]p\}}|dkrtjd||||j |||j |stjd|||j|qtjd|||||j |||qWq*Wtjd||s*t |d }|j|WdQRXdS) aYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sw)rdebugrZRawConfigParserreaditemsinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionoptionssetopenwrite) filenameZsettingsdry_runZoptsZsectionr"optionvaluefrrrr!s8            c@s2eZdZdZdddgZddgZd d Zd dZdS)r zr? descriptionr r@rAr6r;rSrrrrr ss )r )F)Zdistutils.utilrrrZdistutils.errorsrrZsetuptools.extern.six.movesrZ setuptoolsr__all__rrr r rrrrs        +'PK!'Ex%%2command/__pycache__/dist_info.cpython-36.opt-1.pycnu[3 vh@s8dZddlZddlmZddlmZGdddeZdS)zD Create a dist_info directory As defined in the wheel specification N)Command)logc@s.eZdZdZd gZddZddZd d Zd S) dist_infozcreate a .dist-info directory egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dS)N)egg_base)selfr /usr/lib/python3.6/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdS)Nr )r r r r finalize_optionsszdist_info.finalize_optionscCsn|jd}|j|_|j|j|jdtd d}tjdjt j j ||jd}|j |j|dS)Negg_infoz .egg-infoz .dist-infoz creating '{}' bdist_wheel) Zget_finalized_commandrr runrlenrinfoformatospathabspathZegg2dist)r rZ dist_info_dirrr r r rs  z dist_info.runN)rrr)__name__ __module__ __qualname__ descriptionZ user_optionsr r rr r r r r s r)__doc__rZdistutils.corerZ distutilsrrr r r r s  PK!WQ^99*command/__pycache__/install.cpython-36.pycnu[3 vhK@svddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZddd fd d d fgZe eZ d d Z ddZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependenciesold-and-unmanageableNTry not to use this!!single-version-externally-managed5used by system package builders to create 'flat' eggsZinstall_egg_infocCsdS)NT)selfrr/usr/lib/python3.6/install.pyszinstall.Zinstall_scriptscCsdS)NTr)r rrr r scCstjj|d|_d|_dS)N)origrinitialize_optionsold_and_unmanageable!single_version_externally_managed)r rrr r s zinstall.initialize_optionscCs<tjj||jrd|_n|jr8|j r8|j r8tddS)NTzAYou must specify --record or --root when building system packages)r rfinalize_optionsrootrrecordr)r rrr r%s zinstall.finalize_optionscCs(|js |jrtjj|Sd|_d|_dS)N)rrr rhandle_extra_pathZ path_fileZ extra_dirs)r rrr r0s  zinstall.handle_extra_pathcCs@|js |jrtjj|S|jtjs4tjj|n|jdS)N) rrr rrun_called_from_setupinspectZ currentframedo_egg_install)r rrr r:s   z install.runcCsz|dkr4d}tj|tjdkr0d}tj|dStj|d}|dd\}tj|}|jjdd }|d kox|j d kS) a Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail.Z IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distZ run_commands) warningswarnplatformZpython_implementationrZgetouterframesZ getframeinfo f_globalsgetZfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rEs     zinstall._called_from_setupcCs|jjd}||jd|j|jd}|jd|_|jjtjd|j d|jj dj g}t j rp|jdt j ||_|jdt _ dS)N easy_installx)argsrr.z*.eggZ bdist_eggr)Z distributionZget_command_classrrZensure_finalizedZalways_copy_fromZ package_indexscanglobZ run_commandZget_command_objZ egg_output setuptoolsZbootstrap_install_frominsertr&r)r r$cmdr&rrr r`s  zinstall.do_egg_install)rNr)rNr)r __module__ __qualname____doc__r rZ user_optionsZboolean_options new_commandsdict_ncr rrr staticmethodrrrrrr rs      rcCsg|]}|dtjkr|qS)r)rr2).0r,rrr {sr5)Zdistutils.errorsrrr)rrZdistutils.command.installZcommandrr r*_installZ sub_commandsr0rrrr s  lPK! V\9: : 3command/__pycache__/install_egg_info.cpython-36.pycnu[3 vh@s\ddlmZmZddlZddlmZddlmZddlmZddl Z Gdddej eZ dS))logdir_utilN)Command) namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZd d Zd d Z d dZ dS)install_egg_infoz.Install an .egg-info directory for the package install-dir=ddirectory to install tocCs d|_dS)N) install_dir)selfr &/usr/lib/python3.6/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|jdd|jd}tjdd|j|jjd}|j|_tj j |j ||_ g|_ dS)NZ install_libr egg_infoz .egg-info)r r )Zset_undefined_optionsZget_finalized_command pkg_resourcesZ DistributionZegg_nameZ egg_versionrsourceospathjoinr targetoutputs)r Zei_cmdbasenamer r rfinalize_optionss z!install_egg_info.finalize_optionscCs|jdtjj|jr.skimmer)rrr)r r+r )r rr1s zinstall_egg_info.copytreeN)rr r ) __name__ __module__ __qualname____doc__ descriptionZ user_optionsrrr r!rr r r rr s  r) Z distutilsrrrZ setuptoolsrrZsetuptools.archive_utilrrZ Installerrr r r rs    PK!}'command/__pycache__/test.cpython-36.pycnu[3 vh#@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZGd d d e ZGd d d eZGd ddeZ dS)N)DistutilsErrorDistutilsOptionError)log) TestLoader)six)mapfilter) resource_listdirresource_existsnormalize_path working_set_namespace_packagesevaluate_markeradd_activation_listenerrequire EntryPoint)Commandc@seZdZddZdddZdS)ScanningLoadercCstj|t|_dS)N)r__init__set_visited)selfr/usr/lib/python3.6/test.pyrs zScanningLoader.__init__NcCs||jkrdS|jj|g}|jtj||t|drH|j|jt|drxpt|jdD]`}|j dr|dkr|jd|dd }n"t |j|d r`|jd|}nq`|j|j |q`Wt |d kr|j |S|d SdS) aReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. Nadditional_tests__path__z.pyz __init__.py.z /__init__.pyr)raddappendrloadTestsFromModulehasattrrr __name__endswithr ZloadTestsFromNamelenZ suiteClass)rmodulepatternZtestsfileZ submodulerrrr#s$      z"ScanningLoader.loadTestsFromModule)N)r% __module__ __qualname__rr#rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs ||_dS)N)fget)rr.rrrr>szNonDataProperty.__init__NcCs|dkr |S|j|S)N)r.)robjZobjtyperrr__get__AszNonDataProperty.__get__)N)r%r+r,rr0rrrrr-=sr-c@seZdZdZdZd%d&d'gZd d ZddZeddZ ddZ ddZ e j gfddZee j ddZeddZddZddZed d!Zed"d#Zd$S)(testz.Command to run unit tests after in-place buildz#run unit tests after in-place build test-module=m$Run 'test_suite' in specified module test-suite=s9Run single test, case or suite (e.g. 'module.test_suite') test-runner=rTest runner to usecCsd|_d|_d|_d|_dS)N) test_suite test_module test_loader test_runner)rrrrinitialize_optionsSsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n |jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz .test_suiter=z&setuptools.command.test:ScanningLoaderr>)r;r<r distributionr=getattrr>)rmsgrrrfinalize_optionsYs        ztest.finalize_optionscCs t|jS)N)list _test_args)rrrr test_argslsztest.test_argsccs6|j rtjdkrdV|jr$dV|jr2|jVdS)NZdiscoverz --verbose)rGrH)r;sys version_infoverbose)rrrrrEps ztest._test_argsc Cs|j |WdQRXdS)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncrrrwith_project_on_sys_pathxs ztest.with_project_on_sys_pathc csPtjot|jdd}|rv|jddd|jd|jd}t|j}|jd|d|jd|jddd|jdn"|jd|jdd d|jd|jd}t j dd}t j j }zbt|j }t j jd|tjtd d td |j|jf|j|g dVWdQRXWd|t j dd<t j jt j j|tjXdS) Nuse_2to3FZbuild_pyr)ZinplaceZegg_info)egg_baseZ build_extrcSs|jS)N)Zactivate)distrrrsz*test.project_on_sys_path..z%s==%s)rPY3rAr@Zreinitialize_commandZ run_commandZget_finalized_commandr Z build_librIpathmodulescopyrPinsertr rrrZegg_nameZ egg_versionpaths_on_pythonpathclearupdate) rZ include_distsZ with_2to3Zbpy_cmdZ build_pathZei_cmdZold_pathZ old_modulesZ project_pathrrrrLs8             ztest.project_on_sys_pathc cst}tjjd|}tjjdd}z>tjj|}td||g}tjj|}|rX|tjd<dVWd||krztjjddn |tjd<XdS)z Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. PYTHONPATHrN)objectosenvirongetpathsepjoinrpop)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrXs     ztest.paths_on_pythonpathcCsD|j|j}|j|jpg}|jdd|jjD}tj|||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css0|](\}}|jdrt|ddr|VqdS):rN) startswithr).0kvrrr sz%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ tests_requireZextras_requireitems itertoolschain)rQZir_dZtr_dZer_drrr install_distss  ztest.install_distscCs|j|j}dj|j}|jr0|jd|dS|jd|ttjd|}|j |"|j |j WdQRXWdQRXdS)N zskipping "%s" (dry run)z running "%s"location) ror@ra_argvZdry_runannounceroperator attrgetterrXrL run_tests)rZinstalled_distscmdrcrrrruns    ztest.runcCstjrt|jddr|jjdd}|tkrg}|tjkrD|j ||d7}x"tjD]}|j |rT|j |qTWt t tjj |tjdd|j|j|j|j|jdd}|jjsd|j}|j|tjt|dS)NrOFrr)Z testLoaderZ testRunnerexitzTest failed: %s)rrSrAr@r;splitr rIrUr"rgrDr __delitem__unittestmainrr_resolve_as_epr=r>resultZ wasSuccessfulrsrZERRORr)rr(Z del_modulesnamer1rBrrrrvs(        ztest.run_testscCs dg|jS)Nr|)rF)rrrrrrsz test._argvcCs$|dkr dStjd|}|jS)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. Nzx=)rparseZresolve)valZparsedrrrr~sztest._resolve_as_epN)r2r3r4)r5r6r7)r8r9r:)r%r+r,__doc__ descriptionZ user_optionsr?rCr-rFrErN contextlibcontextmanagerrL staticmethodrXrorxrvpropertyrrr~rrrrr1Gs( -  r1)!r]rtrIrrmr|Zdistutils.errorsrrZ distutilsrrZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesr r r r r rrrrZ setuptoolsrrr\r-r1rrrrs   , ) PK!d-.W.command/__pycache__/sdist.cpython-36.opt-1.pycnu[3 vh7@s~ddlmZddljjZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZd ddZGd d d e ejZdS) )logN)six)sdist_add_defaultsccs4x.tjdD] }x|j|D] }|VqWq WdS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesZiter_entry_pointsload)dirnameZepitemr /usr/lib/python3.6/sdist.py walk_revctrlsr cseZdZdZd0d2d3gZiZd d ddgZeddeDZddZ ddZ ddZ ddZ e ejddZddZejd4kpd5ejkod6knpd7ejkod8knZereZd$d%Zfd&d'Zd(d)Zd*d+Zd,d-Zd.d/ZZS)9sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats for source distribution (comma-separated list) keep-tempkz1keep the distribution tree around after creating zarchive file(s) dist-dir=dFdirectory to put the source distribution archive(s) in [default: dist]rz.rstz.txtz.mdccs|]}dj|VqdS)z README{0}N)format).0Zextr r r )szsdist.cCs|jd|jd}|j|_|jjtjj|jd|jx|j D]}|j|qFW|j t |j dg}x*|j D] }dd|f}||krv|j|qvWdS)Negg_infoz SOURCES.txt dist_filesrr)Z run_commandget_finalized_commandfilelistappendospathjoinr check_readmeZget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdZcmd_namerfiledatar r r run+s    z sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r%r r r r*>s zsdist.initialize_optionscCstjdkrdSdg|_dS)NrbetarZgztar)r,r-rr.r)sys version_infoZformats)r%r r r r+Cs zsdist._default_to_gztarc Cs$|jtjj|WdQRXdS)z% Workaround for #516 N)_remove_os_linkr)rr")r%r r r r"Is zsdist.make_distributionccs^Gddd}ttd|}yt`Wntk r6YnXz dVWd||k rXttd|XdS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r r NoValueWsr5linkN)r#rr6 Exceptionsetattr)r5Zorig_valr r r r1Ps  zsdist._remove_os_linkc CsLytjj|Wn6tk rFtj\}}}|jjjdj YnXdS)Ntemplate) r)r read_templater7r/exc_infotb_nexttb_framef_localsclose)r%_tbr r r Z__read_template_hackes zsdist.__read_template_hackr,rrcsb|jjr^|jd}|jj|j|jjs^x0|jD]&\}}}|jjfdd|Dq4WdS)zgetting python filesbuild_pycsg|]}tjj|qSr )rrr )rfilename)src_dirr r sz.sdist._add_defaults_python..N)r$Zhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ data_files)r%rEr@ filenamesr )rGr _add_defaults_python|s  zsdist._add_defaults_pythonc sDy tjrtj|n tjWntk r>tjdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper TypeErrorrwarn)r%) __class__r r rLs  zsdist._add_defaults_data_filescCs:x4|jD]}tjj|rdSqW|jddj|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrOr )r%fr r r r!s   zsdist.check_readmecCs^tjj|||tjj|d}ttdrJtjj|rJtj||j d||j dj |dS)Nz setup.cfgr6r) r)rmake_release_treerrr hasattrrRunlinkZ copy_filerZsave_version_info)r%Zbase_dirfilesdestr r r rTs   zsdist.make_release_treec Cs@tjj|jsdStj|jd}|j}WdQRX|djkS)NFrbz+# file GENERATED by distutils, do NOT edit )rrisfilemanifestioopenreadlineencode)r%fpZ first_liner r r _manifest_is_not_generateds z sdist._manifest_is_not_generatedc Cstjd|jt|jd}xl|D]d}tjr^y|jd}Wn$tk r\tjd|w YnX|j }|j ds | rxq |j j |q W|j dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'rYzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinfor[r]rZPY3decodeUnicodeDecodeErrorrOstrip startswithrrr?)r%r[liner r r read_manifests  zsdist.read_manifest)rNr@keep the distribution tree around after creating archive file(s))rrrj)rrr)rBrCrB)r,r)r,rrD)r,rB)r,rBr)r2r3r4__doc__Z user_optionsZ negative_optZREADME_EXTENSIONStuplerQr(r*r+r" staticmethod contextlibcontextmanagerr1Z_sdist__read_template_hackr/r0Zhas_leaky_handler:rKrLr!rTrari __classcell__r r )rPr rs:      r)r)Z distutilsrZdistutils.command.sdistZcommandrr)rr/r\rnZsetuptools.externrZ py36compatrrlistZ_default_revctrlr r r r r s     PK!(882command/__pycache__/bdist_egg.cpython-36.opt-1.pycnu[3 vh G @sxdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZydd lmZmZd dZWn,ek rddlm Z mZddZYnXddZ!ddZ"ddZ#GdddeZ$e%j&dj'Z(ddZ)ddZ*ddZ+d d!d"Z,d#d$Z-d%d&Z.d'd(Z/d)d*d+d,gZ0d1d/d0Z1dS)2z6setuptools.command.bdist_egg Build .egg distributions)DistutilsSetupError) remove_treemkpath)log)CodeTypeN)six)get_build_platform Distributionensure_directory) EntryPoint)Library)Command)get_pathget_python_versioncCstdS)Npurelib)rrr/usr/lib/python3.6/bdist_egg.py _get_purelibsr)get_python_librcCstdS)NF)rrrrrrscCs2d|krtjj|d}|jdr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrr strip_module#s   rccs:x4tj|D]&\}}}|j|j|||fVq WdS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfilesrrr sorted_walk+sr$c Cs6tjdj}t|d}|j||WdQRXdS)NaR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() w)textwrapdedentlstripopenwrite)ZresourcepyfileZ_stub_templatefrrr write_stub5s  r-c@seZdZdZd*dddefd+d-d.d/gZd ddgZddZddZddZ ddZ ddZ ddZ d d!Z d"d#Zd$d%Zd&d'Zd(d)Zd S)0 bdist_eggzcreate an "egg" distribution bdist-dir=b1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s)exclude-source-filesN+remove all .py files from the generated egg keep-tempkz/keep the pseudo-installation tree around after z!creating the distribution archive dist-dir=d-directory to put final built distributions in skip-build2skip rebuilding everything (for testing/debugging)cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_files)selfrrrinitialize_optionsZszbdist_egg.initialize_optionscCs|jd}|_|j|_|jdkr>|jdj}tjj|d|_|jdkrPt |_|j dd|j dkrt dd|j |jt|jjo|jj }tjj|j|d|_ dS)Negg_infoZbdistZeggr?z.egg)r?r?)get_finalized_commandei_cmdrEr< bdist_baserrjoinr=rZset_undefined_optionsrAr Zegg_nameZ egg_versionr distributionhas_ext_modulesr?)rCrGrHbasenamerrrfinalize_optionscs      zbdist_egg.finalize_optionsc Cs|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |dd|df}|jj j|qrgetattrr)rCZinstcmdZold_rootrk all_outputs ext_outputsZ to_compiler2Zext_namerextr+Z archive_rootrEZ script_dirZ native_libsZ libs_filerrrrunsz                    z bdist_egg.runc Cstjdxt|jD]\}}}x|D]}tjj||}|jdrXtjd|tj ||jdr&|}d}t j ||}tjj|tj |j dd} tjd|| fytj| Wntk rYnXtj|| q&WqWdS) Nz+Removing .py files from temporary directoryz.pyz Deleting %s __pycache__z#(?P.+)\.(?P[^.]+)\.pycnamez.pyczRenaming file from [%s] to [%s])rr_walk_eggr<rrrIrdebugrzrematchpardirgroupremoveOSErrorrename) rCr!r"r#rrZpath_oldpatternmZpath_newrrrrs*        zbdist_egg.zap_pyfilescCs2t|jdd}|dk r|Stjdt|j|jS)Nr|z4zip_safe flag not set; analyzing archive contents...)rrJrr~ analyze_eggr<rt)rCsaferrrr| s  zbdist_egg.zip_safec Cstj|jjpd}|jdijd}|dkr0dS|j s>|jrLtd|ftj dd}|j }dj |j}|jd}t j j|j}d t}|jstt j j|j|jd t|jd} | j|| jd S) Nzsetuptools.installationZ eggsecutabler%zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulerraH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi )rea)r Z parse_maprJZ entry_pointsgetZattrsZextrasrsysversionZ module_namerIrrrLrAlocalsrerrjr)r*rx) rCZepmZepZpyverpkgZfullr!rLheaderr,rrrrs*      zbdist_egg.gen_headercCsltjj|j}tjj|d}xJ|jjjD]<}|j|r(tjj||t |d}t ||j ||q(WdS)z*Copy metadata (egg info) to the target_dirrN) rrnormpathrErIrGZfilelistr#r\rZr Z copy_file)rCZ target_dirZ norm_egg_infoprefixrtargetrrrrw:s zbdist_egg.copy_metadata_toc Csg}g}|jdi}x|t|jD]n\}}}x6|D].}tjj|djtkr.|j|||q.Wx*|D]"}|||d|tjj||<qfWqW|j j r |j d}xd|j D]Z} t | trq|j| j} |j| }tjj|jdstjjtjj|j|r|j|qW||fS)zAGet a list of relative paths to C extensions in the output distrorrPrlZ build_extzdl-)r<r$rrrlowerNATIVE_EXTENSIONSr^rIrJrKrF extensionsrXr Zget_ext_fullnamerZget_ext_filenamerLr\r}) rCrrpathsr!r"r#rZ build_cmdrfullnamerrrrsFs(   &      zbdist_egg.get_ext_outputs)r/r0r1)r3Nr4Pkeep the pseudo-installation tree around after creating the distribution archive)r5r6r)r7r8r9)r:Nr;)__name__ __module__ __qualname__ descriptionrZ user_optionsZboolean_optionsrDrMrcrdr`rrr|rrwrsrrrrr.Cs4   Q' r.z.dll .so .dylib .pydccsLt|}t|\}}}d|kr(|jd|||fVx|D] }|Vq:WdS)z@Walk an unpacked egg's contents, skipping the metadata directoryzEGG-INFON)r$nextr)egg_dirZwalkerr!r"r#Zbdfrrrrfs   rc Csx0tjD]$\}}tjjtjj|d|r |Sq Wts.visit) compression) zipfilerrrrjrr_Z ZIP_DEFLATEDZ ZIP_STOREDZZipFiler$rx) Z zip_filenamerrqrecompressrrrrrrrjr"r#r)rrerrs  r)rrTr%)2__doc__Zdistutils.errorsrZdistutils.dir_utilrrZ distutilsrtypesrrrrr&rZsetuptools.externrZ pkg_resourcesrr r r Zsetuptools.extensionr Z setuptoolsr sysconfigrrr ImportErrorZdistutils.sysconfigrrr$r-r.rrsplitrrrr{rrrrrfrrrrrsL         " $  PK!)w##)command/__pycache__/upload.cpython-36.pycnu[3 vh@s*ddlZddlmZGdddejZdS)N)uploadc@s(eZdZdZddZddZddZdS) rza Override default upload behavior to obtain password in a variety of different ways. cCs8tjj||jptj|_|jp0|jp0|j|_dS)N) origrfinalize_optionsusernamegetpassZgetuserZpassword_load_password_from_keyring_prompt_for_password)selfr /usr/lib/python3.6/upload.pyr s   zupload.finalize_optionsc Cs2ytd}|j|j|jStk r,YnXdS)zM Attempt to load password from keyring. Suppress Exceptions. keyringN) __import__Z get_passwordZ repositoryr Exception)r r r r r rs z"upload._load_password_from_keyringc Cs&ytjSttfk r YnXdS)zH Prompt for a password on the tty. Suppress Exceptions. N)rrKeyboardInterrupt)r r r r r#szupload._prompt_for_passwordN)__name__ __module__ __qualname____doc__rrrr r r r rs r)rZdistutils.commandrrr r r r s PK!Fa.command/__pycache__/upload_docs.cpython-36.pycnu[3 vh@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd d ZGd ddeZdS)zpupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). )standard_b64encode)log)DistutilsOptionErrorN)six) http_clienturllib)iter_entry_points)uploadcCstjr dnd}|jd|S)Nsurrogateescapestrictzutf-8)rPY3encode)serrorsr!/usr/lib/python3.6/upload_docs.py_encodesrc@seZdZdZdZdddejfddgZejZd d Zd efgZ ddZ ddZ ddZ ddZ eddZeddZddZdS) upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIz repository=rzurl of repository [default: %s] show-responseN&display full response text from server upload-dir=directory to uploadcCs$|jdkr xtddD]}dSWdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfZeprrr has_sphinx/s zupload_docs.has_sphinxrcCstj|d|_d|_dS)N)r initialize_optionsr target_dir)rrrrr6s zupload_docs.initialize_optionscCstj||jdkrN|jr0|jd}|j|_q`|jd}tjj |j d|_n|j d|j|_d|j krtt jd|jd|jdS)NrbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r finalize_optionsrrZget_finalized_commandZbuilder_target_dirrospathjoinZ build_baseZensure_dirname repositoryrwarnannounce)rrr rrrr!;s        zupload_docs.finalize_optionsc Cstj|d}z|j|jxtj|jD]~\}}}||jkrT| rTd}t||jxP|D]H}tjj||}|t |jdj tjj } tjj| |} |j || qZWq(WWd|j XdS)Nwz'no files found in upload directory '%s')zipfileZZipFileZmkpathrr"walkrr#r$lenlstripsepwriteclose) rfilenamezip_filerootdirsfilesZtmplnameZfullZrelativedestrrrcreate_zipfileKs   zupload_docs.create_zipfilec Cslx|jD]}|j|q Wtj}|jjj}tjj |d|}z|j ||j |Wdt j |XdS)Nz%s.zip)Zget_sub_commandsZ run_commandtempfileZmkdtemp distributionmetadataget_namer"r#r$r7 upload_fileshutilZrmtree)rZcmd_nameZtmp_dirr5r1rrrrun[s  zupload_docs.runccs|\}}d|}t|ts |g}xn|D]f}t|trN|d|d7}|d}nt|}|Vt|VdV|V|r&|dddkr&dVq&WdS) Nz* Content-Disposition: form-data; name="%s"z; filename="%s"rr s   ) isinstancelisttupler)item sep_boundarykeyvaluestitlevaluerrr _build_partis     zupload_docs._build_partc Csnd}d|}|d}|df}tj|j|d}t||j}tjj|}tj||} d|jd} dj | | fS) z= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--r@)rFz multipart/form-data; boundary=%sascii) functoolspartialrKmapitems itertoolschain from_iterabledecoder$) clsdataboundaryrFZ end_boundaryZ end_itemsZbuilderZ part_groupspartsZ body_items content_typerrr_build_multipart}s  zupload_docs._build_multipartcCsPt|d}|j}WdQRX|jj}d|jtjj||fd}t|j d|j }t |}t j rn|jd}d|}|j|\}} d|j} |j| tjtjj|j\} } } }}}| r| r| st| dkrtj| }n | d krtj| }n td | d }yZ|j|jd | | }|jd ||jdtt||jd||j |j!|Wn6t"j#k r}z|jt|tj$dSd}~XnX|j%}|j&dkrd|j&|j'f} |j| tjnb|j&dkr|j(d}|dkrd|j}d|} |j| tjnd|j&|j'f} |j| tj$|j)rLt*dd|jdddS)NrbZ doc_upload)z:actionr5content:rLzBasic zSubmitting documentation to %sZhttpZhttpszunsupported schema ZPOSTz Content-typezContent-lengthZ AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %s-K)+openreadr9r:r;r"r#basenamerZusernameZpasswordrrr rUr[r%r'rINFOrparseZurlparseAssertionErrorrZHTTPConnectionZHTTPSConnectionZconnectZ putrequestZ putheaderstrr+Z endheaderssendsocketerrorZERRORZ getresponseZstatusreasonZ getheaderZ show_responseprint)rr0fr]metarWZ credentialsZauthZbodyZctmsgZschemaZnetlocZurlZparamsZqueryZ fragmentsZconnrZerlocationrrrr<s`              zupload_docs.upload_file)rNr)rNr)__name__ __module__ __qualname__ZDEFAULT_REPOSITORY descriptionr Z user_optionsZboolean_optionsrZ sub_commandsrr!r7r> staticmethodrK classmethodr[r<rrrrrs"    r)__doc__base64rZ distutilsrZdistutils.errorsrr"rkr)r8r=rRrNZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesrr rrrrrrs       PK!-/command/__pycache__/easy_install.cpython-36.pycnu[3 vhT @sdZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4mm?Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOdd lPZ@ejQde@jRdddddddgZSdd ZTd!dZUe'jVr2d"d#ZWd$d%ZXnd&d#ZWd'd%ZXd(d)ZYGd*dde,ZZd+d,Z[d-d.Z\d/d0Z]d1dZ^d2dZ_Gd3ddeGZ`Gd4d5d5e`Zaejbjcd6d7d8kreaZ`d9d:Zdd;d<Zed=d>Zfd?d@ZgdpdAdBZhdCdDZidEdFZjdGejkkrejZlndHdIZldqdKdLZmdMdNZndOdPZodQdRZpyddSlmqZrWnesk r^dTdUZrYnXdVdWZqGdXdYdYetZueujvZwGdZd[d[euZxGd\d]d]eyZzGd^d_d_ezZ{Gd`dadae{Z|ezj}Z}ezj~Z~dbdcZdddeZdfeefdgdhZdidjZdkdlZdrdmdZe"jdndoZd S)sa% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html )glob) get_platform) convert_path subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMES SCHEME_KEYS)logdir_util) first_line_re)find_executableN)six) configparsermap)Command) run_setup)get_pathget_config_vars) rmtree_safe)setopt)unpack_archive) PackageIndexparse_requirement_arg URL_SCHEME) bdist_eggegg_info)Wheel) yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributions Environment Requirement Distribution PathMetadata EggMetadata WorkingSetDistributionNotFoundVersionConflict DEVELOP_DISTdefault)categorysamefile easy_installPthDistributionsextract_wininst_cfgmainget_exe_prefixescCstjddkS)NP)structcalcsizer;r;"/usr/lib/python3.6/easy_install.pyis_64bitIsr=cCsjtjj|otjj|}ttjdo&|}|r:tjj||Stjjtjj|}tjjtjj|}||kS)z Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r1)ospathexistshasattrr1normpathnormcase)Zp1Zp2Z both_existZ use_samefileZnorm_p1Znorm_p2r;r;r<r1MscCs|S)Nr;)sr;r;r< _to_ascii_srEc Cs*ytj|ddStk r$dSXdS)NasciiTF)rZ text_type UnicodeError)rDr;r;r<isasciibs  rHcCs |jdS)NrF)encode)rDr;r;r<rEjsc Cs(y|jddStk r"dSXdS)NrFTF)rIrG)rDr;r;r<rHms  cCstj|jjddS)N z; )textwrapdedentstripreplace)textr;r;r<usrPc@seZdZdZdZdZdddddddddddddddddddddgZdd dd dd0d3d9ddddZ?ejdj Z@ddZAddZBddZCddZDddZEddZFddZGddZHejdj ZIddZJddZKddZLeMeMddddZNeMdddZOddZPdS)r2z'Manage a download/build/install processz Find/get/install Python packagesTprefix=Ninstallation prefixzip-okzinstall package as a zipfile multi-versionm%make apps have to require() a versionupgradeU1force upgrade (searches PyPI for latest versions) install-dir=dinstall package to DIR script-dir=rDinstall scripts to DIRexclude-scriptsxDon't install scripts always-copya'Copy all needed packages to install dir index-url=i base URL of Python Package Index find-links=f(additional URL(s) to search for packagesbuild-directory=b/download/extract/build in DIR; keep the results optimize=Olalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]record=3filename in which to record list of installed files always-unzipZ*don't install as a zipfile, no matter what site-dirs=S)list of directories where .pth files workeditablee+Install specified packages in editable formno-depsNdon't install dependencies allow-hosts=H$pattern(s) that hostnames must matchlocal-snapshots-okl(allow building eggs from local checkoutsversion"print version information and exit no-find-links9Don't load find-links defined in packages being installedz!install in user site-package '%s'usercCs,d|_d|_|_d|_|_|_d|_d|_d|_d|_ d|_ |_ d|_ |_ |_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrtj |_!tj"|_#n d|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*d|_+|j,j-|_-|j,j.||j,j/ddS)NrFr2)0rzip_oklocal_snapshots_ok install_dir script_direxclude_scripts index_url find_linksbuild_directoryargsoptimizerecordrY always_copy multi_versionr{no_deps allow_hostsrootprefix no_reportrinstall_purelibinstall_platlibinstall_headers install_libinstall_scripts install_data install_baseinstall_platbasesiteENABLE_USER_SITE USER_BASEinstall_userbase USER_SITEinstall_usersite no_find_links package_indexpth_filealways_copy_from site_dirsinstalled_projectssitepy_installedZ_dry_run distributionverboseZ_set_command_optionsget_option_dict)selfr;r;r<initialize_optionssF     zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tjj|stjj|r|VqdS)N)r>r?r@islink).0filenamer;r;r< sz/easy_install.delete_blockers..)listr _delete_path)rblockersZextant_blockersr;r;r<delete_blockersszeasy_install.delete_blockerscCsJtjd||jrdStjj|o.tjj| }|r8tntj}||dS)Nz Deleting %s) r infodry_runr>r?isdirrrmtreeunlink)rr?Zis_treeZremoverr;r;r<rs  zeasy_install._delete_pathcCs6tjdd}td}d}t|jfttdS)zT Render the Setuptools version and installation details, then exit. N setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver}))sysrr$printformatlocals SystemExit)Zverdisttmplr;r;r<_render_versions zeasy_install._render_versionc Cst|jo |jtjjd}tdd\}}|jj|jj|jj||dd|d|d||||t tddd |_ t j r|j |j d <|j|j d <|j|j|j|jd d d d|jdkr|j|_|jdkrd|_|jdd!|jdd"|jr|jr|j|_|j|_|jdd#tttj}t|_|jdk rdd|jjdD}xV|D]N}t jj!|s~t"j#d|n,t||krt$|dn|jj%t|q^W|j&s|j'|j(pd|_(|jdd|_)x4|jt|jfD] }||j)kr|j)j*d|qW|j+dk r8dd|j+jdD}ndg}|j,dkr`|j-|j(|j)|d|_,t.|j)tj|_/|j0dk rt1|j0t2j3r|j0j|_0ng|_0|j4r|j,j5|j)tj|js|j,j6|j0|jdd$t1|j7t8s@y2t8|j7|_7d|j7kodknst9Wnt9k r>t$dYnX|j&rZ|j: rZt;d|j<sjt;d g|_=dS)%Nrr exec_prefixrabiflags) Z dist_nameZ dist_versionZ dist_fullname py_versionpy_version_shortpy_version_nodotZ sys_prefixrZsys_exec_prefixrruserbaseZusersiterrrrFrrinstallrcSsg|]}tjj|jqSr;)r>r? expanduserrM)rrDr;r;r< 3sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }|jqSr;)rM)rrDr;r;r<rHs*)Z search_pathhostsrz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))rr)rr)rr)rr)>rrrsplitrrZget_nameZ get_versionZ get_fullnamegetattr config_varsrrrr_fix_install_dir_for_user_siteexpand_basedirs expand_dirs_expandrrrZset_undefined_optionsrrrrr!r? get_site_dirs all_site_dirsrr>rr warnrappendr{check_site_dirr shadow_pathinsertrr create_indexr& local_indexr isinstancerZ string_typesrZscan_egg_linksadd_find_linksrint ValueErrorrrroutputs) rrrrrBrr]Z path_itemrr;r;r<finalize_optionss                zeasy_install.finalize_optionscCs`|j stj rdS|j|jdkr2d}t||j|_|_tj j ddd}|j |dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedposixZunixZ_user) rrrcreate_home_pathrr rrr>namerN select_scheme)rmsgZ scheme_namer;r;r<rms z+easy_install._fix_install_dir_for_user_sitecCs\xV|D]N}t||}|dk rtjdks0tjdkrrr?rrrsetattr)rattrsattrvalr;r;r< _expand_attrs|s    zeasy_install._expand_attrscCs|jdddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rrrN)r)rr;r;r<rszeasy_install.expand_basedirscCsddddddg}|j|dS)z+Calls `os.path.expanduser` on install dirs.rrrrrrN)r)rdirsr;r;r<rszeasy_install.expand_dirsc Cs|j|jjkrtj|jzx|jD]}|j||j q$W|jr|j}|j rt |j }x(t t |D]}|||d||<qfWddl m }|j|j|j|fd|j|jWdtj|jjXdS)Nr) file_utilz'writing list of installed files to '%s')rrr set_verbosityrr2rrrrlenrange distutilsrexecuteZ write_filewarn_deprecated_options)rspecrZroot_lenZcounterrr;r;r<runs$       zeasy_install.runc CsDy tj}Wn"tk r.tjdtj}YnXtjj|j d|S)zReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r>getpid ExceptionrandomZrandintrmaxsizer?joinr)rpidr;r;r<pseudo_tempnames  zeasy_install.pseudo_tempnamecCsdS)Nr;)rr;r;r<rsz$easy_install.warn_deprecated_optionscCsdt|j}tjj|d}tjj|sTytj|Wn ttfk rR|j YnX||j k}| rv|j rv|j }nd|j d}tjj|}y*|rtj|t|djtj|Wn ttfk r|j YnX| r|j rt|j|r|jdkrt||j |_nd|_|tttkr6d|_n$|j rZtjj| rZd|_d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededzeasy-install.pthz .write-testwNT)r!rr>r?r r@makedirsOSErrorIOErrorcant_write_to_targetrrcheck_pth_processingrropencloserno_default_version_msgrr3r _pythonpathr)rinstdirrZ is_site_dirZtestfileZ test_existsr;r;r<rs>         zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/easy_install.html Please make the appropriate changes for your system and try again. cCsP|jtjd|jf}tjj|js6|d|j7}n|d|j7}t |dS)NrJ) _easy_install__cant_write_msgrexc_inforr>r?r@_easy_install__not_exists_id_easy_install__access_msgr)rrr;r;r<rs z!easy_install.cant_write_to_targetc Cs|j}tjd||jd}|d}tjj|}tdd}y8|rNtj|tjj |}t j j |ddt |d}Wn ttfk r|jYnXz|j|jft|jd }tj}tjd krtjj|\}} tjj|d } | jd kotjj| } | r| }d dlm} | |dddgd tjj|rJtjd|dSWd |r\|jtjj|rttj|tjj|rtj|X|jstjd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %sz.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rJT)exist_okrNrz pythonw.exez python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rr rrr>r?r@ _one_linerrdirname pkg_resourcesZ py31compatrrrrrwriterrrr executablerrr lowerdistutils.spawnr rr) rrrZok_fileZ ok_existsrr#rkr&basenameZaltZuse_altr r;r;r<rsV            z!easy_install.check_pth_processingcCs\|j rN|jdrNx:|jdD],}|jd|r2q|j|||jd|qW|j|dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rZmetadata_isdirZmetadata_listdirinstall_scriptZ get_metadatainstall_wrapper_scripts)rr script_namer;r;r<install_egg_scriptsSsz easy_install.install_egg_scriptscCs\tjj|rLxJtj|D].\}}}x"|D]}|jjtjj||q(WqWn |jj|dS)N)r>r?rwalkrrr )rr?baserfilesrr;r;r< add_outputas    zeasy_install.add_outputcCs|jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)r{r)rrr;r;r< not_editableiszeasy_install.not_editablecCs<|js dStjjtjj|j|jr8td|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)r{r>r?r@r rkeyr)rrr;r;r<check_editableqs zeasy_install.check_editablec cs@tjtjdd}zt|VWdtjj|o8tt |XdS)Nz easy_install-)r) tempfilemkdtemprustrr>r?r@rr)rtmpdirr;r;r<_tmpdir{szeasy_install._tmpdirFcCs|js|j|j}t|tst|rT|j||jj||}|j d|||dSt j j |r||j||j d|||dSt |}|j||jj|||j|j|j |j}|dkrd|}|jr|d7}t|n0|jtkr|j|||d|S|j ||j||SWdQRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)r{install_site_pyr;rr'rr3rdownload install_itemr>r?r@rr5Zfetch_distributionrYrrrZ precedencer.process_distributionlocation)rrdepsr:dlrrr;r;r<r2s2         zeasy_install.easy_installcCs|p|j}|ptjj||k}|p,|jd }|pT|jdk oTtjjt|t|jk}|r| rx$|j|jD]}|j |krnPqnWd}t j dtjj ||r|j |||}x<|D]}|j|||qWn |j|g}|j||d|d|dk rx|D]}||kr|SqWdS)Nz.eggTz Processing %srr<)rr>r?r#endswithrr!r project_namerAr rr) install_eggsr@egg_distribution)rrr>r:rBZinstall_neededrZdistsr;r;r<r?s.         zeasy_install.install_itemcCs@t|}x2tD]*}d|}t||dkrt||||qWdS)z=Sets the install directories by applying the install schemes.Zinstall_N)r r rr)rrschemer4Zattrnamer;r;r<rs  zeasy_install.select_schemecGs|j||jj|||j|jkr2|jj||jj||j|||j|j<tj |j ||f||j dr|j r|jj |jd| r|j rdS|dk r|j|jkrtjd|dS|dks||kr|j}tt|}tj d|ytgj|g|j|j}Wn^tk rB}ztt|WYdd}~Xn0tk rp}zt|jWYdd}~XnX|js|jrx*|D]"}|j|jkr|j|jqWtj d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s) update_pthraddrr4remover.rr rinstallation_report has_metadatarrZget_metadata_linesrras_requirementr'r9r+Zresolver2r,rr-Zreportr)rZ requirementrrBrZdistreqZdistrosr|r;r;r<r@sB            z!easy_install.process_distributioncCs2|jdk r|j S|jdr dS|jds.dSdS)Nz not-zip-safeTzzip-safeF)rrM)rrr;r;r< should_unzips   zeasy_install.should_unzipcCstjj|j|j}tjj|r:d}tj||j|j||Stjj|rL|}nRtjj ||krftj |tj |}t |dkrtjj||d}tjj|r|}t |tj|||S)Nz<%r already exists in %s; build directory %s will not be keptrr)r>r?r rr4r@r rrr#rlistdirrr#shutilmove)rr dist_filename setup_basedstrcontentsr;r;r< maybe_moves"       zeasy_install.maybe_movecCs0|jr dSx tjj|D]}|j|qWdS)N)r ScriptWriterbestget_args write_script)rrrr;r;r<r,sz$easy_install.install_wrapper_scriptscCsNt|j}t||}|r8|j|t}tj||}|j|t|ddS)z/Generate a legacy script wrapper and install itrnN) r9rNis_python_script_load_templaterrX get_headerr[rE)rrr- script_textdev_pathrZ is_scriptZbodyr;r;r<r+"s   zeasy_install.install_scriptcCs(d}|r|jdd}td|}|jdS)z There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplrzutf-8)rNr"decode)r`rZ raw_bytesr;r;r<r],s   zeasy_install._load_templatetc sjfdd|Dtjd|jtjjj|}j|jrLdSt }t |tjj |rptj |t |d|}|j|WdQRXt|d|dS)z1Write an executable file to the scripts directorycsg|]}tjjj|qSr;)r>r?r r)rrb)rr;r<r>sz-easy_install.write_script..zInstalling %s script to %sNri)rr rrr>r?r r2r current_umaskr#r@rrr%chmod)rr-rVmodertargetmaskrkr;)rr<r[;s   zeasy_install.write_scriptcCs`|jjdr|j||gS|jjdr8|j||gS|jjdrT|j||gS|}tjj|r|jd rt|||j ntjj |rtjj |}|j |r|j r|dk r|j|||}tjj|d}tjj|s2ttjj|dd}|stdtjj |t|dkr*td tjj ||d }|jrPtj|j||gS|j||SdS) Nz.eggz.exez.whlz.pyzsetup.pyrz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)r'rD install_egg install_exe install_wheelr>r?isfilerunpack_progressrabspath startswithrrWr r@rrrr{r rreport_editablebuild_and_install)rrrSr:rT setup_scriptZsetupsr;r;r<rFOs<   zeasy_install.install_eggscCs>tjj|r"t|tjj|d}nttj|}tj ||dS)NzEGG-INFO)metadata) r>r?rr)r r* zipimport zipimporterr(Z from_filename)regg_pathrrr;r;r<rG{s    zeasy_install.egg_distributionc Cstjj|jtjj|}tjj|}|js2t||j|}t ||s|tjj |rttjj | rtt j ||jdn"tjj|r|jtj|fd|yd}tjj |r|j|rtjd}}n tjd}}nL|j|r|j||jd}}n*d}|j|rtjd}}n tjd}}|j|||f|dtjj|tjj|ft||d Wn$tk rzt|dd YnX|j||j|S) N)rz Removing FZMovingZCopyingZ ExtractingTz %s to %s)fix_zipimporter_caches)r>r?r rr)rmrr#rGr1rrr remove_treer@rrrnrQrRZcopytreerOZmkpathunpack_and_compileZcopy2r#update_dist_cachesr r2)rrur: destinationrZnew_dist_is_zippedrkrWr;r;r<rhsT               zeasy_install.install_eggc sTt|}|dkrtd|td|jdd|jddtd}tjj||jd}||_ |d}tjj|d}tjj|d }t |t |||_ |j ||tjj|st|d } | jd x<|jdD].\} } | d kr| jd | jddj| fqW| jtjj|d|jfddtj|Dtj|||j|jd|j||S)Nz(%s is not a valid distutils Windows .exerrrr)rErplatformz.eggz.tmpzEGG-INFOzPKG-INFOrzMetadata-Version: 1.0 target_versionz%s: %s _-r*csg|]}tjj|dqS)r)r>r?r )rr)rr;r<rsz,easy_install.install_exe..)rr)r4rr(getrr>r?r egg_namerAr#r)Z _provider exe_to_eggr@rr%itemsrNtitlerrrXrZrZ make_zipfilerrrh) rrSr:cfgrruegg_tmpZ _egg_infoZpkg_infrkkvr;)rr<ris<      " zeasy_install.install_exec s>t|ggifdd}t||g}xtD]l}|jjdr>|jd}|d}tj|dd|d<tjj f|}j ||j |tj ||q>W|j tj tjj dtj|xbdD]Z} t| rtjj d| d } tjj| st| d } | jd j t| d | jqWd S)z;Extract a bdist_wininst to the directories an egg would usecs|j}xԈD]\}}|j|r||t|d}|jd}tjjf|}|j}|jdsl|jdrtj |d |d <dtjj |dd<j |n4|jdr|dkrdtjj |dd<j ||SqW|jdst j d |dS) N/z.pydz.dllrrz.pyzSCRIPTS/z.pthzWARNING: can't process %sr)r'rnrrr>r?r rDr strip_modulesplitextrr r)srcrUrDoldnewpartsrC)r native_libsprefixes to_compile top_levelr;r<processs$      z(easy_install.exe_to_egg..processz.pydrrz.pyzEGG-INFOrrz.txtrrJNrrr)rr)r6rr'rDrrrr>r?r rZ write_stub byte_compileZwrite_safety_flagZ analyze_eggrr@rr%r) rrSrrZstubsresrZresourceZpyfilerZtxtrkr;)rrrrrr<rs6           zeasy_install.exe_to_eggc Cst|}|jsttjj|j|j}tjj|}|j sBt |tjj |rntjj | rnt j||j dn"tjj|r|jtj|fd|z.|j|j|fdtjj|tjj|fWdt|ddX|j||j|S)N)rz Removing zInstalling %s to %sF)rv)rZ is_compatibleAssertionErrorr>r?r rrrmrr#rrr rwr@rrZinstall_as_eggr)r#ryr2rG)rZ wheel_pathr:Zwheelrzr;r;r<rjs.      zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Installedc Cs`d}|jr@|j r@|d|j7}|jtttjkr@|d|j7}|j }|j }|j }d}|t S)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srJr) rr_easy_install__mv_warningrrr!rr?_easy_install__id_warningrArErr) rZreqrZwhatrZegglocrrZextrasr;r;r<rLIsz easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tjj|}tj}d|jtS)NrJ)r>r?r#rr&_easy_install__editable_msgr)rrrqr#pythonr;r;r<robs zeasy_install.report_editablecCstjjdttjjdtt|}|jdkrNd|jd}|jdd|n|jdkrd|jdd|jrv|jdd t j d |t |ddd j |yt ||Wn6tk r}ztd |jdfWYdd}~XnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrrrr~z-qz-nz Running %s %s zSetup script exited with %s)rmodules setdefaultrrrrrrr rrr rrrr)rrqrTrrr;r;r<rgs      zeasy_install.run_setupc Csddg}tjdtjj|d}z|jtjj||j||j|||t|g}g}x2|D]*}x$||D]}|j|j |j |qlWq^W| r|j rt j d||St|t j|jXdS)Nrz --dist-dirz egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))r6r7r>r?r#_set_fetcher_optionsrrr&rhrArr rrrr) rrqrTrZdist_dirZall_eggsZeggsr4rr;r;r<rp{s$   zeasy_install.build_and_installc Cst|jjdj}d }i}x2|jD]&\}}||kr4q"|d||jdd <q"Wt|d }tjj|d }t j ||d S)a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r2rrrrrrr}r~)r2z setup.cfgN)rrrrrr) rrcopyrrNdictr>r?r rZ edit_config) rr0Zei_optsZfetch_directivesZ fetch_optionsr4rZsettingsZ cfg_filenamer;r;r<rs  z!easy_install._set_fetcher_optionscCs0|jdkrdSxX|j|jD]H}|js2|j|jkrtjd||jj||j|jkr|jj|jqW|js|j|jjkrtjd|n2tjd||jj ||j|jkr|jj |j|j s,|jj |jdkr,t jj|jd}t jj|rt j|t|d}|j|jj|jd|jdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filerzsetuptools.pthwtrJ)rr4rrAr rrKrpathsrJrrsaver>r?r rrrrr% make_relativer)rrr]rrkr;r;r<rIs4           zeasy_install.update_pthcCstjd|||S)NzUnpacking %s to %s)r debug)rrrUr;r;r<rlszeasy_install.unpack_progresscshggfdd}t|||jjsdx.D]&}tj|tjdBd@}t||q:WdS)Ncs\|jdr"|jd r"j|n|jds6|jdr@j|j||j rX|pZdS)Nz.pyz EGG-INFO/z.dllz.so)rDrnrrlr)rrU)rto_chmodrr;r<pfs    z+easy_install.unpack_and_compile..pfimi)rrrr>statST_MODErd)rrurzrrkrer;)rrrr<rxs   zeasy_install.unpack_and_compilec Csjtjr dSddlm}z@tj|jd||dd|jd|jrT|||jd|jdWdtj|jXdS)Nr)rr)rforcer) rdont_write_bytecodedistutils.utilrr rrrr)rrrr;r;r<rs zeasy_install.byte_compilea bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.cCs|j}||jtjjddfS)N PYTHONPATHr)_easy_install__no_default_msgrr>environr)rtemplater;r;r<rsz#easy_install.no_default_version_msgcCs|jr dStjj|jd}tdd}|jd}d}tjj|rtj d|jt j |}|j }WdQRX|j dstd |||krtjd ||jst|t j |d dd }|j|WdQRX|j|gd |_dS)z8Make sure there's a site.py in the target dir, if neededNzsite.pyrz site-patch.pyzutf-8rzChecking existing site.py in %sz def __boot():z;%s is not a setuptools-generated site.py; please remove it.z Creating %sr)encodingT)rr>r?r rr"rar@r riorreadrnrrrr#r%r)rZsitepysourceZcurrentZstrmr;r;r<r=s,       zeasy_install.install_site_pycCsj|js dSttjjd}xJtj|jD]:\}}|j|r(tjj | r(|j d|tj |dq(WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) rrr>r?rrZ iteritemsrrnrZ debug_printr)rhomerr?r;r;r<r>szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/bin)rr)rz$base/Lib/site-packagesz $base/ScriptscGs|jdj}|jrh|j}|j|d<|jjtj|j}x0|j D]$\}}t ||ddkr@t |||q@Wddl m }xJ|D]B}t ||}|dk rz|||}tjdkrtjj|}t |||qzWdS)Nrr0r)rr)Zget_finalized_commandrrrr rr>rDEFAULT_SCHEMErrrrrr?r)rrrrHrrrr;r;r<rTs         zeasy_install._expand)rQNrR)rSrTrU)rVrWrX)rYrZr[)r\r]r^)r_rDr`)rarbrc)rdrerf)rgrhri)rjrkrl)rmrnro)rprqrr)rsNrt)rurvrw)rxryrz)r{r|r})r~rr)rrr)rrr)rNr)rNr)F)F)T)N)r)Q__name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsZ user_optionsZboolean_optionsrrrZhelp_msgrZ negative_optrrrrr staticmethodrrrrrrrrrrrKrLlstriprrrrrr.r2r3r5 contextlibcontextmanagerr;r2r?rr@rOrWr,r+r]r[rFrGrhrirrjrrrLrrorrprrIrlrxrrrr=rrr rrr;r;r;r<r2xs    0 z   0    ;  $ $ '  ,6-5   %    cCs tjjddjtj}td|S)Nrr)r>rrrpathsepfilter)rr;r;r<rksrc Csg}|jttjg}tjtjkr0|jtjx|D]}|r6tjdkr`|jtjj |ddn\tj dkr|jtjj |ddtj dd dtjj |dd gn|j|tjj |ddgtjd kr6d |kr6tj j d }|r6tjj |ddtj dd d}|j|q6Wtdtdf}x"|D]}||kr |j|q WtjrR|jtjy|jtjWntk rzYnXttt|}|S)z& Return a list of 'site' dirs os2emxriscosZLibz site-packagesrlibrNrz site-pythondarwinzPython.frameworkHOMELibraryPythonpurelibplatlib)rr)extendrrrrrr{r>r?r seprrrrrrrgetsitepackagesAttributeErrorrrr!)sitedirsrrrZhome_spZ lib_pathsZsite_libr;r;r<rpsV            rccsi}x|D]}t|}||kr q d||<tjj|s6q tj|}||fVx|D]}|jds`qP|dkrjqPttjj||}tt |}|j xP|D]H}|j dst|j }||krd||<tjj|sq|tj|fVqWqPWq WdS)zBYield sys.path directories that might contain "old-style" packagesrz.ptheasy-install.pthsetuptools.pthimportN)rr) r!r>r?rrPrDrr rr rrnrstrip)Zinputsseenr#r1rrklinesliner;r;r< expand_pathss4           rc Cs&t|d}z tj|}|dkr$dS|d|d|d}|dkrHdS|j|dtjd|jd\}}}|dkrzdS|j|d|d d d }tj|}y<|j|} | j d d d} | j t j } |j tj| Wntjk rdSX|jd s|jd rdS|S|jXdS)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None rbN  zegg path translations for a given .exe filePURELIB/rPLATLIB/pywin32_system32PLATLIB/SCRIPTS/EGG-INFO/scripts/DATA/lib/site-packagesrrrzPKG-INFOrz .egg-inforNz EGG-INFO/z.pthz -nspkg.pthPURELIBPLATLIB\rz%s/%s/cSsg|]\}}|j|fqSr;)r')rrbyr;r;r<r$sz$get_exe_prefixes..)rr)rr)rr)rr)rr)rr)rZZipFileZinfolistrrrrDrr upperrrZPY3rar rMrNrnrrsortreverse)Z exe_filenamerrTrrrrVZpthr;r;r<r6s>     & c@sTeZdZdZdZffddZddZddZed d Z d d Z d dZ ddZ dS)r3z)A .pth file with Distribution paths in itFcCsp||_ttt||_ttjj|j|_|j t j |gddx(t |j D]}tt|jt|dqNWdS)NT)rrrr!rr>r?r#basedir_loadr&__init__r rrJr%)rrrr?r;r;r<r/szPthDistributions.__init__cCsg|_d}tj|j}tjj|jrt|jd}x|D]}|j drJd}q6|j }|jj ||j s6|j j drxq6t tjj|j|}|jd<tjj| s||kr|jjd|_q6d||<q6W|j|jr| rd|_x&|jo|jdj r |jjqWdS) NFZrtrT#rrr)rrfromkeysrr>r?rkrrrnrrrMr!r rr@popdirtyr)rZ saw_importrrkrr?r;r;r<r8s2        zPthDistributions._loadc Cs|js dStt|j|j}|rtjd|j|j|}dj |d}t j j |jr`t j |jt|jd}|j|WdQRXn(t j j|jrtjd|jt j |jd|_dS)z$Write changed .pth file back to diskNz Saving %srJrzDeleting empty %sF)rrrrrr rr _wrap_linesr r>r?rrrr%r@)rZ rel_pathsrdatarkr;r;r<rWs   zPthDistributions.savecCs|S)Nr;)rr;r;r<rmszPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jtjk}|r>|jj|jd|_tj||dS)z"Add `dist` to the distribution mapTN) rArrr>getcwdrrr&rJ)rrnew_pathr;r;r<rJqs  zPthDistributions.addcCs6x$|j|jkr$|jj|jd|_qWtj||dS)z'Remove `dist` from the distribution mapTN)rArrKrr&)rrr;r;r<rKs zPthDistributions.removecCstjjt|\}}t|j}|g}tjdkr2dp6tj}xVt||kr||jkrn|jtj |j |j |Stjj|\}}|j|q:W|SdS)Nr) r>r?rr!rraltseprrcurdirrr )rr?ZnpathZlastZbaselenrrr;r;r<rs    zPthDistributions.make_relativeN) rrrrrrrrrrrJrKrr;r;r;r<r3*s  c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs(|jVx|D] }|VqW|jVdS)N)preludepostlude)clsrrr;r;r<rs  z#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) z import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)rrr classmethodrr"rr r;r;r;r<rs  rZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtStjtjjS)z_ Return a regular expression based on first_line_re suitable for matching strings. )rrpatternr9recompilerar;r;r;r<_first_line_res rcCsd|tjtjgkr.tjdkr.t|tj||Stj\}}}t j ||d|dd||ffdS)Nrrrz %s %s) r>rrKrrdrS_IWRITErrrZreraise)funcargexcZetZevr}r;r;r< auto_chmods  rcCs.t|}t|tj|r"t|nt|dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r!_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)Z dist_pathrvnormalized_pathr;r;r<rys <  rycCsTg}t|}xB|D]:}t|}|j|r|||dtjdfkr|j|qW|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rr)rr!rnr>rr)rcacheresultZ prefix_lenpZnpr;r;r<"_collect_zipimporter_cache_entriess   rcCsDx>t||D]0}||}||=|o*|||}|dk r |||<q WdS)a Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r)rrupdaterr old_entryZ new_entryr;r;r<_update_zipimporter_cache*s  r!cCst||dS)N)r!)rrr;r;r<rJsrcCsdd}t|tj|ddS)NcSs |jdS)N)clear)r?r r;r;r<2clear_and_remove_cached_zip_archive_directory_dataOszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data)r)r!rs_zip_directory_cache)rr#r;r;r<rNsrZ__pypy__cCsdd}t|tj|ddS)NcSs&|jtj||jtj||S)N)r"rsrtupdater$)r?r r;r;r<)replace_cached_zip_archive_directory_dataes zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data)r)r!rsr$)rr&r;r;r<rds rc Cs2yt||dWnttfk r(dSXdSdS)z%Is this string a valid Python script?execFTN)r SyntaxError TypeError)rOrr;r;r< is_pythonws r+cCsJy(tj|dd}|jd}WdQRXWnttfk r@|SX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)rrNz#!)rrrrr)r&fpmagicr;r;r<is_shs r.cCs tj|gS)z@Quote a command line argument according to Windows parsing rules) subprocess list2cmdline)rr;r;r< nt_quote_argsr1cCsH|jds|jdrdSt||r&dS|jdrDd|jdjkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. z.pyz.pywTz#!rrF)rDr+rn splitlinesr')r_rr;r;r<r\s  r\)rdcGsdS)Nr;)rr;r;r<_chmodsr3cCsRtjd||yt||Wn0tjk rL}ztjd|WYdd}~XnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r rr3r>error)r?rer|r;r;r<rds rdc@seZdZdZgZeZeddZeddZ eddZ edd Z ed d Z d d Z eddZddZeddZeddZdS) CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S)zV Choose the best CommandSpec class based on environmental conditions. r;)r r;r;r<rYszCommandSpec.bestcCstjjtj}tjjd|S)N__PYVENV_LAUNCHER__)r>r?rBrr&rr)r Z_defaultr;r;r<_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dkr0|jS|j|S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rrfrom_environment from_string)r Zparamr;r;r< from_params  zCommandSpec.from_paramcCs||jgS)N)r7)r r;r;r<r8szCommandSpec.from_environmentcCstj|f|j}||S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )shlexr split_args)r stringrr;r;r<r9szCommandSpec.from_stringcCs8tj|j||_tj|}t|s4dg|jdd<dS)Nz-xr)r;r_extract_optionsoptionsr/r0rH)rr_cmdliner;r;r<install_optionss zCommandSpec.install_optionscCs:|djd}tj|}|r.|jdp0dnd}|jS)zH Extract any options from the first line of the script. rJrrr)r2rmatchgrouprM)Z orig_scriptfirstrBr?r;r;r<r>s zCommandSpec._extract_optionscCs|j|t|jS)N)_renderrr?)rr;r;r< as_headerszCommandSpec.as_headercCs6d}x,|D]$}|j|r |j|r |ddSq W|S)Nz"'rr)rnrD)itemZ_QUOTESqr;r;r< _strip_quotess  zCommandSpec._strip_quotescCs tjdd|D}d|dS)Ncss|]}tj|jVqdS)N)r5rIrM)rrGr;r;r<rsz&CommandSpec._render..z#!rJ)r/r0)rr@r;r;r<rEszCommandSpec._renderN)rrrrr?rr<r rYr7r:r8r9rArr>rFrIrEr;r;r;r<r5s       r5c@seZdZeddZdS)WindowsCommandSpecF)rN)rrrrr<r;r;r;r<rJsrJc@seZdZdZejdjZeZ e dddZ e dddZ e dd d Z ed d Ze d dZe ddZe ddZe dddZdS)rXz` Encapsulates behavior around writing entry point scripts for console and gui apps. a # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) NFcCs6tjdt|rtntj}|jd||}|j||S)Nz Use get_argsr)warningsrDeprecationWarningWindowsScriptWriterrXrYget_script_headerrZ)r rr&wininstwriterheaderr;r;r<get_script_argss zScriptWriter.get_script_argscCs6tjdt|rd}|jjj|}|j||jS)NzUse get_headerz python.exe)rKrrLcommand_spec_classrYr:rArF)r r_r&rOcmdr;r;r<rN's   zScriptWriter.get_script_headerc cs|dkr|j}t|j}xjdD]b}|d}xT|j|jD]B\}}|j||jt}|j||||} x| D] } | VqrWq>Wq"WdS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. NconsoleguiZ_scripts)rUrV) r^r9rNZ get_entry_mapr_ensure_safe_namerr_get_script_args) r rrQrtype_rCrZepr_rrr;r;r<rZ1s     zScriptWriter.get_argscCstjd|}|rtddS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rsearchr)rZ has_path_sepr;r;r<rWCs zScriptWriter._ensure_safe_namecCs tjdt|rtjS|jS)NzUse best)rKrrLrMrY)r Z force_windowsr;r;r< get_writerLs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tjS|SdS)zD Select the best ScriptWriter for this environment. win32javarN)rr{r>r_namerMrY)r r;r;r<rYRszScriptWriter.bestccs|||fVdS)Nr;)r rYrrQr_r;r;r<rX\szScriptWriter._get_script_argsrcCs"|jjj|}|j||jS)z;Create a #! line, getting options (if any) from script_text)rSrYr:rArF)r r_r&rTr;r;r<r^as zScriptWriter.get_header)NF)NF)N)rN)rrrrrKrLrrr5rSr rRrNrZrrWr[rYrXr^r;r;r;r<rX s       rXc@sLeZdZeZeddZeddZeddZeddZ e d d Z d S) rMcCstjdt|jS)NzUse best)rKrrLrY)r r;r;r<r[ls zWindowsScriptWriter.get_writercCs"tt|d}tjjdd}||S)zC Select the best ScriptWriter suitable for Windows )r&ZnaturalZSETUPTOOLS_LAUNCHERr&)rWindowsExecutableLauncherWriterr>rr)r Z writer_lookupZlauncherr;r;r<rYrs zWindowsScriptWriter.bestc #stddd|}|tjdjjdkrBdjft}tj|t dddd d dd g}|j ||j ||}fd d |D}|||d|fVdS)z For Windows, add a .py extensionz.pyaz.pyw)rUrVZPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.z.pyz -script.pyz.pycz.pyoz.execsg|] }|qSr;r;)rrb)rr;r<rsz8WindowsScriptWriter._get_script_args..rbN) rr>rr'rrrrKr UserWarningrK_adjust_header) r rYrrQr_extrrrr;)rr<rXs   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tjtj|tj}|j||d}|j|rJ|S|S)z Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). z pythonw.exez python.exerV)r=repl)rrescape IGNORECASEsub _use_header)r rYZ orig_headerr rdZ pattern_ob new_headerr;r;r<rbs z"WindowsScriptWriter._adjust_headercCs$|ddjd}tjdkp"t|S)z Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. rr"r\r)rMrr{r)riZ clean_headerr;r;r<rhs zWindowsScriptWriter._use_headerN) rrrrJrSr r[rYrXrbrrhr;r;r;r<rMis    rMc@seZdZeddZdS)r_c #s|dkrd}d}dg}nd}d}dddg}|j||}fd d |D} |||d | fVd t|d fVtsd} | td fVdS)zG For Windows, add a .py extension and an .exe launcher rVz -script.pywz.pywZcliz -script.pyz.pyz.pycz.pyocsg|] }|qSr;r;)rrb)rr;r<rszDWindowsExecutableLauncherWriter._get_script_args..rbz.exernz .exe.manifestN)rbget_win_launcherr=load_launcher_manifest) r rYrrQr_Z launcher_typercrZhdrrZm_namer;)rr<rXs   z0WindowsExecutableLauncherWriter._get_script_argsN)rrrr rXr;r;r;r<r_sr_cCs2d|}tr|jdd}n |jdd}td|S)z Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exe.z-64.z-32.r)r=rNr")typeZ launcher_fnr;r;r<rks  rkcCs0tjtd}tjr|tS|jdtSdS)Nzlauncher manifest.xmlzutf-8)r$r"rrPY2varsra)rZmanifestr;r;r<rls  rlFcCstj|||S)N)rQr)r? ignore_errorsonerrorr;r;r<rsrcCstjd}tj||S)N)r>umask)Ztmpr;r;r<rcs  rccCs:ddl}tjj|jd}|tjd<tjj|tdS)Nr) rr>r?r#__path__rargvrr5)rZargv0r;r;r< bootstraps   rwc sddlm}ddlmGfddd}|dkrBtjdd}t0|fddd g|tjdpfd|d |WdQRXdS) Nr)setup)r(cseZdZdZfddZdS)z-main..DistributionWithoutHelpCommandsrc s(tj|f||WdQRXdS)N) _patch_usage _show_help)rrkw)r(r;r<rz sz8main..DistributionWithoutHelpCommands._show_helpN)rrrZ common_usagerzr;)r(r;r<DistributionWithoutHelpCommandssr|rz-qr2z-v)Z script_argsr-Z distclass)rrxZsetuptools.distr(rrvry)rvr{rxr|r;)r(r<r5s    c #sLddl}tjdjfdd}|jj}||j_z dVWd||j_XdS)Nrze usage: %(script)s [options] requirement_or_url ... or: %(script)s --help csttjj|dS)N)Zscript)rr>r?r))r-)USAGEr;r< gen_usage sz_patch_usage..gen_usage)Zdistutils.corerKrLrZcorer~)rr~Zsavedr;)r}r<ry s   ry)N)r')N)rrrrrrZdistutils.errorsrrrr Zdistutils.command.installr r rr r Zdistutils.command.build_scriptsrr(rrr>rsrQr6rrrr rKrKrr9rr/r;rZsetuptools.externrZsetuptools.extern.six.movesrrrrZsetuptools.sandboxrZsetuptools.py31compatrrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrr$r r!r"r#r$r%r&r'r(r)r*r+r,r-r.Zpkg_resources.py31compatfilterwarningsZ PEP440Warning__all__r=r1rorErHr"r2rrrr4r6r3rrrrrryrr!rrbuiltin_module_namesrr+r.r1r\rdr3 ImportErrorrr5r7Zsys_executablerJobjectrXrMr_rRrNrkrlrrcrwr5rryr;r;r;r< s           D |A))'l R    T`A  PK!c!QQ+command/__pycache__/egg_info.cpython-36.pycnu[3 vh`@sdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+ddZ,GdddeZ-GdddeZGdddeZ.ddZ/ddZ0ddZ1dd Z2d!d"Z3d#d$Z4d%d&Z5d'd(Z6d0d*d+Z7d,d-Z8d.d/Z9dS)1zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError) convert_path)logN)six)map)Command)sdist) walk_revctrl) edit_config) bdist_egg)parse_requirements safe_name parse_version safe_version yield_lines EntryPointiter_entry_points to_filename)glob) packagingcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkrv|rd|d7}q4|d||f7}q4d}t|} x:|| kr||} | dkr||d7}n| d kr||7}n| d kr|d} | | kr|| d kr| d} | | kr|| d kr| d} x&| | kr6|| d kr6| d} qW| | krR|tj| 7}nR||d| } d} | dd krd } | dd} | tj| 7} |d| f7}| }n|tj| 7}|d7}qW|s4||7}q4W|d7}tj|tj tj BdS)z Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. z[^%s]z**z.*z (?:%s+%s)*r*?[!]^Nz[%s]z\Z)flags) splitospathsepreescape enumeratelencompile MULTILINEDOTALL)rZpatZchunksr#Z valid_charcchunkZ last_chunkiZ chunk_lencharZinner_iinnerZ char_classr0/usr/lib/python3.6/egg_info.pytranslate_pattern$sV         r2c@seZdZdZd)d*d+d,gZdgZd diZddZeddZ e j ddZ ddZ ddZ d-ddZ ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S).egg_infoz+create a distribution's .egg-info directory egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)tag-dated0Add date stamp (e.g. 20050528) to version number tag-build=b-Specify explicit tag to add to version numberno-dateD"Don't include date stamp [default]cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)egg_name egg_versionegg_baser3 tag_buildtag_datebroken_egg_infovtags)selfr0r0r1initialize_optionsszegg_info.initialize_optionscCsdS)Nr0)rGr0r0r1tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr0)rGvaluer0r0r1rIscCs0tj}|j|d<d|d<t|t|ddS)z Materialize the value of date into the build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. rCrrD)r3N) collections OrderedDicttagsr dict)rGfilenamer3r0r0r1save_version_infos zegg_info.save_version_infoc CsVt|jj|_|j|_|j|_t|j}y6t |t j j }|rFdnd}t t||j|jfWn,tk rtjjd|j|jfYnX|jdkr|jj}|pijdtj|_|jdt|jd|_|jtjkrtjj|j|j|_d|jkr|j|j|jj_ |jj}|dk rR|j |jj!krR|j|_"t|j|_#d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrBz .egg-info-)$r distributionZget_namer@rMrFtagged_versionrAr isinstancerversionZVersionlistr ValueError distutilserrorsZDistutilsOptionErrorrBZ package_dirgetr!curdirZensure_dirnamerr3r"joincheck_broken_egg_infometadataZ _patched_distkeylowerZ_versionZ_parsed_version)rGZparsed_versionZ is_versionspecdirsZpdr0r0r1finalize_optionss8          zegg_info.finalize_optionsFcCsN|r|j|||n6tjj|rJ|dkr@| r@tjd||dS|j|dS)aWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists) write_filer!r"existsrwarn delete_file)rGwhatrOdataforcer0r0r1write_or_delete_files   zegg_info.write_or_delete_filecCsDtjd||tjr|jd}|js@t|d}|j||jdS)zWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %szutf-8wbN) rinforZPY3encodedry_runopenwriteclose)rGrhrOrifr0r0r1rds   zegg_info.write_filecCs tjd||jstj|dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrmror!unlink)rGrOr0r0r1rgs zegg_info.delete_filecCs2|jj}|jr$|j|jr$t|St||jS)N)rRZ get_versionrFendswithr)rGrUr0r0r1rSs zegg_info.tagged_versioncCs|j|j|jj}x@tdD]4}|j|d|j}|||jtj j |j|jqWtj j |jd}tj j |r||j ||j dS)Nzegg_info.writers) installerznative_libs.txt)Zmkpathr3rRZfetch_build_eggrZrequireZresolvenamer!r"r\rerg find_sources)rGrvepwriternlr0r0r1run s     z egg_info.runcCs,d}|jr||j7}|jr(|tjd7}|S)Nrz-%Y%m%d)rCrDtimeZstrftime)rGrUr0r0r1rMs  z egg_info.tagscCs4tjj|jd}t|j}||_|j|j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"r\r3manifest_makerrRmanifestr|filelist)rGZmanifest_filenameZmmr0r0r1rx s  zegg_info.find_sourcescCsd|jd}|jtjkr&tjj|j|}tjj|r`tjddddd||j |j |_ ||_ dS)Nz .egg-inforQNz Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ) r@rBr!r[r"r\rerrfr3rE)rGZbeir0r0r1r](s    zegg_info.check_broken_egg_infoN)r4r5r6)r7r8r9)r:r;r<)r=r>r?)F)__name__ __module__ __qualname__ descriptionZ user_optionsZboolean_optionsZ negative_optrHpropertyrIsetterrPrcrkrdrgrSr|rMrxr]r0r0r0r1r3ws(  / r3c@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rcCs<|j|\}}}}|dkrV|jddj|x"|D]}|j|s4tjd|q4Wn|dkr|jddj|x"|D]}|j|sxtjd|qxWn|dkr|jd dj|x"|D]}|j|stjd |qWnZ|d kr(|jd dj|x&|D]}|j|stjd |qWn|dkrx|jd|dj|fx|D]"}|j ||sPtjd||qPWn|dkr|jd|dj|fx|D]"}|j ||stjd||qWnp|dkr|jd||j |s8tjd|n>|dkr,|jd||j |s8tjd|n t d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_line debug_printr\rrrfrglobal_includeglobal_excluderecursive_includerecursive_excluderrr)rGlineactionZpatternsdirZ dir_patternpatternr0r0r1process_template_line;sd                 zFileList.process_template_linecCsVd}xLtt|jdddD]2}||j|r|jd|j||j|=d}qW|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing Tr)ranger'filesr)rGZ predicatefoundr-r0r0r1 _remove_filesszFileList._remove_filescCs$ddt|D}|j|t|S)z#Include files that match 'pattern'.cSsg|]}tjj|s|qSr0)r!r"isdir).0rsr0r0r1 sz$FileList.include..)rextendbool)rGrrr0r0r1rs zFileList.includecCst|}|j|jS)z#Exclude files that match 'pattern'.)r2rmatch)rGrrr0r0r1rszFileList.excludecCs8tjj|d|}ddt|ddD}|j|t|S)zN Include all files anywhere in 'dir/' that match the pattern. z**cSsg|]}tjj|s|qSr0)r!r"r)rrsr0r0r1rsz.FileList.recursive_include..T) recursive)r!r"r\rrr)rGrrZ full_patternrr0r0r1rs zFileList.recursive_includecCs ttjj|d|}|j|jS)zM Exclude any file anywhere in 'dir/' that match the pattern. z**)r2r!r"r\rr)rGrrrr0r0r1rszFileList.recursive_excludecCs$ddt|D}|j|t|S)zInclude all files from 'dir/'.cSs"g|]}tjj|D]}|qqSr0)rXrfindall)rZ match_diritemr0r0r1rsz"FileList.graft..)rrr)rGrrr0r0r1rs  zFileList.graftcCsttjj|d}|j|jS)zFilter out files from 'dir/'.z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.prunecsJ|jdkr|jttjjd|fdd|jD}|j|t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nz**csg|]}j|r|qSr0)r)rrs)rr0r1rsz+FileList.global_include..)Zallfilesrr2r!r"r\rr)rGrrr0)rr1rs   zFileList.global_includecCsttjjd|}|j|jS)zD Exclude all files anywhere that match the pattern. z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.global_excludecCs8|jdr|dd}t|}|j|r4|jj|dS)N rr)rur _safe_pathrappend)rGrr"r0r0r1rs    zFileList.appendcCs|jjt|j|dS)N)rrfilterr)rGpathsr0r0r1rszFileList.extendcCstt|j|j|_dS)z Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)rVrrr)rGr0r0r1_repairszFileList._repairc Csd}tj|}|dkr(tjd|dStj|d}|dkrNtj||ddSy tjj|shtjj|rldSWn&tk rtj||t j YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T) unicode_utilsfilesys_decoderrfZ try_encoder!r"reUnicodeEncodeErrorsysgetfilesystemencoding)rGr"Zenc_warnZu_pathZ utf8_pathr0r0r1rs  zFileList._safe_pathN)rrrrrrrrrrrrrrrrrr0r0r0r1r8sI     rc@s\eZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ dS)r~z MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifest)rGr0r0r1rHsz!manifest_maker.initialize_optionscCsdS)Nr0)rGr0r0r1rcszmanifest_maker.finalize_optionscCsdt|_tjj|js|j|jtjj|jr<|j |j |jj |jj |jdS)N) rrr!r"rerwrite_manifest add_defaultstemplateZ read_templateprune_file_listsortZremove_duplicates)rGr0r0r1r|s  zmanifest_maker.runcCstj|}|jtjdS)N/)rrreplacer!r#)rGr"r0r0r1_manifest_normalizes z"manifest_maker._manifest_normalizecsBjjfddjjD}dj}jtj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}j|qSr0)r)rrs)rGr0r1r sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrZexecuterd)rGrmsgr0)rGr1rs  zmanifest_maker.write_manifestcCs|j|stj||dS)N)_should_suppress_warningr rf)rGrr0r0r1rf$s zmanifest_maker.warncCs tjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r)rr0r0r1r(sz'manifest_maker._should_suppress_warningcCsttj||jj|j|jj|jtt}|rB|jj|nt j j |jrX|j |j d}|jj|jdS)Nr3)r rrrrrrVr rr!r"reZ read_manifestget_finalized_commandrr3)rGZrcfilesZei_cmdr0r0r1r/s   zmanifest_maker.add_defaultscCsZ|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rrRZ get_fullnamerrZ build_baser$r%r!r#Zexclude_pattern)rGrZbase_dirr#r0r0r1r;s    zmanifest_maker.prune_file_listN)rrrrrHrcr|rrrf staticmethodrrrr0r0r0r1r~s    r~c Cs8dj|}|jd}t|d}|j|WdQRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  zutf-8rlN)r\rnrprq)rOcontentsrsr0r0r1rdEs   rdc Cs|tjd||jsx|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j |j |dS)Nz writing %sZzip_safe)rrmrorRr^rArUr@rwwrite_pkg_infor3getattrr Zwrite_safety_flag)cmdbasenamerOr^ZoldverZoldnameZsafer0r0r1rRs rcCstjj|rtjddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"rerrf)rrrOr0r0r1warn_depends_obsoletees rcCs,t|pf}dd}t||}|j|dS)NcSs|dS)Nrr0)rr0r0r1osz%_write_requirements..)rr writelines)streamZreqslinesZ append_crr0r0r1_write_requirementsms  rcCsn|j}tj}t||j|jp"i}x2t|D]&}|jdjft t|||q.W|j d||j dS)Nz [{extra}] Z requirements) rRrStringIOrZinstall_requiresextras_requiresortedrqformatvarsrkgetvalue)rrrOZdistrirZextrar0r0r1write_requirementsts  rcCs,tj}t||jj|jd||jdS)Nzsetup-requirements)iorrrRZsetup_requiresrkr)rrrOrir0r0r1write_setup_requirementssrcCs:tjdd|jjD}|jd|djt|ddS)NcSsg|]}|jdddqS).rr)r )rkr0r0r1rsz(write_toplevel_names..ztop-level namesr)rNfromkeysrRZiter_distribution_namesrdr\r)rrrOZpkgsr0r0r1write_toplevel_namessrcCst|||ddS)NT) write_arg)rrrOr0r0r1 overwrite_argsrFcCsHtjj|d}t|j|d}|dk r4dj|d}|j||||dS)Nrr)r!r"splitextrrRr\rk)rrrOrjZargnamerJr0r0r1rs rcCs|jj}t|tjs|dkr"|}nr|dk rg}xZt|jD]J\}}t|tjsttj||}dj tt t |j }|j d||fqsR           (   SBEI    PK!.  /command/__pycache__/rotate.cpython-36.opt-1.pycnu[3 vht@s`ddlmZddlmZddlmZddlZddlZddlm Z ddl m Z Gddde Z dS) ) convert_path)log)DistutilsOptionErrorN)six)Commandc@s:eZdZdZdZdddgZgZd d ZddZddZ dS)rotatezDelete older distributionsz2delete older distributions, keeping N newest filesmatch=mpatterns to match (required) dist-dir=d%directory where the distributions arekeep=k(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/usr/lib/python3.6/rotate.pyinitialize_optionsszrotate.initialize_optionsc Cs|jdkrtd|jdkr$tdyt|j|_Wntk rPtdYnXt|jtjrxdd|jjdD|_|j dd dS) NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|jqSr)rstrip).0prrr +sz+rotate.finalize_options..,Zbdistr)rr) rrrint ValueError isinstancerZ string_typessplitZset_undefined_options)rrrrfinalize_optionss  zrotate.finalize_optionscCs|jdddlm}x|jD]}|jjd|}|tjj|j|}dd|D}|j |j t j dt ||||jd}xD|D]<\}}t j d||jstjj|rtj|qtj|qWqWdS) NZegg_infor)glob*cSsg|]}tjj||fqSr)ospathgetmtime)rfrrrr6szrotate.run..z%d file(s) matching %sz Deleting %s)Z run_commandr"rZ distributionZget_namer$r%joinrsortreverserinfolenrZdry_runisdirshutilZrmtreeunlink)rr"patternfilestr'rrrrun/s       z rotate.runN)rr r )r r r )rrr) __name__ __module__ __qualname____doc__ descriptionZ user_optionsZboolean_optionsrr!r3rrrrr sr) Zdistutils.utilrZ distutilsrZdistutils.errorsrr$r.Zsetuptools.externrZ setuptoolsrrrrrrs     PK!{AD D -command/__pycache__/build_clib.cpython-36.pycnu[3 vh@sFddljjZddlmZddlmZddlm Z GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS) build_clibav Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Cs~xv|D]l\}}|jd}|dks4t|ttf r@td|t|}tjd||jdt}t|tsxtd|g}|jdt}t|ttfstd|xX|D]P}|g} | j||j|t} t| ttfstd|| j| |j | qW|j j ||j d} t || ggfkr^|jd} |jd } |jd }|j j||j | | ||jd }|j j| ||j|jd qWdS) Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list') output_dirmacros include_dirscflags)r r r Zextra_postargsdebug)r r )get isinstancelisttuplerrinfodictextendappendZcompilerZobject_filenamesZ build_temprcompiler Zcreate_static_libr)selfZ librariesZlib_nameZ build_inforrZ dependenciesZ global_depssourceZsrc_depsZ extra_depsZexpected_objectsr r r Zobjectsr /usr/lib/python3.6/build_clib.pybuild_librariess`           zbuild_clib.build_librariesN)__name__ __module__ __qualname____doc__rrrrrrsr) Zdistutils.command.build_clibZcommandrZorigZdistutils.errorsrZ distutilsrZsetuptools.dep_utilrrrrrs    PK!9Y5 5 (command/__pycache__/alias.cpython-36.pycnu[3 vhz @sPddlmZddlmZddlmZmZmZddZGdddeZ dd Z d S) )DistutilsOptionError)map) edit_config option_base config_filecCs8xdD]}||krt|SqW|j|gkr4t|S|S)z4Quote an argument for later parsing by shlex.split()"'\#)rrr r )reprsplit)argcr/usr/lib/python3.6/alias.pyshquotes   rc@sHeZdZdZdZdZdgejZejdgZddZ d d Z d d Z d S)aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsTremoverremove (unset) the aliascCstj|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs zalias.initialize_optionscCs*tj||jr&t|jdkr&tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrr)rrrrr#s zalias.finalize_optionscCs|jjd}|jsDtdtdx|D]}tdt||q(WdSt|jdkr|j\}|jrfd}q||krtdt||dStd|dSn$|jd}djtt |jdd}t |j d||ii|j dS) NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr ) Z distributionZget_option_dictrprint format_aliasrrjoinrrrfilenameZdry_run)rrrcommandrrrrun+s&    z alias.runN)rrr) __name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsrZ user_optionsZboolean_optionsrrr#rrrrrs rcCsZ||\}}|tdkrd}n,|tdkr0d}n|tdkrBd}nd|}||d|S) Nglobalz--global-config userz--user-config Zlocalz --filename=%rr)r)namersourcer"rrrrFs    rN) Zdistutils.errorsrZsetuptools.extern.six.movesrZsetuptools.command.setoptrrrrrrrrrrs   4PK!uPP1command/__pycache__/saveopts.cpython-36.opt-1.pycnu[3 vh@s$ddlmZmZGdddeZdS)) edit_config option_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsp|j}i}xP|jD]F}|dkr qx6|j|jD]$\}\}}|dkr0||j|i|<q0WqWt|j||jdS)Nrz command line)Z distributionZcommand_optionsZget_option_dictitems setdefaultrfilenameZdry_run)selfZdistZsettingscmdoptsrcvalr /usr/lib/python3.6/saveopts.pyrun s z saveopts.runN)__name__ __module__ __qualname____doc__ descriptionrr r r rrsrN)Zsetuptools.command.setoptrrrr r r rsPK!}-command/__pycache__/test.cpython-36.opt-1.pycnu[3 vh#@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZGd d d e ZGd d d eZGd ddeZ dS)N)DistutilsErrorDistutilsOptionError)log) TestLoader)six)mapfilter) resource_listdirresource_existsnormalize_path working_set_namespace_packagesevaluate_markeradd_activation_listenerrequire EntryPoint)Commandc@seZdZddZdddZdS)ScanningLoadercCstj|t|_dS)N)r__init__set_visited)selfr/usr/lib/python3.6/test.pyrs zScanningLoader.__init__NcCs||jkrdS|jj|g}|jtj||t|drH|j|jt|drxpt|jdD]`}|j dr|dkr|jd|dd }n"t |j|d r`|jd|}nq`|j|j |q`Wt |d kr|j |S|d SdS) aReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. Nadditional_tests__path__z.pyz __init__.py.z /__init__.pyr)raddappendrloadTestsFromModulehasattrrr __name__endswithr ZloadTestsFromNamelenZ suiteClass)rmodulepatternZtestsfileZ submodulerrrr#s$      z"ScanningLoader.loadTestsFromModule)N)r% __module__ __qualname__rr#rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs ||_dS)N)fget)rr.rrrr>szNonDataProperty.__init__NcCs|dkr |S|j|S)N)r.)robjZobjtyperrr__get__AszNonDataProperty.__get__)N)r%r+r,rr0rrrrr-=sr-c@seZdZdZdZd%d&d'gZd d ZddZeddZ ddZ ddZ e j gfddZee j ddZeddZddZddZed d!Zed"d#Zd$S)(testz.Command to run unit tests after in-place buildz#run unit tests after in-place build test-module=m$Run 'test_suite' in specified module test-suite=s9Run single test, case or suite (e.g. 'module.test_suite') test-runner=rTest runner to usecCsd|_d|_d|_d|_dS)N) test_suite test_module test_loader test_runner)rrrrinitialize_optionsSsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n |jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz .test_suiter=z&setuptools.command.test:ScanningLoaderr>)r;r<r distributionr=getattrr>)rmsgrrrfinalize_optionsYs        ztest.finalize_optionscCs t|jS)N)list _test_args)rrrr test_argslsztest.test_argsccs6|j rtjdkrdV|jr$dV|jr2|jVdS)NZdiscoverz --verbose)rGrH)r;sys version_infoverbose)rrrrrEps ztest._test_argsc Cs|j |WdQRXdS)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncrrrwith_project_on_sys_pathxs ztest.with_project_on_sys_pathc csPtjot|jdd}|rv|jddd|jd|jd}t|j}|jd|d|jd|jddd|jdn"|jd|jdd d|jd|jd}t j dd}t j j }zbt|j }t j jd|tjtd d td |j|jf|j|g dVWdQRXWd|t j dd<t j jt j j|tjXdS) Nuse_2to3FZbuild_pyr)ZinplaceZegg_info)egg_baseZ build_extrcSs|jS)N)Zactivate)distrrrsz*test.project_on_sys_path..z%s==%s)rPY3rAr@Zreinitialize_commandZ run_commandZget_finalized_commandr Z build_librIpathmodulescopyrPinsertr rrrZegg_nameZ egg_versionpaths_on_pythonpathclearupdate) rZ include_distsZ with_2to3Zbpy_cmdZ build_pathZei_cmdZold_pathZ old_modulesZ project_pathrrrrLs8             ztest.project_on_sys_pathc cst}tjjd|}tjjdd}z>tjj|}td||g}tjj|}|rX|tjd<dVWd||krztjjddn |tjd<XdS)z Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. PYTHONPATHrN)objectosenvirongetpathsepjoinrpop)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrXs     ztest.paths_on_pythonpathcCsD|j|j}|j|jpg}|jdd|jjD}tj|||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css0|](\}}|jdrt|ddr|VqdS):rN) startswithr).0kvrrr sz%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ tests_requireZextras_requireitems itertoolschain)rQZir_dZtr_dZer_drrr install_distss  ztest.install_distscCs|j|j}dj|j}|jr0|jd|dS|jd|ttjd|}|j |"|j |j WdQRXWdQRXdS)N zskipping "%s" (dry run)z running "%s"location) ror@ra_argvZdry_runannounceroperator attrgetterrXrL run_tests)rZinstalled_distscmdrcrrrruns    ztest.runcCstjrt|jddr|jjdd}|tkrg}|tjkrD|j ||d7}x"tjD]}|j |rT|j |qTWt t tjj |tjdd|j|j|j|j|jdd}|jjsd|j}|j|tjt|dS)NrOFrr)Z testLoaderZ testRunnerexitzTest failed: %s)rrSrAr@r;splitr rIrUr"rgrDr __delitem__unittestmainrr_resolve_as_epr=r>resultZ wasSuccessfulrsrZERRORr)rr(Z del_modulesnamer1rBrrrrvs(        ztest.run_testscCs dg|jS)Nr|)rF)rrrrrrsz test._argvcCs$|dkr dStjd|}|jS)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. Nzx=)rparseZresolve)valZparsedrrrr~sztest._resolve_as_epN)r2r3r4)r5r6r7)r8r9r:)r%r+r,__doc__ descriptionZ user_optionsr?rCr-rFrErN contextlibcontextmanagerrL staticmethodrXrorxrvpropertyrrr~rrrrr1Gs( -  r1)!r]rtrIrrmr|Zdistutils.errorsrrZ distutilsrrZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesr r r r r rrrrZ setuptoolsrrr\r-r1rrrrs   , ) PK!}5command/__pycache__/easy_install.cpython-36.opt-1.pycnu[3 vhT @sdZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&m'Z'dd l(m)Z)m*Z*dd l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4mm?Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOdd lPZ@ejQde@jRdddddddgZSdd ZTd!dZUe'jVr2d"d#ZWd$d%ZXnd&d#ZWd'd%ZXd(d)ZYGd*dde,ZZd+d,Z[d-d.Z\d/d0Z]d1dZ^d2dZ_Gd3ddeGZ`Gd4d5d5e`Zaejbjcd6d7d8kreaZ`d9d:Zdd;d<Zed=d>Zfd?d@ZgdpdAdBZhdCdDZidEdFZjdGejkkrejZlndHdIZldqdKdLZmdMdNZndOdPZodQdRZpyddSlmqZrWnesk r^dTdUZrYnXdVdWZqGdXdYdYetZueujvZwGdZd[d[euZxGd\d]d]eyZzGd^d_d_ezZ{Gd`dadae{Z|ezj}Z}ezj~Z~dbdcZdddeZdfeefdgdhZdidjZdkdlZdrdmdZe"jdndoZd S)sa% Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/easy_install.html )glob) get_platform) convert_path subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMES SCHEME_KEYS)logdir_util) first_line_re)find_executableN)six) configparsermap)Command) run_setup)get_pathget_config_vars) rmtree_safe)setopt)unpack_archive) PackageIndexparse_requirement_arg URL_SCHEME) bdist_eggegg_info)Wheel) yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributions Environment Requirement Distribution PathMetadata EggMetadata WorkingSetDistributionNotFoundVersionConflict DEVELOP_DISTdefault)categorysamefile easy_installPthDistributionsextract_wininst_cfgmainget_exe_prefixescCstjddkS)NP)structcalcsizer;r;"/usr/lib/python3.6/easy_install.pyis_64bitIsr=cCsjtjj|otjj|}ttjdo&|}|r:tjj||Stjjtjj|}tjjtjj|}||kS)z Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r1)ospathexistshasattrr1normpathnormcase)Zp1Zp2Z both_existZ use_samefileZnorm_p1Znorm_p2r;r;r<r1MscCs|S)Nr;)sr;r;r< _to_ascii_srEc Cs*ytj|ddStk r$dSXdS)NasciiTF)rZ text_type UnicodeError)rDr;r;r<isasciibs  rHcCs |jdS)NrF)encode)rDr;r;r<rEjsc Cs(y|jddStk r"dSXdS)NrFTF)rIrG)rDr;r;r<rHms  cCstj|jjddS)N z; )textwrapdedentstripreplace)textr;r;r<usrPc@seZdZdZdZdZdddddddddddddddddddddgZdd dd dd0d3d9ddddZ?ejdj Z@ddZAddZBddZCddZDddZEddZFddZGddZHejdj ZIddZJddZKddZLeMeMddddZNeMdddZOddZPdS)r2z'Manage a download/build/install processz Find/get/install Python packagesTprefix=Ninstallation prefixzip-okzinstall package as a zipfile multi-versionm%make apps have to require() a versionupgradeU1force upgrade (searches PyPI for latest versions) install-dir=dinstall package to DIR script-dir=rDinstall scripts to DIRexclude-scriptsxDon't install scripts always-copya'Copy all needed packages to install dir index-url=i base URL of Python Package Index find-links=f(additional URL(s) to search for packagesbuild-directory=b/download/extract/build in DIR; keep the results optimize=Olalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]record=3filename in which to record list of installed files always-unzipZ*don't install as a zipfile, no matter what site-dirs=S)list of directories where .pth files workeditablee+Install specified packages in editable formno-depsNdon't install dependencies allow-hosts=H$pattern(s) that hostnames must matchlocal-snapshots-okl(allow building eggs from local checkoutsversion"print version information and exit no-find-links9Don't load find-links defined in packages being installedz!install in user site-package '%s'usercCs,d|_d|_|_d|_|_|_d|_d|_d|_d|_ d|_ |_ d|_ |_ |_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrtj |_!tj"|_#n d|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*d|_+|j,j-|_-|j,j.||j,j/ddS)NrFr2)0rzip_oklocal_snapshots_ok install_dir script_direxclude_scripts index_url find_linksbuild_directoryargsoptimizerecordrY always_copy multi_versionr{no_deps allow_hostsrootprefix no_reportrinstall_purelibinstall_platlibinstall_headers install_libinstall_scripts install_data install_baseinstall_platbasesiteENABLE_USER_SITE USER_BASEinstall_userbase USER_SITEinstall_usersite no_find_links package_indexpth_filealways_copy_from site_dirsinstalled_projectssitepy_installedZ_dry_run distributionverboseZ_set_command_optionsget_option_dict)selfr;r;r<initialize_optionssF     zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tjj|stjj|r|VqdS)N)r>r?r@islink).0filenamer;r;r< sz/easy_install.delete_blockers..)listr _delete_path)rblockersZextant_blockersr;r;r<delete_blockersszeasy_install.delete_blockerscCsJtjd||jrdStjj|o.tjj| }|r8tntj}||dS)Nz Deleting %s) r infodry_runr>r?isdirrrmtreeunlink)rr?Zis_treeZremoverr;r;r<rs  zeasy_install._delete_pathcCs6tjdd}td}d}t|jfttdS)zT Render the Setuptools version and installation details, then exit. N setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver}))sysrr$printformatlocals SystemExit)Zverdisttmplr;r;r<_render_versions zeasy_install._render_versionc Cst|jo |jtjjd}tdd\}}|jj|jj|jj||dd|d|d||||t tddd |_ t j r|j |j d <|j|j d <|j|j|j|jd d d d|jdkr|j|_|jdkrd|_|jdd!|jdd"|jr|jr|j|_|j|_|jdd#tttj}t|_|jdk rdd|jjdD}xV|D]N}t jj!|s~t"j#d|n,t||krt$|dn|jj%t|q^W|j&s|j'|j(pd|_(|jdd|_)x4|jt|jfD] }||j)kr|j)j*d|qW|j+dk r8dd|j+jdD}ndg}|j,dkr`|j-|j(|j)|d|_,t.|j)tj|_/|j0dk rt1|j0t2j3r|j0j|_0ng|_0|j4r|j,j5|j)tj|js|j,j6|j0|jdd$t1|j7t8s@y2t8|j7|_7d|j7kodknst9Wnt9k r>t$dYnX|j&rZ|j: rZt;d|j<sjt;d g|_=dS)%Nrr exec_prefixrabiflags) Z dist_nameZ dist_versionZ dist_fullname py_versionpy_version_shortpy_version_nodotZ sys_prefixrZsys_exec_prefixrruserbaseZusersiterrrrFrrinstallrcSsg|]}tjj|jqSr;)r>r? expanduserrM)rrDr;r;r< 3sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }|jqSr;)rM)rrDr;r;r<rHs*)Z search_pathhostsrz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))rr)rr)rr)rr)>rrrsplitrrZget_nameZ get_versionZ get_fullnamegetattr config_varsrrrr_fix_install_dir_for_user_siteexpand_basedirs expand_dirs_expandrrrZset_undefined_optionsrrrrr!r? get_site_dirs all_site_dirsrr>rr warnrappendr{check_site_dirr shadow_pathinsertrr create_indexr& local_indexr isinstancerZ string_typesrZscan_egg_linksadd_find_linksrint ValueErrorrrroutputs) rrrrrBrr]Z path_itemrr;r;r<finalize_optionss                zeasy_install.finalize_optionscCs`|j stj rdS|j|jdkr2d}t||j|_|_tj j ddd}|j |dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedposixZunixZ_user) rrrcreate_home_pathrr rrr>namerN select_scheme)rmsgZ scheme_namer;r;r<rms z+easy_install._fix_install_dir_for_user_sitecCs\xV|D]N}t||}|dk rtjdks0tjdkrrr?rrrsetattr)rattrsattrvalr;r;r< _expand_attrs|s    zeasy_install._expand_attrscCs|jdddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rrrN)r)rr;r;r<rszeasy_install.expand_basedirscCsddddddg}|j|dS)z+Calls `os.path.expanduser` on install dirs.rrrrrrN)r)rdirsr;r;r<rszeasy_install.expand_dirsc Cs|j|jjkrtj|jzx|jD]}|j||j q$W|jr|j}|j rt |j }x(t t |D]}|||d||<qfWddl m }|j|j|j|fd|j|jWdtj|jjXdS)Nr) file_utilz'writing list of installed files to '%s')rrr set_verbosityrr2rrrrlenrange distutilsrexecuteZ write_filewarn_deprecated_options)rspecrZroot_lenZcounterrr;r;r<runs$       zeasy_install.runc CsDy tj}Wn"tk r.tjdtj}YnXtjj|j d|S)zReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r>getpid ExceptionrandomZrandintrmaxsizer?joinr)rpidr;r;r<pseudo_tempnames  zeasy_install.pseudo_tempnamecCsdS)Nr;)rr;r;r<rsz$easy_install.warn_deprecated_optionscCsdt|j}tjj|d}tjj|sTytj|Wn ttfk rR|j YnX||j k}| rv|j rv|j }nd|j d}tjj|}y*|rtj|t|djtj|Wn ttfk r|j YnX| r|j rt|j|r|jdkrt||j |_nd|_|tttkr6d|_n$|j rZtjj| rZd|_d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededzeasy-install.pthz .write-testwNT)r!rr>r?r r@makedirsOSErrorIOErrorcant_write_to_targetrrcheck_pth_processingrropencloserno_default_version_msgrr3r _pythonpathr)rinstdirrZ is_site_dirZtestfileZ test_existsr;r;r<rs>         zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/easy_install.html Please make the appropriate changes for your system and try again. cCsP|jtjd|jf}tjj|js6|d|j7}n|d|j7}t |dS)NrJ) _easy_install__cant_write_msgrexc_inforr>r?r@_easy_install__not_exists_id_easy_install__access_msgr)rrr;r;r<rs z!easy_install.cant_write_to_targetc Cs|j}tjd||jd}|d}tjj|}tdd}y8|rNtj|tjj |}t j j |ddt |d}Wn ttfk r|jYnXz|j|jft|jd }tj}tjd krtjj|\}} tjj|d } | jd kotjj| } | r| }d dlm} | |dddgd tjj|rJtjd|dSWd |r\|jtjj|rttj|tjj|rtj|X|jstjd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %sz.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rJT)exist_okrNrz pythonw.exez python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rr rrr>r?r@ _one_linerrdirname pkg_resourcesZ py31compatrrrrrwriterrrr executablerrr lowerdistutils.spawnr rr) rrrZok_fileZ ok_existsrr#rkr&basenameZaltZuse_altr r;r;r<rsV            z!easy_install.check_pth_processingcCs\|j rN|jdrNx:|jdD],}|jd|r2q|j|||jd|qW|j|dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rZmetadata_isdirZmetadata_listdirinstall_scriptZ get_metadatainstall_wrapper_scripts)rr script_namer;r;r<install_egg_scriptsSsz easy_install.install_egg_scriptscCs\tjj|rLxJtj|D].\}}}x"|D]}|jjtjj||q(WqWn |jj|dS)N)r>r?rwalkrrr )rr?baserfilesrr;r;r< add_outputas    zeasy_install.add_outputcCs|jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)r{r)rrr;r;r< not_editableiszeasy_install.not_editablecCs<|js dStjjtjj|j|jr8td|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)r{r>r?r@r rkeyr)rrr;r;r<check_editableqs zeasy_install.check_editablec cs@tjtjdd}zt|VWdtjj|o8tt |XdS)Nz easy_install-)r) tempfilemkdtemprustrr>r?r@rr)rtmpdirr;r;r<_tmpdir{szeasy_install._tmpdirFcCs|js|j|j}t|tst|rT|j||jj||}|j d|||dSt j j |r||j||j d|||dSt |}|j||jj|||j|j|j |j}|dkrd|}|jr|d7}t|n0|jtkr|j|||d|S|j ||j||SWdQRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)r{install_site_pyr;rr'rr3rdownload install_itemr>r?r@rr5Zfetch_distributionrYrrrZ precedencer.process_distributionlocation)rrdepsr:dlrrr;r;r<r2s2         zeasy_install.easy_installcCs|p|j}|ptjj||k}|p,|jd }|pT|jdk oTtjjt|t|jk}|r| rx$|j|jD]}|j |krnPqnWd}t j dtjj ||r|j |||}x<|D]}|j|||qWn |j|g}|j||d|d|dk rx|D]}||kr|SqWdS)Nz.eggTz Processing %srr<)rr>r?r#endswithrr!r project_namerAr rr) install_eggsr@egg_distribution)rrr>r:rBZinstall_neededrZdistsr;r;r<r?s.         zeasy_install.install_itemcCs@t|}x2tD]*}d|}t||dkrt||||qWdS)z=Sets the install directories by applying the install schemes.Zinstall_N)r r rr)rrschemer4Zattrnamer;r;r<rs  zeasy_install.select_schemecGs|j||jj|||j|jkr2|jj||jj||j|||j|j<tj |j ||f||j dr|j r|jj |jd| r|j rdS|dk r|j|jkrtjd|dS|dks||kr|j}tt|}tj d|ytgj|g|j|j}Wn^tk rB}ztt|WYdd}~Xn0tk rp}zt|jWYdd}~XnX|js|jrx*|D]"}|j|jkr|j|jqWtj d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s) update_pthraddrr4remover.rr rinstallation_report has_metadatarrZget_metadata_linesrras_requirementr'r9r+Zresolver2r,rr-Zreportr)rZ requirementrrBrZdistreqZdistrosr|r;r;r<r@sB            z!easy_install.process_distributioncCs2|jdk r|j S|jdr dS|jds.dSdS)Nz not-zip-safeTzzip-safeF)rrM)rrr;r;r< should_unzips   zeasy_install.should_unzipcCstjj|j|j}tjj|r:d}tj||j|j||Stjj|rL|}nRtjj ||krftj |tj |}t |dkrtjj||d}tjj|r|}t |tj|||S)Nz<%r already exists in %s; build directory %s will not be keptrr)r>r?r rr4r@r rrr#rlistdirrr#shutilmove)rr dist_filename setup_basedstrcontentsr;r;r< maybe_moves"       zeasy_install.maybe_movecCs0|jr dSx tjj|D]}|j|qWdS)N)r ScriptWriterbestget_args write_script)rrrr;r;r<r,sz$easy_install.install_wrapper_scriptscCsNt|j}t||}|r8|j|t}tj||}|j|t|ddS)z/Generate a legacy script wrapper and install itrnN) r9rNis_python_script_load_templaterrX get_headerr[rE)rrr- script_textdev_pathrZ is_scriptZbodyr;r;r<r+"s   zeasy_install.install_scriptcCs(d}|r|jdd}td|}|jdS)z There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplrzutf-8)rNr"decode)r`rZ raw_bytesr;r;r<r],s   zeasy_install._load_templatetc sjfdd|Dtjd|jtjjj|}j|jrLdSt }t |tjj |rptj |t |d|}|j|WdQRXt|d|dS)z1Write an executable file to the scripts directorycsg|]}tjjj|qSr;)r>r?r r)rrb)rr;r<r>sz-easy_install.write_script..zInstalling %s script to %sNri)rr rrr>r?r r2r current_umaskr#r@rrr%chmod)rr-rVmodertargetmaskrkr;)rr<r[;s   zeasy_install.write_scriptcCs`|jjdr|j||gS|jjdr8|j||gS|jjdrT|j||gS|}tjj|r|jd rt|||j ntjj |rtjj |}|j |r|j r|dk r|j|||}tjj|d}tjj|s2ttjj|dd}|stdtjj |t|dkr*td tjj ||d }|jrPtj|j||gS|j||SdS) Nz.eggz.exez.whlz.pyzsetup.pyrz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)r'rD install_egg install_exe install_wheelr>r?isfilerunpack_progressrabspath startswithrrWr r@rrrr{r rreport_editablebuild_and_install)rrrSr:rT setup_scriptZsetupsr;r;r<rFOs<   zeasy_install.install_eggscCs>tjj|r"t|tjj|d}nttj|}tj ||dS)NzEGG-INFO)metadata) r>r?rr)r r* zipimport zipimporterr(Z from_filename)regg_pathrrr;r;r<rG{s    zeasy_install.egg_distributionc Cstjj|jtjj|}tjj|}|js2t||j|}t ||s|tjj |rttjj | rtt j ||jdn"tjj|r|jtj|fd|yd}tjj |r|j|rtjd}}n tjd}}nL|j|r|j||jd}}n*d}|j|rtjd}}n tjd}}|j|||f|dtjj|tjj|ft||d Wn$tk rzt|dd YnX|j||j|S) N)rz Removing FZMovingZCopyingZ ExtractingTz %s to %s)fix_zipimporter_caches)r>r?r rr)rmrr#rGr1rrr remove_treer@rrrnrQrRZcopytreerOZmkpathunpack_and_compileZcopy2r#update_dist_cachesr r2)rrur: destinationrZnew_dist_is_zippedrkrWr;r;r<rhsT               zeasy_install.install_eggc sTt|}|dkrtd|td|jdd|jddtd}tjj||jd}||_ |d}tjj|d}tjj|d }t |t |||_ |j ||tjj|st|d } | jd x<|jdD].\} } | d kr| jd | jddj| fqW| jtjj|d|jfddtj|Dtj|||j|jd|j||S)Nz(%s is not a valid distutils Windows .exerrrr)rErplatformz.eggz.tmpzEGG-INFOzPKG-INFOrzMetadata-Version: 1.0 target_versionz%s: %s _-r*csg|]}tjj|dqS)r)r>r?r )rr)rr;r<rsz,easy_install.install_exe..)rr)r4rr(getrr>r?r egg_namerAr#r)Z _provider exe_to_eggr@rr%itemsrNtitlerrrXrZrZ make_zipfilerrrh) rrSr:cfgrruegg_tmpZ _egg_infoZpkg_infrkkvr;)rr<ris<      " zeasy_install.install_exec s>t|ggifdd}t||g}xtD]l}|jjdr>|jd}|d}tj|dd|d<tjj f|}j ||j |tj ||q>W|j tj tjj dtj|xbdD]Z} t| rtjj d| d } tjj| st| d } | jd j t| d | jqWd S)z;Extract a bdist_wininst to the directories an egg would usecs|j}xԈD]\}}|j|r||t|d}|jd}tjjf|}|j}|jdsl|jdrtj |d |d <dtjj |dd<j |n4|jdr|dkrdtjj |dd<j ||SqW|jdst j d |dS) N/z.pydz.dllrrz.pyzSCRIPTS/z.pthzWARNING: can't process %sr)r'rnrrr>r?r rDr strip_modulesplitextrr r)srcrUrDoldnewpartsrC)r native_libsprefixes to_compile top_levelr;r<processs$      z(easy_install.exe_to_egg..processz.pydrrz.pyzEGG-INFOrrz.txtrrJNrrr)rr)r6rr'rDrrrr>r?r rZ write_stub byte_compileZwrite_safety_flagZ analyze_eggrr@rr%r) rrSrrZstubsresrZresourceZpyfilerZtxtrkr;)rrrrrr<rs6           zeasy_install.exe_to_eggc Cst|}tjj|j|j}tjj|}|js6t|tjj |rbtjj | rbt j ||jdn"tjj |r|jtj|fd|z.|j|j|fdtjj|tjj|fWdt|ddX|j||j|S)N)rz Removing zInstalling %s to %sF)rv)rr>r?r rrrmrr#rrr rwr@rrZinstall_as_eggr)r#ryr2rG)rZ wheel_pathr:Zwheelrzr;r;r<rjs,     zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Installedc Cs`d}|jr@|j r@|d|j7}|jtttjkr@|d|j7}|j }|j }|j }d}|t S)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srJr) rr_easy_install__mv_warningrrr!rr?_easy_install__id_warningrArErr) rZreqrZwhatrZegglocrrZextrasr;r;r<rLIsz easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tjj|}tj}d|jtS)NrJ)r>r?r#rr&_easy_install__editable_msgr)rrrqr#pythonr;r;r<robs zeasy_install.report_editablecCstjjdttjjdtt|}|jdkrNd|jd}|jdd|n|jdkrd|jdd|jrv|jdd t j d |t |ddd j |yt ||Wn6tk r}ztd |jdfWYdd}~XnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrrrr~z-qz-nz Running %s %s zSetup script exited with %s)rmodules setdefaultrrrrrrr rrr rrrr)rrqrTrrr;r;r<rgs      zeasy_install.run_setupc Csddg}tjdtjj|d}z|jtjj||j||j|||t|g}g}x2|D]*}x$||D]}|j|j |j |qlWq^W| r|j rt j d||St|t j|jXdS)Nrz --dist-dirz egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))r6r7r>r?r#_set_fetcher_optionsrrr&rhrArr rrrr) rrqrTrZdist_dirZall_eggsZeggsr4rr;r;r<rp{s$   zeasy_install.build_and_installc Cst|jjdj}d }i}x2|jD]&\}}||kr4q"|d||jdd <q"Wt|d }tjj|d }t j ||d S)a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r2rrrrrrr}r~)r2z setup.cfgN)rrrrrr) rrcopyrrNdictr>r?r rZ edit_config) rr0Zei_optsZfetch_directivesZ fetch_optionsr4rZsettingsZ cfg_filenamer;r;r<rs  z!easy_install._set_fetcher_optionscCs0|jdkrdSxX|j|jD]H}|js2|j|jkrtjd||jj||j|jkr|jj|jqW|js|j|jjkrtjd|n2tjd||jj ||j|jkr|jj |j|j s,|jj |jdkr,t jj|jd}t jj|rt j|t|d}|j|jj|jd|jdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filerzsetuptools.pthwtrJ)rr4rrAr rrKrpathsrJrrsaver>r?r rrrrr% make_relativer)rrr]rrkr;r;r<rIs4           zeasy_install.update_pthcCstjd|||S)NzUnpacking %s to %s)r debug)rrrUr;r;r<rlszeasy_install.unpack_progresscshggfdd}t|||jjsdx.D]&}tj|tjdBd@}t||q:WdS)Ncs\|jdr"|jd r"j|n|jds6|jdr@j|j||j rX|pZdS)Nz.pyz EGG-INFO/z.dllz.so)rDrnrrlr)rrU)rto_chmodrr;r<pfs    z+easy_install.unpack_and_compile..pfimi)rrrr>statST_MODErd)rrurzrrkrer;)rrrr<rxs   zeasy_install.unpack_and_compilec Csjtjr dSddlm}z@tj|jd||dd|jd|jrT|||jd|jdWdtj|jXdS)Nr)rr)rforcer) rdont_write_bytecodedistutils.utilrr rrrr)rrrr;r;r<rs zeasy_install.byte_compilea bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again.cCs|j}||jtjjddfS)N PYTHONPATHr)_easy_install__no_default_msgrr>environr)rtemplater;r;r<rsz#easy_install.no_default_version_msgcCs|jr dStjj|jd}tdd}|jd}d}tjj|rtj d|jt j |}|j }WdQRX|j dstd |||krtjd ||jst|t j |d dd }|j|WdQRX|j|gd |_dS)z8Make sure there's a site.py in the target dir, if neededNzsite.pyrz site-patch.pyzutf-8rzChecking existing site.py in %sz def __boot():z;%s is not a setuptools-generated site.py; please remove it.z Creating %sr)encodingT)rr>r?r rr"rar@r riorreadrnrrrr#r%r)rZsitepysourceZcurrentZstrmr;r;r<r=s,       zeasy_install.install_site_pycCsj|js dSttjjd}xJtj|jD]:\}}|j|r(tjj | r(|j d|tj |dq(WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) rrr>r?rrZ iteritemsrrnrZ debug_printr)rhomerr?r;r;r<r>szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/bin)rr)rz$base/Lib/site-packagesz $base/ScriptscGs|jdj}|jrh|j}|j|d<|jjtj|j}x0|j D]$\}}t ||ddkr@t |||q@Wddl m }xJ|D]B}t ||}|dk rz|||}tjdkrtjj|}t |||qzWdS)Nrr0r)rr)Zget_finalized_commandrrrr rr>rDEFAULT_SCHEMErrrrrr?r)rrrrHrrrr;r;r<rTs         zeasy_install._expand)rQNrR)rSrTrU)rVrWrX)rYrZr[)r\r]r^)r_rDr`)rarbrc)rdrerf)rgrhri)rjrkrl)rmrnro)rprqrr)rsNrt)rurvrw)rxryrz)r{r|r})r~rr)rrr)rrr)rNr)rNr)F)F)T)N)r)Q__name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsZ user_optionsZboolean_optionsrrrZhelp_msgrZ negative_optrrrrr staticmethodrrrrrrrrrrrKrLlstriprrrrrr.r2r3r5 contextlibcontextmanagerr;r2r?rr@rOrWr,r+r]r[rFrGrhrirrjrrrLrrorrprrIrlrxrrrr=rrr rrr;r;r;r<r2xs    0 z   0    ;  $ $ '  ,6-5   %    cCs tjjddjtj}td|S)Nrr)r>rrrpathsepfilter)rr;r;r<rksrc Csg}|jttjg}tjtjkr0|jtjx|D]}|r6tjdkr`|jtjj |ddn\tj dkr|jtjj |ddtj dd dtjj |dd gn|j|tjj |ddgtjd kr6d |kr6tj j d }|r6tjj |ddtj dd d}|j|q6Wtdtdf}x"|D]}||kr |j|q WtjrR|jtjy|jtjWntk rzYnXttt|}|S)z& Return a list of 'site' dirs os2emxriscosZLibz site-packagesrlibrNrz site-pythondarwinzPython.frameworkHOMELibraryPythonpurelibplatlib)rr)extendrrrrrr{r>r?r seprrrrrrrgetsitepackagesAttributeErrorrrr!)sitedirsrrrZhome_spZ lib_pathsZsite_libr;r;r<rpsV            rccsi}x|D]}t|}||kr q d||<tjj|s6q tj|}||fVx|D]}|jds`qP|dkrjqPttjj||}tt |}|j xP|D]H}|j dst|j }||krd||<tjj|sq|tj|fVqWqPWq WdS)zBYield sys.path directories that might contain "old-style" packagesrz.ptheasy-install.pthsetuptools.pthimportN)rr) r!r>r?rrPrDrr rr rrnrstrip)Zinputsseenr#r1rrklinesliner;r;r< expand_pathss4           rc Cs&t|d}z tj|}|dkr$dS|d|d|d}|dkrHdS|j|dtjd|jd\}}}|dkrzdS|j|d|d d d }tj|}y<|j|} | j d d d} | j t j } |j tj| Wntjk rdSX|jd s|jd rdS|S|jXdS)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None rbN  zegg path translations for a given .exe filePURELIB/rPLATLIB/pywin32_system32PLATLIB/SCRIPTS/EGG-INFO/scripts/DATA/lib/site-packagesrrrzPKG-INFOrz .egg-inforNz EGG-INFO/z.pthz -nspkg.pthPURELIBPLATLIB\rz%s/%s/cSsg|]\}}|j|fqSr;)r')rrbyr;r;r<r$sz$get_exe_prefixes..)rr)rr)rr)rr)rr)rr)rZZipFileZinfolistrrrrDrr upperrrZPY3rar rMrNrnrrsortreverse)Z exe_filenamerrTrrrrVZpthr;r;r<r6s>     & c@sTeZdZdZdZffddZddZddZed d Z d d Z d dZ ddZ dS)r3z)A .pth file with Distribution paths in itFcCsp||_ttt||_ttjj|j|_|j t j |gddx(t |j D]}tt|jt|dqNWdS)NT)rrrr!rr>r?r#basedir_loadr&__init__r rrJr%)rrrr?r;r;r<r/szPthDistributions.__init__cCsg|_d}tj|j}tjj|jrt|jd}x|D]}|j drJd}q6|j }|jj ||j s6|j j drxq6t tjj|j|}|jd<tjj| s||kr|jjd|_q6d||<q6W|j|jr| rd|_x&|jo|jdj r |jjqWdS) NFZrtrT#rrr)rrfromkeysrr>r?rkrrrnrrrMr!r rr@popdirtyr)rZ saw_importrrkrr?r;r;r<r8s2        zPthDistributions._loadc Cs|js dStt|j|j}|rtjd|j|j|}dj |d}t j j |jr`t j |jt|jd}|j|WdQRXn(t j j|jrtjd|jt j |jd|_dS)z$Write changed .pth file back to diskNz Saving %srJrzDeleting empty %sF)rrrrrr rr _wrap_linesr r>r?rrrr%r@)rZ rel_pathsrdatarkr;r;r<rWs   zPthDistributions.savecCs|S)Nr;)rr;r;r<rmszPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jtjk}|r>|jj|jd|_tj||dS)z"Add `dist` to the distribution mapTN) rArrr>getcwdrrr&rJ)rrnew_pathr;r;r<rJqs  zPthDistributions.addcCs6x$|j|jkr$|jj|jd|_qWtj||dS)z'Remove `dist` from the distribution mapTN)rArrKrr&)rrr;r;r<rKs zPthDistributions.removecCstjjt|\}}t|j}|g}tjdkr2dp6tj}xVt||kr||jkrn|jtj |j |j |Stjj|\}}|j|q:W|SdS)Nr) r>r?rr!rraltseprrcurdirrr )rr?ZnpathZlastZbaselenrrr;r;r<rs    zPthDistributions.make_relativeN) rrrrrrrrrrrJrKrr;r;r;r<r3*s  c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs(|jVx|D] }|VqW|jVdS)N)preludepostlude)clsrrr;r;r<rs  z#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) z import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)rrr classmethodrr"rrr;r;r;r<rs  rZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtStjtjjS)z_ Return a regular expression based on first_line_re suitable for matching strings. )rrpatternr9recompilerar;r;r;r<_first_line_res rcCsd|tjtjgkr.tjdkr.t|tj||Stj\}}}t j ||d|dd||ffdS)Nrrrz %s %s) r>rrKrrdrS_IWRITErrrZreraise)funcargexcZetZevr}r;r;r< auto_chmods  rcCs.t|}t|tj|r"t|nt|dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r!_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)Z dist_pathrvnormalized_pathr;r;r<rys <  rycCsTg}t|}xB|D]:}t|}|j|r|||dtjdfkr|j|qW|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rr)rr!rnr>rr)rcacheresultZ prefix_lenpZnpr;r;r<"_collect_zipimporter_cache_entriess   rcCsDx>t||D]0}||}||=|o*|||}|dk r |||<q WdS)a Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r)rrupdaterr old_entryZ new_entryr;r;r<_update_zipimporter_cache*s  r cCst||dS)N)r )rrr;r;r<rJsrcCsdd}t|tj|ddS)NcSs |jdS)N)clear)r?rr;r;r<2clear_and_remove_cached_zip_archive_directory_dataOszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data)r)r rs_zip_directory_cache)rr"r;r;r<rNsrZ__pypy__cCsdd}t|tj|ddS)NcSs&|jtj||jtj||S)N)r!rsrtupdater#)r?rr;r;r<)replace_cached_zip_archive_directory_dataes zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data)r)r rsr#)rr%r;r;r<rds rc Cs2yt||dWnttfk r(dSXdSdS)z%Is this string a valid Python script?execFTN)r SyntaxError TypeError)rOrr;r;r< is_pythonws r*cCsJy(tj|dd}|jd}WdQRXWnttfk r@|SX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)rrNz#!)rrrrr)r&fpmagicr;r;r<is_shs r-cCs tj|gS)z@Quote a command line argument according to Windows parsing rules) subprocess list2cmdline)rr;r;r< nt_quote_argsr0cCsH|jds|jdrdSt||r&dS|jdrDd|jdjkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. z.pyz.pywTz#!rrF)rDr*rn splitlinesr')r_rr;r;r<r\s  r\)rdcGsdS)Nr;)rr;r;r<_chmodsr2cCsRtjd||yt||Wn0tjk rL}ztjd|WYdd}~XnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r rr2r>error)r?rer|r;r;r<rds rdc@seZdZdZgZeZeddZeddZ eddZ edd Z ed d Z d d Z eddZddZeddZeddZdS) CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCs|S)zV Choose the best CommandSpec class based on environmental conditions. r;)r r;r;r<rYszCommandSpec.bestcCstjjtj}tjjd|S)N__PYVENV_LAUNCHER__)r>r?rBrr&rr)r Z_defaultr;r;r<_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dkr0|jS|j|S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rrfrom_environment from_string)r Zparamr;r;r< from_params  zCommandSpec.from_paramcCs||jgS)N)r6)r r;r;r<r7szCommandSpec.from_environmentcCstj|f|j}||S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )shlexr split_args)r stringrr;r;r<r8szCommandSpec.from_stringcCs8tj|j||_tj|}t|s4dg|jdd<dS)Nz-xr)r:r_extract_optionsoptionsr.r/rH)rr_cmdliner;r;r<install_optionss zCommandSpec.install_optionscCs:|djd}tj|}|r.|jdp0dnd}|jS)zH Extract any options from the first line of the script. rJrrr)r1rmatchgrouprM)Z orig_scriptfirstrAr>r;r;r<r=s zCommandSpec._extract_optionscCs|j|t|jS)N)_renderrr>)rr;r;r< as_headerszCommandSpec.as_headercCs6d}x,|D]$}|j|r |j|r |ddSq W|S)Nz"'rr)rnrD)itemZ_QUOTESqr;r;r< _strip_quotess  zCommandSpec._strip_quotescCs tjdd|D}d|dS)Ncss|]}tj|jVqdS)N)r4rHrM)rrFr;r;r<rsz&CommandSpec._render..z#!rJ)r.r/)rr?r;r;r<rDszCommandSpec._renderN)rrrrr>rr;r rYr6r9r7r8r@rr=rErHrDr;r;r;r<r4s       r4c@seZdZeddZdS)WindowsCommandSpecF)rN)rrrrr;r;r;r;r<rIsrIc@seZdZdZejdjZeZ e dddZ e dddZ e dd d Z ed d Ze d dZe ddZe ddZe dddZdS)rXz` Encapsulates behavior around writing entry point scripts for console and gui apps. a # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r __requires__ = %(spec)r import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit( load_entry_point(%(spec)r, %(group)r, %(name)r)() ) NFcCs6tjdt|rtntj}|jd||}|j||S)Nz Use get_argsr)warningsrDeprecationWarningWindowsScriptWriterrXrYget_script_headerrZ)r rr&wininstwriterheaderr;r;r<get_script_argss zScriptWriter.get_script_argscCs6tjdt|rd}|jjj|}|j||jS)NzUse get_headerz python.exe)rJrrKcommand_spec_classrYr9r@rE)r r_r&rNcmdr;r;r<rM's   zScriptWriter.get_script_headerc cs|dkr|j}t|j}xjdD]b}|d}xT|j|jD]B\}}|j||jt}|j||||} x| D] } | VqrWq>Wq"WdS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. NconsoleguiZ_scripts)rTrU) r^r9rNZ get_entry_mapr_ensure_safe_namerr_get_script_args) r rrPrtype_rBrZepr_rrr;r;r<rZ1s     zScriptWriter.get_argscCstjd|}|rtddS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)r searchr)rZ has_path_sepr;r;r<rVCs zScriptWriter._ensure_safe_namecCs tjdt|rtjS|jS)NzUse best)rJrrKrLrY)r Z force_windowsr;r;r< get_writerLs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tjS|SdS)zD Select the best ScriptWriter for this environment. win32javarN)rr{r>r_namerLrY)r r;r;r<rYRszScriptWriter.bestccs|||fVdS)Nr;)r rXrrPr_r;r;r<rW\szScriptWriter._get_script_argsrcCs"|jjj|}|j||jS)z;Create a #! line, getting options (if any) from script_text)rRrYr9r@rE)r r_r&rSr;r;r<r^as zScriptWriter.get_header)NF)NF)N)rN)rrrrrKrLrrr4rRr rQrMrZrrVrZrYrWr^r;r;r;r<rX s       rXc@sLeZdZeZeddZeddZeddZeddZ e d d Z d S) rLcCstjdt|jS)NzUse best)rJrrKrY)r r;r;r<rZls zWindowsScriptWriter.get_writercCs"tt|d}tjjdd}||S)zC Select the best ScriptWriter suitable for Windows )r&ZnaturalZSETUPTOOLS_LAUNCHERr&)rWindowsExecutableLauncherWriterr>rr)r Z writer_lookupZlauncherr;r;r<rYrs zWindowsScriptWriter.bestc #stddd|}|tjdjjdkrBdjft}tj|t dddd d dd g}|j ||j ||}fd d |D}|||d|fVdS)z For Windows, add a .py extensionz.pyaz.pyw)rTrUZPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.z.pyz -script.pyz.pycz.pyoz.execsg|] }|qSr;r;)rrb)rr;r<rsz8WindowsScriptWriter._get_script_args..rbN) rr>rr'rrrrJr UserWarningrK_adjust_header) r rXrrPr_extrrrr;)rr<rWs   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tjtj|tj}|j||d}|j|rJ|S|S)z Make sure 'pythonw' is used for gui and and 'python' is used for console (regardless of what sys.executable is). z pythonw.exez python.exerU)r<repl)r rescape IGNORECASEsub _use_header)r rXZ orig_headerr rcZ pattern_ob new_headerr;r;r<ras z"WindowsScriptWriter._adjust_headercCs$|ddjd}tjdkp"t|S)z Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. rr"r[r)rMrr{r)rhZ clean_headerr;r;r<rgs zWindowsScriptWriter._use_headerN) rrrrIrRr rZrYrWrarrgr;r;r;r<rLis    rLc@seZdZeddZdS)r^c #s|dkrd}d}dg}nd}d}dddg}|j||}fd d |D} |||d | fVd t|d fVtsd} | td fVdS)zG For Windows, add a .py extension and an .exe launcher rUz -script.pywz.pywZcliz -script.pyz.pyz.pycz.pyocsg|] }|qSr;r;)rrb)rr;r<rszDWindowsExecutableLauncherWriter._get_script_args..rbz.exernz .exe.manifestN)raget_win_launcherr=load_launcher_manifest) r rXrrPr_Z launcher_typerbrZhdrrZm_namer;)rr<rWs   z0WindowsExecutableLauncherWriter._get_script_argsN)rrrr rWr;r;r;r<r^sr^cCs2d|}tr|jdd}n |jdd}td|S)z Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exe.z-64.z-32.r)r=rNr")typeZ launcher_fnr;r;r<rjs  rjcCs0tjtd}tjr|tS|jdtSdS)Nzlauncher manifest.xmlzutf-8)r$r"rrPY2varsra)rZmanifestr;r;r<rks  rkFcCstj|||S)N)rQr)r? ignore_errorsonerrorr;r;r<rsrcCstjd}tj||S)N)r>umask)Ztmpr;r;r<rcs  rccCs:ddl}tjj|jd}|tjd<tjj|tdS)Nr) rr>r?r#__path__rargvrr5)rZargv0r;r;r< bootstraps   rvc sddlm}ddlmGfddd}|dkrBtjdd}t0|fddd g|tjdpfd|d |WdQRXdS) Nr)setup)r(cseZdZdZfddZdS)z-main..DistributionWithoutHelpCommandsrc s(tj|f||WdQRXdS)N) _patch_usage _show_help)rrkw)r(r;r<ry sz8main..DistributionWithoutHelpCommands._show_helpN)rrrZ common_usageryr;)r(r;r<DistributionWithoutHelpCommandssr{rz-qr2z-v)Z script_argsr-Z distclass)rrwZsetuptools.distr(rrurx)rurzrwr{r;)r(r<r5s    c #sLddl}tjdjfdd}|jj}||j_z dVWd||j_XdS)Nrze usage: %(script)s [options] requirement_or_url ... or: %(script)s --help csttjj|dS)N)Zscript)rr>r?r))r-)USAGEr;r< gen_usage sz_patch_usage..gen_usage)Zdistutils.corerKrLrZcorer})rr}Zsavedr;)r|r<rx s   rx)N)r&)N)rrrrrrZdistutils.errorsrrrr Zdistutils.command.installr r rr r Zdistutils.command.build_scriptsrr(rrr>rsrQr6rr rr rKrJrr9rr.r:rZsetuptools.externrZsetuptools.extern.six.movesrrrrZsetuptools.sandboxrZsetuptools.py31compatrrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrr$r r!r"r#r$r%r&r'r(r)r*r+r,r-r.Zpkg_resources.py31compatfilterwarningsZ PEP440Warning__all__r=r1rnrErHr"r2rrrr4r6r3rrrrrryrr rrbuiltin_module_namesrr*r-r0r\rdr2 ImportErrorrr4r6Zsys_executablerIobjectrXrLr^rQrMrjrkrrcrvr5rrxr;r;r;r< s           D |A))'l R    T`A  PK!0!0!+command/__pycache__/build_py.cpython-36.pycnu[3 vh|% @sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn"ek rGdddZYnXGd d d ejeZdd d Zd dZdS))glob) convert_pathN)six)mapfilter filterfalse) Mixin2to3c@seZdZdddZdS)rTcCsdS)z do nothingN)selffilesZdoctestsr r /usr/lib/python3.6/build_py.pyrun_2to3szMixin2to3.run_2to3N)T)__name__ __module__ __qualname__r r r r r rsrc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsFtjj||jj|_|jjp i|_d|jkr6|jd=g|_g|_dS)N data_files) origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_files_build_py__doctests_2to3)r r r r r!s   zbuild_py.finalize_optionscCs||j r|j rdS|jr"|j|jr8|j|j|j|jd|j|jd|j|jd|jt j j |dddS)z?Build modules, packages, and copy data files to build directoryNFTr)Zinclude_bytecode) Z py_modulespackagesZ build_modulesZbuild_packagesbuild_package_datar rrZ byte_compilerrZ get_outputs)r r r r run+sz build_py.runcCs&|dkr|j|_|jStjj||S)zlazily compute data filesr)_get_data_filesrrr __getattr__)r attrr r r r?s zbuild_py.__getattr__cCsJtjrt|tjr|jd}tjj||||\}}|rB|jj |||fS)N.) rZPY2 isinstanceZ string_typessplitrr build_modulerappend)r moduleZ module_filepackageZoutfilecopiedr r r r$Fs    zbuild_py.build_modulecCs|jtt|j|jpfS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples)analyze_manifestlistr_get_pkg_data_filesr)r r r r rPszbuild_py._get_data_filescsJ|j|tjj|jg|jd}fdd|j|D}|||fS)Nr!csg|]}tjj|qSr )ospathrelpath).0file)src_dirr r ^sz0build_py._get_pkg_data_files..)get_package_dirr,r-joinZ build_libr#find_data_files)r r' build_dir filenamesr )r1r r+Us   zbuild_py._get_pkg_data_filescCsX|j|j||}tt|}tjj|}ttj j |}tj|j j |g|}|j |||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrrr itertoolschain from_iterablerr,r-isfilemanifest_filesgetexclude_data_files)r r'r1patternsZglobs_expandedZ globs_matchesZ glob_filesr r r r r5cs   zbuild_py.find_data_filesc Csx|jD]\}}}}xr|D]j}tjj||}|jtjj|tjj||}|j||\}} tjj|}| r||jj kr|j j |qWqWdS)z$Copy data files into build directoryN) rr,r-r4ZmkpathdirnameZ copy_fileabspathrZconvert_2to3_doctestsrr%) r r'r1r6r7filenametargetZsrcfileZoutfr(r r r rts   zbuild_py.build_package_datac Csi|_}|jjsdSi}x$|jp$fD]}||t|j|<q&W|jd|jd}x|jj D]}t j j t|\}}d}|} x:|r||kr||kr|}t j j |\}} t j j | |}qW||kr^|jdr|| krq^|j||gj|q^WdS)NZegg_infoz.py)r=rZinclude_package_datarassert_relativer3Z run_commandZget_finalized_commandZfilelistr r,r-r#r4endswith setdefaultr%) r ZmfZsrc_dirsr'Zei_cmdr-dfprevZoldfZdfr r r r)s(   zbuild_py.analyze_manifestcCsdS)Nr )r r r r get_data_filesszbuild_py.get_data_filescCsy |j|Stk rYnXtjj|||}||j|<| sJ|jj rN|Sx,|jjD]}||ksr|j|drXPqXW|Stj |d}|j }WdQRXd|krt j j d|f|S)z8Check namespace packages' __init__ for declare_namespacer!rbNsdeclare_namespacezNamespace package problem: %s is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorrr check_packagerZnamespace_packages startswithioopenread distutilserrorsZDistutilsError)r r'Z package_dirZinit_pyZpkgrIcontentsr r r rOs&   zbuild_py.check_packagecCsi|_tjj|dS)N)rMrrinitialize_options)r r r r rWszbuild_py.initialize_optionscCs0tjj||}|jjdk r,tjj|jj|S|S)N)rrr3rZsrc_rootr,r-r4)r r'resr r r r3s zbuild_py.get_package_dircs\t|j|j||}fdd|D}tjj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}tj|VqdS)N)fnmatchr)r/pattern)r r r sz.build_py.exclude_data_files..c3s|]}|kr|VqdS)Nr )r/fn)badr r r[s)r*r8rr9r:r;set_unique_everseen)r r'r1r r@Z match_groupsZmatchesZkeepersr )r]r r r?s   zbuild_py.exclude_data_filescs.tj|jdg|j|g}fdd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3s |]}tjjt|VqdS)N)r,r-r4r)r/rZ)r1r r r[sz2build_py._get_platform_patterns..)r9r:r>)specr'r1Z raw_patternsr )r1r r8s   zbuild_py._get_platform_patternsN)rrr__doc__rrrr$rr+r5rr)rKrOrWr3r? staticmethodr8r r r r rs    rccsjt}|j}|dkr:xPt|j|D]}|||Vq"Wn,x*|D]"}||}||kr@|||Vq@WdS)zHList unique elements, preserving order. Remember all elements ever seen.N)r^addr __contains__)iterablekeyseenZseen_addelementkr r r r_s  r_cCs:tjj|s|Sddlm}tjdj|}||dS)Nr)DistutilsSetupErrorz Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )r,r-isabsdistutils.errorsrktextwrapdedentlstrip)r-rkmsgr r r rEs   rE)N)rZdistutils.utilrZdistutils.command.build_pyZcommandrrr,rYrnrQrmrTr9Zsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.lib2to3_exr ImportErrorr_rEr r r r s$    Y PK!c!QQ1command/__pycache__/egg_info.cpython-36.opt-1.pycnu[3 vh`@sdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddlm+Z+ddZ,GdddeZ-GdddeZGdddeZ.ddZ/ddZ0ddZ1dd Z2d!d"Z3d#d$Z4d%d&Z5d'd(Z6d0d*d+Z7d,d-Z8d.d/Z9dS)1zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError) convert_path)logN)six)map)Command)sdist) walk_revctrl) edit_config) bdist_egg)parse_requirements safe_name parse_version safe_version yield_lines EntryPointiter_entry_points to_filename)glob) packagingcCsd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkrv|rd|d7}q4|d||f7}q4d}t|} x:|| kr||} | dkr||d7}n| d kr||7}n| d kr|d} | | kr|| d kr| d} | | kr|| d kr| d} x&| | kr6|| d kr6| d} qW| | krR|tj| 7}nR||d| } d} | dd krd } | dd} | tj| 7} |d| f7}| }n|tj| 7}|d7}qW|s4||7}q4W|d7}tj|tj tj BdS)z Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. z[^%s]z**z.*z (?:%s+%s)*r*?[!]^Nz[%s]z\Z)flags) splitospathsepreescape enumeratelencompile MULTILINEDOTALL)rZpatZchunksr#Z valid_charcchunkZ last_chunkiZ chunk_lencharZinner_iinnerZ char_classr0/usr/lib/python3.6/egg_info.pytranslate_pattern$sV         r2c@seZdZdZd)d*d+d,gZdgZd diZddZeddZ e j ddZ ddZ ddZ d-ddZ ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S).egg_infoz+create a distribution's .egg-info directory egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)tag-dated0Add date stamp (e.g. 20050528) to version number tag-build=b-Specify explicit tag to add to version numberno-dateD"Don't include date stamp [default]cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)egg_name egg_versionegg_baser3 tag_buildtag_datebroken_egg_infovtags)selfr0r0r1initialize_optionsszegg_info.initialize_optionscCsdS)Nr0)rGr0r0r1tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr0)rGvaluer0r0r1rIscCs0tj}|j|d<d|d<t|t|ddS)z Materialize the value of date into the build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. rCrrD)r3N) collections OrderedDicttagsr dict)rGfilenamer3r0r0r1save_version_infos zegg_info.save_version_infoc CsVt|jj|_|j|_|j|_t|j}y6t |t j j }|rFdnd}t t||j|jfWn,tk rtjjd|j|jfYnX|jdkr|jj}|pijdtj|_|jdt|jd|_|jtjkrtjj|j|j|_d|jkr|j|j|jj_ |jj}|dk rR|j |jj!krR|j|_"t|j|_#d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrBz .egg-info-)$r distributionZget_namer@rMrFtagged_versionrAr isinstancerversionZVersionlistr ValueError distutilserrorsZDistutilsOptionErrorrBZ package_dirgetr!curdirZensure_dirnamerr3r"joincheck_broken_egg_infometadataZ _patched_distkeylowerZ_versionZ_parsed_version)rGZparsed_versionZ is_versionspecdirsZpdr0r0r1finalize_optionss8          zegg_info.finalize_optionsFcCsN|r|j|||n6tjj|rJ|dkr@| r@tjd||dS|j|dS)aWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists) write_filer!r"existsrwarn delete_file)rGwhatrOdataforcer0r0r1write_or_delete_files   zegg_info.write_or_delete_filecCsDtjd||tjr|jd}|js@t|d}|j||jdS)zWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %szutf-8wbN) rinforZPY3encodedry_runopenwriteclose)rGrhrOrifr0r0r1rds   zegg_info.write_filecCs tjd||jstj|dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrmror!unlink)rGrOr0r0r1rgs zegg_info.delete_filecCs2|jj}|jr$|j|jr$t|St||jS)N)rRZ get_versionrFendswithr)rGrUr0r0r1rSs zegg_info.tagged_versioncCs|j|j|jj}x@tdD]4}|j|d|j}|||jtj j |j|jqWtj j |jd}tj j |r||j ||j dS)Nzegg_info.writers) installerznative_libs.txt)Zmkpathr3rRZfetch_build_eggrZrequireZresolvenamer!r"r\rerg find_sources)rGrvepwriternlr0r0r1run s     z egg_info.runcCs,d}|jr||j7}|jr(|tjd7}|S)Nrz-%Y%m%d)rCrDtimeZstrftime)rGrUr0r0r1rMs  z egg_info.tagscCs4tjj|jd}t|j}||_|j|j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"r\r3manifest_makerrRmanifestr|filelist)rGZmanifest_filenameZmmr0r0r1rx s  zegg_info.find_sourcescCsd|jd}|jtjkr&tjj|j|}tjj|r`tjddddd||j |j |_ ||_ dS)Nz .egg-inforQNz Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ) r@rBr!r[r"r\rerrfr3rE)rGZbeir0r0r1r](s    zegg_info.check_broken_egg_infoN)r4r5r6)r7r8r9)r:r;r<)r=r>r?)F)__name__ __module__ __qualname__ descriptionZ user_optionsZboolean_optionsZ negative_optrHpropertyrIsetterrPrcrkrdrgrSr|rMrxr]r0r0r0r1r3ws(  / r3c@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rcCs<|j|\}}}}|dkrV|jddj|x"|D]}|j|s4tjd|q4Wn|dkr|jddj|x"|D]}|j|sxtjd|qxWn|dkr|jd dj|x"|D]}|j|stjd |qWnZ|d kr(|jd dj|x&|D]}|j|stjd |qWn|dkrx|jd|dj|fx|D]"}|j ||sPtjd||qPWn|dkr|jd|dj|fx|D]"}|j ||stjd||qWnp|dkr|jd||j |s8tjd|n>|dkr,|jd||j |s8tjd|n t d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_line debug_printr\rrrfrglobal_includeglobal_excluderecursive_includerecursive_excluderrr)rGlineactionZpatternsdirZ dir_patternpatternr0r0r1process_template_line;sd                 zFileList.process_template_linecCsVd}xLtt|jdddD]2}||j|r|jd|j||j|=d}qW|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing Tr)ranger'filesr)rGZ predicatefoundr-r0r0r1 _remove_filesszFileList._remove_filescCs$ddt|D}|j|t|S)z#Include files that match 'pattern'.cSsg|]}tjj|s|qSr0)r!r"isdir).0rsr0r0r1 sz$FileList.include..)rextendbool)rGrrr0r0r1rs zFileList.includecCst|}|j|jS)z#Exclude files that match 'pattern'.)r2rmatch)rGrrr0r0r1rszFileList.excludecCs8tjj|d|}ddt|ddD}|j|t|S)zN Include all files anywhere in 'dir/' that match the pattern. z**cSsg|]}tjj|s|qSr0)r!r"r)rrsr0r0r1rsz.FileList.recursive_include..T) recursive)r!r"r\rrr)rGrrZ full_patternrr0r0r1rs zFileList.recursive_includecCs ttjj|d|}|j|jS)zM Exclude any file anywhere in 'dir/' that match the pattern. z**)r2r!r"r\rr)rGrrrr0r0r1rszFileList.recursive_excludecCs$ddt|D}|j|t|S)zInclude all files from 'dir/'.cSs"g|]}tjj|D]}|qqSr0)rXrfindall)rZ match_diritemr0r0r1rsz"FileList.graft..)rrr)rGrrr0r0r1rs  zFileList.graftcCsttjj|d}|j|jS)zFilter out files from 'dir/'.z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.prunecsJ|jdkr|jttjjd|fdd|jD}|j|t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nz**csg|]}j|r|qSr0)r)rrs)rr0r1rsz+FileList.global_include..)Zallfilesrr2r!r"r\rr)rGrrr0)rr1rs   zFileList.global_includecCsttjjd|}|j|jS)zD Exclude all files anywhere that match the pattern. z**)r2r!r"r\rr)rGrrr0r0r1rszFileList.global_excludecCs8|jdr|dd}t|}|j|r4|jj|dS)N rr)rur _safe_pathrappend)rGrr"r0r0r1rs    zFileList.appendcCs|jjt|j|dS)N)rrfilterr)rGpathsr0r0r1rszFileList.extendcCstt|j|j|_dS)z Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)rVrrr)rGr0r0r1_repairszFileList._repairc Csd}tj|}|dkr(tjd|dStj|d}|dkrNtj||ddSy tjj|shtjj|rldSWn&tk rtj||t j YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T) unicode_utilsfilesys_decoderrfZ try_encoder!r"reUnicodeEncodeErrorsysgetfilesystemencoding)rGr"Zenc_warnZu_pathZ utf8_pathr0r0r1rs  zFileList._safe_pathN)rrrrrrrrrrrrrrrrrr0r0r0r1r8sI     rc@s\eZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ dS)r~z MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifest)rGr0r0r1rHsz!manifest_maker.initialize_optionscCsdS)Nr0)rGr0r0r1rcszmanifest_maker.finalize_optionscCsdt|_tjj|js|j|jtjj|jr<|j |j |jj |jj |jdS)N) rrr!r"rerwrite_manifest add_defaultstemplateZ read_templateprune_file_listsortZremove_duplicates)rGr0r0r1r|s  zmanifest_maker.runcCstj|}|jtjdS)N/)rrreplacer!r#)rGr"r0r0r1_manifest_normalizes z"manifest_maker._manifest_normalizecsBjjfddjjD}dj}jtj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}j|qSr0)r)rrs)rGr0r1r sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrZexecuterd)rGrmsgr0)rGr1rs  zmanifest_maker.write_manifestcCs|j|stj||dS)N)_should_suppress_warningr rf)rGrr0r0r1rf$s zmanifest_maker.warncCs tjd|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r)rr0r0r1r(sz'manifest_maker._should_suppress_warningcCsttj||jj|j|jj|jtt}|rB|jj|nt j j |jrX|j |j d}|jj|jdS)Nr3)r rrrrrrVr rr!r"reZ read_manifestget_finalized_commandrr3)rGZrcfilesZei_cmdr0r0r1r/s   zmanifest_maker.add_defaultscCsZ|jd}|jj}|jj|j|jj|tjtj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rrRZ get_fullnamerrZ build_baser$r%r!r#Zexclude_pattern)rGrZbase_dirr#r0r0r1r;s    zmanifest_maker.prune_file_listN)rrrrrHrcr|rrrf staticmethodrrrr0r0r0r1r~s    r~c Cs8dj|}|jd}t|d}|j|WdQRXdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  zutf-8rlN)r\rnrprq)rOcontentsrsr0r0r1rdEs   rdc Cs|tjd||jsx|jj}|j|j|_}|j|j|_}z|j |j Wd|||_|_Xt |jdd}t j |j |dS)Nz writing %sZzip_safe)rrmrorRr^rArUr@rwwrite_pkg_infor3getattrr Zwrite_safety_flag)cmdbasenamerOr^ZoldverZoldnameZsafer0r0r1rRs rcCstjj|rtjddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"rerrf)rrrOr0r0r1warn_depends_obsoletees rcCs,t|pf}dd}t||}|j|dS)NcSs|dS)Nrr0)rr0r0r1osz%_write_requirements..)rr writelines)streamZreqslinesZ append_crr0r0r1_write_requirementsms  rcCsn|j}tj}t||j|jp"i}x2t|D]&}|jdjft t|||q.W|j d||j dS)Nz [{extra}] Z requirements) rRrStringIOrZinstall_requiresextras_requiresortedrqformatvarsrkgetvalue)rrrOZdistrirZextrar0r0r1write_requirementsts  rcCs,tj}t||jj|jd||jdS)Nzsetup-requirements)iorrrRZsetup_requiresrkr)rrrOrir0r0r1write_setup_requirementssrcCs:tjdd|jjD}|jd|djt|ddS)NcSsg|]}|jdddqS).rr)r )rkr0r0r1rsz(write_toplevel_names..ztop-level namesr)rNfromkeysrRZiter_distribution_namesrdr\r)rrrOZpkgsr0r0r1write_toplevel_namessrcCst|||ddS)NT) write_arg)rrrOr0r0r1 overwrite_argsrFcCsHtjj|d}t|j|d}|dk r4dj|d}|j||||dS)Nrr)r!r"splitextrrRr\rk)rrrOrjZargnamerJr0r0r1rs rcCs|jj}t|tjs|dkr"|}nr|dk rg}xZt|jD]J\}}t|tjsttj||}dj tt t |j }|j d||fqsR           (   SBEI    PK!V~g&&2command/__pycache__/build_ext.cpython-36.opt-1.pycnu[3 vhu3@sddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZddlmZddlmZdd lmZyddlmZed Wnek reZYnXe d dd l mZd dZdZdZdZej dkrdZn>ej!dkr,yddl"Z"e#e"dZZWnek r*YnXddZ$ddZ%GdddeZes^ej!dkrjd!ddZ&ndZd"ddZ&dd Z'dS)#N) build_ext) copy_file) new_compiler)customize_compilerget_config_var)DistutilsError)log)Library)sixzCython.Compiler.MainLDSHARED) _config_varsc CsZtjdkrNtj}z$dtd<dtd<dtd<t|Wdtjtj|Xnt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookupr z -dynamiclibCCSHAREDz.dylibSO)sysplatform _CONFIG_VARScopyrclearupdate)compilerZtmpr/usr/lib/python3.6/build_ext.py_customize_compiler_for_shlibs  rFZsharedr TntRTLD_NOWcCs tr|SdS)N) have_rtld)srrr>srcCs>x8ddtjDD]"\}}}d|kr*|S|dkr|SqWdS)z;Return the file extension for an abi3-compliant Extension()css |]}|dtjkr|VqdS)N)impZ C_EXTENSION).0rrrr Csz"get_abi3_suffix..z.abi3z.pydN)r!Z get_suffixes)suffix_rrrget_abi3_suffixAs r&c@sveZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddZdS)rcCs.|jd}|_tj|||_|r*|jdS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace _build_extruncopy_extensions_to_source)selfZ old_inplacerrrr(Ks  z build_ext.runc Cs|jd}x|jD]}|j|j}|j|}|jd}dj|dd}|j|}tj j|tj j |}tj j|j |} t | ||j |jd|jr|j|ptj|dqWdS)Nbuild_py.)verbosedry_runT)get_finalized_command extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename build_librr.r/ _needs_stub write_stubcurdir) r*r+extfullnamefilenameZmodpathpackageZ package_dirZ dest_filenameZ src_filenamerrrr)Ss       z#build_ext.copy_extensions_to_sourcecCstj||}||jkr|j|}tjo4t|do4t}|r^td}|dt| }|t}t |t rt j j |\}}|jj|tStr|jrt j j|\}}t j j|d|S|S)NZpy_limited_api EXT_SUFFIXzdl-)r'r5ext_mapr ZPY3getattrr&_get_config_var_837len isinstancer r8r9splitextshlib_compilerlibrary_filenamelibtype use_stubs_links_to_dynamicr6r7)r*r@rAr?Zuse_abi3Zso_extfndrrrr5is"       zbuild_ext.get_ext_filenamecCs tj|d|_g|_i|_dS)N)r'initialize_optionsrJshlibsrD)r*rrrrQ~s zbuild_ext.initialize_optionscCs2tj||jpg|_|j|jdd|jD|_|jrB|jx|jD]}|j|j|_qJWx|jD]}|j}||j |<||j |j dd<|jr|j |pd}|ot ot |t }||_||_|j|}|_tjjtjj|j|}|o||jkr|jj||rht rhtj|jkrh|jjtjqhWdS)NcSsg|]}t|tr|qSr)rHr )r"r?rrr sz.build_ext.finalize_options..r,r-Fr0)r'finalize_optionsr2Zcheck_extensions_listrRsetup_shlib_compilerr3r4 _full_namerDr6links_to_dynamicrMrHr rNr<r5 _file_namer8r9dirnamer7r; library_dirsappendr>runtime_library_dirs)r*r?r@ZltdnsrAZlibdirrrrrTs,       zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdk r8|j|j|jdk rbx|jD]\}}|j ||qJW|j dk rx|j D]}|j |qtW|j dk r|j |j |jdk r|j|j|jdk r|j|j|jdk r|j|jtj||_dS)N)rr/force)rrr/r^rJrZ include_dirsZset_include_dirsZdefineZ define_macroZundefZundefine_macro librariesZ set_librariesrZZset_library_dirsZrpathZset_runtime_library_dirsZ link_objectsZset_link_objectslink_shared_object__get__)r*rr4valueZmacrorrrrUs(             zbuild_ext.setup_shlib_compilercCst|tr|jStj||S)N)rHr export_symbolsr'get_export_symbols)r*r?rrrrds zbuild_ext.get_export_symbolsc Cs\|j|j}z@t|tr"|j|_tj|||jrL|jdj }|j ||Wd||_XdS)Nr+) Z_convert_pyx_sources_to_langrrHr rJr'build_extensionr<r1r;r=)r*r?Z _compilercmdrrrres   zbuild_ext.build_extensioncsPtjdd|jDdj|jjddd dgtfdd|jDS) z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|] }|jqSr)rV)r"librrrrSsz.build_ext.links_to_dynamic..r,Nr-rc3s|]}|kVqdS)Nr)r"Zlibname)libnamespkgrrr#sz-build_ext.links_to_dynamic..r0)dictfromkeysrRr7rVr6anyr_)r*r?r)rhrirrWs zbuild_ext.links_to_dynamiccCstj||jS)N)r' get_outputs_build_ext__get_stubs_outputs)r*rrrrmszbuild_ext.get_outputscs6fddjD}tj|j}tdd|DS)Nc3s0|](}|jrtjjjf|jjdVqdS)r,N)r<r8r9r7r;rVr6)r"r?)r*rrr#sz0build_ext.__get_stubs_outputs..css|]\}}||VqdS)Nr)r"baseZfnextrrrr#s)r2 itertoolsproduct!_build_ext__get_output_extensionslist)r*Z ns_ext_basesZpairsr)r*rZ__get_stubs_outputss  zbuild_ext.__get_stubs_outputsccs"dVdV|jdjrdVdS)Nz.pyz.pycr+z.pyo)r1optimize)r*rrrZ__get_output_extensionss z!build_ext.__get_output_extensionsFcCs.tjd|j|tjj|f|jjdd}|rJtjj|rJt|d|j st |d}|j djddd t d d tjj |jd d dt ddddt dddt ddddg|j|r*ddlm}||gdd|j d|jdj}|dkr||g|d|j dtjj|r*|j r*tj|dS)Nz writing stub loader for %s to %sr,z.pyz already exists! Please delete.w zdef __bootstrap__():z- global __bootstrap__, __file__, __loader__z% import sys, os, pkg_resources, impz, dlz: __file__ = pkg_resources.resource_filename(__name__,%r)z del __bootstrap__z if '__loader__' in globals():z del __loader__z# old_flags = sys.getdlopenflags()z old_dir = os.getcwd()z try:z( os.chdir(os.path.dirname(__file__))z$ sys.setdlopenflags(dl.RTLD_NOW)z( imp.load_dynamic(__name__,__file__)z finally:z" sys.setdlopenflags(old_flags)z os.chdir(old_dir)z__bootstrap__()rr) byte_compileT)rtr^r/Z install_lib)rinforVr8r9r7r6existsrr/openwriteif_dlr:rXcloseZdistutils.utilrwr1rtunlink)r* output_dirr?compileZ stub_filefrwrtrrrr=sP          zbuild_ext.write_stubN)F)__name__ __module__ __qualname__r(r)r5rQrTrUrdrerWrmrnrrr=rrrrrJs   rc Cs(|j|j||||||||| | | | dS)N)linkZSHARED_LIBRARY) r*objectsoutput_libnamerr_rZr\rcdebug extra_preargsextra_postargs build_temp target_langrrrr`s r`Zstaticc CsRtjj|\}} tjj| \}}|jdjdr<|dd}|j||||| dS)Nxrg)r8r9r6rIrK startswithZcreate_static_lib)r*rrrr_rZr\rcrrrrrrAr:r?rrrr`,s  cCstjdkrd}t|S)z In https://github.com/pypa/setuptools/pull/837, we discovered Python 3.3.0 exposes the extension suffix under the name 'SO'. rr-r)rrr-)r version_infor)r4rrrrFDs rF) NNNNNrNNNN) NNNNNrNNNN)(r8rrpr!Zdistutils.command.build_extrZ _du_build_extZdistutils.file_utilrZdistutils.ccompilerrZdistutils.sysconfigrrZdistutils.errorsrZ distutilsrZsetuptools.extensionr Zsetuptools.externr ZCython.Distutils.build_extr' __import__ ImportErrorr rrrrMrLrr4Zdlhasattrr|r&r`rFrrrrsZ              Q  PK!Kpp4command/__pycache__/upload_docs.cpython-36.opt-1.pycnu[3 vh@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZddlmZd d lmZd d ZGd ddeZdS)zpupload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). )standard_b64encode)log)DistutilsOptionErrorN)six) http_clienturllib)iter_entry_points)uploadcCstjr dnd}|jd|S)Nsurrogateescapestrictzutf-8)rPY3encode)serrorsr!/usr/lib/python3.6/upload_docs.py_encodesrc@seZdZdZdZdddejfddgZejZd d Zd efgZ ddZ ddZ ddZ ddZ eddZeddZddZdS) upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIz repository=rzurl of repository [default: %s] show-responseN&display full response text from server upload-dir=directory to uploadcCs$|jdkr xtddD]}dSWdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfZeprrr has_sphinx/s zupload_docs.has_sphinxrcCstj|d|_d|_dS)N)r initialize_optionsr target_dir)rrrrr6s zupload_docs.initialize_optionscCstj||jdkrN|jr0|jd}|j|_q`|jd}tjj |j d|_n|j d|j|_d|j krtt jd|jd|jdS)NrbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r finalize_optionsrrZget_finalized_commandZbuilder_target_dirrospathjoinZ build_baseZensure_dirname repositoryrwarnannounce)rrr rrrr!;s        zupload_docs.finalize_optionsc Cstj|d}z|j|jxtj|jD]~\}}}||jkrT| rTd}t||jxP|D]H}tjj||}|t |jdj tjj } tjj| |} |j || qZWq(WWd|j XdS)Nwz'no files found in upload directory '%s')zipfileZZipFileZmkpathrr"walkrr#r$lenlstripsepwriteclose) rfilenamezip_filerootdirsfilesZtmplnameZfullZrelativedestrrrcreate_zipfileKs   zupload_docs.create_zipfilec Cslx|jD]}|j|q Wtj}|jjj}tjj |d|}z|j ||j |Wdt j |XdS)Nz%s.zip)Zget_sub_commandsZ run_commandtempfileZmkdtemp distributionmetadataget_namer"r#r$r7 upload_fileshutilZrmtree)rZcmd_nameZtmp_dirr5r1rrrrun[s  zupload_docs.runccs|\}}d|}t|ts |g}xn|D]f}t|trN|d|d7}|d}nt|}|Vt|VdV|V|r&|dddkr&dVq&WdS) Nz* Content-Disposition: form-data; name="%s"z; filename="%s"rr s   ) isinstancelisttupler)item sep_boundarykeyvaluestitlevaluerrr _build_partis     zupload_docs._build_partc Csnd}d|}|d}|df}tj|j|d}t||j}tjj|}tj||} d|jd} dj | | fS) z= Build up the MIME payload for the POST data s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s --s--r@)rFz multipart/form-data; boundary=%sascii) functoolspartialrKmapitems itertoolschain from_iterabledecoder$) clsdataboundaryrFZ end_boundaryZ end_itemsZbuilderZ part_groupspartsZ body_items content_typerrr_build_multipart}s  zupload_docs._build_multipartcCs:t|d}|j}WdQRX|jj}d|jtjj||fd}t|j d|j }t |}t j rn|jd}d|}|j|\}} d|j} |j| tjtjj|j\} } } }}}| dkrtj| }n | d krtj| }n td | d }yZ|j|jd | | }|jd ||jdtt||jd||j |j!|Wn6t"j#k r~}z|jt|tj$dSd}~XnX|j%}|j&dkrd|j&|j'f} |j| tjnb|j&dkr|j(d}|dkrd|j}d|} |j| tjnd|j&|j'f} |j| tj$|j)r6t*dd|jdddS)NrbZ doc_upload)z:actionr5content:rLzBasic zSubmitting documentation to %sZhttpZhttpszunsupported schema ZPOSTz Content-typezContent-lengthZ AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %s-K)+openreadr9r:r;r"r#basenamerZusernameZpasswordrrr rUr[r%r'rINFOrparseZurlparserZHTTPConnectionZHTTPSConnectionAssertionErrorZconnectZ putrequestZ putheaderstrr+Z endheaderssendsocketerrorZERRORZ getresponseZstatusreasonZ getheaderZ show_responseprint)rr0fr]metarWZ credentialsZauthZbodyZctmsgZschemaZnetlocZurlZparamsZqueryZ fragmentsZconnrZerlocationrrrr<s^              zupload_docs.upload_file)rNr)rNr)__name__ __module__ __qualname__ZDEFAULT_REPOSITORY descriptionr Z user_optionsZboolean_optionsrZ sub_commandsrr!r7r> staticmethodrK classmethodr[r<rrrrrs"    r)__doc__base64rZ distutilsrZdistutils.errorsrr"rkr)r8r=rRrNZsetuptools.externrZsetuptools.extern.six.movesrrZ pkg_resourcesrr rrrrrrs       PK!(88,command/__pycache__/bdist_egg.cpython-36.pycnu[3 vh G @sxdZddlmZddlmZmZddlmZddlm Z ddl Z ddl Z ddl Z ddl Z ddlZddlmZddlmZmZmZdd lmZdd lmZdd lmZydd lmZmZd dZWn,ek rddlm Z mZddZYnXddZ!ddZ"ddZ#GdddeZ$e%j&dj'Z(ddZ)ddZ*ddZ+d d!d"Z,d#d$Z-d%d&Z.d'd(Z/d)d*d+d,gZ0d1d/d0Z1dS)2z6setuptools.command.bdist_egg Build .egg distributions)DistutilsSetupError) remove_treemkpath)log)CodeTypeN)six)get_build_platform Distributionensure_directory) EntryPoint)Library)Command)get_pathget_python_versioncCstdS)Npurelib)rrr/usr/lib/python3.6/bdist_egg.py _get_purelibsr)get_python_librcCstdS)NF)rrrrrrscCs2d|krtjj|d}|jdr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrr strip_module#s   rccs:x4tj|D]&\}}}|j|j|||fVq WdS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfilesrrr sorted_walk+sr$c Cs6tjdj}t|d}|j||WdQRXdS)NaR def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() w)textwrapdedentlstripopenwrite)ZresourcepyfileZ_stub_templatefrrr write_stub5s  r-c@seZdZdZd*dddefd+d-d.d/gZd ddgZddZddZddZ ddZ ddZ ddZ d d!Z d"d#Zd$d%Zd&d'Zd(d)Zd S)0 bdist_eggzcreate an "egg" distribution bdist-dir=b1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s)exclude-source-filesN+remove all .py files from the generated egg keep-tempkz/keep the pseudo-installation tree around after z!creating the distribution archive dist-dir=d-directory to put final built distributions in skip-build2skip rebuilding everything (for testing/debugging)cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_files)selfrrrinitialize_optionsZszbdist_egg.initialize_optionscCs|jd}|_|j|_|jdkr>|jdj}tjj|d|_|jdkrPt |_|j dd|j dkrt dd|j |jt|jjo|jj }tjj|j|d|_ dS)Negg_infoZbdistZeggr?z.egg)r?r?)get_finalized_commandei_cmdrEr< bdist_baserrjoinr=rZset_undefined_optionsrAr Zegg_nameZ egg_versionr distributionhas_ext_modulesr?)rCrGrHbasenamerrrfinalize_optionscs      zbdist_egg.finalize_optionsc Cs|j|jd_tjjtjjt}|jj g}|j_ x|D]}t |t rt |dkrtjj |drtjj|d}tjj|}||ks|j|tjr|t |dd|df}|jj j|qrgetattrr)rCZinstcmdZold_rootrk all_outputs ext_outputsZ to_compiler2Zext_namerextr+Z archive_rootrEZ script_dirZ native_libsZ libs_filerrrrunsz                    z bdist_egg.runc Cstjdxt|jD]\}}}x|D]}tjj||}|jdrXtjd|tj ||jdr&|}d}t j ||}tjj|tj |j dd} tjd|| fytj| Wntk rYnXtj|| q&WqWdS) Nz+Removing .py files from temporary directoryz.pyz Deleting %s __pycache__z#(?P.+)\.(?P[^.]+)\.pycnamez.pyczRenaming file from [%s] to [%s])rr_walk_eggr<rrrIrdebugrzrematchpardirgroupremoveOSErrorrename) rCr!r"r#rrZpath_oldpatternmZpath_newrrrrs*        zbdist_egg.zap_pyfilescCs2t|jdd}|dk r|Stjdt|j|jS)Nr|z4zip_safe flag not set; analyzing archive contents...)rrJrr~ analyze_eggr<rt)rCsaferrrr| s  zbdist_egg.zip_safec Cstj|jjpd}|jdijd}|dkr0dS|j s>|jrLtd|ftj dd}|j }dj |j}|jd}t j j|j}d t}|jstt j j|j|jd t|jd} | j|| jd S) Nzsetuptools.installationZ eggsecutabler%zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulerraH#!/bin/sh if [ `basename $0` = "%(basename)s" ] then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@" else echo $0 is not the correct name for this egg file. echo Please rename it back to %(basename)s and try again. exec false fi )rea)r Z parse_maprJZ entry_pointsgetZattrsZextrasrsysversionZ module_namerIrrrLrAlocalsrerrjr)r*rx) rCZepmZepZpyverpkgZfullr!rLheaderr,rrrrs*      zbdist_egg.gen_headercCsltjj|j}tjj|d}xJ|jjjD]<}|j|r(tjj||t |d}t ||j ||q(WdS)z*Copy metadata (egg info) to the target_dirrN) rrnormpathrErIrGZfilelistr#r\rZr Z copy_file)rCZ target_dirZ norm_egg_infoprefixrtargetrrrrw:s zbdist_egg.copy_metadata_toc Csg}g}|jdi}x|t|jD]n\}}}x6|D].}tjj|djtkr.|j|||q.Wx*|D]"}|||d|tjj||<qfWqW|j j r |j d}xd|j D]Z} t | trq|j| j} |j| }tjj|jdstjjtjj|j|r|j|qW||fS)zAGet a list of relative paths to C extensions in the output distrorrPrlZ build_extzdl-)r<r$rrrlowerNATIVE_EXTENSIONSr^rIrJrKrF extensionsrXr Zget_ext_fullnamerZget_ext_filenamerLr\r}) rCrrpathsr!r"r#rZ build_cmdrfullnamerrrrsFs(   &      zbdist_egg.get_ext_outputs)r/r0r1)r3Nr4Pkeep the pseudo-installation tree around after creating the distribution archive)r5r6r)r7r8r9)r:Nr;)__name__ __module__ __qualname__ descriptionrZ user_optionsZboolean_optionsrDrMrcrdr`rrr|rrwrsrrrrr.Cs4   Q' r.z.dll .so .dylib .pydccsLt|}t|\}}}d|kr(|jd|||fVx|D] }|Vq:WdS)z@Walk an unpacked egg's contents, skipping the metadata directoryzEGG-INFON)r$nextr)egg_dirZwalkerr!r"r#Zbdfrrrrfs   rc Csx0tjD]$\}}tjjtjj|d|r |Sq Wts.visit) compression) zipfilerrrrjrr_Z ZIP_DEFLATEDZ ZIP_STOREDZZipFiler$rx) Z zip_filenamerrqrecompressrrrrrrrjr"r#r)rrerrs  r)rrTr%)2__doc__Zdistutils.errorsrZdistutils.dir_utilrrZ distutilsrtypesrrrrr&rZsetuptools.externrZ pkg_resourcesrr r r Zsetuptools.extensionr Z setuptoolsr sysconfigrrr ImportErrorZdistutils.sysconfigrrr$r-r.rrsplitrrrr{rrrrrfrrrrrsL         " $  PK!V1command/__pycache__/register.cpython-36.opt-1.pycnu[3 vh@s"ddljjZGdddejZdS)Nc@seZdZejjZddZdS)registercCs|jdtjj|dS)NZegg_info)Z run_commandorigrrun)selfr/usr/lib/python3.6/register.pyrs z register.runN)__name__ __module__ __qualname__rr__doc__rrrrrrsr)Zdistutils.command.registerZcommandrrrrrrs PK!V,command/__pycache__/bdist_rpm.cpython-36.pycnu[3 vh@s"ddljjZGdddejZdS)Nc@s eZdZdZddZddZdS) bdist_rpmaf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs|jdtjj|dS)NZegg_info)Z run_commandorigrrun)selfr/usr/lib/python3.6/bdist_rpm.pyrs z bdist_rpm.runcsl|jj}|jdd}tjj|}d|d|fdd|D}|jd}d|}|j|||S)N-_z%define version cs0g|](}|jddjddjddjqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0line)line23line24rr s z-bdist_rpm._make_spec_file..z%define unmangled_version )Z distributionZ get_versionr rr_make_spec_fileindexinsert)rversionZ rpmversionspecZ insert_locZunmangled_versionr)r rrrs     zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__rrrrrrrs r)Zdistutils.command.bdist_rpmZcommandrrrrrrs PK!'Ex%%,command/__pycache__/dist_info.cpython-36.pycnu[3 vh@s8dZddlZddlmZddlmZGdddeZdS)zD Create a dist_info directory As defined in the wheel specification N)Command)logc@s.eZdZdZd gZddZddZd d Zd S) dist_infozcreate a .dist-info directory egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dS)N)egg_base)selfr /usr/lib/python3.6/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdS)Nr )r r r r finalize_optionsszdist_info.finalize_optionscCsn|jd}|j|_|j|j|jdtd d}tjdjt j j ||jd}|j |j|dS)Negg_infoz .egg-infoz .dist-infoz creating '{}' bdist_wheel) Zget_finalized_commandrr runrlenrinfoformatospathabspathZegg2dist)r rZ dist_info_dirrr r r rs  z dist_info.runN)rrr)__name__ __module__ __qualname__ descriptionZ user_optionsr r rr r r r r s r)__doc__rZdistutils.corerZ distutilsrrr r r r s  PK!wY6o0command/__pycache__/bdist_wininst.cpython-36.pycnu[3 vh}@s"ddljjZGdddejZdS)Nc@seZdZdddZddZdS) bdist_wininstrcCs |jj||}|dkrd|_|S)zj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 install install_libN)rr)Z distributionreinitialize_commandr)selfcommandZreinit_subcommandscmdr #/usr/lib/python3.6/bdist_wininst.pyrs z"bdist_wininst.reinitialize_commandc Cs$d|_ztjj|Wdd|_XdS)NTF)Z _is_runningorigrrun)rr r r r szbdist_wininst.runN)r)__name__ __module__ __qualname__rr r r r r rs r)Zdistutils.command.bdist_wininstrrr r r r r s PK!uPP+command/__pycache__/saveopts.cpython-36.pycnu[3 vh@s$ddlmZmZGdddeZdS)) edit_config option_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsp|j}i}xP|jD]F}|dkr qx6|j|jD]$\}\}}|dkr0||j|i|<q0WqWt|j||jdS)Nrz command line)Z distributionZcommand_optionsZget_option_dictitems setdefaultrfilenameZdry_run)selfZdistZsettingscmdoptsrcvalr /usr/lib/python3.6/saveopts.pyrun s z saveopts.runN)__name__ __module__ __qualname____doc__ descriptionrr r r rrsrN)Zsetuptools.command.setoptrrrr r r rsPK!I%8command/__pycache__/install_scripts.cpython-36.opt-1.pycnu[3 vh @sRddlmZddljjZddlZddlZddlm Z m Z m Z GdddejZdS))logN) Distribution PathMetadataensure_directoryc@s*eZdZdZddZddZd ddZd S) install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstjj|d|_dS)NF)origrinitialize_optionsno_ep)selfr %/usr/lib/python3.6/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddljj}|jd|jjr,tjj|ng|_ |j rs  PK!hrԃ4command/__pycache__/install_lib.cpython-36.opt-1.pycnu[3 vh@sBddlZddlZddlmZmZddljjZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs&|j|j}|dk r"|j|dS)N)ZbuildinstallZ byte_compile)selfoutfilesr!/usr/lib/python3.6/install_lib.pyrun szinstall_lib.runcs4fddjD}t|j}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s"|]}j|D] }|VqqdS)N) _all_packages).0Zns_pkgpkg)rrr sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZ all_packagesZ excl_specsr)rr get_exclusionss  zinstall_lib.get_exclusionscCs$|jd|g}tjj|jf|S)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)rr Zexclusion_pathpartsrrr rszinstall_lib._exclude_pkg_pathccs$x|r|V|jd\}}}qWdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)Zpkg_namesepZchildrrr r 'szinstall_lib._all_packagescCs,|jjs gS|jd}|j}|r(|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r)Z distributionZnamespace_packagesZget_finalized_commandZ!single_version_externally_managed)rZ install_cmdZsvemrrr r1s  zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjjddtj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoget_tagN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrimprrrr)baserrr rAs    z install_lib._gen_exclusion_pathsrc sX|jstjj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|krjd|dSjd|tjj|j||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdst)excluder#rrr pfgs z!install_lib.copy_tree..pf)rorigr copy_treeZsetuptools.archive_utilr"Z distutilsr#) rZinfileZoutfileZ preserve_modeZpreserve_timesZpreserve_symlinkslevelr"r+r)r*r#rr r-Vs   zinstall_lib.copy_treecs.tjj|}|jr*fdd|DS|S)Ncsg|]}|kr|qSrr)r f)r*rr xsz+install_lib.get_outputs..)r,r get_outputsr)rZoutputsr)r*r r1ts  zinstall_lib.get_outputsN)r!r!rr!) __name__ __module__ __qualname____doc__r rr staticmethodr rrr-r1rrrr rs   r) rr itertoolsrrZdistutils.command.install_libZcommandrr,rrrr s PK!d-.W(command/__pycache__/sdist.cpython-36.pycnu[3 vh7@s~ddlmZddljjZddlZddlZddlZddl Z ddl m Z ddl m Z ddlZeZd ddZGd d d e ejZdS) )logN)six)sdist_add_defaultsccs4x.tjdD] }x|j|D] }|VqWq WdS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesZiter_entry_pointsload)dirnameZepitemr /usr/lib/python3.6/sdist.py walk_revctrlsr cseZdZdZd0d2d3gZiZd d ddgZeddeDZddZ ddZ ddZ ddZ e ejddZddZejd4kpd5ejkod6knpd7ejkod8knZereZd$d%Zfd&d'Zd(d)Zd*d+Zd,d-Zd.d/ZZS)9sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats for source distribution (comma-separated list) keep-tempkz1keep the distribution tree around after creating zarchive file(s) dist-dir=dFdirectory to put the source distribution archive(s) in [default: dist]rz.rstz.txtz.mdccs|]}dj|VqdS)z README{0}N)format).0Zextr r r )szsdist.cCs|jd|jd}|j|_|jjtjj|jd|jx|j D]}|j|qFW|j t |j dg}x*|j D] }dd|f}||krv|j|qvWdS)Negg_infoz SOURCES.txt dist_filesrr)Z run_commandget_finalized_commandfilelistappendospathjoinr check_readmeZget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdZcmd_namerfiledatar r r run+s    z sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r%r r r r*>s zsdist.initialize_optionscCstjdkrdSdg|_dS)NrbetarZgztar)r,r-rr.r)sys version_infoZformats)r%r r r r+Cs zsdist._default_to_gztarc Cs$|jtjj|WdQRXdS)z% Workaround for #516 N)_remove_os_linkr)rr")r%r r r r"Is zsdist.make_distributionccs^Gddd}ttd|}yt`Wntk r6YnXz dVWd||k rXttd|XdS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r r NoValueWsr5linkN)r#rr6 Exceptionsetattr)r5Zorig_valr r r r1Ps  zsdist._remove_os_linkc CsLytjj|Wn6tk rFtj\}}}|jjjdj YnXdS)Ntemplate) r)r read_templater7r/exc_infotb_nexttb_framef_localsclose)r%_tbr r r Z__read_template_hackes zsdist.__read_template_hackr,rrcsb|jjr^|jd}|jj|j|jjs^x0|jD]&\}}}|jjfdd|Dq4WdS)zgetting python filesbuild_pycsg|]}tjj|qSr )rrr )rfilename)src_dirr r sz.sdist._add_defaults_python..N)r$Zhas_pure_modulesrrextendZget_source_filesZinclude_package_dataZ data_files)r%rEr@ filenamesr )rGr _add_defaults_python|s  zsdist._add_defaults_pythonc sDy tjrtj|n tjWntk r>tjdYnXdS)Nz&data_files contains unexpected objects)rZPY2r_add_defaults_data_filessuper TypeErrorrwarn)r%) __class__r r rLs  zsdist._add_defaults_data_filescCs:x4|jD]}tjj|rdSqW|jddj|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrOr )r%fr r r r!s   zsdist.check_readmecCs^tjj|||tjj|d}ttdrJtjj|rJtj||j d||j dj |dS)Nz setup.cfgr6r) r)rmake_release_treerrr hasattrrRunlinkZ copy_filerZsave_version_info)r%Zbase_dirfilesdestr r r rTs   zsdist.make_release_treec Cs@tjj|jsdStj|jd}|j}WdQRX|djkS)NFrbz+# file GENERATED by distutils, do NOT edit )rrisfilemanifestioopenreadlineencode)r%fpZ first_liner r r _manifest_is_not_generateds z sdist._manifest_is_not_generatedc Cstjd|jt|jd}xl|D]d}tjr^y|jd}Wn$tk r\tjd|w YnX|j }|j ds | rxq |j j |q W|j dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'rYzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinfor[r]rZPY3decodeUnicodeDecodeErrorrOstrip startswithrrr?)r%r[liner r r read_manifests  zsdist.read_manifest)rNr@keep the distribution tree around after creating archive file(s))rrrj)rrr)rBrCrB)r,r)r,rrD)r,rB)r,rBr)r2r3r4__doc__Z user_optionsZ negative_optZREADME_EXTENSIONStuplerQr(r*r+r" staticmethod contextlibcontextmanagerr1Z_sdist__read_template_hackr/r0Zhas_leaky_handler:rKrLr!rTrari __classcell__r r )rPr rs:      r)r)Z distutilsrZdistutils.command.sdistZcommandrr)rr/r\rnZsetuptools.externrZ py36compatrrlistZ_default_revctrlr r r r r s     PK!I%2command/__pycache__/install_scripts.cpython-36.pycnu[3 vh @sRddlmZddljjZddlZddlZddlm Z m Z m Z GdddejZdS))logN) Distribution PathMetadataensure_directoryc@s*eZdZdZddZddZd ddZd S) install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstjj|d|_dS)NF)origrinitialize_optionsno_ep)selfr %/usr/lib/python3.6/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddljj}|jd|jjr,tjj|ng|_ |j rs  PK!VR3command/__pycache__/py36compat.cpython-36.opt-1.pycnu[3 vhz@sdddlZddlmZddlmZddlmZddlmZGdddZe ejdr`Gd ddZdS) N)glob) convert_path)sdist)filterc@s\eZdZdZddZeddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)sdist_add_defaultsz Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<|j|j|j|j|j|j|jdS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr /usr/lib/python3.6/py36compat.py add_defaultsszsdist_add_defaults.add_defaultscCs:tjj|sdStjj|}tjj|\}}|tj|kS)z Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ospathexistsabspathsplitlistdir)fspathrZ directoryfilenamerrr_cs_path_exists(s  z"sdist_add_defaults._cs_path_existscCs|j|jjg}x|D]}t|trn|}d}x(|D] }|j|r0d}|jj|Pq0W|s|jddj |q|j|r|jj|q|jd|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMES distributionZ script_name isinstancetuplerfilelistappendwarnjoin)rZ standardsfnZaltsZgot_itrrrr9s       z*sdist_add_defaults._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|}|jj|qWdS)Nz test/test*.pyz setup.cfg)rrrisfilerrextend)rZoptionalpatternfilesrrrrNs z)sdist_add_defaults._add_defaults_optionalcCsd|jd}|jjr$|jj|jx:|jD]0\}}}}x"|D]}|jjtj j ||q>Wq,WdS)Nbuild_py) get_finalized_commandrZhas_pure_modulesrr$get_source_files data_filesrrrr!)rr'ZpkgZsrc_dirZ build_dir filenamesrrrrr Ts    z'sdist_add_defaults._add_defaults_pythoncCs|jjr~xr|jjD]f}t|trDt|}tjj|rz|j j |q|\}}x,|D]$}t|}tjj|rR|j j |qRWqWdS)N) rZhas_data_filesr*rstrrrrr#rr)ritemdirnamer+frrrr ds     z+sdist_add_defaults._add_defaults_data_filescCs(|jjr$|jd}|jj|jdS)N build_ext)rZhas_ext_modulesr(rr$r))rr0rrrr us  z$sdist_add_defaults._add_defaults_extcCs(|jjr$|jd}|jj|jdS)N build_clib)rZhas_c_librariesr(rr$r))rr1rrrr zs  z'sdist_add_defaults._add_defaults_c_libscCs(|jjr$|jd}|jj|jdS)N build_scripts)rZ has_scriptsr(rr$r))rr2rrrr s  z(sdist_add_defaults._add_defaults_scriptsN)__name__ __module__ __qualname____doc__r staticmethodrrrr r r r r rrrrr s rrc@s eZdZdS)rN)r3r4r5rrrrrs) rrZdistutils.utilrZdistutils.commandrZsetuptools.extern.six.movesrrhasattrrrrrs    | PK!WQ^990command/__pycache__/install.cpython-36.opt-1.pycnu[3 vhK@svddlmZddlZddlZddlZddlZddljjZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZddd fd d d fgZe eZ d d Z ddZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependenciesold-and-unmanageableNTry not to use this!!single-version-externally-managed5used by system package builders to create 'flat' eggsZinstall_egg_infocCsdS)NT)selfrr/usr/lib/python3.6/install.pyszinstall.Zinstall_scriptscCsdS)NTr)r rrr r scCstjj|d|_d|_dS)N)origrinitialize_optionsold_and_unmanageable!single_version_externally_managed)r rrr r s zinstall.initialize_optionscCs<tjj||jrd|_n|jr8|j r8|j r8tddS)NTzAYou must specify --record or --root when building system packages)r rfinalize_optionsrootrrecordr)r rrr r%s zinstall.finalize_optionscCs(|js |jrtjj|Sd|_d|_dS)N)rrr rhandle_extra_pathZ path_fileZ extra_dirs)r rrr r0s  zinstall.handle_extra_pathcCs@|js |jrtjj|S|jtjs4tjj|n|jdS)N) rrr rrun_called_from_setupinspectZ currentframedo_egg_install)r rrr r:s   z install.runcCsz|dkr4d}tj|tjdkr0d}tj|dStj|d}|dd\}tj|}|jjdd }|d kox|j d kS) a Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail.Z IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distZ run_commands) warningswarnplatformZpython_implementationrZgetouterframesZ getframeinfo f_globalsgetZfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rEs     zinstall._called_from_setupcCs|jjd}||jd|j|jd}|jd|_|jjtjd|j d|jj dj g}t j rp|jdt j ||_|jdt _ dS)N easy_installx)argsrr.z*.eggZ bdist_eggr)Z distributionZget_command_classrrZensure_finalizedZalways_copy_fromZ package_indexscanglobZ run_commandZget_command_objZ egg_output setuptoolsZbootstrap_install_frominsertr&r)r r$cmdr&rrr r`s  zinstall.do_egg_install)rNr)rNr)r __module__ __qualname____doc__r rZ user_optionsZboolean_options new_commandsdict_ncr rrr staticmethodrrrrrr rs      rcCsg|]}|dtjkr|qS)r)rr2).0r,rrr {sr5)Zdistutils.errorsrrr)rrZdistutils.command.installZcommandrr r*_installZ sub_commandsr0rrrr s  lPK!V2command/__pycache__/bdist_rpm.cpython-36.opt-1.pycnu[3 vh@s"ddljjZGdddejZdS)Nc@s eZdZdZddZddZdS) bdist_rpmaf Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. 3. Replace dash with underscore in the version numbers for better RPM compatibility. cCs|jdtjj|dS)NZegg_info)Z run_commandorigrrun)selfr/usr/lib/python3.6/bdist_rpm.pyrs z bdist_rpm.runcsl|jj}|jdd}tjj|}d|d|fdd|D}|jd}d|}|j|||S)N-_z%define version cs0g|](}|jddjddjddjqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0line)line23line24rr s z-bdist_rpm._make_spec_file..z%define unmangled_version )Z distributionZ get_versionr rr_make_spec_fileindexinsert)rversionZ rpmversionspecZ insert_locZunmangled_versionr)r rrrs     zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__rrrrrrrs r)Zdistutils.command.bdist_rpmZcommandrrrrrrs PK!e.command/__pycache__/install_lib.cpython-36.pycnu[3 vh@sBddlZddlZddlmZmZddljjZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs&|j|j}|dk r"|j|dS)N)ZbuildinstallZ byte_compile)selfoutfilesr!/usr/lib/python3.6/install_lib.pyrun szinstall_lib.runcs4fddjD}t|j}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s"|]}j|D] }|VqqdS)N) _all_packages).0Zns_pkgpkg)rrr sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZ all_packagesZ excl_specsr)rr get_exclusionss  zinstall_lib.get_exclusionscCs$|jd|g}tjj|jf|S)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)rr Zexclusion_pathpartsrrr rszinstall_lib._exclude_pkg_pathccs$x|r|V|jd\}}}qWdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)Zpkg_namesepZchildrrr r 'szinstall_lib._all_packagescCs,|jjs gS|jd}|j}|r(|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r)Z distributionZnamespace_packagesZget_finalized_commandZ!single_version_externally_managed)rZ install_cmdZsvemrrr r1s  zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjjddtj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoget_tagN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrimprrrr)baserrr rAs    z install_lib._gen_exclusion_pathsrc sj|r|r| st|js.tjj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|krjd|dSjd|tjj|j||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdst)excluder#rrr pfgs z!install_lib.copy_tree..pf) AssertionErrorrorigr copy_treeZsetuptools.archive_utilr"Z distutilsr#) rZinfileZoutfileZ preserve_modeZpreserve_timesZpreserve_symlinkslevelr"r+r)r*r#rr r.Vs   zinstall_lib.copy_treecs.tjj|}|jr*fdd|DS|S)Ncsg|]}|kr|qSrr)r f)r*rr xsz+install_lib.get_outputs..)r-r get_outputsr)rZoutputsr)r*r r2ts  zinstall_lib.get_outputsN)r!r!rr!) __name__ __module__ __qualname____doc__r rr staticmethodr rrr.r2rrrr rs   r) rr itertoolsrrZdistutils.command.install_libZcommandrr-rrrr s PK! V\9: : 9command/__pycache__/install_egg_info.cpython-36.opt-1.pycnu[3 vh@s\ddlmZmZddlZddlmZddlmZddlmZddl Z Gdddej eZ dS))logdir_utilN)Command) namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZd d Zd d Z d dZ dS)install_egg_infoz.Install an .egg-info directory for the package install-dir=ddirectory to install tocCs d|_dS)N) install_dir)selfr &/usr/lib/python3.6/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|jdd|jd}tjdd|j|jjd}|j|_tj j |j ||_ g|_ dS)NZ install_libr egg_infoz .egg-info)r r )Zset_undefined_optionsZget_finalized_command pkg_resourcesZ DistributionZegg_nameZ egg_versionrsourceospathjoinr targetoutputs)r Zei_cmdbasenamer r rfinalize_optionss z!install_egg_info.finalize_optionscCs|jdtjj|jr.skimmer)rrr)r r+r )r rr1s zinstall_egg_info.copytreeN)rr r ) __name__ __module__ __qualname____doc__ descriptionZ user_optionsrrr r!rr r r rr s  r) Z distutilsrrrZ setuptoolsrrZsetuptools.archive_utilrrZ Installerrr r r rs    PK!.  )command/__pycache__/rotate.cpython-36.pycnu[3 vht@s`ddlmZddlmZddlmZddlZddlZddlm Z ddl m Z Gddde Z dS) ) convert_path)log)DistutilsOptionErrorN)six)Commandc@s:eZdZdZdZdddgZgZd d ZddZddZ dS)rotatezDelete older distributionsz2delete older distributions, keeping N newest filesmatch=mpatterns to match (required) dist-dir=d%directory where the distributions arekeep=k(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/usr/lib/python3.6/rotate.pyinitialize_optionsszrotate.initialize_optionsc Cs|jdkrtd|jdkr$tdyt|j|_Wntk rPtdYnXt|jtjrxdd|jjdD|_|j dd dS) NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|jqSr)rstrip).0prrr +sz+rotate.finalize_options..,Zbdistr)rr) rrrint ValueError isinstancerZ string_typessplitZset_undefined_options)rrrrfinalize_optionss  zrotate.finalize_optionscCs|jdddlm}x|jD]}|jjd|}|tjj|j|}dd|D}|j |j t j dt ||||jd}xD|D]<\}}t j d||jstjj|rtj|qtj|qWqWdS) NZegg_infor)glob*cSsg|]}tjj||fqSr)ospathgetmtime)rfrrrr6szrotate.run..z%d file(s) matching %sz Deleting %s)Z run_commandr"rZ distributionZget_namer$r%joinrsortreverserinfolenrZdry_runisdirshutilZrmtreeunlink)rr"patternfilestr'rrrrun/s       z rotate.runN)rr r )r r r )rrr) __name__ __module__ __qualname____doc__ descriptionZ user_optionsZboolean_optionsrr!r3rrrrr sr) Zdistutils.utilrZ distutilsrZdistutils.errorsrr$r.Zsetuptools.externrZ setuptoolsrrrrrrs     PK!)w##/command/__pycache__/upload.cpython-36.opt-1.pycnu[3 vh@s*ddlZddlmZGdddejZdS)N)uploadc@s(eZdZdZddZddZddZdS) rza Override default upload behavior to obtain password in a variety of different ways. cCs8tjj||jptj|_|jp0|jp0|j|_dS)N) origrfinalize_optionsusernamegetpassZgetuserZpassword_load_password_from_keyring_prompt_for_password)selfr /usr/lib/python3.6/upload.pyr s   zupload.finalize_optionsc Cs2ytd}|j|j|jStk r,YnXdS)zM Attempt to load password from keyring. Suppress Exceptions. keyringN) __import__Z get_passwordZ repositoryr Exception)r r r r r rs z"upload._load_password_from_keyringc Cs&ytjSttfk r YnXdS)zH Prompt for a password on the tty. Suppress Exceptions. N)rrKeyboardInterrupt)r r r r r#szupload._prompt_for_passwordN)__name__ __module__ __qualname____doc__rrrr r r r rs r)rZdistutils.commandrrr r r r s PK!ޅ&)command/__pycache__/setopt.cpython-36.pycnu[3 vh@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd dZ dddZ Gdd d e ZGdd d eZdS)) convert_path)log)DistutilsOptionErrorN) configparser)Command config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjjtjjtjdS|dkrZtjdkrBdpDd}tjjtd |St d |d S) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)Zkinddotr/usr/lib/python3.6/setopt.pyrsFc Cs.tjd|tj}|j|gx|jD]\}}|dkrTtjd|||j|q*|j|svtjd|||j |x||jD]p\}}|dkrtjd||||j |||j |stjd|||j|qtjd|||||j |||qWq*Wtjd||s*t |d }|j|WdQRXdS) aYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sw)rdebugrZRawConfigParserreaditemsinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionoptionssetopenwrite) filenameZsettingsdry_runZoptsZsectionr"optionvaluefrrrr!s8            c@s2eZdZdZdddgZddgZd d Zd dZdS)r zr? descriptionr r@rAr6r;rSrrrrr ss )r )F)Zdistutils.utilrrrZdistutils.errorsrrZsetuptools.extern.six.movesrZ setuptoolsr__all__rrr r rrrrs        +'PK!VR-command/__pycache__/py36compat.cpython-36.pycnu[3 vhz@sdddlZddlmZddlmZddlmZddlmZGdddZe ejdr`Gd ddZdS) N)glob) convert_path)sdist)filterc@s\eZdZdZddZeddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)sdist_add_defaultsz Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<|j|j|j|j|j|j|jdS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr /usr/lib/python3.6/py36compat.py add_defaultsszsdist_add_defaults.add_defaultscCs:tjj|sdStjj|}tjj|\}}|tj|kS)z Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ospathexistsabspathsplitlistdir)fspathrZ directoryfilenamerrr_cs_path_exists(s  z"sdist_add_defaults._cs_path_existscCs|j|jjg}x|D]}t|trn|}d}x(|D] }|j|r0d}|jj|Pq0W|s|jddj |q|j|r|jj|q|jd|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMES distributionZ script_name isinstancetuplerfilelistappendwarnjoin)rZ standardsfnZaltsZgot_itrrrr9s       z*sdist_add_defaults._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|}|jj|qWdS)Nz test/test*.pyz setup.cfg)rrrisfilerrextend)rZoptionalpatternfilesrrrrNs z)sdist_add_defaults._add_defaults_optionalcCsd|jd}|jjr$|jj|jx:|jD]0\}}}}x"|D]}|jjtj j ||q>Wq,WdS)Nbuild_py) get_finalized_commandrZhas_pure_modulesrr$get_source_files data_filesrrrr!)rr'ZpkgZsrc_dirZ build_dir filenamesrrrrr Ts    z'sdist_add_defaults._add_defaults_pythoncCs|jjr~xr|jjD]f}t|trDt|}tjj|rz|j j |q|\}}x,|D]$}t|}tjj|rR|j j |qRWqWdS)N) rZhas_data_filesr*rstrrrrr#rr)ritemdirnamer+frrrr ds     z+sdist_add_defaults._add_defaults_data_filescCs(|jjr$|jd}|jj|jdS)N build_ext)rZhas_ext_modulesr(rr$r))rr0rrrr us  z$sdist_add_defaults._add_defaults_extcCs(|jjr$|jd}|jj|jdS)N build_clib)rZhas_c_librariesr(rr$r))rr1rrrr zs  z'sdist_add_defaults._add_defaults_c_libscCs(|jjr$|jd}|jj|jdS)N build_scripts)rZ has_scriptsr(rr$r))rr2rrrr s  z(sdist_add_defaults._add_defaults_scriptsN)__name__ __module__ __qualname____doc__r staticmethodrrrr r r r r rrrrr s rrc@s eZdZdS)rN)r3r4r5rrrrrs) rrZdistutils.utilrZdistutils.commandrZsetuptools.extern.six.movesrrhasattrrrrrs    | PK!0!0!1command/__pycache__/build_py.cpython-36.opt-1.pycnu[3 vh|% @sddlmZddlmZddljjZddlZddlZddl Z ddl Z ddl Z ddl Z ddlmZddlmZmZmZyddlmZWn"ek rGdddZYnXGd d d ejeZdd d Zd dZdS))glob) convert_pathN)six)mapfilter filterfalse) Mixin2to3c@seZdZdddZdS)rTcCsdS)z do nothingN)selffilesZdoctestsr r /usr/lib/python3.6/build_py.pyrun_2to3szMixin2to3.run_2to3N)T)__name__ __module__ __qualname__r r r r r rsrc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCsFtjj||jj|_|jjp i|_d|jkr6|jd=g|_g|_dS)N data_files) origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_files_build_py__doctests_2to3)r r r r r!s   zbuild_py.finalize_optionscCs||j r|j rdS|jr"|j|jr8|j|j|j|jd|j|jd|j|jd|jt j j |dddS)z?Build modules, packages, and copy data files to build directoryNFTr)Zinclude_bytecode) Z py_modulespackagesZ build_modulesZbuild_packagesbuild_package_datar rrZ byte_compilerrZ get_outputs)r r r r run+sz build_py.runcCs&|dkr|j|_|jStjj||S)zlazily compute data filesr)_get_data_filesrrr __getattr__)r attrr r r r?s zbuild_py.__getattr__cCsJtjrt|tjr|jd}tjj||||\}}|rB|jj |||fS)N.) rZPY2 isinstanceZ string_typessplitrr build_modulerappend)r moduleZ module_filepackageZoutfilecopiedr r r r$Fs    zbuild_py.build_modulecCs|jtt|j|jpfS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples)analyze_manifestlistr_get_pkg_data_filesr)r r r r rPszbuild_py._get_data_filescsJ|j|tjj|jg|jd}fdd|j|D}|||fS)Nr!csg|]}tjj|qSr )ospathrelpath).0file)src_dirr r ^sz0build_py._get_pkg_data_files..)get_package_dirr,r-joinZ build_libr#find_data_files)r r' build_dir filenamesr )r1r r+Us   zbuild_py._get_pkg_data_filescCsX|j|j||}tt|}tjj|}ttj j |}tj|j j |g|}|j |||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrrr itertoolschain from_iterablerr,r-isfilemanifest_filesgetexclude_data_files)r r'r1patternsZglobs_expandedZ globs_matchesZ glob_filesr r r r r5cs   zbuild_py.find_data_filesc Csx|jD]\}}}}xr|D]j}tjj||}|jtjj|tjj||}|j||\}} tjj|}| r||jj kr|j j |qWqWdS)z$Copy data files into build directoryN) rr,r-r4ZmkpathdirnameZ copy_fileabspathrZconvert_2to3_doctestsrr%) r r'r1r6r7filenametargetZsrcfileZoutfr(r r r rts   zbuild_py.build_package_datac Csi|_}|jjsdSi}x$|jp$fD]}||t|j|<q&W|jd|jd}x|jj D]}t j j t|\}}d}|} x:|r||kr||kr|}t j j |\}} t j j | |}qW||kr^|jdr|| krq^|j||gj|q^WdS)NZegg_infoz.py)r=rZinclude_package_datarassert_relativer3Z run_commandZget_finalized_commandZfilelistr r,r-r#r4endswith setdefaultr%) r ZmfZsrc_dirsr'Zei_cmdr-dfprevZoldfZdfr r r r)s(   zbuild_py.analyze_manifestcCsdS)Nr )r r r r get_data_filesszbuild_py.get_data_filescCsy |j|Stk rYnXtjj|||}||j|<| sJ|jj rN|Sx,|jjD]}||ksr|j|drXPqXW|Stj |d}|j }WdQRXd|krt j j d|f|S)z8Check namespace packages' __init__ for declare_namespacer!rbNsdeclare_namespacezNamespace package problem: %s is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorrr check_packagerZnamespace_packages startswithioopenread distutilserrorsZDistutilsError)r r'Z package_dirZinit_pyZpkgrIcontentsr r r rOs&   zbuild_py.check_packagecCsi|_tjj|dS)N)rMrrinitialize_options)r r r r rWszbuild_py.initialize_optionscCs0tjj||}|jjdk r,tjj|jj|S|S)N)rrr3rZsrc_rootr,r-r4)r r'resr r r r3s zbuild_py.get_package_dircs\t|j|j||}fdd|D}tjj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}tj|VqdS)N)fnmatchr)r/pattern)r r r sz.build_py.exclude_data_files..c3s|]}|kr|VqdS)Nr )r/fn)badr r r[s)r*r8rr9r:r;set_unique_everseen)r r'r1r r@Z match_groupsZmatchesZkeepersr )r]r r r?s   zbuild_py.exclude_data_filescs.tj|jdg|j|g}fdd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3s |]}tjjt|VqdS)N)r,r-r4r)r/rZ)r1r r r[sz2build_py._get_platform_patterns..)r9r:r>)specr'r1Z raw_patternsr )r1r r8s   zbuild_py._get_platform_patternsN)rrr__doc__rrrr$rr+r5rr)rKrOrWr3r? staticmethodr8r r r r rs    rccsjt}|j}|dkr:xPt|j|D]}|||Vq"Wn,x*|D]"}||}||kr@|||Vq@WdS)zHList unique elements, preserving order. Remember all elements ever seen.N)r^addr __contains__)iterablekeyseenZseen_addelementkr r r r_s  r_cCs:tjj|s|Sddlm}tjdj|}||dS)Nr)DistutilsSetupErrorz Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )r,r-isabsdistutils.errorsrktextwrapdedentlstrip)r-rkmsgr r r rEs   rE)N)rZdistutils.utilrZdistutils.command.build_pyZcommandrrr,rYrnrQrmrTr9Zsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.lib2to3_exr ImportErrorr_rEr r r r s$    Y PK!&&,command/__pycache__/build_ext.cpython-36.pycnu[3 vhu3@sddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ddlmZddlmZddlmZdd lmZyddlmZed Wnek reZYnXe d dd l mZd dZdZdZdZej dkrdZn>ej!dkr,yddl"Z"e#e"dZZWnek r*YnXddZ$ddZ%GdddeZes^ej!dkrjd!ddZ&ndZd"ddZ&dd Z'dS)#N) build_ext) copy_file) new_compiler)customize_compilerget_config_var)DistutilsError)log)Library)sixzCython.Compiler.MainLDSHARED) _config_varsc CsZtjdkrNtj}z$dtd<dtd<dtd<t|Wdtjtj|Xnt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookupr z -dynamiclibCCSHAREDz.dylibSO)sysplatform _CONFIG_VARScopyrclearupdate)compilerZtmpr/usr/lib/python3.6/build_ext.py_customize_compiler_for_shlibs  rFZsharedr TntRTLD_NOWcCs tr|SdS)N) have_rtld)srrr>srcCs>x8ddtjDD]"\}}}d|kr*|S|dkr|SqWdS)z;Return the file extension for an abi3-compliant Extension()css |]}|dtjkr|VqdS)N)impZ C_EXTENSION).0rrrr Csz"get_abi3_suffix..z.abi3z.pydN)r!Z get_suffixes)suffix_rrrget_abi3_suffixAs r&c@sveZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddZdS)rcCs.|jd}|_tj|||_|r*|jdS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace _build_extruncopy_extensions_to_source)selfZ old_inplacerrrr(Ks  z build_ext.runc Cs|jd}x|jD]}|j|j}|j|}|jd}dj|dd}|j|}tj j|tj j |}tj j|j |} t | ||j |jd|jr|j|ptj|dqWdS)Nbuild_py.)verbosedry_runT)get_finalized_command extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename build_librr.r/ _needs_stub write_stubcurdir) r*r+extfullnamefilenameZmodpathpackageZ package_dirZ dest_filenameZ src_filenamerrrr)Ss       z#build_ext.copy_extensions_to_sourcecCstj||}||jkr|j|}tjo4t|do4t}|r^td}|dt| }|t}t |t rt j j |\}}|jj|tStr|jrt j j|\}}t j j|d|S|S)NZpy_limited_api EXT_SUFFIXzdl-)r'r5ext_mapr ZPY3getattrr&_get_config_var_837len isinstancer r8r9splitextshlib_compilerlibrary_filenamelibtype use_stubs_links_to_dynamicr6r7)r*r@rAr?Zuse_abi3Zso_extfndrrrr5is"       zbuild_ext.get_ext_filenamecCs tj|d|_g|_i|_dS)N)r'initialize_optionsrJshlibsrD)r*rrrrQ~s zbuild_ext.initialize_optionscCs2tj||jpg|_|j|jdd|jD|_|jrB|jx|jD]}|j|j|_qJWx|jD]}|j}||j |<||j |j dd<|jr|j |pd}|ot ot |t }||_||_|j|}|_tjjtjj|j|}|o||jkr|jj||rht rhtj|jkrh|jjtjqhWdS)NcSsg|]}t|tr|qSr)rHr )r"r?rrr sz.build_ext.finalize_options..r,r-Fr0)r'finalize_optionsr2Zcheck_extensions_listrRsetup_shlib_compilerr3r4 _full_namerDr6links_to_dynamicrMrHr rNr<r5 _file_namer8r9dirnamer7r; library_dirsappendr>runtime_library_dirs)r*r?r@ZltdnsrAZlibdirrrrrTs,       zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdk r8|j|j|jdk rbx|jD]\}}|j ||qJW|j dk rx|j D]}|j |qtW|j dk r|j |j |jdk r|j|j|jdk r|j|j|jdk r|j|jtj||_dS)N)rr/force)rrr/r^rJrZ include_dirsZset_include_dirsZdefineZ define_macroZundefZundefine_macro librariesZ set_librariesrZZset_library_dirsZrpathZset_runtime_library_dirsZ link_objectsZset_link_objectslink_shared_object__get__)r*rr4valueZmacrorrrrUs(             zbuild_ext.setup_shlib_compilercCst|tr|jStj||S)N)rHr export_symbolsr'get_export_symbols)r*r?rrrrds zbuild_ext.get_export_symbolsc Cs\|j|j}z@t|tr"|j|_tj|||jrL|jdj }|j ||Wd||_XdS)Nr+) Z_convert_pyx_sources_to_langrrHr rJr'build_extensionr<r1r;r=)r*r?Z _compilercmdrrrres   zbuild_ext.build_extensioncsPtjdd|jDdj|jjddd dgtfdd|jDS) z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|] }|jqSr)rV)r"librrrrSsz.build_ext.links_to_dynamic..r,Nr-rc3s|]}|kVqdS)Nr)r"Zlibname)libnamespkgrrr#sz-build_ext.links_to_dynamic..r0)dictfromkeysrRr7rVr6anyr_)r*r?r)rhrirrWs zbuild_ext.links_to_dynamiccCstj||jS)N)r' get_outputs_build_ext__get_stubs_outputs)r*rrrrmszbuild_ext.get_outputscs6fddjD}tj|j}tdd|DS)Nc3s0|](}|jrtjjjf|jjdVqdS)r,N)r<r8r9r7r;rVr6)r"r?)r*rrr#sz0build_ext.__get_stubs_outputs..css|]\}}||VqdS)Nr)r"baseZfnextrrrr#s)r2 itertoolsproduct!_build_ext__get_output_extensionslist)r*Z ns_ext_basesZpairsr)r*rZ__get_stubs_outputss  zbuild_ext.__get_stubs_outputsccs"dVdV|jdjrdVdS)Nz.pyz.pycr+z.pyo)r1optimize)r*rrrZ__get_output_extensionss z!build_ext.__get_output_extensionsFcCs.tjd|j|tjj|f|jjdd}|rJtjj|rJt|d|j st |d}|j djddd t d d tjj |jd d dt ddddt dddt ddddg|j|r*ddlm}||gdd|j d|jdj}|dkr||g|d|j dtjj|r*|j r*tj|dS)Nz writing stub loader for %s to %sr,z.pyz already exists! Please delete.w zdef __bootstrap__():z- global __bootstrap__, __file__, __loader__z% import sys, os, pkg_resources, impz, dlz: __file__ = pkg_resources.resource_filename(__name__,%r)z del __bootstrap__z if '__loader__' in globals():z del __loader__z# old_flags = sys.getdlopenflags()z old_dir = os.getcwd()z try:z( os.chdir(os.path.dirname(__file__))z$ sys.setdlopenflags(dl.RTLD_NOW)z( imp.load_dynamic(__name__,__file__)z finally:z" sys.setdlopenflags(old_flags)z os.chdir(old_dir)z__bootstrap__()rr) byte_compileT)rtr^r/Z install_lib)rinforVr8r9r7r6existsrr/openwriteif_dlr:rXcloseZdistutils.utilrwr1rtunlink)r* output_dirr?compileZ stub_filefrwrtrrrr=sP          zbuild_ext.write_stubN)F)__name__ __module__ __qualname__r(r)r5rQrTrUrdrerWrmrnrrr=rrrrrJs   rc Cs(|j|j||||||||| | | | dS)N)linkZSHARED_LIBRARY) r*objectsoutput_libnamerr_rZr\rcdebug extra_preargsextra_postargs build_temp target_langrrrr`s r`Zstaticc Cs^|dks ttjj|\}} tjj| \}}|jdjdrH|dd}|j||||| dS)Nxrg)AssertionErrorr8r9r6rIrK startswithZcreate_static_lib)r*rrrr_rZr\rcrrrrrrAr:r?rrrr`,s  cCstjdkrd}t|S)z In https://github.com/pypa/setuptools/pull/837, we discovered Python 3.3.0 exposes the extension suffix under the name 'SO'. rr-r)rrr-)r version_infor)r4rrrrFDs rF) NNNNNrNNNN) NNNNNrNNNN)(r8rrpr!Zdistutils.command.build_extrZ _du_build_extZdistutils.file_utilrZdistutils.ccompilerrZdistutils.sysconfigrrZdistutils.errorsrZ distutilsrZsetuptools.extensionr Zsetuptools.externr ZCython.Distutils.build_extr' __import__ ImportErrorr rrrrMrLrr4Zdlhasattrr|r&r`rFrrrrsZ              Q  PK!5+command/__pycache__/__init__.cpython-36.pycnu[3 vhR@szdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrrdejd<ejjd[[dS)alias bdist_eggZ bdist_rpmZ build_extZbuild_pyZdevelopZ easy_installZegg_infoZinstallZ install_librotateZsaveoptsZsdistZsetoptZtestZinstall_egg_infoinstall_scriptsregisterZ bdist_wininstZ upload_docsZuploadZ build_clibZ dist_info)bdistN)rZeggPython .egg file)rr) __all__Zdistutils.command.bdistrsysZsetuptools.commandrZformat_commandsZformat_commandappendr r /usr/lib/python3.6/__init__.pys         PK!9Y5 5 .command/__pycache__/alias.cpython-36.opt-1.pycnu[3 vhz @sPddlmZddlmZddlmZmZmZddZGdddeZ dd Z d S) )DistutilsOptionError)map) edit_config option_base config_filecCs8xdD]}||krt|SqW|j|gkr4t|S|S)z4Quote an argument for later parsing by shlex.split()"'\#)rrr r )reprsplit)argcr/usr/lib/python3.6/alias.pyshquotes   rc@sHeZdZdZdZdZdgejZejdgZddZ d d Z d d Z d S)aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsTremoverremove (unset) the aliascCstj|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs zalias.initialize_optionscCs*tj||jr&t|jdkr&tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrr)rrrrr#s zalias.finalize_optionscCs|jjd}|jsDtdtdx|D]}tdt||q(WdSt|jdkr|j\}|jrfd}q||krtdt||dStd|dSn$|jd}djtt |jdd}t |j d||ii|j dS) NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr ) Z distributionZget_option_dictrprint format_aliasrrjoinrrrfilenameZdry_run)rrrcommandrrrrun+s&    z alias.runN)rrr) __name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsrZ user_optionsZboolean_optionsrrr#rrrrrs rcCsZ||\}}|tdkrd}n,|tdkr0d}n|tdkrBd}nd|}||d|S) Nglobalz--global-config userz--user-config Zlocalz --filename=%rr)r)namersourcer"rrrrFs    rN) Zdistutils.errorsrZsetuptools.extern.six.movesrZsetuptools.command.setoptrrrrrrrrrrs   4PK!51command/__pycache__/__init__.cpython-36.opt-1.pycnu[3 vhR@szdddddddddd d d d d dddddddddgZddlmZddlZddlmZdejkrrdejd<ejjd[[dS)alias bdist_eggZ bdist_rpmZ build_extZbuild_pyZdevelopZ easy_installZegg_infoZinstallZ install_librotateZsaveoptsZsdistZsetoptZtestZinstall_egg_infoinstall_scriptsregisterZ bdist_wininstZ upload_docsZuploadZ build_clibZ dist_info)bdistN)rZeggPython .egg file)rr) __all__Zdistutils.command.bdistrsysZsetuptools.commandrZformat_commandsZformat_commandappendr r /usr/lib/python3.6/__init__.pys         PK!͆*command/__pycache__/develop.cpython-36.pycnu[3 vhn@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl m Z mZmZddlmZddlmZddlZGd d d ejeZGd d d eZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN)six) Distribution PathMetadatanormalize_path) easy_install) namespacesc@sveZdZdZdZejddgZejdgZd Zd d Z d d Z ddZ e ddZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode' uninstalluUninstall this source package egg-path=N-Set the path to be used in the .egg-link fileFcCs2|jrd|_|j|jn|j|jdS)NT)r Z multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_options)selfr/usr/lib/python3.6/develop.pyruns  z develop.runcCs&d|_d|_tj|d|_d|_dS)N.)r egg_pathr initialize_options setup_pathZalways_copy_from)rrrrr's  zdevelop.initialize_optionscCs|jd}|jr,d}|j|jf}t|||jg|_tj||j|j |j j t j d|jd}t jj|j||_|j|_|jdkrt jj|j|_t|j}tt jj|j|j}||krtd|t|t|t jj|j|jd|_|j|j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to ) project_name)get_finalized_commandZbroken_egg_inforrZegg_nameargsr finalize_optionsZexpand_basedirsZ expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspathr rrrdist_resolve_setup_pathr)rZeitemplaterZ egg_link_fntargetrrrrr .s<           zdevelop.finalize_optionscCsh|jtjdjd}|tjkr0d|jdd}ttjj|||}|ttjkrdt d|ttj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacer#seprstripcurdircountr r$r%r)r(r&rZ path_to_setupZresolvedrrrr+Xs zdevelop._resolve_setup_pathc CsDtjrt|jddr|jddd|jd|jd}t|j}|jd|d|jd|jddd|jd|jd}||_ ||j _ t ||j |j _n"|jd|jdd d|jd|jtjr|jtjdt_|jtjd |j|j|js,t|jd }|j|j d |jWdQRX|jd|j |j dS) NZuse_2to3FZbuild_pyr)Zinplacer)r(Z build_extr/zCreating %s (link to %s)w )rZPY3getattr distributionZreinitialize_commandZ run_commandrr Z build_librr*locationrrZ _providerZinstall_site_py setuptoolsZbootstrap_install_fromr Zinstall_namespacesrinfor'r(dry_runopenwriterZprocess_distributionZno_deps)rZbpy_cmdZ build_pathZei_cmdfrrrrks4          zdevelop.install_for_developmentcCstjj|jrztjd|j|jt|j}dd|D}|j||j g|j |j gfkrhtj d|dS|j sztj |j|j s|j|j|jjrtj ddS)NzRemoving %s (link to %s)cSsg|] }|jqSr)r2).0linerrr sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r#r$existsr'rr;r(r=closerrwarnr<unlinkZ update_pthr*r8scripts)rZ egg_link_filecontentsrrrrs    zdevelop.uninstall_linkc Cs||jk rtj||S|j|x^|jjp,gD]N}tjjt |}tjj |}t j |}|j }WdQRX|j||||q.WdS)N)r*r install_egg_scriptsinstall_wrapper_scriptsr8rGr#r$r)rbasenameior=readZinstall_script)rr*Z script_nameZ script_pathZstrmZ script_textrrrrIs     zdevelop.install_egg_scriptscCst|}tj||S)N)VersionlessRequirementr rJ)rr*rrrrJszdevelop.install_wrapper_scripts)r rr)rNr)__name__ __module__ __qualname____doc__ descriptionr Z user_optionsZboolean_optionsZcommand_consumes_argumentsrrr staticmethodr+rrrIrJrrrrr s  * /r c@s(eZdZdZddZddZddZdS) rNaz Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS)N)_VersionlessRequirement__dist)rr*rrr__init__szVersionlessRequirement.__init__cCs t|j|S)N)r7rU)rnamerrr __getattr__sz"VersionlessRequirement.__getattr__cCs|jS)N)r)rrrras_requirementsz%VersionlessRequirement.as_requirementN)rOrPrQrRrVrXrYrrrrrNs rN)Zdistutils.utilrZ distutilsrZdistutils.errorsrrr#r"rLZsetuptools.externrZ pkg_resourcesrrr Zsetuptools.command.easy_installr r:r ZDevelopInstallerr objectrNrrrrs     4PK!V+command/__pycache__/register.cpython-36.pycnu[3 vh@s"ddljjZGdddejZdS)Nc@seZdZejjZddZdS)registercCs|jdtjj|dS)NZegg_info)Z run_commandorigrrun)selfr/usr/lib/python3.6/register.pyrs z register.runN)__name__ __module__ __qualname__rr__doc__rrrrrrsr)Zdistutils.command.registerZcommandrrrrrrs PK!{AD D 3command/__pycache__/build_clib.cpython-36.opt-1.pycnu[3 vh@sFddljjZddlmZddlmZddlm Z GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS) build_clibav Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Cs~xv|D]l\}}|jd}|dks4t|ttf r@td|t|}tjd||jdt}t|tsxtd|g}|jdt}t|ttfstd|xX|D]P}|g} | j||j|t} t| ttfstd|| j| |j | qW|j j ||j d} t || ggfkr^|jd} |jd } |jd }|j j||j | | ||jd }|j j| ||j|jd qWdS) Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list') output_dirmacros include_dirscflags)r r r Zextra_postargsdebug)r r )get isinstancelisttuplerrinfodictextendappendZcompilerZobject_filenamesZ build_temprcompiler Zcreate_static_libr)selfZ librariesZlib_nameZ build_inforrZ dependenciesZ global_depssourceZsrc_depsZ extra_depsZexpected_objectsr r r Zobjectsr /usr/lib/python3.6/build_clib.pybuild_librariess`           zbuild_clib.build_librariesN)__name__ __module__ __qualname____doc__rrrrrrsr) Zdistutils.command.build_clibZcommandrZorigZdistutils.errorsrZ distutilsrZsetuptools.dep_utilrrrrrs    PK!͆0command/__pycache__/develop.cpython-36.opt-1.pycnu[3 vhn@sddlmZddlmZddlmZmZddlZddlZddl Z ddl m Z ddl m Z mZmZddlmZddlmZddlZGd d d ejeZGd d d eZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN)six) Distribution PathMetadatanormalize_path) easy_install) namespacesc@sveZdZdZdZejddgZejdgZd Zd d Z d d Z ddZ e ddZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode' uninstalluUninstall this source package egg-path=N-Set the path to be used in the .egg-link fileFcCs2|jrd|_|j|jn|j|jdS)NT)r Z multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_options)selfr/usr/lib/python3.6/develop.pyruns  z develop.runcCs&d|_d|_tj|d|_d|_dS)N.)r egg_pathr initialize_options setup_pathZalways_copy_from)rrrrr's  zdevelop.initialize_optionscCs|jd}|jr,d}|j|jf}t|||jg|_tj||j|j |j j t j d|jd}t jj|j||_|j|_|jdkrt jj|j|_t|j}tt jj|j|j}||krtd|t|t|t jj|j|jd|_|j|j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to ) project_name)get_finalized_commandZbroken_egg_inforrZegg_nameargsr finalize_optionsZexpand_basedirsZ expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspathr rrrdist_resolve_setup_pathr)rZeitemplaterZ egg_link_fntargetrrrrr .s<           zdevelop.finalize_optionscCsh|jtjdjd}|tjkr0d|jdd}ttjj|||}|ttjkrdt d|ttj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacer#seprstripcurdircountr r$r%r)r(r&rZ path_to_setupZresolvedrrrr+Xs zdevelop._resolve_setup_pathc CsDtjrt|jddr|jddd|jd|jd}t|j}|jd|d|jd|jddd|jd|jd}||_ ||j _ t ||j |j _n"|jd|jdd d|jd|jtjr|jtjdt_|jtjd |j|j|js,t|jd }|j|j d |jWdQRX|jd|j |j dS) NZuse_2to3FZbuild_pyr)Zinplacer)r(Z build_extr/zCreating %s (link to %s)w )rZPY3getattr distributionZreinitialize_commandZ run_commandrr Z build_librr*locationrrZ _providerZinstall_site_py setuptoolsZbootstrap_install_fromr Zinstall_namespacesrinfor'r(dry_runopenwriterZprocess_distributionZno_deps)rZbpy_cmdZ build_pathZei_cmdfrrrrks4          zdevelop.install_for_developmentcCstjj|jrztjd|j|jt|j}dd|D}|j||j g|j |j gfkrhtj d|dS|j sztj |j|j s|j|j|jjrtj ddS)NzRemoving %s (link to %s)cSsg|] }|jqSr)r2).0linerrr sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r#r$existsr'rr;r(r=closerrwarnr<unlinkZ update_pthr*r8scripts)rZ egg_link_filecontentsrrrrs    zdevelop.uninstall_linkc Cs||jk rtj||S|j|x^|jjp,gD]N}tjjt |}tjj |}t j |}|j }WdQRX|j||||q.WdS)N)r*r install_egg_scriptsinstall_wrapper_scriptsr8rGr#r$r)rbasenameior=readZinstall_script)rr*Z script_nameZ script_pathZstrmZ script_textrrrrIs     zdevelop.install_egg_scriptscCst|}tj||S)N)VersionlessRequirementr rJ)rr*rrrrJszdevelop.install_wrapper_scripts)r rr)rNr)__name__ __module__ __qualname____doc__ descriptionr Z user_optionsZboolean_optionsZcommand_consumes_argumentsrrr staticmethodr+rrrIrJrrrrr s  * /r c@s(eZdZdZddZddZddZdS) rNaz Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dS)N)_VersionlessRequirement__dist)rr*rrr__init__szVersionlessRequirement.__init__cCs t|j|S)N)r7rU)rnamerrr __getattr__sz"VersionlessRequirement.__getattr__cCs|jS)N)r)rrrras_requirementsz%VersionlessRequirement.as_requirementN)rOrPrQrRrVrXrYrrrrrNs rN)Zdistutils.utilrZ distutilsrZdistutils.errorsrrr#r"rLZsetuptools.externrZ pkg_resourcesrrr Zsetuptools.command.easy_installr r:r ZDevelopInstallerr objectrNrrrrs     4PK!wY6o6command/__pycache__/bdist_wininst.cpython-36.opt-1.pycnu[3 vh}@s"ddljjZGdddejZdS)Nc@seZdZdddZddZdS) bdist_wininstrcCs |jj||}|dkrd|_|S)zj Supplement reinitialize_command to work around http://bugs.python.org/issue20819 install install_libN)rr)Z distributionreinitialize_commandr)selfcommandZreinit_subcommandscmdr #/usr/lib/python3.6/bdist_wininst.pyrs z"bdist_wininst.reinitialize_commandc Cs$d|_ztjj|Wdd|_XdS)NTF)Z _is_runningorigrrun)rr r r r szbdist_wininst.runN)r)__name__ __module__ __qualname__rr r r r r rs r)Zdistutils.command.bdist_wininstrrr r r r r s PK!T` 55!__pycache__/monkey.cpython-39.pycnu[a (Rea@sdZddlZddlZddlZddlZddlZddlmZddl Z ddl Z gZ ddZ ddZ dd Zd d Zd d ZddZddZddZdS)z Monkey patching of distutils. N) import_modulecCs"tdkr|f|jSt|S)am Returns the bases classes for cls sorted by the MRO. Works around an issue on Jython where inspect.getmro will not return all base classes if multiple classes share the same name. Instead, this function will return a tuple containing the class itself, and the contents of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024. Jython)platformpython_implementation __bases__inspectgetmro)clsr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/monkey.py_get_mros  r cCs.t|trtnt|tjrtndd}||S)NcSsdS)Nr )itemr r r (zget_unpatched..) isinstancetypeget_unpatched_classtypes FunctionTypeget_unpatched_function)r lookupr r r get_unpatched$s rcCs:ddt|D}t|}|jds6d|}t||S)zProtect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. css|]}|jds|VqdS) setuptoolsN) __module__ startswith).0r r r r 3s z&get_unpatched_class.. distutilsz(distutils has already been patched by %r)r nextrrAssertionError)r Zexternal_basesbasemsgr r r r-s rcCstjtj_tjdk}|r"tjtj_tjdkp^dtjko@dknp^dtjkoZdkn}|rrd}|tjj _ t tj tjtj fD]}tj j|_qtjjtj_tjjtj_dtjvrtjjtjd_tdS)N)r") )r")r"r')r"r#zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rCommandrcoresys version_infofindallfilelistconfig PyPIRCCommandDEFAULT_REPOSITORY_patch_distribution_metadatadistcmd Distribution extension Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ warehousemoduler r r patch_all?s*          r;cCs*dD] }ttj|}ttjj||qdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)write_pkg_file read_pkg_fileZget_metadata_versionN)getattrrr3setattrrDistributionMetadata)attrnew_valr r r r2fs r2cCs*t||}t|d|t|||dS)z Patch func_name in target_mod with replacement Important - original must be resolved by name to avoid patching an already patched function. unpatchedN)r>vars setdefaultr?) replacementZ target_mod func_nameoriginalr r r patch_funcms rIcCs t|dS)NrC)r>) candidater r r r~srcstdtdkrdSfdd}t|d}t|d}zt|dt|d WntyjYn0zt|d WntyYn0zt|d WntyYn0dS) z\ Patch functions in distutils to use standalone Microsoft Visual C++ compilers. zsetuptools.msvcWindowsNcsLd|vr dnd}||d}t|}t|}t||sBt||||fS)zT Prepare the parameters for patch_func to patch indicated function. msvc9Zmsvc9_Zmsvc14__)lstripr>rhasattr ImportError)mod_namerGZ repl_prefixZ repl_namereplmodZmsvcr r patch_paramss  z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ _get_vc_envZgen_lib_options)rrsystem functoolspartialrIrP)rUrLZmsvc14r rTr r9s&       r9)__doc__r+distutils.filelistrrrrW importlibrrr__all__r rrr;r2rIrr9r r r r s"  'PK!W'__pycache__/archive_util.cpython-39.pycnu[a (Re@sdZddlZddlZddlZddlZddlZddlZddlmZddl m Z gdZ GdddeZ dd Z e dfd d Ze fd d Ze fddZddZddZe fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directory)unpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/archive_util.pyrsrcCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsrc CsL|ptD]2}z||||Wnty2YqYq0dSqtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path internal to the archive ('/'-separated), and a filesystem path where it will be extracted. The callback must return the desired extract path (which may be the same as the one passed in), or else ``None`` to skip that file or directory. The callback can thus be used to report on the progress of the extraction, as well as to filter the items extracted or alter their extraction paths. `drivers`, if supplied, must be a non-empty sequence of functions with the same signature as this function (minus the `drivers` argument), that raise ``UnrecognizedFormat`` if they do not support extracting the designated archive type. The `drivers` are tried in sequence until one is found that does not raise an error, or until all are exhausted (in which case ``UnrecognizedFormat`` is raised). If you do not supply a sequence of drivers, the module's ``extraction_drivers`` constant will be used, which means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that order. Nz!Not a recognized archive type: %s)r r)filename extract_dirprogress_filterZdriversZdriverrrrrs   rc Cstj|std||d|fi}t|D]\}}}||\}}|D],} || dtj|| f|tj|| <qH|D]T} tj|| } ||| | } | sqzt| tj|| } t| | t | | qzq.dS)z"Unpack" a directory, using the same interface as for archives Raises ``UnrecognizedFormat`` if `filename` is not a directory z%s is not a directory/N) ospathisdirrwalkjoinrshutilcopyfilecopystat) rrrpathsbasedirsfilesrrdftargetrrrr @s"   * r c Cst|std|ft|}|D]}|j}|ds,d|dvrPq,tj j |g|dR}|||}|szq,| drt |nHt || |j}t|d}||Wdn1s0Y|jd?} | r,t|| q,Wdn1s0YdS)zUnpack zip `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined by ``zipfile.is_zipfile()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z%s is not a zip filer..wbN)zipfile is_zipfilerZipFileinfolistr startswithsplitrrrendswithrreadopenwrite external_attrchmod) rrrzinfonamer&datar%Zunix_attributesrrrr[s(        ( rcCs|durT|s|rT|j}|rHt|j}t||}t|}||}q|duoj| pj| }|rt|St ddS)z;Resolve any links and extract link targets as normal files.NzGot unknown file type) islnkissymlinkname posixpathdirnamer8rnormpath _getmemberisfiler LookupError)tar_objZtar_member_objlinkpathr!Zis_file_or_dirrrr_resolve_tar_file_or_dirs"    rEc csdd|_t||D]}|j}|dsd|dvr>qtjj|g|dR}zt ||}Wnt y|YqYn0|||}|sq| tj r|dd}||fVqWdn1s0YdS)z1Emit member-destination pairs from a tar archive.cWsdS)Nr)argsrrrz _iter_open_tar..rr'N) chown contextlibclosingr8r.r/rrrrErBr0sep)rCrrmemberr8Z prelim_dst final_dstrrr_iter_open_tars"       rPc Cszt|}Wn6tjyD}ztd|f|WYd}~n d}~00t|||D].\}}z|||WqRtjy~YqR0qRdS)zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined by ``tarfile.open()``). See ``unpack_archive()`` for an explanation of the `progress_filter` argument. z/%s is not a compressed or uncompressed tar fileNT)tarfiler2TarErrorrrP_extract_member ExtractError)rrrtarobjerNrOrrrrs  r)rr*rQrrr=rKdistutils.errorsr pkg_resourcesr__all__rrrr rrErPrr rrrrs(   $  % PK!v~__pycache__/dist.cpython-39.pycnu[a (ReO@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl Zddl Zddl Zddl mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd lmZdd lm Z m!Z!dd l m"Z"dd l#m$Z$dd l%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,Z,ddl-Z,ddl,m.Z.ddl/m0Z0ddl1m2Z2ddl3Z3erpddl4m5Z5e6de6dddZ7ddZ8e9e9dddZ:de9ee9d d!d"Z;de9ee9d d#d$Zd*d+Z?d,d-Z@d.d/ZAeBeCfZDd0d1ZEd2d3ZFd4d5ZGd6d7ZHd8d9ZId:d;ZJdd?ZLd@dAZMdBdCZNdDdEZOdFdGZPdHdIZQe0ejRjSZTGdJddeTZSGdKdLdLe+ZUdS)M DistributionN) strtobool)DEBUGtranslate_longopt)iglob)ListOptional TYPE_CHECKING) defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError) rfc822_escape) StrictVersion) packaging) ordered_set)unique_everseen)SetuptoolsDeprecationWarning)windows_support) get_unpatched)parse_configuration)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/dist.py_get_unpatched2s r cCs&t|dd}|dur"td}||_|S)Nmetadata_version2.1)getattrrr!)selfmvrrrget_metadata_version7s  r&)contentreturnc CsJ|}t|dkr |dSd|dtd|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr N) splitlineslenlstripjointextwrapdedent)r'linesrrrrfc822_unescape?s  r1r)msgfieldr(cCs||}|dkrdS|S)zRead Message header field.UNKNOWNNrr2r3valuerrr_read_field_from_msgGsr7cCst||}|dur|St|S)z4Read Message header field and apply rfc822_unescape.N)r7r1r5rrr_read_field_unescaped_from_msgOs r8cCs||d}|gkrdS|S)z9Read Message header field and return all results as list.N)get_all)r2r3valuesrrr_read_list_from_msgWs r;)r2r(cCs|}|dkrdS|S)Nr4) get_payloadstrip)r2r6rrr_read_payload_from_msg_s r>cCsVt|}t|d|_t|d|_t|d|_t|d|_t|d|_d|_t|d|_ d|_ t|d|_ t |d |_ d |vrt|d |_nd|_t |d |_|jdur|jtd krt||_t|d|_d |vrt|d d|_t|d|_t|d|_|jtdkr4t|d|_t|d|_t|d|_nd|_d|_d|_t|d|_dS)z-Reads the metadata values from a file object.zmetadata-versionnameversionsummaryauthorNz author-emailz home-pagelicensez download-url descriptionr"keywords,platform classifierz1.1requiresprovides obsoletesz license-file)r rr!r7r?r@rDrB maintainer author_emailmaintainer_emailurlr8rC download_urllong_descriptionr>splitrEr; platforms classifiersrIrJrK license_files)r$filer2rrr read_pkg_filefs<              rWcCs"d|vrtd|dd}|S)Nr)z1newlines not allowed and will break in the future )rrreplace)valrrr single_lines  r[c s|}fdd}|dt||d||d||dt||d|d}|D]&\}}t||d }|d urf|||qft| }|d ||j r|d |j |j D]} |d d | qd |} | r|d| |D]} |d| q|d||d||d||d|t|drh|d|j|jr||d|j|jr|jD]} |d| q|d|jpgd|d S)z0Write the PKG-INFO format data to a file object.csd||fdS)Nz%s: %s )write)keyr6rVrr write_fieldsz#write_pkg_file..write_fieldzMetadata-VersionNameVersionZSummaryz Home-page))ZAuthorrB)z Author-emailrM)Z MaintainerrL)zMaintainer-emailrNNZLicensez Download-URLz Project-URLz%s, %srFZKeywordsPlatform ClassifierRequiresProvides Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-Extraz License-Filez %s )r&strget_name get_versionr[get_descriptionget_urlr#r get_licenserP project_urlsitemsr- get_keywords get_platforms _write_listget_classifiers get_requires get_provides get_obsoleteshasattrrglong_description_content_typeprovides_extrasrUr\get_long_description) r$rVr@r_Zoptional_fieldsr3attrZattr_valrC project_urlrErGextrarr^rwrite_pkg_filesH              r~c Csbztjd|}|jrJWn>ttttfy\}ztd||f|WYd}~n d}~00dS)Nzx=z4%r must be importable 'module:attrs' string (got %r)) pkg_resources EntryPointparseextras TypeError ValueErrorAttributeErrorAssertionErrorr)distr{r6eperrrcheck_importables rc Cslz(t|ttfsJd||ks&JWn>ttttfyf}ztd||f|WYd}~n d}~00dS)z"Verify that value is a string listz%%r must be a list of strings (got %r)N) isinstancelisttupler-rrrrrrr{r6rrrrassert_string_lists rcCsd|}t||||D]J}||s2tdd||d\}}}|r||vrtjd||qdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rhas_contents_forr rpartition distutilslogr)rr{r6Z ns_packagesnspparentsepchildrrr check_nsps    rc CsRzttt|Wn4tttfyL}ztd|WYd}~n d}~00dS)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N) r itertoolsstarmap _check_extrarorrrrrrrr check_extras srcCs<|d\}}}|r*t|r*td|tt|dS)N:zInvalid environment marker: ) partitionrinvalid_markerrrparse_requirements)r}reqsr?rmarkerrrrrs rcCs&t||kr"d}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))r{r6N)boolrformat)rr{r6tmplrrr assert_bools rcCs,|st|dtdSt|ddS)Nz is ignored.z is invalid.)rrrrrr{r6rrrinvalid_unless_false$src Csnz(tt|t|ttfr&tdWn@ttfyh}z$d}t|j ||d|WYd}~n d}~00dS)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}r{errorN) rrrrdictsetrrrrrr{r6rrrrrcheck_requirements+s rc CsZztj|WnDtjjtfyT}z$d}t|j||d|WYd}~n d}~00dS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rN)r specifiers SpecifierSetInvalidSpecifierrrrrrrrcheck_specifier9s rc CsDztj|Wn.ty>}zt||WYd}~n d}~00dS)z)Verify that entry_points map is parseableN)rr parse_maprrrrrrcheck_entry_pointsDsrcCst|tstddS)Nztest_suite must be a string)rrhrrrrrcheck_test_suiteLs rcCsZt|tstd||D]4\}}t|tsBtd||t|d||q dS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rrrrrorhr)rr{r6kvrrrcheck_package_dataQs   rcCs(|D]}td|stjd|qdS)Nz \w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr)rr{r6pkgnamerrrcheck_packages`s  rc@s~eZdZdZddeejdddddZdZdd Z dUd d Z d d Z e ddZ e ddZddZddZe ddZddZddZddZe ddZdVd d!Zd"d#Zd$d%Zd&d'ZdWd(d)ZdXd+d,Zd-d.Zd/d0Ze d1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"d;d<Z#d=d>Z$d?d@Z%dAdBZ&dCdDZ'dEdFZ(dGdHZ)dIdJZ*dKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/dS)YraG Distribution with support for tests and package data This is an enhanced version of 'distutils.dist.Distribution' that effectively adds the following new optional keyword arguments to 'setup()': 'install_requires' -- a string or sequence of strings specifying project versions that the distribution requires when installed, in the format used by 'pkg_resources.require()'. They will be installed automatically when the package is installed. If you wish to use packages that are not available in PyPI, or want to give your users an alternate download location, you can add a 'find_links' option to the '[easy_install]' section of your project's 'setup.cfg' file, and then setuptools will scan the listed web pages for links that satisfy the requirements. 'extras_require' -- a dictionary mapping names of optional "extras" to the additional requirement(s) that using those extras incurs. For example, this:: extras_require = dict(reST = ["docutils>=0.3", "reSTedit"]) indicates that the distribution can optionally provide an extra capability called "reST", but it can only be used if docutils and reSTedit are installed. If the user installs your package using EasyInstall and requests one of your extras, the corresponding additional requirements will be installed if needed. 'test_suite' -- the name of a test suite to run for the 'test' command. If the user runs 'python setup.py test', the package will be installed, and the named test suite will be run. The format is the same as would be used on a 'unittest.py' command line. That is, it is the dotted name of an object to import and call to generate a test suite. 'package_data' -- a dictionary mapping package names to lists of filenames or globs to use to find data files contained in the named packages. If the dictionary has filenames or globs listed under '""' (the empty string), those names will be searched for in every package, in addition to any names for the specific package. Data files found using these names/globs will be installed along with the package, in the same location as the package. Note that globs are allowed to reference the contents of non-package subdirectories, as long as you use '/' as a path separator. (Globs are automatically converted to platform-specific paths at runtime.) In addition to these new keywords, this class also has several new methods for manipulating the distribution's contents. For example, the 'include()' and 'exclude()' methods can be thought of as in-place add and subtract commands that add or remove packages, modules, extensions, and so on from the distribution. cCsdSNrrrrrzDistribution.cCsdSrrrrrrrrcCsdSrrrrrrrr)rxrnry license_filerUNcCsl|rd|vsd|vrdStt|d}tjj|}|durh|dshtt|d|_ ||_ dS)Nr?r@zPKG-INFO) r safe_namerhlower working_setby_keyget has_metadata safe_version_version _patched_dist)r$attrsr]rrrrpatch_missing_pkg_infosz#Distribution.patch_missing_pkg_infocstd}|si_|pi}g_|dd_||dg_|dg_t dD]}t  |j dq`t fdd|D|jjj_dS)N package_datasrc_rootdependency_linkssetup_requiresdistutils.setup_keywordscs i|]\}}|jvr||qSr)_DISTUTILS_UNSUPPORTED_METADATA.0rrr$rr s z)Distribution.__init__..)rwr dist_filespoprrrrriter_entry_pointsvars setdefaultr? _Distribution__init__ro_set_metadata_defaults_normalize_version_validate_versionmetadatar@_finalize_requires)r$rZhave_package_datarrrrrs,     zDistribution.__init__cCs4|jD]$\}}t|j||||q dS)z Fill-in missing metadata fields not supported by distutils. Some fields may have been set by other tools (e.g. pbr). Those fields (vars(self.metadata)) take precedence to supplied attrs. N)rrorrrr)r$roptiondefaultrrrrsz#Distribution._set_metadata_defaultscCsTt|tjs|dur|Sttj|}||krPd}t|j fit |S|S)Nz)Normalizing '{version}' to '{normalized}') r setuptoolssicrhrr@rarrrlocals)r@ normalizedrrrrrszDistribution._normalize_versionc Csdt|tjrt|}|dur`ztj|Wn2tjjtfy^t d|t |YS0|S)NzThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.) rnumbersNumberrhrr@raInvalidVersionrrrrr)r@rrrrs zDistribution._validate_versioncCsft|ddr|j|j_t|ddrR|jD]$}|dd}|r,|jj|q,|| dS)z Set `metadata.python_requires` and fix environment markers in `install_requires` and `extras_require`. rgNextras_requirerr) r#rgrrkeysrRryadd_convert_extras_requirements"_move_install_requirements_markers)r$r}rrrrs   zDistribution._finalize_requirescCsht|ddpi}tt|_|D]@\}}|j|t|D]"}||}|j|||q>q"dS)z Convert requirements in `extras_require` of the form `"extra": ["barbazquux; {marker}"]` to `"extra:{marker}": ["barbazquux"]`. rN) r#r r_tmp_extras_requirerorr _suffix_forappend)r$Z spec_ext_reqssectionrrsuffixrrrrs   z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze For a requirement, return the 'extras_require' suffix for that requirement. rr)rrhreqrrrr!szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_ |D]}j dt|j  |qPt fddj D_dS) zv Move requirements in `install_requires` that are using environment markers `extras_require`. cSs|j Srrrrrr is_simple_req3szFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrc3s,|]$\}}|ddtj|DfVqdS)cSsg|] }t|qSr)rh)rrrrr ?rzMDistribution._move_install_requirements_markers...N)map _clean_reqrrrr >szBDistribution._move_install_requirements_markers..)r#rrrfilterr filterfalserrhrrrrrror)r$rZspec_inst_reqsZ inst_reqsZ simple_reqsZ complex_reqsrrrrr)s    z/Distribution._move_install_requirements_markerscCs d|_|S)zP Given a Requirement, remove environment markers and return it. Nr)r$rrrrrCszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r2||vr2|||durF|durFd}tt|||j_dS)z>> list(Distribution._expand_patterns(['LICENSE'])) ['LICENSE'] >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*'])) ['setup.cfg', 'LICENSE'] css:|]2}tt|D] }|dstj|r|VqqdS)~N)sortedrendswithospathisfile)rpatternr rrrresz0Distribution._expand_patterns..r)rrrrr]szDistribution._expand_patternsc Csddlm}tjtjkrgngd}t|}|dur<|}trJ|d|}t |_ |D]}t j |dd6}tr|dj fit||Wdn1s0Y|D]d}||}||} |D]F} | d ks| |vrq||| } || |} || |} || f| | <qq|qZd |jvr:dS|jd D]\} \} } |j| } | rrt|  } n| d vrt| } zt|| p| | Wn0ty}zt||WYd}~n d}~00qHdS) z Adapted from distutils.dist.Distribution.parse_config_files, this method provides the same functionality in subtly-improved ways. r) ConfigParser) z install-basezinstall-platbasez install-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptsz install-dataprefixz exec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8)encodingz reading {filename}__name__global)verbosedry_run) configparserr sysr base_prefix frozensetfind_config_filesrannouncerh optionxformioopenrr read_filesectionsoptionsget_option_dictrwarn_dash_deprecationmake_option_lowercasercommand_optionsro negative_optrsetattrrr )r$ filenamesr ignore_optionsparserfilenamereaderrr#opt_dictoptrZsrcaliasrrrr_parse_config_filesmsP   (           z Distribution._parse_config_filescCsd|dvr |S|dd}tjj|}|dsF|dkrF||vrF|Sd|vr`td||f|S)N)zoptions.extras_requirezoptions.data_files-_r#rzrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rYrcommand__all___setuptools_commands startswithrr)r$r0rZunderscore_optcommandsrrrr%s$ z"Distribution.warn_dash_deprecationcCs8ztd}t|dWStjy2gYS0dS)Nrdistutils.commands)rget_distributionr get_entry_mapDistributionNotFound)r$rrrrr8s  z!Distribution._setuptools_commandscCs4|dks|r|S|}td|||f|S)NrzlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)islowerrrr)r$r0rZ lowercase_optrrrr&sz"Distribution.make_option_lowercasec Cs\|}|dur||}tr,|d||D] \}\}}trZ|d|||fzdd|jD}Wntyg}Yn0z |j}Wntyi}Yn0z|t|t } ||vr| rt |||t | nJ||vr| rt ||t |n,t ||rt |||nt d|||fWq4tyT} zt | | WYd} ~ q4d} ~ 00q4dS)a Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). 'command_obj' must be a Command instance. If 'option_dict' is not supplied, uses the standard option dictionary for this command (from 'self.command_options'). (Adopted from distutils.dist.Distribution._set_command_options) Nz# setting options for '%s' command:z %s = %s (from %s)cSsg|] }t|qSrr)rorrrrrz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')get_command_namer$rrroboolean_optionsrr(rrhr)rrwr r) r$ command_obj option_dict command_namersourcer6 bool_optsneg_opt is_stringrrrr_set_command_optionss>           z!Distribution._set_command_optionsFcCs0|j|dt||j|d||dS)zYParses configuration files from various levels and loads configuration. )r*)ignore_option_errorsN)r3rr'rr)r$r*rKrrrparse_config_filess  zDistribution.parse_config_filescCs8tjjt||jdd}|D]}tjj|ddq|S)zResolve pre-setup requirementsT) installerreplace_conflicting)rY)rrresolverfetch_build_eggr)r$rIZresolved_distsrrrrfetch_build_eggs$szDistribution.fetch_build_eggscCsPd}dd}t|}t|j|}tdd|}t||dD] }||q>dS)z Allow plugins to apply arbitrary operations to the distribution. Each hook may optionally define a 'order' to influence the order of execution. Smaller numbers go first and the default is 0. z(setuptools.finalize_distribution_optionscSs t|ddS)Norderr)r#)hookrrrby_order8sz/Distribution.finalize_options..by_ordercSs|Sr)load)rrrrr=rz/Distribution.finalize_options..)r]N)rrrr_removedrr)r$grouprTZdefinedfilteredZloadedrrrrfinalize_options/s zDistribution.finalize_optionscCsdh}|j|vS)z When removing an entry point, if metadata is loaded from an older version of Setuptools, that removed entry point will attempt to be loaded and will fail. See #2765 for more details. Z 2to3_doctests)r?)rremovedrrrrVAs zDistribution._removedcCsJtdD]:}t||jd}|dur |j|jd|||j|q dS)NrrM)rrr#r?requirerPrU)r$rr6rrr_finalize_setup_keywordsOs z%Distribution._finalize_setup_keywordscCstjtjd}tj|st|t|tj|d}t|d.}| d| d| dWdn1s|0Y|S)Nz.eggsz README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. zAThis directory caches those eggs to prevent repeated downloads. z/However, it is safe to delete this directory. ) r r r-curdirexistsmkdirrZ hide_filer r\)r$Z egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirVs    (zDistribution.get_egg_cache_dircCsddlm}|||S)z Fetch an egg needed for buildingr)rP)Zsetuptools.installerrP)r$rrPrrrrPis zDistribution.fetch_build_eggcCs\||jvr|j|Std|}|D]*}|j|jd||j|<}|St||S)z(Pluggable version of get_command_class()r;r[N)cmdclassrrr\rPrUrget_command_class)r$r6Zepsrrdrrrreos   zDistribution.get_command_classcCs:tdD]$}|j|jvr |}||j|j<q t|SNr;)rrr?rdrOrprint_commandsr$rrdrrrrg|s  zDistribution.print_commandscCs:tdD]$}|j|jvr |}||j|j<q t|Srf)rrr?rdrOrget_command_listrhrrrris  zDistribution.get_command_listcKs@|D]2\}}t|d|d}|r.||q|||qdS)aAdd items to distribution that are named in keyword arguments For example, 'dist.include(py_modules=["x"])' would add 'x' to the distribution's 'py_modules' attribute, if it was not already there. Currently, this method only supports inclusion for attributes that are lists or tuples. If you need to add support for adding to other attributes in this or a subclass, you can add an '_include_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'include()'. So, 'dist.include(foo={"bar":"baz"})' will try to call 'dist._include_foo({"bar":"baz"})', which can then handle whatever special inclusion logic is needed. Z _include_N)ror# _include_misc)r$rrrincluderrrrks  zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagercs"g|]}|kr|s|qSrr9rppackagepfxrrrsz0Distribution.exclude_package..cs"g|]}|kr|s|qSrrlrmrorrrscs&g|]}|jkr|js|qSr)r?r9rmrorrrsN)packages py_modules ext_modules)r$rprrorexclude_packages   zDistribution.exclude_packagecCs2|d}|D]}||ks&||rdSqdS)z.rsequencerr#rr))r$r?r6oldrrr{r _exclude_miscs  $zDistribution._exclude_miscc st|tstd||fzt||Wn2tyZ}ztd||WYd}~n d}~00durrt|||n:ttst|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)rwNrxcsg|]}|vr|qSrrryr~rrrrz.Distribution._include_misc..r|)r$r?r6rnewrrrrjs $ zDistribution._include_misccKs@|D]2\}}t|d|d}|r.||q|||qdS)aRemove items from distribution that are named in keyword arguments For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from the distribution's 'py_modules' attribute. Excluding packages uses the 'exclude_package()' method, so all of the package's contained packages, modules, and extensions are also excluded. Currently, this method only supports exclusion from attributes that are lists or tuples. If you need to add support for excluding from other attributes in this or a subclass, you can add an '_exclude_X' method, where 'X' is the name of the attribute. The method will be called with the value passed to 'exclude()'. So, 'dist.exclude(foo={"bar":"baz"})' will try to call 'dist._exclude_foo({"bar":"baz"})', which can then handle whatever special exclusion logic is needed. Z _exclude_N)ror#r)r$rrrexcluderrrrs  zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rr}rrrru)r$rrrrr_exclude_packagess  zDistribution._exclude_packagesc Cs|jj|_|jj|_|d}|d}||vrf||\}}||=ddl}||d|dd<|d}q&t|||}||} t | ddrd|f||d<|durgS|S)NraliasesTrZcommand_consumes_arguments command lineargs) __class__global_optionsr(r$shlexrRr_parse_command_optsrer#) r$r,rr6rr1r2rnargs cmd_classrrrrs"       z Distribution._parse_command_optsc Csi}|jD]\}}|D]\}\}}|dkr4q|dd}|dkr||}|j}|t|di|D]\} } | |krv| }d}qqvtdn |dkrd}|| |i|<qq|S) ahReturn a '{cmd: {opt:val}}' map of all command-line options Option names are all long, but do not include the leading '--', and contain dashes rather than underscores. If the option doesn't take an argument (e.g. '--quiet'), the 'val' is 'None'. Note that options provided by config files are intentionally excluded. rr5r4rr(NzShouldn't be able to get herer) r'rorYget_command_objr(copyupdater#rr) r$dcmdoptsr0r1rZZcmdobjrHnegposrrrget_cmdline_optionss(     z Distribution.get_cmdline_optionsccsv|jpdD] }|Vq |jpdD] }|Vq |jp4dD]:}t|trN|\}}n|j}|drj|dd}|Vq6dS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)rrrsrtrrr?r)r$pkgrextr?Z buildinforrrrvEs    z$Distribution.iter_distribution_namesc Csddl}|jrt||St|jtjs4t||S|jj dvrPt||S|jj}|jj }|j dkrndppd}|jj }t|j d||||_z(t||Wt|j |||||_St|j |||||_0dS)zIf there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. rN)rutf8win32r)r)r help_commandsrhandle_display_optionsrstdoutr TextIOWrapperrrerrorsrGline_bufferingdetach)r$ option_orderrrrnewlinerrrrrWs2    z#Distribution.handle_display_options)N)N)N)NF)0r __module__ __qualname____doc__rrZ OrderedSetrrrrr staticmethodrrrrrrrrrr3r%r8r&rJrLrQrYrVr]rcrPrergrirkrurrrjrrrrrvrrrrrrmsf4       O .     (c@seZdZdZdS)rzrClass for warning about deprecations in dist in setuptools. Not ignored by default, unlike DeprecationWarning.N)rrrrrrrrr|sr)Vr7rrrr rrZ distutils.logrdistutils.core distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr.typingrr r collectionsr emailr distutils.errorsr rrZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrrrrZsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr email.messager __import__r r&rhr1r7r8r;r>rWr[r~rrr}rrrrrrrrrrrrrcorerrrrrrrs                - >    PK!3p-##%__pycache__/build_meta.cpython-39.pycnu[a (Re((@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z gdZ Gddde ZGdddejjZejd d Zd d Zd dZddZGdddeZGdddeZeZejZejZejZejZejZeZdS)a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. N)parse_requirements)get_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheel build_wheel build_sdist __legacy__SetupRequirementsErrorc@seZdZddZdS)r cCs ||_dSN) specifiers)selfr r /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/build_meta.py__init__4szSetupRequirementsError.__init__N)__name__ __module__ __qualname__rr r r rr 3sr c@s&eZdZddZeejddZdS) DistributioncCstttt|}t|dSr )listmapstrrr )r r Zspecifier_listr r rfetch_build_eggs9szDistribution.fetch_build_eggsccs2tjj}|tj_zdVW|tj_n |tj_0dS)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilscorer)clsorigr r rpatch>s zDistribution.patchN)rrrr classmethod contextlibcontextmanagerrr r r rr8srccs.tj}ddt_zdVW|t_n|t_0dS)a Temporarily disable installing setup_requires Under PEP 517, the backend reports build dependencies to the frontend, and the frontend is responsible for ensuring they're installed. So setuptools (acting as a backend) should not try to install them. cSsdSr r )attrsr r rWz+no_install_setup_requires..N) setuptoolsZ_install_setup_requires)rr r rno_install_setup_requiresNs  r$csfddtDS)Ncs&g|]}tjtj|r|qSr )ospathisdirjoin).0nameZa_dirr r _sz1_get_immediate_subdirectories..)r%listdirr+r r+r_get_immediate_subdirectories^sr.csBfddt|D}z |\}Wnty<tdYn0|S)Nc3s|]}|r|VqdSr endswithr)f extensionr r ds z'_file_with_extension..z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r%r- ValueError) directoryr4Zmatchingfiler r3r_file_with_extensioncs    r9cCs&tj|stdSttdt|S)Nz%from setuptools import setup; setup()open)r%r&existsioStringIOgetattrtokenizer: setup_scriptr r r_open_setup_scriptqs  rBc@s`eZdZddZddZdddZdd d Zdd d Zdd dZddZ dddZ dddZ dS)_BuildMetaBackendcCs|pi}|dg|S)N--global-option) setdefaultr config_settingsr r r _fix_config{s z_BuildMetaBackend._fix_configc Cs||}tjdddg|dt_z4t|Wdn1sP0YWn.ty}z||j7}WYd}~n d}~00|S)Negg_inforD)rHsysargvrr run_setupr r )r rG requirementser r r_get_build_requiress  * z%_BuildMetaBackend._get_build_requiressetup.pycCsX|}d}t| }|dd}Wdn1s60Ytt||dtdS)N__main__z\r\nz\nexec)rBreadreplacerScompilelocals)r rA__file__rr2coder r rrMs  .z_BuildMetaBackend.run_setupNcCs||}|j|dgdS)NwheelrNrHrPrFr r rrs z._BuildMetaBackend.get_requires_for_build_wheelcCs||}|j|gdS)Nr[r\rFr r rrs z._BuildMetaBackend.get_requires_for_build_sdistcCstjdddd|gt_t|Wdn1s>0Y|}ddt|D}t|dkrtt|dkrtj |t|d}qLt|dksJqqL||krt tj ||d|t j |dd|dS) NrIZ dist_infoz --egg-basecSsg|]}|dr|qS)z .dist-infor/r1r r rr,s zF_BuildMetaBackend.prepare_metadata_for_build_wheel..rT) ignore_errors) rKrLr$rMr%r-lenr.r&r(shutilmovermtree)r metadata_directoryrGZdist_info_directoryZ dist_infosr r rrs0 & z2_BuildMetaBackend.prepare_metadata_for_build_wheelc Cs||}tj|}tj|ddtj|d}tjdd|d|g|dt_t | Wdn1sz0Yt ||}tj ||}tj |rt|ttj |||Wdn1s0Y|S)NT)exist_ok)dirrIz --dist-dirrD)rHr%r&abspathmakedirstempfileTemporaryDirectoryrKrLr$rMr9r(r;removerename)r Z setup_commandZresult_extensionZresult_directoryrGZ tmp_dist_dirZresult_basename result_pathr r r_build_with_temp_dirs&  &  4z&_BuildMetaBackend._build_with_temp_dircCs|dgd||S)N bdist_wheelz.whlrl)r wheel_directoryrGrbr r rrs z_BuildMetaBackend.build_wheelcCs|gdd||S)N)sdistz --formatsgztarz.tar.gzrn)r sdist_directoryrGr r rrs z_BuildMetaBackend.build_sdist)rQ)N)N)N)NN)N) rrrrHrPrMrrrrlrrr r r rrCys   " rCcs"eZdZdZdfdd ZZS)_BuildMetaLegacyBackendaOCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. rQc sttj}tjtj|}|tjvr6tjd|tjd}|tjd<z.tt |j |dW|tjdd<|tjd<n|tjdd<|tjd<0dS)Nrr@) rrKr&r%dirnamereinsertrLsuperrsrM)r rAsys_pathZ script_dirZ sys_argv_0 __class__r rrMs      z!_BuildMetaLegacyBackend.run_setup)rQ)rrr__doc__rM __classcell__r r rxrrss rs) rzr<r%rKr?r_rrgr#r pkg_resourcesr__all__ BaseExceptionr distrrr$r.r9rBobjectrCrsZ_BACKENDrrrrrrr r r rs6   m)PK!!__pycache__/launch.cpython-39.pycnu[a (Re,@s.dZddlZddlZddZedkr*edS)z[ Launch the Python script on the command line after setuptools is bootstrapped via import. NcCsttjd}t|ddd}tjddtjdd<ttdt}||}|}Wdn1sf0Y|dd}t ||d}t ||dS) zP Run the script in sys.argv[1] as if it had been invoked naturally. __main__N)__file____name____doc__openz\r\nz\nexec) __builtins__sysargvdictgetattrtokenizerreadreplacecompiler) script_name namespaceopen_ZfidscriptZ norm_scriptcoder/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/launch.pyrun s   &  rr)rrr rrrrrrs PK! (__pycache__/unicode_utils.cpython-39.pycnu[a (Re@s,ddlZddlZddZddZddZdS)NcCsRt|trtd|Sz$|d}td|}|d}WntyLYn0|S)NZNFDutf-8) isinstancestr unicodedata normalizedecodeencode UnicodeError)pathr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/unicode_utils.py decomposes     r c CsXt|tr|Stpd}|df}|D],}z||WStyPYq&Yq&0q&dS)zY Ensure that the given path is decoded, NONE when no expected encoding works rN)rrsysgetfilesystemencodingrUnicodeDecodeError)r Zfs_enc candidatesencr r r filesys_decodes   rcCs&z ||WSty YdS0dS)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrr r r try_encode%s  r)rrr rrr r r r s PK!Ѭ(__pycache__/package_index.cpython-39.pycnu[a (ReΛ@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+dd l,m-Z-e.d Z/e.d ej0Z1e.d Z2e.d ej0j3Z4d5Z6gdZ7dZ8dZ9e9j:dj:ej;edZddZ?dBddZ@dCddZAdDddZBdedfd d!ZCd"d#ZDe.d$ej0ZEeDd%d&ZFGd'd(d(ZGGd)d*d*eGZHGd+d,d,eZIe.d-jJZKd.d/ZLd0d1ZMdEd2d3ZNd4d5ZOGd6d7d7ZPGd8d9d9e jQZRejSjTfd:d;ZUdd?ZWd@dAZXdS)Fz#PyPI and direct package downloadingNwraps) CHECKOUT_DIST Distribution BINARY_DISTnormalize_path SOURCE_DIST Environmentfind_distributions safe_name safe_version to_filename Requirement DEVELOP_DISTEGG_DIST)log)DistutilsError) translate)Wheelunique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz) PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezdS)zGenerate alternative interpretations of a source distro name Note: if `location` is a filesystem filename, you should call ``pkg_resources.normalize_path()`` on it before passing it to this routine! rIcss|]}td|VqdS)z py\d\.\d$N)rerD).0pr!r!r" z(interpret_distro_name..Nr3) py_versionrArS)r7anyrangerPrjoin)rJrQrFr^rArSr9rZr!r!r"rs $rcstfdd}|S)zs Wrap a function returning an iterable such that the resulting iterable only ever yields unique items. cst|i|SNr)argskwargsfuncr!r"wrapperszunique_values..wrapperr)rfrgr!rer" unique_valuessrhz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c cst|D]d}|\}}tttj|d}d|vsDd|vr t |D]}t j |t |dVqNq dD]@}||}|dkrtt ||}|rtt j |t |dVqtdS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager0r3)z Home PagezDownload URLr/N)RELfinditergroupssetmapstrstripr'r7HREFr4rurljoin htmldecoderEfindsearch)r8pagerDtagrelZrelsposr!r!r"find_external_linkss   rzc@s(eZdZdZddZddZddZdS) ContentCheckerzP A null content checker that defines the interface for checking content cCsdS)z3 Feed a block of data to the hash. Nr!selfblockr!r!r"feedszContentChecker.feedcCsdS)zC Check the hash. Return False if validation fails. Tr!r}r!r!r"is_validszContentChecker.is_validcCsdS)zu Call reporter with information about the checker (hash name) substituted into the template. Nr!)r}reportertemplater!r!r"reportszContentChecker.reportN)__name__ __module__ __qualname____doc__rrrr!r!r!r"r{sr{c@sBeZdZedZddZeddZddZ dd Z d d Z d S) HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t||_||_dSrb) hash_namehashlibnewhashexpected)r}rrr!r!r"__init__s zHashChecker.__init__cCsBtj|d}|stS|j|}|s0tS|fi|S)z5Construct a (possibly null) ContentChecker from a URLr/)r4rr5r{patternru groupdict)clsr8r?rDr!r!r"from_urls zHashChecker.from_urlcCs|j|dSrb)rupdater|r!r!r"rszHashChecker.feedcCs|j|jkSrb)r hexdigestrrr!r!r"rszHashChecker.is_validcCs||j}||Srb)r)r}rrmsgr!r!r"rs zHashChecker.reportN) rrrrXcompilerr classmethodrrrrr!r!r!r"rs rcsDeZdZdZdLddZdMd d ZdNd d ZdOd dZddZddZ ddZ ddZ ddZ dPddZ ddZdQfdd Zdd Zd!d"Zd#d$Zd%d&Zd'd(ZdRd)d*ZdSd+d,Zd-d.Zd/Zd0d1Zd2d3ZdTd4d5Zd6d7Zd8d9Zd:d;Zdd?Z e!dUd@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'Z(S)Vrz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOsrtj|g|Ri||dd|d |_i|_i|_i|_td t t |j |_ g|_tjj|_dS)Nr.|)r rr( index_url scanned_urls fetched_urls package_pagesrXrrarnrrDallowsto_scanr4requesturlopenopener)r}rhostsZ ca_bundleZ verify_sslrckwr!r!r"rszPackageIndex.__init__Fc Cs||jvr|sdSd|j|<t|s2||dStt|}|r\||sPdS|d||sn|rn||jvrtt|j |dS||sd|j|<dS| d|d|j|<d}| |||}|durdSt |t jjr|jdkr| d|jd|j|j<d|jd d vr(|dS|j}|}t |tsvt |t jjrXd }n|jd phd }||d }|t|D](} t j|t| d} |!| q|"|j#rt$|dddkr|%||}dS)z.)filterrUr<rr itertoolsstarmap scan_egg_link)r} search_pathdirsZ egg_linksr!r!r"scan_egg_links|s zPackageIndex.scan_egg_linkscCsttj||&}ttdttj|}Wdn1s>0Yt |dkrXdS|\}}t tj||D]*}tjj|g|R|_ t |_ ||qrdS)Nr])openrUr<rarrrnrorprPr rJrrAr)r}r<rZ raw_lineslinesZegg_pathZ setup_pathrGr!r!r"rs4 zPackageIndex.scan_egg_linkcCsd}||js|Stttjj|t|jdd}t|dksRd|dvrV|St |d}t |d}d|j | i|<t|t|fS)N)NNr.r]r2r3rT)r)rrrnr4rr6rPr7r r r setdefaultr'r )r}rZNO_MATCH_SENTINELr9pkgverr!r!r"_scans   zPackageIndex._scanc Cst|D]:}z"|tj|t|dWq tyBYq 0q ||\}}|s\dSt ||D]H}t |\}}| dr|s|r|d||f7}n | || |qftdd|S)z#Process the contents of a PyPI pager3r.pyz #egg=%s-%scSsd|dddS)Nz%sr3r])rE)mr!r!r"r\z,PackageIndex.process_index..)rqrkrr4rrrrsrErrzr@r(need_version_infoscan_urlPYPI_MD5sub) r}r8rvrDrrnew_urlr+fragr!r!r"rs$"    zPackageIndex.process_indexcCs|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_allr}r8r!r!r"rszPackageIndex.need_version_infocGs<|j|jvr,|r"|j|g|R|d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrrr}rrcr!r!r"rs zPackageIndex.scan_allcCsz||j|jd|j|js:||j|jd|j|jsR||t|j|jdD]}||qfdS)Nr.r!) rr unsafe_namerrkeyrKnot_found_in_indexr)r} requirementr8r!r!r" find_packagess zPackageIndex.find_packagescsR|||||jD]"}||vr0|S|d||qtt|||S)Nz%s does not match %s)prescanrrrsuperrobtain)r}r installerrG __class__r!r"rs zPackageIndex.obtaincCsL||jd||sH|t|td|jjtj |fdS)z- checker is a ContentChecker zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N) rrrrrUunlinkrrr*r<rQ)r}checkerrVtfpr!r!r" check_hashs zPackageIndex.check_hashcCsN|D]D}|jdus0t|r0|ds0tt|r<||q|j|qdS)z;Add `urls` to the list that will be prescanned for searchesNfile:)rrr)rrrappend)r}urlsr8r!r!r"add_find_linkss  zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrnrrr!r!r"r szPackageIndex.prescancCs<||jr|jd}}n |jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rrrrr)r}rmethrr!r!r"rs  zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR||d||}t|\}}|drN||||}|Stj |rb|St |}t | ||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path `spec` may be a ``Requirement`` object, or a string containing a URL, an existing local filename, or a project/version requirement spec (i.e. the string form of a ``Requirement`` object). If it is the URL of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is automatically created alongside the downloaded file. If `spec` is a ``Requirement`` object or a string containing a project/version requirement spec, this method returns the location of a matching distribution (possibly after downloading it to `tmpdir`). If `spec` is a locally existing file or directory name, it is simply returned unchanged. If `spec` is a URL, it is downloaded to a subpath of `tmpdir`, and the local filename is returned. Various errors may be raised if a problem occurs during downloading. r3rrJN)rrr _download_urlrEr@r( gen_setuprUr<rr#rfetch_distribution)r}rtmpdirr:foundr+r?r!r!r"r0s    zPackageIndex.downloadc sd|id}d fdd }|rH|||}|s^|dur^|||}|durjdurx||}|dur|s|||}|durdrdpd|nd||j|jd SdS) a|Obtain a distribution suitable for fulfilling `requirement` `requirement` must be a ``pkg_resources.Requirement`` instance. If necessary, or if the `force_scan` flag is set, the requirement is searched for in the (online) package index as well as the locally installed packages. If a distribution matching `requirement` is found, the returned distribution's ``location`` is the value you would have gotten from calling the ``download()`` method with the matching distribution's URL or filename. If no matching distribution is found, ``None`` is returned. If the `source` flag is set, only source distributions and source checkout links will be considered. Unless the `develop_ok` flag is set, development and system eggs (i.e., those using the ``.egg-info`` format) will be ignored. zSearching for %sNcs|dur }||jD]v}|jtkrFsF|vrd|d|<q||vo\|jtkp\ }|r|j}||_tj |jr|SqdS)Nz&Skipping development or system egg: %sr3) rrArrrr0rJdownload_locationrUr<r)reqenvrGtestloc develop_okr}skippedsourcerr!r"rtUs$z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rJ)N)rrrrrcloner) r}rr force_scanrrZ local_indexrGrtr!r r"r=s2         zPackageIndex.fetch_distributioncCs"|||||}|dur|jSdS)a3Obtain a file suitable for fulfilling `requirement` DEPRECATED; use the ``fetch_distribution()`` method now instead. For backward compatibility, this routine is identical but returns the ``location`` of the downloaded distribution instead of a distribution object. N)rrJ)r}rrrrrGr!r!r"fetchszPackageIndex.fetchc Cst|}|r*ddt||ddDp,g}t|dkrtj|}tj||krtj ||}ddl m }|||st |||}ttj |dd<} | d|dj|djtj|dfWdn1s0Y|S|rtd ||fntd dS) NcSsg|]}|jr|qSr!)rL)rYdr!r!r" sz*PackageIndex.gen_setup..r3r)samefilezsetup.pywzIfrom setuptools import setup setup(name=%r, version=%r, py_modules=[%r]) zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rCrDrrErPrUr<rQdirnameraZsetuptools.command.easy_installrshutilcopy2rwriterKrLsplitextr) r}rVr?rrDrrQdstrrr!r!r"rs@       "zPackageIndex.gen_setupi c Cs:|d|d}zt|}||}t|tjjrLtd||j |j f|}d}|j }d}d|vr| d} t tt| }||||||t|d`} ||} | r|| | | |d7}||||||qqq|||| Wdn1s0Y|W|r"|Sn|r4|0dS) NzDownloading %szCan't download %s: %s %srr/zcontent-lengthzContent-Lengthwbr3)rrrrrr4rrrrr dl_blocksizeget_allmaxrnint reporthookrrrrrr) r}r8rVfprrblocknumbssizesizesrr~r!r!r" _download_tosD        .zPackageIndex._download_tocCsdSrbr!)r}r8rVr%Zblksizer'r!r!r"r#szPackageIndex.reporthookc Cs|drt|Szt||jWSttjjfy}zHddd|j D}|r`| ||nt d||f|WYd}~n*d}~0t j jy}z|WYd}~Sd}~0t j jy}z4|r| ||jnt d||jf|WYd}~nd}~0tjjyT}z6|r,| ||jnt d||jf|WYd}~n^d}~0tjjtj fy}z2|r| ||nt d||f|WYd}~n d}~00dS)Nr cSsg|] }t|qSr!)ro)rYargr!r!r"rr\z)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r) local_openopen_with_authrrhttpclient InvalidURLrarcrrr4rrURLErrorreason BadStatusLineline HTTPExceptionsocket)r}r8warningvrr!r!r"rsJ (zPackageIndex.open_urlcCst|\}}|r0d|vr4|dddd}qnd}|drJ|dd}tj||}|dksj|d rv|||S|d ks|d r|||S|d r| ||S|d krt j t j |dS||d|||SdS)Nz...\_Z__downloaded__rHr&svnzsvn+gitzgit+zhg+rr]T)r@replacer(rUr<rar) _download_svn _download_git _download_hgr4r url2pathnamerr5r_attempt_download)r}r:r8rr*r?rVr!r!r"r s$        zPackageIndex._download_urlcCs||ddS)NT)rrr!r!r"r)szPackageIndex.scan_urlcCs6|||}d|ddvr.||||S|SdS)Nrrr)r)rr'_download_html)r}r8rVrr!r!r"rC,s zPackageIndex._attempt_downloadcCsnt|}|D]>}|r td|rF|t||||SqLq |t|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at ) r���rp���rX���ru���r���rU���r���r?��r���)r}���r8���r���rV���r���r4��r!���r!���r"���rD��3��s����   zPackageIndex._download_htmlc�����������������C���s��t�dt�|ddd�}d}|�drd|v�rtj|\}}}}}} |s|drd |d d��v�r|d d��d d\}}t |\} } | rd | v�r| d d\} } d | | f�}nd | �}| }|||||| f}tj |}|� d||�t d|||f��|S�)Nz"SVN download support is deprecatedr2���r3���r���r���zsvn:@z//r.���r]���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)warningsr��� UserWarningr7���r'���r)���r4���r���r5��� _splituser urlunparser���rU���system)r}���r8���rV���credsr:���netlocr<���rZ���qr���authhostuserpwr9���r!���r!���r"���r?��B��s&����   zPackageIndex._download_svnc�����������������C���sp���t�j|�\}}}}}|ddd�}|ddd�}d�}d|v�rR|dd\}}t�j||||df}�|�|fS�)N+r3���r/���r2���r���rE��r���)r4���r���urlsplitr7���rsplit urlunsplit)r8��� pop_prefixr:���rM��r<���r>���r���revr!���r!���r"���_vcs_split_rev_from_urlX��s����z$PackageIndex._vcs_split_rev_from_urlc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�urh|�d|�td ||f��|S�) Nr2���r3���r���TrW��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %sr7���rY��r���rU���rK��r}���r8���rV���rX��r!���r!���r"���r@��j��s���� zPackageIndex._download_gitc�����������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�urh|�d|�td ||f��|S�) Nr2���r3���r���TrZ��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qr[��r\��r!���r!���r"���rA��z��s���� zPackageIndex._download_hgc�����������������G���s���t�j|g|R���d�S�rb���)r���r���r���r!���r!���r"���r�����s����zPackageIndex.debugc�����������������G���s���t�j|g|R���d�S�rb���)r���r���r���r!���r!���r"���r�����s����zPackageIndex.infoc�����������������G���s���t�j|g|R���d�S�rb���)r���r���r���r!���r!���r"���r�����s����zPackageIndex.warn)r���r���NT)F)F)F)N)N)FFFN)FF)N)F))r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r��r���r���r0���r��r��r��r��r)��r#��r���r��r���rC��rD��r?�� staticmethodrY��r@��rA��r���r���r��� __classcell__r!���r!���r���r"���r�����sR�����  5      #�� L )$ # r���z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������C���s���|��d}t|S�)Nr���)rE���r���unescape)rD���whatr!���r!���r"��� decode_entity��s���� ra��c�����������������C���s ���t�t|�S�)a�� Decode HTML entities in the given text. >>> htmldecode( ... 'https://../package_name-0.1.2.tar.gz' ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz') 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz' ) entity_subra��)textr!���r!���r"���rs�����s���� rs���c��������������������s����fdd}|S�)Nc��������������������s����fdd}|S�)Nc��������������� ������s>���t��}t��z�|�i�|W�t�|�S�t�|�0�d�S�rb���)r6��getdefaulttimeoutsetdefaulttimeout)rc���rd���Z old_timeout)rf���timeoutr!���r"���_socket_timeout��s����  z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr!���)rf���rg��rf��re���r"���rg����s����z'socket_timeout.<locals>._socket_timeoutr!���)rf��rg��r!���rh��r"���socket_timeout��s���� ri��c�����������������C���s2���t�j|�}|�}t|}|�}|ddS�)a9�� Encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in str(_encode_auth(long_auth)) False  r���)r4���r���r6���encodebase64 b64encoder���r>��)rO��Zauth_sZ auth_bytesZ encoded_bytesencodedr!���r!���r"��� _encode_auth��s ����  ro��c�������������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�) Credentialz: A username/password pair. Use like a namedtuple. c�����������������C���s���||�_�||�_d�S�rb���usernamepassword)r}���rr��rs��r!���r!���r"���r�����s����zCredential.__init__c�����������������c���s���|�j�V��|�jV��d�S�rb���rq��r���r!���r!���r"���__iter__��s����zCredential.__iter__c�����������������C���s ���dt�|��S�)Nz%(username)s:%(password)s)varsr���r!���r!���r"���__str__��s����zCredential.__str__N)r���r���r���r���r���rt��rv��r!���r!���r!���r"���rp����s���rp��c�������������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd S�) PyPIConfigc�����������������C���sN���t�g�dd}tj|�|�tjtjdd}tj |rJ|� |�dS�)z% Load from ~/.pypirc )rr��rs�� repositoryr���~z.pypircN) dictfromkeys configparserRawConfigParserr���rU���r<���ra��� expanduserr���r���)r}���defaultsrcr!���r!���r"���r�����s ���� zPyPIConfig.__init__c��������������������s&����fdd���D�}tt�j|S�)Nc��������������������s ���g�|�]}��|d��r|qS�)rx��)r���rp���)rY���sectionr���r!���r"���r����s���z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)sectionsrz��rn���_get_repo_cred)r}���Zsections_with_repositoriesr!���r���r"���creds_by_repository��s���� zPyPIConfig.creds_by_repositoryc�����������������C���s6���|��|d�}|t|��|d�|��|d�fS�)Nrx��rr��rs��)r���rp���rp��)r}���r��repor!���r!���r"���r����s ����zPyPIConfig._get_repo_credc�����������������C���s*���|�j��D�]\}}||r |��S�q dS�)z If the URL indicated appears to be a repository defined in this config, return the credential for that repository. N)r��itemsr)���)r}���r8���rx��credr!���r!���r"���find_credential��s���� zPyPIConfig.find_credentialN)r���r���r���r���propertyr��r��r��r!���r!���r!���r"���rw����s ���  rw��c�����������������C���s@��t�j|�}|\}}}}}}|dr2tjd|dv�rHt|\} } nd} | st� |�} | rt | } | j |�f} t j dg| R���| rdt| �} || ||||f} t�j| }t�j|}|d| �n t�j|�}|dt�||}| r<t�j|j\}}}}}}||kr<|| kr<||||||f} t�j| |_|S�) z4Open a urllib2 request, handling HTTP authenticationrF��znonnumeric port: '')r.��httpsNz*Authenticating as %s for %s (from .pypirc)zBasic Authorizationz User-Agent)r4���r���r5���r(���r.��r/��r0��rI��rw��r��ro���rr��r���r���ro��rJ��r���Request add_header user_agentr8���)r8���r���parsedr:���rM��r<���paramsr>���r���rO��addressr��r���r9���r���r���r$��s2h2Zpath2Zparam2Zquery2Zfrag2r!���r!���r"���r-����s8����          r-��c�����������������C���s ���|��d\}}}�|r|nd|�fS�)zNsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.rE��N) rpartition)rP��rQ��delimr!���r!���r"���rI��4��s����rI��c�����������������C���s���|�S�rb���r!���)r8���r!���r!���r"��� fix_sf_url?��s����r��c�������������� ���C���s,��t�j|�\}}}}}}t�j|}tj|r<t�j|�S�| drtj |rg�}t |D�]x} tj || } | dkrt | d} | �} W�d���n1�s0����Y���qntj | r| d7�} |dj| d�q`d} | j|�d |d } d \}}n d \}}} d d i}t| }t�j|�||||S�)z7Read a local path, with special support for directoriesr.���z index.htmlrNz<a href="{name}">{name}</a>)r*���zB<html><head><title>{url}{files}rj)r8files)OK)rzPath not foundz Not foundrz text/html)r4rr5rrBrUr<isfilerr(rrrarrrformatioStringIOrr)r8r:r;r<paramr>rrVrrfilepathr$bodyrstatusmessagerZ body_streamr!r!r"r,Cs.    &    r,)N)N)N)r)YrsysrUrXrrr6rlrrrGr|r http.clientr. urllib.parser4urllib.request urllib.error functoolsrr pkg_resourcesrrrrrr r r r r rrr distutilsrdistutils.errorsrfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrrrCIrqrrDrr7rO__all__Z_SOCKET_TIMEOUTZ_tmplr version_inforr#rr@rrBrWrrhrjrzr{rrrrbrarsrirorpr}rwrrr-rIrr,r!r!r!r"s <          !  #  !  &/ PK!谌߇__pycache__/msvc.cpython-39.pycnu[a (Re@sdZddlZddlmZddlmZmZddlmZm Z m Z m Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlmZdd lmZed krddlZdd lmZnGd d d ZeZeejjfZ zddl!m"Z"Wne yYn0ddZ#d/ddZ$ddZ%ddZ&dddddZ'ddZ(ddZ)d d!Z*d"d#Z+d0d%d&Z,Gd'd(d(Z-Gd)d*d*Z.Gd+d,d,Z/Gd-d.d.Z0dS)1a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows SDK 6.1 (x86, x64, ia64) Microsoft Windows SDK 7.0 (x86, x64, ia64) Microsoft Visual C++ 10.0: Microsoft Windows SDK 7.1 (x86, x64, ia64) Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname) LegacyVersion)unique_everseen) get_unpatchedWindows)environc@seZdZdZdZdZdZdS)winregN)__name__ __module__ __qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/msvc.pyr+sr)Regc Csd}|d|f}zt|d}WnFtyfz|d|f}t|d}Wnty`d}Yn0Yn0|rt|d}t|r|Stt|S)a Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone compiler build for Python (VCForPython / Microsoft Visual C++ Compiler for Python 2.7). Fall back to original behavior when the standalone compiler is not available. Redirect the path of "vcvarsall.bat". Parameters ---------- version: float Required Microsoft Visual C++ version. Return ------ str vcvarsall.bat path z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f installdirz Wow6432Node\N vcvarsall.bat)r get_valueKeyErrorrrr msvc9_find_vcvarsall)versionZvc_basekey productdir vcvarsallrrrrBs     rx86c Osz"tt}|||g|Ri|WStjjy8YntyHYn0zt||WStjjy}zt|||WYd}~n d}~00dS)ao Patched "distutils.msvc9compiler.query_vcvarsall" for support extra Microsoft Visual C++ 9.0 and 10.0 compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- ver: float Required Microsoft Visual C++ version. arch: str Target architecture. Return ------ dict environment N) r msvc9_query_vcvarsall distutilserrorsDistutilsPlatformError ValueErrorEnvironmentInfo return_env_augment_exception)verarchargskwargsorigexcrrrr%ls  r%c CszttjddtjtjB}Wnty2YdS0d}d}|tD]}zt||\}}}Wnty|YqYn0|rJ|tj krJt |rJzt t |}Wnt tfyYqJYn0|dkrJ||krJ||}}qJWdn1s0Y||fS)0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7rNNN)rOpenKeyrKEY_READZKEY_WOW64_32KEYOSError itertoolscount EnumValueREG_SZrintfloatr) TypeError)r! best_versionbest_dirivZvc_dirZvtr rrr_msvc14_find_vc2015s2      *rDcCstdptd}|sdSz>tt|dddddd d d d d d dddg jddd}Wntjtt fyvYdS0t|ddd}t |rd|fSdS)aPython 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. ProgramFiles(x86) ProgramFilesr4zMicrosoft Visual StudioZ Installerz vswhere.exez-latestz -prereleasez -requiresAnyz -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz -propertyinstallationPathz -products*mbcsstrict)encodingr'VCZ AuxiliaryZBuild) rget subprocess check_outputrdecodestripCalledProcessErrorr8UnicodeDecodeErrorr)rootpathrrr_msvc14_find_vc2017s,    rWx64armarm64)r$Z x86_amd64Zx86_armZ x86_arm64c Cst\}}d}|tvr t|}nd|vr,dnd}|rt|ddddd|d d }zd dl}|j|d d d}Wntttfyd}Yn0|st\}}|rt|d|dd }|sdSt|d}t|sdS|rt|sd}||fS)r3Namd64rXr$z..redistZMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT) recursivezMicrosoft.VC140.CRTr4r) rWPLAT_SPEC_TO_RUNTIMErglob ImportErrorr8 LookupErrorrDr) plat_spec_rA vcruntimeZvcruntime_platZvcredistr`r@r#rrr_msvc14_find_vcvarsalls:      rfc CsdtvrddtDSt|\}}|s6tjdz&tjd||tj dj ddd }Wn<tj y}z"tjd |j |WYd }~n d }~00d dd d| DD}|r||d<|S)r3ZDISTUTILS_USE_SDKcSsi|]\}}||qSrlower).0r!valuerrr sz&_msvc14_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r'zError executing {}NcSs$i|]\}}}|r|r||qSrrg)rir!rdrjrrrrkscss|]}|dVqdS)=N) partition)rilinerrr z%_msvc14_get_vc_env..py_vcruntime_redist)ritemsrfr&r'r(rOrPformatSTDOUTrQrScmd splitlines)rcr#reoutr2envrrr_msvc14_get_vc_envs8    r{c CsDz t|WStjjy>}zt|dWYd}~n d}~00dS)a* Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment ,@N)r{r&r'r(r,)rcr2rrrmsvc14_get_vc_env(s   r}cOsJdtjvr8ddl}t|jtdkr8|jjj|i|Stt |i|S)z Patched "distutils._msvccompiler.gen_lib_options" for fix compatibility between "numpy.distutils" and "distutils._msvccompiler" (for Numpy < 1.11.2) znumpy.distutilsrNz1.11.2) sysmodulesZnumpyr __version__r&Z ccompilerZgen_lib_optionsr msvc14_gen_lib_options)r/r0nprrrrBs  rrcCs|jd}d|vs"d|vrd}|jfit}d}|dkrj|ddkr`|d 7}q|d 7}n.|d kr|d 7}||d 7}n|dkr|d7}|f|_dS)zl Add details to the exception message to help guide the user as to what action will resolve it. rr#zvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d"@Zia64r^z( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW r|zd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/N)r/rhrulocalsfind)r2r r.messagetmplZ msdownloadrrrr,Os   r,c@sbeZdZdZeddZddZe ddZ dd Z d d Z dd dZ dddZdddZdS) PlatformInfoz Current and Target Architectures information. Parameters ---------- arch: str Target architecture. Zprocessor_architecturercCs|dd|_dS)NrXr[)rhrmr.)selfr.rrr__init__szPlatformInfo.__init__cCs|j|jdddS)zs Return Target CPU architecture. Return ------ str Target CPU rdr N)r.rrrrr target_cpus zPlatformInfo.target_cpucCs |jdkS)z Return True if target CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r$rrrrr target_is_x86s zPlatformInfo.target_is_x86cCs |jdkS)z Return True if current CPU is x86 32 bits.. Return ------ bool CPU is x86 32 bits r$ current_cpurrrrcurrent_is_x86s zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk Current platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '†' if architecture is x86. x64: bool return 'd' and not 'md64' if architecture is amd64. Return ------ str subfolder: ' arget', or '' (see hidex86 parameter) r$rr[\x64\%srrhidex86rXrrr current_dirszPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar Target platform specific subfolder. Parameters ---------- hidex86: bool return '' and not '\x86' if architecture is x86. x64: bool return '\x64' and not '\amd64' if architecture is amd64. Return ------ str subfolder: '\current', or '' (see hidex86 parameter) r$rr[rrrrrrr target_dirszPlatformInfo.target_dircCs0|rdn|j}|j|krdS|dd|S)ap Cross platform specific subfolder. Parameters ---------- forcex86: bool Use 'x86' as current architecture even if current architecture is not x86. Return ------ str subfolder: '' if target architecture is current architecture, '\current_target' if not. r$r\z\%s_)rrrrm)rforcex86currentrrr cross_dirszPlatformInfo.cross_dirN)FF)FF)F)rrr__doc__rrNrhrrpropertyrrrrrrrrrrrts    rc@seZdZdZejejejejfZ ddZ e ddZ e ddZ e dd Ze d d Ze d d Ze ddZe ddZe ddZe ddZdddZddZdS) RegistryInfoz Microsoft Visual Studio related registry information. Parameters ---------- platform_info: PlatformInfo "PlatformInfo" instance. cCs ||_dSN)pi)rZ platform_inforrrrszRegistryInfo.__init__cCsdS)z Microsoft Visual Studio root registry key. Return ------ str Registry key Z VisualStudiorrrrr visualstudios zRegistryInfo.visualstudiocCs t|jdS)z Microsoft Visual Studio SxS registry key. Return ------ str Registry key ZSxS)rrrrrrsxss zRegistryInfo.sxscCs t|jdS)z| Microsoft Visual C++ VC7 registry key. Return ------ str Registry key ZVC7rrrrrrvcs zRegistryInfo.vccCs t|jdS)z Microsoft Visual Studio VS7 registry key. Return ------ str Registry key ZVS7rrrrrvss zRegistryInfo.vscCsdS)z Microsoft Visual C++ for Python registry key. Return ------ str Registry key zDevDiv\VCForPythonrrrrr vc_for_python(s zRegistryInfo.vc_for_pythoncCsdS)zq Microsoft SDK registry key. Return ------ str Registry key zMicrosoft SDKsrrrrr microsoft_sdk4s zRegistryInfo.microsoft_sdkcCs t|jdS)z Microsoft Windows/Platform SDK registry key. Return ------ str Registry key r rrrrrr windows_sdk@s zRegistryInfo.windows_sdkcCs t|jdS)z Microsoft .NET Framework SDK registry key. Return ------ str Registry key ZNETFXSDKrrrrr netfx_sdkLs zRegistryInfo.netfx_sdkcCsdS)z Microsoft Windows Kits Roots registry key. Return ------ str Registry key zWindows Kits\Installed Rootsrrrrrwindows_kits_rootsXs zRegistryInfo.windows_kits_rootsFcCs$|js|rdnd}td|d|S)a Return key in Microsoft software registry. Parameters ---------- key: str Registry key path where look. x86: str Force x86 software registry. Return ------ str Registry key rZ Wow6432NodeZSoftware Microsoft)rrr)rr!r$Znode64rrr microsoftdszRegistryInfo.microsoftc Cstj}tj}tj}|j}|jD]}d}z||||d|}Wn\ttfy|j sz||||dd|}WqttfyYYqYq0nYqYn0zLz$t ||dWW|r||SttfyYn0W|r||q|r||0qdS)a Look for values in registry in Microsoft software registry. Parameters ---------- key: str Registry key path where look. name: str Value name to find. Return ------ str value NrT) rr7r6ZCloseKeyrHKEYSr8IOErrorrr QueryValueEx) rr!nameZkey_readZopenkeyZclosekeymshkeybkeyrrrlookupws4    zRegistryInfo.lookupN)F)rrrrrrrrrrrrrrrrrrrrrrrrrrrrs6         rc@s<eZdZdZeddZeddZedeZd7ddZ d d Z d d Z d dZ e ddZeddZeddZddZddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Z d3d4Z!e d8d5d6Z"dS)9 SystemInfoz Microsoft Windows and Visual Studio related system information. Parameters ---------- registry_info: RegistryInfo "RegistryInfo" instance. vc_ver: float Required Microsoft Visual C++ version. WinDirrrFrENcCs2||_|jj|_||_|p$||_|_dSr)rirfind_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)rZ registry_inforrrrrs    zSystemInfo.__init__cCs>|}|s|jstjdt|}||jt|dS)zm Find the latest VC version Return ------ float version z%No Microsoft Visual C++ version foundr^)find_reg_vs_versrr&r'r(setupdatesorted)rZ reg_vc_versZvc_versrrrrs   z(SystemInfo._find_latest_available_vs_verc Csn|jj}|jj|jj|jjf}g}t|jj|D]0\}}zt |||dtj }Wnt t fypYq2Yn0|t |\}}} t|D]T} tt6tt|| d} | |vr|| Wdq1s0Yqt|D]T} tt4tt|| } | |vr"|| Wdq1s80YqWdq21sZ0Yq2t|S)z Find Microsoft Visual Studio versions available in registry. Return ------ list of float Versions rN)rrrrrr9productrrr6r7r8rZ QueryInfoKeyrange contextlibsuppressr)r>r;appendEnumKeyr) rrZvckeysZvs_versrr!rZsubkeysvaluesrdrBr-rrrrs*    *   NzSystemInfo.find_reg_vs_versc Csi}d}z t|}Wnttfy.|YS0|D]}zpt||d}t|ddd}t|}Wdn1st0Y|d}tt|d||||d <Wq4tttfyYq4Yq40q4|S) z Find Visual studio 2017+ versions from information in "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances". Return ------ dict float version as key, path as value. z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz state.jsonrtzutf-8)rKNrG VC\Tools\MSVCZinstallationVersion) rr8rrrjsonload_as_float_versionr) rZ vs_versionsZ instances_dirZ hashed_namesrZ state_pathZ state_filestateZvs_pathrrrrs*    ( z#SystemInfo.find_programdata_vs_verscCstd|dddS)z Return a string version as a simplified float version (major.minor) Parameters ---------- version: str Version. Return ------ float version .N)r>rsplit)r rrrrszSystemInfo._as_float_versioncCs.t|jd|j}|j|jjd|jp,|S)zp Microsoft Visual Studio directory. Return ------ str path zMicrosoft Visual Studio %0.1f%0.1f)rProgramFilesx86rrrr)rdefaultrrr VSInstallDir)s zSystemInfo.VSInstallDircCs,|p|}t|s(d}tj||S)zm Microsoft Visual C++ directory. Return ------ str path z(Microsoft Visual C++ directory not found) _guess_vc_guess_vc_legacyrr&r'r()rrVmsgrrr VCInstallDir:s  zSystemInfo.VCInstallDirc Cs|jdkrdSz|j|j}Wnty6|j}Yn0t|d}z$t|d}|||_t||WStt t fyYdS0dS)zl Locate Visual C++ for VS2017+. Return ------ str path r|rrr^N) rrrrrrrrr8r IndexError)rZvs_dirZguess_vcrrrrrLs       zSystemInfo._guess_vccCsbt|jd|j}t|jjd|j}|j|d}|rBt|dn|}|j|jjd|jp`|S)z{ Locate Visual C++ for versions prior to 2017. Return ------ str path z Microsoft Visual Studio %0.1f\VCrrrL)rrrrrrr)rrZreg_pathZ python_vcZ default_vcrrrrjs zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd krFd Sd S) z Microsoft Windows SDK versions for specified MSVC++ version. Return ------ tuple of str versions r)z7.0z6.1z6.0ar)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar|)z10.0rNrrrrrWindowsSdkVersion~s     zSystemInfo.WindowsSdkVersioncCs|t|jdS)zt Microsoft Windows SDK last version. Return ------ str version lib)_use_last_dir_namer WindowsSdkDirrrrrWindowsSdkLastVersions z SystemInfo.WindowsSdkLastVersioncCs d}|jD],}t|jjd|}|j|d}|r q8q |rDt|stt|jjd|j}|j|d}|rtt|d}|rt|s|jD]6}|d|d}d |}t|j |}t|r|}q|rt|s|jD]$}d |}t|j |}t|r|}q|st|j d }|S) zn Microsoft Windows SDK directory. Return ------ str path rzv%sinstallationfolderrrZWinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZ PlatformSDK) rrrrrrrrrfindrFr)rsdkdirr-locrV install_baseZintverdrrrrs6           zSystemInfo.WindowsSdkDirc Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d ||d d f}g}|jd kr~|jD]}|t|jj||g7}qb|jD]}|t|jj d ||g7}q|D]}|j |d}|r|SqdS)zy Microsoft Windows SDK executable directory. Return ------ str path r#r(rTF)rXrzWinSDK-NetFx%dTools%sr-r|zv%sArN) rrrrmNetFxSdkVersionrrrrrr) rZnetfxverr.rZfxZregpathsr-rVZexecpathrrrWindowsSDKExecutablePaths"    z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j}|j|dp$dS)zl Microsoft Visual F# directory. Return ------ str path z%0.1f\Setup\F#r"r)rrrrr)rrVrrrFSharpInstallDirs zSystemInfo.FSharpInstallDircCsF|jdkrdnd}|D]*}|j|jjd|}|r|p:dSqdS)zt Microsoft Universal CRT SDK directory. Return ------ str path r|)10Z81rz kitsroot%srN)rrrr)rversr-rrrrUniversalCRTSdkDirs  zSystemInfo.UniversalCRTSdkDircCs|t|jdS)z Microsoft Universal C Runtime SDK last version. Return ------ str version r)rrrrrrrUniversalCRTSdkLastVersions z%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z Microsoft .NET Framework SDK versions. Return ------ tuple of str versions r|) z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rrrrrrrszSystemInfo.NetFxSdkVersioncCs8d}|jD](}t|jj|}|j|d}|r q4q |S)zu Microsoft .NET Framework SDK directory. Return ------ str path rZkitsinstallationfolder)rrrrr)rrr-rrrr NetFxSdkDir*s  zSystemInfo.NetFxSdkDircCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 32bit directory. Return ------ str path zMicrosoft.NET\FrameworkZframeworkdir32rrrrrrZguess_fwrrrFrameworkDir32<s zSystemInfo.FrameworkDir32cCs"t|jd}|j|jjdp |S)zw Microsoft .NET Framework 64bit directory. Return ------ str path zMicrosoft.NET\Framework64Zframeworkdir64rrrrrFrameworkDir64Ls zSystemInfo.FrameworkDir64cCs |dS)z Microsoft .NET Framework 32bit versions. Return ------ tuple of str versions _find_dot_net_versionsrrrrFrameworkVersion32\s zSystemInfo.FrameworkVersion32cCs |dS)z Microsoft .NET Framework 64bit versions. Return ------ tuple of str versions @rrrrrFrameworkVersion64hs zSystemInfo.FrameworkVersion64cCs|j|jjd|}t|d|}|p6||dp6d}|jdkrJ|dfS|jdkrt|dd d krld n|d fS|jd krdS|jdkrdSdS)z Find Microsoft .NET Framework versions. Parameters ---------- bits: int Platform number of bits: 32 or 64. Return ------ tuple of str versions zframeworkver%dzFrameworkDir%drCrrzv4.0rNrZv4z v4.0.30319v3.5r)r v2.0.50727g @)zv3.0r)rrrgetattrrrrh)rbitsZreg_verZ dot_net_dirr-rrrrts     z!SystemInfo._find_dot_net_versionscs*fddttD}t|dp(dS)a) Return name of the last dir in path or '' if no dir found. Parameters ---------- path: str Use dirs in this path prefix: str Use only dirs starting by this prefix Return ------ str name c3s*|]"}tt|r|r|VqdSr)rr startswith)ridir_namerVprefixrrrqs z0SystemInfo._use_last_dir_name..Nr)reversedrnext)rVrZ matching_dirsrrrrs  zSystemInfo._use_last_dir_name)N)r)#rrrrrrNrrFrrrrr staticmethodrrrrrrrrrrrrrrrrrrrrrrrrrrsZ    *      * "         rc@sTeZdZdZd=ddZeddZedd Zed d Zed d Z eddZ eddZ eddZ eddZ eddZeddZeddZddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zed6d7Zd>d9d:Zd;d<Z dS)?r*aY Return environment variables for specified Microsoft Visual C++ version and platform : Lib, Include, Path and libpath. This function is compatible with Microsoft Visual C++ 9.0 to 14.X. Script created by analysing Microsoft environment configuration files like "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ... Parameters ---------- arch: str Target architecture. vc_ver: float Required Microsoft Visual C++ version. If not set, autodetect the last version. vc_min_ver: float Minimum Microsoft Visual C++ version. NrcCsBt||_t|j|_t|j||_|j|kr>d}tj |dS)Nz.No suitable Microsoft Visual C++ version found) rrrrrsirr&r'r()rr.rZ vc_min_vererrrrrrs    zEnvironmentInfo.__init__cCs|jjS)zk Microsoft Visual Studio. Return ------ float version )r rrrrrrs zEnvironmentInfo.vs_vercCs|jjS)zp Microsoft Visual C++ version. Return ------ float version )r rrrrrrs zEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd d |DS) zu Microsoft Visual Studio Tools. Return ------ list of str paths z Common7\IDEz Common7\Toolsr|TrrXz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjj|qSrrr rrirVrrr rrz+EnvironmentInfo.VSTools..)rrr)rpaths arch_subdirrrrVSToolss    zEnvironmentInfo.VSToolscCst|jjdt|jjdgS)z Microsoft Visual C++ & Microsoft Foundation Class Includes. Return ------ list of str paths IncludezATLMFC\Includerr rrrrr VCIncludess  zEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd d |DS) z Microsoft Visual C++ & Microsoft Foundation Class Libraries. Return ------ list of str paths .@TrXrLib%sz ATLMFC\Lib%sr|z Lib\store%scsg|]}tjj|qSrrrrrrrrrz/EnvironmentInfo.VCLibraries..)rrr)rrrrrr VCLibrariess  zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjdgS)z Microsoft Visual C++ store references Libraries. Return ------ list of str paths r|zLib\store\references)rrr rrrrr VCStoreRefss zEnvironmentInfo.VCStoreRefscCs|j}t|jdg}|jdkr"dnd}|j|}|rL|t|jd|g7}|jdkr|d|jjdd}|t|j|g7}n|jdkr|jrd nd }|t|j||jjdd g7}|jj |jj kr|t|j||jjdd g7}n|t|jd g7}|S) zr Microsoft Visual C++ Tools. Return ------ list of str paths Z VCPackagesrTFBin%sr|rrz bin\HostX86%sz bin\HostX64%srBin) r rrrrrrrrrr)rr toolsrrrVZhost_dirrrrVCTools(s,     zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd}t|jjd|gS|jjdd}t|jjd}|j}t|d||fgSdS) zw Microsoft Windows SDK Libraries. Return ------ list of str paths rTr rrrz%sum%sN)rrrrr r _sdk_subdir)rrrZlibverrrr OSLibrariesMs zEnvironmentInfo.OSLibrariescCsht|jjd}|jdkr&|t|dgS|jdkr8|j}nd}t|d|t|d|t|d|gSd S) zu Microsoft Windows SDK Include. Return ------ list of str paths includerglr|rz%ssharedz%sumz%swinrtN)rr rrr!)rr#sdkverrrr OSIncludesas      zEnvironmentInfo.OSIncludescCst|jjd}g}|jdkr&||j7}|jdkr@|t|dg7}|jdkr||t|jjdt|ddt|d dt|d dt|jjd d d |jdddg7}|S)z} Microsoft Windows SDK Libraries Paths. Return ------ list of str paths Z ReferencesrrzCommonConfiguration\Neutralr|Z UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ ExtensionSDKszMicrosoft.VCLibsrZCommonConfigurationZneutral)rr rrr")rreflibpathrrr OSLibpathys2         zEnvironmentInfo.OSLibpathcCs t|S)zs Microsoft Windows SDK Tools. Return ------ list of str paths )list _sdk_toolsrrrrSdkToolss zEnvironmentInfo.SdkToolsccs|jdkr,|jdkrdnd}t|jj|V|js\|jjdd}d|}t|jj|V|jdvr|jrvd }n|jjddd }d |}t|jj|VnB|jdkrt|jjd}|jjdd}|jj}t|d ||fV|jj r|jj Vd S)z Microsoft Windows SDK Tools paths generator. Return ------ generator of str paths rrrzBin\x86Trr)rrrr zBin\NETFX 4.0 Tools%sz%s%sN) rrr rrrrrrr)rbin_dirrrVr%rrrr+s(     zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu Microsoft Windows SDK version subdir. Return ------ str subdir %s\r)r rrucrtverrrrr!s zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjdgS)zs Microsoft Windows SDK Setup. Return ------ list of str paths rSetup)rrr rrrrrSdkSetups zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}| o,| }n$|p>|}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)zv Microsoft .NET Framework Tools. Return ------ list of str paths rTr[csg|]}tj|qSr)rrrir-r rrrsz+EnvironmentInfo.FxTools..csg|]}tj|qSr)rrr3r4rrrs) rr rrrrrrr)rrZ include32Z include64rrr4rFxToolss"    zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd}t|jjd|gS)z~ Microsoft .Net Framework SDK Libraries. Return ------ list of str paths r|Trzlib\um%s)rr rrrr)rrrrrNetFxSDKLibrariess z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjdgS)z} Microsoft .Net Framework SDK Includes. Return ------ list of str paths r|z include\um)rr rrrrrrNetFxSDKIncludess z EnvironmentInfo.NetFxSDKIncludescCst|jjdgS)z Microsoft Visual Studio Team System Database. Return ------ list of str paths z VSTSDB\DeployrrrrrVsTDb$s zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd}n |jj}d}d|j|f}t||g}|jdkrr|t||dg7}|S)zn Microsoft Build Engine. Return ------ list of str paths rrTrrzMSBuild\%0.1f\bin%sZRoslyn)rr rrrrr)r base_pathrrVbuildrrrMSBuild0s    zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjdgS)zt Microsoft HTML Help Workshop. Return ------ list of str paths rzHTML Help Workshop)rrr rrrrrHTMLHelpWorkshopLs z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjd}|j}t|d||fgS)z Microsoft Universal C Runtime SDK Libraries. Return ------ list of str paths r|Trrz%sucrt%s)rrrrr r _ucrt_subdir)rrrr0rrr UCRTLibraries[s zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd}t|d|jgS)z Microsoft Universal C Runtime SDK Include. Return ------ list of str paths r|r#z%sucrt)rrr rr=)rr#rrr UCRTIncludesms zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z Microsoft Universal C Runtime SDK version subdir. Return ------ str subdir r.r)r rr/rrrr=}s zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk Microsoft Visual F#. Return ------ list of str paths rr)rr rrrrrFSharps zEnvironmentInfo.FSharpc Csd|j}|jjddd}g}|jj}t|dd}t|rft |t |d}||t |dg7}|t |d g7}d |jd d t |j d f}t ||D]&\}}t ||||} t| r| Sqd S) z Microsoft Visual C++ runtime redistributable dll. Return ------ str path zvcruntime%d0.dllTrrz\Toolsz\Redistr^Zonecorer\zMicrosoft.VC%d.CRT N)rrrrRr rrrmrrrr=rr9rr) rrerprefixesZ tools_pathZ redist_pathZcrt_dirsrZcrt_dirrVrrrVCRuntimeRedists  zEnvironmentInfo.VCRuntimeRedistTcCst|d|j|j|j|jg||d|j|j|j|j |j g||d|j|j|j |j g||d|j |j|j|j|j|j|j|j|jg |d}|jdkrt|jr|j|d<|S)z Return environment dict. Parameters ---------- exists: bool It True, only return existing paths. Return ------ dict environment r#rr(rV)r#rr(rVr5rs)dict _build_pathsrr&r?r7rr"r5r>r6rr)r rr8r,r2r;r<r@rrrC)rexistsrzrrrr+sV   zEnvironmentInfo.return_envc Csntj|}t|dt}t||}|rr?r=r@rCr+rErrrrr*sj        $   # #             " 2r*)r$)r)1rriorosrros.pathrrrrr~rplatformr9rOdistutils.errorsr&Z#setuptools.extern.packaging.versionr Z setuptools.extern.more_itertoolsr Zmonkeyr systemrrrDrar'r(Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr%rDrWr_rfr{r}rr,rrrr*rrrrs`       * &&'$ %s:PK! __pycache__/wheel.cpython-39.pycnu[a (Re` @sdZddlmZddlmZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl m Z ddlmZddlmZddlmZe d e jjZd Zd d ZGd ddZdS)zWheels support.) get_platform)logN) parse_version)sys_tags)canonicalize_name)write_requirementsz^(?P.+?)-(?P\d.*?) ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?) )\.whl$z8__import__('pkg_resources').declare_namespace(__name__) c Cst|D]\}}}tj||}|D].}tj||}tj|||}t||q&ttt|D]D\} } tj|| }tj||| }tj |sft|||| =qfq tj|ddD]\}}}|rJt |qdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN) oswalkpathrelpathjoinrenamesreversedlist enumerateexistsrmdir) src_dirZdst_dirdirpathdirnames filenamessubdirfsrcdstndr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/wheel.pyunpacks   r c@sheZdZddZddZddZddZd d Zd d Zd dZ e ddZ e ddZ e ddZ dS)WheelcCsPttj|}|dur$td|||_|D]\}}t|||q6dS)Nzinvalid wheel name: %r) WHEEL_NAMEr r basename ValueErrorfilename groupdictitemssetattr)selfr%matchkvrrr__init__6s  zWheel.__init__cCs&t|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..) itertoolsproduct py_versionsplitabiplatformr)rrrtags>s    z Wheel.tagscs0tddtDtfdd|DdS)z5Is the wheel is compatible with the current platform?css|]}|j|j|jfVqdSN) interpreterr3r4.0trrr Hsz&Wheel.is_compatible..c3s|]}|vrdVqdS)TNrr9supported_tagsrrr<JF)setrnextr6r5rr=r is_compatibleFszWheel.is_compatiblecCs,tj|j|j|jdkrdntddS)Nany) project_nameversionr4z.egg) pkg_resources DistributionrDrEr4regg_namer5rrrrHLs zWheel.egg_namecCsJ|D]4}t|}|drt|t|jr|SqtddS)Nz .dist-infoz.unsupported wheel format. .dist-info not found)namelist posixpathdirnameendswithr startswithrDr$)r)zfmemberrKrrr get_dist_infoRs    zWheel.get_dist_infocCs<t|j}|||Wdn1s.0YdS)z"Install wheel as an egg directory.N)zipfileZipFiler%_install_as_egg)r)destination_eggdirrNrrrinstall_as_egg\szWheel.install_as_eggcCs\d|j|jf}||}d|}tj|d}|||||||||||dS)Nz%s-%sz%s.dataEGG-INFO) rDrErPr r r _convert_metadata_move_data_entries_fix_namespace_packages)r)rTrNZ dist_basename dist_info dist_dataegg_inforrrrSas  zWheel._install_as_eggc sVfdd}|d}t|d}td|ko>tdkn}|sTtd|t||tj|tj j |t |dd d t t tfd d jD}t|ttj|d tj|dtj t|dd} tjj} ttjz*t| ddtj|dWt| n t| 0dS)NcsTt|.}|d}tj|WdS1sF0YdS)Nzutf-8) openrJr readdecodeemailparserParserparsestr)namefpvalue)rZrNrr get_metadatamsz-Wheel._convert_metadata..get_metadataZWHEELz Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)metadatacSsd|_t|Sr7)markerstr)reqrrrraw_reqsz(Wheel._convert_metadata..raw_reqc s2i|]*}|tfddt|fDqS)c3s|]}|vr|VqdSr7r)r:rk)install_requiresrrr<sz5Wheel._convert_metadata...)sortedmaprequires)r:extra)distrmrlrr sz+Wheel._convert_metadata..METADATAzPKG-INFO)rmextras_require)attrsr\z requires.txt)rgetr$r mkdir extractallr r rFrG from_location PathMetadatarrnrorpextrasrename setuptoolsdictr _global_log threshold set_thresholdWARNrget_command_obj) rNrTrZr\rgwheel_metadata wheel_versionZwheel_v1ruZ setup_distZ log_thresholdr)rrrZrmrlrNrrWksR        zWheel._convert_metadatacstj|tjd}tj|rtj|dd}t|t|D]D}|drpttj||qLttj||tj||qLt |t tjjfdddDD]}t ||qtjrt dS)z,Move data entries to their correct location.scriptsrVz.pycc3s|]}tj|VqdSr7)r r r )r:rr[rrr<sz+Wheel._move_data_entries..)dataheaderspurelibplatlibN) r r r rrxlistdirrLunlinkr}rfilterr )rTr[Zdist_data_scriptsZegg_info_scriptsentryrrrrrXs*         zWheel._move_data_entriesc Cstj|d}tj|rt|}|}Wdn1sD0Y|D]}tjj|g|dR}tj|d}tj|st|tj|sRt|d}|t WdqR1s0YqRdS)Nznamespace_packages.txtr.z __init__.pyw) r r r rr]r^r2rxwriteNAMESPACE_PACKAGE_INIT)r\rTZnamespace_packagesremodZmod_dirZmod_initrrrrYs  *    zWheel._fix_namespace_packagesN)__name__ __module__ __qualname__r-r6rBrHrPrUrS staticmethodrWrXrYrrrrr!4s   ? r!)__doc__distutils.utilr distutilsrr`r/r rJrerQrFr~rZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_inforcompileVERBOSEr*r"rr r!rrrrs,      PK!işӉ#__pycache__/dep_util.cpython-39.pycnu[a (Re@sddlmZddZdS)) newer_groupcCsht|t|krtdg}g}tt|D]2}t||||r,||||||q,||fS)zWalk both arguments in parallel, testing if each source group is newer than its corresponding target. Returns a pair of lists (sources_groups, targets) where sources is newer than target, according to the semantics of 'newer_group()'. z5'sources_group' and 'targets' must be the same length)len ValueErrorrangerappend)Zsources_groupstargets n_sources n_targetsir /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr N)distutils.dep_utilrr r r r r s PK!QT  $__pycache__/installer.cpython-39.pycnu[a (Re @spddlZddlZddlZddlZddlZddlmZddlmZddl Z ddl m Z ddZ ddZ d d ZdS) N)log)DistutilsError)WheelcCs(t|tr|St|ttfs$J|S)z8Ensure find-links option end-up being a list of strings.) isinstancestrsplittuplelist) find_linksr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/installer.py_fixup_find_links s r c CsVztdWn"tjy0|dtjYn0t|}|d}d|vrTtddt j vofdt j v}dt j vrxd }nd |vr|d d }nd }d |vrt |d d d d ng}|j r| |j t j|}t}t|D]}||vr||r|Sqt,} tjd ddddd| g} |r<| d|d urT| d|f|p\gD]} | d| fq^| |jpt|zt| Wn6tjy} ztt| | WYd } ~ n d } ~ 00ttt j | dd} t j || !}| "|t#|t j |d}tj$j%||d}|Wd S1sH0Yd S)zLFetch an egg needed for building. Use pip/wheel to fetch/build a wheel.wheelz,WARNING: The wheel package is not available. easy_installZ allow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements.Z PIP_QUIETZ PIP_VERBOSEZ PIP_INDEX_URLN index_urlr z-mpipz--disable-pip-version-checkz --no-depsz-wz--quietz --index-urlz --find-linksz*.whlrzEGG-INFO)metadata)& pkg_resourcesget_distributionDistributionNotFoundannouncerWARN strip_markerget_option_dictrosenvironr Zdependency_linksextendpathrealpathZget_egg_cache_dir Environmentfind_distributionscan_addtempfileTemporaryDirectorysys executableappendurlr subprocess check_callCalledProcessErrorrglobjoinegg_nameZinstall_as_egg PathMetadata Distribution from_filename)distreqoptsquietrr Zeggs_dir environmentZegg_distZtmpdircmdlinker dist_locationZ dist_metadatar r r fetch_build_eggsf        $ r;cCstjt|}d|_|S)z Return a new requirement without the environment marker to avoid calling pip with something like `babel; extra == "i18n"`, which would always be ignored. N)r Requirementparsermarker)r3r r r rXsr)r,rr)r%r# distutilsrdistutils.errorsrrZsetuptools.wheelrr r;rr r r r s   CPK!_, +$__pycache__/extension.cpython-39.pycnu[a (Re@spddlZddlZddlZddlZddlZddlmZddZeZ eej j Z Gddde Z Gdd d e Z dS) N) get_unpatchedcCs2d}zt|dgdjWdSty,Yn0dS)z0 Return True if Cython can be imported. zCython.Distutils.build_ext build_ext)fromlistTF) __import__r Exception)Z cython_implr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/extension.py _have_cython s r c@s eZdZdZddZddZdS) Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs.|dd|_tj|||g|Ri|dS)Npy_limited_apiF)popr _Extension__init__)selfnamesourcesargskwrrr r!szExtension.__init__cCsNtr dS|jpd}|dkr$dnd}ttjd|}tt||j |_ dS)z Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Nzc++z.cppz.cz.pyx$) r languagelower functoolspartialresublistmapr)rlangZ target_extrrrr _convert_pyx_sources_to_lang's  z&Extension._convert_pyx_sources_to_langN)__name__ __module__ __qualname____doc__rrrrrr r sr c@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#rrrr r$6sr$)rrdistutils.core distutilsdistutils.errorsdistutils.extensionZmonkeyrr Z have_pyrexcorer rr$rrrr s  PK!4<0QQ!__pycache__/config.cpython-39.pycnu[a (ReSZ@sddlZddlZddlZddlZddlZddlZddlZddlmZddlm Z ddlm Z ddl m Z ddl Z ddlmZmZddlmZmZddlmZGd d d Ze jd d ZdddZddZddZdddZGdddZGdddeZGdddeZdS)N) defaultdict)partialwraps)iglob)DistutilsOptionErrorDistutilsFileError) LegacyVersionparse) SpecifierSetc@s eZdZdZddZddZdS) StaticModulez0 Attempt to load the module by the name cCs`tj|}t|j}|}Wdn1s40Yt|}t| t |` dSN) importlibutil find_specopenoriginreadastr varsupdatelocalsself)rnamespecstrmsrcmoduler/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/config.py__init__s   & zStaticModule.__init__c s^ztfdd|jjDWStyX}z$tdjfit|WYd}~n d}~00dS)Nc3sH|]@}t|tjr|jD](}t|tjr|jkrt|jVqqdSr ) isinstancerAssigntargetsNameid literal_evalvalue).0Z statementtargetattrrr #s   z+StaticModule.__getattr__..z#{self.name} has no attribute {attr})nextrbody ExceptionAttributeErrorformatr)rr+err*r __getattr__!s  zStaticModule.__getattr__N)__name__ __module__ __qualname____doc__r r3rrrrr sr c cs8z$tjd|dVWtj|ntj|0dS)zH Add path to front of sys.path for the duration of the context. rN)syspathinsertremove)r9rrr patch_path0sr<Fc Csddlm}m}tj|}tj|s4td|t}t tj |zT|}|rb| ng}||vrx| ||j ||dt||j|d}Wt |n t |0t|S)a,Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict r) Distribution _Distributionz%Configuration file %s does not exist.) filenames)ignore_option_errors)Zsetuptools.distr=r>osr9abspathisfilergetcwdchdirdirnamefind_config_filesappendparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict) filepathZ find_othersr@r=r>Zcurrent_directorydistr?handlersrrrread_configuration<s"    rPcCs2djfit}tt||}t|||}|S)z Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. z get_{key})r1r functoolsrgetattr) target_objkeyZ getter_nameZ by_attributegetterrrr _get_optionis rVcCs<tt}|D]*}|jD]}t|j|}|||j|<qq |S)zReturns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict )rdict set_optionsrVrSsection_prefix)rOZ config_dicthandleroptionr'rrrrLus   rLcCs6t|||}|t|j|||j}|||fS)aPerforms additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list )ConfigOptionsHandlerr ConfigMetadataHandlermetadata package_dir) distributionrKr@optionsmetarrrrJs rJc@seZdZdZdZiZd'ddZeddZdd Z e d(d d Z e d)d dZ e ddZ e ddZe ddZe ddZeddZeddZe d*ddZe ddZe d+dd Zd!d"Zd#d$Zd%d&ZdS), ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|D].\}}||s&q||dd}|||<q||_||_||_g|_dS)N.) rYitems startswithreplacestripr@rSsectionsrX)rrSrar@rjrY section_namesection_optionsrrrr s  zConfigHandler.__init__cCstd|jjdS).Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError __class__r4)rrrrparserss zConfigHandler.parsersc Cst}|j}|j||}t|||}||ur6t||r>dSd}|j|}|r~z ||}Wnty|d}|jsxYn0|rdSt|d|d}|durt |||n|||j |dS)NFTzset_%s) tuplerSaliasesgetrRKeyErrorrpr/r@setattrrXrH) rZ option_namer'unknownrSZ current_valueZ skip_optionparsersetterrrr __setitem__s0    zConfigHandler.__setitem__,cCs8t|tr|Sd|vr |}n ||}dd|DS)zRepresents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list  cSsg|]}|r|qSr)ri)r(chunkrrr z-ConfigHandler._parse_list..)r!list splitlinessplit)clsr' separatorrrr _parse_lists   zConfigHandler._parse_listc sjd}|j|d}g}|D]Jtfdd|DrZ|tddttjDq|q|S)aEquivalent to _parse_list() but expands any glob patterns using glob(). However, unlike with glob() calls, the results remain relative paths. :param value: :param separator: List items separator character. :rtype: list )*?[]{}rc3s|]}|vVqdSr r)r(charr'rrr,r~z1ConfigHandler._parse_list_glob..css |]}tj|tVqdSr )rAr9relpathrDr(r9rrrr,s) ranyextendsortedrrAr9rBrH)rr'rZglob_charactersvaluesZexpanded_valuesrrr_parse_list_globs    zConfigHandler._parse_list_globcCsPd}i}||D]8}||\}}}||kr:td||||<q|S)zPRepresents value as a dict. :param value: :rtype: dict =z(Unable to parse option value to dict: %s)r partitionrri)rr'rresultlinerTsepvalrrr _parse_dict szConfigHandler._parse_dictcCs|}|dvS)zQRepresents value as boolean. :param value: :rtype: bool )1trueyes)lower)rr'rrr _parse_bool3szConfigHandler._parse_boolcsfdd}|S)zReturns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable cs d}||rtd|S)Nfile:zCOnly strings are accepted for the {0} field, files are not accepted)rg ValueErrorr1)r'Zexclude_directiverTrrrwIs z3ConfigHandler._exclude_files_parser..parserr)rrTrwrrr_exclude_files_parser=s z#ConfigHandler._exclude_files_parsercs\d}t|ts|S||s |S|t|d}dd|dD}dfdd|DS)aORepresents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtype: str rNcss|]}tj|VqdSr )rAr9rBrirrrrr,kr~z,ConfigHandler._parse_file..rzr{c3s.|]&}|stj|r|VqdS)TN) _assert_localrAr9rC _read_filerrrrr,ls)r!strrglenrjoin)rr'Zinclude_directiverZ filepathsrrr _parse_fileTs  zConfigHandler._parse_filecCs|tstd|dS)Nz#`file:` directive can not access %s)rgrArDr)rMrrrrrszConfigHandler._assert_localcCs:tj|dd}|WdS1s,0YdS)Nzutf-8)encoding)iorr)rMfrrrrwszConfigHandler._read_filec Cs4d}||s|S||dd}|}d|}|p@d}t}|r|d|vr||d}|dd} t | dkrtj t| d}| d}q|}nd|vrtj t|d}t |Nzt t ||WWdStyt|} Yn0Wdn1s 0Yt | |S) zRepresents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str zattr:rdrer r/N)rgrhrirpoprrArDrsplitrr9r<rRr r/r import_module) rr'r_Zattr_directiveZ attrs_path attr_name module_name parent_pathZ custom_pathpartsrrrr _parse_attr|s0         0zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable cs|}D] }||}q|Sr r)r'parsedmethod parse_methodsrrr s z1ConfigHandler._get_parser_compound..parser)rrr rrr_get_parser_compounds z"ConfigHandler._get_parser_compoundcCs6i}|pdd}|D]\}\}}||||<q|S)zParses section options into a dictionary. Optionally applies a given parser to values. :param dict section_options: :param callable values_parser: :rtype: dict cSs|Sr r)rrrrr~z6ConfigHandler._parse_section_to_dict..)rf)rrlZ values_parserr'rT_rrrr_parse_section_to_dicts  z$ConfigHandler._parse_section_to_dictc Cs:|D],\}\}}z |||<Wqty2Yq0qdS)zQParses configuration file section. :param dict section_options: N)rfrt)rrlrrr'rrr parse_sections   zConfigHandler.parse_sectioncCsb|jD]R\}}d}|r"d|}t|d|ddd}|durTtd|j|f||q dS)zTParses configuration file items from one or more related sections. rdz_%szparse_section%sre__Nz0Unsupported distribution option section: [%s.%s])rjrfrRrhrrY)rrkrlZmethod_postfixZsection_parser_methodrrrr s zConfigHandler.parsecstfdd}|S)zthis function will wrap around parameters that are deprecated :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around cst|i|Sr )warningswarn)argskwargsfuncmsg warning_classrrconfig_handlers z@ConfigHandler._deprecated_config_handler..config_handlerr)rrrrrrrr_deprecated_config_handlersz(ConfigHandler._deprecated_config_handler)F)rz)rz)N)N)r4r5r6r7rYrrr propertyrpry classmethodrrrrrr staticmethodrrrrrrr rrrrrrcs@  &         -   rccsHeZdZdZdddddZdZdfd d Zed d Zd dZ Z S)r]r^url description classifiers platforms)Z home_pagesummary classifierplatformFNcstt||||||_dSr )superr]r r_)rrSrar@r_rorrr s zConfigMetadataHandler.__init__cCs^|j}|j}|j}|j}|||||dt|||||d||ddt||||j|d S)rmz[The requires parameter is deprecated, please use install_requires for runtime dependencies.license license_filezDThe license_file parameter is deprecated, use license_files instead.) rkeywordsprovidesrequires obsoletesrrrZ license_filesrlong_descriptionversionZ project_urls)rrrrrDeprecationWarningr_parse_version)r parse_listZ parse_file parse_dictZexclude_files_parserrrrrps4 zConfigMetadataHandler.parserscCs||}||krF|}tt|trBd}t|jfit|S|||j }t |rb|}t|t st |drd tt |}nd|}|S)zSParses `version` option value. :param value: :rtype: str zCVersion loaded from {value} does not comply with PEP 440: {version}__iter__rez%s)rrir!r r rr1rrr_callablerhasattrrmap)rr'rtmplrrrr?s    z$ConfigMetadataHandler._parse_version)FN) r4r5r6rYrrZ strict_moder rrpr __classcell__rrrrr]s !r]c@sdeZdZdZeddZddZddZdd Zd d Z d d Z ddZ ddZ ddZ ddZdS)r\racCsN|j}t|jdd}|j}|j}|j}|||||||||||j|j|t|dS)rm;r)Zzip_safeZinclude_package_datar_scriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requirepackages entry_points py_modulesZpython_requirescmdclass)rrrr_parse_cmdclass_parse_packagesrr )rrZparse_list_semicolonZ parse_boolrZparse_cmdclassrrrrpgs*zConfigOptionsHandler.parserscs$ddfdd||DS)NcSs8|d}||dd}|d|}t|}t||S)Nrer)rfind __import__rR)Zqualified_class_nameidx class_namepkg_namerrrr resolve_classs   z;ConfigOptionsHandler._parse_cmdclass..resolve_classcsi|]\}}||qSrrr(kvrrr r~z8ConfigOptionsHandler._parse_cmdclass..)rrf)rr'rrrrs z$ConfigOptionsHandler._parse_cmdclasscCsnddg}|}||vr"||S||dk}||jdi}|rTddlm}n ddlm}|fi|S)zTParses `packages` option value. :param value: :rtype: list zfind:zfind_namespace:rz packages.findr)find_namespace_packages) find_packages)rirparse_section_packages__findrjrs setuptoolsrr)rr'Zfind_directivesZ trimmed_valueZfindns find_kwargsrrrrrs    z$ConfigOptionsHandler._parse_packagescsR|||j}gdtfdd|D}|d}|durN|d|d<|S)zParses `packages.find` configuration file section. To be used in conjunction with _parse_packages(). :param dict section_options: )whereincludeexcludecs$g|]\}}|vr|r||fqSrrrZ valid_keysrrr}r~zEConfigOptionsHandler.parse_section_packages__find..rNr)rrrWrfrs)rrlZ section_datarrrrrrs  z1ConfigOptionsHandler.parse_section_packages__findcCs|||j}||d<dS)z`Parses `entry_points` configuration file section. :param dict section_options: rN)rrrrlrrrrparse_section_entry_pointssz/ConfigOptionsHandler.parse_section_entry_pointscCs.|||j}|d}|r*||d<|d=|S)Nrrd)rrrs)rrlrrootrrr_parse_package_datas  z(ConfigOptionsHandler._parse_package_datacCs|||d<dS)z`Parses `package_data` configuration file section. :param dict section_options: package_dataNr rrlrrrparse_section_package_datasz/ConfigOptionsHandler.parse_section_package_datacCs|||d<dS)zhParses `exclude_package_data` configuration file section. :param dict section_options: Zexclude_package_dataNr r rrr"parse_section_exclude_package_datasz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}||||d<dS)zbParses `extras_require` configuration file section. :param dict section_options: rrZextras_requireN)rrr)rrlrrrrparse_section_extras_requiresz1ConfigOptionsHandler.parse_section_extras_requirecCs(|||j}dd|D|d<dS)z^Parses `data_files` configuration file section. :param dict section_options: cSsg|]\}}||fqSrrrrrrr}r~zAConfigOptionsHandler.parse_section_data_files.. data_filesN)rrrfrrrrparse_section_data_filessz-ConfigOptionsHandler.parse_section_data_filesN)r4r5r6rYrrprrrrr rrrrrrrrr\cs    r\)FF)F) rrrAr8rrQr collectionsrrrglobr contextlibdistutils.errorsrrZ#setuptools.extern.packaging.versionr r Z&setuptools.extern.packaging.specifiersr r contextmanagerr<rPrVrLrJrcr]r\rrrrs4      -  c_PK!|%__pycache__/py34compat.cpython-39.pycnu[a (Re@sTddlZz ddlZWney&Yn0z ejjZWneyNddZYn0dS)NcCs|j|jS)N)loader load_modulename)specr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/py34compat.pymodule_from_spec sr) importlibimportlib.util ImportErrorutilrAttributeErrorrrrrs    PK!"__pycache__/depends.cpython-39.pycnu[a (Reb@sddlZddlZddlZddlZddlmZddlmZmZm Z m Z ddl mZgdZ GdddZ d d Zdd d ZdddZddZedS)N) StrictVersion) find_module PY_COMPILED PY_FROZEN PY_SOURCE)_imp)Requirerget_module_constantextract_constantc@sHeZdZdZdddZddZdd Zdd d Zdd dZdddZ dS)r z7A prerequisite to building or installing a distributionNcCsF|dur|durt}|dur0||}|dur0d}|jt|`dS)N __version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage attributeformatr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/depends.py__init__szRequire.__init__cCs |jdurd|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrr full_name"s zRequire.full_namecCs*|jdup(|jdup(t|dko(||jkS)z%Is 'version' sufficiently up-to-date?Nunknown)rrstrr)rversionrrr version_ok(szRequire.version_okrcCs~|jdurDz$t|j|\}}}|r*||WStyBYdS0t|j|j||}|durz||urz|jdurz||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)rrrclose ImportErrorr r)rpathsdefaultfpivrrr get_version-s   zRequire.get_versioncCs||duS)z/Return true if dependency is present on 'paths'N)r')rr!rrr is_presentHszRequire.is_presentcCs ||}|durdS||S)z>Return true if dependency is present and up-to-date on 'paths'NF)r'r)rr!rrrr is_currentLs zRequire.is_current)r NN)Nr)N)N) __name__ __module__ __qualname____doc__rrrr'r(r)rrrrr s   r cCs"tjdd}|s|St|S)Ncss dVdS)NrrrrremptyUszmaybe_close..empty) contextlibcontextmanagerclosing)r#r.rrr maybe_closeTs  r2c Cszt||\}}\}}}} Wnty2YdS0t||tkr\|dt|} nX|tkrrt ||} nB|t krt ||d} n(t ||| } t | |dWdSWdn1s0Yt| ||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)rr r2rreadmarshalloadrrget_frozen_objectrcompileZ get_modulegetattrr ) rsymbolr"r!r#pathsuffixmodekindinfocodeZimportedrrrr _s    8r c Cs||jvrdSt|j|}d}d}d}|}t|D]H}|j} |j} | |kr\|j| }q8| |kr|| |kst| |kr||S|}q8dS)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_nameslistindexdisBytecodeopcodearg co_consts) rBr<r"Zname_idx STORE_NAME STORE_GLOBAL LOAD_CONSTconstZ byte_codeoprLrrrr |s  r cCs>tjdstjdkrdSd}|D]}t|=t|q"dS)z Patch the globals to remove the objects not available on some platforms. XXX it'd be better to test assertions about bytecode instead. javacliN)r r )sysplatform startswithglobals__all__remove)Z incompatiblerrrr_update_globalss r[)r3N)r3)rUr7r/rIZdistutils.versionrrrrrrr rYr r2r r r[rrrrs  D  $PK!v8tt"__pycache__/version.cpython-39.pycnu[a (Re@s4ddlZzedjZWney.dZYn0dS)N setuptoolsunknown) pkg_resourcesget_distributionversion __version__ Exceptionr r /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/version.pys PK!R)E__pycache__/glob.cpython-39.pycnu[a (Re @sdZddlZddlZddlZgdZdddZdddZd d Zd d Zd dZ ddZ ddZ e dZ e dZddZddZddZdS)z Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. N)globiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. ) recursive)listr)pathnamerr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/glob.pyrs rcCs*t||}|r&t|r&t|}|r&J|S)aReturn an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. However, unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns. If recursive is true, the pattern '**' will match any files and zero or more directories and subdirectories. )_iglob _isrecursivenext)rritsrrr rs  rccstj|\}}|r t|r tnt}t|sZ|rDtj|rV|Vntj|rV|VdS|sr|||EdHdS||krt|rt ||}n|g}t|st }|D]$}|||D]}tj ||VqqdSN) ospathsplitr glob2glob1 has_magiclexistsisdirr glob0join)rrdirnamebasename glob_in_dirdirsnamerrr r 0s(   r cCsT|s"t|trtjd}ntj}zt|}WntyFgYS0t||SNASCII) isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr rTs   rcCs8|stj|r4|gSntjtj||r4|gSgSr)rrrrr)rrrrr ras  rccs2t|s J|ddVt|D] }|Vq"dS)Nr)r _rlistdir)rr)xrrr rqs  rccs|s"t|trtjd}ntj}zt|}WntjyFYdS0|D]>}|V|rhtj||n|}t |D]}tj||VqtqLdSr) r!r"rr#r$r%errorrrr+)rr*r,ryrrr r+ys  r+z([*?[])s([*?[])cCs(t|trt|}n t|}|duSr)r!r"magic_check_bytessearch magic_check)rmatchrrr rs   rcCst|tr|dkS|dkSdS)Ns**z**)r!r")r)rrr r s r cCs<tj|\}}t|tr(td|}n td|}||S)z#Escape all special characters. s[\1]z[\1])rr splitdriver!r"r/subr1)rdriverrr rs   r)F)F)__doc__rrer'__all__rrr rrrr+compiler1r/rr rrrrr s   $   PK!s@@%__pycache__/namespaces.cpython-39.pycnu[a (Re @sFddlZddlmZddlZejjZGdddZGdddeZdS)N)logc@sTeZdZdZddZddZddZdZd Zd d Z d d Z ddZ e ddZ dS) Installerz -nspkg.pthcCs|}|sdStj|\}}||j7}|j|t d|t |j |}|j rdt |dSt|d}||Wdn1s0YdS)Nz Installing %swt)_get_all_ns_packagesospathsplitext _get_target nspkg_extoutputsappendrinfomap_gen_nspkg_linedry_runlistopen writelines)selfnspfilenameextlinesfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/namespaces.pyinstall_namespaces s     zInstaller.install_namespacescCsHtj|\}}||j7}tj|s.dStd|t|dS)Nz Removing %s) rrrr r existsrr remove)rrrrrruninstall_namespacess    zInstaller.uninstall_namespacescCs|jSN)targetrrrrr 'szInstaller._get_target) zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']rr"rrr _get_rootEszInstaller._get_rootcCsNt|d}|}|j}|d\}}}|r:||j7}d|tdS)N.; )tuplesplitr# _nspkg_tmpl rpartition_nspkg_tmpl_multijoinlocals)rpkgpthrootZ tmpl_linesparentsepchildrrrrHs zInstaller._gen_nspkg_linecCs |jjp g}ttt|j|S)z,Return sorted list of all package namespaces) distributionZnamespace_packagessortedflattenr _pkg_names)rpkgsrrrrQs zInstaller._get_all_ns_packagesccs(|d}|r$d|V|q dS)z Given a namespace package, yield the components of that package. >>> names = Installer._pkg_names('a.b.c') >>> set(names) == set(['a', 'a.b', 'a.b.c']) True r$N)r(r,pop)r.partsrrrr7Vs  zInstaller._pkg_namesN)__name__ __module__ __qualname__r rrr r)r+r#rr staticmethodr7rrrrr s rc@seZdZddZddZdS)DevelopInstallercCstt|jSr )reprstrZegg_pathr"rrrr#gszDevelopInstaller._get_rootcCs|jSr )egg_linkr"rrrr jszDevelopInstaller._get_targetN)r;r<r=r#r rrrrr?fsr?) r distutilsr itertoolschain from_iterabler6rr?rrrrs  ]PK!>7!__pycache__/errors.cpython-39.pycnu[a (Re @s&dZddlmZGdddeeZdS)zCsetuptools.errors Provides exceptions used by setuptools modules. )DistutilsErrorc@seZdZdZdS)RemovedCommandErroraOError used for commands that have been removed in setuptools. Since ``setuptools`` is built on ``distutils``, simply removing a command from ``setuptools`` will make the behavior fall back to ``distutils``; this error is raised if a command exists in ``distutils`` but has been actively removed in ``setuptools``. N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/errors.pyr srN)rdistutils.errorsr RuntimeErrorrrrrr s PK!On*"*"#__pycache__/__init__.cpython-39.pycnu[a (Re@sFdZddlmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl mZddlmZddlZddlmZdd lmZdd lmZdd lmZgd ZejjZdZGd ddZGdddeZ ej!Z"e j!Z#ddZ$ddZ%e j&j%je%_e'e j&j(Z)Gddde)Z(ddZ*ej+fddZ,Gddde-Z.e/dS)z@Extensions to the 'distutils' for large or complex distributions fnmatchcaseN)DistutilsOptionError) convert_path)SetuptoolsDeprecationWarning) Extension) Distribution)Require)monkey)setupr Commandrr r find_packagesfind_namespace_packagesc@sBeZdZdZedddZeddZed d Zed d Z d S) PackageFinderzI Generate a list of all Python packages found within a directory .*cCs,t|t||jddg|R|j|S)a Return a list all Python packages found within directory 'where' 'where' is the root directory which will be searched for packages. It should be supplied as a "cross-platform" (i.e. URL-style) path; it will be converted to the appropriate local path syntax. 'exclude' is a sequence of package names to exclude; '*' can be used as a wildcard in the names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 'foo' itself). 'include' is a sequence of package names to include. If it's specified, only the named packages will be included. If it's not specified, all found packages will be included. 'include' can contain shell style wildcard patterns just like 'exclude'. Zez_setupz *__pycache__)list_find_packages_iterr _build_filter)clswhereexcludeincluderr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/__init__.pyfind-szPackageFinder.findc cstj|ddD]\}}}|dd}g|dd<|D]d}tj||} tj| |} | tjjd} d|vs4|| sxq4|| r|| s| V||q4qdS)zy All the packages found in 'where' that pass the 'include' filter, but not the 'exclude' filter. T followlinksNr) oswalkpathjoinrelpathreplacesep_looks_like_packageappend) rrrrrootdirsfilesZall_dirsdir full_pathrel_pathpackagerrrrGs  z!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z __init__.py)r r"isfiler#r"rrrr'csz!PackageFinder._looks_like_packagecs fddS)z Given a list of patterns, return a callable that will be true only if the input matches at least one of the patterns. cstfddDS)Nc3s|]}t|dVqdS))patNr).0r2namerr nz@PackageFinder._build_filter....)anyr4patternsr4rnr7z-PackageFinder._build_filter..rr9rr9rrhszPackageFinder._build_filterN)rrr) __name__ __module__ __qualname____doc__ classmethodrr staticmethodr'rrrrrr(s   rc@seZdZeddZdS)PEP420PackageFindercCsdS)NTrr1rrrr'rsz'PEP420PackageFinder._looks_like_packageN)r<r=r>rAr'rrrrrBqsrBcCsJGdddtjj}||}|jdd|jrFtdt||jdS)Nc@s eZdZdZddZddZdS)z4_install_setup_requires..MinimalDistributionzl A minimal version of a distribution for supporting the fetch_build_eggs interface. cs6d}fddt|t@D}tjj||dS)N)Zdependency_linkssetup_requirescsi|]}||qSrr)r3kattrsrr r7zQ_install_setup_requires..MinimalDistribution.__init__..)set distutilscorer __init__)selfrFZ_inclfilteredrrErrKsz=_install_setup_requires..MinimalDistribution.__init__cSsdS)zl Disable finalize_options to avoid building the working set. Ref #2158. Nr)rLrrrfinalize_optionsszE_install_setup_requires..MinimalDistribution.finalize_optionsN)r<r=r>r?rKrNrrrrMinimalDistribution~srOT)Zignore_option_errorszdsetup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.) rIrJr parse_config_filesrCwarningswarnrZfetch_build_eggs)rFrOdistrrr_install_setup_requires{s rTcKst|tjjfi|SN)rTrIrJr rErrrr sr c@s:eZdZejZdZddZd ddZddZd d d Z dS)r FcKst||t||dS)zj Construct the command for dist, updating vars(self) with any keyword parameters. N)_CommandrKvarsupdate)rLrSkwrrrrKs zCommand.__init__NcCsBt||}|dur"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr isinstancestrr)rLoptionwhatdefaultvalrrr_ensure_stringlikes    zCommand._ensure_stringlikecCspt||}|durdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"]. Nz,\s*|\s+css|]}t|tVqdSrU)r\r])r3vrrrr6r7z-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r)) rZr\r]r[resplitrallr)rLr^raokrrrensure_string_lists    zCommand.ensure_string_listrcKs t|||}t|||SrU)rVreinitialize_commandrWrX)rLcommandreinit_subcommandsrYcmdrrrriszCommand.reinitialize_command)N)r) r<r=r>rVr?Zcommand_consumes_argumentsrKrbrhrirrrrr s  r cCs&ddtj|ddD}ttjj|S)z% Find all files under 'path' css,|]$\}}}|D]}tj||VqqdSrU)r r"r#)r3baser*r+filerrrr6sz#_find_all_simple..Tr)r r!filterr"r0)r"resultsrrr_find_all_simples rqcCs6t|}|tjkr.tjtjj|d}t||}t|S)z Find all files under 'dir' and return the list of full filenames. Unless dir is '.', return full filenames with dir prepended. )start) rqr curdir functoolspartialr"r$mapr)r,r+Zmake_relrrrfindalls   rwc@seZdZdZdS)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r<r=r>r?rrrrrxsrx)0r?fnmatchrrtr rdrQZ_distutils_hack.overrideZ_distutils_hackdistutils.corerIdistutils.errorsrdistutils.utilrZ_deprecation_warningrZsetuptools.version setuptoolsZsetuptools.extensionrZsetuptools.distr Zsetuptools.dependsr r __all__version __version__Zbootstrap_install_fromrrBrrrrTr rJZ get_unpatchedr rVrqrsrwr]rxZ patch_allrrrrs>         I! 3  PK!g=="__pycache__/sandbox.cpython-39.pycnu[a (Re 8@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddl mZejdrddlmmmmZn ejejZzeZWneydZYn0eZgdZd-ddZejd.dd Z ejd d Z!ejd d Z"ejddZ#Gddde$Z%GdddZ&ejddZ'ddZ(ejddZ)ejddZ*hdZ+ddZ,dd Z-d!d"Z.Gd#d$d$Z/e0ed%rej1gZ2ngZ2Gd&d'd'e/Z3e4ej5d(d)d*6DZ7Gd+d,d,e Z8dS)/N)DistutilsError) working_setjava)AbstractSandboxDirectorySandboxSandboxViolation run_setupcCs^d}t||}|}Wdn1s,0Y|durB|}t||d}t|||dS)z. Python 3 implementation of execfile. rbNexec)openreadcompiler )filenameglobalslocalsmodestreamscriptcoder/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/sandbox.py _execfile$s & rc csRtjdd}|dur$|tjdd<z|VW|tjdd<n|tjdd<0dSN)sysargv)replsavedrrr save_argv1s rc cs<tjdd}z|VW|tjdd<n|tjdd<0dSr)rpathrrrr save_path<sr ccs8tj|ddtj}|t_zdVW|t_n|t_0dS)zL Monkey-patch tempfile.tempdir with replacement, ensuring it exists T)exist_okN)osmakedirstempfiletempdir) replacementrrrr override_tempEs r'c cs8t}t|z|VWt|n t|0dSr)r"getcwdchdir)targetrrrrpushdVs  r+c@seZdZdZeddZdS)UnpickleableExceptionzP An exception representing another Exception that could not be pickled. c CsNzt|t|fWStyHddlm}|||t|YS0dS)z Always return a dumped (pickled) type and exc. If exc can't be pickled, wrap it in UnpickleableException first. r)r,N)pickledumps Exceptionsetuptools.sandboxr,dumprepr)typeexcclsrrrr1es   zUnpickleableException.dumpN)__name__ __module__ __qualname____doc__ staticmethodr1rrrrr,`sr,c@s(eZdZdZddZddZddZdS) ExceptionSaverz^ A Context Manager that will save an exception, serialized, and restore it later. cCs|Srrselfrrr __enter__zszExceptionSaver.__enter__cCs |sdSt|||_||_dSNT)r,r1_saved_tb)r=r3r4tbrrr__exit__}s zExceptionSaver.__exit__cCs2dt|vrdSttj|j\}}||jdS)z"restore and re-raise any exceptionr@N)varsmapr-loadsr@with_tracebackrA)r=r3r4rrrresumes zExceptionSaver.resumeN)r6r7r8r9r>rCrHrrrrr;ts r;c#sjtjt}VWdn1s,0YtjfddtjD}t||dS)z Context in which imported modules are saved. Translates exceptions internal to the context into the equivalent exception outside the context. Nc3s$|]}|vr|ds|VqdS)z encodings.N startswith).0mod_namerrr s zsave_modules..)rmodulescopyr;update_clear_modulesrH) saved_excZ del_modulesrrr save_moduless $  rScCst|D] }tj|=qdSr)listrrN)Z module_namesrLrrrrQs rQc cs.t}z|VWt|n t|0dSr) pkg_resources __getstate__ __setstate__rrrrsave_pkg_resources_statesrXc cstj|d}tttttnt|Ft |t ddVWdn1sj0YWdn1s0YWdn1s0YWdn1s0YWdn1s0YWdn1s0YdS)Ntemp setuptools) r"rjoinrXrSr hide_setuptoolsrr'r+ __import__) setup_dirtemp_dirrrr setup_contexts  r`> distutilsrUZCython_distutils_hackrZcCs|ddd}|tvS)aH >>> _needs_hiding('setuptools') True >>> _needs_hiding('pkg_resources') True >>> _needs_hiding('setuptools_plugin') False >>> _needs_hiding('setuptools.__init__') True >>> _needs_hiding('distutils') True >>> _needs_hiding('os') False >>> _needs_hiding('Cython') True .r)split_MODULES_TO_HIDE)rL base_modulerrr _needs_hidingsrhcCs6tjdd}|dur|tttj}t|dS)a% Remove references to setuptools' modules from sys.modules to allow the invocation to import the most appropriate setuptools. This technique is necessary to avoid issues such as #315 where setuptools upgrading itself would fail to find a function declared in the metadata. rbN)rrNgetZ remove_shimfilterrhrQ)rbrNrrrr\s  r\c Cstjtj|}t|z|gt|tjdd<tjd|t t j ddt |&t|dd}t||Wdn1s0YWn6ty}z|jr|jdrWYd}~n d}~00Wdn1s0YdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|Sr)activate)distrrrzrun_setup..__main__)__file__r6)r"rabspathdirnamer`rTrrinsertr__init__ callbacksappendrdictr SystemExitargs)Z setup_scriptryr^nsvrrrrs   ,rc@seZdZdZdZddZddZddZd d Zd d Z d dZ dD]Z e e e rDe e ee <qDd$ddZerzedeZedeZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZdD]Z e e e ree ee <qddZddZd d!Zd"d#ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs$g|]}|dst|r|qS)_)rJhasattr)rKnamer<rr sz,AbstractSandbox.__init__..)dir_os_attrsr<rr<rrts zAbstractSandbox.__init__cCs"|jD]}tt|t||qdSr)rsetattrr"getattr)r=sourcer~rrr_copys zAbstractSandbox._copycCs(||tr|jt_|jt_d|_dSr?)r_filebuiltinsfile_openr _activer<rrrr>s  zAbstractSandbox.__enter__cCs$d|_trtt_tt_|tdSNF)rrrrrr rr)r=exc_type exc_value tracebackrrrrC!s zAbstractSandbox.__exit__cCs.||WdS1s 0YdS)zRun 'func' under os sandboxingNr)r=funcrrrrun(szAbstractSandbox.runcsttfdd}|S)Ncs>|jr&|j||g|Ri|\}}||g|Ri|Sr)r _remap_pair)r=srcdstrykwr~originalrrwrap0s z3AbstractSandbox._mk_dual_path_wrapper..wraprrr~rrrr_mk_dual_path_wrapper-s z%AbstractSandbox._mk_dual_path_wrapper)renamelinksymlinkNcs p ttfdd}|S)Ncs6|jr |j|g|Ri|}|g|Ri|Sr)r _remap_inputr=rryrrrrr>sz5AbstractSandbox._mk_single_path_wrapper..wrapr)r~rrrrr_mk_single_path_wrapper;sz'AbstractSandbox._mk_single_path_wrapperrr )statlistdirr)r chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsT|jr>|j|g|Ri|}||g|Ri|S|g|Ri|Sr)rr _remap_outputrrrrrcsz4AbstractSandbox._mk_single_with_return..wraprrrrr_mk_single_with_return`s z&AbstractSandbox._mk_single_with_return)readlinktempnamcsttfdd}|S)Ncs$|i|}|jr ||S|Sr)rr)r=ryrretvalrrrrrs z'AbstractSandbox._mk_query..wraprrrrr _mk_queryos zAbstractSandbox._mk_query)r(tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r=rrrr_validate_path~szAbstractSandbox._validate_pathcOs ||SzCalled for path inputsrr= operationrryrrrrrszAbstractSandbox._remap_inputcCs ||S)zCalled for path outputsr)r=rrrrrrszAbstractSandbox._remap_outputcOs<|j|d|g|Ri||j|d|g|Ri|fS)?Called for path pairs like rename, link, and symlink operationsz-fromz-to)rr=rrrryrrrrrszAbstractSandbox._remap_pair)N)r6r7r8r9rrtrr>rCrrr~r}rrrrrrrrrrrrrrrr s<          rdevnullc@seZdZdZegdZgZefddZ ddZ e r@ddd Z dd d Z d d Z ddZddZddZddZdddZdS)rz.) r"rrr_sandboxr[_prefix _exceptionsrrt)r=Zsandbox exceptionsrrrrts zDirectorySandbox.__init__cOsddlm}||||dS)Nr)r)r0r)r=rryrrrrr _violations zDirectorySandbox._violationrcOsF|dvr.||s.|jd||g|Ri|t||g|Ri|S)Nrrtr ZrUUr)_okrrr=rrryrrrrrszDirectorySandbox._filecOsF|dvr.||s.|jd||g|Ri|t||g|Ri|S)Nrr )rrrrrrrrszDirectorySandbox._opencCs|ddS)Nr)rr<rrrrszDirectorySandbox.tmpnamcCsV|j}zBd|_tjtj|}||p@||jkp@||jW||_S||_0dSr) rr"rrr _exemptedrrJr)r=ractiverrrrrs  zDirectorySandbox._okcs<fdd|jD}fdd|jD}t||}t|S)Nc3s|]}|VqdSrrI)rK exceptionfilepathrrrMsz-DirectorySandbox._exempted..c3s|]}t|VqdSr)rematch)rKpatternrrrrMs)r_exception_patterns itertoolschainany)r=rZ start_matchesZpattern_matches candidatesrrrrs   zDirectorySandbox._exemptedcOs:||jvr6||s6|j|tj|g|Ri||Sr) write_opsrrr"rrrrrrrs"zDirectorySandbox._remap_inputcOs8||r||s0|j|||g|Ri|||fS)r)rrrrrrrszDirectorySandbox._remap_paircOsL|t@r0||s0|jd|||g|Ri|tj|||g|Ri|S)zCalled for low-level os.open()zos.open) WRITE_FLAGSrrrr )r=rflagsrryrrrrr szDirectorySandbox.openN)r)r)r)r6r7r8r9rwfromkeysrr _EXCEPTIONSrtrrrrrrrrr rrrrrs      rcCsg|]}tt|dqS)rr)rKarrrrsrz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZedZddZdS)rzEA setup script attempted to modify the filesystem outside the sandboxa SandboxViolation: {cmd}{args!r} {kwargs} The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted. This package cannot be safely installed by EasyInstall, and may not support alternate installation locations even if you run its setup script by hand. Please inform the package's author and the EasyInstall maintainers to find out if a fix or workaround is available. cCs |j\}}}|jjfitSr)rytmplformatr)r=cmdrykwargsrrr__str__s zSandboxViolation.__str__N) r6r7r8r9textwrapdedentlstriprrrrrrrs r)N)N)9r"rr$operator functoolsrr contextlibr-rrrUdistutils.errorsrrplatformrJZ$org.python.modules.posix.PosixModulepythonrNposixZ PosixModulerr~rr NameErrorr r__all__rcontextmanagerrr r'r+r/r,r;rSrQrXr`rfrhr\rrr}rrrreduceor_rerrrrrrsr                  ^ PK!UU__pycache__/_imp.cpython-39.pycnu[a (ReX @sddZddlZddlZddlZddlmZdZdZdZ dZ dZ d d Z dd d Z dd dZddZdS)zX Re-implementation of find_module and get_frozen_object from the deprecated imp module. N)module_from_speccCs(t|trtjjntjj}|||S)N) isinstancelist importlib machinery PathFinder find_specutil)modulepathsfinderr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_imp.pyr s r c CsRt||}|durtd||js>t|dr>tjd|j}d}d}t|jt }|j dksp|rt |jtj j rt}d}d}}n|j dks|rt |jtj jrt}d}d}}n|jr6|j }tj|d }|tj jvrd nd }|tj jvrt}n&|tj jvr t}n|tj jvrt}|tthvrBt||}n d}d}}|||||ffS) z7Just like 'imp.find_module()', but with package supportN Can't find %ssubmodule_search_locationsz __init__.pyfrozenzbuilt-inrrrb)r ImportError has_locationhasattrr rspec_from_loaderloaderrtypeorigin issubclassr FrozenImporter PY_FROZENBuiltinImporter C_BUILTINospathsplitextSOURCE_SUFFIXES PY_SOURCEBYTECODE_SUFFIXES PY_COMPILEDEXTENSION_SUFFIXES C_EXTENSIONopen) rrspeckindfileZstaticr(suffixmoderrr find_modulesF         r6cCs&t||}|std||j|SNr)r rrget_code)rrr1rrrget_frozen_objectGs  r9cCs"t||}|std|t|Sr7)r rr)rrinfor1rrr get_moduleNs  r;)N)N)__doc__r'importlib.utilr importlib.machineryZ py34compatrr+r-r/r&r$r r6r9r;rrrrs  * PK!{cVV/__pycache__/_deprecation_warning.cpython-39.pycnu[a (Re@sGdddeZdS)c@seZdZdZdS)SetuptoolsDeprecationWarningz Base class for warning deprecations in ``setuptools`` This class is not derived from ``DeprecationWarning``, and as such is visible by default. N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_deprecation_warning.pyrsrN)WarningrrrrrPK!//*__pycache__/windows_support.cpython-39.pycnu[a (Re@s(ddlZddlZddZeddZdS)NcCstdkrddS|S)NWindowsc_sdS)N)argskwargsrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/windows_support.pyzwindows_only..)platformsystem)funcrrr windows_onlys r cCsLtdtjjj}tjjtjjf|_tjj |_ d}|||}|sHt dS)z Set the hidden attribute on a file or directory. From http://stackoverflow.com/questions/19622133/ `path` must be text. zctypes.wintypesN) __import__ctypeswindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDargtypesZBOOLrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr hide_file s    r)r rr rrrrrsPK!c *extern/__pycache__/__init__.cpython-39.pycnu[a (Reg @s6ddlZddlZGdddZdZeeeddS)Nc@sXeZdZdZdddZeddZdd Zd d Zd d Z ddZ dddZ ddZ dS)VendorImporterz A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages from root_name. NcCs&||_t||_|p|dd|_dS)NZextern_vendor) root_namesetvendored_namesreplace vendor_pkg)selfrrr rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/extern/__init__.py__init__ s zVendorImporter.__init__ccs|jdVdVdS)zL Search first the vendor package then as a natural package. .N)r r rrr search_paths zVendorImporter.search_pathcCs.||jd\}}}| o,tt|j|jS)z,Figure out if the target module is vendored.r ) partitionranymap startswithr)r fullnamerootbasetargetrrr _module_matches_namespacesz(VendorImporter._module_matches_namespacec Cs~||jd\}}}|jD]F}z.||}t|tj|}|tj|<|WSty`Yq0qtdjfitdS)zK Iterate over the search path to locate and load fullname. r zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N) rrr __import__sysmodules ImportErrorformatlocals)r rrrrprefixZextantmodrrr load_modules     zVendorImporter.load_modulecCs ||jSN)r"name)r specrrr create_module3szVendorImporter.create_modulecCsdSr#r)r modulerrr exec_module6szVendorImporter.exec_modulecCs||rtj||SdS)z(Return a module spec for vendored names.N)r importlibutilspec_from_loader)r rpathrrrr find_spec9szVendorImporter.find_speccCs|tjvrtj|dS)zR Install this importer into sys.meta_path if not already present. N)r meta_pathappendrrrr install@s zVendorImporter.install)rN)NN) __name__ __module__ __qualname____doc__r propertyrrr"r&r(r-r0rrrr rs   r) packaging pyparsingZ ordered_setZmore_itertoolszsetuptools._vendor)importlib.utilr)rrnamesr1r0rrrr sCPK!KDD/command/__pycache__/easy_install.cpython-39.pycnu[a (ReN@sdZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&Z&dd l'm(Z(m)Z)dd l*m+Z+dd l*m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6ddl/m7Z7m8Z8ddl9m:Z:ddl;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJdd l;Z;ejKde;jLdgdZMddZNddZOddZPddZQd d!ZRGd"d#d#e,ZSd$d%ZTd&d'ZUd(d)ZVd*d+ZWd,d-ZXGd.d/d/eBZYGd0d1d1eYZZej[\d2d3d4kreZZYd5d6Z]d7d8Z^d9d:Z_d;d<Z`did=d>Zad?d@ZbdAdBZcdCejdvrecZendDdEZedjdGdHZfdIdJZgdKdLZhdMdNZizddOlmjZkWnely&dPdQZkYn0dRdSZjGdTdUdUemZnenoZpGdVdWdWenZqGdXdYdYZrGdZd[d[erZsGd\d]d]esZterjuZuerjvZvd^d_Zwd`daZxdbe^fdcddZydedfZzGdgdhdhe+Z{d S)ka0 Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html )glob) get_platform) convert_path subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMES SCHEME_KEYS)logdir_util) first_line_re)find_executableN)get_config_varsget_path)SetuptoolsDeprecationWarning)Command) run_setup)setopt)unpack_archive) PackageIndexparse_requirement_arg URL_SCHEME) bdist_eggegg_info)Wheel) yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributions Environment Requirement Distribution PathMetadata EggMetadata WorkingSetDistributionNotFoundVersionConflict DEVELOP_DISTdefault)category)samefile easy_installPthDistributionsextract_wininst_cfgget_exe_prefixescCstddkS)NP)structcalcsizer7r7/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/easy_install.pyis_64bitJsr9cCsjtj|otj|}ttjdo&|}|r:tj||Stjtj|}tjtj|}||kS)z Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r.)ospathexistshasattrr.normpathnormcase)p1p2Z both_existZ use_samefileZnorm_p1Znorm_p2r7r7r8r.Nsr.cCs |dS)Nutf8)encodesr7r7r8 _to_bytes^srFcCs*z|dWdSty$YdS0dS)NasciiTF)rC UnicodeErrorrDr7r7r8isasciibs   rIcCst|ddS)N z; )textwrapdedentstripreplace)textr7r7r8 _one_linerjsrPc@sxeZdZdZdZdZdddddd d d d d ddddddddddddddejfgZgdZ ddiZ e Z dd Z d!d"Zd#d$Zed%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zdd1d2Zd3d4Zd5d6Zd7d8Zed9Zed:Zed;Z dd?Z"d@dAZ#dBdCZ$dDdEZ%dFdGZ&e'j(dHdIZ)ddKdLZ*ddMdNZ+dOdPZ,ddQdRZ-dSdTZ.dUdVZ/dWdXZ0ddYdZZ1ed[d\Z2dd_d`Z3dadbZ4dcddZ5dedfZ6dgdhZ7didjZ8dkdlZ9edmZ:ednZ;ddpdqZdudvZ?dwdxZ@dydzZAd{d|ZBd}d~ZCddZDddZEedFZGddZHeIeIddddZJeIdddZKddZLdS)r/z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zip-okzzinstall package as a zipfile) multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))z install-dir=dzinstall package to DIR)z script-dir=rEzinstall scripts to DIR)exclude-scriptsxzDon't install scripts) always-copyaz'Copy all needed packages to install dir)z index-url=iz base URL of Python Package Index)z find-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files) always-unzipZz*don't install as a zipfile, no matter what)z site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)no-depsNzdon't install dependencies)z allow-hosts=Hz$pattern(s) that hostnames must match)local-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installeduserNz!install in user site-package '%s') rQrSrXrUrZrcrerhrjrkr`rQcCs2tdtd|_d|_|_d|_|_|_d|_ d|_ d|_ d|_ d|_ |_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ t!j"rt!j#|_$t!j%|_&n d|_$d|_&d|_'d|_(d|_)|_*d|_+i|_,d|_-|j.j/|_/|j.0||j.1ddS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr/)2warningswarnEasyInstallDeprecationWarningrkzip_oklocal_snapshots_ok install_dir script_direxclude_scripts index_url find_linksbuild_directoryargsoptimizerecordrU always_copy multi_versionrcno_deps allow_hostsrootprefix no_reportrjinstall_purelibinstall_platlibinstall_headers install_libinstall_scripts install_data install_baseinstall_platbasesiteENABLE_USER_SITE USER_BASEinstall_userbase USER_SITEinstall_usersite no_find_links package_indexpth_filealways_copy_from site_dirsinstalled_projects_dry_run distributionverbose_set_command_optionsget_option_dictselfr7r7r8initialize_optionssN      zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tj|stj|r|VqdSN)r:r;r<islink).0filenamer7r7r8 sz/easy_install.delete_blockers..)listmap _delete_path)rblockersZextant_blockersr7r7r8delete_blockersszeasy_install.delete_blockerscCsJtd||jrdStj|o.tj| }|r8tntj}||dS)Nz Deleting %s) r infodry_runr:r;isdirrrmtreeunlink)rr;Zis_treeZremoverr7r7r8rs  zeasy_install._delete_pathcCs8djtj}td}d}t|jfittdS)zT Render the Setuptools version and installation details, then exit. {}.{} setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)formatsys version_infor!printlocals SystemExit)verdisttmplr7r7r8_render_versions  zeasy_install._render_versionc Cs|jo |tjd}tdd\}}|j|j|j||dd|d|d||||t tddd |_ t j r|j |j d <|j|j d <n|jrtd ||||d d dd|jdur|j|_|jdurd|_|dd|dd|jr(|jr(|j|_|j|_|ddtttj}t|_ |j!durdd|j!dD}|D]N}t"j#|std|n,t||vrt$|dn|j %t|qn|j&s|'|j(pd|_(|j dd|_)|jt|jfD] }||j)vr|j)*d|q|j+durBdd|j+dD}ndg}|j,durj|j-|j(|j)|d|_,t.|j)tj|_/|j0durt1|j0t2r|j0|_0ng|_0|j3r|j,4|j)tj|js|j,5|j0|dd t1|j6t7sXz0t7|j6|_6d|j6krdks$nt8Wn0t8yV} zt$d!| WYd} ~ n d} ~ 00|j&rp|j9spt:d"|j;st:d#g|_-sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }|qSr7)rMrr7r7r8rC*) search_pathhosts)rxrxz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rjrrsplitrrget_name get_version get_fullnamegetattr config_varsrrrrrkr rm_fix_install_dir_for_user_siteexpand_basedirs expand_dirs_expandrrrqrset_undefined_optionsrrrrr; get_site_dirs all_site_dirsrr:rrappendrccheck_site_dirrt shadow_pathinsertr}r create_indexr# local_indexru isinstancestrrpZscan_egg_linksadd_find_linksrxint ValueErrorrvrrwoutputs) rrrrr>rrW path_itemrrdr7r7r8finalize_optionss                 zeasy_install.finalize_optionscCs\|jr tjsdS||jdur.d}t||j|_|_tj ddd}| |dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedposixunix_user) rkrrcreate_home_pathrr rrr:namerN select_scheme)rmsg scheme_namer7r7r8rjs  z+easy_install._fix_install_dir_for_user_sitecCsX|D]N}t||}|durtjdks.tjdkr:tj|}t||j}t|||qdS)Nrnt)rr:rr;rrrsetattr)rattrsattrvalr7r7r8 _expand_attrsys   zeasy_install._expand_attrscCs|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)rrr~Nrrr7r7r8rszeasy_install.expand_basedirscCsgd}||dS)z+Calls `os.path.expanduser` on install dirs.)rrrrrrNr)rdirsr7r7r8rszeasy_install.expand_dirsc Cs|r|dtj|j|jjkr,t|jz|jD]}|||j q4|j r|j }|j rt |j }t t |D]}|||d||<qrddlm}||j|j |fd|j |Wt|jjnt|jj0dS)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r) file_utilz'writing list of installed files to '%s')announcer WARNrr set_verbosityrwr/r|ryrr~lenrange distutilsrexecute write_filewarn_deprecated_options)rZshow_deprecationspecrroot_lencounterrr7r7r8runs2      zeasy_install.runcCsBz t}Wn ty,tdtj}Yn0tj|j d|S)zReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r:getpid Exceptionrandomrandintrmaxsizer;joinrq)rpidr7r7r8pseudo_tempnames   zeasy_install.pseudo_tempnamecCsdSrr7rr7r7r8rsz$easy_install.warn_deprecated_optionsc CsJt|j}tj|d}tj|sRzt|WnttfyP| Yn0||j v}|sp|j sp| }nb| d}tj|}z*|rt|t|dt|Wnttfy| Yn0|s|j stjdd}t|j|j||r|jdur$t||j |_nd|_|j r@tj|s@d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededeasy-install.pthz .write-testw PYTHONPATHrN)rrqr:r;rr<makedirsOSErrorIOErrorcant_write_to_targetrr{check_pth_processingrropencloseenvirongetr rm_easy_install__no_default_msgrr0)rinstdirrZ is_site_dirZtestfileZ test_exists pythonpathr7r7r8rs:          zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s z This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. cCsP|jtd|jf}tj|js6|d|j7}n|d|j7}t |dS)NrJ) _easy_install__cant_write_msgrexc_inforqr:r;r<_easy_install__not_exists_id_easy_install__access_msgr)rrr7r7r8rs z!easy_install.cant_write_to_targetc Cs(|j}td||d}|d}tj|}tdd}z6|rNt|tj |}tj |ddt |d}Wn t t fy|Yn|0z6||jfit|d }tj}tjd krtj|\}} tj|d } | d kotj| } | r| }d dlm} | |dddgd tj|rtd|W|rZ|tj|rrt|tj|rt|dSW|r|tj|rt|tj|rt|n@|r|tj|rt|tj|rt|0|js$td|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rJT)exist_okrNr pythonw.exe python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rqr rrr:r;r<rPrdirnamerrrrrwriterrrr executablerrrlowerdistutils.spawnr*r{rm) rrrZok_fileZ ok_existsrr,r]r.basenameZaltZuse_altr*r7r7r8rsv               z!easy_install.check_pth_processingc CsV|jsH|drH|dD],}|d|r.q||||d|q||dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rsmetadata_isdirmetadata_listdirinstall_script get_metadatainstall_wrapper_scripts)rr script_namer7r7r8install_egg_scriptsSs z easy_install.install_egg_scriptscCsTtj|rDt|D]*\}}}|D]}|jtj||q$qn |j|dSr)r:r;rwalkrrr)rr;baserfilesrr7r7r8 add_outputas  zeasy_install.add_outputcCs|jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rcrrrr7r7r8 not_editableis zeasy_install.not_editablecCs<|js dStjtj|j|jr8td|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)rcr:r;r<rrvkeyrr>r7r7r8check_editableqs zeasy_install.check_editablec csJtjdd}z"t|VWtj|o,t|ntj|oBt|0dS)Nz easy_install-)r)tempfilemkdtemprr:r;r<r)rtmpdirr7r7r8_tmpdir{s  zeasy_install._tmpdirFc CsX|8}t|tst|rV|||j||}|d|||dWdStj |r|||d|||dWdSt |}| ||j |||j|j|j |j}|durd|}|jr|d7}t|nN|jtkr||||d|WdS|||j||WdSWdn1sJ0YdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)rErr$rr?rdownload install_itemr:r;r<rrAZfetch_distributionrUrcrzrr precedencer+process_distributionlocation)rrdepsrDdlrrr7r7r8r/s0            zeasy_install.easy_installcCs |p|j}|ptj||k}|p,|d }|pT|jduoTtjt|t|jk}|r|s|j|jD]}|j |krjqqjd}t dtj ||r| |||}|D]}||||qn ||g}|||d|d|dur|D]}||vr|SqdS)N.eggTz Processing %srrF)rzr:r;r,endswithrrr project_namerKr rr1 install_eggsrJegg_distribution)rrrGrDrLZinstall_neededrdistsr7r7r8rHs2     zeasy_install.install_itemcCs<t|}tD]*}d|}t||dur t||||q dS)z=Sets the install directories by applying the install schemes.install_N)r r rr)rrschemer@attrnamer7r7r8rs zeasy_install.select_schemec Gs|||j|||j|jvr2|j||j|||||j|j<t |j ||g|R| dr|j s|j |d|s|jsdS|dur|j|jkrtd|dS|dus||vr|}tt|}t d|ztg|g|j|j}WnftyB}ztt||WYd}~nrz-easy_install.write_script..zInstalling %s script to %sNri)rr rrrr:r;rr=r current_umaskr r<rrr-chmod)rr8rimodertargetmaskr]r7rr8rn;s   (zeasy_install.write_scriptc CsR|j|j|jd}z||dd}Wnty<Yn0|||gS|}tj|rt|dstt |||j ntj |rtj |}| |r|jr|dur||||}tj|d}tj|s$ttj|dd}|stdtj |t|dkrtdtj ||d }|jrBt|||gS|||SdS) N)rN.exez.whl.pyzsetup.pyrz"Couldn't find a setup script in %sr!zMultiple setup scripts in %sr) install_egg install_exe install_wheelr/KeyErrorr:r;isfilerOrunpack_progressrabspath startswithrvrjrr<rrrrcr rreport_editablebuild_and_install) rrrfrDZ installer_mapZ install_distrg setup_scriptZsetupsr7r7r8rQOsT       zeasy_install.install_eggscCs>tj|r"t|tj|d}ntt|}tj ||dS)NEGG-INFO)metadata) r:r;rr&rr' zipimport zipimporterr% from_filename)regg_pathrr7r7r8rRs   zeasy_install.egg_distributionc Cstj|jtj|}tj|}|js2t|||}t ||sxtj |rrtj |srt j ||jdn"tj|r|tj|fd|zd}tj |r||rtjd}}n tjd}}nL||r|||jd}}n*d}||r tjd}}n tjd}}||||f|dtj|tj|ft||d Wn"tyvt|dd Yn0||||S) Nr Removing FZMovingZCopyingZ ExtractingTz %s to %sfix_zipimporter_caches)r:r;rrqr1rrr rRr.rrr remove_treer<rrrrdrecopytreerbmkpathunpack_and_compilecopy2r,update_dist_cachesr r=)rrrD destinationrZnew_dist_is_zippedr]rTr7r7r8rs^                zeasy_install.install_eggc sPt|}|durtd|td|dd|ddtd}tj||d}||_ |d}tj|d}tj|d }t |t |||_ | ||tj|st|d } | d |dD].\} } | d kr| d | dd| fq| tj|d|fddt|Dtj|||j|jd|||S)Nz(%s is not a valid distutils Windows .exerrrj)rPrjplatformrNz.tmprPKG-INFOrzMetadata-Version: 1.0 target_versionz%s: %s _-r2csg|]}tj|dqS)r)r:r;r)rrwrrr7r8rsz,easy_install.install_exe..)rr)r1rr%rrr:r;regg_namerKr r& _provider exe_to_eggr<rr-itemsrNtitlerrrkrmr make_zipfilerrr) rrfrDcfgrregg_tmpZ _egg_infoZpkg_infr]kvr7rr8rsB       zeasy_install.install_exec s8t|ggifdd}t||g}D]n}|dr<|d}|d}t|dd|d<tjj g|R} || |t ||q<| t tj dt|dD]Z} t| rtj d| d } tj| st| d } | d t| d | qd S) z;Extract a bdist_wininst to the directories an egg would usecs|}D]\}}||r ||t|d}|d}tjjg|R}|}|dsl|drt |d|d<dtj |dd< |n4|dr|dkrdtj |dd< ||Sq |d st d |dS) N/.pyd.dllr!rrSCRIPTS/r&zWARNING: can't process %s)r/rrrr:r;rrOr strip_modulesplitextrr rm)srcrhrEoldnewpartsrMr native_libsprefixes to_compile top_levelr7r8processs$        z(easy_install.exe_to_egg..processrrrrr)rrz.txtrrJN)r2rr/rOrrrr:r;rrZ write_stub byte_compileZwrite_safety_flagZ analyze_eggrr<rr-r) rrfrrZstubsresrresourceZpyfilertxtr]r7rr8rs8          zeasy_install.exe_to_eggc Cst|}|sJtj|j|}tj|}|jsBt |tj |rltj |slt j ||jdn"tj|r|tj|fd|z:||j|fdtj|tj|fWt|ddnt|dd0||||S)NrrzInstalling %s to %sFr)r is_compatibler:r;rrqrrrr rrr rr<rrZinstall_as_eggr1r,rr=rR)r wheel_pathrDwheelrr7r7r8r$s4       zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher z Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Installedc Cs^d}|jr>|js>|d|j7}|jtttjvr>|d|j7}|j }|j }|j }d}|t S)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srJr) r{r_easy_install__mv_warningrqrrrr;_easy_install__id_warningrKrPrjr) rreqrwhatrZegglocrrjextrasr7r7r8rZRs z easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tj|}tj}d|jtS)NrJ)r:r;r,rr._easy_install__editable_msgr)rrrr,pythonr7r7r8rks zeasy_install.report_editablec Cstjdttjdtt|}|jdkrNd|jd}|dd|n|jdkrd|dd|jrv|dd t d |t |ddd |zt ||Wn:ty}z"td |jdf|WYd}~n d}~00dS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrr!rrz-qz-nz Running %s %s zSetup script exited with %s)rmodules setdefaultrrrrrrr rrrrrrrw)rrrgrwrr7r7r8rps*    zeasy_install.run_setupc Csddg}tjdtj|d}z|tj|||||||t|g}g}|D]&}||D]}|| |j |qhq\|s|j st d||Wt|t |jSt|t |j0dS)Nrz --dist-dirz egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))rBrCr:r;r,_set_fetcher_optionsrrr#rrKrr rmrrr) rrrgrwdist_dirZall_eggseggsr@rr7r7r8rs2      zeasy_install.build_and_installc Csh|jd}d}i}|D]\}}||vr2q |d||<q t|d}tj|d}t ||dS)a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r/)rurrtrxr}r!)r/z setup.cfgN) rrcopyrdictr:r;rrZ edit_config) rr;Zei_optsZfetch_directivesZ fetch_optionsr@rsettingsZ cfg_filenamer7r7r8rs  z!easy_install._set_fetcher_optionscCsL|jdurdS|j|jD]J}|js2|j|jkr2qtd||j||j|jvr|j|jq|js|j|jjvrtd|n2td||j ||j|jvr|j |j|j rdS|j |jdkrdSt j|jd}t j|rt |t|d(}||j|jdWdn1s>0YdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filersetuptools.pthwtrJ)rr@r{rKr rrYrpathsrXrrsaver:r;rrqrrrr- make_relative)rrrWrr]r7r7r8rWs:           zeasy_install.update_pthcCstd|||S)NzUnpacking %s to %s)r debug)rrrhr7r7r8rszeasy_install.unpack_progresscsdggfdd}t|||js`D]&}t|tjdBd@}t||q8dS)NcsZ|dr |ds |n|ds4|dr>|||j rV|pXdS)Nr EGG-INFO/rz.so)rOrrrr)rrhrZto_chmodrr7r8pfs    z+easy_install.unpack_and_compile..pfimi)rrrr:statST_MODErz)rrrrr]r{r7rr8rs  zeasy_install.unpack_and_compilec Csvtjr dSddlm}zLt|jd||dd|jd|jrT|||jd|jdWt|jnt|j0dS)Nr)rr!)rxforcer) rdont_write_bytecodedistutils.utilrr rrrrx)rrrr7r7r8rs zeasy_install.byte_compilea bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. cCsb|js dSttjd}|jD]8\}}||r$tj|s$| d|t |dq$dS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) rkrr:r;rrrrr debug_printr)rhomerr;r7r7r8r)szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/binrrz$base/Lib/site-packagesz $base/ScriptscGs|dj}|jrd|}|j|d<|jtj|j}| D]$\}}t ||ddur>t |||q>ddl m }|D]B}t ||}|durt|||}tjdkrtj|}t |||qtdS)Nrr;r)rr)get_finalized_commandrrrr rr:rDEFAULT_SCHEMErrrrrr;r)rrrrUrrrr7r7r8r?s        zeasy_install._expand)T)F)F)T)N)rwr7)r)M__name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsrr user_optionsboolean_options negative_optrrrrr staticmethodrrrrrrr rrrrKrLlstripr"r$r%rrr9r=r?rA contextlibcontextmanagerrEr/rHrrJrbrjr7r5rprnrQrRrrrrrrrZrrrrrrWrrrrMrrrr rrr7r7r7r8r/ns5     - ;   ! $ )    3 6.5   )  r/cCs tjddtj}td|S)Nrr)r:rrrpathsepfilter)rr7r7r8 _pythonpathVsrc sgttjg}tjtjkr0|tj|D]}|s>q4tjdvr`tj |ddnVtj dkrtj |ddj tj dtj |ddgn|tj |ddgtjdkrq4d |vrq4tj d }|sq4tj |d d d j tj d}|q4tdtdf}fdd|DtjrBtjtttWdn1sr0YtttS)z& Return a list of 'site' dirs )Zos2emxZriscosLibz site-packagesrlibz python{}.{}z site-pythondarwinzPython.frameworkHOMELibraryPythonrpurelibplatlibc3s|]}|vr|VqdSrr7rsitedirsr7r8rrz get_site_dirs..N)extendrrrrrrr:r;rseprrrrrrrrrsuppressAttributeErrorgetsitepackagesrrr)rrrZhome_spZ lib_pathsr7rr8r[s^             .rccsi}|D]}t|}||vrqd||<tj|s4qt|}||fV|D]}|ds\qL|dvrfqLttj||}tt |}| |D]L}| drqt| }||vrqd||<tj|sq|t|fVqqLqdS)zBYield sys.path directories that might contain "old-style" packagesr!r&)rrimportN) rr:r;rrcrOrrrrrrrstrip)inputsseenr,r<rr]linesliner7r7r8 expand_pathss8        rc Cs`t|d}zDt|}|dur.W|dS|d|d|d}|dkr\W|dS||dtd|d\}}}|dvrW|dS||d|d d d }t |}z<||} | d d d } | t } |t| Wn"tjyYW|dS0|dr6|dsDW|dS|W|S|0dS)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None rbN  zegg path translations for a given .exe file))zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)rzEGG-INFO/scripts/)zDATA/lib/site-packagesrrrrrr!z .egg-inforNrr&z -nspkg.pth)ZPURELIBZPLATLIB\r z%s/%s/rcSsg|]\}}||fqSr7)r/)rrYyr7r7r8rrz$get_exe_prefixes..)rZipFileinfolistrrrrOrrupperrrvrrMrNrrrsortreverse)Z exe_filenamerrRrrrripthr7r7r8r2s2       r2c@sReZdZdZdZdddZddZdd Zed d Z d d Z ddZ ddZ dS)r0z)A .pth file with Distribution paths in itFr7cCsl||_ttt||_ttj|j|_| t |gddt |j D]}tt|jt|dqLdS)NT)rrrrrr:r;r,basedir_loadr#__init__rrrXr")rrrr;r7r7r8r3"szPthDistributions.__init__cCsg|_d}t|j}tj|jrt|jd}|D]}| drHd}q4| }|j || r4| drtq4t tj|j|}|jd<tj|r||vr|jd|_q4d||<q4||jr|sd|_|jr|jd s|jqdS)NFrtr T#rr!)rrfromkeysrr:r;rrrrr rrMrrr1r<popdirtyr)rZ saw_importr r]rr;r7r7r8r2+s4       zPthDistributions._loadcCs|js dStt|j|j}|rtd|j||}d |d}t j |jr`t |jt|jd}||Wdq1s0Yn(t j |jrtd|jt |jd|_dS)z$Write changed .pth file back to diskNz Saving %srJrzDeleting empty %sF)r8rrrrr rr _wrap_linesrr:r;rrrr-r<)rZ rel_pathsr datar]r7r7r8rJs  * zPthDistributions.savecCs|Srr7)r r7r7r8r9`szPthDistributions._wrap_linescCsN|j|jvo$|j|jvp$|jtk}|r>|j|jd|_t||dS)z"Add `dist` to the distribution mapTN) rKrrr:getcwdrr8r#rX)rrnew_pathr7r7r8rXds   zPthDistributions.addcCs2|j|jvr"|j|jd|_qt||dS)z'Remove `dist` from the distribution mapTN)rKrrYr8r#rar7r7r8rYrs zPthDistributions.removecCstjt|\}}t|j}|g}tjdkr2dp6tj}t||kr||jkrl|tj | | |Stj|\}}||q8|S)Nr) r:r;rrrr1altseprrcurdirr/r)rr;npathlastZbaselenrrr7r7r8rys      zPthDistributions.make_relativeN)r7) rrrrr8r3r2rrr9rXrYrr7r7r7r8r0s  r0c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs$|jV|D] }|Vq |jVdSr)preludepostlude)clsr rr7r7r8r9sz#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) z import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)rrr classmethodr9rPrBrCr7r7r7r8rAs rAZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtSttjS)z_ Return a regular expression based on first_line_re suitable for matching strings. )rrpatternrrecompilervr7r7r7r8_first_line_res rJcCs\|tjtjfvr.tjdkr.t|tj||St\}}}|d|dd||ffdS)Nrrr!z %s %s) r:rrYrrzrS_IWRITErr#)funcargexcetZevrr7r7r8 auto_chmods  rPcCs.t|}t|tj|r"t|nt|dS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)r_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data) dist_pathrnormalized_pathr7r7r8rs <  rcCsPg}t|}|D]:}t|}||r|||dtjdfvr||q|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. r!r)rrrr:rr)rVcacheresult prefix_lenpnpr7r7r8"_collect_zipimporter_cache_entries s   r\cCs@t||D]0}||}||=|o(|||}|dur |||<q dS)a Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r\)rVrWupdaterrZ old_entryZ new_entryr7r7r8_update_zipimporter_caches  r_cCst||dSr)r_)rVrWr7r7r8rQ>srQcCsdd}t|tj|ddS)NcSs |dSr)clearr;r^r7r7r82clear_and_remove_cached_zip_archive_directory_dataCszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_datar]r_r_zip_directory_cache)rVrbr7r7r8rTBs rTZ__pypy__cCsdd}t|tj|ddS)NcSs&|t||tj||Sr)r`rrupdatererar7r7r8)replace_cached_zip_archive_directory_dataYs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarcrd)rVrgr7r7r8rSXs  rSc Cs2zt||dWnttfy(YdS0dSdS)z%Is this string a valid Python script?execFTN)rI SyntaxError TypeError)rOrr7r7r8 is_pythonks rlc Cs`zrr.rr)rD_defaultr7r7r8_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dur0|S||S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rrfrom_environment from_string)rDparamr7r7r8 from_params  zCommandSpec.from_paramcCs||gSr)r~r{r7r7r8rszCommandSpec.from_environmentcCstj|fi|j}||S)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )shlexr split_args)rDstringrr7r7r8rszCommandSpec.from_stringcCs8t|||_t|}t|s4dg|jdd<dS)Nz-xr)rr_extract_optionsoptionsrsrtrI)rrrcmdliner7r7r8install_optionss zCommandSpec.install_optionscCs:|dd}t|}|r.|dp0dnd}|S)zH Extract any options from the first line of the script. rJrr!r)rwrJmatchgrouprM)Z orig_scriptfirstrrr7r7r8rs zCommandSpec._extract_optionscCs||t|jSr)_renderrrrr7r7r8 as_headerszCommandSpec.as_headercCs6d}|D](}||r||r|ddSq|S)Nz"'r!r)rrO)itemZ_QUOTESqr7r7r8 _strip_quotess zCommandSpec._strip_quotescCs tdd|D}d|dS)Ncss|]}t|VqdSr)rzrrM)rrr7r7r8rsz&CommandSpec._render..rnrJrr)rrr7r7r8rs zCommandSpec._renderN)rrrrrrrrErlr~rrrrrrrrrr7r7r7r8rzs*       rzc@seZdZeddZdS)WindowsCommandSpecFrN)rrrrrr7r7r7r8rsrc@seZdZdZedZeZ e dddZ e dddZ e dd d Z ed d Ze d dZe ddZe ddZe dddZdS)rkz` Encapsulates behavior around writing entry point scripts for console and gui apps. aJ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r import re import sys # for compatibility with easy_install; see #2198 __requires__ = %(spec)r try: from importlib.metadata import distribution except ImportError: try: from importlib_metadata import distribution except ImportError: from pkg_resources import load_entry_point def importlib_load_entry_point(spec, group, name): dist_name, _, _ = spec.partition('==') matches = ( entry_point for entry_point in distribution(dist_name).entry_points if entry_point.group == group and entry_point.name == name ) return next(matches).load() globals().setdefault('load_entry_point', importlib_load_entry_point) if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)()) NFcCs6tdt|rtnt}|d||}|||S)Nz Use get_argsr)rlrmrnWindowsScriptWriterrkrlget_script_headerrm)rDrr.wininstwriterheaderr7r7r8get_script_args(s zScriptWriter.get_script_argscCs$tjdtdd|rd}|||S)NzUse get_headerr) stacklevelr))rlrmrnrq)rDrrr.rr7r7r8r0s zScriptWriter.get_script_headerc cs|dur|}t|}dD]Z}|d}||D]>\}}|||jt}|||||} | D] } | Vqlq:q dS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. NconsoleguiZ_scripts) rqrr] get_entry_mapr_ensure_safe_nametemplater_get_script_args) rDrrrtype_rreprrrwrr7r7r8rm9s   zScriptWriter.get_argscCstd|}|rtddS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rHsearchr)rZ has_path_sepr7r7r8rKs zScriptWriter._ensure_safe_namecCs tdt|rtS|SNzUse best)rlrmrnrrl)rDZ force_windowsr7r7r8 get_writerTs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tS|SdS)zD Select the best ScriptWriter for this environment. win32javarN)rrr:r_namerrlr{r7r7r8rlZszScriptWriter.bestccs|||fVdSrr7)rDrrrrrr7r7r8rdszScriptWriter._get_script_argsrcCs"|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrlrrr)rDrrr.cmdr7r7r8rqis zScriptWriter.get_header)NF)NF)N)rN)rrrrrKrLrrrzrrErrrmrrrrlrrqr7r7r7r8rks&#       rkc@sLeZdZeZeddZeddZeddZeddZ e d d Z d S) rcCstdt|Sr)rlrmrnrlr{r7r7r8rts zWindowsScriptWriter.get_writercCs"tt|d}tjdd}||S)zC Select the best ScriptWriter suitable for Windows )r.ZnaturalZSETUPTOOLS_LAUNCHERr.)rWindowsExecutableLauncherWriterr:rr)rDZ writer_lookuplauncherr7r7r8rlzs zWindowsScriptWriter.bestc #stddd|}|tjddvrFdjfit}t|t gd}| || ||}fdd |D}|||d |fVd S) z For Windows, add a .py extension.pyarvrPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)rr -script.py.pyc.pyorvr~csg|] }|qSr7r7rxrr7r8rrz8WindowsScriptWriter._get_script_args..rwN) rr:rr/rrrrlrm UserWarningrY_adjust_header) rDrrrrrextrrrr7rr8rs   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tt|tj}|j||d}||rJ|S|S)z Make sure 'pythonw' is used for gui and 'python' is used for console (regardless of what sys.executable is). r(r)r)rrepl)rHrIescape IGNORECASEsub _use_header)rDrZ orig_headerrGrZ pattern_ob new_headerr7r7r8rs z"WindowsScriptWriter._adjust_headercCs$|ddd}tjdkp"t|S)z Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. rr"r)rMrrr)rZ clean_headerr7r7r8rs zWindowsScriptWriter._use_headerN) rrrrrrErrlrrrrr7r7r7r8rqs    rc@seZdZeddZdS)rc #s|dkrd}d}dg}nd}d}gd}|||}fdd|D} |||d | fVd t|d fVtsd } | td fVd S)zG For Windows, add a .py extension and an .exe launcher rz -script.pywrvclir)rrrcsg|] }|qSr7r7rxrr7r8rrzDWindowsExecutableLauncherWriter._get_script_args..rwr~r^z .exe.manifestN)rget_win_launcherr9load_launcher_manifest) rDrrrrrZ launcher_typerrhdrrZm_namer7rr8rs   z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrErr7r7r7r8rsrcCsJd|}tr4tdkr&|dd}q@|dd}n |dd}td|S)z Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exez win-arm64.z-arm64.z-64.z-32.r)r9rrNr)typeZ launcher_fnr7r7r8rs  rcCsttd}|dtS)Nzlauncher manifest.xmlru) pkg_resourcesrrrvvars)rmanifestr7r7r8rs rFcCst|||Sr)rdr)r; ignore_errorsonerrorr7r7r8rsrcCstd}t||S)N)r:umask)tmpr7r7r8rys  ryc@seZdZdZdS)rnzF Warning for EasyInstall deprecations, bypassing suppression. N)rrrrr7r7r7r8rnsrn)N)rh)|rrrrrrdistutils.errorsrrrr distutils.command.installr r rr r Zdistutils.command.build_scriptsrr0rrr:rrdrBrrHrr rKrlrr5rrsrr r sysconfigrrrrrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrrrrr r!r"r#r$r%r&r'r(r)r*r+filterwarnings PEP440Warning__all__r9r.rFrIrPr/rrrr1r2r0rArrrJrPrr\r_rQrTbuiltin_module_namesrSrlrqrurorzrx ImportErrorrrzr~Zsys_executablerrkrrrrrrrryrnr7r7r7r8s          DqF.)%l  R    TtA PK!wrr)command/__pycache__/setopt.cpython-39.pycnu[a (Re@sddlmZddlmZddlmZddlZddlZddlZddlm Z gdZ ddd Z dd d Z Gd dde Z Gddde ZdS)) convert_path)log)DistutilsOptionErrorN)Command) config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjtjtjdS|dkrZtjdkrBdpDd}tjtd |St d |d S) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)kinddotr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/setopt.pyr srFc CsFtd|t}dd|_||g|D]\}}|dur\td||||q2| |s~td||| ||D]p\}}|durtd|||| ||| |std||||qtd ||||| |||qq2td ||sBt|d }||Wdn1s80YdS) aYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. zReading configuration from %scSs|SNr)xrrr*zedit_config..NzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sw)rdebug configparserRawConfigParser optionxformreaditemsinforemove_section has_section add_section remove_optionoptionssetopenwrite) filenamesettingsdry_runoptssectionr-optionvaluefrrrr s@           rc@s0eZdZdZgdZddgZddZddZd S) rzr1lenr)r@ filenamesrrrfinalize_optionsas   zoption_base.finalize_optionsN)__name__ __module__ __qualname____doc__ user_optionsboolean_optionsrArFrrrrrLs  rc@sFeZdZdZdZgdejZejdgZddZddZ d d Z d S) r z#Save command-line options to a filez1set an option in setup.cfg or another config file))zcommand=czcommand to set an option for)zoption=oz option to set)z set-value=szvalue of the option)removerzremove (unset) the valuerPcCs&t|d|_d|_d|_d|_dSr)rrAcommandr6 set_valuerPr?rrrrAs  zsetopt.initialize_optionscCsBt||jdus|jdur&td|jdur>|js>tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rrFrRr6rrSrPr?rrrrFs  zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr1rRr6replacerSr3r?rrrruns z setopt.runN) rGrHrIrJ descriptionrrKrLrArFrWrrrrr ss r )r )F)distutils.utilrrrdistutils.errorsrrr# setuptoolsr__all__rrrr rrrrs      ,'PK!vL-command/__pycache__/py36compat.cpython-39.pycnu[a (ReR@sXddlZddlmZddlmZddlmZGdddZeejdrTGdddZdS) N)glob) convert_path)sdistc@s\eZdZdZddZeddZddZdd Zd d Z d d Z ddZ ddZ ddZ dS)sdist_add_defaultsz Mix-in providing forward-compatibility for functionality as found in distutils on Python 3.7. Do not edit the code in this class except to update functionality as implemented in distutils. Instead, override in the subclass. cCs<|||||||dS)a9Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all files pointed by package_data (build_py) - all files defined in data_files. - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything else is optional. N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/py36compat.py add_defaultsszsdist_add_defaults.add_defaultscCs:tj|sdStj|}tj|\}}|t|vS)z Case-sensitive path existence check >>> sdist_add_defaults._cs_path_exists(__file__) True >>> sdist_add_defaults._cs_path_exists(__file__.upper()) False F)ospathexistsabspathsplitlistdir)fspathr directoryfilenamerrr_cs_path_exists&s  z"sdist_add_defaults._cs_path_existscCs|j|jjg}|D]~}t|trj|}d}|D]"}||r,d}|j|qPq,|s|dd |q||r|j|q|d|qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found) ZREADMES distribution script_name isinstancetuplerfilelistappendwarnjoin)r Z standardsfnZaltsZgot_itrrrr7s"    z*sdist_add_defaults._add_defaults_standardscCs4ddg}|D]"}ttjjt|}|j|q dS)Nz test/test*.pyz setup.cfg)filterrrisfilerrextend)r optionalpatternfilesrrrrLsz)sdist_add_defaults._add_defaults_optionalcCs\|d}|jr$|j||jD],\}}}}|D]}|jtj ||q:q*dS)Nbuild_py) get_finalized_commandrhas_pure_modulesrr&get_source_files data_filesr rrr")r r*pkgsrc_dir build_dir filenamesrrrrrRs   z'sdist_add_defaults._add_defaults_pythoncCsz|jrv|jjD]b}t|trBt|}tj|rt|j |q|\}}|D]$}t|}tj|rN|j |qNqdS)N) rhas_data_filesr.rstrrrrr%rr )r itemdirnamer2frrrr bs     z+sdist_add_defaults._add_defaults_data_filescCs(|jr$|d}|j|dS)N build_ext)rhas_ext_modulesr+rr&r-)r r8rrrr ss  z$sdist_add_defaults._add_defaults_extcCs(|jr$|d}|j|dS)N build_clib)rhas_c_librariesr+rr&r-)r r:rrrr xs  z'sdist_add_defaults._add_defaults_c_libscCs(|jr$|d}|j|dS)N build_scripts)r has_scriptsr+rr&r-)r r<rrrr }s  z(sdist_add_defaults._add_defaults_scriptsN)__name__ __module__ __qualname____doc__r staticmethodrrrrr r r r rrrrrs rrc@s eZdZdS)rN)r>r?r@rrrrrs)rrdistutils.utilrdistutils.commandrrhasattrrrrrs    | PK!Z8>33,command/__pycache__/bdist_egg.cpython-39.pycnu[a (Re@@sdZddlmZmZddlmZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZmZddlmZddlmZdd lmZmZd d Zd d ZddZddZGdddeZedZ ddZ!ddZ"ddZ#dddZ$ddZ%d d!Z&d"d#Z'gd$Z(d)d'd(Z)dS)*z6setuptools.command.bdist_egg Build .egg distributions) remove_treemkpath)log)CodeTypeN)get_build_platform Distributionensure_directory)Library)Command)get_pathget_python_versioncCstdS)Npurelib)r rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/bdist_egg.py _get_purelibsrcCs2d|vrtj|d}|dr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrr strip_modules   rccs6t|D]&\}}}|||||fVq dS)zbDo os.walk in a reproducible way, independent of indeterministic filesystem readdir order N)rwalksort)dirbasedirsfilesrrr sorted_walk!srcCsJtd}t|d}|||Wdn1s<0YdS)Na def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, importlib.util __file__ = pkg_resources.resource_filename(__name__, %r) __loader__ = None; del __bootstrap__, __loader__ spec = importlib.util.spec_from_file_location(__name__,__file__) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) __bootstrap__() w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr write_stub+s r)c@seZdZdZddddefdddd gZgd Zd d Zd dZddZ ddZ ddZ ddZ ddZ ddZddZddZdd Zd!S)" bdist_eggzcreate an "egg" distribution)z bdist-dir=bz1temporary directory for creating the distributionz plat-name=pz;platform name to embed in generated filenames (default: %s))exclude-source-filesNz+remove all .py files from the generated egg) keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z dist-dir=dz-directory to put final built distributions in) skip-buildNz2skip rebuilding everything (for testing/debugging))r.r1r-cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr) bdist_dir plat_name keep_tempdist_dir skip_build egg_outputexclude_source_filesselfrrrinitialize_optionsRszbdist_egg.initialize_optionscCs|d}|_|j|_|jdur>|dj}tj|d|_|jdurPt |_| dd|j durt dd|j |jt|jo|j }tj|j|d|_ dS)Negg_infobdistegg)r5r5z.egg)get_finalized_commandei_cmdr<r2 bdist_baserrjoinr3rset_undefined_optionsr7regg_nameZ egg_versionr distributionhas_ext_modulesr5)r:r@rAbasenamerrrfinalize_options[s      zbdist_egg.finalize_optionscCs|j|d_tjtjt}|jj g}|j_ |D]}t |t rt |dkrtj |drtj|d}tj|}||ks||tjr|t |dd|df}|jj |q:z*td|j|jddddW||j_ n ||j_ 0dS)Ninstallrzinstalling package data to %s install_data)forceroot)r2r? install_librrnormcaserealpathrrE data_files isinstancetuplelenisabs startswithsepappendrinfo call_command)r: site_packagesolditemrQ normalizedrrrdo_install_datass"  zbdist_egg.do_install_datacCs|jgS)N)r7r9rrr get_outputsszbdist_egg.get_outputscKsTtD]}|||jq|d|j|d|j|j|fi|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr6dry_run)INSTALL_DIRECTORY_ATTRS setdefaultr2r6rbreinitialize_command run_command)r:Zcmdnamekwdirnamecmdrrrr[s zbdist_egg.call_commandcCs|dtd|j|d}|j}d|_|jrH|jsH|d|j ddd}||_| \}}g|_ g}t |D]|\}}t j|\} } t j|jt| d} |j | td ||jstt j|| || |t jd ||<qz|r|||jjr||j} t j| d } || |jjrlt j| d }td ||j d|dd|| t j| d}|rtd||jst|t|d}| d|| d|!n,t j"|rtd||jst #|t$t j| d |%t j&t j|j'dr.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [%s] to [%s])rrZwalk_eggr2rrrBrdebugrrematchpardirgroupremoveOSErrorrename) r:rrrrrZpath_oldpatternmZpath_newrrrrs0       zbdist_egg.zap_pyfilescCs2t|jdd}|dur|Stdt|j|jS)Nrz4zip_safe flag not set; analyzing archive contents...)rrErr analyze_eggr2rz)r:saferrrrs  zbdist_egg.zip_safecCsdS)Nr rr9rrrr szbdist_egg.gen_headercCshtj|j}tj|d}|jjjD]<}||r&tj||t |d}t || ||q&dS)z*Copy metadata (egg info) to the target_dirN) rrnormpathr<rBr@filelistrrWrUr copy_file)r: target_dirZ norm_egg_infoprefixrtargetrrrr~s zbdist_egg.copy_metadata_toc Csg}g}|jdi}t|jD]f\}}}|D].}tj|dtvr*||||q*|D]"}|||d|tj||<q^q|j r| d}|j D]Z} t | trq|| j} || }tj|dstjtj|j|r||q||fS)zAGet a list of relative paths to C extensions in the output distrorrKrm build_extzdl-)r2rrrrlowerNATIVE_EXTENSIONSrYrBrErFr? extensionsrSr Zget_ext_fullnamerZget_ext_filenamerGrWr) r:rrpathsrrrrZ build_cmdrfullnamerrrrys0        zbdist_egg.get_ext_outputsN)__name__ __module__ __qualname__ descriptionr user_optionsboolean_optionsr;rHr`rar[rrrrr~ryrrrrr*;s,  Q r*z.dll .so .dylib .pydccsHt|}t|\}}}d|vr(|d|||fV|D] }|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrnN)rnextr)egg_dirwalkerrrrZbdfrrrr:s  rc CstD](\}}tjtj|d|r|Sqtst||krzt|q|durt||krt|d}| d| qdS)Nrrrs) rrrrrBrboolrr$r%r)rrrrr(rrrrWs    rzzip-safez not-zip-safe)TFc Cstj||}|dd|vr"dS|t|ddtjd}||rJdpLdtj|d}tjdkrpd }nd }t |d }| |t |} | d} tt| } d D]} | | vrtd || d} qd| vrdD]} | | vrtd|| d} q| S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrKrrr) rb)__file____path__z%s: module references %sFinspect) getsource getabsfile getsourcefileZgetfilegetsourcelines findsource getcomments getframeinfogetinnerframesgetouterframesstacktracez"%s: module MAY be using inspect.%s)rrrBrUr|rXrsys version_infor$readmarshalloadrdictfromkeys iter_symbolsrr) rrrrzrpkgrskipr(codersymbolsbadrrrrjs0     rccsR|jD] }|Vq|jD]4}t|tr.|Vqt|trt|D] }|Vq@qdS)zBYield names and strings used by `code` and its nested code objectsN)co_names co_constsrSstrrr)rrconstrrrrs     rcCs2tjdstjdkrdStdtddS)NjavacliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py)rplatformrWrrrrrrrs r)rOrqrL install_baseTr c sddl}ttj|dtd|fdd}|rB|jn|j}s|j |||d} t D]\} } } || | | qd| n t D]\} } } |d| | q|S)aqCreate a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. rNrvz#creating '%s' and adding '%s' to itcs`|D]V}tjtj||}tj|r|tdd}sN|||td|qdS)NrKz adding '%s') rrrrBrrUr%rr)zrhnamesrrr,base_dirrbrrvisits  zmake_zipfile..visit) compression) zipfilerrrrhrrZ ZIP_DEFLATED ZIP_STOREDZipFilerr) zip_filenamerrtrbcompressrurrrrrhrrrrrrs  r)rrTr )*__doc__distutils.dir_utilrr distutilsrtypesrrrrr!r pkg_resourcesrrrZsetuptools.extensionr setuptoolsr sysconfigr r rrrr)r*rrsplitrrrrrrrrrcrrrrrs@     } "  PK!Pnss s (command/__pycache__/alias.cpython-39.pycnu[a (ReM @sDddlmZddlmZmZmZddZGdddeZddZd S) )DistutilsOptionError) edit_config option_base config_filecCs8dD]}||vrt|Sq||gkr4t|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/alias.pyshquotes rc@sHeZdZdZdZdZdgejZejdgZddZ dd Z d d Z d S) aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasrcCst|d|_d|_dS)N)rinitialize_optionsargsrselfrrrrs zalias.initialize_optionscCs*t||jr&t|jdkr&tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrrrrrrr!s  zalias.finalize_optionscCs|jd}|js@tdtd|D]}tdt||q&dSt|jdkr|j\}|jrbd}q||vr~tdt||dStd|dSn$|jd}dtt |jdd}t |j d||ii|j dS) NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr ) distributionget_option_dictrprint format_aliasrrjoinmaprrfilenamedry_run)rrrcommandrrrrun)s&   z alias.runN) __name__ __module__ __qualname____doc__ descriptionZcommand_consumes_argumentsr user_optionsboolean_optionsrrr&rrrrrs rcCsZ||\}}|tdkrd}n,|tdkr0d}n|tdkrBd}nd|}||d|S) Nglobalz--global-config userz--user-config localz --filename=%rr)r)namersourcer%rrrr Ds    r N) distutils.errorsrZsetuptools.command.setoptrrrrrr rrrrs  4PK!f*,command/__pycache__/dist_info.cpython-39.pycnu[a (Re@s8dZddlZddlmZddlmZGdddeZdS)zD Create a dist_info directory As defined in the wheel specification N)Command)logc@s.eZdZdZdgZddZddZddZd S) dist_infozcreate a .dist-info directory)z egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)cCs d|_dSN)egg_baseselfr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdSrr rr r r finalize_optionsszdist_info.finalize_optionscCsn|d}|j|_|||jdtd d}tdt j ||d}| |j|dS)Negg_infoz .egg-infoz .dist-infoz creating '{}' bdist_wheel) get_finalized_commandrr runrlenrinfoformatospathabspathZegg2dist)r r dist_info_dirrr r r rs  z dist_info.runN)__name__ __module__ __qualname__ description user_optionsr r rr r r r r s r)__doc__rdistutils.corer distutilsrrr r r r s  PK!f' @ -command/__pycache__/build_clib.cpython-39.pycnu[a (Re?@sLddlmmZddlmZddlmZddlm Z GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS) build_clibav Override the default build_clib behaviour to do the following: 1. Implement a rudimentary timestamp-based dependency system so 'compile()' doesn't run every time. 2. Add more keys to the 'build_info' dictionary: * obj_deps - specify dependencies for each object compiled. this should be a dictionary mapping a key with the source filename to a list of dependencies. Use an empty string for global dependencies. * cflags - specify a list of additional flags to pass to the compiler. c Csr|D]f\}}|d}|dus.t|ttfs:td|t|}td||dt}t|tsrtd|g}|dt}t|ttfstd||D]P}|g} | |||t} t| ttfstd|| | | | q|j j ||j d} t || ggfkrT|d} |d } |d }|j j||j | | ||jd |j j| ||j|jd qdS) Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list') output_dirmacros include_dirscflags)r r r Zextra_postargsdebug)r r )get isinstancelisttuplerrinfodictextendappendcompilerZobject_filenames build_temprcompiler Zcreate_static_libr)self librariesZlib_nameZ build_inforr dependenciesZ global_depssourceZsrc_depsZ extra_depsZexpected_objectsr r r r/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/build_clib.pybuild_librariess|          zbuild_clib.build_librariesN)__name__ __module__ __qualname____doc__rrrrrrsr) Zdistutils.command.build_clibcommandrorigdistutils.errorsr distutilsrZsetuptools.dep_utilrrrrrs   PK!? 3command/__pycache__/install_egg_info.cpython-39.pycnu[a (Re@s\ddlmZmZddlZddlmZddlmZddlmZddl Z Gdddej eZ dS))logdir_utilN)Command) namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZddZd d Z d d Z d S)install_egg_infoz.Install an .egg-info directory for the package)z install-dir=dzdirectory to install tocCs d|_dSN) install_dirselfr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|dd|d}tdd|j|jd}|j|_tj |j ||_ g|_ dS)N install_lib)r r egg_infoz .egg-info)set_undefined_optionsget_finalized_command pkg_resources Distributionegg_nameZ egg_versionrsourceospathjoinr targetoutputs)r Zei_cmdbasenamer r rfinalize_optionss  z!install_egg_info.finalize_optionscCs|dtj|jr:tj|js:tj|j|jdn(tj |jrb| tj |jfd|j|jstt |j| |jdd|j|jf|dS)Nr)dry_runz Removing r Copying %s to %s) run_commandrrisdirrislinkr remove_treerexistsexecuteunlinkrensure_directorycopytreerZinstall_namespacesr r r rrun!s  zinstall_egg_info.runcCs|jSr )rr r r r get_outputs.szinstall_egg_info.get_outputscs fdd}tjj|dS)NcsDdD] }||sd||vrdSqj|td|||S)N)z.svn/zCVS//r ) startswithrappendrdebug)srcdstskipr r rskimmer3s  z*install_egg_info.copytree..skimmer)rrr)r r3r r rr)1s zinstall_egg_info.copytreeN) __name__ __module__ __qualname____doc__ description user_optionsrrr*r+r)r r r rr s  r) distutilsrrr setuptoolsrrZsetuptools.archive_utilrrZ Installerrr r r rs    PK!CAA.command/__pycache__/upload_docs.cpython-39.pycnu[a (Re2@sdZddlmZddlmZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlmZddlmZd d ZGd d d eZdS) z|upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to sites other than PyPi such as devpi). )standard_b64encode)log)DistutilsOptionErrorN)iter_entry_points)uploadcCs |ddS)Nzutf-8surrogateescape)encode)sr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/upload_docs.py_encodesr c@seZdZdZdZdddejfddgZejZdd Zd efgZ d d Z d dZ ddZ ddZ eddZeddZddZdS) upload_docszhttps://pypi.python.org/pypi/z;Upload documentation to sites other than PyPi such as devpiz repository=rzurl of repository [default: %s])z show-responseNz&display full response text from server)z upload-dir=Nzdirectory to uploadcCs"|jdurtddD]}dSdS)Nzdistutils.commands build_sphinxT) upload_dirr)selfepr r r has_sphinx-s zupload_docs.has_sphinxrcCst|d|_d|_dS)N)rinitialize_optionsr target_dir)rr r r r4s zupload_docs.initialize_optionscCst||jdurV|r8|d}t|jd|_qh|d}tj |j d|_n| d|j|_d|j vr|td|d|jdS) NrhtmlbuildZdocsrzpypi.python.orgzr?rrbasenamer usernamepasswordrdecoderar!r#rINFOurllibparseurlparsereclientHTTPConnectionHTTPSConnectionAssertionErrorconnect putrequest putheaderstrr) endheaderssendsocketerrorERROR getresponsestatusreason getheader show_responseprint)rr.frcmetar] credentialsauthbodyctmsgZschemanetlocurlparamsquery fragmentsconnr`erlocationr r r r@s` &           zupload_docs.upload_fileN)__name__ __module__ __qualname__DEFAULT_REPOSITORY descriptionr user_optionsboolean_optionsr sub_commandsrrr8rE staticmethodrR classmethodrar@r r r r rs(   r)__doc__base64r distutilsrdistutils.errorsrrrr%r;rArYrU http.clientre urllib.parserr pkg_resourcesrrr rr r r r s      PK!r仦 2command/__pycache__/install_scripts.cpython-39.pycnu[a (Re! @sdddlmZddlmmZddlmZddlZddl Z ddl m Z m Z m Z GdddejZdS))logN)DistutilsModuleError) Distribution PathMetadataensure_directoryc@s*eZdZdZddZddZd ddZd S) install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj|d|_dS)NF)origrinitialize_optionsno_ep)selfr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/install_scripts.pyr s z"install_scripts.initialize_optionsc Csddlmm}|d|jjr2tj|ng|_ |j rBdS| d}t |j t|j |j|j|j}| d}t|dd}z| d}t|dd}Wnttfyd}Yn0|j}|rd}|j}|tjkr|g}|}|j|} ||| D]} |j| qdS) Nregg_info build_scripts executable bdist_wininstZ _is_runningFz python.exe)setuptools.command.easy_installcommand easy_install run_command distributionscriptsrrrunoutfilesr get_finalized_commandrZegg_baserregg_nameZ egg_versiongetattr ImportErrorrZ ScriptWriterZWindowsScriptWritersysrbestZcommand_spec_class from_paramget_argsZ as_header write_script) r eiZei_cmddistZbs_cmdZ exec_paramZbw_cmdZ is_wininstwritercmdargsr r r rs:       zinstall_scripts.runtc Gsddlm}m}td||jtj|j|}|j ||}|j s~t |t |d|} | || ||d|dS)z1Write an executable file to the scripts directoryr)chmod current_umaskzInstalling %s script to %swiN)rr)r*rinfoZ install_dirospathjoinrappenddry_runropenwriteclose) r script_namecontentsmodeZignoredr)r*targetmaskfr r r r"7s  zinstall_scripts.write_scriptN)r()__name__ __module__ __qualname____doc__r rr"r r r r r s&r) distutilsrZ!distutils.command.install_scriptsrrrdistutils.errorsrr-r pkg_resourcesrrrr r r r s  PK!g+command/__pycache__/build_py.cpython-39.pycnu[a (ReT @sddlmZddlmZddlmmZddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlmZddZGdddejZd d ZdS) )glob) convert_pathN)unique_everseencCst|t|jtjBdSN)oschmodstatst_modeS_IWRITE)targetr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/build_py.py make_writablesrc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages The data files are specified via a 'package_data' argument to 'setup()'. See 'setuptools.dist.Distribution' for more details. Also, this version of the 'build_py' command allows you to specify both 'py_modules' and 'packages' in the same setup operation. cCs@tj||jj|_|jjp i|_d|jvr6|jd=g|_dS)N data_files)origrfinalize_options distribution package_dataexclude_package_data__dict___build_py__updated_filesselfr r r rs    zbuild_py.finalize_optionscCsN|js|jsdS|jr||jr4|||tjj|dddS)z?Build modules, packages, and copy data files to build directoryNr)Zinclude_bytecode) py_modulespackagesZ build_modulesZbuild_packagesbuild_package_data byte_compilerr get_outputsrr r r run$s z build_py.runcCs&|dkr||_|jStj||S)zlazily compute data filesr)_get_data_filesrrr __getattr__)rattrr r r r!4s zbuild_py.__getattr__cCs.tj||||\}}|r&|j|||fSr)rr build_modulerappend)rmoduleZ module_filepackageoutfilecopiedr r r r#;s zbuild_py.build_modulecCs|tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr )analyze_manifestlistmap_get_pkg_data_filesrrr r r r Aszbuild_py._get_data_filescsJ||tjj|jg|d}fdd||D}|||fS)N.csg|]}tj|qSr )rpathrelpath).0filesrc_dirr r Nsz0build_py._get_pkg_data_files..)get_package_dirrr.join build_libsplitfind_data_files)rr& build_dir filenamesr r2r r,Fs    zbuild_py._get_pkg_data_filescCsX||j||}tt|}tj|}ttj j |}t|j |g|}| |||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrr+r itertoolschain from_iterablefilterrr.isfilemanifest_filesgetexclude_data_files)rr&r3patternsZglobs_expandedZ globs_matchesZ glob_filesfilesr r r r9Ts   zbuild_py.find_data_filesc Cst|jD]h\}}}}|D]V}tj||}|tj|tj||}|||\}} t|tj|}qqdS)z$Copy data files into build directoryN) rrr.r6mkpathdirname copy_filerabspath) rr&r3r:r;filenamer srcfileoutfr(r r r reszbuild_py.build_package_datac Csi|_}|jjsdSi}|jp"dD]}||t||<q$|d|d}|jj D]}t j t|\}}d}|} |r||kr||vr|}t j |\}} t j | |}qx||vrX|dr|| krqX|||g|qXdS)Nr egg_infoz.py)rBrZinclude_package_datarassert_relativer5 run_commandget_finalized_commandfilelistrFrr.r8r6endswith setdefaultr$) rZmfZsrc_dirsr&Zei_cmdr.dfprevZoldfZdfr r r r)ps(    zbuild_py.analyze_manifestcCsdSrr rr r r get_data_filesszbuild_py.get_data_filescCsz |j|WStyYn0tj|||}||j|<|rF|jjsJ|S|jjD]}||ksl||drRqvqR|St |d}| }Wdn1s0Yd|vrt j d|f|S)z8Check namespace packages' __init__ for declare_namespacer-rbNsdeclare_namespacezNamespace package problem: %s is a namespace package, but its __init__.py does not call declare_namespace()! Please fix it. (See the setuptools manual under "Namespace Packages" for details.) ")packages_checkedKeyErrorrr check_packagerZnamespace_packages startswithioopenread distutilserrorsDistutilsError)rr& package_dirZinit_pypkgrVcontentsr r r r\s*     &zbuild_py.check_packagecCsi|_tj|dSr)rZrrinitialize_optionsrr r r rgszbuild_py.initialize_optionscCs0tj||}|jjdur,tj|jj|S|Sr)rrr5rZsrc_rootrr.r6)rr&resr r r r5s zbuild_py.get_package_dircs\t||j||}fdd|D}tj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}t|VqdSr)fnmatchr@r0pattern)rFr r z.build_py.exclude_data_files..c3s|]}|vr|VqdSrr )r0fn)badr r rlrm)r*r<rr=r>r?setr)rr&r3rFrEZ match_groupsmatchesZkeepersr )rorFr rDs zbuild_py.exclude_data_filescs.t|dg||g}fdd|DS)z yield platform-specific path patterns (suitable for glob or fn_match) from a glob-based spec (such as self.package_data or self.exclude_package_data) matching package in src_dir. c3s |]}tjt|VqdSr)rr.r6rrjr2r r rlsz2build_py._get_platform_patterns..)r=r>rC)specr&r3Z raw_patternsr r2r r<s   zbuild_py._get_platform_patternsN)__name__ __module__ __qualname____doc__rrr!r#r r,r9rr)rXr\rgr5rD staticmethodr<r r r r rs"  rcCs:tj|s|Sddlm}td|}||dS)Nr)DistutilsSetupErrorz Error: setup script specifies an absolute path: %s setup() arguments must *always* be /-separated paths relative to the setup.py directory, *never* absolute paths. )rr.isabsdistutils.errorsrytextwrapdedentlstrip)r.rymsgr r r rOs    rO)rdistutils.utilrZdistutils.command.build_pycommandrrrrir|r^r{rar=rZ setuptools.extern.more_itertoolsrrrOr r r r s   EPK!4gVV.command/__pycache__/install_lib.cpython-39.pycnu[a (Re#@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd Zd d Z ed d Z dddZ ddZ dS) install_libz9Don't add compiled flags to filenames of non-Python filescCs&||}|dur"||dSN)buildinstall byte_compile)selfoutfilesr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/install_lib.pyrun szinstall_lib.runcs4fddD}t|}ttj|S)z Return a collections.Sized collections.Container of paths to be excluded for single_version_externally_managed installations. c3s"|]}|D] }|VqqdSr) _all_packages).0Zns_pkgpkgr r r sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)r Z all_packagesZ excl_specsr rr get_exclusionss  zinstall_lib.get_exclusionscCs&|d|g}tjj|jg|RS)zw Given a package name and exclusion path within that package, compute the full exclusion path. .)splitospathjoinZ install_dir)r rZexclusion_pathpartsr r r rszinstall_lib._exclude_pkg_pathccs |r|V|d\}}}qdS)zn >>> list(install_lib._all_packages('foo.bar.baz')) ['foo.bar.baz', 'foo.bar', 'foo'] rN) rpartition)pkg_namesepchildr r r r'szinstall_lib._all_packagescCs,|jjs gS|d}|j}|r(|jjSgS)z Get namespace packages (list) but only for single_version_externally_managed installations and empty otherwise. r) distributionZnamespace_packagesget_finalized_commandZ!single_version_externally_managed)r Z install_cmdZsvemr r r r1s  zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjddtjj}|dV|d V|d V|d VdS) zk Generate file paths to be excluded for namespace packages (bytecode cache files). z __init__.pyz __init__.pycz __init__.pyoimplementationN __pycache__z __init__.z.pycz.pyoz .opt-1.pycz .opt-2.pyc)hasattrsysrrrr$ cache_tag)baser r r rAs     z install_lib._gen_exclusion_pathsrc sh|r |r |rJ|s,tj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|vrd|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdstexcluder,r r r pfhs z!install_lib.copy_tree..pf)rorigr copy_treeZsetuptools.archive_utilr+ distutilsr,) r infileoutfile preserve_modepreserve_timespreserve_symlinkslevelr+r5r r3r r7Ws   zinstall_lib.copy_treecs.tj|}|r*fdd|DS|S)Ncsg|]}|vr|qSr r )rfr4r r yz+install_lib.get_outputs..)r6r get_outputsr)r outputsr r@r rCus  zinstall_lib.get_outputsN)r*r*rr*) __name__ __module__ __qualname____doc__r rr staticmethodrrrr7rCr r r r rs   r) rr' itertoolsrrZdistutils.command.install_libcommandrr6r r r r sPK!U*command/__pycache__/install.cpython-39.pycnu[a (Re*@s|ddlmZddlZddlZddlZddlZddlmmZ ddl Z e jZ Gddde jZdde jj Dej e_ dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd d dfgZe eZ d d Z d dZ ddZ ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrinstall_egg_infocCsdSNTselfrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/install.pyzinstall.install_scriptscCsdSrrr rrr r r cCs*tdtjtj|d|_d|_dS)NzRsetup.py install is deprecated. Use build and pip and other standards-based tools.) warningswarn setuptoolsZSetuptoolsDeprecationWarningorigrinitialize_optionsold_and_unmanageable!single_version_externally_managedr rrr r s zinstall.initialize_optionscCs8tj||jrd|_n|jr4|js4|js4tddS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrr rrr r,s  zinstall.finalize_optionscCs(|js |jrtj|Sd|_d|_dS)N)rrrrhandle_extra_path path_file extra_dirsr rrr r7s  zinstall.handle_extra_pathcCs@|js |jrtj|S|ts4tj|n|dS)N) rrrrrun_called_from_setupinspect currentframedo_egg_installr rrr rAs   z install.runcCsz|dur4d}t|tdkr0d}t|dSt|d}|dd\}t|}|jdd }|d kox|j d kS) a Attempt to detect whether run() was called from setup() or by another command. If called by setup(), the parent caller will be the 'run_command' method in 'distutils.dist', and *its* caller will be the 'run_commands' method. If called any other way, the immediate caller *might* be 'run_command', but it won't have been called by 'run_commands'. Return True in that case or if a call stack is unavailable. Return False otherwise. Nz4Call stack not available. bdist_* commands may fail. IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.dist run_commands) rrplatformpython_implementationrgetouterframes getframeinfo f_globalsgetfunction)Z run_framemsgresZcallerinfoZ caller_modulerrr rLs     zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd| d|j dj g}t j rp|dt j ||_|jdd dt _ dS) N easy_installx)argsrr.z*.eggZ bdist_eggrF)Zshow_deprecation) distributionget_command_classrrensure_finalizedZalways_copy_fromZ package_indexscanglob run_commandget_command_objZ egg_outputrZbootstrap_install_frominsertr3r)r r1cmdr3rrr r!gs   zinstall.do_egg_installN)r% __module__ __qualname____doc__rr user_optionsboolean_options new_commandsdict_ncrrrr staticmethodrr!rrrr rs&       rcCsg|]}|dtjvr|qS)r)rrE).0r=rrr r rH)distutils.errorsrrr9rr'distutils.command.installcommandrrr_install sub_commandsrCrrrr s sPK!Ŧv}}+command/__pycache__/register.cpython-39.pycnu[a (Re@s@ddlmZddlmmZddlmZGdddejZdS))logN)RemovedCommandErrorc@seZdZdZddZdS)registerz+Formerly used to register packages on PyPI.cCs"d}|d|tjt|dS)Nz]The register command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/register.pyrun sz register.runN)__name__ __module__ __qualname____doc__r r r r r rsr) distutilsrZdistutils.command.registercommandrorigZsetuptools.errorsrr r r r s  PK!tU))*command/__pycache__/develop.cpython-39.pycnu[a (Red@sddlmZddlmZddlmZmZddlZddlZddl Z ddl Z ddl m Z ddl mZddl Z Gdddeje ZGd d d ZdS) ) convert_path)log)DistutilsErrorDistutilsOptionErrorN) easy_install) namespacesc@sveZdZdZdZejddgZejdgZdZddZ d d Z d d Z e d dZ ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode') uninstalluzUninstall this source package)z egg-path=Nz-Set the path to be used in the .egg-link filer FcCs2|jrd|_||n||dS)NT)r Z multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_optionsselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/develop.pyruns  z develop.runcCs&d|_d|_t|d|_d|_dS)N.)r egg_pathrinitialize_options setup_pathZalways_copy_fromr rrrr%s  zdevelop.initialize_optionscCs|d}|jr,d}|j|jf}t|||jg|_t||| |j t d|jd}t j|j||_|j|_|jdurt j|j|_t|j}tt j|j|j}||krtd|tj|t|t j|j|jd|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz .egg-linkzA--egg-path must be a relative path from the install directory to  project_name)get_finalized_commandZbroken_egg_inforregg_nameargsrfinalize_optionsexpand_basedirs expand_dirsZ package_indexscanglobospathjoin install_diregg_linkegg_baserabspath pkg_resourcesnormalize_pathr Distribution PathMetadatadist_resolve_setup_pathr)reitemplaterZ egg_link_fntargetrrrrr,sF        zdevelop.finalize_optionscCsn|tjdd}|tjkr0d|dd}ttj |||}|ttjkrjt d|ttj|S)z Generate a path from egg_base back to '.' where the setup script resides and ensure that path points to the setup path from $install_dir/$egg_path. /z../zGCan't get a consistent path to setup script from installation directory) replacer!seprstripcurdircountr(r)r"r#r)r&r$rZ path_to_setupresolvedrrrr-Ws  zdevelop._resolve_setup_pathcCs|d|jddd|dtjr:|tjdt_|td|j|j |j st |jd&}| |j d|jWdn1s0Y|d|j|j dS)Nr build_extr2)ZinplacezCreating %s (link to %s)w ) run_commandreinitialize_command setuptoolsZbootstrap_install_fromrZinstall_namespacesrinfor%r&dry_runopenwriterrZprocess_distributionr,no_deps)rfrrrr ms   4zdevelop.install_for_developmentcCstj|jrztd|j|jt|j}dd|D}|||j g|j |j gfvrht d|dS|j szt |j|j s||j|jjrt ddS)NzRemoving %s (link to %s)cSsg|] }|qSr)r5).0linerrr z*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r!r"existsr%rr?r&rAcloserrwarnr@unlinkZ update_pthr, distributionscripts)rZ egg_link_filecontentsrrrr s    zdevelop.uninstall_linkc Cs||jurt||S|||jjp*gD]b}tjt |}tj |}t |}| }Wdn1st0Y|||||q,dSN)r,rinstall_egg_scriptsinstall_wrapper_scriptsrMrNr!r"r'rbasenameiorAreadZinstall_script)rr, script_nameZ script_pathstrm script_textrrrrQs     &zdevelop.install_egg_scriptscCst|}t||SrP)VersionlessRequirementrrRrr,rrrrRszdevelop.install_wrapper_scriptsN)__name__ __module__ __qualname____doc__ descriptionr user_optionsboolean_optionsZcommand_consumes_argumentsrrr staticmethodr-r r rQrRrrrrrs"  + rc@s(eZdZdZddZddZddZdS) rYa Adapt a pkg_resources.Distribution to simply return the project name as the 'requirement' so that scripts will work across multiple versions. >>> from pkg_resources import Distribution >>> dist = Distribution(project_name='foo', version='1.0') >>> str(dist.as_requirement()) 'foo==1.0' >>> adapted_dist = VersionlessRequirement(dist) >>> str(adapted_dist.as_requirement()) 'foo' cCs ||_dSrP)_VersionlessRequirement__distrZrrr__init__szVersionlessRequirement.__init__cCs t|j|SrP)getattrrc)rnamerrr __getattr__sz"VersionlessRequirement.__getattr__cCs|jSrPrr rrras_requirementsz%VersionlessRequirement.as_requirementN)r[r\r]r^rdrgrhrrrrrYsrY)distutils.utilr distutilsrdistutils.errorsrrr!r rTr(Zsetuptools.command.easy_installrr>rZDevelopInstallerrrYrrrrs    PK!K"d+command/__pycache__/__init__.cpython-39.pycnu[a (Re@s<ddlmZddlZdejvr4dejd<ejd[[dS))bdistNegg)Z bdist_eggzPython .egg file)Zdistutils.command.bdistrsysZformat_commandsZformat_commandappendrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/__init__.pys    PK!/J V V+command/__pycache__/egg_info.cpython-39.pycnu[a (Reb@sdZddlmZddlmZddlmZddlm Z ddlZddlZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%dd l&m'Z'ddl(m)Z)ddlm*Z*ddZ+GdddZ,Gddde,eZ-GdddeZGdddeZ.ddZ/ddZ0ddZ1d d!Z2d"d#Z3d$d%Z4d&d'Z5d(d)Z6d3d+d,Z7d-d.Z8d/d0Z9Gd1d2d2e*Z:dS)4zUsetuptools.command.egg_info Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError) convert_path)logN)Command)sdist) walk_revctrl) edit_config) bdist_egg)parse_requirements safe_name parse_version safe_version yield_lines EntryPointiter_entry_points to_filename)glob) packaging)SetuptoolsDeprecationWarningcCsd}|tjj}ttj}d|f}t|D]\}}|t|dk}|dkrr|r`|d7}q0|d||f7}q0d}t|} || kr||} | dkr||d7}n| d kr||7}n| d kr|d} | | kr|| d kr| d} | | kr|| d kr| d} | | kr,|| d kr,| d} q| | krF|t| 7}nR||d| } d} | dd krxd } | dd} | t| 7} |d| f7}| }n|t| 7}|d7}q~|s0||7}q0|d7}tj|tj tj BdS)z Translate a file path glob like '*.txt' in to a regular expression. This differs from fnmatch.translate which allows wildcards to match directory separators. It also knows about '**/' which matches any number of directories. z[^%s]**z.*z (?:%s+%s)*r*?[!]^Nz[%s]z\Z)flags) splitospathsepreescape enumeratelencompile MULTILINEDOTALL)rpatchunksr#Z valid_charcchunk last_chunkiZ chunk_lencharZinner_iinner char_classr4/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/egg_info.pytranslate_pattern#sV           r6c@s@eZdZdZdZeddZddZddZdd Z ee Z dS) InfoCommonNcCst|jSN)r distributionget_nameselfr4r4r5namezszInfoCommon.namecCst||jSr8)r _maybe_tagr9 get_versionr;r4r4r5tagged_version~szInfoCommon.tagged_versioncCs |jr||jr|S||jS)z egg_info may be called more than once for a distribution, in which case the version string already contains all tags. )vtagsendswithr<versionr4r4r5r>szInfoCommon._maybe_tagcCs,d}|jr||j7}|jr(|td7}|S)Nrz-%Y%m%d) tag_buildtag_datetimestrftimerCr4r4r5tagss  zInfoCommon.tags) __name__ __module__ __qualname__rErFpropertyr=r@r>rIrAr4r4r4r5r7vs  r7c@seZdZdZgdZdgZddiZddZeddZ e j d dZ d d Z d d Z dddZ ddZddZddZddZddZdS)egg_infoz+create a distribution's .egg-info directory))z egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree))tag-datedz0Add date stamp (e.g. 20050528) to version number)z tag-build=bz-Specify explicit tag to add to version number)no-dateDz"Don't include date stamp [default]rPrScCs"d|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerN egg_versionbroken_egg_infor;r4r4r5initialize_optionss zegg_info.initialize_optionscCsdSr8r4r;r4r4r5tag_svn_revisionszegg_info.tag_svn_revisioncCsdSr8r4)r<valuer4r4r5rZscCs0t}||d<d|d<t|t|ddS)z Materialize the value of date into the build tag. Install build keys in a deterministic order to avoid arbitrary reordering on subsequent builds. rErrF)rNN) collections OrderedDictrIr dict)r<filenamerNr4r4r5save_version_infos zegg_info.save_version_infoc CsV|j|_||_t|j}z6t|tjj}|r4dnd}t t ||j|jfWn>t y}z&t j d|j|jf|WYd}~n d}~00|jdur|jj}|pidtj|_|dt|jd|_|jtjkrtj|j|j|_d|jvr||j|jj_|jj}|durR|j|jkrR|j|_t|j|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrU .egg-info-)!r=rVr@rWr isinstancerrDVersionlistr ValueError distutilserrorsDistutilsOptionErrorrUr9 package_dirgetr!curdirensure_dirnamerrNr"joincheck_broken_egg_infometadataZ _patched_distkeylower_version_parsed_version)r<parsed_versionZ is_versionspecrOdirspdr4r4r5finalize_optionssB          zegg_info.finalize_optionsFcCsL|r||||n4tj|rH|dur>|s>td||dS||dS)aWrite `data` to `filename` or delete if empty If `data` is non-empty, this routine is the same as ``write_file()``. If `data` is empty but not ``None``, this is the same as calling ``delete_file(filename)`. If `data` is ``None``, then this is a no-op unless `filename` exists, in which case a warning is issued about the orphaned file (if `force` is false), or deleted (if `force` is true). Nz$%s not set in setup(), but %s exists) write_filer!r"existsrwarn delete_file)r<whatr_dataforcer4r4r5write_or_delete_files   zegg_info.write_or_delete_filecCs>td|||d}|js:t|d}|||dS)zWrite `data` to `filename` (if not a dry run) after announcing it `what` is used in a log message to identify what is being written to the file. zwriting %s to %sutf-8wbN)rinfoencodedry_runopenwriteclose)r<r~r_rfr4r4r5rz s    zegg_info.write_filecCs td||jst|dS)z8Delete `filename` (if not a dry run) after announcing itz deleting %sN)rrrr!unlink)r<r_r4r4r5r}s zegg_info.delete_filecCs||jt|jd|jj}tdD]4}|j|d|}|||j tj |j|j q*tj |jd}tj |r| ||dS)Nzegg_info.writers) installerznative_libs.txt)mkpathrNr!utimer9Zfetch_build_eggrrequireresolver=r"rnr{r} find_sources)r<repwriternlr4r4r5runs     z egg_info.runcCs4tj|jd}t|j}||_||j|_dS)z"Generate SOURCES.txt manifest filez SOURCES.txtN) r!r"rnrNmanifest_makerr9manifestrfilelist)r<Zmanifest_filenamemmr4r4r5r-s  zegg_info.find_sourcescCsT|jd}|jtjkr&tj|j|}tj|rPtd||j |j |_ ||_ dS)NraaB------------------------------------------------------------------------------ Note: Your current .egg-info directory has a '-' in its name; this will not work correctly with "setup.py develop". Please rename %s to %s to correct this problem. ------------------------------------------------------------------------------) rVrUr!rlr"rnr{rr|rNrX)r<Zbeir4r4r5ro5s   zegg_info.check_broken_egg_infoN)F)rJrKrL description user_optionsboolean_options negative_optrYrMrZsetterr`ryrrzr}rrror4r4r4r5rNs$    1  rNc@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)rc Cs ||\}}}}|j|j|j|jt|j|t|j||j |j d}dddddddd d}z ||}Wn"t yt d j |d Yn0|d } |d vr|g}| r|fnd} ||} |d|g| r|gng||D] } || stj| | g| RqdS)N)includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')actionz recursive->rrr4 )Z_parse_template_linerrglobal_includeglobal_exclude functoolspartialrecursive_includerecursive_excluderrKeyErrorrformat startswith debug_printrnrr|) r<linerpatternsdirZ dir_patternZ action_mapZlog_mapZprocess_actionZaction_is_recursiveZextra_log_argsZlog_tmplpatternr4r4r5process_template_lineHs`    zFileList.process_template_linecCsRd}tt|jdddD]2}||j|r|d|j||j|=d}q|S)z Remove all files from the file list that match the predicate. Return True if any matching files were removed Frz removing T)ranger'filesr)r< predicatefoundr0r4r4r5 _remove_filesszFileList._remove_filescCs$ddt|D}||t|S)z#Include files that match 'pattern'.cSsg|]}tj|s|qSr4r!r"isdir.0rr4r4r5 z$FileList.include..rextendboolr<rrr4r4r5rs zFileList.includecCst|}||jS)z#Exclude files that match 'pattern'.)r6rmatchr<rrr4r4r5rszFileList.excludecCs8tj|d|}ddt|ddD}||t|S)zN Include all files anywhere in 'dir/' that match the pattern. rcSsg|]}tj|s|qSr4rrr4r4r5rs z.FileList.recursive_include..T) recursive)r!r"rnrrr)r<rrZ full_patternrr4r4r5rs zFileList.recursive_includecCs ttj|d|}||jS)zM Exclude any file anywhere in 'dir/' that match the pattern. rr6r!r"rnrr)r<rrrr4r4r5rszFileList.recursive_excludecCs$ddt|D}||t|S)zInclude all files from 'dir/'.cSs"g|]}tj|D]}|qqSr4)rgrfindall)rZ match_diritemr4r4r5rsz"FileList.graft..r)r<rrr4r4r5rs  zFileList.graftcCsttj|d}||jS)zFilter out files from 'dir/'.rr)r<rrr4r4r5rszFileList.prunecsJ|jdur|ttjd|fdd|jD}||t|S)z Include all files anywhere in the current directory that match the pattern. This is very inefficient on large file trees. Nrcsg|]}|r|qSr4rrrr4r5rrz+FileList.global_include..)allfilesrr6r!r"rnrrrr4rr5rs   zFileList.global_includecCsttjd|}||jS)zD Exclude all files anywhere that match the pattern. rrrr4r4r5rszFileList.global_excludecCs8|dr|dd}t|}||r4|j|dS)N r)rBr _safe_pathrappend)r<rr"r4r4r5rs    zFileList.appendcCs|jt|j|dSr8)rrfilterr)r<pathsr4r4r5rszFileList.extendcCstt|j|j|_dS)z Replace self.files with only safe paths Because some owners of FileList manipulate the underlying ``files`` attribute directly, this method must be called to repair those paths. N)rerrrr;r4r4r5_repairszFileList._repairc Csd}t|}|dur(td|dSt|d}|durNt||ddSz"tj|shtj|rnWdSWn$tyt||t Yn0dS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFrT) unicode_utilsfilesys_decoderr|Z try_encoder!r"r{UnicodeEncodeErrorsysgetfilesystemencoding)r<r"Zenc_warnZu_pathZ utf8_pathr4r4r5rs    zFileList._safe_pathN)rJrKrLrrrrrrrrrrrrrrr4r4r4r5rEsM     rc@sdeZdZdZddZddZddZdd Zd d Zd d Z e ddZ ddZ ddZ ddZdS)rz MANIFEST.incCsd|_d|_d|_d|_dS)Nr)Z use_defaultsrZ manifest_onlyZforce_manifestr;r4r4r5rYsz!manifest_maker.initialize_optionscCsdSr8r4r;r4r4r5ryszmanifest_maker.finalize_optionscCslt|_tj|js||tj|jr<| | | |j |j |dSr8)rrr!r"r{rwrite_manifest add_defaultstemplateZ read_templateadd_license_filesprune_file_listsortZremove_duplicatesr;r4r4r5rs  zmanifest_maker.runcCst|}|tjdS)N/)rrreplacer!r#)r<r"r4r4r5_manifest_normalize&s z"manifest_maker._manifest_normalizecsBjfddjjD}dj}tj|f|dS)zo Write the file list in 'self.filelist' to the manifest file named by 'self.manifest'. csg|]}|qSr4)rrr;r4r5r2rz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrexecuterz)r<rmsgr4r;r5r*s  zmanifest_maker.write_manifestcCs||st||dSr8)_should_suppress_warningrr|)r<rr4r4r5r|6s zmanifest_maker.warncCs td|S)z; suppress missing-file warnings from sdist zstandard file .*not found)r$r)rr4r4r5r:sz'manifest_maker._should_suppress_warningcCst||j|j|j|jtt}|rB|j|nt j |jrX| t j drp|jd| d}|j|jdS)Nzsetup.pyrN)rrrrrrrerrr!r"r{Z read_manifestget_finalized_commandrrN)r<ZrcfilesZei_cmdr4r4r5rAs     zmanifest_maker.add_defaultscCs4|jjjp g}|D]}td|q|j|dS)Nzadding license file '%s')r9rp license_filesrrrr)r<rlfr4r4r5rSs  z manifest_maker.add_license_filescCsZ|d}|j}|j|j|j|ttj }|jj d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex) rr9 get_fullnamerr build_baser$r%r!r#Zexclude_pattern)r<rbase_dirr#r4r4r5rZs    zmanifest_maker.prune_file_listN)rJrKrLrrYryrrrr| staticmethodrrrrr4r4r4r5r s   rcCsLd|}|d}t|d}||Wdn1s>0YdS)z{Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.  rrN)rnrrr)r_contentsrr4r4r5rzds   rzc Cstd||js|jj}|j|j|_}|j|j|_}z| |j W|||_|_n|||_|_0t |jdd}t |j |dS)Nz writing %sZzip_safe)rrrr9rprWrDrVr=write_pkg_inforNgetattrr Zwrite_safety_flag)cmdbasenamer_rpZoldverZoldnamesafer4r4r5rqs  rcCstj|rtddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6! Use the install_requires/extras_require setup() args instead.)r!r"r{rr|rrr_r4r4r5warn_depends_obsoletes rcCs,t|pd}dd}t||}||dS)Nr4cSs|dS)Nrr4)rr4r4r5 append_crsz&_write_requirements..append_cr)rmap writelines)streamreqslinesrr4r4r5_write_requirementss  rcCsn|j}t}t||j|jp"i}t|D]*}|djfit t|||q,| d|| dS)Nz [{extra}] requirements) r9ioStringIOrZinstall_requiresextras_requiresortedrrvarsrgetvalue)rrr_distrrextrar4r4r5write_requirementss   rcCs,t}t||jj|d||dS)Nzsetup-requirements)rrrr9Zsetup_requiresrr)rrr_rr4r4r5write_setup_requirementssrcCs:tdd|jD}|d|dt|ddS)NcSsg|]}|dddqS).rr)r )rkr4r4r5rsz(write_toplevel_names..ztop-level namesr)r^fromkeysr9Ziter_distribution_namesrzrnr)rrr_pkgsr4r4r5write_toplevel_namess r cCst|||ddS)NT) write_argrr4r4r5 overwrite_argsr FcCsHtj|d}t|j|d}|dur4d|d}|||||dS)Nrr)r!r"splitextrr9rnr)rrr_rargnamer[r4r4r5r s r cCs|jj}t|ts|dur |}nl|durg}t|D]H\}}t|tsnt||}dtt t| }| d||fq8d|}| d||ddS)Nrz [%s] %s rz entry pointsT) r9Z entry_pointsrcstrritemsr parse_grouprnrvaluesrr)rrr_rrsectionrr4r4r5 write_entriess   rcCstdttjdr|tdJ}|D]4}t d|}|r(t | dWdSq(Wdn1sr0YdS)zd Get a -r### off of PKG-INFO Version in case this is an sdist of a subversion revision. z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr) warningsr|EggInfoDeprecationWarningr!r"r{rrr$rintgroup)rrrr4r4r5get_pkg_info_revisions   @rc@seZdZdZdS)rz?Deprecated behavior warning for EggInfo, bypassing suppression.N)rJrKrL__doc__r4r4r4r5rsr)F);rdistutils.filelistrZ _FileListdistutils.errorsrdistutils.utilrrgrrr!r$rrrrGr\ setuptoolsrZsetuptools.command.sdistrrZsetuptools.command.setoptr Zsetuptools.commandr pkg_resourcesr r r rrrrrZsetuptools.unicode_utilsrZsetuptools.globrZsetuptools.externrrr6r7rNrrzrrrrrr r r rrrr4r4r4r5sV         (    S1IW     PK!#$+command/__pycache__/saveopts.cpython-39.pycnu[a (Re@s$ddlmZmZGdddeZdS)) edit_config option_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsh|j}i}|jD]B}|dkrq||D]$\}\}}|dkr,|||i|<q,qt|j||jdS)Nrz command line) distributioncommand_optionsget_option_dictitems setdefaultrfilenamedry_run)selfdistsettingscmdoptsrcvalr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/saveopts.pyrun s z saveopts.runN)__name__ __module__ __qualname____doc__ descriptionrrrrrrsrN)Zsetuptools.command.setoptrrrrrrrsPK!3nk(command/__pycache__/sdist.cpython-39.pycnu[a (Re@sxddlmZddlmmZddlZddlZddlZddl Z ddl m Z ddl Z e Zd ddZGdd d e ejZdS) )logN)sdist_add_defaultsccs,tdD]}||D] }|Vqq dS)z%Find all files under revision controlzsetuptools.file_findersN) pkg_resourcesiter_entry_pointsload)dirnameepitemr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/sdist.py walk_revctrlsrcseZdZdZgdZiZgdZeddeDZddZ dd Z d d Z d d Z e ejddZfddZddZddZddZfddZddZddZddZd d!ZZS)"sdistz=Smart sdist that finds anything supported by revision control))zformats=Nz6formats for source distribution (comma-separated list))z keep-tempkz@keep the distribution tree around after creating archive file(s))z dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])rz.rstz.txtz.mdccs|]}d|VqdS)z README{0}N)format).0extr r r +zsdist.cCs|d|d}|j|_|jtj|jd|| D]}||qD| t |j dg}|j D] }dd|f}||vrp||qpdS)Negg_infoz SOURCES.txt dist_filesrr) run_commandget_finalized_commandfilelistappendospathjoinr check_readmeget_sub_commandsmake_distributiongetattr distributionZ archive_files)selfZei_cmdcmd_namerfiledatar r r run-s      z sdist.runcCstj||dSN)origrinitialize_options_default_to_gztarr'r r r r.@s zsdist.initialize_optionscCstjdkrdSdg|_dS)N)rbetargztar)sys version_infoformatsr0r r r r/Es zsdist._default_to_gztarcCs8|tj|Wdn1s*0YdS)z% Workaround for #516 N)_remove_os_linkr-rr$r0r r r r$Ks zsdist.make_distributionc cspGddd}ttd|}zt`Wnty4Yn0zdVW||urlttd|n||urjttd|0dS)zG In a context, remove and restore os.link if it exists c@s eZdZdS)z&sdist._remove_os_link..NoValueN)__name__ __module__ __qualname__r r r r NoValueYsr<linkN)r%rr= Exceptionsetattr)r<Zorig_valr r r r8Rs  zsdist._remove_os_linkcs&ttjdr"|jddS)Nzpyproject.toml)super_add_defaults_optionalrr isfilerrr0 __class__r r rAgs  zsdist._add_defaults_optionalcCs8|jr4|d}|j||||dS)zgetting python filesbuild_pyN)r&has_pure_modulesrrextendZget_source_files_add_data_files_safe_data_filesr'rEr r r _add_defaults_pythonls  zsdist._add_defaults_pythoncCs|jjr dS|jS)z Extracting data_files from build_py is known to cause infinite recursion errors when `include_package_data` is enabled, so suppress it in that case. r )r&Zinclude_package_data data_filesrJr r r rIsszsdist._safe_data_filescCs|jdd|DdS)zA Add data files as found in build_py.data_files. css.|]&\}}}}|D]}tj||VqqdSr,)rr r!)r_src_dir filenamesnamer r r rs z(sdist._add_data_files..N)rrG)r'rLr r r rH}s zsdist._add_data_filescs0ztWnty*tdYn0dS)Nz&data_files contains unexpected objects)r@_add_defaults_data_files TypeErrorrwarnr0rCr r rQs zsdist._add_defaults_data_filescCs8|jD]}tj|rdSq|dd|jdS)Nz,standard file not found: should have one of z, )READMESrr existsrSr!)r'fr r r r"s   zsdist.check_readmecCs^tj|||tj|d}ttdrJtj|rJt|| d|| d |dS)Nz setup.cfgr=r) r-rmake_release_treerr r!hasattrrUunlink copy_filerZsave_version_info)r'base_dirfilesdestr r r rWs   zsdist.make_release_treecCsTtj|jsdSt|jd}|}Wdn1s>0Y|dkS)NFrbz+# file GENERATED by distutils, do NOT edit )rr rBmanifestioopenreadlineencode)r'fp first_liner r r _manifest_is_not_generateds&z sdist._manifest_is_not_generatedc Cstd|jt|jd}|D]\}z|d}Wn$tyTtd|YqYn0|}|ds|snq|j |q| dS)zRead the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. zreading manifest file '%s'r^zUTF-8z"%r not UTF-8 decodable -- skipping#N) rinfor_radecodeUnicodeDecodeErrorrSstrip startswithrrclose)r'r_liner r r read_manifests   zsdist.read_manifest)r9r:r;__doc__ user_options negative_optZREADME_EXTENSIONStuplerTr+r.r/r$ staticmethod contextlibcontextmanagerr8rArKrIrHrQr"rWrfro __classcell__r r rCr rs*       r)r) distutilsrZdistutils.command.sdistcommandrr-rr5r`ruZ py36compatrrlistZ_default_revctrlrr r r r s   PK!)'command/__pycache__/test.cpython-39.pycnu[a (Re@sddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z mZmZmZmZmZmZmZddlmZddlmZGdd d e ZGd d d ZGd d d eZdS)N)DistutilsErrorDistutilsOptionError)log) TestLoader)resource_listdirresource_existsnormalize_path working_setevaluate_markeradd_activation_listenerrequire EntryPoint)Command)unique_everseenc@seZdZddZdddZdS)ScanningLoadercCst|t|_dSN)r__init__set_visitedselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/test.pyrs zScanningLoader.__init__NcCs||jvrdS|j|g}|t||t|drH||t|drt|jdD]`}| dr|dkr|jd|dd}n"t |j|d r^|jd|}nq^|| |q^t |d kr| |S|d SdS) aReturn a suite of all tests cases contained in the given module If the module is a package, load tests from all the modules in it. If the module has an ``additional_tests`` function, call it and add the return value to the tests. Nadditional_tests__path__z.pyz __init__.py.z /__init__.pyr)raddappendrloadTestsFromModulehasattrrr__name__endswithrZloadTestsFromNamelenZ suiteClass)rmodulepatterntestsfile submodulerrrr!s$      z"ScanningLoader.loadTestsFromModule)N)r# __module__ __qualname__rr!rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs ||_dSrfget)rr/rrrrBszNonDataProperty.__init__NcCs|dur |S||Srr.)robjZobjtyperrr__get__EszNonDataProperty.__get__)N)r#r+r,rr1rrrrr-Asr-c@seZdZdZdZgdZddZddZedd Z d d Z d d Z e j gfddZee j ddZeddZddZddZeddZeddZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated)))z test-module=mz$Run 'test_suite' in specified module)z test-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))z test-runner=rzTest runner to usecCsd|_d|_d|_d|_dSr) test_suite test_module test_loader test_runnerrrrrinitialize_optionsZsztest.initialize_optionscCs|jr|jrd}t||jdurD|jdur8|jj|_n |jd|_|jdur^t|jdd|_|jdurnd|_|jdurt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz .test_suiter8z&setuptools.command.test:ScanningLoaderr9)r6r7r distributionr8getattrr9)rmsgrrrfinalize_options`s        ztest.finalize_optionscCs t|Sr)list _test_argsrrrr test_argsssztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)Zdiscoverz --verbose)r6sys version_infoverboserrrrr@ws ztest._test_argscCs2||Wdn1s$0YdS)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncrrrwith_project_on_sys_paths ztest.with_project_on_sys_pathc cs|d|jddd|d|d}tjdd}tj}zt|j}tj d|t t ddt d|j|jf||gdVWdn1s0YW|tjdd<tjtj|t n.|tjdd<tjtj|t 0dS) Negg_info build_extr)ZinplacercSs|Sr)activate)distrrrz*test.project_on_sys_path..z%s==%s) run_commandreinitialize_commandget_finalized_commandrDpathmodulescopyrZegg_baseinsertr rr r egg_nameZ egg_versionpaths_on_pythonpathclearupdate)rZ include_distsZei_cmdold_pathZ old_modulesZ project_pathrrrrGs,      &     ztest.project_on_sys_pathc cst}tjd|}tjdd}zdtjt|}td||g}tj|}|r\|tjd<dVW||ur|tjddq|tjd<n$||urtjddn |tjd<0dS)z Add the indicated paths to the head of the PYTHONPATH environment variable so that subprocesses will also see the packages at these paths. Do this in a context that restores the value on exit. PYTHONPATHrN) objectosenvirongetpathsepjoinrfilterpop)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrXs    ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css0|](\}}|drt|ddr|VqdS):rN) startswithr ).0kvrrr sz%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ tests_requireZextras_requireitems itertoolschain)rMZir_dZtr_dZer_drrr install_distss   ztest.install_distsc Cs|dtj||j}d|j}|jr>|d|dS|d|tt d|}| |@| | Wdn1s0YWdn1s0YdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)z running "%s"location)announcerWARNrqr;rb_argvdry_runmapoperator attrgetterrXrG run_tests)rZinstalled_distscmdrerrrruns    ztest.runcCsVtjdd|j||j||jdd}|jsRd|j}||t j t |dS)NF)Z testLoaderZ testRunnerexitzTest failed: %s) unittestmainrv_resolve_as_epr8r9resultZ wasSuccessfulrtrERRORr)rr2r=rrrr{s    ztest.run_testscCs dg|jS)Nr)rArrrrrvsz test._argvcCs$|dur dStd|}|S)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. Nzx=)r parseresolve)valparsedrrrrsztest._resolve_as_epN)r#r+r,__doc__ description user_optionsr:r>r-rAr@rI contextlibcontextmanagerrG staticmethodrXrqr}r{propertyrvrrrrrr2Ks,     r2)r^ryrDrrordistutils.errorsrr distutilsrr pkg_resourcesrrrr r r r r setuptoolsrZ setuptools.extern.more_itertoolsrrr-r2rrrrs  (  ( PK!``,command/__pycache__/bdist_rpm.cpython-39.pycnu[a (Re@s<ddlmmZddlZddlmZGdddejZdS)N)SetuptoolsDeprecationWarningc@s eZdZdZddZddZdS) bdist_rpma Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs in RPM distributions. cCs&tdt|dtj|dS)Nzjbdist_rpm is deprecated and will be removed in a future version. Use bdist_wheel (wheel packages) instead.egg_info)warningswarnr run_commandorigrrun)selfr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/bdist_rpm.pyr s  z bdist_rpm.runcCstj|}dd|D}|S)NcSs g|]}|ddddqS)zsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0liner r r sz-bdist_rpm._make_spec_file..)rr_make_spec_file)r specr r r rs   zbdist_rpm._make_spec_fileN)__name__ __module__ __qualname____doc__r rr r r r rs r)Zdistutils.command.bdist_rpmcommandrrr setuptoolsrr r r r s PK!cWbb)command/__pycache__/upload.cpython-39.pycnu[a (Re@s:ddlmZddlmZddlmZGdddejZdS))log)upload)RemovedCommandErrorc@seZdZdZddZdS)rz)Formerly used to upload packages to PyPI.cCs"d}|d|tjt|dS)Nz[The upload command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/upload.pyrun sz upload.runN)__name__ __module__ __qualname____doc__r r r r r rsrN) distutilsrdistutils.commandrorigZsetuptools.errorsrr r r r s   PK![v&&,command/__pycache__/build_ext.cpython-39.pycnu[a (Re3 @spddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z mZddlmZddlmZdd lmZzddlmZed WneyeZYn0ed dd l mZd dZdZdZdZejdkrdZnsr!cCs.tD]$}d|vr|S|dkr|SqdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)suffixrrrget_abi3_suffixBs r#c@sveZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdddZdS)rcCs.|jd}|_t|||_|r*|dS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace _build_extruncopy_extensions_to_source)selfZ old_inplacerrrr%Ls  z build_ext.runc Cs|d}|jD]}||j}||}|d}d|dd}||}tj |tj |}tj |j |} t | ||j |jd|jr||ptj|dqdS)Nbuild_py.)verbosedry_runT)get_finalized_command extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename build_librr+r, _needs_stub write_stubcurdir) r'r(extfullnamefilenamemodpathpackage package_dirZ dest_filenameZ src_filenamerrrr&Ts"       z#build_ext.copy_extensions_to_sourcecCstd}|r&tjj|d|}nt||}td}||jvr|j|}t |do\t }|r|dt | }t }||}t |t rtj|\}}|j|tStr|jrtj|\}}tj|d|S|S)NZSETUPTOOLS_EXT_SUFFIXr) EXT_SUFFIXZpy_limited_apizdl-)r4getenvr5r3r2r$r1rext_mapgetattrr#len isinstancer splitextshlib_compilerlibrary_filenamelibtype use_stubs_links_to_dynamic)r'r<Zso_extr=r;Zuse_abi3fndrrrr1js&      zbuild_ext.get_ext_filenamecCs t|d|_g|_i|_dSN)r$initialize_optionsrHshlibsrCr'rrrrPs zbuild_ext.initialize_optionscCs,t||jpg|_||jdd|jD|_|jrB||jD]}||j|_qH|jD]}|j}||j |<||j | dd<|jr| |pd}|ot ot |t }||_||_||}|_tjtj|j|}|r||jvr|j||rbt rbtj|jvrb|jtjqbdS)NcSsg|]}t|tr|qSr)rFr .0r;rrr s z.build_ext.finalize_options..r)r*F)r$finalize_optionsr.Zcheck_extensions_listrQsetup_shlib_compilerr/r0 _full_namerCr2links_to_dynamicrKrFr rLr8r1 _file_namer4r5dirnamer3r7 library_dirsappendr:runtime_library_dirs)r'r;r<Zltdnsr=libdirrrrrVs,       zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdur8||j|jdur^|jD]\}}| ||qH|j dur~|j D]}| |qn|j dur| |j |jdur||j|jdur||j|jdur||jt||_dS)N)rr,force)rrr,rarHr include_dirsZset_include_dirsZdefineZ define_macroZundefZundefine_macro librariesZ set_librariesr\Zset_library_dirsZrpathZset_runtime_library_dirsZ link_objectsZset_link_objectslink_shared_object__get__)r'rr0valueZmacrorrrrWs*               zbuild_ext.setup_shlib_compilercCst|tr|jSt||SrO)rFr export_symbolsr$get_export_symbolsr'r;rrrrhs zbuild_ext.get_export_symbolscCsb||j}zFt|tr"|j|_t|||jrL|dj }| ||W||_n||_0dS)Nr() Z_convert_pyx_sources_to_langrrFr rHr$build_extensionr8r-r7r9)r'r;Z _compilercmdrrrrjs   zbuild_ext.build_extensioncsPtdd|jDd|jddddgtfdd|jDS) z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|] }|jqSr)rX)rTlibrrrrUz.build_ext.links_to_dynamic..r)Nr*rc3s|]}|vVqdSrOr)rTZlibnameZlibnamespkgrr rmz-build_ext.links_to_dynamic..)dictfromkeysrQr3rXr2anyrcrirrnrrYs zbuild_ext.links_to_dynamiccCst||SrO)r$ get_outputs_build_ext__get_stubs_outputsrRrrrrtszbuild_ext.get_outputscs6fddjD}t|}tdd|DS)Nc3s2|]*}|jrtjjjg|jdRVqdS)r)N)r8r4r5r3r7rXr2rSrRrrrpsz0build_ext.__get_stubs_outputs..css|]\}}||VqdSrOr)rTbaseZfnextrrrrprm)r. itertoolsproduct!_build_ext__get_output_extensionslist)r'Z ns_ext_basespairsrrRrZ__get_stubs_outputss  zbuild_ext.__get_stubs_outputsccs"dVdV|djrdVdS)N.pyz.pycr(z.pyo)r-optimizerRrrrZ__get_output_extensionss z!build_ext.__get_output_extensionsFcCs4td|j|tjj|g|jdRd}|rLtj|rLt|d|j st |d}| dddd t d d tj |jd d dt ddddt ddddddt ddddg||r0ddlm}||gdd|j d |d!j}|dkr||g|d|j d tj|r0|j s0t|dS)"Nz writing stub loader for %s to %sr)r|z already exists! Please delete.w zdef __bootstrap__():z- global __bootstrap__, __file__, __loader__z0 import sys, os, pkg_resources, importlib.utilz, dlz: __file__ = pkg_resources.resource_filename(__name__,%r)z del __bootstrap__z if '__loader__' in globals():z del __loader__z# old_flags = sys.getdlopenflags()z old_dir = os.getcwd()z try:z( os.chdir(os.path.dirname(__file__))z$ sys.setdlopenflags(dl.RTLD_NOW)z3 spec = importlib.util.spec_from_file_location(z# __name__, __file__)z0 mod = importlib.util.module_from_spec(spec)z! spec.loader.exec_module(mod)z finally:z" sys.setdlopenflags(old_flags)z os.chdir(old_dir)z__bootstrap__()rr) byte_compileT)r}rar, install_lib)r inforXr4r5r3r2existsr r,openwriter!r6rZclosedistutils.utilrr-r}unlink)r' output_dirr;compileZ stub_filefrr}rrrr9sh       zbuild_ext.write_stubN)F)__name__ __module__ __qualname__r%r&r1rPrVrWrhrjrYrtruryr9rrrrrKs   rc Cs(||j||||||||| | | | dSrO)linkZSHARED_LIBRARY) r'objectsoutput_libnamerrcr\r^rgdebug extra_preargsextra_postargs build_temp target_langrrrrd$s rdZstaticc Cs^|dus Jtj|\}} tj| \}}|ddrH|dd}|||||| dS)Nxrl)r4r5r2rGrI startswithZcreate_static_lib)r'rrrrcr\r^rgrrrrrr=r6r;rrrrd3s   ) NNNNNrNNNN) NNNNNrNNNN)&r4rrwimportlib.machineryrZdistutils.command.build_extrZ _du_build_extdistutils.file_utilrdistutils.ccompilerrdistutils.sysconfigrrdistutils.errorsr distutilsr Zsetuptools.extensionr ZCython.Distutils.build_extr$ __import__ ImportErrorr rrrrKrJrr0dlhasattrr!r#rdrrrrsZ               W PK!Z - )command/__pycache__/rotate.cpython-39.pycnu[a (ReP@sTddlmZddlmZddlmZddlZddlZddlm Z Gddde Z dS)) convert_path)log)DistutilsOptionErrorN)Commandc@s8eZdZdZdZgdZgZddZddZdd Z d S) rotatezDelete older distributionsz2delete older distributions, keeping N newest files))zmatch=mzpatterns to match (required))z dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/rotate.pyinitialize_optionsszrotate.initialize_optionsc Cs|jdurtd|jdur$tdzt|j|_Wn.tyb}ztd|WYd}~n d}~00t|jtrdd|jdD|_|dddS) NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|qSr)rstrip).0prrr (sz+rotate.finalize_options..,bdist)r r ) r rr int ValueError isinstancestrsplitset_undefined_options)r errrfinalize_optionss     zrotate.finalize_optionscCs|dddlm}|jD]}|jd|}|tj|j|}dd|D}| | t dt ||||jd}|D]<\}}t d||jstj|rt|qt|qqdS) Negg_infor)glob*cSsg|]}tj||fqSr)ospathgetmtime)rfrrrr4zrotate.run..z%d file(s) matching %sz Deleting %s) run_commandr r distributionget_namer"r#joinr sortreverserinfolenr dry_runisdirshutilrmtreeunlink)r r patternfilestr%rrrrun-s        z rotate.runN) __name__ __module__ __qualname____doc__ description user_optionsboolean_optionsrrr7rrrrr sr) distutils.utilr distutilsrdistutils.errorsrr"r1 setuptoolsrrrrrrs    PK!Ng,_vendor/__pycache__/pyparsing.cpython-39.pycnu[a (Rex @s dZdZdZdZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZzddlmZWneyddlmZYn0zdd lmZdd lmZWn*eydd l mZdd l mZYn0zdd l mZWn>ey>zdd lmZWney8dZYn0Yn0gd Zee jdd Zedd kZ e re j!Z"e#Z$e%Z&e#Z'e(e)e*e+e,ee-e.e/e0e1g Z2n^e j3Z"e4Z5ddZ'gZ2ddl6Z6d7D]6Z8ze29e:e6e8Wne;yYqYn0qeGddde?Z@ejAejBZCdZDeDdZEeCeDZFe%dZGdHddejIDZJGdddeKZLGdd d eLZMGd!d"d"eLZNGd#d$d$eNZOGd%d&d&eKZPGd'd(d(e?ZQGd)d*d*e?ZReSeRd+d,ZTd-d.ZUd/d0ZVd1d2ZWd3d4ZXd5d6ZYd7d8ZZdd:d;Z[Gdd?d?e\Z]Gd@dAdAe]Z^GdBdCdCe]Z_GdDdEdEe]Z`e`Zae`e\_bGdFdGdGe]ZcGdHdIdIe`ZdGdJdKdKecZeGdLdMdMe]ZfGdNdOdOe]ZgGdPdQdQe]ZhGdRdSdSe]ZiGdTdUdUe]ZjGdVdWdWe]ZkGdXdYdYe]ZlGdZd[d[elZmGd\d]d]elZnGd^d_d_elZoGd`dadaelZpGdbdcdcelZqGdddedeelZrGdfdgdgelZsGdhdidie\ZtGdjdkdketZuGdldmdmetZvGdndodoetZwGdpdqdqetZxGdrdsdse\ZyGdtdudueyZzGdvdwdweyZ{GdxdydyeyZ|Gdzd{d{e|Z}Gd|d}d}e|Z~Gd~dde?ZeZGdddeyZGdddeyZGdddeyZGdddeZGdddeyZGdddeZGdddeZGdddeZGdddeZGddde?ZddZdddZdddZddZddZddZddZdddZddZdddZddZddZe^dZendZeodZepdZeqdZegeGdd9dddZehdddZehdddZeeBeBejdddBZeeedeZe`deddee}eeBddZddĄZddƄZddȄZddʄZdd̄ZeddZeddZddЄZdd҄ZddԄZddքZe?e_ddd؄Ze@Ze?e_e?e_edكedڃfdd܄ZeZeehd݃ddߡZeehdddZeehd݃dehddBdZeeadedZdddefddZdddZedZedZeegeCeFdd\ZZeed7dZehddHeàġddZddZeehdddZehddZehdɡdZehddZeehddeBdZeZehddZee}egeJddeegde`deoϡdZeeeeBdddZGdddZeӐd k redd Zedd ZegeCeFd Zee֐d ddeZeee׃dZؐdeBZee֐d ddeZeeeڃdZeԐdeِdeeېdZeܠݐdejޠݐdejߠݐdejݐdddlZej᠝eejejݐddS(a pyparsing module - Classes and methods to define and execute parsing grammars ============================================================================= The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. With pyparsing, you don't need to learn a new syntax for defining grammars or matching expressions - the parsing module provides a library of classes that you use to construct the grammar directly in Python. Here is a program to parse "Hello, World!" (or any greeting of the form C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements (L{'+'} operator gives L{And} expressions, strings are auto-converted to L{Literal} expressions):: from pyparsing import Word, alphas # define grammar of a greeting greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) The program outputs the following:: Hello, World! -> ['Hello', ',', 'World', '!'] The Python representation of the grammar is quite readable, owing to the self-explanatory class names, and the use of '+', '|' and '^' operators. The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an object with named attributes. The pyparsing module handles some of the problems that are typically vexing when writing text parsers: - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello , World !", etc.) - quoted strings - embedded comments Getting Started - ----------------- Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing classes inherit from. Use the docstrings for examples of how to: - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes - construct character word-group expressions using the L{Word} class - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones - associate names with your parsed results using L{ParserElement.setResultsName} - find some helpful expression short-cuts like L{delimitedList} and L{oneOf} - find more useful common expressions in the L{pyparsing_common} namespace class z2.2.1z18 Sep 2018 00:49 UTCz*Paul McGuire N)ref)datetime)RLock)Iterable)MutableMapping) OrderedDict)iAndCaselessKeywordCaselessLiteral CharsNotInCombineDictEachEmpty FollowedByForward GoToColumnGroupKeywordLineEnd LineStartLiteral MatchFirstNoMatchNotAny OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalException ParseResultsParseSyntaxException ParserElement QuotedStringRecursiveGrammarExceptionRegexSkipTo StringEnd StringStartSuppressTokenTokenConverterWhiteWordWordEnd WordStart ZeroOrMore alphanumsalphas alphas8bit anyCloseTag anyOpenTag cStyleCommentcolcommaSeparatedListcommonHTMLEntity countedArraycppStyleCommentdblQuotedStringdblSlashComment delimitedListdictOfdowncaseTokensemptyhexnums htmlCommentjavaStyleCommentlinelineEnd lineStartlineno makeHTMLTags makeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence printablespunc8bitpythonStyleComment quotedString removeQuotesreplaceHTMLEntity replaceWith restOfLinesglQuotedStringsrange stringEnd stringStarttraceParseAction unicodeString upcaseTokens withAttribute indentedBlockoriginalTextForungroup infixNotation locatedExpr withClass CloseMatchtokenMappyparsing_commoncCsdt|tr|Sz t|WSty^t|td}td}|dd| |YS0dS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It then < returns the unicode object | encodes it with the default encoding | ... >. xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttry/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/pyparsing.pyz_ustr..N) isinstanceunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr)setParseActiontransformString)objretZ xmlcharrefryryrz_ustrs   rz6sum len sorted reversed list tuple set any all min maxccs|] }|VqdSNry).0yryryrz r|rcCs:d}dddD}t||D]\}}|||}q |S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nry)rsryryrzrr|z_xml_escape..zamp gt lt quot apos)splitzipreplace)data from_symbols to_symbolsfrom_to_ryryrz _xml_escapes rc@s eZdZdS) _ConstantsN)__name__ __module__ __qualname__ryryryrzrsr 0123456789Z ABCDEFabcdef\ccs|]}|tjvr|VqdSr)string whitespacercryryrzrr|c@sPeZdZdZdddZeddZdd Zd d Zd d Z dddZ ddZ dS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dur||_d|_n ||_||_||_|||f|_dSNr)locmsgpstr parserElementargs)selfrrrelemryryrz__init__szParseBaseException.__init__cCs||j|j|j|jS)z internal factory method to simplify creating one type of ParseException from another - avoids having __init__ signature conflicts among subclasses )rrrr)clsperyryrz_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dvr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are: - lineno - returns the line number of the exception text - col - returns the column number of the exception text - line - returns the line containing the exception text rL)r;columnrIN)rLrrr;rIAttributeError)ranameryryrz __getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrLrrryryrz__str__szParseBaseException.__str__cCst|Srrrryryrz__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop immediately because an unbacktrackable syntax error has been foundNrryryryrzr%sr%c@s eZdZdZddZddZdS)r(zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs ||_dSrparseElementTracerparseElementListryryrzr4sz"RecursiveGrammarException.__init__cCs d|jS)NzRecursiveGrammarException: %srrryryrzr7sz!RecursiveGrammarException.__str__N)rrrrrrryryryrzr(2sr(c@s,eZdZddZddZddZddZd S) _ParseResultsWithOffsetcCs||f|_dSrtup)rp1p2ryryrzr;sz _ParseResultsWithOffset.__init__cCs |j|Srrriryryrz __getitem__=sz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrryryrzr?sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrryryrz setOffsetAsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrryryryrzr:src@seZdZdZd[ddZddddefddZdd Zefd d Zd d Z ddZ ddZ ddZ e Z ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName}) Example:: integer = Word(nums) date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: # date_str = integer("year") + '/' + integer("month") + '/' + integer("day") # parseString returns a ParseResults object result = date_str.parseString("1999/12/31") def test(s, fn=repr): print("%s -> %s" % (s, fn(eval(s)))) test("list(result)") test("result[0]") test("result['month']") test("result.day") test("'month' in result") test("'minutes' in result") test("result.dump()", str) prints:: list(result) -> ['1999', '/', '12', '/', '31'] result[0] -> '1999' result['month'] -> '12' result.day -> '31' 'month' in result -> True 'minutes' in result -> False result.dump() -> ['1999', '/', '12', '/', '31'] - day: 31 - month: 12 - year: 1999 NTcCs"t||r|St|}d|_|SNT)r}object__new___ParseResults__doinit)rtoklistnameasListmodalretobjryryrzrks   zParseResults.__new__c Cs`|jrvd|_d|_d|_i|_||_||_|dur6g}||trP|dd|_n||trft||_n|g|_t |_ |dur\|r\|sd|j|<||t rt |}||_||t dttfr|ddgfvs\||tr|g}|r(||trt|d||<ntt|dd||<|||_n4z|d||<Wn"tttfyZ|||<Yn0dS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrvrr basestringr$rcopyKeyError TypeError IndexError)rrrrrr}ryryrzrtsB     $   zParseResults.__init__cCsPt|ttfr|j|S||jvr4|j|ddStdd|j|DSdS)NrtrcSsg|] }|dqSrryrvryryrz r|z,ParseResults.__getitem__..)r}rvslicerrrr$rryryrzrs   zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_ dSr) rrgetrrvrrr$wkrefr)rkrr}subryryrz __setitem__s   " zParseResults.__setitem__c Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}||j D]>\}}|D]0}t |D]"\}\}} t || | |k||<qqxqln|j |=dSNrr) r}rvrlenrrrangeindicesreverseritems enumerater) rrmylenremovedr occurrencesjrvaluepositionryryrz __delitem__s  zParseResults.__delitem__cCs ||jvSr)r)rrryryrz __contains__szParseResults.__contains__cCs t|jSr)rrrryryrz__len__r|zParseResults.__len__cCs |j Srrrryryrz__bool__r|zParseResults.__bool__cCs t|jSriterrrryryrz__iter__r|zParseResults.__iter__cCst|jdddSNrtr rryryrz __reversed__r|zParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrrr rryryrz _iterkeyss  zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdSrryrrrryrzrr|z+ParseResults._itervalues..rrryrrz _itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdSrryrrryrzrr|z*ParseResults._iteritems..rrryrrz _iteritemsszParseResults._iteritemscCs t|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rrrryryrzkeysszParseResults.keyscCs t|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r itervaluesrryryrzvaluesszParseResults.valuescCs t|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r iteritemsrryryrzrszParseResults.itemscCs t|jS)zSince keys() returns an iterator, this method is helpful in bypassing code that looks for the existence of any defined results names.)boolrrryryrzhaskeysszParseResults.haskeyscOs|s dg}|D]*\}}|dkr0|d|f}qtd|qt|dtsdt|dksd|d|vr~|d}||}||=|S|d}|SdS)a Removes and returns item at specified index (default=C{last}). Supports both C{list} and C{dict} semantics for C{pop()}. If passed no argument or an integer argument, it will use C{list} semantics and pop tokens from the list of parsed tokens. If passed a non-integer argument (most likely a string), it will use C{dict} semantics and pop the corresponding value from any defined results names. A second default return value argument is supported, just as in C{dict.pop()}. Example:: def remove_first(tokens): tokens.pop(0) print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321'] label = Word(alphas) patt = label("LABEL") + OneOrMore(Word(nums)) print(patt.parseString("AAB 123 321").dump()) # Use pop() in a parse action to remove named result (note that corresponding value is not # removed from list form of results) def remove_LABEL(tokens): tokens.pop("LABEL") return tokens patt.addParseAction(remove_LABEL) print(patt.parseString("AAB 123 321").dump()) prints:: ['AAB', '123', '321'] - LABEL: AAB ['AAB', '123', '321'] rtdefaultrz-pop() got an unexpected keyword argument '%s'rN)rrr}rvr)rrkwargsrrindexr defaultvalueryryrzpops""  zParseResults.popcCs||vr||S|SdS)ai Returns named result matching the given key, or if there is no such name, then returns the given C{defaultValue} or C{None} if no C{defaultValue} is specified. Similar to C{dict.get()}. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString("1999/12/31") print(result.get("year")) # -> '1999' print(result.get("hour", "not specified")) # -> 'not specified' print(result.get("hour")) # -> None Nry)rkey defaultValueryryrzr3szParseResults.getcCsR|j|||jD]4\}}t|D]"\}\}}t||||k||<q(qdS)a Inserts new element at location index in the list of parsed tokens. Similar to C{list.insert()}. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to insert the parse location in the front of the parsed results def insert_locn(locn, tokens): tokens.insert(0, locn) print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321'] N)rinsertrrrr)rrinsStrrrrrrryryrzr"IszParseResults.insertcCs|j|dS)a Add single element to end of ParseResults list of elements. Example:: print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321'] # use a parse action to compute the sum of the parsed integers, and add it to the end def append_sum(tokens): tokens.append(sum(map(int, tokens))) print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444] N)rappend)ritemryryrzr$]s zParseResults.appendcCs$t|tr||7}n |j|dS)a Add sequence of elements to end of ParseResults list of elements. Example:: patt = OneOrMore(Word(alphas)) # use a parse action to append the reverse of the matched strings, to make a palindrome def make_palindrome(tokens): tokens.extend(reversed([t[::-1] for t in tokens])) return ''.join(tokens) print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl' N)r}r$rextend)ritemseqryryrzr&ks  zParseResults.extendcCs|jdd=|jdS)z7 Clear all elements and results names. N)rrclearrryryrzr(}s zParseResults.clearcCshz ||WStyYdS0||jvr`||jvrF|j|ddStdd|j|DSndSdS)NrrtrcSsg|] }|dqSrryrryryrzrr|z,ParseResults.__getattr__..)rrrr$rrryryrzrs    zParseResults.__getattr__cCs|}||7}|Srr)rotherrryryrz__add__szParseResults.__add__cs|jrjt|jfdd|j}fdd|D}|D],\}}|||<t|dtr.c s4g|],\}}|D]}|t|d|dfqqSrr)rrrvlistr) addoffsetryrzrsz)ParseResults.__iadd__..r) rrrrr}r$rrrupdate)rr+ otheritemsotherdictitemsrrry)r2r.rz__iadd__s     zParseResults.__iadd__cCs&t|tr|dkr|S||SdSr)r}rvrrr+ryryrz__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrrrryryrzrszParseResults.__repr__cCsdddd|jDdS)N[, css(|] }t|trt|nt|VqdSr)r}r$rrrrryryrzrr|z'ParseResults.__str__..])rrrryryrzrszParseResults.__str__rcCsLg}|jD]<}|r |r ||t|tr8||7}q |t|q |Sr)rr$r}r$ _asStringListr)rsepoutr%ryryrzr=s   zParseResults._asStringListcCsdd|jDS)a Returns the parse results as a nested list of matching tokens, all converted to strings. Example:: patt = OneOrMore(Word(alphas)) result = patt.parseString("sldkj lsdkj sldkj") # even though the result prints in string-like form, it is actually a pyparsing ParseResults print(type(result), result) # -> ['sldkj', 'lsdkj', 'sldkj'] # Use asList() to create an actual list result_list = result.asList() print(type(result_list), result_list) # -> ['sldkj', 'lsdkj', 'sldkj'] cSs"g|]}t|tr|n|qSry)r}r$r)rresryryrzrr|z'ParseResults.asList..rrryryrzrszParseResults.asListcs6tr |j}n|j}fddtfdd|DS)a Returns the named parse results as a nested dictionary. Example:: integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") result = date_str.parseString('12/31/1999') print(type(result), repr(result)) # -> (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]}) result_dict = result.asDict() print(type(result_dict), repr(result_dict)) # -> {'day': '1999', 'year': '12', 'month': '31'} # even though a ParseResults supports dict-like access, sometime you just need to have a dict import json print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"} cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|] }|qSryryrtoItemryrzrr|z7ParseResults.asDict..toItem..)r}r$rasDict)rrAryrzrBs  z#ParseResults.asDict..toItemc3s|]\}}||fVqdSrryrrrrAryrzrr|z&ParseResults.asDict..)PY_3rrr)ritem_fnryrArzrCs  zParseResults.asDictcCs8t|j}|j|_|j|_|j|j|j|_|S)zA Returns a new copy of a C{ParseResults} object. )r$rrrrrr3rrrryryrzrs   zParseResults.copyFc CsLd}g}tdd|jD}|d}|s8d}d}d}d} |durJ|} n |jrV|j} | sf|rbdSd} |||d| d g7}t|jD]\} } t| tr| |vr|| || |o|du||g7}n|| d|o|du||g7}qd} | |vr|| } | s|rqnd} t t | } |||d| d | d | d g 7}q|||d | d g7}d |S) z (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.  css(|] \}}|D]}|d|fVqqdSrNryr0ryryrzrs z%ParseResults.asXML.. rNITEM<>.z %s%s- %s: rJrcss|]}t|tVqdSr)r}r$)rvvryryrzrr|z %s%s[%d]: %s%s%sr) r$rrrsortedrr}r$dumpranyrr) rrRdepthfullr?NLrrrrr_ryryrzrags,    4,zParseResults.dumpcOs tj|g|Ri|dS)a Pretty-printer for parsed results as a list, using the C{pprint} module. Accepts additional positional or keyword args as defined for the C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) Example:: ident = Word(alphas, alphanums) num = Word(nums) func = Forward() term = ident | num | Group('(' + func + ')') func <<= ident + Group(Optional(delimitedList(term))) result = func.parseString("fna a,b,(fnb c,d,200),100") result.pprint(width=40) prints:: ['fna', ['a', 'b', ['(', 'fnb', ['c', 'd', '200'], ')'], '100']] N)pprintrrrrryryrzrfszParseResults.pprintcCs.|j|j|jdur|p d|j|jffSr)rrrrrrrryryrz __getstate__szParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||durDt||_nd|_dSr)rrrrr3rr)rstater] inAccumNamesryryrz __setstate__s   zParseResults.__setstate__cCs|j|j|j|jfSr)rrrrrryryrz__getnewargs__szParseResults.__getnewargs__cCstt|t|Sr)rrrrrryryrzrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrr}rrrrrrr __nonzero__r r rrrrErrrrrrrrrr"r$r&r(rr,r6r8rrr=rrCrrOr[r^rarfrhrkrlrryryryrzr$Dsh& ' 4  # =% - r$cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rrrH)rrfind)rstrgrryryrzr;s r;cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators. The first line is number 1. Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{ParserElement.parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. rHrr)count)rroryryrzrLs rLcCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators. rHrrN)rnfind)rrolastCRnextCRryryrzrIs  rIcCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrLr;)instringrexprryryrz_defaultStartDebugActionsrwcCs$tdt|dt|dS)NzMatched z -> )rtrrr)rustartlocendlocrvtoksryryrz_defaultSuccessDebugActionsr{cCstdt|dS)NzException raised:)rtr)rurrvexcryryrz_defaultExceptionDebugActionsr}cGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nry)rryryrzrSsrSrscstvrfddSdgdgtdddkrFddd}dd d n tj}tjd }|dd d }|d|d|ffdd}d}ztdtdj}Wntyt}Yn0||_|S)Ncs|Srryrlrx)funcryrzr{r|z_trim_arity..rFrs)rqcSs8tdkr dnd}tj| |dd|}|ddgS)N)rqrrrlimitrs)system_version traceback extract_stack)rr. frame_summaryryryrzrsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nrrtrs)r extract_tb)tbrframesrryryrzrsz_trim_arity..extract_tbrrtrc sz"|dd}dd<|WStydr<n6z0td}|dddddkshW~n~0dkrdd7<YqYq0qdS)NrTrtrsrr)rrexc_info)rrrr foundArityrrmaxargspa_call_line_synthryrzwrapper-s    z_trim_arity..wrapperzr __class__)r)r) singleArgBuiltinsrrrrgetattrr Exceptionr)rrr LINE_DIFF this_liner func_nameryrrz _trim_aritys,     rcseZdZdZdZdZeddZeddZddd Z d d Z d d Z dddZ dddZ ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+urGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r&z)Abstract base level parser element class.z FcCs |t_dS)a Overrides the default whitespace chars Example:: # default whitespace chars are space, and newline OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def', 'ghi', 'jkl'] # change to just treat newline as significant ParserElement.setDefaultWhitespaceChars(" \t") OneOrMore(Word(alphas)).parseString("abc def\nghi jkl") # -> ['abc', 'def'] N)r&DEFAULT_WHITE_CHARScharsryryrzsetDefaultWhitespaceCharsTs z'ParserElement.setDefaultWhitespaceCharscCs |t_dS)a Set class to be used for inclusion of string literals into a parser. Example:: # default literal class used is Literal integer = Word(nums) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # change to Suppress ParserElement.inlineLiteralsUsing(Suppress) date_str = integer("year") + '/' + integer("month") + '/' + integer("day") date_str.parseString("1999/12/31") # -> ['1999', '12', '31'] N)r&_literalStringClass)rryryrzinlineLiteralsUsingcsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_ d|_ d|_ d|_ t|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)r parseAction failActionstrRepr resultsName saveAsListskipWhitespacer&r whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabs ignoreExprsdebug streamlined mayIndexErrorerrmsg modalResults debugActionsre callPreparse callDuringTry)rsavelistryryrzrxs(zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a$ Make a copy of this C{ParserElement}. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K") integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M")) prints:: [5120, 100, 655360, 268435456] Equivalent form of C{expr.copy()} is just C{expr()}:: integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M") N)rrrrr&rr)rcpyryryrzrs  zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af Define name for this expression, makes debugging and exception messages clearer. Example:: Word(nums).parseString("ABC") # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1) Word(nums).setName("integer").parseString("ABC") # -> Exception: Expected integer (at char 0), (line:1, col:1) Expected exception)rrrrrr)ryryrzsetNames    zParserElement.setNamecCs4|}|dr"|dd}d}||_| |_|S)aP Define name for referencing matching tokens as a nested attribute of the returned parse results. NOTE: this returns a *copy* of the original C{ParserElement} object; this is so that the client can define a basic element, such as an integer, and reference it in multiple places with different names. You can also set results names using the abbreviated syntax, C{expr("name")} in place of C{expr.setResultsName("name")} - see L{I{__call__}<__call__>}. Example:: date_str = (integer.setResultsName("year") + '/' + integer.setResultsName("month") + '/' + integer.setResultsName("day")) # equivalent form: date_str = integer("year") + '/' + integer("month") + '/' + integer("day") *NrtT)rendswithrr)rrlistAllMatchesnewselfryryrzsetResultsNames  zParserElement.setResultsNameTcs@|r&|jdfdd }|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is about to be parsed. Set C{breakFlag} to True to enable, False to disable. Tcsddl}|||||Sr)pdb set_trace)rur doActions callPreParser _parseMethodryrzbreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr)r breakFlagrryrrzsetBreaks  zParserElement.setBreakcOs&tttt||_|dd|_|S)a Define one or more actions to perform when successfully matching parse element definition. Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)}, C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where: - s = the original string being parsed (see note below) - loc = the location of the matching substring - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object If the functions in fns modify the tokens, they can return them as the return value from fn, and the modified list of tokens will replace the original. Otherwise, fn does not need to return any value. Optional keyword arguments: - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing Note: the default parsing behavior is to expand tabs in the input string before starting the parsing process. See L{I{parseString}} for more information on parsing strings containing C{}s, and suggested methods to maintain a consistent view of the parsed string, the parse location, and line and column positions within the parsed string. Example:: integer = Word(nums) date_str = integer + '/' + integer + '/' + integer date_str.parseString("1999/12/31") # -> ['1999', '/', '12', '/', '31'] # use parse action to convert to ints at parse time integer = Word(nums).setParseAction(lambda toks: int(toks[0])) date_str = integer + '/' + integer + '/' + integer # note that integer fields are now ints, not strings date_str.parseString("1999/12/31") # -> [1999, '/', 12, '/', 31] rF)rmaprrrrrfnsrryryrzrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}. See examples in L{I{copy}}. rF)rrrrrrrryryrzaddParseActionszParserElement.addParseActioncs^|dd|ddrtnt|D] fdd}|j|q$|jpV|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, functions passed to C{addCondition} need to return boolean success/fail of the condition. Optional keyword arguments: - message = define a custom message to be used in the raised exception - fatal = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException Example:: integer = Word(nums).setParseAction(lambda toks: int(toks[0])) year_int = integer.copy() year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later") date_str = year_int + '/' + integer + '/' + integer result = date_str.parseString("1999/12/31") # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1) messagezfailed user-defined conditionfatalFcs$tt|||s ||dSr)rrr~exc_typefnrryrzpa&sz&ParserElement.addCondition..par)rr#r!rr$r)rrrrryrrz addConditions zParserElement.addConditioncCs ||_|S)a Define action to perform if parsing fails at this expression. Fail acton fn is a callable function that takes the arguments C{fn(s,loc,expr,err)} where: - s = string being parsed - loc = location where expression match was attempted and failed - expr = the parse expression that failed - err = the exception thrown The function returns no value. It may throw C{L{ParseFatalException}} if it is desired to stop parsing immediately.)r)rrryryrz setFailAction-s zParserElement.setFailActionc CsLd}|rHd}|jD]2}z|||\}}d}qWqtyBYq0qq|SNTF)rrr!)rrur exprsFoundedummyryryrz_skipIgnorables:s    zParserElement._skipIgnorablescCsH|jr|||}|jrD|j}t|}||krD|||vrD|d7}q&|SNr)rrrrr)rrurwtinstrlenryryrzpreParseGs  zParserElement.preParsecCs|gfSrryrrurrryryrz parseImplSszParserElement.parseImplcCs|Srryrrur tokenlistryryrz postParseVszParserElement.postParsec Cs|j}|s|jr|jdr,|jd||||rD|jrD|||}n|}|}zBz||||\}}Wn&tyt|t||j |Yn0WnZt y} zB|jdr|jd|||| |jr||||| WYd} ~ n d} ~ 00n|r|jr|||}n|}|}|j s&|t|krhz||||\}}Wn(tydt|t||j |Yn0n||||\}}| |||}t ||j|j|jd} |jr|s|jr|rTzN|jD]B} | ||| }|durt ||j|jot|t tf|jd} qWnHt yP} z.|jdr:|jd|||| WYd} ~ n d} ~ 00nJ|jD]B} | ||| }|durZt ||j|jot|t tf|jd} qZ|r|jdr|jd||||| || fS)Nrrs)rrr)rrrrrrrr!rrrrrr$rrrrrr}r) rrurrr debuggingpreloc tokensStarttokenserr retTokensrryryrz _parseNoCacheZst              zParserElement._parseNoCachecCs>z|j||dddWSty8t|||j|Yn0dS)NF)rr)rr#r!rrrurryryrztryParses zParserElement.tryParsec Cs2z|||Wnttfy(YdS0dSdS)NFT)rr!rrryryrz canParseNexts zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrr cache not_in_cacheryrzrsz3ParserElement._UnboundedCache.__init__..getcs ||<dSrryrr rrryrzsetsz3ParserElement._UnboundedCache.__init__..setcs dSrr(rrryrzr(sz5ParserElement._UnboundedCache.__init__..clearcstSrrrrryrz cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes MethodTyperrr(r)rrrr(rryrrzrs    z&ParserElement._UnboundedCache.__init__Nrrrrryryryrz_UnboundedCachesrNc@seZdZddZdS)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS) Ncs |Srrrrryrzrs.ParserElement._FifoCache.__init__..getcs<||<tkr8zdWqty4Yq0qdSNF)rpopitemrr)rsizeryrzrs   .ParserElement._FifoCache.__init__..setcs dSrrrrryrzr(s0ParserElement._FifoCache.__init__..clearcstSrrrrryrzrs4ParserElement._FifoCache.__init__..cache_len) rr _OrderedDictrrrrr(rrrrrr(rry)rrrrzrs   !ParserElement._FifoCache.__init__Nrryryryrz _FifoCachesr c@seZdZddZdS)rcst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_ dS) Ncs |Srrrrryrzrsrcs4||<tkr&dq|dSr)rrpopleftr$r)rkey_fiforryrzrs rcsdSrrr)rr ryrzr(srcstSrrrrryrzrsr) rr collectionsdequerrrrr(rrry)rr rrrzrs   rNrryryryrzr src Cs0d\}}|||||f}tjtj}||} | |jurtj|d7<z|||||} Wn:ty} z"||| j | j WYd} ~ n8d} ~ 00||| d| d f| WdSnBtj|d7<t | t r| | d| d fWdSWdn1s"0YdS)Nr/rr)r&packrat_cache_lock packrat_cacherrpackrat_cache_statsrrrrrrr}r) rrurrrHITMISSlookuprrrryryrz _parseCaches$   zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r&rr(rrryryryrz resetCaches zParserElement.resetCachecCs8tjs4dt_|dur tt_n t|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happens often in many complex grammars) can immediately return a cached value, instead of re-executing parsing/validating code. Memoizing is done of both valid results and parsing exceptions. Parameters: - cache_size_limit - (default=C{128}) - if an integer value is provided will limit the size of the packrat cache; if None is passed, then the cache size will be unbounded; if 0 is passed, the cache will be effectively disabled. This speedup may break existing programs that use parse actions that have side-effects. For this reason, packrat parsing is disabled when you first import pyparsing. To activate the packrat feature, your program must call the class method C{ParserElement.enablePackrat()}. If your program uses C{psyco} to "compile as you go", you must call C{enablePackrat} before calling C{psyco.full()}. If you do not do this, Python will crash. For best results, call C{enablePackrat()} immediately after importing pyparsing. Example:: import pyparsing pyparsing.ParserElement.enablePackrat() TN)r&_packratEnabledrrr rr)cache_size_limitryryrz enablePackrat%s   zParserElement.enablePackratc Cst|js||jD] }|q|js8|}z<||d\}}|rr|||}t t }|||Wn2t y}ztj rn|WYd}~nd}~00|SdS)aC Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. If you want the grammar to require that the entire input string be successfully parsed, then set C{parseAll} to True (equivalent to ending the grammar with C{L{StringEnd()}}). Note: C{parseString} implicitly calls C{expandtabs()} on the input string, in order to report proper column numbers in parse actions. If the input string contains tabs and the grammar uses parse actions that use the C{loc} argument to index into the string being parsed, you can ensure you have a consistent view of the input string by: - calling C{parseWithTabs} on your grammar before calling C{parseString} (see L{I{parseWithTabs}}) - define your parse action using the full C{(s,loc,toks)} signature, and reference the input string using the parse action's C{s} argument - explicitly expand the tabs in your input string before calling C{parseString} Example:: Word('a').parseString('aaaaabaaa') # -> ['aaaaa'] Word('a').parseString('aaaaabaaa', parseAll=True) # -> Exception: Expected end of text rN) r&rr streamlinerr expandtabsrrrr+rverbose_stacktrace)rruparseAllrrrser|ryryrz parseStringHs$    zParserElement.parseStringc cs6|js||jD] }|q|js4t|}t|}d}|j}|j}t d} z||kr| |krz |||} ||| dd\} } Wnt y| d}YqZ0| |kr| d7} | | | fV|r|||} | |kr| }q|d7}q| }qZ| d}qZWn6t y0}zt j rn|WYd}~n d}~00dS)a Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. Note that the start and end locations are reported relative to the string being parsed. See L{I{parseString}} for more information on parsing strings with embedded tabs. Example:: source = "sldjf123lsdjjkf345sldkjf879lkjsfd987" print(source) for tokens,start,end in Word(alphas).scanString(source): print(' '*start + '^'*(end-start)) print(' '*start + tokens[0]) prints:: sldjf123lsdjjkf345sldkjf879lkjsfd987 ^^^^^ sldjf ^^^^^^^ lsdjjkf ^^^^^^ sldkjf ^^^^^^ lkjsfd rFrrN)rrrrrrrrrr&rr!rr)rru maxMatchesoverlaprrr preparseFnparseFnmatchesrnextLocrnextlocr|ryryrz scanStringzsB        zParserElement.scanStringc Csg}d}d|_z||D]Z\}}}|||||rpt|trR||7}nt|trf||7}n |||}q|||ddd|D}dtt t |WSt y}zt j rĂn|WYd}~n d}~00dS)af Extension to C{L{scanString}}, to modify matching text with modified tokens that may be returned from a parse action. To use C{transformString}, define a grammar and attach a parse action to it that modifies the returned token list. Invoking C{transformString()} on a target string will then scan for matches, and replace the matched text patterns according to the logic in the parse action. C{transformString()} returns the resulting transformed string. Example:: wd = Word(alphas) wd.setParseAction(lambda toks: toks[0].title()) print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york.")) Prints:: Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York. rTNcSsg|] }|r|qSryry)roryryrzrr|z1ParserElement.transformString..r)rr(r$r}r$rrrrr_flattenrr&r)rrur?lastErxrrr|ryryrzrs(    zParserElement.transformStringc CsTztdd|||DWStyN}ztjr6n|WYd}~n d}~00dS)a Another extension to C{L{scanString}}, simplifying the access to the tokens found to match the given parse expression. May be called with optional C{maxMatches} argument, to clip searching after 'n' matches are found. Example:: # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters cap_word = Word(alphas.upper(), alphas.lower()) print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")) # the sum() builtin can be used to merge results into a single ParseResults object print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))) prints:: [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']] ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity'] cSsg|]\}}}|qSryry)rrxrrryryrzrr|z.ParserElement.searchString..N)r$r(rr&r)rrur!r|ryryrz searchStrings zParserElement.searchStringc csTd}d}|j||dD]*\}}}|||V|r<|dV|}q||dVdS)a[ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split results. Example:: punc = oneOf(list(".,;:/-!?")) print(list(punc.split("This, this?, this sentence, is badly punctuated!"))) prints:: ['This', ' this', '', ' this sentence', ' is badly punctuated', ''] r)r!N)r() rrumaxsplitincludeSeparatorssplitslastrxrrryryrzrs  zParserElement.splitcCsFt|trt|}t|ts:tjdt|tdddSt||gS)a Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement converts them to L{Literal}s by default. Example:: greet = Word(alphas) + "," + Word(alphas) + "!" hello = "Hello, World!" print (hello, "->", greet.parseString(hello)) Prints:: Hello, World! -> ['Hello', ',', 'World', '!'] 4Cannot combine element of type %s with ParserElementrs stacklevelN) r}rr&rwarningswarnr SyntaxWarningrr7ryryrzr,s   zParserElement.__add__cCsBt|trt|}t|ts:tjdt|tdddS||S)z] Implementation of + operator when left operand is not a C{L{ParserElement}} r1rsr2Nr}rr&rr4r5rr6r7ryryrzr81s   zParserElement.__radd__cCsJt|trt|}t|ts:tjdt|tdddS|t |S)zQ Implementation of - operator, returns C{L{And}} with error stop r1rsr2N) r}rr&rr4r5rr6r _ErrorStopr7ryryrz__sub__=s   zParserElement.__sub__cCsBt|trt|}t|ts:tjdt|tdddS||S)z] Implementation of - operator when left operand is not a C{L{ParserElement}} r1rsr2Nr7r7ryryrz__rsub__Is   zParserElement.__rsub__cst|tr|d}}nt|tr|ddd}|ddurHd|df}t|dtr|ddur|ddkrvtS|ddkrtS|dtSqt|dtrt|dtr|\}}||8}qtdt|dt|dntdt||dkr td|dkrtd ||kr6dkrBnntd |rfd d |r|dkrt|}ntg||}n|}n|dkr}ntg|}|S) a Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is equivalent to C{expr*n + L{ZeroOrMore}(expr)} (read as "at least n instances of C{expr}") - C{expr*(None,n)} is equivalent to C{expr*(0,n)} (read as "0 to n instances of C{expr}") - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)} - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)} Note that C{expr*(None,n)} does not raise an exception if more than n exprs exist in the input stream; that is, C{expr*(None,n)} does not enforce a maximum number of expr occurrences. If this behavior is desired, then write C{expr*(None,n) + ~expr} r)NNNrsrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdSr)rnmakeOptionalListrryrzr>sz/ParserElement.__mul__..makeOptionalList) r}rvtupler4rrr ValueErrorr)rr+ minElements optElementsrryr=rz__mul__UsD             zParserElement.__mul__cCs ||Sr)rCr7ryryrz__rmul__szParserElement.__rmul__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zI Implementation of | operator - returns C{L{MatchFirst}} r1rsr2N) r}rr&rr4r5rr6rr7ryryrz__or__s   zParserElement.__or__cCsBt|trt|}t|ts:tjdt|tdddS||BS)z] Implementation of | operator when left operand is not a C{L{ParserElement}} r1rsr2Nr7r7ryryrz__ror__s   zParserElement.__ror__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zA Implementation of ^ operator - returns C{L{Or}} r1rsr2N) r}rr&rr4r5rr6rr7ryryrz__xor__s   zParserElement.__xor__cCsBt|trt|}t|ts:tjdt|tdddS||AS)z] Implementation of ^ operator when left operand is not a C{L{ParserElement}} r1rsr2Nr7r7ryryrz__rxor__s   zParserElement.__rxor__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zC Implementation of & operator - returns C{L{Each}} r1rsr2N) r}rr&rr4r5rr6rr7ryryrz__and__s   zParserElement.__and__cCsBt|trt|}t|ts:tjdt|tdddS||@S)z] Implementation of & operator when left operand is not a C{L{ParserElement}} r1rsr2Nr7r7ryryrz__rand__s   zParserElement.__rand__cCst|S)zE Implementation of ~ operator - returns C{L{NotAny}} )rrryryrz __invert__szParserElement.__invert__cCs|dur||S|SdS)a  Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}. If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be passed as C{True}. If C{name} is omitted, same as calling C{L{copy}}. Example:: # these are equivalent userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno") userdata = Word(alphas)("name") + Word(nums+"-")("socsecno") N)rrr)ryryrz__call__s zParserElement.__call__cCst|S)z Suppresses the output of this C{ParserElement}; useful to keep punctuation from cluttering up returned output. )r-rryryrzsuppressszParserElement.suppresscCs d|_|S)a Disables the skipping of whitespace before matching the characters in the C{ParserElement}'s defined pattern. This is normally only used internally by the pyparsing module, but may be needed in some whitespace-sensitive grammars. FrrryryrzleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8 Overrides the default whitespace chars TF)rrr)rrryryrzsetWhitespaceChars sz ParserElement.setWhitespaceCharscCs d|_|S)z Overrides default behavior to expand C{}s to spaces before parsing the input string. Must be called before C{parseString} when the input grammar contains elements that match C{} characters. T)rrryryrz parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jvrH|j|n|jt||S)a Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment or other ignorable patterns. Example:: patt = OneOrMore(Word(alphas)) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj'] patt.ignore(cStyleComment) patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd'] )r}rr-rr$rr7ryryrzignores   zParserElement.ignorecCs"|pt|p t|ptf|_d|_|S)zT Enable display of debugging messages while doing pattern matching. T)rwr{r}rr)r startAction successActionexceptionActionryryrzsetDebugActions6s zParserElement.setDebugActionscCs|r|tttnd|_|S)a Enable display of debugging messages while doing pattern matching. Set C{flag} to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd wd.setDebug() OneOrMore(term).parseString("abc 123 xyz 890") prints:: Match alphaword at loc 0(1,1) Matched alphaword -> ['abc'] Match alphaword at loc 3(1,4) Exception raised:Expected alphaword (at char 4), (line:1, col:5) Match alphaword at loc 7(1,8) Matched alphaword -> ['xyz'] Match alphaword at loc 11(1,12) Exception raised:Expected alphaword (at char 12), (line:1, col:13) Match alphaword at loc 15(1,16) Exception raised:Expected alphaword (at char 15), (line:1, col:16) The output shown is that produced by the default debug actions - custom debug actions can be specified using L{setDebugActions}. Prior to attempting to match the C{wd} expression, the debugging message C{"Match at loc (,)"} is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"} message is shown. Also note the use of L{setName} to assign a human-readable name to the expression, which makes debugging and exception messages easier to understand - for instance, the default name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}. F)rVrwr{r}r)rflagryryrzsetDebug@s#zParserElement.setDebugcCs|jSr)rrryryrzriszParserElement.__str__cCst|SrrrryryrzrlszParserElement.__repr__cCsd|_d|_|Sr)rrrryryrzroszParserElement.streamlinecCsdSrryrryryrzcheckRecursiontszParserElement.checkRecursioncCs|gdS)zj Check defined expressions for valid structure, check for infinite recursive definitions. N)rY)r validateTraceryryrzvalidatewszParserElement.validatec Csz |}WnDtyPt|d}|}Wdn1sB0YYn0z|||WSty}ztjrzn|WYd}~n d}~00dS)z Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. rN)readropenrrr&r)rfile_or_filenamer file_contentsfr|ryryrz parseFile}s   ,zParserElement.parseFilecsHt|tr"||up t|t|kSt|tr6||Stt||kSdSr)r}r&varsrr%superr7rryrz__eq__s    zParserElement.__eq__cCs ||k Srryr7ryryrz__ne__szParserElement.__ne__cCs tt|Sr)hashidrryryrz__hash__szParserElement.__hash__cCs||kSrryr7ryryrz__req__szParserElement.__req__cCs ||k Srryr7ryryrz__rne__szParserElement.__rne__cCs2z|jt||dWdSty,YdS0dS)a Method for quick testing of a parser against a test string. Good for simple inline microtests of sub expressions while building up larger parser. Parameters: - testString - to test against this expression for a match - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests Example:: expr = Word(nums) assert expr.matches("100") rTFN)rrr)r testStringrryryrzr%s  zParserElement.matches#c Cst|tr"tttj|}t|tr4t|}g}g}d} |D]} |dur^| | dsf|rr| sr| | qD| sxqDd || g} g}z:| dd} |j | |d} | | j|d| o| } Wntyt} zt| trdnd }d| vr(| t| j| | d t| j| d d |n| d | jd || d t| | oZ|} | } WYd} ~ nNd} ~ 0ty}z,| dt|| o|} |} WYd}~n d}~00|r|r| d td | | | | fqD| |fS)a3 Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and easy way to run a parse expression against a list of sample strings. Parameters: - tests - a list of separate test strings, or a multiline string of test strings - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests - comment - (default=C{'#'}) - expression for indicating embedded comments in the test string; pass None to disable comment filtering - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline; if False, only dump nested list - printResults - (default=C{True}) prints test output to stdout - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing Returns: a (success, results) tuple, where success indicates that all tests succeeded (or failed if C{failureTests} is True), and the results contain a list of lines of each test's output Example:: number_expr = pyparsing_common.number.copy() result = number_expr.runTests(''' # unsigned integer 100 # negative integer -100 # float with scientific notation 6.02e23 # integer with scientific notation 1e-12 ''') print("Success" if result[0] else "Failed!") result = number_expr.runTests(''' # stray character 100Z # missing leading digit before '.' -.100 # too many '.' 3.14.159 ''', failureTests=True) print("Success" if result[0] else "Failed!") prints:: # unsigned integer 100 [100] # negative integer -100 [-100] # float with scientific notation 6.02e23 [6.02e+23] # integer with scientific notation 1e-12 [1e-12] Success # stray character 100Z ^ FAIL: Expected end of text (at char 3), (line:1, col:4) # missing leading digit before '.' -.100 ^ FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1) # too many '.' 3.14.159 ^ FAIL: Expected end of text (at char 4), (line:1, col:5) Success Each test string must be on a single line. If you want to test a string that spans multiple lines, create a test like this:: expr.runTest(r"this is a test\n of strings that spans \n 3 lines") (Note that this is a raw string literal, you must include the leading 'r'.) TNFrH\nrm)rdz(FATAL)r r^zFAIL: zFAIL-EXCEPTION: )r}rrrrrrstrip splitlinesrr%r$rrrrarr#rIrr;rrt)rtestsrcommentfullDump printResults failureTests allResultscommentssuccessrxr?resultrrr|ryryrzrunTestssNW      $   zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)TroTTF)Orrrrrr staticmethodrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrr_MAX_INTr(rr,rr,r8r9r:rCrDrErFrGrHrIrJrKrLrMrOrPrQrRrVrXrrrrYr[rbrfrgrjrkrlr%r~ __classcell__ryryrerzr&Os     &     G   " 2G+    D           )    r&cs eZdZdZfddZZS)r.zT Abstract C{ParserElement} subclass, for defining atomic matching patterns. cstt|jdddSNFr)rdr.rrreryrzr@ szToken.__init__rrrrrrryryrerzr.< sr.cs eZdZdZfddZZS)rz, An empty token, will always match. cs$tt|d|_d|_d|_dS)NrTF)rdrrrrrrreryrzrH szEmpty.__init__rryryrerzrD srcs*eZdZdZfddZdddZZS)rz( A token that will never match. cs*tt|d|_d|_d|_d|_dS)NrTFzUnmatchable token)rdrrrrrrrreryrzrS s zNoMatch.__init__TcCst|||j|dSr)r!rrryryrzrZ szNoMatch.parseImpl)TrrrrrrrryryrerzrO s rcs*eZdZdZfddZdddZZS)ra Token to exactly match a specified string. Example:: Literal('blah').parseString('blah') # -> ['blah'] Literal('blah').parseString('blahfooblah') # -> ['blah'] Literal('blah').parseString('bla') # -> Exception: Expected "blah" For case-insensitive matching, use L{CaselessLiteral}. For keyword matching (force word break before and after the matched string), use L{Keyword} or L{CaselessKeyword}. cstt|||_t||_z|d|_Wn(tyTtj dt ddt |_ Yn0dt |j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrsr2"%s"rF)rdrrmatchrmatchLenfirstMatchCharrr4r5r6rrrrrrrr matchStringreryrzrl s    zLiteral.__init__TcCsJ|||jkr6|jdks&||j|r6||j|jfSt|||j|dSr)rr startswithrr!rrryryrzr s zLiteral.parseImpl)Trryryrerzr^ s rcsLeZdZdZedZdfdd Zddd Zfd d Ze d d Z Z S)ra\ Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with C{L{Literal}}: - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}. - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'} Accepts two optional constructor arguments in addition to the keyword string: - C{identChars} is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$" - C{caseless} allows case-insensitive matching, default is C{False}. Example:: Keyword("start").parseString("start") # -> ['start'] Keyword("start").parseString("starting") # -> Exception For case-insensitive matching, use L{CaselessKeyword}. _$NFcstt||durtj}||_t||_z|d|_Wn"ty\t j dt ddYn0d|j|_ d|j |_ d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrsr2rrF)rdrrDEFAULT_KEYWORD_CHARSrrrrrr4r5r6rrrrcaselessupper caselessmatchr identChars)rrrrreryrzr s(      zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jvr|dksj||d|jvr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jvr|dks||d|jvr||j|jfSt |||j |dSr) rrrrrrrrrr!rrryryrzr s4 zKeyword.parseImplcstt|}tj|_|Sr)rdrrrr)rrreryrzr sz Keyword.copycCs |t_dS)z,Overrides the default Keyword chars N)rrrryryrzsetDefaultKeywordChars szKeyword.setDefaultKeywordChars)NF)T) rrrrr5rrrrrrrryryrerzr s  rcs*eZdZdZfddZdddZZS)r al Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text. Example:: OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD'] (Contrast with example for L{CaselessKeyword}.) cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rdr rr returnStringrrrreryrzr s zCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dSr)rrrrr!rrryryrzr szCaselessLiteral.parseImpl)Trryryrerzr s r cs,eZdZdZdfdd Zd ddZZS) r z Caseless version of L{Keyword}. Example:: OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD'] (Contrast with example for L{CaselessLiteral}.) Ncstt|j||dddS)NTr)rdr r)rrrreryrzr szCaselessKeyword.__init__TcCsj||||j|jkrV|t||jksF|||j|jvrV||j|jfSt|||j|dSr)rrrrrrr!rrryryrzr szCaselessKeyword.parseImpl)N)Trryryrerzr sr cs,eZdZdZdfdd Zd ddZZS) rnax A variation on L{Literal} which matches "close" matches, that is, strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters: - C{match_string} - string to be matched - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match The results from a successful parse will contain the matched text from the input string and the following named results: - C{mismatches} - a list of the positions within the match_string where mismatches were found - C{original} - the original match_string used to compare against the input string If C{mismatches} is an empty list, then the match was an exact match. Example:: patt = CloseMatch("ATCATCGAATGGA") patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']}) patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1) # exact match patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']}) # close match allowing up to 2 mismatches patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2) patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']}) rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F) rdrnrr match_string maxMismatchesrrr)rrrreryrzr szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g} |j} tt||||jD]2\}} | \} } | | krN| |t| | krNqqN|d}t|||g}|j|d<| |d<||fSt|||j|dS)Nrroriginal mismatches) rrrrrr$r$r!r)rrurrstartrmaxlocrmatch_stringlocrrs_msrcmatresultsryryrzr s(    zCloseMatch.parseImpl)r)Trryryrerzrn s rncs8eZdZdZd fdd Zdd d Zfd d ZZS)r1a Token for matching words composed of allowed character sets. Defined with string containing all allowed initial characters, an optional string containing allowed body characters (if omitted, defaults to the initial character set), and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. An optional C{excludeChars} parameter can list characters that might be found in the input C{bodyChars} string; useful to define a word of all printables except for one or two characters, for instance. L{srange} is useful for defining custom character set strings for defining C{Word} expressions, using range notation from regular expression character sets. A common mistake is to use C{Word} to match a specific literal string, as in C{Word("Address")}. Remember that C{Word} uses the string argument to define I{sets} of matchable characters. This expression would match "Add", "AAA", "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'. To match an exact literal string, use L{Literal} or L{Keyword}. pyparsing includes helper strings for building Words: - L{alphas} - L{nums} - L{alphanums} - L{hexnums} - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.) - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.) - L{printables} (any non-whitespace character) Example:: # a word composed of digits integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9")) # a word with a leading capital, and zero or more lowercase capital_word = Word(alphas.upper(), alphas.lower()) # hostnames are alphanumeric, with leading alpha, and '-' hostname = Word(alphas, alphanums+'-') # roman numeral (not a strict parser, accepts invalid mix of characters) roman = Word("IVXLCDM") # any string of non-whitespace characters, except for ',' csv_value = Word(printables, excludeChars=",") NrrFcstt|rFdfdd|D}|rFdfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_ |dkrt d||_ |dkr||_ nt |_ |dkr||_ ||_ t||_d|j|_d |_||_d |j|jvr|dkr|dkr|dkr|j|jkr8d t|j|_nHt|jdkrfd t|jt|jf|_nd t|jt|jf|_|jrd|jd|_zt|j|_Wntyd|_Yn0dS)Nrc3s|]}|vr|VqdSrryr excludeCharsryrzr` r|z Word.__init__..c3s|]}|vr|VqdSrryrrryrzrb r|rrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFrqz[%s]+z%s[%s]*z [%s][%s]*z\b)rdr1rr initCharsOrigr initChars bodyCharsOrig bodyChars maxSpecifiedr@minLenmaxLenrrrrr asKeyword_escapeRegexRangeCharsreStringrrescapecompiler)rrrminmaxexactrrrerrzr] s\      0 z Word.__init__Tc Cs>|jr<|j||}|s(t|||j||}||fS|||jvrZt|||j||}|d7}t|}|j}||j }t ||}||kr|||vr|d7}qd} |||j krd} |j r||kr|||vrd} |j r|dkr||d|vs||kr|||vrd} | r.t|||j|||||fS)NrFTr)rrr!rendgrouprrrrrrrr) rrurrr}rr bodycharsrthrowExceptionryryrzr s6    2zWord.parseImplcstztt|WSty"Yn0|jdurndd}|j|jkr^d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)N...rrryryrz charsAsStr s z Word.__str__..charsAsStrz W:(%s,%s)zW:(%s))rdr1rrrrr)rrreryrzr s   z Word.__str__)NrrrFN)Trrrrrrrrryryrerzr1. s.6 #r1csFeZdZdZeedZd fdd Zd ddZ fd d Z Z S) r)a Token for matching strings that match a given regular expression. Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module. If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as named parse results. Example:: realnum = Regex(r"[+-]?\d+\.\d*") date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)') # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})") z[A-Z]rcstt|t|tr|s,tjdtdd||_||_ zt |j|j |_ |j|_ Wqt jytjd|tddYq0n2t|tjr||_ t||_|_ ||_ ntdt||_d|j|_d|_d|_d S) zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrsr2$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rdr)rr}rr4r5r6patternflagsrrr sre_constantserrorcompiledREtyperr@rrrrr)rrrreryrzr s6       zRegex.__init__TcCs`|j||}|s"t|||j||}|}t|}|rX|D]}||||<qF||fSr)rrr!rr groupdictr$r)rrurrr}drrryryrzr s zRegex.parseImplcsDztt|WSty"Yn0|jdur>dt|j|_|jS)NzRe:(%s))rdr)rrrrrrreryrzr s  z Regex.__str__)r)T) rrrrrrrrrrrrryryrerzr) s  " r)cs8eZdZdZd fdd Zd ddZfd d ZZS) r'a Token for matching strings that are delimited by quoting characters. Defined with the following parameters: - quoteChar - string of one or more characters defining the quote delimiting string - escChar - character to escape quotes, typically backslash (default=C{None}) - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None}) - multiline - boolean indicating whether quotes can span multiple lines (default=C{False}) - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True}) - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar) - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True}) Example:: qs = QuotedString('"') print(qs.searchString('lsjdf "This is the quote" sldjf')) complex_qs = QuotedString('{{', endQuoteChar='}}') print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf')) sql_qs = QuotedString('"', escQuote='""') print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf')) prints:: [['This is the quote']] [['This is the "quote"']] [['This is the quote with "embedded" quotes']] NFTc sLtt|}|s0tjdtddt|dur>|}n"|}|s`tjdtddt|_t |_ |d_ |_ t |_ |_|_|_|_|rtjtjB_dtjtj d|durt|pdf_n.rt)z|(?:%s)z|(?:%s.)z(.)z)*%srrFT)%rdr'rrr4r5r6 SyntaxError quoteCharr quoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr MULTILINEDOTALLrrrrrrescCharReplacePatternrrrrrrrrr)rrrr multilinerrrrerrzr/ sz           zQuotedString.__init__c Cs|||jkr|j||pd}|s4t|||j||}|}|jr||j|j }t |t rd|vr|j rddddd}| D]\}}|||}q|jrt|jd|}|jr||j|j}||fS)N\ rH  )\trpz\fz\rz\g<1>)rrrr!rrrrrrr}rrrrrrrrr) rrurrr}rws_mapwslitwscharryryrzrp s*  zQuotedString.parseImplcsFztt|WSty"Yn0|jdur@d|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rdr'rrrrrrreryrzr s  zQuotedString.__str__)NNFTNT)Trryryrerzr' sA #r'cs8eZdZdZd fdd Zd ddZfd d ZZS) r a Token for matching words composed of characters I{not} in a given set (will include whitespace in matched characters if not listed in the provided exclusion set - see example). Defined with string containing all disallowed characters, and an optional minimum, maximum, and/or exact length. The default value for C{min} is 1 (a minimum value < 1 is not valid); the default values for C{max} and C{exact} are 0, meaning no maximum or exact length restriction. Example:: # define a comma-separated-value as anything that is not a ',' csv_value = CharsNotIn(',') print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213")) prints:: ['dkls', 'lsdkjf', 's12 34', '@!#', '213'] rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t ||_ d|j |_ |jdk|_ d|_ dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rdr rrnotCharsr@rrrrrrrr)rrrrrreryrzr s    zCharsNotIn.__init__TcCs|||jvrt|||j||}|d7}|j}t||jt|}||krb|||vrb|d7}qD|||jkrt|||j|||||fSr)rr!rrrrr)rrurrrnotcharsmaxlenryryrzr s  zCharsNotIn.parseImplcsdztt|WSty"Yn0|jdur^t|jdkrRd|jdd|_n d|j|_|jS)Nrz !W:(%s...)z!W:(%s))rdr rrrrrrreryrzr s   zCharsNotIn.__str__)rrr)Trryryrerzr s r cs<eZdZdZddddddZdfd d ZdddZZS)r0a Special matching class for matching whitespace. Normally, whitespace is ignored by pyparsing grammars. This class is included when some whitespace structures are significant. Define with a string containing the whitespace characters to be matched; default is C{" \t\r\n"}. Also takes optional C{min}, C{max}, and C{exact} arguments, as defined for the C{L{Word}} class. zzzzz)rqrrHrr rrcstt|_dfddjDdddjD_d_dj_ |_ |dkrt|_ nt _ |dkr|_ |_ dS)Nrc3s|]}|jvr|VqdSr) matchWhiterrryrzr r|z!White.__init__..css|]}tj|VqdSr)r0 whiteStrsrryryrzr r|Trr) rdr0rrrPrrrrrrrr)rwsrrrrerrzr s  zWhite.__init__TcCs|||jvrt|||j||}|d7}||j}t|t|}||krb|||jvrb|d7}qB|||jkrt|||j|||||fSr)rr!rrrrr)rrurrrrryryrzr s  zWhite.parseImpl)rrrr)T)rrrrrrrrryryrerzr0 sr0cseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rdrrrrrrrrreryrzr s z_PositionToken.__init__rrrrrryryrerzr srcs2eZdZdZfddZddZd ddZZS) rzb Token to advance to a specific column of input text; useful for tabular report scraping. cstt|||_dSr)rdrrr;)rcolnoreryrzr$ szGoToColumn.__init__cCs\t|||jkrXt|}|jr*|||}||krX||rXt|||jkrX|d7}q*|Sr)r;rrrisspace)rrurrryryrzr( s $ zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected columnr;r!)rrurrthiscolnewlocrryryrzr1 s    zGoToColumn.parseImpl)T)rrrrrrrrryryrerzr s  rcs*eZdZdZfddZdddZZS)ra Matches if current position is at the beginning of a line within the parse string Example:: test = ''' AAA this line AAA and this line AAA but not this one B AAA and definitely not this one ''' for t in (LineStart() + 'AAA' + restOfLine).searchString(test): print(t) Prints:: ['AAA', ' this line'] ['AAA', ' and this line'] cstt|d|_dS)NzExpected start of line)rdrrrrreryrzrO szLineStart.__init__TcCs*t||dkr|gfSt|||j|dSr)r;r!rrryryrzrS szLineStart.parseImpl)Trryryrerzr: s rcs*eZdZdZfddZdddZZS)rzU Matches if current position is at the end of a line within the parse string cs,tt||tjddd|_dS)NrHrzExpected end of line)rdrrrPr&rrrrreryrzr\ szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)NrHrrr!rrryryrzra s     zLineEnd.parseImpl)TrryryrerzrX s rcs*eZdZdZfddZdddZZS)r,zM Matches if current position is at the beginning of the parse string cstt|d|_dS)NzExpected start of text)rdr,rrrreryrzrp szStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfSr)rr!rrryryrzrt szStringStart.parseImpl)Trryryrerzr,l s r,cs*eZdZdZfddZdddZZS)r+zG Matches if current position is at the end of the parse string cstt|d|_dS)NzExpected end of text)rdr+rrrreryrzr szStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dSrrrryryrzr s    zStringEnd.parseImpl)Trryryrerzr+{ s r+cs.eZdZdZeffdd ZdddZZS)r3ap Matches if the current position is at the beginning of a Word, and is not preceded by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of the string being parsed, or at the beginning of a line. cs"tt|t||_d|_dS)NzNot at the start of a word)rdr3rr wordCharsrrrreryrzr s zWordStart.__init__TcCs@|dkr8||d|jvs(|||jvr8t|||j||gfSr)rr!rrryryrzr s  zWordStart.parseImpl)TrrrrrXrrrryryrerzr3 sr3cs.eZdZdZeffdd ZdddZZS)r2aZ Matches if the current position is at the end of a Word, and is not followed by any character in a given set of C{wordChars} (default=C{printables}). To emulate the C{} behavior of regular expressions, use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of the string being parsed, or at the end of a line. cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rdr2rrrrrrreryrzr s zWordEnd.__init__TcCsPt|}|dkrH||krH|||jvs8||d|jvrHt|||j||gfSr)rrr!r)rrurrrryryrzr szWordEnd.parseImpl)Trryryrerzr2 sr2cseZdZdZdfdd ZddZddZd d Zfd d Zfd dZ fddZ dfdd Z gfddZ fddZ ZS)r"z^ Abstract subclass of ParserElement, for combining and post-processing parsed tokens. Fcstt||t|tr"t|}t|tr.F)rdr"rr}rrrr&rexprsrallrrrrrrreryrzr s      zParseExpression.__init__cCs |j|Sr)rrryryrzr szParseExpression.__getitem__cCs|j|d|_|Sr)rr$rr7ryryrzr$ s zParseExpression.appendcCs0d|_dd|jD|_|jD] }|q|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on all contained expressions.FcSsg|] }|qSryr*rrryryrzr r|z3ParseExpression.leaveWhitespace..)rrrO)rrryryrzrO s   zParseExpression.leaveWhitespacecsrt|trB||jvrntt|||jD]}||jdq*n,tt|||jD]}||jdqX|Sr )r}r-rrdr"rRr)rr+rreryrzrR s    zParseExpression.ignorecsLztt|WSty"Yn0|jdurFd|jjt|jf|_|jSNz%s:(%s)) rdr"rrrrrrrrreryrzr s  zParseExpression.__str__cs*tt||jD] }|qt|jdkr|jd}t||jr|js|jdur|j s|jdd|jdg|_d|_ |j |j O_ |j |j O_ |jd}t||jr|js|jdur|j s|jdd|jdd|_d|_ |j |j O_ |j |j O_ dt ||_|S)Nrsrrrtr)rdr"rrrr}rrrrrrrrr)rrr+reryrzr s<     zParseExpression.streamlinecstt|||}|Sr)rdr"r)rrrrreryrzr szParseExpression.setResultsNamecCs6|dd|g}|jD]}||q|gdSr)rr[rY)rrZtmprryryrzr[ s  zParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|] }|qSryr*rryryrzr% r|z(ParseExpression.copy..)rdr"rrrGreryrzr# szParseExpression.copy)F)F)rrrrrrr$rOrRrrrr[rrryryrerzr" s " r"csTeZdZdZGdddeZdfdd ZdddZd d Zd d Z d dZ Z S)ra  Requires all given C{ParseExpression}s to be found in the given order. Expressions may be separated by whitespace. May be constructed using the C{'+'} operator. May also be constructed using the C{'-'} operator, which will suppress backtracking. Example:: integer = Word(nums) name_expr = OneOrMore(Word(alphas)) expr = And([integer("id"),name_expr("name"),integer("age")]) # more easily written as: expr = integer("id") + name_expr("name") + integer("age") cseZdZfddZZS)zAnd._ErrorStopcs*ttj|j|i|d|_|dS)N-)rdrr8rrrOrgreryrzr9 szAnd._ErrorStop.__init__rryryrerzr88 sr8TcsRtt|||tdd|jD|_||jdj|jdj|_d|_ dS)Ncss|] }|jVqdSrrrryryrzr@ r|zAnd.__init__..rT) rdrrrrrrPrrrrreryrzr> s z And.__init__c Cs|jdj|||dd\}}d}|jddD]}t|tjrDd}q.|rz||||\}}WqtyrYqty}zd|_t|WYd}~qd}~0t yt|t ||j |Yq0n||||\}}|s| r.||7}q.||fS)NrFr rT) rrr}rr8r%r __traceback__rrrrr) rrurr resultlist errorStopr exprtokensrryryrzrE s(     z And.parseImplcCst|trt|}||Srr}rr&rr$r7ryryrzr6^ s  z And.__iadd__cCs6|dd|g}|jD]}|||jsq2qdSr)rrYrrrsubRecCheckListrryryrzrYc s   zAnd.checkRecursioncCs@t|dr|jS|jdur:dddd|jDd|_|jS)Nr{rqcss|]}t|VqdSrrrryryrzro r|zAnd.__str__..}rrrrrrryryrzrj s    z And.__str__)T)T) rrrrrr8rrr6rYrrryryrerzr( s rcsDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the expression that matches the longest string will be used. May be constructed using the C{'^'} operator. Example:: # construct Or using '^' operator number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) prints:: [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrryryrzr r|zOr.__init__..T)rdrrrrbrrreryrzr sz Or.__init__Tc CsTd}d}g}|jD]}z|||}Wnvtyd} z&d| _| j|krP| }| j}WYd} ~ qd} ~ 0tyt||krt|t||j|}t|}Yq0|||fq|r*|j ddd|D]`\} }z| |||WSty&} z(d| _| j|kr| }| j}WYd} ~ qd} ~ 00q|durB|j|_ |nt||d|dS)NrtcSs |d Srry)xryryrzr{ r|zOr.parseImpl..)r  no defined alternatives to match) rrr!rrrrrr$sortrr) rrurr maxExcLoc maxExceptionr%rloc2r_ryryrzr s<       z Or.parseImplcCst|trt|}||Srrr7ryryrz__ixor__ s  z Or.__ixor__cCs@t|dr|jS|jdur:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdSrrrryryrzr r|zOr.__str__..rrrryryrzr s    z Or.__str__cCs,|dd|g}|jD]}||qdSrrrYrryryrzrY s zOr.checkRecursion)F)T) rrrrrrrrrYrryryrerzrt s   & rcsDeZdZdZdfdd ZdddZdd Zd d Zd d ZZ S)ra Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(Word(nums) + '.' + Word(nums)) print(number.searchString("123 3.1416 789")) # Fail! -> [['123'], ['3'], ['1416'], ['789']] # put more selective expression first number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums) print(number.searchString("123 3.1416 789")) # Better -> [['123'], ['3.1416'], ['789']] Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|] }|jVqdSrrrryryrzr r|z&MatchFirst.__init__..T)rdrrrrbrrreryrzr szMatchFirst.__init__Tc Csd}d}|jD]}z||||}|WStyb}z |j|krN|}|j}WYd}~qd}~0tyt||krt|t||j|}t|}Yq0q|dur|j|_|nt||d|dS)Nrtr)rrr!rrrrr) rrurrrrrrrryryrzr s$     zMatchFirst.parseImplcCst|trt|}||Srrr7ryryrz__ior__ s  zMatchFirst.__ior__cCs@t|dr|jS|jdur:dddd|jDd|_|jS)Nrr | css|]}t|VqdSrrrryryrzr r|z%MatchFirst.__str__..rrrryryrzr s    zMatchFirst.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzrYs zMatchFirst.checkRecursion)F)T) rrrrrrrrrYrryryrerzr s   rcs<eZdZdZd fdd Zd ddZddZd d ZZS) ram Requires all given C{ParseExpression}s to be found, but in any order. Expressions may be separated by whitespace. May be constructed using the C{'&'} operator. Example:: color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN") shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON") integer = Word(nums) shape_attr = "shape:" + shape_type("shape") posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn") color_attr = "color:" + color("color") size_attr = "size:" + integer("size") # use Each (using operator '&') to accept attributes in any order # (shape and posn are required, color and size are optional) shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr) shape_spec.runTests(''' shape: SQUARE color: BLACK posn: 100, 120 shape: CIRCLE size: 50 color: BLUE posn: 50,80 color:GREEN size:20 shape:TRIANGLE posn:20,40 ''' ) prints:: shape: SQUARE color: BLACK posn: 100, 120 ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']] - color: BLACK - posn: ['100', ',', '120'] - x: 100 - y: 120 - shape: SQUARE shape: CIRCLE size: 50 color: BLUE posn: 50,80 ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']] - color: BLUE - posn: ['50', ',', '80'] - x: 50 - y: 80 - shape: CIRCLE - size: 50 color: GREEN size: 20 shape: TRIANGLE posn: 20,40 ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']] - color: GREEN - posn: ['20', ',', '40'] - x: 20 - y: 40 - shape: TRIANGLE - size: 20 Tcs8tt|||tdd|jD|_d|_d|_dS)Ncss|] }|jVqdSrrrryryrzr?r|z Each.__init__..T)rdrrrrrrinitExprGroupsrreryrzr=sz Each.__init__c s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d |_|}|jdd}|jddg}d } | rh||j|j} g} | D]t} z| ||}Wnt y| | Yq0| |j t | | | |vr>| | q| vr܈ | qt| t| krd } q|rd d d|D} t ||d | |fdd|jD7}g}|D]"} | |||\}}| |qt|tg}||fS)Ncss&|]}t|trt|j|fVqdSr)r}rrirvrryryrzrEr|z!Each.parseImpl..cSsg|]}t|tr|jqSryr}rrvrryryrzrFr|z"Each.parseImpl..cSs g|]}|jrt|ts|qSry)rr}rrryryrzrGr|cSsg|]}t|tr|jqSry)r}r4rvrryryrzrIr|cSsg|]}t|tr|jqSry)r}rrvrryryrzrJr|cSs g|]}t|tttfs|qSry)r}rr4rrryryrzrKr|FTr:css|]}t|VqdSrrrryryrzrfr|z*Missing one or more required elements (%s)cs$g|]}t|tr|jvr|qSryr rtmpOptryrzrjr|)r rropt1map optionalsmultioptionals multirequiredrequiredrr!r$rriremoverrrsumr$)rrurropt1opt2tmpLoctmpReqd matchOrder keepMatchingtmpExprsfailedrmissingrr finalResultsryr rzrCsP    zEach.parseImplcCs@t|dr|jS|jdur:dddd|jDd|_|jS)Nrrz & css|]}t|VqdSrrrryryrzryr|zEach.__str__..rrrryryrzrts    z Each.__str__cCs,|dd|g}|jD]}||qdSrrrryryrzrY}s zEach.checkRecursion)T)T) rrrrrrrrYrryryrerzrs 5 1 rcsleZdZdZdfdd ZdddZdd Zfd d Zfd d ZddZ gfddZ fddZ Z S)r za Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens. Fcstt||t|tr@ttjtr2t|}ntt |}||_ d|_ |dur|j |_ |j |_ ||j|j|_|j|_|j|_|j|jdSr)rdr rr}r issubclassr&rr.rrvrrrrPrrrrrr&rrvrreryrzrs    zParseElementEnhance.__init__TcCs2|jdur|jj|||ddStd||j|dS)NFr r)rvrr!rrryryrzrs zParseElementEnhance.parseImplcCs*d|_|j|_|jdur&|j|Sr)rrvrrOrryryrzrOs    z#ParseElementEnhance.leaveWhitespacecsrt|trB||jvrntt|||jdurn|j|jdn,tt|||jdurn|j|jd|Sr )r}r-rrdr rRrvr7reryrzrRs    zParseElementEnhance.ignorecs&tt||jdur"|j|Sr)rdr rrvrreryrzrs  zParseElementEnhance.streamlinecCsB||vrt||g|dd|g}|jdur>|j|dSr)r(rvrY)rrrryryrzrYs  z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdur(|j||gdSrrvr[rYrrZrryryrzr[s  zParseElementEnhance.validatecsVztt|WSty"Yn0|jdurP|jdurPd|jjt|jf|_|jSr) rdr rrrrvrrrrreryrzrs zParseElementEnhance.__str__)F)T) rrrrrrrOrRrrYr[rrryryrerzr s   r cs*eZdZdZfddZdddZZS)ra Lookahead matching of the given parse expression. C{FollowedBy} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression matches at the current position. C{FollowedBy} always returns a null token list. Example:: # use FollowedBy to match a label only if it is followed by a ':' data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint() prints:: [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']] cstt||d|_dSr)rdrrrrrvreryrzrszFollowedBy.__init__TcCs|j|||gfSr)rvrrryryrzrszFollowedBy.parseImpl)Trryryrerzrs rcs2eZdZdZfddZd ddZddZZS) ra Lookahead to disallow matching with the given parse expression. C{NotAny} does I{not} advance the parsing position within the input string, it only verifies that the specified parse expression does I{not} match at the current position. Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny} always returns a null token list. May be constructed using the '~' operator. Example:: cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rdrrrrrrvrr"reryrzrszNotAny.__init__TcCs&|j||rt|||j||gfSr)rvrr!rrryryrzrszNotAny.parseImplcCs4t|dr|jS|jdur.dt|jd|_|jS)Nrz~{rrrrrrvrryryrzrs   zNotAny.__str__)Trryryrerzrs  rcs(eZdZdfdd ZdddZZS) _MultipleMatchNcsFtt||d|_|}t|tr.t|}|dur<|nd|_dSr) rdr$rrr}rr&r not_ender)rrvstopOnenderreryrzr s   z_MultipleMatch.__init__Tc Cs|jj}|j}|jdu}|r$|jj}|r2|||||||dd\}}zV|j } |r`|||| rp|||} n|} ||| |\}} | s| rR|| 7}qRWnttfyYn0||fSNFr ) rvrrr%rrrr!r) rrurrself_expr_parseself_skip_ignorables check_ender try_not_enderrhasIgnoreExprsr tmptokensryryrzrs*      z_MultipleMatch.parseImpl)N)T)rrrrrrryryrerzr$ sr$c@seZdZdZddZdS)ra Repetition of one or more of the given expression. Parameters: - expr - expression that must match one or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: BLACK" OneOrMore(attr_expr).parseString(text).pprint() # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']] # use stopOn attribute for OneOrMore to avoid reading label string as part of the data attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']] # could also be written as (attr_expr * (1,)).parseString(text).pprint() cCs4t|dr|jS|jdur.dt|jd|_|jS)Nrrz}...r#rryryrzrJs   zOneOrMore.__str__N)rrrrrryryryrzr0srcs8eZdZdZd fdd Zd fdd Zdd ZZS) r4aw Optional repetition of zero or more of the given expression. Parameters: - expr - expression that must match zero or more times - stopOn - (default=C{None}) - expression for a terminating sentinel (only required if the sentinel would ordinarily match the repetition expression) Example: similar to L{OneOrMore} Ncstt|j||dd|_dS)N)r&T)rdr4rr)rrvr&reryrzr_szZeroOrMore.__init__Tc s:ztt||||WSttfy4|gfYS0dSr)rdr4rr!rrreryrzrcszZeroOrMore.parseImplcCs4t|dr|jS|jdur.dt|jd|_|jS)Nrr9]...r#rryryrzris   zZeroOrMore.__str__)N)Trryryrerzr4Ss r4c@s eZdZddZeZddZdS) _NullTokencCsdSrryrryryrzrssz_NullToken.__bool__cCsdSrryrryryrzrvsz_NullToken.__str__N)rrrrrmrryryryrzr0rsr0cs6eZdZdZeffdd Zd ddZddZZS) raa Optional matching of the given expression. Parameters: - expr - expression that must match zero or more times - default (optional) - value to be returned if the optional expression is not found. Example:: # US postal code can be a 5-digit zip, plus optional 4-digit qualifier zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4))) zip.runTests(''' # traditional ZIP code 12345 # ZIP+4 form 12101-0001 # invalid ZIP 98765- ''') prints:: # traditional ZIP code 12345 ['12345'] # ZIP+4 form 12101-0001 ['12101-0001'] # invalid ZIP 98765- ^ FAIL: Expected end of text (at char 5), (line:1, col:6) cs.tt|j|dd|jj|_||_d|_dS)NFrT)rdrrrvrr!r)rrvrreryrzrs zOptional.__init__Tc Csxz|jj|||dd\}}WnRttfyn|jturf|jjr\t|jg}|j||jj<qj|jg}ng}Yn0||fSr()rvrr!rr!_optionalNotMatchedrr$)rrurrrryryrzrs    zOptional.parseImplcCs4t|dr|jS|jdur.dt|jd|_|jS)Nrr9r<r#rryryrzrs   zOptional.__str__)T) rrrrr1rrrrryryrerzrzs" rcs,eZdZdZd fdd Zd ddZZS) r*a Token for skipping over all undefined text until the matched expression is found. Parameters: - expr - target expression marking the end of the data to be skipped - include - (default=C{False}) if True, the target expression is also parsed (the skipped text and target expression are returned as a 2-element list). - ignore - (default=C{None}) used to define grammars (typically quoted strings and comments) that might contain false matches to the target expression - failOn - (default=C{None}) define expressions that are not allowed to be included in the skipped test; if found before the target expression is found, the SkipTo is not a match Example:: report = ''' Outstanding Issues Report - 1 Jan 2000 # | Severity | Description | Days Open -----+----------+-------------------------------------------+----------- 101 | Critical | Intermittent system crash | 6 94 | Cosmetic | Spelling error on Login ('log|n') | 14 79 | Minor | System slow when running too many reports | 47 ''' integer = Word(nums) SEP = Suppress('|') # use SkipTo to simply match everything up until the next SEP # - ignore quoted strings, so that a '|' character inside a quoted string does not match # - parse action will call token.strip() for each matched token, i.e., the description body string_data = SkipTo(SEP, ignore=quotedString) string_data.setParseAction(tokenMap(str.strip)) ticket_expr = (integer("issue_num") + SEP + string_data("sev") + SEP + string_data("desc") + SEP + integer("days_open")) for tkt in ticket_expr.searchString(report): print tkt.dump() prints:: ['101', 'Critical', 'Intermittent system crash', '6'] - days_open: 6 - desc: Intermittent system crash - issue_num: 101 - sev: Critical ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14'] - days_open: 14 - desc: Spelling error on Login ('log|n') - issue_num: 94 - sev: Cosmetic ['79', 'Minor', 'System slow when running too many reports', '47'] - days_open: 47 - desc: System slow when running too many reports - issue_num: 79 - sev: Minor FNcs`tt||||_d|_d|_||_d|_t|t rFt ||_ n||_ dt |j|_dS)NTFzNo match found for )rdr*r ignoreExprrr includeMatchrr}rr&rfailOnrrvr)rr+includerRr4reryrzrs zSkipTo.__init__Tc Cs"|}t|}|j}|jj}|jdur,|jjnd}|jdurB|jjnd} |} | |kr|durf||| rfq| durz| || } WqntyYqYqn0qnz||| dddWqtt fy| d7} YqJ0qqJt|||j || }|||} t | } |j r||||dd\}} | | 7} || fS)NF)rrrr ) rrvrr4rr2rrr!rrr$r3)rrurrrxrrv expr_parseself_failOn_canParseNextself_ignoreExpr_tryParsetmplocskiptext skipresultrryryrzrs:    zSkipTo.parseImpl)FNN)Trryryrerzr*s6 r*csbeZdZdZdfdd ZddZddZd d Zd d Zgfd dZ ddZ fddZ Z S)raK Forward declaration of an expression to be defined later - used for recursive grammars, such as algebraic infix notation. When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator. Note: take care when assigning to C{Forward} not to overlook precedence of operators. Specifically, '|' has a lower precedence than '<<', so that:: fwdExpr << a | b | c will actually be evaluated as:: (fwdExpr << a) | b | c thereby leaving b and c out as parseable alternatives. It is recommended that you explicitly group the values inserted into the C{Forward}:: fwdExpr << (a | b | c) Converting to use the '<<=' operator instead will avoid this problem. See L{ParseResults.pprint} for an example of a recursive parser created using C{Forward}. Ncstt|j|dddSr)rdrrr7reryrzr@szForward.__init__cCsjt|trt|}||_d|_|jj|_|jj|_||jj |jj |_ |jj |_ |j |jj |Sr)r}rr&rrvrrrrPrrrrr&r7ryryrz __lshift__Cs      zForward.__lshift__cCs||>Srryr7ryryrz __ilshift__PszForward.__ilshift__cCs d|_|SrrNrryryrzrOSszForward.leaveWhitespacecCs$|js d|_|jdur |j|Sr)rrvrrryryrzrWs   zForward.streamlinecCs>||vr0|dd|g}|jdur0|j||gdSrr r!ryryrzr[^s   zForward.validatecCs^t|dr|jS|jjdSz&|jdur4t|j}nd}W|j|_n |j|_0|jjd|S)Nrz: ...Nonez: )rrrrZ _revertClass_ForwardNoRecurservr)r retStringryryrzres    zForward.__str__cs.|jdurtt|St}||K}|SdSr)rvrdrrrGreryrzrvs  z Forward.copy)N) rrrrrr<r=rOrr[rrrryryrerzr-s  rc@seZdZddZdS)r?cCsdS)Nrryrryryrzrsz_ForwardNoRecurse.__str__N)rrrrryryryrzr?~sr?cs"eZdZdZdfdd ZZS)r/zQ Abstract subclass of C{ParseExpression}, for converting parsed results. Fcstt||d|_dSr)rdr/rrrreryrzrszTokenConverter.__init__)Frryryrerzr/sr/cs6eZdZdZd fdd ZfddZdd ZZS) r a Converter to concatenate all matching tokens to a single string. By default, the matching patterns must also be contiguous in the input string; this can be disabled by specifying C{'adjacent=False'} in the constructor. Example:: real = Word(nums) + '.' + Word(nums) print(real.parseString('3.1416')) # -> ['3', '.', '1416'] # will also erroneously match the following print(real.parseString('3. 1416')) # -> ['3', '.', '1416'] real = Combine(Word(nums) + '.' + Word(nums)) print(real.parseString('3.1416')) # -> ['3.1416'] # no match when there are internal spaces print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...) rTcs8tt|||r|||_d|_||_d|_dSr)rdr rrOadjacentr joinStringr)rrvrBrAreryrzrszCombine.__init__cs(|jrt||ntt|||Sr)rAr&rRrdr r7reryrzrRszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rr$rr=rBrrr)rrurrretToksryryrzrs  "zCombine.postParse)rT)rrrrrrRrrryryrerzr s r cs(eZdZdZfddZddZZS)ra Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions. Example:: ident = Word(alphas) num = Word(nums) term = ident | num func = ident + Optional(delimitedList(term)) print(func.parseString("fn a,b,100")) # -> ['fn', 'a', 'b', '100'] func = ident + Group(Optional(delimitedList(term))) print(func.parseString("fn a,b,100")) # -> ['fn', ['a', 'b', '100']] cstt||d|_dSr)rdrrrr"reryrzrszGroup.__init__cCs|gSrryrryryrzrszGroup.postParserrrrrrrryryrerzrs rcs(eZdZdZfddZddZZS)r aW Converter to return a repetitive expression as a list, but also as a dictionary. Each element can also be referenced using the first token in the expression as its key. Useful for tabular report scraping when the first column can be used as a item key. Example:: data_word = Word(alphas) label = data_word + FollowedBy(':') attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join)) text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) # print attributes as plain groups print(OneOrMore(attr_expr).parseString(text).dump()) # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names result = Dict(OneOrMore(Group(attr_expr))).parseString(text) print(result.dump()) # access named fields as dict entries, or output as dict print(result['shape']) print(result.asDict()) prints:: ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap'] [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'} See more examples at L{ParseResults} of accessing fields by results name. cstt||d|_dSr)rdr rrr"reryrzrsz Dict.__init__cCst|D]\}}t|dkrq|d}t|tr@t|d}t|dkr\td|||<qt|dkrt|dtst|d|||<q|}|d=t|dkst|tr| rt||||<qt|d|||<q|j r|gS|SdS)Nrrrrs) rrr}rvrrrr$rrr)rrurrrtokikey dictvalueryryrzrs$   zDict.postParserDryryrerzr s# r c@s eZdZdZddZddZdS)r-aV Converter for ignoring the results of a parsed expression. Example:: source = "a, b, c,d" wd = Word(alphas) wd_list1 = wd + ZeroOrMore(',' + wd) print(wd_list1.parseString(source)) # often, delimiters that are useful during parsing are just in the # way afterward - use Suppress to keep them out of the parsed output wd_list2 = wd + ZeroOrMore(Suppress(',') + wd) print(wd_list2.parseString(source)) prints:: ['a', ',', 'b', ',', 'c', ',', 'd'] ['a', 'b', 'c', 'd'] (See also L{delimitedList}.) cCsgSrryrryryrzrszSuppress.postParsecCs|SrryrryryrzrM"szSuppress.suppressN)rrrrrrMryryryrzr- sr-c@s(eZdZdZddZddZddZdS) rzI Wrapper for parse actions, to ensure they are only called once. cCst||_d|_dSr)rcallablecalled)r methodCallryryrzr*s zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rIrHr!)rrrrxrryryrzrL-s zOnlyOnce.__call__cCs d|_dSr)rIrryryrzreset3szOnlyOnce.resetN)rrrrrrLrKryryryrzr&srcs8tfdd}z j|_Wnty2Yn0|S)at Decorator for debugging parse actions. When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".} When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised. Example:: wd = Word(alphas) @traceParseAction def remove_duplicate_chars(tokens): return ''.join(sorted(set(''.join(tokens)))) wds = OneOrMore(wd).setParseAction(remove_duplicate_chars) print(wds.parseString("slkdjs sld sldd sdlf sdljf")) prints:: >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {})) <>entering %s(line: '%s', %d, %r) z<.z)rrr)rarRryrQrzrd6s   rd,FcCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)a Helper to define a delimited list of expressions - the delimiter defaults to ','. By default, the list elements and delimiters can have intervening whitespace, and comments, but this can be overridden by passing C{combine=True} in the constructor. If C{combine} is set to C{True}, the matching tokens are returned as a single token string, with the delimiters included; otherwise, the matching tokens are returned as a list of tokens, with the delimiters suppressed. Example:: delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc'] delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE'] z [rqr/N)rr r4rr-)rvdelimcombinedlNameryryrzrBbs $rBcsjtfdd}|dur0ttdd}n|}|d|j|dd|d td S) a: Helper to define a counted list of expressions. This helper defines a pattern of the form:: integer expr expr expr... where the leading integer tells how many expr expressions follow. The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed. If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value. Example:: countedArray(Word(alphas)).parseString('2 ab cd ef') # -> ['ab', 'cd'] # in this parser, the leading integer value is given in binary, # '10' indicating that 2 values are in the array binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2)) countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef') # -> ['ab', 'cd'] cs.|d}|r ttg|p&tt>gSr)rrrE)rrrxr< arrayExprrvryrzcountFieldParseActions"z+countedArray..countFieldParseActionNcSs t|dSr)rvrwryryrzr{r|zcountedArray..arrayLenTrz(len) r)rr1rTrrrrr)rvintExprrYryrWrzr>us r>cCs6g}|D](}t|tr&|t|q||q|Sr)r}rr&r*r$)Lrrryryrzr*s   r*cs6tfdd}|j|dddt|S)a* Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousLiteral(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches a previous literal, will also match the leading C{"1:1"} in C{"1:10"}. If this is not desired, use C{matchPreviousExpr}. Do I{not} use with packrat parsing enabled. csP|rBt|dkr|d>qLt|}tdd|D>n t>dS)Nrrcss|]}t|VqdSr)rrttryryrzrr|zDmatchPreviousLiteral..copyTokenToRepeater..)rr*rrr)rrrxtflatrepryrzcopyTokenToRepeaters   z1matchPreviousLiteral..copyTokenToRepeaterTr[(prev) )rrrr)rvrcryrarzrQs  rQcsFt|}|Kfdd}|j|dddt|S)aS Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = matchPreviousExpr(first) matchExpr = first + ":" + second will match C{"1:1"}, but not C{"1:2"}. Because this matches by expressions, will I{not} match the leading C{"1:1"} in C{"1:10"}; the expressions are evaluated first, and then compared, so C{"1"} is compared with C{"10"}. Do I{not} use with packrat parsing enabled. cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)r*rr!)rrrx theseTokens matchTokensryrzmustMatchTheseTokenss zLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr[)r*rr)rrrxrhrarfrzrcs  z.matchPreviousExpr..copyTokenToRepeaterTr[rd)rrrrr)rve2rcryrarzrPs rPcCs:dD]}||t|}q|dd}|dd}t|S)Nz\^-]rHrprr)r_bslashr)rrryryrzrs   rTc s|rdd}dd}tndd}dd}tg}t|trF|}n$t|trZt|}ntjdt dd|stt Sd }|t |d kr||}t ||d d D]R\}} || |r|||d =qxq||| r|||d =| || | }qxq|d 7}qx|s|rzlt |t d |krTtd d dd|Dd|WStddd|Dd|WSWn$tytjdt ddYn0tfdd|Dd|S)a Helper to quickly define a set of alternative Literals, and makes sure to do longest-first testing when there is a conflict, regardless of the input order, but returns a C{L{MatchFirst}} for best performance. Parameters: - strs - a string of space-delimited literals, or a collection of string literals - caseless - (default=C{False}) - treat all literals as caseless - useRegex - (default=C{True}) - as an optimization, will generate a Regex object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or if creating a C{Regex} raises an exception) Example:: comp_oper = oneOf("< = > <= >= !=") var = Word(alphas) number = Word(nums) term = var | number comparison_expr = term + comp_oper + term print(comparison_expr.searchString("B = 12 AA=23 B<=AA AA>12")) prints:: [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']] cSs||kSr)rr-bryryrzr{r|zoneOf..cSs||Sr)rrrkryryrzr{r|cSs||kSrryrkryryrzr{r|cSs ||Sr)rrkryryrzr{r|z6Invalid argument to oneOf, expected string or iterablersr2rrNrz[%s]css|]}t|VqdSr)rrsymryryrzrr|zoneOf..r|css|]}t|VqdSr)rrrmryryrzrr|z7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdSrryrmparseElementClassryrzr$r|)r rr}rrrrr4r5r6rrrr"rr)rrr) strsruseRegexisequalmaskssymbolsrcurrr+ryrprzrUsP         ** rUcCsttt||S)a Helper to easily and clearly define a dictionary by specifying the respective patterns for the key and value. Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens in the proper order. The key pattern can include delimiting markers or punctuation, as long as they are suppressed, thereby leaving the significant key text. The value pattern can include named results, so that the C{Dict} results can include named token fields. Example:: text = "shape: SQUARE posn: upper left color: light blue texture: burlap" attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)) print(OneOrMore(attr_expr).parseString(text).dump()) attr_label = label attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join) # similar to Dict, but simpler call format result = dictOf(attr_label, attr_value).parseString(text) print(result.dump()) print(result['shape']) print(result.shape) # object attribute access works too print(result.asDict()) prints:: [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']] - color: light blue - posn: upper left - shape: SQUARE - texture: burlap SQUARE SQUARE {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'} )r r4r)r rryryrzrC&s!rCcCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S) a Helper to return the original, untokenized text for a given expression. Useful to restore the parsed fields of an HTML start tag into the raw tag text itself, or to revert separate tokens with intervening whitespace back to the original matching input text. By default, returns astring containing the original parsed text. If the optional C{asString} argument is passed as C{False}, then the return value is a C{L{ParseResults}} containing any results names that were originally matched, and a single token containing the original matched text from the input string. So if the expression passed to C{L{originalTextFor}} contains expressions with defined results names, you must set C{asString} to C{False} if you want to preserve those results name values. Example:: src = "this is test bold text normal text " for tag in ("b","i"): opener,closer = makeHTMLTags(tag) patt = originalTextFor(opener + SkipTo(closer) + closer) print(patt.searchString(src)[0]) prints:: [' bold text '] ['text'] cSs|Srry)rrrxryryrzr{ar|z!originalTextFor..F_original_start _original_endcSs||j|jSr)rxryr~ryryrzr{fr|cSs&||d|dg|dd<dS)Nrxry)rr~ryryrz extractTexthsz$originalTextFor..extractText)rrrrr)rvasString locMarker endlocMarker matchExprrzryryrzriIs  ricCst|ddS)zp Helper to undo pyparsing's default grouping of And expressions, even if all but one are non-empty. cSs|dSrryrwryryrzr{sr|zungroup..)r/r)rvryryrzrjnsrjcCs4tdd}t|d|d|dS)a Helper to decorate a returned token with its starting and ending locations in the input string. This helper adds the following results names: - locn_start = location where matched expression begins - locn_end = location where matched expression ends - value = the actual parsed results Be careful if the input text contains C{} characters, you may want to call C{L{ParserElement.parseWithTabs}} Example:: wd = Word(alphas) for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"): print(match) prints:: [[0, 'ljsdf', 5]] [[8, 'lksdjjf', 15]] [[18, 'lkkjj', 23]] cSs|Srryr~ryryrzr{r|zlocatedExpr.. locn_startrlocn_end)rrrrrO)rvlocatorryryrzrlusrlrErKrJrcrbz\[]-*.$+^?()~ rcCs |ddSrryr~ryryrzr{r|r{z\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0x)unichrrvlstripr~ryryrzr{r|z \\0[0-7]+cCstt|ddddS)Nrr)rrvr~ryryrzr{r|z\]rr9rrnegatebodyr<csDddz"dfddt|jDWSty>YdS0dS)a Helper to easily define string ranges for use in Word construction. Borrows syntax from regexp '[]' string range definitions:: srange("[0-9]") -> "0123456789" srange("[a-z]") -> "abcdefghijklmnopqrstuvwxyz" srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_" The input string must be enclosed in []'s, and the returned string is the expanded character set joined into a single string. The values enclosed in the []'s may be: - a single character - an escaped character with a leading backslash (such as C{\-} or C{\]}) - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) (C{\0x##} is also supported for backwards compatibility) - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character) - a range of any of the above, separated by a dash (C{'a-z'}, etc.) - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.) cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdSr)rrryryrzrr|z+srange....rr)r}r$rrord)pryryrzr{r|zsrange..rc3s|]}|VqdSrry)rpart _expandedryrzrr|zsrange..N)r_reBracketExprrrrrryrrzras " racsfdd}|S)zt Helper method for defining parse actions that require matching at a specific column in the input text. cs"t||krt||ddS)Nzmatched token not at column %dr)rolocnrzr;ryrz verifyColsz!matchOnlyAtCol..verifyColry)r<rryr;rzrOs rOcs fddS)a Helper method for common parse actions that simply return a literal value. Especially useful when used with C{L{transformString}()}. Example:: num = Word(nums).setParseAction(lambda toks: int(toks[0])) na = oneOf("N/A NA").setParseAction(replaceWith(math.nan)) term = na | num OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234] csgSrryr~replStrryrzr{r|zreplaceWith..ryrryrrzr^s r^cCs|dddS)a Helper parse action for removing quotation marks from parsed quoted strings. Example:: # by default, quotation marks are included in parsed results quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"] # use removeQuotes to strip quotation marks from parsed results quotedString.setParseAction(removeQuotes) quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"] rrrtryr~ryryrzr\s r\csLfdd}ztdtdj}Wnty@t}Yn0||_|S)aG Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional args are passed, they are forwarded to the given function as additional arguments after the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the parsed data to an integer using base 16. Example (compare the last to example in L{ParserElement.transformString}:: hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16)) hex_ints.runTests(''' 00 11 22 aa FF 0a 0d 1a ''') upperword = Word(alphas).setParseAction(tokenMap(str.upper)) OneOrMore(upperword).runTests(''' my kingdom for a horse ''') wd = Word(alphas).setParseAction(tokenMap(str.title)) OneOrMore(wd).setParseAction(' '.join).runTests(''' now is the winter of our discontent made glorious summer by this sun of york ''') prints:: 00 11 22 aa FF 0a 0d 1a [0, 17, 34, 170, 255, 10, 13, 26] my kingdom for a horse ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE'] now is the winter of our discontent made glorious summer by this sun of york ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York'] csfdd|DS)Ncsg|]}|gRqSryry)rtoknrrryrzrr|z(tokenMap..pa..ryr~rryrzrsztokenMap..parr)rrrr)rrrrryrrzros   rocCs t|Srrrrwryryrzr{r|cCs t|Srrlowerrwryryrzr{r|c Cst|tr|}t|| d}n|j}tttd}|rt t }t d|dt t t|t d|tddgdd  d d t d }nd ddtD}t t t|B}t d|dt t t| ttt d|tddgdd  dd t d }ttd|d }|dd |ddd|}|dd |ddd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerz_-:rLtag=/FrrEcSs |ddkSNrrryr~ryryrzr{r|z_makeTags..rMrcss|]}|dvr|VqdS)rMNryrryryrzrr|z_makeTags..cSs |ddkSrryr~ryryrzr{r|rNr:rqz<%s>rz)r}rrrr1r6r5r@rrr\r-r r4rrrrrXr[rDr _Lrtitlerrr)tagStrxmlresname tagAttrName tagAttrValueopenTagZprintablesLessRAbrackcloseTagryryrz _makeTags s> ..rcCs t|dS)a  Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = 'More info at the pyparsing wiki page' # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple a,a_end = makeHTMLTags("A") link_expr = a + SkipTo(a_end)("link_text") + a_end for link in link_expr.searchString(text): # attributes in the tag (like "href" shown here) are also accessible as named results print(link.link_text, '->', link.href) prints:: pyparsing -> http://pyparsing.wikispaces.com FrrryryrzrM(srMcCs t|dS)z Helper to construct opening and closing tag expressions for XML, given a tag name. Matches tags only in the given upper/lower case. Example: similar to L{makeHTMLTags} TrrryryrzrN;srNcs8|r|ddn|ddDfdd}|S)a< Helper to create a validating parse action to be used with start tags created with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag with a required attribute value, to avoid false matches on common tags such as C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSryryrDryryrzrzr|z!withAttribute..csZD]P\}}||vr$t||d||tjkr|||krt||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r!rg ANY_VALUE)rrrattrName attrValueattrsryrzr{s  zwithAttribute..pa)r)rattrDictrryrrzrgDs 2 rgcCs"|r d|nd}tfi||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)rg) classname namespace classattrryryrzrms rm(rcCst}||||B}t|D]l\}}|ddd\}} } } | dkrPd|nd|} | dkr|dustt|dkr|td|\} }t| }| tjkr^| d krt||t|t |}n| dkr|durt|||t|t ||}nt||t|t |}nD| dkrTt|| |||t|| |||}ntd n| tj krB| d krt |t st |}t|j |t||}n| dkr|durt|||t|t ||}nt||t|t |}nD| dkr8t|| |||t|| |||}ntd ntd | rvt | ttfrl|j| n || ||| |BK}|}q||K}|S) aD Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] rNrrqz%s termz %s%s termrsz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)rrrr@rrVLEFTrrrRIGHTr}rrvr?rr)baseExpropListlparrparrlastExprroperDefopExprarityrightLeftAssocrtermNameopExpr1opExpr2thisExprr~ryryrzrksZ=   &       &    rkz4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|dur*t|tr"t|tr"t|dkrt|dkr|durtt|t||tjdd dd}n$t t||tj dd}nx|durtt|t |t |ttjdd dd}n4ttt |t |ttjdd d d}ntd t }|durd|tt|t||B|Bt|K}n$|tt|t||Bt|K}|d ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrrcSs |dSrrrwryryrzr{gr|znestedExpr..cSs |dSrrrwryryrzr{jr|cSs |dSrrrwryryrzr{pr|cSs |dSrrrwryryrzr{tr|zOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)r@r}rrr rr r&rrrErrrrr-r4r)openerclosercontentr2rryryrzrR%sH:    *$rRc sfdd}fdd}fdd}ttd}tt|d}t|d }t|d } |rtt||t|t|t|| } n$tt|t|t|t|} | t t| d S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrtzillegal nestingznot a peer entry)rr;r#r!rrrxcurCol indentStackryrzcheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrtznot a subentry)r;r$r!rrryrzcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}r6|dkr6|dksBt||ddS)Nrtrznot an unindent)rr;r!rrrryrz checkUnindents   z$indentedBlock..checkUnindentz INDENTrUNINDENTzindented block) rrrPrMrrrrrrRrj) blockStatementExprrrRrrrrerPEERUNDENTsmExprryrrzrhs(N   rhz#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Proz);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprentityrwryryrzr]sr]z/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentr commaItemrr<c@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrtryrwryryrzr{r|zpyparsing_common.rz"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 address)rrz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdSrI)rp _ipv6_partr%r^ryryrzrr|z,pyparsing_common...r)rrwryryrzr{r|z::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sPzt|dWStyJ}zt||t|WYd}~n d}~00dSr)rstrptimedater@r!rrrrxvefmtryrzcvt_fnsz.pyparsing_common.convertToDate..cvt_fnryrrryrrz convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sLzt|dWStyF}zt||t|WYd}~n d}~00dSr)rrr@r!rrrryrzrsz2pyparsing_common.convertToDatetime..cvt_fnryrryrrzconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rp_html_stripperr)rrrryryrz stripHTMLTagss zpyparsing_common.stripHTMLTagsrSrrrrrzcomma separated listcCs t|Srrrwryryrzr{"r|cCs t|Srrrwryryrzr{%r|N)r)r)?rrrrrorvconvertToIntegerfloatconvertToFloatr1rTrrrrFrr)signed_integerrrrrM mixed_integerrrealsci_realrnumberrr6r5r ipv4_addressr_full_ipv6_address_short_ipv6_addressr_mixed_ipv6_addressr ipv6_address mac_addressrrr iso8601_dateiso8601_datetimeuuidr9r8rrrrrrXr0 _commasepitemrBr[rcomma_separated_listrfrDryryryrzrpsV"" 2     rp__main__selectfromrrL)rUcolumnsrZtablescommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rs)rSF)N)FT)T)r)T)r __version____versionTime__ __author__rweakrefrrrrr4rrr rfrrr_threadr ImportError threadingcollections.abcrrrrZ ordereddict__all__r? version_inforrEmaxsizerrrchrrrrrr`reversedrrrbrrrrZmaxintxranger __builtin__rfnamer$rrrrrrrascii_uppercaseascii_lowercaser6rTrFr5rjr printablerXrrr!r#r%r(rr$registerr;rLrIrwr{r}rSrr&r.rrrrrrr r rnr1r)r'r r0rrrrr,r+r3r2r"rrrrr rrr$rr4r0r1rr*rr?r/r rr r-rrdrBr>r*rQrPrrUrCrirjrlrrErKrJrcrbr _escapedPunc_escapedHexChar_escapedOctChar _singleChar _charRangerrrarOr^r\rorfrDrrMrNrgrrmrVrrrkrWr@r`r[rerRrhr7rYr9r8rrrrr=r]r:rGrOr_rAr?rHrZrrr<rprZ selectTokenZ fromTokenidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLr~rrrrrryryryrzs4          8      @v &A= I G3pLOD|M &#@sQ,A,    I# %     0 ,   ? #p  Z r   "    "   PK!|y.@.@._vendor/__pycache__/ordered_set.cpython-39.pycnu[a (Re;@szdZddlZddlmZzddlmZmZWn"eyNddlmZmZYn0e dZ dZ ddZ Gdd d eeZ dS) z An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, and released under the MIT license. N)deque) MutableSetSequencez3.1cCs"t|do t|t o t|t S)a  Are we being asked to look up a list of things, instead of a single thing? We check for the `__iter__` attribute so that this can cover types that don't have to be known by this module, such as NumPy arrays. Strings, however, should be considered as atomic values to look up, not iterables. The same goes for tuples, since they are immutable and therefore valid entries. We don't need to check for the Python 2 `unicode` type, because it doesn't have an `__iter__` attribute anyway. __iter__)hasattr isinstancestrtuple)objr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/ordered_set.py is_iterables    r c@seZdZdZd;ddZddZddZd d Zd d Zd dZ ddZ ddZ e Z ddZ ddZeZeZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)< OrderedSetz An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Example: >>> OrderedSet([1, 1, 2, 3, 2]) OrderedSet([1, 2, 3]) NcCs g|_i|_|dur||O}dSN)itemsmap)selfiterabler r r __init__4szOrderedSet.__init__cCs t|jS)z Returns the number of unique elements in the ordered set Example: >>> len(OrderedSet([])) 0 >>> len(OrderedSet([1, 2])) 2 )lenrrr r r __len__:s zOrderedSet.__len__cs|t|tr|tkrSt|r4fdd|DSt|dsHt|trlj|}t|trf|S|Sn t d|dS)aQ Get the item at a given index. If `index` is a slice, you will get back that slice of items, as a new OrderedSet. If `index` is a list or a similar iterable, you'll get a list of items corresponding to those indices. This is similar to NumPy's "fancy indexing". The result is not an OrderedSet because you may ask for duplicate indices, and the number of elements returned should be the number of elements asked for. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset[1] 2 csg|]}j|qSr )r).0irr r [z*OrderedSet.__getitem__.. __index__z+Don't know how to index an OrderedSet by %rN) rslice SLICE_ALLcopyr rrlist __class__ TypeError)rindexresultr rr __getitem__Fs   zOrderedSet.__getitem__cCs ||S)z Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False )r!rr r r res zOrderedSet.copycCst|dkrdSt|SdS)Nrr)rr rr r r __getstate__ss zOrderedSet.__getstate__cCs"|dkr|gn ||dS)Nr)r)rstater r r __setstate__s zOrderedSet.__setstate__cCs ||jvS)z Test if the item is in this ordered set Example: >>> 1 in OrderedSet([1, 3, 2]) True >>> 5 in OrderedSet([1, 3, 2]) False )rrkeyr r r __contains__s zOrderedSet.__contains__cCs0||jvr&t|j|j|<|j||j|S)aE Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) OrderedSet([3]) )rrrappendr)r r r adds  zOrderedSet.addcCsDd}z|D]}||}q Wn"ty>tdt|Yn0|S)a< Update the set with the given iterable sequence, then return the index of the last element inserted. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.update([3, 1, 5, 1, 4]) 4 >>> print(oset) OrderedSet([1, 2, 3, 5, 4]) Nz(Argument needs to be an iterable, got %s)r-r" ValueErrortype)rsequenceZ item_indexitemr r r updates   zOrderedSet.updatecs$t|rfdd|DSj|S)aH Get the index of a given entry, raising an IndexError if it's not present. `key` can be an iterable of entries that is not a string, in which case this returns a list of indices. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.index(2) 1 csg|]}|qSr )r#)rsubkeyrr r rrz$OrderedSet.index..)r rr)r rr r#s zOrderedSet.indexcCs,|jstd|jd}|jd=|j|=|S)z Remove and return the last element from the set. Raises KeyError if the set is empty. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.pop() 3 z Set is empty)rKeyErrorr)relemr r r pops  zOrderedSet.popcCsP||vrL|j|}|j|=|j|=|jD]\}}||kr,|d|j|<q,dS)a Remove an element. Do not raise an exception if absent. The MutableSet mixin uses this to implement the .remove() method, which *does* raise an error when asked to remove a non-existent item. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) N)rr)rr*rkvr r r discards zOrderedSet.discardcCs|jdd=|jdS)z8 Remove all items from this OrderedSet. N)rrclearrr r r r<s zOrderedSet.clearcCs t|jS)zb Example: >>> list(iter(OrderedSet([1, 2, 3]))) [1, 2, 3] )iterrrr r r rszOrderedSet.__iter__cCs t|jS)zf Example: >>> list(reversed(OrderedSet([1, 2, 3]))) [3, 2, 1] )reversedrrr r r __reversed__ szOrderedSet.__reversed__cCs&|sd|jjfSd|jjt|fS)Nz%s()z%s(%r))r!__name__r rr r r __repr__szOrderedSet.__repr__cCsPt|ttfrt|t|kSz t|}Wnty>YdS0t||kSdS)a Returns true if the containers have the same items. If `other` is a Sequence, then order is checked, otherwise it is ignored. Example: >>> oset = OrderedSet([1, 3, 2]) >>> oset == [1, 3, 2] True >>> oset == [1, 2, 3] False >>> oset == [2, 3] False >>> oset == OrderedSet([3, 2, 1]) False FN)rrrr setr")rotherZ other_as_setr r r __eq__s  zOrderedSet.__eq__cGs<t|tr|jnt}ttt|g|}tj|}||S)a Combines all unique items. Each items order is defined by its first appearance. Example: >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0]) >>> print(oset) OrderedSet([3, 1, 4, 5, 2, 0]) >>> oset.union([8, 9]) OrderedSet([3, 1, 4, 5, 2, 0, 8, 9]) >>> oset | {10} OrderedSet([3, 1, 4, 5, 2, 0, 10]) )rrr!rr itchain from_iterable)rsetsclsZ containersrr r r union6s zOrderedSet.unioncCs ||Sr) intersectionrrCr r r __and__IszOrderedSet.__and__csHt|tr|jnt}|r>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3]) >>> print(oset) OrderedSet([1, 2, 3]) >>> oset.intersection([2, 4, 5], [1, 2, 3, 4]) OrderedSet([2]) >>> oset.intersection() OrderedSet([1, 2, 3]) c3s|]}|vr|VqdSrr rr1commonr r ^rz*OrderedSet.intersection..)rrr!rBrKrrrHrIrr rOr rKMs zOrderedSet.intersectioncs:|j}|r.tjtt|fdd|D}n|}||S)a Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) OrderedSet([1]) >>> OrderedSet([1, 2, 3]) - OrderedSet([2]) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference() OrderedSet([1, 2, 3]) c3s|]}|vr|VqdSrr rNrCr r rQtrz(OrderedSet.difference..)r!rBrJrrRr rSr differencecs zOrderedSet.differencecs*t|tkrdStfdd|DS)a7 Report whether another set contains this set. Example: >>> OrderedSet([1, 2, 3]).issubset({1, 2}) False >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4}) True >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5}) False Fc3s|]}|vVqdSrr rNrSr r rQrz&OrderedSet.issubset..rallrLr rSr issubsetys zOrderedSet.issubsetcs*tt|krdStfdd|DS)a= Report whether this set contains another set. Example: >>> OrderedSet([1, 2]).issuperset([1, 2, 3]) False >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3}) True >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3}) False Fc3s|]}|vVqdSrr rNrr r rQrz(OrderedSet.issuperset..rUrLr rr issupersets zOrderedSet.issupersetcCs:t|tr|jnt}|||}|||}||S)a Return the symmetric difference of two OrderedSets as a new set. That is, the new set will contain all elements that are in exactly one of the sets. Their order will be preserved, with elements from `self` preceding elements from `other`. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference(other) OrderedSet([4, 5, 9, 2]) )rrr!rTrJ)rrCrIZdiff1Zdiff2r r r symmetric_differenceszOrderedSet.symmetric_differencecCs||_ddt|D|_dS)zt Replace the 'items' list of this OrderedSet with a new one, updating self.map accordingly. cSsi|]\}}||qSr r )ridxr1r r r rz,OrderedSet._update_items..N)r enumerater)rrr r r _update_itemsszOrderedSet._update_itemscs:t|D]}t|Oq |fdd|jDdS)a Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>> this = OrderedSet([1, 2, 3, 4, 5]) >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6])) >>> print(this) OrderedSet([3, 5]) csg|]}|vr|qSr r rNitems_to_remover r rrz0OrderedSet.difference_update..NrBr]r)rrHrCr r^r difference_updateszOrderedSet.difference_updatecs&t|fdd|jDdS)a^ Update this OrderedSet to keep only items in another set, preserving their order in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.intersection_update(other) >>> print(this) OrderedSet([1, 3, 7]) csg|]}|vr|qSr r rNrSr r rrz2OrderedSet.intersection_update..Nr`rLr rSr intersection_updates zOrderedSet.intersection_updatecs<fdd|D}t|fddjD|dS)a Update this OrderedSet to remove items from another set, then add items from the other set that were not present in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference_update(other) >>> print(this) OrderedSet([4, 5, 9, 2]) csg|]}|vr|qSr r rNrr r rrz:OrderedSet.symmetric_difference_update..csg|]}|vr|qSr r rNr^r r rrNr`)rrCZ items_to_addr )r_rr symmetric_difference_updates z&OrderedSet.symmetric_difference_update)N)#r@ __module__ __qualname____doc__rrr%rr&r(r+r-r,r2r#Zget_locZ get_indexerr7r;r<rr?rArDrJrMrKrTrWrXrYr]rarbrcr r r r r*s@    r)rf itertoolsrE collectionsrcollections.abcrr ImportErrorrr __version__r rr r r r s  PK!U+_vendor/__pycache__/__init__.cpython-39.pycnu[a (Re@sdS)Nrrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/__init__.pyPK!.3v 8_vendor/packaging/__pycache__/_structures.cpython-39.pycnu[a (Re@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS) InfinityTypecCsdS)NInfinityselfrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/_structures.py__repr__szInfinityType.__repr__cCs tt|SNhashreprrrrr __hash__ szInfinityType.__hash__cCsdSNFrr otherrrr __lt__szInfinityType.__lt__cCsdSrrrrrr __le__szInfinityType.__le__cCs t||jSr  isinstance __class__rrrr __eq__szInfinityType.__eq__cCst||j Sr rrrrr __ne__szInfinityType.__ne__cCsdSNTrrrrr __gt__ szInfinityType.__gt__cCsdSrrrrrr __ge__$szInfinityType.__ge__cCstSr )NegativeInfinityrrrr __neg__(szInfinityType.__neg__N __name__ __module__ __qualname__r rrrrrrrrrrrr rsrc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)NegativeInfinityTypecCsdS)Nz -Infinityrrrrr r 1szNegativeInfinityType.__repr__cCs tt|Sr r rrrr r5szNegativeInfinityType.__hash__cCsdSrrrrrr r9szNegativeInfinityType.__lt__cCsdSrrrrrr r=szNegativeInfinityType.__le__cCs t||jSr rrrrr rAszNegativeInfinityType.__eq__cCst||j Sr rrrrr rEszNegativeInfinityType.__ne__cCsdSrrrrrr rIszNegativeInfinityType.__gt__cCsdSrrrrrr rMszNegativeInfinityType.__ge__cCstSr )rrrrr rQszNegativeInfinityType.__neg__Nr rrrr r$0sr$N) __future__rrrobjectrrr$rrrrr s&&PK!V64_vendor/packaging/__pycache__/_compat.cpython-39.pycnu[a (Reh@s~ddlmZmZmZddlZddlmZerDddlmZm Z m Z m Z ej ddkZ ej ddkZerlefZnefZdd ZdS) )absolute_importdivisionprint_functionN) TYPE_CHECKING)AnyDictTupleTypecs&Gfddd}t|ddiS)z/ Create a base class with a metaclass. cseZdZfddZdS)z!with_metaclass..metaclasscs ||S)N)clsname this_basesdbasesmetar /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/_compat.py__new__"sz)with_metaclass..metaclass.__new__N)__name__ __module__ __qualname__rr rr r metaclass!srtemporary_classr )typer)rrrr rrwith_metaclasssr) __future__rrrsysZ_typingrtypingrrr r version_infoPY2PY3str string_types basestringrr r r rs PK!spc2_vendor/packaging/__pycache__/utils.cpython-39.pycnu[a (Re@sxddlmZmZmZddlZddlmZmZddlm Z m Z erZddl m Z m Z e deZedZd d Zd d ZdS) )absolute_importdivisionprint_functionN) TYPE_CHECKINGcast)InvalidVersionVersion)NewTypeUnionNormalizedNamez[-_.]+cCstd|}td|S)N-r )_canonicalize_regexsublowerr)namevaluer/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/utils.pycanonicalize_namesrc Csz t|}Wnty"|YS0g}|jdkrD|d|j|tddddd|jD|j dur|dd d|j D|j dur|d |j |j dur|d |j |j dur|d |j d|S) z This is very similar to Version.__str__, but has one subtle difference with the way it handles the release segment. rz{0}!z(\.0)+$.css|]}t|VqdSNstr.0xrrr /z'canonicalize_version..Ncss|]}t|VqdSrrrrrrr3rz.post{0}z.dev{0}z+{0}) r repochappendformatrerjoinreleaseprepostdevlocal)_versionversionpartsrrrcanonicalize_versions"    &    r-) __future__rrrr#Z_typingrrr+rr typingr r rr compilerrr-rrrrs  PK!s}##9_vendor/packaging/__pycache__/requirements.cpython-39.pycnu[a (Re5@sddlmZmZmZddlZddlZddlmZmZm Z m Z ddlm Z m Z m Z mZmZddlmZddlmZddlmZdd lmZmZdd lmZmZmZerdd lmZGd d d e Z!e ej"ej#Z$ed%Z&ed%Z'ed%Z(ed%Z)ed%Z*ed%Z+ed%Z,e dZ-e$e e-e$BZ.ee$e e.Z/e/dZ0e/Z1eddZ2e,e2Z3e1e e*e1Z4e&e e4e'dZ5eej6ej7ej8BZ9eej6ej7ej8BZ:e9e:AZ;ee;e e*e;ddddZdde e=dZ?e?>d de ed!Ze>d"de+Z@e@eZAe?e eAZBe3e eAZCe0e e5eCeBBZDeeDeZEeEFd#Gd$d%d%eGZHdS)&)absolute_importdivisionprint_functionN) stringStart stringEndoriginalTextForParseException) ZeroOrMoreWordOptionalRegexCombine)Literal)parse) TYPE_CHECKING) MARKER_EXPRMarker)LegacySpecifier Specifier SpecifierSet)Listc@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF) joinStringadjacent _raw_speccCs |jpdS)N)r+sltrrr;r1 specifiercCs|dS)Nrrr-rrrr1>r2markercCst||j|jS)N)r_original_start _original_endr-rrrr1Br2zx[]c@s(eZdZdZddZddZddZdS) RequirementzParse a requirement. Parse a given requirement string into its parts, such as name, specifier, URL, and extras. Raises InvalidRequirement on a badly-formed requirement string. c Cszt|}WnFtyT}z.td||j|jd|jWYd}~n d}~00|j|_|jrt |j}|j dkrt ||jkrtdn(|j r|j r|j s|j std|j|j|_nd|_t |jr|jng|_t|j|_|jr|jnd|_dS)NzParse error at "{0!r}": {1}filezInvalid URL givenzInvalid URL: {0}) REQUIREMENT parseStringrrformatlocmsgr&r'urlparsescheme urlunparsenetlocsetr(asListrr3r4)selfrequirement_stringreqe parsed_urlrrr__init___s2      zRequirement.__init__cCs|jg}|jr*|ddt|j|jr@|t|j|jrh|d|j|j rh|d|j r|d|j d|S)Nz[{0}]r#z@ {0} z; {0}r,) r&r(appendr<joinsortedr3strr'r4)rEpartsrrr__str__{s zRequirement.__str__cCsdt|S)Nz)r<rO)rErrr__repr__szRequirement.__repr__N)rrrrrJrQrRrrrrr7Rs r7)I __future__rrrstringreZsetuptools.extern.pyparsingrrrrr r r r r rLurllibrr?Z_typingrmarkersrr specifiersrrrtypingr ValueErrorr ascii_lettersdigitsALPHANUMsuppressLBRACKETRBRACKETLPARENRPARENCOMMA SEMICOLONAT PUNCTUATIONIDENTIFIER_END IDENTIFIERNAMEEXTRAURIURL EXTRAS_LISTEXTRAS _regex_strVERBOSE IGNORECASEVERSION_PEP440VERSION_LEGACY VERSION_ONE VERSION_MANY _VERSION_SPECsetParseAction VERSION_SPECMARKER_SEPARATORMARKERVERSION_AND_MARKERURL_AND_MARKERNAMED_REQUIREMENTr:r;objectr7rrrrsj                 PK!%|:4:44_vendor/packaging/__pycache__/version.cpython-39.pycnu[a (Ren< @sddlmZmZmZddlZddlZddlZddlmZm Z ddl m Z e r.ddl m Z mZmZmZmZmZmZddlmZmZeeefZeeeeeffZeeeefZeeeeeeeefeeeffdffZeeeedfeeeefZeeeedffZe eeefeeefgefZgd Z e!d gd Z"d d Z#Gddde$Z%Gddde&Z'Gddde'Z(e)dej*Z+ddddddZ,ddZ-ddZ.dZ/Gddde'Z0d d!Z1e)d"Z2d#d$Z3d%d&Z4dS)')absolute_importdivisionprint_functionN)InfinityNegativeInfinity) TYPE_CHECKING)CallableIteratorListOptional SupportsIntTupleUnion) InfinityTypeNegativeInfinityType.)parseVersion LegacyVersionInvalidVersionVERSION_PATTERN_Version)epochreleasedevprepostlocalcCs*z t|WSty$t|YS0dS)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. N)rrr)versionr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/version.pyr0s  rc@seZdZdZdS)rzF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrrr r=src@sPeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dS) _BaseVersionNcCs t|jSN)hash_keyselfrrr __hash__Fsz_BaseVersion.__hash__cCs||ddS)NcSs||kSr&rsorrr Lz%_BaseVersion.__lt__.._comparer*otherrrr __lt__Jsz_BaseVersion.__lt__cCs||ddS)NcSs||kSr&rr,rrr r/Pr0z%_BaseVersion.__le__..r1r3rrr __le__Nsz_BaseVersion.__le__cCs||ddS)NcSs||kSr&rr,rrr r/Tr0z%_BaseVersion.__eq__..r1r3rrr __eq__Rsz_BaseVersion.__eq__cCs||ddS)NcSs||kSr&rr,rrr r/Xr0z%_BaseVersion.__ge__..r1r3rrr __ge__Vsz_BaseVersion.__ge__cCs||ddS)NcSs||kSr&rr,rrr r/\r0z%_BaseVersion.__gt__..r1r3rrr __gt__Zsz_BaseVersion.__gt__cCs||ddS)NcSs||kSr&rr,rrr r/`r0z%_BaseVersion.__ne__..r1r3rrr __ne__^sz_BaseVersion.__ne__cCst|tstS||j|jSr&) isinstancer%NotImplementedr()r*r4methodrrr r2bs z_BaseVersion._compare) r!r"r#r(r+r5r6r7r8r9r:r2rrrr r%Csr%c@seZdZddZddZddZeddZed d Zed d Z ed dZ eddZ eddZ eddZ eddZeddZeddZeddZdS)rcCst||_t|j|_dSr&)str_version_legacy_cmpkeyr()r*rrrr __init__ks zLegacyVersion.__init__cCs|jSr&r?r)rrr __str__pszLegacyVersion.__str__cCsdtt|S)Nzformatreprr>r)rrr __repr__tszLegacyVersion.__repr__cCs|jSr&rBr)rrr publicxszLegacyVersion.publiccCs|jSr&rBr)rrr base_version}szLegacyVersion.base_versioncCsdS)Nrr)rrr rszLegacyVersion.epochcCsdSr&rr)rrr rszLegacyVersion.releasecCsdSr&rr)rrr rszLegacyVersion.precCsdSr&rr)rrr rszLegacyVersion.postcCsdSr&rr)rrr rszLegacyVersion.devcCsdSr&rr)rrr rszLegacyVersion.localcCsdSNFrr)rrr is_prereleaseszLegacyVersion.is_prereleasecCsdSrKrr)rrr is_postreleaseszLegacyVersion.is_postreleasecCsdSrKrr)rrr is_devreleaseszLegacyVersion.is_devreleaseN)r!r"r#rArCrGpropertyrHrIrrrrrrrLrMrNrrrr rjs2          rz(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccs\t|D]F}t||}|r |dkr(q |dddvrF|dVq d|Vq dVdS)N.r 0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)r-partrrr _parse_version_partss   r`cCsvd}g}t|D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||q|t|fS)NrJrXrYz*final-00000000)r`lower startswithpopappendtuple)rrpartsr_rrr r@s    r@a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@seZdZededejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZeddZeddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zd%S)&rz^\s*z\s*$c
Cs|j|}|std|t|dr8t|dndtdd|ddDt	|d|d	t	|d
|dp|dt	|d
|dt
|dd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'rrcss|]}t|VqdSr&)int.0irrr 	r0z#Version.__init__..rrUpre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrr)_regexsearchrrErgrouprhrfr[_parse_letter_version_parse_local_versionr?_cmpkeyrrrrrrr()r*rmatchrrr rAs*zVersion.__init__cCsdtt|S)NzrDr)rrr rG-szVersion.__repr__cCsg}|jdkr |d|j|ddd|jD|jdurb|ddd|jD|jdur~|d|j|jdur|d	|j|jdur|d
|jd|S)Nr{0}!rUcss|]}t|VqdSr&r>rjxrrr rl:r0z"Version.__str__..css|]}t|VqdSr&r|r}rrr rl>r0z.post{0}z.dev{0}z+{0})	rrerEjoinrrrrrr*rgrrr rC1s




zVersion.__str__cCs|jj}|Sr&)r?r)r*_epochrrr rNsz
Version.epochcCs|jj}|Sr&)r?r)r*_releaserrr rTszVersion.releasecCs|jj}|Sr&)r?r)r*_prerrr rZszVersion.precCs|jjr|jjdSdSNr)r?rr)rrr r`szVersion.postcCs|jjr|jjdSdSr)r?rr)rrr reszVersion.devcCs(|jjr ddd|jjDSdSdS)NrUcss|]}t|VqdSr&r|r}rrr rlnr0z Version.local..)r?rrr)rrr rjsz
Version.localcCst|dddS)N+rr)r>r[r)rrr rHrszVersion.publiccCsFg}|jdkr |d|j|ddd|jDd|S)Nrr{rUcss|]}t|VqdSr&r|r}rrr rlr0z'Version.base_version..r)rrerErrrrrr rIws

zVersion.base_versioncCs|jdup|jduSr&)rrr)rrr rLszVersion.is_prereleasecCs
|jduSr&)rr)rrr rMszVersion.is_postreleasecCs
|jduSr&)rr)rrr rNszVersion.is_devreleasecCst|jdkr|jdSdS)Nrrlenrr)rrr majorsz
Version.majorcCst|jdkr|jdSdS)Nrrrr)rrr minorsz
Version.minorcCst|jdkr|jdSdS)Nrrrr)rrr microsz
Version.microN)r!r"r#recompilerVERBOSE
IGNORECASErtrArGrCrOrrrrrrrHrIrLrMrNrrrrrrr rs@













rcCsv|rZ|durd}|}|dkr&d}n(|dkr4d}n|dvrBd}n|dvrNd	}|t|fS|sr|rrd	}|t|fSdS)
Nralphaabetab)rPrrRrT)revrr)rbrh)letternumberrrr rws"rwz[\._-]cCs$|dur tddt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|s|nt|VqdSr&)isdigitrbrh)rjr_rrr rlsz'_parse_local_version..)rf_local_version_separatorsr[)rrrr rxs
rxcCsttttddt|}|dur>|dur>|dur>t}n|durLt}n|}|dur^t}n|}|durpt}	n|}	|durt}
ntdd|D}
|||||	|
fS)NcSs|dkS)Nrr)r~rrr r/r0z_cmpkey..css(|] }t|tr|dfnt|fVqdS)rN)r;rhrrirrr rlsz_cmpkey..)rfreversedlist	itertools	dropwhilerr)rrrrrrrr_post_dev_localrrr rys(	ry)5
__future__rrrcollectionsrr_structuresrrZ_typingrtypingr	r
rrr
rrrr
InfiniteTypesr>rhPrePostDevTypeSubLocalType	LocalTypeCmpKeyLegacyCmpKeyboolVersionComparisonMethod__all__
namedtuplerr
ValueErrorrobjectr%rrrrZr\r`r@rrrwrrxryrrrr sp$


'F	 &

PK!xO.f6_vendor/packaging/__pycache__/__about__.cpython-39.pycnu[a

(Re@sDddlmZmZmZgdZdZdZdZdZdZ	dZ
d	Zd
e	ZdS))absolute_importdivisionprint_function)	__title____summary____uri____version__
__author__	__email____license__
__copyright__	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz20.4z)Donald Stufft and individual contributorszdonald@stufft.iozBSD-2-Clause or Apache-2.0zCopyright 2014-2019 %sN)
__future__rrr__all__rrrrr	r
rrrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/__about__.pysPK!=WbPP7_vendor/packaging/__pycache__/specifiers.cpython-39.pycnu[a

(Re|@sXddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZerddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeege fZ!Gd	d
d
e"Z#Gddde
ej$e%Z&Gd
dde&Z'Gddde'Z(ddZ)Gddde'Z*e+dZ,ddZ-ddZ.Gddde&Z/dS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)
TYPE_CHECKING)canonicalize_version)Version
LegacyVersionparse)	ListDictUnionIterableIteratorOptionalCallableTuple	FrozenSetc@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/specifiers.pyr"src@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nrselfrrr__str__)szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nrrrrr__hash__1szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nrrotherrrr__eq__8szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nrr"rrr__ne__@szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        NrrrrrprereleasesHszBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nrrvaluerrrr&PsNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nrritemr&rrrcontainsXszBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterabler&rrrfilter_szBaseSpecifier.filter)N)N)rrrabcabstractmethodr r!r$r%abstractpropertyr&setterr+r-rrrrr(s 





rc@seZdZiZd"ddZddZddZed	d
ZddZ	d
dZ
ddZddZddZ
eddZeddZeddZejddZddZd#ddZd$d d!ZdS)%_IndividualSpecifierNcCsF|j|}|std||d|df|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecr&matchrrr__init__lsz_IndividualSpecifier.__init__cCs0|jdurd|jnd}d|jjt||S)N, prereleases={0!r}r3z<{0}({1!r}{2})>)r<r8r&	__class__rstrrprerrr__repr__zs
z_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r8r;rrrrr sz_IndividualSpecifier.__str__cCs|jdt|jdfS)Nrr)r;r	rrrr_canonical_specsz$_IndividualSpecifier._canonical_speccCs
t|jSN)hashrFrrrrr!sz_IndividualSpecifier.__hash__cCsRt|tr6z|t|}WqFty2tYS0nt||jsFtS|j|jkSrG)
isinstancerrArBrNotImplementedrFr"rrrr$s
z_IndividualSpecifier.__eq__cCsRt|tr6z|t|}WqFty2tYS0nt||jsFtS|j|jkSrG)rIrrArBrrJr;r"rrrr%s
z_IndividualSpecifier.__ne__cCst|d|j|}|S)Nz_compare_{0})getattrr8
_operators)ropoperator_callablerrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|SrG)rIrr
rrr5rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nrr;rrrrr4sz_IndividualSpecifier.operatorcCs
|jdS)NrrRrrrrr5sz_IndividualSpecifier.versioncCs|jSrGr<rrrrr&sz _IndividualSpecifier.prereleasescCs
||_dSrGrSr'rrrr&scCs
||SrGr+rr*rrr__contains__sz!_IndividualSpecifier.__contains__cCs>|dur|j}||}|jr&|s&dS||j}|||jSNF)r&rQ
is_prereleaserOr4r5)rr*r&normalized_itemrNrrrr+s

z_IndividualSpecifier.containsccsd}g}d|dur|ndi}|D]F}||}|j|fi|r |jr\|s\|js\||q d}|Vq |s|r|D]
}|VqtdS)NFr&T)rQr+rXr&append)rr,r&yieldedfound_prereleaseskwr5parsed_versionrrrr-s"
z_IndividualSpecifier.filter)r3N)N)N)rrrrLr?rEr propertyrFr!r$r%rOrQr4r5r&r1rVr+r-rrrrr2hs,







r2c@sveZdZdZededejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        ^\s*\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)==!=<=>=<>cCst|tstt|}|SrG)rIrrBrPrrrrQ s
zLegacySpecifier._coerce_versioncCs|||kSrGrQrprospectiver=rrr_compare_equal&szLegacySpecifier._compare_equalcCs|||kSrGrorprrr_compare_not_equal*sz"LegacySpecifier._compare_not_equalcCs|||kSrGrorprrr_compare_less_than_equal.sz(LegacySpecifier._compare_less_than_equalcCs|||kSrGrorprrr_compare_greater_than_equal2sz+LegacySpecifier._compare_greater_than_equalcCs|||kSrGrorprrr_compare_less_than6sz"LegacySpecifier._compare_less_thancCs|||kSrGrorprrr_compare_greater_than:sz%LegacySpecifier._compare_greater_thanN)rrr
_regex_strrecompileVERBOSE
IGNORECASEr6rLrQrrrsrtrurvrwrrrrr`s 	r`cstfdd}|S)Ncst|tsdS|||SrW)rIr
rpfnrrwrappedCs
z)_require_version_compare..wrapped)	functoolswraps)r~rrr}r_require_version_compare?src	@seZdZdZededejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?z/Specifier._compare_compatible...*rlri)joinlist	itertools	takewhile_version_splitrO)rrqr=prefixrrr_compare_compatibles

zSpecifier._compare_compatiblec	Csz|drVt|j}t|dd}tt|}|dt|}t||\}}||kSt|}|jsnt|j}||kSdS)Nr)endswithr
publicrrBlen_pad_versionlocal)	rrqr=
split_specsplit_prospectiveshortened_prospectivepadded_specpadded_prospectivespec_versionrrrrrs


zSpecifier._compare_equalcCs|||SrG)rrrprrrrsszSpecifier._compare_not_equalcCst|jt|kSrGr
rrprrrrtsz"Specifier._compare_less_than_equalcCst|jt|kSrGrrprrrru
sz%Specifier._compare_greater_than_equalcCs<t|}||ksdS|js8|jr8t|jt|jkr8dSdSNFT)r
rXbase_versionrrqspec_strr=rrrrvszSpecifier._compare_less_thancCs^t|}||ksdS|js8|jr8t|jt|jkr8dS|jdurZt|jt|jkrZdSdSr)r
is_postreleaserrrrrrrw1s
zSpecifier._compare_greater_thancCst|t|kSrG)rBlowerrprrr_compare_arbitraryRszSpecifier._compare_arbitrarycCsR|jdur|jS|j\}}|dvrN|dkr@|dr@|dd}t|jrNdSdS)N)rirlrkrrrirrTF)r<r;rrrX)rr4r5rrrr&Vs


zSpecifier.prereleasescCs
||_dSrGrSr'rrrr&psN)rrrrxryrzr{r|r6rLrrrrrsrtrurvrwrr_r&r1rrrrrMs<]

(




 
rz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}|dD],}t|}|r0||q||q|S)Nr)split
_prefix_regexr7extendgroupsrZ)r5resultr*r>rrrrys
rc
Csgg}}|ttdd||ttdd|||t|dd||t|dd|ddgtdt|dt|d|ddgtdt|dt|dttj|ttj|fS)NcSs|SrGisdigitrrrrrrz_pad_version..cSs|SrGrrrrrrrrr0)rZrrrrinsertmaxchain)leftright
left_splitright_splitrrrrs
,,rc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr3Nc	Csldd|dD}t}|D]8}z|t|WqtyT|t|Yq0qt||_||_dS)NcSsg|]}|r|qSr)r:.0srrr
rz)SpecifierSet.__init__..,)	rsetaddrrr`	frozenset_specsr<)r
specifiersr&split_specifiersparsed	specifierrrrr?s
zSpecifierSet.__init__cCs*|jdurd|jnd}dt||S)Nr@r3z)r<r8r&rBrCrrrrEs
zSpecifierSet.__repr__cCsdtdd|jDS)Nrcss|]}t|VqdSrG)rBrrrr	rz'SpecifierSet.__str__..)rsortedrrrrrr szSpecifierSet.__str__cCs
t|jSrG)rHrrrrrr!szSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdurX|jdurX|j|_n<|jdurv|jdurv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rIrrrJrrr<
ValueError)rr#rrrr__and__s 





zSpecifierSet.__and__cCs6t|ttfrtt|}nt|ts*tS|j|jkSrGrIrr2rrBrJrr"rrrr$s

zSpecifierSet.__eq__cCs6t|ttfrtt|}nt|ts*tS|j|jkSrGrr"rrrr%s

zSpecifierSet.__ne__cCs
t|jSrG)rrrrrr__len__szSpecifierSet.__len__cCs
t|jSrG)iterrrrrr__iter__szSpecifierSet.__iter__cCs.|jdur|jS|jsdStdd|jDS)Ncss|]}|jVqdSrGr&rrrrrrz+SpecifierSet.prereleases..)r<ranyrrrrr&s

zSpecifierSet.prereleasescCs
||_dSrGrSr'rrrr&scCs
||SrGrTrUrrrrVszSpecifierSet.__contains__csLtttfstdur$|js2jr2dStfdd|jDS)NFc3s|]}|jdVqdS)rNrTrr*r&rrr*rz(SpecifierSet.contains..)rIrr
rr&rXallrr)rrrr+s
zSpecifierSet.containscCs|dur|j}|jr6|jD]}|j|t|d}q|Sg}g}|D]P}t|ttfs^t|}n|}t|trnqB|jr|s|s|	|qB|	|qB|s|r|dur|S|SdS)Nr)
r&rr-boolrIrr
rrXrZ)rr,r&r=filteredr\r*r^rrrr-,s*




zSpecifierSet.filter)r3N)N)N)rrrr?rEr r!rr$r%rrr_r&r1rVr+r-rrrrrs"

		


r)0
__future__rrrr.rrryZ_compatrrZ_typingrutilsr	r5r
rrtypingr
rrrrrrrr
ParsedVersionrBUnparsedVersionrCallableOperatorrrABCMetaobjectrr2r`rrrzrrrrrrrrs4,@ 8+
PK!"[/CC1_vendor/packaging/__pycache__/tags.cpython-39.pycnu[a

(Re^@sLddlmZddlZzddlmZWn.eyRddlZddeDZ[Yn0ddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZerddlmZmZmZmZmZmZmZmZmZmZeeZ eeefZ!eeefZ"e	#e$Z%d	d
ddd
dZ&ej'dkZ(Gddde)Z*ddZ+ddZ,dSddZ-ddZ.ddZ/dTddZ0dUdd Z1d!d"Z2dVd#d$Z3d%d&Z4dWd'd(Z5e(fd)d*Z6d+d,Z7dXd-d.Z8d/d0Z9d1d2Z:d3d4Z;d5d6ZGd;d<dZ@d?d@ZAdAdBZBdCdDZCe(fdEdFZDdGdHZEdIdJZFdKdLZGdMdNZHdOdPZIdQdRZJdS)Y)absolute_importN)EXTENSION_SUFFIXEScCsg|]}|dqS)r).0xrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/tags.py
r)
TYPE_CHECKINGcast)
Dict	FrozenSetIOIterableIteratorListOptionalSequenceTupleUnionpycpppipjy)pythoncpythonpypy
ironpythonjythonlc@sdeZdZdZgdZddZeddZeddZed	d
Z	ddZ
d
dZddZddZ
dS)Tagz
    A representation of the tag triple for a wheel.

    Instances are considered immutable and thus are hashable. Equality checking
    is also supported.
    )_interpreter_abi	_platformcCs"||_||_||_dSN)lowerr"r#r$)selfinterpreterabiplatformrrr__init__Fs

zTag.__init__cCs|jSr%)r"r'rrrr(LszTag.interpretercCs|jSr%)r#r,rrrr)QszTag.abicCs|jSr%)r$r,rrrr*VszTag.platformcCs2t|tstS|j|jko0|j|jko0|j|jkSr%)
isinstancer!NotImplementedr*r)r()r'otherrrr__eq__[s


z
Tag.__eq__cCst|j|j|jfSr%)hashr"r#r$r,rrr__hash__fszTag.__hash__cCsd|j|j|jS)Nz{}-{}-{})formatr"r#r$r,rrr__str__jszTag.__str__cCsdj|t|dS)Nz<{self} @ {self_id}>)r'self_id)r3idr,rrr__repr__nszTag.__repr__N)__name__
__module____qualname____doc__	__slots__r+propertyr(r)r*r0r2r4r7rrrrr!<s


r!c	Cs`t}|d\}}}|dD]6}|dD]&}|dD]}|t|||qConfig variable '%s' is unset, Python ABI tag may be incorrect)	sysconfigget_config_varloggerdebug)namerKvaluerrr_get_config_vars
r\cCs|ddddS)Nr?_r>)replace)stringrrr_normalize_stringsr`cCst|dkot|dkS)zj
    Determine if the Python version supports abi3.

    PEP 384 was first implemented in Python 3.2.
    r
))rLtuple)python_versionrrr
_abi3_appliessrec	Cst|}g}t|dd}d}}}td|}ttd}dtv}	|sX|dur\|sX|	r\d}|dkrtd|}
|
sz|
dur~d	}|d
krtd|}|dks|durtjd
krd}n|r|dj|d|	ddj||||d|S)NrbPy_DEBUGgettotalrefcountz_d.pydd)ra
WITH_PYMALLOCm)raraPy_UNICODE_SIZEiucp{version}versionrz"cp{version}{debug}{pymalloc}{ucs4})rrrYpymallocucs4)
rc_version_nodotr\hasattrsysr
maxunicodeappendr3insert)
py_versionrKrGrrrYrsrt
with_debughas_refcounthas_ext
with_pymallocunicode_sizerrr
_cpython_abiss<



rc
	+sZtd|}|stjdd}dt|dd|durVt|dkrRt||}ng}t|}dD]&}z||Wqbt	yYqb0qbt|pt
}|D]}|D]}t||Vqqt|rfdd|DD]
}|Vqԇfd	d|DD]
}|Vqt|rVt
|dddd
D]8}	|D],}djt|d|	fd
td|Vq$qdS)a
    Yields the tags for a CPython interpreter.

    The tags consist of:
    - cp--
    - cp-abi3-
    - cp-none-
    - cp-abi3-  # Older Python versions down to 3.2.

    If python_version only specifies a major version then user-provided ABIs and
    the 'none' ABItag will be used.

    If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
    their normal position and not at the beginning.
    cpython_tagsNrbzcp{}r
)abi3nonec3s|]}td|VqdS)rNr!rrIr(rr	r	zcpython_tags..c3s|]}td|VqdS)rNrrrrrrr	rprrqr)rUrwversion_infor3rurLrlistremove
ValueError_platform_tagsr!rerange)
rdrGrHrSrKexplicit_abir)rIrD
minor_versionrrrrs<

rccstd}|rt|VdS)NSOABI)rVrWr`)r)rrr_generic_abis
rc	kstd|}|s,t}t|d}d||g}|dur:t}t|pDt}t|}d|vrb|d|D]}|D]}t|||VqnqfdS)z
    Yields the tags for a generic interpreter.

    The tags consist of:
    - --

    The "none" ABI will be added if it was not explicitly provided.
    generic_tagsrKrfNr)	rUinterpreter_nameinterpreter_versionjoinrrrryr!)	r(rGrHrSrKinterp_nameinterp_versionr)rIrrrrs


rccs|t|dkr&djt|dddVdj|ddVt|dkrxt|ddd	d	D]}djt|d|fdVqXdS)
z
    Yields Python versions in descending order.

    After the latest version, the major-only version will be yielded, and then
    all previous versions of that major version.
    r
zpy{version}Nrbrqz	py{major}r)majorr)rLr3rur)r{minorrrr_py_interpreter_range4srccsx|stjdd}t|pt}t|D]}|D]}t|d|Vq0q(|rXt|ddVt|D]}t|ddVq`dS)z
    Yields the sequence of tags that are compatible with a specific version of Python.

    The tags consist of:
    - py*-none-
    - -none-any  # ... if `interpreter` is provided.
    - py*-none-any
    Nrbrany)rwrrrrr!)rdr(rHrrrIrrrcompatible_tagsDsrcCs|s|S|drdSdS)Nppci386)
startswith)archis_32bitrrr	_mac_arch^s

rcCs|g}|dkr*|dkrgS|gdnn|dkrN|dkr>gS|gdnJ|dkrv|dksf|dkrjgS|dn"|d	kr|d
krgS|ddg|d
|S)Nx86_64)
rn)intelfat64fat32r)rrfatppc64)rrr)rrr	universal)extendry)rrcpu_archformatsrrr_mac_binary_formatsis&
rc	cst\}}}|dur:tdttt|ddd}n|}|durPt|}n|}t|dddD]>}|d|f}t	||}|D]}dj
|d|d|d	VqqddS)
aD
    Yields the platform tags for a macOS system.

    The `version` parameter is a two-item tuple specifying the macOS version to
    generate platform tags for. The `arch` parameter is the CPU architecture to
    generate platform tags for. Both parameters default to the appropriate value
    for the current system.
    N
MacVersionr?rbr
rrz&macosx_{major}_{minor}_{binary_format})rr
binary_format)r*mac_verrrcmapintrArrrr3)	rrrversion_strr]rrcompat_versionbinary_formatsrrrr
mac_platformss 
$

rc	Cs<zddl}tt||dWSttfy2Yn0t|S)NrZ_compatible)
_manylinuxboolgetattrImportErrorAttributeError_have_compatible_glibc)rZ
glibc_versionrrrr_is_manylinux_compatiblesrcCstp
tSr%)_glibc_version_string_confstr_glibc_version_string_ctypesrrrr_glibc_version_stringsrcCsHz&td}|dusJ|\}}WnttttfyBYdS0|S)zJ
    Primary implementation of glibc_version_string using os.confstr.
    CS_GNU_LIBC_VERSIONN)osconfstrrAAssertionErrorrOSErrorr)version_stringr]rrrrrrs	rcCsrzddl}Wnty YdS0|d}z
|j}WntyJYdS0|j|_|}t|tsn|	d}|S)zG
    Fallback implementation of glibc_version_string using ctypes.
    rNascii)
ctypesrCDLLgnu_get_libc_versionrc_char_prestyper-strdecode)rprocess_namespacerrrrrrs



rcCsHtd|}|s$td|tdSt|d|koFt|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFrr)rematchwarningsrKRuntimeWarningrgroup)rrequired_major
minimum_minorrlrrr_check_glibc_versionsrcCst}|durdSt|||SNF)rr)rrrrrrrsrc@sTeZdZGdddeZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
dZdS)_ELFFileHeaderc@seZdZdZdS)z$_ELFFileHeader._InvalidELFFileHeaderz7
        An invalid ELF file header was found.
        N)r8r9r:r;rrrr_InvalidELFFileHeadersriFLEr
rbra(>l~iicsrfdd}|d|_|j|jkr*t|d|_|j|j|jhvrNt|d|_|j|j|j	hvrrt|d|_
|d|_|d|_
d|_|j|jkrdnd}|j|jkrdnd}|j|jkrd	nd
}|j|jkr|n|}|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_dS)Ncs@zt|t|\}Wntjy:tYn0|Sr%)structunpackreadcalcsizeerrorrr)fmtresultfilerrr)s
z'_ELFFileHeader.__init__..unpackz>IBzHzQ)
e_ident_magicELF_MAGIC_NUMBERrr
e_ident_class
ELFCLASS32
ELFCLASS64e_ident_dataELFDATA2LSBELFDATA2MSBe_ident_version
e_ident_osabie_ident_abiversionre_ident_pade_type	e_machine	e_versione_entrye_phoffe_shoffe_flagse_ehsizee_phentsizee_phnume_shentsizee_shnum
e_shstrndx)r'rrformat_hformat_iformat_qformat_prrrr+'s>


















z_ELFFileHeader.__init__N)r8r9r:rrrrrrrEM_386EM_S390EM_ARM	EM_X86_64EF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDr+rrrrrsrcCs\z8ttjd}t|}Wdn1s,0YWnttttjfyVYdS0|S)Nrb)openrw
executablerIOErrorrrQr)f
elf_headerrrr_get_elf_headerSs*rcCsnt}|durdS|j|jk}||j|jkM}||j|jkM}||j|j@|j	kM}||j|j
@|j
kM}|Sr)rrrrrrrrrrrrrrrr_is_linux_armhf]s

rcCsBt}|durdS|j|jk}||j|jkM}||j|jkM}|Sr)rrrrrrr
rrrr_is_linux_i686qsrcCs |dkrtS|dkrtSdS)Narmv7li686T)rr)rrrr_have_compatible_manylinux_abi|s
r ccsttj}|r,|dkr d}n|dkr,d}g}|dd\}}t|rv|dvrZ|d|d	vrv|d
|dt|}|D]$\}}t||r|	d|Vqq|D]\}}|	d|Vq|VdS)
Nlinux_x86_64
linux_i686
linux_aarch64linux_armv7lr]r
>ppc64leaarch64rs390xrrr)
manylinux2014)rb>rr)
manylinux2010)rb)
manylinux1)rbrlinux)
r`	distutilsutilget_platformrAr ryrOrr^)rr-Zmanylinux_supportr]rZmanylinux_support_iterrZrrrr_linux_platformss8
r1ccsttjVdSr%)r`r.r/r0rrrr_generic_platformssr2cCs.tdkrtStdkr$tStSdS)z;
    Provides the platform tags for this installation.
    DarwinLinuxN)r*systemrr1r2rrrrrs
rcCs:ztjj}Wnty*t}Yn0t|p8|S)z6
    Returns the name of the running interpreter.
    )	rwimplementationrZrr*python_implementationr&INTERPRETER_SHORT_NAMESget)rZrrrrs
rcKs:td|}td|d}|r$t|}nttjdd}|S)z9
    Returns the version of the running interpreter.
    rpy_version_nodotrNrb)rUr\rrurwr)rSrKrrrrrrs

rcCs,tdd|Drd}nd}|tt|S)Ncss|]}|dkVqdS)rNr)rvrrrrr	z!_version_nodot..r]rf)rrrr)rrseprrrrusrucksXtd|}t}|dkr0t|dD]
}|Vq"ntD]
}|Vq6tD]
}|VqHdS)z
    Returns the sequence of tag triples for the running interpreter.

    The order of the sequence corresponds to priority order for the
    interpreter, from most to least important.
    sys_tagsrrN)rUrrrr)rSrKrrDrrrr=s



r=)F)F)NNN)NNN)NNN)NN)K
__future__rdistutils.utilr.importlib.machineryrrimpZget_suffixesloggingrr*rrrwrVrZ_typingrrtypingr
rrrrrrrrrr
PythonVersionrZGlibcVersion	getLoggerr8rXr8maxsize_32_BIT_INTERPRETERobjectr!rJrUr\r`rerrrrrrrrrrrrrrrrrrrr r1r2rrrrur=rrrrs0

	
7



&
<


#@
	!

	PK!"AVV5_vendor/packaging/__pycache__/__init__.cpython-39.pycnu[a

(Re2@sHddlmZmZmZddlmZmZmZmZm	Z	m
Z
mZmZgdZ
dS))absolute_importdivisionprint_function)
__author__
__copyright__	__email____license____summary__	__title____uri____version__)rr
rr
rrr	rN)
__future__rrr	__about__rrrr	r
rrr
__all__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/__init__.pys(PK!GG$$4_vendor/packaging/__pycache__/markers.cpython-39.pycnu[a

(Re%%	@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZdd	lmZmZerdd
lmZmZmZmZmZm Z m!Z!ee"e"ge#fZ$gdZ%Gdd
d
e&Z'Gddde&Z(Gddde&Z)Gddde*Z+Gddde+Z,Gddde+Z-Gddde+Z.ededBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*Bed+BZ/d$d#dd ddd,Z0e/1d-d.ed/ed0Bed1Bed2Bed3Bed4Bed5Bed6BZ2e2ed7Bed8BZ3e31d9d.ed:ed;BZ4e41dBZ5e/e4BZ6ee6e3e6Z7e71d?d.ed@8Z9edA8Z:eZ;e7ee9e;e:BZee;eZ=dBdCZ>dXdEdFZ?dGd.dHd.ej@ejAejBejCejDejEdIZFdJdKZGGdLdMdMe*ZHeHZIdNdOZJdPdQZKdRdSZLdTdUZMGdVdWdWe*ZNdS)Y)absolute_importdivisionprint_functionN)ParseExceptionParseResultsstringStart	stringEnd)
ZeroOrMoreGroupForwardQuotedString)Literal)string_types)
TYPE_CHECKING)	SpecifierInvalidSpecifier)AnyCallableDictListOptionalTupleUnion)
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N__name__
__module____qualname____doc__r$r$/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.pyr"src@seZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    Nrr$r$r$r%r(src@seZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    Nrr$r$r$r%r.src@s,eZdZddZddZddZddZd	S)
NodecCs
||_dSN)value)selfr(r$r$r%__init__6sz
Node.__init__cCs
t|jSr')strr(r)r$r$r%__str__:szNode.__str__cCsd|jjt|S)Nz<{0}({1!r})>)format	__class__r r+r,r$r$r%__repr__>sz
Node.__repr__cCstdSr')NotImplementedErrorr,r$r$r%	serializeBszNode.serializeN)r r!r"r*r-r0r2r$r$r$r%r&5sr&c@seZdZddZdS)VariablecCst|Sr'r+r,r$r$r%r2HszVariable.serializeNr r!r"r2r$r$r$r%r3Gsr3c@seZdZddZdS)ValuecCs
d|S)Nz"{0}")r.r,r$r$r%r2NszValue.serializeNr5r$r$r$r%r6Msr6c@seZdZddZdS)OpcCst|Sr'r4r,r$r$r%r2TszOp.serializeNr5r$r$r$r%r7Ssr7implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_nameos.namesys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationextra)rCrDrErFrGrHcCstt|d|dSNr)r3ALIASESgetsltr$r$r%urQz=====>=<=!=z~=><not inincCst|dSrJ)r7rMr$r$r%rQ|rR'"cCst|dSrJ)r6rMr$r$r%rQrRandorcCst|dSrJ)tuplerMr$r$r%rQrR()cCs t|trdd|DS|SdS)NcSsg|]}t|qSr$)_coerce_parse_result).0ir$r$r%
rRz(_coerce_parse_result..)
isinstancer)resultsr$r$r%rbs
rbTcCst|tttfsJt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rnd|Sdd|dSn"t|trddd	|DS|SdS)
Nrrcss|]}t|ddVqdS)F)firstN)_format_markerrcmr$r$r%	rRz!_format_marker.. r`racSsg|]}|qSr$)r2rjr$r$r%rerRz"_format_marker..)rflistr_rlenrijoin)markerrhinnerr$r$r%ris 



ricCs||vSr'r$lhsrhsr$r$r%rQrRcCs||vSr'r$rsr$r$r%rQrR)rZrYrXrUrSrVrTrWcCsjztd||g}Wnty,Yn0||St|}|dur`td||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.)	rrpr2rcontains
_operatorsrLrr.)rtopruspecoperr$r$r%_eval_ops
r|c@seZdZdS)	UndefinedN)r r!r"r$r$r$r%r}sr}cCs(||t}t|tr$td||S)Nz/{0!r} does not exist in evaluation environment.)rL
_undefinedrfr}rr.)environmentnamer(r$r$r%_get_envs
rc	Csgg}|D]}t|tttfs"Jt|trB|dt||q
t|tr|\}}}t|trtt||j}|j}n|j}t||j}|dt	|||q
|dvsJ|dkr
|gq
t
dd|DS)N)r]r^r^css|]}t|VqdSr')all)rcitemr$r$r%rlrRz$_evaluate_markers..)rfrnr_rappend_evaluate_markersr3rr(r|any)	markersrgroupsrqrtryru	lhs_value	rhs_valuer$r$r%rs"



rcCs2d|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r.releaselevelr+serial)infoversionkindr$r$r%format_full_versions

rcCsrttdr ttjj}tjj}nd}d}||tjtt	t
tttd
tddtjdS)Nimplementation0rv.)r:r8rBr>r<r?r=r;r9r@rA)hasattrsysrrrrosplatformmachinereleasesystemr@rHrppython_version_tuple)iverr:r$r$r%rs"

rc@s.eZdZddZddZddZd
dd	ZdS)rc
Csbztt||_WnHty\}z0d|||j|jd}t|WYd}~n
d}~00dS)Nz+Invalid marker: {0!r}, parse error at {1!r})rbMARKERparseString_markersrr.locr)r)rqeZerr_strr$r$r%r*(szMarker.__init__cCs
t|jSr')rirr,r$r$r%r-2szMarker.__str__cCsdt|S)Nz)r.r+r,r$r$r%r06szMarker.__repr__NcCs$t}|dur||t|j|S)a$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N)rupdaterr)r)rcurrent_environmentr$r$r%evaluate:s

zMarker.evaluate)N)r r!r"r*r-r0rr$r$r$r%r's
r)T)O
__future__rrroperatorrrrZsetuptools.extern.pyparsingrrrrr	r
rrr
LZ_compatrZ_typingr
specifiersrrtypingrrrrrrrr+boolOperator__all__
ValueErrorrrrobjectr&r3r6r7VARIABLErKsetParseActionVERSION_CMP	MARKER_OPMARKER_VALUEBOOLOP
MARKER_VARMARKER_ITEMsuppressLPARENRPARENMARKER_EXPRMARKER_ATOMrrbriltleeqnegegtrxr|r}r~rrrrrr$r$r$r%s$		

>
	PK!{4_vendor/packaging/__pycache__/_typing.cpython-39.pycnu[a

(Re@s.dZddgZdZer"ddlmZnddZdS)a;For neatly implementing static typing in packaging.

`mypy` - the static type analysis tool we use - uses the `typing` module, which
provides core functionality fundamental to mypy's functioning.

Generally, `typing` would be imported at runtime and used in that fashion -
it acts as a no-op at runtime and does not have any run-time overhead by
design.

As it turns out, `typing` is not vendorable - it uses separate sources for
Python 2/Python 3. Thus, this codebase can not expect it to be present.
To work around this, mypy allows the typing import to be behind a False-y
optional to prevent it from running at runtime and type-comments can be used
to remove the need for the types to be accessible directly during runtime.

This module provides the False-y guard in a nicely named fashion so that a
curious maintainer can reach here to read this.

In packaging, all static-typing related imports should be guarded as follows:

    from packaging._typing import TYPE_CHECKING

    if TYPE_CHECKING:
        from typing import ...

Ref: https://github.com/python/mypy/issues/3216

TYPE_CHECKINGcastF)rcCs|S)N)type_valuerr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/packaging/_typing.pyr/sN)__doc____all__rtypingrrrrrs
PK!n_vendor/packaging/_typing.pynu["""For neatly implementing static typing in packaging.

`mypy` - the static type analysis tool we use - uses the `typing` module, which
provides core functionality fundamental to mypy's functioning.

Generally, `typing` would be imported at runtime and used in that fashion -
it acts as a no-op at runtime and does not have any run-time overhead by
design.

As it turns out, `typing` is not vendorable - it uses separate sources for
Python 2/Python 3. Thus, this codebase can not expect it to be present.
To work around this, mypy allows the typing import to be behind a False-y
optional to prevent it from running at runtime and type-comments can be used
to remove the need for the types to be accessible directly during runtime.

This module provides the False-y guard in a nicely named fashion so that a
curious maintainer can reach here to read this.

In packaging, all static-typing related imports should be guarded as follows:

    from packaging._typing import TYPE_CHECKING

    if TYPE_CHECKING:
        from typing import ...

Ref: https://github.com/python/mypy/issues/3216
"""

__all__ = ["TYPE_CHECKING", "cast"]

# The TYPE_CHECKING constant defined by the typing module is False at runtime
# but True while type checking.
if False:  # pragma: no cover
    from typing import TYPE_CHECKING
else:
    TYPE_CHECKING = False

# typing's cast syntax requires calling typing.cast at runtime, but we don't
# want to import typing at runtime. Here, we inform the type checkers that
# we're importing `typing.cast` as `cast` and re-implement typing.cast's
# runtime behavior in a block that is ignored by type checkers.
if TYPE_CHECKING:  # pragma: no cover
    # not executed at runtime
    from typing import cast
else:
    # executed at runtime
    def cast(type_, value):  # noqa
        return value
PK!.->F>F9_vendor/more_itertools/__pycache__/recipes.cpython-39.pycnu[a

(Re?@sdZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlZddlmZmZmZgdZddZdDd	d
ZddZdEd
dZdFddZddZefddZddZeZddZddZ ddZ!dGddZ"dd Z#zdd!lm$Z%Wne&ye#Z$Yn0d"d#Z$e#je$_dHd$d%Z'd&d'Z(d(d)Z)d*d+Z*dId,d-Z+dJd.d/Z,dKd0d1Z-dLd2d3Z.d4d5d6d7Z/dMd8d9Z0d:d;Z1dd?Z3d@dAZ4dBdCZ5dS)NaImported from the recipes section of the itertools documentation.

All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.

.. [1] http://docs.python.org/library/itertools.html#recipes

N)deque)
chaincombinationscountcyclegroupbyislicerepeatstarmapteezip_longest)	randrangesamplechoice)	all_equalconsumeconvolve
dotproduct
first_trueflattengrouperiter_exceptncyclesnthnth_combinationpadnonepad_nonepairwise	partitionpowersetprependquantify#random_combination_with_replacementrandom_combinationrandom_permutationrandom_product
repeatfunc
roundrobintabulatetailtakeunique_everseenunique_justseencCstt||S)zReturn first *n* items of the iterable as a list.

        >>> take(3, range(10))
        [0, 1, 2]

    If there are fewer than *n* items in the iterable, all of them are
    returned.

        >>> take(10, range(3))
        [0, 1, 2]

    )listrniterabler1/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/recipes.pyr*<s
r*cCst|t|S)aReturn an iterator over the results of ``func(start)``,
    ``func(start + 1)``, ``func(start + 2)``...

    *func* should be a function that accepts one integer argument.

    If *start* is not specified it defaults to 0. It will be incremented each
    time the iterator is advanced.

        >>> square = lambda x: x ** 2
        >>> iterator = tabulate(square, -3)
        >>> take(4, iterator)
        [9, 4, 1, 0]

    )mapr)functionstartr1r1r2r(Lsr(cCstt||dS)zReturn an iterator over the last *n* items of *iterable*.

    >>> t = tail(3, 'ABCDEFG')
    >>> list(t)
    ['E', 'F', 'G']

    maxlen)iterrr.r1r1r2r)^sr)cCs,|durt|ddntt|||ddS)aXAdvance *iterable* by *n* steps. If *n* is ``None``, consume it
    entirely.

    Efficiently exhausts an iterator without returning values. Defaults to
    consuming the whole iterator, but an optional second argument may be
    provided to limit consumption.

        >>> i = (x for x in range(10))
        >>> next(i)
        0
        >>> consume(i, 3)
        >>> next(i)
        4
        >>> consume(i)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    If the iterator has fewer items remaining than the provided limit, the
    whole iterator will be consumed.

        >>> i = (x for x in range(3))
        >>> consume(i, 5)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    Nrr6)rnextr)iteratorr/r1r1r2ris rcCstt||d|S)zReturns the nth item or a default value.

    >>> l = range(10)
    >>> nth(l, 3)
    3
    >>> nth(l, 20, "zebra")
    'zebra'

    N)r9r)r0r/defaultr1r1r2rs
rcCst|}t|dot|dS)z
    Returns ``True`` if all the elements are equal to each other.

        >>> all_equal('aaaa')
        True
        >>> all_equal('aaab')
        False

    TF)rr9)r0gr1r1r2rs
rcCstt||S)zcReturn the how many times the predicate is true.

    >>> quantify([True, False, True])
    2

    )sumr3)r0predr1r1r2r!sr!cCst|tdS)aReturns the sequence of elements and then returns ``None`` indefinitely.

        >>> take(5, pad_none(range(3)))
        [0, 1, 2, None, None]

    Useful for emulating the behavior of the built-in :func:`map` function.

    See also :func:`padded`.

    N)rr	r0r1r1r2rsrcCsttt||S)zvReturns the sequence elements *n* times

    >>> list(ncycles(["a", "b"], 3))
    ['a', 'b', 'a', 'b', 'a', 'b']

    )r
from_iterabler	tuple)r0r/r1r1r2rsrcCstttj||S)zcReturns the dot product of the two iterables.

    >>> dotproduct([10, 10], [20, 20])
    400

    )r=r3operatormul)Zvec1Zvec2r1r1r2rsrcCs
t|S)zReturn an iterator flattening one level of nesting in a list of lists.

        >>> list(flatten([[0, 1], [2, 3]]))
        [0, 1, 2, 3]

    See also :func:`collapse`, which can flatten multiple levels of nesting.

    )rr@)ZlistOfListsr1r1r2rs	rcGs&|durt|t|St|t||S)aGCall *func* with *args* repeatedly, returning an iterable over the
    results.

    If *times* is specified, the iterable will terminate after that many
    repetitions:

        >>> from operator import add
        >>> times = 4
        >>> args = 3, 5
        >>> list(repeatfunc(add, times, *args))
        [8, 8, 8, 8]

    If *times* is ``None`` the iterable will not terminate:

        >>> from random import randrange
        >>> times = None
        >>> args = 1, 11
        >>> take(6, repeatfunc(randrange, times, *args))  # doctest:+SKIP
        [2, 4, 8, 1, 8, 4]

    N)r
r	)functimesargsr1r1r2r&sr&ccs*t|\}}t|dt||EdHdS)zReturns an iterator of paired items, overlapping, from the original

    >>> take(4, pairwise(count()))
    [(0, 1), (1, 2), (2, 3), (3, 4)]

    On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.

    N)rr9zip)r0abr1r1r2	_pairwises	
rJ)rccst|EdHdSN)itertools_pairwiser?r1r1r2rsrcCs<t|tr tdt||}}t|g|}t|d|iS)zCollect data into fixed-length chunks or blocks.

    >>> list(grouper('ABCDEFG', 3, 'x'))
    [('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]

    z+grouper expects iterable as first parameter	fillvalue)
isinstanceintwarningswarnDeprecationWarningr8r)r0r/rMrFr1r1r2rs

rcgsdt|}tdd|D}|r`z|D]}|Vq$Wqty\|d8}tt||}Yq0qdS)aJYields an item from each iterable, alternating between them.

        >>> list(roundrobin('ABC', 'D', 'EF'))
        ['A', 'D', 'E', 'B', 'F', 'C']

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    css|]}t|jVqdSrK)r8__next__).0itr1r1r2	9zroundrobin..N)lenr
StopIterationr)	iterablespendingZnextsr9r1r1r2r',sr'csFdurtfdd|D}t|\}}dd|Ddd|DfS)a
    Returns a 2-tuple of iterables derived from the input iterable.
    The first yields the items that have ``pred(item) == False``.
    The second yields the items that have ``pred(item) == True``.

        >>> is_odd = lambda x: x % 2 != 0
        >>> iterable = range(10)
        >>> even_items, odd_items = partition(is_odd, iterable)
        >>> list(even_items), list(odd_items)
        ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])

    If *pred* is None, :func:`bool` is used.

        >>> iterable = [0, 1, False, True, '', ' ']
        >>> false_items, true_items = partition(None, iterable)
        >>> list(false_items), list(true_items)
        ([0, False, ''], [1, True, ' '])

    Nc3s|]}||fVqdSrKr1)rTxr>r1r2rVZrWzpartition..css|]\}}|s|VqdSrKr1rTZcondr]r1r1r2rV]rWcss|]\}}|r|VqdSrKr1r_r1r1r2rV^rW)boolr)r>r0Zevaluationst1t2r1r^r2rCsrcs,t|tfddttdDS)aYields all possible subsets of the iterable.

        >>> list(powerset([1, 2, 3]))
        [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]

    :func:`powerset` will operate on iterables that aren't :class:`set`
    instances, so repeated elements in the input will produce repeated elements
    in the output. Use :func:`unique_everseen` on the input to avoid generating
    duplicates:

        >>> seq = [1, 1, 0]
        >>> list(powerset(seq))
        [(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
        >>> from more_itertools import unique_everseen
        >>> list(powerset(unique_everseen(seq)))
        [(), (1,), (0,), (1, 0)]

    c3s|]}t|VqdSrK)r)rTrsr1r2rVvrWzpowerset..rX)r-rr@rangerYr?r1rdr2rbsrc		cst}|j}g}|j}|du}|D]X}|r2||n|}z||vrN|||VWq"tyx||vrt|||VYq"0q"dS)a
    Yield unique elements, preserving order.

        >>> list(unique_everseen('AAAABBBCCDAABBB'))
        ['A', 'B', 'C', 'D']
        >>> list(unique_everseen('ABBCcAD', str.lower))
        ['A', 'B', 'C', 'D']

    Sequences with a mix of hashable and unhashable items can be used.
    The function will be slower (i.e., `O(n^2)`) for unhashable items.

    Remember that ``list`` objects are unhashable - you can use the *key*
    parameter to transform the list to a tuple (which is hashable) to
    avoid a slowdown.

        >>> iterable = ([1, 2], [2, 3], [1, 2])
        >>> list(unique_everseen(iterable))  # Slow
        [[1, 2], [2, 3]]
        >>> list(unique_everseen(iterable, key=tuple))  # Faster
        [[1, 2], [2, 3]]

    Similary, you may want to convert unhashable ``set`` objects with
    ``key=frozenset``. For ``dict`` objects,
    ``key=lambda x: frozenset(x.items())`` can be used.

    N)setaddappend	TypeError)	r0keyZseensetZseenset_addZseenlistZseenlist_addZuse_keyelementkr1r1r2r+ys
r+cCsttttdt||S)zYields elements in order, ignoring serial duplicates

    >>> list(unique_justseen('AAAABBBCCDAABBB'))
    ['A', 'B', 'C', 'D', 'A', 'B']
    >>> list(unique_justseen('ABBCcAD', str.lower))
    ['A', 'B', 'C', 'A', 'D']

    rX)r3r9rB
itemgetterr)r0rkr1r1r2r,s	r,ccs6z|dur|V|VqWn|y0Yn0dS)aXYields results from a function repeatedly until an exception is raised.

    Converts a call-until-exception interface to an iterator interface.
    Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
    to end the loop.

        >>> l = [0, 1, 2]
        >>> list(iter_except(l.pop, IndexError))
        [2, 1, 0]

    Nr1)rD	exceptionfirstr1r1r2rsrcCstt|||S)a
    Returns the first true value in the iterable.

    If no true value is found, returns *default*

    If *pred* is not None, returns the first item for which
    ``pred(item) == True`` .

        >>> first_true(range(10))
        1
        >>> first_true(range(10), pred=lambda x: x > 5)
        6
        >>> first_true(range(10), default='missing', pred=lambda x: x > 9)
        'missing'

    )r9filter)r0r;r>r1r1r2rsrrX)r	cGs$dd|D|}tdd|DS)aDraw an item at random from each of the input iterables.

        >>> random_product('abc', range(4), 'XYZ')  # doctest:+SKIP
        ('c', 3, 'Z')

    If *repeat* is provided as a keyword argument, that many items will be
    drawn from each iterable.

        >>> random_product('abcd', range(4), repeat=2)  # doctest:+SKIP
        ('a', 2, 'd', 3)

    This equivalent to taking a random selection from
    ``itertools.product(*args, **kwarg)``.

    cSsg|]}t|qSr1rArTpoolr1r1r2
rWz"random_product..css|]}t|VqdSrK)rrsr1r1r2rVrWz!random_product..rr)r	rFpoolsr1r1r2r%sr%cCs*t|}|durt|n|}tt||S)abReturn a random *r* length permutation of the elements in *iterable*.

    If *r* is not specified or is ``None``, then *r* defaults to the length of
    *iterable*.

        >>> random_permutation(range(5))  # doctest:+SKIP
        (3, 4, 0, 1, 2)

    This equivalent to taking a random selection from
    ``itertools.permutations(iterable, r)``.

    N)rArYr)r0rcrtr1r1r2r$s
r$cs8t|t}ttt||}tfdd|DS)zReturn a random *r* length subsequence of the elements in *iterable*.

        >>> random_combination(range(5), 3)  # doctest:+SKIP
        (2, 3, 4)

    This equivalent to taking a random selection from
    ``itertools.combinations(iterable, r)``.

    c3s|]}|VqdSrKr1rTirtr1r2rVrWz%random_combination..)rArYsortedrrf)r0rcr/indicesr1ryr2r#s
r#cs@t|ttfddt|D}tfdd|DS)aSReturn a random *r* length subsequence of elements in *iterable*,
    allowing individual elements to be repeated.

        >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
        (0, 0, 1, 2, 2)

    This equivalent to taking a random selection from
    ``itertools.combinations_with_replacement(iterable, r)``.

    c3s|]}tVqdSrK)r
rw)r/r1r2rVrWz6random_combination_with_replacement..c3s|]}|VqdSrKr1rwryr1r2rVrW)rArYrzrf)r0rcr{r1)r/rtr2r"sr"c	Cst|}t|}|dks ||kr$td}t|||}td|dD]}|||||}qD|dkrn||7}|dks~||krtg}|r||||d|d}}}||kr||8}|||||d}}q||d|qt|S)aEquivalent to ``list(combinations(iterable, r))[index]``.

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`nth_combination` computes the subsequence at
    sort position *index* directly, without computing the previous
    subsequences.

        >>> nth_combination(range(5), 3, 5)
        (0, 3, 4)

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    rrX)rArY
ValueErrorminrf
IndexErrorri)	r0rcindexrtr/crmrxresultr1r1r2r"s( rcCst|g|S)aYield *value*, followed by the elements in *iterator*.

        >>> value = '0'
        >>> iterator = ['1', '2', '3']
        >>> list(prepend(value, iterator))
        ['0', '1', '2', '3']

    To prepend multiple values, see :func:`itertools.chain`
    or :func:`value_chain`.

    )r)valuer:r1r1r2r Lsr ccsht|ddd}t|}tdg|d|}t|td|dD]"}||tttj	||Vq@dS)aBConvolve the iterable *signal* with the iterable *kernel*.

        >>> signal = (1, 2, 3, 4, 5)
        >>> kernel = [3, 2, 1]
        >>> list(convolve(signal, kernel))
        [3, 8, 14, 20, 26, 14, 5]

    Note: the input arguments are not interchangeable, as the *kernel*
    is immediately consumed and stored.

    Nr|rr6rX)
rArYrrr	rir=r3rBrC)signalZkernelr/Zwindowr]r1r1r2r[s
r)r)N)N)N)N)N)N)N)NN)N)6__doc__rPcollectionsr	itertoolsrrrrrrr	r
rrrBrandomr
rr__all__r*r(r)rrrr`r!rrrrrr&rJrrLImportErrorrr'rrr+r,rrr%r$r#r"rr rr1r1r1r2sR	0!

(








-



*PK!Dw6_vendor/more_itertools/__pycache__/more.cpython-39.pycnu[a

(Re@sddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$dd	l%m&Z&m'Z'dd
l(m(Z(m)Z)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3dd
l4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;mZ?dddZ@e?fddZAe?fddZBe?fddZCGdddZDddZEddZFd d!ZGd"d#ZHd$d%ZIdd&d'ZJdd(d)ZKdd*d+ZLd,d-ZMdd.d/ZNd0d1ZOdd2d3ZPGd4d5d5ZQdd6d7ZRd8d9ZSd:d;ZTddd?ZVdd@dAZWddCdDZXddEdFZYddGdHZZddIdJZ[dKdLZ\ddMdNZ]ddOdPZ^dQdRZ_ddTdUZ`GdVdWdWeaZbdXdYZcdZd[Zdddd\d]d^Zedd`daZfdbdcZgdddeZheiejffdfdgZkddhdiZlddjdkZmGdldmdmejejnZoddndoZpdpdqZqerdfdrdsZsdtduZtdvdwZudxdyZvGdzd{d{Zwd|d}Zxd~dZyddfddZze.fddddZ{GdddeZ|GdddZ}GdddZ~erfddZddZdddZdddZerdfddZdddZddZdddZGdddZdddZddZddZddZddZddZddZdddZdddZGdddeZGdddZddZdddZddZddZddZddZdd„ZddĄZGddƄdƃZdS)N)Counterdefaultdictdequeabc)Sequence)ThreadPoolExecutor)partialreducewraps)mergeheapifyheapreplaceheappop)chaincompresscountcycle	dropwhilegroupbyislicerepeatstarmap	takewhileteezip_longest)exp	factorialfloorlog)EmptyQueue)random	randrangeuniform)
itemgettermulsubgtlt)
hexversionmaxsize)	monotonic)consumeflattenpairwisepowersettakeunique_everseen)SAbortThreadadjacentalways_iterablealways_reversiblebucket
callback_iterchunkedcircular_shiftscollapsecollateconsecutive_groupsconsumer	countablecount_cycle	mark_ends
differencedistinct_combinationsdistinct_permutations
distributedivide	exactly_n
filter_exceptfirstgroupby_transformileninterleave_longest
interleaveintersperseislice_extendediterateichunked	is_sortedlastlocatelstripmake_decorator
map_except
map_reducenth_or_lastnth_permutationnth_product
numeric_rangeoneonlypadded
partitionsset_partitionspeekablerepeat_lastreplacerlocaterstrip
run_lengthsampleseekableSequenceViewside_effectsliced
sort_togethersplit_atsplit_aftersplit_before
split_when
split_intospystaggerstrip
substringssubstrings_indexestime_limitedunique_to_eachunzipwindowed	with_iterUnequalIterablesError	zip_equal
zip_offsetwindowed_complete
all_uniquevalue_chain
product_indexcombination_indexpermutation_indexFcs:tttt|g|r2fdd}t|SSdS)aJBreak *iterable* into lists of length *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]

    By the default, the last yielded list will have fewer than *n* elements
    if the length of *iterable* is not divisible by *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
        [[1, 2, 3], [4, 5, 6], [7, 8]]

    To use a fill-in value instead, see the :func:`grouper` recipe.

    If the length of *iterable* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    list is yielded.

    c3s(D]}t|krtd|VqdS)Nziterable is not divisible by n.len
ValueError)chunkiteratorn/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/more.pyretszchunked..retN)iterrr1)iterablerstrictrrrrr9s

r9c
CsNztt|WStyH}z"|tur0td||WYd}~Sd}~00dS)aReturn the first item of *iterable*, or *default* if *iterable* is
    empty.

        >>> first([0, 1, 2, 3])
        0
        >>> first([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.

    :func:`first` is useful when you have a generator of expensive-to-retrieve
    values and want any arbitrary one. It is marginally shorter than
    ``next(iter(iterable), default)``.

    zKfirst() was called on an empty iterable, and no default value was provided.N)nextr
StopIteration_markerr)rdefaulterrrrIsrIc
Cs|zJt|tr|dWSt|dr6tdkr6tt|WSt|dddWSWn,ttt	fyv|t
urntd|YS0dS)aReturn the last item of *iterable*, or *default* if *iterable* is
    empty.

        >>> last([0, 1, 2, 3])
        3
        >>> last([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    __reversed__ir,maxlenzDlast() was called on an empty iterable, and no default was provided.N)
isinstancerhasattrr)rreversedr
IndexError	TypeErrorrrr)rrrrrrSs

rScCstt||d|dS)agReturn the nth or the last item of *iterable*,
    or *default* if *iterable* is empty.

        >>> nth_or_last([0, 1, 2, 3], 2)
        2
        >>> nth_or_last([0, 1], 2)
        1
        >>> nth_or_last([], 0, 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    r,r)rSr)rrrrrrrYsrYc@sTeZdZdZddZddZddZefdd	Zd
dZ	dd
Z
ddZddZdS)rbaWrap an iterator to allow lookahead and prepending elements.

    Call :meth:`peek` on the result to get the value that will be returned
    by :func:`next`. This won't advance the iterator:

        >>> p = peekable(['a', 'b'])
        >>> p.peek()
        'a'
        >>> next(p)
        'a'

    Pass :meth:`peek` a default value to return that instead of raising
    ``StopIteration`` when the iterator is exhausted.

        >>> p = peekable([])
        >>> p.peek('hi')
        'hi'

    peekables also offer a :meth:`prepend` method, which "inserts" items
    at the head of the iterable:

        >>> p = peekable([1, 2, 3])
        >>> p.prepend(10, 11, 12)
        >>> next(p)
        10
        >>> p.peek()
        11
        >>> list(p)
        [11, 12, 1, 2, 3]

    peekables can be indexed. Index 0 is the item that will be returned by
    :func:`next`, index 1 is the item after that, and so on:
    The values up to the given index will be cached.

        >>> p = peekable(['a', 'b', 'c', 'd'])
        >>> p[0]
        'a'
        >>> p[1]
        'b'
        >>> next(p)
        'a'

    Negative indexes are supported, but be aware that they will cache the
    remaining items in the source iterator, which may require significant
    storage.

    To check whether a peekable is exhausted, check its truth value:

        >>> p = peekable(['a', 'b'])
        >>> if p:  # peekable has items
        ...     list(p)
        ['a', 'b']
        >>> if not p:  # peekable is exhausted
        ...     list(p)
        []

    cCst||_t|_dSN)r_itr_cacheselfrrrr__init__%s
zpeekable.__init__cCs|Srrrrrr__iter__)szpeekable.__iter__cCs&z|Wnty YdS0dSNFTpeekrrrrr__bool__,s
zpeekable.__bool__cCsH|js>z|jt|jWn ty<|tur4|YS0|jdS)zReturn the item that will be next returned from ``next()``.

        Return ``default`` if there are no items left. If ``default`` is not
        provided, raise ``StopIteration``.

        r)rappendrrrr)rrrrrr3s
z
peekable.peekcGs|jt|dS)aStack up items to be the next ones returned from ``next()`` or
        ``self.peek()``. The items will be returned in
        first in, first out order::

            >>> p = peekable([1, 2, 3])
            >>> p.prepend(10, 11, 12)
            >>> next(p)
            10
            >>> list(p)
            [11, 12, 1, 2, 3]

        It is possible, by prepending items, to "resurrect" a peekable that
        previously raised ``StopIteration``.

            >>> p = peekable([])
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration
            >>> p.prepend(1)
            >>> next(p)
            1
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration

        N)r
extendleftr)ritemsrrrprependCszpeekable.prependcCs|jr|jSt|jSr)rpopleftrrrrrr__next__bs
zpeekable.__next__cCs|jdurdn|j}|dkrF|jdur*dn|j}|jdur>tn|j}n@|dkr~|jdur\dn|j}|jdurvtdn|j}ntd|dks|dkr|j|jn>tt	||dt}t
|j}||kr|jt|j||t|j|S)Nr,rrzslice step cannot be zero)
stepstartstopr*rrextendrminmaxrrlist)rindexrrrr	cache_lenrrr
_get_slicehs
zpeekable._get_slicecCsdt|tr||St|j}|dkr6|j|jn$||krZ|jt|j|d||j|SNrr,)rslicerrrrrr)rrrrrr__getitem__s


zpeekable.__getitem__N)
__name__
__module____qualname____doc__rrrrrrrrrrrrrrbs:rbcOstdtt|i|S)aReturn a sorted merge of the items from each of several already-sorted
    *iterables*.

        >>> list(collate('ACDZ', 'AZ', 'JKL'))
        ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']

    Works lazily, keeping only the next value from each iterable in memory. Use
    :func:`collate` to, for example, perform a n-way mergesort of items that
    don't fit in memory.

    If a *key* function is specified, the iterables will be sorted according
    to its result:

        >>> key = lambda s: int(s)  # Sort by numeric value, not by string
        >>> list(collate(['1', '10'], ['2', '11'], key=key))
        ['1', '2', '10', '11']


    If the *iterables* are sorted in descending order, set *reverse* to
    ``True``:

        >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
        [5, 4, 3, 2, 1, 0]

    If the elements of the passed-in iterables are out of order, you might get
    unexpected results.

    On Python 3.5+, this function is an alias for :func:`heapq.merge`.

    z>> @consumer
        ... def tally():
        ...     i = 0
        ...     while True:
        ...         print('Thing number %s is %s.' % (i, (yield)))
        ...         i += 1
        ...
        >>> t = tally()
        >>> t.send('red')
        Thing number 0 is red.
        >>> t.send('fish')
        Thing number 1 is fish.

    Without the decorator, you would have to call ``next(t)`` before
    ``t.send()`` could be used.

    cs|i|}t||Sr)r)argsrgenfuncrrwrapperszconsumer..wrapper)r
)rrrrrr>sr>cCs t}tt||ddt|S)zReturn the number of items in *iterable*.

        >>> ilen(x for x in range(1000000) if x % 3 == 0)
        333334

    This consumes the iterable, so handle with care.

    rr)rrzipr)rcounterrrrrKsrKccs|V||}qdS)zReturn ``start``, ``func(start)``, ``func(func(start))``, ...

    >>> from itertools import islice
    >>> list(islice(iterate(lambda x: 2*x, 1), 10))
    [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

    Nr)rrrrrrPs	rPccs2|}|EdHWdn1s$0YdS)a:Wrap an iterable in a ``with`` statement, so it closes once exhausted.

    For example, this will close the file when the iterator is exhausted::

        upper_lines = (line.upper() for line in with_iter(open('foo')))

    Any context manager which returns an iterable is a candidate for
    ``with_iter``.

    Nr)Zcontext_managerrrrrr|sr|c
Cst|}zt|}Wn2tyF}z|p.td|WYd}~n
d}~00zt|}WntyfYn0d||}|p~t||S)aReturn the first item from *iterable*, which is expected to contain only
    that item. Raise an exception if *iterable* is empty or has more than one
    item.

    :func:`one` is useful for ensuring that an iterable contains only one item.
    For example, it can be used to retrieve the result of a database query
    that is expected to return a single row.

    If *iterable* is empty, ``ValueError`` will be raised. You may specify a
    different exception with the *too_short* keyword:

        >>> it = []
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: too many items in iterable (expected 1)'
        >>> too_short = IndexError('too few items')
        >>> one(it, too_short=too_short)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        IndexError: too few items

    Similarly, if *iterable* contains more than one item, ``ValueError`` will
    be raised. You may specify a different exception with the *too_long*
    keyword:

        >>> it = ['too', 'many']
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: Expected exactly one item in iterable, but got 'too',
        'many', and perhaps more.
        >>> too_long = RuntimeError
        >>> one(it, too_long=too_long)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        RuntimeError

    Note that :func:`one` attempts to advance *iterable* twice to ensure there
    is only one item. See :func:`spy` or :func:`peekable` to check iterable
    contents less destructively.

    z&too few items in iterable (expected 1)NLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)rrrrformat)rZ	too_shorttoo_longitfirst_valuersecond_valuemsgrrrr]s",
r]csrfdd}dd}t|}t||dur0}d|krDkrbnn|krX||S|||St|rldndS)	aYield successive distinct permutations of the elements in *iterable*.

        >>> sorted(distinct_permutations([1, 0, 1]))
        [(0, 1, 1), (1, 0, 1), (1, 1, 0)]

    Equivalent to ``set(permutations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    Duplicate permutations arise when there are duplicated elements in the
    input iterable. The number of items returned is
    `n! / (x_1! * x_2! * ... * x_n!)`, where `n` is the total number of
    items input, and each `x_i` is the count of a distinct item in the input
    sequence.

    If *r* is given, only the *r*-length permutations are yielded.

        >>> sorted(distinct_permutations([1, 0, 1], r=2))
        [(0, 1), (1, 0), (1, 1)]
        >>> sorted(distinct_permutations(range(3), r=2))
        [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

    c3st|VtdddD]}||||dkrq._fullc	ss4|d|||d}}t|ddd}tt|}t|V|d}|D]}|||kr`qn||}qLdS|D]2}||||krr||||||<||<qqr|D]2}||||kr||||||<||<qq||d||d7}|d7}|d|||||d||d<|dd<q6dS)Nr,r)rrr)	rrheadtailZright_head_indexesZleft_tail_indexesZpivotrrrrr_partialvs*

z'distinct_permutations.._partialNrr)r)sortedrr)rrrrrrrrrDEs'rDcCs^|dkrtdnH|dkr0ttt||ddSt|g}t||}ttt||ddSdS)a6Intersperse filler element *e* among the items in *iterable*, leaving
    *n* items between each filler element.

        >>> list(intersperse('!', [1, 2, 3, 4, 5]))
        [1, '!', 2, '!', 3, '!', 4, '!', 5]

        >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2))
        [1, 2, None, 3, 4, None, 5]

    rz
n must be > 0r,N)rrrMrr9r.)rrrZfillerchunksrrrrNs


rNcsFdd|D}tttt|fddDfdd|DS)aReturn the elements from each of the input iterables that aren't in the
    other input iterables.

    For example, suppose you have a set of packages, each with a set of
    dependencies::

        {'pkg_1': {'A', 'B'}, 'pkg_2': {'B', 'C'}, 'pkg_3': {'B', 'D'}}

    If you remove one package, which dependencies can also be removed?

    If ``pkg_1`` is removed, then ``A`` is no longer necessary - it is not
    associated with ``pkg_2`` or ``pkg_3``. Similarly, ``C`` is only needed for
    ``pkg_2``, and ``D`` is only needed for ``pkg_3``::

        >>> unique_to_each({'A', 'B'}, {'B', 'C'}, {'B', 'D'})
        [['A'], ['C'], ['D']]

    If there are duplicates in one input iterable that aren't in the others
    they will be duplicated in the output. Input order is preserved::

        >>> unique_to_each("mississippi", "missouri")
        [['p', 'p'], ['o', 'u', 'r']]

    It is assumed that the elements of each iterable are hashable.

    cSsg|]}t|qSr)r.0rrrr
z"unique_to_each..csh|]}|dkr|qSr,r)relement)countsrr	rz!unique_to_each..csg|]}ttj|qSr)rfilter__contains__r)uniquesrrrr)rr
from_iterablemapset)rpoolr)rrrrysryccs|dkrtd|dkr$tVdS|dkr4tdt|d}|}t|j|D]}|d8}|sN|}t|VqNt|}||krtt|t|||Vn6d|krt||krnn||f|7}t|VdS)aMReturn a sliding window of width *n* over the given iterable.

        >>> all_windows = windowed([1, 2, 3, 4, 5], 3)
        >>> list(all_windows)
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    When the window is larger than the iterable, *fillvalue* is used in place
    of missing values:

        >>> list(windowed([1, 2, 3], 4))
        [(1, 2, 3, None)]

    Each window will advance in increments of *step*:

        >>> list(windowed([1, 2, 3, 4, 5, 6], 3, fillvalue='!', step=2))
        [(1, 2, 3), (3, 4, 5), (5, 6, '!')]

    To slide into the iterable's items, use :func:`chain` to add filler items
    to the left:

        >>> iterable = [1, 2, 3, 4]
        >>> n = 3
        >>> padding = [None] * (n - 1)
        >>> list(windowed(chain(padding, iterable), 3))
        [(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
    rn must be >= 0Nr,zstep must be >= 1r)	rrrrrrrrr)seqr	fillvaluerZwindowr_rrrrr{s(
r{ccstg}t|D]}|||fVqt|}t|}td|dD],}t||dD]}||||VqVqBdS)aFYield all of the substrings of *iterable*.

        >>> [''.join(s) for s in substrings('more')]
        ['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']

    Note that non-string iterables can also be subdivided.

        >>> list(substrings([0, 1, 2]))
        [(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)]

    rr,N)rrrrr)rritem
item_countrrrrrrvs


rvcs0tdtd}|rt|}fdd|DS)a@Yield all substrings and their positions in *seq*

    The items yielded will be a tuple of the form ``(substr, i, j)``, where
    ``substr == seq[i:j]``.

    This function only works for iterables that support slicing, such as
    ``str`` objects.

    >>> for item in substrings_indexes('more'):
    ...    print(item)
    ('m', 0, 1)
    ('o', 1, 2)
    ('r', 2, 3)
    ('e', 3, 4)
    ('mo', 0, 2)
    ('or', 1, 3)
    ('re', 2, 4)
    ('mor', 0, 3)
    ('ore', 1, 4)
    ('more', 0, 4)

    Set *reverse* to ``True`` to yield the same items in the opposite order.


    r,c3sB|]:}tt|dD] }||||||fVqqdSr,N)rr)rLrrrr	Nsz%substrings_indexes..)rrr)rreverserrrrrw1s
rwc@s:eZdZdZd
ddZddZddZd	d
ZddZdS)r7aWrap *iterable* and return an object that buckets it iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    NcCs,t||_||_tt|_|p$dd|_dS)NcSsdSNTrxrrr{rz!bucket.__init__..)rr_keyrrr
_validator)rrkey	validatorrrrrws

zbucket.__init__cCsH||sdSzt||}Wnty2YdS0|j||dSr)rrrr
appendleft)rvaluerrrrr}s
zbucket.__contains__ccs~|j|r|j|Vqzt|j}Wnty>YdS0||}||kr\|Vqq||r|j||qqdS)z
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        N)rrrrrrrr)rr
r
item_valuerrr_get_valuess	


zbucket._get_valuesccsD|jD](}||}||r|j||q|jEdHdSr)rrrrrkeys)rrrrrrrs



zbucket.__iter__cCs||stdS||S)Nr)rrrrr
rrrrs
zbucket.__getitem__)N)	rrrrrrrrrrrrrr7Ss#

r7cCs$t|}t||}|t||fS)aReturn a 2-tuple with a list containing the first *n* elements of
    *iterable*, and an iterator with the same items as *iterable*.
    This allows you to "look ahead" at the items in the iterable without
    advancing it.

    There is one item in the list by default:

        >>> iterable = 'abcdefg'
        >>> head, iterable = spy(iterable)
        >>> head
        ['a']
        >>> list(iterable)
        ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    You may use unpacking to retrieve items instead of lists:

        >>> (head,), iterable = spy('abcdefg')
        >>> head
        'a'
        >>> (first, second), iterable = spy('abcdefg', 2)
        >>> first
        'a'
        >>> second
        'b'

    The number of items requested can be larger than the number of items in
    the iterable:

        >>> iterable = [1, 2, 3, 4, 5]
        >>> head, iterable = spy(iterable, 10)
        >>> head
        [1, 2, 3, 4, 5]
        >>> list(iterable)
        [1, 2, 3, 4, 5]

    )rr1copyr)rrrrrrrrss%
rscGstt|S)a4Return a new iterable yielding from each iterable in turn,
    until the shortest is exhausted.

        >>> list(interleave([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7]

    For a version that doesn't terminate after the shortest iterable is
    exhausted, see :func:`interleave_longest`.

    )rrr)rrrrrMsrMcGs"tt|dti}dd|DS)asReturn a new iterable yielding from each iterable in turn,
    skipping any that are exhausted.

        >>> list(interleave_longest([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7, 3, 8]

    This function produces the same output as :func:`roundrobin`, but may
    perform better for some inputs (in particular when the number of iterables
    is large).

    rcss|]}|tur|VqdSr)r)rrrrrrrz%interleave_longest..)rrrr)rrrrrrLsrLc#s$fdd|dEdHdS)a>Flatten an iterable with multiple levels of nesting (e.g., a list of
    lists of tuples) into non-iterable types.

        >>> iterable = [(1, 2), ([3, 4], [[5], [6]])]
        >>> list(collapse(iterable))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and
    will not be collapsed.

    To avoid collapsing other types, specify *base_type*:

        >>> iterable = ['ab', ('cd', 'ef'), ['gh', 'ij']]
        >>> list(collapse(iterable, base_type=tuple))
        ['ab', ('cd', 'ef'), 'gh', 'ij']

    Specify *levels* to stop flattening after a certain level:

    >>> iterable = [('a', ['b']), ('c', ['d'])]
    >>> list(collapse(iterable))  # Fully flattened
    ['a', 'b', 'c', 'd']
    >>> list(collapse(iterable, levels=1))  # Only one level flattened
    ['a', ['b'], 'c', ['d']]

    c3sdur|ks0t|ttfs0dur:t|r:|VdSzt|}Wnty`|VYdS0|D]}||dEdHqfdSNr,)rstrbytesrr)nodeleveltreechild	base_typelevelswalkrrrs&zcollapse..walkrNr)rrrrrrr;sr;ccszzd|dur||dur2|D]}|||Vqn"t||D]}|||EdHq>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> func = lambda x: print(x, file=f)
        >>> before = lambda: print(u'HEADER', file=f)
        >>> after = f.close
        >>> it = [u'a', u'b', u'c']
        >>> consume(side_effect(func, it, before=before, after=after))
        >>> f.closed
        True

    N)r9)rr
chunk_sizebeforeafterrrrrrrk,s,
rkcsDttfddtdD|r<fdd}t|SSdS)apYield slices of length *n* from the sequence *seq*.

    >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
    [(1, 2, 3), (4, 5, 6)]

    By the default, the last yielded slice will have fewer than *n* elements
    if the length of *seq* is not divisible by *n*:

    >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
    [(1, 2, 3), (4, 5, 6), (7, 8)]

    If the length of *seq* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    slice is yielded.

    This function will only work for iterables that support slicing.
    For non-sliceable iterables, see :func:`chunked`.

    c3s|]}||VqdSrrrr)rrrrr}rzsliced..rc3s(D]}t|krtd|VqdS)Nzseq is not divisible by n.r)Z_slicerrrrszsliced..retN)rrrr)rrrrr)rrrrrlis
 
rlrccs|dkrt|VdSg}t|}|D]N}||rj|V|rD|gV|dkr\t|VdSg}|d8}q&||q&|VdS)a<Yield lists of items from *iterable*, where each list is delimited by
    an item where callable *pred* returns ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b'))
        [['a'], ['c', 'd', 'c'], ['a']]

        >>> list(split_at(range(10), lambda n: n % 2 == 1))
        [[0], [2], [4], [6], [8], []]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_at(range(10), lambda n: n % 2 == 1, maxsplit=2))
        [[0], [2], [4, 5, 6, 7, 8, 9]]

    By default, the delimiting items are not included in the output.
    The include them, set *keep_separator* to ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b', keep_separator=True))
        [['a'], ['b'], ['c', 'd', 'c'], ['b'], ['a']]

    rNr,rrr)rpredmaxsplitZkeep_separatorbufrrrrrrns"


rnccs|dkrt|VdSg}t|}|D]J}||rf|rf|V|dkrZ|gt|VdSg}|d8}||q&|r||VdS)a\Yield lists of items from *iterable*, where each list ends just before
    an item for which callable *pred* returns ``True``:

        >>> list(split_before('OneTwo', lambda s: s.isupper()))
        [['O', 'n', 'e'], ['T', 'w', 'o']]

        >>> list(split_before(range(10), lambda n: n % 3 == 0))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_before(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]
    rNr,rrr r!r"rrrrrrps 
rpccsz|dkrt|VdSg}t|}|D]D}||||r&|r&|V|dkr^t|VdSg}|d8}q&|rv|VdS)a[Yield lists of items from *iterable*, where each list ends with an
    item where callable *pred* returns ``True``:

        >>> list(split_after('one1two2', lambda s: s.isdigit()))
        [['o', 'n', 'e', '1'], ['t', 'w', 'o', '2']]

        >>> list(split_after(range(10), lambda n: n % 3 == 0))
        [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_after(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0], [1, 2, 3], [4, 5, 6, 7, 8, 9]]

    rNr,rr#rrrros 



roccs|dkrt|VdSt|}zt|}Wnty>YdS0|g}|D]L}|||r|V|dkr||gt|VdSg}|d8}|||}qJ|VdS)aSplit *iterable* into pieces based on the output of *pred*.
    *pred* should be a function that takes successive pairs of items and
    returns ``True`` if the iterable should be split in between them.

    For example, to find runs of increasing numbers, split the iterable when
    element ``i`` is larger than element ``i + 1``:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2], lambda x, y: x > y))
        [[1, 2, 3, 3], [2, 5], [2, 4], [2]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2],
        ...                 lambda x, y: x > y, maxsplit=2))
        [[1, 2, 3, 3], [2, 5], [2, 4, 2]]

    rNr,)rrrrr)rr r!rZcur_itemr"Z	next_itemrrrrqs(


rqccs>t|}|D],}|dur(t|VdStt||VqdS)aYield a list of sequential items from *iterable* of length 'n' for each
    integer 'n' in *sizes*.

        >>> list(split_into([1,2,3,4,5,6], [1,2,3]))
        [[1], [2, 3], [4, 5, 6]]

    If the sum of *sizes* is smaller than the length of *iterable*, then the
    remaining items of *iterable* will not be returned.

        >>> list(split_into([1,2,3,4,5,6], [2,3]))
        [[1, 2], [3, 4, 5]]

    If the sum of *sizes* is larger than the length of *iterable*, fewer items
    will be returned in the iteration that overruns *iterable* and further
    lists will be empty:

        >>> list(split_into([1,2,3,4], [1,2,3,4]))
        [[1], [2, 3], [4], []]

    When a ``None`` object is encountered in *sizes*, the returned list will
    contain items up to the end of *iterable* the same way that itertools.slice
    does:

        >>> list(split_into([1,2,3,4,5,6,7,8,9,0], [2,3,None]))
        [[1, 2], [3, 4, 5], [6, 7, 8, 9, 0]]

    :func:`split_into` can be useful for grouping a series of items where the
    sizes of the groups are not uniform. An example would be where in a row
    from a table, multiple columns represent elements of the same feature
    (e.g. a point represented by x,y,z) but, the format is not the same for
    all columns.
    N)rrr)rsizesrrrrrrr+s#
rrc	cst|}|dur&t|t|EdHnZ|dkr8tdnHd}|D]}|V|d7}q@|rd|||n||}t|D]
}|VqtdS)aYield the elements from *iterable*, followed by *fillvalue*, such that
    at least *n* items are emitted.

        >>> list(padded([1, 2, 3], '?', 5))
        [1, 2, 3, '?', '?']

    If *next_multiple* is ``True``, *fillvalue* will be emitted until the
    number of items emitted is a multiple of *n*::

        >>> list(padded([1, 2, 3, 4], n=3, next_multiple=True))
        [1, 2, 3, 4, None, None]

    If *n* is ``None``, *fillvalue* will be emitted indefinitely.

    Nr,n must be at least 1r)rrrrr)	rrrZ
next_multiplerrr	remainingrrrrr_Xs

r_ccs6t}|D]
}|Vq|tur |n|}t|EdHdS)a"After the *iterable* is exhausted, keep yielding its last element.

        >>> list(islice(repeat_last(range(3)), 5))
        [0, 1, 2, 2, 2]

    If the iterable is empty, yield *default* forever::

        >>> list(islice(repeat_last(range(0), 42), 5))
        [42, 42, 42, 42, 42]

    N)rr)rrrfinalrrrrcxs
rccs0dkrtdt|}fddt|DS)aDistribute the items from *iterable* among *n* smaller iterables.

        >>> group_1, group_2 = distribute(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 3, 5]
        >>> list(group_2)
        [2, 4, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = distribute(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 4, 7], [2, 5], [3, 6]]

    If the length of *iterable* is smaller than *n*, then the last returned
    iterables will be empty:

        >>> children = distribute(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function uses :func:`itertools.tee` and may require significant
    storage. If you need the order items in the smaller iterables to match the
    original iterable, see :func:`divide`.

    r,r%csg|]\}}t||dqSr)r)rrrrrrrrzdistribute..)rr	enumerate)rrchildrenrr(rrEs
rErrr,cCs t|t|}t||||dS)a[Yield tuples whose elements are offset from *iterable*.
    The amount by which the `i`-th item in each tuple is offset is given by
    the `i`-th item in *offsets*.

        >>> list(stagger([0, 1, 2, 3]))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3)]
        >>> list(stagger(range(8), offsets=(0, 2, 4)))
        [(0, 2, 4), (1, 3, 5), (2, 4, 6), (3, 5, 7)]

    By default, the sequence will end when the final element of a tuple is the
    last item in the iterable. To continue until the first element of a tuple
    is the last item in the iterable, set *longest* to ``True``::

        >>> list(stagger([0, 1, 2, 3], longest=True))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3), (2, 3, None), (3, None, None)]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    )offsetslongestr)rrr)rr,r-rr*rrrrtsrtcseZdZdfdd	ZZS)r}Ncs*d}|dur|dj|7}t|dS)Nz Iterables have different lengthsz/: index 0 has length {}; index {} has length {})rsuperr)rdetailsr	__class__rrrszUnequalIterablesError.__init__)N)rrrr
__classcell__rrr0rr}sr}ccs6t|dtiD]"}|D]}|turtq|VqdS)Nr)rrr})rZcombovalrrr_zip_equal_generators
r4cGstdkrtdtzZt|d}t|dddD]\}}t|}||kr4q\q4t|WSt|||fdWntyt	|YS0dS)a ``zip`` the input *iterables* together, but raise
    ``UnequalIterablesError`` if they aren't all the same length.

        >>> it_1 = range(3)
        >>> it_2 = iter('abc')
        >>> list(zip_equal(it_1, it_2))
        [(0, 'a'), (1, 'b'), (2, 'c')]

        >>> it_1 = range(3)
        >>> it_2 = iter('abcd')
        >>> list(zip_equal(it_1, it_2)) # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        more_itertools.more.UnequalIterablesError: Iterables have different
        lengths

    i
zwzip_equal will be removed in a future version of more-itertools. Use the builtin zip function with strict=True instead.rr,N)r/)
r)rrrrr)rr}rr4)rZ
first_sizerrrrrrr~s	
r~)r-rcGst|t|krtdg}t||D]P\}}|dkrP|tt|||q&|dkrl|t||dq&||q&|rt|d|iSt|S)aF``zip`` the input *iterables* together, but offset the `i`-th iterable
    by the `i`-th item in *offsets*.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1)))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e')]

    This can be used as a lightweight alternative to SciPy or pandas to analyze
    data sets in which some series have a lead or lag relationship.

    By default, the sequence will end when the shortest iterable is exhausted.
    To continue until the longest iterable is exhausted, set *longest* to
    ``True``.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1), longest=True))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e'), (None, 'f')]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    z,Number of iterables and offsets didn't matchrNr)rrrrrrrr)r,r-rr	staggeredrrrrrrsrrcsndurt|}nBt|}t|dkr>|dfdd}nt|fdd}tttt|||dS)aReturn the input iterables sorted together, with *key_list* as the
    priority for sorting. All iterables are trimmed to the length of the
    shortest one.

    This can be used like the sorting function in a spreadsheet. If each
    iterable represents a column of data, the key list determines which
    columns are used for sorting.

    By default, all iterables are sorted using the ``0``-th iterable::

        >>> iterables = [(4, 3, 2, 1), ('a', 'b', 'c', 'd')]
        >>> sort_together(iterables)
        [(1, 2, 3, 4), ('d', 'c', 'b', 'a')]

    Set a different key list to sort according to another iterable.
    Specifying multiple keys dictates how ties are broken::

        >>> iterables = [(3, 1, 2), (0, 1, 0), ('c', 'b', 'a')]
        >>> sort_together(iterables, key_list=(1, 2))
        [(2, 3, 1), (0, 0, 1), ('a', 'c', 'b')]

    To sort by a function of the elements of the iterable, pass a *key*
    function. Its arguments are the elements of the iterables corresponding to
    the key list::

        >>> names = ('a', 'b', 'c')
        >>> lengths = (1, 2, 3)
        >>> widths = (5, 2, 1)
        >>> def area(length, width):
        ...     return length * width
        >>> sort_together([names, lengths, widths], key_list=(1, 2), key=area)
        [('c', 'b', 'a'), (3, 2, 1), (1, 2, 5)]

    Set *reverse* to ``True`` to sort in descending order.

        >>> sort_together([(1, 2, 3), ('c', 'b', 'a')], reverse=True)
        [(3, 2, 1), ('a', 'b', 'c')]

    Nr,rcs|SrrZzipped_items)r
key_offsetrrrfrzsort_together..cs|Srrr7)
get_key_itemsrrrrks)rr)r$rrrr)rZkey_listrrZkey_argumentr)r9rr8rrm2s(
rmcsPtt|\}}|sdS|d}t|t|}ddtfddt|DS)aThe inverse of :func:`zip`, this function disaggregates the elements
    of the zipped *iterable*.

    The ``i``-th iterable contains the ``i``-th element from each element
    of the zipped iterable. The first element is used to to determine the
    length of the remaining elements.

        >>> iterable = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> letters, numbers = unzip(iterable)
        >>> list(letters)
        ['a', 'b', 'c', 'd']
        >>> list(numbers)
        [1, 2, 3, 4]

    This is similar to using ``zip(*iterable)``, but it avoids reading
    *iterable* into memory. Note, however, that this function uses
    :func:`itertools.tee` and thus may require significant storage.

    rrcsfdd}|S)Ncs&z
|WSty tYn0dSr)rr)objrrrgetters

z)unzip..itemgetter..getterr)rr<rr;rr$szunzip..itemgetterc3s |]\}}t||VqdSrr)rrrr$rrrrzunzip..)rsrrrrr))rrrrr>rrztsrzc	Cs|dkrtdz|ddWnty:t|}Yn0|}tt||\}}g}d}td|dD]6}|}|||kr|dn|7}|t|||qh|S)aDivide the elements from *iterable* into *n* parts, maintaining
    order.

        >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 2, 3]
        >>> list(group_2)
        [4, 5, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = divide(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 2, 3], [4, 5], [6, 7]]

    If the length of the iterable is smaller than n, then the last returned
    iterables will be empty:

        >>> children = divide(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function will exhaust the iterable before returning and may require
    significant storage. If order is not important, see :func:`distribute`,
    which does not first pull the iterable into memory.

    r,r%Nr)rrrdivmodrrrr)	rrrqrrrrrrrrrFsrFcCsX|durtdS|dur,t||r,t|fSz
t|WStyRt|fYS0dS)axIf *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    Nr)rrr)r:rrrrr5s)

r5cCsZ|dkrtdt|\}}dg|}t|t|||}ttt|d|d}t||S)asReturn an iterable over `(bool, item)` tuples where the `item` is
    drawn from *iterable* and the `bool` indicates whether
    that item satisfies the *predicate* or is adjacent to an item that does.

    For example, to find whether items are adjacent to a ``3``::

        >>> list(adjacent(lambda x: x == 3, range(6)))
        [(False, 0), (False, 1), (True, 2), (True, 3), (True, 4), (False, 5)]

    Set *distance* to change what counts as adjacent. For example, to find
    whether items are two places away from a ``3``:

        >>> list(adjacent(lambda x: x == 3, range(6), distance=2))
        [(False, 0), (True, 1), (True, 2), (True, 3), (True, 4), (True, 5)]

    This is useful for contextualizing the results of a search function.
    For example, a code comparison tool might want to identify lines that
    have changed, but also surrounding lines to give the viewer of the diff
    context.

    The predicate function will only be called once for each item in the
    iterable.

    See also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    rzdistance must be at least 0Frr,)rrrranyr{r)	predicaterdistancei1i2paddingselectedZadjacent_to_selectedrrrr4
s
r4cs:t||}r fdd|D}r6fdd|D}|S)aAn extension of :func:`itertools.groupby` that can apply transformations
    to the grouped data.

    * *keyfunc* is a function computing a key value for each item in *iterable*
    * *valuefunc* is a function that transforms the individual items from
      *iterable* after grouping
    * *reducefunc* is a function that transforms each group of items

    >>> iterable = 'aAAbBBcCC'
    >>> keyfunc = lambda k: k.upper()
    >>> valuefunc = lambda v: v.lower()
    >>> reducefunc = lambda g: ''.join(g)
    >>> list(groupby_transform(iterable, keyfunc, valuefunc, reducefunc))
    [('A', 'aaa'), ('B', 'bbb'), ('C', 'ccc')]

    Each optional argument defaults to an identity function if not specified.

    :func:`groupby_transform` is useful when grouping elements of an iterable
    using a separate iterable as the key. To do this, :func:`zip` the iterables
    and pass a *keyfunc* that extracts the first element and a *valuefunc*
    that extracts the second element::

        >>> from operator import itemgetter
        >>> keys = [0, 0, 1, 1, 1, 2, 2, 2, 3]
        >>> values = 'abcdefghi'
        >>> iterable = zip(keys, values)
        >>> grouper = groupby_transform(iterable, itemgetter(0), itemgetter(1))
        >>> [(k, ''.join(g)) for k, g in grouper]
        [(0, 'ab'), (1, 'cde'), (2, 'fgh'), (3, 'i')]

    Note that the order of items in the iterable is significant.
    Only adjacent items are grouped together, so if you don't want any
    duplicate groups, you should sort the iterable by the key function.

    c3s |]\}}|t|fVqdSrr=rkg)	valuefuncrrrZrz$groupby_transform..c3s|]\}}||fVqdSrrrH)
reducefuncrrr\rr)rkeyfuncrKrLrr)rLrKrrJ4s$
rJc@seZdZdZeeddZddZddZddZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!S)"r\a<An extension of the built-in ``range()`` function whose arguments can
    be any orderable numeric type.

    With only *stop* specified, *start* defaults to ``0`` and *step*
    defaults to ``1``. The output items will match the type of *stop*:

        >>> list(numeric_range(3.5))
        [0.0, 1.0, 2.0, 3.0]

    With only *start* and *stop* specified, *step* defaults to ``1``. The
    output items will match the type of *start*:

        >>> from decimal import Decimal
        >>> start = Decimal('2.1')
        >>> stop = Decimal('5.1')
        >>> list(numeric_range(start, stop))
        [Decimal('2.1'), Decimal('3.1'), Decimal('4.1')]

    With *start*, *stop*, and *step*  specified the output items will match
    the type of ``start + step``:

        >>> from fractions import Fraction
        >>> start = Fraction(1, 2)  # Start at 1/2
        >>> stop = Fraction(5, 2)  # End at 5/2
        >>> step = Fraction(1, 2)  # Count by 1/2
        >>> list(numeric_range(start, stop, step))
        [Fraction(1, 2), Fraction(1, 1), Fraction(3, 2), Fraction(2, 1)]

    If *step* is zero, ``ValueError`` is raised. Negative steps are supported:

        >>> list(numeric_range(3, -1, -1.0))
        [3.0, 2.0, 1.0, 0.0]

    Be aware of the limitations of floating point numbers; the representation
    of the yielded numbers may be surprising.

    ``datetime.datetime`` objects can be used for *start* and *stop*, if *step*
    is a ``datetime.timedelta`` object:

        >>> import datetime
        >>> start = datetime.datetime(2019, 1, 1)
        >>> stop = datetime.datetime(2019, 1, 3)
        >>> step = datetime.timedelta(days=1)
        >>> items = iter(numeric_range(start, stop, step))
        >>> next(items)
        datetime.datetime(2019, 1, 1, 0, 0)
        >>> next(items)
        datetime.datetime(2019, 1, 2, 0, 0)

    rcGst|}|dkr@|\|_t|jd|_t|j|jd|_nl|dkrl|\|_|_t|j|jd|_n@|dkr|\|_|_|_n&|dkrtd|ntd|t|jd|_|j|jkrtd|j|jk|_	|
dS)Nr,rrz2numeric_range expected at least 1 argument, got {}z2numeric_range expected at most 3 arguments, got {}z&numeric_range() arg 3 must not be zero)r_stoptype_start_steprr_zeror_growing	_init_len)rrZargcrrrrs4znumeric_range.__init__cCs"|jr|j|jkS|j|jkSdSr)rUrRrPrrrrrsznumeric_range.__bool__cCsr|jr:|j|kr|jkrnnqn||j|j|jkSn4|j|krR|jkrnnn|j||j|jkSdSNF)rUrRrPrSrT)relemrrrrsznumeric_range.__contains__cCsdt|tr\t|}t|}|s&|r.|o,|S|j|jkoX|j|jkoX|d|dkSndSdS)NrF)rr\boolrRrS
_get_by_index)rotherZ
empty_selfZempty_otherrrr__eq__s



znumeric_range.__eq__cCst|tr||St|tr|jdur.|jn
|j|j}|jdusR|j|jkrZ|j}n |j|jkrn|j	}n||j}|j
dus|j
|jkr|j	}n"|j
|jkr|j}n||j
}t|||Std
t|jdS)Nz8numeric range indices must be integers or slices, not {})rintrZrrrSr_lenrRrPrr\rrrQr)rrrrrrrrrs(


znumeric_range.__getitem__cCs&|rt|j|d|jfS|jSdSNr)hashrRrZrS_EMPTY_HASHrrrr__hash__sznumeric_range.__hash__csBfddtD}jr,tttj|Stttj|SdS)Nc3s|]}j|jVqdSr)rRrS)rrrrrrrz)numeric_range.__iter__..)rrUrrr'rPr()rvaluesrrrrsznumeric_range.__iter__cCs|jSr)r^rrrr__len__sznumeric_range.__len__cCsr|jr|j}|j}|j}n|j}|j}|j}||}||jkrHd|_n&t||\}}t|t||jk|_dSNr)rUrRrPrSrTr^r?r])rrrrrCr@rrrrrVs
znumeric_range._init_lencCst|j|j|jffSr)r\rRrPrSrrrr
__reduce__
sznumeric_range.__reduce__cCsF|jdkr"dt|jt|jSdt|jt|jt|jSdS)Nr,znumeric_range({}, {})znumeric_range({}, {}, {}))rSrreprrRrPrrrr__repr__s
znumeric_range.__repr__cCs"tt|d|j|j|jSr_)rr\rZrRrSrrrrrs
znumeric_range.__reversed__cCst||vSr)r]rrrrr!sznumeric_range.countcCs|jrL|j|kr|jkrnqt||j|j\}}||jkrt|SnF|j|krd|jkrnn*t|j||j\}}||jkrt|Std|dS)Nz{} is not in numeric range)	rUrRrPr?rSrTr]rr)rr
r@rrrrr$s


znumeric_range.indexcCs<|dkr||j7}|dks$||jkr,td|j||jS)Nrz'numeric range object index out of range)r^rrRrS)rrrrrrZ2s

znumeric_range._get_by_indexN)rrrrr`rrarrrr\rrbrrdrVrfrhrrrrZrrrrr\as"3

r\cs<tstdS|dur"tnt|}fdd|DS)aCycle through the items from *iterable* up to *n* times, yielding
    the number of completed cycles along with each item. If *n* is omitted the
    process repeats indefinitely.

    >>> list(count_cycle('AB', 3))
    [(0, 'A'), (0, 'B'), (1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]

    rNc3s |]}D]}||fVq
qdSrr)rrrrrrrGrzcount_cycle..)rrrr)rrrrrirr@:s
	r@ccs~t|}zt|}Wnty(YdS0z,tD] }|}t|}|dkd|fVq2Wn"tyx|dkd|fVYn0dS)aHYield 3-tuples of the form ``(is_first, is_last, item)``.

    >>> list(mark_ends('ABC'))
    [(True, False, 'A'), (False, False, 'B'), (False, True, 'C')]

    Use this when looping over an iterable to take special action on its first
    and/or last items:

    >>> iterable = ['Header', 100, 200, 'Footer']
    >>> total = 0
    >>> for is_first, is_last, item in mark_ends(iterable):
    ...     if is_first:
    ...         continue  # Skip the header
    ...     if is_last:
    ...         continue  # Skip the footer
    ...     total += item
    >>> print(total)
    300
    NrFT)rrrr)rrbrarrrrAJs
rAcCsJ|durttt||S|dkr*tdt||td}ttt||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(locate([0, 1, 1, 0, 1, 0, 0]))
        [1, 2, 4]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item.

        >>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
        [1, 3]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(locate(iterable, pred=pred, window_size=3))
        [1, 5, 9]

    Use with :func:`seekable` to find indexes and then retrieve the associated
    items:

        >>> from itertools import count
        >>> from more_itertools import seekable
        >>> source = (3 * n + 1 if (n % 2) else n // 2 for n in count())
        >>> it = seekable(source)
        >>> pred = lambda x: x > 100
        >>> indexes = locate(it, pred=pred)
        >>> i = next(indexes)
        >>> it.seek(i)
        >>> next(it)
        106

    Nr,zwindow size must be at least 1r)rrrrr{rr)rr window_sizerrrrrTos&rTcCs
t||S)aYield the items from *iterable*, but strip any from the beginning
    for which *pred* returns ``True``.

    For example, to remove a set of items from the start of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(lstrip(iterable, pred))
        [1, 2, None, 3, False, None]

    This function is analogous to to :func:`str.lstrip`, and is essentially
    an wrapper for :func:`itertools.dropwhile`.

    )rrr rrrrUsrUccsFg}|j}|j}|D],}||r*||q|EdH||VqdS)aYield the items from *iterable*, but strip any from the end
    for which *pred* returns ``True``.

    For example, to remove a set of items from the end of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(rstrip(iterable, pred))
        [None, False, None, 1, 2, None, 3]

    This function is analogous to :func:`str.rstrip`.

    N)rclear)rr cacheZcache_appendcache_clearrrrrrfs

rfcCstt|||S)aYield the items from *iterable*, but strip any from the
    beginning and end for which *pred* returns ``True``.

    For example, to remove a set of items from both ends of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(strip(iterable, pred))
        [1, 2, None, 3]

    This function is analogous to :func:`str.strip`.

    )rfrUrnrrrrusruc@s0eZdZdZddZddZddZdd	Zd
S)rOaAn extension of :func:`itertools.islice` that supports negative values
    for *stop*, *start*, and *step*.

        >>> iterable = iter('abcdefgh')
        >>> list(islice_extended(iterable, -4, -1))
        ['e', 'f', 'g']

    Slices with negative values require some caching of *iterable*, but this
    function takes care to minimize the amount of memory required.

    For example, you can use a negative step with an infinite iterator:

        >>> from itertools import count
        >>> list(islice_extended(count(), 110, 99, -2))
        [110, 108, 106, 104, 102, 100]

    You can also use slice notation directly:

        >>> iterable = map(str, count())
        >>> it = islice_extended(iterable)[10:20:2]
        >>> list(it)
        ['10', '12', '14', '16', '18']

    cGs(t|}|rt|t||_n||_dSr)r_islice_helperr	_iterable)rrrrrrrrszislice_extended.__init__cCs|Srrrrrrrszislice_extended.__iter__cCs
t|jSr)rrsrrrrr	szislice_extended.__next__cCs&t|trtt|j|StddS)Nz4islice_extended.__getitem__ argument must be a slice)rrrOrrrsr)rrrrrr	s
zislice_extended.__getitem__N)rrrrrrrrrrrrrOs
rOccs|j}|j}|jdkrtd|jp&d}|dkrt|dur>dn|}|dkrtt|d|d}|rn|ddnd}t||d}|dur|}n"|dkrt||}nt||d}||}	|	dkrdSt|d|	|D]\}
}|Vqn|dur\|dkr\t	t|||dtt|||d}t|D]0\}
}|
}|
|dkrL|V||q(nt||||EdHn4|durdn|}|dur|dkr|d}	tt|d|	d}|r|ddnd}|dkr||}}nt||dd}}t||||D]\}
}|Vqn|dur@|d}
t	t||
|
d|dkrT|}d}	n2|durld}|d}	nd}||}	|	dkrdStt||	}||d|EdHdS)Nrz1step argument must be a non-zero integer or None.r,rr)
rrrrrr)rrrrrrr)rsrrrrplen_iterrrrrrZcached_itemmrrrrr
	sn










rrcCs.z
t|WSty(tt|YS0dS)aAn extension of :func:`reversed` that supports all iterables, not
    just those which implement the ``Reversible`` or ``Sequence`` protocols.

        >>> print(*always_reversible(x for x in range(3)))
        2 1 0

    If the iterable is already reversible, this function returns the
    result of :func:`reversed()`. If the iterable is not reversible,
    this function will cache the remaining items in the iterable and
    yield them in reverse order, which may require significant storage.
    N)rrrrirrrr6j	s
r6cCs|Srrrrrrr|	rrc#s6tt|fdddD]\}}ttd|VqdS)aYield groups of consecutive items using :func:`itertools.groupby`.
    The *ordering* function determines whether two items are adjacent by
    returning their position.

    By default, the ordering function is the identity function. This is
    suitable for finding runs of numbers:

        >>> iterable = [1, 10, 11, 12, 20, 30, 31, 32, 33, 40]
        >>> for group in consecutive_groups(iterable):
        ...     print(list(group))
        [1]
        [10, 11, 12]
        [20]
        [30, 31, 32, 33]
        [40]

    For finding runs of adjacent letters, try using the :meth:`index` method
    of a string of letters:

        >>> from string import ascii_lowercase
        >>> iterable = 'abcdfgilmnop'
        >>> ordering = ascii_lowercase.index
        >>> for group in consecutive_groups(iterable, ordering):
        ...     print(list(group))
        ['a', 'b', 'c', 'd']
        ['f', 'g']
        ['i']
        ['l', 'm', 'n', 'o', 'p']

    Each group of consecutive items is an iterator that shares it source with
    *iterable*. When an an output group is advanced, the previous group is
    no longer available unless its elements are copied (e.g., into a ``list``).

        >>> iterable = [1, 2, 11, 12, 21, 22]
        >>> saved_groups = []
        >>> for group in consecutive_groups(iterable):
        ...     saved_groups.append(list(group))  # Copy group elements
        >>> saved_groups
        [[1, 2], [11, 12], [21, 22]]

    cs|d|dSrrrorderingrrr	rz$consecutive_groups..rr,N)rr)rr$)rrxrIrJrrwrr=|	s*r=)initialcCsXt|\}}zt|g}Wnty4tgYS0|durBg}t|t|t||S)aThis function is the inverse of :func:`itertools.accumulate`. By default
    it will compute the first difference of *iterable* using
    :func:`operator.sub`:

        >>> from itertools import accumulate
        >>> iterable = accumulate([0, 1, 2, 3, 4])  # produces 0, 1, 3, 6, 10
        >>> list(difference(iterable))
        [0, 1, 2, 3, 4]

    *func* defaults to :func:`operator.sub`, but other functions can be
    specified. They will be applied as follows::

        A, B, C, D, ... --> A, func(B, A), func(C, B), func(D, C), ...

    For example, to do progressive division:

        >>> iterable = [1, 2, 6, 24, 120]
        >>> func = lambda x, y: x // y
        >>> list(difference(iterable, func))
        [1, 2, 3, 4, 5]

    If the *initial* keyword is set, the first element will be skipped when
    computing successive differences.

        >>> it = [10, 11, 13, 16]  # from accumulate([1, 2, 3], initial=10)
        >>> list(difference(it, initial=10))
        [1, 2, 3]

    N)rrrrrrr)rrrzrkrjrIrrrrB	srBc@s0eZdZdZddZddZddZdd	Zd
S)rjaSReturn a read-only view of the sequence object *target*.

    :class:`SequenceView` objects are analogous to Python's built-in
    "dictionary view" types. They provide a dynamic view of a sequence's items,
    meaning that when the sequence updates, so does the view.

        >>> seq = ['0', '1', '2']
        >>> view = SequenceView(seq)
        >>> view
        SequenceView(['0', '1', '2'])
        >>> seq.append('3')
        >>> view
        SequenceView(['0', '1', '2', '3'])

    Sequence views support indexing, slicing, and length queries. They act
    like the underlying sequence, except they don't allow assignment:

        >>> view[1]
        '1'
        >>> view[1:-1]
        ['1', '2']
        >>> len(view)
        4

    Sequence views are useful as an alternative to copying, as they don't
    require (much) extra storage.

    cCst|tst||_dSr)rrr_target)rtargetrrrr	s
zSequenceView.__init__cCs
|j|Sr)r{)rrrrrr	szSequenceView.__getitem__cCs
t|jSr)rr{rrrrrd	szSequenceView.__len__cCsd|jjt|jS)Nz{}({}))rr1rrgr{rrrrrh	szSequenceView.__repr__N)rrrrrrrdrhrrrrrj	s
rjc@sNeZdZdZdddZddZddZd	d
ZefddZ	d
dZ
ddZdS)ria
Wrap an iterator to allow for seeking backward and forward. This
    progressively caches the items in the source iterable so they can be
    re-visited.

    Call :meth:`seek` with an index to seek to that position in the source
    iterable.

    To "reset" an iterator, seek to ``0``:

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> it.seek(0)
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> next(it)
        '3'

    You can also seek forward:

        >>> it = seekable((str(n) for n in range(20)))
        >>> it.seek(10)
        >>> next(it)
        '10'
        >>> it.seek(20)  # Seeking past the end of the source isn't a problem
        >>> list(it)
        []
        >>> it.seek(0)  # Resetting works even after hitting the end
        >>> next(it), next(it), next(it)
        ('0', '1', '2')

    Call :meth:`peek` to look ahead one item without advancing the iterator:

        >>> it = seekable('1234')
        >>> it.peek()
        '1'
        >>> list(it)
        ['1', '2', '3', '4']
        >>> it.peek(default='empty')
        'empty'

    Before the iterator is at its end, calling :func:`bool` on it will return
    ``True``. After it will return ``False``:

        >>> it = seekable('5678')
        >>> bool(it)
        True
        >>> list(it)
        ['5', '6', '7', '8']
        >>> bool(it)
        False

    You may view the contents of the cache with the :meth:`elements` method.
    That returns a :class:`SequenceView`, a view that updates automatically:

        >>> it = seekable((str(n) for n in range(10)))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> elements = it.elements()
        >>> elements
        SequenceView(['0', '1', '2'])
        >>> next(it)
        '3'
        >>> elements
        SequenceView(['0', '1', '2', '3'])

    By default, the cache grows as the source iterable progresses, so beware of
    wrapping very large or infinite iterables. Supply *maxlen* to limit the
    size of the cache (this of course limits how far back you can seek).

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()), maxlen=2)
        >>> next(it), next(it), next(it), next(it)
        ('0', '1', '2', '3')
        >>> list(it.elements())
        ['2', '3']
        >>> it.seek(0)
        >>> next(it), next(it), next(it), next(it)
        ('2', '3', '4', '5')
        >>> next(it)
        '6'

    NcCs0t||_|durg|_ntg||_d|_dSr)r_sourcerr_index)rrrrrrrY
s

zseekable.__init__cCs|Srrrrrrra
szseekable.__iter__cCs`|jdurFz|j|j}Wnty2d|_Yn0|jd7_|St|j}|j||Sr)r~rrrr}rrrrrrrd
s

zseekable.__next__cCs&z|Wnty YdS0dSrrrrrrrr
s
zseekable.__bool__cCsVzt|}Wn ty,|tur$|YS0|jdurDt|j|_|jd8_|Sr)rrrr~rr)rrZpeekedrrrry
s

z
seekable.peekcCs
t|jSr)rjrrrrrelements
szseekable.elementscCs*||_|t|j}|dkr&t||dSre)r~rrr-)rr	remainderrrrseek
sz
seekable.seek)N)rrrrrrrrrrrrrrrrri
sU
ric@s(eZdZdZeddZeddZdS)rga
    :func:`run_length.encode` compresses an iterable with run-length encoding.
    It yields groups of repeated items with the count of how many times they
    were repeated:

        >>> uncompressed = 'abbcccdddd'
        >>> list(run_length.encode(uncompressed))
        [('a', 1), ('b', 2), ('c', 3), ('d', 4)]

    :func:`run_length.decode` decompresses an iterable that was previously
    compressed with run-length encoding. It yields the items of the
    decompressed iterable:

        >>> compressed = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> list(run_length.decode(compressed))
        ['a', 'b', 'b', 'c', 'c', 'c', 'd', 'd', 'd', 'd']

    cCsddt|DS)Ncss|]\}}|t|fVqdSr)rKrHrrrr
rz$run_length.encode..rMrirrrencode
szrun_length.encodecCstdd|DS)Ncss|]\}}t||VqdSr)r)rrIrrrrr
rz$run_length.decode..)rrrirrrdecode
szrun_length.decodeN)rrrrstaticmethodrrrrrrrg
s

rgcCstt|dt|||kS)aReturn ``True`` if exactly ``n`` items in the iterable are ``True``
    according to the *predicate* function.

        >>> exactly_n([True, True, False], 2)
        True
        >>> exactly_n([True, True, False], 1)
        False
        >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
        True

    The iterable will be advanced until ``n + 1`` truthy items are encountered,
    so avoid calling it on infinite iterables.

    r,)rr1r)rrrBrrrrG
srGcCs$t|}tt|tt|t|S)zReturn a list of circular shifts of *iterable*.

    >>> circular_shifts(range(4))
    [(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
    )rr1rr{r)rlstrrrr:
sr:csfdd}|S)aReturn a decorator version of *wrapping_func*, which is a function that
    modifies an iterable. *result_index* is the position in that function's
    signature where the iterable goes.

    This lets you use itertools on the "production end," i.e. at function
    definition. This can augment what the function returns without changing the
    function's code.

    For example, to produce a decorator version of :func:`chunked`:

        >>> from more_itertools import chunked
        >>> chunker = make_decorator(chunked, result_index=0)
        >>> @chunker(3)
        ... def iter_range(n):
        ...     return iter(range(n))
        ...
        >>> list(iter_range(9))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

    To only allow truthy items to be returned:

        >>> truth_serum = make_decorator(filter, result_index=1)
        >>> @truth_serum(bool)
        ... def boolean_test():
        ...     return [0, 1, '', ' ', False, True]
        ...
        >>> list(boolean_test())
        [1, ' ', True]

    The :func:`peekable` and :func:`seekable` wrappers make for practical
    decorators:

        >>> from more_itertools import peekable
        >>> peekable_function = make_decorator(peekable)
        >>> @peekable_function()
        ... def str_range(*args):
        ...     return (str(x) for x in range(*args))
        ...
        >>> it = str_range(1, 20, 2)
        >>> next(it), next(it), next(it)
        ('1', '3', '5')
        >>> it.peek()
        '7'
        >>> next(it)
        '7'

    csfdd}|S)Ncsfdd}|S)Ncs0|i|}t}|||iSr)rinsert)rrresultZwrapping_args_)fresult_index
wrapping_args
wrapping_funcwrapping_kwargsrr
inner_wrapper
szOmake_decorator..decorator..outer_wrapper..inner_wrapperr)rr)rrrr)rr
outer_wrapper
sz8make_decorator..decorator..outer_wrapperr)rrrrr)rrr	decorator
s	z!make_decorator..decoratorr)rrrrrrrV
s2rVc	Cst|durddn|}tt}|D]"}||}||}|||q |durj|D]\}}||||<qTd|_|S)aReturn a dictionary that maps the items in *iterable* to categories
    defined by *keyfunc*, transforms them with *valuefunc*, and
    then summarizes them by category with *reducefunc*.

    *valuefunc* defaults to the identity function if it is unspecified.
    If *reducefunc* is unspecified, no summarization takes place:

        >>> keyfunc = lambda x: x.upper()
        >>> result = map_reduce('abbccc', keyfunc)
        >>> sorted(result.items())
        [('A', ['a']), ('B', ['b', 'b']), ('C', ['c', 'c', 'c'])]

    Specifying *valuefunc* transforms the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> result = map_reduce('abbccc', keyfunc, valuefunc)
        >>> sorted(result.items())
        [('A', [1]), ('B', [1, 1]), ('C', [1, 1, 1])]

    Specifying *reducefunc* summarizes the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> reducefunc = sum
        >>> result = map_reduce('abbccc', keyfunc, valuefunc, reducefunc)
        >>> sorted(result.items())
        [('A', 1), ('B', 2), ('C', 3)]

    You may want to filter the input iterable before applying the map/reduce
    procedure:

        >>> all_items = range(30)
        >>> items = [x for x in all_items if 10 <= x <= 20]  # Filter
        >>> keyfunc = lambda x: x % 2  # Evens map to 0; odds to 1
        >>> categories = map_reduce(items, keyfunc=keyfunc)
        >>> sorted(categories.items())
        [(0, [10, 12, 14, 16, 18, 20]), (1, [11, 13, 15, 17, 19])]
        >>> summaries = map_reduce(items, keyfunc=keyfunc, reducefunc=sum)
        >>> sorted(summaries.items())
        [(0, 90), (1, 75)]

    Note that all items in the iterable are gathered into a list before the
    summarization step, which may require significant storage.

    The returned object is a :obj:`collections.defaultdict` with the
    ``default_factory`` set to ``None``, such that it behaves like a normal
    dictionary.

    NcSs|Srrrrrrr<rzmap_reduce..)rrrrdefault_factory)	rrNrKrLrrrr
Z
value_listrrrrX	s3rXcsV|durBz&t|fddtt||DWSty@Yn0ttt|||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``, starting from the right and moving left.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(rlocate([0, 1, 1, 0, 1, 0, 0]))  # Truthy at 1, 2, and 4
        [4, 2, 1]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item:

        >>> iterable = iter('abcb')
        >>> pred = lambda x: x == 'b'
        >>> list(rlocate(iterable, pred))
        [3, 1]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(rlocate(iterable, pred=pred, window_size=3))
        [9, 5, 1]

    Beware, this function won't return anything for infinite iterables.
    If *iterable* is reversible, ``rlocate`` will reverse it and search from
    the right. Otherwise, it will search from the left and return the results
    in reverse order.

    See :func:`locate` to for other example applications.

    Nc3s|]}|dVqdSrrrrurrrprzrlocate..)rrTrrr)rr rmrrrreLs!rec	cs|dkrtdt|}t|tg|d}t||}d}|D]X}||r||dusZ||kr||d7}|EdHt||dq>|r>|dtur>|dVq>dS)aYYield the items from *iterable*, replacing the items for which *pred*
    returns ``True`` with the items from the iterable *substitutes*.

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
        >>> pred = lambda x: x == 0
        >>> substitutes = (2, 3)
        >>> list(replace(iterable, pred, substitutes))
        [1, 1, 2, 3, 1, 1, 2, 3, 1, 1]

    If *count* is given, the number of replacements will be limited:

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1, 0]
        >>> pred = lambda x: x == 0
        >>> substitutes = [None]
        >>> list(replace(iterable, pred, substitutes, count=2))
        [1, 1, None, 1, 1, None, 1, 1, 0]

    Use *window_size* to control the number of items passed as arguments to
    *pred*. This allows for locating and replacing subsequences.

        >>> iterable = [0, 1, 2, 5, 0, 1, 2, 5]
        >>> window_size = 3
        >>> pred = lambda *args: args == (0, 1, 2)  # 3 items passed to pred
        >>> substitutes = [3, 4] # Splice in these items
        >>> list(replace(iterable, pred, substitutes, window_size=window_size))
        [3, 4, 5, 3, 4, 5]

    r,zwindow_size must be at least 1rN)rrrrr{r-)	rr ZsubstitutesrrmrZwindowsrwrrrrdws

rdc#sLt|t}ttd|D](}fddtd|||fDVqdS)a"Yield all possible order-preserving partitions of *iterable*.

    >>> iterable = 'abc'
    >>> for part in partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['a', 'b', 'c']

    This is unrelated to :func:`partition`.

    r,csg|]\}}||qSrr)rrrsequencerrrrzpartitions..r6N)rrr0rr)rrrrrrr`sr`c#st|}t|}|dur6|dkr*tdn||kr6dSfdd|durptd|dD]}||EdHqXn||EdHdS)a
    Yield the set partitions of *iterable* into *k* parts. Set partitions are
    not order-preserving.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable, 2):
    ...     print([''.join(p) for p in part])
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']


    If *k* is not given, every set partition is generated.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']
    ['a', 'b', 'c']

    Nr,z6Can't partition in a negative or zero number of groupsc3st|}|dkr|gVn||kr4dd|DVnz|^}}||dD]}|gg|VqJ||D]D}tt|D]2}|d||g||g||ddVqxqhdS)Nr,cSsg|]
}|gqSrr)rrtrrrrrzAset_partitions..set_partitions_helper..)rr)rrIrrMprset_partitions_helperrrrs
z-set_partitions..set_partitions_helper)rrrr)rrIrrrrrrasrac@s(eZdZdZddZddZddZdS)	rxa
    Yield items from *iterable* until *limit_seconds* have passed.
    If the time limit expires before all items have been yielded, the
    ``timed_out`` parameter will be set to ``True``.

    >>> from time import sleep
    >>> def generator():
    ...     yield 1
    ...     yield 2
    ...     sleep(0.2)
    ...     yield 3
    >>> iterable = time_limited(0.1, generator())
    >>> list(iterable)
    [1, 2]
    >>> iterable.timed_out
    True

    Note that the time is checked before each item is yielded, and iteration
    stops if  the time elapsed is greater than *limit_seconds*. If your time
    limit is 1 second, but it takes 2 seconds to generate the first item from
    the iterable, the function will run for 2 seconds and not yield anything.

    cCs2|dkrtd||_t||_t|_d|_dS)Nrzlimit_seconds must be positiveF)r
limit_secondsrrsr+_start_time	timed_out)rrrrrrrs
ztime_limited.__init__cCs|Srrrrrrr!sztime_limited.__iter__cCs*t|j}t|j|jkr&d|_t|Sr)rrsr+rrrrrrrrr$s

ztime_limited.__next__NrrrrrrrrrrrrxsrxcCsNt|}t||}zt|}Wnty0Yn0d||}|pHt||S)a*If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.

    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError

    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    r)rrrrr)rrrrrrrrrrr^-s
r^ccsNt|}t|t}|turdStt|g|\}}t||Vt||qdS)aBreak *iterable* into sub-iterables with *n* elements each.
    :func:`ichunked` is like :func:`chunked`, but it yields iterables
    instead of lists.

    If the sub-iterables are read in order, the elements of *iterable*
    won't be stored in memory.
    If they are read out of order, :func:`itertools.tee` is used to cache
    elements as necessary.

    >>> from itertools import count
    >>> all_chunks = ichunked(count(), 4)
    >>> c_1, c_2, c_3 = next(all_chunks), next(all_chunks), next(all_chunks)
    >>> list(c_2)  # c_1's elements have been cached; c_3's haven't been
    [4, 5, 6, 7]
    >>> list(c_1)
    [0, 1, 2, 3]
    >>> list(c_3)
    [8, 9, 10, 11]

    N)rrrrrrr-)rrsourcerrrrrrQVs
rQccs|dkrtdn|dkr$dVdSt|}tt|tddg}dg|}d}|rzt|d\}}Wn&ty||d8}YqPYn0|||<|d|krt|VqP|tt||dd|dtdd|d7}qPdS)aBYield the distinct combinations of *r* items taken from *iterable*.

        >>> list(distinct_combinations([0, 0, 1], 2))
        [(0, 0), (0, 1)]

    Equivalent to ``set(combinations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    rzr must be non-negativerNr,ryr)	rrr2r)r$rrpopr)rrr
generatorsZ
current_comborZcur_idxrrrrrC{s4


rCc	gs4|D]*}z||Wn|y&Yq0|VqdS)aYield the items from *iterable* for which the *validator* function does
    not raise one of the specified *exceptions*.

    *validator* is called for each item in *iterable*.
    It should be a function that accepts one argument and raises an exception
    if that item is not valid.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(filter_except(int, iterable, ValueError, TypeError))
    ['1', '2', '4']

    If an exception other than one given by *exceptions* is raised by
    *validator*, it is raised like normal.
    Nr)rr
exceptionsrrrrrHsrHc	gs0|D]&}z||VWq|y(Yq0qdS)aTransform each item from *iterable* with *function* and yield the
    result, unless *function* raises one of the specified *exceptions*.

    *function* is called to transform each item in *iterable*.
    It should be a accept one argument.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(map_except(int, iterable, ValueError, TypeError))
    [1, 2, 4]

    If an exception other than one given by *exceptions* is raised by
    *function*, it is raised like normal.
    Nr)functionrrrrrrrWs
rWcCst||}ttt|}|ttttd|}t||D]T\}}||krD||t|<|ttt|9}|ttttd|d7}qD|Sr)r1rrr!rr)r")rrI	reservoirWZ
next_indexrrrrr_sample_unweighteds
$rcsdd|D}t|t||td\}}tt|}t||D]p\}}||krd\}}t||}	t|	d}
t|
|}t||fd\}}tt|}qJ||8}qJfddt|DS)Ncss|]}tt|VqdSr)rr!)rweightrrrrrz#_sample_weighted..rr,csg|]}tdqSr)r)rrrrrr

rz$_sample_weighted..)	r1rrrr!rr#r
r)rrIweightsZweight_keysZsmallest_weight_keyrZweights_to_skiprrZt_wZr_2Z
weight_keyrrr_sample_weighteds 

rcCs>|dkrgSt|}|dur&t||St|}t|||SdS)afReturn a *k*-length list of elements chosen (without replacement)
    from the *iterable*. Like :func:`random.sample`, but works on iterables
    of unknown length.

    >>> iterable = range(100)
    >>> sample(iterable, 5)  # doctest: +SKIP
    [81, 60, 96, 16, 4]

    An iterable with *weights* may also be given:

    >>> iterable = range(100)
    >>> weights = (i * i + 1 for i in range(100))
    >>> sampled = sample(iterable, 5, weights=weights)  # doctest: +SKIP
    [79, 67, 74, 66, 78]

    The algorithm can also be used to generate weighted random permutations.
    The relative weight of each item determines the probability that it
    appears late in the permutation.

    >>> data = "abcdefgh"
    >>> weights = range(1, len(data) + 1)
    >>> sample(data, k=len(data), weights=weights)  # doctest: +SKIP
    ['c', 'a', 'b', 'e', 'g', 'd', 'h', 'f']
    rN)rrr)rrIrrrrrh

s
rhcCs6|rtnt}|dur|nt||}tt|t|S)aReturns ``True`` if the items of iterable are in sorted order, and
    ``False`` otherwise. *key* and *reverse* have the same meaning that they do
    in the built-in :func:`sorted` function.

    >>> is_sorted(['1', '2', '3', '4', '5'], key=int)
    True
    >>> is_sorted([5, 4, 3, 1, 2], reverse=True)
    False

    The function returns ``False`` after encountering the first out-of-order
    item. If there are no out-of-order items, the iterable is exhausted.
    N)r(r'rrArr/)rrrcomparerrrrrR1
srRc@seZdZdS)r3N)rrrrrrrr3D
sr3c@sZeZdZdZdddZddZdd	Zd
dZdd
Ze	ddZ
e	ddZddZdS)r8aConvert a function that uses callbacks to an iterator.

    Let *func* be a function that takes a `callback` keyword argument.
    For example:

    >>> def func(callback=None):
    ...     for i, c in [(1, 'a'), (2, 'b'), (3, 'c')]:
    ...         if callback:
    ...             callback(i, c)
    ...     return 4


    Use ``with callback_iter(func)`` to get an iterator over the parameters
    that are delivered to the callback.

    >>> with callback_iter(func) as it:
    ...     for args, kwargs in it:
    ...         print(args)
    (1, 'a')
    (2, 'b')
    (3, 'c')

    The function will be called in a background thread. The ``done`` property
    indicates whether it has completed execution.

    >>> it.done
    True

    If it completes successfully, its return value will be available
    in the ``result`` property.

    >>> it.result
    4

    Notes:

    * If the function uses some keyword argument besides ``callback``, supply
      *callback_kwd*.
    * If it finished executing, but raised an exception, accessing the
      ``result`` property will raise the same exception.
    * If it hasn't finished executing, accessing the ``result``
      property from within the ``with`` block will raise ``RuntimeError``.
    * If it hasn't finished executing, accessing the ``result`` property from
      outside the ``with`` block will raise a
      ``more_itertools.AbortThread`` exception.
    * Provide *wait_seconds* to adjust how frequently the it is polled for
      output.

    callback皙?cCs8||_||_d|_d|_||_tdd|_||_dS)NFr,)max_workers)	_func
_callback_kwd_aborted_future
_wait_secondsr	_executor_reader	_iterator)rrZcallback_kwdZwait_secondsrrrr{
szcallback_iter.__init__cCs|Srrrrrr	__enter__
szcallback_iter.__enter__cCsd|_|jdSr)rrshutdown)rexc_type	exc_value	tracebackrrr__exit__
szcallback_iter.__exit__cCs|Srrrrrrr
szcallback_iter.__iter__cCs
t|jSr)rrrrrrr
szcallback_iter.__next__cCs|jdurdS|jSrW)rdonerrrrr
s
zcallback_iter.donecCs|jstd|jS)NzFunction has not yet completed)rRuntimeErrorrrrrrrr
szcallback_iter.resultc#stfdd}jjjfij|i_zjjd}WntyVYn0	|Vj
r2qtq2g}z}WntyYqYqx0	||qx
|EdHdS)Ncs jrtd||fdS)Nzcanceled by user)rr3put)rrr@rrrr
sz'callback_iter._reader..callback)timeout)r rsubmitrrrgetrr	task_doner
get_nowaitrjoin)rrrr&rrrr
s0

zcallback_iter._readerN)rr)
rrrrrrrrrpropertyrrrrrrrr8H
s2
	

r8ccs|dkrtdt|}t|}||kr0tdt||dD]<}|d|}||||}|||d}|||fVq@dS)a
    Yield ``(beginning, middle, end)`` tuples, where:

    * Each ``middle`` has *n* items from *iterable*
    * Each ``beginning`` has the items before the ones in ``middle``
    * Each ``end`` has the items after the ones in ``middle``

    >>> iterable = range(7)
    >>> n = 3
    >>> for beginning, middle, end in windowed_complete(iterable, n):
    ...     print(beginning, middle, end)
    () (0, 1, 2) (3, 4, 5, 6)
    (0,) (1, 2, 3) (4, 5, 6)
    (0, 1) (2, 3, 4) (5, 6)
    (0, 1, 2) (3, 4, 5) (6,)
    (0, 1, 2, 3) (4, 5, 6) ()

    Note that *n* must be at least 0 and most equal to the length of
    *iterable*.

    This function will exhaust the iterable and may require significant
    storage.
    rrzn must be <= len(seq)r,N)rrrr)rrrrrZ	beginningZmiddleendrrrr
src	Cszt}|j}g}|j}|r$t||n|D]L}z||vr>WdS||Wq(tyr||vrfYdS||Yq(0q(dS)a
    Returns ``True`` if all the elements of *iterable* are unique (no two
    elements are equal).

        >>> all_unique('ABCB')
        False

    If a *key* function is specified, it will be used to make comparisons.

        >>> all_unique('ABCb')
        True
        >>> all_unique('ABCb', str.lower)
        False

    The function returns as soon as the first non-unique element is
    encountered. Iterables with a mix of hashable and unhashable items can
    be used, but the function will be slower for unhashable items.
    FT)raddrrr)rrZseensetZseenset_addZseenlistZseenlist_addrrrrr
srcGstttt|}ttt|}tt|}|dkr:||7}d|krN|ksTntg}t||D]"\}}|	|||||}qbtt|S)aEquivalent to ``list(product(*args))[index]``.

    The products of *args* can be ordered lexicographically.
    :func:`nth_product` computes the product at sort position *index* without
    computing the previous products.

        >>> nth_product(8, range(2), range(2), range(2), range(2))
        (1, 0, 0, 0)

    ``IndexError`` will be raised if the given *index* is invalid.
    r)
rrrrrr	r%rrr)rrpoolsnscrrrrrrr[s

r[c
Cs(t|}t|}|dus ||kr0|t|}}n0d|krD|ksLntnt|t||}|dkrp||7}d|kr|ksnt|dkrtSdg|}||kr|t||n|}td|dD]J}t||\}}	d||kr|krnn|	|||<|dkrqqtt|j	|S)a'Equivalent to ``list(permutations(iterable, r))[index]```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`nth_permutation`
    computes the subsequence at sort position *index* directly, without
    computing the previous subsequences.

        >>> nth_permutation('ghijk', 2, 5)
        ('h', 'i')

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    Nrr,)
rrrrrrrr?rr)
rrrrrrrr@drrrrrZ.s,
rZc	gsL|D]B}t|ttfr|Vqz|EdHWqtyD|VYq0qdS)aYield all arguments passed to the function in the same order in which
    they were passed. If an argument itself is iterable then iterate over its
    values.

        >>> list(value_chain(1, 2, 3, [4, 5, 6]))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and are emitted
    as-is:

        >>> list(value_chain('12', '34', ['56', '78']))
        ['12', '34', '56', '78']


    Multiple levels of nesting are not flattened.

    N)rrrr)rr
rrrr\srcGsVd}t||tdD]>\}}|tus*|tur2tdt|}|t|||}q|S)aEquivalent to ``list(product(*args)).index(element)``

    The products of *args* can be ordered lexicographically.
    :func:`product_index` computes the first index of *element* without
    computing the previous products.

        >>> product_index([8, 2], range(10), range(5))
        42

    ``ValueError`` will be raised if the given *element* isn't in the product
    of *args*.
    rrlz element is not a product of args)rrrrrr)rrrrrrrrrxs
rc
Cst|}t|d\}}|dur"dSg}t|}|D]:\}}||kr2||t|d\}}|durhqvq2|}q2tdt||dfd\}}	d}
tt|ddD]8\}}||}||kr|
t|t|t||7}
qt|dt|dt|||
S)aEquivalent to ``list(combinations(iterable, r)).index(element)``

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`combination_index` computes the index of the
    first *element*, without computing the previous combinations.

        >>> combination_index('adf', 'abcdefg')
        10

    ``ValueError`` will be raised if the given *element* isn't one of the
    combinations of *iterable*.
    )NNNrz(element is not a combination of iterablerr,)r)r)rrrrSrr)
rrrIyZindexesrrrtmprrrrrrrrs*

"rcCsLd}t|}ttt|dd|D]$\}}||}|||}||=q"|S)aEquivalent to ``list(permutations(iterable, r)).index(element)```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`permutation_index`
    computes the index of the first *element* directly, without computing
    the previous permutations.

        >>> permutation_index([1, 3, 2], range(5))
        19

    ``ValueError`` will be raised if the given *element* isn't one of the
    permutations of *iterable*.
    rr)rrrrr)rrrrrrrrrrrs
rc@s(eZdZdZddZddZddZdS)	r?aWrap *iterable* and keep a count of how many items have been consumed.

    The ``items_seen`` attribute starts at ``0`` and increments as the iterable
    is consumed:

        >>> iterable = map(str, range(10))
        >>> it = countable(iterable)
        >>> it.items_seen
        0
        >>> next(it), next(it)
        ('0', '1')
        >>> list(it)
        ['2', '3', '4', '5', '6', '7', '8', '9']
        >>> it.items_seen
        10
    cCst||_d|_dSre)rr
items_seenrrrrrs
zcountable.__init__cCs|Srrrrrrrszcountable.__iter__cCst|j}|jd7_|Sr)rrrrrrrrs
zcountable.__next__Nrrrrrr?sr?)F)NN)N)r,)Nr,)F)r,)NN)NNN)F)rF)r)r)r)NNF)N)r+FN)r6NF)r,)NNN)N)r)NN)Nr,)N)NN)N)NF)N)rcollectionsrrrrcollections.abcrconcurrent.futuresr	functoolsrr	r
heapqrrr
r	itertoolsrrrrrrrrrrrrmathrrrrqueuerr r!r"r#operatorr$r%r&r'r(sysr)r*timer+Zrecipesr-r.r/r0r1r2__all__objectrr9rIrSrYrbr<r>rKrPr|r]rDrNryr{rvrwr7rsrMrLr;rkrlrnrprorqrrr_rcrErtrr}r4r~rrmrzrFrrr5r4rJHashabler\r@rArYrTrUrfrurOrrr6r=rBrjrirgrGr:rVrXrerdr`rarxr^rQrCrHrWrrrhrR
BaseExceptionr3r8rrr[rZrrrrr?rrrrs8 	V
!&& 

C
d
!
3
"`
+
0
=
"
,
#
$
--
 
#
.'
B135
'
-Z
%0.`0*-


A
C+
=
8-
)%(#
$
|(
#.+PK!hx"N==:_vendor/more_itertools/__pycache__/__init__.cpython-39.pycnu[a

(ReR@sddlTddlTdZdS))*z8.8.0N)moreZrecipes__version__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_vendor/more_itertools/__init__.pysPK!v_distutils/py35compat.pynu[import sys
import subprocess


def __optim_args_from_interpreter_flags():
    """Return a list of command-line arguments reproducing the current
    optimization settings in sys.flags."""
    args = []
    value = sys.flags.optimize
    if value > 0:
        args.append("-" + "O" * value)
    return args


_optim_args_from_interpreter_flags = getattr(
    subprocess,
    "_optim_args_from_interpreter_flags",
    __optim_args_from_interpreter_flags,
)
PK!0c	))2_distutils/__pycache__/fancy_getopt.cpython-39.pycnu[a

(RexE@sdZddlZddlZddlZddlZddlTdZedeZedeefZ	e
ddZGd	d
d
Z
ddZd
dejDZddZddZGdddZedkrdZdD]*ZedeedeeeeqdS)a6distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
N)*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$-_c@seZdZdZdddZddZddZd d	d
ZddZd
dZ	ddZ
ddZddZddZ
d!ddZddZd"ddZd#ddZdS)$FancyGetoptaWrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    NcCsN||_i|_|jr|i|_i|_g|_g|_i|_i|_i|_	g|_
dSN)option_tableoption_index_build_indexaliasnegative_alias
short_opts	long_opts
short2long	attr_name	takes_argoption_orderselfrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/fancy_getopt.py__init__)s	zFancyGetopt.__init__cCs(|j|jD]}||j|d<qdS)Nr)rclearr)roptionrrrr	Qs

zFancyGetopt._build_indexcCs||_|dSr)rr	rrrrset_option_tableVszFancyGetopt.set_option_tablecCs<||jvrtd|n |||f}|j|||j|<dS)Nz'option conflict: already an option '%s')rDistutilsGetoptErrorrappend)rlong_optionshort_optionhelp_stringrrrr
add_optionZs

zFancyGetopt.add_optioncCs
||jvS)zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)rrrrrr
has_optioncszFancyGetopt.has_optioncCs
|tS)zTranslate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.	translate
longopt_xlater rrr
get_attr_namehszFancyGetopt.get_attr_namecCs\t|tsJ|D]@\}}||jvr:td|||f||jvrtd|||fqdS)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)
isinstancedictitemsrr)raliaseswhatr
optrrr_check_alias_dictns

zFancyGetopt._check_alias_dictcCs||d||_dS)z'Set the aliases for this option parser.r
N)r,r
)rr
rrrset_aliasesxszFancyGetopt.set_aliasescCs||d||_dS)zSet the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table.znegative aliasN)r,r)rrrrrset_negative_aliases}sz FancyGetopt.set_negative_aliasescCsg|_g|_|ji|_|jD]}t|dkrD|\}}}d}n(t|dkr^|\}}}}ntd|ft|t	rt|dkrt
d||dust|t	rt|dkst
d	|||j|<|j||d
dkr|r|d}|dd
}d|j|<nF|j
|}|dur:|j|r0t
d
||f||jd
<d|j|<|j|}|dur|j||j|krt
d||ft|st
d||||j|<|r"|j|||j|d<q"dS)zPopulate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        rzinvalid option tuple: %rz9invalid long option '%s': must be a string of length >= 2Nz:invalid short option '%s': must a single character or None=:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r
rrrrepeatrlen
ValueErrorr&strrrrrgetr

longopt_rematchr%r)rrlongshorthelpr6alias_torrr_grok_option_tablesr








zFancyGetopt._grok_option_tablec
Cs|durtjdd}|dur*t}d}nd}|d|j}zt|||j\}}Wn.tjy}zt	|WYd}~n
d}~00|D]\}}t
|dkr|ddkr|j|d}n,t
|dkr|ddd	ksJ|dd}|j
|}	|	r|	}|j|s<|d
ksJd|j
|}	|	r8|	}d}nd}|j|}
|rn|j
|
durnt||
dd}t||
||j||fq|r||fS|SdS)aParse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr2TF r1rrz--zboolean option can't have value)sysargvOptionDummyrAjoinrgetoptr
errorDistutilsArgErrorr7rr
r:rrrr6getattrsetattrrr)rargsobjectcreated_objectroptsmsgr+valr
attrrrrrHsF 
zFancyGetopt.getoptcCs|jdurtdn|jSdS)zReturns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        Nz!'getopt()' hasn't been called yet)rRuntimeError)rrrrget_option_orders

zFancyGetopt.get_option_ordercCsjd}|jD]L}|d}|d}t|}|ddkr:|d}|durJ|d}||kr
|}q
|ddd}d}||}	d	|}
|r|g}nd
g}|jD]}|dd\}}}t||	}
|ddkr|dd}|dur|
r|d|||
dfn|d
||fn:d||f}|
r4|d|||
dfn|d||
ddD]}||
|qNq|S)zGenerate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        rr2r3r4Nr1NrBzOption summary:r/z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr7	wrap_textr)rheadermax_optrr=r>l	opt_width
line_width
text_width
big_indentlinesr?text	opt_namesrrr
generate_helpsH



zFancyGetopt.generate_helpcCs0|durtj}||D]}||dqdS)N
)rDstdoutrcwrite)rrYfilelinerrr
print_helphszFancyGetopt.print_help)N)NN)NN)N)NN)__name__
__module____qualname____doc__rr	rrr!r%r,r-r.rArHrUrcrirrrrrs
(
	
M
=

OrcCst|}|||||Sr)rr.rH)optionsnegative_optrNrMparserrrrfancy_getoptos
rqcCsi|]}t|dqS)rB)ord).0Z_wscharrrr
urtcCs|durgSt||kr|gS|}|t}td|}dd|D}g}|rg}d}|rt|d}|||kr||d|d=||}q\|r|dddkr|d=qq\|r|dkr||dd||d|d|d<|dddkr|d=|d|qN|S)	zwrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)cSsg|]}|r|qSrr)rschrrr
ruzwrap_text..rr3rBrC)r7
expandtabsr#WS_TRANSresplitrrG)rawidthchunksr`cur_linecur_lenr[rrrrXws:

rXcCs
|tS)zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    r")r+rrrtranslate_longoptsrc@seZdZdZgfddZdS)rFz_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCs|D]}t||dqdS)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rL)rrnr+rrrrszOptionDummy.__init__N)rjrkrlrmrrrrrrFsrF__main__zTra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))
(z	width: %drd)rmrDstringrzrHdistutils.errorslongopt_patcompiler;neg_alias_rer9	maketransr$rrq
whitespaceryrXrrFrjrawprintrGrrrrs*
T6PK!v_%%2_distutils/__pycache__/archive_util.cpython-39.pycnu[a

(Re|!@s>dZddlZddlmZddlZzddlZWneyBdZYn0ddlmZddl	m
Z
ddlmZddl
mZzddlmZWneydZYn0zdd	lmZWneydZYn0d
dZdd
Zd#ddZd$ddZedgdfedgdfedgdfedgdfedgdfegdfdZdd Zd%d!d"ZdS)&zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).N)warn)DistutilsExecError)spawn)mkpath)log)getpwnam)getgrnamcCsLtdus|durdSzt|}Wnty6d}Yn0|durH|dSdS)z"Returns a gid, given a group name.N)rKeyErrornameresultr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/archive_util.py_get_gids
rcCsLtdus|durdSzt|}Wnty6d}Yn0|durH|dSdS)z"Returns an uid, given a user name.Nr	)rr
rrrr_get_uid+s
rgzipcs6dddddd}dddd	d
}|dur:||vr:td|d
}	|dkrZ|	||d7}	ttj|	|dddl}
t	dt
tfdd}|s|
|	d||}z|j
||dW|n
|0|dkr2tdt|	||}
tjdkr||	|
g}n
|d|	g}t||d|
S|	S)a=Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    gzbz2xz)rbzip2rNcompressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarrdry_runrzCreating tar archivecs,dur|_|_dur(|_|_|S)N)gidgnameuiduname)tarinforgroupownerrrr_set_uid_gidasz"make_tarball.._set_uid_gidzw|%s)filterz'compress' will be deprecated.win32z-f)keys
ValueErrorgetrospathdirnametarfilerinforropenaddcloserPendingDeprecationWarningsysplatformr)	base_namebase_dirrverboserr"r!tar_compressioncompress_extarchive_namer,r#tarcompressed_namecmdrr rmake_tarball7sB
	


r=c
Cs|d}ttj||dtdurn|r.d}nd}ztd|||g|dWntyhtd|Yn0nJtd|||sztj	|d	tj
d
}Wn$tytj	|d	tjd
}Yn0||tj
krtjtj|d}|||td|t|D]\}}	}
|	D]6}tjtj||d}|||td|q|
D]B}tjtj||}tj|rP|||td|qPqWdn1s0Y|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.ziprNz-rz-rqzipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to itw)compressionrzadding '%s')rr)r*r+zipfilerrrr-ZipFileZIP_DEFLATEDRuntimeError
ZIP_STOREDcurdirnormpathjoinwritewalkisfile)r4r5r6rzip_filename
zipoptionsr>r*dirpathdirnames	filenamesrrrrmake_zipfilesT	


4rQ)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)gztarbztarxztarztarr:r>cCs|D]}|tvr|SqdS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)ARCHIVE_FORMATS)formatsformatrrrcheck_archive_formatss
rYc
Cst}|dur6td|tj|}|s6t||durDtj}d|i}	zt|}
Wnt	yvt
d|Yn0|
d}|
dD]\}}
|
|	|<q|dkr||	d<||	d	<z4|||fi|	}W|durtd
|t|n"|durtd
|t|0|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'rr>r"r!zchanging back to '%s')r)getcwdrdebugr*abspathchdirrFrVr
r')r4rXroot_dirr5r6rr"r!save_cwdkwargsformat_infofuncargvalfilenamerrrmake_archives8


rg)rrrNN)rr)NNrrNN)__doc__r)warningsrr2rAImportErrordistutils.errorsrdistutils.spawnrdistutils.dir_utilr	distutilsrpwdrgrprrrr=rQrVrYrgrrrrsH



H
=




	
PK!;*_distutils/__pycache__/dist.cpython-39.pycnu[a

(Re@sdZddlZddlZddlZddlmZzddlZWneyJdZYn0ddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZed	Zd
dZGdd
d
ZGdddZddZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
N)message_from_file)*)FancyGetopttranslate_longopt)
check_environ	strtobool
rfc822_escapelog)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsPt|trn@t|tsLt|j}d}|jfit}ttj|t|}|S)Nz>Warning: '{fieldname}' should be a list, got type '{typename}')	
isinstancestrlisttype__name__formatlocalsr
WARN)value	fieldnametypenamemsgr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/dist.py_ensure_lists


rc@sDeZdZdZgdZdZgdZddeDZddiZdId
dZ	dd
Z
dJddZddZdKddZ
ddZddZddZddZddgfddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+ZdLd,d-ZdMd.d/ZdNd1d2Zejfd3d4Zd5d6Zd7d8Z d9d:Z!d;d<Z"d=d>Z#d?d@Z$dAdBZ%dCdDZ&dEdFZ'dGdHZ(d	S)ODistributionaThe core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    ))verbosevzrun verbosely (default))quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
))z
help-commandsNzlist all available commands)nameNzprint package name)versionVzprint package version)fullnameNzprint -)authorNzprint the author's name)author-emailNz print the author's email address)
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)urlNzprint the URL for this package)licenseNz print the license of the package)licenceNzalias for --license)descriptionNzprint the package description)zlong-descriptionNz"print the long package description)	platformsNzprint the list of platforms)classifiersNzprint the list of classifiers)keywordsNzprint the list of keywords)providesNz+print the list of packages/modules provided)requiresNz+print the list of packages/modules required)	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|dqS)rr).0xrrr
zDistribution.rrNcCs\d|_d|_d|_|jD]}t||dqt|_|jjD] }d|}t||t|j|q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r|d}|dur8|d=|D]4\}}| |}|D]\}	}
d|
f||	<qqd|vr~|d|d	<|d=d
}t!durnt!"|nt#j$%|d|D]\}}
t&|jd|rt|jd||
nNt&|j|rt|j||
n0t&||rt|||
nd
t'|}t!"|qd|_(|jdurP|jD].}
|
)ds6qP|
dkr d|_(qPq |*dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rrget_Noptionszsetup scriptr.r-z:'licence' distribution option is deprecated; use 'license'
set_zUnknown distribution option: %sT-z
--no-user-cfgF)+rdry_runr"display_option_namessetattrDistributionMetadatametadata_METHOD_BASENAMESgetattrcmdclasscommand_packagesscript_namescript_argscommand_options
dist_filespackagespackage_datapackage_dir
py_modules	librariesheadersext_modulesext_packageinclude_dirs
extra_pathscripts
data_filespasswordcommand_objhave_rungetitemsget_option_dictwarningswarnsysstderrwritehasattrrepr
want_user_cfg
startswithfinalize_options)selfattrsattrbasenamemethod_namer=commandcmd_optionsopt_dictoptvalrkeyargrrr__init__s~








zDistribution.__init__cCs&|j|}|dur"i}|j|<|S)zGet the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rLr])rjrodictrrrr_'szDistribution.get_option_dictr<c	Csddlm}|dur"t|j}|dur@||||d}|sV||ddS|D]h}|j|}|dur||d|qZ||d|||}|dD]}||d|qqZdS)Nr)pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r>)pprintrxsortedrLkeysannouncer]split)	rjheadercommandsindentrxcmd_namerqoutlinerrrdump_option_dicts2s*zDistribution.dump_option_dictscCsg}ttjtjdj}tj|d}tj|rB|	|tj
dkrRd}nd}|jrtjtjd|}tj|r|	|d}tj|r|	|t
r|dd	||S)
aFind as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        	distutilsz
distutils.cfgposixz.pydistutils.cfgzpydistutils.cfg~z	setup.cfgzusing config files: %sz, )rospathdirnamerbmodules__file__joinisfileappendr$rg
expanduserrr|)rjfilessys_dirsys_file
user_filename	user_file
local_filerrrfind_config_filesNs&



zDistribution.find_config_filescCsddlm}tjtjkr"gd}ng}t|}|dur>|}trL|d|}|D]}trl|d||	||
D]V}||}||}|D]8}	|	dkr|	|vr|
||	}
|	dd}	||
f||	<qq~|qVd	|jvr|jd	D]\}	\}}
|j
|	}zF|r.t||t|
n(|	d
vrJt||	t|
nt||	|
Wqty}
zt|
WYd}
~
qd}
~
00qdS)Nr)ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataprefixzexec-prefixhomeuserrootz"Distribution.parse_config_files():z  reading %srr@_global)rrA)configparserrrbrbase_prefix	frozensetrrr|readsectionsr=r_r]replacervrLr^negative_optrCr
ValueErrorDistutilsOptionError)rj	filenamesrignore_optionsparserfilenamesectionr=rqrrrssrcaliasrrrrparse_config_files~sD






zDistribution.parse_config_filescCs|}g|_t||j}||j|ddi|j|j|d}|	}t
|j|
|rhdS|r|||}|durhdSqh|jr|j|t|jdk|jddS|jstddS)	aParse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r.r-)argsobjectNrdisplay_optionsrzno commands suppliedT)_get_toplevel_optionsrrrset_negative_aliasesrset_aliasesgetoptrKget_option_orderr

set_verbosityrhandle_display_options_parse_command_optsr"
_show_helplenDistutilsArgError)rjtoplevel_optionsrroption_orderrrrparse_command_lines.	
zDistribution.parse_command_linecCs|jdgS)zReturn the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)global_optionsrjrrrrsz"Distribution._get_toplevel_optionsc
Csddlm}|d}t|s*td||j|z||}Wn,typ}zt	|WYd}~n
d}~00t
||std|t|drt
|jtsd}t|||j}t|dr|}||jt|d	rt
|jtrt|j}ng}||j|j|||||d
d\}}	t|	drX|	jrX|j|d|gddSt|d	rt
|jtrd}
|jD]F\}}}
}t|	||r|d
}
t|r|ntd
||fq||
rdS||}t|	D]\}}d|f||<q|S)aParse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        rCommandzinvalid command name '%s'Nz&command class %s must subclass Commanduser_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)rhelp_optionsrr"rzYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) 
distutils.cmdr
command_rematch
SystemExitrrget_command_classDistutilsModuleErrorr
issubclassDistutilsClassErrorrerrrrcopyupdaterfix_help_optionsset_option_tablerrrr"r
get_attr_namecallabler_varsr^)rjrrrro	cmd_classrrroptshelp_option_foundhelp_optionshortdescfuncrqr$rrrrrsr











z Distribution._parse_command_optscCsPdD]F}t|j|}|durqt|trdd|dD}t|j||qdS)zSet final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        r2r0NcSsg|]}|qSrstrip)r7elmrrrr9kr:z1Distribution.finalize_options..,)rGrErr
r}rC)rjrlrrrrrias
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|}n|j}||||jdt	d|rt||j
|dt	d|jD]z}t|t
rt||r|}	n
||}	t|	drt|	jtr||	jt|	jn||	j|d|	jt	dqzt	||jd	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r	gen_usagerz
Global options:r<zKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:N)distutils.corerrrrrr
print_helpcommon_usageprintrrrrrrrerrrrrrJ)
rjrrrrrrr=roklassrrrrns:






zDistribution._show_helpc	Csddlm}|jr4|tdt||jdSd}i}|jD]}d||d<qB|D]l\}}|rX||rXt|}t	|j
d|}|dvrtd|n |dvrtd	|nt|d}qX|S)
zIf there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rrr<rr;rr)r1r3r4r5r>)rr
help_commandsprint_commandsrrJrr]rrGrEr)	rjrrany_display_optionsis_display_optionoptionrrrsrrrrrs*
z#Distribution.handle_display_optionsc	Csht|d|D]R}|j|}|s.||}z
|j}WntyNd}Yn0td|||fqdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        :(no description available)z
  %-*s  %sN)rrHr]rr/AttributeError)rjrr~
max_lengthcmdrr/rrrprint_command_lists


zDistribution.print_command_listcCsddl}|jj}i}|D]}d||<qg}|jD]}||s4||q4d}||D]}t||krZt|}qZ||d||rt	||d|dS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
distutils.commandro__all__rHr{r]rrrr)rjrstd_commandsis_stdrextra_commandsrrrrrs.


zDistribution.print_commandsc		Csddl}|jj}i}|D]}d||<qg}|jD]}||s4||q4g}||D]N}|j|}|sx||}z
|j}Wnt	yd}Yn0|||fqZ|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrr)
rrorrHr{r]rrr/r)	rjrrrrrrvrr/rrrget_command_lists(	




zDistribution.get_command_listcCsN|j}t|tsJ|durd}dd|dD}d|vrD|dd||_|S)z9Return a list of packages from which commands are loaded.Nr<cSsg|]}|dkr|qS)r<r)r7pkgrrrr9"r:z5Distribution.get_command_packages..rzdistutils.commandr)rIrrr}insert)rjpkgsrrrget_command_packagess
z!Distribution.get_command_packagesc	Cs|j|}|r|S|D]}d||f}|}zt|tj|}Wnty\YqYn0zt||}Wn$tyt	d|||fYn0||j|<|St	d|dS)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s'N)
rHr]r
__import__rbrImportErrorrGrr)rjrorpkgnamemodule_name
klass_namemodulerrrr(s,


zDistribution.get_command_classcCsl|j|}|sh|rhtr&|d|||}||}|j|<d|j|<|j|}|rh||||S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z.z1error in %s: command '%s' has no such option '%s')get_command_namer_rr|r^boolean_optionsrrrr
rCrrerr)rjr[option_dictcommand_namersourcer	bool_optsneg_opt	is_stringrrrrrisF	






z!Distribution._set_command_optionsrcCs|ddlm}t||s&|}||}n|}|js8|S|d|_d|j|<|||rx|	D]}|
||qf|S)aReinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        rr)rrrr	r	finalizedinitialize_optionsr\rget_sub_commandsreinitialize_command)rjroreinit_subcommandsrrsubrrrrs


z!Distribution.reinitialize_commandcCst||dSNr	)rjrlevelrrrr|szDistribution.announcecCs|jD]}||qdS)zRun each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)rrun_command)rjrrrrrun_commandss
zDistribution.run_commandscCsD|j|rdStd|||}||d|j|<dS)aDo whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)r\r]r
infor	ensure_finalizedrun)rjrorrrrrs	
zDistribution.run_commandcCst|jp|jpgdkSNr)rrNrQrrrrhas_pure_modulesszDistribution.has_pure_modulescCs|jot|jdkSr )rTrrrrrhas_ext_modulesszDistribution.has_ext_modulescCs|jot|jdkSr )rRrrrrrhas_c_librariesszDistribution.has_c_librariescCs|p|Sr)r!r"rrrrhas_modulesszDistribution.has_modulescCs|jot|jdkSr )rSrrrrrhas_headersszDistribution.has_headerscCs|jot|jdkSr )rXrrrrrhas_scriptsszDistribution.has_scriptscCs|jot|jdkSr )rYrrrrrhas_data_filesszDistribution.has_data_filescCs|o|o|Sr)r!r"r#rrrris_pures
zDistribution.is_pure)N)NNr<)N)r)N)r))r
__module____qualname____doc__rrrrBrrvr_rrrrrrrirrrrrrrr	rrr
INFOr|rrr!r"r#r$r%r&r'r(rrrrr-sN,

0
:C[

2(!"&

,
)
rc@seZdZdZdZdBddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd d!Zd"d#ZeZd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Z d:d;Z!dd?Z#d@dAZ$dS)CrDz]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r$r%r(author_emailr*maintainer_emailr,r-r/long_descriptionr2r0r'r+
contact_emailr1download_urlr3r4r5NcCs|dur|t|nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr)
read_pkg_fileopenr$r%r(r-r*r.r,r-r/r/r2r0r1r1r3r4r5)rjrrrrrvs&zDistributionMetadata.__init__cst|fdd}fdd}d}|d|_|d|_|d|_|d	|_d
|_|d|_d
|_|d|_|d
|_	dvr|d|_
nd
|_
|d|_|d|_dvr|dd|_
|d|_|d|_|dkr|d|_|d|_|d|_nd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs|}|dkrdS|SNUNKNOWNr)r$rrrr_read_field)sz7DistributionMetadata.read_pkg_file.._read_fieldcs|d}|gkrdS|Sr)get_all)r$valuesr6rr
_read_list/sz6DistributionMetadata.read_pkg_file.._read_listzmetadata-versionr$r%summaryr(Nr)z	home-pager-zdownload-urlr/r2rplatform
classifier1.1r4r3r5)rr$r%r/r(r*r-r.r,r-r1r/r}r2r0r1r4r3r5)rjfiler7r:metadata_versionrr6rr2%s:












z"DistributionMetadata.read_pkg_filecCsFttj|dddd}||Wdn1s80YdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFOwzUTF-8)encodingN)r3rrrwrite_pkg_file)rjbase_dirpkg_inforrrwrite_pkg_infoYs
z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|d||d||d||d||d|	|d|
|d	||d
||jr|d|jt
|}|d|d
|}|r|d|||d|||d|||d|||d|||d|dS)z9Write the PKG-INFO format data to a file object.
        z1.0r>zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
rz
Keywords: %s
Platform
ClassifierRequiresProvides	ObsoletesN)r3r4r5r1r1rdget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenserget_long_descriptionrget_keywords_write_list
get_platformsget_classifiersget_requiresget_provides
get_obsoletes)rjr?r%	long_descr2rrrrC`s6z#DistributionMetadata.write_pkg_filecCs |D]}|d||fqdS)Nz%s: %s
)rd)rjr?r$r9rrrrrUsz DistributionMetadata._write_listcCs
|jpdSr4)r$rrrrrLszDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r%rrrrrMsz DistributionMetadata.get_versioncCsd||fS)Nz%s-%s)rLrMrrrrget_fullnamesz!DistributionMetadata.get_fullnamecCs
|jpdSr4)r(rrrr
get_authorszDistributionMetadata.get_authorcCs
|jpdSr4)r-rrrrget_author_emailsz%DistributionMetadata.get_author_emailcCs
|jpdSr4)r*rrrrget_maintainersz#DistributionMetadata.get_maintainercCs
|jpdSr4)r.rrrrget_maintainer_emailsz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr4)r*r(rrrrrPsz DistributionMetadata.get_contactcCs|jp|jpdSr4)r.r-rrrrrQsz&DistributionMetadata.get_contact_emailcCs
|jpdSr4)r,rrrrrOszDistributionMetadata.get_urlcCs
|jpdSr4)r-rrrrrRsz DistributionMetadata.get_licensecCs
|jpdSr4)r/rrrrrNsz$DistributionMetadata.get_descriptioncCs
|jpdSr4)r/rrrrrSsz)DistributionMetadata.get_long_descriptioncCs
|jpgSr)r2rrrrrTsz!DistributionMetadata.get_keywordscCst|d|_dS)Nr2)rr2rjrrrrset_keywordssz!DistributionMetadata.set_keywordscCs|jp
dgSr4)r0rrrrrVsz"DistributionMetadata.get_platformscCst|d|_dS)Nr0)rr0rarrr
set_platformssz"DistributionMetadata.set_platformscCs
|jpgSr)r1rrrrrWsz$DistributionMetadata.get_classifierscCst|d|_dS)Nr1)rr1rarrrset_classifierssz$DistributionMetadata.set_classifierscCs
|jpdSr4)r1rrrrget_download_urlsz%DistributionMetadata.get_download_urlcCs
|jpgSr)r4rrrrrXsz!DistributionMetadata.get_requirescCs,ddl}|D]}|j|qt||_dSr )distutils.versionpredicateversionpredicateVersionPredicaterr4rjrrrrrrset_requiressz!DistributionMetadata.set_requirescCs
|jpgSr)r3rrrrrYsz!DistributionMetadata.get_providescCs6dd|D}|D]}ddl}|j|q||_dS)NcSsg|]}|qSrr)r7rrrrr9r:z5DistributionMetadata.set_provides..r)rfrgsplit_provisionr3)rjrrrrrrset_providess
z!DistributionMetadata.set_providescCs
|jpgSr)r5rrrrrZsz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j|qt||_dSr )rfrgrhrr5rirrr
set_obsoletessz"DistributionMetadata.set_obsoletes)N)%rr)r*r+rFrvr2rFrCrUrLrMr\r]r^r_r`rPrQrOrRget_licencerNrSrTrbrVrcrWrdrerXrjrYrlrZrmrrrrrDsD	
4"rDcCs$g}|D]}||ddq|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r)r)r=new_options
help_tuplerrrrsr)r+rbrreemailrr`rdistutils.errorsdistutils.fancy_getoptrrdistutils.utilrrrrr
distutils.debugrcompilerrrrDrrrrrs4

ZcPK!zf**._distutils/__pycache__/filelist.cpython-39.pycnu[a

(Re_4@sdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdddZdd	Z
Gd
ddeZejfdd
ZddZdddZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
Nconvert_path)DistutilsTemplateErrorDistutilsInternalError)logc@s|eZdZdZdddZddZejfddZd	d
Z	ddZ
d
dZddZddZ
ddZddZdddZdddZdS) FileListaA list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    NcCsd|_g|_dSN)allfilesfiles)selfwarndebug_printr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/filelist.py__init__ szFileList.__init__cCs
||_dSr)r	)rr	rrrset_allfiles&szFileList.set_allfilescCst||_dSr)findallr	)rdirrrrr)szFileList.findallcCsddlm}|rt|dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugrprint)rmsgrrrrr
,szFileList.debug_printcCs|j|dSr)r
append)ritemrrrr6szFileList.appendcCs|j|dSr)r
extend)ritemsrrrr9szFileList.extendcCs<tttjj|j}g|_|D]}|jtjj|qdSr)sortedmapospathsplitr
rjoin)rZsortable_filesZ
sort_tuplerrrsort<sz
FileList.sortcCs@tt|jdddD]$}|j||j|dkr|j|=qdS)Nr)rangelenr
)rirrrremove_duplicatesEszFileList.remove_duplicatescCs|}|d}d}}}|dvrTt|dkr  ...cSsg|]}t|qSrr.0wrrr
Xz1FileList._parse_template_line..r#)recursive-includerecursive-excludez,'%s' expects    ...cSsg|]}t|qSrrr.rrrr1^r2)graftprunez#'%s' expects a single zunknown action '%s')r r&rr)rlinewordsactionpatternsrdir_patternrrr_parse_template_lineMs0zFileList._parse_template_linecCsD||\}}}}|dkrV|dd||D]}|j|dds2td|q2n|dkr|dd||D]}|j|ddsvtd	|qvn|d
kr|dd||D]}|j|ddstd
|qnb|dkr(|dd||D]"}|j|ddstd|qn|dkrz|d|d|f|D](}|j||dsNd}t|||qNn|dkr|d|d|f|D]$}|j||dstd||qnx|dkr|d||jd|ds@td|nB|dkr4|d||jd|ds@td|ntd|dS)Nr)zinclude  r#)anchorz%warning: no files found matching '%s'r*zexclude z9warning: no previously-included files found matching '%s'r+zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr,zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr3zrecursive-include %s %s)prefixz:warning: no files found matching '%s' under directory '%s'r4zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r6zgraft z+warning: no directories found matching '%s'r7zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r=r
r!include_patternrrexclude_patternr)rr8r:r;rr<patternrrrrprocess_template_lineis|








zFileList.process_template_liner#rcCsld}t||||}|d|j|jdur4||jD],}||r:|d||j|d}q:|S)aSelect strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        Fz%include_pattern: applying regex r'%s'Nz adding T)translate_patternr
rCr	rsearchr
r)rrCr?r@is_regexfiles_found
pattern_renamerrrrAs


zFileList.include_patterncCsrd}t||||}|d|jtt|jdddD]4}||j|r8|d|j||j|=d}q8|S)aRemove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        Fz%exclude_pattern: applying regex r'%s'r#r$z
 removing T)rEr
rCr%r&r
rF)rrCr?r@rGrHrIr'rrrrBszFileList.exclude_pattern)NN)r#Nr)r#Nr)__name__
__module____qualname____doc__rrrcurdirrr
rrr"r(r=rDrArBrrrrrs

	M
+rcCs0ttj|dd}dd|D}ttjj|S)z%
    Find all files under 'path'
    T)followlinkscss,|]$\}}}|D]}tj||VqqdSr)rrr!)r/basedirsr
filerrr	sz#_find_all_simple..)_UniqueDirsfilterrwalkrisfile)rZ
all_uniqueresultsrrr_find_all_simples
rZc@s$eZdZdZddZeddZdS)rUz
    Exclude previously-seen dirs from walk results,
    avoiding infinite recursion.
    Ref https://bugs.python.org/issue44497.
    cCsF|\}}}t|}|j|jf}||v}|r6|dd=|||S)z
        Given an item from an os.walk result, determine
        if the item represents a unique dir for this instance
        and if not, prevent further traversal.
        N)rstatst_devst_inoadd)rZ	walk_itemrQrRr
r[	candidatefoundrrr__call__	s



z_UniqueDirs.__call__cCst||Sr)rV)clsrrrrrVsz_UniqueDirs.filterN)rKrLrMrNraclassmethodrVrrrrrUsrUcCs6t|}|tjkr.tjtjj|d}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	rZrrO	functoolspartialrrelpathrlist)rr
Zmake_relrrrrs


rcCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    \z\\\\z\1[^%s]z((?sf
PK!/_distutils/__pycache__/ccompiler.cpython-39.pycnu[a

(Re@sdZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZGd
ddZdZdd
dZddddddZddZdddZddZddZdS)zdistutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.N)*)spawn)	move_file)mkpath)newer_group)split_quotedexecute)logc
@seZdZdZdZdZdZdZdZdZ	dZ
dZddddddZgdZ
drd	d
ZddZd
dZddZddZdsddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Z d/d0Z!dtd1d2Z"d3d4Z#d5d6Z$d7d8Z%d9d:Z&dud;d<Z'dvd=d>Z(d?d@Z)dwdAdBZ*dCZ+dDZ,dEZ-dxdFdGZ.dydHdIZ/dzdJdKZ0d{dLdMZ1dNdOZ2dPdQZ3dRdSZ4d|dTdUZ5d}dVdWZ6d~dYdZZ7dd[d\Z8dd]d^Z9dd`daZ:ddcddZ;dedfZdkdlZ?dmdnZ@ddpdqZAdS)	CCompileraAbstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    Ncc++objc).cz.ccz.cppz.cxxz.m)rr
rrcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
D]}|||j
|qFdSN)
dry_runforceverbose
output_dirmacrosinclude_dirs	librarieslibrary_dirsruntime_library_dirsobjectsexecutableskeysset_executable)selfrrrkeyr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/ccompiler.py__init__UszCCompiler.__init__cKs<|D]2}||jvr&td||jjf||||qdS)aDefine the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        z$unknown executable '%s' for class %sN)r
ValueError	__class____name__r)rkwargsrrrr set_executablesys

zCCompiler.set_executablescCs,t|trt||t|nt|||dSr)
isinstancestrsetattrr)rrvaluerrr rs
zCCompiler.set_executablecCs0d}|jD] }|d|kr"|S|d7}q
dS)Nr)r)rnameidefnrrr _find_macros

zCCompiler._find_macrocCs`|D]V}t|trFt|dvrFt|dts8|ddurFt|dtstd|ddqdS)zEnsures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r+r+Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r'tuplelenr(	TypeError)rZdefinitionsr.rrr _check_macro_definitionss


z"CCompiler._check_macro_definitionscCs.||}|dur|j|=|j||fdS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        Nr/rappend)rr,r*r-rrr define_macros	
zCCompiler.define_macrocCs0||}|dur|j|=|f}|j|dS)aUndefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        Nr5)rr,r-Zundefnrrr undefine_macros

zCCompiler.undefine_macrocCs|j|dS)zAdd 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr6rdirrrr add_include_dirszCCompiler.add_include_dircCs|dd|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        Nrrdirsrrr set_include_dirsszCCompiler.set_include_dirscCs|j|dS)aAdd 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr6)rlibnamerrr add_libraryszCCompiler.add_librarycCs|dd|_dS)zSet the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)rZlibnamesrrr 
set_librariesszCCompiler.set_librariescCs|j|dS)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr6r9rrr add_library_dirszCCompiler.add_library_dircCs|dd|_dS)zSet the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)rr=rrr set_library_dirsszCCompiler.set_library_dirscCs|j|dS)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr6r9rrr add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd|_dS)zSet the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)rr=rrr set_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j|dS)zAdd 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr6)robjectrrr add_link_object szCCompiler.add_link_objectcCs|dd|_dS)zSet the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)rrrrr set_link_objects(szCCompiler.set_link_objectscCs*|dur|j}nt|ts"td|dur2|j}n"t|trL||jpFg}ntd|durd|j}n*t|ttfrt||jpg}ntd|durg}|j|d|d}t	|t	|ksJt
||}i}	tt	|D]B}
||
}||
}tj
|d}
|tj
|||
f|	|<q|||||	fS)z;Process arguments and decide which source files to compile.N%'output_dir' must be a string or None/'macros' (if supplied) must be a list of tuples6'include_dirs' (if supplied) must be a list of stringsr)	strip_dirrr+)rr'r(r3rlistrr1object_filenamesr2gen_preprocess_optionsrangeospathsplitextrdirname)rZoutdirrZincdirssourcesdependsextrarpp_optsbuildr-srcobjextrrr _setup_compile6s>


zCCompiler._setup_compilecCs0|dg}|rdg|dd<|r,||dd<|S)Nz-cz-grr)rrYdebugbeforecc_argsrrr _get_cc_argsas
zCCompiler._get_cc_argscCs|dur|j}nt|ts"td|dur2|j}n"t|trL||jpFg}ntd|durd|j}n*t|ttfrt||jpg}ntd|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        NrJrKrL)rr'r(r3rrNrr1)rrrrrrr _fix_compile_argsjs"


zCCompiler._fix_compile_argscCs*|j||d}t|t|ks"J|ifS)a,Decide which source files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rOr2)rrVrrWrrrr 
_prep_compiles	zCCompiler._prep_compilecCsHt|ttfstdt|}|dur.|j}nt|ts@td||fS)zTypecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNrJ)r'rNr1r3rr()rrrrrr _fix_object_argss
zCCompiler._fix_object_argscCs|dur|j}n*t|ttfr2t||jp,g}ntd|durJ|j}n*t|ttfrlt||jpfg}ntd|dur|j}n*t|ttfrt||jpg}ntd|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr'rNr1r3rr)rrrrrrr 
_fix_lib_argss,zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd}n
t||}|SdS)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        Tnewer)missingN)rrr)rroutput_filergrrr 
_need_links
zCCompiler._need_linkc		Cs|t|ts|g}d}t|j}|D]T}tj|\}}|j|}z |j	|}||kr`|}|}Wq"t
ytYq"0q"|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r'rNr2language_orderrRrSrTlanguage_mapgetindexr")	rrVlangrnsourcebaser]ZextlangZextindexrrr detect_languages

zCCompiler.detect_languagecCsdS)aPreprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nr)rrprirr
extra_preargsextra_postargsrrr 
preprocessszCCompiler.preprocessc		Csv|||||||\}}	}}
}||
||}|	D]@}
z||
\}}WntyZYq0Yn0||
|||||
q0|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )r^rbKeyError_compile)rrVrrrr_rsrtrWrrYrZrar\r[r]rrr compiles6
zCCompiler.compilecCsdS)zCompile 'src' to product 'obj'.Nr)rr\r[r]rartrYrrr rwCszCCompiler._compilecCsdS)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nr)rroutput_libnamerr_target_langrrr create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library
executablecCstdS)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        NNotImplementedError)rZtarget_descroutput_filenamerrrrexport_symbolsr_rsrt
build_temprzrrr linkis9zCCompiler.linkc

Cs2|tj||j|dd|||||||	|
||
dS)Nshared)lib_type)rr
SHARED_LIBRARYlibrary_filename)
rrryrrrrrr_rsrtrrzrrr link_shared_libs
zCCompiler.link_shared_libc

Cs(|tj|||||||||	|
||
dSr)rr

SHARED_OBJECT)
rrrrrrrrr_rsrtrrzrrr link_shared_objects
zCCompiler.link_shared_objectcCs.|tj|||||||d|||	d|

dSr)rr

EXECUTABLEexecutable_filename)rrZoutput_prognamerrrrr_rsrtrzrrr link_executables



zCCompiler.link_executablecCstdS)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        Nr}r9rrr library_dir_optionszCCompiler.library_dir_optioncCstdS)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        Nr}r9rrr runtime_library_dir_optionsz$CCompiler.runtime_library_dir_optioncCstdS)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        Nr})rlibrrr library_optionszCCompiler.library_optionc

Cstddl}|durg}|dur g}|dur,g}|dur8g}|jd|dd\}}t|d}	z2|D]}
|	d|
q^|	d|W|	n
|	0zDz|j|g|d	}Wn tyYWt|d
S0Wt|nt|0znz|j	|d||dWn2t
tfy2YW|D]}t|qd
S0tdW|D]}t|qDn|D]}t|q\0dS)
zReturn a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNrT)textwz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
r<Fza.out)rr)tempfilemkstemprRfdopenwritecloserxCompileErrorremover	LinkErrorr3)
rfuncnameZincludesrrrrfdfnamefZinclrfnrrr has_functionsR	

zCCompiler.has_functioncCstdS)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        Nr})rr>rr_rrr find_library_file+szCCompiler.find_library_filecCs|durd}g}|D]|}tj|\}}tj|d}|tj|d}||jvrftd||f|rvtj|}|tj	|||j
q|S)Nrr+z"unknown file type '%s' (from '%s'))rRrSrT
splitdriveisabssrc_extensionsUnknownFileErrorbasenamer6join
obj_extension)rZsource_filenamesrMrZ	obj_namessrc_namerqr]rrr rOVs"

zCCompiler.object_filenamescCs0|dusJ|rtj|}tj|||jSr)rRrSrrshared_lib_extensionrrrMrrrr shared_object_filenamegsz CCompiler.shared_object_filenamecCs4|dusJ|rtj|}tj|||jp.dS)Nr)rRrSrr
exe_extensionrrrr rmszCCompiler.executable_filenamestaticc
Csl|dusJ|dvrtdt||d}t||d}tj|\}}|||f}	|r\d}tj|||	S)N)rrZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr)r"getattrrRrSsplitr)
rr@rrMrfmtr]r:rqfilenamerrr rsszCCompiler.library_filenamer+cCst|dSr)r	r_)rmsglevelrrr announceszCCompiler.announcecCsddlm}|rt|dS)Nr)DEBUG)distutils.debugrprint)rrrrrr debug_printszCCompiler.debug_printcCstjd|dS)Nzwarning: %s
)sysstderrr)rrrrr warnszCCompiler.warncCst||||jdSr)rr)rfuncargsrrrrr rszCCompiler.executecKst|fd|ji|dS)Nr)rr)rcmdr%rrr rszCCompiler.spawncCst|||jdSN)r)rr)rr[dstrrr rszCCompiler.move_filecCst|||jddSr)rr)rr,moderrr rszCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr)rr)rr)rrr)r+)Nr+)r)Br$
__module____qualname____doc__
compiler_typerrZstatic_lib_extensionrZstatic_lib_formatZshared_lib_formatrrlrkr!r&rr/r4r7r8r;r?rArBrCrDrErFrHrIr^rbrcrdrerfrjrrrurxrwr{rrrrrrrrrrrrrOrrrrrrrrrrrrrr r
s
$ 

+	 
"



D

A



3
+





r
))zcygwin.*unix)posixr)ntmsvccCsV|durtj}|durtj}tD]0\}}t||dusHt||dur |Sq dS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr)rRr,rplatform_default_compilersrematch)osnamerpatterncompilerrrr get_default_compilers

r)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)rZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)rrcygwinZmingw32ZbcppcCsXddlm}g}tD] }|d|dt|dfq|||}|ddS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)FancyGetoptz	compiler=Nr0zList of available compilers:)distutils.fancy_getoptrcompiler_classrr6sort
print_help)rZ	compilersrZpretty_printerrrr show_compilerss
rcCs|durtj}z"|dur t|}t|\}}}Wn6tyfd|}|durZ|d|}t|Yn0z*d|}t|tj|}	t	|	|}
Wn>t
ytd|Yn"tytd||fYn0|
d||S)a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rRr,rrrvDistutilsPlatformError
__import__rmodulesvarsImportErrorDistutilsModuleError)platrrrrmodule_name
class_namelong_descriptionrmoduleklassrrr new_compilers:

rcCsg}|D]}t|tr0dt|kr.dkss8

--PK!NW[0_distutils/__pycache__/py38compat.cpython-39.pycnu[a

(Re@sddZdS)cCs4zddl}|WSty$Yn0d|||fS)Nz%s-%s.%s)_aix_supportaix_platformImportError)osnameversionreleaserr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/py38compat.pyrs
rN)rrrrr	PK!)+..+_distutils/__pycache__/debug.cpython-39.pycnu[a

(Re@sddlZejdZdS)NZDISTUTILS_DEBUG)osenvirongetDEBUGrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/debug.pysPK!>;992_distutils/__pycache__/msvccompiler.cpython-39.pycnu[a

(Re[@s~dZddlZddlZddlmZmZmZmZmZddl	m
Z
mZddlm
Z
dZz,ddlZdZeZejZejZejZejZWndeyz4ddlZddlZdZeZejZejZejZejZWneye
dYn0Yn0erejejejej fZ!d	d
Z"ddZ#d
dZ$GdddZ%ddZ&ddZ'ddZ(Gddde
Z)e&dkrze
*de)Z+ddl,m)Z)ddl,m%Z%dS)zdistutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsjzt||}Wnty"YdS0g}d}zt||}WntyPYqfYn0|||d7}q,|S)zReturn list of registry keys.Nr)RegOpenKeyExRegError
RegEnumKeyappend)basekeyhandleLikr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/msvccompiler.py	read_keys7s


rcCs~zt||}Wnty"YdS0i}d}zt||\}}}WntyVYqzYn0|}t||t|<|d7}q,|S)zXReturn dict of registry keys and values.

    All names are converted to lowercase.
    Nrr
)rrRegEnumValuelowerconvert_mbcs)rrrdrnamevaluetyperrrread_valuesHs

rcCs8t|dd}|dur4z|d}Wnty2Yn0|S)Ndecodembcs)getattrUnicodeError)sdecrrrr]src@s,eZdZddZddZddZddZd	S)

MacroExpandercCsi|_||dSN)macrosload_macros)selfversionrrr__init__gszMacroExpander.__init__cCs2tD](}t||}|r|||jd|<q.qdS)Nz$(%s))HKEYSrr()r*Zmacropathrrrrrr	set_macroks

zMacroExpander.set_macroc

Csd|}|d|dd|d|ddd}|d|d	z*|d
krX|d|dn|d|d
Wn,ty}ztdWYd}~n
d}~00d}tD]T}zt||}WntyYqYn0t|d}t|d||f}	|	d|jd<qdS)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg@ZFrameworkSDKDirzsdkinstallrootv1.1ZsdkinstallrootaPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz%s\%sr+z$(FrameworkVersion))	r/KeyErrorrr-rrr
rr()
r*r+Zvsbasenetexcprhrrrrrr)rs,

zMacroExpander.load_macroscCs$|jD]\}}|||}q
|Sr')r(itemsreplace)r*r$rvrrrsubszMacroExpander.subN)__name__
__module____qualname__r,r/r)r8rrrrr&fsr&cCsd}tj|}|dkrdS|t|}tj|ddd\}}t|ddd}|dkrf|d7}t|d	d
d}|dkrd}|dkr||SdS)
zReturn the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.N r

g$@r)sysr+findlensplitint)prefixrr$restZmajorVersionZminorVersionrrrget_build_versionsrJcCs@d}tj|}|dkrdStjd|}tj|t||S)zUReturn the processor architecture.

    Possible results are "Intel" or "AMD64".
    z bit (r<Intel))rCr+rDrE)rHrjrrrget_build_architecturesrNcCs0g}|D]"}tj|}||vr||q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )osr.normpathr)pathsZ
reduced_pathsr3nprrrnormalize_and_reduce_pathssrSc
@seZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd+ddZddZd,ddZd-ddZd.ddZd/ddZddZddZd d!Zd0d"d#Zd$d%Zd1d'd(Zd)d*ZdS)2MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt||||t|_t|_|jdkr\|jdkrHd|_t|j|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrKzSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr=F)rr,rJ_MSVCCompiler__versionrN_MSVCCompiler__arch_MSVCCompiler__rootr&_MSVCCompiler__macros_MSVCCompiler__productinitialized)r*verbosedry_runforcerrrr,s

zMSVCCompiler.__init__cCsg|_dtjvrDdtjvrD|drDd|_d|_d|_d|_d|_nx|	d|_t
|jd	krltd
|j|d|_|d|_|d|_|d|_|d|_|
d|
dz&tjdd
D]}|j|qWntyYn0t|j|_d
|jtjd<d|_|jdkr|jdkrt|j||dS||dSq>|jdkrtD]&}t|d|jdur|d	qqgS)
zGet a list of devstudio directories (include, lib or path).

        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        z dirsrVz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesrbr=z%s\6.0NzIt seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.)	
_can_read_regrWrYr-rrZr8rFr)r*r.platformrrrrrrrxKs,





zMSVCCompiler.get_msvc_pathscCs6|dkr|d}n
||}|r2d|tj|<dS)zSet environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        r`libraryrbN)rxrzrOrr)r*rr3rrrryos

zMSVCCompiler.set_path_env_var)rrr)rr)NNNrNNN)NrN)
NNNNNrNNNN)r)r)r9r:r;__doc__
compiler_typeZexecutablesrrrrrrrZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr,rrrrrrrrrrsrxryrrrrrTs`
B
 
X

S

$rTg @z3Importing new compiler from distutils.msvc9compiler)rT)r&)-rrCrOdistutils.errorsrrrrrdistutils.ccompilerrr	distutilsr	rwinregZhkey_mod	OpenKeyExrEnumKeyr
Z	EnumValuererrorrImportErrorZwin32apiZwin32coninfoZ
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTr-rrrr&rJrNrSrTrZOldMSVCCompilerZdistutils.msvc9compilerrrrrs`



	-
9
PK!\C._distutils/__pycache__/dep_util.cpython-39.pycnu[a

(Re
@s6dZddlZddlmZddZddZdd	d
ZdS)zdistutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis.N)DistutilsFileErrorcCs`tj|s tdtj|tj|s0dSddlm}t||}t||}||kS)aReturn true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    zfile '%s' does not existrST_MTIME)ospathexistsrabspathstatr)sourcetargetrmtime1mtime2r/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/dep_util.pynewers
rcCsht|t|krtdg}g}tt|D]2}t||||r,||||||q,||fS)zWalk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    z+'sources' and 'targets' must be same length)len
ValueErrorrangerappend)sourcestargets	n_sources	n_targetsirrrnewer_pairwise srerrorcCstj|sdSddlm}t||}|D]P}tj|sb|dkrHn|dkrTq.n|dkrbdSt||}||kr.dSq.dS)aReturn true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    rrrrignorerN)rrrr
r)rrmissingrtarget_mtimersource_mtimerrrnewer_group6s r!)r)__doc__rdistutils.errorsrrrr!rrrrs
PK!R/_distutils/__pycache__/file_util.cpython-39.pycnu[a

(Re@sZdZddlZddlmZddlmZddddZdd
dZdd
dZdddZ	ddZ
dS)zFdistutils.file_util

Utility functions for operating on single files.
N)DistutilsFileError)logcopyingzhard linkingzsymbolically linking)Nhardsym@c
Csd}d}zzt|d}Wn6tyP}ztd||jfWYd}~n
d}~00tj|rzt|Wn6ty}ztd||jfWYd}~n
d}~00zt|d}Wn6ty}ztd||jfWYd}~n
d}~00z||}Wn8ty0}ztd||jfWYd}~n
d}~00|s<qz|	|Wqty}ztd||jfWYd}~qd}~00qW|r|
|r|
n|r|
|r|
0dS)	a5Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    Nrbzcould not open '%s': %szcould not delete '%s': %swbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)openOSErrorrstrerrorospathexistsunlinkreadwriteclose)srcdstbuffer_sizefsrcfdstebufr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/file_util.py_copy_file_contentssT	(
rcCs
ddlm}ddlm}	m}
m}m}tj	|s %srr)distutils.dep_utilrstatr r!r"r#r
risfilerisdirjoinbasenamedirnamerdebug_copy_actionKeyError
ValueErrorinforsamefilelinkrsymlinkrutimechmod)rr
preserve_modepreserve_timesupdater1verbosedry_runrr r!r"r#diractionstrrr	copy_fileCsV!





r=cCsddlm}m}m}m}m}ddl}	|dkr:td|||rB|S||sVt	d|||rrt
j|||}n||rt	d||f|||st	d||fd	}
zt

||WnRty}z8|j\}}
||	jkrd
}
nt	d|||
fWYd}~n
d}~00|
rt|||dzt
|Wnhty}zN|j\}}
zt
|WntynYn0t	d
||||
fWYd}~n
d}~00|S)a%Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    r)rr&r'r)r*Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r8zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)os.pathrr&r'r)r*errnorr/rr
rr(renamerargsEXDEVr=r)rrr8r9rr&r'r)r*r?copy_itrnummsgrrr	move_files`



rFcCs>t|d}z$|D]}||dqW|n
|0dS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    w
N)r
rr)filenamecontentsflinerrr
write_files

rM)r)rrrNrr)rr)__doc__r
distutils.errorsr	distutilsrr,rr=rFrMrrrrs
3
d
?PK!DOoo6_distutils/__pycache__/versionpredicate.cpython-39.pycnu[a

(Re
@sdZddlZddlZddlZedejZedZedZ	ddZ
ejejej
ejejejdZGd	d
d
ZdaddZdS)
zBModule for parsing and testing package version predicate strings.
Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t|}|std||\}}|tj|fS)zVParse a single version comparison.

    Return (comparison string, StrictVersion)
    z"bad package restriction syntax: %r)re_splitComparisonmatch
ValueErrorgroups	distutilsversion
StrictVersion)predrescompZverStrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/versionpredicate.pysplitUps

r)z>=z!=c@s(eZdZdZddZddZddZdS)	VersionPredicateaParse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    cCs|}|stdt|}|s.td||\|_}|}|rt|}|sbtd||d}dd|dD|_|jstd|ng|_d	S)
z*Parse a version predicate string.
        zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|qSr)r).0ZaPredrrr

tz-VersionPredicate.__init__..,zempty parenthesized list in %rN)	striprre_validPackagerrnamere_parensplitr	)selfZversionPredicateStrrZparenstrrrr
__init__`s&

zVersionPredicate.__init__cCs8|jr.dd|jD}|jdd|dS|jSdS)NcSs g|]\}}|dt|qS) )r)rcondverrrr
r}rz,VersionPredicate.__str__..z (z, ))r	rjoin)rseqrrr
__str__{szVersionPredicate.__str__cCs(|jD]\}}t|||sdSqdS)zTrue if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        FT)r	compmap)rrrr rrr
satisfied_byszVersionPredicate.satisfied_byN)__name__
__module____qualname____doc__rr$r&rrrr
rs@rcCsdtdurtdtja|}t|}|s8td||dpDd}|rVtj	
|}|d|fS)a9Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r)
_provision_rxrecompileASCIIrrrgrouprrr)valuemr rrr
split_provisions
r4)r*r.Zdistutils.versionroperatorr/r0rrrrltleeqgtgener%rr-r4rrrr
s

nPK!Goo/_distutils/__pycache__/extension.cpython-39.pycnu[a

(Re)@s.dZddlZddlZGdddZddZdS)zmdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.Nc@s"eZdZdZdddZddZdS)	ExtensionaJust a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    NcKst|tstdt|tr.tdd|Ds6td||_||_|pHg|_|pRg|_|p\g|_	|pfg|_
|ppg|_|pzg|_|	pg|_
|
pg|_|pg|_|pg|_|
pg|_|pg|_||_||_t|dkrdd|D}dt|}d	|}t|dS)
Nz'name' must be a stringcss|]}t|tVqdS)N)
isinstancestr).0vr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/extension.py	jz%Extension.__init__..z#'sources' must be a list of stringsrcSsg|]}t|qSr)repr)roptionrrr
r
z&Extension.__init__..z, zUnknown Extension options: %s)rrAssertionErrorlistallnamesourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_argsexport_symbols	swig_optsdependslanguageoptionallenjoinsortedwarningswarn)selfrrrrrrrrrrrrrrrr kwoptionsmsgrrr__init__Vs6













zExtension.__init__cCsd|jj|jj|jt|fS)Nz<%s.%s(%r) at %#x>)	__class__
__module____qualname__rid)r&rrr__repr__szExtension.__repr__)NNNNNNNNNNNNNN)__name__r,r-__doc__r*r/rrrrrs"C
/rcCsddlm}m}m}ddlm}ddlm}||}||dddddd}zfg}|}	|	durdq|	|	rpqP|	d|	dkrd	krnn|
d
|	qP||	|}	||	}
|
d}t|g}d}
|
ddD]}|
dur|
|d}
qt
j|d}|dd}|dd}|dvr2|j|q|d
krJ|j|q|dkr|d}|dkrz|j|dfn$|j|d|||ddfq|dkr|j|q|dkr|j|q|dkr|j|q|dkr|j|q|dkr|j|q|dkr*|j}
q|dkr<|j}
q|dkrN|j}
q|dkrr|j||s|j}
q|dvr|j|q|
d|q||qPW|n
|0|S)z3Reads a Setup file and returns Extension instances.r)parse_makefileexpand_makefile_vars_variable_rx)TextFile)split_quoted)strip_commentsskip_blanks
join_lines	lstrip_ws	rstrip_wsN*z'%s' lines not handled yet)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')distutils.sysconfigr2r3r4distutils.text_filer5distutils.utilr6readlinematchr%rappendospathsplitextrrfindrrrrrrrrclose)filenamer2r3r4r5r6varsfile
extensionslinewordsmoduleextappend_next_wordwordsuffixswitchvalueequalsrrrread_setup_files
 

















rZ)r1rGr$rrZrrrrszPK!ONl33,_distutils/__pycache__/config.cpython-39.pycnu[a

(Re@s<dZddlZddlmZddlmZdZGdddeZdS)zdistutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
N)RawConfigParser)CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sheZdZdZdZdZdZdZdddefdgZd	gZ	d
dZ
dd
ZddZddZ
ddZddZdS)
PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/pypiNzrepository=rzurl of repository [default: %s])
show-responseNz&display full response text from serverrcCstjtjddS)zReturns rc file path.~z.pypirc)ospathjoin
expanduserselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/config.py_get_rc_file&szPyPIRCCommand._get_rc_filecCs\|}tt|tjtjBdd"}|t||fWdn1sN0YdS)zCreates a default .pypirc file.iwN)rr	fdopenopenO_CREATO_WRONLYwriteDEFAULT_PYPIRC)rusernamepasswordrcfrrr
_store_pypirc*s zPyPIRCCommand._store_pypirccCs|}tj|r|d||jp.|j}t}|||	}d|vrF|
dd}dd|dD}|gkrd|vrdg}niS|D]}d|i}|
|d	|d	<d
|jfd|jfdfD].\}	}
|
||	r|
||	||	<q|
||	<q|dkr ||jdfvr |j|d
<|S|d|ks:|d
|kr|SqnRd
|vrd
}|
|d
rp|
|d
}n|j}|
|d	|
|d|||jdSiS)zReads the .pypirc file.zUsing PyPI login from %s	distutilsz
index-serverscSs g|]}|dkr|qS))strip).0serverrrr
=sz.PyPIRCCommand._read_pypirc..
rr"r
repositoryrealm)rNzserver-loginr)rrr%r"r&)rr	r
existsannouncer%DEFAULT_REPOSITORYrreadsectionsgetsplit
DEFAULT_REALM
has_option)rrr%configr+
index_servers_serversr"currentkeydefaultrrr_read_pypirc0sb








zPyPIRCCommand._read_pypirccCs8ddl}|dd}||ddd}||S)z%Read and decode a PyPI HTTP response.rNzcontent-typez
text/plaincharsetascii)cgi	getheaderparse_headerr,r*decode)rresponser:content_typeencodingrrr_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)zInitialize options.Nr)r%r&
show_responser
rrrinitialize_optionswsz PyPIRCCommand.initialize_optionscCs(|jdur|j|_|jdur$|j|_dS)zFinalizes options.N)r%r)r&r.r
rrrfinalize_options}s

zPyPIRCCommand.finalize_options)__name__
__module____qualname____doc__r)r.r%r&user_optionsboolean_optionsrrr6rArCrDrrrrrs&@r)rHr	configparserr
distutils.cmdrrrrrrrs

PK!W77*_distutils/__pycache__/util.cpython-39.pycnu[a

(ReO@s(dZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZd
dZdd
ZejdkrdadZddZddZddZddZddZddZdaddZddZd/d!d"Z da!a"a#d#d$Z$d%d&Z%d0d'd(Z&d)d*Z'd1d+d,Z(d-d.Z)dS)2zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
N)DistutilsPlatformError)newer)spawn)log)DistutilsByteCompileError)"_optim_args_from_interpreter_flagscCstjdkrFdtjvrdSdtjvr.dSdtjvr@dStjSdtjvrZtjdStjd	ksnttd
sttjSt\}}}}}|	dd}|	d
d}|	dd}|dddkrd||fS|dddkr,|ddkrd}dt
|dd|ddf}ddd}|d|tj7}n|dddkrVd d!lm
}||||S|dd"d#krd#}td$tj}||}|r|}n>|dd"d%krddl}	ddl}
|	|
j|||\}}}d&|||fS)'aReturn a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    ntamd64	win-amd64z(arm)	win-arm32z(arm64)	win-arm64_PYTHON_HOST_PLATFORMposixuname/ _-Nlinuxz%s-%ssunosr5solarisz%d.%s32bit64bit)ilz.%saixr)aix_platformcygwinz[\d.]+darwinz%s-%s-%s)osnamesysversionlowerplatformenvironhasattrrreplaceintmaxsizeZ
py38compatr recompileASCIImatchgroup_osx_supportdistutils.sysconfigget_platform_osx	sysconfigget_config_vars)osnamehostreleaser'machinebitnessr rel_remr4	distutilsrA/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/util.pyget_host_platformsP


 



rCcCs:tjdkr0ddddd}|tjdp.tStSdS)Nr	win32rrr
)x86x64armarm64VSCMD_ARG_TGT_ARCH)r$r%getr*rC)TARGET_TO_PLATrArArBget_platformds
rLr#MACOSX_DEPLOYMENT_TARGETcCsdadS)zFor testing only. Do not call.N)_syscfg_macosx_verrArArArB_clear_cached_macosx_verusrOcCs.tdur*ddlm}|tp d}|r*|atS)zGet the version of macOS latched in the Python interpreter configuration.
    Returns the version as a string or None if can't obtain one. Cached.Nr)r7r)rNr@r7get_config_varMACOSX_VERSION_VAR)r7verrArArB!get_macosx_target_ver_from_syscfgzsrScCs^t}tjt}|rZ|rVt|ddgkrVt|ddgkrVdtd||f}t||S|S)aReturn the version of macOS for which we are building.

    The target version defaults to the version in sysconfig latched at time
    the Python interpreter was built, unless overridden by an environment
    variable. If neither source has a value, then None is returned
r$zE mismatch: now "%s" but "%s" during configure; must use 10.3 or later)rSr$r*rJrQ
split_versionr)Z
syscfg_verZenv_vermy_msgrArArBget_macosx_target_versrXcCsdd|dDS)zEConvert a dot-separated string into a list of numbers for comparisonscSsg|]}t|qSrA)r-).0nrArArB
z!split_version...)split)srArArBrVsrVcCsztjdkr|S|s|S|ddkr.td||ddkrFtd||d}d|vrd|dqP|sntjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absolutezpath '%s' cannot end with '/'r])r$sep
ValueErrorr^removecurdirpathjoin)pathnamepathsrArArBconvert_paths	

ricCstjdkr._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rxr/subrwrb)r_rzr|varrArArB
subst_varss	rerror: cCs|t|S)N)ry)excprefixrArArBgrok_environment_error
srcCs(tdtjatdatdadS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r/r0string
whitespace
_wordchars_re
_squote_re
_dquote_rerArArArB_init_regexs
rcCstdurt|}g}d}|rt||}|}|t|krZ||d|q||tjvr||d|||d	}d}n||dkr|d|||dd}|d}n||dkrt
||}n*||dkrt||}ntd|||dur t
d|||\}}|d|||d|d||d}|d	}|t|kr||qq|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nrrjr'"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rrstripr2endlenappendrrlstriprrRuntimeErrorrbspan)r_wordsposr?rbegrArArBsplit_quoteds>

,
rcCsP|dur6d|j|f}|dddkr6|ddd}t||sL||dS)aPerform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%rz,)r))__name__rinfo)funcargsmsgverbosedry_runrArArBexecuteYs	
rcCs2|}|dvrdS|dvr dStd|fdS)zConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )yyesttrueon1r)rZnoffalseoff0rzinvalid truth value %rN)r(rb)valrArArB	strtoboollsrc	Cshddl}tjrtd|dur*do(|dk}|sTzddlm}	|	d\}
}Wn,tyxddlm}d|d}
}Yn0t	d||s|
durt
|
d	}
n
t|d	}
|
L|

d
|

dtt|d|

d
|||||fWdn1s0Ytjg}|t||t||dtt
j|fd||dnddlm}|D]}|dddkr~qd|dkr|dkrdn|}tjj||d}ntj|}|}|r|dt||krtd||f|t|d}|rt
j||}t
j |}|rd|s0t!||rRt	d|||s`||||nt"d||qddS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.T)mkstempz.py)mktempz$writing byte-compilation script '%s'wz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rzremoving %s)r0r)optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#
subprocessr&dont_write_bytecodertempfilerrvrrrr$fdopenopenwriterfmaprepr
executableextendrrrrrc
py_compiler0	importlibutilcache_from_sourcerrbrebasenamerdebug)py_filesoptimizeforcerbase_dirrrdirectrr	script_fdscript_namerscriptcmdr0fileoptcfiledfile
cfile_baserArArBbyte_compile|st$

&


rcCs|d}d}||S)zReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    
z	
        )r^rf)headerlinesrarArArB
rfc822_escapes
r)r)Nrr)rrNNrrN)*__doc__r$r/importlib.utilrrr&distutils.errorsrdistutils.dep_utilrdistutils.spawnrr@rrZ
py35compatrrCrLr)rNrQrOrSrXrVrirorrrxrrrrrrrrrrrrArArArBsLP

=

PK!
+2_distutils/__pycache__/bcppcompiler.cpython-39.pycnu[a

(Re.:@spdZddlZddlmZmZmZmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZGdd	d	e	ZdS)
zdistutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
N)DistutilsExecErrorCompileErrorLibError	LinkErrorUnknownFileError)	CCompilergen_preprocess_options)
write_file)newer)logc
@seZdZdZdZiZdgZgdZeeZdZ	dZ
dZdZZ
d	ZdddZdddZdddZdddZdddZd ddZd!ddZd
S)"BCPPCompilerzConcrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    Zbcppz.c)z.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCsnt||||d|_d|_d|_d|_gd|_gd|_gd|_gd|_	g|_
gd|_gd|_dS)	Nz	bcc32.exezilink32.exeztlib.exe)/tWMz/O2/q/g0)r
z/Odrr)z/Tpd/Gnr/x)rrr)rrrz/r)
r__init__cclinkerlibZpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugZldflags_staticldflags_exeldflags_exe_debug)selfverbosedry_runforcer /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/bcppcompiler.pyr5s




zBCPPCompiler.__init__Nc	Cs|||||||\}}	}}
}|p$g}|d|rB||jn||j|	D]>}
z||
\}}Wnty~YqRYn0tj|}tj|
}
|	tj
|
|dkrqR|dkrz|dd|
|gWqRty}zt
|WYd}~qRd}~00qR||jvrd}n||jvr*d}nd}d|
}z,||jg||
||g||gWqRty}zt
|WYd}~qRd}~00qR|	S)	Nz-c.res.rcZbrcc32z-foz-P-o)Z_setup_compileappendextendrrKeyErrorospathnormpathmkpathdirnamespawnrr
_c_extensions_cpp_extensionsr)rsources
output_dirmacrosinclude_dirsdebug
extra_preargsextra_postargsdependsobjectspp_optsbuildZcompile_optsobjsrcextmsgZ	input_optZ
output_optr r r!compileQsT




 zBCPPCompiler.compilec	
Cs|||\}}|j||d}|||r|dg|}|r:z||jg|Wqty|}zt|WYd}~qd}~00ntd|dS)N)r2z/uskipping %s (up-to-date))	_fix_object_argslibrary_filename
_need_linkr.rrrrr5)	rr9Zoutput_libnamer2r5target_langoutput_filenameZlib_argsr?r r r!create_static_libs zBCPPCompiler.create_static_libc 
Cs|||\}}||||\}}}|r8tdt||durNtj||}|||r|t	j
krd}|	r~|jdd}q|jdd}n&d}|	r|j
dd}n|jdd}|durd}ntj|\}}tj|\}}tj|d}tj|d|}dg}|pgD]}|d||fq|t||fd	|ttjj|}|g}g}|D]>}tjtj|\}}|d
kr||n
||q`|D]}|dtj|q|d|||d
|g|d|D]4}||||	}|dur||n
||q|d|d|d
|g|d
|||
rp|
|dd<|r|||tj|z||jg|Wn.ty}zt|WYd}~n
d}~00ntd|dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r$rz%s.defZEXPORTSz  %s=_%sz
writing %sr"z/L%sz/L.,z,,Zimport32Zcw32mtrA) rBZ
_fix_lib_argsrwarnstrr)r*joinrDrZ
EXECUTABLErrrrsplitsplitextr-r&executer	mapr+normcaser'find_library_filer,r.rrrr5) rZtarget_descr9rFr2	librarieslibrary_dirsruntime_library_dirsexport_symbolsr5r6r7
build_temprEZstartup_objZld_argsZdef_fileheadtailmodnamer>temp_dircontentssymZobjects2	resourcesfilebaselrlibfiler?r r r!links











 zBCPPCompiler.linkc	Csr|r"|d}|d|d||f}n|d|f}|D]:}|D]0}tj|||}tj|r:|Sq:q2dS)NZ_dZ_bcpp)r)r*rKrCexists)	rdirsrr5ZdlibZ	try_namesdirnamerar r r!rQ4s
zBCPPCompiler.find_library_filer$cCs|durd}g}|D]}tjtj|\}}||jddgvrRtd||f|rbtj|}|dkr|tj|||q|dkr|tj||dq|tj|||j	q|S)Nr$r#r"z"unknown file type '%s' (from '%s'))
r)r*rMrPsrc_extensionsrbasenamer&rK
obj_extension)rZsource_filenamesZ	strip_dirr2Z	obj_namessrc_namer_r>r r r!object_filenamesNs$zBCPPCompiler.object_filenamesc
Cs|d||\}}}t||}dg|}	|dur>|	d||rN||	dd<|r\|	||	||js~|dus~t||r|r|tj	|z|
|	Wn4ty}
zt|
t
|
WYd}
~
n
d}
~
00dS)Nz	cpp32.exer%r)Z_fix_compile_argsrr&r'rr
r,r)r*r-r.rprintr)rsourceZoutput_filer3r4r6r7_r:Zpp_argsr?r r r!
preprocessis&	



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr$)NNNNN)__name__
__module____qualname____doc__
compiler_typeZexecutablesr/r0rgriZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr@rGrbrQrkror r r r!rsX

D




r)rsr)distutils.errorsrrrrrdistutils.ccompilerrrdistutils.file_utilr	distutils.dep_utilr
	distutilsrrr r r r!sPK!)-_distutils/__pycache__/version.cpython-39.pycnu[a

(Re0@s>dZddlZGdddZGdddeZGdddeZdS)	aProvides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
Nc@sJeZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
dS)VersionzAbstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    NcCs|r||dSNparseselfvstringr	/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/version.py__init__&szVersion.__init__cCsd|jjt|fS)Nz	%s ('%s'))	__class____name__strrr	r	r
__repr__*szVersion.__repr__cCs||}|tur|S|dkSNr_cmpNotImplementedrothercr	r	r
__eq__-s
zVersion.__eq__cCs||}|tur|S|dkSrrrr	r	r
__lt__3s
zVersion.__lt__cCs||}|tur|S|dkSrrrr	r	r
__le__9s
zVersion.__le__cCs||}|tur|S|dkSrrrr	r	r
__gt__?s
zVersion.__gt__cCs||}|tur|S|dkSrrrr	r	r
__ge__Es
zVersion.__ge__)N)r

__module____qualname____doc__rrrrrrrr	r	r	r
rs
rc@s<eZdZdZedejejBZddZ	ddZ
ddZd	S)

StrictVersiona?Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs|j|}|std||ddddd\}}}}}|rTttt|||g|_nttt||gd|_|r|dt|f|_nd|_dS)	Nzinvalid version number '%s')rr)	
version_rematch
ValueErrorgrouptuplemapintversion
prerelease)rrr'majorminorpatchr.Zprerelease_numr	r	r
rszStrictVersion.parsecCsb|jddkr*dtt|jdd}ndtt|j}|jr^||jdt|jd}|S)Nr"r.r!)r-joinr+rr.rr	r	r
__str__szStrictVersion.__str__cCst|trt|}nt|ts"tS|j|jkrB|j|jkr>dSdS|jsR|jsRdS|jrb|jsbdS|jsr|jrrdS|jr|jr|j|jkrdS|j|jkrdSdSndsJddS)Nr!rFznever get here)
isinstancerr rr-r.rrr	r	r
rs*


zStrictVersion._cmpN)r
rrrrecompileVERBOSEASCIIr&rr4rr	r	r	r
r ]s#

r c@sHeZdZdZedejZdddZddZ	dd	Z
d
dZdd
ZdS)LooseVersionaVersion numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    z(\d+ | [a-z]+ | \.)NcCs|r||dSrrrr	r	r
r0szLooseVersion.__init__c	Cs\||_dd|j|D}t|D],\}}zt|||<Wq$tyNYq$0q$||_dS)NcSsg|]}|r|dkr|qS)r2r	).0xr	r	r

:sz&LooseVersion.parse..)rcomponent_resplit	enumerater,r(r-)rr
componentsiobjr	r	r
r5szLooseVersion.parsecCs|jSr)rrr	r	r
r4EszLooseVersion.__str__cCsdt|S)NzLooseVersion ('%s'))rrr	r	r
rIszLooseVersion.__repr__cCsVt|trt|}nt|ts"tS|j|jkr2dS|j|jkrBdS|j|jkrRdSdS)Nrr5r!)r6rr<rr-r7r	r	r
rMs


zLooseVersion._cmp)N)
r
rrrr8r9r:r@rrr4rrr	r	r	r
r<
s
r<)rr8rr r<r	r	r	r

s
>1PK!$6u	u	)_distutils/__pycache__/log.cpython-39.pycnu[a

(Re@sldZdZdZdZdZdZddlZGdd	d	ZeZej	Z	ej
Z
ejZejZej
Z
ejZd
dZdd
ZdS)z,A simple log mechanism styled after PEP 282.Nc@sPeZdZefddZddZddZddZd	d
ZddZ	d
dZ
ddZdS)LogcCs
||_dSN)	threshold)selfr	r/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/log.py__init__szLog.__init__cCs|tttttfvr"tdt|||jkr|r8||}|tttfvrNtj	}ntj
}z|d|Wn8ty|j
}||d|}|d|Yn0|dS)Nz%s wrong log levelz%s
backslashreplace)DEBUGINFOWARNERRORFATAL
ValueErrorstrr	sysstderrstdoutwriteUnicodeEncodeErrorencodingencodedecodeflush)r
levelmsgargsstreamrrrr_logs
zLog._logcGs||||dSr)r#)r
rr r!rrrlog'szLog.logcGs|t||dSr)r#rr
r r!rrrdebug*sz	Log.debugcGs|t||dSr)r#rr%rrrinfo-szLog.infocGs|t||dSr)r#rr%rrrwarn0szLog.warncGs|t||dSr)r#rr%rrrerror3sz	Log.errorcGs|t||dSr)r#rr%rrrfatal6sz	Log.fatalN)__name__
__module____qualname__rr
r#r$r&r'r(r)r*rrrrrsrcCstj}|t_|Sr)_global_logr	)roldrrr
set_thresholdAsr0cCs8|dkrttn"|dkr$ttn|dkr4ttdS)Nrrr)r0rrr)vrrr
set_verbosityGs

r2)__doc__rrrrrrrr.r$r&r'r(r)r*r0r2rrrrs +PK!Y1Y1/_distutils/__pycache__/sysconfig.cpython-39.pycnu[a

(Re~T@sdZddlZddlZddlZddlZddlmZdejvZej	
ejZej	
ej
Zej	
ejZej	
ejZdejvrej	ejdZn&ejrej	ej	ejZneZddZeed	dZejd
krddZeeZeeZd
dZeZdZ zesej!Z Wne"y"Yn0ddZ#d-ddZ$d.ddZ%ddZ&ddZ'ddZ(d/ddZ)e*dZ+e*dZ,e*d Z-d0d!d"Z.d#d$Z/da0d%d&Z1d'd(Z2d)d*Z3d+d,Z4dS)1aProvide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        
N)DistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs,dD]"}tjtj|d|rdSqdS)N)SetupzSetup.localModulesTF)ospathisfilejoin)dfnr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/sysconfig.py_is_python_source_dir,sr_homentcCs0|r,tj|tjtjtdr,tS|S)NZPCbuild)rrnormcase
startswithr	PREFIX)r
rrr
_fix_pcbuild5s
rcCstrttSttS)N)	_sys_homerproject_baserrrr

_python_build=srcCsdtjddS)zReturn a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dN)sysversion_inforrrr
get_python_versionQsrcCs|dur|rtpt}tjdkrtr:tjdkr:tj|dSt	rh|rJt
pHtStjtdd}tj
|Strpdnd}|tt}tj|d|Stjd	krt	rtj|dtjjtj|d
Stj|dStdtjdS)aReturn the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    NposixincludesrcdirIncludepypypythonrPCzFI don't know where Python installs its C header files on platform '%s')BASE_EXEC_PREFIXBASE_PREFIXrnameIS_PYPYrrrr	python_buildrrget_config_varnormpathrbuild_flagspathsepr)
plat_specificprefixincdirimplementation
python_dirrrr
get_python_incYs0

r5cCstrBtjdkrB|durt}|r4tj|dtjdStj|dS|durh|r\|rVtpXt	}n|rdt
pft}tjdkr|sz|rttdd}nd}trd	nd
}tj|||t
}|r|Stj|dSn|StSdS)aWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    N_init_r1exec_prefixrSOr"rrAr)r\rrarr)rr:r*rr+rrrxr	rr-isabsgetcwdrrYrZcustomize_config_varsappend)argsfuncrr"baserZvalsr)rrr
r]sD




r]cCs*|dkrddl}|dtdt|S)zReturn the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    rrNz SO is deprecated, use EXT_SUFFIXr)warningswarnDeprecationWarningr]ra)r)rrrr
r,:sr,)rN)rrN)N)N)5__doc__rrryrrrbuiltin_module_namesr*rr-r1rrr:base_prefixr(base_exec_prefixr'r^rrrrrrr;rr)rrr+r.rAttributeErrorrr5r?r[rprxrrzrrrrrr\rrr]r,rrrr
s\




+
8K





jKPK!T^Ј""5_distutils/__pycache__/cygwinccompiler.cpython-39.pycnu[a

(Re*B@sdZddlZddlZddlZddlmZmZmZddlZddl	m
Z
ddlmZddl
mZmZmZmZddlmZddlmZd	d
ZGddde
ZGd
ddeZdZdZdZddZedZddZddZ ddZ!dS)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
N)PopenPIPEcheck_output)
UnixCCompiler)
write_file)DistutilsExecErrorCCompilerErrorCompileErrorUnknownFileError)LooseVersion)find_executablecCstjd}|dkr|tj|d|d}|dkr8dgS|dkrFdgS|d	krTd
gS|dkrbdgS|d
krpdgStd|dS)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)sysversionfind
ValueError)Zmsc_posZmsc_verr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/cygwinccompiler.py	get_msvcr?src
@sReZdZdZdZdZdZdZdZdZ	dZ
dd
dZdd
ZdddZ
dddZdS)CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    cygwinz.o.az.dllzlib%s%sz%s%sz.exercCsHt||||t\}}|d||f|turB|d|tjdd|_	tjdd|_
d|j	vrt\|_|_
|_||jd|j|j
|jf|j
dkr|j	|_nd	|_|j
d
krd}qd}n|j	|_d}|jd
|j	d|j	d
|j
d|j	d|j|fdd|j	vr<|jdkrz get_versions..)tuple)commandsrrrr3sr3cCst|dg}|dS)zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachinescygwin)rstripendswith)r1rrrrrksrk)"rhr.rrK
subprocessrrrreZdistutils.unixccompilerrdistutils.file_utilrdistutils.errorsrrr	r
Zdistutils.versionrdistutils.spawnrrrrjr,rtrvr*compilerrr3rkrrrrs,1@1/
PK!p##._distutils/__pycache__/dir_util.cpython-39.pycnu[a

(Reb@spdZddlZddlZddlmZmZddlmZiadddZ	dd	d
Z
dddZd
dZdddZ
ddZdS)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.N)DistutilsFileErrorDistutilsInternalError)logcCsht|tstd|ftj|}g}tj|s<|dkr@|Sttj	|rV|Stj
|\}}|g}|r|rtj|stj
|\}}|d|ql|D]}tj||}tj	|}	t|	rq|dkrt
d||sZzt||WnXtyN}
z>|
jtjkr$tj|s:td||
jdfWYd}
~
n
d}
~
00||dt|	<q|S)	aCreate a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    z(mkpath: 'name' must be a string (got %r)rrzcreating %szcould not create '%s': %sN)
isinstancestrrospathnormpathisdir
_path_createdgetabspathsplitinsertjoinrinfomkdirOSErrorerrnoEEXISTrargsappend)namemodeverbosedry_runcreated_dirsheadtailtailsdabs_headexcr'/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/dir_util.pymkpathsB



r)c	CsNt}|D] }|tj|tj|q
t|D]}t||||dq4dS)aCreate all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    rrN)setaddrrrdirnamesortedr))base_dirfilesrrrneed_dirfiledirr'r'r(create_treePs
r4c
Csbddlm}|s(tj|s(td|zt|}	Wn@tyv}
z(|rPg}	ntd||
jfWYd}
~
n
d}
~
00|st	||dg}|	D]}tj
||}
tj
||}|drq|rtj|
rt
|
}|dkrtd	|||st||||qtj|
r<|t|
|||||||d
q||
||||||d
||q|S)aCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    r)	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %sr*)distutils.file_utilr5rrrrlistdirrstrerrorr)r
startswithislinkreadlinkrrsymlinkrextend	copy_tree)srcdst
preserve_modepreserve_timespreserve_symlinksupdaterrr5nameseoutputsnsrc_namedst_name	link_destr'r'r(r>csR

r>cCsft|D]F}tj||}tj|r@tj|s@t||q
|tj|fq
|tj	|fdS)zHelper for remove_tree().N)
rr7rrrr:_build_cmdtuplerremovermdir)r	cmdtuplesfreal_fr'r'r(rLsrLcCs|dkrtd||rdSg}t|||D]j}z2|d|dtj|d}|tvrbt|=Wq.ty}ztd||WYd}~q.d}~00q.dS)zRecursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)	rrrLrrrrrwarn)	directoryrrrOcmdrr&r'r'r(remove_trees

rUcCs6tj|\}}|ddtjkr2||dd}|S)zTake the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    rrN)rr
splitdrivesep)rdriver'r'r(ensure_relativesrY)rrr)rrr)rrrrrr)rr)__doc__rrdistutils.errorsrr	distutilsrrr)r4r>rLrUrYr'r'r'r(s
?

E

PK!
Bc!c!/_distutils/__pycache__/text_file.cpython-39.pycnu[a

(Re0@s&dZddlZddlZGdddZdS)ztext_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.Nc@steZdZdZddddddddZdddZd	d
ZddZdd
dZdddZ	dddZ
ddZddZddZ
dS)TextFileaProvides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not.rstrict)strip_commentsskip_blanks	lstrip_ws	rstrip_ws
join_lines
collapse_joinerrorsNcKs|dur|durtd|jD]0}||vr@t||||q"t|||j|q"|D]}||jvr\td|q\|dur||n||_||_d|_g|_	dS)zConstruct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
RuntimeErrordefault_optionskeyssetattrKeyErroropenfilenamefilecurrent_linelinebuf)selfrroptionsoptr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/text_file.py__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd|_d|_dS)zyOpen a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor.r)rrN)riorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|dS)ziClose the current file and forget everything we know about it
           (filename, current line number).N)rrrclose)rrrrrrvs
zTextFile.closecCsjg}|dur|j}||jdt|ttfrD|dt|n|d||t|d|S)Nz, z
lines %d-%d: z	line %d: )rappendr
isinstancelisttuplestrjoin)rmsglineZoutmsgrrr	gen_errorszTextFile.gen_errorcCstd|||dS)Nzerror: )
ValueErrorr(rr&r'rrrerrorszTextFile.errorcCs tjd|||ddS)aPrint (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line.z	warning: 
N)sysstderrwriter(r*rrrwarnsz
TextFile.warncCs|jr|jd}|jd=|Sd}|j}|dkr6d}|jr|r|d}|dkrTnX|dksl||ddkr|ddkr|dp~d}|d||}|dkrq n|d	d}|jr|r|dur|d
|S|j	r|
}||}t|jt
r
|jdd|jd<n|j|jdg|_n:|dur,dSt|jt
rL|jdd|_n|jd|_|jrr|jrr|}n"|jr|
}n|jr|}|dks|dkr|jrq |jr|ddkr|dd}q |dddkr|ddd}q |S)
aURead and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not.rN#rr\r,z\#z2continuation line immediately precedes end-of-filez\
)rrreadlinerfindstripreplacer	r0r
lstripr!rr"rrrstripr)rr'Zbuildup_lineposeolrrrr5sf




	



zTextFile.readlinecCs(g}|}|dur|S||qdS)zWRead and return the list of all logical lines remaining in the
           current file.N)r5r )rlinesr'rrr	readliness
zTextFile.readlinescCs|j|dS)zPush 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead.N)rr )rr'rrr
unreadlineszTextFile.unreadline)NN)N)N)N)__name__
__module____qualname____doc__r
rrrr(r+r0r5r>r?rrrrr
s$:	
!	



x
r)rCr-rrrrrrsPK!C,_distutils/__pycache__/errors.cpython-39.pycnu[a

(Re
@s8dZGdddeZGdddeZGdddeZGdddeZGd	d
d
eZGdddeZGd
ddeZGdddeZ	GdddeZ
GdddeZGdddeZGdddeZ
GdddeZGdddeZGdddeZGdd d eZGd!d"d"eZGd#d$d$eZGd%d&d&eZd'S)(adistutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".c@seZdZdZdS)DistutilsErrorzThe root of all Distutils evil.N__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/errors.pyrsrc@seZdZdZdS)DistutilsModuleErrorzUnable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes).Nrrrrrr	sr	c@seZdZdZdS)DistutilsClassErrorzSome command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface.Nrrrrrr
sr
c@seZdZdZdS)DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.Nrrrrrrsrc@seZdZdZdS)DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage.Nrrrrrrsrc@seZdZdZdS)DistutilsFileErrorzAny problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised.Nrrrrrr
$sr
c@seZdZdZdS)DistutilsOptionErroraSyntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead.Nrrrrrr*src@seZdZdZdS)DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'.Nrrrrrr3src@seZdZdZdS)DistutilsPlatformErrorzWe don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass.Nrrrrrr8src@seZdZdZdS)DistutilsExecErrorz`Any problems executing an external program (such as the C
    compiler, when compiling C files).Nrrrrrr>src@seZdZdZdS)DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!).NrrrrrrCsrc@seZdZdZdS)DistutilsTemplateErrorz%Syntax error in a file list template.NrrrrrrHsrc@seZdZdZdS)DistutilsByteCompileErrorzByte compile error.NrrrrrrKsrc@seZdZdZdS)CCompilerErrorz#Some compile/link operation failed.NrrrrrrOsrc@seZdZdZdS)PreprocessErrorz.Failure to preprocess one or more C/C++ files.NrrrrrrRsrc@seZdZdZdS)CompileErrorz2Failure to compile one or more C/C++ source files.NrrrrrrUsrc@seZdZdZdS)LibErrorzKFailure to create a static library from one or more C/C++ object
    files.NrrrrrrXsrc@seZdZdZdS)	LinkErrorz]Failure to link one or more C/C++ object files into an executable
    or shared library file.Nrrrrrr\src@seZdZdZdS)UnknownFileErrorz(Attempt to process an unknown file type.Nrrrrrr`srN)r	Exceptionrr	r
rrr
rrrrrrrrrrrrrrrrrs&
	PK!&%6%63_distutils/__pycache__/_msvccompiler.cpython-39.pycnu[a

(ReMQ@sdZddlZddlZddlZddlZddlZeeddl	Z	Wdn1sT0Yddl
mZmZm
Z
mZmZddlmZmZddlmZddlmZddlmZdd	Zd
dZdd
dddZddZddZdddZdddddZGdddeZ dS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platform)countcCsztjtjdtjtjBd}Wnty<tdYdS0d}d}|tD]}zt	||\}}}WntyYqYn0|rR|tj
krRtj
|rRztt|}WnttfyYqRYn0|dkrR||krR||}}qRWdn1s0Y||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr)winreg	OpenKeyExHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYOSErrorr	debugrZ	EnumValueREG_SZospathisdirintfloat
ValueError	TypeError)keybest_versionbest_dirivZvc_dirZvtversionr"/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/_msvccompiler.py_find_vc2015 s2




,r$c
Cstjdptjd}|s dSz8tjtj|dddddd	d
ddd
dg	ddd}Wntjt	t
fytYdS0tj|ddd}tj|rd|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)ZProgramFilesr
zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products*mbcsstrict)encodingerrorsZVCZ	AuxiliaryZBuild)renvironget
subprocesscheck_outputrjoinstripCalledProcessErrorrUnicodeDecodeErrorr)rootrr"r"r#_find_vc2017<s(
r4x86x64armarm64)r5	x86_amd64x86_arm	x86_arm64cCs\t\}}|st\}}|s*tddStj|d}tj|sTtd|dS|dfS)Nz$No suitable Visual C++ version foundr
z
vcvarsall.batz%s cannot be found)r4r$r	rrrr/isfile)	plat_spec_rr	vcvarsallr"r"r#_find_vcvarsallcs


r@c
CstdrddtjDSt|\}}|s6tdz&tjd||tj	dj
ddd	}WnBtjy}z(t
|jtd
|jWYd}~n
d}~00dddd
|DD}|S)NZDISTUTILS_USE_SDKcSsi|]\}}||qSr"lower).0rvaluer"r"r#
wsz_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r)zError executing {}cSs$i|]\}}}|r|r||qSr"rA)rCrr>rDr"r"r#rEscss|]}|dVqdS)=N)	partition)rCliner"r"r#	z_get_vc_env..)rgetenvr+itemsr@rr-r.formatSTDOUTdecoder1r	erroroutputcmd
splitlines)r=r?r>outexcenvr"r"r#_get_vc_envus.


rYcCsN|stdtj}|D].}tjtj||}tj|r|Sq|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rrMsplitpathseprr/abspathr<)Zexepathspfnr"r"r#	_find_exes	
r`r9r:r;)win32z	win-amd64z	win-arm32z	win-arm64c
seZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd(ddZd)ddZd*ddZd+ddZd,ddZd-ddZfddZejfddZd d!Zd"d#Zd$d%Zd.d&d'ZZ S)/MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t||||d|_d|_dS)NF)r__init__	plat_nameinitialized)selfverbosedry_runforcer"r"r#rdszMSVCCompiler.__init__NcCs|jrJd|durt}|tvr6tdttt|}t|}|sRtd|dd|_|j	t
j}td||_
td||_td||_td	||_td
||_td||_|dd	t
jD]}|r||t
jq|d
d	t
jD]}|r||t
jqd|_gd|_gd|_gd}gd}g|d|_g|d|_g|ddd|_g|ddd|_g||_g||_t j!df|jt j!df|jt j!df|jt j"df|jt j"df|jt j"df|jt j#df|jt j#df|jt j#df|ji	|_$d|_dS)Nzdon't init multiple timesz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.rzcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeincludelib)/nologoz/O2/W3z/GLz/DNDEBUGz/MD)rnz/Odz/MDdz/Ziroz/D_DEBUG)rn/INCREMENTAL:NO/LTCG)rnrprqz/DEBUG:FULLz/MANIFEST:EMBED,ID=1z/DLLz/MANIFEST:EMBED,ID=2z/MANIFESTUAC:NOFT)%rfr
PLAT_TO_VCVARSrrOtuplerYr,_pathsrZrr[r`cclinkerrmrcmcmtZadd_include_dirrstripsepZadd_library_dirZpreprocess_optionscompile_optionscompile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY_ldflags)rgrer=Zvc_envr]dirldflagsZ
ldflags_debugr"r"r#
initializes^



zMSVCCompiler.initializerkcsXifddjDfddjjDp8dfdd}tt||S)Ncsi|]}|jqSr")
obj_extensionrCextrgr"r#rE&rLz1MSVCCompiler.object_filenames..csi|]}|jqSr")
res_extensionrrr"r#rE'rLrkcstj|\}}r"tj|}n2tj|\}}|tjjtjjfrT|dd}ztj||WSt	yt
d|Yn0dS)NzDon't know how to compile {})rrsplitextbasename
splitdrive
startswithr{altsepr/LookupErrorrrO)r^baserr>)ext_map
output_dir	strip_dirr"r#
make_out_path,sz4MSVCCompiler.object_filenames..make_out_path)src_extensions_rc_extensions_mc_extensionslistmap)rgZsource_filenamesrrrr")rrrgrr#object_filenames!szMSVCCompiler.object_filenamesc	Cs|js||||||||}	|	\}}
}}}|p6g}
|
d|rT|
|jn|
|jd}|
D]}z||\}}WntyYqhYn0|rtj	
|}||jvrd|}nH||jvrd|}d}n.||j
vr@|}d|}z||jg|||gWqhty:}zt|WYd}~qhd}~00qhn||jvrtj	|}tj	|}z\||jd|d||gtj	tj	|\}}tj	||d	}||jd||gWqhty}zt|WYd}~qhd}~00qhntd
|||jg|
|}|r$|d|||d|||z||Wqhty}zt|WYd}~qhd}~00qh|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rrcz"Don't know how to compile {} to {}z/EHscz/Fo)rfrZ_setup_compileappendextendr}r|KeyErrorrrr\
_c_extensions_cpp_extensionsrspawnrwrrrdirnamerxrrr/rOru)rgsourcesrZmacrosinclude_dirsr
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsZadd_cpp_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirrr>Zrc_fileargsr"r"r#compileBsr








 zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||r|d|g}|rJz,td|jd||	|jg|Wqt
y}zt|WYd}~qd}~00ntd|dS)N)r/OUT:Executing "%s" %s skipping %s (up-to-date))rfr_fix_object_argslibrary_filename
_need_linkr	rrmr/rrr)	rgrZoutput_libnamerrtarget_langoutput_filenameZlib_argsrr"r"r#create_static_libs zMSVCCompiler.create_static_libc
Cs|js||||\}}||||}|\}}}|rL|dt|t||||}|durptj	||}|
||r|j||	f}dd|pgD}||||d|g}tj|d}|durtj
tj|\}}tj	|||}|d||
r|
|dd<|r.||tjtj|}||z,td|jd	|||jg|Wn.ty}zt|WYd}~n
d}~00ntd	|dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|qS)z/EXPORT:r")rCsymr"r"r#
rLz%MSVCCompiler.link..rrz/IMPLIB:rrr)rfrrZ
_fix_lib_argswarnstrrrrr/rr~rrrrrrr\mkpathr	rrvrrr)rgZtarget_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrrr
build_temprZ
fixed_argsZlib_optsrZexport_optsZld_argsZdll_nameZdll_extZimplib_filerr"r"r#links^





 zMSVCCompiler.linkcsRttj|jd}||| }tj||dWdS1sB0Y|jS)N)PATH)rX)dictrr+rt_fallback_spawnsuperrrD)rgrTrXfallback	__class__r"r#rs.zMSVCCompiler.spawnc
#stddi}z
|VWn2tyJ}zdt|vr6WYd}~nd}~00dStdtjd|t	||_
Wdn1s0YdS)z
        Discovered in pypa/distutils#15, some tools monkeypatch the compiler,
        so the 'env' kwarg causes a TypeError. Detect this condition and
        restore the legacy, unsafe behavior.
        ZBagr"z!unexpected keyword argument 'env'Nz>Fallback spawn triggered. Please update distutils monkeypatch.z
os.environ)typerrwarningsrunittestZmockpatchrrrD)rgrTrXZbagrWrr"r#rs
zMSVCCompiler._fallback_spawncCsd|S)Nz	/LIBPATH:r"rgrr"r"r#library_dir_optionszMSVCCompiler.library_dir_optioncCstddS)Nz:don't know how to set runtime library search path for MSVC)rrr"r"r#runtime_library_dir_optionsz'MSVCCompiler.runtime_library_dir_optioncCs
||S)N)r)rgrmr"r"r#library_option szMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj|||}tj|r$|Sq$qdS)NZ_d)rrr/rr<)rgdirsrmrZ	try_namesrnameZlibfiler"r"r#find_library_file#szMSVCCompiler.find_library_file)rrr)N)rrk)NNNrNNN)NrN)
NNNNNrNNNN)r)!__name__
__module____qualname____doc__
compiler_typeZexecutablesrrrrrrrZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrdrrrrrr
contextlibcontextmanagerrrrrr
__classcell__r"r"rr#rbs`

P
"
]

Erb)N)!rrr-rrZ
unittest.mockrsuppressImportErrorrdistutils.errorsrrrrrdistutils.ccompilerrr	distutilsr	distutils.utilr
	itertoolsrr$r4ZPLAT_SPEC_TO_RUNTIMEr@rYr`rrrbr"r"r"r#s8&!
PK!Xg._distutils/__pycache__/__init__.cpython-39.pycnu[a

(Re@s*dZddlZejdejdZdZdS)zdistutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
N T)__doc__sysversionindex__version__localr	r	/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/__init__.pys
PK!
Mhh*_distutils/__pycache__/core.cpython-39.pycnu[a

(Re"@sdZddlZddlZddlmZddlTddlmZddlm	Z	ddl
mZddlm
Z
d	Zd
dZdadadZd
ZddZdddZdS)a#distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
N)DEBUG)*)Distribution)Command)
PyPIRCCommand)	Extensionzusage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj|}ttS)N)ospathbasenameUSAGEvars)script_namescriptr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/core.py	gen_usage sr)	distclassr
script_argsoptionsnameversionauthorauthor_email
maintainermaintainer_emailurllicensedescriptionlong_descriptionkeywords	platformsclassifiersdownload_urlrequiresprovides	obsoletes)rsourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_args	swig_optsexport_symbolsdependslanguagec
Ks|d}|r|d=nt}d|vr8tjtjd|d<d|vrRtjdd|d<z||a}WnNty}z6d|vrt	d|nt	d	|d|fWYd}~n
d}~00t
d
kr|S|trt
d|t
dkr|Sz|}Wn<ty.}z"t	t|jd
|WYd}~n
d}~00trFt
d|t
dkrT|S|rz|Wntyt	dYnty}z6trtjd|fnt	d|fWYd}~nLd}~0ttfy}z&trnt	dt|WYd}~n
d}~00|S)aThe gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    rr
rrNrzerror in setup command: %szerror in %s setup command: %sinitz%options (after parsing config files):configz

error: %sz%options (after parsing command line):commandlineinterruptedz
error: %s
z	error: %szerror: )getrrr	r
sysargv_setup_distributionDistutilsSetupError
SystemExit_setup_stop_afterparse_config_filesrprintdump_option_dictsparse_command_lineDistutilsArgErrorrr
run_commandsKeyboardInterruptOSErrorstderrwriteDistutilsErrorCCompilerErrorstr)attrsklassdistmsgokexcrrrsetup9sd%

,
"&rSruncCs|dvrtd|f|atj}d|i}zxzf|tjd<|durP|tjdd<t|d}t||Wdn1s~0YW|t_dan|t_da0WntyYn0t	durt
d|t	S)	a.Run a setup script in a somewhat controlled environment, and
    return the Distribution instance that drives things.  This is useful
    if you need to find out the distribution meta-data (passed as
    keyword args from 'script' to 'setup()', or the contents of the
    config files or command-line.

    'script_name' is a file that will be read and run with 'exec()';
    'sys.argv[0]' will be replaced with 'script' for the duration of the
    call.  'script_args' is a list of strings; if supplied,
    'sys.argv[1:]' will be replaced by 'script_args' for the duration of
    the call.

    'stop_after' tells 'setup()' when to stop processing; possible
    values:
      init
        stop after the Distribution instance has been created and
        populated with the keyword arguments to 'setup()'
      config
        stop after config files have been parsed (and their data
        stored in the Distribution instance)
      commandline
        stop after the command-line ('sys.argv[1:]' or 'script_args')
        have been parsed (and the data stored in the Distribution)
      run [default]
        stop after all commands have been run (the same as if 'setup()'
        had been called in the usual way

    Returns the Distribution instance, which provides all information
    used to drive the Distutils.
    )r5r6r7rTz"invalid value for 'stop_after': %r__file__rNr4rbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)
ValueErrorr?r:r;copyopenexecreadr>r<RuntimeError)r
r
stop_after	save_argvgfrrr	run_setups.

.
ra)NrT)__doc__rr:distutils.debugrdistutils.errorsdistutils.distr
distutils.cmdrdistutils.configrdistutils.extensionrrrr?r<setup_keywordsextension_keywordsrSrarrrrs 	qPK!5y0_distutils/__pycache__/py35compat.cpython-39.pycnu[a

(Re@s(ddlZddlZddZeedeZdS)NcCs*g}tjj}|dkr&|dd||S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r-O)sysflagsoptimizeappend)argsvaluer
/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/py35compat.py#__optim_args_from_interpreter_flagss
r"_optim_args_from_interpreter_flags)r
subprocessrgetattrr
r
r
r
rs
PK!VB3_distutils/__pycache__/unixccompiler.cpython-39.pycnu[a

(Re8@sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZmZmZmZddlmZejdkrddlZGd	d
d
e
ZdS)a9distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
N)	sysconfig)newer)	CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecErrorCompileErrorLibError	LinkError)logdarwinc
@seZdZdZddgdgdgddgdgddgddZejddd	krNd
ged
<gdZdZd
Z	dZ
dZdZdZ
ZZeZejdkrdZd'ddZddZd(ddZd)ddZddZdd Zd!d"Zd#d$Zd*d%d&ZdS)+
UnixCCompilerunixNccz-sharedarz-cr)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverranlibrr)z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.exec
Cs|d||}|\}}}t||}	|j|	}
|r>|
d|g|rN||
dd<|r\|
||
||js~|dus~t||r|r|tj	
|z||
Wn,ty}zt
|WYd}~n
d}~00dS)N-or)Z_fix_compile_argsrrextendappendforcermkpathospathdirnamespawnrr)selfsourceZoutput_fileZmacrosinclude_dirs
extra_preargsextra_postargs
fixed_argsignorepp_optsZpp_argsmsgr-/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py
preprocessUs$




zUnixCCompiler.preprocessc	
Csr|j}tjdkr t|||}z ||||d|g|Wn,tyl}zt|WYd}~n
d}~00dS)Nrr)rsysplatform_osx_supportcompiler_fixupr#rr)	r$objsrcextZcc_argsr(r+rr,r-r-r._compileos

zUnixCCompiler._compilerc
Cs|||\}}|j||d}|||r|tj|||j|g||j	|j
rz||j
|gWqty}zt|WYd}~qd}~00nt
d|dS)N)
output_dirskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkrr r!r"r#robjectsrrr	rdebug)r$r=Zoutput_libnamer8r>target_langoutput_filenamer,r-r-r.create_static_libzs$	 zUnixCCompiler.create_static_libc
Cs|||\}}||||}|\}}}t||||}t|ttdfsPtd|durftj	||}|
||r||j|d|g}|	rdg|dd<|
r|
|dd<|r|||
tj|z|tjkr|jdd}n|jdd}|
dkrr|jrrd}tj|ddkr@d}d||vr@|d7}q&tj||d	kr\d}nd}|j||||<tjd
krt||}|||Wn.ty}zt|WYd}~n
d}~00ntd|dS)Nz%'output_dir' must be a string or Nonerz-grzc++env=Z	ld_so_aixrr9)r:Z
_fix_lib_argsr
isinstancestrtype	TypeErrorr r!joinr<r=rrr"rZ
EXECUTABLErrrbasenamer0r1r2r3r#rr
rr>)r$Ztarget_descr=r@r8	librarieslibrary_dirsruntime_library_dirsexport_symbolsr>r'r(
build_tempr?r)Zlib_optsZld_argsZlinkerioffsetr,r-r-r.linksZ


 zUnixCCompiler.linkcCsd|S)N-Lr-)r$dirr-r-r.library_dir_optionsz UnixCCompiler.library_dir_optioncCsd|vpd|vS)Ngcczg++r-)r$Z
compiler_namer-r-r._is_gccszUnixCCompiler._is_gcccCstjttdd}tjdddkrjddl	m
}m}|}|r`||ddgkr`d|Sd	|SnNtjdd
dkrd|Stjddd
kr||rdd	|gSdd	|gStddkrd|Sd|SdS)NCCrrr)get_macosx_target_ver
split_version
z-Wl,-rpath,rSZfreebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+sGNULDyesz-Wl,--enable-new-dtags,-Rz-Wl,-R)
r r!rJshlexsplitrget_config_varr0r1distutils.utilrYrZrW)r$rTrrYrZZmacosx_target_verr-r-r.runtime_library_dir_options 

z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr-)r$libr-r-r.library_optionszUnixCCompiler.library_optioncCs|j|dd}|j|dd}|j|dd}|j|dd}tjdkrptd}td|}	|	durfd	}
n
|	d
}
|D] }tj	
||}tj	
||}
tj	
||}tj	
||}tjdkr@|ds|dr@|d
s@tj	
|
|d
d|}tj	
|
|d
d|}
tj	
|
|d
d|}tj	
|
|d
d|}tj	|
rV|
Stj	|rl|Stj	|r|Stj	|rt|SqtdS)Nshared)Zlib_typedylib
xcode_stubstaticrCFLAGSz-isysroot\s*(\S+)/rCz/System/z/usr/z/usr/local/)
r;r0r1rrbresearchgroupr r!rI
startswithexists)r$dirsrer>Zshared_fZdylib_fZxcode_stub_fZstatic_fcflagsmZsysrootrTrgrhrjrir-r-r.find_library_filesF




zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)__name__
__module____qualname__
compiler_typeZexecutablesr0r1Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionr/r7rArRrUrWrdrfrur-r-r-r.r
-sL





B'r
)__doc__r r0rmr`	distutilsrdistutils.dep_utilrdistutils.ccompilerrrrdistutils.errorsrrr	r
rr1r2r
r-r-r-r.s 
PK!7o&66)_distutils/__pycache__/cmd.cpython-39.pycnu[a

(ReF@sbdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZGdddZ
dS)ztdistutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
N)DistutilsOptionError)utildir_util	file_utilarchive_utildep_utillogc@s"eZdZdZgZddZddZddZdd	Zd
dZ	dCddZ
ddZdDddZddZ
dEddZdFddZddZdGddZdd Zd!d"Zd#d$Zd%d&ZdHd'd(ZdId*d+Zd,d-Zd.d/Zd0d1ZdJd2d3ZdKd5d6ZdLd7d8ZdMd9d:ZdNd;d<ZdOd=d>Z dPd?d@Z!dQdAdBZ"dS)RCommanda}Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    cCsbddlm}t||std|jtur0td||_|d|_	|j
|_
d|_d|_d|_
dS)zCreate and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        r)Distributionz$dist must be a Distribution instancezCommand is an abstract classN)distutils.distr
isinstance	TypeError	__class__r
RuntimeErrordistributioninitialize_options_dry_runverboseforcehelp	finalized)selfdistrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/cmd.py__init__/s


zCommand.__init__cCs<|dkr0t|d|}|dur*t|j|S|Snt|dS)Ndry_run_)getattrrAttributeError)rattrmyvalrrr__getattr___szCommand.__getattr__cCs|js|d|_dS)N)rfinalize_optionsrrrrensure_finalizediszCommand.ensure_finalizedcCstd|jdS)aSet default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        ,abstract method -- subclass %s must overrideNrrr&rrrr{s
zCommand.initialize_optionscCstd|jdS)aSet final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        r(Nr)r&rrrr%szCommand.finalize_optionsNcCsddlm}|dur d|}|j||tjd|d}|jD]R\}}}||}|ddkrn|dd}t||}|j|d||ftjdqBdS)	Nr)
longopt_xlatezcommand options for '%s':)levelz  =z%s = %s)	distutils.fancy_getoptr+get_command_nameannouncer	INFOuser_options	translater)rheaderindentr+optionrvaluerrrdump_optionss

zCommand.dump_optionscCstd|jdS)aA command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        r(Nr)r&rrrruns
zCommand.runr$cCst||dS)zmIf the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        Nr)rmsgr,rrrr1szCommand.announcecCs&ddlm}|r"t|tjdS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugr<printsysstdoutflush)rr;r<rrrdebug_printszCommand.debug_printcCsBt||}|dur"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))rsetattrr
strr)rr7whatdefaultvalrrr_ensure_stringlikes

zCommand._ensure_stringlikecCs||d|dS)zWEnsure that 'option' is a string; if not defined, set it to
        'default'.
        stringN)rH)rr7rFrrr
ensure_stringszCommand.ensure_stringcCspt||}|durdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|tVqdSN)r
rD).0vrrr	z-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r))	rr
rDrCresplitlistallr)rr7rGokrrrensure_string_lists


zCommand.ensure_string_listcCs6||||}|dur2||s2td|||fdS)Nzerror in '%s' option: )rHr)rr7testerrE	error_fmtrFrGrrr_ensure_tested_strings
zCommand._ensure_tested_stringcCs||tjjdddS)z5Ensure that 'option' is the name of an existing file.filenamez$'%s' does not exist or is not a fileN)rXospathisfilerr7rrrensure_filenameszCommand.ensure_filenamecCs||tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rXrZr[isdirr]rrrensure_dirnameszCommand.ensure_dirnamecCst|dr|jS|jjSdS)Ncommand_name)hasattrrar__name__r&rrrr0	s
zCommand.get_command_namecGsF|j|}||D](\}}t||durt||t||qdS)a>Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        N)rget_command_objr'rrC)rsrc_cmdoption_pairssrc_cmd_obj
src_option
dst_optionrrrset_undefined_optionss
zCommand.set_undefined_optionscCs|j||}||S)zWrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        )rrdr')rcommandcreatecmd_objrrrget_finalized_command$szCommand.get_finalized_commandrcCs|j||SrK)rreinitialize_command)rrkreinit_subcommandsrrrro0szCommand.reinitialize_commandcCs|j|dS)zRun some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        N)rrun_command)rrkrrrrq4szCommand.run_commandcCs2g}|jD]"\}}|dus"||r
||q
|S)akDetermine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        N)sub_commandsappend)rcommandscmd_namemethodrrrget_sub_commands;s
zCommand.get_sub_commandscCstd||dS)Nzwarning: %s: %s
)r	warnr0)rr;rrrrxKszCommand.warncCstj||||jddSNr)rexecuter)rfuncargsr;r,rrrr{NszCommand.executecCstj|||jddSry)rmkpathr)rnamemoderrrrQszCommand.mkpathc	Cstj|||||j||jdS)zCopy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.)rz)r	copy_filerr)rinfileoutfile
preserve_modepreserve_timeslinkr,rrrrTs

zCommand.copy_filec	Cstj||||||j|jdS)z\Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        rz)r	copy_treerr)rrrrrpreserve_symlinksr,rrrr]s

zCommand.copy_treecCstj|||jdS)z$Move a file respecting dry-run flag.rz)r	move_filer)rsrcdstr,rrrrfszCommand.move_filecCs ddlm}||||jddS)z2Spawn an external command respecting dry-run flag.r)spawnrzN)distutils.spawnrr)rcmdsearch_pathr,rrrrrjsz
Command.spawnc	Cstj|||||j||dS)N)rownergroup)rmake_archiver)r	base_nameformatroot_dirbase_dirrrrrrroszCommand.make_archivecCs|durd|}t|tr"|f}nt|ttfs8td|durRd|d|f}|jsdt||rv|	||||n
t
|dS)aSpecial case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )r
rDrRtuplerjoinrrnewer_groupr{r	debug)rinfilesrr|r}exec_msgskip_msgr,rrr	make_fileus

zCommand.make_file)Nr*)r$)N)N)N)r$)r)Nr$)r~)r$r$Nr$)r$r$rr$)r$)r$r$)NNNN)NNr$)#rc
__module____qualname____doc__rrrr#r'rr%r9r:r1rBrHrJrUrXr^r`r0rjrnrorqrwrxr{rrrrrrrrrrrr
sP0












	
	


r
)rr?rZrPdistutils.errorsr	distutilsrrrrrr	r
rrrrs
PK!N+_distutils/__pycache__/spawn.cpython-39.pycnu[a

(Re
@s\dZddlZddlZddlZddlmZmZddlmZddl	m
Z
dddZdd	d
ZdS)
zdistutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
N)DistutilsPlatformErrorDistutilsExecError)DEBUG)logc
Cst|}tt||r dS|r@t|d}|dur@||d<|durL|nttj}t	j
dkrddlm}m
}|}|r|||<z tj||d}	|	|	j}
WnHty}z0ts|d}td||jdf|WYd}~n
d}~00|
rts|d}td||
fdS)	aRun another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    Nrdarwin)MACOSX_VERSION_VARget_macosx_target_ver)envzcommand %r failed: %sz#command %r failed with exit code %s)listrinfo
subprocesslist2cmdlinefind_executabledictosenvironsysplatformdistutils.utilrr	Popenwait
returncodeOSErrorrrargs)cmdsearch_pathverbosedry_runr

executablerr	Zmacosx_target_verprocexitcodeexcr$/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/spawn.pyspawns@


r&c	Cstj|\}}tjdkr*|dkr*|d}tj|r:|S|durtjdd}|durztd}Wnt	t
fytj}Yn0|sdS|tj
}|D]&}tj||}tj|r|SqdS)zTries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    win32z.exeNPATHCS_PATH)rpathsplitextrrisfilergetconfstrAttributeError
ValueErrordefpathsplitpathsepjoin)r r*_extpathspfr$r$r%rHs(
r)rrrN)N)
__doc__rrrdistutils.errorsrrdistutils.debugr	distutilsrr&rr$r$r$r%s
6PK!N<DD3_distutils/__pycache__/msvc9compiler.cpython-39.pycnu[a

(Rev@sNdZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZddlmZddlZejZejZejZejZejejejejfZej dkoej!dkZ"e"rd	Z#d
Z$dZ%ndZ#d
Z$dZ%dddZ&GdddZ'GdddZ(ddZ)ddZ*ddZ+ddZ,d$ddZ-e)Z.e.d kr:ed!e.Gd"d#d#eZ/dS)%adistutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platformwin32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFrameworkx86amd64rz	win-amd64c@sPeZdZdZddZeeZddZeeZddZeeZdd	Ze	eZd
S)Regz2Helper class to read values from the registry
    cCs:tD](}|||}|r||vr||Sqt|dSN)HKEYSread_valuesKeyError)clspathkeybasedr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/msvc9compiler.py	get_value?s
z
Reg.get_valuecCsjzt||}Wnty"YdS0g}d}zt||}WntyPYqfYn0|||d7}q,|S)zReturn list of registry keys.Nr)RegOpenKeyExRegError
RegEnumKeyappend)rrrhandleLikrrr	read_keysGs


z
Reg.read_keysc	Cszt||}Wnty"YdS0i}d}zt||\}}}WntyVYq~Yn0|}|||||<|d7}q,|S)z`Return dict of registry keys and values.

        All names are converted to lowercase.
        Nrr)rrRegEnumValuelowerconvert_mbcs)	rrrr!rr#namevaluetyperrrrYs

zReg.read_valuescCs8t|dd}|dur4z|d}Wnty2Yn0|S)Ndecodembcs)getattrUnicodeError)sdecrrrr(oszReg.convert_mbcsN)
__name__
__module____qualname____doc__rclassmethodr%rr(staticmethodrrrrr;src@s,eZdZddZddZddZddZd	S)

MacroExpandercCsi|_t||_||dSr)macrosVS_BASEvsbaseload_macros)selfversionrrr__init__{s
zMacroExpander.__init__cCst|||jd|<dS)Nz$(%s))rrr9)r=Zmacrorrrrr	set_macroszMacroExpander.set_macroc	Cs|d|jdd|d|jdd|dtdz$|dkrP|d	td
ntd
WntyttdYn0|dkr|d
|jd|dtdn`d}tD]V}zt||}WntyYqYn0t	|d}t
|d||f}|d|jd<qdS)NZVCInstallDirz	\Setup\VC
productdirZVSInstallDirz	\Setup\VSZFrameworkDirZinstallroot @ZFrameworkSDKDirzsdkinstallrootv2.0aPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@ZFrameworkVersionzclr versionZ
WindowsSdkDirZcurrentinstallfolderz.Software\Microsoft\NET Framework Setup\Productrz%s\%sr>z$(FrameworkVersion))
r@r;NET_BASErrWINSDK_BASErrrrrrr9)r=r>prhrrrrrr<s2


zMacroExpander.load_macroscCs$|jD]\}}|||}q
|Sr)r9itemsreplace)r=r0r$vrrrsubszMacroExpander.subN)r2r3r4r?r@r<rJrrrrr8ysr8cCsd}tj|}|dkrdS|t|}tj|ddd\}}t|ddd}|dkrf|d7}t|d	d
d}|dkrd}|dkr||SdS)
zReturn the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.N r
g$@r)sysr>findlensplitint)prefixr#r0restZmajorVersionZminorVersionrrrget_build_versionsrYcCs0g}|D]"}tj|}||vr||q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )osrnormpathr )pathsZ
reduced_pathsrEnprrrnormalize_and_reduce_pathssr^cCs<|tj}g}|D]}||vr||qtj|}|S)z8Remove duplicate values of an environment variable.
    )rUrZpathsepr join)variableZoldListZnewListr#ZnewVariablerrrremoveDuplicatessrbcCst|}ztd|d}Wn ty<tdd}Yn0|rNtj|sd|}tj	
|d}|rtj|rtj|tjtjd}tj
|}tj|std|dSntd||std	dStj|d
}tj|r|StddS)zFind the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    z%s\Setup\VCrAz%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.batUnable to find vcvarsall.bat)r:rrrr	debugrZrisdirenvirongetr`pardirabspathisfile)r>r;rAZtoolskeyZtoolsdir	vcvarsallrrrfind_vcvarsalls4




rlcCsHt|}hd}i}|dur$tdtd||tjd||ftjtjd}z|\}}|dkrvt|	d|	d}|
d	D]d}t|}d
|vrq|
}|
d
d\}	}
|	}	|	|vr|
tjr|
dd}
t|
||	<qW|j|jn|j|j0t|t|krDttt||S)
zDLaunch vcvarsall.bat and read the settings from its environment
    >ZlibpathlibincluderNrcz'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)stdoutstderrrr-
=rrK)rlrr	rd
subprocessPopenPIPEcommunicatewaitr,rUrr(stripr'endswithrZr_rbrocloserprT
ValueErrorstrlistkeys)r>archrkinterestingresultpopenrorplinerr*rrrquery_vcvarsallsB



rrBz(VC %0.1f is not supported by this modulec
@seZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd,ddZd-ddZd.ddZd/ddZd0ddZd1ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd2d(d)Zd*d+ZdS)3MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t||||t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr?VERSION_MSVCCompiler__versionZ_MSVCCompiler__root_MSVCCompiler__paths	plat_name_MSVCCompiler__archinitialized)r=verbosedry_runforcerrrr?HszMSVCCompiler.__init__NcCs|jrJd|durt}d}||vr6td|fdtjvrtdtjvrt|drtd|_d|_d|_d	|_	d
|_
n|tks|dkrt|}nttdt|}tt
|}|d
tj|_|dtjd<|dtjd<t|jdkrtd|j|d|_|d|_|d|_|d	|_	|d
|_
z(tjd
dD]}|j|qHWntyrYn0t|j|_d|jtjd
<d|_|jdkrgd|_gd|_ngd|_gd|_gd|_|jdkrgd|_dg|_d|_dS)Nzdon't init multiple timesrz--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer_rrmrnrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.;r)/nologo/O2/MD/W3/DNDEBUG)r/Od/MDdr/Z7/D_DEBUG)rrrr/GS-r)rrrrrrr)/DLLrz/INCREMENTAL:NO)rrz/INCREMENTAL:noz/DEBUGrT)rr
rrZrffind_execclinkerrmrcmcPLAT_TO_VCVARSrrrUr_rrTZ_MSVCCompiler__productr rr^r`Zpreprocess_optionsrcompile_optionscompile_options_debugldflags_sharedrldflags_shared_debugZldflags_static)r=rZok_platsZ	plat_specZvc_envrErrr
initializeSsd






zMSVCCompiler.initializecCs|durd}g}|D]}tj|\}}tj|d}|tj|d}||jvrbtd||rrtj|}||jvr|	tj
|||jq||jvr|	tj
|||jq|	tj
|||j
q|S)NrrzDon't know how to compile %s)rZrsplitext
splitdriveisabssrc_extensionsrbasename_rc_extensionsr r`
res_extension_mc_extensions
obj_extension)r=Zsource_filenamesZ	strip_dir
output_dirZ	obj_namessrc_namerextrrrobject_filenamess,


zMSVCCompiler.object_filenamesc	Cst|js||||||||}	|	\}}
}}}|p6g}
|
d|rT|
|jn|
|j|
D]}z||\}}WntyYqdYn0|rtj	
|}||jvrd|}nX||jvrd|}nB||j
vr<|}d|}z"||jg||g|gWqdty6}zt|WYd}~qdd}~00qdn||jvrtj	|}tj	|}zl||jgd|d|g|gtj	tj	|\}}tj	||d}||jgd|g|gWqdty}zt|WYd}~qdd}~00qdntd||fd	|}z&||jg|
|||g|Wqdtyl}zt|WYd}~qdd}~00qd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrz"Don't know how to compile %s to %sz/Fo)rrZ_setup_compiler extendrrrrZrri
_c_extensions_cpp_extensionsrspawnrrrrdirnamerrrr`r)r=sourcesrr9include_dirsrd
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirrrZrc_filerrrcompiles











 zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||r|d|g}|rJz||jg|Wqty}zt|WYd}~qd}~00nt	
d|dS)N)r/OUT:skipping %s (up-to-date))rr_fix_object_argslibrary_filename
_need_linkrrmrrr	rd)	r=rZoutput_libnamerrdtarget_langoutput_filenameZlib_argsrrrrcreate_static_libs zMSVCCompiler.create_static_libc
CsX|js||||\}}||||}|\}}}|rL|dt|t||||}|durptj	||}|
||rH|tjkr|	r|j
dd}q|jdd}n|	r|j
}n|j}g}|pgD]}|d|q||||d|g}tj|d}|durLtjtj|\}}tj	|||}|d||||||
rl|
|dd<|r||||tj|z||jg|Wn.ty}zt|WYd}~n
d}~00|||}|durT|\}}d||f}z|dd	d
||gWn.tyD}zt|WYd}~n
d}~00ntd|dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:rrz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestr)rrrZ
_fix_lib_argswarnr|rrZrr`rr
EXECUTABLErrr rrrrmanifest_setup_ldargsrmkpathrrrrmanifest_get_embed_infor	rd)r=target_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrdrr
build_temprZ
fixed_argsZlib_optsZldflagsZexport_optssymld_argsZdll_nameZdll_extZimplib_filerZmfinfoZ
mffilenamemfidZout_argrrrlink5s








 zMSVCCompiler.linkcCs,tj|tj|d}|d|dS)Nz	.manifest/MANIFESTFILE:)rZrr`rr )r=rrr
temp_manifestrrrrs
z"MSVCCompiler.manifest_setup_ldargscCs^|D]"}|dr|ddd}q,qdS|tjkr|)rz*\s*zI|)w)
openreadrzrerDOTALLrJsearchwriteOSError)r=Z
manifest_fileZ
manifest_fZmanifest_bufpatternrrrrs6	


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:rr=dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCstddS)NzsP>.#
)
PK!gP3_distutils/command/__pycache__/bdist.cpython-39.pycnu[a

(Re@sHdZddlZddlmZddlTddlmZddZGdd	d	eZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).N)Command)*)get_platformcCsPddlm}g}tjD]"}|d|dtj|dfq||}|ddS)zFPrint list of available formats (arguments to "--format" option).
    r)FancyGetoptformats=Nz'List of available distribution formats:)distutils.fancy_getoptrbdistformat_commandsappendformat_command
print_help)rformatsformatZpretty_printerr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/bdist.pyshow_formatss
rc
@seZdZdZddddefdddd	d
gZdgZdd
defgZdZ	dddZ
gdZdddddddddd	ZddZ
dd Zd!d"Zd
S)#r	z$create a built (binary) distribution)zbdist-base=bz4temporary directory for creating built distributionsz
plat-name=pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=dz=directory to put final built distributions in [default: dist])
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)	bdist_rpmgztarzip)posixnt)	ZrpmrbztarxztarztartarZwininstrZmsi)rzRPM distribution)
bdist_dumbzgzip'ed tar file)r"zbzip2'ed tar file)r"zxz'ed tar file)r"zcompressed tar file)r"ztar file)
bdist_wininstzWindows executable installer)r"zZIP file)Z	bdist_msizMicrosoft InstallercCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)
bdist_base	plat_namerdist_dir
skip_buildgroupowner)selfrrrinitialize_optionsQszbdist.initialize_optionscCs|jdur(|jrt|_n|dj|_|jdurT|dj}tj|d|j|_|	d|j
durz|jtjg|_
Wn t
ytdtjYn0|jdurd|_dS)Nbuildzbdist.rz;don't know how to create built distributions on platform %sdist)r%r'rget_finalized_commandr$
build_baseospathjoinensure_string_listrdefault_formatnameKeyErrorDistutilsPlatformErrorr&)r*r/rrrfinalize_optionsZs*






zbdist.finalize_optionsc	Csg}|jD]<}z||j|dWq
tyDtd|Yq
0q
tt|jD]h}||}||}||jvr|j||_	|dkr|j
|_
|j|_|||ddvrd|_|
|qVdS)Nrzinvalid format '%s'r"r)rrrr6DistutilsOptionErrorrangelenreinitialize_commandno_format_optionrr)r(Z	keep_temprun_command)r*commandsricmd_nameZsub_cmdrrrrunvs"


z	bdist.run)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsr=r4r
rr+r8rBrrrrr	sH
	r	)	__doc__r0distutils.corerdistutils.errorsdistutils.utilrrr	rrrrsPK!:G٠!!;_distutils/command/__pycache__/bdist_wininst.cpython-39.pycnu[a

(Re>@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.N)Command)get_platform)remove_tree)*)get_python_version)logc
seZdZdZddddefdddd	d
ddd
dddg
ZgdZejdkZ	fddZ
ddZddZddZ
ddZd$ddZd d!Zd"d#ZZS)%
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)zbitmap=bz>bitmap to use for the installer instead of python-powered logo)ztitle=tz?title to display on the installer background instead of default)
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nzspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC)r
rrrwin32cs$tj|i|tdtddS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead)super__init__warningswarnDeprecationWarning)selfargskw	__class__/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_wininst.pyr?szbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
	bdist_dir	plat_name	keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle
skip_buildinstall_scriptpre_install_scriptuser_access_control)rr r r!initialize_optionsEsz bdist_wininst.initialize_optionscCs|dd|jdurR|jr6|jr6|jd}|j|_|dj}tj	
|d|_|js^d|_|js|jrt
}|jr|j|krtd|f||_|ddd|jr|jjD]}|jtj	|krqqtd|jdS)	Nbdist)r+r+ZwininstzMtarget version can only be %s, or the '--skip-build' option must be specified)r(r()r#r#z(install_script '%s' not found in scripts)set_undefined_optionsr"r+r#distributionget_command_objget_finalized_command
bdist_baseospathjoinr'has_ext_modulesrDistutilsOptionErrorr,scriptsbasename)rr0r6Z
short_versionscriptr r r!finalize_optionsUs>
zbdist_wininst.finalize_optionsc
Cstjdkr&|js|jr&td|js6|d|jddd}|j	|_
|j|_d|_|j|_|d}d|_
d|_|jr|j}|s|jsJd	d
tjdd}d|j|f}|d}tj|jd
||_dD],}|}|dkr|d}t|d||qtd|j	|tjdtj|j	d|tjd=ddlm}|}	|j }
|j!|	d|j	d}|"||
|j#|jrt$}nd}|jj%&d||'|
ft(d|t)||j*st+|j	|j,ddS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall)reinit_subcommandsrinstall_libz Should have already checked thisz%d.%drz.%s-%slib)purelibplatlibheadersr<datarHz/Include/$dist_nameinstall_zinstalling to %sZPURELIB)mktempzip)root_diranyrzremoving temporary file '%s')dry_run)-sysplatformr3r:has_c_librariesDistutilsPlatformErrorr+run_commandreinitialize_commandr"rootwarn_dirr#compileoptimizer'version_infor5r7r8r9
build_base	build_libuppersetattrrinfoensure_finalizedinsertruntempfilerKget_fullnamemake_archive
create_exer)r
dist_filesappendget_installer_filenamedebugremover$rrO)
rrArDr'plat_specifierr@keyvaluerKZarchive_basenamefullnamearcnameZ	pyversionr r r!rb{st







zbdist_wininst.runcCsZg}|jj}|d|jpdd}dd}dD]B}t||d}|r0|d|||f}|d|||fq0|d	|jr|d
|j|d|||d|j|d
|j|j	r|d|j	|j
r|d|j
|jp|j}|d||ddl
}ddl}	d||
|	jf}
|d|
d|S)Nz
[metadata]r1
cSs|ddS)Nrqz\n)replace)sr r r!escapesz)bdist_wininst.get_inidata..escape)authorauthor_emaildescription
maintainermaintainer_emailnameurlversionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3metadatarhlong_descriptiongetattr
capitalizer,r%r&r'r.r*rdtime	distutilsctime__version__r9)rlinesr}r_rtrzrIr*rrZ
build_infor r r!get_inidatas>

zbdist_wininst.get_inidataNc	Csddl}||j|}||}|d||rtt|d}|}Wdn1s`0Yt|}	nd}	t|d}
|
	|
|r|
	|t|tr|
d}|d}|jrt|jddd	}|
d}Wdn1s0Y||d
}n|d}|
	||ddt||	}
|
	|
t|d}|
	|Wdn1sr0YWdn1s0YdS)
Nrzcreating %srbwbmbcsrzlatin-1)encodings
zZscript_dataheaderr r r!rfsD
&



,

zbdist_wininst.create_execCsD|jr&tj|jd||j|jf}ntj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r'r7r8r9r(r#)rrorr r r!ri1s

z$bdist_wininst.get_installer_filenamec	Cs(t}|jrl|j|krl|jdkr&d}q|jdkr6d}q|jdkrFd}q|jdkrVd}q|jdkrfd	}qd
}n>zddlm}Wntyd
}Yn0|d
d}|d}tjt	}|j
dkr|j
dddkr|j
dd}nd}tj|d||f}t|d}z|
W|S|0dS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)CRT_ASSEMBLY_VERSION.z.0rwinr1zwininst-%s%s.exer)rr'msvcrtrImportError	partitionr7r8dirname__file__r#r9rrclose)	rZcur_versionZbvrmajor	directoryZsfixfilenamerr r r!r>s<	






zbdist_wininst.get_exe_bytes)N)__name__
__module____qualname__rwruser_optionsboolean_optionsrPrQZ_unsupportedrr/r?rbrrfrir
__classcell__r r rr!rs:%
&Q.
7
r)__doc__r7rPrdistutils.corerdistutils.utilrdistutils.dir_utilrdistutils.errorsdistutils.sysconfigrrrrr r r r!sPK!Ֆ3_distutils/command/__pycache__/check.cpython-39.pycnu[a

(Re@sdZddlmZddlmZzHddlmZddlmZddl	m
Z
ddl	mZGdd	d	eZd
Z
WneyzdZ
Yn0Gdd
d
eZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
)Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc@seZdZd	ddZddZdS)
SilentReporterNrasciireplacec
Cs"g|_t||||||||dSN)messagesr__init__)selfsourcereport_level
halt_levelstreamdebugencoding
error_handlerr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/check.pyr
szSilentReporter.__init__cOs8|j||||ftj|g|R||j|d|S)N)leveltype)rappendrsystem_messageZlevels)rrmessagechildrenkwargsrrrrszSilentReporter.system_message)Nrr	r
)__name__
__module____qualname__r
rrrrrrs
rTFc@s\eZdZdZdZgdZgdZddZddZd	d
Z	ddZ
d
dZddZddZ
dS)checkz6This command checks the meta-data of the package.
    z"perform some checks on the package))metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check fails)r#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.rN)r%r#r'	_warningsrrrrinitialize_options0szcheck.initialize_optionscCsdSrrr+rrrfinalize_options7szcheck.finalize_optionscCs|jd7_t||S)z*Counts the number of warnings that occurs.r))r*rwarn)rmsgrrrr.:sz
check.warncCsL|jr||jr0tr"|n|jr0td|jrH|jdkrHtddS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#check_metadatar%HAS_DOCUTILScheck_restructuredtextr'rr*r+rrrrun?s
z	check.runcCs|jj}g}dD]"}t||r(t||s||q|rL|dd||jrd|js|dn"|j	r||j
s|dn
|ddS)aEnsures that all required elements of meta-data are supplied.

        Required fields:
            name, version, URL

        Recommended fields:
            (author and author_email) or (maintainer and maintainer_email))

        Warns if any are missing.
        )nameversionurlzmissing required meta-data: %sz, zNmissing meta-data: if 'author' supplied, 'author_email' should be supplied toozVmissing meta-data: if 'maintainer' supplied, 'maintainer_email' should be supplied toozkmissing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be suppliedN)distributionr#hasattrgetattrrr.joinauthorauthor_email
maintainermaintainer_email)rr#missingattrrrrr0Oszcheck.check_metadatacCsX|j}||D]>}|dd}|dur8|d}nd|d|f}||qdS)z4Checks if the long string fields are reST-compliant.lineNr)z%s (line %s))r7get_long_description_check_rst_datagetr.)rdatawarningrBrrrr2ps

zcheck.check_restructuredtextc
Cs|jjp
d}t}tjtfd}d|_d|_d|_t	||j
|j|j|j
|j|jd}tj|||d}||dz|||Wn<ty}z$|jdd|d	ifWYd}~n
d}~00|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)
componentsN)rrrr)rrAz!Could not finish the parsing: %s.)r7script_namerrOptionParserget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZnote_sourceparseAttributeErrorrr)rrFsource_pathparsersettingsreporterrNerrrrD{s.zcheck._check_rst_dataN)rr r!__doc__descriptionuser_optionsboolean_optionsr,r-r.r3r0r2rDrrrrr"#s!r"N)rVdistutils.corerdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr1	Exceptionr"rrrrs
PK!4(::8_distutils/command/__pycache__/py37compat.cpython-39.pycnu[a

(Re@sPddlZddZddZejdkrHejdkrHejddd	krHeeeneZdS)
NccsDddlm}|dsdSdtjd?tjd?d@|d	VdS)
zj
    On Python 3.7 and earlier, distutils would include the Python
    library. See pypa/distutils#9.
    r	sysconfigZPy_ENABLED_SHAREDNz
python{}.{}{}ABIFLAGS)	distutilsrget_config_varformatsys
hexversionrr
/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/py37compat.py_pythonlib_compats
rcsfddS)Ncs|i|S)Nr
)argskwargsf1f2r
rzcompose..r
rr
rrcomposesr)darwinraix)rrrversion_infoplatformlistZ	pythonlibr
r
r
rsPK!W	nn8_distutils/command/__pycache__/bdist_dumb.cpython-39.pycnu[a

(Re1@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
d
eZdS)zdistutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).N)Command)get_platform)remove_treeensure_relative)*)get_python_version)logc	@s\eZdZdZddddefdddd	d
ddg	Zgd
ZdddZddZddZ	ddZ
dS)
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=dz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))zformat=fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))relativeNz7build the archive using relative paths (default: false))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r
rrgztarzip)posixntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)		bdist_dir	plat_nameformat	keep_tempdist_dir
skip_buildrownergroup)selfr /builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_dumb.pyinitialize_options2szbdist_dumb.initialize_optionscCsx|jdur&|dj}tj|d|_|jdurdz|jtj|_Wn t	ybt
dtjYn0|dddddS)NbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rget_finalized_command
bdist_baseospathjoinrdefault_formatnameKeyErrorDistutilsPlatformErrorset_undefined_options)rr%r r r!finalize_options=s"


zbdist_dumb.finalize_optionscCs(|js|d|jddd}|j|_|j|_d|_td|j|dd|j	|j
f}tj
|j|}|js~|j}nJ|jr|j|jkrtdt|jt|jfntj
|jt|j}|j||j||j|jd	}|jrt}nd
}|jjd||f|js$t|j|jddS)
Nbuildinstall)reinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))root_dirrranyr	)dry_run) rrun_commandreinitialize_commandrrootwarn_dirrinfodistributionget_fullnamerr&r'r(rrhas_ext_modulesinstall_baseinstall_platbaser,reprrmake_archiverrrr
dist_filesappendrrr5)rr0Zarchive_basenameZpseudoinstall_rootZarchive_rootfilenameZ	pyversionr r r!runOsN






zbdist_dumb.runN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsr)r"r.rEr r r r!r	s,r	)__doc__r&distutils.corerdistutils.utilrdistutils.dir_utilrrdistutils.errorsdistutils.sysconfigr	distutilsrr	r r r r!sPK!lŻ**8_distutils/command/__pycache__/build_clib.cpython-39.pycnu[a

(ReV@sTdZddlZddlmZddlTddlmZddlmZddZ	Gd	d
d
eZ
dS)zdistutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.N)Command)*)customize_compiler)logcCsddlm}|dS)Nrshow_compilers)distutils.ccompilerrrr	/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_clib.pyrsrc@sfeZdZdZgdZddgZdddefgZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZdS)
build_clibz/build C/C++ libraries used by Python extensions))zbuild-clib=bz%directory to build C/C++ libraries to)zbuild-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r
build_temp	librariesinclude_dirsdefineundefrrcompilerselfr	r	r
initialize_options4szbuild_clib.initialize_optionscCsh|dddddd|jj|_|jr0||j|jdurH|jjpDg|_t|jtrd|jtj	|_dS)Nbuild)rr)rr)rr)rr)rr)
set_undefined_optionsdistributionrcheck_library_listr
isinstancestrsplitospathseprr	r	r
finalize_optionsDs

zbuild_clib.finalize_optionscCs|js
dSddlm}||j|j|jd|_t|j|jdurN|j|j|j	durv|j	D]\}}|j
||q^|jdur|jD]}|j|q|
|jdS)Nr)new_compiler)rdry_runr)rrr&rr'rrrZset_include_dirsrZdefine_macrorZundefine_macrobuild_libraries)rr&namevalueZmacror	r	r
run^s"




zbuild_clib.runcCst|tstd|D]z}t|ts8t|dkr8td|\}}t|tsRtdd|vsntjdkr~tj|vr~td|dt|tstdqd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuplesz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r listDistutilsSetupErrortuplelenr!r#sepdict)rrlibr)
build_infor	r	r
rvs,



zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}||q|S)N)rappend)rZ	lib_nameslib_namer5r	r	r
get_library_namesszbuild_clib.get_library_namescCsZ||jg}|jD]>\}}|d}|dus>t|ttfsJtd|||q|S)Nsourcesfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rrgetr r.r0r/extend)r	filenamesr7r5r9r	r	r
get_source_filess
zbuild_clib.get_source_filescCs|D]\}}|d}|dus,t|ttfs8td|t|}td||d}|d}|jj||j	|||j
d}|jj|||j|j
dqdS)Nr9r:zbuilding '%s' librarymacrosr)
output_dirr?rr)r@r)
r;r r.r0r/rinforcompilerrZcreate_static_libr)rrr7r5r9r?rZobjectsr	r	r
r(s,


	
zbuild_clib.build_libraries)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrhelp_optionsrr%r+rr8r>r(r	r	r	r
rs
$r)__doc__r#distutils.corerdistutils.errorsdistutils.sysconfigr	distutilsrrrr	r	r	r
sPK!_3_distutils/command/__pycache__/clean.cpython-39.pycnu[a

(Re
@sDdZddlZddlmZddlmZddlmZGdddeZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.N)Command)remove_tree)logc@s6eZdZdZgdZdgZddZddZdd	Zd
S)cleanz-clean up temporary files from 'build' command))zbuild-base=bz2base build directory (default: 'build.build-base'))z
build-lib=Nzs
PK!r$66>_distutils/command/__pycache__/install_egg_info.cpython-39.pycnu[a

(Re+
@sddZddlmZddlmZmZddlZddlZddlZGdddeZ	ddZ
d	d
ZddZdS)
zdistutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.)Command)logdir_utilNc@s:eZdZdZdZdgZddZddZdd	Zd
dZ	dS)
install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=dzdirectory to install tocCs
d|_dSN)install_dirselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsd|dddtt|jtt|jgtjddR}t	j
|j||_
|j
g|_dS)Ninstall_lib)rrz%s-%s-py%d.%d.egg-info)set_undefined_optionsto_filename	safe_namedistributionget_namesafe_versionget_versionsysversion_infoospathjoinrtargetoutputs)r
basenamerrrfinalize_optionssz!install_egg_info.finalize_optionscCs|j}tj|r0tj|s0tj||jdnNtj|rV|	tj
|jfd|n(tj|js~|	tj|jfd|jt
d||jst|ddd}|jj|Wdn1s0YdS)N)dry_runz	Removing z	Creating z
Writing %swzUTF-8)encoding)rrrisdirislinkrremove_treer existsexecuteunlinkrmakedirsrinfoopenrmetadatawrite_pkg_file)r
rfrrrrun szinstall_egg_info.runcCs|jSr)rr	rrrget_outputs.szinstall_egg_info.get_outputsN)
__name__
__module____qualname____doc__descriptionuser_optionsr
rr/r0rrrrrs
rcCstdd|S)zConvert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    [^A-Za-z0-9.]+-)resubnamerrrr6srcCs|dd}tdd|S)zConvert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
     .r7r8)replacer9r:)versionrrrr>srcCs|ddS)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r8_)r?r;rrrrHsr)
r4
distutils.cmdr	distutilsrrrrr9rrrrrrrrs+
PK!&T=_distutils/command/__pycache__/install_headers.cpython-39.pycnu[a

(Re@s$dZddlmZGdddeZdS)zdistutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.)Commandc@sFeZdZdZddgZdgZddZddZd	d
ZddZ	d
dZ
dS)install_headerszinstall C/C++ header files)zinstall-dir=dz$directory to install header files to)forcefz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)install_dirroutfilesselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/install_headers.pyinitialize_optionssz"install_headers.initialize_optionscCs|ddddS)Ninstall)rr)rr)set_undefined_optionsr	rrrfinalize_optionssz install_headers.finalize_optionscCsH|jj}|sdS||j|D]"}|||j\}}|j|q dSN)distributionheadersmkpathr	copy_filerappend)r
rheaderout_rrrrun!szinstall_headers.runcCs|jjp
gSr)rrr	rrr
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrrget_outputs.szinstall_headers.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsr
rrrrrrrrr
s
rN)__doc__distutils.corerrrrrrsPK!nSN(N(4_distutils/command/__pycache__/config.cpython-39.pycnu[a

(Re=3@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	ZGd
ddeZddd
Z
dS)adistutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c@seZdZdZgdZddZddZddZd	d
ZddZ	d
dZ
ddZddZddZ
d(ddZd)ddZd*ddZd+ddZd,dd Zd-d"d#Zdddgfd$d%Zd.d&d'ZdS)/configzprepare to build)	)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link with)z
library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N)compilerccinclude_dirs	librarieslibrary_dirsr
dump_source
temp_filesselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/config.pyinitialize_options3szconfig.initialize_optionscCs|jdur|jjpg|_nt|jtr6|jtj|_|jdurHg|_nt|jtr^|jg|_|jdurpg|_nt|jtr|jtj|_dSN)	rdistribution
isinstancestrsplitospathseprrrrrrfinalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrrrunRsz
config.runcCszddlm}m}t|j|sv||j|jdd|_t|j|jrN|j|j|j	rb|j
|j	|jrv|j|jdS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)	CCompilernew_compilerr)rdry_runforceN)
distutils.ccompilerr$r%rrr&rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr$r%rrr_check_compilerYs
zconfig._check_compilercCsdt|}t|dV}|r>|D]}|d|q |d|||ddkr^|dWdn1sr0Y|S)NZ_configtestwz#include <%s>

)LANG_EXTopenwrite)rbodyheaderslangfilenamefileheaderrrr_gen_temp_sourcefileks

(zconfig._gen_temp_sourcefilecCs<||||}d}|j||g|jj|||d||fS)Nz
_configtest.ir)r6rextendr
preprocess)rr0r1rr2srcoutrrr_preprocessws
zconfig._preprocesscCs\||||}|jr"t|d||j|g\}|j||g|jj|g|d||fS)Nzcompiling '%s':r7)r6r	dump_filerZobject_filenamesrr8compile)rr0r1rr2r:objrrr_compile~szconfig._compilec
Csr|||||\}}tjtj|d}	|jj|g|	|||d|jjdur\|	|jj}	|j	|	|||	fS)Nr)rrZtarget_lang)
r@r pathsplitextbasenamerZlink_executableZ
exe_extensionrappend)
rr0r1rrrr2r:r?progrrr_linkszconfig._linkc	GsR|s|j}g|_tdd||D]&}zt|Wq&tyJYq&0q&dS)Nzremoving: %s )rrinfojoinr removeOSError)r	filenamesr3rrr_cleansz
config._cleanNrcCsPddlm}|d}z|||||Wn|yBd}Yn0||S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        rCompileErrorTF)r(rOr)r<rMrr0r1rr2rOokrrrtry_cpps
zconfig.try_cppcCs||||||\}}t|tr0t|}t|8}d}	|}
|
dkrPqb||
r>d}	qbq>Wdn1sv0Y|	|	S)aConstruct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        FTN)
r)r<rrrer>r.readlinesearchrM)rpatternr0r1rr2r:r;r4matchlinerrr
search_cpps	



"zconfig.search_cppcCsbddlm}|z|||||d}Wn|yBd}Yn0t|rPdpRd||S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrNTFsuccess!failure.)r(rOr)r@rrHrMrPrrrtry_compiles
zconfig.try_compilec
	Csnddlm}m}|z|||||||d}	Wn||fyNd}	Yn0t|	r\dp^d||	S)zTry to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        rrO	LinkErrorTFr[r\)r(rOr_r)rFrrHrM)
rr0r1rrrr2rOr_rQrrrtry_links

zconfig.try_linkc

Csddlm}m}|z.|||||||\}	}
}||gd}Wn||tfybd}Yn0t|rpdprd|	|S)zTry to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rr^TFr[r\)
r(rOr_r)rFspawnrrrHrM)
rr0r1rrrr2rOr_r:r?ZexerQrrrtry_runs


zconfig.try_runrc	Cst|g}|r|d||d|r<|d|n|d||dd|d}||||||S)aDetermine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;}r+)r)rDrIr`)	rfuncr1rrrdeclcallr0rrr
check_funcs


zconfig.check_funccCs ||d|||g||S)aDetermine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r)r`)rlibraryrr1rZother_librariesrrr	check_lib4s


zconfig.check_libcCs|jd|g|dS)zDetermine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r0r1r)rR)rr5rrr2rrrcheck_headerBs
zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)__name__
__module____qualname__descriptionuser_optionsrr"r#r)r6r<r@rFrMrRrZr]r`rbrgrirjrrrrrs>	






rcCsR|durtd|n
t|t|}zt|W|n
|0dS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrHr.readclose)r3headr4rrrr=Ks
r=)N)__doc__r rTdistutils.corerdistutils.errorsrdistutils.sysconfigr	distutilsrr-rr=rrrrs
8PK!c=_distutils/command/__pycache__/install_scripts.cpython-39.pycnu[a

(Re@sDdZddlZddlmZddlmZddlmZGdddeZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.N)Command)log)ST_MODEc@sHeZdZdZgdZddgZddZddZd	d
ZddZ	d
dZ
dS)install_scriptsz%install scripts (Python or otherwise)))zinstall-dir=dzdirectory to install scripts to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)install_dirr	build_dir
skip_buildselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/install_scripts.pyinitialize_optionssz"install_scripts.initialize_optionscCs |dd|dddddS)Nbuild)
build_scriptsrinstall)rr)rr)r
r
)set_undefined_optionsrrrrfinalize_options!sz install_scripts.finalize_optionscCs|js|d||j|j|_tjdkr~|D]H}|j	rLt
d|q4t|t
dBd@}t
d||t||q4dS)Nrposixzchanging mode of %simizchanging mode of %s to %o)r
run_command	copy_treerroutfilesosnameget_outputsdry_runrinfostatrchmod)rfilemoderrrrun)s

zinstall_scripts.runcCs|jjp
gSN)distributionscriptsrrrr
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr&)rrrrrr;szinstall_scripts.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrr%r)rrrrrrsr)	__doc__rdistutils.corer	distutilsrr!rrrrrrs
PK!$&&6_distutils/command/__pycache__/build_py.cpython-39.pycnu[a

(Reo@@sddZddlZddlZddlZddlZddlmZddlTddl	m
Z
ddlmZGdddeZ
dS)	zHdistutils.command.build_py

Implements the Distutils 'build_py' command.N)Command)*)convert_path)logc@seZdZdZgdZddgZddiZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZddZddZddZd d!Zd.d#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-S)/build_pyz5"build" pure Python modules (copy to build directory)))z
build-lib=dzdirectory to "build" (copy) to)compileczcompile .py to .pyc)
no-compileNz!don't compile .py files [default])z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz2forcibly build everything (ignore file timestamps)rrr
cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	build_lib
py_modulespackagepackage_datapackage_dirroptimizerselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_py.pyinitialize_options szbuild_py.initialize_optionsc	Cs|ddd|jj|_|jj|_|jj|_i|_|jjr^|jjD]\}}t||j|<qF||_	t
|jtsz,t|j|_d|jkrdksnJWnt
tfytdYn0dS)Nbuild)rr)rrrzoptimize must be 0, 1, or 2)set_undefined_optionsdistributionpackagesrrritemsrget_data_files
data_files
isinstancerint
ValueErrorAssertionErrorDistutilsOptionError)rnamepathrrrfinalize_options*s$



 zbuild_py.finalize_optionscCs:|jr||jr$||||jdddS)Nr)include_bytecode)r
build_modulesrbuild_packagesbuild_package_databyte_compileget_outputsrrrrrunCszbuild_py.runcsg}|js|S|jD]h}||}tjj|jg|d}d|rPt|dfdd|||D}|	||||fq|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples.rcsg|]}|dqSNr).0fileplenrr
ssz+build_py.get_data_files..)
rget_package_dirosr'joinrsplitlenfind_data_filesappend)rdatarsrc_dir	build_dir	filenamesrr5rras



zbuild_py.get_data_filescsd|jdg|j|g}g|D]:}ttjt|t|}fdd|Dq$S)z6Return filenames for package's data files in 'src_dir'cs$g|]}|vrtj|r|qSr)r9r'isfile)r3fnfilesrrr7sz,build_py.find_data_files..)	rgetglobr9r'r:escaperextend)rrr@ZglobspatternfilelistrrFrr=yszbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj||}|tj||jtj|||ddqq
dS)z$Copy data files into build directoryNF
preserve_mode)r r9r'r:mkpathdirname	copy_file)rZlastdirrr@rArBfilenametargetrrrr,szbuild_py.build_package_datacCs|d}|js&|r tjj|SdSng}|rz|jd|}Wn(tyj|d|d|d=Yq*0|d|tjj|Sq*|jd}|dur|d||rtjj|SdSdS)zReturn the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r0rCrN)r;rr9r'r:KeyErrorinsertrH)rrr'tailZpdirrrrr8s(
	zbuild_py.get_package_dircCsj|dkr8tj|s td|tj|s8td||rftj|d}tj|rZ|Std|dS)NrCz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r9r'existsDistutilsFileErrorisdirr:rDrwarn)rrrinit_pyrrr
check_packages&zbuild_py.check_packagecCs&tj|std||dSdSdS)Nz!file %s (for module %s) not foundFT)r9r'rDrr\)rmodulemodule_filerrrcheck_moduleszbuild_py.check_modulec	Cs|||ttjt|d}g}tj|jj}|D]P}tj|}||krtj	tj
|d}||||fq>|d|q>|S)Nz*.pyrzexcluding %s)
r^rIr9r'r:rJabspathrscript_namesplitextbasenamer>debug_print)	rrrZmodule_filesmodulesZsetup_scriptr
Zabs_fr_rrrfind_package_modulesszbuild_py.find_package_modulesc	Csi}g}|jD]}|d}d|dd}|d}z||\}}Wn tyf||}d}Yn0|s|||}	|df||<|	r||d|	ftj||d}
|	||
sq||||
fq|S)aFinds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r0rrUr1__init__.py)
rr;r:rVr8r^r>r9r'ra)rrrgr_r'rZmodule_basercheckedr]r`rrrfind_moduless*



zbuild_py.find_modulescCsNg}|jr|||jrJ|jD]$}||}|||}||q$|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrKrlrr8rh)rrgrrmrrrfind_all_moduless

zbuild_py.find_all_modulescCsdd|DS)NcSsg|]}|dqS)rUr)r3r_rrrr7-z-build_py.get_source_files..)rnrrrrget_source_files,szbuild_py.get_source_filescCs$|gt||dg}tjj|S)Nrj)listr9r'r:)rrArr_Zoutfile_pathrrrget_module_outfile/szbuild_py.get_module_outfiler1cCs|}g}|D]p\}}}|d}||j||}|||r|jr^|tjj|dd|j	dkr|tjj||j	dq|dd|j
D7}|S)Nr0rC)optimizationrcSs,g|]$\}}}}|D]}tj||qqSr)r9r'r:)r3rr@rArBrSrrrr7Bs
z(build_py.get_outputs..)rnr;rrrr>r	importlibutilcache_from_sourcerr )rr)rgoutputsrr_r`rSrrrr.3s&





zbuild_py.get_outputscCsbt|tr|d}nt|ttfs,td||j||}tj	
|}|||j||ddS)Nr0z:'package' must be a string (dot-separated), list, or tuplerrN)
r!strr;rqtuple	TypeErrorrrrr9r'rQrPrR)rr_r`routfiledirrrrbuild_moduleJs

zbuild_py.build_modulecCs*|}|D]\}}}||||qdSr2)rlr})rrgrr_r`rrrr*Yszbuild_py.build_modulescCsP|jD]D}||}|||}|D]$\}}}||ks:J||||q$qdSr2)rr8rhr})rrrrgZpackage_r_r`rrrr+bs


zbuild_py.build_packagescCstjr|ddSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d|jdkr||||j|j	||j
ddS)Nz%byte-compiling is disabled, skipping.r)r-rU)rrprefixdry_run)sysdont_write_bytecoder\distutils.utilr-rr9seprrrr)rrGr-r~rrrr-vs




zbuild_py.byte_compileN)r1)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr(r/rr=r,r8r^rarhrlrnrprrr.r}r*r+r-rrrrrs.



'4
	r)__doc__r9importlib.utilrtrrIdistutils.corerdistutils.errorsrr	distutilsrrrrrrsPK!]	uW	W	:_distutils/command/__pycache__/install_data.cpython-39.pycnu[a

(Re@s<dZddlZddlmZddlmZmZGdddeZdS)zdistutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.N)Command)change_rootconvert_pathc@sFeZdZdZgdZdgZddZddZdd	Zd
dZ	dd
Z
dS)install_datazinstall data files))zinstall-dir=dzIbase directory for installing data files (default: installation base dir))zroot=NzsPK!!DD9_distutils/command/__pycache__/install_lib.cpython-39.pycnu[a

(Re @sLdZddlZddlZddlZddlmZddlmZdZ	GdddeZ
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).N)Command)DistutilsOptionErrorz.pyc@sxeZdZdZgdZgdZddiZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZdS)install_libz7install all Python modules (extensions and pure Python)))zinstall-dir=dzdirectory to install to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default])
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])
skip-buildNzskip the build steps)rr	r
rr	cCs(d|_d|_d|_d|_d|_d|_dS)Nr)install_dir	build_dirrr	optimize
skip_buildselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_options3szinstall_lib.initialize_optionsc	Cs|ddddddd|jdur&d|_|jdur6d	|_t|jtszt|j|_|jd
vr^tWnttfy~tdYn0dS)Ninstall)	build_libr)rr)rr)r	r	)rr)rrTF)rzoptimize must be 0, 1, or 2)set_undefined_optionsr	r
isinstanceintAssertionError
ValueErrorrrrrrfinalize_options<s&	


zinstall_lib.finalize_optionscCs0||}|dur,|jr,||dSN)buildrdistributionhas_pure_modulesbyte_compilerZoutfilesrrrrunVszinstall_lib.runcCs2|js.|jr|d|jr.|ddS)Nbuild_py	build_ext)rr#r$run_commandhas_ext_modulesrrrrr"fs



zinstall_lib.buildcCs8tj|jr ||j|j}n|d|jdS|S)Nz3'%s' does not exist -- no Python modules to install)ospathisdirr	copy_treerwarnr&rrrrmszinstall_lib.installcCsrtjr|ddSddlm}|dj}|jrH||d|j||j	d|j
dkrn|||j
|j||j|j	ddS)Nz%byte-compiling is disabled, skipping.r)r%r)rrprefixdry_run)rrr1verboser2)sysdont_write_bytecoder0distutils.utilr%get_finalized_commandrootr	rr2rr3)rfilesr%Zinstall_rootrrrr%vs

zinstall_lib.byte_compilec
	Csd|sgS||}|}t||}t|ttj}g}|D] }	|tj||	|dq>|Sr!)	r7get_outputsgetattrlenr,sepappendr-join)
rZhas_anyZ	build_cmdZ
cmd_option
output_dirZbuild_filesr
prefix_lenoutputsfilerrr_mutate_outputss

zinstall_lib._mutate_outputscCsrg}|D]d}tjtj|d}|tkr.q|jrJ|tjj	|dd|j
dkr|tjj	||j
dq|S)Nr)optimizationr)r,r-splitextnormcasePYTHON_SOURCE_EXTENSIONr	r>	importlibutilcache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileextrrr_bytecode_filenamess



zinstall_lib._bytecode_filenamescCsR||jdd|j}|jr*||}ng}||jdd|j}|||S)zReturn the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r(rr))rDr#r$rr	rNr+)rZpure_outputsZbytecode_outputsZext_outputsrrrr:szinstall_lib.get_outputscCsLg}|jr&|d}|||jrH|d}|||S)zGet the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r(r))r#r$r7extendr:r+)rinputsr(r)rrr
get_inputss



zinstall_lib.get_inputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr r'r"rr%rDrNr:rQrrrrrs		r)__doc__r,importlib.utilrJr4distutils.corerdistutils.errorsrrIrrrrrsPK!|4j6j65_distutils/command/__pycache__/install.cpython-39.pycnu[a

(Rek
@s:dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZddddddZddddddddddddedddddddddddddZer"dddd d!ded"<ddd#d$d!ded%<dZGd&d'd'eZdS)(zFdistutils.command.install

Implements the Distutils 'install' command.N)log)Command)DEBUG)get_config_vars)DistutilsPlatformError)
write_file)convert_path
subst_varschange_root)get_platform)DistutilsOptionError)	USER_BASE)	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)purelibplatlibheadersscriptsdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name)unix_prefix	unix_homentpypypypy_ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbasent_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin	unix_userc@seZdZdZgdZgdZer>edddefedddiZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3efd4efd5efd6efd7d8d9fgZdS):installz'install everything from build directory))zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nzfinalize_optionss














	
zinstall.finalize_optionscCstsdSddlm}t|d|jD]r}|d}|ddkrL|dd}||jvrx|j|}||}t||}n||}t||}td||q(dS)zDumps the list of user options.Nr)
longopt_xlate:=z  %s: %s)	rdistutils.fancy_getoptrurdebuguser_optionsnegative_opt	translaterd)r<msgruoptopt_namevalr=r=r>rXs





zinstall.dump_dirscCs"|jdus|jdur\|jdur2|jdur2|jdusP|jdusP|jdusP|jdurXtddS|j	r|j
durttd|j
|_|_|dn|j
dur|j
|_|_|dnl|jdur|jdurtdtjtj|_tjtj|_n|jdur|j|_|j|_|j|_|ddS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)r(r)r.r+r,r-r/r0rr#r1r
select_schemer'r%r&rUronormpathr[r;r=r=r>rYsL




zinstall.finalize_unixcCs|jr8|jdurtd|j|_|_|tjdn~|jdur\|j|_|_|dnZ|j	durvtj
tj	|_	|j	|_|_z|tjWn t
ytdtjYn0dS)z)Finalizes options for non-posix platformsNr_userrz)I don't know how to install stuff on '%s')r#r1rr(r)rrUrVr'r%rorr[KeyErrorr;r=r=r>rZs&


zinstall.finalize_othercCsnttdr2tjdkr2|ds2tjdkr.d}nd}t|}tD]*}d|}t||dur>t	||||q>dS)	z=Sets the install directories by applying the install schemes.pypy_version_info))r_homerrrinstall_N)
hasattrr[rcendswithrUrVINSTALL_SCHEMESSCHEME_KEYSrdsetattr)r<rVschemekeyattrnamer=r=r>rs

zinstall.select_schemecCsX|D]N}t||}|durtjdks.tjdkr:tj|}t||j}t|||qdS)Nr@r)rdrUrVro
expanduserr	rer)r<attrsattrrr=r=r>
_expand_attrss
zinstall._expand_attrscCs|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)r(r)r*Nrr;r=r=r>rgszinstall.expand_basedirscCs|gddS)z+Calls `os.path.expanduser` on install dirs.)r+r,r.r-r/r0Nrr;r=r=r>riszinstall.expand_dirscGs,|D]"}d|}t||tt||qdS)z!Call `convert_path` over `names`.rN)rrrdr<namesrVrr=r=r>rlszinstall.convert_pathscCs|jdur|jj|_|jdurtdt|jtrB|jd|_t|jdkr`|jd}}n"t|jdkrz|j\}}ntdt	|}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,r$rrBzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrA)r4r_rrW
isinstancestrr]lenrr	path_filerq)r<rrqr=r=r>rms(



zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||qdS)z:Change the install directories pointed by name using root.rN)rr
r*rdrr=r=r>rr!szinstall.change_rootscCsb|js
dSttjd}|jD]8\}}||r$tj|s$|	d|t
|dq$dS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)r#rrUrorreitems
startswithisdirdebug_printmakedirs)r<r'rVror=r=r>rj'szinstall.create_home_pathcCs"|js6|d|jdj}|jr6|tkr6td|D]}||q>|j	r\|
|jr|}|j
rt|j
}tt|D]}|||d||<q|t|j|fd|jttjjtj}ttjj|}tjtj|j}|jr|j	r|js||vrtd|jdS)zRuns the command.rTz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r6run_commandr_get_command_obj	plat_namer7rrget_sub_commandsrcreate_path_filer:get_outputsr*rrangeexecutermaprUrorr[normcaser.r5rrz)r<
build_platcmd_nameoutputsroot_lencountersys_pathr.r=r=r>run3sD

zinstall.runcCsJtj|j|jd}|jr8|t||jgfd|n|	d|dS)zCreates the .pth file.pthzcreating %szpath file '%s' not createdN)
rUrorprnrr5rrrqrW)r<filenamer=r=r>r_s

zinstall.create_path_filecCshg}|D].}||}|D]}||vr"||q"q|jrd|jrd|tj|j	|jd|S)z.Assembles the outputs of all the sub-commands.r)
rget_finalized_commandrappendrr5rUrorprn)r<rrcmdrr=r=r>rms
zinstall.get_outputscCs.g}|D]}||}||q|S)z*Returns the inputs of all the sub-commands)rrextend
get_inputs)r<inputsrrr=r=r>r~s

zinstall.get_inputscCs|jp|jS)zSReturns true if the current distribution has any Python
        modules to install.)r_has_pure_modulesrkr;r=r=r>has_libs
zinstall.has_libcCs
|jS)zLReturns true if the current distribution has any headers to
        install.)r_has_headersr;r=r=r>rszinstall.has_headerscCs
|jS)zMReturns true if the current distribution has any scripts to.
        install.)r_has_scriptsr;r=r=r>rszinstall.has_scriptscCs
|jS)zJReturns true if the current distribution has any data to.
        install.)r_has_data_filesr;r=r=r>has_dataszinstall.has_datar.r-r/r0install_egg_infocCsdS)NTr=r;r=r=r>zinstall.) __name__
__module____qualname__descriptionr{boolean_optionsrfrrr|r?rtrXrYrZrrrgrirlrmrrrjrrrrrrrrsub_commandsr=r=r=r>rWsJ;
N(	",
r)__doc__r[rU	distutilsrdistutils.corerdistutils.debugrdistutils.sysconfigrdistutils.errorsrdistutils.file_utilrdistutils.utilrr	r
rrsiter
rrfWINDOWS_SCHEMErrrr=r=r=r>sz
!
	
PK!fo!o!6_distutils/command/__pycache__/register.cpython-39.pycnu[a

(Re-@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGddde	Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
N)warn)
PyPIRCCommand)*)logc@seZdZdZejddgZejgdZdddfgZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZdddZdS)registerz7register the distribution with the Python package index)list-classifiersNz list the valid Trove classifiers)strictNzBWill stop the registering if the meta-data are not fully compliant)verifyrrcheckcCsdS)NTselfrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/register.pyzregister.cCst|d|_d|_dS)Nr)rinitialize_optionslist_classifiersrrrrrrs
zregister.initialize_optionscCs*t|d|jfdd}||jjd<dS)Nr)r)rrestructuredtextr
)rfinalize_optionsrdistributioncommand_options)r

check_optionsrrrr$s

zregister.finalize_optionscCsT|||D]}||q|jr8|n|jrH|n|dS)N)	r_set_configget_sub_commandsrun_commanddry_runverify_metadatarclassifiers
send_metadata)r
cmd_namerrrrun+s

zregister.runcCs8tdt|jd}||j|_d|_|dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)rPendingDeprecationWarningrget_command_objensure_finalizedrrr!)r
r
rrrcheck_metadata:szregister.check_metadatacCsz|}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfvr^td|j|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        usernamepassword
repositoryrealmTpypiz%s not found in .pypircFN)_read_pypircr&r'r(r)
has_configDEFAULT_REPOSITORY
ValueError)r
configrrrrDs




zregister._set_configcCs*|jd}tj|}t||dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r(urllibrequesturlopenrinfo_read_pypi_response)r
urlresponserrrrUs
zregister.classifierscCs&||d\}}td||dS)zF Send the metadata to the package index server to be checked.
        r	Server response (%s): %sN)post_to_serverbuild_post_datarr3)r
coderesultrrrr\szregister.verify_metadatac
Cs|jrd}|j}|j}nd}d}}d}||vrd|dtjt}|sRd}q,||vr,tdq,|dkrl|s|td}qn|st		d}q|t
j}t
j
|jd	}||j|||||d
|\}}|d||ftj|dkr|jr||j_nf|d
tj|d|tjd}|dvrNtd}|s*d}q*|dkr|||nl|dkrddi}	d|	d<|	d<|	d<d|	d<|	dstd|	d<q|	d|	dkr0|	dst		d|	d<q|	dst		d|	d<q|	d|	dkrd|	d<d|	d<tdq|	dsJtd|	d<q0||	\}}|dkrrtd||ntdtd nP|d!krdd"i}	d|	d<|	dstd#|	d<q||	\}}td||dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        1xz1 2 3 4zWe need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rsubmitr7zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)XZynzSave your login (y/N)?ny2:actionusernamer'emailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.3Zpassword_resetzYour email address: )r,r&r'splitannouncerINFOinputprintgetpassr0r1HTTPPasswordMgrparseurlparser(add_passwordr)r8r9r_get_rc_filelower
_store_pypircr3)
r
choicer&r'choicesauthhostr:r;datarrrrcs














zregister.send_metadatacCs|jj}|d||||||||	|
|||
|||d}|ds|ds|drd|d<|S)Nz1.0)rEmetadata_versionrGversionsummaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformrdownload_urlprovidesrequires	obsoletesrfrgrhz1.1r\)rmetadataget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes)r
actionmetar[rrrr9s,zregister.build_post_dataNc
Csd|vr$|d|d|jftjd}d|}|d}t}|D]~\}}t|tgtdfvrn|g}|D]R}t|}|	||	d||	d|	||rr|d	d
krr|	dqrqH|	||	d|
d}d
|tt|d}	t
j|j||	}
t
jt
jj|d}d}z||
}Wn|t
jjy}
z*|jrb|
j}|
j|
jf}WYd}
~
nTd}
~
0t
jjy}
zdt|
f}WYd}
~
n d}
~
00|jr||}d}|jrdd|df}||tj|S)zC Post a query to the server, and return a string response.
        rGzRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z



zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)password_mgrr>Ni)r@OKzK---------------------------------------------------------------------------)rKr(rrLioStringIOitemstypestrwritegetvalueencodelenr0r1Requestbuild_openerHTTPBasicAuthHandleropenerror	HTTPError
show_responsefpreadr:msgURLErrorr4join)r
r[rYboundaryZsep_boundaryZend_boundarybodykeyvalueheadersreqopenerr;errrrr8s^






 "
zregister.post_to_server)N)__name__
__module____qualname__rbruser_optionsboolean_optionssub_commandsrrr!r%rrrrr9r8rrrrrs"
zr)__doc__rOrurllib.parser0urllib.requestwarningsrdistutils.corerdistutils.errors	distutilsrrrrrrsPK!,EE6_distutils/command/__pycache__/__init__.cpython-39.pycnu[a

(Re@sdZgdZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.)buildbuild_py	build_ext
build_clib
build_scriptscleaninstallinstall_libinstall_headersinstall_scriptsinstall_datasdistregisterbdist
bdist_dumb	bdist_rpm
bdist_wininstcheckuploadN)__doc____all__rr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/__init__.pysPK!Q;_distutils/command/__pycache__/build_scripts.cpython-39.pycnu[a

(ReK@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddlm
Z
ddlZed	ZGd
ddeZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.N)ST_MODE)	sysconfig)Command)newer)convert_path)logs^#!.*python[0-9.]*([ 	].*)?$c@sFeZdZdZgdZdgZddZddZdd	Zd
dZ	dd
Z
dS)
build_scriptsz("build" scripts (copy and fixup #! line)))z
build-dir=dzdirectory to "build" (copy) to)forcefz1forcibly build everything (ignore file timestamps)zexecutable=ez*specify final destination interpreter pathr
cCs"d|_d|_d|_d|_d|_dSN)	build_dirscriptsr

executableoutfilesselfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_scripts.pyinitialize_optionss
z build_scripts.initialize_optionscCs|dddd|jj|_dS)Nbuild)rr)r
r
)rr)set_undefined_optionsdistributionrrrrrfinalize_options%szbuild_scripts.finalize_optionscCs|jSr
)rrrrrget_source_files,szbuild_scripts.get_source_filescCs|js
dS|dSr
)rcopy_scriptsrrrrrun/szbuild_scripts.runc	Cs||jg}g}|jD],}d}t|}tj|jtj|}|||j	slt
||sltd|qzt
|d}Wnty|jsd}YnX0t|j\}}|d|}	|	s|d|qt|	}
|
rd}|
dpd	}|r$td
||j|||jstjs(|j}n(tjtddtd
tdf}t|}d||d}
z|
dWn"tyt d!|
Yn0z|
|Wn$tyt d!|
|Yn0t
|d(}|"|
|#|$Wdn1s
0Y|rH|%q|r2|%|||&||qtj'dkr|D]`}|jrttd|nDt(|t)d@}|dBd@}||krZtd|||t*||qZ||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)rbNrz%s is an empty file (skipping)Tzcopying and adjusting %s -> %sBINDIRz
python%s%sVERSIONEXEs#!
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})wbposixzchanging mode of %siimz!changing mode of %s from %o to %o)+mkpathrrrospathjoinbasenameappendr
rrdebugopenOSErrordry_runtokenizedetect_encodingreadlineseekwarn
first_line_rematchgroupinforpython_buildrget_config_varfsencodedecodeUnicodeDecodeError
ValueErrorformatwrite
writelines	readlinesclose	copy_filenamestatrchmod)rrZ
updated_filesscriptadjustoutfilerencodinglines
first_liner7post_interprshebangoutffileZoldmodeZnewmoderrrr5s









.


zbuild_scripts.copy_scriptsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrrrrrrrrrsr)__doc__r(rerGr	distutilsrdistutils.corerdistutils.dep_utilrdistutils.utilrrr1compiler6rrrrrs
PK!883_distutils/command/__pycache__/sdist.cpython-39.pycnu[a

(Re=J@sdZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZddZGdddeZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).N)glob)warn)Command)dir_util)	file_util)archive_util)TextFile)FileList)log)convert_path)DistutilsTemplateErrorDistutilsOptionErrorcCs`ddlm}ddlm}g}|D] }|d|d||dfq$|||ddS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)FancyGetopt)ARCHIVE_FORMATSformats=Nz.List of available source distribution formats:)distutils.fancy_getoptrZdistutils.archive_utilrkeysappendsort
print_help)rrformatsformatr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/sdist.pyshow_formatss
rc@seZdZdZddZgdZgdZdddefgZd	d
dZ	defgZ
d
ZddZddZ
ddZddZddZddZeddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Z d6d7Z!d8d9Z"dS):sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)metadata_checkselfrrrchecking_metadata(szsdist.checking_metadata))z	template=tz5name of manifest template file [default: MANIFEST.in])z	manifest=mz)name of manifest file [default: MANIFEST])use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])no-defaultsNz"don't include the default file set)pruneNzspecifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])no-pruneNz$don't automatically exclude anything)
manifest-onlyozEjust regenerate the manifest and then stop (implies --force-manifest))force-manifestfzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r#r%r'r)r+r.zhelp-formatsNz#list available distribution formatsr#r%)r$r&check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)Nrgztar)
templatemanifestuse_defaultsr%
manifest_onlyZforce_manifestr	keep_tempdist_dir
archive_filesrownergrouprrrrinitialize_optionseszsdist.initialize_optionscCsZ|jdurd|_|jdur d|_|dt|j}|rFtd||jdurVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'dist)r5r4ensure_string_listrcheck_archive_formatsrr
r9)rZ
bad_formatrrrfinalize_options|s



zsdist.finalize_optionscCs>t|_|D]}||q||jr2dS|dSN)r	filelistget_sub_commandsrun_command
get_file_listr7make_distribution)rcmd_namerrrrunsz	sdist.runcCs*tdt|jd}||dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr1N)rPendingDeprecationWarningdistributionget_command_objensure_finalizedrI)rr1rrrcheck_metadataszsdist.check_metadatacCstj|j}|s:|r:||j|jdS|sN|	d|j|j
|jrf||rr|
|jr||j|j|dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))ospathisfiler4_manifest_is_not_generated
read_manifestrCrZremove_duplicatesrfindallr6add_defaults
read_templater%prune_file_listwrite_manifest)rZtemplate_existsrrrrFs(




zsdist.get_file_listcCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scriptsrrrrrUszsdist.add_defaultscCs:tj|sdStj|}tj|\}}|t|vS)z
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rOrPexistsabspathsplitlistdir)fspathra	directoryfilenamerrr_cs_path_existss

zsdist._cs_path_existscCs|j|jjg}|D]~}t|trj|}d}|D]"}||r,d}|j|qPq,|s|dd	|q||r|j|q|d|qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
READMESrKscript_name
isinstancetuplergrCrrjoin)rZ	standardsfnZaltsZgot_itrrrrYs"


zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|}|j|qdS)Nz
test/test*.pyz	setup.cfg)filterrOrPrQrrCextend)roptionalpatternfilesrrrrZszsdist._add_defaults_optionalcCs\|d}|jr$|j||jD],\}}}}|D]}|jtj	
||q:q*dS)Nbuild_py)get_finalized_commandrKhas_pure_modulesrCroget_source_files
data_filesrrOrPrl)rrspkgsrc_dir	build_dir	filenamesrfrrrr[s

zsdist._add_defaults_pythoncCsz|jrv|jjD]b}t|trBt|}tj|rt|j	
|q|\}}|D]$}t|}tj|rN|j	
|qNqdSrB)rKhas_data_filesrwrjstrrrOrPrQrCr)ritemdirnamer{r*rrrr\$s

zsdist._add_defaults_data_filescCs(|jr$|d}|j|dS)N	build_ext)rKhas_ext_modulesrtrCrorv)rrrrrr]5s

zsdist._add_defaults_extcCs(|jr$|d}|j|dS)N
build_clib)rKhas_c_librariesrtrCrorv)rrrrrr^:s

zsdist._add_defaults_c_libscCs(|jr$|d}|j|dS)N
build_scripts)rKhas_scriptsrtrCrorv)rrrrrr_?s

zsdist._add_defaults_scriptsc
Cstd|jt|jddddddd}zr|}|dur:qz|j|Wq(ttfy}z$|	d|j
|j|fWYd}~q(d}~00q(W|n
|0dS)zRead and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r2)strip_commentsskip_blanks
join_lines	lstrip_ws	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
infor4rreadlinerCprocess_template_liner
ValueErrorrrfcurrent_lineclose)rr4linemsgrrrrVDs"

"zsdist.read_templatecCsz|d}|j}|jjd|jd|jjd|dtjdkrFd}nd}gd}d|d	||f}|jj|d
ddS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        buildN)prefixwin32z/|\\/)RCSCVSz\.svnz\.hgz\.gitz\.bzr_darcsz(^|%s)(%s)(%s).*|r2)Zis_regex)	rtrKget_fullnamerCZexclude_pattern
build_basesysplatformrl)rrbase_dirsepsZvcs_dirsZvcs_ptrnrrrrWas


zsdist.prune_file_listcCsX|rtd|jdS|jjdd}|dd|tj	|j|fd|jdS)zWrite the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rRr
rr5rCrrinsertexecuter
write_file)rcontentrrrrXyszsdist.write_manifestcCsDtj|jsdSt|j}z|}W|n
|0|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rOrPrQr5openrr)rfp
first_linerrrrRs

z sdist._manifest_is_not_generatedcCsjtd|jt|j>}|D](}|}|ds|s:q|j|qWdn1s\0YdS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'#N)r
rr5rstrip
startswithrCr)rr5rrrrrSszsdist.read_manifestcCs||tj|||jdttdr4d}d|}nd}d|}|sPtdn
t||D]<}tj	
|s|td|q^tj	||}|j|||d	q^|j
j|dS)
aCreate the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        dry_runlinkhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r)mkpathrcreate_treerhasattrrOr
rrrPrQrl	copy_filerKmetadatawrite_pkg_info)rrrrrrfiledestrrrmake_release_trees 
	


zsdist.make_release_treecCs|j}tj|j|}|||jjg}d|j	vrT|j	
|j	|j	d|j	D]:}|j
||||j|jd}|
||jj
dd|fqZ||_|jstj||jddS)aCreate the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        tar)rr;r<rrN)rKrrOrPrlr9rrCrrrrpopindexmake_archiver;r<
dist_filesr:r8rremove_treer)rr	base_namer:fmtrrrrrGs





zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r:rrrrget_archive_filesszsdist.get_archive_files)#__name__
__module____qualname__descriptionr user_optionsboolean_optionsrhelp_optionsnegative_optsub_commandsrhr=rArIrNrFrUstaticmethodrgrYrZr[r\r]r^r_rVrWrXrRrSrrGrrrrrr$sH'
(
*r)__doc__rOrrwarningsrdistutils.corer	distutilsrrrdistutils.text_filerdistutils.filelistr	r
distutils.utilrdistutils.errorsrr
rrrrrrsPK!9+0+07_distutils/command/__pycache__/bdist_rpm.cpython-39.pycnu[a

(Re!T@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).N)Command)DEBUG)
write_file)*)get_python_version)logc@sdeZdZdZgdZgdZddddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
dS)	bdist_rpmzcreate an RPM distribution)))zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow ") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe ") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)
no-autoreqNz+do not automatically calculate dependencies)	keep-tempkz"don't clean up RPM build directory)no-keep-tempNz&clean up RPM build directory [default])use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)	rpm3-modeNz"RPM 3 compatibility mode (default))	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nzfinalize_optionss6




zbdist_rpm.finalize_optionscCsT|dd|dd|j|jf|d|dt|jtrxdD]&}tj	
|rP||jvrP|j|qP|dd	|d
|d|d||j
|_
|d
|d|d|d|d|d|d|d|d|d|d|d|d|d|d|ddS)NrzDevelopment/Librariesr"z%s <%s>r#r$)ZREADMEz
README.txtr 1r!rr%r&r'r(r)r*r+r,r-r.r/r1r2r3r4r5r:)
ensure_stringrLget_contactget_contact_emailensure_string_list
isinstancer$listrErFexistsappend_format_changelogr%ensure_filename)r<Zreadmer=r=r>rNsB




















zbdist_rpm.finalize_package_datacCstrruns












z
bdist_rpm.runcCstj|jtj|S)N)rErFrGrr~)r<rFr=r=r>
_dist_pathszbdist_rpm._dist_pathc	Cs\d|jd|jddd|jd|jdddd|jg}td	}d
dd|	D}d
}d}|||}||kr|
d|
d|d
|gd|jr|
dn
|
d|d|j
d|jddg|js|js$|
dn|
d|jdD]V}t||}t|tr`|
d|d|fn|dur(|
d||fq(|jdkr|
d|j|jr|
d |j|jr|
d!d|j|jr|
d"tj|j|jr|
d#|dd$|jgd%|jtjtj d&f}d'|}	|j!rVd(|	}	d)|}
d*d+d,|	fd-d.|
fd/d0d1d2d3d4g	}|D]\}}
}t||
}|s|r|dd5|g|rt"|$}||#$d
Wdn1s0Yn
|
|q|gd6|j%r6|
d7d|j%|j&rX|dd8g||j&|S)9ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version -_z%define unmangled_version z%define release z	Summary: zrpm --eval %{__os_install_post}
cSsg|]}d|qS)z  %s \)ru).0rr=r=r>
sz-bdist_rpm._make_spec_file..zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post )z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerProvidesRequiresZ	Conflicts	Obsoletesz%s: %s NUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r0r'z&%setup -n %{name}-%{unmangled_version}buildr(installr))cleanr*zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr+N)prer,N)postr-N)Zpreunr.N)Zpostunr/N%)rz%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rLrgget_versionreplacer get_description
subprocess	getoutputrG
splitlinesrXrqrget_licenserr:rMgetattrlowerrUrVget_urlrr4r&rErFr~r9get_long_descriptionrrHargvr7openreadrvr$r%)r<Z	spec_fileZvendor_hookproblemfixedZ
fixed_hookfieldvalZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_optattrdefaultfr=r=r>ris


	





6zbdist_rpm._make_spec_filecCs||s|Sg}|dD]N}|}|ddkrB|d|gq|ddkrZ||q|d|q|dsx|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rrrrrz  )rurvrqrX)r<r%Z
new_changelogrr=r=r>rY0szbdist_rpm._format_changelogN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optr?rOrNrrrirYr=r=r=r>rs m--*r)__doc__rrHrEdistutils.corerdistutils.debugrdistutils.file_utilrdistutils.errorsdistutils.sysconfigr	distutilsrrr=r=r=r>sPK!Db4_distutils/command/__pycache__/upload.cpython-39.pycnu[a

(Re@sdZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZeed
deeddeeddd
ZGdddeZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
N)standard_b64encode)urlopenRequest	HTTPError)urlparse)DistutilsErrorDistutilsOptionError)
PyPIRCCommand)spawn)logmd5sha256blake2b)Z
md5_digestZ
sha256_digestZblake2_256_digestc@sJeZdZdZejddgZejdgZddZddZd	d
Z	ddZ
d
S)uploadzupload binary package to PyPI)signszsign files to upload using gpg)z	identity=izGPG identity used to sign filesrcCs,t|d|_d|_d|_d|_d|_dS)NrF)r	initialize_optionsusernamepassword
show_responseridentity)selfr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/upload.pyr)s
zupload.initialize_optionscCsrt||jr|jstd|}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr
repositoryrealm)r	finalize_optionsrrr_read_pypircrrrrdistribution)rconfigrrrr1s




zupload.finalize_optionscCs:|jjsd}t||jjD]\}}}||||qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))r 
dist_filesrupload_file)rmsgcommand	pyversionfilenamerrrrunCs
z
upload.runc"Cs
t|j\}}}}}}	|s"|s"|	r0td|j|dvrDtd||jr|ddd|g}
|jrnd|jg|
dd<t|
|jd	t|d
}z|}W|	n
|	0|j
j}
dd|
|

tj||f||d
|
|
|
|
|
|
|
|
|
|
|
|
|
d}d|d<tD]B\}}|durLq6z|| ||<Wnt!ytYn0q6|jrt|dd
,}tj|d|f|d<Wdn1s0Y|j"d|j#$d}dt%|&d}d}d|$d}|d}t'(}|D]\}}d|}t)|t*sB|g}|D]j}t+|t,urr|d|d7}|d}nt-|$d}|.||.|$d|.d|.|qFq |.||/}d||jf}|0|t1j2d |t-t3||d!}t4|j||d"}zt5|}|6}|j7}Wnjt8yX} z| j9}| j7}WYd} ~ nBd} ~ 0t:y} z |0t-| t1j;WYd} ~ n
d} ~ 00|d#kr|0d$||ft1j2|j<r|=|}!d%>d&|!d&f}|0|t1j2n"d'||f}|0|t1j;t?|dS)(NzIncompatible url %s)httphttpszunsupported schema Zgpgz
--detach-signz-az--local-user)dry_runrbZfile_upload1z1.0)z:actionZprotocol_versionnameversioncontentfiletyper&metadata_versionsummaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformclassifiersdownload_urlprovidesrequires	obsoletesrcommentz.ascZ
gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-length
Authorization)dataheaderszServer response (%s): %s
zK---------------------------------------------------------------------------zUpload failed (%s): %s)@rrAssertionErrorrrr
r,openreadcloser metadataget_nameget_versionospathbasenameget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes_FILE_CONTENT_DIGESTSitems	hexdigest
ValueErrorrrencoderdecodeioBytesIO
isinstancelisttypetuplestrwritegetvalueannouncerINFOlenrrgetcoder$rcodeOSErrorERRORr_read_pypi_responsejoinr)"rr%r&r'Zschemanetlocurlparamsquery	fragmentsZgpg_argsfr1metarEZdigest_namedigest_cons	user_passauthboundaryZsep_boundaryZend_boundarybodykeyvaluetitler$rFrequestresultstatusreasonetextrrrr#Ks

 

(







zupload.upload_fileN)__name__
__module____qualname__r8r	user_optionsboolean_optionsrrr(r#rrrrrsr)__doc__rPrfhashlibbase64rurllib.requestrrrurllib.parserdistutils.errorsrrdistutils.corer	distutils.spawnr
	distutilsrgetattrr`rrrrrs


PK!ZmMM7_distutils/command/__pycache__/bdist_msi.cpython-39.pycnu[a

(Re@sdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
d
eZGdddeZdS)z#
Implements the bdist_msi command.
N)Command)remove_tree)get_python_version)
StrictVersion)DistutilsOptionError)get_platform)log)schemasequencetext)	DirectoryFeatureDialogadd_datac@sFeZdZdZddZddZddd	ZdddZdddZddZ	dS)PyDialogzDialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs@tj|g|R|jd}d|d}|dd||jddS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)$iHZ
BottomLinerN)r__init__hlinew)selfargskwZrulerZbmwidthr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|ddddddd|dS)	z,Set the title text of the dialog at the top.Title
@<z{\VerdanaBold10}%sN)r)rtitlerrrr"%szPyDialog.titleBackc
Cs,|r
d}nd}||d|jddd|||S)zAdd a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr$8
pushbuttonrrr"nextnameactiveflagsrrrback,sz
PyDialog.backCancelc
Cs,|r
d}nd}||d|jddd|||S)zAdd a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$i0r'r(r)r*r,rrrcancel7szPyDialog.cancelNextc
Cs,|r
d}nd}||d|jddd|||S)zAdd a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$r'r(r)r*r,rrrr-Bsz
PyDialog.nextc
Cs,||t|j|d|jdddd||S)zAdd a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associatedr'r(r)r%)r+intrr)rr.r"r-ZxposrrrxbuttonMszPyDialog.xbuttonN)r#r$)r2r$)r4r$)
__name__
__module____qualname____doc__rr"r1r3r-r8rrrrrs



rc
seZdZdZddddefdddd	d
ddd
g
ZgdZgdZdZfddZ	ddZ
ddZddZddZ
ddZddZdd Zd!d"ZZS)#	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)r?rArCrF)z2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9Xcs$tj|i|tdtddS)NzZbdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead)superrwarningswarnDeprecationWarning)rrr	__class__rrrszbdist_msi.__init__cCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)	bdist_dir	plat_name	keep_tempZno_target_compileZno_target_optimizetarget_versiondist_dir
skip_buildinstall_scriptpre_install_scriptversions)rrrrinitialize_optionsszbdist_msi.initialize_optionscCs|dd|jdur2|dj}tj|d|_t}|jsN|j	
rN||_|jr|jg|_|js|j	
r|j|krt
d|fnt|j|_|ddd|jrt
d|jr|j	jD]}|jtj|krqqt
d|jd|_dS)	Nbdist)rTrTZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rSrS)rPrPz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)set_undefined_optionsrOget_finalized_command
bdist_baseospathjoinrrRdistributionhas_ext_modulesrWrTrlistall_versionsrVrUscriptsbasenameinstall_script_key)rr\Z
short_versionscriptrrrfinalize_optionssH

zbdist_msi.finalize_optionscCs|js|d|jddd}|j|_|j|_d|_|d}d|_d|_|j	r|j
}|s~|jslJddtjdd	}d
|j
|f}|d}tj|jd||_td|j|tjdtj|jd
|tjd=||j|j}||}tj|}tj|r0t||jj }|j!}	|	sJ|j"}	|	sTd}	|#}
dt$|
j%}|j}|j
rd|j
|f}nd|}t&'|t(|t&)||	|_*t&+|j*t,d|
fg}
|j-p|j.}|r|
/d|f|j0r|
/d|j0f|
rt1|j*d|
|2|3|4|5|j*6t7|jdrld|j
pXd|f}|jj8/||j9st:|j|j;ddS)Nbuildinstallr$)reinit_subcommandsrinstall_libz Should have already checked thisz%d.%drHz.%s-%slibzinstalling to %sZPURELIBUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUTProperty
dist_filesr=any)dry_run)d?d!d@dz[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogrHZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHiderZDiskCostDlgOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostListdiz{120}{70}{70}{70}{70}g?rZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.rrzInstall for all usersZJUSTMEzInstall just for mez
[ALLUSERS]zWhichUsers="ALL"rz({\DlgFontBold8}[Progress1] [ProductName]#AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressProgressrz)Welcome to the [ProductName] Setup WizardZBodyText?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGrouplrrrz&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallrz[REMOVE]zMaintenanceForm_Action="Remove"ZRemovingZremoves
z MaintenanceForm_Action<>"Change")rrrrrrr"r1r3r-eventcontrolrr+mappingr`rrWr	conditionr8Z
radiogroupadd)rrxyrrr"modalZmodelessZtrack_disk_spacefatalrBZ	user_exitZexit_dialogZinuseerrorr3ZcostingprepZseldlgorderrrZinstall_other_condZdont_install_other_condZcostZ
whichusersgprogressZmaintrrrrs
	



       





zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj|j|}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rRrPr]r^r_rS)rr	base_namerrrrrsz bdist_msi.get_installer_filename)r9r:r;descriptionruser_optionsboolean_optionsrcrrrXrhrrrrrr
__classcell__rrrMrr=Us<
([66&@r=)r<r]ryrJdistutils.corerdistutils.dir_utilrdistutils.sysconfigrZdistutils.versionrdistutils.errorsrdistutils.utilr	distutilsrrr	r
rrr
rrrr=rrrrs>PK!٤K??7_distutils/command/__pycache__/build_ext.cpython-39.pycnu[a

(Re{@sdZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
lmZedZddZGdddeZdS)zdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).N)Command)*)customize_compilerget_python_version)get_config_h_filename)newer_group)	Extension)get_platform)log)
py37compat)	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|dS)Nrshow_compilers)distutils.ccompilerrrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.pyrsrc@seZdZdZdejZdddddefdd	d
defdd
ddddefddddddddddgZgdZ	ddde
fgZd d!Zd"d#Z
d$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zejd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdS)D	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=bz(directory for compiled extension modules)zbuild-temp=tz1directory for temporary files (build by-products)z
plat-name=pz>platform name to cross-compile for, if supported (default: %s))inplaceiziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link withz
library-dirs=Lz.directories to search for external C libraries)zrpath=Rz7directories to search for shared C libraries at runtime)z
link-objects=Oz2extra explicit link objects to include in the link)debuggz'compile/link with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)userNz#add user include, library and rpath)rr r"r&r'z
help-compilerNzlist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)
extensions	build_lib	plat_name
build_temprpackageinclude_dirsdefineundef	librarieslibrary_dirsrpathlink_objectsr r"compilerswigswig_cpp	swig_optsr'parallelselfrrrinitialize_optionsks*zbuild_ext.initialize_optionsc

Csddlm}|ddddddd	d
|jdur8|jj|_|jj|_|}|jdd}|j	durn|jj	pjg|_	t
|j	tr|j	t
j|_	tjtjkr|j	t
jtjd
|j	|t
jj||kr|j	|t
jj|d|d|jdurg|_|jdurg|_nt
|jtr:|jt
j|_|jdurNg|_nt
|jtrl|jt
j|_t
jdkrh|jt
jtjdtjtjkr|jt
jtjd|jrt
j|jd|_nt
j|jd|_|j	t
jtt tdd}|r|j||j!dkr*d}n|j!dd}t
jtjd}|r\t
j||}|j|tj"dddkr|j#s|jt
jtjddt$dn|jd|%dr|j#s|j|%dn|jd|j&r|j&d }d!d"|D|_&|j'r"|j'd |_'|j(dur6g|_(n|j(d#|_(|j)rt
jt*d
}t
jt*d}	t
j+|r|j	|t
j+|	r|j|	|j|	t
|j,trzt-|j,|_,Wnt.yt/d$Yn0dS)%Nr)	sysconfigbuild)r)r))r+r+)r4r4)r r )r"r")r8r8)r*r*r)
plat_specificincluder0r3ntZlibsZDebugZRelease_homewin32ZPCbuildcygwinlibpythonconfig.Py_ENABLE_SHAREDLIBDIR,cSsg|]}|dfqS)1r).0symbolrrr
z.build_ext.finalize_options.. zparallel should be an integer)0	distutilsr<set_undefined_optionsr,distributionext_packageext_modulesr(get_python_incr-
isinstancestrsplitospathsepsysexec_prefixbase_exec_prefixappendpathjoinextendensure_string_listr0r1r2nameprefixr r+dirnamergetattrr*platformpython_buildrget_config_varr.r/r7r'r
isdirr8int
ValueErrorDistutilsOptionError)
r:r<Z
py_includeZplat_py_include	_sys_homesuffixZnew_libZdefinesZuser_includeZuser_librrrfinalize_optionss






zbuild_ext.finalize_optionscCsjddlm}|jsdS|jrL|d}|j|p:g|j	
|j||j|j
|j|jd|_t|jtjdkr|jtkr|j|j|jdur|j|j|jdur|jD]\}}|j||q|jdur|jD]}|j|q|jdur|j|j|j	dur*|j|j	|jdurD|j|j|j dur^|j!|j |"dS)Nr)new_compiler
build_clib)r4verbosedry_runr"r@)#rrtr(rUhas_c_librariesget_finalized_commandr0rdZget_library_namesr1rarur4rvrwr"rr\rfr*r	Z
initializer-Zset_include_dirsr.Zdefine_macror/Zundefine_macroZ
set_librariesZset_library_dirsr2Zset_runtime_library_dirsr3Zset_link_objectsbuild_extensions)r:rtrurfvaluemacrorrrruns@






z
build_ext.runc
Csvt|tstdt|D]T\}}t|tr0qt|trFt|dkrNtd|\}}td|t|t	rvt
|s~tdt|tstdt||d}dD]"}|
|}|d	urt|||q|
d
|_d|vrtd|
d
}|rhg|_g|_|D]b}	t|	tr"t|	dvs*tdt|	dkrJ|j|	dnt|	dkr|j|	q|||<qd	S)aEnsure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instanceszMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sources)r-r1r0
extra_objectsextra_compile_argsextra_link_argsNr2Zdef_filez9'def_file' element of build info dict no longer supportedmacros)rr~z9'macros' element of build info dict must be 1- or 2-tuplerr)rYlistDistutilsSetupError	enumeratertuplelenr
warnrZextension_name_rematchdictgetsetattrruntime_library_dirs
define_macrosundef_macrosra)
r:r(rextext_nameZ
build_infokeyvalrr|rrrcheck_extensions_listWs^







zbuild_ext.check_extensions_listcCs,||jg}|jD]}||jq|SN)rr(rdr)r:	filenamesrrrrget_source_filess

zbuild_ext.get_source_filescCs2||jg}|jD]}|||jq|Sr)rr(raget_ext_fullpathrf)r:outputsrrrrget_outputss

zbuild_ext.get_outputscCs(||j|jr|n|dSr)rr(r8_build_extensions_parallel_build_extensions_serialr9rrrrzs
zbuild_ext.build_extensionsc
sj}jdurt}zddlm}Wnty>d}Yn0|durTdS||dnfddjD}tj|D]:\}}	||
Wdq1s0YqWdn1s0YdS)NTr)ThreadPoolExecutor)max_workerscsg|]}j|qSr)submitbuild_extension)rNrexecutorr:rrrPsz8build_ext._build_extensions_parallel..)r8r\	cpu_countconcurrent.futuresrImportErrorrr(zip_filter_build_errorsresult)r:workersrfuturesrfutrrrrs"

z$build_ext._build_extensions_parallelc	CsD|jD]8}||||Wdq1s40YqdSr)r(rr)r:rrrrrs
z"build_ext._build_extensions_serialc
csVz
dVWnFtttfyP}z(|js(|d|j|fWYd}~n
d}~00dS)Nz"building extension "%s" failed: %s)CCompilerErrorDistutilsErrorCompileErroroptionalrrf)r:rerrrrs
zbuild_ext._filter_build_errorsc
CsP|j}|dust|ttfs*td|jt|}||j}||j}|j	slt
||dsltd|jdSt
d|j|||}|jpg}|jdd}|jD]}||fq|jj||j||j|j||jd}|dd|_|jr||j|jpg}|jp|j|}	|jj|||||j|j ||!||j|j|	d
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)
output_dirrr-r extra_postargsdepends)r0r1rrexport_symbolsr r+Ztarget_lang)"rrYrrrrfsortedrrr"rr
r infoswig_sourcesrrrrar4compiler+r-Z_built_objectsrrdrlanguageZdetect_languageZlink_shared_object
get_librariesr1rget_export_symbols)
r:rrext_pathr
extra_argsrr/ZobjectsrrrrrsV



zbuild_ext.build_extensioncCs$g}g}i}|jrtd|js6d|jvs6d|jvrI don't know how to find (much less run) SWIG on platform '%s'N)r\rfrbrcisfileDistutilsPlatformError)r:versfnrrrris


zbuild_ext.find_swigcCs||}|d}||d}|jsRtjj|dd|g}tj|j|Sd|dd}|d}tj	|
|}tj||S)zReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rIrNrbuild_py)get_ext_fullnamer[get_ext_filenamerr\rbrcr)ryabspathZget_package_dir)r:rfullnamemodpathfilenamer,rpackage_dirrrrrs


zbuild_ext.get_ext_fullpathcCs |jdur|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrI)r,)r:rrrrrs
zbuild_ext.get_ext_fullnamecCs.ddlm}|d}|d}tjj||S)zConvert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        rrlrI
EXT_SUFFIX)distutils.sysconfigrlr[r\rbrc)r:rrlrZ
ext_suffixrrrrs
zbuild_ext.get_ext_filenamecCsz|jdd}z|dWn.tyLd|dddd}Yn
0d|}d	|}||jvrt|j||jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        rIrasciiZU_punycode-__ZPyInit)rfr[encodeUnicodeEncodeErrorreplacedecoderra)r:rrfrrZ
initfunc_namerrrrs"
zbuild_ext.get_export_symbolscCstjdkr^ddlm}t|j|sd}|jr4|d}|tjd?tjd?d@f}|j|gSndd	l	m
}d
}|drttdrd
}ns&PK!3_distutils/command/__pycache__/build.cpython-39.pycnu[a

(Re@sTdZddlZddlZddlmZddlmZddlmZddZ	Gdd	d	eZ
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.N)Command)DistutilsOptionError)get_platformcCsddlm}|dS)Nrshow_compilers)distutils.ccompilerrrr/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/_distutils/command/build.pyrsrc@seZdZdZdddddddd	d
efddd
ddgZddgZdddefgZddZ	ddZ
ddZddZddZ
dd Zd!d"Zd#efd$e
fd%efd&efgZdS)'buildz"build everything needed to install)zbuild-base=bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=tztemporary build directoryz
plat-name=pz6platform name to build for, if supported (default: %s))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)debuggz;compile extensions and libraries with debugging information)forcefz2forcibly build everything (ignore file timestamps))zexecutable=ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr
r)
build_base
build_purelib
build_platlib	build_lib
build_temp
build_scriptscompiler	plat_namerr
executableparallelselfrrr	initialize_options8szbuild.initialize_optionscCsf|jdurt|_ntjdkr&tdd|jgtjddR}ttdrT|d7}|jdurptj	
|jd|_|jdurtj	
|jd||_|j
dur|jr|j|_
n|j|_
|jdurtj	
|jd||_|jdurtj	
|jd	tjdd|_|jdur&tjr&tj	tj|_t|jtrbzt|j|_Wnty`td
Yn0dS)NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%dgettotalrefcountz-pydebuglibtempz
scripts-%d.%dzparallel should be an integer)rrosnamersysversion_infohasattrrpathjoinrrrdistributionhas_ext_modulesrrrnormpath
isinstancerstrint
ValueError)r plat_specifierrrr	finalize_optionsHsD












zbuild.finalize_optionscCs|D]}||qdSN)get_sub_commandsrun_command)r cmd_namerrr	runsz	build.runcCs
|jSr7)r.has_pure_modulesrrrr	r<szbuild.has_pure_modulescCs
|jSr7)r.has_c_librariesrrrr	r=szbuild.has_c_librariescCs
|jSr7)r.r/rrrr	r/szbuild.has_ext_modulescCs
|jSr7)r.has_scriptsrrrr	r>szbuild.has_scriptsbuild_py
build_clib	build_extr)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsr!r6r;r<r=r/r>sub_commandsrrrr	r
sF8r
)__doc__r)r'distutils.corerdistutils.errorsrdistutils.utilrrr
rrrr	sPK!oY_distutils/command/bdist_msi.pynu[# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""

import os
import sys
import warnings
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils.sysconfig import get_python_version
from distutils.version import StrictVersion
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
from distutils import log
import msilib
from msilib import schema, sequence, text
from msilib import Directory, Feature, Dialog, add_data

class PyDialog(Dialog):
    """Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left."""
    def __init__(self, *args, **kw):
        """Dialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)"""
        Dialog.__init__(self, *args)
        ruler = self.h - 36
        bmwidth = 152*ruler/328
        #if kw.get("bitmap", True):
        #    self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
        self.line("BottomLine", 0, ruler, self.w, 0)

    def title(self, title):
        "Set the title text of the dialog at the top."
        # name, x, y, w, h, flags=Visible|Enabled|Transparent|NoPrefix,
        # text, in VerdanaBold10
        self.text("Title", 15, 10, 320, 60, 0x30003,
                  r"{\VerdanaBold10}%s" % title)

    def back(self, title, next, name = "Back", active = 1):
        """Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 180, self.h-27 , 56, 17, flags, title, next)

    def cancel(self, title, next, name = "Cancel", active = 1):
        """Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 304, self.h-27, 56, 17, flags, title, next)

    def next(self, title, next, name = "Next", active = 1):
        """Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 236, self.h-27, 56, 17, flags, title, next)

    def xbutton(self, name, title, next, xpos):
        """Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated"""
        return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next)

class bdist_msi(Command):

    description = "create a Microsoft Installer (.msi) binary distribution"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4',
                    '2.5', '2.6', '2.7', '2.8', '2.9',
                    '3.0', '3.1', '3.2', '3.3', '3.4',
                    '3.5', '3.6', '3.7', '3.8', '3.9']
    other_version = 'X'

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        warnings.warn("bdist_msi command is deprecated since Python 3.9, "
                      "use bdist_wheel (wheel packages) instead",
                      DeprecationWarning, 2)

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.versions = None

    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'msi')

        short_version = get_python_version()
        if (not self.target_version) and self.distribution.has_ext_modules():
            self.target_version = short_version

        if self.target_version:
            self.versions = [self.target_version]
            if not self.skip_build and self.distribution.has_ext_modules()\
               and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'"
                      " option must be specified" % (short_version,))
        else:
            self.versions = list(self.all_versions)

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                   )

        if self.pre_install_script:
            raise DistutilsOptionError(
                  "the pre-install-script feature is not yet implemented")

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)
        self.install_script_key = None

    def run(self):
        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.prefix = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        self.mkpath(self.dist_dir)
        fullname = self.distribution.get_fullname()
        installer_name = self.get_installer_filename(fullname)
        installer_name = os.path.abspath(installer_name)
        if os.path.exists(installer_name): os.unlink(installer_name)

        metadata = self.distribution.metadata
        author = metadata.author
        if not author:
            author = metadata.maintainer
        if not author:
            author = "UNKNOWN"
        version = metadata.get_version()
        # ProductVersion must be strictly numeric
        # XXX need to deal with prerelease versions
        sversion = "%d.%d.%d" % StrictVersion(version).version
        # Prefix ProductName with Python x.y, so that
        # it sorts together with the other Python packages
        # in Add-Remove-Programs (APR)
        fullname = self.distribution.get_fullname()
        if self.target_version:
            product_name = "Python %s %s" % (self.target_version, fullname)
        else:
            product_name = "Python %s" % (fullname)
        self.db = msilib.init_database(installer_name, schema,
                product_name, msilib.gen_uuid(),
                sversion, author)
        msilib.add_tables(self.db, sequence)
        props = [('DistVersion', version)]
        email = metadata.author_email or metadata.maintainer_email
        if email:
            props.append(("ARPCONTACT", email))
        if metadata.url:
            props.append(("ARPURLINFOABOUT", metadata.url))
        if props:
            add_data(self.db, 'Property', props)

        self.add_find_python()
        self.add_files()
        self.add_scripts()
        self.add_ui()
        self.db.Commit()

        if hasattr(self.distribution, 'dist_files'):
            tup = 'bdist_msi', self.target_version or 'any', fullname
            self.distribution.dist_files.append(tup)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def add_files(self):
        db = self.db
        cab = msilib.CAB("distfiles")
        rootdir = os.path.abspath(self.bdist_dir)

        root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir")
        f = Feature(db, "Python", "Python", "Everything",
                    0, 1, directory="TARGETDIR")

        items = [(f, root, '')]
        for version in self.versions + [self.other_version]:
            target = "TARGETDIR" + version
            name = default = "Python" + version
            desc = "Everything"
            if version is self.other_version:
                title = "Python from another location"
                level = 2
            else:
                title = "Python %s from registry" % version
                level = 1
            f = Feature(db, name, title, desc, 1, level, directory=target)
            dir = Directory(db, cab, root, rootdir, target, default)
            items.append((f, dir, version))
        db.Commit()

        seen = {}
        for feature, dir, version in items:
            todo = [dir]
            while todo:
                dir = todo.pop()
                for file in os.listdir(dir.absolute):
                    afile = os.path.join(dir.absolute, file)
                    if os.path.isdir(afile):
                        short = "%s|%s" % (dir.make_short(file), file)
                        default = file + version
                        newdir = Directory(db, cab, dir, file, default, short)
                        todo.append(newdir)
                    else:
                        if not dir.component:
                            dir.start_component(dir.logical, feature, 0)
                        if afile not in seen:
                            key = seen[afile] = dir.add_file(file)
                            if file==self.install_script:
                                if self.install_script_key:
                                    raise DistutilsOptionError(
                                          "Multiple files with name %s" % file)
                                self.install_script_key = '[#%s]' % key
                        else:
                            key = seen[afile]
                            add_data(self.db, "DuplicateFile",
                                [(key + version, dir.component, key, None, dir.logical)])
            db.Commit()
        cab.commit(db)

    def add_find_python(self):
        """Adds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe"""

        start = 402
        for ver in self.versions:
            install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver
            machine_reg = "python.machine." + ver
            user_reg = "python.user." + ver
            machine_prop = "PYTHON.MACHINE." + ver
            user_prop = "PYTHON.USER." + ver
            machine_action = "PythonFromMachine" + ver
            user_action = "PythonFromUser" + ver
            exe_action = "PythonExe" + ver
            target_dir_prop = "TARGETDIR" + ver
            exe_prop = "PYTHON" + ver
            if msilib.Win64:
                # type: msidbLocatorTypeRawValue + msidbLocatorType64bit
                Type = 2+16
            else:
                Type = 2
            add_data(self.db, "RegLocator",
                    [(machine_reg, 2, install_path, None, Type),
                     (user_reg, 1, install_path, None, Type)])
            add_data(self.db, "AppSearch",
                    [(machine_prop, machine_reg),
                     (user_prop, user_reg)])
            add_data(self.db, "CustomAction",
                    [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"),
                     (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"),
                     (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"),
                    ])
            add_data(self.db, "InstallExecuteSequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "InstallUISequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "Condition",
                    [("Python" + ver, 0, "NOT TARGETDIR" + ver)])
            start += 4
            assert start < 500

    def add_scripts(self):
        if self.install_script:
            start = 6800
            for ver in self.versions + [self.other_version]:
                install_action = "install_script." + ver
                exe_prop = "PYTHON" + ver
                add_data(self.db, "CustomAction",
                        [(install_action, 50, exe_prop, self.install_script_key)])
                add_data(self.db, "InstallExecuteSequence",
                        [(install_action, "&Python%s=3" % ver, start)])
                start += 1
        # XXX pre-install scripts are currently refused in finalize_options()
        #     but if this feature is completed, it will also need to add
        #     entries for each version as the above code does
        if self.pre_install_script:
            scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
            with open(scriptfn, "w") as f:
                # The batch file will be executed with [PYTHON], so that %1
                # is the path to the Python interpreter; %0 will be the path
                # of the batch file.
                # rem ="""
                # %1 %0
                # exit
                # """
                # 
                f.write('rem ="""\n%1 %0\nexit\n"""\n')
                with open(self.pre_install_script) as fin:
                    f.write(fin.read())
            add_data(self.db, "Binary",
                [("PreInstall", msilib.Binary(scriptfn))
                ])
            add_data(self.db, "CustomAction",
                [("PreInstall", 2, "PreInstall", None)
                ])
            add_data(self.db, "InstallExecuteSequence",
                    [("PreInstall", "NOT Installed", 450)])


    def add_ui(self):
        db = self.db
        x = y = 50
        w = 370
        h = 300
        title = "[ProductName] Setup"

        # see "Dialog Style Bits"
        modal = 3      # visible | modal
        modeless = 1   # visible
        track_disk_space = 32

        # UI customization properties
        add_data(db, "Property",
                 # See "DefaultUIFont Property"
                 [("DefaultUIFont", "DlgFont8"),
                  # See "ErrorDialog Style Bit"
                  ("ErrorDialog", "ErrorDlg"),
                  ("Progress1", "Install"),   # modified in maintenance type dlg
                  ("Progress2", "installs"),
                  ("MaintenanceForm_Action", "Repair"),
                  # possible values: ALL, JUSTME
                  ("WhichUsers", "ALL")
                 ])

        # Fonts, see "TextStyle Table"
        add_data(db, "TextStyle",
                 [("DlgFont8", "Tahoma", 9, None, 0),
                  ("DlgFontBold8", "Tahoma", 8, None, 1), #bold
                  ("VerdanaBold10", "Verdana", 10, None, 1),
                  ("VerdanaRed9", "Verdana", 9, 255, 0),
                 ])

        # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
        # Numbers indicate sequence; see sequence.py for how these action integrate
        add_data(db, "InstallUISequence",
                 [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
                  ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
                  # In the user interface, assume all-users installation if privileged.
                  ("SelectFeaturesDlg", "Not Installed", 1230),
                  # XXX no support for resume installations yet
                  #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240),
                  ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
                  ("ProgressDlg", None, 1280)])

        add_data(db, 'ActionText', text.ActionText)
        add_data(db, 'UIText', text.UIText)
        #####################################################################
        # Standard dialogs: FatalError, UserExit, ExitDialog
        fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        fatal.title("[ProductName] Installer ended prematurely")
        fatal.back("< Back", "Finish", active = 0)
        fatal.cancel("Cancel", "Back", active = 0)
        fatal.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.")
        fatal.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c=fatal.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        user_exit.title("[ProductName] Installer was interrupted")
        user_exit.back("< Back", "Finish", active = 0)
        user_exit.cancel("Cancel", "Back", active = 0)
        user_exit.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup was interrupted.  Your system has not been modified.  "
                   "To install this program at a later time, please run the installation again.")
        user_exit.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = user_exit.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
                             "Finish", "Finish", "Finish")
        exit_dialog.title("Completing the [ProductName] Installer")
        exit_dialog.back("< Back", "Finish", active = 0)
        exit_dialog.cancel("Cancel", "Back", active = 0)
        exit_dialog.text("Description", 15, 235, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = exit_dialog.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Return")

        #####################################################################
        # Required dialog: FilesInUse, ErrorDlg
        inuse = PyDialog(db, "FilesInUse",
                         x, y, w, h,
                         19,                # KeepModeless|Modal|Visible
                         title,
                         "Retry", "Retry", "Retry", bitmap=False)
        inuse.text("Title", 15, 6, 200, 15, 0x30003,
                   r"{\DlgFontBold8}Files in Use")
        inuse.text("Description", 20, 23, 280, 20, 0x30003,
               "Some files that need to be updated are currently in use.")
        inuse.text("Text", 20, 55, 330, 50, 3,
                   "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.")
        inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess",
                      None, None, None)
        c=inuse.back("Exit", "Ignore", name="Exit")
        c.event("EndDialog", "Exit")
        c=inuse.next("Ignore", "Retry", name="Ignore")
        c.event("EndDialog", "Ignore")
        c=inuse.cancel("Retry", "Exit", name="Retry")
        c.event("EndDialog","Retry")

        # See "Error Dialog". See "ICE20" for the required names of the controls.
        error = Dialog(db, "ErrorDlg",
                       50, 10, 330, 101,
                       65543,       # Error|Minimize|Modal|Visible
                       title,
                       "ErrorText", None, None)
        error.text("ErrorText", 50,9,280,48,3, "")
        #error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None)
        error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo")
        error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes")
        error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort")
        error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel")
        error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore")
        error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk")
        error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry")

        #####################################################################
        # Global "Query Cancel" dialog
        cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title,
                        "No", "No", "No")
        cancel.text("Text", 48, 15, 194, 30, 3,
                    "Are you sure you want to cancel [ProductName] installation?")
        #cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None,
        #               "py.ico", None, None)
        c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No")
        c.event("EndDialog", "Exit")

        c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes")
        c.event("EndDialog", "Return")

        #####################################################################
        # Global "Wait for costing" dialog
        costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title,
                         "Return", "Return", "Return")
        costing.text("Text", 48, 15, 194, 30, 3,
                     "Please wait while the installer finishes determining your disk space requirements.")
        c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None)
        c.event("EndDialog", "Exit")

        #####################################################################
        # Preparation dialog: no user input except cancellation
        prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title,
                        "Cancel", "Cancel", "Cancel")
        prep.text("Description", 15, 70, 320, 40, 0x30003,
                  "Please wait while the Installer prepares to guide you through the installation.")
        prep.title("Welcome to the [ProductName] Installer")
        c=prep.text("ActionText", 15, 110, 320, 20, 0x30003, "Pondering...")
        c.mapping("ActionText", "Text")
        c=prep.text("ActionData", 15, 135, 320, 30, 0x30003, None)
        c.mapping("ActionData", "Text")
        prep.back("Back", None, active=0)
        prep.next("Next", None, active=0)
        c=prep.cancel("Cancel", None)
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Feature (Python directory) selection
        seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title,
                        "Next", "Next", "Cancel")
        seldlg.title("Select Python Installations")

        seldlg.text("Hint", 15, 30, 300, 20, 3,
                    "Select the Python locations where %s should be installed."
                    % self.distribution.get_fullname())

        seldlg.back("< Back", None, active=0)
        c = seldlg.next("Next >", "Cancel")
        order = 1
        c.event("[TARGETDIR]", "[SourceDir]", ordering=order)
        for version in self.versions + [self.other_version]:
            order += 1
            c.event("[TARGETDIR]", "[TARGETDIR%s]" % version,
                    "FEATURE_SELECTED AND &Python%s=3" % version,
                    ordering=order)
        c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1)
        c.event("EndDialog", "Return", ordering=order + 2)
        c = seldlg.cancel("Cancel", "Features")
        c.event("SpawnDialog", "CancelDlg")

        c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3,
                           "FEATURE", None, "PathEdit", None)
        c.event("[FEATURE_SELECTED]", "1")
        ver = self.other_version
        install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver
        dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver

        c = seldlg.text("Other", 15, 200, 300, 15, 3,
                        "Provide an alternate Python location")
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1,
                           "TARGETDIR" + ver, None, "Next", None)
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        #####################################################################
        # Disk cost
        cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
                        "OK", "OK", "OK", bitmap=False)
        cost.text("Title", 15, 6, 200, 15, 0x30003,
                 r"{\DlgFontBold8}Disk Space Requirements")
        cost.text("Description", 20, 20, 280, 20, 0x30003,
                  "The disk space required for the installation of the selected features.")
        cost.text("Text", 20, 53, 330, 60, 3,
                  "The highlighted volumes (if any) do not have enough disk space "
              "available for the currently selected features.  You can either "
              "remove some files from the highlighted volumes, or choose to "
              "install less features onto local drive(s), or select different "
              "destination drive(s).")
        cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223,
                     None, "{120}{70}{70}{70}{70}", None, None)
        cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")

        #####################################################################
        # WhichUsers Dialog. Only available on NT, and for privileged users.
        # This must be run before FindRelatedProducts, because that will
        # take into account whether the previous installation was per-user
        # or per-machine. We currently don't support going back to this
        # dialog after "Next" was selected; to support this, we would need to
        # find how to reset the ALLUSERS property, and how to re-run
        # FindRelatedProducts.
        # On Windows9x, the ALLUSERS property is ignored on the command line
        # and in the Property table, but installer fails according to the documentation
        # if a dialog attempts to set ALLUSERS.
        whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title,
                            "AdminInstall", "Next", "Cancel")
        whichusers.title("Select whether to install [ProductName] for all users of this computer.")
        # A radio group with two options: allusers, justme
        g = whichusers.radiogroup("AdminInstall", 15, 60, 260, 50, 3,
                                  "WhichUsers", "", "Next")
        g.add("ALL", 0, 5, 150, 20, "Install for all users")
        g.add("JUSTME", 0, 25, 150, 20, "Install just for me")

        whichusers.back("Back", None, active=0)

        c = whichusers.next("Next >", "Cancel")
        c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1)
        c.event("EndDialog", "Return", ordering = 2)

        c = whichusers.cancel("Cancel", "AdminInstall")
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Installation Progress dialog (modeless)
        progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
                            "Cancel", "Cancel", "Cancel", bitmap=False)
        progress.text("Title", 20, 15, 200, 15, 0x30003,
                     r"{\DlgFontBold8}[Progress1] [ProductName]")
        progress.text("Text", 35, 65, 300, 30, 3,
                      "Please wait while the Installer [Progress2] [ProductName]. "
                      "This may take several minutes.")
        progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:")

        c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...")
        c.mapping("ActionText", "Text")

        #c=progress.text("ActionData", 35, 140, 300, 20, 3, None)
        #c.mapping("ActionData", "Text")

        c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537,
                           None, "Progress done", None, None)
        c.mapping("SetProgress", "Progress")

        progress.back("< Back", "Next", active=False)
        progress.next("Next >", "Cancel", active=False)
        progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg")

        ###################################################################
        # Maintenance type: repair/uninstall
        maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title,
                         "Next", "Next", "Cancel")
        maint.title("Welcome to the [ProductName] Setup Wizard")
        maint.text("BodyText", 15, 63, 330, 42, 3,
                   "Select whether you want to repair or remove [ProductName].")
        g=maint.radiogroup("RepairRadioGroup", 15, 108, 330, 60, 3,
                            "MaintenanceForm_Action", "", "Next")
        #g.add("Change", 0, 0, 200, 17, "&Change [ProductName]")
        g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]")
        g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]")

        maint.back("< Back", None, active=False)
        c=maint.next("Finish", "Cancel")
        # Change installation: Change progress dialog to "Change", then ask
        # for feature selection
        #c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1)
        #c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2)

        # Reinstall: Change progress dialog to "Repair", then invoke reinstall
        # Also set list of reinstalled features to "ALL"
        c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5)
        c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6)
        c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7)
        c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8)

        # Uninstall: Change progress to "Remove", then invoke uninstall
        # Also set list of removed features to "ALL"
        c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11)
        c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12)
        c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13)
        c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14)

        # Close dialog when maintenance action scheduled
        c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20)
        #c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21)

        maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg")

    def get_installer_filename(self, fullname):
        # Factored out to allow overriding in subclasses
        if self.target_version:
            base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name,
                                            self.target_version)
        else:
            base_name = "%s.%s.msi" % (fullname, self.plat_name)
        installer_name = os.path.join(self.dist_dir, base_name)
        return installer_name
PK!d->>#_distutils/command/bdist_wininst.pynu["""distutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""

import os
import sys
import warnings
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_wininst(Command):

    description = "create an executable installer for MS Windows"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('bitmap=', 'b',
                     "bitmap to use for the installer instead of python-powered logo"),
                    ('title=', 't',
                     "title to display on the installer background instead of default"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                    ('user-access-control=', None,
                     "specify Vista's UAC handling - 'none'/default=no "
                     "handling, 'auto'=use UAC if target Python installed for "
                     "all users, 'force'=always use UAC"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
    _unsupported = (sys.platform != "win32")

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        warnings.warn("bdist_wininst command is deprecated since Python 3.8, "
                      "use bdist_wheel (wheel packages) instead",
                      DeprecationWarning, 2)

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.bitmap = None
        self.title = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.user_access_control = None


    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            if self.skip_build and self.plat_name:
                # If build is skipped and plat_name is overridden, bdist will
                # not see the correct 'plat_name' - so set that up manually.
                bdist = self.distribution.get_command_obj('bdist')
                bdist.plat_name = self.plat_name
                # next the command will be initialized using that name
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'wininst')

        if not self.target_version:
            self.target_version = ""

        if not self.skip_build and self.distribution.has_ext_modules():
            short_version = get_python_version()
            if self.target_version and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'" \
                      " option must be specified" % (short_version,))
            self.target_version = short_version

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                  )

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)

    def run(self):
        if (sys.platform != "win32" and
            (self.distribution.has_ext_modules() or
             self.distribution.has_c_libraries())):
            raise DistutilsPlatformError \
                  ("distribution contains extensions and/or C libraries; "
                   "must be compiled on a Windows 32 platform")

        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0
        install.plat_name = self.plat_name

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        # Use a custom scheme for the zip-file, because we have to decide
        # at installation time which scheme to use.
        for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
            value = key.upper()
            if key == 'headers':
                value = value + '/Include/$dist_name'
            setattr(install,
                    'install_' + key,
                    value)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        from tempfile import mktemp
        archive_basename = mktemp()
        fullname = self.distribution.get_fullname()
        arcname = self.make_archive(archive_basename, "zip",
                                    root_dir=self.bdist_dir)
        # create an exe containing the zip-file
        self.create_exe(arcname, fullname, self.bitmap)
        if self.distribution.has_ext_modules():
            pyversion = get_python_version()
        else:
            pyversion = 'any'
        self.distribution.dist_files.append(('bdist_wininst', pyversion,
                                             self.get_installer_filename(fullname)))
        # remove the zip-file again
        log.debug("removing temporary file '%s'", arcname)
        os.remove(arcname)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def get_inidata(self):
        # Return data describing the installation.
        lines = []
        metadata = self.distribution.metadata

        # Write the [metadata] section.
        lines.append("[metadata]")

        # 'info' will be displayed in the installer's dialog box,
        # describing the items to be installed.
        info = (metadata.long_description or '') + '\n'

        # Escape newline characters
        def escape(s):
            return s.replace("\n", "\\n")

        for name in ["author", "author_email", "description", "maintainer",
                     "maintainer_email", "name", "url", "version"]:
            data = getattr(metadata, name, "")
            if data:
                info = info + ("\n    %s: %s" % \
                               (name.capitalize(), escape(data)))
                lines.append("%s=%s" % (name, escape(data)))

        # The [setup] section contains entries controlling
        # the installer runtime.
        lines.append("\n[Setup]")
        if self.install_script:
            lines.append("install_script=%s" % self.install_script)
        lines.append("info=%s" % escape(info))
        lines.append("target_compile=%d" % (not self.no_target_compile))
        lines.append("target_optimize=%d" % (not self.no_target_optimize))
        if self.target_version:
            lines.append("target_version=%s" % self.target_version)
        if self.user_access_control:
            lines.append("user_access_control=%s" % self.user_access_control)

        title = self.title or self.distribution.get_fullname()
        lines.append("title=%s" % escape(title))
        import time
        import distutils
        build_info = "Built %s with distutils-%s" % \
                     (time.ctime(time.time()), distutils.__version__)
        lines.append("build_info=%s" % build_info)
        return "\n".join(lines)

    def create_exe(self, arcname, fullname, bitmap=None):
        import struct

        self.mkpath(self.dist_dir)

        cfgdata = self.get_inidata()

        installer_name = self.get_installer_filename(fullname)
        self.announce("creating %s" % installer_name)

        if bitmap:
            with open(bitmap, "rb") as f:
                bitmapdata = f.read()
            bitmaplen = len(bitmapdata)
        else:
            bitmaplen = 0

        with open(installer_name, "wb") as file:
            file.write(self.get_exe_bytes())
            if bitmap:
                file.write(bitmapdata)

            # Convert cfgdata from unicode to ascii, mbcs encoded
            if isinstance(cfgdata, str):
                cfgdata = cfgdata.encode("mbcs")

            # Append the pre-install script
            cfgdata = cfgdata + b"\0"
            if self.pre_install_script:
                # We need to normalize newlines, so we open in text mode and
                # convert back to bytes. "latin-1" simply avoids any possible
                # failures.
                with open(self.pre_install_script, "r",
                          encoding="latin-1") as script:
                    script_data = script.read().encode("latin-1")
                cfgdata = cfgdata + script_data + b"\n\0"
            else:
                # empty pre-install script
                cfgdata = cfgdata + b"\0"
            file.write(cfgdata)

            # The 'magic number' 0x1234567B is used to make sure that the
            # binary layout of 'cfgdata' is what the wininst.exe binary
            # expects.  If the layout changes, increment that number, make
            # the corresponding changes to the wininst.exe sources, and
            # recompile them.
            header = struct.pack(" (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']rr#rrr	_get_rootEszInstaller._get_rootcCsNt|d}|}|j}|d\}}}|r||j7}d|tdS)N.;
)tuplesplitr%_nspkg_tmpl
rpartition_nspkg_tmpl_multijoinlocals)rpkgpthrootZ
tmpl_linesparentsepchildrrrrHs
zInstaller._gen_nspkg_linecCs |jjpg}ttt|j|S)z,Return sorted list of all package namespaces)distributionZnamespace_packagessortedflattenr
_pkg_names)rpkgsrrrrQszInstaller._get_all_ns_packagesccs0|d}|rd|V||sdSdS)z
        Given a namespace package, yield the components of that
        package.

        >>> names = Installer._pkg_names('a.b.c')
        >>> set(names) == set(['a', 'a.b', 'a.b.c'])
        True
        r&N)r*r.pop)r0partsrrrr9Vs

zInstaller._pkg_namesN)__name__
__module____qualname__r
rrr	r+r-r%rrstaticmethodr9rrrrr	s	rc@seZdZddZddZdS)DevelopInstallercCstt|jSr!)reprstrZegg_pathr#rrrr%gszDevelopInstaller._get_rootcCr r!)egg_linkr#rrrr	jr$zDevelopInstaller._get_targetN)r=r>r?r%r	rrrrrAfsrA)	r	distutilsr	itertoolschain
from_iterabler8rrArrrrs]PK!!e==#__pycache__/sandbox.cpython-310.pycnu[o

Xai8@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZejdrRddlmmmmZnejejZzeZWneygdZYnweZgdZd-ddZejd-dd	Z ejd
dZ!ejdd
Z"ejddZ#Gddde$Z%GdddZ&ejddZ'ddZ(ejddZ)ejddZ*hdZ+ddZ,dd Z-d!d"Z.Gd#d$d$Z/e0ed%rej1gZ2ngZ2Gd&d'd'e/Z3e4ej5d(d)d*6DZ7Gd+d,d,e
Z8dS).N)DistutilsError)working_setjava)AbstractSandboxDirectorySandboxSandboxViolation	run_setupcCs^d}t||}|}Wdn1swY|dur!|}t||d}t|||dS)z.
    Python 3 implementation of execfile.
    rbNexec)openreadcompiler
)filenameglobalslocalsmodestreamscriptcoder/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/sandbox.py	_execfile$s
rc
csRtjdd}|dur|tjdd<z
|VW|tjdd<dS|tjdd<wN)sysargv)replsavedrrr	save_argv1s"rc
cs<tjdd}z
|VW|tjdd<dS|tjdd<wr)rpathrrrr	save_path<s
"r ccs8tj|ddtj}|t_z	dVW|t_dS|t_w)zL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    T)exist_okN)osmakedirstempfiletempdir)replacementrrrr
override_tempEsr'c	cs8t}t|z|VWt|dSt|wr)r"getcwdchdir)targetrrrrpushdVs
r+c@seZdZdZeddZdS)UnpickleableExceptionzP
    An exception representing another Exception that could not be pickled.
    c	CsJzt|t|fWSty$ddlm}|||t|YSw)z
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r,)pickledumps	Exceptionsetuptools.sandboxr,dumprepr)typeexcclsrrrr1eszUnpickleableException.dumpN)__name__
__module____qualname____doc__staticmethodr1rrrrr,`sr,c@s(eZdZdZddZddZddZdS)	ExceptionSaverz^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|Srrselfrrr	__enter__zszExceptionSaver.__enter__cCs |sdSt|||_||_dSNT)r,r1_saved_tb)r=r3r4tbrrr__exit__}s
zExceptionSaver.__exit__cCs.dt|vrdSttj|j\}}||j)z"restore and re-raise any exceptionr@N)varsmapr-loadsr@with_tracebackrA)r=r3r4rrrresumeszExceptionSaver.resumeN)r6r7r8r9r>rCrHrrrrr;ts
r;c#sltjt}VWdn1swYtjfddtjD}t||dS)z
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s&|]}|vr|ds|VqdS)z
encodings.N
startswith).0mod_namerrr	szsave_modules..)rmodulescopyr;update_clear_modulesrH)	saved_excZdel_modulesrrrsave_moduless

rScCst|D]}tj|=qdSr)listrrN)Zmodule_namesrLrrrrQs
rQc	cs.t}z|VWt|dSt|wr)
pkg_resources__getstate____setstate__rrrrsave_pkg_resources_states
rXc
cs"tj|d}t|t`tMtt7t|#t	|t
ddVWdn1s6wYWdn1sEwYWdn1sTwYWdn1scwYWdn1srwYWddSWddS1swYdS)Ntemp
setuptools)r"rjoinrXrSr hide_setuptoolsrr'r+
__import__)	setup_dirtemp_dirrrr
setup_contexts.

"r`>ZCythonrUrZ	distutils_distutils_hackcCs|ddd}|tvS)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    .r)split_MODULES_TO_HIDE)rLbase_modulerrr
_needs_hidingsrhcCs6tjdd}|dur|tttj}t|dS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    rbN)rrNgetZremove_shimfilterrhrQ)rbrNrrrr\s
r\cCs
tjtj|}t|mz@|gt|tjdd<tjd|t	
t	jddt
|t|dd}t||Wdn1sIwYWntyj}z|jr`|jdr`WYd}~n
d}~wwWddSWddS1s~wYdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|Sr)activate)distrrrszrun_setup..__main__)__file__r6)r"rabspathdirnamer`rTrrinsertr__init__	callbacksappendrdictr
SystemExitargs)Zsetup_scriptrxr^nsvrrrrs*

"rc@seZdZdZdZddZddZddZd	d
ZddZ	d
dZ
dD]Zee
er0e
eee<q"d$ddZer=edeZedeZdD]Zee
erReeee<qDddZdD]Zee
ergeeee<qYddZdD]Zee
er|eeee<qnddZddZd d!Zd"d#ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs$g|]}|dst|r|qS)_)rJhasattr)rKnamer<rr
sz,AbstractSandbox.__init__..)dir_os_attrsr<rr<rrss
zAbstractSandbox.__init__cCs"|jD]}tt|t||qdSr)rsetattrr"getattr)r=sourcer}rrr_copys
zAbstractSandbox._copycCs(||tr|jt_|jt_d|_dSr?)r_filebuiltinsfile_openr_activer<rrrr>s


zAbstractSandbox.__enter__cCs$d|_trtt_tt_|tdSNF)rrrrrrrr)r=exc_type	exc_value	tracebackrrrrC!s
zAbstractSandbox.__exit__cCs.||WdS1swYdS)zRun 'func' under os sandboxingNr)r=funcrrrrun(s$zAbstractSandbox.runcttfdd}|S)Ncs>|jr|j||g|Ri|\}}||g|Ri|Sr)r_remap_pair)r=srcdstrxkwr}originalrrwrap0s z3AbstractSandbox._mk_dual_path_wrapper..wraprrr}rrrr_mk_dual_path_wrapper-s
z%AbstractSandbox._mk_dual_path_wrapper)renamelinksymlinkNcs pttfdd}|S)Ncs6|jr|j|g|Ri|}|g|Ri|Sr)r_remap_inputr=rrxrrrrr>sz5AbstractSandbox._mk_single_path_wrapper..wrapr)r}rrrrr_mk_single_path_wrapper;sz'AbstractSandbox._mk_single_path_wrapperrr)statlistdirr)rchmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ	startfilemkfifomknodpathconfaccesscr)NcsT|jr|j|g|Ri|}||g|Ri|S|g|Ri|Sr)rr
_remap_outputrrrrrcsz4AbstractSandbox._mk_single_with_return..wraprrrrr_mk_single_with_return`
z&AbstractSandbox._mk_single_with_return)readlinktempnamcr)Ncs$|i|}|jr||S|Sr)rr)r=rxrretvalrrrrrsz'AbstractSandbox._mk_query..wraprrrrr	_mk_queryorzAbstractSandbox._mk_query)r(tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r=rrrr_validate_path~szAbstractSandbox._validate_pathcO
||SzCalled for path inputsrr=	operationrrxrrrrr
zAbstractSandbox._remap_inputcCr)zCalled for path outputsr)r=rrrrrrrzAbstractSandbox._remap_outputcOs<|j|d|g|Ri||j|d|g|Ri|fS)?Called for path pairs like rename, link, and symlink operationsz-fromz-to)rr=rrrrxrrrrrszAbstractSandbox._remap_pairr)r6r7r8r9rrsrr>rCrrr}r|rrrrrrrrrrrrrrrr
sF








rdevnullc@seZdZdZegdZgZ	efddZ	ddZ
er!ddd	Zdd
dZdd
Z
ddZddZddZddZdddZdS)rz.)
r"rrr_sandboxr[_prefix_exceptionsrrs)r=Zsandbox
exceptionsrrrrsszDirectorySandbox.__init__cOsddlm}||||)Nr)r)r0r)r=rrxrrrrr
_violationszDirectorySandbox._violationrcOF|dvr||s|jd||g|Ri|t||g|Ri|S)Nrrtr	ZrUUr)_okrrr=rrrxrrrrrzDirectorySandbox._filecOr)Nrr)rrrrrrrrrzDirectorySandbox._opencCs|ddS)Nr)rr<rrrrszDirectorySandbox.tmpnamcCsR|j}z!d|_tjtj|}||p ||jkp ||jW||_S||_wr)	rr"rrr	_exemptedrrJr)r=ractiverrrrrs

zDirectorySandbox._okcs<fdd|jD}fdd|jD}t||}t|S)Nc3s|]}|VqdSrrI)rK	exceptionfilepathrrrMs

z-DirectorySandbox._exempted..c3s|]	}t|VqdSr)rematch)rKpatternrrrrMs
)r_exception_patterns	itertoolschainany)r=rZ
start_matchesZpattern_matches
candidatesrrrrs

zDirectorySandbox._exemptedcOs:||jvr||s|j|tj|g|Ri||Sr)	write_opsrrr"rrrrrrrs"zDirectorySandbox._remap_inputcOs8||r
||s|j|||g|Ri|||fS)r)rrrrrrrszDirectorySandbox._remap_paircOsL|t@r||s|jd|||g|Ri|tj|||g|Ri|S)zCalled for low-level os.open()zos.open)WRITE_FLAGSrrrr)r=rflagsrrxrrrrrszDirectorySandbox.openN)r)r)r6r7r8r9rvfromkeysrr_EXCEPTIONSrsrrrrrrrrrrrrrrs$



rcCsg|]}tt|dqS)rr)rKarrrr~s
r~z4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZedZddZdS)rzEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        cCs |j\}}}|jjditS)Nr)rxtmplformatr)r=cmdrxkwargsrrr__str__szSandboxViolation.__str__N)	r6r7r8r9textwrapdedentlstriprrrrrrrsrr)9r"rr$operator	functoolsrr
contextlibr-rrrUdistutils.errorsrrplatformrJZ$org.python.modules.posix.PosixModulepythonrNposixZPosixModulerr}rr	NameErrorrr__all__rcontextmanagerrr r'r+r/r,r;rSrQrXr`rfrhr\rrr|rrrreduceor_rerrrrrrsv 





	


	
	
^	PK!Ur+RR"__pycache__/monkey.cpython-310.pycnu[o

Xaia@sdZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
gZ	ddZddZ
dd	Zd
dZdd
ZddZddZddZdS)z
Monkey patching of distutils.
N)
import_modulecCs"tdkr|f|jSt|S)am
    Returns the bases classes for cls sorted by the MRO.

    Works around an issue on Jython where inspect.getmro will not return all
    base classes if multiple classes share the same name. Instead, this
    function will return a tuple containing the class itself, and the contents
    of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
    Jython)platformpython_implementation	__bases__inspectgetmro)clsr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/monkey.py_get_mros	
rcCs.t|trtnt|tjrtndd}||S)NcSsdS)Nr
)itemr
r
r(szget_unpatched..)
isinstancetypeget_unpatched_classtypesFunctionTypeget_unpatched_function)r
lookupr
r
r
get_unpatched$s
rcCs:ddt|D}t|}|jdsd|}t||S)zProtect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css |]}|jds|VqdS)
setuptoolsN)
__module__
startswith).0r	r
r
r	3s

z&get_unpatched_class..	distutilsz(distutils has already been patched by %r)rnextrrAssertionError)r	Zexternal_basesbasemsgr
r
rr-srcCstjtj_tjdk}|rtjtj_tjdkp/dtjko dknp/dtjko-dkn}|r9d}|tjj	_
ttjtjtj
fD]}tjj|_qDtjjtj_tjjtj_dtjvretjjtjd_tdS)N)r!)
)r!)r!r&)r!r"zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rCommandrcoresysversion_infofindallfilelistconfig
PyPIRCCommandDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdDistribution	extension	Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehousemoduler
r
r	patch_all?s*







r:cCs*dD]}ttj|}ttjj||qdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)write_pkg_file
read_pkg_fileZget_metadata_versionN)getattrrr2setattrrDistributionMetadata)attrnew_valr
r
rr1fsr1cCs*t||}t|d|t|||dS)z
    Patch func_name in target_mod with replacement

    Important - original must be resolved by name to avoid
    patching an already patched function.
    	unpatchedN)r=vars
setdefaultr>)replacementZ
target_mod	func_nameoriginalr
r
r
patch_funcms
rHcCs
t|dS)NrB)r=)	candidater
r
rr~s
rcstdtdkrdSfdd}t|d}t|d}zt|dt|d	Wn	ty5Ynwzt|d
Wn	tyGYnwz	t|dWdSty[YdSw)z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvcWindowsNcsLd|vrdnd}||d}t|}t|}t||s!t||||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        msvc9Zmsvc9_Zmsvc14__)lstripr=rhasattrImportError)mod_namerFZrepl_prefixZ	repl_namereplmodZmsvcr
rpatch_paramss


z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)rrsystem	functoolspartialrHrO)rTrKZmsvc14r
rSrr8s,
r8)__doc__r*distutils.filelistrrrrV	importlibrrr__all__rrrr:r1rHrr8r
r
r
rs&	'PK!4"__pycache__/errors.cpython-310.pycnu[o

Xai@s&dZddlmZGdddeeZdS)zCsetuptools.errors

Provides exceptions used by setuptools modules.
)DistutilsErrorc@seZdZdZdS)RemovedCommandErroraOError used for commands that have been removed in setuptools.

    Since ``setuptools`` is built on ``distutils``, simply removing a command
    from ``setuptools`` will make the behavior fall back to ``distutils``; this
    error is raised if a command exists in ``distutils`` but has been actively
    removed in ``setuptools``.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/errors.pyr	srN)rdistutils.errorsrRuntimeErrorrrrrr	sPK!{ѳ&__pycache__/py34compat.cpython-310.pycnu[o

Xai@sTddlZzddlZWn	eyYnwzejjZWdSey)ddZYdSw)NcCs|j|jS)N)loaderload_modulename)specr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/py34compat.pymodule_from_specsr)	importlibimportlib.utilImportErrorutilrAttributeErrorrrrrsPK!XL )__pycache__/unicode_utils.cpython-310.pycnu[o

Xai@s,ddlZddlZddZddZddZdS)NcCsRt|trtd|Sz|d}td|}|d}W|Sty(Y|Sw)NZNFDutf-8)
isinstancestrunicodedata	normalizedecodeencodeUnicodeError)pathr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/unicode_utils.py	decomposes

r
c	CsRt|tr|Stpd}|df}|D]}z||WSty&YqwdS)zY
    Ensure that the given path is decoded,
    NONE when no expected encoding works
    rN)rrsysgetfilesystemencodingrUnicodeDecodeError)r
Zfs_enc
candidatesencrrrfilesys_decodes
rcCs"z||WStyYdSw)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrrrr
try_encode%s
r)rrr
rrrrrrs
PK!A&!__pycache__/wheel.cpython-310.pycnu[o

Xai` @sdZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlm
Z
ddlmZddlmZddlmZe	d	e	jjZd
ZddZGd
ddZdS)zWheels support.)get_platform)logN)
parse_version)sys_tags)canonicalize_name)write_requirementsz^(?P.+?)-(?P\d.*?)
    ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?)
    )\.whl$z8__import__('pkg_resources').declare_namespace(__name__)
cCst|D]Q\}}}tj||}|D]}tj||}tj|||}t||qttt|D]"\}	}
tj||
}tj|||
}tj	|sUt||||	=q3qtj|ddD]\}}}|rgJt
|q^dS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN)oswalkpathrelpathjoinrenamesreversedlist	enumerateexistsrmdir)src_dirZdst_dirdirpathdirnames	filenamessubdirfsrcdstndr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/wheel.pyunpacks$	r c@sheZdZddZddZddZddZd	d
ZddZd
dZ	e
ddZe
ddZe
ddZ
dS)WheelcCsPttj|}|durtd|||_|D]
\}}t|||qdS)Nzinvalid wheel name: %r)	
WHEEL_NAMEr	rbasename
ValueErrorfilename	groupdictitemssetattr)selfr%matchkvrrr__init__6szWheel.__init__cCs&t|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..)	itertoolsproduct
py_versionsplitabiplatformr)rrrtags>s



z
Wheel.tagscs0tddtDtfdd|DdS)z5Is the wheel is compatible with the current platform?css |]}|j|j|jfVqdSN)interpreterr3r4.0trrr	Hs
z&Wheel.is_compatible..c3s|]	}|vrdVqdS)TNrr9supported_tagsrrr<JsF)setrnextr6r5rr=r
is_compatibleFszWheel.is_compatiblecCs,tj|j|j|jdkr
dntddS)Nany)project_nameversionr4z.egg)
pkg_resourcesDistributionrCrDr4regg_namer5rrrrGLszWheel.egg_namecCsF|D]}t|}|drt|t|jr|Sqtd)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)namelist	posixpathdirnameendswithr
startswithrCr$)r)zfmemberrJrrr
get_dist_infoRs

zWheel.get_dist_infocCs>t|j}|||WddS1swYdS)z"Install wheel as an egg directory.N)zipfileZipFiler%_install_as_egg)r)destination_eggdirrMrrrinstall_as_egg\s"zWheel.install_as_eggcCs\d|j|jf}||}d|}tj|d}|||||||||||dS)Nz%s-%sz%s.dataEGG-INFO)	rCrDrOr	rr
_convert_metadata_move_data_entries_fix_namespace_packages)r)rSrMZ
dist_basename	dist_info	dist_dataegg_inforrrrRas
zWheel._install_as_eggc	sTfdd}|d}t|d}td|kotdkn}|s*td|t||tj|tj	j
|t|dd	d
tt
tfddjD}t|ttj|d
tj|dtj	t|dd}	tjj}
ttjzt|	ddtj|dWt|
dSt|
w)NcsTt|}|d}tj|WdS1s#wYdS)Nzutf-8)	openrIr
readdecodeemailparserParserparsestr)namefpvalue)rYrMrrget_metadatams$z-Wheel._convert_metadata..get_metadataZWHEELz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)metadatacSsd|_t|Sr7)markerstr)reqrrrraw_reqsz(Wheel._convert_metadata..raw_reqc
s2i|]}|tfddt|fDqS)c3s|]	}|vr|VqdSr7r)r:rj)install_requiresrrr<sz5Wheel._convert_metadata...)sortedmaprequires)r:extra)distrlrkrr
sz+Wheel._convert_metadata..METADATAzPKG-INFO)rlextras_require)attrsr[zrequires.txt)rgetr$r	mkdir
extractallrr
rErF
from_locationPathMetadatarrmrnroextrasrename
setuptoolsdictr_global_log	threshold
set_thresholdWARNrget_command_obj)rMrSrYr[rfwheel_metadata
wheel_versionZwheel_v1rtZ
setup_distZ
log_thresholdr)rqrYrlrkrMrrVksR


zWheel._convert_metadatacstj|tjd}tj|rNtj|dd}t|t|D]"}|dr8ttj||q&ttj||tj||q&t	|t
tjjfdddDD]}t||q\tjrqt	dSdS)z,Move data entries to their correct location.scriptsrUz.pycc3s|]
}tj|VqdSr7)r	rr
)r:rrZrrr<s

z+Wheel._move_data_entries..)dataheaderspurelibplatlibN)r	rr
rrwlistdirrKunlinkr|rfilterr )rSrZZdist_data_scriptsZegg_info_scriptsentryrrrrrWs,


zWheel._move_data_entriesc	Cstj|d}tj|rkt|}|}Wdn1s"wY|D]C}tjj|g|dR}tj|d}tj|sJt|tj|sjt|d
}|t	Wdn1sewYq)dSdS)Nznamespace_packages.txtr.z__init__.pyw)
r	rr
rr\r]r2rwwriteNAMESPACE_PACKAGE_INIT)r[rSZnamespace_packagesrdmodZmod_dirZmod_initrrrrXs&

zWheel._fix_namespace_packagesN)__name__
__module____qualname__r-r6rArGrOrTrRstaticmethodrVrWrXrrrrr!4s


?
r!)__doc__distutils.utilr	distutilsrr_r/r	rIrerPrEr}rZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_inforcompileVERBOSEr*r"rr r!rrrrs2PK!4!!)__pycache__/package_index.cpython-310.pycnu[o

XaiΛ@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+dd	l,m-Z-e.d
Z/e.dej0Z1e.dZ2e.d
ej0j3Z4d5Z6gdZ7dZ8dZ9e9j:dj:ej;edZddZ?dBddZ@dBddZAdBddZBdedfd d!ZCd"d#ZDe.d$ej0ZEeDd%d&ZFGd'd(d(ZGGd)d*d*eGZHGd+d,d,eZIe.d-jJZKd.d/ZLd0d1ZMdCd2d3ZNd4d5ZOGd6d7d7ZPGd8d9d9ejQZRejSjTfd:d;ZUdd?ZWd@dAZXdS)Dz#PyPI and direct package downloadingNwraps)

CHECKOUT_DISTDistributionBINARY_DISTnormalize_pathSOURCE_DISTEnvironmentfind_distributions	safe_namesafe_versionto_filenameRequirementDEVELOP_DISTEGG_DIST)log)DistutilsError)	translate)Wheelunique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgz)PackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezsz(interpret_distro_name..Nr3)
py_versionrArS)r7anyrangerPrjoin)rJrQrFr]rArSr9rZr!r!r"rs
$
rcstfdd}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cst|i|SNr)argskwargsfuncr!r"wrapperszunique_values..wrapperr)rerfr!rdr"
unique_valuessrgz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c	cst|D]2}|\}}tttj|d}d|vs#d|vr8t	|D]}t
j|t
|dVq(qdD] }||}|dkr[t	||}|r[t
j|t
|dVq;dS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager0r3)z
Home PagezDownload URLr/N)RELfinditergroupssetmapstrstripr'r7HREFr4rurljoin
htmldecoderEfindsearch)r8pagerDtagrelZrelsposr!r!r"find_external_linkss 
ryc@(eZdZdZddZddZddZdS)	ContentCheckerzP
    A null content checker that defines the interface for checking content
    cCdS)z3
        Feed a block of data to the hash.
        Nr!selfblockr!r!r"feedzContentChecker.feedcCr|)zC
        Check the hash. Return False if validation fails.
        Tr!r~r!r!r"is_validrzContentChecker.is_validcCr|)zu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        Nr!)r~reportertemplater!r!r"reportszContentChecker.reportN)__name__
__module____qualname____doc__rrrr!r!r!r"r{s
r{c@sBeZdZedZddZeddZddZ	dd	Z
d
dZdS)
HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t||_||_dSra)	hash_namehashlibnewhashexpected)r~rrr!r!r"__init__s
zHashChecker.__init__cCsBtj|d}|s
tS|j|}|stS|di|S)z5Construct a (possibly null) ContentChecker from a URLr/Nr!)r4rr5r{patternrt	groupdict)clsr8r?rDr!r!r"from_urlszHashChecker.from_urlcCs|j|dSra)rupdater}r!r!r"rzHashChecker.feedcCs|j|jkSra)r	hexdigestrrr!r!r"rrzHashChecker.is_validcCs||j}||Sra)r)r~rrmsgr!r!r"rs
zHashChecker.reportN)rrrrXcompilerrclassmethodrrrrr!r!r!r"rs

rcsLeZdZdZ		dLddZdMd	d
ZdMddZdMd
dZddZddZ	ddZ
ddZddZdNddZ
ddZdNfdd	Zdd Zd!d"Zd#d$Zd%d&Zd'd(Z		dOd)d*ZdPd+d,Zd-d.Zd/Zd0d1Zd2d3ZdNd4d5Zd6d7Zd8d9Zd:d;Zdd?Z e!dMd@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'Z(S)Qrz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOsrtj|g|Ri||dd|d|_i|_i|_i|_td	t
t|j|_
g|_tjj|_dS)Nr.|)r	rr(	index_urlscanned_urlsfetched_urls
package_pagesrXrr`rmrrDallowsto_scanr4requesturlopenopener)r~rhostsZ	ca_bundleZ
verify_sslrbkwr!r!r"rszPackageIndex.__init__FcCs||jvr	|s	dSd|j|<t|s||dStt|}|r.||s(dS|d||s7|r7||jvrAtt|j	|dS||sMd|j|<dS|
d|d|j|<d}||||}|durhdSt|t
jjr||jdkr||
d|jd|j|j<d|jd	d
vr|dS|j}|}t|tst|t
jjrd}n|jdpd}||d
}|t|D]}	t
j|t|	 d}
|!|
q|"|j#rt$|dddkr|%||}dSdSdS)z.)filterrUr<rr	itertoolsstarmap
scan_egg_link)r~search_pathdirsZ	egg_linksr!r!r"scan_egg_links|s
zPackageIndex.scan_egg_linkscCsttj||}ttdttj|}Wdn1swYt	|dkr,dS|\}}t
tj||D]}tjj|g|R|_t|_
||q9dS)Nr\)openrUr<r`rrrmrnrorPr
rJrrAr)r~r<rZ	raw_lineslinesZegg_pathZ
setup_pathrGr!r!r"rszPackageIndex.scan_egg_linkcCsd}||js
|Stttjj|t|jdd}t|dks)d|dvr+|St	|d}t
|d}d|j|
i|<t|t|fS)N)NNr.r\r2r3rT)r)rrrmr4rr6rPr7rrr
setdefaultr'r
)r~rZNO_MATCH_SENTINELr9pkgverr!r!r"_scanszPackageIndex._scanc	
Cst|D]}z|tj|t|dWqty!Yqw||\}}|s-dSt	||D]$}t
|\}}|drQ|sQ|rL|d||f7}n|||
|q2tdd|S)z#Process the contents of a PyPI pager3r.pyz
#egg=%s-%scSsd|dddS)Nz%sr3r\)rE)mr!r!r"sz,PackageIndex.process_index..)rprjrr4rrqrrrErryr@r(need_version_infoscan_urlPYPI_MD5sub)	r~r8rurDrrnew_urlr+fragr!r!r"rs&"
zPackageIndex.process_indexcCs|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_allr~r8r!r!r"rszPackageIndex.need_version_infocGs<|j|jvr|r|j|g|R|d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrrr~rrbr!r!r"rszPackageIndex.scan_allcCsz||j|jd|j|js||j|jd|j|js)||t|j|jdD]}||q3dS)Nr.r!)	rrunsafe_namerrkeyrKnot_found_in_indexr)r~requirementr8r!r!r"
find_packagess
zPackageIndex.find_packagescsR|||||jD]}||vr|S|d||qtt|||S)Nz%s does not match %s)prescanrrrsuperrobtain)r~r	installerrG	__class__r!r"rs
zPackageIndex.obtaincCsL||jd||s$|t|td|jjtj	
|fdS)z-
        checker is a ContentChecker
        zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N)rrrrrUunlinkrrr*r<rQ)r~checkerrVtfpr!r!r"
check_hashs
zPackageIndex.check_hashcCsN|D]"}|jdust|r|dstt|r||q|j|qdS)z;Add `urls` to the list that will be prescanned for searchesNfile:)rrr)rrrappend)r~urlsr8r!r!r"add_find_linkss

zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrmrrr!r!r"rs
zPackageIndex.prescancCs<||jr|jd}}n|jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rrrrr)r~rmethrr!r!r"rs
zPackageIndex.not_found_in_indexcCs~t|ts5t|}|r)||d||}t|\}}|dr'||||}|Stj	
|r1|St|}t|
||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path

        `spec` may be a ``Requirement`` object, or a string containing a URL,
        an existing local filename, or a project/version requirement spec
        (i.e. the string form of a ``Requirement`` object).  If it is the URL
        of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one
        that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is
        automatically created alongside the downloaded file.

        If `spec` is a ``Requirement`` object or a string containing a
        project/version requirement spec, this method returns the location of
        a matching distribution (possibly after downloading it to `tmpdir`).
        If `spec` is a locally existing file or directory name, it is simply
        returned unchanged.  If `spec` is a URL, it is downloaded to a subpath
        of `tmpdir`, and the local filename is returned.  Various errors may be
        raised if a problem occurs during downloading.
        r3rrJN)rrr
_download_urlrEr@r(	gen_setuprUr<rr#rfetch_distribution)r~rtmpdirr:foundr+r?r!r!r"r0s

zPackageIndex.downloadc	sd|id}d
fdd	}|r$|||}|s/|dur/|||}|dur@jdur<||}|durO|sO|||}|dur`drZdp[d|dSd||j|jd	S)a|Obtain a distribution suitable for fulfilling `requirement`

        `requirement` must be a ``pkg_resources.Requirement`` instance.
        If necessary, or if the `force_scan` flag is set, the requirement is
        searched for in the (online) package index as well as the locally
        installed packages.  If a distribution matching `requirement` is found,
        the returned distribution's ``location`` is the value you would have
        gotten from calling the ``download()`` method with the matching
        distribution's URL or filename.  If no matching distribution is found,
        ``None`` is returned.

        If the `source` flag is set, only source distributions and source
        checkout links will be considered.  Unless the `develop_ok` flag is
        set, development and system eggs (i.e., those using the ``.egg-info``
        format) will be ignored.
        zSearching for %sNcs|dur}||jD];}|jtkr#s#|vr"d|d|<q||vo.|jtkp.}|rF|j}||_tj	
|jrF|SqdS)Nz&Skipping development or system egg: %sr3)rrArrrr0rJdownload_locationrUr<r)reqenvrGtestloc
develop_okr~skippedsourcer	r!r"rsUs(z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rJra)rrrrrcloner)	r~rr	
force_scanrrZlocal_indexrGrsr!rr"r=s2




zPackageIndex.fetch_distributioncCs"|||||}|dur|jSdS)a3Obtain a file suitable for fulfilling `requirement`

        DEPRECATED; use the ``fetch_distribution()`` method now instead.  For
        backward compatibility, this routine is identical but returns the
        ``location`` of the downloaded distribution instead of a distribution
        object.
        N)rrJ)r~rr	rrrGr!r!r"fetchszPackageIndex.fetchc
	Cst|}|rddt||ddDpg}t|dkrxtj|}tj||krEtj	||}ddl
m}|||sEt
|||}ttj	|dd}	|	d|dj|djtj|dfWd|S1sqwY|S|rtd	||ftd
)NcSsg|]}|jr|qSr!)rL)rYdr!r!r"
sz*PackageIndex.gen_setup..r3r)samefilezsetup.pywzIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rCrDrrErPrUr<rQdirnamer`Zsetuptools.command.easy_installrshutilcopy2rwriterKrLsplitextr)
r~rVr?r	rDrrQdstrrr!r!r"rsF



		zPackageIndex.gen_setupi cCs2|d|d}zt|}||}t|tjjr%td||j	|j
f|}d}|j}d}d|vrI|d}	t
tt|	}||||||t|d1}
	||}|ro|||
||d	7}||||||nnqP||||
Wdn1swY|W|r|SS|r|ww)
NzDownloading %szCan't download %s: %s %srr/zcontent-lengthzContent-LengthwbTr3)rrrrrr4rrrrrdl_blocksizeget_allmaxrmint
reporthookrrrrrr)r~r8rVfprrblocknumbssizesizesrrr!r!r"_download_tosF





	

zPackageIndex._download_tocCsdSrar!)r~r8rVr(Zblksizer*r!r!r"r&zPackageIndex.reporthookc
Cs|dr	t|Szt||jWSttjjfyD}z$ddd|j	D}|r0|
||n	td||f|WYd}~dSd}~wtj
jyY}z|WYd}~Sd}~wtj
jy}z|rl|
||jn
td||jf|WYd}~dSd}~wtjjy}z|r|
||jn
td||jf|WYd}~dSd}~wtjjtj
fy}z|r|
||n	td||f|WYd}~dSd}~ww)Nr cSsg|]}t|qSr!)rn)rYargr!r!r"rsz)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r)
local_openopen_with_authrrhttpclient
InvalidURLr`rbrrr4rrURLErrorreason
BadStatusLineline
HTTPExceptionsocket)r~r8warningvrr!r!r"rs^
zPackageIndex.open_urlcCst|\}}|rd|vr|dddd}d|vsnd}|dr(|dd}tj||}|dks8|d	r>|||S|d
ksG|drM|||S|drX|	||S|d
krht
jt
j
|dS||d|||S)Nz...\_Z__downloaded__rHr&svnzsvn+gitzgit+zhg+rr\T)r@replacer(rUr<r`r)
_download_svn
_download_git_download_hgr4rurl2pathnamerr5r_attempt_download)r~r:r8r	r*r?rVr!r!r"rs(

zPackageIndex._download_urlcCs||ddS)NT)rrr!r!r"r)rzPackageIndex.scan_urlcCs2|||}d|ddvr||||S|S)Nrrr)r,rr'_download_html)r~r8rVrr!r!r"rG,szPackageIndex._attempt_downloadcCsjt|}|D]}|r%td|r#|t||||Snq|t|td|)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at )	r���ro���rX���rt���r���rU���r���rC��r���)r~���r8���r���rV���r���r8��r!���r!���r"���rH��3��s���

zPackageIndex._download_htmlc�����������������C���s��t�dt�|ddd�}d}|�drqd|v�rqtj|\}}}}}}	|sq|drqd	|d
d��v�rq|d
d��d	d\}}t	|\}
}|
rqd|
v�r]|
dd\}}
d||
f�}nd
|
�}|}||||||	f}tj
|}|�d||�t
d|||f��|S�)Nz"SVN download support is deprecatedr2���r3���r���r���zsvn:@z//r.���r\���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)warningsr���UserWarningr7���r'���r)���r4���r���r5���
_splituser
urlunparser���rU���system)r~���r8���rV���credsr:���netlocr<���rZ���qr���authhostuserpwr9���r!���r!���r"���rC��B��s&���zPackageIndex._download_svnc�����������������C���sp���t�j|�\}}}}}|ddd�}|ddd�}d�}d|v�r)|dd\}}t�j||||df}�|�|fS�)N+r3���r/���r2���r���rI��r���)r4���r���urlsplitr7���rsplit
urlunsplit)r8���
pop_prefixr:���rQ��r<���r>���r���revr!���r!���r"���_vcs_split_rev_from_urlX��s���z$PackageIndex._vcs_split_rev_from_urlc�����������������C���l���|�ddd�}|�j|dd\}}|�d||�td||f��|d�ur4|�d|�td	||f��|S�)
Nr2���r3���r���Tr[��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %sr7���r]��r���rU���rO��r~���r8���rV���r\��r!���r!���r"���rD��j�����zPackageIndex._download_gitc�����������������C���r^��)
Nr2���r3���r���Tr_��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -qr`��ra��r!���r!���r"���rE��z��rb��zPackageIndex._download_hgc�����������������G������t�j|g|R���d�S�ra���)r���r���r���r!���r!���r"���r��������zPackageIndex.debugc�����������������G���rc��ra���)r���r���r���r!���r!���r"���r�����rd��zPackageIndex.infoc�����������������G���rc��ra���)r���r���r���r!���r!���r"���r�����rd��zPackageIndex.warn)r���r���NT)Fra���)FFFN)FF))r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r��r���r���r0���r��r��r��r"��r,��r&��r���r��r���rG��rH��rC��staticmethodr]��rD��rE��r���r���r���
__classcell__r!���r!���r���r"���r�����sT����


5



		
#

L
)$
#r���z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�����������������C���s���|��d}t|S�)Nr���)rE���r���unescape)rD���whatr!���r!���r"���
decode_entity��s���

ri��c�����������������C���s
���t�t|�S�)a��
    Decode HTML entities in the given text.

    >>> htmldecode(
    ...     'https://../package_name-0.1.2.tar.gz'
    ...     '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz')
    'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz'
    )
entity_subri��)textr!���r!���r"���rr�����s���
	rr���c��������������������s����fdd}|S�)Nc��������������������s����fdd}|S�)Nc���������������	������s:���t��}t��z
�|�i�|W�t�|�S�t�|�w�ra���)r:��getdefaulttimeoutsetdefaulttimeout)rb���rc���Zold_timeout)re���timeoutr!���r"���_socket_timeout��s
���
z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr!���)re���ro��rn��rd���r"���ro����s���z'socket_timeout.<locals>._socket_timeoutr!���)rn��ro��r!���rp��r"���socket_timeout��s���rq��c�����������������C���s2���t�j|�}|�}t|}|�}|ddS�)a9��
    Encode auth from a URL suitable for an HTTP header.
    >>> str(_encode_auth('username%3Apassword'))
    'dXNlcm5hbWU6cGFzc3dvcmQ='

    Long auth strings should not cause a newline to be inserted.
    >>> long_auth = 'username:' + 'password'*10
    >>> chr(10) in str(_encode_auth(long_auth))
    False
    
r���)r4���r���r6���encodebase64	b64encoder���rB��)rS��Zauth_sZ
auth_bytesZ
encoded_bytesencodedr!���r!���r"���_encode_auth��s
���
rw��c�������������������@���rz���)	
Credentialz:
    A username/password pair. Use like a namedtuple.
    c�����������������C���s���||�_�||�_d�S�ra���usernamepassword)r~���rz��r{��r!���r!���r"���r�����s���
zCredential.__init__c�����������������c���s����|�j�V��|�jV��d�S�ra���ry��r���r!���r!���r"���__iter__��s���zCredential.__iter__c�����������������C���s���dt�|��S�)Nz%(username)s:%(password)s)varsr���r!���r!���r"���__str__��s���zCredential.__str__N)r���r���r���r���r���r|��r~��r!���r!���r!���r"���rx����s
����rx��c�������������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd	S�)

PyPIConfigc�����������������C���sR���t�g�dd}tj|�|�tjtjdd}tj	|r'|�
|�dS�dS�)z%
        Load from ~/.pypirc
        )rz��r{��
repositoryr���~z.pypircN)dictfromkeysconfigparserRawConfigParserr���rU���r<���r`���
expanduserr���r���)r~���defaultsrcr!���r!���r"���r�����s���zPyPIConfig.__init__c��������������������s&����fdd���D�}tt�j|S�)Nc��������������������s ���g�|�]}��|d��r|qS�)r��)r���ro���)rY���sectionr���r!���r"���r����s����z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)sectionsr��rm���_get_repo_cred)r~���Zsections_with_repositoriesr!���r���r"���creds_by_repository��s���
zPyPIConfig.creds_by_repositoryc�����������������C���s6���|��|d�}|t|��|d�|��|d�fS�)Nr��rz��r{��)r���ro���rx��)r~���r��repor!���r!���r"���r����s
���zPyPIConfig._get_repo_credc�����������������C���s*���|�j��D�]
\}}||r|��S�qdS�)z
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N)r��itemsr)���)r~���r8���r��credr!���r!���r"���find_credential��s
���
zPyPIConfig.find_credentialN)r���r���r���r���propertyr��r��r��r!���r!���r!���r"���r����s����
r��c�����������������C���s:��t�j|�}|\}}}}}}|drtjd|dv�r$t|\}	}
nd}	|	sBt�	|�}|rBt
|}	|j|�f}tj
dg|R���|	redt|	�}	||
||||f}
t�j|
}t�j|}|d|	�nt�j|�}|dt�||}|	rt�j|j\}}}}}}||kr||
kr||||||f}
t�j|
|_|S�)	z4Open a urllib2 request, handling HTTP authenticationrJ��znonnumeric port: '')r2��httpsNz*Authenticating as %s for %s (from .pypirc)zBasic 
Authorizationz
User-Agent)r4���r���r5���r(���r2��r3��r4��rM��r��r��rn���rz��r���r���rw��rN��r���Request
add_header
user_agentr8���)r8���r���parsedr:���rQ��r<���paramsr>���r���rS��addressr��r���r9���r���r���r'��s2h2Zpath2Zparam2Zquery2Zfrag2r!���r!���r"���r1����s8���

r1��c�����������������C���s$���|��d\}}}�|r||�fS�d|�fS�)zNsplituser('user[:passwd]@host[:port]')
    --> 'user[:passwd]', 'host[:port]'.rI��N)
rpartition)rT��rU��delimr!���r!���r"���rM��4��s���rM��c�����������������C���s���|�S�ra���r!���)r8���r!���r!���r"���
fix_sf_url?��r-��r��c��������������	���C���s*��t�j|�\}}}}}}t�j|}tj|rt�j|�S�|	dr}tj
|r}g�}t|D�];}	tj||	}
|	dkrXt
|
d}|�}W�d���n1�sQw���Y���n tj
|
rb|	d7�}	|dj|	d�q0d}
|
j|�d|d	}d
\}}nd\}}}dd
i}t|}t�j|�||||S�)z7Read a local path, with special support for directoriesr.���z
index.htmlrNz<a href="{name}">{name}</a>)r*���zB<html><head><title>{url}{files}rr)r8files)OK)rzPath not foundz	Not foundrz	text/html)r4rr5rrFrUr<isfilerr(rrr`rrrformatioStringIOrr)r8r:r;r<paramr>rrVrrfilepathr'bodyrstatusmessagerZbody_streamr!r!r"r0Cs0



r0ra)r)YrsysrUrXrrr:rtrrrKrrhttp.clientr2urllib.parser4urllib.requesturllib.error	functoolsrr
pkg_resourcesrrrrrr	r
rrr
rrr	distutilsrdistutils.errorsrfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrrrCIrprrDrr7rO__all__Z_SOCKET_TIMEOUTZ_tmplrversion_inforr#rr@rrBrWrrgriryr{rrrrjrirrrqrwrxrrrrr1rMrr0r!r!r!r"s<
	


!
#

!
&/PK!,

(__pycache__/archive_util.cpython-310.pycnu[o

Xai@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
gdZGdddeZdd	Z
e
dfd
dZe
fdd
Ze
fddZddZddZe
fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directory)unpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/archive_util.pyrsrcCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsrc	Cs@|ptD]}z
||||WdStyYqwtd|)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``

    `progress_filter` is a function taking two arguments: a source path
    internal to the archive ('/'-separated), and a filesystem path where it
    will be extracted.  The callback must return the desired extract path
    (which may be the same as the one passed in), or else ``None`` to skip
    that file or directory.  The callback can thus be used to report on the
    progress of the extraction, as well as to filter the items extracted or
    alter their extraction paths.

    `drivers`, if supplied, must be a non-empty sequence of functions with the
    same signature as this function (minus the `drivers` argument), that raise
    ``UnrecognizedFormat`` if they do not support extracting the designated
    archive type.  The `drivers` are tried in sequence until one is found that
    does not raise an error, or until all are exhausted (in which case
    ``UnrecognizedFormat`` is raised).  If you do not supply a sequence of
    drivers, the module's ``extraction_drivers`` constant will be used, which
    means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that
    order.
    Nz!Not a recognized archive type: %s)r	r)filenameextract_dirprogress_filterZdriversZdriverrrrrsrcCstj|std||d|fi}t|D]Q\}}}||\}}|D]}	||	dtj||	f|tj||	<q$|D]*}
tj||
}|||
|}|sPq=t|tj||
}
t|
|t	|
|q=qdS)z"Unpack" a directory, using the same interface as for archives

    Raises ``UnrecognizedFormat`` if `filename` is not a directory
    z%s is not a directory/N)
ospathisdirrwalkjoinrshutilcopyfilecopystat)rrrpathsbasedirsfilesrrdftargetrrrr
@s&*r
c

Cst|std|ft|p}|D]b}|j}|ds'd|dvr(qtj	j
|g|dR}|||}|s=q|drGt|n$t||
|j}t|d
}||Wdn1sfwY|jd?}	|	rxt||	qWddS1swYdS)zUnpack zip `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
    by ``zipfile.is_zipfile()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z%s is not a zip filer..wbN)zipfile
is_zipfilerZipFileinfolistr
startswithsplitrrrendswithrreadopenwrite
external_attrchmod)
rrrzinfonamer&datar%Zunix_attributesrrrr[s0




"rcCs|dur5|s|r5|j}|r$t|j}t||}t|}||}|dur5|s|s|duo@|	p@|
}|rE|Std)z;Resolve any links and extract link targets as normal files.NzGot unknown file type)islnkissymlinkname	posixpathdirnamer8rnormpath
_getmemberisfilerLookupError)tar_objZtar_member_objlinkpathr!Zis_file_or_dirrrr_resolve_tar_file_or_dirs,


rEc
csdd|_t|U|D]I}|j}|dsd|dvr qtjj|g|dR}zt	||}Wn	t
y=Yqw|||}|sFq|tjrR|dd}||fVqWddS1scwYdS)z1Emit member-destination pairs from a tar archive.cWsdS)Nr)argsrrrsz _iter_open_tar..rr'N)
chown
contextlibclosingr8r.r/rrrrErBr0sep)rCrrmemberr8Z
prelim_dst	final_dstrrr_iter_open_tars*

"rOc
Csxzt|}Wntjy}ztd|f|d}~wwt|||D]\}}z|||Wq#tjy9Yq#wdS)zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined
    by ``tarfile.open()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z/%s is not a compressed or uncompressed tar fileNT)tarfiler2TarErrorrrO_extract_memberExtractError)rrrtarobjerMrNrrrrs&r)rr*rPrrr=rJdistutils.errorsr
pkg_resourcesr__all__rrrr
rrErOrr	rrrrs*
$%PK!A|=f"__pycache__/launch.cpython-310.pycnu[o

Xai,@s2dZddlZddlZddZedkredSdS)z[
Launch the Python script on the command line after
setuptools is bootstrapped via import.
NcCsttjd}t|ddd}tjddtjdd<ttdt}||}|}Wdn1s3wY|dd}t	||d}t
||dS)	zP
    Run the script in sys.argv[1] as if it had
    been invoked naturally.
    __main__N)__file____name____doc__openz\r\nz\nexec)__builtins__sysargvdictgetattrtokenizerreadreplacecompiler)script_name	namespaceopen_ZfidscriptZnorm_scriptcoder/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/launch.pyrun
s


rr)rrr
rrrrrrs
PK!Cc]]0__pycache__/_deprecation_warning.cpython-310.pycnu[o

Xai@sGdddeZdS)c@seZdZdZdS)SetuptoolsDeprecationWarningz
    Base class for warning deprecations in ``setuptools``

    This class is not derived from ``DeprecationWarning``, and as such is
    visible by default.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_deprecation_warning.pyrsrN)WarningrrrrrsPK!^Y%__pycache__/extension.cpython-310.pycnu[o

Xai@spddlZddlZddlZddlZddlZddlmZddZeZ	eej
jZGdddeZGdd	d	eZ
dS)
N)
get_unpatchedcCs0d}zt|dgdjWdStyYdSw)z0
    Return True if Cython can be imported.
    zCython.Distutils.build_ext	build_ext)fromlistTF)
__import__r	Exception)Zcython_implr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/extension.py_have_cython
sr
c@s eZdZdZddZddZdS)	Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs.|dd|_tj|||g|Ri|dS)Npy_limited_apiF)popr
_Extension__init__)selfnamesourcesargskwrrr	r!s zExtension.__init__cCsNtrdS|jp	d}|dkrdnd}ttjd|}tt||j	|_	dS)z
        Replace sources with .pyx extensions to sources with the target
        language extension. This mechanism allows language authors to supply
        pre-converted sources but to prefer the .pyx sources.
        Nzc++z.cppz.cz.pyx$)
r
languagelower	functoolspartialresublistmapr)rlangZ
target_extrrrr	_convert_pyx_sources_to_lang's
z&Extension._convert_pyx_sources_to_langN)__name__
__module____qualname____doc__rrrrrr	rsrc@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#rrrr	r$6sr$)rrdistutils.core	distutilsdistutils.errorsdistutils.extensionZmonkeyrr
Z
have_pyrexcorerrr$rrrr	sPK!YSS __pycache__/_imp.cpython-310.pycnu[o

XaiX	@sddZddlZddlZddlZddlmZdZdZdZ	dZ
dZd	d
ZdddZ
dd
dZddZdS)zX
Re-implementation of find_module and get_frozen_object
from the deprecated imp module.
N)module_from_speccCs(t|trtjjntjj}|||SN)
isinstancelist	importlib	machinery
PathFinder	find_specutil)modulepathsfinderr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_imp.pyrs

rc	CsJt||}|durtd||jst|drtjd|j}d}d}t|jt	}|j
dks8|rAt|jtjj
rAt}d}d}}n\|j
dksP|rYt|jtjjrYt}d}d}}nD|jr|j
}tj|d	}|tjjvrod
nd}|tjjvrzt}n|tjjvrt}n|tjjvrt}|tthvrt||}nd}d}}|||||ffS)z7Just like 'imp.find_module()', but with package supportN
Can't find %ssubmodule_search_locationsz__init__.pyfrozenzbuilt-inrrrb)rImportErrorhas_locationhasattrrrspec_from_loaderloaderr	typeorigin
issubclassrFrozenImporter	PY_FROZENBuiltinImporter	C_BUILTINospathsplitextSOURCE_SUFFIXES	PY_SOURCEBYTECODE_SUFFIXESPY_COMPILEDEXTENSION_SUFFIXESC_EXTENSIONopen)	rrspeckindfileZstaticr)suffixmoderrrfind_modulesH





r7cCs&t||}|s
td||j|SNr)rrr get_code)rrr2rrrget_frozen_objectGs
r:cCs"t||}|s
td|t|Sr8)rrr)rrinfor2rrr
get_moduleNs
r<r)__doc__r(importlib.utilrimportlib.machineryZ
py34compatrr,r.r0r'r%rr7r:r<rrrrs
	
*PK!rmƦƦ __pycache__/msvc.cpython-310.pycnu[o

Xai@sdZddlZddlmZddlmZmZddlmZm	Z	m
Z
mZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZdd	lmZed
kr[ddlZddlmZn
Gdd
d
ZeZeejjfZ zddl!m"Z"Wn	e y|YnwddZ#d/ddZ$ddZ%ddZ&dddddZ'ddZ(ddZ)d d!Z*d"d#Z+d0d%d&Z,Gd'd(d(Z-Gd)d*d*Z.Gd+d,d,Z/Gd-d.d.Z0dS)1a
Improved support for Microsoft Visual C++ compilers.

Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
    Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
    Microsoft Windows SDK 6.1 (x86, x64, ia64)
    Microsoft Windows SDK 7.0 (x86, x64, ia64)

Microsoft Visual C++ 10.0:
    Microsoft Windows SDK 7.1 (x86, x64, ia64)

Microsoft Visual C++ 14.X:
    Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
    Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
    Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64)

This may also support compilers shipped with compatible Visual Studio versions.
N)open)listdirpathsep)joinisfileisdirdirname)
LegacyVersion)unique_everseen)
get_unpatchedWindows)environc@seZdZdZdZdZdZdS)winregN)__name__
__module____qualname__
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/msvc.pyr+s
r)RegcCsd}|d|f}zt|d}Wn#ty3z|d|f}t|d}Wnty0d}YnwYnw|rAt|d}t|rA|Stt|S)a
    Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
    compiler build for Python
    (VCForPython / Microsoft Visual C++ Compiler for Python 2.7).

    Fall back to original behavior when the standalone compiler is not
    available.

    Redirect the path of "vcvarsall.bat".

    Parameters
    ----------
    version: float
        Required Microsoft Visual C++ version.

    Return
    ------
    str
        vcvarsall.bat path
    z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f
installdirzWow6432Node\N
vcvarsall.bat)r	get_valueKeyErrorrrrmsvc9_find_vcvarsall)versionZvc_basekey
productdir	vcvarsallrrrrBs$
rx86c
Osztt}|||g|Ri|WStjjyYn	ty$Ynwzt||WStjjyB}zt|||d}~ww)ao
    Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
    Microsoft Visual C++ 9.0 and 10.0 compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    ver: float
        Required Microsoft Visual C++ version.
    arch: str
        Target architecture.

    Return
    ------
    dict
        environment
    N)	rmsvc9_query_vcvarsall	distutilserrorsDistutilsPlatformError
ValueErrorEnvironmentInfo
return_env_augment_exception)verarchargskwargsorigexcrrrr%lsr%cCszttjddtjtjB}Wn
tyYdSwd}d}|^tD]D}zt||\}}}Wn
ty<Yn8w|ri|tj	krit
|riztt|}Wnt
tfy[Yq%w|dkri||kri||}}q%Wd||fSWd||fS1swY||fS)0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7rNNN)rOpenKeyrKEY_READZKEY_WOW64_32KEYOSError	itertoolscount	EnumValueREG_SZrintfloatr)	TypeError)r!best_versionbest_dirivZvc_dirZvtr rrr_msvc14_find_vc2015sH






rDcCstdp	td}|sdSztt|dddddd	d
dd
dd
dddgjddd}Wntjtt	fy;YdSwt|ddd}t
|rKd|fSdS)aPython 3.8 "distutils/_msvccompiler.py" backport

    Returns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    ProgramFiles(x86)ProgramFilesr4zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez-requiresAnyz	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz	-propertyinstallationPathz	-products*mbcsstrict)encodingr'VCZ	AuxiliaryZBuild)rget
subprocesscheck_outputrdecodestripCalledProcessErrorr8UnicodeDecodeErrorr)rootpathrrr_msvc14_find_vc2017s2		
rWx64armarm64)r$Z	x86_amd64Zx86_armZ	x86_arm64c	
Cst\}}d}|tvrt|}nd|vrdnd}|rDt|ddddd|d	d
	}zddl}|j|dd
d}WntttfyCd}Ynw|sUt\}}|rUt|d|dd
}|sYdSt|d}t|sddS|rjt|sld}||fS)r3Namd64rXr$z..redistZMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT)	recursivezMicrosoft.VC140.CRTr4r)	rWPLAT_SPEC_TO_RUNTIMErglobImportErrorr8LookupErrorrDr)		plat_spec_rA	vcruntimeZvcruntime_platZvcredistr`r@r#rrr_msvc14_find_vcvarsalls<



rfc
Csdtvr
ddtDSt|\}}|stjdztjd||tj	dj
ddd	}WntjyF}ztjd
|j|d}~wwddd
d|
DD}|r[||d<|S)r3ZDISTUTILS_USE_SDKcSsi|]	\}}||qSrlower).0r!valuerrr
sz&_msvc14_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r'zError executing {}NcSs$i|]\}}}|r|r||qSrrg)rir!rdrjrrrrkscss|]}|dVqdS)=N)	partition)rilinerrr	sz%_msvc14_get_vc_env..py_vcruntime_redist)ritemsrfr&r'r(rOrPformatSTDOUTrQrScmd
splitlines)rcr#reoutr2envrrr_msvc14_get_vc_envs<


rzc
Cs4zt|WStjjy}zt|dd}~ww)a*
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    Microsoft Visual C++ 14.X compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    plat_spec: str
        Target architecture.

    Return
    ------
    dict
        environment
    ,@N)rzr&r'r(r,)rcr2rrrmsvc14_get_vc_env(s

r|cOsJdtjvrddl}t|jtdkr|jjj|i|Stt	|i|S)z
    Patched "distutils._msvccompiler.gen_lib_options" for fix
    compatibility between "numpy.distutils" and "distutils._msvccompiler"
    (for Numpy < 1.11.2)
    znumpy.distutilsrNz1.11.2)
sysmodulesZnumpyr	__version__r&Z	ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r/r0nprrrrBs

rrcCs|jd}d|vsd|vrLd}|jdit}d}|dkr5|ddkr0|d	7}n|d
7}n|dkrD|d7}||d
7}n|dkrL|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rr#zvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%d"@Zia64r^z( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27$@z* Get it with "Microsoft Windows SDK 7.1": iW r{zd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/Nr)r/rhrtlocalsfind)r2r r.messagetmplZ
msdownloadrrrr,Os


r,c@sbeZdZdZeddZddZe	ddZ
dd	Zd
dZdd
dZ
dddZdddZdS)PlatformInfoz
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturercCs|dd|_dS)NrXr[)rhrmr.)selfr.rrr__init__szPlatformInfo.__init__cCs|j|jdddS)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        rdrN)r.rrrrr
target_cpus
zPlatformInfo.target_cpucC
|jdkS)z
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r$rrrrr
target_is_x86
	zPlatformInfo.target_is_x86cCr)z
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r$current_cpurrrrcurrent_is_x86rzPlatformInfo.current_is_x86FcC.|jdkr	|r	dS|jdkr|rdSd|jS)uk
        Current platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '†' if architecture is x86.
        x64: bool
            return 'd' and not 'md64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '	arget', or '' (see hidex86 parameter)
        r$rr[\x64\%srrhidex86rXrrrcurrent_dirzPlatformInfo.current_dircCr)ar
        Target platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '\x86' if architecture is x86.
        x64: bool
            return '\x64' and not '\amd64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '\current', or '' (see hidex86 parameter)
        r$rr[rrrrrrr
target_dirrzPlatformInfo.target_dircCs0|rdn|j}|j|krdS|dd|S)ap
        Cross platform specific subfolder.

        Parameters
        ----------
        forcex86: bool
            Use 'x86' as current architecture even if current architecture is
            not x86.

        Return
        ------
        str
            subfolder: '' if target architecture is current architecture,
            '\current_target' if not.
        r$r\z\%s_)rrrrm)rforcex86currentrrr	cross_dirs
zPlatformInfo.cross_dirN)FFF)rrr__doc__rrNrhrrpropertyrrrrrrrrrrrts


rc@seZdZdZejejejejfZ	ddZ
eddZeddZ
edd	Zed
dZedd
ZeddZeddZeddZeddZdddZddZdS)RegistryInfoz
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dSN)pi)rZ
platform_inforrrrs
zRegistryInfo.__init__cCdS)z
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        ZVisualStudiorrrrrvisualstudio
zRegistryInfo.visualstudiocCt|jdS)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        ZSxS)rrrrrrsxs
zRegistryInfo.sxscCr)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        ZVC7rrrrrrvcrzRegistryInfo.vccCr)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        ZVS7rrrrrvsrzRegistryInfo.vscCr)z
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonrrrrr
vc_for_python(rzRegistryInfo.vc_for_pythoncCr)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsrrrrr
microsoft_sdk4rzRegistryInfo.microsoft_sdkcCr)z
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r
rrrrrrwindows_sdk@rzRegistryInfo.windows_sdkcCr)z
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        ZNETFXSDKrrrrr	netfx_sdkLrzRegistryInfo.netfx_sdkcCr)z
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsrrrrrwindows_kits_rootsXrzRegistryInfo.windows_kits_rootsFcCs$|js|r	dnd}td|d|S)a
        Return key in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        x86: str
            Force x86 software registry.

        Return
        ------
        str
            Registry key
        rZWow6432NodeZSoftware	Microsoft)rrr)rr!r$Znode64rrr	microsoftdszRegistryInfo.microsoftc	
Cstj}tj}tj}|j}|jD]l}d}z||||d|}Wn+ttfyI|j	sEz||||dd|}WnttfyDYYqwYqYnwz)zt
||dWW|r^||SSttfykYnwW|rs||q|r{||wwdS)a
        Look for values in registry in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        name: str
            Value name to find.

        Return
        ------
        str
            value
        NrT)rr7r6ZCloseKeyrHKEYSr8IOErrorrrQueryValueEx)	rr!nameZkey_readZopenkeyZclosekeymshkeybkeyrrrlookupwsD


zRegistryInfo.lookupNr)rrrrrrrrrrrrrrrrrrrrrrrrrrrrs8









rc@s<eZdZdZeddZeddZedeZd7ddZ	d	d
Z
ddZd
dZe
ddZeddZeddZddZddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Z d3d4Z!e
d8d5d6Z"dS)9
SystemInfoz
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    WinDirrrFrENcCs2||_|jj|_||_|p||_|_dSr)rirfind_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)rZ
registry_inforrrrrs



zSystemInfo.__init__cCs>|}|s|jstjdt|}||jt|dS)zm
        Find the latest VC version

        Return
        ------
        float
            version
        z%No Microsoft Visual C++ version foundr^)find_reg_vs_versrr&r'r(setupdatesorted)rZreg_vc_versZvc_versrrrrs	
z(SystemInfo._find_latest_available_vs_vercCsb|jj}|jj|jj|jjf}g}t|jj|D]\}}z
t	|||dtj
}Wnttfy5Yqw|lt
|\}}}	t|D]*}
tttt||
d}||vr`||Wdn1sjwYqEt|D](}
tttt||
}||vr||Wdn1swYqtWdn1swYqt|S)z
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)rrrrrr9productrrr6r7r8rZQueryInfoKeyrange
contextlibsuppressr)r>r;appendEnumKeyr)rrZvckeysZvs_versrr!rZsubkeysvaluesrdrBr-rrrrs>	

zSystemInfo.find_reg_vs_versc	Csi}d}zt|}Wn
ttfy|YSw|D]F}z8t||d}t|ddd
}t|}Wdn1s:wY|d}tt|d||||d	<Wqtttfy`Yqw|S)
z
        Find Visual studio 2017+ versions from information in
        "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances".

        Return
        ------
        dict
            float version as key, path as value.
        z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz
state.jsonrtzutf-8)rKNrG
VC\Tools\MSVCZinstallationVersion)	rr8rrrjsonload_as_float_versionr)	rZvs_versionsZ
instances_dirZhashed_namesrZ
state_pathZ
state_filestateZvs_pathrrrrs0
z#SystemInfo.find_programdata_vs_verscCstd|dddS)z
        Return a string version as a simplified float version (major.minor)

        Parameters
        ----------
        version: str
            Version.

        Return
        ------
        float
            version
        .N)r>rsplit)r rrrrszSystemInfo._as_float_versioncCs.t|jd|j}|j|jjd|jp|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        zMicrosoft Visual Studio %0.1f%0.1f)rProgramFilesx86rrrr)rdefaultrrrVSInstallDir)szSystemInfo.VSInstallDircCs,|p|}t|sd}tj||S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)	_guess_vc_guess_vc_legacyrr&r'r()rrVmsgrrrVCInstallDir:s

zSystemInfo.VCInstallDirc
Cs|jdkrdSz|j|j}Wnty|j}Ynwt|d}zt|d}|||_t||WStt	t
fy@YdSw)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        r{rrr^)rrrrrrrrr8r
IndexError)rZvs_dirZguess_vcrrrrrLs
	

zSystemInfo._guess_vccCsbt|jd|j}t|jjd|j}|j|d}|r!t|dn|}|j|jjd|jp0|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        z Microsoft Visual Studio %0.1f\VCrrrL)rrrrrrr)rrZreg_pathZ	python_vcZ
default_vcrrrrjs	zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkrdS|jdkrdS|jd	kr#d
SdS)z
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        r)z7.0z6.1z6.0ar)z7.1z7.0a&@)z8.0z8.0a(@)8.1z8.1ar{)z10.0rNrrrrrWindowsSdkVersion~s





zSystemInfo.WindowsSdkVersioncC|t|jdS)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        lib)_use_last_dir_namer
WindowsSdkDirrrrrWindowsSdkLastVersion
z SystemInfo.WindowsSdkLastVersioncCs
d}|jD]}t|jjd|}|j|d}|rnq|r"t|s:t|jjd|j}|j|d}|r:t|d}|r@t|s_|jD]}|d|d}d	|}t|j	|}t|r^|}qC|ret|s{|jD]}d
|}t|j	|}t|rz|}qh|st|j
d}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        rzv%sinstallationfolderrrZWinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)rrrrrrrrrfindrFr)rsdkdirr-locrVinstall_baseZintverdrrrrs<




zSystemInfo.WindowsSdkDirc	Cs|jdkr
d}d}nd}|jdkrdnd}|jjd|d}d	||d
df}g}|jdkr?|jD]
}|t|jj||g7}q1|jD]}|t|jj	d
||g7}qB|D]}|j
|d}|rc|SqTdS)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        r#r(rTF)rXrzWinSDK-NetFx%dTools%sr-r{zv%sArN)rrrrmNetFxSdkVersionrrrrrr)	rZnetfxverr.rZfxZregpathsr-rVZexecpathrrrWindowsSDKExecutablePaths&



z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j}|j|dpdS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        z%0.1f\Setup\F#r"r)rrrrr)rrVrrrFSharpInstallDirs
zSystemInfo.FSharpInstallDircCsF|jdkrdnd}|D]}|j|jjd|}|r |pdSqdS)zt
        Microsoft Universal CRT SDK directory.

        Return
        ------
        str
            path
        r{)10Z81rz
kitsroot%srN)rrrr)rversr-rrrrUniversalCRTSdkDirszSystemInfo.UniversalCRTSdkDircCr)z
        Microsoft Universal C Runtime SDK last version.

        Return
        ------
        str
            version
        r)rrrrrrrUniversalCRTSdkLastVersionrz%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSdS)z
        Microsoft .NET Framework SDK versions.

        Return
        ------
        tuple of str
            versions
        r{)	z4.7.2z4.7.1z4.7z4.6.2z4.6.1z4.6z4.5.2z4.5.1z4.5rrrrrrrs
zSystemInfo.NetFxSdkVersioncCs:d}|jD]}t|jj|}|j|d}|r|Sq|S)zu
        Microsoft .NET Framework SDK directory.

        Return
        ------
        str
            path
        rZkitsinstallationfolder)rrrrr)rrr-rrrrNetFxSdkDir*s

zSystemInfo.NetFxSdkDircC"t|jd}|j|jjdp|S)zw
        Microsoft .NET Framework 32bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\FrameworkZframeworkdir32rrrrrrZguess_fwrrrFrameworkDir32<zSystemInfo.FrameworkDir32cCr)zw
        Microsoft .NET Framework 64bit directory.

        Return
        ------
        str
            path
        zMicrosoft.NET\Framework64Zframeworkdir64rrrrrFrameworkDir64LrzSystemInfo.FrameworkDir64cC
|dS)z
        Microsoft .NET Framework 32bit versions.

        Return
        ------
        tuple of str
            versions
         _find_dot_net_versionsrrrrFrameworkVersion32\

zSystemInfo.FrameworkVersion32cCr)z
        Microsoft .NET Framework 64bit versions.

        Return
        ------
        tuple of str
            versions
        @rrrrrFrameworkVersion64hrzSystemInfo.FrameworkVersion64cCs|j|jjd|}t|d|}|p||dpd}|jdkr%|dfS|jdkr<|dd	d
kr8ddfS|dfS|jd
krCdS|jdkrJdSdS)z
        Find Microsoft .NET Framework versions.

        Parameters
        ----------
        bits: int
            Platform number of bits: 32 or 64.

        Return
        ------
        tuple of str
            versions
        zframeworkver%dzFrameworkDir%drCrrzv4.0rNrZv4z
v4.0.30319v3.5r)r
v2.0.50727g @)zv3.0r)rrrgetattrrrrh)rbitsZreg_verZdot_net_dirr-rrrr	ts

$

z!SystemInfo._find_dot_net_versionscs*fddttD}t|dpdS)a)
        Return name of the last dir in path or '' if no dir found.

        Parameters
        ----------
        path: str
            Use dirs in this path
        prefix: str
            Use only dirs starting by this prefix

        Return
        ------
        str
            name
        c3s,|]}tt|r|r|VqdSr)rr
startswith)ridir_namerVprefixrrrqs
z0SystemInfo._use_last_dir_name..Nr)reversedrnext)rVrZ
matching_dirsrrrrs
zSystemInfo._use_last_dir_namerr)#rrrrrrNrrFrrrrrstaticmethodrrrrrrrrrrrrrrrrrr
r
r	rrrrrrs\


*





*
"








rc@sTeZdZdZd=ddZeddZedd	Zed
dZedd
Z	eddZ
eddZeddZeddZ
eddZeddZeddZddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zed6d7Zd>d9d:Zd;d<Z dS)?r*aY
    Return environment variables for specified Microsoft Visual C++ version
    and platform : Lib, Include, Path and libpath.

    This function is compatible with Microsoft Visual C++ 9.0 to 14.X.

    Script created by analysing Microsoft environment configuration files like
    "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ...

    Parameters
    ----------
    arch: str
        Target architecture.
    vc_ver: float
        Required Microsoft Visual C++ version. If not set, autodetect the last
        version.
    vc_min_ver: float
        Minimum Microsoft Visual C++ version.
    NrcCsBt||_t|j|_t|j||_|j|krd}tj	|dS)Nz.No suitable Microsoft Visual C++ version found)
rrrrrsirr&r'r()rr.rZ
vc_min_vererrrrrrs

zEnvironmentInfo.__init__cC|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )rrrrrrr
zEnvironmentInfo.vs_vercCr)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )rrrrrrrrzEnvironmentInfo.vc_vercsVddg}jdkr"jjddd}|dg7}|dg7}|d|g7}fd	d
|DS)zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\Toolsr{TrrXz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scg|]	}tjj|qSrrrrrirVrrr
z+EnvironmentInfo.VSTools..)rrr)rpathsarch_subdirrrrVSToolss



zEnvironmentInfo.VSToolscCst|jjdt|jjdgS)z
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        IncludezATLMFC\Includerrrrrrr
VCIncludess
zEnvironmentInfo.VCIncludescsbjdkr
jjdd}njjdd}d|d|g}jdkr(|d|g7}fd	d
|DS)z
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        .@TrXrLib%szATLMFC\Lib%sr{zLib\store%scrrr(r!rrrr"r#z/EnvironmentInfo.VCLibraries..)rrr)rr%r$rrrVCLibrariess


zEnvironmentInfo.VCLibrariescC|jdkrgSt|jjdgS)z
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        r{zLib\store\references)rrrrrrrrVCStoreRefss

zEnvironmentInfo.VCStoreRefscCs|j}t|jdg}|jdkrdnd}|j|}|r&|t|jd|g7}|jdkr?d|jjdd}|t|j|g7}|S|jdkrw|jrKd	nd
}|t|j||jjddg7}|jj	|jj
kru|t|j||jjddg7}|S|t|jdg7}|S)
zr
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths
        Z
VCPackagesrTFBin%sr{r,r*z
bin\HostX86%sz
bin\HostX64%sr+Bin)rrrrrrrrrrr)rrtoolsrr%rVZhost_dirrrrVCTools(s0


zEnvironmentInfo.VCToolscCsd|jdkr|jjddd}t|jjd|gS|jjdd}t|jjd}|j}t|d||fgS)zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        rTrr-r+rz%sum%s)rrrrrr_sdk_subdir)rr%rZlibverrrrOSLibrariesMs

zEnvironmentInfo.OSLibrariescCsdt|jjd}|jdkr|t|dgS|jdkr|j}nd}t|d|t|d|t|d|gS)	zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        includerglr{rz%ssharedz%sumz%swinrt)rrrrr5)rr7sdkverrrr
OSIncludesas


zEnvironmentInfo.OSIncludescCst|jjd}g}|jdkr||j7}|jdkr |t|dg7}|jdkrM||t|jjdt|ddt|d	dt|d
dt|jjddd
|jdddg7}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        Z
ReferencesrrzCommonConfiguration\Neutralr{Z
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsrZCommonConfigurationZneutral)rrrrr6)rreflibpathrrr	OSLibpathys2






zEnvironmentInfo.OSLibpathcCst|S)zs
        Microsoft Windows SDK Tools.

        Return
        ------
        list of str
            paths
        )list
_sdk_toolsrrrrSdkToolsrzEnvironmentInfo.SdkToolsccs|jdkr|jdkr
dnd}t|jj|V|js/|jjdd}d|}t|jj|V|jdvrQ|jr.crJr)rrrKrLrrr"rM)	rrrrrrrr
r
)rrZ	include32Z	include64r3rrLrFxToolss"

zEnvironmentInfo.FxToolscCs8|jdks	|jjsgS|jjdd}t|jjd|gS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        r{Tr+zlib\um%s)rrrrrr)rr%rrrNetFxSDKLibrariess
z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks	|jjsgSt|jjdgS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        r{z
include\um)rrrrrrrrNetFxSDKIncludess
z EnvironmentInfo.NetFxSDKIncludescCst|jjdgS)z
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deployr rrrrVsTDb$s
zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr|jj}|jjdd}n|jj}d}d|j|f}t||g}|jdkr9|t||dg7}|S)zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        rr*Tr,rzMSBuild\%0.1f\bin%sZRoslyn)rrrrrrr)r	base_pathr%rVbuildrrrMSBuild0s



zEnvironmentInfo.MSBuildcCr/)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        rzHTML Help Workshop)rrrrrrrrHTMLHelpWorkshopLrIz EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjd}|j}t|d||fgS)z
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        r{Tr+rz%sucrt%s)rrrrrr_ucrt_subdir)rr%rrErrr
UCRTLibraries[s

zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd}t|d|jgS)z
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        r{r7z%sucrt)rrrrrV)rr7rrrUCRTIncludesms

zEnvironmentInfo.UCRTIncludescCrB)z
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        rCr)rrrDrrrrV}rFzEnvironmentInfo._ucrt_subdircCs$d|jkrdkr
gS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        rr)rrrrrrrFSharps

zEnvironmentInfo.FSharpc
Csd|j}|jjddd}g}|jj}t|dd}t|r3t	|t
|d}||t	|dg7}|t	|d	g7}d
|jdd
t|jdf}t
||D]\}}t	||||}	t|	rd|	SqQdS)
z
        Microsoft Visual C++ runtime redistributable dll.

        Return
        ------
        str
            path
        zvcruntime%d0.dllTr+rz\Toolsz\Redistr^Zonecorer\zMicrosoft.VC%d.CRT
N)rrrrRrrrrmrrrr=rr9rr)
rrer%prefixesZ
tools_pathZredist_pathZcrt_dirsrZcrt_dirrVrrrVCRuntimeRedists$

zEnvironmentInfo.VCRuntimeRedistTcCst|d|j|j|j|jg||d|j|j|j|j	|j
g||d|j|j|j|jg||d|j
|j|j|j|j|j|j|j|jg	|d}|jdkrWt|jrW|j|d<|S)z
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.

        Return
        ------
        dict
            environment
        r7rr<rV)r7rr<rVr5rr)dict_build_pathsr)r:rXrPr.r6rNrWrOr0r=r4r&rQr@rHrTrUrYrrr\)rexistsryrrrr+sV	 
zEnvironmentInfo.return_envc
Csntj|}t|dt}t||}|rttt	|n|}|s.d|
}tj
|t|}	t|	S)aC
        Given an environment variable name and specified paths,
        return a pathsep-separated string of paths containing
        unique, extant, directories from those paths and from
        the environment variable. Raise an error if no paths
        are resolved.

        Parameters
        ----------
        name: str
            Environment variable name
        spec_path_lists: list of str
            Paths
        exists: bool
            It True, only return existing paths.

        Return
        ------
        str
            Pathsep-separated paths
        rz %s environment variable is empty)r9chain
from_iterablerrNrrr>filterrupperr&r'r(r
r)
rrZspec_path_listsr_Z
spec_pathsZ	env_pathsr$Zextant_pathsrZunique_pathsrrrr^s
zEnvironmentInfo._build_paths)Nr)T)!rrrrrrrrr&r)r.r0r4r6r:r=r@r?r5rHrNrOrPrQrTrUrWrXrVrYr\r+r^rrrrr*sl
	






$


#
#













"2r*)r$r)1rriorosrros.pathrrrrr}rplatformr9rOdistutils.errorsr&Z#setuptools.extern.packaging.versionr	Z setuptools.extern.more_itertoolsr
Zmonkeyrsystemrrr]rar'r(Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr%rDrWr_rfrzr|rr,rrrr*rrrrsd	
*&&'$

%s:PK!|]xܐ$__pycache__/dep_util.cpython-310.pycnu[o

Xai@sddlmZddZdS))newer_groupcCsht|t|krtdg}g}tt|D]}t||||r/||||||q||fS)zWalk both arguments in parallel, testing if each source group is newer
    than its corresponding target. Returns a pair of lists (sources_groups,
    targets) where sources is newer than target, according to the semantics
    of 'newer_group()'.
    z5'sources_group' and 'targets' must be the same length)len
ValueErrorrangerappend)Zsources_groupstargets	n_sources	n_targetsir/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr
N)distutils.dep_utilrr
rrrrsPK!^Of"f"$__pycache__/__init__.cpython-310.pycnu[o

Xai@sFdZddlmZddlZddlZddlZddlZddlZddl	Z
ddlmZddl
mZddlmZddlZddlmZdd	lmZdd
lmZddlmZgdZejjZdZGd
ddZGdddeZ ej!Z"e j!Z#ddZ$ddZ%e
j&j%je%_e'e
j&j(Z)Gddde)Z(ddZ*ej+fddZ,Gddde-Z.e/dS)z@Extensions to the 'distutils' for large or complex distributionsfnmatchcaseN)DistutilsOptionError)convert_path)SetuptoolsDeprecationWarning)	Extension)Distribution)Require)monkey)setupr	Commandrr
r
find_packagesfind_namespace_packagesc@sBeZdZdZedddZeddZed	d
ZeddZ	d
S)
PackageFinderzI
    Generate a list of all Python packages found within a directory
    .*cCs,t|t||jddg|R|j|S)a	Return a list all Python packages found within directory 'where'

        'where' is the root directory which will be searched for packages.  It
        should be supplied as a "cross-platform" (i.e. URL-style) path; it will
        be converted to the appropriate local path syntax.

        'exclude' is a sequence of package names to exclude; '*' can be used
        as a wildcard in the names, such that 'foo.*' will exclude all
        subpackages of 'foo' (but not 'foo' itself).

        'include' is a sequence of package names to include.  If it's
        specified, only the named packages will be included.  If it's not
        specified, all found packages will be included.  'include' can contain
        shell style wildcard patterns just like 'exclude'.
        Zez_setupz*__pycache__)list_find_packages_iterr
_build_filter)clswhereexcludeincluderr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/__init__.pyfind-szPackageFinder.findccstj|ddD]F\}}}|dd}g|dd<|D]2}tj||}	tj|	|}
|
tjjd}d|vs<||	s=q||rH||sH|V||qqdS)zy
        All the packages found in 'where' that pass the 'include' filter, but
        not the 'exclude' filter.
        TfollowlinksNr)	oswalkpathjoinrelpathreplacesep_looks_like_packageappend)rrrrrootdirsfilesZall_dirsdir	full_pathrel_pathpackagerrrrGsz!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z__init__.py)r r"isfiler#r"rrrr'csz!PackageFinder._looks_like_packagecsfddS)z
        Given a list of patterns, return a callable that will be true only if
        the input matches at least one of the patterns.
        cstfddDS)Nc3s|]	}t|dVqdS))patNr).0r2namerr	nsz@PackageFinder._build_filter....)anyr4patternsr4rnz-PackageFinder._build_filter..rr8rr8rrhszPackageFinder._build_filterN)rrr)
__name__
__module____qualname____doc__classmethodrrstaticmethodr'rrrrrr(s

rc@seZdZeddZdS)PEP420PackageFindercCdS)NTrr1rrrr'rsz'PEP420PackageFinder._looks_like_packageN)r<r=r>rAr'rrrrrBqsrBcCsNGdddtjj}||}|jdd|jr%tdt||jdSdS)Nc@s eZdZdZddZddZdS)z4_install_setup_requires..MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        cs6d}fddt|t@D}tjj||dS)N)Zdependency_linkssetup_requirescsi|]}||qSrr)r3kattrsrr
r;zQ_install_setup_requires..MinimalDistribution.__init__..)set	distutilscorer	__init__)selfrGZ_inclfilteredrrFrrLsz=_install_setup_requires..MinimalDistribution.__init__cSrC)zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr)rMrrrfinalize_optionsszE_install_setup_requires..MinimalDistribution.finalize_optionsN)r<r=r>r?rLrOrrrrMinimalDistribution~srPT)Zignore_option_errorszdsetup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.)	rJrKr	parse_config_filesrDwarningswarnrZfetch_build_eggs)rGrPdistrrr_install_setup_requires{srUcKst|tjjdi|S)Nr)rUrJrKrrFrrrrsrc@s:eZdZejZdZddZdddZddZd
d
dZ	dS)r
FcKst||t||dS)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)_CommandrLvarsupdate)rMrTkwrrrrLszCommand.__init__NcCsBt||}|durt||||St|tstd|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr
isinstancestrr)rMoptionwhatdefaultvalrrr_ensure_stringlikes

zCommand._ensure_stringlikecCsrt||}|durdSt|trt||td|dSt|tr+tdd|D}nd}|s7td||fdS)zEnsure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|tVqdSN)r\r])r3vrrrr6sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r))	rZr\r]r[resplitrallr)rMr^raokrrrensure_string_lists



zCommand.ensure_string_listrcKs t|||}t|||Src)rVreinitialize_commandrWrX)rMcommandreinit_subcommandsrYcmdrrrrjszCommand.reinitialize_commandrc)r)
r<r=r>rVr?Zcommand_consumes_argumentsrLrbrirjrrrrr
s
r
cCs&ddtj|ddD}ttjj|S)z%
    Find all files under 'path'
    css.|]\}}}|D]
}tj||Vq	qdSrc)r r"r#)r3baser*r+filerrrr6sz#_find_all_simple..Tr)r r!filterr"r0)r"resultsrrr_find_all_simplesrrcCs6t|}|tjkrtjtjj|d}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	rrr curdir	functoolspartialr"r$mapr)r,r+Zmake_relrrrfindalls


rxc@seZdZdZdS)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r<r=r>r?rrrrrysry)0r?fnmatchrrur rerRZ_distutils_hack.overrideZ_distutils_hackdistutils.corerJdistutils.errorsrdistutils.utilrZ_deprecation_warningrZsetuptools.version
setuptoolsZsetuptools.extensionrZsetuptools.distr	Zsetuptools.dependsr
r__all__version__version__Zbootstrap_install_fromrrBrrrrUrrKZ
get_unpatchedr
rVrrrtrxr]ryZ	patch_allrrrrs@I!3PK!C
o

%__pycache__/installer.cpython-310.pycnu[o

Xai
@spddlZddlZddlZddlZddlZddlmZddlmZddl	Z	ddl
mZddZddZ
d	d
ZdS)N)log)DistutilsError)WheelcCs(t|tr	|St|ttfsJ|S)z8Ensure find-links option end-up being a list of strings.)
isinstancestrsplittuplelist)
find_linksr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/installer.py_fixup_find_links
s
r
cCs<ztdWntjy|dtjYnwt|}|d}d|vr*tddt	j
vo3dt	j
v}dt	j
vrsCPK!VQQ"__pycache__/config.cpython-310.pycnu[o

XaiSZ@sddlZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZddl
Z
ddlmZmZddlmZmZddlmZGd	d
d
Ze
jddZdddZddZddZdddZGdddZGdddeZGdddeZdS)N)defaultdict)partialwraps)iglob)DistutilsOptionErrorDistutilsFileError)
LegacyVersionparse)SpecifierSetc@s eZdZdZddZddZdS)StaticModulez0
    Attempt to load the module by the name
    cCs`tj|}t|j}|}Wdn1swYt|}t|	t
|`dSN)	importlibutil	find_specopenoriginreadastr
varsupdatelocalsself)rnamespecstrmsrcmoduler/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/config.py__init__s

zStaticModule.__init__c
sNztfdd|jjDWSty&}ztdjdit|d}~ww)Nc3sJ|] }t|tjr"|jD]}t|tjr!|jkr
t|jVq
qdSr
)
isinstancerAssigntargetsNameidliteral_evalvalue).0Z	statementtargetattrrr	#s



z+StaticModule.__getattr__..z#{self.name} has no attribute {attr}r)nextrbody	ExceptionAttributeErrorformatr)rr+err*r__getattr__!s
zStaticModule.__getattr__N)__name__
__module____qualname____doc__r r3rrrrrsrc	cs8ztjd|dVWtj|dStj|w)zH
    Add path to front of sys.path for the duration of the context.
    rN)syspathinsertremove)r9rrr
patch_path0s
r<Fc		Csddlm}m}tj|}tj|std|t}t	tj
|z-|}|r1|ng}||vr<|||j
||dt||j|d}Wt	|t|St	|w)a,Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file
        to get options from.

    :param bool find_others: Whether to search for other configuration files
        which could be on in various places.

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :rtype: dict
    r)Distribution
_Distributionz%Configuration file %s does not exist.)	filenames)ignore_option_errors)Zsetuptools.distr=r>osr9abspathisfilergetcwdchdirdirnamefind_config_filesappendparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict)	filepathZfind_othersr@r=r>Zcurrent_directorydistr?handlersrrrread_configuration<s$

rPcCs2djdit}tt||}t|||}|S)z
    Given a target object and option key, get that option from
    the target object, either through a get_{key} method or
    from an attribute directly.
    z	get_{key}Nr)r1r	functoolsrgetattr)
target_objkeyZgetter_nameZby_attributegetterrrr_get_optionisrVcCs<tt}|D]}|jD]}t|j|}|||j|<qq|S)zReturns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    )rdictset_optionsrVrSsection_prefix)rOZconfig_dicthandleroptionr'rrrrLus
rLcCs6t|||}|t|j|||j}|||fS)aPerforms additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    )ConfigOptionsHandlerr
ConfigMetadataHandlermetadatapackage_dir)distributionrKr@optionsmetarrrrJsrJc@seZdZdZdZ	iZ	d'ddZeddZdd	Z	e
d(ddZe
d(d
dZe
ddZ
e
ddZe
ddZe
ddZeddZeddZe
d)ddZe
ddZe
d)dd Zd!d"Zd#d$Zd%d&ZdS)*
ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}|D]\}}||sq	||dd}|||<q	||_||_||_g|_dS)N.)	rYitems
startswithreplacestripr@rSsectionsrX)rrSrar@rjrYsection_namesection_optionsrrrr s


zConfigHandler.__init__cCstd|jj).Metadata item name to parser function mapping.z!%s must provide .parsers property)NotImplementedError	__class__r4)rrrrparserss
zConfigHandler.parsersc	Cst}|j}|j||}t|||}||urt||rdSd}|j|}|r?z||}Wnty>d}|js<Ynw|rCdSt|d|d}|durVt	|||n|||j
|dS)NFTzset_%s)tuplerSaliasesgetrRKeyErrorrpr/r@setattrrXrH)	rZoption_namer'unknownrSZ
current_valueZskip_optionparsersetterrrr__setitem__s4zConfigHandler.__setitem__,cCs8t|tr|Sd|vr|}n||}dd|DS)zRepresents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        
cSsg|]
}|r|qSr)ri)r(chunkrrr
sz-ConfigHandler._parse_list..)r!list
splitlinessplit)clsr'	separatorrrr_parse_lists



zConfigHandler._parse_listc	sjd}|j|d}g}|D]%tfdd|Dr-|tddttjDq
|q
|S)aEquivalent to _parse_list() but expands any glob patterns using glob().

        However, unlike with glob() calls, the results remain relative paths.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        )*?[]{}rc3s|]}|vVqdSr
r)r(charr'rrr,sz1ConfigHandler._parse_list_glob..css"|]}tj|tVqdSr
)rAr9relpathrDr(r9rrrr,s

)	ranyextendsortedrrAr9rBrH)rr'rZglob_charactersvaluesZexpanded_valuesrrr_parse_list_globs
zConfigHandler._parse_list_globcCsPd}i}||D]}||\}}}||krtd||||<q	|S)zPRepresents value as a dict.

        :param value:
        :rtype: dict
        =z(Unable to parse option value to dict: %s)r	partitionrri)rr'rresultlinerTsepvalrrr_parse_dict szConfigHandler._parse_dictcCs|}|dvS)zQRepresents value as boolean.

        :param value:
        :rtype: bool
        )1trueyes)lower)rr'rrr_parse_bool3szConfigHandler._parse_boolcfdd}|S)zReturns a parser function to make sure field inputs
        are not files.

        Parses a value after getting the key so error messages are
        more informative.

        :param key:
        :rtype: callable
        cs d}||rtd|S)Nfile:zCOnly strings are accepted for the {0} field, files are not accepted)rg
ValueErrorr1)r'Zexclude_directiverTrrrwIs
z3ConfigHandler._exclude_files_parser..parserr)rrTrwrrr_exclude_files_parser=s	z#ConfigHandler._exclude_files_parsercs\d}t|ts	|S||s|S|t|d}dd|dD}dfdd|DS)aORepresents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        rNcss |]}tj|VqdSr
)rAr9rBrirrrrr,ksz,ConfigHandler._parse_file..rzr{c3s4|]}|s		tj|r|VqdS)TN)
_assert_localrAr9rC
_read_filerrrrr,ls

)r!strrglenrjoin)rr'Zinclude_directiverZ	filepathsrrr_parse_fileTs

zConfigHandler._parse_filecCs|ts
td|dS)Nz#`file:` directive can not access %s)rgrArDr)rMrrrrrszConfigHandler._assert_localcCs:tj|dd}|WdS1swYdS)Nzutf-8)encoding)iorr)rMfrrrrws$zConfigHandler._read_filec	Cs0d}||s	|S||dd}|}d|}|p d}t}|ra|d|vrR||d}|dd}	t	|	dkrOtj
t|	d}|	d}n|}nd|vratj
t|d}t|&ztt
||WWdStyt|}
YnwWdn1swYt|
|S)	zRepresents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:rdrer r/N)rgrhrirpoprrArDrsplitrr9r<rRrr/r
import_module)rr'r_Zattr_directiveZ
attrs_path	attr_namemodule_nameparent_pathZcustom_pathpartsrrrr_parse_attr|s8




zConfigHandler._parse_attrcr)zReturns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs|}D]}||}q|Sr
r)r'parsedmethod
parse_methodsrrr
s
z1ConfigHandler._get_parser_compound..parser)rrr
rrr_get_parser_compounds
z"ConfigHandler._get_parser_compoundcCs6i}|pdd}|D]\}\}}||||<q|S)zParses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cSs|Sr
r)rrrrsz6ConfigHandler._parse_section_to_dict..)rf)rrlZ
values_parserr'rT_rrrr_parse_section_to_dicts

z$ConfigHandler._parse_section_to_dictc	Cs8|D]\}\}}z|||<WqtyYqwdS)zQParses configuration file section.

        :param dict section_options:
        N)rfrt)rrlrrr'rrr
parse_sectionszConfigHandler.parse_sectioncCsb|jD])\}}d}|rd|}t|d|ddd}|dur*td|j|f||qdS)zTParses configuration file items from one
        or more related sections.

        rdz_%szparse_section%sre__Nz0Unsupported distribution option section: [%s.%s])rjrfrRrhrrY)rrkrlZmethod_postfixZsection_parser_methodrrrr
s"
zConfigHandler.parsecstfdd}|S)zthis function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param warning_class: class of warning exception to be raised
        :param func: function to be wrapped around
        cst|i|Sr
)warningswarn)argskwargsfuncmsg
warning_classrrconfig_handlersz@ConfigHandler._deprecated_config_handler..config_handlerr)rrrrrrrr_deprecated_config_handlersz(ConfigHandler._deprecated_config_handlerF)rzr
)r4r5r6r7rYrrr propertyrpryclassmethodrrrrrrstaticmethodrrrrrrr
rrrrrrcsF

&

	



-
rccsLeZdZdZdddddZdZ		dfd	d
	ZeddZd
dZ	Z
S)r]r^urldescriptionclassifiers	platforms)Z	home_pagesummary
classifierplatformFNcstt||||||_dSr
)superr]r r_)rrSrar@r_rorrr s

zConfigMetadataHandler.__init__cCs^|j}|j}|j}|j}|||||dt|||||d||ddt||||j|d
S)rmz[The requires parameter is deprecated, please use install_requires for runtime dependencies.licenselicense_filezDThe license_file parameter is deprecated, use license_files instead.)
rkeywordsprovidesrequires	obsoletesrrrZ
license_filesrlong_descriptionversionZproject_urls)rrrrrDeprecationWarningr_parse_version)r
parse_listZ
parse_file
parse_dictZexclude_files_parserrrrrps4
zConfigMetadataHandler.parserscCs||}||kr#|}tt|tr!d}t|jdit|S|||j	}t
|r1|}t|tsIt|drEd
tt|}|Sd|}|S)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}__iter__rez%sNr)rrir!r
r	rr1rrr_callablerhasattrrmap)rr'rtmplrrrr?s"


z$ConfigMetadataHandler._parse_version)FN)r4r5r6rYrrZstrict_moder rrpr
__classcell__rrrrr]s
!r]c@sdeZdZdZeddZddZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZdS)r\racCsN|j}t|jdd}|j}|j}|j}|||||||||||j|j|t|dS)rm;r)Zzip_safeZinclude_package_datar_scriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ
tests_requirepackagesentry_points
py_modulesZpython_requirescmdclass)rrrr_parse_cmdclass_parse_packagesrr)rrZparse_list_semicolonZ
parse_boolrZparse_cmdclassrrrrpgs*zConfigOptionsHandler.parserscs$ddfdd||DS)NcSs8|d}||dd}|d|}t|}t||S)Nrer)rfind
__import__rR)Zqualified_class_nameidx
class_namepkg_namerrrr
resolve_classs


z;ConfigOptionsHandler._parse_cmdclass..resolve_classcsi|]	\}}||qSrrr(kvrrr
sz8ConfigOptionsHandler._parse_cmdclass..)rrf)rr'rrrrs	z$ConfigOptionsHandler._parse_cmdclasscCsnddg}|}||vr||S||dk}||jdi}|r*ddlm}nddlm}|d	i|S)
zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:rz
packages.findr)find_namespace_packages)
find_packagesNr)rirparse_section_packages__findrjrs
setuptoolsrr)rr'Zfind_directivesZ
trimmed_valueZfindnsfind_kwargsrrrrrs
z$ConfigOptionsHandler._parse_packagescsR|||j}gdtfdd|D}|d}|dur'|d|d<|S)zParses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        )whereincludeexcludecs$g|]\}}|vr|r||fqSrrrZ
valid_keysrrr}s$zEConfigOptionsHandler.parse_section_packages__find..rNr)rrrWrfrs)rrlZsection_datarrrrrrs
z1ConfigOptionsHandler.parse_section_packages__findcCs|||j}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        rN)rrrrlrrrrparse_section_entry_pointssz/ConfigOptionsHandler.parse_section_entry_pointscCs.|||j}|d}|r||d<|d=|S)Nrrd)rrrs)rrlrrootrrr_parse_package_datas
z(ConfigOptionsHandler._parse_package_datacC|||d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        package_dataNrrrlrrrparse_section_package_dataz/ConfigOptionsHandler.parse_section_package_datacCr)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataNrrrrr"parse_section_exclude_package_datarz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}||||d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        rrZextras_requireN)rrr)rrlrrrrparse_section_extras_requiresz1ConfigOptionsHandler.parse_section_extras_requirecCs(|||j}dd|D|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        cSsg|]\}}||fqSrrrrrrr}szAConfigOptionsHandler.parse_section_data_files..
data_filesN)rrrfrrrrparse_section_data_filessz-ConfigOptionsHandler.parse_section_data_filesN)r4r5r6rYrrprrrr	rrrrrrrrrr\cs


r\)FFr) rrrAr8rrQrcollectionsrrrglobr
contextlibdistutils.errorsrrZ#setuptools.extern.packaging.versionr	r
Z&setuptools.extern.packaging.specifiersrrcontextmanagerr<rPrVrLrJrcr]r\rrrrs6

-
c_PK!#__pycache__/depends.cpython-310.pycnu[o

Xaib@sddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZgdZGdddZ
d	d
Zddd
ZdddZddZedS)N)
StrictVersion)find_modulePY_COMPILED	PY_FROZEN	PY_SOURCE)_imp)Requirerget_module_constantextract_constantc@sLeZdZdZ		dddZddZdd	ZdddZdd
dZdddZ	dS)r	z7A prerequisite to building or installing a distributionNcCsF|dur
|dur
t}|dur||}|durd}|jt|`dS)N__version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage	attributeformatr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/depends.py__init__szRequire.__init__cCs |jdur
d|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrr	full_name"s
zRequire.full_namecCs*|jdup|jdupt|dko||jkS)z%Is 'version' sufficiently up-to-date?Nunknown)rrstrr)rversionrrr
version_ok(szRequire.version_okrcCs~|jdur"zt|j|\}}}|r||WSty!YdSwt|j|j||}|dur=||ur=|jdur=||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)rrrcloseImportErrorr
r)rpathsdefaultfpivrrrget_version-s

zRequire.get_versioncCs||duS)z/Return true if dependency is present on 'paths'N)r')rr!rrr
is_presentHszRequire.is_presentcCs ||}|durdS||S)z>Return true if dependency is present and up-to-date on 'paths'NF)r'r)rr!rrrr
is_currentLs

zRequire.is_current)rNN)NrN)
__name__
__module____qualname____doc__rrrr'r(r)rrrrr	s


r	cCs"tjdd}|s|St|S)NcssdVdSr*rrrrremptyUszmaybe_close..empty)
contextlibcontextmanagerclosing)r#r/rrrmaybe_closeTs


r3cCszt||\}}\}}}}	Wn
tyYdSwt|C|tkr.|dt|}
n,|tkr9t	||}
n!|t
krFt||d}
nt|||	}t
||dWdSWdn1sdwYt|
||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)rr r3rreadmarshalloadrrget_frozen_objectrcompileZ
get_modulegetattrr)rsymbolr"r!r#pathsuffixmodekindinfocodeZimportedrrrr
_s&



r
cCs||jvrdSt|j|}d}d}d}|}t|D]$}|j}	|j}
|	|kr.|j|
}q|
|kr>|	|ks:|	|kr>|S|}qdS)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_nameslistindexdisBytecodeopcodearg	co_consts)rCr=r"Zname_idx
STORE_NAMESTORE_GLOBAL
LOAD_CONSTconstZ	byte_codeoprMrrrr|s 
rcCs>tjds
tjdkr
dSd}|D]}t|=t|qdS)z
    Patch the globals to remove the objects not available on some platforms.

    XXX it'd be better to test assertions about bytecode instead.
    javacliN)rr
)sysplatform
startswithglobals__all__remove)Zincompatiblerrrr_update_globalssr\)r4N)r4)rVr8r0rJZdistutils.versionrrrrrrrrZr	r3r
rr\rrrrsD

$
PK!{2{{#__pycache__/version.cpython-310.pycnu[o

Xai@s4ddlZz	edjZWdSeydZYdSw)N
setuptoolsunknown)
pkg_resourcesget_distributionversion__version__	Exceptionr	r	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/version.pys
PK!3%k488+__pycache__/windows_support.cpython-310.pycnu[o

Xai@s(ddlZddlZddZeddZdS)NcCstdkr
ddS|S)NWindowsc_sdS)N)argskwargsrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/windows_support.pyszwindows_only..)platformsystem)funcrrrwindows_onlysrcCsLtdtjjj}tjjtjjf|_tjj	|_
d}|||}|s$tdS)z
    Set the hidden attribute on a file or directory.

    From http://stackoverflow.com/questions/19622133/

    `path` must be text.
    zctypes.wintypesN)
__import__ctypeswindllZkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDargtypesZBOOLrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr	hide_files	


r)rrrrrrrrs
PK!oc __pycache__/dist.cpython-310.pycnu[o

XaiO@sdgZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZddl
mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd	lmZdd
lm Z m!Z!ddl
m"Z"ddl#m$Z$dd
l%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,Z,ddl-Z,ddl,m.Z.ddl/m0Z0ddl1m2Z2ddl3Z3erddl4m5Z5e6de6dddZ7ddZ8de9de9fddZ:d d!d"e9dee9fd#d$Z;d d!d"e9dee9fd%d&Zd+d,Z?d-d.Z@d/d0ZAeBeCfZDd1d2ZEd3d4ZFd5d6ZGd7d8ZHd9d:ZId;d<ZJd=d>ZKd?d@ZLdAdBZMdCdDZNdEdFZOdGdHZPdIdJZQe0ejRjSZTGdKddeTZSGdLdMdMe+ZUdS)NDistributionN)	strtobool)DEBUGtranslate_longopt)iglob)ListOptional
TYPE_CHECKING)defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError)
rfc822_escape)
StrictVersion)	packaging)ordered_set)unique_everseen)SetuptoolsDeprecationWarning)windows_support)
get_unpatched)parse_configuration)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/dist.py_get_unpatched2sr cCs&t|dd}|durtd}||_|S)Nmetadata_version2.1)getattrrr!)selfmvrrrget_metadata_version7s
r&contentreturnc
CsJ|}t|dkr|dSd|dtd|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr
N)
splitlineslenlstripjointextwrapdedent)r'linesrrrrfc822_unescape?s*r1msgrfieldcCs||}|dkr
dS|S)zRead Message header field.UNKNOWNNrr2r3valuerrr_read_field_from_msgGsr7cCst||}|dur|St|S)z4Read Message header field and apply rfc822_unescape.N)r7r1r5rrr_read_field_unescaped_from_msgOs
r8cCs||d}|gkrdS|S)z9Read Message header field and return all results as list.N)get_all)r2r3valuesrrr_read_list_from_msgWsr;cCs|}|dkrdS|S)Nr4)get_payloadstrip)r2r6rrr_read_payload_from_msg_sr>cCsTt|}t|d|_t|d|_t|d|_t|d|_t|d|_d|_t|d|_	d|_
t|d|_t|d	|_
d
|vrFt|d
|_nd|_t|d|_|jdur`|jtdkr`t||_t|d|_d
|vrst|d
d|_t|d|_t|d|_|jtdkrt|d|_t|d|_t|d|_n	d|_d|_d|_t|d|_dS)z-Reads the metadata values from a file object.zmetadata-versionnameversionsummaryauthorNzauthor-emailz	home-pagelicensezdownload-urldescriptionr"keywords,platform
classifierz1.1requiresprovides	obsoleteszlicense-file)rrr!r7r?r@rDrB
maintainerauthor_emailmaintainer_emailurlr8rCdownload_urllong_descriptionr>splitrEr;	platformsclassifiersrIrJrK
license_files)r$filer2rrr
read_pkg_filefs<
rWcCs"d|vrtd|dd}|S)Nr)z1newlines not allowed and will break in the future )rrreplace)valrrrsingle_lines
r[c
s|}fdd}|dt||d||d||dt||d|d}|D]\}}t||d	}|d	urF|||q3t|	}|d
||j
r[|d|j
|jD]	}	|dd
|	q`d
|}
|
rx|d|
|D]}|d|q||d||d||d||d|t|dr|d|j|jr|d|j|jr|jD]}|d|q|d|jpgd|d	S)z0Write the PKG-INFO format data to a file object.csd||fdS)Nz%s: %s
)write)keyr6rVrrwrite_fieldsz#write_pkg_file..write_fieldzMetadata-VersionNameVersionZSummaryz	Home-page))ZAuthorrB)zAuthor-emailrM)Z
MaintainerrL)zMaintainer-emailrNNZLicensezDownload-URLzProject-URLz%s, %srFZKeywordsPlatform
ClassifierRequiresProvides	Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-ExtrazLicense-Filez
%s

)r&strget_nameget_versionr[get_descriptionget_urlr#rget_licenserPproject_urlsitemsr-get_keywords
get_platforms_write_listget_classifiersget_requiresget_provides
get_obsoleteshasattrrglong_description_content_typeprovides_extrasrUr\get_long_description)
r$rVr@r_Zoptional_fieldsr3attrZattr_valrCproject_urlrErGextrarr^rwrite_pkg_filesJ




r~cCsTztjd|}|jrJWdSttttfy)}z	td||f|d}~ww)Nzx=z4%r must be importable 'module:attrs' string (got %r))	
pkg_resources
EntryPointparseextras	TypeError
ValueErrorAttributeErrorAssertionErrorr)distr{r6eperrrcheck_importables
rcCs^zt|ttfs
Jd||ksJWdSttttfy.}z	td||f|d}~ww)z"Verify that value is a string listz%%r must be a list of strings (got %r)N)	
isinstancelisttupler-rrrrrrr{r6rrrrassert_string_lists
rcCsd|}t||||D]%}||stdd||d\}}}|r/||vr/tjd||q
dS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rhas_contents_forr
rpartition	distutilslogr)rr{r6Zns_packagesnspparentsepchildrrr	check_nsps$
rc
CsDz
ttt|WdStttfy!}ztd|d}~ww)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N)	r	itertoolsstarmap_check_extrarorrrrrrrrcheck_extras
srcCs<|d\}}}|rt|rtd|tt|dS)N:zInvalid environment marker: )	partitionrinvalid_markerrrparse_requirements)r}reqsr?rmarkerrrrrsrcCs&t||krd}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))r{r6N)boolrformat)rr{r6tmplrrrassert_boolsrcCs(|s
t|dtdSt|d)Nz is ignored.z is invalid.)rrrrrr{r6rrrinvalid_unless_false$src
Cs`ztt|t|ttfrtdWdSttfy/}zd}t|j	||d|d}~ww)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}r{errorN)
rrrrdictsetrrrrrr{r6rrrrrcheck_requirements+src
CsLz	tj|WdStjjtfy%}zd}t|j||d|d}~ww)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rN)r
specifiersSpecifierSetInvalidSpecifierrrrrrrrcheck_specifier9src
Cs6z	tj|WdSty}zt||d}~ww)z)Verify that entry_points map is parseableN)rr	parse_maprrrrrrcheck_entry_pointsDs
rcCst|ts	tddS)Nztest_suite must be a string)rrhrrrrrcheck_test_suiteLs
rcCsZt|tstd||D]\}}t|ts!td||t|d||qdS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rrrrrorhr)rr{r6kvrrrcheck_package_dataQs


rcCs(|D]}td|stjd|qdS)Nz\w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr)rr{r6pkgnamerrrcheck_packages`src@s~eZdZdZddeejdddddZdZdd	Z	dUd
dZ
dd
ZeddZ
eddZddZddZeddZddZddZddZeddZdUd d!Zd"d#Zd$d%Zd&d'ZdUd(d)ZdVd+d,Zd-d.Zd/d0Zed1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"d;d<Z#d=d>Z$d?d@Z%dAdBZ&dCdDZ'dEdFZ(dGdHZ)dIdJZ*dKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/dS)WraGDistribution with support for tests and package data

    This is an enhanced version of 'distutils.dist.Distribution' that
    effectively adds the following new optional keyword arguments to 'setup()':

     'install_requires' -- a string or sequence of strings specifying project
        versions that the distribution requires when installed, in the format
        used by 'pkg_resources.require()'.  They will be installed
        automatically when the package is installed.  If you wish to use
        packages that are not available in PyPI, or want to give your users an
        alternate download location, you can add a 'find_links' option to the
        '[easy_install]' section of your project's 'setup.cfg' file, and then
        setuptools will scan the listed web pages for links that satisfy the
        requirements.

     'extras_require' -- a dictionary mapping names of optional "extras" to the
        additional requirement(s) that using those extras incurs. For example,
        this::

            extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])

        indicates that the distribution can optionally provide an extra
        capability called "reST", but it can only be used if docutils and
        reSTedit are installed.  If the user installs your package using
        EasyInstall and requests one of your extras, the corresponding
        additional requirements will be installed if needed.

     'test_suite' -- the name of a test suite to run for the 'test' command.
        If the user runs 'python setup.py test', the package will be installed,
        and the named test suite will be run.  The format is the same as
        would be used on a 'unittest.py' command line.  That is, it is the
        dotted name of an object to import and call to generate a test suite.

     'package_data' -- a dictionary mapping package names to lists of filenames
        or globs to use to find data files contained in the named packages.
        If the dictionary has filenames or globs listed under '""' (the empty
        string), those names will be searched for in every package, in addition
        to any names for the specific package.  Data files found using these
        names/globs will be installed along with the package, in the same
        location as the package.  Note that globs are allowed to reference
        the contents of non-package subdirectories, as long as you use '/' as
        a path separator.  (Globs are automatically converted to
        platform-specific paths at runtime.)

    In addition to these new keywords, this class also has several new methods
    for manipulating the distribution's contents.  For example, the 'include()'
    and 'exclude()' methods can be thought of as in-place add and subtract
    commands that add or remove packages, modules, extensions, and so on from
    the distribution.
    cCdSNrrrrrzDistribution.cCrrrrrrrrrcCrrrrrrrrr)rxrnrylicense_filerUNcCst|r
d|vs
d|vrdStt|d}tjj|}|dur6|ds8tt|d|_	||_
dSdSdS)Nr?r@zPKG-INFO)r	safe_namerhlowerworking_setby_keygethas_metadatasafe_version_version
_patched_dist)r$attrsr]rrrrpatch_missing_pkg_infos
z#Distribution.patch_missing_pkg_infocstd}|s
i_|p
i}g_|dd_||dg_|dg_t	dD]}t
|jdq0t
fdd|D|jjj_dS)Npackage_datasrc_rootdependency_linkssetup_requiresdistutils.setup_keywordscs i|]\}}|jvr||qSr)_DISTUTILS_UNSUPPORTED_METADATA.0rrr$rr
s

z)Distribution.__init__..)rwr
dist_filespoprrrrriter_entry_pointsvars
setdefaultr?
_Distribution__init__ro_set_metadata_defaults_normalize_version_validate_versionmetadatar@_finalize_requires)r$rZhave_package_datarrrrrs,



	zDistribution.__init__cCs4|jD]\}}t|j||||qdS)z
        Fill-in missing metadata fields not supported by distutils.
        Some fields may have been set by other tools (e.g. pbr).
        Those fields (vars(self.metadata)) take precedence to
        supplied attrs.
        N)rrorrrr)r$roptiondefaultrrrrsz#Distribution._set_metadata_defaultscCsTt|tjs
|dur|Sttj|}||kr(d}t|j	dit
|S|S)Nz)Normalizing '{version}' to '{normalized}'r)r
setuptoolssicrhrr@rarrrlocals)r@
normalizedrrrrrszDistribution._normalize_versionc	Csft|tjr
t|}|dur1z	tj|W|Stjjtfy0t	
d|t|YSw|S)NzThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)
rnumbersNumberrhrr@raInvalidVersionrrrrr)r@rrrrs	zDistribution._validate_versioncCsft|ddr|j|j_t|ddr)|jD]}|dd}|r(|jj|q||	dS)z
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rgNextras_requirerr)
r#rgrrkeysrRryadd_convert_extras_requirements"_move_install_requirements_markers)r$r}rrrrs
zDistribution._finalize_requirescCsht|ddpi}tt|_|D] \}}|j|t|D]}||}|j|||qqdS)z
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        rN)	r#rr_tmp_extras_requirerorr_suffix_forappend)r$Z
spec_ext_reqssectionrrsuffixrrrrs


z)Distribution._convert_extras_requirementscCs|jr
dt|jSdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        rr)rrhreqrrrr!szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_	|D]}j
dt|j|q(t
fddj
D_dS)	zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jSrrrrrr
is_simple_req3szFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrc3s.|]\}}|ddtj|DfVqdS)cSg|]}t|qSr)rh)rrrrr
?zMDistribution._move_install_requirements_markers...N)map
_clean_reqrrrr	>s

zBDistribution._move_install_requirements_markers..)r#rrrfilterrfilterfalserrhrrrrrror)r$rZspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsrrrrr)s

z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        Nr)r$rrrrrCszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r||vr|||dur#|dur#d}tt|||j_dS)z>> list(Distribution._expand_patterns(['LICENSE']))
        ['LICENSE']
        >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*']))
        ['setup.cfg', 'LICENSE']
        css<|]}tt|D]}|ds
tj|r
|Vq
qdS)~N)sortedrendswithospathisfile)rpatternr
rrrres

z0Distribution._expand_patterns..r)rrrrr]szDistribution._expand_patternscCsddlm}tjtjkrgngd}t|}|dur|}tr%|d|}t	|_
|D]g}tj|dd}trE|dj
dit||Wdn1sTwY|D]2}||}||}	|D]#}
|
d	ksu|
|vrvqk|||
}||
|}
||
|}
||f|	|
<qkq]|q-d
|jvrdS|jd
D]7\}
\}}|j|
}
|
rt|}n|
dvrt|}z
t||
p|
|Wqty}zt||d}~wwdS)
z
        Adapted from distutils.dist.Distribution.parse_config_files,
        this method provides the same functionality in subtly-improved
        ways.
        r)ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataprefixzexec-prefixhomeuserrootNz"Distribution.parse_config_files():utf-8)encodingz  reading {filename}__name__global)verbosedry_runr)configparserrsysrbase_prefix	frozensetfind_config_filesrannouncerhoptionxformioopenrr	read_filesectionsoptionsget_option_dictrwarn_dash_deprecationmake_option_lowercasercommand_optionsronegative_optrsetattrrr
)r$	filenamesrignore_optionsparserfilenamereaderrr&opt_dictoptrZsrcaliasrrrr_parse_config_filesmsZ





z Distribution._parse_config_filescCsd|dvr|S|dd}tjj|}|ds#|dkr#||vr#|Sd|vr0td||f|S)N)zoptions.extras_requirezoptions.data_files-_r&rzrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rYrcommand__all___setuptools_commands
startswithrr)r$r3rZunderscore_optcommandsrrrr(s z"Distribution.warn_dash_deprecationcCs4z
td}t|dWStjygYSw)Nrdistutils.commands)rget_distributionr
get_entry_mapDistributionNotFound)r$rrrrr;s
z!Distribution._setuptools_commandscCs4|dks|r
|S|}td|||f|S)NrzlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)islowerrrr)r$r3rZ
lowercase_optrrrr)sz"Distribution.make_option_lowercasecCsH|}|dur
||}tr|d||D]\}\}}tr,|d|||fz
dd|jD}WntyAg}Ynwz|j}WntyRi}Ynwz=t|t	}	||vrk|	rkt
|||t|n$||vrz|	rzt
||t|nt||rt
|||n	t
d|||fWqty}
zt
|
|
d}
~
wwdS)a
        Set the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').

        (Adopted from distutils.dist.Distribution._set_command_options)
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSrrr)rorrrrrz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')get_command_namer'rr roboolean_optionsrr+rrhr,rrwr
r)r$command_objoption_dictcommand_namersourcer6	bool_optsneg_opt	is_stringrrrr_set_command_optionssJ




z!Distribution._set_command_optionsFcCs0|j|dt||j|d||dS)zYParses configuration files from various levels
        and loads configuration.

        )r-)ignore_option_errorsN)r6rr*rr)r$r-rNrrrparse_config_filesszDistribution.parse_config_filescCs8tjjt||jdd}|D]
}tjj|ddq|S)zResolve pre-setup requirementsT)	installerreplace_conflicting)rY)rrresolverfetch_build_eggr)r$rIZresolved_distsrrrrfetch_build_eggs$szDistribution.fetch_build_eggscCsPd}dd}t|}t|j|}tdd|}t||dD]}||qdS)z
        Allow plugins to apply arbitrary operations to the
        distribution. Each hook may optionally define a 'order'
        to influence the order of execution. Smaller numbers
        go first and the default is 0.
        z(setuptools.finalize_distribution_optionscSst|ddS)Norderr)r#)hookrrrby_order8sz/Distribution.finalize_options..by_ordercSs|Sr)load)rrrrr=sz/Distribution.finalize_options..)r]N)rrrr_removedrr
)r$grouprWZdefinedfilteredZloadedrrrrfinalize_options/s

zDistribution.finalize_optionscCsdh}|j|vS)z
        When removing an entry point, if metadata is loaded
        from an older version of Setuptools, that removed
        entry point will attempt to be loaded and will fail.
        See #2765 for more details.
        Z
2to3_doctests)r?)rremovedrrrrYAs

zDistribution._removedcCsJtdD]}t||jd}|dur"|j|jd|||j|qdS)NrrP)rrr#r?requirerSrX)r$rr6rrr_finalize_setup_keywordsOsz%Distribution._finalize_setup_keywordscCstjtjd}tj|sDt|t|tj|d}t|d}|	d|	d|	dWd|S1s?wY|S)Nz.eggsz
README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

zAThis directory caches those eggs to prevent repeated downloads.

z/However, it is safe to delete this directory.

)
rr
r-curdirexistsmkdirrZ	hide_filer#r\)r$Z
egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirVs"


zDistribution.get_egg_cache_dircCsddlm}|||S)z Fetch an egg needed for buildingr)rS)Zsetuptools.installerrS)r$rrSrrrrSis
zDistribution.fetch_build_eggcCs\||jvr
|j|Std|}|D]}|j|jd||j|<}|St||S)z(Pluggable version of get_command_class()r>r^)cmdclassrrr_rSrXrget_command_class)r$r9Zepsrrgrrrrhos

zDistribution.get_command_classcC:tdD]}|j|jvr|}||j|j<qt|SNr>)rrr?rgrRrprint_commandsr$rrgrrrrk|
zDistribution.print_commandscCrirj)rrr?rgrRrget_command_listrlrrrrnrmzDistribution.get_command_listcK@|D]\}}t|d|d}|r||q|||qdS)aAdd items to distribution that are named in keyword arguments

        For example, 'dist.include(py_modules=["x"])' would add 'x' to
        the distribution's 'py_modules' attribute, if it was not already
        there.

        Currently, this method only supports inclusion for attributes that are
        lists or tuples.  If you need to add support for adding to other
        attributes in this or a subclass, you can add an '_include_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'include()'.  So, 'dist.include(foo={"bar":"baz"})'
        will try to call 'dist._include_foo({"bar":"baz"})', which can then
        handle whatever special inclusion logic is needed.
        Z	_include_N)ror#
_include_misc)r$rrrincluderrrrqs
zDistribution.includecsjd|jrfdd|jD|_|jr"fdd|jD|_|jr3fdd|jD|_dSdS)z9Remove packages, modules, and extensions in named packagerc"g|]
}|kr|s|qSrr<rppackagepfxrrrz0Distribution.exclude_package..crrrrsrtrvrrrrycs&g|]}|jkr|js|qSr)r?r<rtrvrrrs
N)packages
py_modulesext_modules)r$rwrrvrexclude_packageszDistribution.exclude_packagecCs2|d}|D]}||ks||rdSqdS)z.rsequencerr#rr,)r$r?r6oldrrrr
_exclude_miscs"

zDistribution._exclude_miscc
st|ts
td||fzt||Wnty'}ztd||d}~wwdur4t|||dStts?t|dfdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)rNrcrrrrrrrrrz.Distribution._include_misc..r)r$r?r6rnewrrrrps 

zDistribution._include_misccKro)aRemove items from distribution that are named in keyword arguments

        For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
        the distribution's 'py_modules' attribute.  Excluding packages uses
        the 'exclude_package()' method, so all of the package's contained
        packages, modules, and extensions are also excluded.

        Currently, this method only supports exclusion from attributes that are
        lists or tuples.  If you need to add support for excluding from other
        attributes in this or a subclass, you can add an '_exclude_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'exclude()'.  So, 'dist.exclude(foo={"bar":"baz"})'
        will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
        handle whatever special exclusion logic is needed.
        Z	_exclude_N)ror#r)r$rrrexcluderrrrs
zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rrrrrr})r$rzrrr_exclude_packagess

zDistribution._exclude_packagesc
Cs|jj|_|jj|_|d}|d}||vr6||\}}||=ddl}||d|dd<|d}||vst|||}||}	t	|	ddrWd|f||d<|durWgS|S)NraliasesTrZcommand_consumes_argumentscommand lineargs)
	__class__global_optionsr+r'shlexrRr_parse_command_optsrhr#)
r$r/rr9rr4r5rnargs	cmd_classrrrrs$



z Distribution._parse_command_optscCsi}|jD]W\}}|D]N\}\}}|dkrq|dd}|dkrO||}|j}|t|di|D]\}	}
|
|krI|	}d}nq;tdn|dkrUd}||	|i|<qq|S)	ahReturn a '{cmd: {opt:val}}' map of all command-line options

        Option names are all long, but do not include the leading '--', and
        contain dashes rather than underscores.  If the option doesn't take
        an argument (e.g. '--quiet'), the 'val' is 'None'.

        Note that options provided by config files are intentionally excluded.
        rr8r7rr+NzShouldn't be able to get herer)
r*rorYget_command_objr+copyupdater#rr)r$dcmdoptsr3r4rZZcmdobjrKnegposrrrget_cmdline_optionss.


z Distribution.get_cmdline_optionsccsx|jpdD]}|Vq|jpdD]}|Vq|jpdD]}t|tr(|\}}n|j}|dr6|dd}|VqdS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)rzr{r|rrr?r)r$pkgrextr?Z	buildinforrrr~Es


z$Distribution.iter_distribution_namesc
Csddl}|jr
t||St|jtjst||S|jj	dvr(t||S|jj}|jj
}|jdkr7dp8d}|jj}t|j
d||||_zt||Wt|j
|||||_St|j
|||||_w)zIf there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rN)rutf8win32r)r)r
help_commandsrhandle_display_optionsrstdoutr"
TextIOWrapperrrerrorsrGline_bufferingdetach)r$option_orderrrrnewlinerrrrrWs*z#Distribution.handle_display_optionsr)NF)0r
__module____qualname____doc__rrZ
OrderedSetrrrrrstaticmethodrrrrrrrrrr6r(r;r)rMrOrTr\rYr`rfrSrhrkrnrqr}rrrprrrrr~rrrrrrmsh4







O

.



	(c@seZdZdZdS)rzrClass for warning about deprecations in dist in
    setuptools. Not ignored by default, unlike DeprecationWarning.N)rrrrrrrrr|sr)Vr:r"rrrrrZ
distutils.logrdistutils.core
distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr.typingrr	r
collectionsremailrdistutils.errorsr
rrZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrrrrZsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr
email.messager
__import__r r&rhr1r7r8r;r>rWr[r~rrrrrrrrrrrrrrrrcorerrrrrrrs-
>

PK!;.##&__pycache__/build_meta.cpython-310.pycnu[o

Xai((@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZgdZGddde
ZGdddejjZejd	d
ZddZd
dZddZGdddeZGdddeZeZejZejZejZejZejZeZdS)a-A PEP 517 interface to setuptools

Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.

PEP 517 defines a different method of interfacing with setuptools. Rather
than calling "setup.py" directly, the frontend should:

  1. Set the current directory to the directory with a setup.py file
  2. Import this module into a safe python interpreter (one in which
     setuptools can potentially set global variables or crash hard).
  3. Call one of the functions defined in PEP 517.

What each function does is defined in PEP 517. However, here is a "casual"
definition of the functions (this definition should not be relied on for
bug reports or API stability):

  - `build_wheel`: build a wheel in the folder and return the basename
  - `get_requires_for_build_wheel`: get the `setup_requires` to build
  - `prepare_metadata_for_build_wheel`: get the `install_requires`
  - `build_sdist`: build an sdist in the folder and return the basename
  - `get_requires_for_build_sdist`: get the `setup_requires` to build

Again, this is not a formal definition! Just a "taste" of the module.
N)parse_requirements)get_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheelbuild_wheelbuild_sdist
__legacy__SetupRequirementsErrorc@seZdZddZdS)r	cCs
||_dSN)
specifiers)selfrr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/build_meta.py__init__4s
zSetupRequirementsError.__init__N)__name__
__module____qualname__rr
r
r
rr	3sr	c@s&eZdZddZeejddZdS)DistributioncCstttt|}t|r
)listmapstrrr	)rrZspecifier_listr
r
rfetch_build_eggs9szDistribution.fetch_build_eggsccs2tjj}|tj_z
dVW|tj_dS|tj_w)zw
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        N)	distutilscorer)clsorigr
r
rpatch>szDistribution.patchN)rrrrclassmethod
contextlibcontextmanagerrr
r
r
rr8s
rccs.tj}ddt_z	dVW|t_dS|t_w)a
Temporarily disable installing setup_requires

    Under PEP 517, the backend reports build dependencies to the frontend,
    and the frontend is responsible for ensuring they're installed.
    So setuptools (acting as a backend) should not try to install them.
    cSsdSr
r
)attrsr
r
rWsz+no_install_setup_requires..N)
setuptoolsZ_install_setup_requires)rr
r
rno_install_setup_requiresNs
r#csfddtDS)Ncs&g|]}tjtj|r|qSr
)ospathisdirjoin).0nameZa_dirr
r
_s
z1_get_immediate_subdirectories..)r$listdirr*r
r*r_get_immediate_subdirectories^sr-cs<fddt|D}z|\}W|Stytdw)Nc3s|]
}|r|VqdSr
endswithr(f	extensionr
r	ds
z'_file_with_extension..z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r$r,
ValueError)	directoryr3Zmatchingfiler
r2r_file_with_extensioncs
r8cCs&tj|stdSttdt|S)Nz%from setuptools import setup; setup()open)r$r%existsioStringIOgetattrtokenizer9setup_scriptr
r
r_open_setup_scriptqs
rAc@sfeZdZddZddZdddZdd	d
ZdddZ	dd
dZddZ			dddZ
dddZdS)_BuildMetaBackendcCs|pi}|dg|S)N--global-option)
setdefaultrconfig_settingsr
r
r_fix_config{sz_BuildMetaBackend._fix_configc
Cs||}tjdddg|dt_zt|WdW|S1s*wYW|StyI}z||j7}WYd}~|Sd}~ww)Negg_inforC)rGsysargvrr	run_setupr	r)rrFrequirementser
r
r_get_build_requiress 


z%_BuildMetaBackend._get_build_requiressetup.pycCsX|}d}t|}|dd}Wdn1swYtt||dtdS)N__main__z\r\nz\nexec)rAreadreplacerRcompilelocals)rr@__file__rr1coder
r
rrLs
z_BuildMetaBackend.run_setupNcCs||}|j|dgdS)NwheelrMrGrOrEr
r
rrs
z._BuildMetaBackend.get_requires_for_build_wheelcCs||}|j|gdS)NrZr[rEr
r
rrs
z._BuildMetaBackend.get_requires_for_build_sdistcCstjdddd|gt_t|Wdn1swY|}	ddt|D}t|dkrLtt|dkrLtj	|t|d}q&t|dksTJ	||krmt
tj	||d|t
j|dd|dS)	NrHZ	dist_infoz
--egg-baseTcSsg|]	}|dr|qS)z
.dist-infor.r0r
r
rr+s
zF_BuildMetaBackend.prepare_metadata_for_build_wheel..r)
ignore_errors)
rJrKr#rLr$r,lenr-r%r'shutilmovermtree)rmetadata_directoryrFZdist_info_directoryZ
dist_infosr
r
rrs0
z2_BuildMetaBackend.prepare_metadata_for_build_wheelc	Cs||}tj|}tj|ddtj|dT}tjdd|d|g|dt_t	|
Wdn1s=wYt||}tj||}tj
|rYt|ttj|||Wd|S1sowY|S)NT)exist_ok)dirrHz
--dist-dirrC)rGr$r%abspathmakedirstempfileTemporaryDirectoryrJrKr#rLr8r'r:removerename)rZ
setup_commandZresult_extensionZresult_directoryrFZtmp_dist_dirZresult_basenameresult_pathr
r
r_build_with_temp_dirs.



z&_BuildMetaBackend._build_with_temp_dircCs|dgd||S)Nbdist_wheelz.whlrk)rwheel_directoryrFrar
r
rrs
z_BuildMetaBackend.build_wheelcCs|gdd||S)N)sdistz	--formatsgztarz.tar.gzrm)rsdist_directoryrFr
r
rrs
z_BuildMetaBackend.build_sdistrPr
)NN)rrrrGrOrLrrrrkrrr
r
r
rrBys



"
rBcs"eZdZdZdfdd	ZZS)_BuildMetaLegacyBackendaOCompatibility backend for setuptools

    This is a version of setuptools.build_meta that endeavors
    to maintain backwards
    compatibility with pre-PEP 517 modes of invocation. It
    exists as a temporary
    bridge between the old packaging mechanism and the new
    packaging mechanism,
    and will eventually be removed.
    rPc
sttj}tjtj|}|tjvrtjd|tjd}|tjd<ztt	|j
|dW|tjdd<|tjd<dS|tjdd<|tjd<w)Nrr?)rrJr%r$dirnamerdinsertrKsuperrsrL)rr@sys_pathZ
script_dirZ
sys_argv_0	__class__r
rrLs 



z!_BuildMetaLegacyBackend.run_setuprr)rrr__doc__rL
__classcell__r
r
rxrrss
rs) rzr;r$rJr>r^rrfr"r
pkg_resourcesr__all__
BaseExceptionr	distrrr#r-r8rAobjectrBrsZ_BACKENDrrrrrrr
r
r
rs8	
m)
PK![ __pycache__/glob.cpython-310.pycnu[o

Xai	@sdZddlZddlZddlZgdZdddZdddZd	d
ZddZd
dZ	ddZ
ddZedZ
edZddZddZddZdS)z
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * Hidden files are not ignored.
N)globiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )	recursive)listr)pathnamerr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/glob.pyrsrcCs*t||}|rt|rt|}|rJ|S)aReturn an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )_iglob_isrecursivenext)rritsrrr	rs

rccstj|\}}|rt|rtnt}t|s/|r$tj|r"|VdStj|r-|VdS|s;|||EdHdS||krIt|rIt	||}n|g}t|sRt
}|D]}|||D]
}tj||Vq[qTdSN)ospathsplitrglob2glob1	has_magiclexistsisdirr
glob0join)rrdirnamebasenameglob_in_dirdirsnamerrr	r
0s0r
cCsT|st|trtjd}ntj}zt|}Wnty#gYSwt||SNASCII)	
isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr	rTs
rcCs:|s
tj|r|gSgStjtj||r|gSgSr)rrrrr)rrrrr	rasrccs4t|sJ|ddVt|D]}|VqdS)Nr)r	_rlistdir)rr)xrrr	rqsrccs|st|trtjd}ntj}zt|}Wntjy$YdSw|D]}|V|r5tj||n|}t	|D]
}tj||Vq;q'dSr)
r!r"rr#r$r%errorrrr+)rr*r,ryrrr	r+ys"
r+z([*?[])s([*?[])cCs.t|trt|}|duSt|}|duSr)r!r"magic_check_bytessearchmagic_check)rmatchrrr	rs



rcCst|tr	|dkS|dkS)Ns**z**)r!r")r)rrr	rs
rcCsBtj|\}}t|trtd|}||Std|}||S)z#Escape all special characters.
    s[\1]z[\1])rr
splitdriver!r"r/subr1)rdriverrr	rs
r)F)__doc__rrer'__all__rrr
rrrr+compiler1r/rrrrrrr	s"

$


PK!R{+extern/__pycache__/__init__.cpython-310.pycnu[o

Xaig	@s6ddlZddlZGdddZdZeeeddS)Nc@sXeZdZdZdddZeddZdd	Zd
dZdd
Z	ddZ
dddZddZdS)VendorImporterz
    A PEP 302 meta path importer for finding optionally-vendored
    or otherwise naturally-installed packages from root_name.
    NcCs&||_t||_|p|dd|_dS)NZextern_vendor)	root_namesetvendored_namesreplace
vendor_pkg)selfrrr	rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/extern/__init__.py__init__s
zVendorImporter.__init__ccs|jdVdVdS)zL
        Search first the vendor package then as a natural package.
        .N)r	r
rrrsearch_paths
zVendorImporter.search_pathcCs.||jd\}}}|ott|j|jS)z,Figure out if the target module is vendored.r
)	partitionranymap
startswithr)r
fullnamerootbasetargetrrr_module_matches_namespacesz(VendorImporter._module_matches_namespacec	Csx||jd\}}}|jD]"}z||}t|tj|}|tj|<|WSty0Yqwtdjdit)zK
        Iterate over the search path to locate and load fullname.
        r
zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.Nr)	rrr
__import__sysmodulesImportErrorformatlocals)r
rrrrprefixZextantmodrrrload_modules$



zVendorImporter.load_modulecCs||jSN)r"name)r
specrrr
create_module3szVendorImporter.create_modulecCsdSr#r)r
modulerrrexec_module6szVendorImporter.exec_modulecCs||rtj||SdS)z(Return a module spec for vendored names.N)r	importlibutilspec_from_loader)r
rpathrrrr	find_spec9s
zVendorImporter.find_speccCs|tjvr
tj|dSdS)zR
        Install this importer into sys.meta_path if not already present.
        N)r	meta_pathappendrrrrinstall@s
zVendorImporter.install)rN)NN)
__name__
__module____qualname____doc__rpropertyrrr"r&r(r-r0rrrrrs


r)	packaging	pyparsingZordered_setZmore_itertoolszsetuptools._vendor)importlib.utilr)rrnamesr1r0rrrrs
CPK!>v		.command/__pycache__/build_clib.cpython-310.pycnu[o

Xai?@sLddlmmZddlmZddlmZddlm	Z	GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS)
build_clibav
    Override the default build_clib behaviour to do the following:

    1. Implement a rudimentary timestamp-based dependency system
       so 'compile()' doesn't run every time.
    2. Add more keys to the 'build_info' dictionary:
        * obj_deps - specify dependencies for each object compiled.
                     this should be a dictionary mapping a key
                     with the source filename to a list of
                     dependencies. Use an empty string for global
                     dependencies.
        * cflags   - specify a list of additional flags to pass to
                     the compiler.
    c	Csn|D]\}}|d}|dust|ttfstd|t|}td||dt}t|ts8td|g}|dt}t|ttfsNtd||D](}|g}	|	|||t}
t|
ttfsntd||	|
|	|	qP|j
j||jd}t
||ggfkr|d}|d	}
|d
}|j
j||j||
||jd|j
j|||j|jdqdS)
Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list')
output_dirmacrosinclude_dirscflags)r	r
rZextra_postargsdebug)r	r
)get
isinstancelisttuplerrinfodictextendappendcompilerZobject_filenamesZ
build_temprcompiler
Zcreate_static_libr)self	librariesZlib_nameZ
build_inforrdependenciesZglobal_depssourceZsrc_depsZ
extra_depsZexpected_objectsr
rrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/build_clib.pybuild_librariess|






zbuild_clib.build_librariesN)__name__
__module____qualname____doc__rrrrrrsr)
Zdistutils.command.build_clibcommandrorigdistutils.errorsr	distutilsrZsetuptools.dep_utilrrrrrs
PK!7j@@+command/__pycache__/develop.cpython-310.pycnu[o

Xaid@sddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddl
Z
GdddejeZGd	d
d
ZdS))convert_path)log)DistutilsErrorDistutilsOptionErrorN)easy_install)
namespacesc@sveZdZdZdZejddgZejdgZdZddZ	d	d
Z
ddZed
dZ
ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode')	uninstalluzUninstall this source package)z	egg-path=Nz-Set the path to be used in the .egg-link filer	FcCs2|jrd|_||n||dS)NT)r	Z
multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_optionsselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/develop.pyruns
zdevelop.runcCs&d|_d|_t|d|_d|_dS)N.)r	egg_pathrinitialize_options
setup_pathZalways_copy_fromr
rrrr%s


zdevelop.initialize_optionscCs|d}|jrd}|j|jf}t|||jg|_t|||	|j
td|jd}t
j|j||_|j|_|jdurPt
j|j|_t|j}tt
j|j|j}||krltd|tj|t|t
j|j|jd|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz	.egg-linkzA--egg-path must be a relative path from the install directory to project_name)get_finalized_commandZbroken_egg_inforregg_nameargsrfinalize_optionsexpand_basedirsexpand_dirsZ
package_indexscanglobospathjoininstall_diregg_linkegg_baserabspath
pkg_resourcesnormalize_pathrDistributionPathMetadatadist_resolve_setup_pathr)reitemplaterZegg_link_fntargetrrrrr,sF





zdevelop.finalize_optionscCsn|tjdd}|tjkrd|dd}ttj	|||}|ttjkr5t
d|ttj|S)z
        Generate a path from egg_base back to '.' where the
        setup script resides and ensure that path points to the
        setup path from $install_dir/$egg_path.
        /z../zGCan't get a consistent path to setup script from installation directory)replacer!seprstripcurdircountr(r)r"r#r)r&r$rZ
path_to_setupresolvedrrrr-Ws

zdevelop._resolve_setup_pathcCs|d|jddd|dtjr|tjdt_|td|j|j	|j
sNt|jd}||j
d|jWdn1sIwY|d|j|jdS)Nr	build_extr2)ZinplacezCreating %s (link to %s)w
)run_commandreinitialize_command
setuptoolsZbootstrap_install_fromrZinstall_namespacesrinfor%r&dry_runopenwriterrZprocess_distributionr,no_deps)rfrrrrms

zdevelop.install_for_developmentcCstj|jr=td|j|jt|j}dd|D}|||j	g|j	|j
gfvr4td|dS|js=t
|j|jsF||j|jjrQtddSdS)NzRemoving %s (link to %s)cSsg|]}|qSr)r5).0linerrr
sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r!r"existsr%rr?r&rAcloserrwarnr@unlinkZ
update_pthr,distributionscripts)rZ
egg_link_filecontentsrrrrs
zdevelop.uninstall_linkc	Cs||jurt||S|||jjpgD]1}tjt	|}tj
|}t|}|
}Wdn1s:wY|||||qdSN)r,rinstall_egg_scriptsinstall_wrapper_scriptsrLrMr!r"r'rbasenameiorAreadZinstall_script)rr,script_nameZscript_pathstrmscript_textrrrrPs


zdevelop.install_egg_scriptscCst|}t||SrO)VersionlessRequirementrrQrr,rrrrQszdevelop.install_wrapper_scriptsN)__name__
__module____qualname____doc__descriptionruser_optionsboolean_optionsZcommand_consumes_argumentsrrrstaticmethodr-rrrPrQrrrrrs$	+
rc@s(eZdZdZddZddZddZdS)	rXa
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.

    >>> from pkg_resources import Distribution
    >>> dist = Distribution(project_name='foo', version='1.0')
    >>> str(dist.as_requirement())
    'foo==1.0'
    >>> adapted_dist = VersionlessRequirement(dist)
    >>> str(adapted_dist.as_requirement())
    'foo'
    cCs
||_dSrO)_VersionlessRequirement__distrYrrr__init__s
zVersionlessRequirement.__init__cCst|j|SrO)getattrrb)rnamerrr__getattr__sz"VersionlessRequirement.__getattr__cCs|jSrOrr
rrras_requirementsz%VersionlessRequirement.as_requirementN)rZr[r\r]rcrfrgrrrrrXs
rX)distutils.utilr	distutilsrdistutils.errorsrrr!r rSr(Zsetuptools.command.easy_installrr>rZDevelopInstallerrrXrrrrsPK!da,command/__pycache__/build_py.cpython-310.pycnu[o

XaiT @sddlmZddlmZddlmmZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlZddlmZddZGdddejZd	d
ZdS))glob)convert_pathN)unique_everseencCst|t|jtjBdSN)oschmodstatst_modeS_IWRITE)targetr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/build_py.py
make_writablesrc@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages

    The data files are specified via a 'package_data' argument to 'setup()'.
    See 'setuptools.dist.Distribution' for more details.

    Also, this version of the 'build_py' command allows you to specify both
    'py_modules' and 'packages' in the same setup operation.
    cCs@tj||jj|_|jjpi|_d|jvr|jd=g|_dS)N
data_files)origrfinalize_optionsdistributionpackage_dataexclude_package_data__dict___build_py__updated_filesselfrrr
rs


zbuild_py.finalize_optionscCsN|js|jsdS|jr||jr|||tjj|dddS)z?Build modules, packages, and copy data files to build directoryNr)Zinclude_bytecode)	
py_modulespackagesZ
build_modulesZbuild_packagesbuild_package_databyte_compilerrget_outputsrrrr
run$szbuild_py.runcCs&|dkr||_|jStj||S)zlazily compute data filesr)_get_data_filesrrr__getattr__)rattrrrr
r!4s
zbuild_py.__getattr__cCs.tj||||\}}|r|j|||fSr)rrbuild_modulerappend)rmoduleZmodule_filepackageoutfilecopiedrrr
r#;szbuild_py.build_modulecCs|tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr)analyze_manifestlistmap_get_pkg_data_filesrrrrr
r Aszbuild_py._get_data_filescsJ||tjj|jg|d}fdd||D}|||fS)N.csg|]	}tj|qSr)rpathrelpath).0filesrc_dirrr

Nsz0build_py._get_pkg_data_files..)get_package_dirrr.join	build_libsplitfind_data_files)rr&	build_dir	filenamesrr2r
r,Fs


zbuild_py._get_pkg_data_filescCsX||j||}tt|}tj|}ttj	j
|}t|j|g|}|
|||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrr+r	itertoolschain
from_iterablefilterrr.isfilemanifest_filesgetexclude_data_files)rr&r3patternsZglobs_expandedZ
globs_matchesZ
glob_filesfilesrrr
r9Ts
zbuild_py.find_data_filesc
Cst|jD]4\}}}}|D]+}tj||}|tj|tj||}|||\}}	t|tj|}qqdS)z$Copy data files into build directoryN)	rrr.r6mkpathdirname	copy_filerabspath)
rr&r3r:r;filenamersrcfileoutfr(rrr
reszbuild_py.build_package_datacCsi|_}|jjsdSi}|jpdD]}||t||<q|d|d}|jj	D]N}t
jt|\}}d}|}	|ra||kra||vra|}t
j|\}}
t
j
|
|}|ra||kra||vsF||vrz|dro||	kroq,|||g|q,dS)Nregg_infoz.py)rBrZinclude_package_datarassert_relativer5run_commandget_finalized_commandfilelistrFrr.r8r6endswith
setdefaultr$)rZmfZsrc_dirsr&Zei_cmdr.dfprevZoldfZdfrrr
r)ps.


zbuild_py.analyze_manifestcCsdSrrrrrr
get_data_filesszbuild_py.get_data_filescCsz|j|WStyYnwtj|||}||j|<|r#|jjs%|S|jjD]}||ks6||dr8nq)|St	|d}|
}Wdn1sPwYd|vrbtj
d|f|S)z8Check namespace packages' __init__ for declare_namespacer-rbNsdeclare_namespacezNamespace package problem: %s is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
")packages_checkedKeyErrorrr
check_packagerZnamespace_packages
startswithioopenread	distutilserrorsDistutilsError)rr&package_dirZinit_pypkgrVcontentsrrr
r\s0

zbuild_py.check_packagecCsi|_tj|dSr)rZrrinitialize_optionsrrrr
rgszbuild_py.initialize_optionscCs0tj||}|jjdurtj|jj|S|Sr)rrr5rZsrc_rootrr.r6)rr&resrrr
r5szbuild_py.get_package_dircs\t||j||}fdd|D}tj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]	}t|VqdSr)fnmatchr@r0pattern)rFrr
	z.build_py.exclude_data_files..c3s|]	}|vr|VqdSrr)r0fn)badrr
rlrm)r*r<rr=r>r?setr)rr&r3rFrEZmatch_groupsmatchesZkeepersr)rorFr
rDszbuild_py.exclude_data_filescs.t|dg||g}fdd|DS)z
        yield platform-specific path patterns (suitable for glob
        or fn_match) from a glob-based spec (such as
        self.package_data or self.exclude_package_data)
        matching package in src_dir.
        c3s"|]}tjt|VqdSr)rr.r6rrjr2rr
rls

z2build_py._get_platform_patterns..)r=r>rC)specr&r3Zraw_patternsrr2r
r<s


zbuild_py._get_platform_patternsN)__name__
__module____qualname____doc__rrr!r#r r,r9rr)rXr\rgr5rDstaticmethodr<rrrr
rs$	rcCs6tj|s|Sddlm}td|}||)Nr)DistutilsSetupErrorz
        Error: setup script specifies an absolute path:

            %s

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.
        )rr.isabsdistutils.errorsrytextwrapdedentlstrip)r.rymsgrrr
rOs	
rO)rdistutils.utilrZdistutils.command.build_pycommandrrrrir|r^r{rar=rZ setuptools.extern.more_itertoolsrrrOrrrr
sEPK!ee*command/__pycache__/upload.cpython-310.pycnu[o

Xai@s:ddlmZddlmZddlmZGdddejZdS))log)upload)RemovedCommandErrorc@seZdZdZddZdS)rz)Formerly used to upload packages to PyPI.cCsd}|d|tjt|)Nz[The upload command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/upload.pyrun
sz
upload.runN)__name__
__module____qualname____doc__rr	r	r	r
rsrN)	distutilsrdistutils.commandrorigZsetuptools.errorsrr	r	r	r
sPK!mm-command/__pycache__/bdist_rpm.cpython-310.pycnu[o

Xai@s<ddlmmZddlZddlmZGdddejZdS)N)SetuptoolsDeprecationWarningc@s eZdZdZddZddZdS)	bdist_rpma
    Override the default bdist_rpm behavior to do the following:

    1. Run egg_info to ensure the name and version are properly calculated.
    2. Always run 'install' using --single-version-externally-managed to
       disable eggs in RPM distributions.
    cCs&tdt|dtj|dS)Nzjbdist_rpm is deprecated and will be removed in a future version. Use bdist_wheel (wheel packages) instead.egg_info)warningswarnrrun_commandorigrrun)selfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/bdist_rpm.pyr	s
z
bdist_rpm.runcCstj|}dd|D}|S)NcSs g|]}|ddddqS)zsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0linerrr
sz-bdist_rpm._make_spec_file..)rr_make_spec_file)r
specrrrrs

zbdist_rpm._make_spec_fileN)__name__
__module____qualname____doc__r	rrrrrrsr)Zdistutils.command.bdist_rpmcommandrrr
setuptoolsrrrrrsPK!.8N,command/__pycache__/saveopts.cpython-310.pycnu[o

Xai@s$ddlmZmZGdddeZdS))edit_configoption_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsh|j}i}|jD]!}|dkrq||D]\}\}}|dkr(|||i|<qqt|j||jdS)Nrzcommand line)distributioncommand_optionsget_option_dictitems
setdefaultrfilenamedry_run)selfdistsettingscmdoptsrcvalr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/saveopts.pyrun	s
zsaveopts.runN)__name__
__module____qualname____doc__descriptionrrrrrrsrN)Zsetuptools.command.setoptrrrrrrrsPK!Lb&&-command/__pycache__/build_ext.cpython-310.pycnu[o

Xai3@szddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZzddlmZed
WneyUeZYnwedddlmZd
dZdZdZdZejdkrrdZnej dkrz
ddl!Z!e"e!dZZWn	eyYnwddZ#ddZ$GdddeZesej dkr				dddZ%dSdZ				dddZ%dS) NEXTENSION_SUFFIXES)	build_ext)	copy_file)new_compiler)customize_compilerget_config_var)DistutilsError)log)LibraryzCython.Compiler.MainLDSHARED)_config_varsc	Csltjdkr0t}zdtd<dtd<dtd<t|Wtt|dStt|wt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclibCCSHAREDz.dylibSO)sysplatform_CONFIG_VARScopyrclearupdate)compilertmpr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/build_ext.py_customize_compiler_for_shlibs

rFZsharedrTntRTLD_NOWcCstr|SdS)N)	have_rtld)srrrif_dl>sr!cCs.tD]}d|vr|S|dkr|SqdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)suffixrrrget_abi3_suffixBsr#c@sveZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZdddZdS)rcCs2|jd}|_t|||_|r|dSdS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace
_build_extruncopy_extensions_to_source)selfZold_inplacerrrr%Ls
z
build_ext.runc
Cs|d}|jD]J}||j}||}|d}d|dd}||}tj	|tj	
|}tj	|j|}	t|	||j
|jd|jrR||pNtj|dqdS)Nbuild_py.)verbosedry_runT)get_finalized_command
extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename	build_librr+r,_needs_stub
write_stubcurdir)
r'r(extfullnamefilenamemodpathpackagepackage_dirZ
dest_filenameZsrc_filenamerrrr&Ts&





z#build_ext.copy_extensions_to_sourcecCstd}|rtjj|d|}n
t||}td}||jvrk|j|}t	|do.t
}|rA|dt|}t
}||}t|t
rUtj|\}}|j|tStrk|jrktj|\}}tj|d|S|S)NZSETUPTOOLS_EXT_SUFFIXr)
EXT_SUFFIXZpy_limited_apizdl-)r4getenvr5r3r2r$r1rext_mapgetattrr#len
isinstancersplitextshlib_compilerlibrary_filenamelibtype	use_stubs_links_to_dynamic)r'r<Zso_extr=r;Zuse_abi3fndrrrr1js&




zbuild_ext.get_ext_filenamecCs t|d|_g|_i|_dSN)r$initialize_optionsrHshlibsrCr'rrrrPs

zbuild_ext.initialize_optionscCs(t||jp	g|_||jdd|jD|_|jr!||jD]	}||j|_q$|jD]`}|j}||j	|<||j	|
dd<|jrM||pNd}|oXtoXt
|t}||_||_||}|_tjtj|j|}|r||jvr|j||rtrtj|jvr|jtjq1dS)NcSsg|]	}t|tr|qSr)rFr.0r;rrr
s
z.build_ext.finalize_options..r)r*F)r$finalize_optionsr.Zcheck_extensions_listrQsetup_shlib_compilerr/r0
_full_namerCr2links_to_dynamicrKrFrrLr8r1
_file_namer4r5dirnamer3r7library_dirsappendr:runtime_library_dirs)r'r;r<Zltdnsr=libdirrrrrVs0



zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdur||j|jdur/|jD]
\}}|	||q$|j
dur?|j
D]}||q7|jdurJ|
|j|jdurU||j|jdur`||j|jdurk||jt||_dS)N)rr,force)rrr,rarHrinclude_dirsZset_include_dirsZdefineZdefine_macroZundefZundefine_macro	librariesZ
set_librariesr\Zset_library_dirsZrpathZset_runtime_library_dirsZlink_objectsZset_link_objectslink_shared_object__get__)r'rr0valueZmacrorrrrWs*







zbuild_ext.setup_shlib_compilercCst|tr|jSt||SrO)rFrexport_symbolsr$get_export_symbolsr'r;rrrrhs
zbuild_ext.get_export_symbolscCsl||j}z*t|tr|j|_t|||jr,|dj	}|
||W||_dSW||_dS||_w)Nr()Z_convert_pyx_sources_to_langrrFrrHr$build_extensionr8r-r7r9)r'r;Z	_compilercmdrrrrjs

zbuild_ext.build_extensioncsPtdd|jDd|jddddgtfdd|jDS)	z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|]}|jqSr)rX)rTlibrrrrUsz.build_ext.links_to_dynamic..r)Nr*rc3s|]	}|vVqdSrOr)rTZlibnameZlibnamespkgrr	z-build_ext.links_to_dynamic..)dictfromkeysrQr3rXr2anyrcrirrmrrYs zbuild_ext.links_to_dynamiccCst||SrO)r$get_outputs_build_ext__get_stubs_outputsrRrrrrtszbuild_ext.get_outputscs6fddjD}t|}tdd|DS)Nc3s4|]}|jrtjjjg|jdRVqdS)r)N)r8r4r5r3r7rXr2rSrRrrros
z0build_ext.__get_stubs_outputs..css|]	\}}||VqdSrOr)rTbaseZfnextrrrrorp)r.	itertoolsproduct!_build_ext__get_output_extensionslist)r'Zns_ext_basespairsrrRrZ__get_stubs_outputss

zbuild_ext.__get_stubs_outputsccs(dVdV|djrdVdSdS)N.pyz.pycr(z.pyo)r-optimizerRrrrZ__get_output_extensionss
z!build_ext.__get_output_extensionsFcCs8td|j|tjj|g|jdRd}|r&tj|r&t|d|j	s`t
|d}|dddd	td
dtj
|jdd
dtddddtddddddtddddg||rddlm}||gdd|j	d |d!j}|dkr||g|d|j	d tj|r|j	st|dSdSdSdS)"Nz writing stub loader for %s to %sr)r|z already exists! Please delete.w
zdef __bootstrap__():z-   global __bootstrap__, __file__, __loader__z0   import sys, os, pkg_resources, importlib.utilz, dlz:   __file__ = pkg_resources.resource_filename(__name__,%r)z   del __bootstrap__z    if '__loader__' in globals():z       del __loader__z#   old_flags = sys.getdlopenflags()z   old_dir = os.getcwd()z   try:z(     os.chdir(os.path.dirname(__file__))z$     sys.setdlopenflags(dl.RTLD_NOW)z3     spec = importlib.util.spec_from_file_location(z#                __name__, __file__)z0     mod = importlib.util.module_from_spec(spec)z!     spec.loader.exec_module(mod)z   finally:z"     sys.setdlopenflags(old_flags)z     os.chdir(old_dir)z__bootstrap__()rr)byte_compileT)r}rar,install_lib)r
inforXr4r5r3r2existsr	r,openwriter!r6rZclosedistutils.utilrr-r}unlink)r'
output_dirr;compileZ	stub_filefrr}rrrr9sl

	zbuild_ext.write_stubN)F)__name__
__module____qualname__r%r&r1rPrVrWrhrjrYrtruryr9rrrrrKs
	rc

Cs(||j|||||||||	|
||
dSrO)linkZSHARED_LIBRARY)
r'objectsoutput_libnamerrcr\r^rgdebug
extra_preargsextra_postargs
build_temptarget_langrrrrd$srdZstaticc
Cs^|dusJtj|\}}
tj|
\}}|ddr$|dd}||||||dS)Nxrl)r4r5r2rGrI
startswithZcreate_static_lib)r'rrrrcr\r^rgrrrrrr=r6r;rrrrd3s
)
NNNNNrNNNN)&r4rrwimportlib.machineryrZdistutils.command.build_extrZ
_du_build_extdistutils.file_utilrZdistutils.ccompilerrdistutils.sysconfigrrdistutils.errorsr		distutilsr
Zsetuptools.extensionrZCython.Distutils.build_extr$
__import__ImportErrorr
rrrrKrJrr0dlhasattrr!r#rdrrrrs`

	W
PK!f3f3-command/__pycache__/bdist_egg.cpython-310.pycnu[o

Xai@@s"dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZmZddlmZddlmZdd	lmZmZd
dZdd
ZddZddZGdddeZedZ ddZ!ddZ"ddZ#dddZ$ddZ%d d!Z&d"d#Z'gd$Z(	%	&d)d'd(Z)dS)*z6setuptools.command.bdist_egg

Build .egg distributions)remove_treemkpath)log)CodeTypeN)get_build_platformDistributionensure_directory)Library)Command)get_pathget_python_versioncCstdS)Npurelib)rrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/bdist_egg.py_get_purelibrcCs2d|vrtj|d}|dr|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrrstrip_modules

rccs8t|D]\}}}|||||fVqdS)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)rwalksort)dirbasedirsfilesrrrsorted_walk!sr cCsLtd}t|d}|||WddS1swYdS)Na
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, importlib.util
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __loader__ = None; del __bootstrap__, __loader__
            spec = importlib.util.spec_from_file_location(__name__,__file__)
            mod = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(mod)
        __bootstrap__()
        w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr
write_stub+s
"r*c@seZdZdZddddefdddd	gZgd
ZddZd
dZddZ	ddZ
ddZddZddZ
ddZddZddZdd Zd!S)"	bdist_eggzcreate an "egg" distribution)z
bdist-dir=bz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))exclude-source-filesNz+remove all .py files from the generated egg)	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=dz-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))r/r2r.cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)	bdist_dir	plat_name	keep_tempdist_dir
skip_build
egg_outputexclude_source_filesselfrrrinitialize_optionsRs
zbdist_egg.initialize_optionscCs|d}|_|j|_|jdur|dj}tj|d|_|jdur(t	|_|
dd|jdurTtdd|j
|jt|joC|j
}tj|j|d|_dSdS)Negg_infobdistegg)r6r6z.egg)get_finalized_commandei_cmdr=r3
bdist_baserrjoinr4rset_undefined_optionsr8regg_nameZegg_versionrdistributionhas_ext_modulesr6)r;rArBbasenamerrrfinalize_options[s$


zbdist_egg.finalize_optionscCs|j|d_tjtjt}|jj	g}|j_	|D]D}t
|trZt|dkrZtj
|drZtj|d}tj|}||ksL||tjrZ|t|dd|df}|jj	|qztd|j|jddddW||j_	dS||j_	w)Ninstallrzinstalling package data to %sinstall_data)forceroot)r3r@install_librrnormcaserealpathrrF
data_files
isinstancetuplelenisabs
startswithsepappendrinfocall_command)r;
site_packagesolditemrR
normalizedrrrdo_install_datass"zbdist_egg.do_install_datacCs|jgS)N)r8r:rrrget_outputsrzbdist_egg.get_outputscKsTtD]	}|||jq|d|j|d|j|j|fi|}|||S)z8Invoke reinitialized command `cmdname` with keyword argsr7dry_run)INSTALL_DIRECTORY_ATTRS
setdefaultr3r7rcreinitialize_commandrun_command)r;Zcmdnamekwdirnamecmdrrrr\s
zbdist_egg.call_commandcCs|dtd|j|d}|j}d|_|jr$|js$|d|j	ddd}||_|
\}}g|_g}t|D]>\}}t
j|\}	}
t
j|jt|	d}|j|td	||jsmtt
j|||||t
jd
||<q=|r|||jjr||j}t
j|d}
||
|jjrt
j|
d}td
||j	d|dd||
t
j|
d}|rtd||jst|t|d}| d|| d|!nt
j"|rtd||jst
#|t$t
j|d|%t
j&t
j|j'drt(d|j)r|*t+|j,||j-|j|.d|j/s9t0|j|jdt1|jdgdt2|j,fdS)Nr=zinstalling library code to %srJ
build_clibrPr)warn_dir.pyzcreating stub loader for %s/EGG-INFOscriptszinstalling scripts to %sinstall_scriptsrL)install_dirZno_epznative_libs.txtz
writing %swt
zremoving %szdepends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)verbosercmoderc
dist_filesr+)3rgrr[r3r@rOrFhas_c_librariesr7r\get_ext_outputsstubs	enumeraterrrrCrrZrcr*rHreplacerYbyte_compilerSrarrpcopy_metadata_torr%r&closeisfileunlinkwrite_safety_flagzip_safeexistsr=warnr9zap_pyfilesmake_zipfiler8ru
gen_headerr5rgetattrr)r;ZinstcmdZold_rootrjall_outputsext_outputsZ
to_compiler-Zext_namerextr(Zarchive_rootr=Z
script_dirZnative_libsZ	libs_filerrrruns










z
bdist_egg.runc

Cstdt|jD]^\}}}|D]V}tj||}|dr*td|t	||drg|}d}t
||}tj|tj|
dd}	td||	fzt|	Wn	ty`Ynwt||	qq
dS)	Nz+Removing .py files from temporary directoryrmzDeleting %s__pycache__z#(?P.+)\.(?P[^.]+)\.pycname.pyczRenaming file from [%s] to [%s])rr[walk_eggr3rrrCrdebugrrematchpardirgroupremoveOSErrorrename)
r;rrrrrZpath_oldpatternmZpath_newrrrrs8



zbdist_egg.zap_pyfilescCs2t|jdd}|dur
|Stdt|j|jS)Nrz4zip_safe flag not set; analyzing archive contents...)rrFrranalyze_eggr3r{)r;saferrrrs

zbdist_egg.zip_safecCsdS)Nr!rr:rrrrszbdist_egg.gen_headercCshtj|j}tj|d}|jjjD]}||r1tj||t	|d}t
||||qdS)z*Copy metadata (egg info) to the target_dirN)rrnormpathr=rCrAfilelistrrXrVr	copy_file)r;
target_dirZ
norm_egg_infoprefixrtargetrrrrs
zbdist_egg.copy_metadata_tocCsg}g}|jdi}t|jD]3\}}}|D]}tj|dtvr,||||q|D]}|||d|tj||<q/q|j	
r}|d}|jD]-}	t
|	trWqO||	j}
||
}tj|ds|tjtj|j|r|||qO||fS)zAGet a list of relative paths to C extensions in the output distrorrLrn	build_extzdl-)r3r rrrlowerNATIVE_EXTENSIONSrZrCrFrGr@
extensionsrTr	Zget_ext_fullnamerZget_ext_filenamerHrXr)r;rrpathsrrrrZ	build_cmdrfullnamerrrrzs6






zbdist_egg.get_ext_outputsN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsr<rIrarbr\rrrrrrzrrrrr+;s.	
Qr+z.dll .so .dylib .pydccsJt|}t|\}}}d|vr|d|||fV|D]}|VqdS)z@Walk an unpacked egg's contents, skipping the metadata directoryroN)r nextr)egg_dirwalkerrrrZbdfrrrr:s
rc	CstD]\}}tjtj|d|r|SqtsdSd}t|D](\}}}|D] }|ds7|dr8q+|dsB|drKt	||||oJ|}q+q$|S)NroFTrmz.pywrz.pyo)
safety_flagsitemsrrrrCcan_scanrrscan_module)	rr{flagfnrrrrrrrrrEs rcCstD]9\}}tj||}tj|r%|dust||kr$t|q|dur=t||kr=t|d}|	d|
qdS)Nrsrt)rrrrrCrboolrr%r&r)rrrrr)rrrrWs


rzzip-safeznot-zip-safe)TFc
Cstj||}|dd|vrdS|t|ddtjd}||r%dp&dtj|d}tjdkr8d	}nd
}t	|d}|
|t|}	|
d}
tt|	}dD]}||vrgtd
||d}
qXd|vr~dD]}||vr}td||d}
qn|
S)z;Check whether module possibly uses unsafe-for-zipfile stuffNTrLrrr)rb)__file____path__z%s: module references %sFinspect)	getsource
getabsfile
getsourcefileZgetfilegetsourcelines
findsourcegetcommentsgetframeinfogetinnerframesgetouterframesstacktracez"%s: module MAY be using inspect.%s)rrrCrVr}rYrsysversion_infor%readmarshalloadrdictfromkeysiter_symbolsrr)
rrrr{rpkgrskipr)codersymbolsbadrrrrjs4 



rccsT|jD]}|Vq|jD]}t|tr|Vq
t|tr't|D]}|Vq!q
dS)zBYield names and strings used by `code` and its nested code objectsN)co_names	co_constsrTstrrr)rrconstrrrrs



rcCs2tjds
tjdkr
dStdtddS)NjavacliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py)rplatformrXrrrrrrrs
r)rPrrrMinstall_baseTr!c
sddl}ttj|dtd|fdd}|r!|jn|j}sD|j	|||d}	t
D]\}
}}||	|
|q2|	|St
D]\}
}}|d|
|qH|S)aqCreate a zip file from all the files under 'base_dir'.  The output
    zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
    Python module (if available) or the InfoZIP "zip" utility (if installed
    and found on the default search path).  If neither tool is available,
    raises DistutilsExecError.  Returns the name of the output zip file.
    rNrwz#creating '%s' and adding '%s' to itcs`|D]+}tjtj||}tj|r-|tdd}s'|||td|qdS)NrLzadding '%s')	rrrrCrrVr&rr)zrinamesrrr-base_dirrcrrvisitszmake_zipfile..visit)compression)zipfilerrrrirr[ZIP_DEFLATED
ZIP_STOREDZipFiler r)
zip_filenamerrurccompressrvrrrrrirrrrrrs	r)rrTr!)*__doc__distutils.dir_utilrr	distutilsrtypesrrrrr"r
pkg_resourcesrrrZsetuptools.extensionr	
setuptoolsr
	sysconfigrrrrr r*r+rrsplitrrrrrrrrrdrrrrrsB
}"PK!n+command/__pycache__/install.cpython-310.pycnu[o

Xai*@s|ddlmZddlZddlZddlZddlZddlmmZ	ddl
Z
e	jZGddde	jZdde	jjDej
e_dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd	d
dfgZe	eZ
ddZd
dZddZ
ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)old-and-unmanageableNzTry not to use this!)!single-version-externally-managedNz5used by system package builders to create 'flat' eggsrrinstall_egg_infocCdSNTselfr	r	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install.pyzinstall.install_scriptscCrrr	r
r	r	rr
rcCs*tdtjtj|d|_d|_dS)NzRsetup.py install is deprecated. Use build and pip and other standards-based tools.)	warningswarn
setuptoolsZSetuptoolsDeprecationWarningorigrinitialize_optionsold_and_unmanageable!single_version_externally_managedr
r	r	rr s
zinstall.initialize_optionscCsBtj||jrd|_dS|jr|js|jstddSdSdS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordrr
r	r	rr,s
zinstall.finalize_optionscCs(|js|jrtj|Sd|_d|_dS)N)rrrrhandle_extra_path	path_file
extra_dirsr
r	r	rr7s
zinstall.handle_extra_pathcCsB|js|jrtj|S|tstj|dS|dS)N)	rrrrrun_called_from_setupinspectcurrentframedo_egg_installr
r	r	rrAs
zinstall.runcCsz|durd}t|tdkrd}t|dSt|d}|dd\}t|}|jdd	}|d
ko<|j	dkS)a
        Attempt to detect whether run() was called from setup() or by another
        command.  If called by setup(), the parent caller will be the
        'run_command' method in 'distutils.dist', and *its* caller will be
        the 'run_commands' method.  If called any other way, the
        immediate caller *might* be 'run_command', but it won't have been
        called by 'run_commands'. Return True in that case or if a call stack
        is unavailable. Return False otherwise.
        Nz4Call stack not available. bdist_* commands may fail.
IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distrun_commands)
rrplatformpython_implementationr getouterframesgetframeinfo	f_globalsgetfunction)Z	run_framemsgresZcallerinfoZ
caller_moduler	r	rrLs


zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd|	d|j
djg}tj
r8|dtj
||_|jdd	dt_
dS)
Neasy_installx)argsrr.z*.eggZ	bdist_eggrF)Zshow_deprecation)distributionget_command_classrrensure_finalizedZalways_copy_fromZ
package_indexscanglobrun_commandget_command_objZ
egg_outputrZbootstrap_install_frominsertr4r)rr2cmdr4r	r	rr"gs

zinstall.do_egg_installN)r&
__module____qualname____doc__rruser_optionsboolean_optionsnew_commandsdict_ncrrrrstaticmethodrr"r	r	r	rrs(



rcCsg|]}|dtjvr|qS)r)rrF).0r>r	r	r
srI)distutils.errorsrr r:rr(distutils.command.installcommandrrr_installsub_commandsrDr	r	r	rssPK!kf

*command/__pycache__/rotate.cpython-310.pycnu[o

XaiP@sTddlmZddlmZddlmZddlZddlZddlm	Z	Gddde	Z
dS))convert_path)log)DistutilsOptionErrorN)Commandc@s8eZdZdZdZgdZgZddZddZdd	Z	d
S)rotatezDelete older distributionsz2delete older distributions, keeping N newest files))zmatch=mzpatterns to match (required))z	dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/rotate.pyinitialize_optionss
zrotate.initialize_optionsc
Cs|jdur	td|jdurtdzt|j|_Wnty+}ztd|d}~wwt|jtr>dd|jdD|_|dddS)	NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|qSr)rstrip).0prrr
(sz+rotate.finalize_options..,bdist)rr)	r
rrint
ValueError
isinstancestrsplitset_undefined_options)r
errrfinalize_optionss"



zrotate.finalize_optionscCs|dddlm}|jD]U}|jd|}|tj|j|}dd|D}|	|
tdt
||||jd}|D]\}}td||jsbtj|r]t|qDt|qDqdS)	Negg_infor)glob*cSsg|]
}tj||fqSr)ospathgetmtime)rfrrrr4szrotate.run..z%d file(s) matching %szDeleting %s)run_commandr r
distributionget_namer"r#joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)r
r patternfilestr%rrrrun-s&


z
rotate.runN)
__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsrrr6rrrrr
sr)distutils.utilr	distutilsrdistutils.errorsrr"r0
setuptoolsrrrrrrsPK!J!		)command/__pycache__/alias.cpython-310.pycnu[o

XaiM	@sDddlmZddlmZmZmZddZGdddeZddZd	S)
)DistutilsOptionError)edit_configoption_baseconfig_filecCs8dD]}||vrt|Sq||gkrt|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/alias.pyshquotesrc@sHeZdZdZdZdZdgejZejdgZddZ	dd	Z
d
dZdS)
aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasrcCst|d|_d|_dS)N)rinitialize_optionsargsrselfrrrrs

zalias.initialize_optionscCs.t||jrt|jdkrtddSdS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrrrrrrr!s
zalias.finalize_optionscCs|jd}|js tdtd|D]
}tdt||qdSt|jdkrG|j\}|jr1d}n(||vr?tdt||dStd|dS|jd}dtt	|jdd}t
|jd||ii|jdS)	NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr )
distributionget_option_dictrprintformat_aliasrrjoinmaprrfilenamedry_run)rrrcommandrrrrun)s&
z	alias.runN)__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsruser_optionsboolean_optionsrrr&rrrrrsrcCsZ||\}}|tdkrd}n|tdkrd}n
|tdkr!d}nd|}||d|S)	Nglobalz--global-config userz--user-config localz
--filename=%rr)r)namersourcer%rrrr Dsr N)	distutils.errorsrZsetuptools.command.setoptrrrrrr rrrrs

4PK!-command/__pycache__/dist_info.cpython-310.pycnu[o

Xai@s8dZddlZddlmZddlmZGdddeZdS)zD
Create a dist_info directory
As defined in the wheel specification
N)Command)logc@s.eZdZdZdgZddZddZddZd	S)
	dist_infozcreate a .dist-info directory)z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)cCs
d|_dSN)egg_baseselfr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/dist_info.pyinitialize_optionss
zdist_info.initialize_optionscCsdSrr
rr
r
rfinalize_optionsszdist_info.finalize_optionscCsn|d}|j|_|||jdtdd}tdt	j
||d}||j|dS)Negg_infoz	.egg-infoz
.dist-infoz
creating '{}'bdist_wheel)
get_finalized_commandrr
runrlenrinfoformatospathabspathZegg2dist)r	r
dist_info_dirrr
r
rrs

z
dist_info.runN)__name__
__module____qualname__descriptionuser_optionsrr
rr
r
r
rrsr)__doc__rdistutils.corer	distutilsrrr
r
r
rs
PK!pt		3command/__pycache__/install_scripts.cpython-310.pycnu[o

Xai!
@sdddlmZddlmmZddlmZddlZddl	Z	ddl
mZmZm
Z
GdddejZdS))logN)DistutilsModuleError)DistributionPathMetadataensure_directoryc@s*eZdZdZddZddZd
ddZd	S)install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj|d|_dS)NF)origrinitialize_optionsno_ep)selfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_scripts.pyr	
s
z"install_scripts.initialize_optionsc	Csddlmm}|d|jjrtj|ng|_	|j
r!dS|d}t|j
t|j
|j|j|j}|d}t|dd}z
|d}t|dd}Wn
ttfyZd}Ynw|j}|red}|j}|tjkrm|g}|}|j|}	|||	D]}
|j|
qdS)	Nregg_info
build_scripts
executableZ
bdist_wininstZ_is_runningFz
python.exe)setuptools.command.easy_installcommandeasy_installrun_commanddistributionscriptsrrrunoutfilesr
get_finalized_commandrZegg_baserregg_nameZegg_versiongetattrImportErrorrZScriptWriterZWindowsScriptWritersysrbestZcommand_spec_class
from_paramget_argsZ	as_headerwrite_script)reiZei_cmddistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstwritercmdargsrrr
rs>




zinstall_scripts.runtc
Gsddlm}m}td||jtj|j|}|j	
||}|jsAt|t
|d|}	|	||	||d|dSdS)z1Write an executable file to the scripts directoryr)chmod
current_umaskzInstalling %s script to %swiN)rr(r)rinfoZinstall_dirospathjoinrappenddry_runropenwriteclose)
rscript_namecontentsmodeZignoredr(r)targetmaskfrrr
r!7s
zinstall_scripts.write_scriptN)r')__name__
__module____qualname____doc__r	rr!rrrr
r
s
&r)	distutilsrZ!distutils.command.install_scriptsrrrdistutils.errorsrr,r
pkg_resourcesrrrrrrr
sPK!}VV)command/__pycache__/sdist.cpython-310.pycnu[o

Xai@sxddlmZddlmmZddlZddlZddlZddl	Z	ddl
mZddlZe
Zd
ddZGdd	d	eejZdS))logN)sdist_add_defaultsccs.tdD]}||D]}|VqqdS)z%Find all files under revision controlzsetuptools.file_findersN)
pkg_resourcesiter_entry_pointsload)dirnameepitemr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/sdist.pywalk_revctrlsrcseZdZdZgdZiZgdZeddeDZddZ	dd	Z
d
dZdd
Ze
ejddZfddZddZddZddZfddZddZddZddZd d!ZZS)"sdistz=Smart sdist that finds anything supported by revision control))zformats=Nz6formats for source distribution (comma-separated list))z	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])rz.rstz.txtz.mdccs|]}d|VqdS)z	README{0}N)format).0extrrr
	+szsdist.cCs|d|d}|j|_|jtj|jd||	D]}||q"|
t|jdg}|j
D]}dd|f}||vrH||q8dS)Negg_infozSOURCES.txt
dist_filesrr)run_commandget_finalized_commandfilelistappendospathjoinrcheck_readmeget_sub_commandsmake_distributiongetattrdistributionZ
archive_files)selfZei_cmdcmd_namerfiledatarrr
run-s




z	sdist.runcCstj||dSN)origrinitialize_options_default_to_gztarr&rrr
r-@szsdist.initialize_optionscCstjdkrdSdg|_dS)N)rbetargztar)sysversion_infoformatsr/rrr
r.Es
zsdist._default_to_gztarcCs:|tj|WddS1swYdS)z%
        Workaround for #516
        N)_remove_os_linkr,rr#r/rrr
r#Ks
"zsdist.make_distributionc
csvGddd}ttd|}zt`Wn	tyYnwzdVW||ur-ttd|dSdS||ur:ttd|ww)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link..NoValueN)__name__
__module____qualname__rrrr
NoValueYsr;linkN)r$rr<	Exceptionsetattr)r;Zorig_valrrr
r7Rszsdist._remove_os_linkcs*ttjdr|jddSdS)Nzpyproject.toml)super_add_defaults_optionalrrisfilerrr/	__class__rr
r@gs
zsdist._add_defaults_optionalcCs<|jr|d}|j||||dSdS)zgetting python filesbuild_pyN)r%has_pure_modulesrrextendZget_source_files_add_data_files_safe_data_filesr&rDrrr
_add_defaults_pythonls


zsdist._add_defaults_pythoncCs|jjrdS|jS)z
        Extracting data_files from build_py is known to cause
        infinite recursion errors when `include_package_data`
        is enabled, so suppress it in that case.
        r)r%Zinclude_package_data
data_filesrIrrr
rHsszsdist._safe_data_filescCs|jdd|DdS)zA
        Add data files as found in build_py.data_files.
        css0|]\}}}}|D]
}tj||Vq
qdSr+)rrr )r_src_dir	filenamesnamerrr
rs
z(sdist._add_data_files..N)rrF)r&rKrrr
rG}szsdist._add_data_filescs0ztWdStytdYdSw)Nz&data_files contains unexpected objects)r?_add_defaults_data_files	TypeErrorrwarnr/rBrr
rPs
zsdist._add_defaults_data_filescCs8|jD]}tj|rdSq|dd|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrRr )r&frrr
r!s

zsdist.check_readmecCs^tj|||tj|d}ttdr%tj|r%t||	d||
d|dS)Nz	setup.cfgr<r)r,rmake_release_treerrr hasattrrTunlink	copy_filerZsave_version_info)r&base_dirfilesdestrrr
rVs
zsdist.make_release_treecCsTtj|js	dSt|jd}|}Wdn1swY|dkS)NFrbz+# file GENERATED by distutils, do NOT edit
)rrrAmanifestioopenreadlineencode)r&fp
first_linerrr
_manifest_is_not_generateds
z sdist._manifest_is_not_generatedc	Cstd|jt|jd}|D],}z|d}Wnty(td|Yqw|}|ds4|s5q|j	
|q|dS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'r]zUTF-8z"%r not UTF-8 decodable -- skipping#N)rinfor^r`decodeUnicodeDecodeErrorrRstrip
startswithrrclose)r&r^linerrr

read_manifestszsdist.read_manifest)r8r9r:__doc__user_optionsnegative_optZREADME_EXTENSIONStuplerSr*r-r.r#staticmethod
contextlibcontextmanagerr7r@rJrHrGrPr!rVrern
__classcell__rrrBr
rs,




r)r)	distutilsrZdistutils.command.sdistcommandrr,rr4r_rtZ
py36compatrrlistZ_default_revctrlrrrrr
s
PK!+,command/__pycache__/__init__.cpython-310.pycnu[o

Xai@s<ddlmZddlZdejvrdejd<ejd[[dS))bdistNegg)Z	bdist_eggzPython .egg file)Zdistutils.command.bdistrsysZformat_commandsZformat_commandappendrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__init__.pys

PK!ab,command/__pycache__/register.cpython-310.pycnu[o

Xai@s@ddlmZddlmmZddlmZGdddejZdS))logN)RemovedCommandErrorc@seZdZdZddZdS)registerz+Formerly used to register packages on PyPI.cCsd}|d|tjt|)Nz]The register command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/register.pyrun
szregister.runN)__name__
__module____qualname____doc__rr	r	r	r
rsr)	distutilsrZdistutils.command.registercommandrorigZsetuptools.errorsrr	r	r	r
sPK!+_m*command/__pycache__/setopt.cpython-310.pycnu[o

Xai@sddlmZddlmZddlmZddlZddlZddlZddlm	Z	gdZ
ddd	ZdddZGd
dde	Z
Gddde
ZdS))convert_path)log)DistutilsOptionErrorN)Command)config_fileedit_configoption_basesetoptlocalcCsd|dkrdS|dkrtjtjtjdS|dkr-tjdkr!dp"d}tjtd	|St	d
|)zGet the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    r
z	setup.cfgglobalz
distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user')
ospathjoindirname	distutils__file__name
expanduserr
ValueError)kinddotr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/setopt.pyr
srFc		CsHtd|t}dd|_||g|D]c\}}|dur.td||||q|	|s?td|||
||D]8\}}|durktd||||||||sjtd||||qCtd	|||||
|||qCqtd
||st|d}||WddS1swYdSdS)aYEdit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %scSs|SNr)xrrr*szedit_config..NzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %sw)rdebugconfigparserRawConfigParseroptionxformreaditemsinforemove_sectionhas_sectionadd_section
remove_optionoptionssetopenwrite)	filenamesettingsdry_runoptssectionr,optionvaluefrrrr sH




"rc@s0eZdZdZgdZddgZddZddZd	S)
rzrrrr@s


zsetopt.initialize_optionscCsFt||jdus|jdurtd|jdur|js!tddSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rrErQr5rrRrOr>rrrrEs
zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr0rQr5replacerRr2r>rrrrunsz
setopt.runN)rFrGrHrIdescriptionrrJrKr@rErVrrrrr	ssr	)r
)F)distutils.utilrrrdistutils.errorsrrr"
setuptoolsr__all__rrrr	rrrrs

,'PK!>畴		4command/__pycache__/install_egg_info.cpython-310.pycnu[o

Xai@s\ddlmZmZddlZddlmZddlmZddlmZddl	Z	Gdddej
eZdS))logdir_utilN)Command)
namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZddZd	d
Z	ddZ
d
S)install_egg_infoz.Install an .egg-info directory for the package)zinstall-dir=dzdirectory to install tocCs
d|_dSN)install_dirselfr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_egg_info.pyinitialize_optionss
z#install_egg_info.initialize_optionscCsV|dd|d}tdd|j|jd}|j|_tj	
|j||_g|_
dS)Ninstall_lib)r
r
egg_infoz	.egg-info)set_undefined_optionsget_finalized_command
pkg_resourcesDistributionegg_nameZegg_versionrsourceospathjoinr
targetoutputs)rZei_cmdbasenamer
r
rfinalize_optionss

z!install_egg_info.finalize_optionscCs|dtj|jrtj|jstj|j|jdntj	|jr1|
tj|jfd|j|js:t
|j|
|jdd|j|jf|dS)Nr)dry_runz	Removing r
Copying %s to %s)run_commandrrisdirrislinkrremove_treerexistsexecuteunlinkrensure_directorycopytreerZinstall_namespacesrr
r
rrun!s
zinstall_egg_info.runcCs|jSr	)rrr
r
rget_outputs.szinstall_egg_info.get_outputscs fdd}tjj|dS)NcsDdD]}||sd||vrdSqj|td|||S)N)z.svn/zCVS//r )
startswithrappendrdebug)srcdstskiprr
rskimmer3sz*install_egg_info.copytree..skimmer)rrr)rr3r
rrr)1szinstall_egg_info.copytreeN)__name__
__module____qualname____doc__descriptionuser_optionsrrr*r+r)r
r
r
rr
s
r)	distutilsrrr
setuptoolsrrZsetuptools.archive_utilrrZ	Installerrr
r
r
rsPK!LX^^/command/__pycache__/upload_docs.cpython-310.pycnu[o

Xai2@sdZddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZddlmZd	d
ZGdddeZdS)
z|upload_docs

Implements a Distutils 'upload_docs' subcommand (upload documentation to
sites other than PyPi such as devpi).
)standard_b64encode)log)DistutilsOptionErrorN)iter_entry_points)uploadcCs|ddS)Nzutf-8surrogateescape)encode)sr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/upload_docs.py_encodesr
c@seZdZdZdZdddejfddgZejZdd	Zd
efgZ	ddZ
d
dZddZddZ
eddZeddZddZdS)upload_docszhttps://pypi.python.org/pypi/z;Upload documentation to sites other than PyPi such as devpizrepository=rzurl of repository [default: %s])z
show-responseNz&display full response text from server)zupload-dir=Nzdirectory to uploadcCs&|jdurtddD]}dSdSdS)Nzdistutils.commandsbuild_sphinxT)
upload_dirr)selfeprrr
has_sphinx-s

zupload_docs.has_sphinxrcCst|d|_d|_dS)N)rinitialize_optionsr
target_dir)rrrrr4s

zupload_docs.initialize_optionscCst||jdur+|r|d}t|jd|_n|d}tj	
|jd|_n	|d|j|_d|j
vr>td|d|jdS)	NrhtmlbuildZdocsrzpypi.python.orgzrrbasenamer
usernamepasswordrdecoder`r!r#rINFOurllibparseurlparserdclientHTTPConnectionHTTPSConnectionAssertionErrorconnect
putrequest	putheaderstrr)
endheaderssendsocketerrorERRORgetresponsestatusreason	getheader
show_responseprint)rr.frbmetar\credentialsauthbodyctmsgZschemanetlocurlparamsquery	fragmentsconnr_erlocationrrrr?sh



zupload_docs.upload_fileN)__name__
__module____qualname__DEFAULT_REPOSITORYdescriptionruser_optionsboolean_optionsrsub_commandsrrr7rDstaticmethodrQclassmethodr`r?rrrrrs*


r)__doc__base64r	distutilsrdistutils.errorsrrr~r%r:r@rXrThttp.clientrdurllib.parserq
pkg_resourcesrrr
rrrrrs"PK!䷆(command/__pycache__/test.cpython-310.pycnu[o

Xai@sddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZGdd	d	eZGd
ddZGdd
d
eZdS)N)DistutilsErrorDistutilsOptionError)log)
TestLoader)resource_listdirresource_existsnormalize_pathworking_setevaluate_markeradd_activation_listenerrequire
EntryPoint)Command)unique_everseenc@eZdZddZdddZdS)ScanningLoadercCst|t|_dSN)r__init__set_visitedselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs||jvrdS|j|g}|t||t|dr$||t|dr`t|jdD]0}|	drF|dkrF|jd|dd}nt
|j|d	rV|jd|}nq/|||q/t|d
krk|
|S|dS)aReturn a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        Nadditional_tests__path__z.pyz__init__.py.z/__init__.pyr)raddappendrloadTestsFromModulehasattrrr__name__endswithrZloadTestsFromNamelenZ
suiteClass)rmodulepatterntestsfile	submodulerrrr"s$



z"ScanningLoader.loadTestsFromModuler)r$
__module____qualname__rr"rrrrrsrc@r)NonDataPropertycCs
||_dSrfget)rr0rrrrBs
zNonDataProperty.__init__NcCs|dur|S||Srr/)robjZobjtyperrr__get__Es
zNonDataProperty.__get__r)r$r,r-rr2rrrrr.Asr.c@seZdZdZdZgdZddZddZedd	Z	d
dZ
dd
Zej
gfddZeej
ddZeddZddZddZeddZeddZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated)))ztest-module=mz$Run 'test_suite' in specified module)ztest-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=rzTest runner to usecCsd|_d|_d|_d|_dSr)
test_suitetest_moduletest_loadertest_runnerrrrrinitialize_optionsZs
ztest.initialize_optionscCs|jr|jrd}t||jdur"|jdur|jj|_n|jd|_|jdur/t|jdd|_|jdur7d|_|jdurFt|jdd|_dSdS)Nz1You may specify a module or a suite, but not bothz.test_suiter9z&setuptools.command.test:ScanningLoaderr:)r7r8rdistributionr9getattrr:)rmsgrrrfinalize_options`s




ztest.finalize_optionscCst|Sr)list
_test_argsrrrr	test_argssztest.test_argsccs:|jstjdkrdV|jrdV|jr|jVdSdS)N)Zdiscoverz	--verbose)r7sysversion_infoverboserrrrrAwsztest._test_argscCs4||WddS1swYdS)zI
        Backward compatibility for project_on_sys_path context.
        N)project_on_sys_path)rfuncrrrwith_project_on_sys_paths
"ztest.with_project_on_sys_pathc
csL|d|jddd|d|d}tjdd}tj}zkt|j}tj	d|t
tddt
d|j|jf||gdVWdn!1sXwYW|tjdd<tjtj|t
dSW|tjdd<tjtj|t
dS|tjdd<tjtj|t
w)	Negg_info	build_extr)ZinplacercSs|Sr)activate)distrrrsz*test.project_on_sys_path..z%s==%s)run_commandreinitialize_commandget_finalized_commandrFpathmodulescopyrZegg_baseinsertr	rrregg_nameZegg_versionpaths_on_pythonpathclearupdate)rZ
include_distsZei_cmdold_pathZold_modulesZproject_pathrrrrIs:








ztest.project_on_sys_pathc
cst}tjd|}tjdd}z4tjt|}td||g}tj|}|r/|tjd<dVW||ur@tjdddS|tjd<dS||urStjddw|tjd<w)z
        Add the indicated paths to the head of the PYTHONPATH environment
        variable so that subprocesses will also see the packages at
        these paths.

        Do this in a context that restores the value on exit.
        
PYTHONPATHrN)	objectosenvirongetpathsepjoinrfilterpop)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrYs"

ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        css2|]\}}|drt|ddr|VqdS):rN)
startswithr
).0kvrrr	s
z%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_requireitems	itertoolschain)rOZir_dZtr_dZer_drrr
install_distss
ztest.install_distsc	Cs|dtj||j}d|j}|jr|d|dS|d|tt	
d|}||)||
Wdn1sGwYWddSWddS1s_wYdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)zrunning "%s"location)announcerWARNrrr<rc_argvdry_runmapoperator
attrgetterrYrI	run_tests)rZinstalled_distscmdrfrrrruns$

"ztest.runcCsVtjdd|j||j||jdd}|js)d|j}||t	j
t|dS)NF)Z
testLoaderZ
testRunnerexitzTest failed: %s)unittestmainrw_resolve_as_epr9r:resultZ
wasSuccessfulrurERRORr)rr3r>rrrr|s



ztest.run_testscCsdg|jS)Nr)rBrrrrrwrCz
test._argvcCs$|durdStd|}|S)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Nzx=)r
parseresolve)valparsedrrrrs
ztest._resolve_as_epN)r$r,r-__doc__descriptionuser_optionsr;r?r.rBrArK
contextlibcontextmanagerrIstaticmethodrYrrr~r|propertyrwrrrrrr3Ks.



r3)r_rzrFrrprdistutils.errorsrr	distutilsrr
pkg_resourcesrrrr	r
rrr

setuptoolsrZ setuptools.extern.more_itertoolsrrr.r3rrrrs(
(
PK!YΕh/command/__pycache__/install_lib.cpython-310.pycnu[o

Xai#@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@s\eZdZdZddZddZddZedd	Zd
dZ	edd
Z
	dddZddZdS)install_libz9Don't add compiled flags to filenames of non-Python filescCs*||}|dur||dSdSN)buildinstallbyte_compile)selfoutfilesr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/install_lib.pyrun
s
zinstall_lib.runcs4fddD}t|}ttj|S)z
        Return a collections.Sized collections.Container of paths to be
        excluded for single_version_externally_managed installations.
        c3s$|]
}|D]}|Vq	qdSr)
_all_packages).0Zns_pkgpkgr	rr	sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)r	Zall_packagesZ
excl_specsrrrget_exclusionss

zinstall_lib.get_exclusionscCs&|d|g}tjj|jg|RS)zw
        Given a package name and exclusion path within that package,
        compute the full exclusion path.
        .)splitospathjoinZinstall_dir)r	rZexclusion_pathpartsrrrrszinstall_lib._exclude_pkg_pathccs(|r|V|d\}}}|sdSdS)zn
        >>> list(install_lib._all_packages('foo.bar.baz'))
        ['foo.bar.baz', 'foo.bar', 'foo']
        rN)
rpartition)pkg_namesepchildrrrr's
zinstall_lib._all_packagescCs,|jjsgS|d}|j}|r|jjSgS)z
        Get namespace packages (list) but only for
        single_version_externally_managed installations and empty otherwise.
        r)distributionZnamespace_packagesget_finalized_commandZ!single_version_externally_managed)r	Zinstall_cmdZsvemrrrr1s

zinstall_lib._get_SVEM_NSPsccsddVdVdVttdsdStjddtjj}|dV|d	V|d
V|dVdS)zk
        Generate file paths to be excluded for namespace packages (bytecode
        cache files).
        z__init__.pyz__init__.pycz__init__.pyoimplementationN__pycache__z	__init__.z.pycz.pyoz
.opt-1.pycz
.opt-2.pyc)hasattrsysrrrr$	cache_tag)baserrrrAs



z install_lib._gen_exclusion_pathsrc	sh|r|r|rJ|stj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|vrd|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdstexcluder,r
rrpfhs
z!install_lib.copy_tree..pf)rorigr	copy_treeZsetuptools.archive_utilr+	distutilsr,)	r	infileoutfile
preserve_modepreserve_timespreserve_symlinkslevelr+r5rr3rr7Ws
zinstall_lib.copy_treecs.tj|}|rfdd|DS|S)Ncsg|]}|vr|qSrr)rfr4rr
ysz+install_lib.get_outputs..)r6rget_outputsr)r	outputsrr@rrBus
zinstall_lib.get_outputsN)r*r*rr*)
__name__
__module____qualname____doc__r
rrstaticmethodrrrr7rBrrrrrs
	

r)	rr'	itertoolsrrZdistutils.command.install_libcommandrr6rrrrs
PK!ܿ.command/__pycache__/py36compat.cpython-310.pycnu[o

XaiR@s\ddlZddlmZddlmZddlmZGdddZeejdr,GdddZdSdS)	N)glob)convert_path)sdistc@s\eZdZdZddZeddZddZdd	Zd
dZ	dd
Z
ddZddZddZ
dS)sdist_add_defaultsz
    Mix-in providing forward-compatibility for functionality as found in
    distutils on Python 3.7.

    Do not edit the code in this class except to update functionality
    as implemented in distutils. Instead, override in the subclass.
    cCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/py36compat.pyadd_defaultsszsdist_add_defaults.add_defaultscCs:tj|sdStj|}tj|\}}|t|vS)z
        Case-sensitive path existence check

        >>> sdist_add_defaults._cs_path_exists(__file__)
        True
        >>> sdist_add_defaults._cs_path_exists(__file__.upper())
        False
        F)ospathexistsabspathsplitlistdir)fspathr	directoryfilenamerrr_cs_path_exists&s

z"sdist_add_defaults._cs_path_existscCs|j|jjg}|D]?}t|tr5|}d}|D]}||r'd}|j|nq|s4|dd	|q	||rA|j|q	|d|q	dS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
ZREADMESdistributionscript_name
isinstancetuplerfilelistappendwarnjoin)r
Z	standardsfnZaltsZgot_itrrrr7s(


z*sdist_add_defaults._add_defaults_standardscCs4ddg}|D]}ttjjt|}|j|qdS)Nz
test/test*.pyz	setup.cfg)filterrrisfilerrextend)r
optionalpatternfilesrrrrLs
z)sdist_add_defaults._add_defaults_optionalcCs\|d}|jr|j||jD]\}}}}|D]
}|jtj	
||qqdS)Nbuild_py)get_finalized_commandrhas_pure_modulesrr&get_source_files
data_filesr rrr")r
r*pkgsrc_dir	build_dir	filenamesrrrrrRs

z'sdist_add_defaults._add_defaults_pythoncCs~|jr;|jjD]3}t|tr!t|}tj|r |j	
|q	|\}}|D]}t|}tj|r9|j	
|q'q	dSdS)N)rhas_data_filesr.rstrrrrr%rr )r
itemdirnamer2frrrr	bs 

z+sdist_add_defaults._add_defaults_data_filescC,|jr|d}|j|dSdS)N	build_ext)rhas_ext_modulesr+rr&r-)r
r9rrrr
s

z$sdist_add_defaults._add_defaults_extcCr8)N
build_clib)rhas_c_librariesr+rr&r-)r
r<rrrrxr;z'sdist_add_defaults._add_defaults_c_libscCr8)N
build_scripts)rhas_scriptsr+rr&r-)r
r>rrrr}r;z(sdist_add_defaults._add_defaults_scriptsN)__name__
__module____qualname____doc__rstaticmethodrrrrr	r
rrrrrrrs
rrc@seZdZdS)rN)r@rArBrrrrrs)rrdistutils.utilrdistutils.commandrrhasattrrrrrs|PK!b&0command/__pycache__/easy_install.cpython-310.pycnu[o

XaiN@sdZddlmZddlmZddlmZmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZmZddlmZdd	lmZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
l Z dd
l!Z!dd
l"Z"dd
l#Z#dd
l$Z$dd
l%Z%dd
l&Z&ddl'm(Z(m)Z)ddl*m+Z+dd
l*m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6ddl/m7Z7m8Z8ddl9m:Z:ddl;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJdd
l;Z;ejKde;jLdgdZMddZNddZOddZPddZQd d!ZRGd"d#d#e,ZSd$d%ZTd&d'ZUd(d)ZVd*d+ZWd,d-ZXGd.d/d/eBZYGd0d1d1eYZZej[\d2d3d4krBeZZYd5d6Z]d7d8Z^d9d:Z_d;d<Z`did=d>Zad?d@ZbdAdBZcdCejdvrhecZendDdEZedjdGdHZfdIdJZgdKdLZhdMdNZizddOlmjZkWnelydPdQZkYnwdRdSZjGdTdUdUemZnenoZpGdVdWdWenZqGdXdYdYZrGdZd[d[erZsGd\d]d]esZterjuZuerjvZvd^d_Zwd`daZxdbe^fdcddZydedfZzGdgdhdhe+Z{d
S)ka0
Easy Install
------------

A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.

__ https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html

)glob)get_platform)convert_path
subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMESSCHEME_KEYS)logdir_util)
first_line_re)find_executableN)get_config_varsget_path)SetuptoolsDeprecationWarning)Command)	run_setup)setopt)unpack_archive)PackageIndexparse_requirement_arg
URL_SCHEME)	bdist_eggegg_info)Wheel)yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributionsEnvironmentRequirementDistributionPathMetadataEggMetadata
WorkingSetDistributionNotFoundVersionConflictDEVELOP_DISTdefault)category)samefileeasy_installPthDistributionsextract_wininst_cfgget_exe_prefixescCstddkS)NP)structcalcsizer7r7/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/easy_install.pyis_64bitJr9cCsjtj|otj|}ttjdo|}|rtj||Stjtj|}tjtj|}||kS)z
    Determine if two paths reference the same file.

    Augments os.path.samefile to work on Windows and
    suppresses errors if the path doesn't exist.
    r.)ospathexistshasattrr.normpathnormcase)p1p2Z
both_existZuse_samefileZnorm_p1Znorm_p2r7r7r8r.Nsr.cCs
|dS)Nutf8)encodesr7r7r8	_to_bytes^s
rGcCs&z|dWdStyYdSw)NasciiTF)rDUnicodeErrorrEr7r7r8isasciibs
rJcCst|ddS)N
z; )textwrapdedentstripreplace)textr7r7r8
_one_linerjsrQc@szeZdZdZdZdZdddddd	d
ddd
ddddddddddddddejfgZgdZ	ddiZ
eZdd Z
d!d"Zd#d$Zed%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zdd1d2Zd3d4Zd5d6Zd7d8Zed9Zed:Zed;Z dd?Z"d@dAZ#dBdCZ$dDdEZ%dFdGZ&e'j(dHdIZ)ddKdLZ*ddMdNZ+dOdPZ,	ddQdRZ-dSdTZ.dUdVZ/dWdXZ0ddYdZZ1ed[d\Z2dd_d`Z3dadbZ4dcddZ5dedfZ6dgdhZ7didjZ8dkdlZ9edmZ:ednZ;ddpdqZdudvZ?dwdxZ@dydzZAd{d|ZBd}d~ZCddZDddZEedFZGddZHeIeIddddZJeIdddZKddZLdS)r/z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zip-okzzinstall package as a zipfile)
multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))zinstall-dir=dzinstall package to DIR)zscript-dir=rFzinstall scripts to DIR)exclude-scriptsxzDon't install scripts)always-copyaz'Copy all needed packages to install dir)z
index-url=iz base URL of Python Package Index)zfind-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)always-unzipZz*don't install as a zipfile, no matter what)z
site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)no-depsNzdon't install dependencies)zallow-hosts=Hz$pattern(s) that hostnames must match)local-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z
no-find-linksNz9Don't load find-links defined in packages being installeduserNz!install in user site-package '%s')
rRrTrYrVr[rdrfrirkrlrarRcCs2tdtd|_d|_|_d|_|_|_d|_	d|_
d|_d|_d|_
|_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ t!j"rlt!j#|_$t!j%|_&nd|_$d|_&d|_'d|_(d|_)|_*d|_+i|_,d|_-|j.j/|_/|j.0||j.1ddS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr/)2warningswarnEasyInstallDeprecationWarningrlzip_oklocal_snapshots_okinstall_dir
script_direxclude_scripts	index_url
find_linksbuild_directoryargsoptimizerecordrValways_copy
multi_versionrdno_depsallow_hostsrootprefix	no_reportrkinstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datainstall_baseinstall_platbasesiteENABLE_USER_SITE	USER_BASEinstall_userbase	USER_SITEinstall_usersite
no_find_links
package_indexpth_filealways_copy_from	site_dirsinstalled_projects_dry_rundistributionverbose_set_command_optionsget_option_dictselfr7r7r8initialize_optionssN

zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss,|]}tj|stj|r|VqdSN)r;r<r=islink).0filenamer7r7r8	s


z/easy_install.delete_blockers..)listmap_delete_path)rblockersZextant_blockersr7r7r8delete_blockersszeasy_install.delete_blockerscCsJtd||jrdStj|otj|}|rtntj}||dS)NzDeleting %s)	rinfodry_runr;r<isdirrrmtreeunlink)rr<Zis_treeZremoverr7r7r8rszeasy_install._delete_pathcCs4djtj}td}d}t|jditt)zT
        Render the Setuptools version and installation details, then exit.
        {}.{}
setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})Nr7)formatsysversion_infor!printlocals
SystemExit)verdisttmplr7r7r8_render_versions
zeasy_install._render_versionc
Csl|jo|tjd}tdd\}}|j|j|j||dd|d|d||||t	tddd|_
tjrK|j
|j
d	<|j|j
d
<n|jrStd||||dd
dd|jdurp|j|_|jdurxd|_|dd|dd|jr|jr|j|_|j|_|ddtttj}t|_ |j!durdd|j!dD}|D]#}t"j#|std|qt||vrt$|d|j %t|q|j&s|'|j(pd|_(|j dd|_)|jt|jfD]}||j)vr|j)*d|q|j+durdd|j+dD}ndg}|j,dur+|j-|j(|j)|d|_,t.|j)tj|_/|j0durHt1|j0t2rG|j0|_0ng|_0|j3rY|j,4|j)tj|jsd|j,5|j0|dd t1|j6t7szt7|j6|_6d|j6krdkst8t8Wnt8y}	zt$d!|	d}	~	ww|j&r|j9st:d"|j;st:d#g|_-sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|]}|qSr7)rNrr7r7r8rC*)search_pathhosts)ryryz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rkrrsplitrrget_nameget_versionget_fullnamegetattrconfig_varsrrrrrlrrn_fix_install_dir_for_user_siteexpand_basedirsexpand_dirs_expandrsrrrset_undefined_optionsrrrrr<
get_site_dirs
all_site_dirsrr;rrappendrdcheck_site_dirrushadow_pathinsertr~rcreate_indexr#local_indexrv
isinstancestrrqZscan_egg_linksadd_find_linksryint
ValueErrorrwrrxoutputs)
rrrrr?rrX	path_itemrrer7r7r8finalize_optionss








zeasy_install.finalize_optionscCs\|jrtjsdS||jdurd}t||j|_|_tj	
ddd}||dS)z;
        Fix the install_dir if "--user" was used.
        Nz$User base directory is not specifiedposixunix_user)rlrrcreate_home_pathrr	rrr;namerO
select_scheme)rmsgscheme_namer7r7r8rjs
z+easy_install._fix_install_dir_for_user_sitecCsX|D]'}t||}|dur)tjdkstjdkrtj|}t||j}t|||qdS)Nrnt)rr;rr<rrrsetattr)rattrsattrvalr7r7r8
_expand_attrsys
zeasy_install._expand_attrscCs|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)rrrNrrr7r7r8rszeasy_install.expand_basedirscCsgd}||dS)z+Calls `os.path.expanduser` on install dirs.)rrrrrrNr)rdirsr7r7r8rszeasy_install.expand_dirsc	Cs|r	|dtj|j|jjkrt|jzQ|jD]
}|||jq|j	rZ|j
}|jrFt|j}t
t|D]}|||d||<q9ddlm}||j|j	|fd|j	|Wt|jjdSt|jjw)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r)	file_utilz'writing list of installed files to '%s')announcerWARNrr
set_verbosityrxr/r}rzrrlenrange	distutilsrexecute
write_filewarn_deprecated_options)rZshow_deprecationspecrroot_lencounterrr7r7r8runs2


"zeasy_install.runcCsBzt}Wntytdtj}Ynwtj|j	d|S)zReturn a pseudo-tempname base in the install directory.
        This code is intentionally naive; if a malicious party can write to
        the target directory you're already in deep doodoo.
        rztest-easy-install-%s)
r;getpid	Exceptionrandomrandintrmaxsizer<joinrr)rpidr7r7r8pseudo_tempnameszeasy_install.pseudo_tempnamecCdSrr7rr7r7r8rz$easy_install.warn_deprecated_optionsc	CsBt|j}tj|d}tj|s)zt|Wnttfy(|	Ynw||j
v}|s8|js8|}n1|
d}tj|}z|rLt|t|dt|Wnttfyh|	Ynw|s~|js~tjdd}t|j|j||r|jdurt||j
|_nd|_|jrtj|sd|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededeasy-install.pthz.write-testw
PYTHONPATHrN)rrrr;r<rr=makedirsOSErrorIOErrorcant_write_to_targetrr|check_pth_processingrropencloseenvirongetrrn_easy_install__no_default_msgrr0)rinstdirrZis_site_dirZtestfileZtest_exists
pythonpathr7r7r8rs@







zeasy_install.check_site_diraS
        can't create or remove files in install directory

        The following error occurred while trying to add or remove files in the
        installation directory:

            %s

        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s
        z
        This directory does not currently exist.  Please create it and try again, or
        choose a different installation directory (using the -d or --install-dir
        option).
        a
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.

        For information on other options, you may wish to consult the
        documentation at:

          https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html

        Please make the appropriate changes for your system and try again.
        cCsR|jtd|jf}tj|js|d|j7}t	||d|j7}t	|)NrK)
_easy_install__cant_write_msgrexc_inforrr;r<r=_easy_install__not_exists_id_easy_install__access_msgr)rrr7r7r8rsz!easy_install.cant_write_to_targetc
	Cs|j}td||d}|d}tj|}tdd}z|r't|tj	|}tj
|ddt|d}Wntt
fyI|Ynwz||jdit|d	}tj}tjd
krtj|\}}	tj|d}
|	dkotj|
}|r|
}d
dlm}||dddgd
tj|rtd|W|r|tj|rt|tj|rt|dSdSW|r|tj|rt|tj|rt|n|r|tj|rt|tj|rt|ww|jstd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %s.pthz.okzz
            import os
            f = open({ok_file!r}, 'w')
            f.write('OK')
            f.close()
            rKT)exist_okrNrpythonw.exe
python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesFr7)rrrrrr;r<r=rQrdirnamerrrrrwriterrrr
executablerrrlowerdistutils.spawnr-r|rn)
rr"rZok_fileZ	ok_existsrr/r^r1basenameZaltZuse_altr-r7r7r8rs~






z!easy_install.check_pth_processingc	CsV|js$|dr$|dD]}|d|rq
||||d|q
||dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rtmetadata_isdirmetadata_listdirinstall_scriptget_metadatainstall_wrapper_scripts)rrscript_namer7r7r8install_egg_scriptsSsz easy_install.install_egg_scriptscCsVtj|r#t|D]\}}}|D]
}|jtj||qqdS|j|dSr)r;r<rwalkrrr)rr<baserfilesrr7r7r8
add_outputaszeasy_install.add_outputcCs|jr
td|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rdrrrr7r7r8not_editableiszeasy_install.not_editablecCs<|jsdStjtj|j|jrtd|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)rdr;r<r=rrwkeyrrAr7r7r8check_editableqs
zeasy_install.check_editablec	csTtjdd}zt|VWtj|ot|dSdStj|o(t|ww)Nz
easy_install-)r)tempfilemkdtemprr;r<r=r)rtmpdirr7r7r8_tmpdir{s
8zeasy_install._tmpdirFc	CsB|}t|tsIt|r*|||j||}|d|||dWdStj	
|rE|||d|||dWdSt|}|||j
|||j|j|j|j}|durqd|}|jrm|d7}t||jtkr||||d|WdS|||j||WdS1swYdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)rHrr$rrBrdownloadinstall_itemr;r<r=rrDZfetch_distributionrVrdr{rr
precedencer+process_distributionlocation)rrdepsrGdlrrr7r7r8r/s8






$zeasy_install.easy_installcCs|p|j}|ptj||k}|p|d}|p*|jduo*tjt|t|jk}|rA|sA|j|jD]	}|j	|kr>nq5d}t
dtj||ra|
|||}|D]	}||||qVn||g}|||d|d|dur|D]}||vr|SqwdSdS)N.eggTz
Processing %srrI)r{r;r<r/endswithrrrproject_namerNrrr4install_eggsrMegg_distribution)rrrJrGrOZinstall_neededrdistsr7r7r8rKs<


zeasy_install.install_itemcCs<t|}tD]}d|}t||durt||||qdS)z=Sets the install directories by applying the install schemes.install_N)r
rrr)rrschemerCattrnamer7r7r8rszeasy_install.select_schemec
Gs|||j|||j|jvr|j||j|||||j|j<t	|j
||g|R|drH|jsH|j
|d|sO|jsOdS|dura|j|jkratd|dS|dusi||vrs|}tt|}t	d|ztg|g|j|j}Wn%ty}ztt||d}~wty}zt||d}~ww|js|jr|D]}|j|jvr||qt	d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)
update_pthraddrrCremover<rrrinstallation_reporthas_metadatarrget_metadata_linesr{rnas_requirementr$rr(resolver/r)rr*reportr)rrequirementrrOrZdistreqZdistrosrer7r7r8rMsP



z!easy_install.process_distributioncCs2|jdur	|jS|drdS|dsdSdS)Nznot-zip-safeTzzip-safeF)rpr^rrr7r7r8should_unzips


zeasy_install.should_unzipcCstj|j|j}tj|rd}t||j|j||Stj|r&|}n)tj	||kr3t
|t|}t|dkrOtj||d}tj|rO|}t
|t|||S)Nz<%r already exists in %s; build directory %s will not be keptr$r)r;r<rrwrCr=rrnrr/rlistdirrr shutilmove)rr
dist_filename
setup_basedstrcontentsr7r7r8
maybe_moves$

zeasy_install.maybe_movecCs,|jrdSt|D]}|j|qdSr)rtScriptWriterbestget_argswrite_script)rrrxr7r7r8r:s
z$easy_install.install_wrapper_scriptscCsNt|}t||}|r||t}t||}||t|ddS)z/Generate a legacy script wrapper and install itr_N)	rr`is_python_script_load_templaterrn
get_headerrqrG)rrr;script_textdev_pathrZ	is_scriptbodyr7r7r8r8"s
zeasy_install.install_scriptcCs(d}|r
|dd}td|}|dS)z
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        zscript.tmplz.tmplz (dev).tmplrutf-8)rOrdecode)rvrZ	raw_bytesr7r7r8rs,s


zeasy_install._load_templatetr7csfdd|Dtd|jtjj|}|jr&dSt	}t
|tj|r8t|t
|d|
}||Wdn1sOwYt|d|dS)z1Write an executable file to the scripts directorycsg|]
}tjj|qSr7)r;r<rrsrrZrr7r8r>z-easy_install.write_script..zInstalling %s script to %sNri)rrrrsr;r<rr@r
current_umaskr r=rrr0chmod)rr;rlmodertargetmaskr^r7rr8rq;s 

zeasy_install.write_scriptc	CsH|j|j|jd}z||dd}Wn	tyYnw|||gS|}tj|r:|ds:t	|||j
ntj|rFtj|}|
|rY|jrY|durY||||}tj|d}tj|sttj|dd}|s|tdtj|t|dkrtdtj||d	}|jrt|||gS|||S)
N)rQ.exez.whl.pyzsetup.pyrz"Couldn't find a setup script in %sr$zMultiple setup scripts in %sr)install_egginstall_exe
install_wheelr2KeyErrorr;r<isfilerRrunpack_progressrabspath
startswithrwrmrr=rrrrdrrreport_editablebuild_and_install)	rrrirGZ
installer_mapZinstall_distrjsetup_scriptZsetupsr7r7r8rTOsT


zeasy_install.install_eggscCs>tj|rt|tj|d}ntt|}tj	||dS)NEGG-INFO)metadata)
r;r<rr&rr'	zipimportzipimporterr%
from_filename)regg_pathrr7r7r8rUszeasy_install.egg_distributionc	Cstj|jtj|}tj|}|jst|||}t	||stj
|r8tj|s8tj
||jdntj|rI|tj|fd|z_d}tj
|re||r^tjd}}n,tjd}}n%||rv|||jd}}nd}||rtjd}}ntjd}}||||f|dtj|tj|ft||d	Wntyt|dd	w||||S)
Nr	Removing FZMovingZCopyingZ
ExtractingTz	 %s to %sfix_zipimporter_caches)r;r<rrrr4rrr rUr.rrr
remove_treer=rrrrgrhcopytreeremkpathunpack_and_compilecopy2r/update_dist_cachesrr@)rrrGdestinationrZnew_dist_is_zippedr^rUr7r7r8rs`











zeasy_install.install_eggcsNt|}|durtd|td|dd|ddtd}tj||d}||_	|d}tj|d}tj|d	}t
|t|||_|
||tj|st|d
}	|	d|dD]\}
}|
dkr{|	d
|
dd|fqd|	tj|d|fddt|Dtj|||j|jd|||S)Nz(%s is not a valid distutils Windows .exerrrk)rSrkplatformrQz.tmprPKG-INFOrzMetadata-Version: 1.0
target_versionz%s: %s
_-r5csg|]}tj|dqS)r)r;r<r)rrxrsr7r8rsz,easy_install.install_exe..)rr)r1rr%r rr;r<regg_namerNr r&	_provider
exe_to_eggr=rr0itemsrOtitlerrrnrprmake_zipfilerrr)rrirGcfgrregg_tmpZ	_egg_infoZpkg_infr^kvr7rr8rsD


zeasy_install.install_execs8t|ggifdd}t||g}D]7}|drU|d}|d}t|dd|d<tjj	g|R}
||
|t||q|t
tj	dt|dD]-}	t|	rtj	d|	d	}
tj|
st|
d
}|d	t|	d|qldS)
z;Extract a bdist_wininst to the directories an egg would usecs|}D]l\}}||rr||t|d}|d}tjjg|R}|}|ds6|drTt	|d|d<dtj
|dd<||S|drn|dkrndtj
|dd<||Sq|d	s~t
d
|dS)N/.pyd.dllr$rrSCRIPTS/r)zWARNING: can't process %s)r2rrrr;r<rrRrstrip_modulesplitextrrrn)srcrkrFoldnewpartsrPrnative_libsprefixes
to_compile	top_levelr7r8processs(





z(easy_install.exe_to_egg..processrrrrr)rrz.txtrrKN)r2rr2rRrrrr;r<rrZ
write_stubbyte_compileZwrite_safety_flagZanalyze_eggrr=rr0r)rrirrZstubsresrresourceZpyfilertxtr^r7rr8rs>






zeasy_install.exe_to_eggc
Cst|}|s
Jtj|j|}tj|}|js!t	|tj
|r6tj|s6tj
||jdntj|rG|tj|fd|z||j|fdtj|tj|fWt|ddnt|ddw||||S)NrrzInstalling %s to %sFr)r
is_compatibler;r<rrrrrrr rrr
rr=rrZinstall_as_eggr4r/rr@rU)r
wheel_pathrGwheelrr7r7r8r$s4

	

zeasy_install.install_wheela(
        Because this distribution was installed --multi-version, before you can
        import modules from this package in an application, you will need to
        'import pkg_resources' and then use a 'require()' call similar to one of
        these examples, in order to select the desired version:

            pkg_resources.require("%(name)s")  # latest installed version
            pkg_resources.require("%(name)s==%(version)s")  # this exact version
            pkg_resources.require("%(name)s>=%(version)s")  # this version or higher
        z
        Note also that the installation directory must be on sys.path at runtime for
        this to work.  (e.g. by being the application's script directory, by being on
        PYTHONPATH, or by being added to sys.path by your code.)
        	Installedc	Cs^d}|jr|js|d|j7}|jtttjvr|d|j7}|j	}|j
}|j}d}|tS)z9Helpful installation message for display to package usersz
%(what)s %(eggloc)s%(extras)srKr)
r|r_easy_install__mv_warningrrrrrr<_easy_install__id_warningrNrSrkr)	rreqrwhatrZegglocrrkextrasr7r7r8r]Rs
z easy_install.installation_reportaR
        Extracted editable version of %(spec)s to %(dirname)s

        If it uses setuptools in its setup script, you can activate it in
        "development" mode by going to that directory and running::

            %(python)s setup.py develop

        See the setuptools documentation for the "develop" command for more info.
        cCs"tj|}tj}d|jtS)NrK)r;r<r/rr1_easy_install__editable_msgr)rrrr/pythonr7r7r8rkszeasy_install.report_editablec
Cstjdttjdtt|}|jdkr'd|jd}|dd|n|jdkr2|dd|jr;|dd	t	
d
|t|ddd|zt
||WdStyl}ztd|jdf|d}~ww)
Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrr$rrz-qz-nz
Running %s %s zSetup script exited with %s)rmodules
setdefaultrrrrrrrrrrrrrrx)rrrjrxrr7r7r8rps.

zeasy_install.run_setupc		Csddg}tjdtj|d}zJ|tj|||||||t|g}g}|D]}||D]}||	|j
|q4q.|sM|jsMt
d||Wt|t|jSt|t|jw)Nrz
--dist-dirz
egg-dist-tmp-)rdirz+No eggs found in %s (setup script problem?))rErFr;r<r/_set_fetcher_optionsrrr#rrNrrrnrrr)	rrrjrxdist_dirZall_eggseggsrCrr7r7r8rs.


zeasy_install.build_and_installc	Csh|jd}d}i}|D]\}}||vrq|d||<qt|d}tj|d}t	||dS)a
        When easy_install is about to run bdist_egg on a source dist, that
        source dist might have 'setup_requires' directives, requiring
        additional fetching. Ensure the fetcher options given to easy_install
        are available to that command as well.
        r/)rvrruryr~r$)r/z	setup.cfgN)
rrcopyrdictr;r<rrZedit_config)	rr>Zei_optsZfetch_directivesZ
fetch_optionsrCrsettingsZcfg_filenamer7r7r8rs	
z!easy_install._set_fetcher_optionscCsJ|jdurdS|j|jD]%}|js|j|jkrq
td||j||j|jvr2|j|jq
|js]|j|jjvrDtd|ntd||j	||j|jvr]|j
|j|jrbdS|j|jdkrndSt
j|jd}t
j|rt
|t|d}||j|jdWddS1swYdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filersetuptools.pthwtrK)rrCr|rNrrr\rpathsr[rrsaver;r<rrrrrrr0
make_relative)rrrXrr^r7r7r8rZs>



"zeasy_install.update_pthcCstd|||S)NzUnpacking %s to %s)rdebug)rrrkr7r7r8rszeasy_install.unpack_progresscshggfdd}t|||js0D]}t|tjdBd@}t||qdSdS)NcsZ|dr|ds|n|ds|dr|||jr+|p,dS)Nr	EGG-INFO/rz.so)rRrrrr)rrkrZto_chmodrr7r8pfs
z+easy_install.unpack_and_compile..pfimi)rrrr;statST_MODEr~)rrrrr^rr7rr8rs
zeasy_install.unpack_and_compilec	CstjrdSddlm}z0t|jd||dd|jd|jr3|||jd|jdWt|jdSWt|jdSt|jw)Nr)rr$)ryforcer)	rdont_write_bytecodedistutils.utilrrrrrry)rrrr7r7r8rszeasy_install.byte_compilea
        bad install directory or PYTHONPATH

        You are attempting to install a package to a directory that is not
        on PYTHONPATH and which Python does not read ".pth" files from.  The
        installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s

        and your PYTHONPATH environment variable currently contains:

            %r

        Here are some of your options for correcting the problem:

        * You can choose a different installation directory, i.e., one that is
          on PYTHONPATH or supports .pth files

        * You can add the installation directory to the PYTHONPATH environment
          variable.  (It must then also be on PYTHONPATH whenever you run
          Python and want to use the package(s) you are installing.)

        * You can set up the installation directory to support ".pth" files by
          using one of the approaches described here:

          https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html#custom-installation-locations


        Please make the appropriate changes for your system and try again.
        cCsb|jsdSttjd}|jD]\}}||r.tj|s.|	d|t
|dqdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)rlrr;r<rrrrrdebug_printr)rhomerr<r7r7r8r)szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz	$base/binrrz$base/Lib/site-packagesz
$base/ScriptscGs|dj}|jr2|}|j|d<|jtj|j}|	D]\}}t
||ddur1t|||qddlm
}|D]!}t
||}|dur[|||}tjdkrUtj|}t|||q:dS)Nrr>r)rr)get_finalized_commandrrrr
r r;rDEFAULT_SCHEMErrrrrr<r)rrrrXrrrr7r7r8r?s&



zeasy_install._expand)T)Fr)rzr7)r)M__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsrruser_optionsboolean_optionsnegative_optrrrrrstaticmethodrrrrrrr
rrrrLrMlstripr%r'r(rrr<r@rBrD
contextlibcontextmanagerrHr/rKrrMrermr:r8rsrqrTrUrrrrrrr]rrrrrrZrrrrNr!rrr
rrr7r7r7r8r/ns5	

	
-	;



!$
)	



3	6.5	

	) 
r/cCs tjddtj}td|S)Nrr)r;rr rpathsepfilter)rr7r7r8_pythonpathVs
rc	sgttjg}tjtjkr|tj|D]h}|sqtjdvr0tj	|ddn+tj
dkrNtj	|ddjtjdtj	|ddgn
|tj	|ddgtjdkraqd	|vrfqtj
d
}|soqtj	|ddd
jtjd}|qtdtdf}fdd|DtjrtjtttWdn1swYtttS)z&
    Return a list of 'site' dirs
    )Zos2emxZriscosLibz
site-packagesrlibzpython{}.{}zsite-pythondarwinzPython.frameworkHOMELibraryPythonrpurelibplatlibc3s|]	}|vr|VqdSrr7rsitedirsr7r8rsz get_site_dirs..N)extendrrrrrrr;r<rseprrrr rrrrrsuppressAttributeErrorgetsitepackagesrrr)rrrZhome_spZ	lib_pathsr7rr8r[s`





rccsi}|D]l}t|}||vrqd||<tj|sqt|}||fV|D]I}|ds/q'|dvr4q'ttj||}tt	|}|
|D]&}|drQqIt|}||vr\qId||<tj|sgqI|t|fVqIq'qdS)zBYield sys.path directories that might contain "old-style" packagesr$r))rrimportN)
rr;r<rrfrRrrrrrrrstrip)inputsseenr/r?rr^linesliner7r7r8expand_pathss@



rcCsTt|d}zt|}|durW|dS|d|d|d}|dkr-W|dS||dtd|d\}}}|dvrKW|dS||d|d	d	d
}t	|}z||}	|	
ddd
}
|
t
}
|t|
WntjyYW|dSw|dr|dsW|dS|W|S|w)znExtract configuration data from a bdist_wininst .exe

    Returns a configparser.RawConfigParser, or None
    rbN	zegg path translations for a given .exe file))zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)rzEGG-INFO/scripts/)zDATA/lib/site-packagesrrrrrr$z	.egg-inforNrr)z
-nspkg.pth)ZPURELIBZPLATLIB\r
z%s/%s/rcSsg|]
\}}||fqSr7)r2)rrZyr7r7r8rr|z$get_exe_prefixes..)rZipFileinfolistrrrrRrrupperrryrrNrOrrrsortreverse)Zexe_filenamerrSrrrrlpthr7r7r8r2s4



r2c@sReZdZdZdZdddZddZdd	Zed
dZ	dd
Z
ddZddZdS)r0z)A .pth file with Distribution paths in itFr7cCsl||_ttt||_ttj|j|_|	t
|gddt|j
D]
}tt|jt|dq&dS)NT)rrrrrr;r<r/basedir_loadr#__init__rrr[r")rrrr<r7r7r8r7"szPthDistributions.__init__cCsg|_d}t|j}tj|jret|jd}|D]F}|	dr$d}q|
}|j||r9|	dr:qt
tj|j|}|jd<tj|rS||vr\|jd|_qd||<q||jrm|smd|_|jr|jds|j|jr|jdrwdSdSdSdS)NFrtr
T#rr$)rrfromkeysrr;r<rrrrrrrNrrr5r=popdirtyr)rZ
saw_importrr^rr<r7r7r8r6+s6




$zPthDistributions._loadcCs|jsdStt|j|j}|rLtd|j||}d	|d}t
j|jr0t

|jt|jd
}||Wdn1sFwYnt
j|jr`td|jt

|jd|_dS)z$Write changed .pth file back to diskNz	Saving %srKrzDeleting empty %sF)r<rrrrrrr_wrap_linesrr;r<rrrr0r=)rZ	rel_pathsrdatar^r7r7r8rJs"

zPthDistributions.savecC|Srr7)rr7r7r8r=`szPthDistributions._wrap_linescCsN|j|jvo|j|jvp|jtk}|r|j|jd|_t||dS)z"Add `dist` to the distribution mapTN)	rNrrr;getcwdrr<r#r[)rrnew_pathr7r7r8r[dszPthDistributions.addcCs<|j|jvr|j|jd|_|j|jvst||dS)z'Remove `dist` from the distribution mapTN)rNrr\r<r#rdr7r7r8r\rs
zPthDistributions.removecCstjt|\}}t|j}|g}tjdkrdptj}t||krI||jkr6|tj	|
||Stj|\}}||t||ks"|S)Nr)r;r<rrrr5altsepr	rcurdirr3r)rr<npathlastZbaselenrr	r7r7r8rys



zPthDistributions.make_relativeN)r7)
rrrrr<r7r6rrr=r[r\rr7r7r7r8r0s
	
r0c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs&|jV|D]}|Vq|jVdSr)preludepostlude)clsrrr7r7r8r=s
z#RewritePthDistributions._wrap_linesz?
        import sys
        sys.__plen = len(sys.path)
        z
        import sys
        new = sys.path[sys.__plen:]
        del sys.path[sys.__plen:]
        p = getattr(sys, '__egginsert', 0)
        sys.path[p:p] = new
        sys.__egginsert = p + len(new)
        N)rrrclassmethodr=rQrGrHr7r7r7r8rFs

rFZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtSttjS)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )rrpatternrrecompileryr7r7r7r8_first_line_resrOcCsX|tjtjfvrtjdkrt|tj||St\}}}|d|dd||ff)Nrrr$z %s %s)	r;rr\rr~rS_IWRITErr&)funcargexcetZevrr7r7r8
auto_chmods
rUcCs0t|}t|tj|rt|dSt|dS)aa

    Fix any globally cached `dist_path` related data

    `dist_path` should be a path of a newly installed egg distribution (zipped
    or unzipped).

    sys.path_importer_cache contains finder objects that have been cached when
    importing data from the original distribution. Any such finders need to be
    cleared since the replacement distribution might be packaged differently,
    e.g. a zipped egg distribution might get replaced with an unzipped egg
    folder or vice versa. Having the old finders cached may then cause Python
    to attempt loading modules from the replacement distribution using an
    incorrect loader.

    zipimport.zipimporter objects are Python loaders charged with importing
    data packaged inside zip archives. If stale loaders referencing the
    original distribution, are left behind, they can fail to load modules from
    the replacement distribution. E.g. if an old zipimport.zipimporter instance
    is used to load data from a new zipped egg archive, it may cause the
    operation to attempt to locate the requested data in the wrong location -
    one indicated by the original distribution's zip archive directory
    information. Such an operation may then fail outright, e.g. report having
    read a 'bad local file header', or even worse, it may fail silently &
    return invalid data.

    zipimport._zip_directory_cache contains cached zip archive directory
    information for all existing zipimport.zipimporter instances and all such
    instances connected to the same archive share the same cached directory
    information.

    If asked, and the underlying Python implementation allows it, we can fix
    all existing zipimport.zipimporter instances instead of having to track
    them down and remove them one by one, by updating their shared cached zip
    archive directory information. This, of course, assumes that the
    replacement distribution is packaged as a zipped egg.

    If not asked to fix existing zipimport.zipimporter instances, we still do
    our best to clear any remaining zipimport.zipimporter related cached data
    that might somehow later get used when attempting to load data from the new
    distribution and thus cause such load operations to fail. Note that when
    tracking down such remaining stale data, we can not catch every conceivable
    usage from here, and we clear only those that we know of and have found to
    cause problems if left alive. Any remaining caches should be updated by
    whomever is in charge of maintaining them, i.e. they should be ready to
    handle us replacing their zip archives with new distributions at runtime.

    N)r_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)	dist_pathrnormalized_pathr7r7r8rs
<rcCsPg}t|}|D]}t|}||r%|||dtjdfvr%||q|S)ap
    Return zipimporter cache entry keys related to a given normalized path.

    Alternative path spellings (e.g. those using different character case or
    those using alternative path separators) related to the same path are
    included. Any sub-path entries are included as well, i.e. those
    corresponding to zip archives embedded in other zip archives.

    r$r)rrrr;r	r)r[cacheresult
prefix_lenpnpr7r7r8"_collect_zipimporter_cache_entries
s


racCs@t||D]}||}||=|o|||}|dur|||<qdS)a
    Update zipimporter cache data for a given normalized path.

    Any sub-path entries are processed as well, i.e. those corresponding to zip
    archives embedded in other zip archives.

    Given updater is a callable taking a cache entry key and the original entry
    (after already removing the entry from the cache), and expected to update
    the entry and possibly return a new one to be inserted in its place.
    Returning None indicates that the entry should not be replaced with a new
    one. If no updater is given, the cache entries are simply removed without
    any additional processing, the same as if the updater simply returned None.

    N)ra)r[r\updaterr_	old_entryZ	new_entryr7r7r8_update_zipimporter_caches
rdcCst||dSr)rd)r[r\r7r7r8rV>r:rVcCdd}t|tj|ddS)NcSs|dSr)clearr<rcr7r7r82clear_and_remove_cached_zip_archive_directory_dataCszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_datarbrdr_zip_directory_cache)r[rhr7r7r8rYBs

rYZ__pypy__cCre)NcSs&|t||tj||Sr)rfrrupdaterkrgr7r7r8)replace_cached_zip_archive_directory_dataYs
zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarirj)r[rmr7r7r8rXXs


rXc	Cs,z	t||dWdSttfyYdSw)z%Is this string a valid Python script?execFT)rNSyntaxError	TypeError)rPrr7r7r8	is_pythonksrrc	Cshz&tj|dd
}|d}Wdn
1swYW|dkSW|dkSttfy3|YSw)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)encodingrN#!)r$rrrr)r1fpmagicr7r7r8is_shusrwcCst|gS)z@Quote a command line argument according to Windows parsing rules
subprocesslist2cmdline)rRr7r7r8nt_quote_argsr{cCsH|ds
|drdSt||rdS|dr"d|dvSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    r.pywTrtrrF)rRrrr
splitlinesr2)rurr7r7r8rrs

rr)r~cGrrr7)rxr7r7r8_chmodrr~c
CsTtd||zt||WdStjy)}z
td|WYd}~dSd}~ww)Nzchanging mode of %s to %ozchmod failed: %s)rrr~r;error)r<rrer7r7r8r~sr~c@seZdZdZgZeZeddZeddZ	eddZ
edd	Zed
dZdd
Z
eddZddZeddZeddZdS)CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    cCr?)zV
        Choose the best CommandSpec class based on environmental conditions.
        r7rIr7r7r8roszCommandSpec.bestcCstjtj}tjd|S)N__PYVENV_LAUNCHER__)r;r<r?rr1rr )rI_defaultr7r7r8_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr||S|dur|S||S)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        N)rrfrom_environmentfrom_string)rIparamr7r7r8
from_params


zCommandSpec.from_paramcCs||gSr)rrr7r7r8rszCommandSpec.from_environmentcCstj|fi|j}||S)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )shlexr
split_args)rIstringrr7r7r8rszCommandSpec.from_stringcCs<t|||_t|}t|sdg|jdd<dSdS)Nz-xr)rr_extract_optionsoptionsryrzrJ)rrucmdliner7r7r8install_optionss

zCommandSpec.install_optionscCs:|dd}t|}|r|dpdnd}|S)zH
        Extract any options from the first line of the script.
        rKrr$r)r}rOmatchgrouprN)Zorig_scriptfirstrrr7r7r8rszCommandSpec._extract_optionscCs||t|jSr)_renderrrrr7r7r8	as_headerszCommandSpec.as_headercCs6d}|D]}||r||r|ddSq|S)Nz"'r$r)rrR)itemZ_QUOTESqr7r7r8
_strip_quotesszCommandSpec._strip_quotescCs tdd|D}d|dS)Ncss|]
}t|VqdSr)rrrN)rrr7r7r8rs
z&CommandSpec._render..rtrKrx)rrr7r7r8rs
zCommandSpec._renderN)rrrrrrrrJrorrrrrrrrrrr7r7r7r8rs,





	
rc@seZdZeddZdS)WindowsCommandSpecFrN)rrrrrr7r7r7r8rsrc@seZdZdZedZeZ	e
dddZe
dddZe
dd	d
Z
eddZe
d
dZe
ddZe
ddZe
dddZdS)rnz`
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    aJ
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        import re
        import sys

        # for compatibility with easy_install; see #2198
        __requires__ = %(spec)r

        try:
            from importlib.metadata import distribution
        except ImportError:
            try:
                from importlib_metadata import distribution
            except ImportError:
                from pkg_resources import load_entry_point


        def importlib_load_entry_point(spec, group, name):
            dist_name, _, _ = spec.partition('==')
            matches = (
                entry_point
                for entry_point in distribution(dist_name).entry_points
                if entry_point.group == group and entry_point.name == name
            )
            return next(matches).load()


        globals().setdefault('load_entry_point', importlib_load_entry_point)


        if __name__ == '__main__':
            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
            sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)())
        NFcCs6tdt|r
tnt}|d||}|||S)NzUse get_argsr)rmrnroWindowsScriptWriterrnroget_script_headerrp)rIrr1wininstwriterheaderr7r7r8get_script_args(szScriptWriter.get_script_argscCs$tjdtdd|rd}|||S)NzUse get_headerr)
stacklevelr,)rmrnrort)rIrur1rr7r7r8r0szScriptWriter.get_script_headerccs|dur	|}t|}dD]-}|d}||D]\}}|||jt}|||||}	|	D]}
|
Vq7qqdS)z
        Yield write_script() argument tuples for a distribution's
        console_scripts and gui_scripts entry points.
        NconsoleguiZ_scripts)	rtrr`
get_entry_mapr_ensure_safe_nametemplater_get_script_args)rIrrrtype_rreprurxrr7r7r8rp9s
zScriptWriter.get_argscCstd|}|rtddS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)rMsearchr)rZhas_path_sepr7r7r8rKszScriptWriter._ensure_safe_namecCs tdt|rtS|SNzUse best)rmrnrorro)rIZ
force_windowsr7r7r8
get_writerTszScriptWriter.get_writercCs*tjdkstjdkrtjdkrtS|S)zD
        Select the best ScriptWriter for this environment.
        win32javar)rrr;r_namerrorr7r7r8roZszScriptWriter.bestccs|||fVdSrr7)rIrrrrur7r7r8rdszScriptWriter._get_script_argsrcCs"|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrorrr)rIrur1cmdr7r7r8rtis
zScriptWriter.get_header)NFr)rN)rrrrrLrMrrrrrJrrrprrrrorrtr7r7r7r8rns,!#


	
rnc@sLeZdZeZeddZeddZeddZeddZ	e
d	d
ZdS)rcCstdt|Sr)rmrnrororr7r7r8rtszWindowsScriptWriter.get_writercCs"tt|d}tjdd}||S)zC
        Select the best ScriptWriter suitable for Windows
        )r1ZnaturalZSETUPTOOLS_LAUNCHERr1)rWindowsExecutableLauncherWriterr;rr )rIZ
writer_lookuplauncherr7r7r8rozszWindowsScriptWriter.bestc	#stddd|}|tjddvr$djdit}t|t	gd}|
||||}fdd	|D}|||d
|fVdS)
z For Windows, add a .py extension.pyar|rPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)rr
-script.py.pyc.pyor|rcg|]}|qSr7r7r{rr7r8rrz8WindowsScriptWriter._get_script_args..rzNr7)rr;rr2rrrrmrnUserWarningr\_adjust_header)	rIrrrruextrrrr7rr8rs
z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr
||}}tt|tj}|j||d}||r%|S|S)z
        Make sure 'pythonw' is used for gui and 'python' is used for
        console (regardless of what sys.executable is).
        r+r,r)rrepl)rMrNescape
IGNORECASEsub_use_header)rIrZorig_headerrLrZ
pattern_ob
new_headerr7r7r8rs
z"WindowsScriptWriter._adjust_headercCs$|ddd}tjdkpt|S)z
        Should _adjust_header use the replaced header?

        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        rr"r)rNrrr)rZclean_headerr7r7r8rs	zWindowsScriptWriter._use_headerN)rrrrrrJrrorrrrr7r7r7r8rqs




rc@seZdZeddZdS)rc#s|dkr
d}d}dg}nd}d}gd}|||}fdd|D}	|||d	|	fVd
t|dfVtsJd}
|
td	fVd
Sd
S)zG
        For Windows, add a .py extension and an .exe launcher
        rz-script.pywr|clir)rrrcrr7r7r{rr7r8rrzDWindowsExecutableLauncherWriter._get_script_args..rzrr_z
.exe.manifestN)rget_win_launcherr9load_launcher_manifest)rIrrrruZ
launcher_typerrhdrrZm_namer7rr8rs$z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrJrr7r7r7r8rsrcCsJd|}trtdkr|dd}n
|dd}n|dd}td|S)z
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    z%s.exez	win-arm64.z-arm64.z-64.z-32.r)r9rrOr)typeZlauncher_fnr7r7r8rs

rcCsttd}|dtS)Nzlauncher manifest.xmlrx)
pkg_resourcesrrryvars)rmanifestr7r7r8rsrFcCst|||Sr)rgr)r<
ignore_errorsonerrorr7r7r8rr:rcCstd}t||S)N)r;umask)tmpr7r7r8r}s

r}c@seZdZdZdS)rozF
    Warning for EasyInstall deprecations, bypassing suppression.
    N)rrrrr7r7r7r8rosror)rn)|rrrrrrdistutils.errorsrrrr	distutils.command.installr
rrrr
Zdistutils.command.build_scriptsrr3rrr;rrgrErrMrr
rLrmrr5rryrr$r 	sysconfigrrrrrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrrrrr r!r"r#r$r%r&r'r(r)r*r+filterwarnings
PEP440Warning__all__r9r.rGrJrQr/rrrr1r2r0rFrr rOrUrrardrVrYbuiltin_module_namesrXrrrwr{rrr~r~ImportErrorrrrZsys_executablerrnrrrrrrrr}ror7r7r7r8sDqF.)%l	R
 


TtA PK!HszInfoCommon._maybe_tagcCs,d}|jr
||j7}|jr|td7}|S)Nrz-%Y%m%d)	tag_buildtag_datetimestrftimerCr4r4r5tagss
zInfoCommon.tags)__name__
__module____qualname__rErFpropertyr=r@r>rIrAr4r4r4r5r7vs

r7c@seZdZdZgdZdgZddiZddZeddZ	e	j
d	dZ	d
dZdd
ZdddZ
ddZddZddZddZddZdS)egg_infoz+create a distribution's .egg-info directory))z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree))tag-datedz0Add date stamp (e.g. 20050528) to version number)z
tag-build=bz-Specify explicit tag to add to version number)no-dateDz"Don't include date stamp [default]rPrScCs"d|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerNegg_versionbroken_egg_infor;r4r4r5initialize_optionss

zegg_info.initialize_optionscCdSr8r4r;r4r4r5tag_svn_revisionzegg_info.tag_svn_revisioncCrZr8r4)r<valuer4r4r5r[r\cCs0t}||d<d|d<t|t|ddS)z
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        rErrF)rNN)collectionsOrderedDictrIr	dict)r<filenamerNr4r4r5save_version_infoszegg_info.save_version_infoc
CsL|j|_||_t|j}zt|tjj}|rdnd}t	t
||j|jfWntyB}z
tj
d|j|jf|d}~ww|jdurV|jj}|pOidtj|_|dt|jd|_|jtjkrstj|j|j|_d|jvr|||j|jj_|jj}|dur|j|jkr|j|_t|j|_ d|j_dSdSdS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrU	.egg-info-)!r=rVr@rWr

isinstancerrDVersionlistr
ValueError	distutilserrorsDistutilsOptionErrorrUr9package_dirgetr!curdirensure_dirnamerrNr"joincheck_broken_egg_infometadataZ
_patched_distkeylower_version_parsed_version)r<parsed_versionZ
is_versionspecrOdirspdr4r4r5finalize_optionssH






zegg_info.finalize_optionsFcCsR|r||||dStj|r'|dur |s td||dS||dSdS)aWrite `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        Nz$%s not set in setup(), but %s exists)
write_filer!r"existsrwarndelete_file)r<whatradataforcer4r4r5write_or_delete_files	zegg_info.write_or_delete_filecCsBtd|||d}|jst|d}|||dSdS)zWrite `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        zwriting %s to %sutf-8wbN)rinfoencodedry_runopenwriteclose)r<rrarfr4r4r5r|
s


zegg_info.write_filecCs$td||jst|dSdS)z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)rrrr!unlink)r<rar4r4r5rszegg_info.delete_filecCs||jt|jd|jj}tdD]}|j|d|}|||j	tj
|j|j	qtj
|jd}tj
|rC|
||dS)Nzegg_info.writers)	installerznative_libs.txt)mkpathrNr!utimer9Zfetch_build_eggrrequireresolver=r"rpr}rfind_sources)r<repwriternlr4r4r5runs
zegg_info.runcCs4tj|jd}t|j}||_||j|_dS)z"Generate SOURCES.txt manifest filezSOURCES.txtN)	r!r"rprNmanifest_makerr9manifestrfilelist)r<Zmanifest_filenamemmr4r4r5r-s

zegg_info.find_sourcescCsX|jd}|jtjkrtj|j|}tj|r*td||j	|j	|_
||_	dSdS)NrcaB------------------------------------------------------------------------------
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
------------------------------------------------------------------------------)rVrUr!rnr"rpr}rr~rNrX)r<Zbeir4r4r5rq5s

zegg_info.check_broken_egg_infoNF)rJrKrLdescriptionuser_optionsboolean_optionsnegative_optrYrMr[setterrbr{rr|rrrrqr4r4r4r5rNs&



1
rNc@s|eZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZdS)rc
	Cs||\}}}}|j|j|j|jt|j|t|j||j	|j
d}dddddddd	d}z||}WntyDtd
j
|dw|d}	|d
vrQ|g}|	rV|fnd}
||}|d|g|	rg|gng||D]}||stj||g|
RqpdS)N)includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')actionz
recursive->rrr4 )Z_parse_template_linerrglobal_includeglobal_exclude	functoolspartialrecursive_includerecursive_excluderrKeyErrorrformat
startswithdebug_printrprr~)
r<linerpatternsdirZdir_patternZ
action_mapZlog_mapZprocess_actionZaction_is_recursiveZextra_log_argsZlog_tmplpatternr4r4r5process_template_lineHsf

zFileList.process_template_linecCsRd}tt|jdddD]}||j|r&|d|j||j|=d}q
|S)z
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Frz
 removing T)ranger'filesr)r<	predicatefoundr0r4r4r5
_remove_filesszFileList._remove_filescC$ddt|D}||t|S)z#Include files that match 'pattern'.cSg|]
}tj|s|qSr4r!r"isdir.0rr4r4r5
sz$FileList.include..rextendboolr<rrr4r4r5rs
zFileList.includecCst|}||jS)z#Exclude files that match 'pattern'.)r6rmatchr<rrr4r4r5rszFileList.excludecCs8tj|d|}ddt|ddD}||t|S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        rcSrr4rrr4r4r5rs

z.FileList.recursive_include..T)	recursive)r!r"rprrr)r<rrZfull_patternrr4r4r5rs
zFileList.recursive_includecCs ttj|d|}||jS)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        rr6r!r"rprr)r<rrrr4r4r5rszFileList.recursive_excludecCr)zInclude all files from 'dir/'.cSs"g|]
}tj|D]}|q
qSr4)rirfindall)rZ	match_diritemr4r4r5rs
z"FileList.graft..r)r<rrr4r4r5rs

zFileList.graftcCsttj|d}||jS)zFilter out files from 'dir/'.rr)r<rrr4r4r5rszFileList.prunecsJ|jdur	|ttjd|fdd|jD}||t|S)z
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nrcsg|]	}|r|qSr4rrrr4r5rsz+FileList.global_include..)allfilesrr6r!r"rprrrr4rr5rs

zFileList.global_includecCsttjd|}||jS)zD
        Exclude all files anywhere that match the pattern.
        rrrr4r4r5rszFileList.global_excludecCs<|dr|dd}t|}||r|j|dSdS)N
r)rBr
_safe_pathrappend)r<rr"r4r4r5rs

zFileList.appendcCs|jt|j|dSr8)rrfilterr)r<pathsr4r4r5rszFileList.extendcCstt|j|j|_dS)z
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N)rgrrrr;r4r4r5_repairszFileList._repairc	Csd}t|}|durtd|dSt|d}|dur't||ddSztj|s4tj|r7WdSWdStyLt||t	
YdSw)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFrT)
unicode_utilsfilesys_decoderr~Z
try_encoder!r"r}UnicodeEncodeErrorsysgetfilesystemencoding)r<r"Zenc_warnZu_pathZ	utf8_pathr4r4r5rs 
zFileList._safe_pathN)rJrKrLrrrrrrrrrrrrrrr4r4r4r5rEsM



rc@sdeZdZdZddZddZddZdd	Zd
dZdd
Z	e
ddZddZddZ
ddZdS)rzMANIFEST.incCsd|_d|_d|_d|_dS)Nr)Zuse_defaultsrZ
manifest_onlyZforce_manifestr;r4r4r5rYs
z!manifest_maker.initialize_optionscCrZr8r4r;r4r4r5r{szmanifest_maker.finalize_optionscCslt|_tj|js||tj|jr|	|
||j|j
|dSr8)rrr!r"r}rwrite_manifestadd_defaultstemplateZ
read_templateadd_license_filesprune_file_listsortZremove_duplicatesr;r4r4r5rs

zmanifest_maker.runcCst|}|tjdS)N/)rrreplacer!r#)r<r"r4r4r5_manifest_normalize&s
z"manifest_maker._manifest_normalizecsBjfddjjD}dj}tj|f|dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        csg|]}|qSr4)rrr;r4r5r2sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrexecuter|)r<rmsgr4r;r5r*s

zmanifest_maker.write_manifestcCs||s
t||dSdSr8)_should_suppress_warningrr~)r<rr4r4r5r~6s
zmanifest_maker.warncCstd|S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r$r)rr4r4r5r:sz'manifest_maker._should_suppress_warningcCst||j|j|j|jtt}|r!|j|nt	j
|jr,|t	j
dr8|jd|
d}|j|jdS)Nzsetup.pyrN)rrrrrrrgrrr!r"r}Z
read_manifestget_finalized_commandrrN)r<ZrcfilesZei_cmdr4r4r5rAs


zmanifest_maker.add_defaultscCs4|jjjpg}|D]}td|q	|j|dS)Nzadding license file '%s')r9rr
license_filesrrrr)r<rlfr4r4r5rSs
z manifest_maker.add_license_filescCsZ|d}|j}|j|j|j|ttj	}|jj
d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex)rr9get_fullnamerr
build_baser$r%r!r#Zexclude_pattern)r<rbase_dirr#r4r4r5rZs


zmanifest_maker.prune_file_listN)rJrKrLrrYr{rrrr~staticmethodrrrrr4r4r4r5r
s

rcCsNd|}|d}t|d}||WddS1s wYdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    
rrN)rprrr)racontentsrr4r4r5r|ds


"r|c	Cstd||jsE|jj}|j|j|_}|j|j|_}z|	|j
W|||_|_n|||_|_wt|jdd}t
|j
|dSdS)Nz
writing %sZzip_safe)rrrr9rrrWrDrVr=write_pkg_inforNgetattrr
Zwrite_safety_flag)cmdbasenamerarrZoldverZoldnamesafer4r4r5rqs rcCstj|r
tddSdS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r!r"r}rr~rrrar4r4r5warn_depends_obsoletes
rcCs,t|pd}dd}t||}||dS)Nr4cSs|dS)Nrr4)rr4r4r5	append_crsz&_write_requirements..append_cr)rmap
writelines)streamreqslinesrr4r4r5_write_requirementss
rcCsn|j}t}t||j|jpi}t|D]}|djdit	t|||q|
d||dS)Nz
[{extra}]
requirementsr4)r9ioStringIOrZinstall_requiresextras_requiresortedrrvarsrgetvalue)rrradistrrextrar4r4r5write_requirementss
rcCs,t}t||jj|d||dS)Nzsetup-requirements)rrrr9Zsetup_requiresrr)rrrarr4r4r5write_setup_requirementssr	cCs:tdd|jD}|d|dt|ddS)NcSsg|]
}|dddqS).rr)r )rkr4r4r5rsz(write_toplevel_names..ztop-level namesr)r`fromkeysr9Ziter_distribution_namesr|rpr)rrrapkgsr4r4r5write_toplevel_namess rcCst|||ddS)NT)	write_argrr4r4r5
overwrite_argsrFcCsHtj|d}t|j|d}|durd|d}|||||dS)Nrr)r!r"splitextrr9rpr)rrrarargnamer]r4r4r5rs
rcCs|jj}t|ts
|dur|}n6|durFg}t|D]$\}}t|ts7t||}dtt	t|
}|d||fqd|}|d||ddS)Nrz	[%s]
%s

rzentry pointsT)
r9Zentry_pointsrestrritemsrparse_grouprprvaluesrr)rrrarrsectionrr4r4r5
write_entriess

rcCstdttjdr?td&}|D]}t	d|}|r.t
|dWdSqWddS1s:wYdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr)warningsr~EggInfoDeprecationWarningr!r"r}rrr$rintgroup)rrrr4r4r5get_pkg_info_revisions 
rc@seZdZdZdS)rz?Deprecated behavior warning for EggInfo, bypassing suppression.N)rJrKrL__doc__r4r4r4r5rsrr);rdistutils.filelistrZ	_FileListdistutils.errorsrdistutils.utilrrirrr!r$rrrrGr^
setuptoolsrZsetuptools.command.sdistrrZsetuptools.command.setoptr	Zsetuptools.commandr

pkg_resourcesrrr
rrrrrZsetuptools.unicode_utilsrZsetuptools.globrZsetuptools.externrrr6r7rNrr|rrrrr	rrrrrrr4r4r4r5sX(S1IW
	

PK!UU??/_vendor/__pycache__/ordered_set.cpython-310.pycnu[o

Xai;@szdZddlZddlmZz
ddlmZmZWney'ddlmZmZYnwe	dZ
dZddZGdd	d	eeZ
dS)
z
An OrderedSet is a custom MutableSet that remembers its order, so that every
entry has an index that can be looked up.

Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger,
and released under the MIT license.
N)deque)
MutableSetSequencez3.1cCs"t|dot|tot|tS)a

    Are we being asked to look up a list of things, instead of a single thing?
    We check for the `__iter__` attribute so that this can cover types that
    don't have to be known by this module, such as NumPy arrays.

    Strings, however, should be considered as atomic values to look up, not
    iterables. The same goes for tuples, since they are immutable and therefore
    valid entries.

    We don't need to check for the Python 2 `unicode` type, because it doesn't
    have an `__iter__` attribute anyway.
    __iter__)hasattr
isinstancestrtuple)objr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/ordered_set.pyis_iterables



r
c@seZdZdZd;ddZddZddZd	d
ZddZd
dZ	ddZ
ddZeZddZ
ddZeZeZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)<
OrderedSetz
    An OrderedSet is a custom MutableSet that remembers its order, so that
    every entry has an index that can be looked up.

    Example:
        >>> OrderedSet([1, 1, 2, 3, 2])
        OrderedSet([1, 2, 3])
    NcCs$g|_i|_|dur||O}dSdSN)itemsmap)selfiterablerrr__init__4s
zOrderedSet.__init__cC
t|jS)z
        Returns the number of unique elements in the ordered set

        Example:
            >>> len(OrderedSet([]))
            0
            >>> len(OrderedSet([1, 2]))
            2
        )lenrrrrr__len__:

zOrderedSet.__len__csvt|tr
|tkr
St|rfdd|DSt|ds$t|tr5j|}t|tr3|S|St	d|)aQ
        Get the item at a given index.

        If `index` is a slice, you will get back that slice of items, as a
        new OrderedSet.

        If `index` is a list or a similar iterable, you'll get a list of
        items corresponding to those indices. This is similar to NumPy's
        "fancy indexing". The result is not an OrderedSet because you may ask
        for duplicate indices, and the number of elements returned should be
        the number of elements asked for.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset[1]
            2
        csg|]}j|qSr)r).0irrr
[z*OrderedSet.__getitem__..	__index__z+Don't know how to index an OrderedSet by %r)
rslice	SLICE_ALLcopyr
rrlist	__class__	TypeError)rindexresultrrr__getitem__Fs


zOrderedSet.__getitem__cCs
||S)z
        Return a shallow copy of this object.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> other = this.copy()
            >>> this == other
            True
            >>> this is other
            False
        )r#rrrrr!es
zOrderedSet.copycCst|dkrdSt|S)Nrr)rr"rrrr__getstate__sszOrderedSet.__getstate__cCs$|dkr|gdS||dS)Nr)r)rstaterrr__setstate__szOrderedSet.__setstate__cCs
||jvS)z
        Test if the item is in this ordered set

        Example:
            >>> 1 in OrderedSet([1, 3, 2])
            True
            >>> 5 in OrderedSet([1, 3, 2])
            False
        )rrkeyrrr__contains__rzOrderedSet.__contains__cCs0||jvrt|j|j|<|j||j|S)aE
        Add `key` as an item to this OrderedSet, then return its index.

        If `key` is already in the OrderedSet, return the index it already
        had.

        Example:
            >>> oset = OrderedSet()
            >>> oset.append(3)
            0
            >>> print(oset)
            OrderedSet([3])
        )rrrappendr+rrradds

zOrderedSet.addcCs>d}z
|D]}||}qW|Stytdt|w)a<
        Update the set with the given iterable sequence, then return the index
        of the last element inserted.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.update([3, 1, 5, 1, 4])
            4
            >>> print(oset)
            OrderedSet([1, 2, 3, 5, 4])
        Nz(Argument needs to be an iterable, got %s)r/r$
ValueErrortype)rsequenceZ
item_indexitemrrrupdates
zOrderedSet.updatecs$t|r
fdd|DSj|S)aH
        Get the index of a given entry, raising an IndexError if it's not
        present.

        `key` can be an iterable of entries that is not a string, in which case
        this returns a list of indices.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.index(2)
            1
        csg|]}|qSr)r%)rsubkeyrrrrrz$OrderedSet.index..)r
rr+rrrr%s

zOrderedSet.indexcCs,|jstd|jd}|jd=|j|=|S)z
        Remove and return the last element from the set.

        Raises KeyError if the set is empty.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.pop()
            3
        zSet is empty)rKeyErrorr)relemrrrpops
zOrderedSet.popcCsT||vr&|j|}|j|=|j|=|jD]\}}||kr%|d|j|<qdSdS)a
        Remove an element.  Do not raise an exception if absent.

        The MutableSet mixin uses this to implement the .remove() method, which
        *does* raise an error when asked to remove a non-existent item.

        Example:
            >>> oset = OrderedSet([1, 2, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
            >>> oset.discard(2)
            >>> print(oset)
            OrderedSet([1, 3])
        N)rr)rr,rkvrrrdiscards
zOrderedSet.discardcCs|jdd=|jdS)z8
        Remove all items from this OrderedSet.
        N)rrclearrrrrr>szOrderedSet.clearcCr)zb
        Example:
            >>> list(iter(OrderedSet([1, 2, 3])))
            [1, 2, 3]
        )iterrrrrrr
zOrderedSet.__iter__cCr)zf
        Example:
            >>> list(reversed(OrderedSet([1, 2, 3])))
            [3, 2, 1]
        )reversedrrrrr__reversed__r@zOrderedSet.__reversed__cCs&|s	d|jjfSd|jjt|fS)Nz%s()z%s(%r))r#__name__r"rrrr__repr__szOrderedSet.__repr__cCsLt|ttfrt|t|kSzt|}Wn
tyYdSwt||kS)a
        Returns true if the containers have the same items. If `other` is a
        Sequence, then order is checked, otherwise it is ignored.

        Example:
            >>> oset = OrderedSet([1, 3, 2])
            >>> oset == [1, 3, 2]
            True
            >>> oset == [1, 2, 3]
            False
            >>> oset == [2, 3]
            False
            >>> oset == OrderedSet([3, 2, 1])
            False
        F)rrrr"setr$)rotherZother_as_setrrr__eq__szOrderedSet.__eq__cGs<t|tr|jnt}ttt|g|}tj|}||S)a
        Combines all unique items.
        Each items order is defined by its first appearance.

        Example:
            >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
            >>> print(oset)
            OrderedSet([3, 1, 4, 5, 2, 0])
            >>> oset.union([8, 9])
            OrderedSet([3, 1, 4, 5, 2, 0, 8, 9])
            >>> oset | {10}
            OrderedSet([3, 1, 4, 5, 2, 0, 10])
        )rrr#rr"itchain
from_iterable)rsetsclsZ
containersrrrrunion6szOrderedSet.unioncCs
||Sr)intersectionrrFrrr__and__Is
zOrderedSet.__and__csNt|tr|jnt}|r!tjtt|fdd|D}||S|}||S)a
        Returns elements in common between all sets. Order is defined only
        by the first set.

        Example:
            >>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3])
            >>> print(oset)
            OrderedSet([1, 2, 3])
            >>> oset.intersection([2, 4, 5], [1, 2, 3, 4])
            OrderedSet([2])
            >>> oset.intersection()
            OrderedSet([1, 2, 3])
        c3s|]	}|vr|VqdSrrrr3commonrr	^z*OrderedSet.intersection..)rrr#rErNrrrKrLrrrRrrNMszOrderedSet.intersectioncs@|j}|rtjtt|fdd|D}||S|}||S)a
        Returns all elements that are in this set but not the others.

        Example:
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
            OrderedSet([1])
            >>> OrderedSet([1, 2, 3]) - OrderedSet([2])
            OrderedSet([1, 3])
            >>> OrderedSet([1, 2, 3]).difference()
            OrderedSet([1, 2, 3])
        c3s|]	}|vr|VqdSrrrQrFrrrTtrUz(OrderedSet.difference..)r#rErMrrVrrWr
differencecszOrderedSet.differencecs*t|tkr
dStfdd|DS)a7
        Report whether another set contains this set.

        Example:
            >>> OrderedSet([1, 2, 3]).issubset({1, 2})
            False
            >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4})
            True
            >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5})
            False
        Fc3|]}|vVqdSrrrQrWrrrTz&OrderedSet.issubset..rallrOrrWrissubsetyzOrderedSet.issubsetcs*tt|kr
dStfdd|DS)a=
        Report whether this set contains another set.

        Example:
            >>> OrderedSet([1, 2]).issuperset([1, 2, 3])
            False
            >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3})
            True
            >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3})
            False
        Fc3rYrrrQrrrrTrZz(OrderedSet.issuperset..r[rOrrr
issupersetr^zOrderedSet.issupersetcCs:t|tr|jnt}|||}|||}||S)a
        Return the symmetric difference of two OrderedSets as a new set.
        That is, the new set will contain all elements that are in exactly
        one of the sets.

        Their order will be preserved, with elements from `self` preceding
        elements from `other`.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference(other)
            OrderedSet([4, 5, 9, 2])
        )rrr#rXrM)rrFrLZdiff1Zdiff2rrrsymmetric_differences
zOrderedSet.symmetric_differencecCs||_ddt|D|_dS)zt
        Replace the 'items' list of this OrderedSet with a new one, updating
        self.map accordingly.
        cSsi|]\}}||qSrr)ridxr3rrr
rz,OrderedSet._update_items..N)r	enumerater)rrrrr
_update_itemsszOrderedSet._update_itemscs:t|D]}t|Oq|fdd|jDdS)a
        Update this OrderedSet to remove items from one or more other sets.

        Example:
            >>> this = OrderedSet([1, 2, 3])
            >>> this.difference_update(OrderedSet([2, 4]))
            >>> print(this)
            OrderedSet([1, 3])

            >>> this = OrderedSet([1, 2, 3, 4, 5])
            >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6]))
            >>> print(this)
            OrderedSet([3, 5])
        cg|]}|vr|qSrrrQitems_to_removerrrz0OrderedSet.difference_update..NrErdr)rrKrFrrfrdifference_updateszOrderedSet.difference_updatecs&t|fdd|jDdS)a^
        Update this OrderedSet to keep only items in another set, preserving
        their order in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.intersection_update(other)
            >>> print(this)
            OrderedSet([1, 3, 7])
        csg|]}|vr|qSrrrQrWrrrrhz2OrderedSet.intersection_update..NrirOrrWrintersection_updateszOrderedSet.intersection_updatecs<fdd|D}t|fddjD|dS)a
        Update this OrderedSet to remove items from another set, then
        add items from the other set that were not present in this set.

        Example:
            >>> this = OrderedSet([1, 4, 3, 5, 7])
            >>> other = OrderedSet([9, 7, 1, 3, 2])
            >>> this.symmetric_difference_update(other)
            >>> print(this)
            OrderedSet([4, 5, 9, 2])
        crerrrQrrrrrhz:OrderedSet.symmetric_difference_update..crerrrQrfrrrrhNri)rrFZitems_to_addr)rgrrsymmetric_difference_updates
z&OrderedSet.symmetric_difference_updater)#rC
__module____qualname____doc__rrr'r!r(r*r-r/r.r4r%Zget_locZget_indexerr9r=r>rrBrDrGrMrPrNrXr]r_r`rdrjrkrlrrrrr*sB
	r)ro	itertoolsrHcollectionsrcollections.abcrrImportErrorrr __version__r
rrrrrsPK!-_vendor/__pycache__/pyparsing.cpython-310.pycnu[o

Xaix@s
dZdZdZdZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZzddlmZWneySddlmZYnwzdd	lmZdd
lmZWneywdd	l
mZdd
l
mZYnwzddl
mZWneyzddlmZWneydZYnwYnwgdZee	jdd
Zedd
kZ e re	j!Z"e#Z$e%Z&e#Z'e(e)e*e+e,ee-e.e/e0e1gZ2n)e	j3Z"e4Z5ddZ'gZ2ddl6Z6d7D]Z8z
e29e:e6e8Wqe;yYqweGddde?Z@ejAejBZCdZDeDdZEeCeDZFe%dZGdHddejIDZJGdddeKZLGdd d eLZMGd!d"d"eLZNGd#d$d$eNZOGd%d&d&eKZPGd'd(d(e?ZQGd)d*d*e?ZReSeRd+d,ZTd-d.ZUd/d0ZVd1d2ZWd3d4ZXd5d6ZYd7d8ZZ	dd:d;Z[Gdd?d?e\Z]Gd@dAdAe]Z^GdBdCdCe]Z_GdDdEdEe]Z`e`Zae`e\_bGdFdGdGe]ZcGdHdIdIe`ZdGdJdKdKecZeGdLdMdMe]ZfGdNdOdOe]ZgGdPdQdQe]ZhGdRdSdSe]ZiGdTdUdUe]ZjGdVdWdWe]ZkGdXdYdYe]ZlGdZd[d[elZmGd\d]d]elZnGd^d_d_elZoGd`dadaelZpGdbdcdcelZqGdddedeelZrGdfdgdgelZsGdhdidie\ZtGdjdkdketZuGdldmdmetZvGdndodoetZwGdpdqdqetZxGdrdsdse\ZyGdtdudueyZzGdvdwdweyZ{GdxdydyeyZ|Gdzd{d{e|Z}Gd|d}d}e|Z~Gd~dde?ZeZGdddeyZGdddeyZGdddeyZGdddeZGdddeyZGdddeZGdddeZGdddeZGdddeZGddde?ZddZdddZdddZddZddZddZddZdddZddZdddZddZddZe^dZendZeodZepdZeqdZegeGdd9dddZehdddZehdddZeeBeBejdddBZeeedeZe`deddee}eeBddZddĄZddƄZddȄZddʄZdd̄ZeddZ	eddZ	ddЄZdd҄ZddԄZddքZe?e_ddd؄Ze@Ze?e_e?e_edكedڃfdd܄ZeZ	eehd݃ddߡZeehdddZeehd݃dehddBdZeeadedZdddefddZdddZedZedZeegeCeFdd\ZZeed7dZehddHeàġddZddZeehdddZ	ehddZ	ehdɡdZehddZ	eehddeBdZ	eZ	ehddZ	ee}egeJddeegde`deoϡdZeeeeBdddZ	GdddZeӐd	krhedd
ZeddZegeCeFdZee֐d
ddeZeee׃dZؐdeBZee֐d
ddeZeeeڃdZeԐdeِdeeېdZeܠݐdejޠݐdejߠݐdejݐdddlZej᠝eejejݐddSdS(a	
pyparsing module - Classes and methods to define and execute parsing grammars
=============================================================================

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments


Getting Started -
-----------------
Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:
 - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes
 - construct character word-group expressions using the L{Word} class
 - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes
 - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones
 - associate names with your parsed results using L{ParserElement.setResultsName}
 - find some helpful expression short-cuts like L{delimitedList} and L{oneOf}
 - find more useful common expressions in the L{pyparsing_common} namespace class
z2.2.1z18 Sep 2018 00:49 UTCz*Paul McGuire N)ref)datetime)RLock)Iterable)MutableMapping)OrderedDict)iAndCaselessKeywordCaselessLiteral
CharsNotInCombineDictEachEmpty
FollowedByForward
GoToColumnGroupKeywordLineEnd	LineStartLiteral
MatchFirstNoMatchNotAny	OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalExceptionParseResultsParseSyntaxException
ParserElementQuotedStringRecursiveGrammarExceptionRegexSkipTo	StringEndStringStartSuppressTokenTokenConverterWhiteWordWordEnd	WordStart
ZeroOrMore	alphanumsalphas
alphas8bitanyCloseTag
anyOpenTag
cStyleCommentcolcommaSeparatedListcommonHTMLEntitycountedArraycppStyleCommentdblQuotedStringdblSlashComment
delimitedListdictOfdowncaseTokensemptyhexnumshtmlCommentjavaStyleCommentlinelineEnd	lineStartlinenomakeHTMLTagsmakeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral
nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence
printablespunc8bitpythonStyleCommentquotedStringremoveQuotesreplaceHTMLEntityreplaceWith
restOfLinesglQuotedStringsrange	stringEndstringStarttraceParseAction
unicodeStringupcaseTokens
withAttribute
indentedBlockoriginalTextForungroup
infixNotationlocatedExpr	withClass
CloseMatchtokenMappyparsing_commoncCs`t|tr|Szt|WSty/t|td}td}|dd|	|YSw)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexinttry/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/pyparsing.py$z_ustr..)

isinstanceunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr)setParseActiontransformString)objretZ
xmlcharrefryryrz_ustrs

rz6sum len sorted reversed list tuple set any all min maxccs|]}|VqdSNry).0yryryrz	srcCs:d}dddD}t||D]
\}}|||}q|S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]	}d|dVqdS)&;Nry)rsryryrzrz_xml_escape..zamp gt lt quot apos)splitzipreplace)datafrom_symbols
to_symbolsfrom_to_ryryrz_xml_escapes
rc@seZdZdS)
_ConstantsN)__name__
__module____qualname__ryryryrzrsr
0123456789ZABCDEFabcdef\ccs|]
}|tjvr|VqdSr)string
whitespacercryryrzrc@sPeZdZdZdddZeddZdd	Zd
dZdd
Z	dddZ
ddZdS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dur||_d|_n||_||_||_|||f|_dSNr)locmsgpstr
parserElementargs)selfrrrelemryryrz__init__szParseBaseException.__init__cCs||j|j|j|jS)z
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)clsperyryrz_from_exceptionsz"ParseBaseException._from_exceptioncCsJ|dkrt|j|jS|dvrt|j|jS|dkr!t|j|jSt|)zsupported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        rL)r;columnrI)rLrrr;rIAttributeError)ranameryryrz__getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrLrrryryrz__str__szParseBaseException.__str__cCt|Srrrryryrz__repr__zParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been foundNrryryryrzr%sr%c@ eZdZdZddZddZdS)r(zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs
||_dSrparseElementTracerparseElementListryryrzr4
z"RecursiveGrammarException.__init__cCs
d|jS)NzRecursiveGrammarException: %srrryryrzr7rz!RecursiveGrammarException.__str__N)rrrrrrryryryrzr(2sr(c@s,eZdZddZddZddZddZd	S)
_ParseResultsWithOffsetcCs||f|_dSrtup)rp1p2ryryrzr;z _ParseResultsWithOffset.__init__cC
|j|Srrriryryrz__getitem__=rz#_ParseResultsWithOffset.__getitem__cCst|jdSNr)reprrrryryrzr?rz _ParseResultsWithOffset.__repr__cCs|jd|f|_dSrrrryryrz	setOffsetArz!_ParseResultsWithOffset.setOffsetN)rrrrrrrryryryrzr:s
rc@seZdZdZd[ddZddddefddZdd	Zefd
dZdd
Z	ddZ
ddZddZeZ
ddZddZddZddZddZerPeZ	eZ	eZneZ	eZ	eZ	ddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName})

    Example::
        integer = Word(nums)
        date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))
        # equivalent form:
        # date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

        # parseString returns a ParseResults object
        result = date_str.parseString("1999/12/31")

        def test(s, fn=repr):
            print("%s -> %s" % (s, fn(eval(s))))
        test("list(result)")
        test("result[0]")
        test("result['month']")
        test("result.day")
        test("'month' in result")
        test("'minutes' in result")
        test("result.dump()", str)
    prints::
        list(result) -> ['1999', '/', '12', '/', '31']
        result[0] -> '1999'
        result['month'] -> '12'
        result.day -> '31'
        'month' in result -> True
        'minutes' in result -> False
        result.dump() -> ['1999', '/', '12', '/', '31']
        - day: 31
        - month: 12
        - year: 1999
    NTcCs"t||r|St|}d|_|SNT)r}object__new___ParseResults__doinit)rtoklistnameasListmodalretobjryryrzrks


zParseResults.__new__c
Csb|jr;d|_d|_d|_i|_||_||_|durg}||tr(|dd|_n||tr3t||_n|g|_t	|_
|dur|r|sHd|j|<||trQt|}||_||t
dttfre|ddgfvs||trm|g}|r||tr~t|d||<ntt|dd||<|||_dSz	|d||<WdStttfy|||<YdSwdSdSdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrvrr
basestringr$rcopyKeyError	TypeError
IndexError)rrrrrr}ryryrzrtsH



"

zParseResults.__init__cCsLt|ttfr|j|S||jvr|j|ddStdd|j|DS)NrtrcSsg|]}|dqSrryrvryryrz
z,ParseResults.__getitem__..)r}rvslicerrrr$rryryrzrs


zParseResults.__getitem__cCs||tr|j|t|g|j|<|d}n"||ttfr'||j|<|}n|j|tt|dg|j|<|}||trFt||_	dSdSr)
rrgetrrvrrr$wkrefr)rkrr}subryryrz__setitem__s


"
zParseResults.__setitem__c
Cst|ttfrXt|j}|j|=t|tr$|dkr||7}t||d}tt||}||j	
D]\}}|D]}t|D]\}\}}	t||	|	|k||<qBq.rrryrrz_itervalueszParseResults._itervaluescr)Nc3s|]	}||fVqdSrryrrryrzrrz*ParseResults._iteritems..r!rryrrz
_iteritemsr#zParseResults._iteritemscCt|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rrrryryrzkeyszParseResults.keyscCr%)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r
itervaluesrryryrzvaluesr'zParseResults.valuescCr%)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r	iteritemsrryryrzrr'zParseResults.itemscCr)zSince keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names.)boolrrryryrzhaskeyss
zParseResults.haskeyscOs|sdg}|D]\}}|dkr|d|f}q	td|t|dts1t|dks1|d|vr>|d}||}||=|S|d}|S)a
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # Use pop() in a parse action to remove named result (note that corresponding value is not
            # removed from list form of results)
            def remove_LABEL(tokens):
                tokens.pop("LABEL")
                return tokens
            patt.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        rtdefaultrz-pop() got an unexpected keyword argument '%s'r)rrr}rvr)rrkwargsrrindexrdefaultvalueryryrzpops"zParseResults.popcCs||vr||S|S)ai
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        ry)rkeydefaultValueryryrzr3szParseResults.getcCsR|j|||jD]\}}t|D]\}\}}t||||k||<qqdS)a
        Inserts new element at location index in the list of parsed tokens.
        
        Similar to C{list.insert()}.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']

            # use a parse action to insert the parse location in the front of the parsed results
            def insert_locn(locn, tokens):
                tokens.insert(0, locn)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        N)rinsertrrrr)rr/insStrrrrr
rryryrzr4IszParseResults.insertcCs|j|dS)a
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            
            # use a parse action to compute the sum of the parsed integers, and add it to the end
            def append_sum(tokens):
                tokens.append(sum(map(int, tokens)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        N)rappend)ritemryryrzr6]zParseResults.appendcCs&t|tr||7}dS|j|dS)a
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # use a parse action to append the reverse of the matched strings, to make a palindrome
            def make_palindrome(tokens):
                tokens.extend(reversed([t[::-1] for t in tokens]))
                return ''.join(tokens)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        N)r}r$rextend)ritemseqryryrzr9ks

zParseResults.extendcCs|jdd=|jdS)z7
        Clear all elements and results names.
        N)rrclearrryryrzr;}szParseResults.clearcCs z||WStyYdSwr)rrrr$rrryryrzrs

zParseResults.__getattr__cCs|}||7}|Srr)rotherrryryrz__add__szParseResults.__add__cs|jr5t|jfdd|j}fdd|D}|D]\}}|||<t|dtr4t||d_q|j|j7_|j	|j|S)Ncs|dkrS|Srry)a)offsetryrzr{rz'ParseResults.__iadd__..c	s4g|]\}}|D]}|t|d|dfqqSrr)rrrvlistr)	addoffsetryrzrs
 z)ParseResults.__iadd__..r)
rrrrr}r$rrrupdate)rr>
otheritemsotherdictitemsrrry)rErArz__iadd__s


zParseResults.__iadd__cCs"t|tr
|dkr
|S||Sr)r}rvrrr>ryryrz__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrrrryryrzrzParseResults.__repr__cCsdddd|jDdS)N[, css*|]}t|tr
t|nt|VqdSr)r}r$rrrrryryrzrs(z'ParseResults.__str__..])rrrryryrzrszParseResults.__str__rcCsLg}|jD]}|r|r||t|tr||7}q|t|q|Sr)rr6r}r$
_asStringListr)rsepoutr7ryryrzrQs


zParseResults._asStringListcCsdd|jDS)a
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # ->  ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # ->  ['sldkj', 'lsdkj', 'sldkj']
        cSs"g|]
}t|tr
|n|qSry)r}r$r)rresryryrzrs"z'ParseResults.asList..rrryryrzrszParseResults.asListcs6tr|j}n|j}fddtfdd|DS)a
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # ->  (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # ->  {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        cs0t|tr|r
|Sfdd|DS|S)Ncsg|]}|qSryryrtoItemryrzrrz7ParseResults.asDict..toItem..)r}r$r,asDict)rrUryrzrVs

z#ParseResults.asDict..toItemc3s |]\}}||fVqdSrryrrrrUryrzrz&ParseResults.asDict..)PY_3rr*r)ritem_fnryrUrzrWs
	zParseResults.asDictcCs8t|j}|j|_|j|_|j|j|j|_|S)zA
        Returns a new copy of a C{ParseResults} object.
        )r$rrrrrrFrrrryryrzrs
zParseResults.copyFcCsFd}g}tdd|jD}|d}|sd}d}d}d}	|dur%|}	n|jr+|j}	|	s3|r1dSd}	|||d|	d	g7}t|jD]S\}
}t|trp|
|vr`||||
|oY|du||g7}qA||d|oi|du||g7}qAd}|
|vrz||
}|s|rqAd}t	t
|}
|||d|d	|
d
|d	g	7}qA|||d
|	d	g7}d|S)z
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        
css*|]\}}|D]	}|d|fVqqdSrNryrCryryrzrs
z%ParseResults.asXML..  rNITEM<>.z
%s%s- %s: r_rcs|]}t|tVqdSr)r}r$)rvvryryrzrz
%s%s[%d]:
%s%s%sr)
r6rrr,sortedrr}r$dumpranyrr)rrgdepthfullrSNLrrrrruryryrzrxgs.


4,
zParseResults.dumpcOs tj|g|Ri|dS)a
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        N)pprintrrrr.ryryrzr}s zParseResults.pprintcCs.|j|j|jdur|pd|j|jffSr)rrrrrrrryryrz__getstate__szParseResults.__getstate__cCsP|d|_|d\|_}}|_i|_|j||dur#t||_dSd|_dSr)rrrrrFrr)rstaterrinAccumNamesryryrz__setstate__s

zParseResults.__setstate__cCs|j|j|j|jfSr)rrrrrryryrz__getnewargs__rzParseResults.__getnewargs__cCstt|t|Sr)rrrr&rryryrzrrLzParseResults.__dir__)NNTTrr)NFrT)rrT)4rrrrrr}rrrrrrr__nonzero__rrrr"r$rZr&r)rrr(r*r,r1rr4r6r9r;rr?rIrKrrrQrrWrrdrprsrxr}rrrrryryryrzr$Dst
&	'	

4
#
=
%-
r$cCsF|}d|krt|krnn
||ddkrdS||dd|S)aReturns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   rrr])rrfind)rstrgrryryrzr;s
Br;cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   r]rr)count)rrryryrzrLs
rLcCsB|dd|}|d|}|dkr||d|S||ddS)zfReturns the line of text containing loc within a string, counting newlines as line separators.
       r]rrN)rfind)rrlastCRnextCRryryrzrIs
rIcCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrLr;)instringrexprryryrz_defaultStartDebugActions8rcCs$tdt|dt|dS)NzMatched z -> )rrrr)rstartlocendlocrtoksryryrz_defaultSuccessDebugActions$rcCstdt|dS)NzException raised:)rr)rrrexcryryrz_defaultExceptionDebugActionrrcGdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nry)rryryrzrSsrSrscstvr
fddSdgdgtdddkr#ddd}dd	d
ntj}tjd}|ddd
}|d|d|ffdd}d}ztdtdj}Wn
tybt}Ynw||_|S)Ncs|Srryrlrx)funcryrzr{z_trim_arity..rFrs)rqcSs8tdkrdnd}tj||dd|}|ddgS)N)rqrrrlimitrs)system_version	traceback
extract_stack)rrA
frame_summaryryryrzrsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)Nrrtrs)r
extract_tb)tbrframesrryryrzrsz_trim_arity..extract_tbrrtrc	s	z|dd}dd<|WStyJdrztd}|dddddks4W~n~wdkrIdd7<Yqw)NrrTrtrsr)rrexc_info)rrrr
foundArityrrmaxargspa_call_line_synthryrzwrapper-s&z_trim_arity..wrapperzr	__class__r)	singleArgBuiltinsrrrrgetattrr	Exceptionr)rrr	LINE_DIFF	this_liner	func_nameryrrz_trim_aritys.

rcseZdZdZdZdZeddZeddZddd	Z	d
dZ
dd
ZdddZdddZ
ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+urpGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r&z)Abstract base level parser element class.z 
	
FcC
|t_dS)a
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space,  and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        N)r&DEFAULT_WHITE_CHARScharsryryrzsetDefaultWhitespaceCharsTs

z'ParserElement.setDefaultWhitespaceCharscCr)a
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        N)r&_literalStringClass)rryryrzinlineLiteralsUsingcs
z!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_	d|_
d|_d|_t|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)rparseAction
failActionstrReprresultsName
saveAsListskipWhitespacer&r
whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabsignoreExprsdebugstreamlined
mayIndexErrorerrmsgmodalResultsdebugActionsrecallPreparse
callDuringTry)rsavelistryryrzrxs(
zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jrtj|_|S)a$
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        N)rrrrr&rr)rcpyryryrzrs
zParserElement.copycCs*||_d|j|_t|dr|j|j_|S)af
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        	Expected 	exception)rrrrrr<ryryrzsetNames


zParserElement.setNamecCs4|}|dr|dd}d}||_||_|S)aP
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        *NrtT)rendswithrr)rrlistAllMatchesnewselfryryrzsetResultsNames
zParserElement.setResultsNameTcsB|r|jdfdd	}|_||_|St|jdr|jj|_|S)zMethod to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        Tcsddl}|||||Sr)pdb	set_trace)rr	doActionscallPreParser_parseMethodryrzbreakersz'ParserElement.setBreak..breaker_originalParseMethodNTT)_parserr)r	breakFlagrryrrzsetBreaks
zParserElement.setBreakcOs&tttt||_|dd|_|S)a
        Define one or more actions to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}} for more information
        on parsing strings containing C{}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        rF)rmaprrrrrfnsr.ryryrzrs"zParserElement.setParseActioncOs4|jtttt|7_|jp|dd|_|S)z
        Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}.
        
        See examples in L{I{copy}}.
        rF)rrrrrrrryryrzaddParseActionszParserElement.addParseActioncs^|dd|ddrtnt|D]fdd}|j|q|jp+|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        messagezfailed user-defined conditionfatalFcs$tt|||s||dSr)r+rrexc_typefnrryrzpa&sz&ParserElement.addCondition..par)rr#r!rr6r)rrr.rryrrzaddConditionszParserElement.addConditioncCs
||_|S)aDefine action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately.)r)rrryryrz
setFailAction-s
zParserElement.setFailActionc	CsJd}|r#d}|jD]}z	|||\}}d}q
ty Yq	w|s|SNTF)rrr!)rrr
exprsFoundedummyryryrz_skipIgnorables:s
	zParserElement._skipIgnorablescCsZ|jr	|||}|jr+|j}t|}||kr+|||vr+|d7}||kr+|||vs|SNr)rrrrr)rrrwtinstrlenryryrzpreParseGszParserElement.preParsecCs|gfSrryrrrrryryrz	parseImplSrzParserElement.parseImplcCs|Srryrrr	tokenlistryryrz	postParseVzParserElement.postParsec
Cs|j}|s|jrm|jdr|jd||||r"|jr"|||}n|}|}zz||||\}}WntyCt|t||j	|wWnft
yl}	z|jdr\|jd||||	|jrg|||||	d}	~	ww|ry|jry|||}n|}|}|js|t|krz||||\}}Wntyt|t||j	|w||||\}}||||}t
||j|j|jd}
|jr3|s|jr3|rz$|jD]}||||
}|durt
||j|jot|t
tf|jd}
qWnCt
y
}	z|jdr|jd||||	d}	~	ww|jD]!}||||
}|dur1t
||j|jo,t|t
tf|jd}
q|rG|jdrG|jd|||||
||
fS)Nrrs)rrr)rrrrrrrr!rrrrrr$rrrrrr}r)rrrrr	debuggingpreloctokensStarttokenserr	retTokensrryryrz
_parseNoCacheZs







zParserElement._parseNoCachecCs6z|j||dddWStyt|||j|w)NF)rr)rr#r!rrrrryryrztryParses
zParserElement.tryParsec	Cs,z	|||WdSttfyYdSw)NFT)r
r!rr	ryryrzcanParseNextszParserElement.canParseNextc@eZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Nc|Srrrr2cachenot_in_cacheryrzrz3ParserElement._UnboundedCache.__init__..getcs||<dSrryrr2r
rryrzsetrz3ParserElement._UnboundedCache.__init__..setcdSrr;rrryrzr;rz5ParserElement._UnboundedCache.__init__..clearctSrrrrryrz	cache_lenrz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes
MethodTyperrr;r)rrrr;rryrrzrsz&ParserElement._UnboundedCache.__init__Nrrrrryryryrz_UnboundedCacherNc@r)ParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Ncr
rrrrryrzrr.ParserElement._FifoCache.__init__..getcsJ||<tkr#zdWn	tyYnwtks
dSdSNF)rpopitemrr)rsizeryrzrs.ParserElement._FifoCache.__init__..setcrrrrrryrzr;r0ParserElement._FifoCache.__init__..clearcrrrrrryrzrr4ParserElement._FifoCache.__init__..cache_len)	rr_OrderedDictrrrrr;rrr%rrr;rry)rrr%rzrs!ParserElement._FifoCache.__init__Nrryryryrz
_FifoCacher r,c@r)r!cst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_	dS)	Ncr
rrrrryrzrrr"cs>||<tkrdtks
|dSr)rr1popleftr6r)rkey_fifor%ryrzrs
r&csdSrrr)rr.ryrzr;sr'crrrrrryrzrrr()
rrcollectionsdequerrrrr;rr*ry)rr.rr%rzrsr+Nrryryryrzr,r rcCsd\}}|||||f}tjqtj}||}	|	|jur^tj|d7<z
|||||}	WntyF}
z|||
j	|
j
d}
~
ww|||	d|	df|	WdStj|d7<t|	t
rn|	|	d|	dfWdS1swYdS)NrBrr)r&packrat_cache_lock
packrat_cacherrpackrat_cache_statsrrrrrrr}r)rrrrrHITMISSlookuprr
rryryrz_parseCaches,


$zParserElement._parseCachecCs(tjdgttjtjdd<dSr)r&r2r;rr3ryryryrz
resetCaches
zParserElement.resetCachecCs<tjsdt_|durtt_nt|t_tjt_dSdS)aEnables "packrat" parsing, which adds memoizing to the parsing logic.
           Repeated parse attempts at the same string location (which happens
           often in many complex grammars) can immediately return a cached value,
           instead of re-executing parsing/validating code.  Memoizing is done of
           both valid results and parsing exceptions.
           
           Parameters:
            - cache_size_limit - (default=C{128}) - if an integer value is provided
              will limit the size of the packrat cache; if None is passed, then
              the cache size will be unbounded; if 0 is passed, the cache will
              be effectively disabled.
            
           This speedup may break existing programs that use parse actions that
           have side-effects.  For this reason, packrat parsing is disabled when
           you first import pyparsing.  To activate the packrat feature, your
           program must call the class method C{ParserElement.enablePackrat()}.  If
           your program uses C{psyco} to "compile as you go", you must call
           C{enablePackrat} before calling C{psyco.full()}.  If you do not do this,
           Python will crash.  For best results, call C{enablePackrat()} immediately
           after importing pyparsing.
           
           Example::
               import pyparsing
               pyparsing.ParserElement.enablePackrat()
        TN)r&_packratEnabledrr2r,r7r)cache_size_limitryryrz
enablePackrat%szParserElement.enablePackratc
Cst|js||jD]}|q|js|}z"||d\}}|r<|||}t	t
}|||W|SW|StyP}ztjrJ|d}~ww)aC
        Execute the parse expression with the given string.
        This is the main interface to the client code, once the complete
        expression has been built.

        If you want the grammar to require that the entire input string be
        successfully parsed, then set C{parseAll} to True (equivalent to ending
        the grammar with C{L{StringEnd()}}).

        Note: C{parseString} implicitly calls C{expandtabs()} on the input string,
        in order to report proper column numbers in parse actions.
        If the input string contains tabs and
        the grammar uses parse actions that use the C{loc} argument to index into the
        string being parsed, you can ensure you have a consistent view of the input
        string by:
         - calling C{parseWithTabs} on your grammar before calling C{parseString}
           (see L{I{parseWithTabs}})
         - define your parse action using the full C{(s,loc,toks)} signature, and
           reference the input string using the parse action's C{s} argument
         - explicitly expand the tabs in your input string before calling
           C{parseString}
        
        Example::
            Word('a').parseString('aaaaabaaa')  # -> ['aaaaa']
            Word('a').parseString('aaaaabaaa', parseAll=True)  # -> Exception: Expected end of text
        rN)
r&r8r
streamlinerr
expandtabsrrrr+rverbose_stacktrace)rrparseAllrrrserryryrzparseStringHs,

zParserElement.parseStringc
csD|js||jD]}|q|jst|}t|}d}|j}|j}t	
d}	zb||kr|	|krz|||}
|||
dd\}}Wn
tyS|
d}Yn)w||krx|	d7}	||
|fV|ru|||}
|
|krp|}n|d7}n|}n|
d}||kr|	|ks6WdSWdSWdSWdSty}zt	j
r|d}~ww)a
        Scan the input string for expression matches.  Each match will return the
        matching tokens, start location, and end location.  May be called with optional
        C{maxMatches} argument, to clip scanning after 'n' matches are found.  If
        C{overlap} is specified, then overlapping matches will be reported.

        Note that the start and end locations are reported relative to the string
        being parsed.  See L{I{parseString}} for more information on parsing
        strings with embedded tabs.

        Example::
            source = "sldjf123lsdjjkf345sldkjf879lkjsfd987"
            print(source)
            for tokens,start,end in Word(alphas).scanString(source):
                print(' '*start + '^'*(end-start))
                print(' '*start + tokens[0])
        
        prints::
        
            sldjf123lsdjjkf345sldkjf879lkjsfd987
            ^^^^^
            sldjf
                    ^^^^^^^
                    lsdjjkf
                              ^^^^^^
                              sldkjf
                                       ^^^^^^
                                       lkjsfd
        rFrrN)rr=rrrr>rrrr&r8r!rr?)rr
maxMatchesoverlaprrr
preparseFnparseFnmatchesrnextLocrnextlocrryryrz
scanStringzsL




(zParserElement.scanStringc
Csg}d}d|_zN||D]-\}}}|||||r8t|tr)||7}nt|tr3||7}n|||}q
|||ddd|D}dtt	t
|WStyg}ztj
ra|d}~ww)af
        Extension to C{L{scanString}}, to modify matching text with modified tokens that may
        be returned from a parse action.  To use C{transformString}, define a grammar and
        attach a parse action to it that modifies the returned token list.
        Invoking C{transformString()} on a target string will then scan for matches,
        and replace the matched text patterns according to the logic in the parse
        action.  C{transformString()} returns the resulting transformed string.
        
        Example::
            wd = Word(alphas)
            wd.setParseAction(lambda toks: toks[0].title())
            
            print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york."))
        Prints::
            Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York.
        rTNcSsg|]}|r|qSryry)roryryrzrrz1ParserElement.transformString..r)rrKr6r}r$rrrrr_flattenrr&r?)rrrSlastErxrrrryryrzrs,



zParserElement.transformStringc
CsBztdd|||DWSty }ztjr|d}~ww)a
        Another extension to C{L{scanString}}, simplifying the access to the tokens found
        to match the given parse expression.  May be called with optional
        C{maxMatches} argument, to clip searching after 'n' matches are found.
        
        Example::
            # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters
            cap_word = Word(alphas.upper(), alphas.lower())
            
            print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))

            # the sum() builtin can be used to merge results into a single ParseResults object
            print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")))
        prints::
            [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']]
            ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity']
        cSsg|]\}}}|qSryry)rrxrrryryrzrz.ParserElement.searchString..N)r$rKrr&r?)rrrDrryryrzsearchStringszParserElement.searchStringc	csVd}d}|j||dD]\}}}|||V|r|dV|}q||dVdS)a[
        Generator method to split a string using the given expression as a separator.
        May be called with optional C{maxsplit} argument, to limit the number of splits;
        and the optional C{includeSeparators} argument (default=C{False}), if the separating
        matching text should be included in the split results.
        
        Example::        
            punc = oneOf(list(".,;:/-!?"))
            print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
        prints::
            ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
        r)rDN)rK)	rrmaxsplitincludeSeparatorssplitslastrxrrryryrzrs

zParserElement.splitcCFt|tr
t|}t|tstjdt|tdddSt||gS)a
        Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
        converts them to L{Literal}s by default.
        
        Example::
            greet = Word(alphas) + "," + Word(alphas) + "!"
            hello = "Hello, World!"
            print (hello, "->", greet.parseString(hello))
        Prints::
            Hello, World! -> ['Hello', ',', 'World', '!']
        4Cannot combine element of type %s with ParserElementrs
stacklevelN)	r}rr&rwarningswarnr
SyntaxWarningrrJryryrzr?s


zParserElement.__add__cCsBt|tr
t|}t|tstjdt|tdddS||S)z]
        Implementation of + operator when left operand is not a C{L{ParserElement}}
        rVrsrWNr}rr&rrYrZrr[rJryryrzrK1


zParserElement.__radd__cCsJt|tr
t|}t|tstjdt|tdddS|t	|S)zQ
        Implementation of - operator, returns C{L{And}} with error stop
        rVrsrWN)
r}rr&rrYrZrr[r
_ErrorStoprJryryrz__sub__=s


zParserElement.__sub__cCsBt|tr
t|}t|tstjdt|tdddS||S)z]
        Implementation of - operator when left operand is not a C{L{ParserElement}}
        rVrsrWNr\rJryryrz__rsub__Ir]zParserElement.__rsub__cst|tr|d}}npt|trt|ddd}|ddur$d|df}t|dtrO|ddurO|ddkr;tS|ddkrEtS|dtSt|dtrft|dtrf|\}}||8}ntdt|dt|dtdt||dkrtd|dkrtd	||krdkrtd
|rÇfdd|r|dkr|}|Stg||}|S|}|S|dkrˈ}|Stg|}|S)
a
        Implementation of * operator, allows use of C{expr * 3} in place of
        C{expr + expr + expr}.  Expressions may also me multiplied by a 2-integer
        tuple, similar to C{{min,max}} multipliers in regular expressions.  Tuples
        may also include C{None} as in:
         - C{expr*(n,None)} or C{expr*(n,)} is equivalent
              to C{expr*n + L{ZeroOrMore}(expr)}
              (read as "at least n instances of C{expr}")
         - C{expr*(None,n)} is equivalent to C{expr*(0,n)}
              (read as "0 to n instances of C{expr}")
         - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)}
         - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)}

        Note that C{expr*(None,n)} does not raise an exception if
        more than n exprs exist in the input stream; that is,
        C{expr*(None,n)} does not enforce a maximum number of expr
        occurrences.  If this behavior is desired, then write
        C{expr*(None,n) + ~expr}
        r)NNNrsrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs$|dkrt|dStSr)rnmakeOptionalListrryrzrdsz/ParserElement.__mul__..makeOptionalList)	r}rvtupler4rrr
ValueErrorr)rr>minElementsoptElementsrryrcrz__mul__UsN



zParserElement.__mul__cCs
||Sr)rirJryryrz__rmul__rzParserElement.__rmul__cCrU)zI
        Implementation of | operator - returns C{L{MatchFirst}}
        rVrsrWN)	r}rr&rrYrZrr[rrJryryrz__or__


zParserElement.__or__cCsBt|tr
t|}t|tstjdt|tdddS||BS)z]
        Implementation of | operator when left operand is not a C{L{ParserElement}}
        rVrsrWNr\rJryryrz__ror__r]zParserElement.__ror__cCrU)zA
        Implementation of ^ operator - returns C{L{Or}}
        rVrsrWN)	r}rr&rrYrZrr[rrJryryrz__xor__rlzParserElement.__xor__cCsBt|tr
t|}t|tstjdt|tdddS||AS)z]
        Implementation of ^ operator when left operand is not a C{L{ParserElement}}
        rVrsrWNr\rJryryrz__rxor__r]zParserElement.__rxor__cCrU)zC
        Implementation of & operator - returns C{L{Each}}
        rVrsrWN)	r}rr&rrYrZrr[rrJryryrz__and__rlzParserElement.__and__cCsBt|tr
t|}t|tstjdt|tdddS||@S)z]
        Implementation of & operator when left operand is not a C{L{ParserElement}}
        rVrsrWNr\rJryryrz__rand__r]zParserElement.__rand__cCr)zE
        Implementation of ~ operator - returns C{L{NotAny}}
        )rrryryrz
__invert__szParserElement.__invert__cCs|dur	||S|S)a

        Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}.
        
        If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be
        passed as C{True}.
           
        If C{name} is omitted, same as calling C{L{copy}}.

        Example::
            # these are equivalent
            userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
            userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")             
        N)rrr<ryryrz__call__s
zParserElement.__call__cCr)z
        Suppresses the output of this C{ParserElement}; useful to keep punctuation from
        cluttering up returned output.
        )r-rryryrzsuppressszParserElement.suppresscC
d|_|S)a
        Disables the skipping of whitespace before matching the characters in the
        C{ParserElement}'s defined pattern.  This is normally only used internally by
        the pyparsing module, but may be needed in some whitespace-sensitive grammars.
        FrrryryrzleaveWhitespacezParserElement.leaveWhitespacecCsd|_||_d|_|S)z8
        Overrides the default whitespace chars
        TF)rrr)rrryryrzsetWhitespaceChars
sz ParserElement.setWhitespaceCharscCru)z
        Overrides default behavior to expand C{}s to spaces before parsing the input string.
        Must be called before C{parseString} when the input grammar contains elements that
        match C{} characters.
        T)rrryryrz
parseWithTabsrxzParserElement.parseWithTabscCsNt|tr	t|}t|tr||jvr|j||S|jt||S)a
        Define expression to be ignored (e.g., comments) while doing pattern
        matching; may be called repeatedly, to define multiple comment or other
        ignorable patterns.
        
        Example::
            patt = OneOrMore(Word(alphas))
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
            
            patt.ignore(cStyleComment)
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd']
        )r}rr-rr6rrJryryrzignores



zParserElement.ignorecCs"|pt|pt|p	tf|_d|_|S)zT
        Enable display of debugging messages while doing pattern matching.
        T)rrrrr)rstartAction
successActionexceptionActionryryrzsetDebugActions6szParserElement.setDebugActionscCs |r|ttt|Sd|_|S)a
        Enable display of debugging messages while doing pattern matching.
        Set C{flag} to True to enable, False to disable.

        Example::
            wd = Word(alphas).setName("alphaword")
            integer = Word(nums).setName("numword")
            term = wd | integer
            
            # turn on debugging for wd
            wd.setDebug()

            OneOrMore(term).parseString("abc 123 xyz 890")
        
        prints::
            Match alphaword at loc 0(1,1)
            Matched alphaword -> ['abc']
            Match alphaword at loc 3(1,4)
            Exception raised:Expected alphaword (at char 4), (line:1, col:5)
            Match alphaword at loc 7(1,8)
            Matched alphaword -> ['xyz']
            Match alphaword at loc 11(1,12)
            Exception raised:Expected alphaword (at char 12), (line:1, col:13)
            Match alphaword at loc 15(1,16)
            Exception raised:Expected alphaword (at char 15), (line:1, col:16)

        The output shown is that produced by the default debug actions - custom debug actions can be
        specified using L{setDebugActions}. Prior to attempting
        to match the C{wd} expression, the debugging message C{"Match  at loc (,)"}
        is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"}
        message is shown. Also note the use of L{setName} to assign a human-readable name to the expression,
        which makes debugging and exception messages easier to understand - for instance, the default
        name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}.
        F)rrrrr)rflagryryrzsetDebug@s
#zParserElement.setDebugcCs|jSr)rrryryrzrizParserElement.__str__cCrrrrryryrzrlrzParserElement.__repr__cCsd|_d|_|Sr)rrrryryrzr=oszParserElement.streamlinecCsdSrryrryryrzcheckRecursiontrzParserElement.checkRecursioncCs|gdS)zj
        Check defined expressions for valid structure, check for infinite recursive definitions.
        N)r)r
validateTraceryryrzvalidatewszParserElement.validatecCsz|}Wn"ty(t|d}|}Wdn1s!wYYnwz|||WStyB}ztjr<|d}~ww)z
        Execute the parse expression on the given file or filename.
        If a filename is specified (instead of a file object),
        the entire file is opened, read, and closed before parsing.
        rN)readropenrBrr&r?)rfile_or_filenamer@
file_contentsfrryryrz	parseFile}s 
zParserElement.parseFilecsDt|tr||upt|t|kSt|tr||Stt||kSr)r}r&varsrrHsuperrJrryrz__eq__s



zParserElement.__eq__cC
||kSrryrJryryrz__ne__rzParserElement.__ne__cCstt|Sr)hashidrryryrz__hash__rzParserElement.__hash__cC||kSrryrJryryrz__req__rzParserElement.__req__cCrrryrJryryrz__rne__rzParserElement.__rne__cCs.z|jt||dWdStyYdSw)a
        Method for quick testing of a parser against a test string. Good for simple 
        inline microtests of sub expressions while building up larger parser.
           
        Parameters:
         - testString - to test against this expression for a match
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests
            
        Example::
            expr = Word(nums)
            assert expr.matches("100")
        r@TF)rBrr)r
testStringr@ryryrzrHs
zParserElement.matches#cCst|trtttj|}t|trt|}g}g}d}	|D]}
|dur.|	|
ds2|r8|
s8|
|
q"|
s;q"d||
g}g}z|
dd}
|j
|
|d}|
|j|d|	o_|}	Wnuty}
zIt|
trpdnd	}d|
vr|
t|
j|
|
d
t|
j|
dd|n|
d
|
jd||
d
t|
|	o|}	|
}WYd}
~
n%d}
~
wty}z|
dt||	o|}	|}WYd}~nd}~ww|r|r|
d	td||
|
|fq"|	|fS)a3
        Execute the parse expression on a series of test strings, showing each
        test, the parsed results or where the parse failed. Quick and easy way to
        run a parse expression against a list of sample strings.
           
        Parameters:
         - tests - a list of separate test strings, or a multiline string of test strings
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests           
         - comment - (default=C{'#'}) - expression for indicating embedded comments in the test 
              string; pass None to disable comment filtering
         - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline;
              if False, only dump nested list
         - printResults - (default=C{True}) prints test output to stdout
         - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing

        Returns: a (success, results) tuple, where success indicates that all tests succeeded
        (or failed if C{failureTests} is True), and the results contain a list of lines of each 
        test's output
        
        Example::
            number_expr = pyparsing_common.number.copy()

            result = number_expr.runTests('''
                # unsigned integer
                100
                # negative integer
                -100
                # float with scientific notation
                6.02e23
                # integer with scientific notation
                1e-12
                ''')
            print("Success" if result[0] else "Failed!")

            result = number_expr.runTests('''
                # stray character
                100Z
                # missing leading digit before '.'
                -.100
                # too many '.'
                3.14.159
                ''', failureTests=True)
            print("Success" if result[0] else "Failed!")
        prints::
            # unsigned integer
            100
            [100]

            # negative integer
            -100
            [-100]

            # float with scientific notation
            6.02e23
            [6.02e+23]

            # integer with scientific notation
            1e-12
            [1e-12]

            Success
            
            # stray character
            100Z
               ^
            FAIL: Expected end of text (at char 3), (line:1, col:4)

            # missing leading digit before '.'
            -.100
            ^
            FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1)

            # too many '.'
            3.14.159
                ^
            FAIL: Expected end of text (at char 4), (line:1, col:5)

            Success

        Each test string must be on a single line. If you want to test a string that spans multiple
        lines, create a test like this::

            expr.runTest(r"this is a test\n of strings that spans \n 3 lines")
        
        (Note that this is a raw string literal, you must include the leading 'r'.)
        TNFr]\nr)r{z(FATAL)r r^zFAIL: zFAIL-EXCEPTION: )r}rrrrrrstrip
splitlinesrrHr6rrrBrxrr#rIrr;rr)rtestsr@commentfullDumpprintResultsfailureTests
allResultscommentssuccessrxrSresultrrrryryrzrunTestssT
W

$
zParserElement.runTestsFTr)r9r)TrTTF)Orrrrrr?staticmethodrrrrrrrrrrrrrrrrr
rrrr)r,r2rr1r3r7rr8r:r<rB_MAX_INTrKrrPrr?rKr_r`rirjrkrmrnrorprqrrrsrtrwryrzr{rrrrr=rrrrrrrrrHr
__classcell__ryryrrzr&Os




&



G


"2G+D
			

)

r&c eZdZdZfddZZS)r.zT
    Abstract C{ParserElement} subclass, for defining atomic matching patterns.
    cstt|jdddSNFr)rr.rrrryrzr@	r#zToken.__init__rrrrrrryryrrzr.<	r.cr)rz,
    An empty token, will always match.
    cs$tt|d|_d|_d|_dS)NrTF)rrrrrrrrryrzrH	s
zEmpty.__init__rryryrrzrD	rrc*eZdZdZfddZdddZZS)rz(
    A token that will never match.
    cs*tt|d|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrrrrrrryrzrS	s

zNoMatch.__init__TcCst|||j|r)r!rrryryrzrZ	szNoMatch.parseImplrrrrrrrrryryrrzrO	srcr)ra
    Token to exactly match a specified string.
    
    Example::
        Literal('blah').parseString('blah')  # -> ['blah']
        Literal('blah').parseString('blahfooblah')  # -> ['blah']
        Literal('blah').parseString('bla')  # -> Exception: Expected "blah"
    
    For case-insensitive matching, use L{CaselessLiteral}.
    
    For keyword matching (force word break before and after the matched string),
    use L{Keyword} or L{CaselessKeyword}.
    cstt|||_t||_z|d|_Wnty*tj	dt
ddt|_Ynwdt
|j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrsrW"%s"rF)rrrmatchrmatchLenfirstMatchCharrrYrZr[rrrrrrrrmatchStringrryrzrl	s


zLiteral.__init__TcCsF|||jkr|jdks||j|r||j|jfSt|||j|r)rr
startswithrr!rrryryrzr	szLiteral.parseImplrrryryrrzr^	s
rcsLeZdZdZedZdfdd	Zddd	Zfd
dZe	dd
Z
ZS)ra\
    Token to exactly match a specified string as a keyword, that is, it must be
    immediately followed by a non-keyword character.  Compare with C{L{Literal}}:
     - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}.
     - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'}
    Accepts two optional constructor arguments in addition to the keyword string:
     - C{identChars} is a string of characters that would be valid identifier characters,
          defaulting to all alphanumerics + "_" and "$"
     - C{caseless} allows case-insensitive matching, default is C{False}.
       
    Example::
        Keyword("start").parseString("start")  # -> ['start']
        Keyword("start").parseString("starting")  # -> Exception

    For case-insensitive matching, use L{CaselessKeyword}.
    _$NFcstt||durtj}||_t||_z|d|_Wnty.t	j
dtddYnwd|j|_d|j|_
d|_d|_||_|rO||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrsrWrrF)rrrDEFAULT_KEYWORD_CHARSrrrrrrYrZr[rrrrcaselessupper
caselessmatchr
identChars)rrrrrryrzr	s*


zKeyword.__init__TcCs|jr>||||j|jkr=|t||jks&|||j|jvr=|dks5||d|jvr=||j|jfSn;|||jkry|jdksQ||j|ry|t||jksd|||j|jvry|dksq||d|jvry||j|jfSt	|||j
|r)rrrrrrrrrr!rrryryrzr	s*&zKeyword.parseImplcstt|}tj|_|Sr)rrrrr)rrrryrzr	szKeyword.copycCr)z,Overrides the default Keyword chars
        N)rrrryryrzsetDefaultKeywordChars	s
zKeyword.setDefaultKeywordCharsr#r)rrrrr5rrrrrrrryryrrzr	s
rcr)r
al
    Token to match a specified string, ignoring case of letters.
    Note: the matched results will always be in the case of the given
    match string, NOT the case of the input text.

    Example::
        OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD']
        
    (Contrast with example for L{CaselessKeyword}.)
    cs6tt||||_d|j|_d|j|_dS)Nz'%s'r)rr
rrreturnStringrrrrryrzr	szCaselessLiteral.__init__TcCs<||||j|jkr||j|jfSt|||j|r)rrrrr!rrryryrzr	szCaselessLiteral.parseImplrrryryrrzr
	s
r
c,eZdZdZdfdd	Zd	ddZZS)
r	z
    Caseless version of L{Keyword}.

    Example::
        OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD']
        
    (Contrast with example for L{CaselessLiteral}.)
    Ncstt|j||dddS)NTr)rr	r)rrrrryrzr	szCaselessKeyword.__init__TcCsf||||j|jkr+|t||jks#|||j|jvr+||j|jfSt|||j|r)rrrrrrr!rrryryrzr	s*zCaselessKeyword.parseImplrrrryryrrzr		sr	cr)
rnax
    A variation on L{Literal} which matches "close" matches, that is, 
    strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters:
     - C{match_string} - string to be matched
     - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match
    
    The results from a successful parse will contain the matched text from the input string and the following named results:
     - C{mismatches} - a list of the positions within the match_string where mismatches were found
     - C{original} - the original match_string used to compare against the input string
    
    If C{mismatches} is an empty list, then the match was an exact match.
    
    Example::
        patt = CloseMatch("ATCATCGAATGGA")
        patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']})
        patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1)

        # exact match
        patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']})

        # close match allowing up to 2 mismatches
        patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2)
        patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']})
    rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F)	rrnrrmatch_string
maxMismatchesrrr)rrrrryrzr

s
zCloseMatch.__init__TcCs|}t|}|t|j}||kr[|j}d}g}	|j}
tt||||jD]\}}|\}}
||
kr@|	|t|	|
kr@nq'|d}t|||g}|j|d<|	|d<||fSt|||j|)Nrroriginal
mismatches)	rrrrrr6r$r!r)rrrrstartrmaxlocrmatch_stringlocrrs_msrcmatresultsryryrzr
s* 

zCloseMatch.parseImpl)rrrryryrrzrn	s	rncs8eZdZdZd
fdd	Zdd	d
ZfddZZS)r1a	
    Token for matching words composed of allowed character sets.
    Defined with string containing all allowed initial characters,
    an optional string containing allowed body characters (if omitted,
    defaults to the initial character set), and an optional minimum,
    maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction. An optional
    C{excludeChars} parameter can list characters that might be found in 
    the input C{bodyChars} string; useful to define a word of all printables
    except for one or two characters, for instance.
    
    L{srange} is useful for defining custom character set strings for defining 
    C{Word} expressions, using range notation from regular expression character sets.
    
    A common mistake is to use C{Word} to match a specific literal string, as in 
    C{Word("Address")}. Remember that C{Word} uses the string argument to define
    I{sets} of matchable characters. This expression would match "Add", "AAA",
    "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'.
    To match an exact literal string, use L{Literal} or L{Keyword}.

    pyparsing includes helper strings for building Words:
     - L{alphas}
     - L{nums}
     - L{alphanums}
     - L{hexnums}
     - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.)
     - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.)
     - L{printables} (any non-whitespace character)

    Example::
        # a word composed of digits
        integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9"))
        
        # a word with a leading capital, and zero or more lowercase
        capital_word = Word(alphas.upper(), alphas.lower())

        # hostnames are alphanumeric, with leading alpha, and '-'
        hostname = Word(alphas, alphanums+'-')
        
        # roman numeral (not a strict parser, accepts invalid mix of characters)
        roman = Word("IVXLCDM")
        
        # any string of non-whitespace characters, except for ','
        csv_value = Word(printables, excludeChars=",")
    NrrFcstt|r#dfdd|D}|r#dfdd|D}||_t||_|r6||_t||_n||_t||_|dk|_	|dkrKt
d||_|dkrV||_nt
|_|dkrc||_||_t||_d|j|_d	|_||_d
|j|jvr|dkr|dkr|dkr|j|jkrdt|j|_n#t|jdkrdt|jt|jf|_n
d
t|jt|jf|_|jrd|jd|_z
t|j|_WdStyd|_YdSwdSdSdSdS)Nrc3|]	}|vr|VqdSrryrexcludeCharsryrzr`
rz Word.__init__..c3rrryrrryrzrb
rrrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedrFrz[%s]+z%s[%s]*z	[%s][%s]*z\b)rr1rr
initCharsOrigr	initChars
bodyCharsOrig	bodyCharsmaxSpecifiedrfminLenmaxLenrrrrr	asKeyword_escapeRegexRangeCharsreStringrrescapecompiler)rrrminmaxexactrrrrrzr]
s`



(
z
Word.__init__Tc
CsF|jr|j||}|st|||j||}||fS|||jvr-t|||j||}|d7}t|}|j}||j	}t
||}||kr\|||vr\|d7}||kr\|||vsNd}	|||jkrgd}	|jrv||krv|||vrvd}	|j
r|dkr||d|vs||kr|||vrd}	|	rt|||j|||||fS)NrFTr)rrr!rendgrouprrrrrrrr)
rrrrrrr	bodycharsrthrowExceptionryryrzr
s8

,zWord.parseImplcsxztt|WStyYnw|jdur9dd}|j|jkr1d||j||jf|_|jSd||j|_|jS)NcSs t|dkr|dddS|S)N...rrryryrz
charsAsStr
sz Word.__str__..charsAsStrz	W:(%s,%s)zW:(%s))rr1rrrrr)rrrryrzr
s
zWord.__str__)NrrrFNrrrrrrrrrryryrrzr1.
s
.
6#r1csFeZdZdZeedZdfdd	ZdddZ	fd	d
Z
ZS)
r)a
    Token for matching strings that match a given regular expression.
    Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.
    If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as 
    named parse results.

    Example::
        realnum = Regex(r"[+-]?\d+\.\d*")
        date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)')
        # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression
        roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})")
    z[A-Z]rcstt|t|tr?|stjdtdd||_||_	zt
|j|j	|_
|j|_Wn,t
jy>tjd|tddwt|tjrT||_
t||_|_||_	ntdt||_d|j|_d|_d|_d	S)
zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrsrW$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectrFTN)rr)rr}rrYrZr[patternflagsrrr
sre_constantserrorcompiledREtyperrfrrrrr)rrrrryrzr
s8



zRegex.__init__TcCs`|j||}|st|||j||}|}t|}|r,|D]}||||<q#||fSr)rrr!rr	groupdictr$r)rrrrrdrrryryrzr
szRegex.parseImplcsDztt|WStyYnw|jdurdt|j|_|jS)NzRe:(%s))rr)rrrrrrrryrzr
s
z
Regex.__str__rr)rrrrrrrrrrrrryryrrzr)
s
"
r)cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
r'a
    Token for matching strings that are delimited by quoting characters.
    
    Defined with the following parameters:
        - quoteChar - string of one or more characters defining the quote delimiting string
        - escChar - character to escape quotes, typically backslash (default=C{None})
        - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None})
        - multiline - boolean indicating whether quotes can span multiple lines (default=C{False})
        - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True})
        - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar)
        - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True})

    Example::
        qs = QuotedString('"')
        print(qs.searchString('lsjdf "This is the quote" sldjf'))
        complex_qs = QuotedString('{{', endQuoteChar='}}')
        print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf'))
        sql_qs = QuotedString('"', escQuote='""')
        print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf'))
    prints::
        [['This is the quote']]
        [['This is the "quote"']]
        [['This is the quote with "embedded" quotes']]
    NFTc
s>tt|}|stjdtddt|dur|}n|}|s0tjdtddt|_t	|_
|d_|_t	|_
|_|_|_|_|rttjtjB_dtjtjd|durnt|podf_nd_dtjtjd|durt|pdf_t	jd	krjd
dfdd
tt	jd	ddDd7_|rÈjdt|7_|rڈjdt|7_tjd_jdtj7_ztjj_j_Wntjytjdjtddwt _!dj!_"d_#d_$dS)Nz$quoteChar cannot be the empty stringrsrWz'endQuoteChar cannot be the empty stringrz%s(?:[^%s%s]rz%s(?:[^%s\n\r%s]rz|(?:z)|(?:c3s6|]}dtjd|tj|fVqdS)z%s[^%s]N)rrendQuoteCharrrOrryrzrXsz(QuotedString.__init__..rt)z|(?:%s)z|(?:%s.)z(.)z)*%srrFT)%rr'rrrYrZr[SyntaxError	quoteCharrquoteCharLenfirstQuoteCharrendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr	MULTILINEDOTALLrrrrrrescCharReplacePatternrrrrrrrrr)rrrr	multilinerrrrrrzr/s|






zQuotedString.__init__c	Cs|||jkr|j||pd}|st|||j||}|}|jrf||j|j	}t
|trfd|vrP|jrPddddd}|
D]
\}}|||}qE|jr[t|jd|}|jrf||j|j}||fS)N\	r]
)\trz\fz\rz\g<1>)rrrr!rrrrrrr}rrrrrrrrr)	rrrrrrws_mapwslitwscharryryrzrps* 
zQuotedString.parseImplcsFztt|WStyYnw|jdur d|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr'rrrrrrrryrzrs
zQuotedString.__str__)NNFTNTrrryryrrzr's

A#r'cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
ra
    Token for matching words composed of characters I{not} in a given set (will
    include whitespace in matched characters if not listed in the provided exclusion set - see example).
    Defined with string containing all disallowed characters, and an optional
    minimum, maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction.

    Example::
        # define a comma-separated-value as anything that is not a ','
        csv_value = CharsNotIn(',')
        print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213"))
    prints::
        ['dkls', 'lsdkjf', 's12 34', '@!#', '213']
    rrcstt|d|_||_|dkrtd||_|dkr ||_nt|_|dkr-||_||_t	||_
d|j
|_|jdk|_d|_
dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrr)rrrrnotCharsrfrrrrrrrr)rr
rrrrryrzrs 

zCharsNotIn.__init__TcCs|||jvrt|||j||}|d7}|j}t||jt|}||kr:|||vr:|d7}||kr:|||vs,|||jkrIt|||j|||||fSr)r
r!rrrrr)rrrrrnotcharsmaxlenryryrzrszCharsNotIn.parseImplcshztt|WStyYnw|jdur1t|jdkr+d|jdd|_|jSd|j|_|jS)Nrz
!W:(%s...)z!W:(%s))rrrrrrr
rrryrzrs
zCharsNotIn.__str__)rrrrrryryrrzrs

rcs<eZdZdZddddddZdfdd	ZdddZZS)r0a
    Special matching class for matching whitespace.  Normally, whitespace is ignored
    by pyparsing grammars.  This class is included when some whitespace structures
    are significant.  Define with a string containing the whitespace characters to be
    matched; default is C{" \t\r\n"}.  Also takes optional C{min}, C{max}, and C{exact} arguments,
    as defined for the C{L{Word}} class.
    zzzzz)rrr]rr 	
rrcstt|_dfddjDdddjD_d_dj_	|_
|dkr:|_nt_|dkrI|_|_
dSdS)Nrc3s|]
}|jvr|VqdSr)
matchWhiterrryrzrrz!White.__init__..css|]}tj|VqdSr)r0	whiteStrsrryryrzrrvTrr)
rr0rrryrrrrrrrr)rwsrrrrrrzrs 
zWhite.__init__TcCs|||jvrt|||j||}|d7}||j}t|t|}||kr;|||jvr;|d7}||kr;|||jvs,|||jkrJt|||j|||||fSr)rr!rrrrr)rrrrrrryryrzr	s
zWhite.parseImpl)rrrrr)rrrrrrrrryryrrzr0sr0ceZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dSr)rrrrrrrrrrryrzr

z_PositionToken.__init__rrrrrryryrrzrrcs2eZdZdZfddZddZd	ddZZS)
rzb
    Token to advance to a specific column of input text; useful for tabular report scraping.
    cstt|||_dSr)rrrr;)rcolnorryrzr$
zGoToColumn.__init__cCs~t|||jkr=t|}|jr|||}||kr=||r=t|||jkr=|d7}||kr=||r=t|||jks'|Sr)r;rrrisspace)rrrrryryrzr(s$$zGoToColumn.preParseTcCsDt||}||jkrt||d|||j|}|||}||fS)NzText not in expected columnr;r!)rrrrthiscolnewlocrryryrzr1s

zGoToColumn.parseImplr)rrrrrrrrryryrrzr s
	rcr)ra
    Matches if current position is at the beginning of a line within the parse string
    
    Example::
    
        test = '''        AAA this line
        AAA and this line
          AAA but not this one
        B AAA and definitely not this one
        '''

        for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
            print(t)
    
    Prints::
        ['AAA', ' this line']
        ['AAA', ' and this line']    

    ctt|d|_dS)NzExpected start of line)rrrrrrryrzrOrzLineStart.__init__TcCs&t||dkr|gfSt|||j|r)r;r!rrryryrzrSszLineStart.parseImplrrryryrrzr:srcr)rzU
    Matches if current position is at the end of a line within the parse string
    cs,tt||tjddd|_dS)Nr]rzExpected end of line)rrrryr&rrrrrryrzr\s
zLineEnd.__init__TcCs\|t|kr||dkr|ddfSt|||j||t|kr&|dgfSt|||j|)Nr]rrr!rrryryrzraszLineEnd.parseImplrrryryrrzrXsrcr)r,zM
    Matches if current position is at the beginning of the parse string
    cr)NzExpected start of text)rr,rrrrryrzrprzStringStart.__init__TcCs0|dkr|||dkrt|||j||gfSr)rr!rrryryrzrtszStringStart.parseImplrrryryrrzr,lr,cr)r+zG
    Matches if current position is at the end of the parse string
    cr)NzExpected end of text)rr+rrrrryrzrrzStringEnd.__init__TcCsX|t|krt|||j||t|kr|dgfS|t|kr$|gfSt|||j|rr rryryrzrszStringEnd.parseImplrrryryrrzr+{r!r+c.eZdZdZeffdd	ZdddZZS)r3ap
    Matches if the current position is at the beginning of a Word, and
    is not preceded by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of
    the string being parsed, or at the beginning of a line.
    cs"tt|t||_d|_dS)NzNot at the start of a word)rr3rr	wordCharsrrr#rryrzrs

zWordStart.__init__TcCs@|dkr||d|jvs|||jvrt|||j||gfSr)r#r!rrryryrzrs
zWordStart.parseImplrrrrrrXrrrryryrrzr3sr3cr")r2aZ
    Matches if the current position is at the end of a Word, and
    is not followed by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of
    the string being parsed, or at the end of a line.
    cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rr2rrr#rrr$rryrzrrzWordEnd.__init__TcCsPt|}|dkr$||kr$|||jvs||d|jvr$t|||j||gfSr)rr#r!r)rrrrrryryrzrszWordEnd.parseImplrr%ryryrrzr2sr2cseZdZdZdfdd	ZddZddZd	d
ZfddZfd
dZ	fddZ
dfdd	ZgfddZfddZ
ZS)r"z^
    Abstract subclass of ParserElement, for combining and post-processing parsed tokens.
    Fcstt||t|trt|}t|trt|g|_	n3t|t
r.F)rr"rr}rrrr&rexprsrallrrrrr&rrryrzrs 



zParseExpression.__init__cCrr)r&rryryrzrrzParseExpression.__getitem__cCs|j|d|_|Sr)r&r6rrJryryrzr6szParseExpression.appendcCs0d|_dd|jD|_|jD]}|q|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on
           all contained expressions.FcSg|]}|qSryr=rrryryrzrrz3ParseExpression.leaveWhitespace..)rr&rw)rrryryrzrws


zParseExpression.leaveWhitespacecstt|tr"||jvr tt|||jD]
}||jdq|Stt|||jD]
}||jdq-|Sr)r}r-rrr"r{r&)rr>rrryrzr{



zParseExpression.ignorecsLztt|WStyYnw|jdur#d|jjt|jf|_|jSNz%s:(%s))	rr"rrrrrrr&rrryrzrs
zParseExpression.__str__cs tt||jD]}|q
t|jdkr|jd}t||jrO|jsO|jdurO|j	sO|jdd|jdg|_d|_
|j|jO_|j|jO_|jd}t||jr|js|jdur|j	s|jdd|jdd|_d|_
|j|jO_|j|jO_dt
||_|S)Nrsrrrtr)rr"r=r&rr}rrrrrrrrr)rrr>rryrzr=s8





zParseExpression.streamlinecstt|||}|Sr)rr"r)rrrrrryrzr
szParseExpression.setResultsNamecCs6|dd|g}|jD]}||q|gdSr)r&rr)rrtmprryryrzr

zParseExpression.validatecs$tt|}dd|jD|_|S)NcSr)ryr=r*ryryrzr%
rz(ParseExpression.copy..)rr"rr&r\rryrzr#
szParseExpression.copyr)rrrrrrr6rwr{rr=rrrrryryrrzr"s	
"r"csTeZdZdZGdddeZdfdd	ZdddZd	d
ZddZ	d
dZ
ZS)ra

    Requires all given C{ParseExpression}s to be found in the given order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'+'} operator.
    May also be constructed using the C{'-'} operator, which will suppress backtracking.

    Example::
        integer = Word(nums)
        name_expr = OneOrMore(Word(alphas))

        expr = And([integer("id"),name_expr("name"),integer("age")])
        # more easily written as:
        expr = integer("id") + name_expr("name") + integer("age")
    cr)zAnd._ErrorStopcs*ttj|j|i|d|_|dS)N-)rrr^rrrwr~rryrzr9
szAnd._ErrorStop.__init__rryryrrzr^8
rr^TcsRtt|||tdd|jD|_||jdj|jdj|_d|_	dS)Ncs|]}|jVqdSrrr*ryryrzr@
zAnd.__init__..rT)
rrrr'r&rryrrrr(rryrzr>
s

zAnd.__init__c	Cs|jdj|||dd\}}d}|jddD]W}t|tjr"d}q|r[z||||\}}Wn4ty7tyJ}zd|_t|d}~wt	yZt|t
||j|w||||\}}|sj|rn||7}q||fS)NrFrCrT)
r&rr}rr^r%r
__traceback__rrrrr,)	rrrr
resultlist	errorStopr
exprtokensrryryrzrE
s.
z
And.parseImplcCt|tr
t|}||Srr}rr&rr6rJryryrzrI^



zAnd.__iadd__cCs8|dd|g}|jD]
}|||jsdSqdSr)r&rrrrsubRecCheckListrryryrzrc
s

zAnd.checkRecursioncC@t|dr|jS|jdurdddd|jDd|_|jS)Nr{rcs|]}t|VqdSrrr*ryryrzro
r zAnd.__str__..}rrrrr&rryryrzrj



 zAnd.__str__r)rrrrrr^rrrIrrrryryrrzr(
s
rcDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the expression that matches the longest string will be used.
    May be constructed using the C{'^'} operator.

    Example::
        # construct Or using '^' operator
        
        number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789"))
    prints::
        [['123'], ['3.1416'], ['789']]
    Fc<tt||||jrtdd|jD|_dSd|_dS)Ncsr0rr1r*ryryrzr
r2zOr.__init__..T)rrrr&ryrr(rryrzr

zOr.__init__TcCsDd}d}g}|jD]M}z|||}Wn;ty2}	zd|	_|	j|kr(|	}|	j}WYd}	~	q	d}	~	wtyNt||krLt|t||j|}t|}Yq	w|||fq	|r|j	ddd|D]-\}
}z
|
|||WSty}	zd|	_|	j|kr|	}|	j}WYd}	~	qcd}	~	ww|dur|j|_|t||d|)NrtcSs
|dSrry)xryryrzr{
rzOr.parseImpl..)r2 no defined alternatives to match)r&r
r!r3rrrrr6sortrr)rrrr	maxExcLocmaxExceptionrHrloc2r_ryryrzr
sF


zOr.parseImplcCr7rr8rJryryrz__ixor__
r9zOr.__ixor__cCr<)Nrr=z ^ csr>rrr*ryryrzr
r zOr.__str__..r?r@rryryrzr
rAz
Or.__str__cC,|dd|g}|jD]}||qdSrr&rr:ryryrzr

zOr.checkRecursionrr)
rrrrrrrLrrrryryrrzrt
s
&	rcrB)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the first one listed is the one that will match.
    May be constructed using the C{'|'} operator.

    Example::
        # construct MatchFirst using '|' operator
        
        # watch the order of expressions to match
        number = Word(nums) | Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789")) #  Fail! -> [['123'], ['3'], ['1416'], ['789']]

        # put more selective expression first
        number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums)
        print(number.searchString("123 3.1416 789")) #  Better -> [['123'], ['3.1416'], ['789']]
    FcrC)Ncsr0rr1r*ryryrzr
r2z&MatchFirst.__init__..T)rrrr&ryrr(rryrzr
rDzMatchFirst.__init__Tc	Csd}d}|jD]F}z||||}|WSty1}z|j|kr'|}|j}WYd}~qd}~wtyMt||krKt|t||j|}t|}Yqw|durX|j|_|t||d|)NrtrF)r&rr!rrrrr)	rrrrrHrIrrrryryrzr
s*


zMatchFirst.parseImplcCr7rr8rJryryrz__ior__
r9zMatchFirst.__ior__cCr<)Nrr= | csr>rrr*ryryrzr
r z%MatchFirst.__str__..r?r@rryryrzr
rAzMatchFirst.__str__cCrMrrNr:ryryrzrrOzMatchFirst.checkRecursionrr)
rrrrrrrPrrrryryrrzr
s
	rcs<eZdZdZdfdd	ZdddZddZd	d
ZZS)ram
    Requires all given C{ParseExpression}s to be found, but in any order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'&'} operator.

    Example::
        color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN")
        shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON")
        integer = Word(nums)
        shape_attr = "shape:" + shape_type("shape")
        posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn")
        color_attr = "color:" + color("color")
        size_attr = "size:" + integer("size")

        # use Each (using operator '&') to accept attributes in any order 
        # (shape and posn are required, color and size are optional)
        shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr)

        shape_spec.runTests('''
            shape: SQUARE color: BLACK posn: 100, 120
            shape: CIRCLE size: 50 color: BLUE posn: 50,80
            color:GREEN size:20 shape:TRIANGLE posn:20,40
            '''
            )
    prints::
        shape: SQUARE color: BLACK posn: 100, 120
        ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']]
        - color: BLACK
        - posn: ['100', ',', '120']
          - x: 100
          - y: 120
        - shape: SQUARE


        shape: CIRCLE size: 50 color: BLUE posn: 50,80
        ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']]
        - color: BLUE
        - posn: ['50', ',', '80']
          - x: 50
          - y: 80
        - shape: CIRCLE
        - size: 50


        color: GREEN size: 20 shape: TRIANGLE posn: 20,40
        ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']]
        - color: GREEN
        - posn: ['20', ',', '40']
          - x: 20
          - y: 40
        - shape: TRIANGLE
        - size: 20
    Tcs8tt|||tdd|jD|_d|_d|_dS)Ncsr0rr1r*ryryrzr?r2z Each.__init__..T)rrrr'r&rrinitExprGroupsr(rryrzr=s
z
Each.__init__c	s|jrItdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d	|_|}|jdd}|jddg}d
}	|	r||j|j}
g}|
D]8}z|||}Wnt	y|
|Yqmw|
|jt||||vr|
|qm|vr
|qmt|t|
krd	}	|	s_|rddd|D}
t	||d
|
|fdd|jD7}g}|D]}||||\}}|
|qt|tg}||fS)Ncss(|]}t|trt|j|fVqdSr)r}rrrr*ryryrzrEs&z!Each.parseImpl..cSg|]
}t|tr|jqSryr}rrr*ryryrzrFz"Each.parseImpl..cSs g|]}|jrt|ts|qSry)rr}rr*ryryrzrG cSrSry)r}r4rr*ryryrzrIrUcSrSry)r}rrr*ryryrzrJrUcSs g|]}t|tttfs|qSry)r}rr4rr*ryryrzrKrVFTrNcsr>rrr*ryryrzrfr z*Missing one or more required elements (%s)cs$g|]}t|tr|jvr|qSryrTr*tmpOptryrzrjr|)rRrr&opt1map	optionalsmultioptionals
multirequiredrequiredr
r!r6rrremoverrrsumr$)rrrropt1opt2tmpLoctmpReqd
matchOrderkeepMatchingtmpExprsfailedrmissingr4rfinalResultsryrWrzrCsV

zEach.parseImplcCr<)Nrr=z & csr>rrr*ryryrzryr zEach.__str__..r?r@rryryrzrtrAzEach.__str__cCrMrrNr:ryryrzr}rOzEach.checkRecursionr)	rrrrrrrrrryryrrzrs5
1	rcsleZdZdZdfdd	ZdddZdd	Zfd
dZfdd
ZddZ	gfddZ
fddZZS)r za
    Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens.
    Fcstt||t|tr ttjtrt|}ntt	|}||_
d|_|durM|j|_|j
|_
||j|j|_|j|_|j|_|j|jdSdSr)rr rr}r
issubclassr&rr.rrrrrryrrrrrr9rrrrryrzrs 
zParseElementEnhance.__init__TcCs.|jdur|jj|||ddStd||j|)NFrCr)rrr!rrryryrzrs
zParseElementEnhance.parseImplcCs*d|_|j|_|jdur|j|Sr#)rrrrwrryryrzrws


z#ParseElementEnhance.leaveWhitespacecstt|tr"||jvr tt|||jdur |j|jd|Stt|||jdur8|j|jd|Sr)r}r-rrr r{rrJrryrzr{r+zParseElementEnhance.ignorecs&tt||jdur|j|Sr)rr r=rrrryrzr=s

zParseElementEnhance.streamlinecCsF||vrt||g|dd|g}|jdur!|j|dSdSr)r(rr)rrr;ryryrzrs
z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdur|j||gdSrrrrrrr-ryryrzrr.zParseElementEnhance.validatecsVztt|WStyYnw|jdur(|jdur(d|jjt|jf|_|jSr,)	rr rrrrrrrrrryrzrszParseElementEnhance.__str__rr)
rrrrrrrwr{r=rrrrryryrrzr s
r cr)ra
    Lookahead matching of the given parse expression.  C{FollowedBy}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression matches at the current
    position.  C{FollowedBy} always returns a null token list.

    Example::
        # use FollowedBy to match a label only if it is followed by a ':'
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint()
    prints::
        [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']]
    ctt||d|_dSr)rrrrrrrryrzr
zFollowedBy.__init__TcCs|j|||gfSr)rr
rryryrzrszFollowedBy.parseImplrrryryrrzrsrcs2eZdZdZfddZd	ddZddZZS)
ra
    Lookahead to disallow matching with the given parse expression.  C{NotAny}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression does I{not} match at the current
    position.  Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny}
    always returns a null token list.  May be constructed using the '~' operator.

    Example::
        
    cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrrrrrrrorryrzrszNotAny.__init__TcCs&|j||rt|||j||gfSr)rrr!rrryryrzrszNotAny.parseImplcC4t|dr|jS|jdurdt|jd|_|jS)Nrz~{r?rrrrrrryryrzr


zNotAny.__str__rrryryrrzrs


rcs(eZdZdfdd	ZdddZZS)	_MultipleMatchNcsLtt||d|_|}t|trt|}|dur!||_dSd|_dSr)	rrtrrr}rr&r	not_ender)rrstopOnenderrryrzrs

z_MultipleMatch.__init__Tc	Cs|jj}|j}|jdu}|r|jj}|r|||||||dd\}}z*|j}		|r1||||	r9|||}
n|}
|||
|\}}|sI|rM||7}q*ttfy[Y||fSwNFrC)	rrrrur
rr,r!r)rrrrself_expr_parseself_skip_ignorablescheck_ender
try_not_enderrhasIgnoreExprsr	tmptokensryryrzrs0




z_MultipleMatch.parseImplrr)rrrrrrryryrrzrt
srtc@seZdZdZddZdS)ra
    Repetition of one or more of the given expression.
    
    Parameters:
     - expr - expression that must match one or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: BLACK"
        OneOrMore(attr_expr).parseString(text).pprint()  # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']]

        # use stopOn attribute for OneOrMore to avoid reading label string as part of the data
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']]
        
        # could also be written as
        (attr_expr * (1,)).parseString(text).pprint()
    cCrq)Nrr=z}...rrrryryrzrJrszOneOrMore.__str__N)rrrrrryryryrzr0srcs8eZdZdZd
fdd	Zdfdd	Zdd	ZZS)r4aw
    Optional repetition of zero or more of the given expression.
    
    Parameters:
     - expr - expression that must match zero or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example: similar to L{OneOrMore}
    Ncstt|j||dd|_dS)N)rvT)rr4rr)rrrvrryrzr_s
zZeroOrMore.__init__Tc	s6ztt||||WSttfy|gfYSwr)rr4rr!rrrryrzrcs
zZeroOrMore.parseImplcCrq)NrrM]...rrrryryrzrirszZeroOrMore.__str__rrrryryrrzr4Ss
r4c@s eZdZddZeZddZdS)
_NullTokencCrr#ryrryryrzrsrz_NullToken.__bool__cCrrryrryryrzrvrz_NullToken.__str__N)rrrrrrryryryrzrrsrcs6eZdZdZeffdd	Zd	ddZddZZS)
raa
    Optional matching of the given expression.

    Parameters:
     - expr - expression that must match zero or more times
     - default (optional) - value to be returned if the optional expression is not found.

    Example::
        # US postal code can be a 5-digit zip, plus optional 4-digit qualifier
        zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4)))
        zip.runTests('''
            # traditional ZIP code
            12345
            
            # ZIP+4 form
            12101-0001
            
            # invalid ZIP
            98765-
            ''')
    prints::
        # traditional ZIP code
        12345
        ['12345']

        # ZIP+4 form
        12101-0001
        ['12101-0001']

        # invalid ZIP
        98765-
             ^
        FAIL: Expected end of text (at char 5), (line:1, col:6)
    cs.tt|j|dd|jj|_||_d|_dS)NFrT)rrrrrr3r)rrr-rryrzrs

zOptional.__init__Tc	Csz|jj|||dd\}}W||fSttfyG|jtur6|jjr1t|jg}|j||jj<n|jg}ng}Y||fSY||fSY||fSwrx)rrr!rr3_optionalNotMatchedrr$)rrrrrryryrzrs 


zOptional.parseImplcCrq)NrrMrPrrrryryrzrrszOptional.__str__r)	rrrrrrrrrryryrrzrzs
"
rcs,eZdZdZd	fdd	Zd
ddZZS)r*a	
    Token for skipping over all undefined text until the matched expression is found.

    Parameters:
     - expr - target expression marking the end of the data to be skipped
     - include - (default=C{False}) if True, the target expression is also parsed 
          (the skipped text and target expression are returned as a 2-element list).
     - ignore - (default=C{None}) used to define grammars (typically quoted strings and 
          comments) that might contain false matches to the target expression
     - failOn - (default=C{None}) define expressions that are not allowed to be 
          included in the skipped test; if found before the target expression is found, 
          the SkipTo is not a match

    Example::
        report = '''
            Outstanding Issues Report - 1 Jan 2000

               # | Severity | Description                               |  Days Open
            -----+----------+-------------------------------------------+-----------
             101 | Critical | Intermittent system crash                 |          6
              94 | Cosmetic | Spelling error on Login ('log|n')         |         14
              79 | Minor    | System slow when running too many reports |         47
            '''
        integer = Word(nums)
        SEP = Suppress('|')
        # use SkipTo to simply match everything up until the next SEP
        # - ignore quoted strings, so that a '|' character inside a quoted string does not match
        # - parse action will call token.strip() for each matched token, i.e., the description body
        string_data = SkipTo(SEP, ignore=quotedString)
        string_data.setParseAction(tokenMap(str.strip))
        ticket_expr = (integer("issue_num") + SEP 
                      + string_data("sev") + SEP 
                      + string_data("desc") + SEP 
                      + integer("days_open"))
        
        for tkt in ticket_expr.searchString(report):
            print tkt.dump()
    prints::
        ['101', 'Critical', 'Intermittent system crash', '6']
        - days_open: 6
        - desc: Intermittent system crash
        - issue_num: 101
        - sev: Critical
        ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14']
        - days_open: 14
        - desc: Spelling error on Login ('log|n')
        - issue_num: 94
        - sev: Cosmetic
        ['79', 'Minor', 'System slow when running too many reports', '47']
        - days_open: 47
        - desc: System slow when running too many reports
        - issue_num: 79
        - sev: Minor
    FNcs`tt||||_d|_d|_||_d|_t|t	r#t
||_n||_dt
|j|_dS)NTFzNo match found for )rr*r
ignoreExprrrincludeMatchrr}rr&rfailOnrrr)rr>includer{rrryrzrs
zSkipTo.__init__Tc	Cs$|}t|}|j}|jj}|jdur|jjnd}|jdur!|jjnd}	|}
|
|kri|dur3|||
r3n>|	durJ	z|	||
}
Wn	tyHYnwq8z
|||
dddWntt	fyc|
d7}
Ynwn|
|ks)t|||j
||
}|||}t|}|jr||||dd\}}
||
7}||fS)NrF)rrrC)
rrrrrrr
rr!rrr$r)rrrrrrr
expr_parseself_failOn_canParseNextself_ignoreExpr_tryParsetmplocskiptext
skipresultrryryrzrsD
zSkipTo.parseImpl)FNNrrryryrrzr*s6
r*csbeZdZdZdfdd	ZddZddZd	d
ZddZgfd
dZ	ddZ
fddZZS)raK
    Forward declaration of an expression to be defined later -
    used for recursive grammars, such as algebraic infix notation.
    When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator.

    Note: take care when assigning to C{Forward} not to overlook precedence of operators.
    Specifically, '|' has a lower precedence than '<<', so that::
        fwdExpr << a | b | c
    will actually be evaluated as::
        (fwdExpr << a) | b | c
    thereby leaving b and c out as parseable alternatives.  It is recommended that you
    explicitly group the values inserted into the C{Forward}::
        fwdExpr << (a | b | c)
    Converting to use the '<<=' operator instead will avoid this problem.

    See L{ParseResults.pprint} for an example of a recursive parser created using
    C{Forward}.
    Ncstt|j|dddSr)rrrrJrryrzr@rLzForward.__init__cCsjt|tr
t|}||_d|_|jj|_|jj|_||jj	|jj
|_
|jj|_|j
|jj|Sr)r}rr&rrrrrryrrrrr9rJryryrz
__lshift__Cs





zForward.__lshift__cCs||>SrryrJryryrz__ilshift__PrzForward.__ilshift__cCrur#rvrryryrzrwSszForward.leaveWhitespacecCs$|jsd|_|jdur|j|Sr)rrr=rryryrzr=Ws


zForward.streamlinecCs>||vr|dd|g}|jdur|j||gdSrrlrmryryrzr^s

zForward.validatecCst|dr|jS|jjdS)Nrz: ...)rrrrZ_revertClass_ForwardNoRecurserr)r	retStringryryrzres
zForward.__str__cs*|jdurtt|St}||K}|Sr)rrrrr\rryrzrvs

zForward.copyr)
rrrrrrrrwr=rrrrryryrrzr-s
rc@r)rcCr)Nrryrryryrzrrz_ForwardNoRecurse.__str__N)rrrrryryryrzr~r rcs"eZdZdZdfdd	ZZS)r/zQ
    Abstract subclass of C{ParseExpression}, for converting parsed results.
    Fcrnr#)rr/rrrkrryrzrrpzTokenConverter.__init__rrryryrrzr/sr/cs6eZdZdZd
fdd	ZfddZdd	ZZS)ra
    Converter to concatenate all matching tokens to a single string.
    By default, the matching patterns must also be contiguous in the input string;
    this can be disabled by specifying C{'adjacent=False'} in the constructor.

    Example::
        real = Word(nums) + '.' + Word(nums)
        print(real.parseString('3.1416')) # -> ['3', '.', '1416']
        # will also erroneously match the following
        print(real.parseString('3. 1416')) # -> ['3', '.', '1416']

        real = Combine(Word(nums) + '.' + Word(nums))
        print(real.parseString('3.1416')) # -> ['3.1416']
        # no match when there are internal spaces
        print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...)
    rTcs8tt|||r|||_d|_||_d|_dSr)rrrrwadjacentr
joinStringr)rrrrrryrzrs
zCombine.__init__cs*|jrt|||Stt|||Sr)rr&r{rrrJrryrzr{s
zCombine.ignorecCsL|}|dd=|td||jg|jd7}|jr$|r$|gS|S)Nr)r)rr$rrQrrrr,)rrrrretToksryryrzrs
"zCombine.postParse)rT)rrrrrr{rrryryrrzrs

rc(eZdZdZfddZddZZS)ra
    Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions.

    Example::
        ident = Word(alphas)
        num = Word(nums)
        term = ident | num
        func = ident + Optional(delimitedList(term))
        print(func.parseString("fn a,b,100"))  # -> ['fn', 'a', 'b', '100']

        func = ident + Group(Optional(delimitedList(term)))
        print(func.parseString("fn a,b,100"))  # -> ['fn', ['a', 'b', '100']]
    crnr)rrrrrorryrzrrpzGroup.__init__cCs|gSrryrryryrzrrzGroup.postParserrrrrrrryryrrzrs
rcr)r
aW
    Converter to return a repetitive expression as a list, but also as a dictionary.
    Each element can also be referenced using the first token in the expression as its key.
    Useful for tabular report scraping when the first column can be used as a item key.

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        # print attributes as plain groups
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names
        result = Dict(OneOrMore(Group(attr_expr))).parseString(text)
        print(result.dump())
        
        # access named fields as dict entries, or output as dict
        print(result['shape'])        
        print(result.asDict())
    prints::
        ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap']

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'}
    See more examples at L{ParseResults} of accessing fields by results name.
    crnr)rr
rrrorryrzrrpz
Dict.__init__cCst|D]h\}}t|dkrq|d}t|tr t|d}t|dkr.td|||<qt|dkrEt|dtsEt|d|||<q|}|d=t|dks[t|trc|	rct||||<qt|d|||<q|j
rs|gS|S)Nrrrrs)rrr}rvrrrr$rr,r)rrrrrtokikey	dictvalueryryrzrs$
zDict.postParserryryrrzr
s#r
c@r)r-aV
    Converter for ignoring the results of a parsed expression.

    Example::
        source = "a, b, c,d"
        wd = Word(alphas)
        wd_list1 = wd + ZeroOrMore(',' + wd)
        print(wd_list1.parseString(source))

        # often, delimiters that are useful during parsing are just in the
        # way afterward - use Suppress to keep them out of the parsed output
        wd_list2 = wd + ZeroOrMore(Suppress(',') + wd)
        print(wd_list2.parseString(source))
    prints::
        ['a', ',', 'b', ',', 'c', ',', 'd']
        ['a', 'b', 'c', 'd']
    (See also L{delimitedList}.)
    cCsgSrryrryryrzrrzSuppress.postParsecCs|Srryrryryrzrt"rzSuppress.suppressN)rrrrrrtryryryrzr-sr-c@s(eZdZdZddZddZddZdS)	rzI
    Wrapper for parse actions, to ensure they are only called once.
    cCst||_d|_dSr#)rcallablecalled)r
methodCallryryrzr*s

zOnlyOnce.__init__cCs*|js||||}d|_|St||d)NTr)rrr!)rrrrxrryryrzrs-s
zOnlyOnce.__call__cCs
d|_dSr#)rrryryrzreset3rzOnlyOnce.resetN)rrrrrrsrryryryrzr&s
rcs8tfdd}zj|_W|StyY|Sw)at
    Decorator for debugging parse actions. 
    
    When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
    When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised.

    Example::
        wd = Word(alphas)

        @traceParseAction
        def remove_duplicate_chars(tokens):
            return ''.join(sorted(set(''.join(tokens))))

        wds = OneOrMore(wd).setParseAction(remove_duplicate_chars)
        print(wds.parseString("slkdjs sld sldd sdlf sdljf"))
    prints::
        >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {}))
        <>entering %s(line: '%s', %d, %r)
z<.z)rrr)rrryrrzrd6s
rd,FcCs\t|dt|dt|d}|r!t|t|||S|tt|||S)a
    Helper to define a delimited list of expressions - the delimiter defaults to ','.
    By default, the list elements and delimiters can have intervening whitespace, and
    comments, but this can be overridden by passing C{combine=True} in the constructor.
    If C{combine} is set to C{True}, the matching tokens are returned as a single token
    string, with the delimiters included; otherwise, the matching tokens are returned
    as a list of tokens, with the delimiters suppressed.

    Example::
        delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc']
        delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    z [rr)rrr4rr-)rdelimcombinedlNameryryrzrBbs$
rBcsjtfdd}|durttdd}n|}|d|j|dd|d	td
S)a:
    Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
        integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    
    If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value.

    Example::
        countedArray(Word(alphas)).parseString('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2))
        countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef')  # -> ['ab', 'cd']
    cs.|d}|rttg|ptt>gSr)rrrE)rrrxrb	arrayExprrryrzcountFieldParseActions"z+countedArray..countFieldParseActionNcSst|dSr)rvrwryryrzr{zcountedArray..arrayLenTrz(len) r)rr1rTrrrrr)rintExprrryrrzr>us
r>cCs6g}|D]}t|tr|t|q||q|Sr)r}rr9rMr6)LrrryryrzrMs
rMcs6tfdd}|j|dddt|S)a*
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousLiteral(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches a
    previous literal, will also match the leading C{"1:1"} in C{"1:10"}.
    If this is not desired, use C{matchPreviousExpr}.
    Do I{not} use with packrat parsing enabled.
    csT|r#t|dkr|d>dSt|}tdd|D>dSt>dS)Nrrcsr>r)rrttryryrzrr zDmatchPreviousLiteral..copyTokenToRepeater..)rrMrrr)rrrxtflatrepryrzcopyTokenToRepeatersz1matchPreviousLiteral..copyTokenToRepeaterTr(prev) )rrrr)rrryrrzrQs


rQcsFt|}|Kfdd}|j|dddt|S)aS
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousExpr(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches by
    expressions, will I{not} match the leading C{"1:1"} in C{"1:10"};
    the expressions are evaluated first, and then compared, so
    C{"1"} is compared with C{"10"}.
    Do I{not} use with packrat parsing enabled.
    cs*t|fdd}j|dddS)Ncs$t|}|krtddddS)Nrr)rMrr!)rrrxtheseTokensmatchTokensryrzmustMatchTheseTokensszLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensTr)rMrr)rrrxrrrrzrsz.matchPreviousExpr..copyTokenToRepeaterTrr)rrrrr)re2rryrrzrPsrPcCs:dD]
}||t|}q|dd}|dd}t|S)Nz\^-]r]rrr	)r_bslashr)rrryryrzrs
rTc
s|r
dd}dd}tn
dd}dd}tg}t|tr#|}nt|tr-t|}ntjdt	dd|s:t
Sd	}|t|d
kr||}t||d
dD](\}}	||	|rd|||d
=n|||	rz|||d
=|
||	|	}nqR|d
7}|t|d
ksD|s|rz3t|td|krtd
ddd|Dd|WStddd|Dd|WStytjdt	ddYnwtfdd|Dd|S)a
    Helper to quickly define a set of alternative Literals, and makes sure to do
    longest-first testing when there is a conflict, regardless of the input order,
    but returns a C{L{MatchFirst}} for best performance.

    Parameters:
     - strs - a string of space-delimited literals, or a collection of string literals
     - caseless - (default=C{False}) - treat all literals as caseless
     - useRegex - (default=C{True}) - as an optimization, will generate a Regex
          object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or
          if creating a C{Regex} raises an exception)

    Example::
        comp_oper = oneOf("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.searchString("B = 12  AA=23 B<=AA AA>12"))
    prints::
        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    cSs||kSr)rr@bryryrzr{zoneOf..cSs||Sr)rrrryryrzr{scSrrryrryryrzr{rcSs
||Sr)rrryryrzr{rz6Invalid argument to oneOf, expected string or iterablersrWrrNrz[%s]csr>r)rrsymryryrzrr zoneOf..rQ|css|]}t|VqdSr)rrrryryrzrrvz7Exception creating Regex for oneOf, building MatchFirstc3|]}|VqdSrryrparseElementClassryrzr$r )r
rr}rrrrrYrZr[rrrr4rr)rrr)
strsruseRegexisequalmaskssymbolsrcurrr>ryrrzrUsV





*&
"rUcCsttt||S)a
    Helper to easily and clearly define a dictionary by specifying the respective patterns
    for the key and value.  Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
    in the proper order.  The key pattern can include delimiting markers or punctuation,
    as long as they are suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the C{Dict} results can include named token
    fields.

    Example::
        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)

        # similar to Dict, but simpler call format
        result = dictOf(attr_label, attr_value).parseString(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.asDict())
    prints::
        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    )r
r4r)r2r
ryryrzrC&s!rCcCs^tdd}|}d|_|d||d}|r dd}ndd}|||j|_|S)	a
    Helper to return the original, untokenized text for a given expression.  Useful to
    restore the parsed fields of an HTML start tag into the raw tag text itself, or to
    revert separate tokens with intervening whitespace back to the original matching
    input text. By default, returns astring containing the original parsed text.  
       
    If the optional C{asString} argument is passed as C{False}, then the return value is a 
    C{L{ParseResults}} containing any results names that were originally matched, and a 
    single token containing the original matched text from the input string.  So if 
    the expression passed to C{L{originalTextFor}} contains expressions with defined
    results names, you must set C{asString} to C{False} if you want to preserve those
    results name values.

    Example::
        src = "this is test  bold text  normal text "
        for tag in ("b","i"):
            opener,closer = makeHTMLTags(tag)
            patt = originalTextFor(opener + SkipTo(closer) + closer)
            print(patt.searchString(src)[0])
    prints::
        [' bold text ']
        ['text']
    cS|Srry)rrrxryryrzr{az!originalTextFor..F_original_start
_original_endcSs||j|jSr)rrrryryrzr{frcSs&||d|dg|dd<dS)Nrr)r1rryryrzextractTexths&z$originalTextFor..extractText)rrrrr)rasString	locMarkerendlocMarker	matchExprrryryrzriIs

ricCst|ddS)zp
    Helper to undo pyparsing's default grouping of And expressions, even
    if all but one are non-empty.
    cSs|dSrryrwryryrzr{srzungroup..)r/r)rryryrzrjnsrjcCs4tdd}t|d|d|dS)a
    Helper to decorate a returned token with its starting and ending locations in the input string.
    This helper adds the following results names:
     - locn_start = location where matched expression begins
     - locn_end = location where matched expression ends
     - value = the actual parsed results

    Be careful if the input text contains C{} characters, you may want to call
    C{L{ParserElement.parseWithTabs}}

    Example::
        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)
    prints::
        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSrrryrryryrzr{rzlocatedExpr..
locn_startr
locn_end)rrrrrw)rlocatorryryrzrlus$rlrErKrJrcrbz\[]-*.$+^?()~ rcCs|ddSrryrryryrzr{rr{z\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0x)unichrrvlstriprryryrzr{z	\\0[0-7]+cCstt|ddddS)Nrr)rrvrryryrzr{sz\]r/rMrnegatebodyrPcs@ddzdfddt|jDWStyYdSw)a
    Helper to easily define string ranges for use in Word construction.  Borrows
    syntax from regexp '[]' string range definitions::
        srange("[0-9]")   -> "0123456789"
        srange("[a-z]")   -> "abcdefghijklmnopqrstuvwxyz"
        srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
    The input string must be enclosed in []'s, and the returned string is the expanded
    character set joined into a single string.
    The values enclosed in the []'s may be:
     - a single character
     - an escaped character with a leading backslash (such as C{\-} or C{\]})
     - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) 
         (C{\0x##} is also supported for backwards compatibility) 
     - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
     - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
     - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
    cSs<t|ts|Sdddtt|dt|ddDS)Nrcsr>r)rrryryrzrr z+srange....rr)r}r$rrord)pryryrzr{s<zsrange..rc3rrry)rpart	_expandedryrzrr zsrange..)r_reBracketExprrBrrrryrrzras"racfdd}|S)zt
    Helper method for defining parse actions that require matching at a specific
    column in the input text.
    cs"t||krt||ddS)Nzmatched token not at column %dr)rlocnrraryrz	verifyColsz!matchOnlyAtCol..verifyColry)rbrryrarzrOsrOcsfddS)a
    Helper method for common parse actions that simply return a literal value.  Especially
    useful when used with C{L{transformString}()}.

    Example::
        num = Word(nums).setParseAction(lambda toks: int(toks[0]))
        na = oneOf("N/A NA").setParseAction(replaceWith(math.nan))
        term = na | num
        
        OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234]
    csgSrryrreplStrryrzr{szreplaceWith..ryrryrrzr^sr^cCs|dddS)a
    Helper parse action for removing quotation marks from parsed quoted strings.

    Example::
        # by default, quotation marks are included in parsed results
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]

        # use removeQuotes to strip quotation marks from parsed results
        quotedString.setParseAction(removeQuotes)
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
    rrrtryrryryrzr\r8r\csLfdd}ztdtdj}Wn
ty t}Ynw||_|S)aG
    Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional 
    args are passed, they are forwarded to the given function as additional arguments after
    the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
    parsed data to an integer using base 16.

    Example (compare the last to example in L{ParserElement.transformString}::
        hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16))
        hex_ints.runTests('''
            00 11 22 aa FF 0a 0d 1a
            ''')
        
        upperword = Word(alphas).setParseAction(tokenMap(str.upper))
        OneOrMore(upperword).runTests('''
            my kingdom for a horse
            ''')

        wd = Word(alphas).setParseAction(tokenMap(str.title))
        OneOrMore(wd).setParseAction(' '.join).runTests('''
            now is the winter of our discontent made glorious summer by this sun of york
            ''')
    prints::
        00 11 22 aa FF 0a 0d 1a
        [0, 17, 34, 170, 255, 10, 13, 26]

        my kingdom for a horse
        ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE']

        now is the winter of our discontent made glorious summer by this sun of york
        ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York']
    csfdd|DS)Ncsg|]
}|gRqSryry)rtoknrrryrzrrUz(tokenMap..pa..ryrrryrzrrztokenMap..parr)rrrr)rrrrryrrzros 
rocCt|Srrrrwryryrzr{rcCrrrlowerrwryryrzr{rc	Cst|tr|}t||d}n|j}tttd}|rLt	t
}td|dtt
t|td|tddgdd		d
dtd}nCd
ddtD}t	t
t|B}td|dtt
t|	tttd|tddgdd		ddtd}ttd|d}|dd
|ddd|}|dd
|ddd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag namerz_-:ratag=/Fr-rEcS|ddkSNrrryrryryrzr{rz_makeTags..rbrcss|]	}|dvr|VqdS)rbNryrryryrzrrz_makeTags..cSrrryrryryrzr{rrcr:rz<%s>rz)r}rrrr1r6r5r@rrr\r-r
r4rrrrrXr[rDr_Lrtitlerrr)tagStrxmlresnametagAttrNametagAttrValueopenTagZprintablesLessRAbrackcloseTagryryrz	_makeTagss>
..rcC
t|dS)a 
    Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches
    tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.

    Example::
        text = 'More info at the pyparsing wiki page'
        # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple
        a,a_end = makeHTMLTags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end
        
        for link in link_expr.searchString(text):
            # attributes in the  tag (like "href" shown here) are also accessible as named results
            print(link.link_text, '->', link.href)
    prints::
        pyparsing -> http://pyparsing.wikispaces.com
    FrrryryrzrM(s
rMcCr)z
    Helper to construct opening and closing tag expressions for XML, given a tag name. Matches
    tags only in the given upper/lower case.

    Example: similar to L{makeHTMLTags}
    TrrryryrzrN;s
rNcs8|r	|ddn|ddDfdd}|S)a<
    Helper to create a validating parse action to be used with start tags created
    with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
    with a required attribute value, to avoid false matches on common tags such as
    C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSryryrXryryrzrzrz!withAttribute..csZD](\}}||vrt||d||tjkr*|||kr*t||d||||fqdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r!rg ANY_VALUE)rrrattrName attrValueattrsryrzr{s  zwithAttribute..pa)r)rattrDictrryrrzrgDs 2 rgcCs"|rd|nd}tdi||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclassNry)rg) classname namespace classattrryryrzrms rm(rcCst}||||B}t|D]-\}}|ddd\}} } } | dkr(d|nd|} | dkrB|dus:t|dkr>td|\} }t| }| tjkr| d kr`t||t|t |}n| dkr|dur{t|||t|t ||}nt||t|t |}n| dkrt|| |||t|| |||}nutd | tj kr| d krt |t st |}t|j |t||}nP| dkr|durt|||t|t ||}n5t||t|t |}n&| dkrt|| |||t|| |||}ntd td | r2t | ttfr-|j| n|| ||| |BK}|}q||K}|S) aD Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or binary, left- or right-associative. Parse actions can also be attached to operator expressions. The generated parser will also recognize the use of parentheses to override operator precedences (see example below). Note: if you define a deep operator list, you may see performance issues when using infixNotation. See L{ParserElement.enablePackrat} for a mechanism to potentially improve your parser performance. Parameters: - baseExpr - expression representing the most basic element for the nested - opList - list of tuples, one for each operator precedence level in the expression grammar; each tuple is of the form (opExpr, numTerms, rightLeftAssoc, parseAction), where: - opExpr is the pyparsing expression for the operator; may also be a string, which will be converted to a Literal; if numTerms is 3, opExpr is a tuple of two expressions, for the two operators separating the 3 terms - numTerms is the number of terms for this operator (must be 1, 2, or 3) - rightLeftAssoc is the indicator whether the operator is right or left associative, using the pyparsing-defined constants C{opAssoc.RIGHT} and C{opAssoc.LEFT}. - parseAction is the parse action to be associated with expressions matching this operator expression (the parse action tuple member may be omitted); if the parse action is passed a tuple or list of functions, this is equivalent to calling C{setParseAction(*fn)} (L{ParserElement.setParseAction}) - lpar - expression for matching left-parentheses (default=C{Suppress('(')}) - rpar - expression for matching right-parentheses (default=C{Suppress(')')}) Example:: # simple example of four-function arithmetic with ints and variable names integer = pyparsing_common.signed_integer varname = pyparsing_common.identifier arith_expr = infixNotation(integer | varname, [ ('-', 1, opAssoc.RIGHT), (oneOf('* /'), 2, opAssoc.LEFT), (oneOf('+ -'), 2, opAssoc.LEFT), ]) arith_expr.runTests(''' 5+3*6 (5+3)*6 -2--11 ''', fullDump=False) prints:: 5+3*6 [[5, '+', [3, '*', 6]]] (5+3)*6 [[[5, '+', 3], '*', 6]] -2--11 [[['-', 2], '-', ['-', 11]]] rNrrqz%s termz %s%s termrsz@if numterms=3, opExpr must be a tuple or list of two expressionsrz6operator must be unary (1), binary (2), or ternary (3)z2operator must indicate right or left associativity)rrrrfrrVLEFTrrrRIGHTr}rrrerr)baseExpropListlparrparrlastExprroperDefopExprarityrightLeftAssocrtermNameopExpr1opExpr2thisExprrryryrzrksZ=  &  &   rkz4"(?:[^"\n\r\\]|(?:"")|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*"z string enclosed in double quotesz4'(?:[^'\n\r\\]|(?:'')|(?:\\(?:[^x]|x[0-9a-fA-F]+)))*'z string enclosed in single quotesz*quotedString using single or double quotesuzunicode string literalcCs||krtd|durt|trt|trt|dkrQt|dkrQ|dur>tt|t||tjdd dd}nTt t||tj dd}nA|durstt|t |t |ttjdd dd}nttt |t |ttjdd d d}ntd t }|dur|tt|t||B|Bt|K}n|tt|t||Bt|K}|d ||f|S) a~ Helper method for defining nested lists enclosed in opening and closing delimiters ("(" and ")" are the default). Parameters: - opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression - closer - closing character for a nested list (default=C{")"}); can also be a pyparsing expression - content - expression for items within the nested lists (default=C{None}) - ignoreExpr - expression for ignoring opening and closing delimiters (default=C{quotedString}) If an expression is not provided for the content argument, the nested expression will capture all whitespace-delimited content between delimiters as a list of separate values. Use the C{ignoreExpr} argument to define expressions that may contain opening or closing characters that should not be treated as opening or closing characters for nesting, such as quotedString or a comment expression. Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}. The default is L{quotedString}, but if no expressions are to be ignored, then pass C{None} for this argument. Example:: data_type = oneOf("void int short long char float double") decl_data_type = Combine(data_type + Optional(Word('*'))) ident = Word(alphas+'_', alphanums+'_') number = pyparsing_common.number arg = Group(decl_data_type + ident) LPAR,RPAR = map(Suppress, "()") code_body = nestedExpr('{', '}', ignoreExpr=(quotedString | cStyleComment)) c_function = (decl_data_type("type") + ident("name") + LPAR + Optional(delimitedList(arg), [])("args") + RPAR + code_body("body")) c_function.ignore(cStyleComment) source_code = ''' int is_odd(int x) { return (x%2); } int dec_to_hex(char hchar) { if (hchar >= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNrrcS |dSrrrwryryrzr{grznestedExpr..cSr!rr"rwryryrzr{jrcSr!rr"rwryryrzr{prcSr!rr"rwryryrzr{trzOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rfr}rrr rr r&rrrErrrrr-r4r)openerclosercontentrrryryrzrR%sH:      *$rRc sfdd}fdd}fdd}ttd}tt|d}t|d }t|d } |rStt||t|t|t|| } ntt|t|t|t|} | t t| d S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkr%|dkrt||dt||ddS)Nrtzillegal nestingznot a peer entry)rr;r#r!rrrxcurCol indentStackryrzcheckPeerIndents     z&indentedBlock..checkPeerIndentcs0t||}|dkr|dSt||d)Nrtznot a subentry)r;r6r!r&r(ryrzcheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}r|dkr|dks!t||ddS)Nrtrznot an unindent)rr;r!r1r&r(ryrz checkUnindents    z$indentedBlock..checkUnindentz INDENTrUNINDENTzindented block) rrryrtrrrrrr{r) blockStatementExprr)rgr*r+r,r|r-PEERUNDENTsmExprryr(rzrhs( N   rhz#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prz);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprentityrwryryrzr]r'r]z/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style commentr commaItemrr<c@seZdZdZeeZ eeZ e e  d eZ e e d eedZ ed d eZ e ede e dZ ed d eeeed eB d Z eeed  d eZ ed d eZ eeBeBZ ed d eZ e eded dZ ed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z' ed# d$Z( e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z, ed- d.Z- ed/ d0Z. e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Z< e)ed:d Z= e)ed;d Z>d}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrtryrwryryrzr{rzpyparsing_common.r/z"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberrK identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 address)rrz::zshort IPv6 addresscCstdd|DdkS)Ncss |] }tj|rdVqdSr^)rp _ipv6_partrHrryryrzrrYz,pyparsing_common...r)r_rwryryrzr{rOz::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcr)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c s@z t|dWSty}zt||t|d}~wwr)rstrptimedaterfr!rrrrxvefmtryrzcvt_fns z.pyparsing_common.convertToDate..cvt_fnryrDrEryrCrz convertToDate zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcr)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c s<z t|dWSty}zt||t|d}~wwr)rr?rfr!rrArCryrzrEs z2pyparsing_common.convertToDatetime..cvt_fnryrFryrCrzconvertToDatetimerHz"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rp_html_stripperr)rrrryryrz stripHTMLTagss zpyparsing_common.stripHTMLTagsrrr5r6rrzcomma separated listcCrrrrwryryrzr{"rcCrrrrwryryrzr{%rN)r>)rI)?rrrrrorvconvertToIntegerfloatconvertToFloatr1rTrrr7rFr;r)signed_integerr8rrrt mixed_integerr_realsci_realr=numberr9r6r5r: ipv4_addressr=_full_ipv6_address_short_ipv6_addressr_mixed_ipv6_addressr ipv6_address mac_addressrrGrJ iso8601_dateiso8601_datetimeuuidr9r8rLrMrrrrXr0 _commasepitemrBr[rcomma_separated_listrfrDryryryrzrps"" 2      rp__main__selectfromrr)rcolumnsrZtablescommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rs)rFr)FTrr)r __version____versionTime__ __author__rweakrefrrrrrYrrr/r}rrr_threadr ImportError threadingcollections.abcrrrr)Z ordereddict__all__re version_inforrZmaxsizerrrchrrrr_rrwreversedrrryr'rrrZmaxintxranger __builtin__rfnamer6rrrrrrrascii_uppercaseascii_lowercaser6rTrFr5rr printablerXrrr!r#r%r(rr$registerr;rLrIrrrrSrr&r.rrrrrrr r rnr1r)r'r r0rrrrr,r+r3r2r"rrrrr rrrtrr4rrrr*rrr/r rr r-rrdrBr>rMrQrPrrUrCrirjrlrrErKrJrcrbr _escapedPunc_escapedHexChar_escapedOctChar _singleChar _charRangerrrarOr^r\rorfrDrrMrNrgrrmrVrrrkrWr@r`r[rerRrhr7rYr9r8rrr3r&r=r]r:rGrwr_rAr?rHrZr=r_r<rprZ selectTokenZ fromTokenidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLrrUr9r;r^rKryryryrzs4            8      @v &A= I G3pLOD|M &#@sQ,A ,   I #%     0  ,  ? #p   Zr   "    "   PK!wA,_vendor/__pycache__/__init__.cpython-310.pycnu[o Xai@sdS)Nrrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/__init__.pysPK!.ѱ22:_vendor/packaging/__pycache__/requirements.cpython-310.pycnu[o Xai5@sddlmZmZmZddlZddlZddlmZmZm Z m Z ddlm Z m Z m Z mZmZddlmZddlmZddlmZdd lmZmZdd lmZmZmZerXdd lmZGd d d e Z!e ej"ej#Z$ed%Z&ed%Z'ed%Z(ed%Z)ed%Z*ed%Z+ed%Z,e dZ-e$e e-e$BZ.ee$e e.Z/e/dZ0e/Z1eddZ2e,e2Z3e1e e*e1Z4e&e e4e'dZ5eej6ej7ej8BZ9eej6ej7ej8BZ:e9e:AZ;ee;e e*e;ddddZdde e=dZ?e?>d de ed!Ze>d"de+Z@e@eZAe?e eAZBe3e eAZCe0e e5eCeBBZDeeDeZEeEFd#Gd$d%d%eGZHdS)&)absolute_importdivisionprint_functionN) stringStart stringEndoriginalTextForParseException) ZeroOrMoreWordOptionalRegexCombine)Literal)parse) TYPE_CHECKING) MARKER_EXPRMarker)LegacySpecifier Specifier SpecifierSet)Listc@seZdZdZdS)InvalidRequirementzJ An invalid requirement was found, users should refer to PEP 508. N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF) joinStringadjacent _raw_speccCs |jpdS)N)r+sltrrr;s r1 specifiercCs|dS)Nrrr-rrrr1>smarkercCst||j|jS)N)r_original_start _original_endr-rrrr1Bszx[]c@s(eZdZdZddZddZddZdS) RequirementzParse a requirement. Parse a given requirement string into its parts, such as name, specifier, URL, and extras. Raises InvalidRequirement on a badly-formed requirement string. c Cszt|}Wnty$}ztd||j|jd|jd}~ww|j|_|jr]t |j}|j dkrDt ||jkrCtdn|j rP|j rP|j sX|j sXtd|j|j|_nd|_t |jri|jng|_t|j|_|jr||j|_dSd|_dS)NzParse error at "{0!r}": {1}filezInvalid URL givenzInvalid URL: {0}) REQUIREMENT parseStringrrformatlocmsgr&r'urlparsescheme urlunparsenetlocsetr(asListrr2r3)selfrequirement_stringreqe parsed_urlrrr__init___s8     zRequirement.__init__cCs|jg}|jr|ddt|j|jr |t|j|jr4|d|j|j r4|d|j r@|d|j d|S)Nz[{0}]r#z@ {0} z; {0}r,) r&r(appendr;joinsortedr2strr'r3)rDpartsrrr__str__{s  zRequirement.__str__cCsdt|S)Nz)r;rN)rDrrr__repr__szRequirement.__repr__N)rrrrrIrPrQrrrrr6Rs   r6)I __future__rrrstringreZsetuptools.extern.pyparsingrrrrr r r r r rLurllibrr>Z_typingrmarkersrr specifiersrrrtypingr ValueErrorr ascii_lettersdigitsALPHANUMsuppressLBRACKETRBRACKETLPARENRPARENCOMMA SEMICOLONAT PUNCTUATIONIDENTIFIER_END IDENTIFIERNAMEEXTRAURIURL EXTRAS_LISTEXTRAS _regex_strVERBOSE IGNORECASEVERSION_PEP440VERSION_LEGACY VERSION_ONE VERSION_MANY _VERSION_SPECsetParseAction VERSION_SPECMARKER_SEPARATORMARKERVERSION_AND_MARKERURL_AND_MARKERNAMED_REQUIREMENTr9r:objectr6rrrrsl                 PK!}S3_vendor/packaging/__pycache__/utils.cpython-310.pycnu[o Xai@sxddlmZmZmZddlZddlmZmZddlm Z m Z er-ddl m Z m Z e deZedZd d Zd d ZdS) )absolute_importdivisionprint_functionN) TYPE_CHECKINGcast)InvalidVersionVersion)NewTypeUnionNormalizedNamez[-_.]+cCstd|}td|S)N-r )_canonicalize_regexsublowerr)namevaluer/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/utils.pycanonicalize_names rc Cszt|}Wn ty|YSwg}|jdkr"|d|j|tddddd|jD|j durH|dd d|j D|j durV|d |j |j durd|d |j |j durr|d |j d|S) z This is very similar to Version.__str__, but has one subtle difference with the way it handles the release segment. rz{0}!z(\.0)+$.cs|]}t|VqdSNstr.0xrrr /z'canonicalize_version..Ncsrrrrrrrr3r z.post{0}z.dev{0}z+{0}) r repochappendformatrerjoinreleaseprepostdevlocal)_versionversionpartsrrrcanonicalize_versions$   &     r.) __future__rrrr$Z_typingrrr,rr typingr r rr compilerrr.rrrrs   PK!V8#PP8_vendor/packaging/__pycache__/specifiers.cpython-310.pycnu[o Xai|@sXddlmZmZmZddlZddlZddlZddlZddlm Z m Z ddl m Z ddl mZddlmZmZmZe reddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeege fZ!Gd d d e"Z#Gd d d e ej$e%Z&Gd dde&Z'Gddde'Z(ddZ)Gddde'Z*e+dZ,ddZ-ddZ.Gddde&Z/dS))absolute_importdivisionprint_functionN) string_typeswith_metaclass) TYPE_CHECKING)canonicalize_version)Version LegacyVersionparse) ListDictUnionIterableIteratorOptionalCallableTuple FrozenSetc@seZdZdZdS)InvalidSpecifierzH An invalid specifier was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/specifiers.pyr"src@seZdZejddZejddZejddZejddZej d d Z e j d d Z ejdd dZ ejdddZ d S) BaseSpecifiercCdS)z Returns the str representation of this Specifier like object. This should be representative of the Specifier itself. Nrselfrrr__str__)zBaseSpecifier.__str__cCr)zF Returns a hash value for this Specifier like object. Nrrrrr__hash__1r"zBaseSpecifier.__hash__cCr)zq Returns a boolean representing whether or not the two Specifier like objects are equal. Nrr otherrrr__eq__8r"zBaseSpecifier.__eq__cCr)zu Returns a boolean representing whether or not the two Specifier like objects are not equal. Nrr$rrr__ne__@r"zBaseSpecifier.__ne__cCr)zg Returns whether or not pre-releases as a whole are allowed by this specifier. Nrrrrr prereleasesHr"zBaseSpecifier.prereleasescCr)zd Sets whether or not pre-releases as a whole are allowed by this specifier. Nrr valuerrrr(Pr"NcCr)zR Determines if the given item is contained within this specifier. Nrr itemr(rrrcontainsXr"zBaseSpecifier.containscCr)z Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. Nr)r iterabler(rrrfilter_r"zBaseSpecifier.filterN)rrrabcabstractmethodr!r#r&r'abstractpropertyr(setterr-r/rrrrr(s"       rc@seZdZiZd"ddZddZddZed d Zd d Z d dZ ddZ ddZ ddZ eddZeddZeddZejddZddZd#ddZd#d d!ZdS)$_IndividualSpecifierNcCsF|j|}|std||d|df|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec _prereleases)r specr(matchrrr__init__ls    z_IndividualSpecifier.__init__cCs0|jdur d|jnd}d|jjt||S)N, prereleases={0!r}r6z<{0}({1!r}{2})>)r?r;r( __class__rstrr prerrr__repr__zs  z_IndividualSpecifier.__repr__cCs dj|jS)Nz{0}{1})r;r>rrrrr!s z_IndividualSpecifier.__str__cCs|jdt|jdfS)Nrr)r>r rrrr_canonical_specsz$_IndividualSpecifier._canonical_speccC t|jSr0)hashrIrrrrr# z_IndividualSpecifier.__hash__cCsPt|trz |t|}WntytYSwt||js"tS|j|jkSr0) isinstancerrDrErNotImplementedrIr$rrrr&    z_IndividualSpecifier.__eq__cCsPt|trz |t|}WntytYSwt||js"tS|j|jkSr0)rMrrDrErrNr>r$rrrr'rOz_IndividualSpecifier.__ne__cCst|d|j|}|S)Nz _compare_{0})getattrr; _operators)r opoperator_callablerrr _get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfs t|}|Sr0)rMr r r r r8rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncC |jdS)Nrr>rrrrr7 z_IndividualSpecifier.operatorcCrW)NrrXrrrrr8rYz_IndividualSpecifier.versioncCs|jSr0r?rrrrr(sz _IndividualSpecifier.prereleasescC ||_dSr0rZr)rrrr(rYcC ||Sr0r-r r,rrr __contains__rLz!_IndividualSpecifier.__contains__cCs>|dur|j}||}|jr|sdS||j}|||jSNF)r(rV is_prereleaserTr7r8)r r,r(normalized_itemrSrrrr-s    z_IndividualSpecifier.containsccsd}g}d|dur |ndi}|D]#}||}|j|fi|r4|jr/|s/|js/||qd}|Vq|sA|rC|D] }|Vq;dSdSdS)NFr(T)rVr-rar(append)r r.r(yieldedfound_prereleaseskwr8parsed_versionrrrr/s*  z_IndividualSpecifier.filterr6Nr0)rrrrQrBrHr!propertyrIr#r&r'rTrVr7r8r(r4r_r-r/rrrrr5hs.          r5c@sveZdZdZededejejBZdddddd d Z d d Z d dZ ddZ ddZ ddZddZddZdS)LegacySpecifiera (?P(==|!=|<=|>=|<|>)) \s* (?P [^,;\s)]* # Since this is a "legacy" specifier, and the version # string can be just about anything, we match everything # except for whitespace, a semi-colon for marker support, # a closing paren since versions can be enclosed in # them, and a comma since it's a version separator. ) ^\s*\s*$equal not_equalless_than_equalgreater_than_equal less_than greater_than)==!=<=>=<>cCst|ts tt|}|Sr0)rMr rErUrrrrV s  zLegacySpecifier._coerce_versioncCs|||kSr0rVr prospectiver@rrr_compare_equal&zLegacySpecifier._compare_equalcCs|||kSr0ryrzrrr_compare_not_equal*r}z"LegacySpecifier._compare_not_equalcCs|||kSr0ryrzrrr_compare_less_than_equal.r}z(LegacySpecifier._compare_less_than_equalcCs|||kSr0ryrzrrr_compare_greater_than_equal2r}z+LegacySpecifier._compare_greater_than_equalcCs|||kSr0ryrzrrr_compare_less_than6r}z"LegacySpecifier._compare_less_thancCs|||kSr0ryrzrrr_compare_greater_than:r}z%LegacySpecifier._compare_greater_thanN)rrr _regex_strrecompileVERBOSE IGNORECASEr9rQrVr|r~rrrrrrrrrjs"   rjcstfdd}|S)Ncst|tsdS|||Sr`)rMr rzfnrrwrappedCs  z)_require_version_compare..wrapped) functoolswraps)rrrrr_require_version_compare?src @seZdZdZededejejBZdddddd d d d Z e d dZ e ddZ e ddZ e ddZe ddZe ddZe ddZddZeddZejddZd S)! Specifiera (?P(~=|==|!=|<=|>=|<|>|===)) (?P (?: # The identity operators allow for an escape hatch that will # do an exact string match of the version you wish to install. # This will not be parsed by PEP 440 and we cannot determine # any semantic meaning from it. This operator is discouraged # but included entirely as an escape hatch. (?<====) # Only match for the identity operator \s* [^\s]* # We just match everything, except for whitespace # since we are only testing for strict identity. ) | (?: # The (non)equality operators allow for wild card and local # versions to be specified so we have to define these two # operators separately to enable that. (?<===|!=) # Only match for equals and not equals \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release (?: # pre release [-_\.]? (a|b|c|rc|alpha|beta|pre|preview) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? # You cannot use a wild card and a dev or local version # together so group them with a | and make them optional. (?: (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local | \.\* # Wild card syntax of .* )? ) | (?: # The compatible operator requires at least two digits in the # release segment. (?<=~=) # Only match for the compatible operator \s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *) (?: # pre release [-_\.]? (a|b|c|rc|alpha|beta|pre|preview) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) | (?: # All other operators only allow a sub set of what the # (non)equality operators do. Specifically they do not allow # local versions to be specified nor do they allow the prefix # matching wild cards. (?sz/Specifier._compare_compatible...*rvrs)joinlist itertools takewhile_version_splitrT)r r{r@prefixrrr_compare_compatibles  zSpecifier._compare_compatiblec Csv|dr+t|j}t|dd}tt|}|dt|}t||\}}||kSt|}|js7t|j}||kS)Nr)endswithr publicrrElen _pad_versionlocal) r r{r@ split_specsplit_prospectiveshortened_prospective padded_specpadded_prospective spec_versionrrrr|s    zSpecifier._compare_equalcCs||| Sr0)r|rzrrrr~szSpecifier._compare_not_equalcCst|jt|kSr0r rrzrrrrz"Specifier._compare_less_than_equalcCst|jt|kSr0rrzrrrr rz%Specifier._compare_greater_than_equalcCs<t|}||ks dS|js|jrt|jt|jkrdSdSNFT)r ra base_versionr r{spec_strr@rrrrs zSpecifier._compare_less_thancCs^t|}||ks dS|js|jrt|jt|jkrdS|jdur-t|jt|jkr-dSdSr)r is_postreleaserrrrrrr1s  zSpecifier._compare_greater_thancCst|t|kSr0)rElowerrzrrr_compare_arbitraryRszSpecifier._compare_arbitrarycCsR|jdur|jS|j\}}|dvr'|dkr |dr |dd}t|jr'dSdS)N)rsrvrurrrsrrTF)r?r>rr ra)r r7r8rrrr(Vs    zSpecifier.prereleasescCr[r0rZr)rrrr(prYN)rrrrrrrrr9rQrrr|r~rrrrrrir(r4rrrrrMs>]  (       rz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCs@g}|dD]}t|}|r||q||q|S)Nr)split _prefix_regexr:extendgroupsrc)r8resultr,rArrrrys  rc Csgg}}|ttdd||ttdd|||t|dd||t|dd|ddgtdt|dt|d|ddgtdt|dt|dttj|ttj|fS)NcS|Sr0isdigitrrrrrz_pad_version..cSrr0rrrrrrrrr0)rcrrrrinsertmaxchain)leftright left_split right_splitrrrrs ,,rc@seZdZdddZddZddZd d Zd d Zd dZddZ ddZ ddZ e ddZ e jddZ ddZdddZ dddZdS) SpecifierSetr6Nc Csjdd|dD}t}|D]}z |t|Wqty*|t|Yqwt||_||_dS)NcSsg|] }|r|qSr)r=.0srrr sz)SpecifierSet.__init__..,) rsetaddrrrj frozenset_specsr?)r specifiersr(split_specifiersparsed specifierrrrrBs   zSpecifierSet.__init__cCs*|jdur d|jnd}dt||S)NrCr6z)r?r;r(rErFrrrrHs  zSpecifierSet.__repr__cCsdtdd|jDS)Nrcss|]}t|VqdSr0)rErrrr sz'SpecifierSet.__str__..)rsortedrrrrrr!szSpecifierSet.__str__cCrJr0)rKrrrrrr#rLzSpecifierSet.__hash__cCst|tr t|}nt|tstSt}t|j|jB|_|jdur-|jdur-|j|_|S|jdur=|jdur=|j|_|S|j|jkrI|j|_|Std)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rMrrrNrrr? ValueError)r r%rrrr__and__s$     zSpecifierSet.__and__cCs6t|ttfrtt|}nt|tstS|j|jkSr0rMrr5rrErNrr$rrrr&   zSpecifierSet.__eq__cCs6t|ttfrtt|}nt|tstS|j|jkSr0rr$rrrr'rzSpecifierSet.__ne__cCrJr0)rrrrrr__len__rLzSpecifierSet.__len__cCrJr0)iterrrrrr__iter__rLzSpecifierSet.__iter__cCs.|jdur|jS|js dStdd|jDS)Ncss|]}|jVqdSr0r(rrrrrsz+SpecifierSet.prereleases..)r?ranyrrrrr(s zSpecifierSet.prereleasescCr[r0rZr)rrrr(rYcCr\r0r]r^rrrr_ rLzSpecifierSet.__contains__csLtttfs tdur|jsjrdStfdd|jDS)NFc3s|] }|jdVqdS)rNr]rr,r(rrr*sz(SpecifierSet.contains..)rMr r r r(raallrr+rrrr-s zSpecifierSet.containscCs|dur|j}|jr|jD] }|j|t|d}q |Sg}g}|D](}t|ttfs/t|}n|}t|tr7q!|jrD|sD|sC| |q!| |q!|sT|rT|durT|S|S)Nr) r(rr/boolrMr r r rarc)r r.r(r@filteredrer,rgrrrr/,s,       zSpecifierSet.filterrhr0)rrrrBrHr!r#rr&r'rrrir(r4r_r-r/rrrrrs$       r)0 __future__rrrr1rrrZ_compatrrZ_typingrutilsr r8r r r typingr rrrrrrrr ParsedVersionrEUnparsedVersionrCallableOperatorrrABCMetaobjectrr5rjrrrrrrrrrrrs6  , @ 8 + PK!D$$5_vendor/packaging/__pycache__/markers.cpython-310.pycnu[o Xai%% @sddlmZmZmZddlZddlZddlZddlZddlm Z m Z m Z m Z ddlm Z mZmZmZddlmZddlmZddlmZdd lmZmZerhdd lmZmZmZmZmZm Z m!Z!ee"e"ge#fZ$gd Z%Gd d d e&Z'Gddde&Z(Gddde&Z)Gddde*Z+Gddde+Z,Gddde+Z-Gddde+Z.ededBedBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*Bed+BZ/d$d#dd ddd,Z0e/1d-d.ed/ed0Bed1Bed2Bed3Bed4Bed5Bed6BZ2e2ed7Bed8BZ3e31d9d.ed:ed;BZ4e41dBZ5e/e4BZ6ee6e3e6Z7e71d?d.ed@8Z9edA8Z:eZ;e7ee9e;e:BZe e;e Z=dBdCZ>dXdEdFZ?dGd.dHd.ej@ejAejBejCejDejEdIZFdJdKZGGdLdMdMe*ZHeHZIdNdOZJdPdQZKdRdSZLdTdUZMGdVdWdWe*ZNdS)Y)absolute_importdivisionprint_functionN)ParseException ParseResults stringStart stringEnd) ZeroOrMoreGroupForward QuotedString)Literal) string_types) TYPE_CHECKING) SpecifierInvalidSpecifier)AnyCallableDictListOptionalTupleUnion) InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@eZdZdZdS)rzE An invalid marker was found, users should refer to PEP 508. N__name__ __module__ __qualname____doc__r%r%/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/markers.pyr"rc@r)rzP An invalid operation was attempted on a value that doesn't support it. Nr r%r%r%r&r(r'rc@r)rz\ A name was attempted to be used that does not exist inside of the environment. Nr r%r%r%r&r.r'rc@s,eZdZddZddZddZddZd S) NodecCs ||_dSN)value)selfr*r%r%r&__init__6 z Node.__init__cC t|jSr))strr*r+r%r%r&__str__:r-z Node.__str__cCsd|jjt|S)Nz <{0}({1!r})>)format __class__r!r/r0r%r%r&__repr__>sz Node.__repr__cCstr))NotImplementedErrorr0r%r%r& serializeBszNode.serializeN)r!r"r#r,r1r4r6r%r%r%r&r(5s  r(c@eZdZddZdS)VariablecCt|Sr)r/r0r%r%r&r6HzVariable.serializeNr!r"r#r6r%r%r%r&r8G r8c@r7)ValuecCs d|S)Nz"{0}")r2r0r%r%r&r6Nr-zValue.serializeNr<r%r%r%r&r>Mr=r>c@r7)OpcCr9r)r:r0r%r%r&r6Tr;z Op.serializeNr<r%r%r%r&r?Sr=r?implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_version sys_platformos_nameos.name sys.platformplatform.versionplatform.machineplatform.python_implementationpython_implementationextra)rKrLrMrNrOrPcCstt|d|dSNr)r8ALIASESgetsltr%r%r&usrYz=====>=<=!=z~=><not inincC t|dSrR)r?rUr%r%r&rY| '"cCrbrR)r>rUr%r%r&rYrcandorcCrbrR)tuplerUr%r%r&rYrc()cCst|tr dd|DS|S)NcSsg|]}t|qSr%)_coerce_parse_result).0ir%r%r& z(_coerce_parse_result..) isinstancer)resultsr%r%r&rks rkTcCst|tttfs Jt|tr$t|dkr$t|dttfr$t|dSt|tr@dd|D}|r7d|Sdd|dSt|trOddd |DS|S) Nrrcss|] }t|ddVqdS)F)firstN)_format_markerrlmr%r%r& sz!_format_marker.. rirjcSsg|]}|qSr%)r6rtr%r%r&rnroz"_format_marker..)rplistrhrlenrsjoin)markerrrinnerr%r%r&rss     rscCs||vSr)r%lhsrhsr%r%r&rYcCs||vSr)r%r}r%r%r&rYr)rar`r_r\rZr]r[r^cCsjz td||g}Wn tyYnw||St|}|dur0td||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.) rrzr6rcontains _operatorsrTrr2)r~oprspecoperr%r%r&_eval_ops    rc@s eZdZdS) UndefinedN)r!r"r#r%r%r%r&rsrcCs(||t}t|trtd||S)Nz/{0!r} does not exist in evaluation environment.)rT _undefinedrprrr2) environmentnamer*r%r%r&_get_envs  rc Csgg}|D]Y}t|tttfsJt|tr!|dt||qt|trO|\}}}t|tr:t||j}|j}n |j}t||j}|dt |||q|dvsUJ|dkr^|gqt dd|DS)N)rfrgrgcss|]}t|VqdSr))all)rlitemr%r%r&rvsz$_evaluate_markers..) rprxrhrappend_evaluate_markersr8rr*rany) markersrgroupsr{r~rr lhs_value rhs_valuer%r%r&rs$        rcCs2d|}|j}|dkr||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r2 releaselevelr/serial)infoversionkindr%r%r&format_full_versions rcCsrttdrttjj}tjj}nd}d}||tjtt t tt t d tddtjd S)Nimplementation0r.) rBr@rJrFrDrGrErCrArHrI)hasattrsysrrrrosplatformmachinereleasesystemrHrPrzpython_version_tuple)iverrBr%r%r&r s"   rc@s.eZdZddZddZddZd dd ZdS) rc CsTz tt||_WdSty)}zd|||j|jd}t|d}~ww)Nz+Invalid marker: {0!r}, parse error at {1!r})rkMARKER parseString_markersrr2locr)r+r{eZerr_strr%r%r&r,(szMarker.__init__cCr.r))rsrr0r%r%r&r12r-zMarker.__str__cCsdt|S)Nz)r2r/r0r%r%r&r46szMarker.__repr__NcCs$t}|dur ||t|j|S)a$Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment. The environment is determined from the current Python process. N)rupdaterr)r+rcurrent_environmentr%r%r&evaluate:s   zMarker.evaluater))r!r"r#r,r1r4rr%r%r%r&r's  r)T)O __future__rrroperatorrrrZsetuptools.extern.pyparsingrrrrr r r r r LZ_compatrZ_typingr specifiersrrtypingrrrrrrrr/boolOperator__all__ ValueErrorrrrobjectr(r8r>r?VARIABLErSsetParseAction VERSION_CMP MARKER_OP MARKER_VALUEBOOLOP MARKER_VAR MARKER_ITEMsuppressLPARENRPAREN MARKER_EXPR MARKER_ATOMrrkrsltleeqnegegtrrrrrrrrrr%r%r%r&s   $      >       PK!,) 9_vendor/packaging/__pycache__/_structures.cpython-310.pycnu[o Xai@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@TeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS) InfinityTypecCdS)NInfinityselfr r /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/_structures.py__repr__zInfinityType.__repr__cC tt|SNhashreprr r r r __hash__  zInfinityType.__hash__cCrNFr r otherr r r __lt__rzInfinityType.__lt__cCrrr rr r r __le__rzInfinityType.__le__cC t||jSr isinstance __class__rr r r __eq__rzInfinityType.__eq__cCt||j Srrrr r r __ne__zInfinityType.__ne__cCrNTr rr r r __gt__ rzInfinityType.__gt__cCrr#r rr r r __ge__$rzInfinityType.__ge__cCtSr)NegativeInfinityr r r r __neg__(rzInfinityType.__neg__N __name__ __module__ __qualname__r rrrrr!r$r%r(r r r r r rc@r)NegativeInfinityTypecCr)Nz -Infinityr r r r r r 1rzNegativeInfinityType.__repr__cCrrrr r r r r5rzNegativeInfinityType.__hash__cCrr#r rr r r r9rzNegativeInfinityType.__lt__cCrr#r rr r r r=rzNegativeInfinityType.__le__cCrrrrr r r rArzNegativeInfinityType.__eq__cCr rrrr r r r!Er"zNegativeInfinityType.__ne__cCrrr rr r r r$IrzNegativeInfinityType.__gt__cCrrr rr r r r%MrzNegativeInfinityType.__ge__cCr&r)rr r r r r(QrzNegativeInfinityType.__neg__Nr)r r r r r.0r-r.N) __future__rrrobjectrrr.r'r r r r s & &PK!{u_7_vendor/packaging/__pycache__/__about__.cpython-310.pycnu[o Xai@sDddlmZmZmZgdZdZdZdZdZdZ dZ d Z d e Z d S) )absolute_importdivisionprint_function) __title__ __summary____uri__ __version__ __author__ __email__ __license__ __copyright__ packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz20.4z)Donald Stufft and individual contributorszdonald@stufft.iozBSD-2-Clause or Apache-2.0zCopyright 2014-2019 %sN) __future__rrr__all__rrrrr r r r rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/__about__.pys  PK!CC2_vendor/packaging/__pycache__/tags.cpython-310.pycnu[o Xai^@s^ddlmZddlZzddlmZWney)ddlZddeDZ[Ynwddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZmZer|ddlmZmZmZmZmZmZmZmZmZmZeeZ eeefZ!eeefZ"e #e$Z%d d d d d dZ&ej'dkZ(Gddde)Z*ddZ+ddZ,dSddZ-ddZ.ddZ/dSddZ0   dTdd Z1d!d"Z2   dTd#d$Z3d%d&Z4   dTd'd(Z5e(fd)d*Z6d+d,Z7dUd-d.Z8d/d0Z9d1d2Z:d3d4Z;d5d6ZGd;d<dZ@d?d@ZAdAdBZBdCdDZCe(fdEdFZDdGdHZEdIdJZFdKdLZGdMdNZHdOdPZIdQdRZJdS)V)absolute_importN)EXTENSION_SUFFIXEScCsg|]}|dqS)r).0xrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/tags.py sr) TYPE_CHECKINGcast) Dict FrozenSetIOIterableIteratorListOptionalSequenceTupleUnionpycpppipjy)pythoncpythonpypy ironpythonjythonlc@sdeZdZdZgdZddZeddZeddZed d Z d d Z d dZ ddZ ddZ dS)Tagz A representation of the tag triple for a wheel. Instances are considered immutable and thus are hashable. Equality checking is also supported. ) _interpreter_abi _platformcCs"||_||_||_dSN)lowerr!r"r#)self interpreterabiplatformrrr__init__Fs  z Tag.__init__cC|jSr$)r!r&rrrr'LzTag.interpretercCr+r$)r"r,rrrr(Qr-zTag.abicCr+r$)r#r,rrrr)Vr-z Tag.platformcCs2t|tstS|j|jko|j|jko|j|jkSr$) isinstancer NotImplementedr)r(r')r&otherrrr__eq__[s    z Tag.__eq__cCst|j|j|jfSr$)hashr!r"r#r,rrr__hash__fz Tag.__hash__cCsd|j|j|jS)Nz{}-{}-{})formatr!r"r#r,rrr__str__jr4z Tag.__str__cCsdj|t|dS)Nz<{self} @ {self_id}>)r&self_id)r5idr,rrr__repr__nsz Tag.__repr__N)__name__ __module__ __qualname____doc__ __slots__r*propertyr'r(r)r1r3r6r9rrrrr <s     r c Cs`t}|d\}}}|dD]}|dD]}|dD] }|t|||qqqt|S)z Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances. Returning a set is required due to the possibility that the tag is a compressed tag set. -.)setsplitaddr frozenset)tagtags interpretersabis platformsr'r( platform_rrr parse_tagssrLcCsP|sdSt|dksd|vr$|ddtt|}td|||dS)z[ Backwards-compatibility with Python 2.7 to allow treating 'warn' as keyword-only. Fr warnNz,{}() got an unexpected keyword argument {!r})lenpopnextiterkeys TypeErrorr5) func_namekwargsargrrr_warn_keyword_parameters  rWFcCs&t|}|dur|rtd||S)Nz>Config variable '%s' is unset, Python ABI tag may be incorrect) sysconfigget_config_varloggerdebug)namerMvaluerrr_get_config_vars  r^cCs|ddddS)NrA_r@)replace)stringrrr_normalize_stringr4rbcCst|dko t|dkS)zj Determine if the Python version supports abi3. PEP 384 was first implemented in Python 3.2. r ))rNtuple)python_versionrrr _abi3_appliessrgc Cst|}g}t|dd}d}}}td|}ttd}dtv} |s,|dur.|s,| r.d}|dkrXtd|} | s=| dur?d }|d krWtd |} | d ksU| durWtjd krWd}n |rc|dj|d| ddj||||d|S)NrdPy_DEBUGgettotalrefcountz_d.pydd)rc WITH_PYMALLOCm)rcrcPy_UNICODE_SIZEiu cp{version}versionrz"cp{version}{debug}{pymalloc}{ucs4})rtr[pymallocucs4) re_version_nodotr^hasattrsysr maxunicodeappendr5insert) py_versionrMrIrtr[rurv with_debug has_refcounthas_ext with_pymalloc unicode_sizerrr _cpython_abiss8      rc +sXtd|}|stjdd}dt|dd|dur,t|dkr*t||}ng}t|}dD]}z||Wq2t yDYq2wt|pJt }|D]}|D] }t ||VqRqNt |rpfdd|DD]}|Vqjfd d|DD]}|Vqyt |rt |dddd D]} |D]}d jt|d | fd t d|VqqdSdS)a Yields the tags for a CPython interpreter. The tags consist of: - cp-- - cp-abi3- - cp-none- - cp-abi3- # Older Python versions down to 3.2. If python_version only specifies a major version then user-provided ABIs and the 'none' ABItag will be used. If 'abi3' or 'none' are specified in 'abis' then they will be yielded at their normal position and not at the beginning. cpython_tagsNrdzcp{}r )abi3nonec3|] }td|VqdS)rNr rrKr'rr zcpython_tags..c3r)rNrrrrrrrrrrrsr)rWry version_infor5rwrNrlistremove ValueError_platform_tagsr rgrange) rfrIrJrUrM explicit_abir(rKrF minor_versionrrrrsH    rccs"td}|rt|VdSdS)NSOABI)rXrYrb)r(rrr _generic_abis  rc kstd|}|st}t|d}d||g}|durt}t|p#t}t|}d|vr2|d|D]}|D] }t|||Vq8q4dS)z Yields the tags for a generic interpreter. The tags consist of: - -- The "none" ABI will be added if it was not explicitly provided. generic_tagsrMrhNr) rWinterpreter_nameinterpreter_versionjoinrrrr{r ) r'rIrJrUrM interp_nameinterp_versionr(rKrrrrs"   rccst|dkrdjt|dddVdj|ddVt|dkr=t|ddd d D]}djt|d|fdVq-dSdS) z Yields Python versions in descending order. After the latest version, the major-only version will be yielded, and then all previous versions of that major version. r z py{version}Nrdrsz py{major}r)majorr)rNr5rwr)r}minorrrr_py_interpreter_range4s  rccsz|s tjdd}t|pt}t|D]}|D] }t|d|Vqq|r-t|ddVt|D] }t|ddVq1dS)z Yields the sequence of tags that are compatible with a specific version of Python. The tags consist of: - py*-none- - -none-any # ... if `interpreter` is provided. - py*-none-any Nrdrany)ryrrrrr )rfr'rJrtrKrrrcompatible_tagsDs  rcCs|s|S|dr dSdS)Nppci386) startswith)archis_32bitrrr _mac_arch^s  rcCs|g}|dkr|dkr gS|gdn7|dkr'|dkrgS|gdn%|dkr;|dks3|dkr5gS|dn|d krL|d krEgS|d d g|d |S)Nx86_64) rp)intelfat64fat32r)rrfatppc64)rrr)rrr universal)extendr{)rtcpu_archformatsrrr_mac_binary_formatsis&  rc cst\}}}|durtdttt|ddd}n|}|dur)t|}n|}t|dddD]}|d|f}t ||}|D]}dj |d|d|d VqBq3dS) aD Yields the platform tags for a macOS system. The `version` parameter is a two-item tuple specifying the macOS version to generate platform tags for. The `arch` parameter is the CPU architecture to generate platform tags for. Both parameters default to the appropriate value for the current system. N MacVersionrArdr rrz&macosx_{major}_{minor}_{binary_format})rr binary_format) r)mac_verr remapintrCrrrr5) rtr version_strr_rrcompat_versionbinary_formatsrrrr mac_platformss& $    rc Cs:zddl}tt||dWSttfyYt|Sw)NrZ _compatible) _manylinuxboolgetattr ImportErrorAttributeError_have_compatible_glibc)r\ glibc_versionrrrr_is_manylinux_compatiblesrcCs tptSr$)_glibc_version_string_confstr_glibc_version_string_ctypesrrrr_glibc_version_strings rc CsFztd}|dus J|\}}W|Sttttfy"YdSw)zJ Primary implementation of glibc_version_string using os.confstr. CS_GNU_LIBC_VERSIONN)osconfstrrCAssertionErrorrOSErrorr)version_stringr_rtrrrrs  rcCsrzddl}Wn tyYdSw|d}z|j}Wn ty%YdSw|j|_|}t|ts7| d}|S)zG Fallback implementation of glibc_version_string using ctypes. rNascii) ctypesrCDLLgnu_get_libc_versionrc_char_prestyper.strdecode)rprocess_namespacerrrrrrs        rcCsHtd|}|std|tdSt|d|ko#t|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFrr)rematchwarningsrMRuntimeWarningrgroup)rrequired_major minimum_minorrnrrr_check_glibc_versions rcCst}|dur dSt|||SNF)rr)rrrrrrrs rc@sTeZdZGdddeZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd dZdS)_ELFFileHeaderc@seZdZdZdS)z$_ELFFileHeader._InvalidELFFileHeaderz7 An invalid ELF file header was found. N)r:r;r<r=rrrr_InvalidELFFileHeadersriFLEr rdrc(>l~iicsrfdd}|d|_|j|jkrt|d|_|j|j|jhvr't|d|_|j|j|j hvr9t|d|_ |d|_ |d|_ d|_|j|jkrVdnd}|j|jkr`dnd}|j|jkrjd nd }|j|jkrt|n|}|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_dS) Ncs:zt|t|\}W|Stjytwr$)structunpackreadcalcsizeerrorrr)fmtresultfilerrr)sz'_ELFFileHeader.__init__..unpackz>IBzHzQ) e_ident_magicELF_MAGIC_NUMBERrr e_ident_class ELFCLASS32 ELFCLASS64 e_ident_data ELFDATA2LSB ELFDATA2MSBe_ident_version e_ident_osabie_ident_abiversionr e_ident_pade_type e_machine e_versione_entrye_phoffe_shoffe_flagse_ehsize e_phentsizee_phnum e_shentsizee_shnum e_shstrndx)r&rrformat_hformat_iformat_qformat_prrrr*'s>                    z_ELFFileHeader.__init__N)r:r;r<rrrrrrrEM_386EM_S390EM_ARM EM_X86_64EF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDr*rrrrrs rc Cs^zttjd}t|}WdW|S1swYW|Sttttjfy.YdSw)Nrb)openry executablerIOErrorrrSr)f elf_headerrrr_get_elf_headerSs  rcCsnt}|dur dS|j|jk}||j|jkM}||j|jkM}||j|j@|j kM}||j|j @|j kM}|Sr) rrrrrrrrrrrrrrrr_is_linux_armhf]s   r cCsBt}|dur dS|j|jk}||j|jkM}||j|jkM}|Sr)rrrrrrrrrrr_is_linux_i686qs r!cCs |dkrtS|dkrtSdS)Narmv7li686T)r r!)rrrr_have_compatible_manylinux_abi|s r$ccsttj}|r|dkrd}n|dkrd}g}|dd\}}t|r<|dvr.|d|d vr<|d |d t|}|D]\}}t||rT| d |VnqB|D] \}}| d |VqW|VdS) N linux_x86_64 linux_i686 linux_aarch64 linux_armv7lr_r >rs390xrppc64leaarch64r"r#) manylinux2014)rd>rr#) manylinux2010)rd ) manylinux1)rdrlinux) rb distutilsutil get_platformrCr$r{rQrr`)rr1Zmanylinux_supportr_rZmanylinux_support_iterr\rrrr_linux_platformss<    r5ccsttjVdSr$)rbr2r3r4rrrr_generic_platformssr6cCs*tdkr tStdkrtStS)z; Provides the platform tags for this installation. DarwinLinux)r)systemrr5r6rrrrrs  rcCs:ztjj}Wntyt}Ynwt|p|S)z6 Returns the name of the running interpreter. ) ryimplementationr\rr)python_implementationr%INTERPRETER_SHORT_NAMESget)r\rrrrs   rcKs<td|}td|d}|rt|}|Sttjdd}|S)z9 Returns the version of the running interpreter. rpy_version_nodotrNrd)rWr^rrwryr)rUrMrtrrrrs  rcCs,tdd|Dr d}nd}|tt|S)Ncss|]}|dkVqdS)rNr)rvrrrrsz!_version_nodot..r_rh)rrrr)rtseprrrrwsrwcksZtd|}t}|dkrt|dD]}|Vqn tD]}|VqtD]}|Vq%dS)z Returns the sequence of tag triples for the running interpreter. The order of the sequence corresponds to priority order for the interpreter, from most to least important. sys_tagsrrN)rWrrrr)rUrMrrFrrrrAs   rA)F)NNN)NN)K __future__rdistutils.utilr2importlib.machineryrrimpZ get_suffixesloggingrr)rrryrXrZ_typingr r typingr r rrrrrrrrr PythonVersionrZ GlibcVersion getLoggerr:rZr<maxsize_32_BIT_INTERPRETERobjectr rLrWr^rbrgrrrrrrrrrrrrrrrrrr r!r$r5r6rrrrwrArrrrs  0    7   & <   # @  !   PK!wj5_vendor/packaging/__pycache__/_typing.cpython-310.pycnu[o Xai@s2dZddgZ dZerddlmZdSddZdS) a;For neatly implementing static typing in packaging. `mypy` - the static type analysis tool we use - uses the `typing` module, which provides core functionality fundamental to mypy's functioning. Generally, `typing` would be imported at runtime and used in that fashion - it acts as a no-op at runtime and does not have any run-time overhead by design. As it turns out, `typing` is not vendorable - it uses separate sources for Python 2/Python 3. Thus, this codebase can not expect it to be present. To work around this, mypy allows the typing import to be behind a False-y optional to prevent it from running at runtime and type-comments can be used to remove the need for the types to be accessible directly during runtime. This module provides the False-y guard in a nicely named fashion so that a curious maintainer can reach here to read this. In packaging, all static-typing related imports should be guarded as follows: from packaging._typing import TYPE_CHECKING if TYPE_CHECKING: from typing import ... Ref: https://github.com/python/mypy/issues/3216 TYPE_CHECKINGcastF)r)rcCs|S)N)type_valuerr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/_typing.pyr/sN)__doc____all__typingrrrrrrs PK!][[6_vendor/packaging/__pycache__/__init__.cpython-310.pycnu[o Xai2@sHddlmZmZmZddlmZmZmZmZm Z m Z m Z m Z gdZ dS))absolute_importdivisionprint_function) __author__ __copyright__ __email__ __license__ __summary__ __title____uri__ __version__)r r r r rrr rN) __future__rrr __about__rrrr r r r r __all__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/__init__.pys( PK!m@335_vendor/packaging/__pycache__/version.cpython-310.pycnu[o Xain< @sddlmZmZmZddlZddlZddlZddlmZm Z ddl m Z e rddl m Z mZmZmZmZmZmZddlmZmZeeefZeeeeeffZeeeefZeeeeeeeefeeeffdffZeeeedfeeeefZeeeedffZe eeefeeefgefZgd Z e!d gd Z"d d Z#Gddde$Z%Gddde&Z'Gddde'Z(e)dej*Z+ddddddZ,ddZ-ddZ.dZ/Gddde'Z0d d!Z1e)d"Z2d#d$Z3d%d&Z4dS)')absolute_importdivisionprint_functionN)InfinityNegativeInfinity) TYPE_CHECKING)CallableIteratorListOptional SupportsIntTupleUnion) InfinityTypeNegativeInfinityType.)parseVersion LegacyVersionInvalidVersionVERSION_PATTERN_Version)epochreleasedevprepostlocalcCs&zt|WStyt|YSw)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. )rrr)versionr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/version.pyr0s    rc@seZdZdZdS)rzF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrrr r=src@sPeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dS) _BaseVersionNcCs t|jSN)hash_keyselfrrr __hash__Fs z_BaseVersion.__hash__cC||ddS)NcSs||kSr&rsorrr Lz%_BaseVersion.__lt__.._comparer*otherrrr __lt__Jz_BaseVersion.__lt__cCr,)NcSs||kSr&rr-rrr r0Pr1z%_BaseVersion.__le__..r2r4rrr __le__Nr7z_BaseVersion.__le__cCr,)NcSs||kSr&rr-rrr r0Tr1z%_BaseVersion.__eq__..r2r4rrr __eq__Rr7z_BaseVersion.__eq__cCr,)NcSs||kSr&rr-rrr r0Xr1z%_BaseVersion.__ge__..r2r4rrr __ge__Vr7z_BaseVersion.__ge__cCr,)NcSs||kSr&rr-rrr r0\r1z%_BaseVersion.__gt__..r2r4rrr __gt__Zr7z_BaseVersion.__gt__cCr,)NcSs||kSr&rr-rrr r0`r1z%_BaseVersion.__ne__..r2r4rrr __ne__^r7z_BaseVersion.__ne__cCst|tstS||j|jSr&) isinstancer%NotImplementedr()r*r5methodrrr r3bs z_BaseVersion._compare) r!r"r#r(r+r6r8r9r:r;r<r3rrrr r%Cs r%c@seZdZddZddZddZeddZed d Zed d Z ed dZ eddZ eddZ eddZ eddZeddZeddZeddZdS)rcCst||_t|j|_dSr&)str_version_legacy_cmpkeyr()r*rrrr __init__ks zLegacyVersion.__init__cC|jSr&rAr)rrr __str__pszLegacyVersion.__str__cCdtt|S)Nzformatreprr@r)rrr __repr__tzLegacyVersion.__repr__cCrDr&rEr)rrr publicxzLegacyVersion.publiccCrDr&rEr)rrr base_version}rNzLegacyVersion.base_versioncCdS)Nrr)rrr rzLegacyVersion.epochcCdSr&rr)rrr rrRzLegacyVersion.releasecCrSr&rr)rrr rrRzLegacyVersion.precCrSr&rr)rrr rrRzLegacyVersion.postcCrSr&rr)rrr rrRzLegacyVersion.devcCrSr&rr)rrr rrRzLegacyVersion.localcCrPNFrr)rrr is_prereleaserRzLegacyVersion.is_prereleasecCrPrTrr)rrr is_postreleaserRzLegacyVersion.is_postreleasecCrPrTrr)rrr is_devreleaserRzLegacyVersion.is_devreleaseN)r!r"r#rCrFrKpropertyrMrOrrrrrrrUrVrWrrrr rjs4          rz(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccs^t|D]#}t||}|r|dkrq|dddvr$|dVqd|VqdVdS)N.r 0123456789**final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)r.partrrr _parse_version_partss    ricCsd}g}t|D]8}|dr=|dkr)|r)|ddkr)||r)|ddks|r=|ddkr=||r=|ddks1||q |t|fS)NrQrarbz*final-00000000)rilower startswithpopappendtuple)rrpartsrhrrr rBs   rBa v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@seZdZededejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZeddZeddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zd%S)&rz^\s*z\s*$c
Cs|j|}|std|t|drt|dndtdd|ddDt	|d|d	t	|d
|dpC|dt	|d
|dt
|dd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'rrcs|]}t|VqdSr&)int.0irrr 	z#Version.__init__..rr^pre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrr)_regexsearchrrIrgrouprrrord_parse_letter_version_parse_local_versionrA_cmpkeyrrrrrrr()r*rmatchrrr rCs*
zVersion.__init__cCrG)NzrHr)rrr rK-rLzVersion.__repr__cCsg}|jdkr|d|j|ddd|jD|jdur1|ddd|jD|jdur?|d|j|jdurM|d	|j|jdur[|d
|jd|S)Nr{0}!r^csrqr&r@rtxrrr rv:rwz"Version.__str__..csrqr&rrrrr rv>rwz.post{0}z.dev{0}z+{0})	rrnrIjoinrrrrrr*rprrr rF1s





zVersion.__str__cC|jj}|Sr&)rAr)r*_epochrrr rNz
Version.epochcCrr&)rAr)r*_releaserrr rTrzVersion.releasecCrr&)rAr)r*_prerrr rZrzVersion.precC|jjr
|jjdSdSNr)rArr)rrr r`zVersion.postcCrr)rArr)rrr rerzVersion.devcCs$|jjrddd|jjDSdS)Nr^csrqr&rrrrr rvnrwz Version.local..)rArrr)rrr rjsz
Version.localcCst|dddS)N+rr)r@rdr)rrr rMrzVersion.publiccCsFg}|jdkr|d|j|ddd|jDd|S)Nrrr^csrqr&rrrrr rvrwz'Version.base_version..r)rrnrIrrrrrr rOws


zVersion.base_versioncCs|jdup	|jduSr&)rrr)rrr rUrzVersion.is_prereleasecC
|jduSr&)rr)rrr rV
zVersion.is_postreleasecCrr&)rr)rrr rWrzVersion.is_devreleasecCst|jdkr|jdSdS)Nrrlenrr)rrr majorz
Version.majorcCt|jdkr|jdSdS)Nrrrr)rrr minorrz
Version.minorcCr)Nrrrr)rrr microrz
Version.microN)r!r"r#recompilerVERBOSE
IGNORECASErrCrKrFrXrrrrrrrMrOrUrVrWrrrrrrr rsB












rcCsv|r-|durd}|}|dkrd}n|dkrd}n
|dvr!d}n|dvr'd	}|t|fS|s9|r9d	}|t|fSdS)
Nralphaabetab)rYrr[r])revrr)rkrr)letternumberrrr rs"rz[\._-]cCs$|durtddt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss(|]}|s|nt|VqdSr&)isdigitrkrr)rtrhrrr rvs

z'_parse_local_version..)ro_local_version_separatorsrd)rrrr rs
rcCsttttddt|}|dur|dur|durt}n	|dur&t}n|}|dur/t}n|}|dur8t}	n|}	|durAt}
n	tdd|D}
|||||	|
fS)NcSs|dkS)Nrr)rrrr r0r1z_cmpkey..css*|]}t|tr
|dfnt|fVqdS)rN)r=rrrrsrrr rvs
z_cmpkey..)roreversedlist	itertools	dropwhilerr)rrrrrrrr_post_dev_localrrr rs(	r)5
__future__rrrcollectionsrr_structuresrrZ_typingrtypingr	r
rrr
rrrr
InfiniteTypesr@rrPrePostDevTypeSubLocalType	LocalTypeCmpKeyLegacyCmpKeyboolVersionComparisonMethod__all__
namedtuplerr
ValueErrorrobjectr%rrrrcrerirBrrrrrrrrrr sr$


'F	 
&
PK!؅5_vendor/packaging/__pycache__/_compat.cpython-310.pycnu[o

Xaih@s~ddlmZmZmZddlZddlmZer"ddlmZm	Z	m
Z
mZejddkZ
ejddkZer6efZnefZdd	ZdS)
)absolute_importdivisionprint_functionN)
TYPE_CHECKING)AnyDictTupleTypecs&Gfddd}t|ddiS)z/
    Create a base class with a metaclass.
    cseZdZfddZdS)z!with_metaclass..metaclasscs||S)N)clsname
this_basesdbasesmetar
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/packaging/_compat.py__new__"sz)with_metaclass..metaclass.__new__N)__name__
__module____qualname__rr
rr
r	metaclass!srtemporary_classr
)typer)rrrr
rrwith_metaclasssr)
__future__rrrsysZ_typingrtypingrrr	r
version_infoPY2PY3strstring_types
basestringrr
r
r
rsPK!lfFfF:_vendor/more_itertools/__pycache__/recipes.cpython-310.pycnu[o

Xai?@sdZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlZddlmZmZmZgdZddZdDd	d
ZddZdEd
dZdEddZddZefddZddZeZddZddZ ddZ!dEddZ"dd Z#zdd!lm$Z%Wne&ye#Z$Yn	wd"d#Z$e#je$_dEd$d%Z'd&d'Z(d(d)Z)d*d+Z*dEd,d-Z+dEd.d/Z,dEd0d1Z-dFd2d3Z.d4d5d6d7Z/dEd8d9Z0d:d;Z1dd?Z3d@dAZ4dBdCZ5dS)GaImported from the recipes section of the itertools documentation.

All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.

.. [1] http://docs.python.org/library/itertools.html#recipes

N)deque)
chaincombinationscountcyclegroupbyislicerepeatstarmapteezip_longest)	randrangesamplechoice)	all_equalconsumeconvolve
dotproduct
first_trueflattengrouperiter_exceptncyclesnthnth_combinationpadnonepad_nonepairwise	partitionpowersetprependquantify#random_combination_with_replacementrandom_combinationrandom_permutationrandom_product
repeatfunc
roundrobintabulatetailtakeunique_everseenunique_justseencCtt||S)zReturn first *n* items of the iterable as a list.

        >>> take(3, range(10))
        [0, 1, 2]

    If there are fewer than *n* items in the iterable, all of them are
    returned.

        >>> take(10, range(3))
        [0, 1, 2]

    )listrniterabler2/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/recipes.pyr*<s
r*cCst|t|S)aReturn an iterator over the results of ``func(start)``,
    ``func(start + 1)``, ``func(start + 2)``...

    *func* should be a function that accepts one integer argument.

    If *start* is not specified it defaults to 0. It will be incremented each
    time the iterator is advanced.

        >>> square = lambda x: x ** 2
        >>> iterator = tabulate(square, -3)
        >>> take(4, iterator)
        [9, 4, 1, 0]

    )mapr)functionstartr2r2r3r(Lsr(cCstt||dS)zReturn an iterator over the last *n* items of *iterable*.

    >>> t = tail(3, 'ABCDEFG')
    >>> list(t)
    ['E', 'F', 'G']

    maxlen)iterrr/r2r2r3r)^sr)cCs.|durt|dddStt|||ddS)aXAdvance *iterable* by *n* steps. If *n* is ``None``, consume it
    entirely.

    Efficiently exhausts an iterator without returning values. Defaults to
    consuming the whole iterator, but an optional second argument may be
    provided to limit consumption.

        >>> i = (x for x in range(10))
        >>> next(i)
        0
        >>> consume(i, 3)
        >>> next(i)
        4
        >>> consume(i)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    If the iterator has fewer items remaining than the provided limit, the
    whole iterator will be consumed.

        >>> i = (x for x in range(3))
        >>> consume(i, 5)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    Nrr7)rnextr)iteratorr0r2r2r3ris rcCstt||d|S)zReturns the nth item or a default value.

    >>> l = range(10)
    >>> nth(l, 3)
    3
    >>> nth(l, 20, "zebra")
    'zebra'

    N)r:r)r1r0defaultr2r2r3rs
rcCst|}t|dot|dS)z
    Returns ``True`` if all the elements are equal to each other.

        >>> all_equal('aaaa')
        True
        >>> all_equal('aaab')
        False

    TF)rr:)r1gr2r2r3rs
rcCr-)zcReturn the how many times the predicate is true.

    >>> quantify([True, False, True])
    2

    )sumr4)r1predr2r2r3r!sr!cCst|tdS)aReturns the sequence of elements and then returns ``None`` indefinitely.

        >>> take(5, pad_none(range(3)))
        [0, 1, 2, None, None]

    Useful for emulating the behavior of the built-in :func:`map` function.

    See also :func:`padded`.

    N)rr	r1r2r2r3rsrcCsttt||S)zvReturns the sequence elements *n* times

    >>> list(ncycles(["a", "b"], 3))
    ['a', 'b', 'a', 'b', 'a', 'b']

    )r
from_iterabler	tuple)r1r0r2r2r3rsrcCstttj||S)zcReturns the dot product of the two iterables.

    >>> dotproduct([10, 10], [20, 20])
    400

    )r>r4operatormul)Zvec1Zvec2r2r2r3rsrcCs
t|S)zReturn an iterator flattening one level of nesting in a list of lists.

        >>> list(flatten([[0, 1], [2, 3]]))
        [0, 1, 2, 3]

    See also :func:`collapse`, which can flatten multiple levels of nesting.

    )rrA)ZlistOfListsr2r2r3rs
	rcGs&|durt|t|St|t||S)aGCall *func* with *args* repeatedly, returning an iterable over the
    results.

    If *times* is specified, the iterable will terminate after that many
    repetitions:

        >>> from operator import add
        >>> times = 4
        >>> args = 3, 5
        >>> list(repeatfunc(add, times, *args))
        [8, 8, 8, 8]

    If *times* is ``None`` the iterable will not terminate:

        >>> from random import randrange
        >>> times = None
        >>> args = 1, 11
        >>> take(6, repeatfunc(randrange, times, *args))  # doctest:+SKIP
        [2, 4, 8, 1, 8, 4]

    N)r
r	)functimesargsr2r2r3r&sr&ccs,t|\}}t|dt||EdHdS)zReturns an iterator of paired items, overlapping, from the original

    >>> take(4, pairwise(count()))
    [(0, 1), (1, 2), (2, 3), (3, 4)]

    On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.

    N)rr:zip)r1abr2r2r3	_pairwises	
rK)rccst|EdHdSN)itertools_pairwiser@r2r2r3rsrcCs<t|trtdt||}}t|g|}t|d|iS)zCollect data into fixed-length chunks or blocks.

    >>> list(grouper('ABCDEFG', 3, 'x'))
    [('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]

    z+grouper expects iterable as first parameter	fillvalue)
isinstanceintwarningswarnDeprecationWarningr9r)r1r0rNrGr2r2r3rs

rcgslt|}tdd|D}|r4z|D]}|VqWnty/|d8}tt||}Ynw|sdSdS)aJYields an item from each iterable, alternating between them.

        >>> list(roundrobin('ABC', 'D', 'EF'))
        ['A', 'D', 'E', 'B', 'F', 'C']

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    css|]}t|jVqdSrL)r9__next__).0itr2r2r3	9zroundrobin..N)lenr
StopIterationr)	iterablespendingZnextsr:r2r2r3r',s
r'csFdurtfdd|D}t|\}}dd|Ddd|DfS)a
    Returns a 2-tuple of iterables derived from the input iterable.
    The first yields the items that have ``pred(item) == False``.
    The second yields the items that have ``pred(item) == True``.

        >>> is_odd = lambda x: x % 2 != 0
        >>> iterable = range(10)
        >>> even_items, odd_items = partition(is_odd, iterable)
        >>> list(even_items), list(odd_items)
        ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])

    If *pred* is None, :func:`bool` is used.

        >>> iterable = [0, 1, False, True, '', ' ']
        >>> false_items, true_items = partition(None, iterable)
        >>> list(false_items), list(true_items)
        ([0, False, ''], [1, True, ' '])

    Nc3s|]	}||fVqdSrLr2)rUxr?r2r3rWZzpartition..css|]	\}}|s|VqdSrLr2rUZcondr^r2r2r3rW]r`css|]	\}}|r|VqdSrLr2rar2r2r3rW^r`)boolr)r?r1Zevaluationst1t2r2r_r3rCsrcs,t|tfddttdDS)aYields all possible subsets of the iterable.

        >>> list(powerset([1, 2, 3]))
        [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]

    :func:`powerset` will operate on iterables that aren't :class:`set`
    instances, so repeated elements in the input will produce repeated elements
    in the output. Use :func:`unique_everseen` on the input to avoid generating
    duplicates:

        >>> seq = [1, 1, 0]
        >>> list(powerset(seq))
        [(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
        >>> from more_itertools import unique_everseen
        >>> list(powerset(unique_everseen(seq)))
        [(), (1,), (0,), (1, 0)]

    c3s|]}t|VqdSrL)r)rUrsr2r3rWvrXzpowerset..rY)r.rrArangerZr@r2rfr3rbs$rc		cst}|j}g}|j}|du}|D]+}|r||n|}z
||vr(|||VWqty=||vr;|||VYqwdS)a
    Yield unique elements, preserving order.

        >>> list(unique_everseen('AAAABBBCCDAABBB'))
        ['A', 'B', 'C', 'D']
        >>> list(unique_everseen('ABBCcAD', str.lower))
        ['A', 'B', 'C', 'D']

    Sequences with a mix of hashable and unhashable items can be used.
    The function will be slower (i.e., `O(n^2)`) for unhashable items.

    Remember that ``list`` objects are unhashable - you can use the *key*
    parameter to transform the list to a tuple (which is hashable) to
    avoid a slowdown.

        >>> iterable = ([1, 2], [2, 3], [1, 2])
        >>> list(unique_everseen(iterable))  # Slow
        [[1, 2], [2, 3]]
        >>> list(unique_everseen(iterable, key=tuple))  # Faster
        [[1, 2], [2, 3]]

    Similary, you may want to convert unhashable ``set`` objects with
    ``key=frozenset``. For ``dict`` objects,
    ``key=lambda x: frozenset(x.items())`` can be used.

    N)setaddappend	TypeError)	r1keyZseensetZseenset_addZseenlistZseenlist_addZuse_keyelementkr2r2r3r+ys(r+cCsttttdt||S)zYields elements in order, ignoring serial duplicates

    >>> list(unique_justseen('AAAABBBCCDAABBB'))
    ['A', 'B', 'C', 'D', 'A', 'B']
    >>> list(unique_justseen('ABBCcAD', str.lower))
    ['A', 'B', 'C', 'A', 'D']

    rY)r4r:rC
itemgetterr)r1rmr2r2r3r,s	r,ccs4z|dur
|V	|Vq|yYdSw)aXYields results from a function repeatedly until an exception is raised.

    Converts a call-until-exception interface to an iterator interface.
    Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
    to end the loop.

        >>> l = [0, 1, 2]
        >>> list(iter_except(l.pop, IndexError))
        [2, 1, 0]

    Nr2)rE	exceptionfirstr2r2r3rsrcCstt|||S)a
    Returns the first true value in the iterable.

    If no true value is found, returns *default*

    If *pred* is not None, returns the first item for which
    ``pred(item) == True`` .

        >>> first_true(range(10))
        1
        >>> first_true(range(10), pred=lambda x: x > 5)
        6
        >>> first_true(range(10), default='missing', pred=lambda x: x > 9)
        'missing'

    )r:filter)r1r<r?r2r2r3rsrrY)r	cGs$dd|D|}tdd|DS)aDraw an item at random from each of the input iterables.

        >>> random_product('abc', range(4), 'XYZ')  # doctest:+SKIP
        ('c', 3, 'Z')

    If *repeat* is provided as a keyword argument, that many items will be
    drawn from each iterable.

        >>> random_product('abcd', range(4), repeat=2)  # doctest:+SKIP
        ('a', 2, 'd', 3)

    This equivalent to taking a random selection from
    ``itertools.product(*args, **kwarg)``.

    cSsg|]}t|qSr2rBrUpoolr2r2r3
sz"random_product..css|]}t|VqdSrL)rrur2r2r3rWz!random_product..rt)r	rGpoolsr2r2r3r%sr%cCs*t|}|durt|n|}tt||S)abReturn a random *r* length permutation of the elements in *iterable*.

    If *r* is not specified or is ``None``, then *r* defaults to the length of
    *iterable*.

        >>> random_permutation(range(5))  # doctest:+SKIP
        (3, 4, 0, 1, 2)

    This equivalent to taking a random selection from
    ``itertools.permutations(iterable, r)``.

    N)rBrZr)r1rervr2r2r3r$s
r$cs8t|t}ttt||}tfdd|DS)zReturn a random *r* length subsequence of the elements in *iterable*.

        >>> random_combination(range(5), 3)  # doctest:+SKIP
        (2, 3, 4)

    This equivalent to taking a random selection from
    ``itertools.combinations(iterable, r)``.

    c3|]}|VqdSrLr2rUirvr2r3rWrxz%random_combination..)rBrZsortedrrh)r1rer0indicesr2r}r3r#s
r#cs@t|ttfddt|D}tfdd|DS)aSReturn a random *r* length subsequence of elements in *iterable*,
    allowing individual elements to be repeated.

        >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
        (0, 0, 1, 2, 2)

    This equivalent to taking a random selection from
    ``itertools.combinations_with_replacement(iterable, r)``.

    c3s|]}tVqdSrL)r
r{)r0r2r3rWrxz6random_combination_with_replacement..c3rzrLr2r{r}r2r3rWrx)rBrZr~rh)r1rerr2)r0rvr3r"sr"c	Cst|}t|}|dks||krtd}t|||}td|dD]}|||||}q"|dkr7||7}|dks?||krAtg}|ry||||d|d}}}||krn||8}|||||d}}||ksY||d||sEt|S)aEquivalent to ``list(combinations(iterable, r))[index]``.

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`nth_combination` computes the subsequence at
    sort position *index* directly, without computing the previous
    subsequences.

        >>> nth_combination(range(5), 3, 5)
        (0, 3, 4)

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    rrY)rBrZ
ValueErrorminrh
IndexErrorrk)	r1reindexrvr0cror|resultr2r2r3r"s, rcCst|g|S)aYield *value*, followed by the elements in *iterator*.

        >>> value = '0'
        >>> iterator = ['1', '2', '3']
        >>> list(prepend(value, iterator))
        ['0', '1', '2', '3']

    To prepend multiple values, see :func:`itertools.chain`
    or :func:`value_chain`.

    )r)valuer;r2r2r3r Lsr ccsjt|ddd}t|}tdg|d|}t|td|dD]}||tttj	||Vq!dS)aBConvolve the iterable *signal* with the iterable *kernel*.

        >>> signal = (1, 2, 3, 4, 5)
        >>> kernel = [3, 2, 1]
        >>> list(convolve(signal, kernel))
        [3, 8, 14, 20, 26, 14, 5]

    Note: the input arguments are not interchangeable, as the *kernel*
    is immediately consumed and stored.

    Nrrr7rY)
rBrZrrr	rkr>r4rCrD)signalZkernelr0Zwindowr^r2r2r3r[s
r)rrL)NN)6__doc__rQcollectionsr	itertoolsrrrrrrr	r
rrrCrandomr
rr__all__r*r(r)rrrrbr!rrrrrr&rKrrMImportErrorrr'rrr+r,rrr%r$r#r"rr rr2r2r2r3sV	0!


(







-


*PK!DBB;_vendor/more_itertools/__pycache__/__init__.cpython-310.pycnu[o

XaiR@sddlTddlTdZdS))*z8.8.0N)moreZrecipes__version__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.pysPK!{yحح7_vendor/more_itertools/__pycache__/more.cpython-310.pycnu[o

Xai@sddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$dd	l%m&Z&m'Z'dd
l(m(Z(m)Z)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3dd
l4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;mZ?dddZ@e?fddZAe?fddZBe?fddZCGdddZDddZEddZFd d!ZGd"d#ZHd$d%ZIdd&d'ZJdd(d)ZKdd*d+ZLd,d-ZMdd.d/ZNd0d1ZOdd2d3ZPGd4d5d5ZQdd6d7ZRd8d9ZSd:d;ZTddd?ZVdd@dAZWddCdDZXddEdFZYddGdHZZddIdJZ[dKdLZ\ddMdNZ]ddOdPZ^dQdRZ_ddTdUZ`GdVdWdWeaZbdXdYZcdZd[Zdddd\d]d^Zedd`daZfdbdcZgdddeZheiejffdfdgZkddhdiZlddjdkZmGdldmdmejejnZoddndoZpdpdqZqerdfdrdsZsdtduZtdvdwZudxdyZvGdzd{d{Zwd|d}Zxd~dZyddfddZze.fddddZ{GdddeZ|GdddZ}GdddZ~erfddZddZd_ddZdddZerdfddZdddZddZdddZGdddZdddZddZddZddZddZddZddZdddZdddZGdddeZGdddZddZdddZddZddZddZddZdd„ZddĄZGddƄdƃZdS)N)Counterdefaultdictdequeabc)Sequence)ThreadPoolExecutor)partialreducewraps)mergeheapifyheapreplaceheappop)chaincompresscountcycle	dropwhilegroupbyislicerepeatstarmap	takewhileteezip_longest)exp	factorialfloorlog)EmptyQueue)random	randrangeuniform)
itemgettermulsubgtlt)
hexversionmaxsize)	monotonic)consumeflattenpairwisepowersettakeunique_everseen)SAbortThreadadjacentalways_iterablealways_reversiblebucket
callback_iterchunkedcircular_shiftscollapsecollateconsecutive_groupsconsumer	countablecount_cycle	mark_ends
differencedistinct_combinationsdistinct_permutations
distributedivide	exactly_n
filter_exceptfirstgroupby_transformileninterleave_longest
interleaveintersperseislice_extendediterateichunked	is_sortedlastlocatelstripmake_decorator
map_except
map_reducenth_or_lastnth_permutationnth_product
numeric_rangeoneonlypadded
partitionsset_partitionspeekablerepeat_lastreplacerlocaterstrip
run_lengthsampleseekableSequenceViewside_effectsliced
sort_togethersplit_atsplit_aftersplit_before
split_when
split_intospystaggerstrip
substringssubstrings_indexestime_limitedunique_to_eachunzipwindowed	with_iterUnequalIterablesError	zip_equal
zip_offsetwindowed_complete
all_uniquevalue_chain
product_indexcombination_indexpermutation_indexFcs6tttt|g|rfdd}t|SS)aJBreak *iterable* into lists of length *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]

    By the default, the last yielded list will have fewer than *n* elements
    if the length of *iterable* is not divisible by *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
        [[1, 2, 3], [4, 5, 6], [7, 8]]

    To use a fill-in value instead, see the :func:`grouper` recipe.

    If the length of *iterable* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    list is yielded.

    c3*D]}t|krtd|VqdS)Nziterable is not divisible by n.len
ValueError)chunkiteratorn/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.pyretzchunked..ret)iterrr1)iterablerstrictrrrrr9s

r9c
CsJztt|WSty$}z|turtd||WYd}~Sd}~ww)aReturn the first item of *iterable*, or *default* if *iterable* is
    empty.

        >>> first([0, 1, 2, 3])
        0
        >>> first([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.

    :func:`first` is useful when you have a generator of expensive-to-retrieve
    values and want any arbitrary one. It is marginally shorter than
    ``next(iter(iterable), default)``.

    zKfirst() was called on an empty iterable, and no default value was provided.N)nextr
StopIteration_markerr)rdefaulterrrrIsrIc
Cstz#t|tr|dWSt|drtdkrtt|WSt|dddWSttt	fy9|t
ur5td|YSw)aReturn the last item of *iterable*, or *default* if *iterable* is
    empty.

        >>> last([0, 1, 2, 3])
        3
        >>> last([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    __reversed__ir,maxlenzDlast() was called on an empty iterable, and no default was provided.)
isinstancerhasattrr)rreversedr
IndexError	TypeErrorrrr)rrrrrrSs

rScCstt||d|dS)agReturn the nth or the last item of *iterable*,
    or *default* if *iterable* is empty.

        >>> nth_or_last([0, 1, 2, 3], 2)
        2
        >>> nth_or_last([0, 1], 2)
        1
        >>> nth_or_last([], 0, 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    r,r)rSr)rrrrrrrYsrYc@sTeZdZdZddZddZddZefdd	Zd
dZ	dd
Z
ddZddZdS)rbaWrap an iterator to allow lookahead and prepending elements.

    Call :meth:`peek` on the result to get the value that will be returned
    by :func:`next`. This won't advance the iterator:

        >>> p = peekable(['a', 'b'])
        >>> p.peek()
        'a'
        >>> next(p)
        'a'

    Pass :meth:`peek` a default value to return that instead of raising
    ``StopIteration`` when the iterator is exhausted.

        >>> p = peekable([])
        >>> p.peek('hi')
        'hi'

    peekables also offer a :meth:`prepend` method, which "inserts" items
    at the head of the iterable:

        >>> p = peekable([1, 2, 3])
        >>> p.prepend(10, 11, 12)
        >>> next(p)
        10
        >>> p.peek()
        11
        >>> list(p)
        [11, 12, 1, 2, 3]

    peekables can be indexed. Index 0 is the item that will be returned by
    :func:`next`, index 1 is the item after that, and so on:
    The values up to the given index will be cached.

        >>> p = peekable(['a', 'b', 'c', 'd'])
        >>> p[0]
        'a'
        >>> p[1]
        'b'
        >>> next(p)
        'a'

    Negative indexes are supported, but be aware that they will cache the
    remaining items in the source iterator, which may require significant
    storage.

    To check whether a peekable is exhausted, check its truth value:

        >>> p = peekable(['a', 'b'])
        >>> if p:  # peekable has items
        ...     list(p)
        ['a', 'b']
        >>> if not p:  # peekable is exhausted
        ...     list(p)
        []

    cCst||_t|_dSN)r_itr_cacheselfrrrr__init__%s
zpeekable.__init__cC|Srrrrrr__iter__)zpeekable.__iter__cC$z|WdStyYdSwNFTpeekrrrrr__bool__,
zpeekable.__bool__cCsH|jsz|jt|jWnty|tur|YSw|jdS)zReturn the item that will be next returned from ``next()``.

        Return ``default`` if there are no items left. If ``default`` is not
        provided, raise ``StopIteration``.

        r)rappendrrrr)rrrrrr3s
z
peekable.peekcGs|jt|dS)aStack up items to be the next ones returned from ``next()`` or
        ``self.peek()``. The items will be returned in
        first in, first out order::

            >>> p = peekable([1, 2, 3])
            >>> p.prepend(10, 11, 12)
            >>> next(p)
            10
            >>> list(p)
            [11, 12, 1, 2, 3]

        It is possible, by prepending items, to "resurrect" a peekable that
        previously raised ``StopIteration``.

            >>> p = peekable([])
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration
            >>> p.prepend(1)
            >>> next(p)
            1
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration

        N)r
extendleftr)ritemsrrrprependCszpeekable.prependcCs|jr|jSt|jSr)rpopleftrrrrrr__next__bs

zpeekable.__next__cCs|jdurdn|j}|dkr#|jdurdn|j}|jdurtn|j}n |dkr?|jdur.dn|j}|jdur;tdn|j}ntd|dksK|dkrS|j|jntt	||dt}t
|j}||krr|jt|j||t|j|S)Nr,rrzslice step cannot be zero)
stepstartstopr*rrextendrminmaxrrlist)rindexrrrr	cache_lenrrr
_get_slicehs
zpeekable._get_slicecCsdt|tr
||St|j}|dkr|j|jn||kr-|jt|j|d||j|SNrr,)rslicerrrrrr)rrrrrr__getitem__s



zpeekable.__getitem__N)
__name__
__module____qualname____doc__rrrrrrrrrrrrrrbs:rbcOstdtt|i|S)aReturn a sorted merge of the items from each of several already-sorted
    *iterables*.

        >>> list(collate('ACDZ', 'AZ', 'JKL'))
        ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']

    Works lazily, keeping only the next value from each iterable in memory. Use
    :func:`collate` to, for example, perform a n-way mergesort of items that
    don't fit in memory.

    If a *key* function is specified, the iterables will be sorted according
    to its result:

        >>> key = lambda s: int(s)  # Sort by numeric value, not by string
        >>> list(collate(['1', '10'], ['2', '11'], key=key))
        ['1', '2', '10', '11']


    If the *iterables* are sorted in descending order, set *reverse* to
    ``True``:

        >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
        [5, 4, 3, 2, 1, 0]

    If the elements of the passed-in iterables are out of order, you might get
    unexpected results.

    On Python 3.5+, this function is an alias for :func:`heapq.merge`.

    z>> @consumer
        ... def tally():
        ...     i = 0
        ...     while True:
        ...         print('Thing number %s is %s.' % (i, (yield)))
        ...         i += 1
        ...
        >>> t = tally()
        >>> t.send('red')
        Thing number 0 is red.
        >>> t.send('fish')
        Thing number 1 is fish.

    Without the decorator, you would have to call ``next(t)`` before
    ``t.send()`` could be used.

    cs|i|}t||Sr)r)argsrgenfuncrrwrapperszconsumer..wrapper)r
)rrrrrr>sr>cCs t}tt||ddt|S)zReturn the number of items in *iterable*.

        >>> ilen(x for x in range(1000000) if x % 3 == 0)
        333334

    This consumes the iterable, so handle with care.

    rr)rrzipr)rcounterrrrrKsrKccs	|V||}q)zReturn ``start``, ``func(start)``, ``func(func(start))``, ...

    >>> from itertools import islice
    >>> list(islice(iterate(lambda x: 2*x, 1), 10))
    [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

    r)rrrrrrPs
rPccs6|}|EdHWddS1swYdS)a:Wrap an iterable in a ``with`` statement, so it closes once exhausted.

    For example, this will close the file when the iterator is exhausted::

        upper_lines = (line.upper() for line in with_iter(open('foo')))

    Any context manager which returns an iterable is a candidate for
    ``with_iter``.

    Nr)Zcontext_managerrrrrr|s"r|c
Csvt|}zt|}Wnty}z|ptd|d}~wwzt|}Wn
ty.Y|Swd||}|p:t|)aReturn the first item from *iterable*, which is expected to contain only
    that item. Raise an exception if *iterable* is empty or has more than one
    item.

    :func:`one` is useful for ensuring that an iterable contains only one item.
    For example, it can be used to retrieve the result of a database query
    that is expected to return a single row.

    If *iterable* is empty, ``ValueError`` will be raised. You may specify a
    different exception with the *too_short* keyword:

        >>> it = []
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: too many items in iterable (expected 1)'
        >>> too_short = IndexError('too few items')
        >>> one(it, too_short=too_short)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        IndexError: too few items

    Similarly, if *iterable* contains more than one item, ``ValueError`` will
    be raised. You may specify a different exception with the *too_long*
    keyword:

        >>> it = ['too', 'many']
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: Expected exactly one item in iterable, but got 'too',
        'many', and perhaps more.
        >>> too_long = RuntimeError
        >>> one(it, too_long=too_long)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        RuntimeError

    Note that :func:`one` attempts to advance *iterable* twice to ensure there
    is only one item. See :func:`spy` or :func:`peekable` to check iterable
    contents less destructively.

    z&too few items in iterable (expected 1)NLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)rrrrformat)rZ	too_shorttoo_longitfirst_valuersecond_valuemsgrrrr]s&,
r]cstfdd}dd}t|}t||dur}d|kr"kr1nn
|kr,||S|||St|r7dSdS)	aYield successive distinct permutations of the elements in *iterable*.

        >>> sorted(distinct_permutations([1, 0, 1]))
        [(0, 1, 1), (1, 0, 1), (1, 1, 0)]

    Equivalent to ``set(permutations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    Duplicate permutations arise when there are duplicated elements in the
    input iterable. The number of items returned is
    `n! / (x_1! * x_2! * ... * x_n!)`, where `n` is the total number of
    items input, and each `x_i` is the count of a distinct item in the input
    sequence.

    If *r* is given, only the *r*-length permutations are yielded.

        >>> sorted(distinct_permutations([1, 0, 1], r=2))
        [(0, 1), (1, 0), (1, 1)]
        >>> sorted(distinct_permutations(range(3), r=2))
        [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

    c3s	t|VtdddD]}||||dkrnqdStd|dD]}||||kr4nq(||||||<||<|d|d||dd<q)NTrr,)tuplerange)Aijsizerr_full^s
z$distinct_permutations.._fullc	ss4|d|||d}}t|ddd}tt|}	t|V|d}|D]}|||kr2n||}q(dS|D]}||||krT||||||<||<nq;|D]}||||krp||||||<||<nqW||d||d7}|d7}|d|||||d||d<|dd<q)Nr,r)rrr)	rrheadtailZright_head_indexesZleft_tail_indexesZpivotrrrrr_partialvs4

2z'distinct_permutations.._partialNrr)r)sortedrr)rrrrrrrrrDEs'rDcCsX|dkrtd|dkrttt||ddSt|g}t||}ttt||ddS)a6Intersperse filler element *e* among the items in *iterable*, leaving
    *n* items between each filler element.

        >>> list(intersperse('!', [1, 2, 3, 4, 5]))
        [1, '!', 2, '!', 3, '!', 4, '!', 5]

        >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2))
        [1, 2, None, 3, 4, None, 5]

    rz
n must be > 0r,N)rrrMrr9r.)rrrZfillerchunksrrrrNs

rNcsFdd|D}tttt|fddDfdd|DS)aReturn the elements from each of the input iterables that aren't in the
    other input iterables.

    For example, suppose you have a set of packages, each with a set of
    dependencies::

        {'pkg_1': {'A', 'B'}, 'pkg_2': {'B', 'C'}, 'pkg_3': {'B', 'D'}}

    If you remove one package, which dependencies can also be removed?

    If ``pkg_1`` is removed, then ``A`` is no longer necessary - it is not
    associated with ``pkg_2`` or ``pkg_3``. Similarly, ``C`` is only needed for
    ``pkg_2``, and ``D`` is only needed for ``pkg_3``::

        >>> unique_to_each({'A', 'B'}, {'B', 'C'}, {'B', 'D'})
        [['A'], ['C'], ['D']]

    If there are duplicates in one input iterable that aren't in the others
    they will be duplicated in the output. Input order is preserved::

        >>> unique_to_each("mississippi", "missouri")
        [['p', 'p'], ['o', 'u', 'r']]

    It is assumed that the elements of each iterable are hashable.

    cSsg|]}t|qSr)r.0rrrr
z"unique_to_each..csh|]
}|dkr|qSr,r)relement)countsrr	z!unique_to_each..csg|]
}ttj|qSr)rfilter__contains__r)uniquesrrrr)rr
from_iterablemapset)rpoolr)rrrrysryccs|dkr	td|dkrtVdS|dkrtdt|d}|}t|j|D]}|d8}|s7|}t|Vq(t|}||krOtt|t|||VdSd|kr\t||krmndS||f|7}t|VdSdS)aMReturn a sliding window of width *n* over the given iterable.

        >>> all_windows = windowed([1, 2, 3, 4, 5], 3)
        >>> list(all_windows)
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    When the window is larger than the iterable, *fillvalue* is used in place
    of missing values:

        >>> list(windowed([1, 2, 3], 4))
        [(1, 2, 3, None)]

    Each window will advance in increments of *step*:

        >>> list(windowed([1, 2, 3, 4, 5, 6], 3, fillvalue='!', step=2))
        [(1, 2, 3), (3, 4, 5), (5, 6, '!')]

    To slide into the iterable's items, use :func:`chain` to add filler items
    to the left:

        >>> iterable = [1, 2, 3, 4]
        >>> n = 3
        >>> padding = [None] * (n - 1)
        >>> list(windowed(chain(padding, iterable), 3))
        [(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
    rn must be >= 0Nr,zstep must be >= 1r)	rrrrrrrrr)seqr	fillvaluerZwindowr_rrrrr{s.

 r{ccsvg}t|D]}|||fVqt|}t|}td|dD]}t||dD]}||||Vq,q"dS)aFYield all of the substrings of *iterable*.

        >>> [''.join(s) for s in substrings('more')]
        ['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']

    Note that non-string iterables can also be subdivided.

        >>> list(substrings([0, 1, 2]))
        [(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)]

    rr,N)rrrrr)rritem
item_countrrrrrrvs


rvcs0tdtd}|rt|}fdd|DS)a@Yield all substrings and their positions in *seq*

    The items yielded will be a tuple of the form ``(substr, i, j)``, where
    ``substr == seq[i:j]``.

    This function only works for iterables that support slicing, such as
    ``str`` objects.

    >>> for item in substrings_indexes('more'):
    ...    print(item)
    ('m', 0, 1)
    ('o', 1, 2)
    ('r', 2, 3)
    ('e', 3, 4)
    ('mo', 0, 2)
    ('or', 1, 3)
    ('re', 2, 4)
    ('mor', 0, 3)
    ('ore', 1, 4)
    ('more', 0, 4)

    Set *reverse* to ``True`` to yield the same items in the opposite order.


    r,c3sD|]}tt|dD]}||||||fVqqdSr,N)rr)rLrrrr	Nsz%substrings_indexes..)rrr)rreverserrrrrw1s
rwc@s:eZdZdZd
ddZddZddZd	d
ZddZdS)r7aWrap *iterable* and return an object that buckets it iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    NcCs,t||_||_tt|_|pdd|_dS)NcSsdSNTrxrrr{z!bucket.__init__..)rr_keyrrr
_validator)rrkey	validatorrrrrws

zbucket.__init__cCsH||sdSzt||}Wn
tyYdSw|j||dSr)rrrr
appendleft)rvaluerrrrr}s
zbucket.__contains__ccs~	|j|r|j|Vn.	zt|j}Wn
ty"YdSw||}||kr0|Vn||r=|j||qq)z
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        TN)rrrrrr
rr)rrr
item_valuerrr_get_valuess$


zbucket._get_valuesccsF|jD]}||}||r|j||q|jEdHdSr)rr
rrrkeys)rrrrrrrs


zbucket.__iter__cCs||s	tdS||S)Nr)rrrrrrrrrs

zbucket.__getitem__r)	rrrrrrrrrrrrrr7Ss
#
r7cCs$t|}t||}|t||fS)aReturn a 2-tuple with a list containing the first *n* elements of
    *iterable*, and an iterator with the same items as *iterable*.
    This allows you to "look ahead" at the items in the iterable without
    advancing it.

    There is one item in the list by default:

        >>> iterable = 'abcdefg'
        >>> head, iterable = spy(iterable)
        >>> head
        ['a']
        >>> list(iterable)
        ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    You may use unpacking to retrieve items instead of lists:

        >>> (head,), iterable = spy('abcdefg')
        >>> head
        'a'
        >>> (first, second), iterable = spy('abcdefg', 2)
        >>> first
        'a'
        >>> second
        'b'

    The number of items requested can be larger than the number of items in
    the iterable:

        >>> iterable = [1, 2, 3, 4, 5]
        >>> head, iterable = spy(iterable, 10)
        >>> head
        [1, 2, 3, 4, 5]
        >>> list(iterable)
        [1, 2, 3, 4, 5]

    )rr1copyr)rrrrrrrrss%
rscGstt|S)a4Return a new iterable yielding from each iterable in turn,
    until the shortest is exhausted.

        >>> list(interleave([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7]

    For a version that doesn't terminate after the shortest iterable is
    exhausted, see :func:`interleave_longest`.

    )rrr)rrrrrMsrMcGs"tt|dti}dd|DS)asReturn a new iterable yielding from each iterable in turn,
    skipping any that are exhausted.

        >>> list(interleave_longest([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7, 3, 8]

    This function produces the same output as :func:`roundrobin`, but may
    perform better for some inputs (in particular when the number of iterables
    is large).

    rcss|]	}|tur|VqdSr)r)rr
rrrrz%interleave_longest..)rrrr)rrrrrrLsrLc#s&fdd|dEdHdS)a>Flatten an iterable with multiple levels of nesting (e.g., a list of
    lists of tuples) into non-iterable types.

        >>> iterable = [(1, 2), ([3, 4], [[5], [6]])]
        >>> list(collapse(iterable))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and
    will not be collapsed.

    To avoid collapsing other types, specify *base_type*:

        >>> iterable = ['ab', ('cd', 'ef'), ['gh', 'ij']]
        >>> list(collapse(iterable, base_type=tuple))
        ['ab', ('cd', 'ef'), 'gh', 'ij']

    Specify *levels* to stop flattening after a certain level:

    >>> iterable = [('a', ['b']), ('c', ['d'])]
    >>> list(collapse(iterable))  # Fully flattened
    ['a', 'b', 'c', 'd']
    >>> list(collapse(iterable, levels=1))  # Only one level flattened
    ['a', ['b'], 'c', ['d']]

    c3sdur	|kst|ttfsdurt|r|VdSzt|}Wn
ty1|VYdSw|D]}||dEdHq4dSNr,)rstrbytesrr)nodeleveltreechild	base_typelevelswalkrrr#s zcollapse..walkrNr)rr!r"rr rr;sr;ccsz5|dur	||dur|D]	}|||Vqnt||D]}|||EdHqW|dur5|dSdS|dur?|ww)auInvoke *func* on each item in *iterable* (or on each *chunk_size* group
    of items) before yielding the item.

    `func` must be a function that takes a single argument. Its return value
    will be discarded.

    *before* and *after* are optional functions that take no arguments. They
    will be executed before iteration starts and after it ends, respectively.

    `side_effect` can be used for logging, updating progress bars, or anything
    that is not functionally "pure."

    Emitting a status message:

        >>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> func = lambda x: print(x, file=f)
        >>> before = lambda: print(u'HEADER', file=f)
        >>> after = f.close
        >>> it = [u'a', u'b', u'c']
        >>> consume(side_effect(func, it, before=before, after=after))
        >>> f.closed
        True

    N)r9)rr
chunk_sizebeforeafterrrrrrrk,s$,
rkcs@ttfddtdD|rfdd}t|SS)apYield slices of length *n* from the sequence *seq*.

    >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
    [(1, 2, 3), (4, 5, 6)]

    By the default, the last yielded slice will have fewer than *n* elements
    if the length of *seq* is not divisible by *n*:

    >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
    [(1, 2, 3), (4, 5, 6), (7, 8)]

    If the length of *seq* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    slice is yielded.

    This function will only work for iterables that support slicing.
    For non-sliceable iterables, see :func:`chunked`.

    c3s |]}||VqdSrrrr)rrrrr}zsliced..rc3r)Nzseq is not divisible by n.r)Z_slicerrrrrzsliced..ret)rrrr)rrrrr)rrrrrlis
 
rlrccs|dkrt|VdSg}t|}|D]'}||r6|V|r#|gV|dkr/t|VdSg}|d8}q||q|VdS)a<Yield lists of items from *iterable*, where each list is delimited by
    an item where callable *pred* returns ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b'))
        [['a'], ['c', 'd', 'c'], ['a']]

        >>> list(split_at(range(10), lambda n: n % 2 == 1))
        [[0], [2], [4], [6], [8], []]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_at(range(10), lambda n: n % 2 == 1, maxsplit=2))
        [[0], [2], [4, 5, 6, 7, 8, 9]]

    By default, the delimiting items are not included in the output.
    The include them, set *keep_separator* to ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b', keep_separator=True))
        [['a'], ['b'], ['c', 'd', 'c'], ['b'], ['a']]

    rNr,rrr)rpredmaxsplitZkeep_separatorbufrrrrrrns$



rnccs|dkrt|VdSg}t|}|D]%}||r4|r4|V|dkr.|gt|VdSg}|d8}||q|rA|VdSdS)a\Yield lists of items from *iterable*, where each list ends just before
    an item for which callable *pred* returns ``True``:

        >>> list(split_before('OneTwo', lambda s: s.isupper()))
        [['O', 'n', 'e'], ['T', 'w', 'o']]

        >>> list(split_before(range(10), lambda n: n % 3 == 0))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_before(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]
    rNr,r)rr*r+r,rrrrrrps$

rpccs|dkrt|VdSg}t|}|D]"}||||r6|r6|V|dkr0t|VdSg}|d8}q|r>|VdSdS)a[Yield lists of items from *iterable*, where each list ends with an
    item where callable *pred* returns ``True``:

        >>> list(split_after('one1two2', lambda s: s.isdigit()))
        [['o', 'n', 'e', '1'], ['t', 'w', 'o', '2']]

        >>> list(split_after(range(10), lambda n: n % 3 == 0))
        [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_after(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0], [1, 2, 3], [4, 5, 6, 7, 8, 9]]

    rNr,r)r-rrrros&



roccs|dkrt|VdSt|}zt|}Wn
ty YdSw|g}|D]&}|||rE|V|dkr?|gt|VdSg}|d8}|||}q&|VdS)aSplit *iterable* into pieces based on the output of *pred*.
    *pred* should be a function that takes successive pairs of items and
    returns ``True`` if the iterable should be split in between them.

    For example, to find runs of increasing numbers, split the iterable when
    element ``i`` is larger than element ``i + 1``:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2], lambda x, y: x > y))
        [[1, 2, 3, 3], [2, 5], [2, 4], [2]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2],
        ...                 lambda x, y: x > y, maxsplit=2))
        [[1, 2, 3, 3], [2, 5], [2, 4, 2]]

    rNr,)rrrrr)rr*r+rZcur_itemr,Z	next_itemrrrrqs,



rqccs@t|}|D]}|durt|VdStt||VqdS)aYield a list of sequential items from *iterable* of length 'n' for each
    integer 'n' in *sizes*.

        >>> list(split_into([1,2,3,4,5,6], [1,2,3]))
        [[1], [2, 3], [4, 5, 6]]

    If the sum of *sizes* is smaller than the length of *iterable*, then the
    remaining items of *iterable* will not be returned.

        >>> list(split_into([1,2,3,4,5,6], [2,3]))
        [[1, 2], [3, 4, 5]]

    If the sum of *sizes* is larger than the length of *iterable*, fewer items
    will be returned in the iteration that overruns *iterable* and further
    lists will be empty:

        >>> list(split_into([1,2,3,4], [1,2,3,4]))
        [[1], [2, 3], [4], []]

    When a ``None`` object is encountered in *sizes*, the returned list will
    contain items up to the end of *iterable* the same way that itertools.slice
    does:

        >>> list(split_into([1,2,3,4,5,6,7,8,9,0], [2,3,None]))
        [[1, 2], [3, 4, 5], [6, 7, 8, 9, 0]]

    :func:`split_into` can be useful for grouping a series of items where the
    sizes of the groups are not uniform. An example would be where in a row
    from a table, multiple columns represent elements of the same feature
    (e.g. a point represented by x,y,z) but, the format is not the same for
    all columns.
    N)rrr)rsizesrrrrrrr+s#
rrc	cst|}|durt|t|EdHdS|dkrtdd}|D]	}|V|d7}q!|r3|||n||}t|D]}|Vq;dS)aYield the elements from *iterable*, followed by *fillvalue*, such that
    at least *n* items are emitted.

        >>> list(padded([1, 2, 3], '?', 5))
        [1, 2, 3, '?', '?']

    If *next_multiple* is ``True``, *fillvalue* will be emitted until the
    number of items emitted is a multiple of *n*::

        >>> list(padded([1, 2, 3, 4], n=3, next_multiple=True))
        [1, 2, 3, 4, None, None]

    If *n* is ``None``, *fillvalue* will be emitted indefinitely.

    Nr,n must be at least 1r)rrrrr)	rrrZ
next_multiplerrr	remainingrrrrr_Xs
r_ccs8t}|D]}|Vq|tur|n|}t|EdHdS)a"After the *iterable* is exhausted, keep yielding its last element.

        >>> list(islice(repeat_last(range(3)), 5))
        [0, 1, 2, 2, 2]

    If the iterable is empty, yield *default* forever::

        >>> list(islice(repeat_last(range(0), 42), 5))
        [42, 42, 42, 42, 42]

    N)rr)rrrfinalrrrrcxsrccs0dkrtdt|}fddt|DS)aDistribute the items from *iterable* among *n* smaller iterables.

        >>> group_1, group_2 = distribute(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 3, 5]
        >>> list(group_2)
        [2, 4, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = distribute(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 4, 7], [2, 5], [3, 6]]

    If the length of *iterable* is smaller than *n*, then the last returned
    iterables will be empty:

        >>> children = distribute(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function uses :func:`itertools.tee` and may require significant
    storage. If you need the order items in the smaller iterables to match the
    original iterable, see :func:`divide`.

    r,r/csg|]\}}t||dqSr)r)rrrrrrrszdistribute..)rr	enumerate)rrchildrenrr2rrEs
rErrr,cCs t|t|}t||||dS)a[Yield tuples whose elements are offset from *iterable*.
    The amount by which the `i`-th item in each tuple is offset is given by
    the `i`-th item in *offsets*.

        >>> list(stagger([0, 1, 2, 3]))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3)]
        >>> list(stagger(range(8), offsets=(0, 2, 4)))
        [(0, 2, 4), (1, 3, 5), (2, 4, 6), (3, 5, 7)]

    By default, the sequence will end when the final element of a tuple is the
    last item in the iterable. To continue until the first element of a tuple
    is the last item in the iterable, set *longest* to ``True``::

        >>> list(stagger([0, 1, 2, 3], longest=True))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3), (2, 3, None), (3, None, None)]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    )offsetslongestr)rrr)rr6r7rr4rrrrtsrtcseZdZdfdd	ZZS)r}Ncs*d}|dur
|dj|7}t|dS)Nz Iterables have different lengthsz/: index 0 has length {}; index {} has length {})rsuperr)rdetailsr	__class__rrrszUnequalIterablesError.__init__r)rrrr
__classcell__rrr:rr}sr}ccs8t|dtiD]}|D]	}|turtq|VqdS)Nr)rrr})rZcombovalrrr_zip_equal_generatorsr>cGstdkr
tdtz+t|d}t|dddD]\}}t|}||kr(nqt|WSt|||fdtyBt	|YSw)a ``zip`` the input *iterables* together, but raise
    ``UnequalIterablesError`` if they aren't all the same length.

        >>> it_1 = range(3)
        >>> it_2 = iter('abc')
        >>> list(zip_equal(it_1, it_2))
        [(0, 'a'), (1, 'b'), (2, 'c')]

        >>> it_1 = range(3)
        >>> it_2 = iter('abcd')
        >>> list(zip_equal(it_1, it_2)) # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        more_itertools.more.UnequalIterablesError: Iterables have different
        lengths

    i
zwzip_equal will be removed in a future version of more-itertools. Use the builtin zip function with strict=True instead.rr,N)r9)
r)rrrrr3rr}rr>)rZ
first_sizerrrrrrr~s"	
r~)r7rcGst|t|krtdg}t||D](\}}|dkr(|tt|||q|dkr6|t||dq||q|rEt|d|iSt|S)aF``zip`` the input *iterables* together, but offset the `i`-th iterable
    by the `i`-th item in *offsets*.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1)))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e')]

    This can be used as a lightweight alternative to SciPy or pandas to analyze
    data sets in which some series have a lead or lag relationship.

    By default, the sequence will end when the shortest iterable is exhausted.
    To continue until the longest iterable is exhausted, set *longest* to
    ``True``.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1), longest=True))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e'), (None, 'f')]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    z,Number of iterables and offsets didn't matchrNr)rrrrrrrr)r6r7rr	staggeredrrrrrrsrrcsndur	t|}n!t|}t|dkr|dfdd}nt|fdd}tttt|||dS)aReturn the input iterables sorted together, with *key_list* as the
    priority for sorting. All iterables are trimmed to the length of the
    shortest one.

    This can be used like the sorting function in a spreadsheet. If each
    iterable represents a column of data, the key list determines which
    columns are used for sorting.

    By default, all iterables are sorted using the ``0``-th iterable::

        >>> iterables = [(4, 3, 2, 1), ('a', 'b', 'c', 'd')]
        >>> sort_together(iterables)
        [(1, 2, 3, 4), ('d', 'c', 'b', 'a')]

    Set a different key list to sort according to another iterable.
    Specifying multiple keys dictates how ties are broken::

        >>> iterables = [(3, 1, 2), (0, 1, 0), ('c', 'b', 'a')]
        >>> sort_together(iterables, key_list=(1, 2))
        [(2, 3, 1), (0, 0, 1), ('a', 'c', 'b')]

    To sort by a function of the elements of the iterable, pass a *key*
    function. Its arguments are the elements of the iterables corresponding to
    the key list::

        >>> names = ('a', 'b', 'c')
        >>> lengths = (1, 2, 3)
        >>> widths = (5, 2, 1)
        >>> def area(length, width):
        ...     return length * width
        >>> sort_together([names, lengths, widths], key_list=(1, 2), key=area)
        [('c', 'b', 'a'), (3, 2, 1), (1, 2, 5)]

    Set *reverse* to ``True`` to sort in descending order.

        >>> sort_together([(1, 2, 3), ('c', 'b', 'a')], reverse=True)
        [(3, 2, 1), ('a', 'b', 'c')]

    Nr,rcs|SrrZzipped_items)r
key_offsetrrrfszsort_together..cs|SrrrA)
get_key_itemsrrrrks)rr)r$rrrr)rZkey_listrrZkey_argumentr)rCrrBrrm2s(
rmcsPtt|\}}|sdS|d}t|t|}ddtfddt|DS)aThe inverse of :func:`zip`, this function disaggregates the elements
    of the zipped *iterable*.

    The ``i``-th iterable contains the ``i``-th element from each element
    of the zipped iterable. The first element is used to to determine the
    length of the remaining elements.

        >>> iterable = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> letters, numbers = unzip(iterable)
        >>> list(letters)
        ['a', 'b', 'c', 'd']
        >>> list(numbers)
        [1, 2, 3, 4]

    This is similar to using ``zip(*iterable)``, but it avoids reading
    *iterable* into memory. Note, however, that this function uses
    :func:`itertools.tee` and thus may require significant storage.

    rrcsfdd}|S)Ncsz|WStytwr)rr)objrrrgetters


z)unzip..itemgetter..getterr)rrFrrErr$szunzip..itemgetterc3s"|]\}}t||VqdSrr)rrrr$rrr zunzip..)rsrrrrr3)rrrrrHrrztsrzc	Cs|dkrtdz|ddWn
tyt|}Ynw|}tt||\}}g}d}td|dD]}|}|||krA|dn|7}|t|||q4|S)aDivide the elements from *iterable* into *n* parts, maintaining
    order.

        >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 2, 3]
        >>> list(group_2)
        [4, 5, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = divide(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 2, 3], [4, 5], [6, 7]]

    If the length of the iterable is smaller than n, then the last returned
    iterables will be empty:

        >>> children = divide(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function will exhaust the iterable before returning and may require
    significant storage. If order is not important, see :func:`distribute`,
    which does not first pull the iterable into memory.

    r,r/Nr)rrrdivmodrrrr)	rrrqrrrrrrrrrFs rFcCsT|durtdS|durt||rt|fSzt|WSty)t|fYSw)axIf *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    Nr)rrr)rDr!rrrr5s)

r5cCsZ|dkrtdt|\}}dg|}t|t|||}ttt|d|d}t||S)asReturn an iterable over `(bool, item)` tuples where the `item` is
    drawn from *iterable* and the `bool` indicates whether
    that item satisfies the *predicate* or is adjacent to an item that does.

    For example, to find whether items are adjacent to a ``3``::

        >>> list(adjacent(lambda x: x == 3, range(6)))
        [(False, 0), (False, 1), (True, 2), (True, 3), (True, 4), (False, 5)]

    Set *distance* to change what counts as adjacent. For example, to find
    whether items are two places away from a ``3``:

        >>> list(adjacent(lambda x: x == 3, range(6), distance=2))
        [(False, 0), (True, 1), (True, 2), (True, 3), (True, 4), (True, 5)]

    This is useful for contextualizing the results of a search function.
    For example, a code comparison tool might want to identify lines that
    have changed, but also surrounding lines to give the viewer of the diff
    context.

    The predicate function will only be called once for each item in the
    iterable.

    See also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    rzdistance must be at least 0Frr,)rrrranyr{r)	predicaterdistancei1i2paddingselectedZadjacent_to_selectedrrrr4
s

r4cs:t||}rfdd|D}rfdd|D}|S)aAn extension of :func:`itertools.groupby` that can apply transformations
    to the grouped data.

    * *keyfunc* is a function computing a key value for each item in *iterable*
    * *valuefunc* is a function that transforms the individual items from
      *iterable* after grouping
    * *reducefunc* is a function that transforms each group of items

    >>> iterable = 'aAAbBBcCC'
    >>> keyfunc = lambda k: k.upper()
    >>> valuefunc = lambda v: v.lower()
    >>> reducefunc = lambda g: ''.join(g)
    >>> list(groupby_transform(iterable, keyfunc, valuefunc, reducefunc))
    [('A', 'aaa'), ('B', 'bbb'), ('C', 'ccc')]

    Each optional argument defaults to an identity function if not specified.

    :func:`groupby_transform` is useful when grouping elements of an iterable
    using a separate iterable as the key. To do this, :func:`zip` the iterables
    and pass a *keyfunc* that extracts the first element and a *valuefunc*
    that extracts the second element::

        >>> from operator import itemgetter
        >>> keys = [0, 0, 1, 1, 1, 2, 2, 2, 3]
        >>> values = 'abcdefghi'
        >>> iterable = zip(keys, values)
        >>> grouper = groupby_transform(iterable, itemgetter(0), itemgetter(1))
        >>> [(k, ''.join(g)) for k, g in grouper]
        [(0, 'ab'), (1, 'cde'), (2, 'fgh'), (3, 'i')]

    Note that the order of items in the iterable is significant.
    Only adjacent items are grouped together, so if you don't want any
    duplicate groups, you should sort the iterable by the key function.

    c3s"|]\}}|t|fVqdSrrGrkg)	valuefuncrrrZrIz$groupby_transform..c3s |]\}}||fVqdSrrrS)
reducefuncrrr\r(r)rkeyfuncrVrWrr)rWrVrrJ4s
$rJc@seZdZdZeeddZddZddZddZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!S)"r\a<An extension of the built-in ``range()`` function whose arguments can
    be any orderable numeric type.

    With only *stop* specified, *start* defaults to ``0`` and *step*
    defaults to ``1``. The output items will match the type of *stop*:

        >>> list(numeric_range(3.5))
        [0.0, 1.0, 2.0, 3.0]

    With only *start* and *stop* specified, *step* defaults to ``1``. The
    output items will match the type of *start*:

        >>> from decimal import Decimal
        >>> start = Decimal('2.1')
        >>> stop = Decimal('5.1')
        >>> list(numeric_range(start, stop))
        [Decimal('2.1'), Decimal('3.1'), Decimal('4.1')]

    With *start*, *stop*, and *step*  specified the output items will match
    the type of ``start + step``:

        >>> from fractions import Fraction
        >>> start = Fraction(1, 2)  # Start at 1/2
        >>> stop = Fraction(5, 2)  # End at 5/2
        >>> step = Fraction(1, 2)  # Count by 1/2
        >>> list(numeric_range(start, stop, step))
        [Fraction(1, 2), Fraction(1, 1), Fraction(3, 2), Fraction(2, 1)]

    If *step* is zero, ``ValueError`` is raised. Negative steps are supported:

        >>> list(numeric_range(3, -1, -1.0))
        [3.0, 2.0, 1.0, 0.0]

    Be aware of the limitations of floating point numbers; the representation
    of the yielded numbers may be surprising.

    ``datetime.datetime`` objects can be used for *start* and *stop*, if *step*
    is a ``datetime.timedelta`` object:

        >>> import datetime
        >>> start = datetime.datetime(2019, 1, 1)
        >>> stop = datetime.datetime(2019, 1, 3)
        >>> step = datetime.timedelta(days=1)
        >>> items = iter(numeric_range(start, stop, step))
        >>> next(items)
        datetime.datetime(2019, 1, 1, 0, 0)
        >>> next(items)
        datetime.datetime(2019, 1, 2, 0, 0)

    rcGst|}|dkr |\|_t|jd|_t|j|jd|_n5|dkr6|\|_|_t|j|jd|_n|dkrC|\|_|_|_n|dkrNtd|td|t|jd|_|j|jkrgtd|j|jk|_	|
dS)Nr,rrz2numeric_range expected at least 1 argument, got {}z2numeric_range expected at most 3 arguments, got {}z&numeric_range() arg 3 must not be zero)r_stoptype_start_steprr_zeror_growing	_init_len)rrZargcrrrrs0znumeric_range.__init__cCs|jr	|j|jkS|j|jkSr)r`r]r[rrrrrsznumeric_range.__bool__cCsx|jr|j|kr|jkrndS||j|j|jkSdS|j|kr+|jkr:ndS|j||j|jkSdSNF)r`r]r[r^r_)relemrrrrsznumeric_range.__contains__cCs^t|tr-t|}t|}|s|r|o|S|j|jko,|j|jko,|d|dkSdS)NrF)rr\boolr]r^
_get_by_index)rotherZ
empty_selfZempty_otherrrr__eq__s



znumeric_range.__eq__cCst|tr
||St|trc|jdur|jn|j|j}|jdus)|j|jkr-|j}n|j|jkr7|j	}n||j}|j
dusH|j
|jkrL|j	}n|j
|jkrW|j}n||j
}t|||Std
t|j)Nz8numeric range indices must be integers or slices, not {})rintrerrr^r_lenr]r[rr\rrr\r)rrrrrrrrrs&


znumeric_range.__getitem__cCs"|rt|j|d|jfS|jSNr)hashr]rer^_EMPTY_HASHrrrr__hash__sznumeric_range.__hash__cs>fddtD}jrtttj|Stttj|S)Nc3s |]}j|jVqdSr)r]r^)rrrrrrr(z)numeric_range.__iter__..)rr`rrr'r[r()rvaluesrrrrsznumeric_range.__iter__cCs|jSr)rirrrr__len__sznumeric_range.__len__cCst|jr
|j}|j}|j}n
|j}|j}|j}||}||jkr%d|_dSt||\}}t|t||jk|_dSNr)r`r]r[r^r_rirJrh)rrrrrNrKrrrrras

znumeric_range._init_lencCst|j|j|jffSr)r\r]r[r^rrrr
__reduce__
sznumeric_range.__reduce__cCsB|jdkrdt|jt|jSdt|jt|jt|jS)Nr,znumeric_range({}, {})znumeric_range({}, {}, {}))r^rreprr]r[rrrr__repr__s
znumeric_range.__repr__cCs"tt|d|j|j|jSrj)rr\rer]r^rrrrrs
znumeric_range.__reversed__cCst||vSr)rhrrrrr!sznumeric_range.countcCs|jr&|j|kr|jkr%nn8t||j|j\}}||jkr%t|Sn#|j|kr2|jkrInnt|j||j\}}||jkrIt|Std|)Nz{} is not in numeric range)	r`r]r[rJr^r_rhrr)rrrKrrrrr$s

znumeric_range.indexcCs<|dkr	||j7}|dks||jkrtd|j||jS)Nrz'numeric range object index out of range)rirr]r^)rrrrrre2s

znumeric_range._get_by_indexN)rrrrrkrrlrrrrgrrmrrorarqrsrrrrerrrrr\as$3

r\cs<ts
tdS|durtnt|}fdd|DS)aCycle through the items from *iterable* up to *n* times, yielding
    the number of completed cycles along with each item. If *n* is omitted the
    process repeats indefinitely.

    >>> list(count_cycle('AB', 3))
    [(0, 'A'), (0, 'B'), (1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]

    rNc3s"|]}D]}||fVqqdSrr)rrrrrrrGrIzcount_cycle..)rrrr)rrrrrtrr@:s
	r@ccst|}zt|}Wn
tyYdSwztD]}|}t|}|dkd|fVqWdSty?|dkd|fVYdSw)aHYield 3-tuples of the form ``(is_first, is_last, item)``.

    >>> list(mark_ends('ABC'))
    [(True, False, 'A'), (False, False, 'B'), (False, True, 'C')]

    Use this when looping over an iterable to take special action on its first
    and/or last items:

    >>> iterable = ['Header', 100, 200, 'Footer']
    >>> total = 0
    >>> for is_first, is_last, item in mark_ends(iterable):
    ...     if is_first:
    ...         continue  # Skip the header
    ...     if is_last:
    ...         continue  # Skip the footer
    ...     total += item
    >>> print(total)
    300
    NrFT)rrrr)rrbrarrrrAJs 
rAcCsJ|dur
ttt||S|dkrtdt||td}ttt||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(locate([0, 1, 1, 0, 1, 0, 0]))
        [1, 2, 4]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item.

        >>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
        [1, 3]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(locate(iterable, pred=pred, window_size=3))
        [1, 5, 9]

    Use with :func:`seekable` to find indexes and then retrieve the associated
    items:

        >>> from itertools import count
        >>> from more_itertools import seekable
        >>> source = (3 * n + 1 if (n % 2) else n // 2 for n in count())
        >>> it = seekable(source)
        >>> pred = lambda x: x > 100
        >>> indexes = locate(it, pred=pred)
        >>> i = next(indexes)
        >>> it.seek(i)
        >>> next(it)
        106

    Nr,zwindow size must be at least 1r)rrrrr{rr)rr*window_sizerrrrrTos&rTcCs
t||S)aYield the items from *iterable*, but strip any from the beginning
    for which *pred* returns ``True``.

    For example, to remove a set of items from the start of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(lstrip(iterable, pred))
        [1, 2, None, 3, False, None]

    This function is analogous to to :func:`str.lstrip`, and is essentially
    an wrapper for :func:`itertools.dropwhile`.

    )rrr*rrrrUs
rUccsHg}|j}|j}|D]}||r||q|EdH||VqdS)aYield the items from *iterable*, but strip any from the end
    for which *pred* returns ``True``.

    For example, to remove a set of items from the end of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(rstrip(iterable, pred))
        [None, False, None, 1, 2, None, 3]

    This function is analogous to :func:`str.rstrip`.

    N)rclear)rr*cacheZcache_appendcache_clearr
rrrrfs

rfcCstt|||S)aYield the items from *iterable*, but strip any from the
    beginning and end for which *pred* returns ``True``.

    For example, to remove a set of items from both ends of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(strip(iterable, pred))
        [1, 2, None, 3]

    This function is analogous to :func:`str.strip`.

    )rfrUryrrrrusruc@0eZdZdZddZddZddZdd	Zd
S)rOaAn extension of :func:`itertools.islice` that supports negative values
    for *stop*, *start*, and *step*.

        >>> iterable = iter('abcdefgh')
        >>> list(islice_extended(iterable, -4, -1))
        ['e', 'f', 'g']

    Slices with negative values require some caching of *iterable*, but this
    function takes care to minimize the amount of memory required.

    For example, you can use a negative step with an infinite iterator:

        >>> from itertools import count
        >>> list(islice_extended(count(), 110, 99, -2))
        [110, 108, 106, 104, 102, 100]

    You can also use slice notation directly:

        >>> iterable = map(str, count())
        >>> it = islice_extended(iterable)[10:20:2]
        >>> list(it)
        ['10', '12', '14', '16', '18']

    cGs*t|}|rt|t||_dS||_dSr)r_islice_helperr	_iterable)rrrrrrrrs
zislice_extended.__init__cCrrrrrrrrrzislice_extended.__iter__cC
t|jSr)rrrrrrr	
zislice_extended.__next__cCs"t|tr
tt|j|Std)Nz4islice_extended.__getitem__ argument must be a slice)rrrOr~rr)rrrrrr	s
zislice_extended.__getitem__N)rrrrrrrrrrrrrOsrOccs|j}|j}|jdkrtd|jpd}|dkr|durdn|}|dkrstt|d|d}|r7|ddnd}t||d}|durG|}n|dkrQt||}nt||d}||}	|	dkrbdSt|d|	|D]\}
}|VqidS|dur|dkrt	t|||dtt|||d}t|D]\}
}|
}|
|dkr|V||qdSt||||EdHdS|durdn|}|dur	|dkr	|d}	tt|d|	d}|r|ddnd}|dkr||}}n
t||dd}}t||||D]\}
}|VqdS|dur|d}
t	t||
|
d|dkr%|}d}	n|dur1d}|d}	n
d}||}	|	dkr>dStt||	}||d|EdHdS)Nrz1step argument must be a non-zero integer or None.r,rr)
rrrrrr3rrrrrrr)rsrrrr{len_iterrrrrrZcached_itemmrrrr~
	sv







r~cCs*zt|WStytt|YSw)aAn extension of :func:`reversed` that supports all iterables, not
    just those which implement the ``Reversible`` or ``Sequence`` protocols.

        >>> print(*always_reversible(x for x in range(3)))
        2 1 0

    If the iterable is already reversible, this function returns the
    result of :func:`reversed()`. If the iterable is not reversible,
    this function will cache the remaining items in the iterable and
    yield them in reverse order, which may require significant storage.
    )rrrrtrrrr6j	s

r6cCrrrr	rrrr|	rrc#s8tt|fdddD]\}}ttd|Vq
dS)aYield groups of consecutive items using :func:`itertools.groupby`.
    The *ordering* function determines whether two items are adjacent by
    returning their position.

    By default, the ordering function is the identity function. This is
    suitable for finding runs of numbers:

        >>> iterable = [1, 10, 11, 12, 20, 30, 31, 32, 33, 40]
        >>> for group in consecutive_groups(iterable):
        ...     print(list(group))
        [1]
        [10, 11, 12]
        [20]
        [30, 31, 32, 33]
        [40]

    For finding runs of adjacent letters, try using the :meth:`index` method
    of a string of letters:

        >>> from string import ascii_lowercase
        >>> iterable = 'abcdfgilmnop'
        >>> ordering = ascii_lowercase.index
        >>> for group in consecutive_groups(iterable, ordering):
        ...     print(list(group))
        ['a', 'b', 'c', 'd']
        ['f', 'g']
        ['i']
        ['l', 'm', 'n', 'o', 'p']

    Each group of consecutive items is an iterator that shares it source with
    *iterable*. When an an output group is advanced, the previous group is
    no longer available unless its elements are copied (e.g., into a ``list``).

        >>> iterable = [1, 2, 11, 12, 21, 22]
        >>> saved_groups = []
        >>> for group in consecutive_groups(iterable):
        ...     saved_groups.append(list(group))  # Copy group elements
        >>> saved_groups
        [[1, 2], [11, 12], [21, 22]]

    cs|d|dSrrr	orderingrrr	rz$consecutive_groups..rr,N)rr3rr$)rrrTrUrrrr=|	s*r=)initialcCsXt|\}}zt|g}Wn
tytgYSw|dur!g}t|t|t||S)aThis function is the inverse of :func:`itertools.accumulate`. By default
    it will compute the first difference of *iterable* using
    :func:`operator.sub`:

        >>> from itertools import accumulate
        >>> iterable = accumulate([0, 1, 2, 3, 4])  # produces 0, 1, 3, 6, 10
        >>> list(difference(iterable))
        [0, 1, 2, 3, 4]

    *func* defaults to :func:`operator.sub`, but other functions can be
    specified. They will be applied as follows::

        A, B, C, D, ... --> A, func(B, A), func(C, B), func(D, C), ...

    For example, to do progressive division:

        >>> iterable = [1, 2, 6, 24, 120]
        >>> func = lambda x, y: x // y
        >>> list(difference(iterable, func))
        [1, 2, 3, 4, 5]

    If the *initial* keyword is set, the first element will be skipped when
    computing successive differences.

        >>> it = [10, 11, 13, 16]  # from accumulate([1, 2, 3], initial=10)
        >>> list(difference(it, initial=10))
        [1, 2, 3]

    N)rrrrrrr)rrrrvrurIrrrrB	srBc@r})rjaSReturn a read-only view of the sequence object *target*.

    :class:`SequenceView` objects are analogous to Python's built-in
    "dictionary view" types. They provide a dynamic view of a sequence's items,
    meaning that when the sequence updates, so does the view.

        >>> seq = ['0', '1', '2']
        >>> view = SequenceView(seq)
        >>> view
        SequenceView(['0', '1', '2'])
        >>> seq.append('3')
        >>> view
        SequenceView(['0', '1', '2', '3'])

    Sequence views support indexing, slicing, and length queries. They act
    like the underlying sequence, except they don't allow assignment:

        >>> view[1]
        '1'
        >>> view[1:-1]
        ['1', '2']
        >>> len(view)
        4

    Sequence views are useful as an alternative to copying, as they don't
    require (much) extra storage.

    cCst|tst||_dSr)rrr_target)rtargetrrrr	s

zSequenceView.__init__cCs
|j|Sr)r)rrrrrr	rzSequenceView.__getitem__cCrr)rrrrrrro	rzSequenceView.__len__cCsd|jjt|jS)Nz{}({}))rr;rrrrrrrrrs	szSequenceView.__repr__N)rrrrrrrorsrrrrrj	srjc@sNeZdZdZdddZddZddZd	d
ZefddZ	d
dZ
ddZdS)ria
Wrap an iterator to allow for seeking backward and forward. This
    progressively caches the items in the source iterable so they can be
    re-visited.

    Call :meth:`seek` with an index to seek to that position in the source
    iterable.

    To "reset" an iterator, seek to ``0``:

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> it.seek(0)
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> next(it)
        '3'

    You can also seek forward:

        >>> it = seekable((str(n) for n in range(20)))
        >>> it.seek(10)
        >>> next(it)
        '10'
        >>> it.seek(20)  # Seeking past the end of the source isn't a problem
        >>> list(it)
        []
        >>> it.seek(0)  # Resetting works even after hitting the end
        >>> next(it), next(it), next(it)
        ('0', '1', '2')

    Call :meth:`peek` to look ahead one item without advancing the iterator:

        >>> it = seekable('1234')
        >>> it.peek()
        '1'
        >>> list(it)
        ['1', '2', '3', '4']
        >>> it.peek(default='empty')
        'empty'

    Before the iterator is at its end, calling :func:`bool` on it will return
    ``True``. After it will return ``False``:

        >>> it = seekable('5678')
        >>> bool(it)
        True
        >>> list(it)
        ['5', '6', '7', '8']
        >>> bool(it)
        False

    You may view the contents of the cache with the :meth:`elements` method.
    That returns a :class:`SequenceView`, a view that updates automatically:

        >>> it = seekable((str(n) for n in range(10)))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> elements = it.elements()
        >>> elements
        SequenceView(['0', '1', '2'])
        >>> next(it)
        '3'
        >>> elements
        SequenceView(['0', '1', '2', '3'])

    By default, the cache grows as the source iterable progresses, so beware of
    wrapping very large or infinite iterables. Supply *maxlen* to limit the
    size of the cache (this of course limits how far back you can seek).

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()), maxlen=2)
        >>> next(it), next(it), next(it), next(it)
        ('0', '1', '2', '3')
        >>> list(it.elements())
        ['2', '3']
        >>> it.seek(0)
        >>> next(it), next(it), next(it), next(it)
        ('2', '3', '4', '5')
        >>> next(it)
        '6'

    NcCs0t||_|dur
g|_ntg||_d|_dSr)r_sourcerr_index)rrrrrrrY
s


zseekable.__init__cCrrrrrrrra
rzseekable.__iter__cCs`|jdur#z|j|j}Wntyd|_Yn
w|jd7_|St|j}|j||Sr)rrrrrrrrrrrrd
s


zseekable.__next__cCrrrrrrrrr
rzseekable.__bool__cCsVzt|}Wnty|tur|YSw|jdur"t|j|_|jd8_|Sr)rrrrrr)rrZpeekedrrrry
s
z
seekable.peekcCrr)rjrrrrrelements
rzseekable.elementscCs.||_|t|j}|dkrt||dSdSrp)rrrr-)rr	remainderrrrseek
s
z
seekable.seekr)rrrrrrrrrrrrrrrrri
s
Uric@s(eZdZdZeddZeddZdS)rga
    :func:`run_length.encode` compresses an iterable with run-length encoding.
    It yields groups of repeated items with the count of how many times they
    were repeated:

        >>> uncompressed = 'abbcccdddd'
        >>> list(run_length.encode(uncompressed))
        [('a', 1), ('b', 2), ('c', 3), ('d', 4)]

    :func:`run_length.decode` decompresses an iterable that was previously
    compressed with run-length encoding. It yields the items of the
    decompressed iterable:

        >>> compressed = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> list(run_length.decode(compressed))
        ['a', 'b', 'b', 'c', 'c', 'c', 'd', 'd', 'd', 'd']

    cCsddt|DS)Ncss |]\}}|t|fVqdSr)rKrSrrrr
r(z$run_length.encode..rXrtrrrencode
szrun_length.encodecCstdd|DS)Ncss|]
\}}t||VqdSr)r)rrTrrrrr
z$run_length.decode..)rrrtrrrdecode
szrun_length.decodeN)rrrrstaticmethodrrrrrrrg
s
rgcCstt|dt|||kS)aReturn ``True`` if exactly ``n`` items in the iterable are ``True``
    according to the *predicate* function.

        >>> exactly_n([True, True, False], 2)
        True
        >>> exactly_n([True, True, False], 1)
        False
        >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
        True

    The iterable will be advanced until ``n + 1`` truthy items are encountered,
    so avoid calling it on infinite iterables.

    r,)rr1r)rrrMrrrrG
srGcCs$t|}tt|tt|t|S)zReturn a list of circular shifts of *iterable*.

    >>> circular_shifts(range(4))
    [(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
    )rr1rr{r)rlstrrrr:
sr:csfdd}|S)aReturn a decorator version of *wrapping_func*, which is a function that
    modifies an iterable. *result_index* is the position in that function's
    signature where the iterable goes.

    This lets you use itertools on the "production end," i.e. at function
    definition. This can augment what the function returns without changing the
    function's code.

    For example, to produce a decorator version of :func:`chunked`:

        >>> from more_itertools import chunked
        >>> chunker = make_decorator(chunked, result_index=0)
        >>> @chunker(3)
        ... def iter_range(n):
        ...     return iter(range(n))
        ...
        >>> list(iter_range(9))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

    To only allow truthy items to be returned:

        >>> truth_serum = make_decorator(filter, result_index=1)
        >>> @truth_serum(bool)
        ... def boolean_test():
        ...     return [0, 1, '', ' ', False, True]
        ...
        >>> list(boolean_test())
        [1, ' ', True]

    The :func:`peekable` and :func:`seekable` wrappers make for practical
    decorators:

        >>> from more_itertools import peekable
        >>> peekable_function = make_decorator(peekable)
        >>> @peekable_function()
        ... def str_range(*args):
        ...     return (str(x) for x in range(*args))
        ...
        >>> it = str_range(1, 20, 2)
        >>> next(it), next(it), next(it)
        ('1', '3', '5')
        >>> it.peek()
        '7'
        >>> next(it)
        '7'

    csfdd}|S)Ncsfdd}|S)Ncs0|i|}t}|||iSr)rinsert)rrresultZwrapping_args_)fresult_index
wrapping_args
wrapping_funcwrapping_kwargsrr
inner_wrapper
szOmake_decorator..decorator..outer_wrapper..inner_wrapperr)rr)rrrr)rr
outer_wrapper
sz8make_decorator..decorator..outer_wrapperr)rrrrr)rrr	decorator
s	z!make_decorator..decoratorr)rrrrrrrV
s2rVc	Cst|durddn|}tt}|D]}||}||}|||q|dur5|D]
\}}||||<q*d|_|S)aReturn a dictionary that maps the items in *iterable* to categories
    defined by *keyfunc*, transforms them with *valuefunc*, and
    then summarizes them by category with *reducefunc*.

    *valuefunc* defaults to the identity function if it is unspecified.
    If *reducefunc* is unspecified, no summarization takes place:

        >>> keyfunc = lambda x: x.upper()
        >>> result = map_reduce('abbccc', keyfunc)
        >>> sorted(result.items())
        [('A', ['a']), ('B', ['b', 'b']), ('C', ['c', 'c', 'c'])]

    Specifying *valuefunc* transforms the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> result = map_reduce('abbccc', keyfunc, valuefunc)
        >>> sorted(result.items())
        [('A', [1]), ('B', [1, 1]), ('C', [1, 1, 1])]

    Specifying *reducefunc* summarizes the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> reducefunc = sum
        >>> result = map_reduce('abbccc', keyfunc, valuefunc, reducefunc)
        >>> sorted(result.items())
        [('A', 1), ('B', 2), ('C', 3)]

    You may want to filter the input iterable before applying the map/reduce
    procedure:

        >>> all_items = range(30)
        >>> items = [x for x in all_items if 10 <= x <= 20]  # Filter
        >>> keyfunc = lambda x: x % 2  # Evens map to 0; odds to 1
        >>> categories = map_reduce(items, keyfunc=keyfunc)
        >>> sorted(categories.items())
        [(0, [10, 12, 14, 16, 18, 20]), (1, [11, 13, 15, 17, 19])]
        >>> summaries = map_reduce(items, keyfunc=keyfunc, reducefunc=sum)
        >>> sorted(summaries.items())
        [(0, 90), (1, 75)]

    Note that all items in the iterable are gathered into a list before the
    summarization step, which may require significant storage.

    The returned object is a :obj:`collections.defaultdict` with the
    ``default_factory`` set to ``None``, such that it behaves like a normal
    dictionary.

    NcSrrrr	rrrr<rzmap_reduce..)rrrrdefault_factory)	rrYrVrWrrrrZ
value_listrrrrX	s3rXcsV|dur!zt|fddtt||DWSty Ynwttt|||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``, starting from the right and moving left.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(rlocate([0, 1, 1, 0, 1, 0, 0]))  # Truthy at 1, 2, and 4
        [4, 2, 1]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item:

        >>> iterable = iter('abcb')
        >>> pred = lambda x: x == 'b'
        >>> list(rlocate(iterable, pred))
        [3, 1]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(rlocate(iterable, pred=pred, window_size=3))
        [9, 5, 1]

    Beware, this function won't return anything for infinite iterables.
    If *iterable* is reversible, ``rlocate`` will reverse it and search from
    the right. Otherwise, it will search from the left and return the results
    in reverse order.

    See :func:`locate` to for other example applications.

    Nc3s|]	}|dVqdSrrr'rrrrprzrlocate..)rrTrrr)rr*rxrrrreLs!rec	cs|dkr	tdt|}t|tg|d}t||}d}|D],}||r?|dus.||kr?|d7}|EdHt||dq |rL|dturL|dVq dS)aYYield the items from *iterable*, replacing the items for which *pred*
    returns ``True`` with the items from the iterable *substitutes*.

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
        >>> pred = lambda x: x == 0
        >>> substitutes = (2, 3)
        >>> list(replace(iterable, pred, substitutes))
        [1, 1, 2, 3, 1, 1, 2, 3, 1, 1]

    If *count* is given, the number of replacements will be limited:

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1, 0]
        >>> pred = lambda x: x == 0
        >>> substitutes = [None]
        >>> list(replace(iterable, pred, substitutes, count=2))
        [1, 1, None, 1, 1, None, 1, 1, 0]

    Use *window_size* to control the number of items passed as arguments to
    *pred*. This allows for locating and replacing subsequences.

        >>> iterable = [0, 1, 2, 5, 0, 1, 2, 5]
        >>> window_size = 3
        >>> pred = lambda *args: args == (0, 1, 2)  # 3 items passed to pred
        >>> substitutes = [3, 4] # Splice in these items
        >>> list(replace(iterable, pred, substitutes, window_size=window_size))
        [3, 4, 5, 3, 4, 5]

    r,zwindow_size must be at least 1rN)rrrrr{r-)	rr*ZsubstitutesrrxrZwindowsrwrrrrdws$


rdc#sNt|t}ttd|D]}fddtd|||fDVqdS)a"Yield all possible order-preserving partitions of *iterable*.

    >>> iterable = 'abc'
    >>> for part in partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['a', 'b', 'c']

    This is unrelated to :func:`partition`.

    r,csg|]
\}}||qSrr)rrrsequencerrrrzpartitions..r@N)rrr0rr)rrrrrrr`s&r`c#st|}t|}|dur|dkrtd||krdSfdd|dur9td|dD]
}||EdHq,dS||EdHdS)a
    Yield the set partitions of *iterable* into *k* parts. Set partitions are
    not order-preserving.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable, 2):
    ...     print([''.join(p) for p in part])
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']


    If *k* is not given, every set partition is generated.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']
    ['a', 'b', 'c']

    Nr,z6Can't partition in a negative or zero number of groupsc3st|}|dkr|gVdS||krdd|DVdS|^}}||dD]	}|gg|Vq(||D]"}tt|D]}|d||g||g||ddVq?q7dS)Nr,cSsg|]}|gqSrr)rrrrrrszAset_partitions..set_partitions_helper..)rr)rrTrrMprset_partitions_helperrrrs0z-set_partitions..set_partitions_helper)rrrr)rrTrrrrrras rac@(eZdZdZddZddZddZdS)	rxa
    Yield items from *iterable* until *limit_seconds* have passed.
    If the time limit expires before all items have been yielded, the
    ``timed_out`` parameter will be set to ``True``.

    >>> from time import sleep
    >>> def generator():
    ...     yield 1
    ...     yield 2
    ...     sleep(0.2)
    ...     yield 3
    >>> iterable = time_limited(0.1, generator())
    >>> list(iterable)
    [1, 2]
    >>> iterable.timed_out
    True

    Note that the time is checked before each item is yielded, and iteration
    stops if  the time elapsed is greater than *limit_seconds*. If your time
    limit is 1 second, but it takes 2 seconds to generate the first item from
    the iterable, the function will run for 2 seconds and not yield anything.

    cCs2|dkrtd||_t||_t|_d|_dS)Nrzlimit_seconds must be positiveF)r
limit_secondsrrr+_start_time	timed_out)rrrrrrrs

ztime_limited.__init__cCrrrrrrrr!rztime_limited.__iter__cCs*t|j}t|j|jkrd|_t|Sr)rrr+rrrrrrrrr$s

ztime_limited.__next__Nrrrrrrrrrrrrxs
rxcCsLt|}t||}zt|}Wn
tyY|Swd||}|p%t|)a*If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.

    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError

    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    r)rrrrr)rrrrrrrrrrr^-s
r^ccsNt|}	t|t}|turdStt|g|\}}t||Vt||q)aBreak *iterable* into sub-iterables with *n* elements each.
    :func:`ichunked` is like :func:`chunked`, but it yields iterables
    instead of lists.

    If the sub-iterables are read in order, the elements of *iterable*
    won't be stored in memory.
    If they are read out of order, :func:`itertools.tee` is used to cache
    elements as necessary.

    >>> from itertools import count
    >>> all_chunks = ichunked(count(), 4)
    >>> c_1, c_2, c_3 = next(all_chunks), next(all_chunks), next(all_chunks)
    >>> list(c_2)  # c_1's elements have been cached; c_3's haven't been
    [4, 5, 6, 7]
    >>> list(c_1)
    [0, 1, 2, 3]
    >>> list(c_3)
    [8, 9, 10, 11]

    TN)rrrrrrr-)rrsourcerrrrrrQVs

rQccs|dkr	td|dkrdVdSt|}tt|tddg}dg|}d}|rtz
t|d\}}WntyE||d8}Yq(w|||<|d|krVt|Vn|tt||dd|dtdd|d7}|s*dSdS)aBYield the distinct combinations of *r* items taken from *iterable*.

        >>> list(distinct_combinations([0, 0, 1], 2))
        [(0, 0), (0, 1)]

    Equivalent to ``set(combinations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    rzr must be non-negativerNr,rr)	rrr2r3r$rrpopr)rrr
generatorsZ
current_comborZcur_idxrrrrrC{s:
rCc	gs6|D]}z||Wn	|yYqw|VqdS)aYield the items from *iterable* for which the *validator* function does
    not raise one of the specified *exceptions*.

    *validator* is called for each item in *iterable*.
    It should be a function that accepts one argument and raises an exception
    if that item is not valid.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(filter_except(int, iterable, ValueError, TypeError))
    ['1', '2', '4']

    If an exception other than one given by *exceptions* is raised by
    *validator*, it is raised like normal.
    Nr)rr
exceptionsrrrrrHsrHc	gs0|D]}z||VWq|yYqwdS)aTransform each item from *iterable* with *function* and yield the
    result, unless *function* raises one of the specified *exceptions*.

    *function* is called to transform each item in *iterable*.
    It should be a accept one argument.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(map_except(int, iterable, ValueError, TypeError))
    [1, 2, 4]

    If an exception other than one given by *exceptions* is raised by
    *function*, it is raised like normal.
    Nr)functionrrrrrrrWsrWcCst||}ttt|}|ttttd|}t||D]*\}}||krL||t|<|ttt|9}|ttttd|d7}q"|Sr)r1rrr!rr3r")rrT	reservoirWZ
next_indexrrrrr_sample_unweighteds
"rcsdd|D}t|t||td\}}tt|}t||D]8\}}||krYd\}}t||}	t|	d}
t|
|}t||fd\}}tt|}q%||8}q%fddt|DS)Ncss|]
}tt|VqdSr)rr!)rweightrrrrrz#_sample_weighted..rr,csg|]}tdqSr)r)rrrrrr

sz$_sample_weighted..)	r1rrrr!rr#r
r)rrTweightsZweight_keysZsmallest_weight_keyrZweights_to_skiprrZt_wZr_2Z
weight_keyrrr_sample_weighteds 

rcCs:|dkrgSt|}|durt||St|}t|||S)afReturn a *k*-length list of elements chosen (without replacement)
    from the *iterable*. Like :func:`random.sample`, but works on iterables
    of unknown length.

    >>> iterable = range(100)
    >>> sample(iterable, 5)  # doctest: +SKIP
    [81, 60, 96, 16, 4]

    An iterable with *weights* may also be given:

    >>> iterable = range(100)
    >>> weights = (i * i + 1 for i in range(100))
    >>> sampled = sample(iterable, 5, weights=weights)  # doctest: +SKIP
    [79, 67, 74, 66, 78]

    The algorithm can also be used to generate weighted random permutations.
    The relative weight of each item determines the probability that it
    appears late in the permutation.

    >>> data = "abcdefgh"
    >>> weights = range(1, len(data) + 1)
    >>> sample(data, k=len(data), weights=weights)  # doctest: +SKIP
    ['c', 'a', 'b', 'e', 'g', 'd', 'h', 'f']
    rN)rrr)rrTrrrrrh

s
rhcCs6|rtnt}|dur|nt||}tt|t|S)aReturns ``True`` if the items of iterable are in sorted order, and
    ``False`` otherwise. *key* and *reverse* have the same meaning that they do
    in the built-in :func:`sorted` function.

    >>> is_sorted(['1', '2', '3', '4', '5'], key=int)
    True
    >>> is_sorted([5, 4, 3, 1, 2], reverse=True)
    False

    The function returns ``False`` after encountering the first out-of-order
    item. If there are no out-of-order items, the iterable is exhausted.
    N)r(r'rrLrr/)rrrcomparerrrrrR1
srRc@seZdZdS)r3N)rrrrrrrr3D
sr3c@sZeZdZdZdddZddZdd	Zd
dZdd
Ze	ddZ
e	ddZddZdS)r8aConvert a function that uses callbacks to an iterator.

    Let *func* be a function that takes a `callback` keyword argument.
    For example:

    >>> def func(callback=None):
    ...     for i, c in [(1, 'a'), (2, 'b'), (3, 'c')]:
    ...         if callback:
    ...             callback(i, c)
    ...     return 4


    Use ``with callback_iter(func)`` to get an iterator over the parameters
    that are delivered to the callback.

    >>> with callback_iter(func) as it:
    ...     for args, kwargs in it:
    ...         print(args)
    (1, 'a')
    (2, 'b')
    (3, 'c')

    The function will be called in a background thread. The ``done`` property
    indicates whether it has completed execution.

    >>> it.done
    True

    If it completes successfully, its return value will be available
    in the ``result`` property.

    >>> it.result
    4

    Notes:

    * If the function uses some keyword argument besides ``callback``, supply
      *callback_kwd*.
    * If it finished executing, but raised an exception, accessing the
      ``result`` property will raise the same exception.
    * If it hasn't finished executing, accessing the ``result``
      property from within the ``with`` block will raise ``RuntimeError``.
    * If it hasn't finished executing, accessing the ``result`` property from
      outside the ``with`` block will raise a
      ``more_itertools.AbortThread`` exception.
    * Provide *wait_seconds* to adjust how frequently the it is polled for
      output.

    callback皙?cCs8||_||_d|_d|_||_tdd|_||_dS)NFr,)max_workers)	_func
_callback_kwd_aborted_future
_wait_secondsr	_executor_reader	_iterator)rrZcallback_kwdZwait_secondsrrrr{
szcallback_iter.__init__cCrrrrrrr	__enter__
rzcallback_iter.__enter__cCsd|_|jdSr)rrshutdown)rexc_type	exc_value	tracebackrrr__exit__
szcallback_iter.__exit__cCrrrrrrrr
rzcallback_iter.__iter__cCrr)rrrrrrr
rzcallback_iter.__next__cCs|jdurdS|jSrb)rdonerrrrr
s

zcallback_iter.donecCs|jstd|jS)NzFunction has not yet completed)rRuntimeErrorrrrrrrr
s
zcallback_iter.resultc#stfdd}jjjfij|i_	z	jjd}Wn	ty-Ynw	|Vj
r;nqg}	z}Wn	tyNYnw	||q?
|EdHdS)Ncs jrtd||fdS)Nzcanceled by user)rr3put)rrrKrrrr
sz'callback_iter._reader..callbackT)timeout)r rsubmitrrrgetrr	task_doner
get_nowaitrjoin)rrrr0rrrr
s>

zcallback_iter._readerN)rr)
rrrrrrrrrpropertyrrrrrrrr8H
s
2	

r8ccs|dkr	tdt|}t|}||krtdt||dD]}|d|}||||}|||d}|||fVq!dS)a
    Yield ``(beginning, middle, end)`` tuples, where:

    * Each ``middle`` has *n* items from *iterable*
    * Each ``beginning`` has the items before the ones in ``middle``
    * Each ``end`` has the items after the ones in ``middle``

    >>> iterable = range(7)
    >>> n = 3
    >>> for beginning, middle, end in windowed_complete(iterable, n):
    ...     print(beginning, middle, end)
    () (0, 1, 2) (3, 4, 5, 6)
    (0,) (1, 2, 3) (4, 5, 6)
    (0, 1) (2, 3, 4) (5, 6)
    (0, 1, 2) (3, 4, 5) (6,)
    (0, 1, 2, 3) (4, 5, 6) ()

    Note that *n* must be at least 0 and most equal to the length of
    *iterable*.

    This function will exhaust the iterable and may require significant
    storage.
    rrzn must be <= len(seq)r,N)rrrr)rrrrrZ	beginningZmiddleendrrrr
src	Csxt}|j}g}|j}|rt||n|D]%}z||vrWdS||Wqty9||vr3YdS||YqwdS)a
    Returns ``True`` if all the elements of *iterable* are unique (no two
    elements are equal).

        >>> all_unique('ABCB')
        False

    If a *key* function is specified, it will be used to make comparisons.

        >>> all_unique('ABCb')
        True
        >>> all_unique('ABCb', str.lower)
        False

    The function returns as soon as the first non-unique element is
    encountered. Iterables with a mix of hashable and unhashable items can
    be used, but the function will be slower for unhashable items.
    FT)raddrrr)rrZseensetZseenset_addZseenlistZseenlist_addrrrrr
srcGstttt|}ttt|}tt|}|dkr||7}d|kr(|ks+ttg}t||D]\}}|	|||||}q2tt|S)aEquivalent to ``list(product(*args))[index]``.

    The products of *args* can be ordered lexicographically.
    :func:`nth_product` computes the product at sort position *index* without
    computing the previous products.

        >>> nth_product(8, range(2), range(2), range(2), range(2))
        (1, 0, 0, 0)

    ``IndexError`` will be raised if the given *index* is invalid.
    r)
rrrrrr	r%rrr)rrpoolsnscrrrrrrr[s

r[c
Cs&t|}t|}|dus||kr|t|}}nd|kr#|ks&ttt|t||}|dkr8||7}d|krC|ksFtt|dkrMtSdg|}||kr^|t||n|}td|dD]#}t||\}}	d||kr||krnn|	|||<|dkrnqgtt|j	|S)a'Equivalent to ``list(permutations(iterable, r))[index]```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`nth_permutation`
    computes the subsequence at sort position *index* directly, without
    computing the previous subsequences.

        >>> nth_permutation('ghijk', 2, 5)
        ('h', 'i')

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    Nrr,)
rrrrrrrrJrr)
rrrrrrrrKdrrrrrZ.s6
rZc	gsL|D] }t|ttfr|Vqz|EdHWqty#|VYqwdS)aYield all arguments passed to the function in the same order in which
    they were passed. If an argument itself is iterable then iterate over its
    values.

        >>> list(value_chain(1, 2, 3, [4, 5, 6]))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and are emitted
    as-is:

        >>> list(value_chain('12', '34', ['56', '78']))
        ['12', '34', '56', '78']


    Multiple levels of nesting are not flattened.

    N)rrrr)rrrrrr\s
rcGsVd}t||tdD]\}}|tus|turtdt|}|t|||}q	|S)aEquivalent to ``list(product(*args)).index(element)``

    The products of *args* can be ordered lexicographically.
    :func:`product_index` computes the first index of *element* without
    computing the previous products.

        >>> product_index([8, 2], range(10), range(5))
        42

    ``ValueError`` will be raised if the given *element* isn't in the product
    of *args*.
    rrwz element is not a product of args)rrrrrr)rrrr
rrrrrxs
rc
Cst|}t|d\}}|durdSg}t|}|D]\}}||kr5||t|d\}}|dur3n|}qtdt||dfd\}}	d}
tt|ddD]\}}||}||krj|
t|t|t||7}
qNt|dt|dt|||
S)aEquivalent to ``list(combinations(iterable, r)).index(element)``

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`combination_index` computes the index of the
    first *element*, without computing the previous combinations.

        >>> combination_index('adf', 'abcdefg')
        10

    ``ValueError`` will be raised if the given *element* isn't one of the
    combinations of *iterable*.
    NNNrz(element is not a combination of iterablerr,)r)r3rrrrSrr)
rrrTyZindexesrrr
tmprrrrrrrrs.

 (rcCsLd}t|}ttt|dd|D]\}}||}|||}||=q|S)aEquivalent to ``list(permutations(iterable, r)).index(element)```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`permutation_index`
    computes the index of the first *element* directly, without computing
    the previous permutations.

        >>> permutation_index([1, 3, 2], range(5))
        19

    ``ValueError`` will be raised if the given *element* isn't one of the
    permutations of *iterable*.
    rr)rrrrr)rrrrrr
rrrrrs
rc@r)	r?aWrap *iterable* and keep a count of how many items have been consumed.

    The ``items_seen`` attribute starts at ``0`` and increments as the iterable
    is consumed:

        >>> iterable = map(str, range(10))
        >>> it = countable(iterable)
        >>> it.items_seen
        0
        >>> next(it), next(it)
        ('0', '1')
        >>> list(it)
        ['2', '3', '4', '5', '6', '7', '8', '9']
        >>> it.items_seen
        10
    cCst||_d|_dSrp)rr
items_seenrrrrrs

zcountable.__init__cCrrrrrrrrrzcountable.__iter__cCst|j}|jd7_|Sr)rrrrrrrrs
zcountable.__next__Nrrrrrr?s
r?)Frrrr)NNN)rF)r)NNF)r5FN)r@NFrb)rcollectionsrrrrcollections.abcrconcurrent.futuresr	functoolsrr	r
heapqrrr
r	itertoolsrrrrrrrrrrrrmathrrrrqueuerr r!r"r#operatorr$r%r&r'r(sysr)r*timer+Zrecipesr-r.r/r0r1r2__all__objectrr9rIrSrYrbr<r>rKrPr|r]rDrNryr{rvrwr7rsrMrLr;rkrlrnrprorqrrr_rcrErtrr}r>r~rrmrzrFrrr5r4rJHashabler\r@rArdrTrUrfrurOr~r6r=rBrjrirgrGr:rVrXrerdr`rarxr^rQrCrHrWrrrhrR
BaseExceptionr3r8rrr[rZrrrrr?rrrrs8 	V
!&& 

C
d
!3
"
`+

0
=
"
,
#
$-
-
 
#.
'B13
5
'-
Z%0.`0*-



AC
+=
8
-)%(
#
$|
(#.+PK!*1_distutils/__pycache__/py38compat.cpython-310.pycnu[o

Xai@sddZdS)cCs4z	ddl}|WStyYnwd|||fS)Nz%s-%s.%s)_aix_supportaix_platformImportError)osnameversionreleaserr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/py38compat.pyrs
rN)rrrrr	sPK!q$%B6B64_distutils/__pycache__/_msvccompiler.cpython-310.pycnu[o

XaiMQ@sdZddlZddlZddlZddlZddlZeeddl	Z	Wdn1s*wYddl
mZmZm
Z
mZmZddlmZmZddlmZddlmZddlmZdd	Zd
dZdd
dddZddZddZdddZdddddZGdddeZ dS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platform)countcCs ztjtjdtjtjBd}WntytdYdSwd}d}|_tD]F}zt	||\}}}Wn
ty@Yn:w|ro|tj
krotj
|roztt|}WnttfyaYq)w|dkro||kro||}}q)Wd||fSWd||fS1swY||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr)winreg	OpenKeyExHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYOSErrorr	debugrZ	EnumValueREG_SZospathisdirintfloat
ValueError	TypeError)keybest_versionbest_dirivZvc_dirZvtversionr"/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/_msvccompiler.py_find_vc2015 sH









r$c
Cstjdptjd}|sdSztjtj|dddddd	d
ddd
dg	ddd}Wntjt	t
fy:YdSwtj|ddd}tj|rNd|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)ZProgramFilesr
zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products*mbcsstrict)encodingerrorsZVCZ	AuxiliaryZBuild)renvironget
subprocesscheck_outputrjoinstripCalledProcessErrorrUnicodeDecodeErrorr)rootrr"r"r#_find_vc2017<s.
r4x86x64armarm64)r5	x86_amd64x86_arm	x86_arm64cCs\t\}}|st\}}|stddStj|d}tj|s*td|dS|dfS)Nz$No suitable Visual C++ version foundr
z
vcvarsall.batz%s cannot be found)r4r$r	rrrr/isfile)	plat_spec_rr	vcvarsallr"r"r#_find_vcvarsallcs


r@c
CstdrddtjDSt|\}}|stdztjd||tj	dj
ddd	}WntjyI}zt
|jtd
|jd}~wwdddd
|DD}|S)NZDISTUTILS_USE_SDKcSsi|]	\}}||qSr"lower).0rvaluer"r"r#
wsz_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r)zError executing {}cSs$i|]\}}}|r|r||qSr"rA)rCrr>rDr"r"r#rEscss|]}|dVqdS)=N)	partition)rCliner"r"r#	sz_get_vc_env..)rgetenvr+itemsr@rr-r.formatSTDOUTdecoder1r	erroroutputcmd
splitlines)r=r?r>outexcenvr"r"r#_get_vc_envus2


rXcCsN|stdtj}|D]}tjtj||}tj|r$|Sq
|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rrLsplitpathseprr/abspathr<)Zexepathspfnr"r"r#	_find_exes	r_r9r:r;)win32z	win-amd64z	win-arm32z	win-arm64cseZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd(ddZd)ddZ	
	d*ddZ	
	d+ddZ		
	d,ddZ						
				d-ddZfddZejfddZd d!Zd"d#Zd$d%Zd.d&d'ZZ S)/MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t||||d|_d|_dS)NF)r__init__	plat_nameinitialized)selfverbosedry_runforcer"r"r#rcs
zMSVCCompiler.__init__NcCs|jrJd|durt}|tvrtdttt|}t|}|s)td|dd|_|j	t
j}td||_
td||_td||_td	||_td
||_td||_|dd	t
jD]
}|rr||t
jqe|d
d	t
jD]
}|r||t
jq}d|_gd|_gd|_gd}gd}g|d|_g|d|_g|ddd|_g|ddd|_g||_g||_t j!df|jt j!df|jt j!df|jt j"df|jt j"df|jt j"df|jt j#df|jt j#df|jt j#df|ji	|_$d|_dS)Nzdon't init multiple timesz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.rzcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeincludelib)/nologoz/O2/W3z/GLz/DNDEBUGz/MD)rmz/Odz/MDdz/Zirnz/D_DEBUG)rm/INCREMENTAL:NO/LTCG)rmrorpz/DEBUG:FULLz/MANIFEST:EMBED,ID=1z/DLLz/MANIFEST:EMBED,ID=2z/MANIFESTUAC:NOFT)%rer
PLAT_TO_VCVARSrrNtuplerXr,_pathsrYrrZr_cclinkerrlrcmcmtZadd_include_dirrstripsepZadd_library_dirZpreprocess_optionscompile_optionscompile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY_ldflags)rfrdr=Zvc_envr\dirldflagsZ
ldflags_debugr"r"r#
initializesb





zMSVCCompiler.initializerjcsXifddjDfddjjDpdfdd}tt||S)Nci|]}|jqSr")
obj_extensionrCextrfr"r#rE&z1MSVCCompiler.object_filenames..crr")
res_extensionrrr"r#rE'rrjcstj|\}}rtj|}ntj|\}}|tjjtjjfr*|dd}ztj||WSt	yDt
d|w)NzDon't know how to compile {})rrsplitextbasename
splitdrive
startswithrzaltsepr/LookupErrorrrN)r]baserr>)ext_map
output_dir	strip_dirr"r#
make_out_path,sz4MSVCCompiler.object_filenames..make_out_path)src_extensions_rc_extensions_mc_extensionslistmap)rfZsource_filenamesrrrr")rrrfrr#object_filenames!szMSVCCompiler.object_filenamesc	CsL|js||||||||}	|	\}}
}}}|pg}
|
d|r*|
|jn|
|jd}|
D]}z||\}}Wn	tyGYq4w|rPtj	
|}||jvrZd|}n||jvrfd|}d}n||j
vr|}d|}z||jg|||gWnty}zt|d}~wwq4||jvrtj	|}tj	|}z.||jd|d||gtj	tj	|\}}tj	||d	}||jd||gWnty}zt|d}~wwq4td
|||jg|
|}|r|d|||d|||z||Wq4ty#}zt|d}~ww|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rrbz"Don't know how to compile {} to {}z/EHscz/Fo)rerZ_setup_compileappendextendr|r{KeyErrorrrr[
_c_extensions_cpp_extensionsrspawnrvrrrdirnamerwrrr/rNrt)rfsourcesrZmacrosinclude_dirsr
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsZadd_cpp_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirrr>Zrc_fileargsr"r"r#compileBs









zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||rN|d|g}|r&	ztd|jd||	|jg|WdSt
yM}zt|d}~wwtd|dS)N)r/OUT:Executing "%s" %s skipping %s (up-to-date))rer_fix_object_argslibrary_filename
_need_linkr	rrlr/rrr)	rfrZoutput_libnamerrtarget_langoutput_filenameZlib_argsrr"r"r#create_static_libs$zMSVCCompiler.create_static_libc
Cs|js||||\}}||||}|\}}}|r&|dt|t||||}|dur8tj	||}|
||r|j||	f}dd|pKgD}||||d|g}tj|d}|durtj
tj|\}}tj	|||}|d||
r|
|dd<|r||tjtj|}||ztd|jd	|||jg|WdSty}zt|d}~wwtd	|dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|qS)z/EXPORT:r")rCsymr"r"r#
rz%MSVCCompiler.link..rrz/IMPLIB:rrr)rerrZ
_fix_lib_argswarnstrrrrr/rr}rrrrrrr[mkpathr	rrurrr)rfZtarget_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrrrZ
build_temprZ
fixed_argsZlib_optsrZexport_optsZld_argsZdll_nameZdll_extZimplib_filerr"r"r#linksb




zMSVCCompiler.linkcsRttj|jd}|||}tj||dWdS1s!wY|jS)N)PATH)rW)dictrr+rs_fallback_spawnsuperrrD)rfrSrWfallback	__class__r"r#rs
 zMSVCCompiler.spawnc
#stddi}z|VWdSty'}z
dt|vrWYd}~nd}~wwtdtjd|t	||_
WddS1sGwYdS)z
        Discovered in pypa/distutils#15, some tools monkeypatch the compiler,
        so the 'env' kwarg causes a TypeError. Detect this condition and
        restore the legacy, unsafe behavior.
        ZBagr"z!unexpected keyword argument 'env'Nz>Fallback spawn triggered. Please update distutils monkeypatch.z
os.environ)typerrwarningsrunittestZmockpatchrrrD)rfrSrWZbagrVrr"r#rs""zMSVCCompiler._fallback_spawncCsd|S)Nz	/LIBPATH:r"rfr~r"r"r#library_dir_optionszMSVCCompiler.library_dir_optioncCstd)Nz:don't know how to set runtime library search path for MSVC)rrr"r"r#runtime_library_dir_optionsz'MSVCCompiler.runtime_library_dir_optioncCs
||SN)r)rfrlr"r"r#library_option s
zMSVCCompiler.library_optioncCs\|r	|d|g}n|g}|D]}|D]}tj|||}tj|r*|SqqdS)N_d)rrr/rr<)rfdirsrlrZ	try_namesr~nameZlibfiler"r"r#find_library_file#szMSVCCompiler.find_library_file)rrrr)rrj)NNNrNNN)NrN)
NNNNNrNNNN)r)!__name__
__module____qualname____doc__
compiler_typeZexecutablesrrrrrrrZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrcrrrrrr
contextlibcontextmanagerrrrrr
__classcell__r"r"rr#rasb

P
"
]

Erar)!rrr-rrZ
unittest.mockrsuppressImportErrorrdistutils.errorsrrrrrZdistutils.ccompilerrr	distutilsr	distutils.utilr
	itertoolsrr$r4ZPLAT_SPEC_TO_RUNTIMEr@rXr_rqrar"r"r"r#s<
!
PK!7B993_distutils/__pycache__/msvccompiler.cpython-310.pycnu[o

Xai[@sdZddlZddlZddlmZmZmZmZmZddl	m
Z
mZddlm
Z
dZzddlZdZeZejZejZejZejZWn2eypzddlZddlZdZeZejZejZejZejZWneyme
dYnwYnwer}ejejejej fZ!d	d
Z"ddZ#d
dZ$GdddZ%ddZ&ddZ'ddZ(Gddde
Z)e&dkre
*de)Z+ddl,m)Z)ddl,m%Z%dSdS)zdistutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsfzt||}Wn
tyYdSwg}d}	zt||}Wn
ty(Y|Sw|||d7}q)zReturn list of registry keys.NrT)RegOpenKeyExRegError
RegEnumKeyappend)basekeyhandleLikr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/msvccompiler.py	read_keys7s"
rcCszzt||}Wn
tyYdSwi}d}	z
t||\}}}Wn
ty+Y|Sw|}t||t|<|d7}q)zXReturn dict of registry keys and values.

    All names are converted to lowercase.
    NrTr
)rrRegEnumValuelowerconvert_mbcs)rrrdrnamevaluetyperrrread_valuesHs$rcCs<t|dd}|durz|d}W|StyY|Sw|S)Ndecodembcs)getattrUnicodeError)sdecrrrr]s
rc@s,eZdZddZddZddZddZd	S)

MacroExpandercCsi|_||dSN)macrosload_macros)selfversionrrr__init__gszMacroExpander.__init__cCs4tD]}t||}|r|||jd|<dSqdS)Nz$(%s))HKEYSrr()r*Zmacropathrrrrrr	set_macroks
zMacroExpander.set_macroc

Csd|}|d|dd|d|ddd}|d|d	z|d
kr,|d|dn|d|d
WntyD}ztdd}~wwd}tD](}zt||}Wn	ty[YqIwt|d}t|d||f}	|	d|jd<qIdS)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg@ZFrameworkSDKDirzsdkinstallrootv1.1ZsdkinstallrootaPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz%s\%sr+z$(FrameworkVersion))	r/KeyErrorrr-rrr
rr()
r*r+Zvsbasenetexcprhrrrrrr)rs6
zMacroExpander.load_macroscCs$|jD]
\}}|||}q|Sr')r(itemsreplace)r*r$rvrrrsubszMacroExpander.subN)__name__
__module____qualname__r,r/r)r8rrrrr&fs
r&cCsd}tj|}|dkrdS|t|}tj|ddd\}}t|ddd}|dkr3|d7}t|d	d
d}|dkrCd}|dkrK||SdS)
zReturn the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.N r

g$@r)sysr+findlensplitint)prefixrr$restZmajorVersionZminorVersionrrrget_build_versionsrJcCs@d}tj|}|dkrdStjd|}tj|t||S)zUReturn the processor architecture.

    Possible results are "Intel" or "AMD64".
    z bit (r<Intel))rCr+rDrE)rHrjrrrget_build_architecturesrNcCs0g}|D]}tj|}||vr||q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )osr.normpathr)pathsZ
reduced_pathsr3nprrrnormalize_and_reduce_pathss
rSc@seZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd+ddZddZ	
	d,ddZ	
	d-ddZ		
	d.ddZ						
				d/ddZddZddZd d!Zd0d"d#Zd$d%Zd1d'd(Zd)d*ZdS)2MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt||||t|_t|_|jdkr.|jdkr$d|_t|j|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrKzSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr=F)rr,rJ_MSVCCompiler__versionrN_MSVCCompiler__arch_MSVCCompiler__rootr&_MSVCCompiler__macros_MSVCCompiler__productinitialized)r*verbosedry_runforcerrrr,s


zMSVCCompiler.__init__cCsg|_dtjvr"dtjvr"|dr"d|_d|_d|_d|_d|_n<|	d|_t
|jd	kr6td
|j|d|_|d|_|d|_|d|_|d|_|
d|
dztjdd
D]}|j|qgWn	tyzYnwt|j|_d
|jtjd<d|_|jdkrgd|_gd|_n
gd|_gd|_gd|_|jdkrgd|_ngd|_dg|_d|_dS)NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer.rzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.libinclude;rK)/nologo/O2/MD/W3/GX/DNDEBUG)rc/Od/MDdrfrg/Z7/D_DEBUG)rcrdrerf/GS-rh)rcrirjrfrmrkrl)/DLLrcz/INCREMENTAL:NOrV)rnrc/INCREMENTAL:no/DEBUG)rnrcroz	/pdb:NonerprcT)_MSVCCompiler__pathsrOenvironfind_execclinkerr`rcmcget_msvc_pathsrErr[set_path_env_varrFrr0rSjoinZpreprocess_optionsrXcompile_optionscompile_options_debugldflags_sharedrWldflags_shared_debugZldflags_staticr\)r*r3rrr
initializesP









zMSVCCompiler.initializecCs|durd}g}|D]b}tj|\}}tj|d}|tj|d}||jvr1td||r9tj|}||jvrL|	tj
|||jq
||jvr_|	tj
|||jq
|	tj
|||j
q
|S)Nrr
zDon't know how to compile %s)rOr.splitext
splitdriveisabssrc_extensionsrbasename_rc_extensionsrrz
res_extension_mc_extensions
obj_extension)r*Zsource_filenamesZ	strip_dir
output_dirZ	obj_namessrc_namerextrrrobject_filenames8s,


zMSVCCompiler.object_filenamesNc	Cs8|js||||||||}	|	\}}
}}}|pg}
|
d|r*|
|jn|
|j|
D]}z||\}}Wn	tyEYq2w|rNtj	
|}||jvrXd|}n||jvrbd|}n||j
vr|}d|}z||jg||g|gWnty}zt|d}~wwq2||jvrtj	|}tj	|}z6||jgd|d|g|gtj	tj	|\}}tj	||d}||jgd|g|gWnty}zt|d}~wwq2td||fd	|}z||jg|
|||g|Wq2ty}zt|d}~ww|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrUz"Don't know how to compile %s to %sz/Fo)r\rZ_setup_compilerextendr|r{r0rOr.abspath
_c_extensions_cpp_extensionsrspawnrvrrrdirnamerwrrrzrt)r*sourcesrr(include_dirsdebug
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirr_Zrc_filerrrcompileWs













zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||rC|d|g}|r&	z||jg|WdStyB}zt|d}~wwt	
d|dS)N)r/OUT:skipping %s (up-to-date))r\r_fix_object_argslibrary_filename
_need_linkrr`rrr	r)	r*rZoutput_libnamerrtarget_langoutput_filenameZlib_argsrrrrcreate_static_libs"zMSVCCompiler.create_static_libc
Cs|js||||\}}||||}|\}}}|r&|dt|t||||}|dur8tj	||}|
||r|tjkrU|	rM|j
dd}n|jdd}n	|	r[|j
}n|j}g}|pcgD]	}|d|qd||||d|g}|durtjtj|\}}tj	tj|d||}|d||
r|
|dd<|r|||tj|z||jg|WdSty}zt|d}~wwtd|dS)Nz5I don't know what to do with 'runtime_library_dirs': r
z/EXPORT:rrz/IMPLIB:r)r\rrZ
_fix_lib_argswarnstrrrOr.rzrrZ
EXECUTABLEr~r}rrrrrrmkpathrrurrr	r)r*Ztarget_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrrrZ
build_temprZ
fixed_argsZlib_optsZldflagsZexport_optssymZld_argsZdll_nameZdll_extZimplib_filerrrrlinksl




zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:rr*dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCstd)Nzsj



	-

9
PK!N
4_distutils/__pycache__/unixccompiler.cpython-310.pycnu[o

Xai8@sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZmZmZmZddlmZejdkrCddlZGd	d
d
e
ZdS)a9distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
N)	sysconfig)newer)	CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecErrorCompileErrorLibError	LinkError)logdarwinc	@seZdZdZddgdgdgddgdgddgddZejddd	kr'd
ged
<gdZdZd
Z	dZ
dZdZdZ
ZZeZejdkrDdZ		d'ddZddZ	d(ddZ				d)ddZddZdd Zd!d"Zd#d$Zd*d%d&ZdS)+
UnixCCompilerunixNccz-sharedarz-cr)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverranlibrr)z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.exec
Cs|d||}|\}}}t||}	|j|	}
|r|
d|g|r'||
dd<|r.|
||
||js?|dus?t||rc|rJ|tj	
|z||
WdStyb}zt
|d}~wwdS)N-or)Z_fix_compile_argsrrextendappendforcermkpathospathdirnamespawnrr)selfsourceZoutput_fileZmacrosinclude_dirs
extra_preargsextra_postargs
fixed_argsignorepp_optsZpp_argsmsgr-/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/unixccompiler.py
preprocessUs*




zUnixCCompiler.preprocessc	
Csd|j}tjdkrt|||}z||||d|g|WdSty1}zt|d}~ww)Nrr)rsysplatform_osx_supportcompiler_fixupr#rr)	r$objsrcextZcc_argsr(r+rr,r-r-r._compileos
zUnixCCompiler._compilerc
Cs|||\}}|j||d}|||rN|tj|||j|g||j	|j
rLz||j
|gWdStyK}zt|d}~wwdSt
d|dS)N)
output_dirskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkrr r!r"r#robjectsrrr	rdebug)r$r=Zoutput_libnamer8r>target_langoutput_filenamer,r-r-r.create_static_libzs*	zUnixCCompiler.create_static_libc
Cs|||\}}||||}|\}}}t||||}t|ttdfs(td|dur3tj	||}|
||r||j|d|g}|	rMdg|dd<|
rU|
|dd<|r\|||
tj|zf|tjkrs|jdd}n|jdd}|
dkr|jrd}tj|ddkrd}d||vr|d7}d||vstj||d	krd}nd}|j||||<tjd
krt||}|||WdSty}zt|d}~wwtd|dS)Nz%'output_dir' must be a string or Nonerz-grzc++env=Z	ld_so_aixrr9)r:Z
_fix_lib_argsr
isinstancestrtype	TypeErrorr r!joinr<r=rrr"rZ
EXECUTABLErrrbasenamer0r1r2r3r#rr
rr>)r$Ztarget_descr=r@r8	librarieslibrary_dirsruntime_library_dirsexport_symbolsr>r'r(Z
build_tempr?r)Zlib_optsZld_argsZlinkerioffsetr,r-r-r.links`



zUnixCCompiler.linkcCd|S)N-Lr-)r$dirr-r-r.library_dir_optionz UnixCCompiler.library_dir_optioncCsd|vpd|vS)Ngcczg++r-)r$Z
compiler_namer-r-r._is_gccszUnixCCompiler._is_gcccCstjttdd}tjdddkr4ddl	m
}m}|}|r0||ddgkr0d|Sd	|Stjdd
dkrAd|Stjddd
kr[||rUdd	|gSdd	|gStddkrfd|Sd|S)NCCrrr)get_macosx_target_ver
split_version
z-Wl,-rpath,rSZfreebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+sGNULDyesz-Wl,--enable-new-dtags,-Rz-Wl,-R)
r r!rJshlexsplitrget_config_varr0r1distutils.utilrZr[rX)r$rTrrZr[Zmacosx_target_verr-r-r.runtime_library_dir_options 
z(UnixCCompiler.runtime_library_dir_optioncCrR)Nz-lr-)r$libr-r-r.library_optionrVzUnixCCompiler.library_optioncCs|j|dd}|j|dd}|j|dd}|j|dd}tjdkr8td}td|}	|	dur3d	}
n|	d
}
|D]}tj	
||}tj	
||}
tj	
||}tj	
||}tjdkr|dsl|dr|d
stj	
|
|d
d|}tj	
|
|d
d|}
tj	
|
|d
d|}tj	
|
|d
d|}tj	|
r|
Stj	|r|Stj	|r|Stj	|r|Sq:dS)Nshared)Zlib_typedylib
xcode_stubstaticrCFLAGSz-isysroot\s*(\S+)/rCz/System/z/usr/z/usr/local/)
r;r0r1rrcresearchgroupr r!rI
startswithexists)r$dirsrfr>Zshared_fZdylib_fZxcode_stub_fZstatic_fcflagsmZsysrootrTrhrirkrjr-r-r.find_library_filesH



zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)__name__
__module____qualname__
compiler_typeZexecutablesr0r1Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionr/r7rArQrUrXrergrvr-r-r-r.r
-sN





B'r
)__doc__r r0rnra	distutilsrdistutils.dep_utilrZdistutils.ccompilerrrrdistutils.errorsrrr	r
rr1r2r
r-r-r-r.s 
PK!٨99+_distutils/__pycache__/core.cpython-310.pycnu[o

Xai"@sdZddlZddlZddlmZddlTddlmZddlm	Z	ddl
mZddlm
Z
d	Zd
dZdadadZd
ZddZdddZdS)a#distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
N)DEBUG)*)Distribution)Command)
PyPIRCCommand)	Extensionzusage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj|}ttS)N)ospathbasenameUSAGEvars)script_namescriptr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/core.py	gen_usage s
r)	distclassr
script_argsoptionsnameversionauthorauthor_email
maintainermaintainer_emailurllicensedescriptionlong_descriptionkeywords	platformsclassifiersdownload_urlrequiresprovides	obsoletes)rsourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_args	swig_optsexport_symbolsdependslanguagec
Ks|d}|r|d=nt}d|vrtjtjd|d<d|vr)tjdd|d<z||a}Wn tyQ}zd|vrCt	d|t	d	|d|fd}~wwt
d
krX|S|trft
d|t
dkrl|Sz|}Wnty}zt	t|jd
|d}~wwtrt
d|t
dkr|S|rz|W|Styt	dty}ztrtjd|ft	d|fd}~wttfy}ztr؂t	dt|d}~ww|S)aThe gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    rr
rrNrzerror in setup command: %szerror in %s setup command: %sinitz%options (after parsing config files):configz

error: %sz%options (after parsing command line):commandlineinterruptedz
error: %s
z	error: %szerror: )getrrr	r
sysargv_setup_distributionDistutilsSetupError
SystemExit_setup_stop_afterparse_config_filesrprintdump_option_dictsparse_command_lineDistutilsArgErrorrr
run_commandsKeyboardInterruptOSErrorstderrwriteDistutilsErrorCCompilerErrorstr)attrsklassdistmsgokexcrrrsetup9st
%

rSruncCs|dvrtd|f|atj}d|i}zr<RuntimeError)r
r
stop_after	save_argvgfrrr	run_setups4


ra)NrT)__doc__rr:distutils.debugrdistutils.errorsdistutils.distr
distutils.cmdrdistutils.configrdistutils.extensionrrrr?r<setup_keywordsextension_keywordsrSrarrrrs"	qPK!/**/_distutils/__pycache__/filelist.cpython-310.pycnu[o

Xai_4@sdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdddZdd	Z
Gd
ddeZejfdd
ZddZdddZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
Nconvert_path)DistutilsTemplateErrorDistutilsInternalError)logc@s~eZdZdZdddZddZejfddZd	d
Z	ddZ
d
dZddZddZ
ddZddZdddZ	dddZdS)FileListaA list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    NcCsd|_g|_dSN)allfilesfiles)selfwarndebug_printr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/filelist.py__init__ s
zFileList.__init__cCs
||_dSr)r	)rr	rrrset_allfiles&s
zFileList.set_allfilescCst||_dSr)findallr	)rdirrrrr)szFileList.findallcCs ddlm}|rt|dSdS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugrprint)rmsgrrrrr
,szFileList.debug_printcC|j|dSr)r
append)ritemrrrr6zFileList.appendcCrr)r
extend)ritemsrrrr9rzFileList.extendcCs<tttjj|j}g|_|D]}|jtjj|qdSr)sortedmapospathsplitr
rjoin)rZsortable_filesZ
sort_tuplerrrsort<s
z
FileList.sortcCs@tt|jdddD]}|j||j|dkr|j|=qdS)Nr)rangelenr
)rirrrremove_duplicatesEs
zFileList.remove_duplicatescCs|}|d}d}}}|dvr*t|dkrtd|dd|ddD}n?|dvrLt|d	kr:td
|t|d}dd|ddD}n|dvrct|dkr\td
|t|d}ntd|||||fS)Nr)includeexcludeglobal-includeglobal-excludez&'%s' expects   ...cSg|]}t|qSrr.0wrrr
Xz1FileList._parse_template_line..r%)recursive-includerecursive-excludez,'%s' expects    ...cSr0rrr1rrrr4^r5)graftprunez#'%s' expects a single zunknown action '%s')r"r(rr)rlinewordsactionpatternsrdir_patternrrr_parse_template_lineMs0zFileList._parse_template_linecCs:||\}}}}|dkr+|dd||D]}|j|dds(td|qdS|dkrM|dd||D]}|j|ddsJtd	|q;dS|d
kro|dd||D]}|j|ddsltd
|q]dS|dkr|dd||D]}|j|ddstd|qdS|dkr|d|d|f|D]}|j||dsd}t|||qdS|dkr|d|d|f|D]}|j||dstd||qdS|dkr|d||jd|dstd|dSdS|dkr|d||jd|dstd|dSdStd|)Nr+zinclude  r%)anchorz%warning: no files found matching '%s'r,zexclude z9warning: no previously-included files found matching '%s'r-zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr.zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr6zrecursive-include %s %s)prefixz:warning: no files found matching '%s' under directory '%s'r7zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r9zgraft z+warning: no directories found matching '%s'r:zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r@r
r#include_patternrrexclude_patternr)rr;r=r>rr?patternrrrrprocess_template_lineis
zFileList.process_template_liner%rcCsld}t||||}|d|j|jdur||jD]}||r3|d||j|d}q|S)aSelect strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        Fz%include_pattern: applying regex r'%s'Nz adding T)translate_patternr
rFr	rsearchr
r)rrFrBrCis_regexfiles_found
pattern_renamerrrrDs


zFileList.include_patterncCsrd}t||||}|d|jtt|jdddD]}||j|r6|d|j||j|=d}q|S)aRemove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        Fz%exclude_pattern: applying regex r'%s'r%r&z
 removing T)rHr
rFr'r(r
rI)rrFrBrCrJrKrLr)rrrrEszFileList.exclude_pattern)NNr%Nr)__name__
__module____qualname____doc__rrr curdirrr
rrr$r*r@rGrDrErrrrrs

	
M+rcCs0ttj|dd}dd|D}ttjj|S)z%
    Find all files under 'path'
    T)followlinkscss.|]\}}}|D]
}tj||Vq	qdSr)r r!r#)r2basedirsr
filerrr	sz#_find_all_simple..)_UniqueDirsfilterr walkr!isfile)r!Z
all_uniqueresultsrrr_find_all_simples
r^c@s$eZdZdZddZeddZdS)rYz
    Exclude previously-seen dirs from walk results,
    avoiding infinite recursion.
    Ref https://bugs.python.org/issue44497.
    cCsF|\}}}t|}|j|jf}||v}|r|dd=|||S)z
        Given an item from an os.walk result, determine
        if the item represents a unique dir for this instance
        and if not, prevent further traversal.
        N)r statst_devst_inoadd)rZ	walk_itemrUrVr
r_	candidatefoundrrr__call__	s



z_UniqueDirs.__call__cCst||Sr)rZ)clsrrrrrZsz_UniqueDirs.filterN)rOrPrQrRreclassmethodrZrrrrrYs
rYcCs6t|}|tjkrtjtjj|d}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	r^r rS	functoolspartialr!relpathrlist)rr
Zmake_relrrrrs


rcCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    \z\\\\z\1[^%s]z((?sf
PK!ww8N!N!0_distutils/__pycache__/text_file.cpython-310.pycnu[o

Xai0@s&dZddlZddlZGdddZdS)ztext_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.Nc@steZdZdZddddddddZdddZd	d
ZddZdd
dZdddZ	dddZ
ddZddZddZ
dS)TextFileaProvides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not.rstrict)strip_commentsskip_blanks	lstrip_ws	rstrip_ws
join_lines
collapse_joinerrorsNcKs|dur|durtd|jD]}||vr t||||qt|||j|q|D]
}||jvr;td|q.|durF||n	||_||_d|_g|_	dS)zConstruct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
RuntimeErrordefault_optionskeyssetattrKeyErroropenfilenamefilecurrent_linelinebuf)selfrroptionsoptr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/text_file.py__init__Ns 

zTextFile.__init__cCs&||_tj|jd|jd|_d|_dS)zyOpen a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor.r)rrN)riorrrr)rrrrrros
z
TextFile.opencCs$|j}d|_d|_d|_|dS)ziClose the current file and forget everything we know about it
           (filename, current line number).N)rrrclose)rrrrrrvs
zTextFile.closecCsjg}|dur	|j}||jdt|ttfr"|dt|n|d||t|d|S)Nz, z
lines %d-%d: z	line %d: )rappendr
isinstancelisttuplestrjoin)rmsglineZoutmsgrrr	gen_errors
zTextFile.gen_errorcCstd|||)Nzerror: )
ValueErrorr(rr&r'rrrerrorszTextFile.errorcCs tjd|||ddS)aPrint (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line.z	warning: 
N)sysstderrwriter(r*rrrwarns z
TextFile.warncCs|jr|jd}|jd=|Sd}	|j}|dkrd}|jrW|rW|d}|dkr+n,|dks7||ddkrQ|dd	kr?d	p@d}|d||}|dkrPqn|d
d}|jr|r|durg|d|S|j	rn|
}||}t|jt
r|jdd|jd<n%|j|jdg|_n|durdSt|jt
r|jdd|_n|jd|_|jr|jr|}n|jr|
}n|jr|}|dks|d	kr|jrq|jr|ddkr|dd}q|ddd
kr|ddd	}q|S)aURead and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not.rTN#rr\r,z\#z2continuation line immediately precedes end-of-filez\
)rrreadlinerfindstripreplacer	r0r
lstripr!rr"rrrstripr)rr'Zbuildup_lineposeolrrrr5sj




	



zTextFile.readlinecCs&g}	|}|dur
|S||q)zWRead and return the list of all logical lines remaining in the
           current file.TN)r5r )rlinesr'rrr	readliness
zTextFile.readlinescCs|j|dS)zPush 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead.N)rr )rr'rrr
unreadlineszTextFile.unreadline)NN)N)__name__
__module____qualname____doc__r
rrrr(r+r0r5r>r?rrrrr
s&:
	!
	


x
r)rCr-rrrrrrsPK!c-_distutils/__pycache__/errors.cpython-310.pycnu[o

Xai
@s8dZGdddeZGdddeZGdddeZGdddeZGd	d
d
eZGdddeZGd
ddeZGdddeZ	GdddeZ
GdddeZGdddeZGdddeZ
GdddeZGdddeZGdddeZGdd d eZGd!d"d"eZGd#d$d$eZGd%d&d&eZd'S)(adistutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".c@eZdZdZdS)DistutilsErrorzThe root of all Distutils evil.N__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/errors.pyrrc@r)DistutilsModuleErrorzUnable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes).Nrrrrr	rrc@r)DistutilsClassErrorzSome command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface.Nrrrrr	r
sr
c@r)DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.Nrrrrr	rr
rc@r)DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage.Nrrrrr	rrrc@r)DistutilsFileErrorzAny problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised.Nrrrrr	r$rc@r)DistutilsOptionErroraSyntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead.Nrrrrr	r*src@r)DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'.Nrrrrr	r3rrc@r)DistutilsPlatformErrorzWe don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass.Nrrrrr	r8rrc@r)DistutilsExecErrorz`Any problems executing an external program (such as the C
    compiler, when compiling C files).Nrrrrr	r>rrc@r)DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!).Nrrrrr	rCrrc@r)DistutilsTemplateErrorz%Syntax error in a file list template.Nrrrrr	rHrc@r)DistutilsByteCompileErrorzByte compile error.Nrrrrr	rKrrc@r)CCompilerErrorz#Some compile/link operation failed.Nrrrrr	rOrrc@r)PreprocessErrorz.Failure to preprocess one or more C/C++ files.Nrrrrr	rRrrc@r)CompileErrorz2Failure to compile one or more C/C++ source files.Nrrrrr	rUrrc@r)LibErrorzKFailure to create a static library from one or more C/C++ object
    files.Nrrrrr	rXrrc@r)	LinkErrorz]Failure to link one or more C/C++ object files into an executable
    or shared library file.Nrrrrr	r\rrc@r)UnknownFileErrorz(Attempt to process an unknown file type.Nrrrrr	r`rrN)r	Exceptionrrr
rrrrrrrrrrrrrrrrrrrr	s(
	PK!\Y"Y"6_distutils/__pycache__/cygwinccompiler.cpython-310.pycnu[o

Xai*B@sdZddlZddlZddlZddlmZmZmZddlZddl	m
Z
ddlmZddl
mZmZmZmZddlmZddlmZd	d
ZGddde
ZGd
ddeZdZdZdZddZedZddZddZ ddZ!dS)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
N)PopenPIPEcheck_output)
UnixCCompiler)
write_file)DistutilsExecErrorCCompilerErrorCompileErrorUnknownFileError)LooseVersion)find_executablecCstjd}|dkr>tj|d|d}|dkrdgS|dkr#dgS|d	kr*d
gS|dkr1dgS|d
kr8dgStd|dS)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)sysversionfind
ValueError)Zmsc_posZmsc_verr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/cygwinccompiler.py	get_msvcr?src@sZeZdZdZdZdZdZdZdZdZ	dZ
dd
dZdd
Z				dddZ
dddZdS)CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    cygwinz.o.az.dllzlib%s%sz%s%sz.exercCsFt||||t\}}|d||f|tur!|d|tjdd|_	tjdd|_
d|j	vrgt\|_|_
|_||jd|j|j
|jf|j
dkrY|j	|_nd	|_|j
d
krdd}n	d}n|j	|_d}|jd
|j	d|j	d
|j
d|j	d|j|fdd|j	vr|jdkrdg|_|ddSt|_dS)Nz%Python's GCC status: %s (details: %s)zPython's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.CCgccCXXzg++z: gcc %s, ld %s, dllwrap %s
z2.10.90dllwrap2.13-shared
-mdll -staticz%s -mcygwin -O -Wallz%s -mcygwin -mdll -O -Wallz%s -mcygwinz%s -mcygwin %scompilercompiler_socompiler_cxx
linker_exe	linker_so2.91.57msvcrtz,Consider upgrading to a newer version of gcc)r__init__check_config_hdebug_printCONFIG_H_OKwarnosenvirongetcccxxget_versionsgcc_version
ld_versionZdllwrap_version
compiler_type
linker_dllset_executables
dll_librariesr)selfverbosedry_runforcestatusdetails
shared_optionrrrr)dsX






zCygwinCCompiler.__init__c
Cs|dks|dkr&z
|dd|d|gWdSty%}zt|d}~wwz||j||d|g|WdStyH}zt|d}~ww)z:Compiles the source by spawning GCC and windres if needed..rc.resZwindresz-iz-oN)spawnrr	r#)r:objsrcextZcc_argsextra_postargsZpp_optsmsgrrr_compileszCygwinCCompiler._compileNcCsHt|
pg}
t|pg}t|pg}||j|dur||jks)|jdkrtj|d}tjtj	|\}}tj
||d}tj
|d|d}dtj	|dg}|D]}||q]|t
||fd	||jd
kr|
d|g|
d|gn|||	s|
d
t||||||||d|	|
|||
dS)zLink the objects.Nrrz.deflibrz
LIBRARY %sZEXPORTSz
writing %srz--output-libz--defz-s)copyextendr9Z
EXECUTABLEr7r.pathdirnamesplitextbasenamejoinappendexecuterrlink)r:Ztarget_descZobjectsZoutput_filename
output_dir	librarieslibrary_dirsruntime_library_dirsexport_symbolsdebugZ
extra_preargsrGZ
build_tempZtarget_langtemp_dirZdll_nameZ
dll_extensionZdef_fileZlib_filecontentssymrrrrTsB	



zCygwinCCompiler.linkcCs|durd}g}|D]H}tjtj|\}}||jddgvr)td||f|r1tj|}|dvrE|tj||||j	q
|tj|||j	q
|S)z#Adds supports for rc and res files.Nr^rArBz"unknown file type '%s' (from '%s'))rBrA)
r.rMrOnormcaseZsrc_extensionsr
rPrRrQ
obj_extension)r:Zsource_filenamesZ	strip_dirrUZ	obj_namessrc_namebaserFrrrobject_filenamess&z CygwinCCompiler.object_filenamesrrr)
NNNNNrNNNN)rr^)__name__
__module____qualname____doc__r6r`Zstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr)rIrTrcrrrrrYs"
@
Nrc@seZdZdZdZdddZdS)Mingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows.
    Zmingw32rc	Cst||||d|jvr|jdkrd}nd}d|jvr$|jdkr$d}nd}t|jr/td|jd	|jd
|jd	|jd|jd|j	||fd
g|_
t|_
dS)Nrrr rr'z--entry _DllMain@12r^z1Cygwin gcc cannot be used with --compiler=mingw32z%s -O -Wallz%s -mdll -O -Wallz%sz%s %s %sr!)rr)r1r5r4is_cygwinccrr8r2r7r9r)r:r;r<r=r@entry_pointrrrr)s.
zMingw32CCompiler.__init__Nrd)rerfrgrhr6r)rrrrrjsrjokznot okZ	uncertainc
Csddlm}dtjvrtdfSdtjvrtdfS|}z(t|}zd|vr4td|fW|WSt	d	|fW|WS|wt
y_}ztd
||jffWYd}~Sd}~ww)awCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r)	sysconfigZGCCzsys.version mentions 'GCC'ZClangzsys.version mentions 'Clang'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '%s': %sN)
	distutilsrnrrr,get_config_h_filenameopenreadcloseCONFIG_H_NOTOKOSErrorCONFIG_H_UNCERTAINstrerror)rnfnconfig_hexcrrrr*Ms(

r*s(\d+\.\d+(\.\d+)*)cCst|d}t|durdSt|dtdj}z
|}W|n|wt|}|dur1dSt	|
dS)zFind the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    rNT)shellstdout)splitrrrr|rrrs
RE_VERSIONsearchrgroupdecode)cmd
executableout
out_stringresultrrr_find_exe_version~s

rcCsgd}tdd|DS)zg Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    )zgcc -dumpversionzld -vzdllwrap --versioncSsg|]}t|qSr)r).0rrrr
sz get_versions..)tuple)commandsrrrr3sr3cCst|dg}|dS)zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachinescygwin)rstripendswith)r1rrrrrksrk)"rhr.rrK
subprocessrrrreZdistutils.unixccompilerrdistutils.file_utilrdistutils.errorsrrr	r
Zdistutils.versionrdistutils.spawnrrrrjr,rtrvr*compilerrr3rkrrrrs.1@1
/PK!D33,_distutils/__pycache__/debug.cpython-310.pycnu[o

Xai@sddlZejdZdS)NZDISTUTILS_DEBUG)osenvirongetDEBUGrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/debug.pysPK!Y<	<	*_distutils/__pycache__/log.cpython-310.pycnu[o

Xai@sldZdZdZdZdZdZddlZGdd	d	ZeZej	Z	ej
Z
ejZejZej
Z
ejZd
dZdd
ZdS)z,A simple log mechanism styled after PEP 282.Nc@sPeZdZefddZddZddZddZd	d
ZddZ	d
dZ
ddZdS)LogcCs
||_dSN)	threshold)selfr	r/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/log.py__init__s
zLog.__init__cCs|tttttfvrtdt|||jkrV|r||}|tttfvr'tj	}ntj
}z	|d|WntyO|j
}||d|}|d|Ynw|dSdS)Nz%s wrong log levelz%s
backslashreplace)DEBUGINFOWARNERRORFATAL
ValueErrorstrr	sysstderrstdoutwriteUnicodeEncodeErrorencodingencodedecodeflush)r
levelmsgargsstreamrrrr_logs"
zLog._logcGs||||dSr)r#)r
rr r!rrrlog'zLog.logcG|t||dSr)r#rr
r r!rrrdebug*r%z	Log.debugcGr&r)r#rr'rrrinfo-r%zLog.infocGr&r)r#rr'rrrwarn0r%zLog.warncGr&r)r#rr'rrrerror3r%z	Log.errorcGr&r)r#rr'rrrfatal6r%z	Log.fatalN)__name__
__module____qualname__rr
r#r$r(r)r*r+r,rrrrrsrcCstj}|t_|Sr)_global_logr	)roldrrr
set_thresholdAsr2cCs@|dkr
ttdS|dkrttdS|dkrttdSdS)Nrrr)r2rrr)vrrr
set_verbosityGsr4)__doc__rrrrrrrr0r$r(r)r*r+r,r2r4rrrrs"+PK!;E1E10_distutils/__pycache__/sysconfig.cpython-310.pycnu[o

Xai~T@sdZddlZddlZddlZddlZddlmZdejvZej	
ejZej	
ej
Zej	
ejZej	
ejZdejvrHej	ejdZnejrWej	ej	ejZneZddZeed	dZejd
krvddZeeZeeZd
dZeZdZ zesej!Z Wn	e"yYnwddZ#d-ddZ$d.ddZ%ddZ&ddZ'ddZ(d/ddZ)e*dZ+e*dZ,e*d Z-d/d!d"Z.d#d$Z/da0d%d&Z1d'd(Z2d)d*Z3d+d,Z4dS)0aProvide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        
N)DistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs,dD]}tjtj|d|rdSqdS)N)SetupzSetup.localModulesTF)ospathisfilejoin)dfnr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/sysconfig.py_is_python_source_dir,s
r_homentcCs0|rtj|tjtjtdrtS|S)NZPCbuild)rrnormcase
startswithr	PREFIX)r
rrr
_fix_pcbuild5s
rcCstrttSttSN)	_sys_homerproject_baserrrr

_python_build=srcCsdtjddS)zReturn a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dN)sysversion_inforrrr
get_python_versionQsrcCs|dur
|rtp	t}tjdkrItrtjdkrtj|dSt	r4|r%t
p$tStjtdd}tj
|Str8dnd}|tt}tj|d|Stjd	krit	rbtj|dtjjtj|d
Stj|dStdtj)aReturn the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    NposixincludesrcdirIncludepypypythonrPCzFI don't know where Python installs its C header files on platform '%s')BASE_EXEC_PREFIXBASE_PREFIXrnameIS_PYPYrrrr	python_buildrrget_config_varnormpathrbuild_flagspathsepr)
plat_specificprefixincdirimplementation
python_dirrrr
get_python_incYs0

r6cCstr!tjdkr!|dur
t}|rtj|dtjdStj|dS|dur4|r.|r+tp,t	}n|r2t
p3t}tjdkrb|s=|rDttdd}nd}trJd	nd
}tj|||t
}|r[|Stj|dStjdkrx|rptj|dStj|ddStd
tj)aSReturn the directory containing the Python library (standard or
    site additions).

    If 'plat_specific' is true, return the directory containing
    platform-specific modules, i.e. any module from a non-pure-Python
    module distribution; otherwise, return the platform-shared library
    directory.  If 'standard_lib' is true, return the directory
    containing standard Python library modules; otherwise, return the
    directory for site-specific modules.

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    rNz
lib-pythonrz
site-packagesr
platlibdirlibr%r&rLibz?I don't know where Python installs its library on platform '%s')r+rrrrrr	versionr(r)EXEC_PREFIXr*getattrrr)r1standard_libr2libdirr4	libpythonrrr
get_python_libs<


r@c	Cs|jdkrtjdkrtdsddl}|tdtd<tddd	d
ddd
d\}}}}}}}}	dtj	vrOtj	d}
dtj	vrM|
|rM|
|t|d}|
}dtj	vrYtj	d}dtj	vrctj	d}dtj	vrntj	d}n|d}dtj	vr|dtj	d}d	tj	vr|dtj	d	}|dtj	d	}dtj	vr|dtj	d}|dtj	d}|dtj	d}d
tj	vrtj	d
}dtj	vr|dtj	d}n|d|	}|d|}
|j||
|
d|||||ddtj	vr|j
ddr|jtj	dd||_dSdS)zDo any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    unixdarwinCUSTOMIZED_OSX_COMPILERrNTrueCCCXXCFLAGSCCSHAREDLDSHAREDSHLIB_SUFFIXARARFLAGSCPPz -ELDFLAGS CPPFLAGS)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverZRANLIBranlib)rX)
compiler_typerplatformr-_osx_supportcustomize_compiler_config_varsget_config_varsrenvironrlenset_executablesZexecutablesgetshared_lib_extension)rRr[cccxxcflagsccsharedldsharedshlib_suffixarar_flagsnewcccpprWcc_cmdrrr
r\sh

















	
r\cCsDtrtjdkrtjtp
td}n
tpt}ntdd}tj|dS)z2Return full pathname of installed pyconfig.h file.rr'rr1z
pyconfig.h)r,rr*rr	rrr6)inc_dirrrr
get_config_h_filenames


rqcCs\trtjtptdStddd}dtt	}t
tjdr&|dtjj
7}tj||dS)zAReturn full pathname of installed Makefile from the Python build.Makefilerrr1r=zconfig-{}{}
_multiarchz-%s)r,rrr	rrr@formatrr/hasattrrr4rt)lib_dirconfig_filerrr
get_makefile_filenamesrycCs|duri}td}td}	|}|s	|S||}|r>|dd\}}zt|}Wn	ty8Ynw|||<n||}|rLd||d<q)zParse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
Trrr)recompilereadlinematchgroupint
ValueError)fpg	define_rxundef_rxlinemnvrrr
parse_config_hs&




rz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c	Csddlm}||ddddd}|duri}i}i}	|}|dur#n?t|}|ra|dd\}}	|	}	|	d	d
}
d|
vrE|	||<nzt|	}	Wnt	y\|	d	d||<Ynw|	||<qd}|r1t
|D]}||}
t|
pzt
|
}|r+|d}d}||vrt||}n>||vrd
}n7|tjvrtj|}n,||vr|dr|dd|vrd
}nd||vrd
}nt|d|}nd
||<}|r*|
|d}|
d|||}
d|vr|
||<qkzt|
}
Wnt	y|
||<Ynw|
||<||=|dr*|dd|vr*|dd}||vr*|
||<qk||=qk|sg||D]\}}	t|	trI|	||<q9|||S)zParse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    r)TextFilersurrogateescape)strip_commentsskip_blanks
join_lineserrorsNTrz$$r$)rGrNrPFPY_r )distutils.text_filerr|_variable_rxr}r~stripreplacerrlist_findvar1_rxsearch_findvar2_rxstrrr_rendstartcloseitems
isinstanceupdate)rrrrdonenotdonerrrrtmpvrenamed_variablesr*valuefounditemafterkrrr
parse_makefileBs





2
rcCsX	t|p
t|}|r(|\}}|d|||d||d}n	|Sq)aExpand Makefile-style variables -- "${foo}" or "$(foo)" -- in
    'string' according to 'vars' (a dictionary mapping variable names to
    values).  Variables not present in 'vars' are silently expanded to the
    empty string.  The variable values in 'vars' should not contain further
    variable expansions; if 'vars' is the output of 'parse_makefile()',
    you're fine.  Returns a variable-expanded version of 's'.
    TrrN)rrrspanrbr~)svarsrbegrrrr
expand_makefile_varss*rc
Cstjddjtjtjttjddd}z
t	|t
tdgd}Wnty5t	dt
tdgd}Ynw|j
}iat|d	S)
z7Initialize the module as appropriate for POSIX systems._PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rtr)abirZ	multiarchbuild_time_varsrZ_sysconfigdataN)rr_rbrurabiflagsrZr<r4
__import__globalslocalsImportErrorrr]r)r*_temprrrr
_init_posixs"rcCs~i}tddd|d<tddd|d<tdd|d<td|d<d	|d
<tdd|d
<tjtj	t
j|d<|adS)z+Initialize the module as appropriate for NTrrrsLIBDEST
BINLIBDESTro	INCLUDEPY
EXT_SUFFIXz.exeEXE.rVERSIONBINDIRN)
r@r6_impextension_suffixesrrrrdirnameabspathr
executabler])rrrr
_init_ntsrcGsLtdurtdtj}|r|niattd<ttd<tstd}|dur,|td<tdt}tjdkrOt	rHtj
t}tj

||}ntj
t}tj
tj
|td<t	rtjdkrt}tj
tds|tkrtj

|td}tj
|td<tjd	krd
dl}|t|rg}|D]
}|t|q|StS)aWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    NZ_init_r2exec_prefixrSOr#rrBr)r]rrbrr*rr;r+rr,rrryr	rr.isabsgetcwdrrZr[customize_config_varsappend)argsfuncrr#baser[valsr*rrr
r^sB



r^cCs*|dkrddl}|dtdt|S)zReturn the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    rrNz SO is deprecated, use EXT_SUFFIXr)warningswarnDeprecationWarningr^rb)r*rrrr
r-:sr-)rN)rrNr)5__doc__rrrzrrrbuiltin_module_namesr+rr.r2rrr;base_prefixr)base_exec_prefixr(r_rrrrrrr<rr*rrr,r/rAttributeErrorrr6r@r\rqryrr{rrrrrr]rrr^r-rrrr
sb




+8K




jKPK!8[h))3_distutils/__pycache__/fancy_getopt.cpython-310.pycnu[o

XaixE@sdZddlZddlZddlZddlZddlTdZedeZedeefZ	e
ddZGd	d
d
Z
ddZd
dejDZddZddZGdddZedkrndZdD]ZedeedeeeeqXdSdS)a6distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
N)*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$-_c@seZdZdZdddZddZddZd d	d
ZddZd
dZ	ddZ
ddZddZddZ
d ddZddZdddZd ddZdS)!FancyGetoptaWrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    NcCsN||_i|_|jr
|i|_i|_g|_g|_i|_i|_i|_	g|_
dSN)option_tableoption_index_build_indexaliasnegative_alias
short_opts	long_opts
short2long	attr_name	takes_argoption_orderselfrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/fancy_getopt.py__init__)s	
zFancyGetopt.__init__cCs(|j|jD]	}||j|d<qdS)Nr)rclearr)roptionrrrr	Qs

zFancyGetopt._build_indexcCs||_|dSr)rr	rrrrset_option_tableVszFancyGetopt.set_option_tablecCs:||jvrtd||||f}|j|||j|<dS)Nz'option conflict: already an option '%s')rDistutilsGetoptErrorrappend)rlong_optionshort_optionhelp_stringrrrr
add_optionZs

zFancyGetopt.add_optioncCs
||jvS)zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)rrrrrr
has_optioncs
zFancyGetopt.has_optioncCs
|tS)zTranslate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.	translate
longopt_xlater rrr
get_attr_nameh
zFancyGetopt.get_attr_namecCs\t|tsJ|D] \}}||jvrtd|||f||jvr+td|||fqdS)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)
isinstancedictitemsrr)raliaseswhatr
optrrr_check_alias_dictns

zFancyGetopt._check_alias_dictcC||d||_dS)z'Set the aliases for this option parser.r
N)r-r
)rr
rrrset_aliasesxs
zFancyGetopt.set_aliasescCr.)zSet the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table.znegative aliasN)r-r)rrrrrset_negative_aliases}s
z FancyGetopt.set_negative_aliasescCsg|_g|_|ji|_|jD]}t|dkr!|\}}}d}nt|dkr.|\}}}}ntd|ft|t	r@t|dkrFt
d||dus[t|t	rUt|dks[t
d	|||j|<|j||d
dkr~|rr|d}|dd
}d|j|<n!|j
|}|dur|j|rt
d
||f||jd
<d|j|<|j|}|dur|j||j|krt
d||ft|st
d||||j|<|r|j|||j|d<qdS)zPopulate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        rzinvalid option tuple: %rz9invalid long option '%s': must be a string of length >= 2Nz:invalid short option '%s': must a single character or None=:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r
rrrrepeatrlen
ValueErrorr'strrrrrgetr

longopt_rematchr%r)rrlongshorthelpr8alias_torrr_grok_option_tablest








zFancyGetopt._grok_option_tablec
Cs|durtjdd}|durt}d}nd}|d|j}zt|||j\}}Wntjy>}zt	|d}~ww|D]y\}}t
|dkrY|ddkrY|j|d}nt
|dkrg|ddd	ksiJ|dd}|j
|}	|	ry|	}|j|s|d
ksJd|j
|}	|	r|	}d}nd}|j|}
|r|j
|
durt||
dd}t||
||j||fqA|r||fS|S)aParse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr4TF r3rrz--zboolean option can't have value)sysargvOptionDummyrCjoinrgetoptr
errorDistutilsArgErrorr9rr
r<rrrr8getattrsetattrrr)rargsobjectcreated_objectroptsmsgr,valr
attrrrrrJsJ 

zFancyGetopt.getoptcCs|jdur	td|jS)zReturns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        Nz!'getopt()' hasn't been called yet)rRuntimeError)rrrrget_option_orders
zFancyGetopt.get_option_ordercCsdd}|jD]&}|d}|d}t|}|ddkr|d}|dur%|d}||kr+|}q|ddd}d}||}	d	|}
|rD|g}nd
g}|jD]e}|dd\}}}t||	}
|ddkrf|dd}|dur|
ry|d|||
dfn&|d
||fnd||f}|
r|d|||
dfn|d||
ddD]	}||
|qqJ|S)zGenerate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        rr4r5r6Nr3NrDzOption summary:r1z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr9	wrap_textr)rheadermax_optrr?r@l	opt_width
line_width
text_width
big_indentlinesrAtext	opt_namesrrr
generate_helpsL


zFancyGetopt.generate_helpcCs0|durtj}||D]	}||dqdS)N
)rFstdoutrewrite)rr[filelinerrr
print_helphs
zFancyGetopt.print_helpr)NN)__name__
__module____qualname____doc__rr	rrr!r%r-r/r0rCrJrWrerkrrrrrs 
(
	

M=

OrcCst|}|||||Sr)rr0rJ)optionsnegative_optrPrOparserrrrfancy_getoptos
rscCsi|]}t|dqS)rD)ord).0Z_wscharrrr
usrvcCs|durgSt||kr|gS|}|t}td|}dd|D}g}|rg}d}|rZt|d}|||krJ||d|d=||}n|rW|dddkrW|d=n|s/|r|dkru||dd||d|d|d<|dddkr|d=|d||s)|S)	zwrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)cSsg|]}|r|qSrr)ruchrrr
szwrap_text..rr5rDrE)r9
expandtabsr#WS_TRANSresplitrrI)rcwidthchunksrbcur_linecur_lenr]rrrrZws>

"rZcCs
|tS)zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    r")r,rrrtranslate_longoptr&rc@seZdZdZgfddZdS)rHz_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCs|D]}t||dqdS)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rN)rrpr,rrrrszOptionDummy.__init__N)rlrmrnrorrrrrrHsrH__main__zTra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))
(z	width: %drf)rorFstringr{rJdistutils.errorslongopt_patcompiler=neg_alias_rer;	maketransr$rrs
whitespacerzrZrrHrlrcwprintrIrrrrs0
T6PK!U8DD4_distutils/__pycache__/msvc9compiler.cpython-310.pycnu[o

Xaiv@sLdZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZddlmZddlZejZejZejZejZejejejejfZej dkoWej!dkZ"e"rad	Z#d
Z$dZ%ndZ#d
Z$dZ%dddZ&GdddZ'GdddZ(ddZ)ddZ*ddZ+ddZ,d$ddZ-e)Z.e.d kred!e.Gd"d#d#eZ/dS)%adistutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platformwin32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFrameworkx86amd64rz	win-amd64c@sPeZdZdZddZeeZddZeeZddZeeZdd	Ze	eZd
S)Regz2Helper class to read values from the registry
    cCs6tD]}|||}|r||vr||Sqt|N)HKEYSread_valuesKeyError)clspathkeybasedr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py	get_value?sz
Reg.get_valuecCsfzt||}Wn
tyYdSwg}d}	zt||}Wn
ty(Y|Sw|||d7}q)zReturn list of registry keys.NrT)RegOpenKeyExRegError
RegEnumKeyappend)rrrhandleLikrrr	read_keysGs"
z
Reg.read_keysc	Cs~zt||}Wn
tyYdSwi}d}	z
t||\}}}Wn
ty+Y|Sw|}|||||<|d7}q)z`Return dict of registry keys and values.

        All names are converted to lowercase.
        NrTr)rrRegEnumValuelowerconvert_mbcs)	rrrr!rr#namevaluetyperrrrYs$zReg.read_valuescCs<t|dd}|durz|d}W|StyY|Sw|S)Ndecodembcs)getattrUnicodeError)sdecrrrr(os
zReg.convert_mbcsN)
__name__
__module____qualname____doc__rclassmethodr%rr(staticmethodrrrrr;src@s,eZdZddZddZddZddZd	S)

MacroExpandercCsi|_t||_||dSr)macrosVS_BASEvsbaseload_macros)selfversionrrr__init__{s
zMacroExpander.__init__cCst|||jd|<dS)Nz$(%s))rrr9)r=Zmacrorrrrr	set_macroszMacroExpander.set_macroc	Cs|d|jdd|d|jdd|dtdz|dkr(|d	td
ntd
Wnty8tdw|dkrN|d
|jd|dtddSd}tD])}zt||}Wn	tydYqRwt	|d}t
|d||f}|d|jd<qRdS)NZVCInstallDirz	\Setup\VC
productdirZVSInstallDirz	\Setup\VSZFrameworkDirZinstallroot @ZFrameworkSDKDirzsdkinstallrootv2.0aPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@ZFrameworkVersionzclr versionZ
WindowsSdkDirZcurrentinstallfolderz.Software\Microsoft\NET Framework Setup\Productrz%s\%sr>z$(FrameworkVersion))
r@r;NET_BASErrWINSDK_BASErrrrrrr9)r=r>prhrrrrrr<s:
zMacroExpander.load_macroscCs$|jD]
\}}|||}q|Sr)r9itemsreplace)r=r0r$vrrrsubszMacroExpander.subN)r2r3r4r?r@r<rJrrrrr8ys
r8cCsd}tj|}|dkrdS|t|}tj|ddd\}}t|ddd}|dkr3|d7}t|d	d
d}|dkrCd}|dkrK||SdS)
zReturn the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.N r
g$@r)sysr>findlensplitint)prefixr#r0restZmajorVersionZminorVersionrrrget_build_versionsrYcCs0g}|D]}tj|}||vr||q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )osrnormpathr )pathsZ
reduced_pathsrEnprrrnormalize_and_reduce_pathss
r^cCs<|tj}g}|D]}||vr||q
tj|}|S)z8Remove duplicate values of an environment variable.
    )rUrZpathsepr join)variableZoldListZnewListr#ZnewVariablerrrremoveDuplicatess
rbcCst|}z
td|d}Wntytdd}Ynw|r'tj|sbd|}tj	
|d}|r[tj|r[tj|tjtjd}tj
|}tj|sZtd|dSntd||sktd	dStj|d
}tj|rz|StddS)zFind the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    z%s\Setup\VCrAz%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.batUnable to find vcvarsall.bat)r:rrrr	debugrZrisdirenvirongetr`pardirabspathisfile)r>r;rAZtoolskeyZtoolsdir	vcvarsallrrrfind_vcvarsalls8



rlcCsFt|}hd}i}|durtdtd||tjd||ftjtjd}z\|\}}|dkr;t|	d|	d}|
d	D]2}t|}d
|vrQqE|
}|
d
d\}	}
|	}	|	|vrw|
tjrq|
dd}
t|
||	<qEW|j|jn|j|jwt|t|krttt||S)
zDLaunch vcvarsall.bat and read the settings from its environment
    >ZlibpathincludelibrNrcz'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)stdoutstderrrr-
=rrK)rlrr	rd
subprocessPopenPIPEcommunicatewaitr,rUrr(stripr'endswithrZr_rbrocloserprT
ValueErrorstrlistkeys)r>archrkinterestingresultpopenrorplinerr*rrrquery_vcvarsallsF




rrBz(VC %0.1f is not supported by this modulec@seZdZdZdZiZdgZgdZdgZdgZ	eeee	Z
dZdZd	Z
d
ZdZZdZd,ddZd-ddZ	
	d.ddZ	
	d/ddZ		
	d0ddZ						
				d1ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd2d(d)Zd*d+ZdS)3MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t||||t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr?VERSION_MSVCCompiler__versionZ_MSVCCompiler__root_MSVCCompiler__paths	plat_name_MSVCCompiler__archinitialized)r=verbosedry_runforcerrrr?Hs
zMSVCCompiler.__init__NcCs|jrJd|durt}d}||vrtd|fdtjvr:dtjvr:|dr:d|_d|_d|_d	|_	d
|_
na|tksC|dkrHt|}nttdt|}tt
|}|d
tj|_|dtjd<|dtjd<t|jdkr}td|j|d|_|d|_|d|_|d	|_	|d
|_
ztjd
dD]}|j|qWn	tyYnwt|j|_d|jtjd
<d|_|jdkrgd|_gd|_n
gd|_gd|_gd|_|jdkrgd|_dg|_d|_dS)Nzdon't init multiple timesrz--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer_rrnrmrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.;r)/nologo/O2/MD/W3/DNDEBUG)r/Od/MDdr/Z7/D_DEBUG)rrrr/GS-r)rrrrrrr)/DLLrz/INCREMENTAL:NO)rrz/INCREMENTAL:noz/DEBUGrT)rr
rrZrffind_execclinkerrnrcmcPLAT_TO_VCVARSrrrUr_rrTZ_MSVCCompiler__productr rr^r`Zpreprocess_optionsrcompile_optionscompile_options_debugldflags_sharedrldflags_shared_debugZldflags_static)r=rZok_platsZ	plat_specZvc_envrErrr
initializeSsh









zMSVCCompiler.initializecCs|durd}g}|D]b}tj|\}}tj|d}|tj|d}||jvr1td||r9tj|}||jvrL|	tj
|||jq
||jvr_|	tj
|||jq
|	tj
|||j
q
|S)NrrzDon't know how to compile %s)rZrsplitext
splitdriveisabssrc_extensionsrbasename_rc_extensionsr r`
res_extension_mc_extensions
obj_extension)r=Zsource_filenamesZ	strip_dir
output_dirZ	obj_namessrc_namerextrrrobject_filenamess,


zMSVCCompiler.object_filenamesc	Cs8|js||||||||}	|	\}}
}}}|pg}
|
d|r*|
|jn|
|j|
D]}z||\}}Wn	tyEYq2w|rNtj	
|}||jvrXd|}n||jvrbd|}n||j
vr|}d|}z||jg||g|gWnty}zt|d}~wwq2||jvrtj	|}tj	|}z6||jgd|d|g|gtj	tj	|\}}tj	||d}||jgd|g|gWnty}zt|d}~wwq2td||fd	|}z||jg|
|||g|Wq2ty}zt|d}~ww|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrz"Don't know how to compile %s to %sz/Fo)rrZ_setup_compiler extendrrrrZrri
_c_extensions_cpp_extensionsrspawnrrrrdirnamerrrr`r)r=sourcesrr9include_dirsrd
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirrrZrc_filerrrcompiles













zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||rC|d|g}|r&	z||jg|WdStyB}zt|d}~wwt	
d|dS)N)r/OUT:skipping %s (up-to-date))rr_fix_object_argslibrary_filename
_need_linkrrnrrr	rd)	r=rZoutput_libnamerrdtarget_langoutput_filenameZlib_argsrrrrcreate_static_libs"zMSVCCompiler.create_static_libc
Cs<|js||||\}}||||}|\}}}|r&|dt|t||||}|dur8tj	||}|
||r|tjkrV|	rN|j
dd}n|jdd}n	|	r\|j
}n|j}g}|pdgD]	}|d|qe||||d|g}tj|d}|durtjtj|\}}tj	|||}|d||||||
r|
|dd<|r|||tj|z||jg|Wnty}zt|d}~ww|||}|dur|\}}d||f}z
|dd	d
||gWdSty}zt|d}~wwdStd|dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:rrz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestr)rrrZ
_fix_lib_argswarnr|rrZrr`rr
EXECUTABLErrr rrrrmanifest_setup_ldargsrmkpathrrrrmanifest_get_embed_infor	rd)r=target_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrdrr
build_temprZ
fixed_argsZlib_optsZldflagsZexport_optssymld_argsZdll_nameZdll_extZimplib_filerZmfinfoZ
mffilenamemfidZout_argrrrlink5s






	zMSVCCompiler.linkcCs,tj|tj|d}|d|dS)Nz	.manifest/MANIFESTFILE:)rZrr`rr )r=rrr
temp_manifestrrrrs
z"MSVCCompiler.manifest_setup_ldargscCs^|D]}|dr|ddd}nqdS|tjkrd}nd}||}|dur+dS||fS)Nr:rrP)
startswithrUrr_remove_visual_c_ref)r=rrargrrrrrrs


z$MSVCCompiler.manifest_get_embed_infocCszUt|}z
|}W|n|wtdtj}t|d|}d}t|d|}tdtj}t||dur>WdSt|d}z
|||W|WS|wt	y_YdSw)NzU|)rz*\s*zI|)w)
openreadrzrerDOTALLrJsearchwriteOSError)r=Z
manifest_fileZ
manifest_fZmanifest_bufpatternrrrrs4	


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:rr=dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCstd)NzsR>.
#)PK!*[3_distutils/__pycache__/archive_util.cpython-310.pycnu[o

Xai|!@sFdZddlZddlmZddlZzddlZWney!dZYnwddlmZddl	m
Z
ddlmZddl
mZzddlmZWneyMdZYnwzdd	lmZWneyadZYnwd
dZdd
Z		d#ddZd$ddZedgdfedgdfedgdfedgdfedgdfegdfdZdd Z		d%d!d"ZdS)&zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).N)warn)DistutilsExecError)spawn)mkpath)log)getpwnam)getgrnamcCLtdus|dur
dSzt|}Wntyd}Ynw|dur$|dSdS)z"Returns a gid, given a group name.N)rKeyErrornameresultr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/archive_util.py_get_gidrcCr	)z"Returns an uid, given a user name.Nr
)rrrrrr_get_uid+rrgzipcs2dddddd}dddd	d
}|dur||vrtd|d
}	|dkr-|	||d7}	ttj|	|dddl}
t	dt
tfdd}|sp|
|	d||}z
|j
||dW|n|w|dkrtdt|	||}
tjdkr||	|
g}n|d|	g}t||d|
S|	S)a=Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    gzbz2xz)rbzip2rNcompressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarrdry_runrzCreating tar archivecs,dur
|_|_dur|_|_|S)N)gidgnameuiduname)tarinforgroupownerrrr_set_uid_gidasz"make_tarball.._set_uid_gidzw|%s)filterz'compress' will be deprecated.win32z-f)keys
ValueErrorgetrospathdirnametarfilerinforropenaddcloserPendingDeprecationWarningsysplatformr)	base_namebase_dirrverboserr$r#tar_compressioncompress_extarchive_namer.r%tarcompressed_namecmdrr"rmake_tarball7sB
	


r?c
Cs|d}ttj||dtdur4|rd}nd}z
td|||g|dW|Sty3td|wtd|||sztj	|d	tj
d
}WntyZtj	|d	tjd
}Ynw|o|tj
krztjtj|d}|||td|t|D]D\}}	}
|	D]}tjtj||d}|||td|q|
D]}tjtj||}tj|r|||td|qqWd|S1swY|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.ziprNz-rz-rqzipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to itw)compressionrzadding '%s')rr+r,r-zipfilerrrr/ZipFileZIP_DEFLATEDRuntimeError
ZIP_STOREDcurdirnormpathjoinwritewalkisfile)r6r7r8rzip_filename
zipoptionsr@r,dirpathdirnames	filenamesr
rrrmake_zipfilesf	%



rS)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)gztarbztarxztarztarr<r@cCs|D]
}|tvr|SqdS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)ARCHIVE_FORMATS)formatsformatrrrcheck_archive_formatss
r[c
Cst}|durtd|tj|}|st||dur"tj}d|i}	zt|}
Wn
t	y9t
d|w|
d}|
dD]\}}
|
|	|<qB|dkrW||	d<||	d	<z|||fi|	}W|durqtd
|t||S|durtd
|t|ww)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'rr@r$r#zchanging back to '%s')r+getcwdrdebugr,abspathchdirrHrXrr))r6rZroot_dirr7r8rr$r#save_cwdkwargsformat_infofuncargvalfilenamerrrmake_archives<


ri)rrrNN)rr)NNrrNN)__doc__r+warningsrr4rCImportErrordistutils.errorsrdistutils.spawnrdistutils.dir_utilr	distutilsrpwdrgrprrrr?rSrXr[rirrrrsP

H
=



	
PK!250_distutils/__pycache__/file_util.cpython-310.pycnu[o

Xai@sbdZddlZddlmZddlmZddddZdd
dZ		dd
dZ		dddZ	ddZ
dS)zFdistutils.file_util

Utility functions for operating on single files.
N)DistutilsFileError)logcopyingzhard linkingzsymbolically linking)Nhardsym@c
Csd}d}zzt|d}Wnty!}z	td||jfd}~wwtj|rEzt|WntyD}z	td||jfd}~wwzt|d}Wntya}z	td||jfd}~ww	z||}Wnty}z	td||jfd}~ww|snz|	|Wnty}z	td	||jfd}~wwqcW|r|
|r|
dSdS|r|
|r|
ww)
a5Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    Nrbzcould not open '%s': %szcould not delete '%s': %swbzcould not create '%s': %sTzcould not read from '%s': %szcould not write to '%s': %s)openOSErrorrstrerrorospathexistsunlinkreadwriteclose)srcdstbuffer_sizefsrcfdstebufr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/file_util.py_copy_file_contentssr	
rcCsddlm}ddlm}	m}
m}m}tj	|st
d|tj|r2|}
tj|tj
|}ntj|}
|rM|||sM|dkrItd||dfSzt|}Wn
ty`td|w|dkrtj
|tj
|krztd|||
ntd||||r|dfS|d	krtj|rtj||szt|||dfWStyYnwn|d
krtj|rtj||st|||dfSt|||s|rt|}|rt|||	||
f|rt|||||dfS)aCopy a file 'src' to 'dst'.  If 'dst' is a directory, then 'src' is
    copied there with the same name; otherwise, it must be a filename.  (If
    the file exists, it will be ruthlessly clobbered.)  If 'preserve_mode'
    is true (the default), the file's mode (type and permission bits, or
    whatever is analogous on the current platform) is copied.  If
    'preserve_times' is true (the default), the last-modified and
    last-access times are copied as well.  If 'update' is true, 'src' will
    only be copied if 'dst' does not exist, or if 'dst' does exist but is
    older than 'src'.

    'link' allows you to make hard links (os.link) or symbolic links
    (os.symlink) instead of copying: set it to "hard" or "sym"; if it is
    None (the default), files are copied.  Don't set 'link' on systems that
    don't support it: 'copy_file()' doesn't check if hard or symbolic
    linking is available. If hardlink fails, falls back to
    _copy_file_contents().

    Under Mac OS, uses the native file copy function in macostools; on
    other systems, uses '_copy_file_contents()' to copy file contents.

    Return a tuple (dest_name, copied): 'dest_name' is the actual name of
    the output file, and 'copied' is true if the file was copied (or would
    have been copied, if 'dry_run' true).
    r)newer)ST_ATIMEST_MTIMEST_MODES_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz%s %s -> %srr)distutils.dep_utilrstatr r!r"r#r
risfilerisdirjoinbasenamedirnamerdebug_copy_actionKeyError
ValueErrorinforsamefilelinkrsymlinkrutimechmod)rr
preserve_modepreserve_timesupdater1verbosedry_runrr r!r"r#diractionstrrr	copy_fileCs\!
	

r=cCsddlm}m}m}m}m}ddl}	|dkrtd|||r!|S||s+t	d|||r9t
j|||}n||rEt	d||f|||sSt	d||fd	}
zt

||Wn(ty}z|j\}}
||	jkrrd
}
n	t	d|||
fWYd}~nd}~ww|
rt|||dzt
|W|Sty}z |j\}}
zt
|Wn	tyYnwt	d
||||
fd}~ww|S)a%Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    r)rr&r'r)r*Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r8zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)os.pathrr&r'r)r*errnorr/rr
rr(renamerargsEXDEVr=r)rrr8r9rr&r'r)r*r?copy_itrnummsgrrr	move_filesn




rFcCs<t|d}z|D]	}||dqW|dS|w)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    w
N)r
rr)filenamecontentsflinerrr
write_files
rM)r)rrrNrr)rr)__doc__r
distutils.errorsr	distutilsrr,rr=rFrMrrrrs 
3
d
?PK!1_distutils/__pycache__/py35compat.cpython-310.pycnu[o

Xai@s(ddlZddlZddZeedeZdS)NcCs*g}tjj}|dkr|dd||S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r-O)sysflagsoptimizeappend)argsvaluer
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/py35compat.py#__optim_args_from_interpreter_flagss
r"_optim_args_from_interpreter_flags)r
subprocessrgetattrr
r
r
r
rs
PK!NR...0_distutils/__pycache__/ccompiler.cpython-310.pycnu[o

Xai@sdZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZGd
ddZdZdd
dZddddddZddZdddZddZddZdS)zdistutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.N)*)spawn)	move_file)mkpath)newer_group)split_quotedexecute)logc@sdeZdZdZdZdZdZdZdZdZ	dZ
dZddddddZgdZ
drd	d
ZddZd
dZddZddZdsddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Z d/d0Z!dsd1d2Z"d3d4Z#d5d6Z$d7d8Z%d9d:Z&		dtd;d<Z'			dud=d>Z(d?d@Z)		dvdAdBZ*dCZ+dDZ,dEZ-										dwdFdGZ.										dwdHdIZ/										dwdJdKZ0								dxdLdMZ1dNdOZ2dPdQZ3dRdSZ4		dydTdUZ5dzdVdWZ6d{dYdZZ7d{d[d\Z8d{d]d^Z9	_	Xd|d`daZ:d}dcddZ;dedfZdkdlZ?dmdnZ@ddpdqZAdS)	CCompileraAbstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    Ncc++objc).cz.ccz.cppz.cxxz.m)rr
rrcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
D]}|||j
|q#dSN)
dry_runforceverbose
output_dirmacrosinclude_dirs	librarieslibrary_dirsruntime_library_dirsobjectsexecutableskeysset_executable)selfrrrkeyr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/ccompiler.py__init__UszCCompiler.__init__cKs<|D]}||jvrtd||jjf||||qdS)aDefine the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        z$unknown executable '%s' for class %sN)r
ValueError	__class____name__r)rkwargsrrrr set_executablesys

zCCompiler.set_executablescCs.t|trt||t|dSt|||dSr)
isinstancestrsetattrr)rrvaluerrr rs
zCCompiler.set_executablecCs0d}|jD]}|d|kr|S|d7}qdS)Nr)r)rnameidefnrrr _find_macros

zCCompiler._find_macrocCs`|D]+}t|tr#t|dvr#t|dts|ddur#t|dts-td|ddqdS)zEnsures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r+r+Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r'tuplelenr(	TypeError)rZdefinitionsr.rrr _check_macro_definitionss
z"CCompiler._check_macro_definitionscCs.||}|dur
|j|=|j||fdS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        Nr/rappend)rr,r*r-rrr define_macros
	zCCompiler.define_macrocCs0||}|dur
|j|=|f}|j|dS)aUndefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        Nr5)rr,r-Zundefnrrr undefine_macros

zCCompiler.undefine_macrocC|j|dS)zAdd 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr6rdirrrr add_include_dirzCCompiler.add_include_dircC|dd|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        Nrrdirsrrr set_include_dirsszCCompiler.set_include_dirscCr9)aAdd 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr6)rlibnamerrr add_libraryszCCompiler.add_librarycCr>)zSet the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)rZlibnamesrrr 
set_librarieszCCompiler.set_librariescCr9)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr6r:rrr add_library_dirr=zCCompiler.add_library_dircCr>)zSet the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)rr@rrr set_library_dirsszCCompiler.set_library_dirscCr9)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr6r:rrr add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCr>)zSet the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)rr@rrr set_runtime_library_dirsrFz"CCompiler.set_runtime_library_dirscCr9)zAdd 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr6)robjectrrr add_link_object r=zCCompiler.add_link_objectcCr>)zSet the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)rrrrr set_link_objects(rFzCCompiler.set_link_objectscCs*|dur|j}n	t|tstd|dur|j}nt|tr&||jp#g}ntd|dur2|j}nt|ttfrCt||jp@g}ntd|durMg}|j|d|d}t	|t	|ks_Jt
||}i}	tt	|D]!}
||
}||
}tj
|d}
|tj
|||
f|	|<ql|||||	fS)z;Process arguments and decide which source files to compile.N%'output_dir' must be a string or None/'macros' (if supplied) must be a list of tuples6'include_dirs' (if supplied) must be a list of stringsr)	strip_dirrr+)rr'r(r3rlistrr1object_filenamesr2gen_preprocess_optionsrangeospathsplitextrdirname)rZoutdirrZincdirssourcesdependsextrarpp_optsbuildr-srcobjextrrr _setup_compile6s>


zCCompiler._setup_compilecCs0|dg}|rdg|dd<|r||dd<|S)Nz-cz-grr)rr]debugbeforecc_argsrrr _get_cc_argsas
zCCompiler._get_cc_argscCs|dur|j}n	t|tstd|dur|j}nt|tr&||jp#g}ntd|dur2|j}nt|ttfrCt||jp@g}ntd|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        NrNrOrP)rr'r(r3rrRrr1)rrrrrrr _fix_compile_argsjs"



zCCompiler._fix_compile_argscCs*|j||d}t|t|ksJ|ifS)a,Decide which source files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rSr2)rrZrr[rrrr 
_prep_compiles	zCCompiler._prep_compilecCsNt|ttfstdt|}|dur|j}||fSt|ts#td||fS)zTypecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNrN)r'rRr1r3rr()rrrrrr _fix_object_argss
zCCompiler._fix_object_argscCs|dur|j}nt|ttfrt||jpg}ntd|dur%|j}nt|ttfr6t||jp3g}ntd|durB|j}nt|ttfrSt||jpPg}ntd|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr'rRr1r3rr)rrrrrrr 
_fix_lib_argss,
zCCompiler._fix_lib_argscCs0|jrdS|jrt||dd}|St||}|S)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        Tnewer)missing)rrr)rroutput_filerkrrr 
_need_links
zCCompiler._need_linkc		Cszt|ts|g}d}t|j}|D])}tj|\}}|j|}z|j	|}||kr0|}|}Wqt
y:Yqw|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r'rRr2language_orderrVrWrXlanguage_mapgetindexr")	rrZlangrrsourcebaseraZextlangZextindexrrr detect_languages"

zCCompiler.detect_languagecCdS)aPreprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nr)rrtrmrr
extra_preargsextra_postargsrrr 
preprocessszCCompiler.preprocessc		Csr|||||||\}}	}}
}||
||}|	D]}
z||
\}}Wn	ty+Yqw||
|||||
q|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )rbrfKeyError_compile)rrZrrrrcrxryr[rr]r^rer`r_rarrr compiles6zCCompiler.compilecCrw)zCompile 'src' to product 'obj'.Nr)rr`r_rareryr]rrr r|CzCCompiler._compilecCrw)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nr)rroutput_libnamerrctarget_langrrr create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library
executablecCt)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        NotImplementedError)rZtarget_descroutput_filenamerrrrexport_symbolsrcrxry
build_temprrrr linkis9zCCompiler.linkc

Cs2|tj||j|dd|||||||	|
||
dS)Nshared)lib_type)rr
SHARED_LIBRARYlibrary_filename)
rrrrrrrrrcrxryrrrrr link_shared_libs

zCCompiler.link_shared_libc

Cs(|tj|||||||||	|
||
dSr)rr

SHARED_OBJECT)
rrrrrrrrrcrxryrrrrr link_shared_objects

zCCompiler.link_shared_objectcCs.|tj|||||||d|||	d|

dSr)rr

EXECUTABLEexecutable_filename)rrZoutput_prognamerrrrrcrxryrrrr link_executables



zCCompiler.link_executablecCr)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        rr:rrr library_dir_optionr~zCCompiler.library_dir_optioncCr)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        rr:rrr runtime_library_dir_optionr~z$CCompiler.runtime_library_dir_optioncCr)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        r)rlibrrr library_optionr~zCCompiler.library_optionc

Csjddl}|dur
g}|durg}|durg}|durg}|jd|dd\}}t|d}	z|D]	}
|	d|
q/|	d|W|	n|	wz"z
|j|g|d	}WntyfYWt|d
SwWt|nt|wz5z|j	|d||dWnt
tfyYW|D]}t|qd
SwtdW|D]}t|qdS|D]}t|qw)
zReturn a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNrT)textwz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
r?Fza.out)rr)tempfilemkstemprVfdopenwritecloser}CompileErrorremover	LinkErrorr3)
rfuncnameZincludesrrrrfdfnamefZinclrfnrrr has_functionsX	
zCCompiler.has_functioncCr)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        r)rrArrcrrr find_library_file+szCCompiler.find_library_filecCs|durd}g}|D]>}tj|\}}tj|d}|tj|d}||jvr3td||f|r;tj|}|tj	|||j
q
|S)Nrr+z"unknown file type '%s' (from '%s'))rVrWrX
splitdriveisabssrc_extensionsUnknownFileErrorbasenamer6join
obj_extension)rZsource_filenamesrQrZ	obj_namessrc_namerurarrr rSVs"

zCCompiler.object_filenamescCs0|dusJ|rtj|}tj|||jSr)rVrWrrshared_lib_extensionrrrQrrrr shared_object_filenamegsz CCompiler.shared_object_filenamecCs4|dusJ|rtj|}tj|||jpdS)Nr)rVrWrr
exe_extensionrrrr rmszCCompiler.executable_filenamestaticc
Csl|dusJ|dvrtdt||d}t||d}tj|\}}|||f}	|r.d}tj|||	S)N)rrZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr)r"getattrrVrWsplitr)
rrCrrQrfmtrar;rufilenamerrr rsszCCompiler.library_filenamer+cCst|dSr)r	rc)rmsglevelrrr announceszCCompiler.announcecCs ddlm}|rt|dSdS)Nr)DEBUG)distutils.debugrprint)rrrrrr debug_printszCCompiler.debug_printcCstjd|dS)Nzwarning: %s
)sysstderrr)rrrrr warnzCCompiler.warncCst||||jdSr)rr)rfuncargsrrrrr rrzCCompiler.executecKst|fd|ji|dS)Nr)rr)rcmdr%rrr rszCCompiler.spawncCst|||jdSN)r)rr)rr_dstrrr rszCCompiler.move_filecCst|||jddSr)rr)rr,moderrr rrzCCompiler.mkpath)rrrr)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr)rrr)r+)Nr+)r)Br$
__module____qualname____doc__
compiler_typerrZstatic_lib_extensionrZstatic_lib_formatZshared_lib_formatrrpror!r&rr/r4r7r8r<rBrDrErGrHrIrJrLrMrbrfrgrhrirjrnrvrzr}r|rrrrrrrrrrrrrrSrrrrrrrrrrrrrr r
s
$ 

+	
 "



D

A




3
+




r
))zcygwin.*unix)posixr)ntmsvccCsV|durtj}|durtj}tD]\}}t||dus$t||dur(|SqdS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr)rVr,rplatform_default_compilersrematch)osnamerpatterncompilerrrr get_default_compilers
r)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)rZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)rrcygwinZmingw32ZbcppcCsXddlm}g}tD]}|d|dt|dfq|||}|ddS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)FancyGetoptz	compiler=Nr0zList of available compilers:)distutils.fancy_getoptrcompiler_classrr6sort
print_help)rZ	compilersrZpretty_printerrrr show_compilerss
rcCs|durtj}z|durt|}t|\}}}Wnty1d|}|dur-|d|}t|wzd|}t|tj|}	t	|	|}
Wnt
yTtd|tybtd||fw|
d||S)a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rVr,rrr{DistutilsPlatformError
__import__rmodulesvarsImportErrorDistutilsModuleError)platrrrrmodule_name
class_namelong_descriptionrmoduleklassrrr new_compilers>
rcCsg}|D]G}t|trdt|krdksntd|t|dkr.|d|dqt|dkrK|ddurD|d|dq|d|q|D]	}|d	|qN|S)
aGenerate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    r+r0zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srNz-D%sz-D%s=%sz-I%s)r'r1r2r3r6)rrr]Zmacror;rrr rTs$$rTcCsg}|D]
}|||q|D]}||}t|tr"||}q||q|D]+}tj|\}}	|rM||g|	}
|
rE||
q*|	d|q*||
|q*|S)acGenerate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    z6no library file corresponding to '%s' found (skipping))r6rrr'rRrVrWrrrr)rrrrZlib_optsr;optrlib_dirZlib_nameZlib_filerrr gen_lib_options?s&


r)NN)NNrrr)rrrVrdistutils.errorsdistutils.spawnrdistutils.file_utilrdistutils.dir_utilrdistutils.dep_utilrdistutils.utilrr	distutilsr	r
rrrrrrTrrrrr s:

--PK!-,_distutils/__pycache__/spawn.cpython-310.pycnu[o

Xai
@s\dZddlZddlZddlZddlmZmZddlmZddl	m
Z
dddZdd	d
ZdS)
zdistutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
N)DistutilsPlatformErrorDistutilsExecError)DEBUG)logc
Cst|}tt||rdS|r t|d}|dur ||d<|dur&|nttj}t	j
dkrAddlm}m
}|}|rA|||<ztj||d}	|	|	j}
Wntyo}zts_|d}td||jdf|d}~ww|
rtsx|d}td||
fdS)	aRun another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    Nrdarwin)MACOSX_VERSION_VARget_macosx_target_ver)envzcommand %r failed: %sz#command %r failed with exit code %s)listrinfo
subprocesslist2cmdlinefind_executabledictosenvironsysplatformdistutils.utilrr	Popenwait
returncodeOSErrorrrargs)cmdsearch_pathverbosedry_runr

executablerr	Zmacosx_target_verprocexitcodeexcr$/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/spawn.pyspawnsF


r&c	Cstj|\}}tjdkr|dkr|d}tj|r|S|durBtjdd}|durBztd}Wnt	t
fyAtj}Ynw|sFdS|tj
}|D]}tj||}tj|ra|SqNdS)zTries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    win32z.exeNPATHCS_PATH)rpathsplitextrrisfilergetconfstrAttributeError
ValueErrordefpathsplitpathsepjoin)r r*_extpathspfr$r$r%rHs,
r)rrrN)N)
__doc__rrrdistutils.errorsrrdistutils.debugr	distutilsrr&rr$r$r$r%s
6PK!P7||7_distutils/__pycache__/versionpredicate.cpython-310.pycnu[o

Xai
@sdZddlZddlZddlZedejZedZedZ	ddZ
ejejej
ejejejdZGd	d
d
ZdaddZdS)
zBModule for parsing and testing package version predicate strings.
Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t|}|s
td||\}}|tj|fS)zVParse a single version comparison.

    Return (comparison string, StrictVersion)
    z"bad package restriction syntax: %r)re_splitComparisonmatch
ValueErrorgroups	distutilsversion
StrictVersion)predrescompZverStrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/versionpredicate.pysplitUps

r)z>=z!=c@s(eZdZdZddZddZddZdS)	VersionPredicateaParse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    cCs|}|s
tdt|}|std||\|_}|}|rMt|}|s1td||d}dd|dD|_|jsKtd|d	Sg|_d	S)
z*Parse a version predicate string.
        zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|qSr)r).0ZaPredrrr

tsz-VersionPredicate.__init__..,zempty parenthesized list in %rN)	striprre_validPackagerrnamere_parensplitr	)selfZversionPredicateStrrZparenstrrrr
__init__`s(


zVersionPredicate.__init__cCs4|jrdd|jD}|jdd|dS|jS)NcSs g|]\}}|dt|qS) )r)rcondverrrr
r}s z,VersionPredicate.__str__..z (z, ))r	rjoin)rseqrrr
__str__{szVersionPredicate.__str__cCs(|jD]\}}t|||sdSqdS)zTrue if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        FT)r	compmap)rrrrrrr
satisfied_bys
zVersionPredicate.satisfied_byN)__name__
__module____qualname____doc__rr#r%rrrr
rs
@rcCsdtdurtdtja|}t|}|std||dp"d}|r+tj	
|}|d|fS)a9Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r)
_provision_rxrecompileASCIIrrrgrouprrr)valuemrrrr
split_provisions
r3)r)r-Zdistutils.versionroperatorr.r/rrrrltleeqgtgener$rr,r3rrrr
s 

nPK!0Y0_distutils/__pycache__/extension.cpython-310.pycnu[o

Xai)@s.dZddlZddlZGdddZddZdS)zmdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.Nc@s>eZdZdZ														dddZddZdS)	ExtensionaJust a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    NcKst|ts	tdt|trtdd|Dstd||_||_|p$g|_|p)g|_|p.g|_	|p3g|_
|p8g|_|p=g|_|	pBg|_
|
pGg|_|pLg|_|pQg|_|
pVg|_|p[g|_||_||_t|dkrdd|D}dt|}d	|}t|dSdS)
Nz'name' must be a stringcss|]}t|tVqdS)N)
isinstancestr).0vr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/extension.py	jsz%Extension.__init__..z#'sources' must be a list of stringsrcSsg|]}t|qSr)repr)roptionrrr
sz&Extension.__init__..z, zUnknown Extension options: %s)rrAssertionErrorlistallnamesourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_argsexport_symbols	swig_optsdependslanguageoptionallenjoinsortedwarningswarn)selfrrrrrrrrrrrrrrrrkwoptionsmsgrrr__init__Vs8













zExtension.__init__cCsd|jj|jj|jt|fS)Nz<%s.%s(%r) at %#x>)	__class__
__module____qualname__rid)r%rrr__repr__szExtension.__repr__)NNNNNNNNNNNNNN)__name__r+r,__doc__r)r.rrrrrs$C
/rcCsddlm}m}m}ddlm}ddlm}||}||dddddd}z,g}	|}	|	dur3n|	|	r9q(|	d|	d	krGd
krQnn|
d|	q(||	|}	||	}
|
d}t|g}d}
|
ddD]}|
dury|
|d}
qkt
j|d}|dd}|dd}|d
vr|j|qk|dkr|j|qk|dkr|d}|d	kr|j|dfqk|j|d|||ddfqk|dkr|j|qk|dkr|j|qk|dkr|j|qk|dkr|j|qk|dkr|j|qk|dkr
|j}
qk|dkr|j}
qk|dkr|j}
qk|dkr1|j||s0|j}
qk|dvr=|j|qk|
d|qk||q)W||S|w)z3Reads a Setup file and returns Extension instances.r)parse_makefileexpand_makefile_vars_variable_rx)TextFile)split_quoted)strip_commentsskip_blanks
join_lines	lstrip_ws	rstrip_wsTN*z'%s' lines not handled yet)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')distutils.sysconfigr1r2r3distutils.text_filer4distutils.utilr5readlinematchr$rappendospathsplitextrrfindrrrrrrrrclose)filenamer1r2r3r4r5varsfile
extensionslinewordsmoduleextappend_next_wordwordsuffixswitchvalueequalsrrrread_setup_files
 










K
rY)r0rFr#rrYrrrrs
zPK!J/_distutils/__pycache__/dep_util.cpython-310.pycnu[o

Xai
@s6dZddlZddlmZddZddZdd	d
ZdS)zdistutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis.N)DistutilsFileErrorcCs`tj|stdtj|tj|sdSddlm}t||}t||}||kS)aReturn true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    zfile '%s' does not existrST_MTIME)ospathexistsrabspathstatr)sourcetargetrmtime1mtime2r/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/dep_util.pynewers
rcCsht|t|krtdg}g}tt|D]}t||||r/||||||q||fS)zWalk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    z+'sources' and 'targets' must be same length)len
ValueErrorrangerappend)sourcestargets	n_sources	n_targetsirrrnewer_pairwise srerrorcCstj|sdSddlm}t||}|D]'}tj|s0|dkr$n|dkr)q|dkr0dSt||}||kr>dSqdS)aReturn true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    rrrrignorer)rrrr
r)rrmissingrtarget_mtimersource_mtimerrrnewer_group6s"r!)r)__doc__rdistutils.errorsrrrr!rrrrsPK!8Nb/_distutils/__pycache__/__init__.cpython-310.pycnu[o

Xai@s*dZddlZejdejdZdZdS)zdistutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
N T)__doc__sysversionindex__version__localr	r	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/__init__.pys
PK!:е66*_distutils/__pycache__/cmd.cpython-310.pycnu[o

XaiF@sbdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZGdddZ
dS)ztdistutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
N)DistutilsOptionError)utildir_util	file_utilarchive_utildep_utillogc@s2eZdZdZgZddZddZddZdd	Zd
dZ	dCddZ
ddZdDddZddZ
dEddZdEddZddZ	dEddZdd Zd!d"Zd#d$Zd%d&ZdDd'd(ZdFd*d+Zd,d-Zd.d/Zd0d1ZdGd2d3ZdHd5d6Z		dId7d8Z		dJd9d:ZdDd;d<ZdKd=d>Z 		dLd?d@Z!	dMdAdBZ"dS)NCommanda}Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    cCsbddlm}t||std|jturtd||_|d|_	|j
|_
d|_d|_d|_
dS)zCreate and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        r)Distributionz$dist must be a Distribution instancezCommand is an abstract classN)distutils.distr
isinstance	TypeError	__class__r
RuntimeErrordistributioninitialize_options_dry_runverboseforcehelp	finalized)selfdistrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/cmd.py__init__/s



zCommand.__init__cCs6|dkrt|d|}|durt|j|S|St|)Ndry_run_)getattrrAttributeError)rattrmyvalrrr__getattr___szCommand.__getattr__cCs|js|d|_dSN)rfinalize_optionsrrrrensure_finalizedis
zCommand.ensure_finalizedcCtd|j)aSet default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        ,abstract method -- subclass %s must overriderrr'rrrr{
zCommand.initialize_optionscCr))aSet final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        r*r+r'rrrr&szCommand.finalize_optionsNcCsddlm}|durd|}|j||tjd|d}|jD])\}}}||}|ddkr7|dd}t||}|j|d||ftjdq!dS)	Nr)
longopt_xlatezcommand options for '%s':)levelz  =z%s = %s)	distutils.fancy_getoptr.get_command_nameannouncer	INFOuser_options	translater)rheaderindentr.optionrvaluerrrdump_optionss

zCommand.dump_optionscCr))aA command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        r*r+r'rrrrunr,zCommand.runr%cCst||dS)zmIf the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        Nr)rmsgr/rrrr4szCommand.announcecCs*ddlm}|rt|tjdSdS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugr?printsysstdoutflush)rr>r?rrrdebug_prints
zCommand.debug_printcCsBt||}|durt||||St|tstd|||f|S)Nz'%s' must be a %s (got `%s`))rsetattrr
strr)rr:whatdefaultvalrrr_ensure_stringlikes

zCommand._ensure_stringlikecCs||d|dS)zWEnsure that 'option' is a string; if not defined, set it to
        'default'.
        stringN)rK)rr:rIrrr
ensure_stringszCommand.ensure_stringcCsrt||}|durdSt|trt||td|dSt|tr+tdd|D}nd}|s7td||fdS)zEnsure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|tVqdSN)r
rG).0vrrr	sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r))	rr
rGrFresplitlistallr)rr:rJokrrrensure_string_lists


zCommand.ensure_string_listcCs:||||}|dur||std|||fdSdS)Nzerror in '%s' option: )rKr)rr:testerrH	error_fmtrIrJrrr_ensure_tested_stringszCommand._ensure_tested_stringcCs||tjjdddS)z5Ensure that 'option' is the name of an existing file.filenamez$'%s' does not exist or is not a fileN)rZospathisfilerr:rrrensure_filenameszCommand.ensure_filenamecCs||tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rZr\r]isdirr_rrrensure_dirnameszCommand.ensure_dirnamecCst|dr|jS|jjS)Ncommand_name)hasattrrcr__name__r'rrrr3	s
zCommand.get_command_namecGsF|j|}||D]\}}t||dur t||t||qdS)a>Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        N)rget_command_objr(rrF)rsrc_cmdoption_pairssrc_cmd_obj
src_option
dst_optionrrrset_undefined_optionsszCommand.set_undefined_optionscCs|j||}||S)zWrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        )rrfr()rcommandcreatecmd_objrrrget_finalized_command$szCommand.get_finalized_commandrcCs|j||SrN)rreinitialize_command)rrmreinit_subcommandsrrrrq0szCommand.reinitialize_commandcCs|j|dS)zRun some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        N)rrun_command)rrmrrrrs4szCommand.run_commandcCs2g}|jD]\}}|dus||r||q|S)akDetermine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        N)sub_commandsappend)rcommandscmd_namemethodrrrget_sub_commands;s
zCommand.get_sub_commandscCstd||dS)Nzwarning: %s: %s
)r	warnr3)rr>rrrrzKzCommand.warncCstj||||jddSNr)rexecuter)rfuncargsr>r/rrrr~NszCommand.executecCstj|||jddSr|)rmkpathr)rnamemoderrrrQr{zCommand.mkpathc	Cstj|||||j||jdS)zCopy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.)r})r	copy_filerr)rinfileoutfile
preserve_modepreserve_timeslinkr/rrrrTs

zCommand.copy_filec	Cstj||||||j|jdS)z\Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        r})r	copy_treerr)rrrrrpreserve_symlinksr/rrrr]s

zCommand.copy_treecCstj|||jdS)z$Move a file respecting dry-run flag.r})r	move_filer)rsrcdstr/rrrrfszCommand.move_filecCs ddlm}||||jddS)z2Spawn an external command respecting dry-run flag.r)spawnr}N)distutils.spawnrr)rcmdsearch_pathr/rrrrrjsz
Command.spawnc	Cstj|||||j||dS)N)rownergroup)rmake_archiver)r	base_nameformatroot_dirbase_dirrrrrrroszCommand.make_archivecCs|durd|}t|tr|f}nt|ttfstd|dur)d|d|f}|js2t||r<|	||||dSt
|dS)aSpecial case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )r
rGrTtuplerjoinrrnewer_groupr~r	debug)rinfilesrrrexec_msgskip_msgr/rrr	make_fileus

zCommand.make_file)Nr-)r%rN)rr$)r)r%r%Nr%)r%r%rr%)r%r%)NNNN)NNr%)#re
__module____qualname____doc__rtrr#r(rr&r<r=r4rErKrMrWrZr`rbr3rlrprqrsryrzr~rrrrrrrrrrrr
sR0












	

	

r
)rrBr\rRdistutils.errorsr	distutilsrrrrrr	r
rrrrsPK!*33/_distutils/__pycache__/dir_util.cpython-310.pycnu[o

Xaib@stdZddlZddlZddlmZmZddlmZiadddZ	dd	d
Z
		dddZd
dZdddZ
ddZdS)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.N)DistutilsFileErrorDistutilsInternalError)logcCsrt|tstd|ftj|}g}tj|s|dkr |Sttj	|r+|Stj
|\}}|g}|rX|rXtj|sXtj
|\}}|d||rX|rXtj|r@|D]\}tj||}tj	|}	t|	roqZ|dkryt
d||szt||Wn)ty}
z|
jtjkrtj|std||
jdfWYd}
~
nd}
~
ww||dt|	<qZ|S)	aCreate a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    z(mkpath: 'name' must be a string (got %r)rrzcreating %szcould not create '%s': %sN)
isinstancestrrospathnormpathisdir
_path_createdgetabspathsplitinsertjoinrinfomkdirOSErrorerrnoEEXISTrargsappend)namemodeverbosedry_runcreated_dirsheadtailtailsdabs_headexcr'/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/dir_util.pymkpathsJ



r)c	CsNt}|D]}|tj|tj|qt|D]
}t||||dqdS)aCreate all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    rrN)setaddrrrdirnamesortedr))base_dirfilesrrrneed_dirfiledirr'r'r(create_treePsr4c
CsZddlm}|stj|std|zt|}	Wn ty;}
z|r(g}	n	td||
jfWYd}
~
nd}
~
ww|sDt	||dg}|	D]b}tj
||}
tj
||}|dr^qH|rtj|
rt
|
}|dkrvtd	|||s~t||||qHtj|
r|t|
|||||||d
qH||
||||||d
||qH|S)aCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    r)	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %sr*)distutils.file_utilr5rrrrlistdirrstrerrorr)r
startswithislinkreadlinkrrsymlinkrextend	copy_tree)srcdst
preserve_modepreserve_timespreserve_symlinksupdaterrr5nameseoutputsnsrc_namedst_name	link_destr'r'r(r>csX

r>cCsft|D]#}tj||}tj|r tj|s t||q|tj|fq|tj	|fdS)zHelper for remove_tree().N)
rr7rrrr:_build_cmdtuplerremovermdir)r	cmdtuplesfreal_fr'r'r(rLsrLcCs|dkr
td||rdSg}t|||D]4}z|d|dtj|d}|tvr1t|=WqtyK}z
td||WYd}~qd}~wwdS)zRecursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)	rrrLrrrrrwarn)	directoryrrrOcmdrr&r'r'r(remove_trees$
rUcCs6tj|\}}|ddtjkr||dd}|S)zTake the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    rrN)rr
splitdrivesep)rdriver'r'r(ensure_relativesrY)rrr)rrrrrr)rr)__doc__rrdistutils.errorsrr	distutilsrrr)r4r>rLrUrYr'r'r'r(s

?
E

PK!H<<-_distutils/__pycache__/config.cpython-310.pycnu[o

Xai@s<dZddlZddlmZddlmZdZGdddeZdS)zdistutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
N)RawConfigParser)CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sheZdZdZdZdZdZdZdddefdgZd	gZ	d
dZ
dd
ZddZddZ
ddZddZdS)
PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/pypiNzrepository=rzurl of repository [default: %s])
show-responseNz&display full response text from serverrcCstjtjddS)zReturns rc file path.~z.pypirc)ospathjoin
expanduserselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/config.py_get_rc_file&szPyPIRCCommand._get_rc_filecCs^|}tt|tjtjBdd}|t||fWddS1s(wYdS)zCreates a default .pypirc file.iwN)rr	fdopenopenO_CREATO_WRONLYwriteDEFAULT_PYPIRC)rusernamepasswordrcfrrr
_store_pypirc*s "zPyPIRCCommand._store_pypirccCs|}tj|r|d||jp|j}t}|||	}d|vr|
dd}dd|dD}|gkrEd|vrCdg}niS|D]U}d|i}|
|d	|d	<d
|jfd|jfdfD]\}	}
|
||	rs|
||	||	<q`|
||	<q`|dkr||jdfvr|j|d
<|S|d|ks|d
|kr|SqGiSd
|vrd
}|
|d
r|
|d
}n|j}|
|d	|
|d|||jdSiS)zReads the .pypirc file.zUsing PyPI login from %s	distutilsz
index-serverscSs g|]}|dkr|qS))strip).0serverrrr
=sz.PyPIRCCommand._read_pypirc..
rr"r
repositoryrealm)rNzserver-loginr)rrr%r"r&)rr	r
existsannouncer%DEFAULT_REPOSITORYrreadsectionsgetsplit
DEFAULT_REALM
has_option)rrr%configr+
index_servers_serversr"currentkeydefaultrrr_read_pypirc0sb




zPyPIRCCommand._read_pypirccCs8ddl}|dd}||ddd}||S)z%Read and decode a PyPI HTTP response.rNzcontent-typez
text/plaincharsetascii)cgi	getheaderparse_headerr,r*decode)rresponser:content_typeencodingrrr_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)zInitialize options.Nr)r%r&
show_responser
rrrinitialize_optionsws
z PyPIRCCommand.initialize_optionscCs,|jdur	|j|_|jdur|j|_dSdS)zFinalizes options.N)r%r)r&r.r
rrrfinalize_options}s


zPyPIRCCommand.finalize_options)__name__
__module____qualname____doc__r)r.r%r&user_optionsboolean_optionsrrr6rArCrDrrrrrs(@r)rHr	configparserr
distutils.cmdrrrrrrrs
PK!ٱ._distutils/__pycache__/version.cpython-310.pycnu[o

Xai0@s>dZddlZGdddZGdddeZGdddeZdS)	aProvides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
Nc@sJeZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
dS)VersionzAbstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    NcC|r	||dSdSNparseselfvstringr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/version.py__init__&zVersion.__init__cCsd|jjt|fS)Nz	%s ('%s'))	__class____name__strrr
r
r__repr__*szVersion.__repr__cCs||}|tur|S|dkSNr_cmpNotImplementedrothercr
r
r__eq__-
zVersion.__eq__cCs||}|tur|S|dkSrrrr
r
r__lt__3rzVersion.__lt__cCs||}|tur|S|dkSrrrr
r
r__le__9rzVersion.__le__cCs||}|tur|S|dkSrrrr
r
r__gt__?rzVersion.__gt__cCs||}|tur|S|dkSrrrr
r
r__ge__ErzVersion.__ge__r)r
__module____qualname____doc__rrrrrrrr
r
r
rrs
rc@s<eZdZdZedejejBZddZ	ddZ
ddZd	S)

StrictVersiona?Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs|j|}|std||ddddd\}}}}}|r*ttt|||g|_nttt||gd|_|rC|dt|f|_dSd|_dS)	Nzinvalid version number '%s')rr)	
version_rematch
ValueErrorgrouptuplemapintversion
prerelease)rr	r*majorminorpatchr1Zprerelease_numr
r
rrs
zStrictVersion.parsecCsb|jddkrdtt|jdd}n	dtt|j}|jr/||jdt|jd}|S)Nr%r.r$)r0joinr.rr1rr
r
r__str__szStrictVersion.__str__cCst|tr
t|}nt|tstS|j|jkr!|j|jkrdSdS|js)|js)dS|jr1|js1dS|js9|jr9dS|jrQ|jrQ|j|jkrGdS|j|jkrOdSdSJd)Nr$rFznever get here)
isinstancerr#rr0r1rrr
r
rrs*


zStrictVersion._cmpN)rr r!r"recompileVERBOSEASCIIr)rr7rr
r
r
rr#]s#

r#c@sHeZdZdZedejZdddZddZ	dd	Z
d
dZdd
ZdS)LooseVersionaVersion numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    z(\d+ | [a-z]+ | \.)NcCrrrrr
r
rr0r
zLooseVersion.__init__c	CsZ||_dd|j|D}t|D]\}}zt|||<Wqty'Yqw||_dS)NcSsg|]
}|r|dkr|qS)r5r
).0xr
r
r
:sz&LooseVersion.parse..)r	component_resplit	enumerater/r+r0)rr	
componentsiobjr
r
rr5s
zLooseVersion.parsecCs|jSr)r	rr
r
rr7EszLooseVersion.__str__cCsdt|S)NzLooseVersion ('%s'))rrr
r
rrIszLooseVersion.__repr__cCsVt|tr
t|}nt|tstS|j|jkrdS|j|jkr!dS|j|jkr)dSdS)Nrr8r$)r9rr?rr0r:r
r
rrMs


zLooseVersion._cmpr)
rr r!r"r;r<r=rCrrr7rrr
r
r
rr?
s
r?)r"r;rr#r?r
r
r
rs	>1PK!o,^88+_distutils/__pycache__/dist.cpython-310.pycnu[o

Xai@sdZddlZddlZddlZddlmZzddlZWney%dZYnwddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZed	Zd
dZGdd
d
ZGdddZddZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
N)message_from_file)*)FancyGetopttranslate_longopt)
check_environ	strtobool
rfc822_escapelog)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsTt|tr	|St|ts(t|j}d}|jdit}ttj|t|}|S)Nz>Warning: '{fieldname}' should be a list, got type '{typename}')	
isinstancestrlisttype__name__formatlocalsr
WARN)value	fieldnametypenamemsgrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/dist.py_ensure_lists


rc@sDeZdZdZgdZdZgdZddeDZddiZdId
dZ	dd
Z
dJddZddZdIddZ
ddZddZddZddZddgfddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+ZdKd,d-ZdId.d/ZdLd1d2Zejfd3d4Zd5d6Zd7d8Z d9d:Z!d;d<Z"d=d>Z#d?d@Z$dAdBZ%dCdDZ&dEdFZ'dGdHZ(d	S)MDistributionaThe core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    ))verbosevzrun verbosely (default))quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
))z
help-commandsNzlist all available commands)nameNzprint package name)versionVzprint package version)fullnameNzprint -)authorNzprint the author's name)author-emailNz print the author's email address)
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)urlNzprint the URL for this package)licenseNz print the license of the package)licenceNzalias for --license)descriptionNzprint the package description)zlong-descriptionNz"print the long package description)	platformsNzprint the list of platforms)classifiersNzprint the list of classifiers)keywordsNzprint the list of keywords)providesNz+print the list of packages/modules provided)requiresNz+print the list of packages/modules required)	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|dqSrr).0xrrr
szDistribution.rrNcCsDd|_d|_d|_|jD]}t||dqt|_|jjD]}d|}t||t|j|qi|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r|d}|dur|d=|D]\}}| |}|D]
\}	}
d|
f||	<qqd|vr|d|d	<|d=d
}t!durt!"|nt#j$%|d|D]<\}}
t&|jd|rt|jd||
qt&|j|rt|j||
qt&||rt|||
qd
t'|}t!"|qd|_(|jdur|jD]}
|
)dsn|
dkrd|_(nq|*dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rrget_Noptionszsetup scriptr.r-z:'licence' distribution option is deprecated; use 'license'
set_zUnknown distribution option: %sT-z
--no-user-cfgF)+rdry_runr"display_option_namessetattrDistributionMetadatametadata_METHOD_BASENAMESgetattrcmdclasscommand_packagesscript_namescript_argscommand_options
dist_filespackagespackage_datapackage_dir
py_modules	librariesheadersext_modulesext_packageinclude_dirs
extra_pathscripts
data_filespasswordcommand_objhave_rungetitemsget_option_dictwarningswarnsysstderrwritehasattrrepr
want_user_cfg
startswithfinalize_options)selfattrsattrbasenamemethod_namer=commandcmd_optionsopt_dictoptvalrkeyargrrr__init__s





zDistribution.__init__cCs&|j|}|duri}|j|<|S)zGet the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rLr])rjrodictrrrr_'szDistribution.get_option_dictr<c	Csddlm}|durt|j}|dur ||||d}|s+||ddS|D]4}|j|}|durC||d|q-||d|||}|dD]}||d|qUq-dS)Nr)pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r>)pprintrxsortedrLkeysannouncer]split)	rjheadercommandsindentrxcmd_namerqoutlinerrrdump_option_dicts2s.zDistribution.dump_option_dictscCsg}ttjtjdj}tj|d}tj|r!|	|tj
dkr)d}nd}|jrDtjtjd|}tj|rD|	|d}tj|rQ|	|t
r]|dd	||S)
aFind as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        	distutilsz
distutils.cfgposixz.pydistutils.cfgzpydistutils.cfg~z	setup.cfgzusing config files: %sz, )rospathdirnamerbmodules__file__joinisfileappendr$rg
expanduserrr|)rjfilessys_dirsys_file
user_filename	user_file
local_filerrrfind_config_filesNs&



zDistribution.find_config_filescCs|ddlm}tjtjkrgd}ng}t|}|dur|}tr&|d|}|D]D}tr6|d||	||
D]+}||}||}|D]}	|	dkri|	|vri|
||	}
|	dd}	||
f||	<qMq?|q+d	|jvr|jd	D]?\}	\}}
|j
|	}z!|rt||t|
n|	d
vrt||	t|
nt||	|
Wq|ty}
zt|
d}
~
wwdSdS)Nr)ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataprefixzexec-prefixhomeuserrootz"Distribution.parse_config_files():z  reading %srr@_global)rrA)configparserrrbrbase_prefix	frozensetrrr|readsectionsr=r_r]replacervrLr^negative_optrCr
ValueErrorDistutilsOptionError)rj	filenamesrignore_optionsparserfilenamesectionr=rqrrrssrcaliasrrrrparse_config_files~sR






zDistribution.parse_config_filescCs|}g|_t||j}||j|ddi|j|j|d}|	}t
|j|
|r4dS|rD|||}|durBdS|s6|jrW|j|t|jdk|jddS|js^tddS)	aParse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r.r-)argsobjectNrdisplay_optionsrzno commands suppliedT)_get_toplevel_optionsrrrset_negative_aliasesrset_aliasesgetoptrKget_option_orderr

set_verbosityrhandle_display_options_parse_command_optsr"
_show_helplenDistutilsArgError)rjtoplevel_optionsrroption_orderrrrparse_command_lines0	
zDistribution.parse_command_linecCs|jdgS)zReturn the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)global_optionsrjrrrrsz"Distribution._get_toplevel_optionsc
Csddlm}|d}t|std||j|z||}Wnty2}zt	|d}~wwt
||s>td|t|drIt
|jtsQd}t|||j}t|drc|}||jt|d	rtt
|jtrtt|j}ng}||j|j|||||d
d\}}	t|	dr|	jr|j|d|gddSt|d	rt
|jtrd}
|jD] \}}}
}t|	||rd
}
t|r|qtd
||fq|
rdS||}t|	D]
\}}d|f||<q|S)aParse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        rCommandzinvalid command name '%s'Nz&command class %s must subclass Commanduser_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)rhelp_optionsrr"rzYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) 
distutils.cmdr
command_rematch
SystemExitrrget_command_classDistutilsModuleErrorr
issubclassDistutilsClassErrorrer
rrrcopyupdaterfix_help_optionsset_option_tablerrrr"r
get_attr_namecallabler_varsr^)rjrrrro	cmd_classrrroptshelp_option_foundhelp_optionshortdescfuncrqr$rrrrrsx












z Distribution._parse_command_optscCsPdD]#}t|j|}|durqt|tr%dd|dD}t|j||qdS)zSet final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        r2r0NcSg|]}|qSrstrip)r8elmrrrr:kz1Distribution.finalize_options..,)rGrEr
rr}rC)rjrlrrrrrias
zDistribution.finalize_optionsrc
Csddlm}ddlm}|r)|r|}n|j}||||jdt	d|r:||j
|dt	d|jD]=}t|t
rLt||rL|}	n||}	t|	drht|	jtrh||	jt|	jn||	j|d|	jt	dq=t	||jd	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r	gen_usagerz
Global options:r<zKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:N)distutils.corerrrrrr
print_helpcommon_usageprintrrr
rrrrerrrrrrJ)
rjrrrrrrr=roklassrrrrns:






zDistribution._show_helpc	Csddlm}|jr|tdt||jdSd}i}|jD]}d||d<q!|D]6\}}|rb||rbt|}t	|j
d|}|dvrPtd|n|dvr\td	|nt|d}q,|S)
zIf there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rrr<rr;rr)r1r3r4r5r>)rr
help_commandsprint_commandsrrJrr]rrGrEr)	rjrrany_display_optionsis_display_optionoptionrrrsrrrrrs,
z#Distribution.handle_display_optionsc	Csht|d|D])}|j|}|s||}z|j}Wnty'd}Ynwtd|||fqdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        :(no description available)z
  %-*s  %sN)rrHr]rr/AttributeError)rjrr~
max_lengthcmdrr/rrrprint_command_lists

zDistribution.print_command_listcCsddl}|jj}i}|D]}d||<qg}|jD]}||s&||qd}||D]}t||kr9t|}q-||d||rOt	||d|dSdS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
distutils.commandro__all__rHr{r]rrrr)rjrstd_commandsis_stdrextra_commandsrrrrrs4


zDistribution.print_commandsc		Csddl}|jj}i}|D]}d||<qg}|jD]}||s&||qg}||D]'}|j|}|s<||}z|j}Wnt	yLd}Ynw|||fq-|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrr)
rrorrHr{r]rrr/r)	rjrrrrrrvrr/rrrget_command_lists,	




zDistribution.get_command_listcCsN|j}t|ts%|durd}dd|dD}d|vr"|dd||_|S)z9Return a list of packages from which commands are loaded.Nr<cSsg|]
}|dkr|qS)r<r)r8pkgrrrr:"sz5Distribution.get_command_packages..rzdistutils.commandr)rIr
rr}insert)rjpkgsrrrget_command_packagess
z!Distribution.get_command_packagesc	Cs|j|}|r
|S|D]?}d||f}|}zt|tj|}Wn	ty,Yqwzt||}WntyDt	d|||fw||j|<|St	d|)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s')
rHr]r
__import__rbrImportErrorrGrr)rjrorpkgnamemodule_name
klass_namemodulerrrr(s0
zDistribution.get_command_classcCsl|j|}|s4|r4tr|d|||}||}|j|<d|j|<|j|}|r4||||S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z.z1error in %s: command '%s' has no such option '%s')get_command_namer_rr|r^boolean_optionsrrr
rrCrrerr)rjr[option_dictcommand_namersourcer	bool_optsneg_opt	is_stringrrrrrisR	





z!Distribution._set_command_optionsrcCs|ddlm}t||s|}||}n|}|js|S|d|_d|j|<|||r<|	D]}|
||q3|S)aReinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        rr)rrr
rr
	finalizedinitialize_optionsr\rget_sub_commandsreinitialize_command)rjroreinit_subcommandsrrsubrrrrs


z!Distribution.reinitialize_commandcCst||dSNr	)rjrlevelrrrr|zDistribution.announcecCs|jD]}||qdS)zRun each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)rrun_command)rjrrrrrun_commandss
zDistribution.run_commandscCsD|j|rdStd|||}||d|j|<dS)aDo whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)r\r]r
inforensure_finalizedrun)rjror
rrrrs	
zDistribution.run_commandcCst|jp|jpgdkSNr)rrNrQrrrrhas_pure_modulesszDistribution.has_pure_modulescC|jo	t|jdkSr#)rTrrrrrhas_ext_moduleszDistribution.has_ext_modulescCr%r#)rRrrrrrhas_c_librariesr'zDistribution.has_c_librariescCs|p|Sr)r$r&rrrrhas_modulesrzDistribution.has_modulescCr%r#)rSrrrrrhas_headersr'zDistribution.has_headerscCr%r#)rXrrrrrhas_scriptsr'zDistribution.has_scriptscCr%r#)rYrrrrrhas_data_filesr'zDistribution.has_data_filescCs|o
|o
|Sr)r$r&r(rrrris_pures
zDistribution.is_purer)NNr<)rr6))r
__module____qualname____doc__rrrrBrrvr_rrrrrrrirrrrrrrrrrr
INFOr|rrr$r&r(r)r*r+r,r-rrrrr-sP,


0:C[

2(!"
&

,)
rc@seZdZdZdZdBddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd d!Zd"d#ZeZd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Z d:d;Z!dd?Z#d@dAZ$dS)CrDz]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r$r%r(author_emailr*maintainer_emailr,r-r/long_descriptionr2r0r'r+
contact_emailr1download_urlr3r4r5NcCs|dur
|t|dSd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr)
read_pkg_fileopenr$r%r(r2r*r3r,r-r/r4r2r0r1r6r3r4r5)rjrrrrrvs&
zDistributionMetadata.__init__cst|fdd}fdd}d}|d|_|d|_|d|_|d	|_d
|_|d|_d
|_|d|_|d
|_	dvrG|d|_
nd
|_
|d|_|d|_dvr`|dd|_
|d|_|d|_|dkr|d|_|d|_|d|_d
Sd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs|}|dkr
dS|SNUNKNOWNr)r$rrrr_read_field)sz7DistributionMetadata.read_pkg_file.._read_fieldcs|d}|gkrdS|Sr)get_all)r$valuesr;rr
_read_list/sz6DistributionMetadata.read_pkg_file.._read_listzmetadata-versionr$r%summaryr(Nr)z	home-pager-zdownload-urlr/r2rplatform
classifier1.1r4r3r5)rr$r%r/r(r*r2r3r,r-r6r4r}r2r0r1r4r3r5)rjfiler<r?metadata_versionrr;rr7%s:













z"DistributionMetadata.read_pkg_filecCsHttj|dddd}||WddS1swYdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFOwzUTF-8)encodingN)r8rrrwrite_pkg_file)rjbase_dirpkg_inforrrwrite_pkg_infoYs"z#DistributionMetadata.write_pkg_infocCs`d}|js|js|js|js|jrd}|d||d||d||d||d|	|d|
|d	||d
||jrd|d|jt
|}|d|d
|}|r|d|||d|||d|||d|||d|||d|dS)z9Write the PKG-INFO format data to a file object.
        z1.0rCzMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
rz
Keywords: %s
Platform
ClassifierRequiresProvides	ObsoletesN)r3r4r5r1r6rdget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenserget_long_descriptionrget_keywords_write_list
get_platformsget_classifiersget_requiresget_provides
get_obsoletes)rjrDr%	long_descr2rrrrH`s6z#DistributionMetadata.write_pkg_filecCs |D]}|d||fqdS)Nz%s: %s
)rd)rjrDr$r>rrrrrZsz DistributionMetadata._write_listcC
|jpdSr9)r$rrrrrQ
zDistributionMetadata.get_namecCra)Nz0.0.0)r%rrrrrRrbz DistributionMetadata.get_versioncCsd||fS)Nz%s-%s)rQrRrrrrget_fullnamer'z!DistributionMetadata.get_fullnamecCrar9)r(rrrr
get_authorrbzDistributionMetadata.get_authorcCrar9)r2rrrrget_author_emailrbz%DistributionMetadata.get_author_emailcCrar9)r*rrrrget_maintainerrbz#DistributionMetadata.get_maintainercCrar9)r3rrrrget_maintainer_emailrbz)DistributionMetadata.get_maintainer_emailcC|jp|jpdSr9)r*r(rrrrrUrz DistributionMetadata.get_contactcCrhr9)r3r2rrrrrVrz&DistributionMetadata.get_contact_emailcCrar9)r,rrrrrTrbzDistributionMetadata.get_urlcCrar9)r-rrrrrWrbz DistributionMetadata.get_licensecCrar9)r/rrrrrSrbz$DistributionMetadata.get_descriptioncCrar9)r4rrrrrXrbz)DistributionMetadata.get_long_descriptioncC
|jpgSr)r2rrrrrYrbz!DistributionMetadata.get_keywordscCt|d|_dS)Nr2)rr2rjrrrrset_keywordsrz!DistributionMetadata.set_keywordscCs|jpdgSr9)r0rrrrr[sz"DistributionMetadata.get_platformscCrj)Nr0)rr0rkrrr
set_platformsrz"DistributionMetadata.set_platformscCrir)r1rrrrr\rbz$DistributionMetadata.get_classifierscCrj)Nr1)rr1rkrrrset_classifiersrz$DistributionMetadata.set_classifierscCrar9)r6rrrrget_download_urlrbz%DistributionMetadata.get_download_urlcCrir)r4rrrrr]rbz!DistributionMetadata.get_requirescC,ddl}|D]}|j|qt||_dSr#)distutils.versionpredicateversionpredicateVersionPredicaterr4rjrrrrrrset_requiresz!DistributionMetadata.set_requirescCrir)r3rrrrr^rbz!DistributionMetadata.get_providescCs6dd|D}|D]}ddl}|j|q	||_dS)NcSrrr)r8rrrrr:rz5DistributionMetadata.set_provides..r)rqrrsplit_provisionr3)rjrrrrrrset_providess

z!DistributionMetadata.set_providescCrir)r5rrrrr_rbz"DistributionMetadata.get_obsoletescCrpr#)rqrrrsrr5rtrrr
set_obsoletesrvz"DistributionMetadata.set_obsoletesr)%rr.r/r0rFrvr7rKrHrZrQrRrcrdrerfrgrUrVrTrWget_licencerSrXrYrlr[rmr\rnror]rur^rxr_ryrrrrrDsF
	4"rDcCs$g}|D]}||ddq|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r)r)r=new_options
help_tuplerrrrsr)r0rbrreemailrr`rdistutils.errorsdistutils.fancy_getoptrrdistutils.utilrrrrr
distutils.debugrcompilerrrrDrrrrrs8
ZcPK!s77+_distutils/__pycache__/util.cpython-310.pycnu[o

XaiO@s0dZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZd
dZdd
ZejdkrIdadZddZddZddZddZddZddZdaddZddZd/d!d"Z da!a"a#d#d$Z$d%d&Z%d0d'd(Z&d)d*Z'				d1d+d,Z(d-d.Z)dS)2zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
N)DistutilsPlatformError)newer)spawn)log)DistutilsByteCompileError)"_optim_args_from_interpreter_flagscCstjdkr#dtjvrdSdtjvrdSdtjvr dStjSdtjvr-tjdStjd	ks7ttd
s:tjSt\}}}}}|	dd}|	d
d}|	dd}|dddkred||fS|dddkr|ddkrd}dt
|dd|ddf}ddd}|d|tj7}nO|dddkrd d!lm
}||||S|dd"d#krd#}td$tj}||}|r|}n|dd"d%krddl}	ddl}
|	|
j|||\}}}d&|||fS)'aReturn a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    ntamd64	win-amd64z(arm)	win-arm32z(arm64)	win-arm64_PYTHON_HOST_PLATFORMposixuname/ _-Nlinuxz%s-%ssunosr5solarisz%d.%s32bit64bit)ilz.%saixr)aix_platformcygwinz[\d.]+darwinz%s-%s-%s)osnamesysversionlowerplatformenvironhasattrrreplaceintmaxsizeZ
py38compatr recompileASCIImatchgroup_osx_supportdistutils.sysconfigget_platform_osx	sysconfigget_config_vars)osnamehostreleaser'machinebitnessr rel_remr4	distutilsrA/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/util.pyget_host_platformsT


 


rCcCs6tjdkrddddd}|tjdptStS)Nr	win32rrr
)x86x64armarm64VSCMD_ARG_TGT_ARCH)r$r%getr*rC)TARGET_TO_PLATrArArBget_platformds
rLr#MACOSX_DEPLOYMENT_TARGETcCsdadS)zFor testing only. Do not call.N)_syscfg_macosx_verrArArArB_clear_cached_macosx_verusrOcCs.tdurddlm}|tpd}|r|atS)zGet the version of macOS latched in the Python interpreter configuration.
    Returns the version as a string or None if can't obtain one. Cached.Nr)r7r)rNr@r7get_config_varMACOSX_VERSION_VAR)r7verrArArB!get_macosx_target_ver_from_syscfgzsrScCs^t}tjt}|r-|r+t|ddgkr+t|ddgkr+dtd||f}t||S|S)aReturn the version of macOS for which we are building.

    The target version defaults to the version in sysconfig latched at time
    the Python interpreter was built, unless overridden by an environment
    variable. If neither source has a value, then None is returned
r$zE mismatch: now "%s" but "%s" during configure; must use 10.3 or later)rSr$r*rJrQ
split_versionr)Z
syscfg_verZenv_vermy_msgrArArBget_macosx_target_versrXcCsdd|dDS)zEConvert a dot-separated string into a list of numbers for comparisonscSsg|]}t|qSrA)r-).0nrArArB
sz!split_version...)split)srArArBrVsrVcCstjdkr|S|s|S|ddkrtd||ddkr#td||d}d|vr5|dd|vs,|s:tjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absolutezpath '%s' cannot end with '/'r\)r$sep
ValueErrorr]removecurdirpathjoin)pathnamepathsrArArBconvert_paths
	

rhcCstjdkrtj|stj||Stj||ddStjdkr=tj|\}}|ddkr6|dd}tj||Stdtj)a	Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    rrNr	r\z!nothing known about platform '%s')r$r%rdisabsre
splitdriver)new_rootrfdriverdrArArBchange_roots

rnc	CsvtrdStjdkr,dtjvr,zddl}|tdtjd<Wnttfy+Ynwdtjvr7t	tjd<dadS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    NrHOMErrPLATr)
_environ_checkedr$r%r*pwdgetpwuidgetuidImportErrorKeyErrorrL)rrrArArB
check_environs	
rwc
CsHt|fdd}ztd||WSty#}ztd|d}~ww)aPerform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    cSs(|d}||vrt||Stj|S)Nr)r3strr$r*)r2
local_varsvar_namerArArB_substs

zsubst_vars.._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rwr/subrvra)r^ryr{varrArArB
subst_varss	r~error: cCs|t|S)N)rx)excprefixrArArBgrok_environment_error
srcCs(tdtjatdatdadS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r/r0string
whitespace
_wordchars_re
_squote_re
_dquote_rerArArArB_init_regexs
rcCstdurt|}g}d}|rt||}|}|t|kr-||d|	|S||tjvrH||d|||d	}d}ni||dkra|d|||dd}|d}nP||dkrnt
||}n||dkr{t||}ntd|||durt
d|||\}}|d|||d|d||d}|d	}|t|kr||	|S|s|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nrrir'"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rrstripr2endlenappendrrlstriprrRuntimeErrorraspan)r^wordsposr?rbegrArArBsplit_quotedsD
,
$rcCsT|durd|j|f}|dddkr|ddd}t||s(||dSdS)aPerform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%rz,)r))__name__rinfo)funcargsmsgverbosedry_runrArArBexecuteYs	
rcCs.|}|dvr
dS|dvrdStd|f)zConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )yyesttrueon1r)rZnoffalseoff0rzinvalid truth value %r)r(ra)valrArArB	strtoboollsrc	CsNddl}tjrtd|dur|dk}|szddlm}	|	d\}
}Wnty9ddlm}d|d}
}Ynwt	d||s|
durMt
|
d	}
nt|d	}
|
&|

d
|

dtt|d|

d
|||||fWdn1s}wYtjg}|t||t||dtt
j|fd||ddSddlm}|D]w}|dddkrq|dkr|dkrdn|}tjj||d}ntj|}|}|r|dt||krtd||f|t|d}|rt
j||}t
j |}|r$|st!||rt	d|||s||||qt"d||qdS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.T)mkstempz.py)mktempz$writing byte-compilation script '%s'wz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rzremoving %s)r0r)optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#
subprocessr&dont_write_bytecodertempfilerrurrrr$fdopenopenwriteremaprepr
executableextendrrrrrb
py_compiler0	importlibutilcache_from_sourcerrardbasenamerdebug)py_filesoptimizeforcerbase_dirrrdirectrr	script_fdscript_namerscriptcmdr0fileoptcfiledfile
cfile_baserArArBbyte_compile|s~$



rcCs|d}d}||S)zReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    
z	
        )r]re)headerlinesr`rArArB
rfc822_escapes

r)r)Nrr)rrNNrrN)*__doc__r$r/importlib.utilrrr&distutils.errorsrdistutils.dep_utilrdistutils.spawnrr@rrZ
py35compatrrCrLr)rNrQrOrSrXrVrhrnrqrwr~rrrrrrrrrrrArArArBsNP



=
PK!:zM3_distutils/__pycache__/bcppcompiler.cpython-310.pycnu[o

Xai.:@spdZddlZddlmZmZmZmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZGdd	d	e	ZdS)
zdistutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
N)DistutilsExecErrorCompileErrorLibError	LinkErrorUnknownFileError)	CCompilergen_preprocess_options)
write_file)newer)logc@seZdZdZdZiZdgZgdZeeZdZ	dZ
dZdZZ
d	Z	
	
	
dddZ	
	
dddZ	
	
	
dddZ	
	
	
	
	
	
	
	
	
	
dddZdddZ	
	d ddZ	
	
	
	
	
d!ddZd
S)"BCPPCompilerzConcrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    Zbcppz.c)z.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCsnt||||d|_d|_d|_d|_gd|_gd|_gd|_gd|_	g|_
gd|_gd|_dS)	Nz	bcc32.exezilink32.exeztlib.exe)/tWMz/O2/q/g0)r
z/Odrr)z/Tpd/Gnr/x)rrr)rrrz/r)
r__init__cclinkerlibZpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugZldflags_staticldflags_exeldflags_exe_debug)selfverbosedry_runforcer /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/bcppcompiler.pyr5s




zBCPPCompiler.__init__Nc	Csn|||||||\}}	}}
}|pg}|d|r!||jn||j|	D]}
z||
\}}Wn	ty<Yq)wtj|}tj|
}
|	tj
|
|dkrWq)|dkrxz|dd|
|gWntyv}zt
|d}~wwq)||jvrd}n
||jvrd}nd}d|
}z||jg||
||g||gWq)ty}zt
|d}~ww|	S)	Nz-c.res.rcZbrcc32z-foz-P-o)Z_setup_compileappendextendrrKeyErrorospathnormpathmkpathdirnamespawnrr
_c_extensions_cpp_extensionsr)rsources
output_dirmacrosinclude_dirsdebug
extra_preargsextra_postargsdependsobjectspp_optsbuildZcompile_optsobjsrcextmsgZ	input_optZ
output_optr r r!compileQs^



zBCPPCompiler.compilec	
Cs|||\}}|j||d}|||r;|dg|}|r	z||jg|WdSty:}zt|d}~wwtd|dS)N)r2z/uskipping %s (up-to-date))	_fix_object_argslibrary_filename
_need_linkr.rrrrr5)	rr9Zoutput_libnamer2r5target_langoutput_filenameZlib_argsr?r r r!create_static_libszBCPPCompiler.create_static_libc 
Cs|||\}}||||\}}}|rtdt||dur'tj||}|||ra|t	j
krGd}|	r?|jdd}n|jdd}nd}|	rS|j
dd}n|jdd}|durad}n?tj|\}}tj|\}}tj|d}tj|d|}dg}|pgD]}|d||fq|t||fd	|ttjj|}|g}g}|D]}tjtj|\}}|d
kr||q||q|D]
}|dtj|q|d|||d
|g|d|D]}||||	}|dur||q||q|d|d|d
|g|d
|||
r2|
|dd<|r:|||tj|z||jg|WdSty`}zt|d}~wwtd|dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r$rz%s.defZEXPORTSz  %s=_%sz
writing %sr"z/L%sz/L.,z,,Zimport32Zcw32mtrA) rBZ
_fix_lib_argsrwarnstrr)r*joinrDrZ
EXECUTABLErrrrsplitsplitextr-r&executer	mapr+normcaser'find_library_filer,r.rrrr5) rZtarget_descr9rFr2	librarieslibrary_dirsruntime_library_dirsexport_symbolsr5r6r7Z
build_temprEZstartup_objZld_argsZdef_fileheadtailmodnamer>temp_dircontentssymZobjects2	resourcesfilebaselrlibfiler?r r r!links









zBCPPCompiler.linkc	Csr|r|d}|d|d||f}n|d|f}|D]}|D]}tj|||}tj|r5|SqqdS)N_dZ_bcpp)r)r*rKrCexists)	rdirsrr5ZdlibZ	try_namesdirnamer`r r r!rQ4s
zBCPPCompiler.find_library_filer$cCs|durd}g}|D]V}tjtj|\}}||jddgvr)td||f|r1tj|}|dkrB|tj|||q
|dkrS|tj||dq
|tj|||j	q
|S)Nr$r#r"z"unknown file type '%s' (from '%s'))
r)r*rMrPsrc_extensionsrbasenamer&rK
obj_extension)rZsource_filenamesZ	strip_dirr2Z	obj_namessrc_namer^r>r r r!object_filenamesNs$zBCPPCompiler.object_filenamesc
Cs|d||\}}}t||}dg|}	|dur|	d||r'||	dd<|r.|	||	||js?|dus?t||rg|rJ|tj	|z|
|	WdStyf}
zt|
t
|
d}
~
wwdS)Nz	cpp32.exer%r)Z_fix_compile_argsrr&r'rr
r,r)r*r-r.rprintr)rsourceZoutput_filer3r4r6r7_r:Zpp_argsr?r r r!
preprocessis,	



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr$)NNNNN)__name__
__module____qualname____doc__
compiler_typeZexecutablesr/r0rgriZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr@rGrarQrkror r r r!rsZ

D




r)rsr)distutils.errorsrrrrrZdistutils.ccompilerrrdistutils.file_utilr	distutils.dep_utilr
	distutilsrrr r r r!sPK!Ъb	b	;_distutils/command/__pycache__/install_data.cpython-310.pycnu[o

Xai@s<dZddlZddlmZddlmZmZGdddeZdS)zdistutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.N)Command)change_rootconvert_pathc@sFeZdZdZgdZdgZddZddZdd	Zd
dZ	dd
Z
dS)install_datazinstall data files))zinstall-dir=dzIbase directory for installing data files (default: installation base dir))zroot=Nzs
PK!hV==9_distutils/command/__pycache__/build_clib.cpython-310.pycnu[o

XaiV@sTdZddlZddlmZddlTddlmZddlmZddZ	Gd	d
d
eZ
dS)zdistutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.N)Command)*)customize_compiler)logcCsddlm}|dS)Nrshow_compilers)distutils.ccompilerrrr	/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/build_clib.pyrs
rc@sfeZdZdZgdZddgZdddefgZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZdS)
build_clibz/build C/C++ libraries used by Python extensions))zbuild-clib=bz%directory to build C/C++ libraries to)zbuild-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r
build_temp	librariesinclude_dirsdefineundefrrcompilerselfr	r	r
initialize_options4s
zbuild_clib.initialize_optionscCsl|dddddd|jj|_|jr||j|jdur$|jjp"g|_t|jtr4|jtj	|_dSdS)Nbuild)rr)rr)rr)rr)rr)
set_undefined_optionsdistributionrcheck_library_listr
isinstancestrsplitospathseprr	r	r
finalize_optionsDs

zbuild_clib.finalize_optionscCs|jsdSddlm}||j|j|jd|_t|j|jdur'|j|j|j	dur;|j	D]\}}|j
||q/|jdurL|jD]}|j|qC|
|jdS)Nr)new_compiler)rdry_runr)rrr&rr'rrrZset_include_dirsrZdefine_macrorZundefine_macrobuild_libraries)rr&namevalueZmacror	r	r
run^s"




zbuild_clib.runcCst|ts	td|D]=}t|tst|dkrtd|\}}t|ts)tdd|vs7tjdkr?tj|vr?td|dt|tsHtdqd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuplesz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r listDistutilsSetupErrortuplelenr!r#sepdict)rrlibr)
build_infor	r	r
rvs0



zbuild_clib.check_library_listcCs,|jsdSg}|jD]	\}}||q
|S)N)rappend)rZ	lib_nameslib_namer5r	r	r
get_library_namesszbuild_clib.get_library_namescCsZ||jg}|jD]\}}|d}|dust|ttfs%td|||q|S)Nsourcesfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rrgetr r.r0r/extend)r	filenamesr7r5r9r	r	r
get_source_filess
zbuild_clib.get_source_filescCs|D]G\}}|d}|dust|ttfstd|t|}td||d}|d}|jj||j	|||j
d}|jj|||j|j
dqdS)Nr9r:zbuilding '%s' librarymacrosr)
output_dirr?rr)r@r)
r;r r.r0r/rinforcompilerrZcreate_static_libr)rrr7r5r9r?rZobjectsr	r	r
r(s.



	zbuild_clib.build_libraries)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrhelp_optionsrr%r+rr8r>r(r	r	r	r
rs
$r)__doc__r#distutils.corerdistutils.errorsdistutils.sysconfigr	distutilsrrrr	r	r	r
sPK!XB&&7_distutils/command/__pycache__/build_py.cpython-310.pycnu[o

Xaio@@sddZddlZddlZddlZddlZddlmZddlTddl	m
Z
ddlmZGdddeZ
dS)	zHdistutils.command.build_py

Implements the Distutils 'build_py' command.N)Command)*)convert_path)logc@seZdZdZgdZddgZddiZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZddZddZddZd d!Zd.d#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-S)/build_pyz5"build" pure Python modules (copy to build directory)))z
build-lib=dzdirectory to "build" (copy) to)compileczcompile .py to .pyc)
no-compileNz!don't compile .py files [default])z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz2forcibly build everything (ignore file timestamps)rrr
cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	build_lib
py_modulespackagepackage_datapackage_dirroptimizerselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/build_py.pyinitialize_options s
zbuild_py.initialize_optionsc	Cs|ddd|jj|_|jj|_|jj|_i|_|jjr/|jjD]\}}t||j|<q#||_	t
|jts`zt|j|_d|jkrMdksPJJWdSt
tfy_tdwdS)Nbuild)rr)rrrzoptimize must be 0, 1, or 2)set_undefined_optionsdistributionpackagesrrritemsrget_data_files
data_files
isinstancerint
ValueErrorAssertionErrorDistutilsOptionError)rnamepathrrrfinalize_options*s(



$zbuild_py.finalize_optionscCs:|jr||jr||||jdddS)Nr)include_bytecode)r
build_modulesrbuild_packagesbuild_package_databyte_compileget_outputsrrrrrunCszbuild_py.runcsg}|js|S|jD]4}||}tjj|jg|d}d|r(t|dfdd|||D}|	||||fq
|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples.rcsg|]}|dqSNr).0fileplenrr
ssz+build_py.get_data_files..)
rget_package_dirosr'joinrsplitlenfind_data_filesappend)rdatarsrc_dir	build_dir	filenamesrr5rras



zbuild_py.get_data_filescsd|jdg|j|g}g|D]}ttjt|t|}fdd|DqS)z6Return filenames for package's data files in 'src_dir'cs$g|]}|vrtj|r|qSr)r9r'isfile)r3fnfilesrrr7s

z,build_py.find_data_files..)	rgetglobr9r'r:escaperextend)rrr@ZglobspatternfilelistrrFrr=yszbuild_py.find_data_filescCs`d}|jD](\}}}}|D]}tj||}|tj||jtj|||ddq
qdS)z$Copy data files into build directoryNF
preserve_mode)r r9r'r:mkpathdirname	copy_file)rZlastdirrr@rArBfilenametargetrrrr,szbuild_py.build_package_datacCs|d}|js|rtjj|SdSg}|rCz
|jd|}Wnty4|d|d|d=Yn
w|d|tjj|S|s|jd}|durS|d||r[tjj|SdS)zReturn the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r0rCrN)r;rr9r'r:KeyErrorinsertrH)rrr'tailZpdirrrrr8s,

zbuild_py.get_package_dircCsj|dkrtj|std|tj|std||r3tj|d}tj|r-|Std|dS)NrCz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r9r'existsDistutilsFileErrorisdirr:rDrwarn)rrrinit_pyrrr
check_packages&zbuild_py.check_packagecCs"tj|std||dSdS)Nz!file %s (for module %s) not foundFT)r9r'rDrr\)rmodulemodule_filerrrcheck_moduleszbuild_py.check_modulec	Cs|||ttjt|d}g}tj|jj}|D](}tj|}||kr@tj	tj
|d}||||fq|d|q|S)Nz*.pyrzexcluding %s)
r^rIr9r'r:rJabspathrscript_namesplitextbasenamer>debug_print)	rrrZmodule_filesmodulesZsetup_scriptr
Zabs_fr_rrrfind_package_modulesszbuild_py.find_package_modulesc	Csi}g}|jD]]}|d}d|dd}|d}z||\}}Wnty3||}d}Ynw|sL|||}	|df||<|	rL||d|	ftj||d}
|	||
s\q||||
fq|S)aFinds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r0rrUr1__init__.py)
rr;r:rVr8r^r>r9r'ra)rrrgr_r'rZmodule_basercheckedr]r`rrrfind_moduless,


zbuild_py.find_modulescCsNg}|jr|||jr%|jD]}||}|||}||q|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrKrlrr8rh)rrgrrmrrrfind_all_moduless

zbuild_py.find_all_modulescCsdd|DS)NcSsg|]}|dqS)rUr)r3r_rrrr7-sz-build_py.get_source_files..)rnrrrrget_source_files,szbuild_py.get_source_filescCs$|gt||dg}tjj|S)Nrj)listr9r'r:)rrArr_Zoutfile_pathrrrget_module_outfile/szbuild_py.get_module_outfiler1cCs|}g}|D]8\}}}|d}||j||}|||r@|jr/|tjj|dd|j	dkr@|tjj||j	dq|dd|j
D7}|S)Nr0rC)optimizationrcSs,g|]\}}}}|D]	}tj||q
qSr)r9r'r:)r3rr@rArBrSrrrr7Bs
z(build_py.get_outputs..)rnr;rqrr>r	importlibutilcache_from_sourcerr )rr)rgoutputsrr_r`rSrrrr.3s(




zbuild_py.get_outputscCsbt|tr|d}nt|ttfstd||j||}tj	
|}|||j||ddS)Nr0z:'package' must be a string (dot-separated), list, or tuplerrN)
r!strr;rptuple	TypeErrorrqrr9r'rQrPrR)rr_r`routfiledirrrrbuild_moduleJs

zbuild_py.build_modulecCs*|}|D]\}}}||||qdSr2)rlr|)rrgrr_r`rrrr*Yszbuild_py.build_modulescCsP|jD]"}||}|||}|D]\}}}||ksJ||||qqdSr2)rr8rhr|)rrrrgZpackage_r_r`rrrr+bs


zbuild_py.build_packagescCstjr
|ddSddlm}|j}|dtjkr|tj}|jr-||d|j	||j
d|jdkr@|||j|j	||j
ddSdS)Nz%byte-compiling is disabled, skipping.r)r-rU)rrprefixdry_run)sysdont_write_bytecoder\distutils.utilr-rr9seprrr~r)rrGr-r}rrrr-vs 





zbuild_py.byte_compileN)r1)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr(r/rr=r,r8r^rarhrlrnrorqr.r|r*r+r-rrrrrs0



'4
	r)__doc__r9importlib.utilrsrrIdistutils.corerdistutils.errorsrr	distutilsrrrrrrsPK!1{665_distutils/command/__pycache__/upload.cpython-310.pycnu[o

Xai@sdZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZeed
deeddeeddd
ZGdddeZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
N)standard_b64encode)urlopenRequest	HTTPError)urlparse)DistutilsErrorDistutilsOptionError)
PyPIRCCommand)spawn)logmd5sha256blake2b)Z
md5_digestZ
sha256_digestZblake2_256_digestc@sJeZdZdZejddgZejdgZddZddZd	d
Z	ddZ
d
S)uploadzupload binary package to PyPI)signszsign files to upload using gpg)z	identity=izGPG identity used to sign filesrcCs,t|d|_d|_d|_d|_d|_dS)NrF)r	initialize_optionsusernamepassword
show_responseridentity)selfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/upload.pyr)s

zupload.initialize_optionscCszt||jr|jstd|}|ikr+|d|_|d|_|d|_|d|_	|js9|j
jr;|j
j|_dSdSdS)Nz.Must use --sign for --identity to have meaningrr
repositoryrealm)r	finalize_optionsrrr_read_pypircrrrrdistribution)rconfigrrrr1s




zupload.finalize_optionscCs:|jjs
d}t||jjD]\}}}||||qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))r 
dist_filesrupload_file)rmsgcommand	pyversionfilenamerrrrunCsz
upload.runc"
Cs>t|j\}}}}}}	|s|s|	rtd|j|dvr"td||jr>ddd|g}
|jr7d|jg|
dd<t|
|jd	t|d
}z
|}W|	n|	w|j
j}
iddd
dd|
d|

dtj||fd|d|ddd|
d|
d|
d|
d|
d|
d|
d|
d|
|
|
|
|
d}d |d!<tD]\}}|durqz
|| ||<Wqt!yYqw|jrt|d"d
}tj|d"|f|d#<Wdn	1swY|j"d$|j#$d%}d&t%|&d%}d'}d(|$d%}|d)}t'(}|D]J\}}d*|}t)|t*s@|g}|D]5}t+|t,urX|d+|d,7}|d-}nt-|$d.}|.||.|$d.|.d/|.|qBq/|.||/}d0||jf}|0|t1j2d1|t-t3||d2}t4|j||d3}z
t5|}|6}|j7}Wn/t8y} z| j9}| j7}WYd} ~ nd} ~ wt:y} z
|0t-| t1j;d} ~ ww|d4kr|0d5||ft1j2|j<r|=|}!d6>d7|!d7f}|0|t1j2dSdSd8||f}|0|t1j;t?|)9NzIncompatible url %s)httphttpszunsupported schema Zgpgz
--detach-signz-az--local-user)dry_runrbz:actionZfile_uploadZprotocol_version1nameversioncontentfiletyper&metadata_versionz1.0summaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformclassifiers)download_urlprovidesrequires	obsoletesrcommentz.ascZ
gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-length
Authorization)dataheaderszServer response (%s): %s
zK---------------------------------------------------------------------------zUpload failed (%s): %s)@rrAssertionErrorrrr
r,openreadcloser metadataget_nameget_versionospathbasenameget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes_FILE_CONTENT_DIGESTSitems	hexdigest
ValueErrorrrencoderdecodeioBytesIO
isinstancelisttypetuplestrwritegetvalueannouncerINFOlenrrgetcoder$rcodeOSErrorERRORr_read_pypi_responsejoinr)"rr%r&r'Zschemanetlocurlparamsquery	fragmentsZgpg_argsfr1metarEZdigest_namedigest_cons	user_passauthboundaryZsep_boundaryZend_boundarybodykeyvaluetitler$rFrequestresultstatusreasonetextrrrr#Ks


 









zupload.upload_fileN)__name__
__module____qualname__r8r	user_optionsboolean_optionsrrr(r#rrrrrsr)__doc__rPrfhashlibbase64rurllib.requestrrrurllib.parserdistutils.errorsrrdistutils.corer	distutils.spawnr
	distutilsrgetattrr`rrrrrs 


PK!p>GG9_distutils/command/__pycache__/py37compat.cpython-310.pycnu[o

Xai@sTddlZddZddZejdkr&ejdkr&ejddd	kr&eeeZdSeZdS)
NccsFddlm}|dsdSdtjd?tjd?d@|d	VdS)
zj
    On Python 3.7 and earlier, distutils would include the Python
    library. See pypa/distutils#9.
    r	sysconfigZPy_ENABLED_SHAREDNz
python{}.{}{}ABIFLAGS)	distutilsrget_config_varformatsys
hexversionrr
/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/py37compat.py_pythonlib_compats

rcsfddS)Ncs|i|S)Nr
)argskwargsf1f2r
rszcompose..r
rr
rrcomposesr)darwinraix)rrrversion_infoplatformlistZ	pythonlibr
r
r
rs

PK!s\70708_distutils/command/__pycache__/bdist_rpm.cpython-310.pycnu[o

Xai!T@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).N)Command)DEBUG)
write_file)*)get_python_version)logc@sdeZdZdZgdZgdZddddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
dS)	bdist_rpmzcreate an RPM distribution)))zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow ") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe ") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)
no-autoreqNz+do not automatically calculate dependencies)	keep-tempkz"don't clean up RPM build directory)no-keep-tempNz&clean up RPM build directory [default])use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)	rpm3-modeNz"RPM 3 compatibility mode (default))	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nzfinalize_optionss6




zbdist_rpm.finalize_optionscCsT|dd|dd|j|jf|d|dt|jtrr#r$)ZREADMEz
README.txtr 1r!rr%r&r'r(r)r*r+r,r-r.r/r1r2r3r4r5r:)
ensure_stringrLget_contactget_contact_emailensure_string_list
isinstancer$listrErFexistsappend_format_changelogr%ensure_filename)r<Zreadmer=r=r>rNsD




















zbdist_rpm.finalize_package_datacCstrtdtd|jtd|jtd|jtd|j|jr*|j}||ni}dD]}t	j
|j|||<|||q.|d}t	j
|d|j
}|t||fd	||jrddS|j
jdd}|d
}|jrydg|_ndg|_|d
||j
_|d
}|d}||||jrt	j
|jr||j|ntd|jtddg}	|jr|	dn|j r|	dn|	d|	!dd|j"g|j#r|	!ddt	j
$|jg|j%s|	d|j&r|	d|	|d}
|
d}d|
d}d|||f}
t	'|
}zCg}d}	|(}|s$n!|)*}t+|d ks3J||d!|durC|d
}q|,}|rTt-d"t.|
W|,n|,w|/|	|j0s|j
1rrt2}nd#}|j st	j
|d$|}t	j
|sJ|3||jt	j
|j|}|j
jd%||f|js|D]4}t	j
|d&|}t	j
|r|3||jt	j
|jt	j
4|}|j
jd%||fqdSdSdS)'Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)SOURCESSPECSBUILDRPMSSRPMSr\z%s.speczwriting '%s'sdistbztargztarrr[zicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'TrzFailed to execute: %sanyr_rr^)5rprintr"r#r$r%rrmkpathrErFrGrrLget_nameexecuter_make_spec_file
dist_filesreinitialize_commandrformatsrun_commandZget_archive_files	copy_filer&rWDistutilsFileErrorrinforrXrextendrr8abspathr6rpopenreadlinestripsplitlencloseDistutilsExecErrorreprspawndry_runrMr	move_filebasename)r<Zspec_dirZrpm_dirr	Z	spec_pathZsaved_dist_filesr`source
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmdoutZbinary_rpmsZ
source_rpmlinelstatusZ	pyversionZsrpmfilenamerAr=r=r>runs












z
bdist_rpm.runcCstj|jtj|S)N)rErFrGrr~)r<rFr=r=r>
_dist_pathszbdist_rpm._dist_pathc	CsJd|jd|jddd|jd|jdddd|jg}td	}d
dd|	D}d
}d}|||}||krT|
d|
d|d
|gd|jrd|
dn|
d|d|j
d|jddg|js|js|
dn|
d|jdD](}t||}t|tr|
d|d|fq|dur|
d||fq|jdkr|
d|j|jr|
d |j|jr|
d!d|j|jr|
d"tj|j|jr|
d#|dd$|jgd%|jtjtj d&f}d'|}	|j!r!d(|	}	d)|}
d*d+d,|	fd-d.|
fd/d0d1d2d3d4g	}|D]C\}}
}t||
}|sH|rz|dd5|g|rut"|}||#$d
Wdn	1snwYq8|
|q8|gd6|j%r|
d7d|j%|j&r|dd8g||j&|S)9ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version -_z%define unmangled_version z%define release z	Summary: zrpm --eval %{__os_install_post}
cSsg|]}d|qS)z  %s \)ru).0rr=r=r>
sz-bdist_rpm._make_spec_file..zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post )z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerProvidesRequiresZ	Conflicts	Obsoletesz%s: %s NUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r0r'z&%setup -n %{name}-%{unmangled_version}buildr(installr))cleanr*zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr+N)prer,N)postr-N)Zpreunr.N)Zpostunr/N%)rz%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rLrgget_versionreplacer get_description
subprocess	getoutputrG
splitlinesrXrqrget_licenserr:rMgetattrlowerrUrVget_urlrr4r&rErFr~r9get_long_descriptionrrHargvr7openreadrvr$r%)r<Z	spec_fileZvendor_hookproblemfixedZ
fixed_hookfieldvalZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_optattrdefaultfr=r=r>ris


	








zbdist_rpm._make_spec_filecCs||s|Sg}|dD]'}|}|ddkr!|d|gq
|ddkr-||q
|d|q
|ds<|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rrrrrz  )rurvrqrX)r<r%Z
new_changelogrr=r=r>rY0szbdist_rpm._format_changelogN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optr?rOrNrrrirYr=r=r=r>rs"m--*r)__doc__rrHrEdistutils.corerdistutils.debugrdistutils.file_utilrdistutils.errorsdistutils.sysconfigr	distutilsrrr=r=r=r>sPK!!u?M?M8_distutils/command/__pycache__/bdist_msi.cpython-310.pycnu[o

Xai@sdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
d
eZGdddeZdS)z#
Implements the bdist_msi command.
N)Command)remove_tree)get_python_version)
StrictVersion)DistutilsOptionError)get_platform)log)schemasequencetext)	DirectoryFeatureDialogadd_datac@sFeZdZdZddZddZddd	ZdddZdddZddZ	dS)PyDialogzDialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs@tj|g|R|jd}d|d}|dd||jddS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)$iHZ
BottomLinerN)r__init__hlinew)selfargskwZrulerZbmwidthr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|ddddddd|dS)	z,Set the title text of the dialog at the top.Title
@<z{\VerdanaBold10}%sN)r)rtitlerrrr"%szPyDialog.titleBackc
C,|rd}nd}||d|jddd|||S)zAdd a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr$8
pushbuttonrrr"nextnameactiveflagsrrrback,z
PyDialog.backCancelc
Cr%)zAdd a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr&r$i0r(r)r*r+r-rrrcancel7r3zPyDialog.cancelNextc
Cr%)zAdd a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr&r$r(r)r*r+r-rrrr.Br3z
PyDialog.nextc
Cs,||t|j|d|jdddd||S)zAdd a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associatedr(r)r*r&)r,intrr)rr/r"r.ZxposrrrxbuttonMs,zPyDialog.xbuttonN)r#r$)r4r$)r6r$)
__name__
__module____qualname____doc__rr"r2r5r.r:rrrrrs



rc
seZdZdZddddefdddd	d
ddd
g
ZgdZgdZdZfddZ	ddZ
ddZddZddZ
ddZddZdd Zd!d"ZZS)#	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)rArCrErH)z2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9Xcs$tj|i|tdtddS)NzZbdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead)superrwarningswarnDeprecationWarning)rrr	__class__rrrszbdist_msi.__init__cCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)	bdist_dir	plat_name	keep_tempZno_target_compileZno_target_optimizetarget_versiondist_dir
skip_buildinstall_scriptpre_install_scriptversions)rrrrinitialize_optionss
zbdist_msi.initialize_optionscCs|dd|jdur|dj}tj|d|_t}|js'|j	
r'||_|jrD|jg|_|jsC|j	
rC|j|krCt
d|fnt|j|_|ddd|jrXt
d|jrt|j	jD]
}|jtj|krlnq_t
d|jd|_dS)	Nbdist)rVrVZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rUrU)rRrRz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)set_undefined_optionsrQget_finalized_command
bdist_baseospathjoinrrTdistributionhas_ext_modulesrYrVrlistall_versionsrXrWscriptsbasenameinstall_script_key)rr^Z
short_versionscriptrrrfinalize_optionssJ



zbdist_msi.finalize_optionscCs~|js|d|jddd}|j|_|j|_d|_|d}d|_d|_|j	rV|j
}|s?|js6Jddtjdd	}d
|j
|f}|d}tj|jd||_td|j|tjdtj|jd
|tjd=||j|j}||}tj|}tj|rt||jj }|j!}	|	s|j"}	|	sd}	|#}
dt$|
j%}|j}|j
rd|j
|f}nd|}t&'|t(|t&)||	|_*t&+|j*t,d|
fg}
|j-p|j.}|r|
/d|f|j0r|
/d|j0f|
rt1|j*d|
|2|3|4|5|j*6t7|jdr/d|j
p%d|f}|jj8/||j9s=t:|j|j;ddSdS)Nbuildinstallr$)reinit_subcommandsrinstall_libz Should have already checked thisz%d.%drJz.%s-%slibzinstalling to %sZPURELIBUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUTProperty
dist_filesr?any)dry_run)

	zbdist_msi.add_scriptscCs
|j}d}}d}d}d}d}d}d}	t|dgd	t|d
gdt|dgd
t|dtjt|dtjt|d||||||ddd}
|
d|
jdddd|
jdddd|
ddddddd|
ddd dd!dd"|
j	dddd#}|
d$d%t|d&||||||ddd}|d'|jdddd|jdddd|ddddddd(|ddd dd!dd"|j	dddd#}|
d$d%t|d)||||||ddd}
|
d*|
jdddd|
jdddd|
d+dd,dd!dd"|
j	dddd#}|
d$d-t|d.||||d/|d0d0d0d1d2}|d3dd4d5ddd6|d+d!d7d8d!dd9|d:d!d;dd?d!d@dz[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogrJZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHiderZDiskCostDlgOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostListdiz{120}{70}{70}{70}{70}g?rZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.rrzInstall for all usersZJUSTMEzInstall just for mez
[ALLUSERS]zWhichUsers="ALL"rz({\DlgFontBold8}[Progress1] [ProductName]#AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressProgressrz)Welcome to the [ProductName] Setup WizardZBodyText?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGrouplrrrz&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallrz[REMOVE]zMaintenanceForm_Action="Remove"ZRemovingZremoves
z MaintenanceForm_Action<>"Change")rrrrrrr"r2r5r.eventcontrolrr,mappingrbrrYr	conditionr:Z
radiogroupadd)rrxyrrr"modalZmodelessZtrack_disk_spacefatalrDZ	user_exitZexit_dialogZinuseerrorr5ZcostingprepZseldlgorderrrZinstall_other_condZdont_install_other_condZcostZ
whichusersgprogressZmaintrrrrs
	



       





zbdist_msi.add_uicCs<|jr
d||j|jf}nd||jf}tj|j|}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rTrRr_r`rarU)rr	base_namerrrrrsz bdist_msi.get_installer_filename)r;r<r=descriptionruser_optionsboolean_optionsrerrrZrjrrrrrr
__classcell__rrrOrr?Us>
([66&@r?)r>r_r{rLdistutils.corerdistutils.dir_utilrdistutils.sysconfigrZdistutils.versionrdistutils.errorsrdistutils.utilr	distutilsrrr	r
rrr
rrrr?rrrrs >PK!F!!<_distutils/command/__pycache__/bdist_wininst.cpython-310.pycnu[o

Xai>@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.N)Command)get_platform)remove_tree)*)get_python_version)logc
seZdZdZddddefdddd	d
ddd
dddg
ZgdZejdkZ	fddZ
ddZddZddZ
ddZd$ddZd d!Zd"d#ZZS)%
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)no-target-compilecz/do not compile .py to .pyc on the target system)no-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)zbitmap=bz>bitmap to use for the installer instead of python-powered logo)ztitle=tz?title to display on the installer background instead of default)
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nzspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UAC)r
rrrwin32cs$tj|i|tdtddS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead)super__init__warningswarnDeprecationWarning)selfargskw	__class__/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_wininst.pyr?szbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
	bdist_dir	plat_name	keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle
skip_buildinstall_scriptpre_install_scriptuser_access_control)rr r r!initialize_optionsEs
z bdist_wininst.initialize_optionscCs|dd|jdur)|jr|jr|jd}|j|_|dj}tj	
|d|_|js/d|_|jsL|jrLt
}|jrI|j|krItd|f||_|ddd|jrp|jjD]}|jtj	|krhdSqZtd|jdS)	Nbdist)r+r+ZwininstzMtarget version can only be %s, or the '--skip-build' option must be specified)r(r()r#r#z(install_script '%s' not found in scripts)set_undefined_optionsr"r+r#distributionget_command_objget_finalized_command
bdist_baseospathjoinr'has_ext_modulesrDistutilsOptionErrorr,scriptsbasename)rr0r6Z
short_versionscriptr r r!finalize_optionsUsB
zbdist_wininst.finalize_optionsc
Cstjdkr|js|jrtd|js|d|jddd}|j	|_
|j|_d|_|j|_|d}d|_
d|_|jrm|j}|sV|jsMJd	d
tjdd}d|j|f}|d}tj|jd
||_dD]}|}|dkr}|d}t|d||qotd|j	|tjdtj|j	d|tjd=ddlm}|}	|j }
|j!|	d|j	d}|"||
|j#|jrt$}nd}|jj%&d||'|
ft(d|t)||j*st+|j	|j,ddSdS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall)reinit_subcommandsrinstall_libz Should have already checked thisz%d.%drz.%s-%slib)purelibplatlibheadersr<datarHz/Include/$dist_nameinstall_zinstalling to %sZPURELIB)mktempzip)root_diranyrzremoving temporary file '%s')dry_run)-sysplatformr3r:has_c_librariesDistutilsPlatformErrorr+run_commandreinitialize_commandr"rootwarn_dirr#compileoptimizer'version_infor5r7r8r9
build_base	build_libuppersetattrrinfoensure_finalizedinsertruntempfilerKget_fullnamemake_archive
create_exer)r
dist_filesappendget_installer_filenamedebugremover$rrO)
rrArDr'Zplat_specifierr@keyvaluerKZarchive_basenamefullnamearcnameZ	pyversionr r r!rb{sv








zbdist_wininst.runcCsXg}|jj}|d|jpdd}dd}dD]!}t||d}|r9|d|||f}|d|||fq|d	|jrJ|d
|j|d|||d|j|d
|j|j	rp|d|j	|j
r{|d|j
|jp|j}|d||ddl
}ddl}	d||
|	jf}
|d|
d|S)Nz
[metadata]r1
cSs|ddS)Nrpz\n)replace)sr r r!escapesz)bdist_wininst.get_inidata..escape)authorauthor_emaildescription
maintainermaintainer_emailnameurlversionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3metadatarhlong_descriptiongetattr
capitalizer,r%r&r'r.r*rdtime	distutilsctime__version__r9)rlinesr|r_rsryrIr*rrZ
build_infor r r!get_inidatas@


zbdist_wininst.get_inidataNc	Csddl}||j|}||}|d||r:t|d}|}Wdn1s0wYt|}	nd}	t|d}
|
	|
|rP|
	|t|trZ|
d}|d}|jrt|jddd	}|
d}Wdn1s{wY||d
}n|d}|
	||ddt||	}
|
	|
t|d}|
	|Wdn1swYWddSWddS1swYdS)
Nrzcreating %srbwbmbcsrzlatin-1)encodings
zZscript_dataheaderr r r!rfsP







#"zbdist_wininst.create_execCsF|jrtj|jd||j|jf}|Stj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r'r7r8r9r(r#)rrnrr r r!ri1s

z$bdist_wininst.get_installer_filenamec	Cs$t}|jr6|j|kr6|jdkrd}nB|jdkrd}n:|jdkr#d}n2|jdkr+d}n*|jdkr3d	}n"d
}nzddlm}WntyId
}Ynw|d
d}|d}tjt	}|j
dkrq|j
dddkrq|j
dd}nd}tj|d||f}t|d}z	|
W|S|w)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)CRT_ASSEMBLY_VERSION.z.0rwinr1zwininst-%s%s.exer)rr'msvcrtrImportError	partitionr7r8dirname__file__r#r9rrclose)	rZcur_versionZbvrmajor	directoryZsfixfilenamerr r r!r>s:	





zbdist_wininst.get_exe_bytes)N)__name__
__module____qualname__rvruser_optionsboolean_optionsrPrQZ_unsupportedrr/r?rbrrfrir
__classcell__r r rr!rs<%
&Q
.7
r)__doc__r7rPrdistutils.corerdistutils.utilrdistutils.dir_utilrdistutils.errorsdistutils.sysconfigrrrrr r r r!sPK!??8_distutils/command/__pycache__/build_ext.cpython-310.pycnu[o

Xai{@sdZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
lmZedZddZGdddeZdS)zdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).N)Command)*)customize_compilerget_python_version)get_config_h_filename)newer_group)	Extension)get_platform)log)
py37compat)	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|dS)Nrshow_compilers)distutils.ccompilerrrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.pyrs
rc@seZdZdZdejZdddddefdd	d
defdd
ddddefddddddddddgZgdZ	ddde
fgZd d!Zd"d#Z
d$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zejd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdS)D	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=bz(directory for compiled extension modules)zbuild-temp=tz1directory for temporary files (build by-products)z
plat-name=pz>platform name to cross-compile for, if supported (default: %s))inplaceiziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link withz
library-dirs=Lz.directories to search for external C libraries)zrpath=Rz7directories to search for shared C libraries at runtime)z
link-objects=Oz2extra explicit link objects to include in the link)debuggz'compile/link with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)userNz#add user include, library and rpath)rr r"r&r'z
help-compilerNzlist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)
extensions	build_lib	plat_name
build_temprpackageinclude_dirsdefineundef	librarieslibrary_dirsrpathlink_objectsr r"compilerswigswig_cpp	swig_optsr'parallelselfrrrinitialize_optionsks*
zbuild_ext.initialize_optionsc

Csddlm}|ddddddd	d
|jdur|jj|_|jj|_|}|jdd}|j	dur7|jj	p5g|_	t
|j	trE|j	t
j|_	tjtjkrW|j	t
jtjd
|j	|t
jj||krq|j	|t
jj|d|d|jdurg|_|jdurg|_nt
|jtr|jt
j|_|jdurg|_nt
|jtr|jt
j|_t
jdkr-|jt
jtjdtjtjkr|jt
jtjd|jrt
j|jd|_n	t
j|jd|_|j	t
jtt tdd}|r|j||j!dkrd}n|j!dd}t
jtjd}|r't
j||}|j|tj"dddkrS|j#sM|jt
jtjddt$dn|jd|%drm|j#sg|j|%dn|jd|j&r|j&d }d!d"|D|_&|j'r|j'd |_'|j(durg|_(n|j(d#|_(|j)rt
jt*d
}t
jt*d}	t
j+|r|j	|t
j+|	r|j|	|j|	t
|j,trz	t-|j,|_,WdSt.yt/d$wdS)%Nr)	sysconfigbuild)r)r))r+r+)r4r4)r r )r"r")r8r8)r*r*r)
plat_specificincluder0r3ntZlibsZDebugZRelease_homewin32ZPCbuildcygwinlibpythonconfig.Py_ENABLE_SHAREDLIBDIR,cSsg|]}|dfqS)1r).0symbolrrr
sz.build_ext.finalize_options.. zparallel should be an integer)0	distutilsr<set_undefined_optionsr,distributionext_packageext_modulesr(get_python_incr-
isinstancestrsplitospathsepsysexec_prefixbase_exec_prefixappendpathjoinextendensure_string_listr0r1r2nameprefixr r+dirnamergetattrr*platformpython_buildrget_config_varr.r/r7r'r
isdirr8int
ValueErrorDistutilsOptionError)
r:r<Z
py_includeZplat_py_include	_sys_homesuffixZnew_libZdefinesZuser_includeZuser_librrrfinalize_optionss









zbuild_ext.finalize_optionscCsbddlm}|jsdS|jr&|d}|j|pg|j	
|j||j|j
|j|jd|_t|jtjdkrJ|jtkrJ|j|j|jdurV|j|j|jdurj|jD]\}}|j||q^|jdur{|jD]}|j|qr|jdur|j|j|j	dur|j|j	|jdur|j|j|j dur|j!|j |"dS)Nr)new_compiler
build_clib)r4verbosedry_runr"r@)#rrsr(rThas_c_librariesget_finalized_commandr0rcZget_library_namesr1r`rtr4rurvr"rr[rer*r	Z
initializer-Zset_include_dirsr.Zdefine_macror/Zundefine_macroZ
set_librariesZset_library_dirsr2Zset_runtime_library_dirsr3Zset_link_objectsbuild_extensions)r:rsrtrevaluemacrorrrruns@










z
build_ext.runc
Csht|ts	tdt|D]\}}t|trq
t|tr"t|dkr&td|\}}td|t|t	r:t
|s>tdt|tsGtdt||d}dD]}|
|}|d	urat|||qP|
d
|_d|vrqtd|
d
}|rg|_g|_|D],}	t|	trt|	dvstdt|	dkr|j|	dqt|	dkr|j|	q|||<q
d	S)aEnsure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instanceszMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sources)r-r1r0
extra_objectsextra_compile_argsextra_link_argsNr2Zdef_filez9'def_file' element of build info dict no longer supportedmacros)rr}z9'macros' element of build info dict must be 1- or 2-tuplerr)rXlistDistutilsSetupError	enumeratertuplelenr
warnrYextension_name_rematchdictgetsetattrruntime_library_dirs
define_macrosundef_macrosr`)
r:r(rextext_nameZ
build_infokeyvalrr{rrrcheck_extensions_listWsd








zbuild_ext.check_extensions_listcCs,||jg}|jD]}||jq|SN)rr(rcr~)r:	filenamesrrrrget_source_filess

zbuild_ext.get_source_filescCs2||jg}|jD]}|||jq|Sr)rr(r`get_ext_fullpathre)r:outputsrrrrget_outputss

zbuild_ext.get_outputscCs*||j|jr|dS|dSr)rr(r8_build_extensions_parallel_build_extensions_serialr9rrrryszbuild_ext.build_extensionsc
sj}jdurt}zddlm}Wntyd}Ynw|dur*dS||d8fddjD}tj|D]\}}	||
Wdn1sYwYqAWddS1sjwYdS)NTr)ThreadPoolExecutor)max_workerscsg|]	}j|qSr)submitbuild_extension)rNrexecutorr:rrrPsz8build_ext._build_extensions_parallel..)r8r[	cpu_countconcurrent.futuresrImportErrorrr(zip_filter_build_errorsresult)r:workersrfuturesrfutrrrrs,

"z$build_ext._build_extensions_parallelc	CsD|jD]}||
||Wdn1swYqdSr)r(rr)r:rrrrrs
z"build_ext._build_extensions_serialc
csXzdVWdStttfy+}z|js|d|j|fWYd}~dSd}~ww)Nz"building extension "%s" failed: %s)CCompilerErrorDistutilsErrorCompileErroroptionalrre)r:rerrrrszbuild_ext._filter_build_errorsc
CsL|j}|dust|ttfstd|jt|}||j}||j}|j	s6t
||ds6td|jdSt
d|j|||}|jpGg}|jdd}|jD]}||fqR|jj||j||j|j||jd}|dd|_|jr|||j|jpg}|jp|j|}	|jj|||||j|j ||!||j|j|	d
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)
output_dirrr-r extra_postargsdepends)r0r1rrexport_symbolsr r+Ztarget_lang)"r~rXrrrresortedrrr"rr
r infoswig_sourcesrrrr`r4compiler+r-Z_built_objectsrrcrlanguageZdetect_languageZlink_shared_object
get_librariesr1rget_export_symbols)
r:rr~ext_pathr
extra_argsrr/ZobjectsrrrrrsV





zbuild_ext.build_extensioncCs$g}g}i}|jrtd|jsd|jvsd|jvrd}nd}|D](}tj|\}}	|	dkrE||d||||d||<q"||q"|sO|S|jpU|	}
|
dg}|
|j|jrh|d|jsv|jD]}||qn|D]}||}
td	||
||d
|
|gqx|S)zWalk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i_wrapz-pythonzswigging %s to %sz-o)
r6r
rr7r[rasplitextr`r5	find_swigrcrspawn)r:r~	extensionZnew_sourcesrZswig_targetsZ
target_extsourcebaserr5Zswig_cmdotargetrrrr3s>




zbuild_ext.swig_sourcescCsZtjdkrdStjdkr&dD]}tjd|d}tj|r#|SqdStdtj)zReturn the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        posixr5r@)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s')r[rerarbisfileDistutilsPlatformError)r:versfnrrrris

zbuild_ext.find_swigcCs||}|d}||d}|js)tjj|dd|g}tj|j|Sd|dd}|d}tj	|
|}tj||S)zReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rIrNrbuild_py)get_ext_fullnamerZget_ext_filenamerr[rarbr)rxabspathZget_package_dir)r:rfullnamemodpathfilenamer,rpackage_dirrrrrs


zbuild_ext.get_ext_fullpathcCs|jdur|S|jd|S)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrI)r,)r:rrrrrs
zbuild_ext.get_ext_fullnamecCs.ddlm}|d}|d}tjj||S)zConvert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        rrkrI
EXT_SUFFIX)distutils.sysconfigrkrZr[rarb)r:rrkrZ
ext_suffixrrrrs
zbuild_ext.get_ext_filenamecCsz|jdd}z|dWnty&d|dddd}Ynwd|}d	|}||jvr:|j||jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        rIrasciiZU_punycode-__ZPyInit)rerZencodeUnicodeEncodeErrorreplacedecoderr`)r:rrerqZ
initfunc_namerrrrs 
zbuild_ext.get_export_symbolscCstjdkr/ddlm}t|j|s.d}|jr|d}|tjd?tjd?d@f}|j|gSn@dd	l	m
}d
}|drattdrCd
}ntjdkrKd
}ndtj
vra|ddkrYd
}n|ddkrad
}|ro|d}|jd|gS|jtS)zReturn the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        rBr)MSVCCompilerz
python%d%d_drFrJgetandroidapilevelTrE_PYTHON_HOST_PLATFORMANDROID_API_LEVELMACHDEP	LDVERSIONrG)r]riZdistutils._msvccompilerrrXr4r 
hexversionr0rrkhasattrr[environr	pythonlib)r:rrtemplaterrkZlink_libpython	ldversionrrrrs6




zbuild_ext.get_libraries) __name__
__module____qualname__descriptionr[r\Zsep_byr	user_optionsboolean_optionsrhelp_optionsr;rrr|rrrryrr
contextlibcontextmanagerrrrrrrrrrrrrrr"sp
+@N	
	L6	
r)__doc__rr[rer]distutils.corerdistutils.errorsrrrrdistutils.dep_utilrdistutils.extensionrdistutils.utilr	rRr
rsiter
rrrrrrrrs(PK!NU6U66_distutils/command/__pycache__/install.cpython-310.pycnu[o

Xaik
@s8dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZddddddZddddddddddddedddddddddddddZerdddd d!ded"<ddd#d$d!ded%<dZGd&d'd'eZdS)(zFdistutils.command.install

Implements the Distutils 'install' command.N)log)Command)DEBUG)get_config_vars)DistutilsPlatformError)
write_file)convert_path
subst_varschange_root)get_platform)DistutilsOptionError)	USER_BASE)	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)purelibplatlibheadersscriptsdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name)unix_prefix	unix_homentpypypypy_ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbasent_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin	unix_userc@seZdZdZgdZgdZeredddefedddiZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3efd4efd5efd6efd7d8d9fgZdS):installz'install everything from build directory))zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nzfinalize_optionss















	
zinstall.finalize_optionscCstsdSddlm}t|d|jD]9}|d}|ddkr&|dd}||jvr<|j|}||}t||}n
||}t||}td||qdS)zDumps the list of user options.Nr)
longopt_xlate:=z  %s: %s)	rdistutils.fancy_getoptrurdebuguser_optionsnegative_opt	translaterd)r<msgruoptopt_namevalr=r=r>rXs 





zinstall.dump_dirscCs$|jdus
|jdur.|jdur|jdur|jdus(|jdus(|jdus(|jdur,tddS|j	rH|j
dur:td|j
|_|_|ddS|j
dur[|j
|_|_|ddS|jdurz|jduritdtjtj|_tjtj|_n	|jdur|j|_|j|_|j|_|ddS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)r(r)r.r+r,r-r/r0rr#r1r
select_schemer'r%r&rUronormpathr[r;r=r=r>rYsB










zinstall.finalize_unixcCs|jr|jdurtd|j|_|_|tjddS|jdur0|j|_|_|ddS|j	dur=tj
tj	|_	|j	|_|_z	|tjWdSt
y[tdtjw)z)Finalizes options for non-posix platformsNr_userrz)I don't know how to install stuff on '%s')r#r1rr(r)rrUrVr'r%rorr[KeyErrorr;r=r=r>rZs(


zinstall.finalize_othercCsnttdrtjdkr|dstjdkrd}nd}t|}tD]}d|}t||dur4t	||||qdS)	z=Sets the install directories by applying the install schemes.pypy_version_info))r_homerrrinstall_N)
hasattrr[rcendswithrUrVINSTALL_SCHEMESSCHEME_KEYSrdsetattr)r<rVschemekeyattrnamer=r=r>rs


zinstall.select_schemecCsX|D]'}t||}|dur)tjdkstjdkrtj|}t||j}t|||qdS)Nr@r)rdrUrVro
expanduserr	rer)r<attrsattrrr=r=r>
_expand_attrss
zinstall._expand_attrscC|gddS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)r(r)r*Nrr;r=r=r>rgszinstall.expand_basedirscCr)z+Calls `os.path.expanduser` on install dirs.)r+r,r.r-r/r0Nrr;r=r=r>riszinstall.expand_dirscGs,|D]}d|}t||tt||qdS)z!Call `convert_path` over `names`.rN)rrrdr<namesrVrr=r=r>rlszinstall.convert_pathscCs|jdur
|jj|_|jdurFtdt|jtr!|jd|_t|jdkr0|jd}}nt|jdkr=|j\}}ntdt	|}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,r$rrBzY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrA)r4r_rrW
isinstancestrr]lenrr	path_filerq)r<rrqr=r=r>rms(




zinstall.handle_extra_pathc	Gs0|D]}d|}t||t|jt||qdS)z:Change the install directories pointed by name using root.rN)rr
r*rdrr=r=r>rr!szinstall.change_rootscCsb|jsdSttjd}|jD]\}}||r.tj|s.|	d|t
|dqdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)r#rrUrorreitems
startswithisdirdebug_printmakedirs)r<r'rVror=r=r>rj'szinstall.create_home_pathcCs&|js|d|jdj}|jr|tkrtd|D]}||q|j	r.|
|jr]|}|j
rPt|j
}tt|D]}|||d||<qC|t|j|fd|jttjjtj}ttjj|}tjtj|j}|jr|j	r|js||vrtd|jdSdSdSdS)zRuns the command.rTz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r6run_commandr_get_command_obj	plat_namer7rrget_sub_commandsrcreate_path_filer:get_outputsr*rrangeexecutermaprUrorr[normcaser.r5rrz)r<
build_platcmd_nameoutputsroot_lencountersys_pathr.r=r=r>run3sH

zinstall.runcCsLtj|j|jd}|jr|t||jgfd|dS|	d|dS)zCreates the .pth file.pthzcreating %szpath file '%s' not createdN)
rUrorprnrr5rrrqrW)r<filenamer=r=r>r_s

zinstall.create_path_filecCshg}|D]}||}|D]}||vr||qq|jr2|jr2|tj|j	|jd|S)z.Assembles the outputs of all the sub-commands.r)
rget_finalized_commandrappendrr5rUrorprn)r<rrcmdrr=r=r>rms

zinstall.get_outputscCs.g}|D]}||}||q|S)z*Returns the inputs of all the sub-commands)rrextend
get_inputs)r<inputsrrr=r=r>r~s

zinstall.get_inputscCs|jp	|jS)zSReturns true if the current distribution has any Python
        modules to install.)r_has_pure_modulesrkr;r=r=r>has_libs
zinstall.has_libcC
|jS)zLReturns true if the current distribution has any headers to
        install.)r_has_headersr;r=r=r>r
zinstall.has_headerscCr)zMReturns true if the current distribution has any scripts to.
        install.)r_has_scriptsr;r=r=r>rrzinstall.has_scriptscCr)zJReturns true if the current distribution has any data to.
        install.)r_has_data_filesr;r=r=r>has_datarzinstall.has_datar.r-r/r0install_egg_infocCsdS)NTr=r;r=r=r>szinstall.) __name__
__module____qualname__descriptionr{boolean_optionsrfrrr|r?rtrXrYrZrrrgrirlrmrrrjrrrrrrrrsub_commandsr=r=r=r>rWsL;
N(	",
r)__doc__r[rU	distutilsrdistutils.corerdistutils.debugrdistutils.sysconfigrdistutils.errorsrdistutils.file_utilrdistutils.utilrr	r
rrsiter
rrfZWINDOWS_SCHEMErrrr=r=r=r>s|
!
	
PK!p'4_distutils/command/__pycache__/clean.cpython-310.pycnu[o

Xai
@sDdZddlZddlmZddlmZddlmZGdddeZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.N)Command)remove_tree)logc@s6eZdZdZgdZdgZddZddZdd	Zd
S)cleanz-clean up temporary files from 'build' command))zbuild-base=bz2base build directory (default: 'build.build-base'))z
build-lib=NzsPK!ig_distutils/command/__pycache__/install_headers.cpython-310.pycnu[o

Xai@s$dZddlmZGdddeZdS)zdistutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.)Commandc@sFeZdZdZddgZdgZddZddZd	d
ZddZ	d
dZ
dS)install_headerszinstall C/C++ header files)zinstall-dir=dz$directory to install header files to)forcefz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)install_dirroutfilesselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/install_headers.pyinitialize_optionss
z"install_headers.initialize_optionscCs|ddddS)Ninstall)rr)rr)set_undefined_optionsr	rrrfinalize_optionssz install_headers.finalize_optionscCsH|jj}|sdS||j|D]}|||j\}}|j|qdSN)distributionheadersmkpathr	copy_filerappend)r
rheaderout_rrrrun!szinstall_headers.runcCs|jjpgSr)rrr	rrr
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrrget_outputs.szinstall_headers.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsr
rrrrrrrrr
s
rN)__doc__distutils.corerrrrrrsPK!ll4_distutils/command/__pycache__/build.cpython-310.pycnu[o

Xai@sTdZddlZddlZddlmZddlmZddlmZddZ	Gdd	d	eZ
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.N)Command)DistutilsOptionError)get_platformcCsddlm}|dS)Nrshow_compilers)Zdistutils.ccompilerrrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/build.pyrs
rc@seZdZdZdddddddd	d
efddd
ddgZddgZdddefgZddZ	ddZ
ddZddZddZ
dd Zd!d"Zd#efd$e
fd%efd&efgZdS)'buildz"build everything needed to install)zbuild-base=bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=tztemporary build directoryz
plat-name=pz6platform name to build for, if supported (default: %s))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)debuggz;compile extensions and libraries with debugging information)forcefz2forcibly build everything (ignore file timestamps))zexecutable=ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)
build_base
build_purelib
build_platlib	build_lib
build_temp
build_scriptscompiler	plat_namerr
executableparallelselfrrrinitialize_options8s
zbuild.initialize_optionscCsZ|jdur
t|_n	tjdkrtdd|jgtjddR}ttdr*|d7}|jdur8tj	
|jd|_|jdurHtj	
|jd||_|j
dur[|jrW|j|_
n|j|_
|jdurktj	
|jd||_|jdurtj	
|jd	tjdd|_|jdurtjrtj	tj|_t|jtrz	t|j|_WdStytd
wdS)NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%dgettotalrefcountz-pydebuglibtempz
scripts-%d.%dzparallel should be an integer)rrosnamersysversion_infohasattrrpathjoinrrrdistributionhas_ext_modulesrrrnormpath
isinstancerstrint
ValueError)rZplat_specifierrrrfinalize_optionsHsH













zbuild.finalize_optionscCs|D]}||qdSN)get_sub_commandsrun_command)rcmd_namerrrrunsz	build.runcC
|jSr5)r-has_pure_modulesrrrrr;
zbuild.has_pure_modulescCr:r5)r-has_c_librariesrrrrr=r<zbuild.has_c_librariescCr:r5)r-r.rrrrr.r<zbuild.has_ext_modulescCr:r5)r-has_scriptsrrrrr>r<zbuild.has_scriptsbuild_py
build_clib	build_extr)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsr r4r9r;r=r.r>sub_commandsrrrrr	sH8r	)__doc__r(r&distutils.corerdistutils.errorsrdistutils.utilrrr	rrrrsPK!hd>_distutils/command/__pycache__/install_scripts.cpython-310.pycnu[o

Xai@sDdZddlZddlmZddlmZddlmZGdddeZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.N)Command)log)ST_MODEc@sHeZdZdZgdZddgZddZddZd	d
ZddZ	d
dZ
dS)install_scriptsz%install scripts (Python or otherwise)))zinstall-dir=dzdirectory to install scripts to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)install_dirr	build_dir
skip_buildselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/install_scripts.pyinitialize_optionss
z"install_scripts.initialize_optionscCs |dd|dddddS)Nbuild)
build_scriptsrinstall)rr)rr)r
r
)set_undefined_optionsrrrrfinalize_options!sz install_scripts.finalize_optionscCs|js|d||j|j|_tjdkr?|D]&}|j	r&t
d|qt|t
dBd@}t
d||t||qdSdS)Nrposixzchanging mode of %simizchanging mode of %s to %o)r
run_command	copy_treerroutfilesosnameget_outputsdry_runrinfostatrchmod)rfilemoderrrrun)s

zinstall_scripts.runcCs|jjpgSN)distributionscriptsrrrr
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr&)rrrrrr;s
zinstall_scripts.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrr%r)rrrrrrsr)	__doc__rdistutils.corer	distutilsrr!rrrrrrsPK!Ç884_distutils/command/__pycache__/sdist.cpython-310.pycnu[o

Xai=J@sdZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZddZGdddeZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).N)glob)warn)Command)dir_util)	file_util)archive_util)TextFile)FileList)log)convert_path)DistutilsTemplateErrorDistutilsOptionErrorcCs`ddlm}ddlm}g}|D]}|d|d||dfq|||ddS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)FancyGetopt)ARCHIVE_FORMATSformats=Nz.List of available source distribution formats:)distutils.fancy_getoptrZdistutils.archive_utilrkeysappendsort
print_help)rrformatsformatr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.pyshow_formatss
rc@seZdZdZddZgdZgdZdddefgZd	d
dZ	defgZ
d
ZddZddZ
ddZddZddZddZeddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Z d6d7Z!d8d9Z"dS):sdistz6create a source distribution (tarball, zip file, etc.)cC|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)metadata_checkselfrrrchecking_metadata(zsdist.checking_metadata))z	template=tz5name of manifest template file [default: MANIFEST.in])z	manifest=mz)name of manifest file [default: MANIFEST])use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])no-defaultsNz"don't include the default file set)pruneNzspecifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])no-pruneNz$don't automatically exclude anything)
manifest-onlyozEjust regenerate the manifest and then stop (implies --force-manifest))force-manifestfzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r%r'r)r+r-r0zhelp-formatsNz#list available distribution formatsr%r')r&r(check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)Nrgztar)
templatemanifestuse_defaultsr'
manifest_onlyZforce_manifestr	keep_tempdist_dir
archive_filesrownergrouprrrrinitialize_optionses
zsdist.initialize_optionscCs^|jdurd|_|jdurd|_|dt|j}|r#td||jdur-d|_dSdS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'dist)r7r6ensure_string_listrcheck_archive_formatsrr
r;)r Z
bad_formatrrrfinalize_options|s




zsdist.finalize_optionscCs>t|_|D]}||q||jrdS|dSN)r	filelistget_sub_commandsrun_command
get_file_listr9make_distribution)r cmd_namerrrrunsz	sdist.runcCs*tdt|jd}||dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr3N)rPendingDeprecationWarningdistributionget_command_objensure_finalizedrK)r r3rrrcheck_metadataszsdist.check_metadatacCstj|j}|s|r||j|jdS|s'|	d|j|j
|jr3||r9|
|jr@||j|j|dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))ospathisfiler6_manifest_is_not_generated
read_manifestrErZremove_duplicatesrfindallr8add_defaults
read_templater'prune_file_listwrite_manifest)r Ztemplate_existsrrrrHs(




zsdist.get_file_listcCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scriptsrrrrrWszsdist.add_defaultscCs:tj|sdStj|}tj|\}}|t|vS)z
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rQrRexistsabspathsplitlistdir)fspathrc	directoryfilenamerrr_cs_path_existss

zsdist._cs_path_existscCs|j|jjg}|D]?}t|tr5|}d}|D]}||r'd}|j|nq|s4|dd	|q	||rA|j|q	|d|q	dS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
READMESrMscript_name
isinstancetuplerirErrjoin)r Z	standardsfnZaltsZgot_itrrrr[s(


zsdist._add_defaults_standardscCs4ddg}|D]}ttjjt|}|j|qdS)Nz
test/test*.pyz	setup.cfg)filterrQrRrSrrEextend)r optionalpatternfilesrrrr\s
zsdist._add_defaults_optionalcCs\|d}|jr|j||jD]\}}}}|D]
}|jtj	
||qqdS)Nbuild_py)get_finalized_commandrMhas_pure_modulesrErqget_source_files
data_filesrrQrRrn)r rupkgsrc_dir	build_dir	filenamesrhrrrr]s

zsdist._add_defaults_pythoncCs~|jr;|jjD]3}t|tr!t|}tj|r |j	
|q	|\}}|D]}t|}tj|r9|j	
|q'q	dSdSrD)rMhas_data_filesryrlstrrrQrRrSrEr)r itemdirnamer}r,rrrr^$s 

zsdist._add_defaults_data_filescC,|jr|d}|j|dSdS)N	build_ext)rMhas_ext_modulesrvrErqrx)r rrrrr_5

zsdist._add_defaults_extcCr)N
build_clib)rMhas_c_librariesrvrErqrx)r rrrrr`:rzsdist._add_defaults_c_libscCr)N
build_scripts)rMhas_scriptsrvrErqrx)r rrrrra?rzsdist._add_defaults_scriptsc
Cstd|jt|jddddddd}z;	|}|durn*z|j|Wn ttfyF}z|	d|j
|j|fWYd}~nd}~wwqW|dS|w)zRead and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r4)strip_commentsskip_blanks
join_lines	lstrip_ws	rstrip_wsZ
collapse_joinTNz%s, line %d: %s)
r
infor6rreadlinerEprocess_template_liner
ValueErrorrrhcurrent_lineclose)r r6linemsgrrrrXDs,

zsdist.read_templatecCsz|d}|j}|jjd|jd|jjd|dtjdkr#d}nd}gd}d|d	||f}|jj|d
ddS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        buildN)prefixwin32z/|\\/)RCSCVSz\.svnz\.hgz\.gitz\.bzr_darcsz(^|%s)(%s)(%s).*|r4)Zis_regex)	rvrMget_fullnamerEZexclude_pattern
build_basesysplatformrn)r rbase_dirsepsZvcs_dirsZvcs_ptrnrrrrYas


zsdist.prune_file_listcCsX|rtd|jdS|jjdd}|dd|tj	|j|fd|jdS)zWrite the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rTr
rr7rErtinsertexecuter
write_file)r contentrrrrZyszsdist.write_manifestcCsBtj|js	dSt|j}z
|}W||dkS|w)NFz+# file GENERATED by distutils, do NOT edit
)rQrRrSr7openrr)r fp
first_linerrrrTs


z sdist._manifest_is_not_generatedcCsltd|jt|j }|D]}|}|ds|sq|j|qWddS1s/wYdS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'#N)r
rr7rstrip
startswithrEr)r r7rrrrrUs"zsdist.read_manifestcCs||tj|||jdttdrd}d|}nd}d|}|s(tdnt||D]}tj	
|s>td|q/tj	||}|j|||d	q/|j
j|dS)
aCreate the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        dry_runlinkhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r)mkpathrcreate_treerhasattrrQr
rrrRrSrn	copy_filerMmetadatawrite_pkg_info)r rrtrrfiledestrrrmake_release_trees 

	

zsdist.make_release_treecCs|j}tj|j|}|||jjg}d|j	vr*|j	
|j	|j	d|j	D]}|j
||||j|jd}|
||jj
dd|fq-||_|js[tj||jddSdS)aCreate the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        tar)rr=r>rrN)rMrrQrRrnr;rrErtrrpopindexmake_archiver=r>
dist_filesr<r:rremove_treer)r r	base_namer<fmtrrrrrIs 





zsdist.make_distributioncCr)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r<rrrrget_archive_filesr"zsdist.get_archive_files)#__name__
__module____qualname__descriptionr!user_optionsboolean_optionsrhelp_optionsnegative_optsub_commandsrjr?rCrKrPrHrWstaticmethodrir[r\r]r^r_r`rarXrYrZrTrUrrIrrrrrr$sJ'
(
*r)__doc__rQrrwarningsrdistutils.corer	distutilsrrrdistutils.text_filerdistutils.filelistr	r
distutils.utilrdistutils.errorsrr
rrrrrrs PK!mJJ7_distutils/command/__pycache__/__init__.cpython-310.pycnu[o

Xai@sdZgdZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.)buildbuild_py	build_ext
build_clib
build_scriptscleaninstallinstall_libinstall_headersinstall_scriptsinstall_datasdistregisterbdist
bdist_dumb	bdist_rpmZ
bdist_wininstcheckuploadN)__doc____all__rr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/__init__.pysPK!(9k;ss9_distutils/command/__pycache__/bdist_dumb.cpython-310.pycnu[o

Xai1@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
d
eZdS)zdistutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).N)Command)get_platform)remove_treeensure_relative)*)get_python_version)logc	@s\eZdZdZddddefdddd	d
ddg	Zgd
ZdddZddZddZ	ddZ
dS)
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=dz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))zformat=fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)
skip-buildNz2skip rebuilding everything (for testing/debugging))relativeNz7build the archive using relative paths (default: false))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group])r
rrgztarzip)posixntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)		bdist_dir	plat_nameformat	keep_tempdist_dir
skip_buildrownergroup)selfr /builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_dumb.pyinitialize_options2s
zbdist_dumb.initialize_optionscCst|jdur|dj}tj|d|_|jdur0z	|jtj|_Wnt	y/t
dtjw|dddddS)NbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rget_finalized_command
bdist_baseospathjoinrdefault_formatnameKeyErrorDistutilsPlatformErrorset_undefined_options)rr%r r r!finalize_options=s$

zbdist_dumb.finalize_optionscCs(|js|d|jddd}|j|_|j|_d|_td|j|dd|j	|j
f}tj
|j|}|js?|j}n$|jrX|j|jkrXtdt|jt|jftj
|jt|j}|j||j||j|jd	}|jryt}nd
}|jjd||f|jst|j|jddSdS)
Nbuildinstall)reinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))root_dirrranyr	)dry_run) rrun_commandreinitialize_commandrrootwarn_dirrinfodistributionget_fullnamerr&r'r(rrhas_ext_modulesinstall_baseinstall_platbaser,reprrmake_archiverrrr
dist_filesappendrrr5)rr0Zarchive_basenameZpseudoinstall_rootZarchive_rootfilenameZ	pyversionr r r!runOsN





zbdist_dumb.runN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsr)r"r.rEr r r r!r	s.r	)__doc__r&distutils.corerdistutils.utilrdistutils.dir_utilrrdistutils.errorsdistutils.sysconfigr	distutilsrr	r r r r!sPK!""""7_distutils/command/__pycache__/register.cpython-310.pycnu[o

Xai-@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGddde	Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
N)warn)
PyPIRCCommand)*)logc@seZdZdZejddgZejgdZdddfgZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZdddZdS)registerz7register the distribution with the Python package index)list-classifiersNz list the valid Trove classifiers)strictNzBWill stop the registering if the meta-data are not fully compliant)verifyrrcheckcCsdS)NTselfrr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/register.pyszregister.cCst|d|_d|_dS)Nr)rinitialize_optionslist_classifiersrrrrrrs

zregister.initialize_optionscCs*t|d|jfdd}||jjd<dS)Nr)r)rrestructuredtextr
)rfinalize_optionsrdistributioncommand_options)r

check_optionsrrrr$s

zregister.finalize_optionscCsX|||D]}||q|jr|dS|jr&|dS|dSN)	r_set_configget_sub_commandsrun_commanddry_runverify_metadatarclassifiers
send_metadata)r
cmd_namerrrrun+szregister.runcCs8tdt|jd}||j|_d|_|dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)rPendingDeprecationWarningrget_command_objensure_finalizedrrr!)r
r
rrrcheck_metadata:szregister.check_metadatacCs||}|ikr!|d|_|d|_|d|_|d|_d|_d	S|jd|jfvr0td|j|jdkr9|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        usernamepassword
repositoryrealmTpypiz%s not found in .pypircFN)_read_pypircr&r'r(r)
has_configDEFAULT_REPOSITORY
ValueError)r
configrrrrDs






zregister._set_configcCs*|jd}tj|}t||dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r(urllibrequesturlopenrinfo_read_pypi_response)r
urlresponserrrrUs
zregister.classifierscCs&||d\}}td||dS)zF Send the metadata to the package index server to be checked.
        r	Server response (%s): %sN)post_to_serverbuild_post_datarr3)r
coderesultrrrr\szregister.verify_metadatac
Cs|jrd}|j}|j}nd}d}}d}||vr5|dtjt}|s)d}n||vr1td||vs|dkr|sAtd}|r;|sJt		d}|rCt
j}t
j
|jd	}||j|||||d
|\}}|d||ftj|dkr|jr||j_dS|d
tj|d|tjd}|dvrtd}|sd}|dvs|dkr|||dSdSdS|dkr\ddi}	d|	d<|	d<|	d<d|	d<|	dstd|	d<|	dr|	d|	dkr+|	dst		d|	d<|	dr|	dst		d|	d<|	dr|	d|	dkr#d|	d<d|	d<td|	d|	dks|	ds;td|	d<|	dr0||	\}}|dkrPtd||dStdtd dS|d!krdd"i}	d|	d<|	dsytd#|	d<|	drn||	\}}td||dSdS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        1xz1 2 3 4zWe need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rsubmitr7zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)XZynzSave your login (y/N)?ny2:actionusernamer'emailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.3Zpassword_resetzYour email address: )r,r&r'splitannouncerINFOinputprintgetpassr0r1HTTPPasswordMgrparseurlparser(add_passwordr)r8r9r_get_rc_filelower
_store_pypircr3)
r
choicer&r'choicesauthhostr:r;datarrrrcs





	





zregister.send_metadatacCs|jj}id|ddd|d|d|d|d|d	|d
|d|	d|
d
|d|d|
d|d|d|}|dsc|dsc|drgd|d<|S)NrEmetadata_versionz1.0rGversionsummaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformrdownload_urlprovidesrequires	obsoletesz1.1)rmetadataget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes)r
actionmetar[rrrr9sN	

zregister.build_post_dataNc
Csd|vr|d|d|jftjd}d|}|d}t}|D]?\}}t|tgtdfvr7|g}|D])}t|}|	||	d||	d|	||rb|d	d
krb|	dq9q$|	||	d|
d}d
|tt|d}	t
j|j||	}
t
jt
jj|d}d}z||
}Wn;t
jjy}
z|jr|
j}|
j|
jf}WYd}
~
n(d}
~
wt
jjy}
zdt|
f}WYd}
~
nd}
~
ww|jr||}d}|jrdd|df}||tj|S)zC Post a query to the server, and return a string response.
        rGzRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z



zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)password_mgrr>Ni)r@OKzK---------------------------------------------------------------------------)rKr(rrLioStringIOitemstypestrwritegetvalueencodelenr0r1Requestbuild_openerHTTPBasicAuthHandleropenerror	HTTPError
show_responsefpreadr:msgURLErrorr4join)r
r[rYboundaryZsep_boundaryZend_boundarybodykeyvalueheadersreqopenerr;errrrr8sh








zregister.post_to_serverr)__name__
__module____qualname__rbruser_optionsboolean_optionssub_commandsrrr!r%rrrrr9r8rrrrrs$
zr)__doc__rOrurllib.parser0urllib.requestwarningsrdistutils.corerdistutils.errors	distutilsrrrrrrsPK!JPPH((5_distutils/command/__pycache__/config.cpython-310.pycnu[o

Xai=3@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	ZGd
ddeZddd
Z
dS)adistutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c@seZdZdZgdZddZddZddZd	d
ZddZ	d
dZ
ddZddZddZ
d(ddZ		d(ddZd)ddZ		d*ddZ		d*dd Z		!d+d"d#Zdddgfd$d%Z		d)d&d'ZdS),configzprepare to build)	)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link with)z
library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N)compilerccinclude_dirs	librarieslibrary_dirsr
dump_source
temp_filesselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/config.pyinitialize_options3s
zconfig.initialize_optionscCs|jdur
|jjp
g|_nt|jtr|jtj|_|jdur$g|_nt|jtr/|jg|_|jdur9g|_dSt|jtrI|jtj|_dSdSN)	rdistribution
isinstancestrsplitospathseprrrrrrfinalize_optionsBs




zconfig.finalize_optionscCsdSrrrrrrrunRsz
config.runcCsddlm}m}t|j|s=||j|jdd|_t|j|jr'|j|j|j	r1|j
|j	|jr?|j|jdSdSdS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)	CCompilernew_compilerr)rdry_runforceN)
distutils.ccompilerr$r%rrr&rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr$r%rrr_check_compilerYs
zconfig._check_compilercCsdt|}t|d4}|r|D]	}|d|q|d|||ddkr7|dWd|SWd|S1sBwY|S)NZ_configtestwz#include <%s>

)LANG_EXTopenwrite)rbodyheaderslangfilenamefileheaderrrr_gen_temp_sourcefileks 



zconfig._gen_temp_sourcefilecCs<||||}d}|j||g|jj|||d||fS)Nz
_configtest.ir)r6rextendr
preprocess)rr0r1rr2srcoutrrr_preprocessws
zconfig._preprocesscCs\||||}|jrt|d||j|g\}|j||g|jj|g|d||fS)Nzcompiling '%s':r7)r6r	dump_filerZobject_filenamesrr8compile)rr0r1rr2r:objrrr_compile~szconfig._compilec
Csr|||||\}}tjtj|d}	|jj|g|	|||d|jjdur.|	|jj}	|j	|	|||	fS)Nr)rrZtarget_lang)
r@r pathsplitextbasenamerZlink_executableZ
exe_extensionrappend)
rr0r1rrrr2r:r?progrrr_links
zconfig._linkc	GsP|s|j}g|_tdd||D]}zt|Wqty%YqwdS)Nzremoving: %s )rrinfojoinr removeOSError)r	filenamesr3rrr_cleansz
config._cleanNrcCsPddlm}|d}z
|||||Wn|y!d}Ynw||S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        rCompileErrorTF)r(rOr)r<rMrr0r1rr2rOokrrrtry_cppszconfig.try_cppcCs||||||\}}t|trt|}t|}d}		|}
|
dkr)n	||
r1d}	nq Wdn1sr.readlinesearchrM)rpatternr0r1rr2r:r;r4matchlinerrr
search_cpps$	




zconfig.search_cppcCsbddlm}|z|||||d}Wn|y!d}Ynwt|r(dp)d||S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrNTFsuccess!failure.)r(rOr)r@rrHrMrPrrrtry_compileszconfig.try_compilec
	Csnddlm}m}|z|||||||d}	Wn
||fy'd}	Ynwt|	r.dp/d||	S)zTry to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        rrO	LinkErrorTFr[r\)r(rOr_r)rFrrHrM)
rr0r1rrrr2rOr_rQrrrtry_links
zconfig.try_linkc

Csddlm}m}|z|||||||\}	}
}||gd}Wn||tfy1d}Ynwt|r8dp9d|	|S)zTry to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rr^TFr[r\)
r(rOr_r)rFspawnrrrHrM)
rr0r1rrrr2rOr_r:r?ZexerQrrrtry_runs

zconfig.try_runrc	Cst|g}|r|d||d|r|d|n|d||dd|d}||||||S)aDetermine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;}r+)r)rDrIr`)	rfuncr1rrrdeclcallr0rrr
check_funcs


zconfig.check_funccCs ||d|||g||S)aDetermine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r)r`)rlibraryrr1rZother_librariesrrr	check_lib4s


zconfig.check_libcCs|jd|g|dS)zDetermine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r0r1r)rR)rr5rrr2rrrcheck_headerBs
zconfig.check_header)NNNr)NNr)NNNNr)NNNNrr)__name__
__module____qualname__descriptionuser_optionsrr"r#r)r6r<r@rFrMrRrZr]r`rbrgrirjrrrrrs@	






rcCsP|durtd|nt|t|}zt|W|dS|w)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrHr.readclose)r3headr4rrrr=Ks
r=r)__doc__r rTdistutils.corerdistutils.errorsrdistutils.sysconfigr	distutilsrr-rr=rrrrs
8PK!Z~<_distutils/command/__pycache__/build_scripts.cpython-310.pycnu[o

XaiK@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddlm
Z
ddlZed	ZGd
ddeZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.N)ST_MODE)	sysconfig)Command)newer)convert_path)logs^#!.*python[0-9.]*([ 	].*)?$c@sFeZdZdZgdZdgZddZddZdd	Zd
dZ	dd
Z
dS)
build_scriptsz("build" scripts (copy and fixup #! line)))z
build-dir=dzdirectory to "build" (copy) to)forcefz1forcibly build everything (ignore file timestamps)zexecutable=ez*specify final destination interpreter pathr
cCs"d|_d|_d|_d|_d|_dSN)	build_dirscriptsr

executableoutfilesselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/build_scripts.pyinitialize_optionss

z build_scripts.initialize_optionscCs|dddd|jj|_dS)Nbuild)rr)r
r
)rr)set_undefined_optionsdistributionrrrrrfinalize_options%szbuild_scripts.finalize_optionscCs|jSr
)rrrrrget_source_files,szbuild_scripts.get_source_filescCs|jsdS|dSr
)rcopy_scriptsrrrrrun/szbuild_scripts.runc	Cs||jg}g}|jD]}d}t|}tj|jtj|}|||j	s6t
||s6td|q
zt
|d}WntyL|jsHd}Yn,wt|j\}}|d|}	|	sh|d|q
t|	}
|
rxd}|
dpwd	}|r
td
||j|||jstjs|j}ntjtddtd
tdf}t|}d||d}
z|
dWntyt d!|
wz|
|Wntyt d!|
|wt
|d}|"|
|#|$Wdn1swY|r	|%q
|r|%|||&||q
tj'dkrW|D]1}|jr3td|q%t(|t)d@}|dBd@}||krUtd|||t*||q%||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)rbNrz%s is an empty file (skipping)Tzcopying and adjusting %s -> %sBINDIRz
python%s%sVERSIONEXEs#!
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})wbposixzchanging mode of %siimz!changing mode of %s from %o to %o)+mkpathrrrospathjoinbasenameappendr
rrdebugopenOSErrordry_runtokenizedetect_encodingreadlineseekwarn
first_line_rematchgroupinforpython_buildrget_config_varfsencodedecodeUnicodeDecodeError
ValueErrorformatwrite
writelines	readlinesclose	copy_filenamestatrchmod)rrZ
updated_filesscriptadjustoutfilerencodinglines
first_liner7post_interprshebangoutffileZoldmodeZnewmoderrrr5s








zbuild_scripts.copy_scriptsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrrrrrrrrrsr)__doc__r(rerGr	distutilsrdistutils.corerdistutils.dep_utilrdistutils.utilrrr1compiler6rrrrrs
PK!}GG?_distutils/command/__pycache__/install_egg_info.cpython-310.pycnu[o

Xai+
@sddZddlmZddlmZmZddlZddlZddlZGdddeZ	ddZ
d	d
ZddZdS)
zdistutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.)Command)logdir_utilNc@s:eZdZdZdZdgZddZddZdd	Zd
dZ	dS)
install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=dzdirectory to install tocCs
d|_dSN)install_dirselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/install_egg_info.pyinitialize_optionss
z#install_egg_info.initialize_optionscCsd|dddtt|jtt|jgtjddR}t	j
|j||_
|j
g|_dS)Ninstall_lib)rrz%s-%s-py%d.%d.egg-info)set_undefined_optionsto_filename	safe_namedistributionget_namesafe_versionget_versionsysversion_infoospathjoinrtargetoutputs)r
basenamerrrfinalize_optionssz!install_egg_info.finalize_optionscCs|j}tj|rtj|stj||jdn'tj|r+|	tj
|jfd|ntj|js?|	tj|jfd|jt
d||jsit|ddd}|jj|WddS1sbwYdSdS)N)dry_runz	Removing z	Creating z
Writing %swzUTF-8)encoding)rrrisdirislinkrremove_treer existsexecuteunlinkrmakedirsrinfoopenrmetadatawrite_pkg_file)r
rfrrrrun s"zinstall_egg_info.runcCs|jSr)rr	rrrget_outputs.szinstall_egg_info.get_outputsN)
__name__
__module____qualname____doc__descriptionuser_optionsr
rr/r0rrrrrs
rcCstdd|S)zConvert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    [^A-Za-z0-9.]+-)resubnamerrrr6srcCs|dd}tdd|S)zConvert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
     .r7r8)replacer9r:)versionrrrr>srcCs|ddS)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r8_)r?r;rrrrHsr)
r4
distutils.cmdr	distutilsrrrrr9rrrrrrrrs+
PK!94_distutils/command/__pycache__/check.cpython-310.pycnu[o

Xai@sdZddlmZddlmZz$ddlmZddlmZddl	m
Z
ddl	mZGdd	d	eZd
Z
Wney=dZ
YnwGdd
d
eZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
)Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc@s"eZdZ		d	ddZddZdS)
SilentReporterNrasciireplacec
Cs"g|_t||||||||dSN)messagesr__init__)selfsourcereport_level
halt_levelstreamdebugencoding
error_handlerr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/check.pyr
szSilentReporter.__init__cOs8|j||||ftj|g|R||j|d|S)N)leveltype)rappendrsystem_messageZlevels)rrmessagechildrenkwargsrrrrszSilentReporter.system_message)Nrr	r
)__name__
__module____qualname__r
rrrrrrs

rTFc@s\eZdZdZdZgdZgdZddZddZd	d
Z	ddZ
d
dZddZddZ
dS)checkz6This command checks the meta-data of the package.
    z"perform some checks on the package))metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check fails)r#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.rN)r%r#r'	_warningsrrrrinitialize_options0s
zcheck.initialize_optionscCsdSrrr+rrrfinalize_options7szcheck.finalize_optionscCs|jd7_t||S)z*Counts the number of warnings that occurs.r))r*rwarn)rmsgrrrr.:sz
check.warncCsP|jr||jrtr|n|jrtd|jr$|jdkr&tddSdS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#check_metadatar%HAS_DOCUTILScheck_restructuredtextr'rr*r+rrrrun?s
z	check.runcCs|jj}g}dD]}t||rt||s||q|r&|dd||jr5|js3|ddSdS|j	rD|j
sB|ddSdS|ddS)aEnsures that all required elements of meta-data are supplied.

        Required fields:
            name, version, URL

        Recommended fields:
            (author and author_email) or (maintainer and maintainer_email))

        Warns if any are missing.
        )nameversionurlzmissing required meta-data: %sz, zNmissing meta-data: if 'author' supplied, 'author_email' should be supplied toozVmissing meta-data: if 'maintainer' supplied, 'maintainer_email' should be supplied toozkmissing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be suppliedN)distributionr#hasattrgetattrrr.joinauthorauthor_email
maintainermaintainer_email)rr#missingattrrrrr0Os"
zcheck.check_metadatacCsX|j}||D]}|dd}|dur|d}nd|d|f}||q
dS)z4Checks if the long string fields are reST-compliant.lineNr)z%s (line %s))r7get_long_description_check_rst_datagetr.)rdatawarningrBrrrr2ps

zcheck.check_restructuredtextc
Cs|jjpd}t}tjtfd}d|_d|_d|_t	||j
|j|j|j
|j|jd}tj|||d}||dz
|||W|jStyd}z|jdd|d	ifWYd}~|jSd}~ww)
z8Returns warnings when the provided data doesn't compile.zsetup.py)
componentsN)rrrr)rrAz!Could not finish the parsing: %s.)r7script_namerrOptionParserget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZnote_sourceparseAttributeErrorrr)rrFsource_pathparsersettingsreporterrNerrrrD{s4zcheck._check_rst_dataN)rr r!__doc__descriptionuser_optionsboolean_optionsr,r-r.r3r0r2rDrrrrr"#s!r"N)rVdistutils.corerdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr1	Exceptionr"rrrrsPK!4_distutils/command/__pycache__/bdist.cpython-310.pycnu[o

Xai@sHdZddlZddlmZddlTddlmZddZGdd	d	eZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).N)Command)*)get_platformcCsPddlm}g}tjD]}|d|dtj|dfq||}|ddS)zFPrint list of available formats (arguments to "--format" option).
    r)FancyGetoptformats=Nz'List of available distribution formats:)distutils.fancy_getoptrbdistformat_commandsappendformat_command
print_help)rformatsformatZpretty_printerr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/bdist.pyshow_formatss
rc
@seZdZdZddddefdddd	d
gZdgZdd
defgZdZ	dddZ
gdZdddddddddd	ZddZ
dd Zd!d"Zd
S)#r	z$create a built (binary) distribution)zbdist-base=bz4temporary directory for creating built distributionsz
plat-name=pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=dz=directory to put final built distributions in [default: dist])
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)	bdist_rpmgztarzip)posixnt)	ZrpmrbztarxztarztartarZwininstrZmsi)rzRPM distribution)
bdist_dumbzgzip'ed tar file)r"zbzip2'ed tar file)r"zxz'ed tar file)r"zcompressed tar file)r"ztar file)Z
bdist_wininstzWindows executable installer)r"zZIP file)Z	bdist_msizMicrosoft InstallercCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)
bdist_base	plat_namerdist_dir
skip_buildgroupowner)selfrrrinitialize_optionsQs
zbdist.initialize_optionscCs|jdur|jr
t|_n|dj|_|jdur*|dj}tj|d|j|_|	d|j
durMz
|jtjg|_
Wnt
yLtdtjw|jdurWd|_dSdS)Nbuildzbdist.rz;don't know how to create built distributions on platform %sdist)r$r&rget_finalized_commandr#
build_baseospathjoinensure_string_listrdefault_formatnameKeyErrorDistutilsPlatformErrorr%)r)r.rrrfinalize_optionsZs.






zbdist.finalize_optionsc	Csg}|jD]}z||j|dWqty td|wtt|jD]4}||}||}||jvr>|j||_	|dkrJ|j
|_
|j|_|||ddvrWd|_|
|q(dS)Nrzinvalid format '%s'r"r)rrrr5DistutilsOptionErrorrangelenreinitialize_commandno_format_optionrr(r'Z	keep_temprun_command)r)commandsricmd_nameZsub_cmdrrrrunvs&


z	bdist.run)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsr<r3r
rr*r7rArrrrr	sJ
	r	)	__doc__r/distutils.corerdistutils.errorsdistutils.utilrrr	rrrrsPK!(2kk:_distutils/command/__pycache__/install_lib.cpython-310.pycnu[o

Xai @sLdZddlZddlZddlZddlmZddlmZdZ	GdddeZ
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).N)Command)DistutilsOptionErrorz.pyc@sxeZdZdZgdZgdZddiZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZddZddZdS)install_libz7install all Python modules (extensions and pure Python)))zinstall-dir=dzdirectory to install to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default])
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])
skip-buildNzskip the build steps)rr	r
rr	cCs(d|_d|_d|_d|_d|_d|_dS)Nr)install_dir	build_dirrr	optimize
skip_buildselfr/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-4.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_options3s
zinstall_lib.initialize_optionsc	Cs|ddddddd|jdurd|_|jdurd	|_t|jts?zt|j|_|jd
vr/tWdSttfy>tdwdS)Ninstall)	build_libr)rr)rr)r	r	)rr)rrTF)rzoptimize must be 0, 1, or 2)set_undefined_optionsr	r
isinstanceintAssertionError
ValueErrorrrrrrfinalize_options<s,
	

zinstall_lib.finalize_optionscCs8||}|dur|jr||dSdSdSN)buildrdistributionhas_pure_modulesbyte_compilerZoutfilesrrrrunVs
zinstall_lib.runcCs:|js|jr
|d|jr|ddSdSdS)Nbuild_py	build_ext)rr#r$run_commandhas_ext_modulesrrrrr"fs


zinstall_lib.buildcCs6tj|jr||j|j}|S|d|jdS)Nz3'%s' does not exist -- no Python modules to install)ospathisdirr	copy_treerwarnr&rrrrmszinstall_lib.installcCsvtjr
|ddSddlm}|dj}|jr$||d|j||j	d|j
dkr9|||j
|j||j|j	ddSdS)Nz%byte-compiling is disabled, skipping.r)r%r)rrprefixdry_run)rrr1verboser2)sysdont_write_bytecoder0distutils.utilr%get_finalized_commandrootr	rr2rr3)rfilesr%Zinstall_rootrrrr%vs 


zinstall_lib.byte_compilec
	Csd|sgS||}|}t||}t|ttj}g}|D]}	|tj||	|dq|Sr!)	r7get_outputsgetattrlenr,sepappendr-join)
rZhas_anyZ	build_cmdZ
cmd_option
output_dirZbuild_filesr
prefix_lenoutputsfilerrr_mutate_outputss

zinstall_lib._mutate_outputscCsrg}|D]2}tjtj|d}|tkrq|jr%|tjj	|dd|j
dkr6|tjj	||j
dq|S)Nr)optimizationr)r,r-splitextnormcasePYTHON_SOURCE_EXTENSIONr	r>	importlibutilcache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileextrrr_bytecode_filenamess


zinstall_lib._bytecode_filenamescCsR||jdd|j}|jr||}ng}||jdd|j}|||S)zReturn the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r(rr))rDr#r$rr	rNr+)rZpure_outputsZbytecode_outputsZext_outputsrrrr:szinstall_lib.get_outputscCsLg}|jr|d}|||jr$|d}|||S)zGet the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r(r))r#r$r7extendr:r+)rinputsr(r)rrr
get_inputss



zinstall_lib.get_inputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr r'r"rr%rDrNr:rQrrrrrs		r)__doc__r,importlib.utilrJr4distutils.corerdistutils.errorsrrIrrrrrsPK!Iqq
py26compat.pynu["""
Compatibility Support for Python 2.6 and earlier
"""

import sys

try:
    from urllib.parse import splittag
except ImportError:
    from urllib import splittag


def strip_fragment(url):
    """
    In `Python 8280 `_, Python 2.7 and
    later was patched to disregard the fragment when making URL requests.
    Do the same for Python 2.6 and earlier.
    """
    url, fragment = splittag(url)
    return url


if sys.version_info >= (2, 7):
    strip_fragment = lambda x: x

try:
    from importlib import import_module
except ImportError:

    def import_module(module_name):
        return __import__(module_name, fromlist=['__name__'])
PK!\jfBfB"__pycache__/sandbox.cpython-35.pycnu[

Re8@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlZejjdrddljjjjZnejejZy
eZWnek
rdZYnXeZddlm Z ddlm!Z!ddd	d
gZ"dddZ#ej$dd
dZ%ej$ddZ&ej$ddZ'ej$ddZ(Gddde)Z*GdddZ+ej$ddZ,ddZ-ej$ddZ.ej$dd Z/d!d"Z0d#d$Z1d%d
Z2Gd&ddZ3e4ed'rsej5gZ6ngZ6Gd(dde3Z7ej8ej9d)d*d+j:DZ;Gd,d	d	e Z<dS)-N)six)builtinsmapjava)DistutilsError)working_setAbstractSandboxDirectorySandboxSandboxViolation	run_setupcCsd}t||}|j}WdQRXtjdddksvtjdddkrtjddd
kr|jdd}|jd	d}|dkr|}t||d
}t|||dS)z.
    Python 3 implementation of execfile.
    rbNrs
s
s
exec)r
r)rr)rr
)openreadsysversion_inforeplacecompiler)filenameglobalslocalsmodestreamscriptcoder/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/sandbox.py	_execfile#sKr c
csVtjdd}|dk	r2|tjddtk
r`ddlm}|j||t|SYnXdS)z
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r4N)pickledumps	Exceptionsetuptools.sandboxr4dumprepr)typeexcclsrrrr9hs
 
zUnpickleableException.dumpN)__name__
__module____qualname____doc__staticmethodr9rrrrr4csr4c@s:eZdZdZddZddZddZdS)	ExceptionSaverz^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|S)Nr)selfrrr	__enter__|szExceptionSaver.__enter__cCs,|s
dStj|||_||_dS)NT)r4r9_saved_tb)rDr;r<tbrrr__exit__s
	zExceptionSaver.__exit__cCsKdt|krdSttj|j\}}tj|||jdS)z"restore and re-raise any exceptionrFN)varsrr5loadsrFrreraiserG)rDr;r<rrrresumeszExceptionSaver.resumeN)r>r?r@rArErIrMrrrrrCvsrCc
#sktjjt}VWdQRXtjjfddtjD}t||jdS)z
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s1|]'}|kr|jdr|VqdS)z
encodings.N)
startswith).0mod_name)r#rr	szsave_modules..)rmodulescopyrCupdate_clear_modulesrM)	saved_excZdel_modulesr)r#rsave_moduless
rWcCs%xt|D]}tj|=q
WdS)N)listrrR)module_namesrPrrrrUsrUccs*tj}z	|VWdtj|XdS)N)r(__getstate____setstate__)r#rrrsave_pkg_resources_states	r\c,cstjj|d}tvtettMt<t|(t	|t
ddVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)Ntemp
setuptools)r/r%joinr\rWhide_setuptoolsr&r$r.r3
__import__)	setup_dirtemp_dirrrr
setup_contexts






rdcCs"tjd}t|j|S)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    z1(setuptools|pkg_resources|distutils|Cython)(\.|$))rerboolmatch)rPpatternrrr
_needs_hidingsricCs tttj}t|dS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    N)filterrirrRrU)rRrrrr`sr`cCs.tjjtjj|}t|y|gt|tjddtk
r"}z|jr|jdrWYdd}~XnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs
|jS)N)activate)distrrrszrun_setup..__file__r>__main__)r/r%abspathdirnamerdrXrr!insertr__init__	callbacksappend
isinstancestrencodegetfilesystemencodingr	dictr 
SystemExitargs)Zsetup_scriptr|rbZdunder_filensvrrrrs
 

c@seZdZdZdZddZddZddZd	d
ZddZ	d
dZ
x9dddgD](Zee
erpe
eees	z,AbstractSandbox.__init__..)dir_os_attrs)rDr)rDrrs
szAbstractSandbox.__init__cCs1x*|jD]}tt|t||q
WdS)N)rsetattrr/getattr)rDsourcerrrr_copyszAbstractSandbox._copycCs8|j|tr|jt_|jt_d|_dS)NT)r_filerfile_openr_active)rDrrrrEs

zAbstractSandbox.__enter__cCs2d|_trtt_tt_|jtdS)NF)rrrrrrrr)rDexc_type	exc_value	tracebackrrrrIs
			zAbstractSandbox.__exit__c	Cs||SWdQRXdS)zRun 'func' under os sandboxingNr)rDfuncrrrrun"szAbstractSandbox.runcs(ttfdd}|S)Ncs=|jr*|j||||\}}||||S)N)r_remap_pair)rDsrcdstr|kw)roriginalrrwrap*s	!z3AbstractSandbox._mk_dual_path_wrapper..wrap)rr)rrr)rrr_mk_dual_path_wrapper'sz%AbstractSandbox._mk_dual_path_wrapperrenamelinksymlinkNcs.pttfdd}|S)Ncs1|jr!|j|||}|||S)N)r_remap_input)rDr%r|r)rrrrr8s	z5AbstractSandbox._mk_single_path_wrapper..wrap)rr)rrrr)rrr_mk_single_path_wrapper5sz'AbstractSandbox._mk_single_path_wrapperrrstatlistdirr1chmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ	startfilemkfifomknodpathconfaccesscs(ttfdd}|S)NcsM|jr=|j|||}|j|||S|||S)N)rr
_remap_output)rDr%r|r)rrrrrMs	z4AbstractSandbox._mk_single_with_return..wrap)rr)rrr)rrr_mk_single_with_returnJsz&AbstractSandbox._mk_single_with_returnreadlinktempnamcs(ttfdd}|S)Ncs,||}|jr(|j|S|S)N)rr)rDr|rretval)rrrrr\s	z'AbstractSandbox._mk_query..wrap)rr)rrr)rrr	_mk_queryYszAbstractSandbox._mk_queryr0tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)rDr%rrr_validate_pathhszAbstractSandbox._validate_pathcOs
|j|S)zCalled for path inputs)r)rD	operationr%r|rrrrrlszAbstractSandbox._remap_inputcCs
|j|S)zCalled for path outputs)r)rDrr%rrrrpszAbstractSandbox._remap_outputcOs6|j|d||||j|d|||fS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r)rDrrrr|rrrrrtszAbstractSandbox._remap_pair)r>r?r@rArrsrrErIrrrrrrrrrrrrrrrrrrrrsB

devnullc@seZdZdZejdddddddd	d
ddd
dg
ZdgZeddZ	ddZ
erdddZdddZddZ
ddZddZdd Zd!d"Zd#d$d%Zd&S)'r	z.)
r/r%rr_sandboxr__prefix_exceptionsrrs)rDZsandbox
exceptionsrrrrss
!	
zDirectorySandbox.__init__cOs&ddlm}||||dS)Nr)r
)r8r
)rDrr|rr
rrr
_violationszDirectorySandbox._violationrcOsH|dkr5|j|r5|jd||||t||||S)NrrtrrUUr)rrrrr)_okrr)rDr%rr|rrrrrszDirectorySandbox._filecOsH|dkr5|j|r5|jd||||t||||S)Nrrrrrr)rrrrr)rrr)rDr%rr|rrrrrszDirectorySandbox._opencCs|jddS)Nr)r)rDrrrrszDirectorySandbox.tmpnamcCss|j}zYd|_tjjtjj|}|j|p`||jkp`|j|jSWd||_XdS)NF)	rr/r%rr	_exemptedrrNr)rDr%activerrrrrs		zDirectorySandbox._okcsTfdd|jD}fdd|jD}tj||}t|S)Nc3s|]}j|VqdS)N)rN)rO	exception)filepathrrrQsz-DirectorySandbox._exempted..c3s!|]}tj|VqdS)N)rerg)rOrh)rrrrQs)r_exception_patterns	itertoolschainany)rDrZ
start_matchesZpattern_matches
candidatesr)rrrs

zDirectorySandbox._exemptedcOsE||jkrA|j|rA|j|tjj||||S)zCalled for path inputs)	write_opsrrr/r%r)rDrr%r|rrrrrs"zDirectorySandbox._remap_inputcOsC|j|s |j|r9|j|||||||fS)z?Called for path pairs like rename, link, and symlink operations)rr)rDrrrr|rrrrrs zDirectorySandbox._remap_pairicOsO|t@r6|j|r6|jd|||||tj|||||S)zCalled for low-level os.open()zos.open)WRITE_FLAGSrrrr)rDrflagsrr|rrrrrszDirectorySandbox.openN)r>r?r@rArzfromkeysrr_EXCEPTIONSrsrrrrrrrrrrrrrr	s 		
cCs"g|]}tt|dqS)r)rr)rOarrrrs	rz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s7eZdZdZejdjZddZdS)r
zEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        cCs%|j\}}}|jjtS)N)r|tmplformatr)rDcmdr|kwargsrrr__str__szSandboxViolation.__str__N)	r>r?r@rAtextwrapdedentlstriprrrrrrr
s
)=r/rr+operator	functoolsrre
contextlibr5rZsetuptools.externrZsetuptools.extern.six.movesrrZpkg_resources.py31compatr(platformrNZ$org.python.modules.posix.PosixModulepythonrRposixZPosixModulerrrr	NameErrorrrdistutils.errorsrr__all__r contextmanagerr$r&r.r3r7r4rCrWrUr\rdrir`rrrrrr	reduceor_splitrr
rrrrs^


	
	wVPK!		%__pycache__/py36compat.cpython-35.pycnu[

ReK@suddlZddlmZddlmZddlmZGdddZejd	krqGdddZdS)
N)DistutilsOptionError)	strtobool)DEBUGc@s%eZdZdZdddZdS)Distribution_parse_config_filesz
    Mix-in providing forward-compatibility for functionality to be
    included by default on Python 3.7.

    Do not edit the code in this class except to update functionality
    as implemented in distutils.
    NcCsKddlm}tjtjkrRddddddd	d
ddd
ddg
}ng}t|}|dkr||j}tr|jd|dd}x|D]}tr|jd||j	|x|j
D]}|j|}|j|}xZ|D]R}	|	dkr|	|kr|j
||	}
|	jdd}	||
f||	sAPK!"{@!__pycache__/monkey.cpython-35.pycnu[

Re@sdZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlZgZ
ddZdd	Zd
dZdd
ZddZddZddZddZddZdS)z
Monkey patching of distutils.
N)
import_module)sixcCs-tjdkr |f|jStj|S)am
    Returns the bases classes for cls sorted by the MRO.

    Works around an issue on Jython where inspect.getmro will not return all
    base classes if multiple classes share the same name. Instead, this
    function will return a tuple containing the class itself, and the contents
    of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
    Jython)platformpython_implementation	__bases__inspectgetmro)clsr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/monkey.py_get_mros	rcCsFt|tjrtn!t|tjr0tn	dd}||S)NcSsdS)Nr)itemrrr
*szget_unpatched..)
isinstancerclass_typesget_unpatched_classtypesFunctionTypeget_unpatched_function)rlookuprrr

get_unpatched&srcCsQddt|D}t|}|jjdsMd|}t||S)zProtect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css'|]}|jjds|VqdS)
setuptoolsN)
__module__
startswith).0rrrr
	6sz&get_unpatched_class..	distutilsz(distutils has already been patched by %r)rnextrrAssertionError)rZexternal_basesbasemsgrrr
r/s	
rcCsNtjtj_tjdk}|r3tjtj_tjdkpd
tjko\dknpdtjko{dknpdtjkodkn}|rd	}|tjj	_
ttx/tj
tjtjfD]}tj
j|_qWtjjtj_tjjtj_d
tjkrCtjjtjd
_tdS)N
rzhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)r#r$r#)r%r&r')r#r)r#r#r&)r#r()r#r(r))r#r$)r#r$r#)rCommandrcoresysversion_infofindallfilelistconfig
PyPIRCCommandDEFAULT_REPOSITORY+_patch_distribution_metadata_write_pkg_file+_patch_distribution_metadata_write_pkg_infodistcmdDistribution	extension	Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehousemodulerrr
	patch_allAs(r=cCstjjtjj_dS)zDPatch write_pkg_file to also write Requires-Python/Requires-ExternalN)rr5write_pkg_filerDistributionMetadatarrrr
r3ksr3cCsLdtjddko$dkn}|s3dStjjtjj_dS)z
    Workaround issue #197 - Python 3 prior to 3.2.2 uses an environment-local
    encoding to save the pkg_info. Monkey-patch its write_pkg_info method to
    correct this undesirable behavior.
    r#Nr%)r#)r#r%r%)r,r-rr5write_pkg_inforr?)Zenvironment_localrrr
r4rs)r4cCs9t||}t|jd|t|||dS)z
    Patch func_name in target_mod with replacement

    Important - original must be resolved by name to avoid
    patching an already patched function.
    	unpatchedN)getattrvars
setdefaultsetattr)replacementZ
target_mod	func_nameoriginalrrr

patch_funcsrIcCs
t|dS)NrA)rB)	candidaterrr
rsrcstdtjdkr"dSfdd}tj|d}tj|d}y$t|dt|d	Wntk
rYnXyt|d
Wntk
rYnXyt|dWntk
rYnXdS)z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvcWindowsNcsnd|krdnd}||jd}t|}t|}t||sat||||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        msvc9Zmsvc9_Zmsvc14__)lstriprBrhasattrImportError)mod_namerGZrepl_prefixZ	repl_namereplmod)msvcrr
patch_paramssz9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)rrsystem	functoolspartialrIrP)rUrLZmsvc14r)rTr
r;s&



r;)__doc__r,distutils.filelistrrrrWr	Z
py26compatrZsetuptools.externrr__all__rrrr=r3r4rIrr;rrrr
s&	*PK!][[$__pycache__/extension.cpython-35.pycnu[

Re@sddlZddlZddlZddlZddlZddlmZddlm	Z	ddZ
e
Ze	ejj
ZGdddeZ
Gd	d
d
e
ZdS)N)map)
get_unpatchedcCs=d}yt|ddgjdSWntk
r8YnXdS)z0
    Return True if Cython can be imported.
    zCython.Distutils.build_extfromlist	build_extTF)
__import__r	Exception)Zcython_implr	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/extension.py_have_cythons
rc@s.eZdZdZddZddZdS)	Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs2|jdd|_tj|||||dS)Npy_limited_apiF)popr

_Extension__init__)selfnamesourcesargskwr	r	r
r#szExtension.__init__cCsqtr
dS|jpd}|jdkr4dnd}tjtjd|}tt||j	|_	dS)z
        Replace sources with .pyx extensions to sources with the target
        language extension. This mechanism allows language authors to supply
        pre-converted sources but to prefer the .pyx sources.
        Nzc++z.cppz.cz.pyx$)
rlanguagelower	functoolspartialresublistrr)rlangZ
target_extrr	r	r
_convert_pyx_sources_to_lang)s	z&Extension._convert_pyx_sources_to_langN)__name__
__module____qualname____doc__rrr	r	r	r
r src@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#r	r	r	r
r$8sr$)rrdistutils.core	distutilsdistutils.errorsdistutils.extensionZsetuptools.extern.six.movesrZmonkeyrrZ
have_pyrexcorerrr$r	r	r	r
sPK!aɊɊ(__pycache__/package_index.cpython-35.pycnu[

Re#
@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
yddlmZWn"e
k
rddlmZYnXddlmZddlmZmZmZmZddlZddlmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddlm$Z$dd	l%m&Z&dd
l'm(Z(ddl)m*Z*ddl+m,Z,dd
l-m.Z.ej/dZ0ej/dej1Z2ej/dZ3ej/dej1j4Z5dj6Z7ddddgZ8dZ9dZ:e:j;dej<dddeZ=ddZ>ddZ?dd Z@dd!dZAdd"d#ZBdd$d%ZCdedd&dZDdd'd(ZEd)d*ZFej/d+ej1ZGeFd,d-ZHGd.d/d/eIZJGd0d1d1eJZKGd2ddeZLej/d3jMZNd4d5ZOd6d7ZPd8d9ZQdd:d;ZRd<d=ZSGd>d?d?eIZTGd@dAdAejUZVejWjXdBdCZYeRe9eYZYdDdEZZdFdGZ[dS)Hz#PyPI and direct package downloadingN)wraps)	splituser)six)urllibhttp_clientconfigparsermap)
CHECKOUT_DISTDistributionBINARY_DISTnormalize_pathSOURCE_DISTEnvironmentfind_distributions	safe_namesafe_versionto_filenameRequirementDEVELOP_DIST)ssl_support)log)DistutilsError)	translate)strip_fragment)get_all_headersz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)
\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgzPackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezsz(interpret_distro_name..r:Nr8
py_versionrJrW)r@anyrangerTr
join)rUrVrOr`rJrWrBr^r%r%r&rs* 5ccst}|j}|dkrSxjtjj|j|D]}|||Vq7Wn8x5|D]-}||}||krZ|||VqZWdS)zHList unique elements, preserving order. Remember all elements ever seen.N)setaddrmovesfilterfalse__contains__)iterablekeyseenZseen_addelementkr%r%r&unique_everseens		


rncs"tfdd}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cst||S)N)rn)argskwargs)funcr%r&wrapperszunique_values..wrapper)r)rqrrr%)rqr&
unique_valuessrsz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>ccsxtj|D]}|j\}}tttj|jjd}d|ksgd|krx:t	j|D])}t
jj|t
|jdVqwWqWxddD]\}|j|}|d	krt	j||}|rt
jj|t
|jdVqWdS)
zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager9r8
Home PageDownload URLN)rurvr<)RELfinditergroupsrdrstrstripr0r@HREFrr"urljoin
htmldecoderNfindsearch)rApagerMtagrelZrelsposr%r%r&find_external_linkss'+
rc@s:eZdZdZddZddZddZdS)	ContentCheckerzP
    A null content checker that defines the interface for checking content
    cCsdS)z3
        Feed a block of data to the hash.
        Nr%)selfblockr%r%r&feedszContentChecker.feedcCsdS)zC
        Check the hash. Return False if validation fails.
        Tr%)rr%r%r&is_validszContentChecker.is_validcCsdS)zu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        Nr%)rreportertemplater%r%r&reportszContentChecker.reportN)__name__
__module____qualname____doc__rrrr%r%r%r&rsrc@saeZdZejdZddZeddZddZ	dd	Z
d
dZdS)
HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs(||_tj||_||_dS)N)	hash_namehashlibnewhashexpected)rrrr%r%r&__init__s	zHashChecker.__init__cCsRtjj|d}|s#tS|jj|}|sBtS||jS)z5Construct a (possibly null) ContentChecker from a URLr8r<)rr"r>rpatternr	groupdict)clsrArHrMr%r%r&from_urlszHashChecker.from_urlcCs|jj|dS)N)rupdate)rrr%r%r&rszHashChecker.feedcCs|jj|jkS)N)r	hexdigestr)rr%r%r&rszHashChecker.is_validcCs||j}||S)N)r)rrrmsgr%r%r&rs
zHashChecker.reportN)rrrr\compilerrclassmethodrrrrr%r%r%r&rs	rcseZdZdZddJddddZdd	d
ZdddZdd
dZddZddZ	ddZ
ddZdddZddZ
dfddZddZdd Zd!d"Zd#d$Zd%d&Zddddd'd(Zddd)d*Zd+d,Zd-Zd.d/Zd0d1Zdd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zd<d=Ze dd>d?Z!d@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&S)Krz;A distribution index that scans web pages for download URLszhttps://pypi.python.org/simple*NTcOstj||||dd|jd|_i|_i|_i|_tjdj	t
t|j|_
g|_|otjo|ptj}|rtj||_ntjj|_dS)Nr7|)rrr1	index_urlscanned_urlsfetched_urls
package_pagesr\rrcrrrMallowsto_scanrZis_availableZfind_ca_bundleZ
opener_foropenerrrequesturlopen)rrhostsZ	ca_bundleZ
verify_sslrokwZuse_sslr%r%r&r$s!			'		zPackageIndex.__init__FcCs^||jkr|rdSd|j|rr)rrAfatalsis_filerr%r%r&r{s!%zPackageIndex.url_okcCsEttjj|}dd|D}ttj|j|dS)Ncss@|]6}tj|D] }|jdr||fVqqdS)z	.egg-linkN)rYrr1)r]rEentryr%r%r&r_sz.PackageIndex.scan_egg_links..)filterrYrErr	itertoolsstarmap
scan_egg_link)rsearch_pathdirsZ	egg_linksr%r%r&scan_egg_linkss	
zPackageIndex.scan_egg_linksc
Csttjj||(}ttdttj|}WdQRXt	|dkr\dS|\}}xQt
tjj||D]4}tjj|||_t|_
|j|qWdS)Nr:)openrYrErcrrrrzr{rTrrUr
rJre)rrErZ	raw_lineslinesZegg_pathZ
setup_pathrPr%r%r&rs("	zPackageIndex.scan_egg_linkc

sfdd}xXtj|D]G}y,|tjj|t|jdWq"tk
rhYq"Xq"W||\}}|rxvt||D]e}t	|\}}	|j
dr|	r|r|d||f7}n
j|j|qWt
jdd|SdSd	S)
z#Process the contents of a PyPI pagecs|jjrtttjj|tjdjd}t|dkrd|dkrt	|d}t
|d}djj|j
i|.scanr8z.pyz
#egg=%s-%scSsd|jdddS)Nz%sr8r r:)rN)mr%r%r&sz,PackageIndex.process_index..rN)r|rxrr"r}r~rNr#rrIr1need_version_infoscan_urlPYPI_MD5sub)
rrArrrMrrnew_urlr4fragr%)rr&rs$,
	
zPackageIndex.process_indexcCs|jd|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_all)rrAr%r%r&rszPackageIndex.need_version_infocGsI|j|jkr5|r(|j|||jd|j|jdS)Nz6Scanning index of all packages (this may take a while))rrrrr)rrror%r%r&rszPackageIndex.scan_allcCs|j|j|jd|jj|jsK|j|j|jd|jj|jsm|j|x3t|jj|jfD]}|j|qWdS)Nr7)	rrunsafe_namerrrjproject_namenot_found_in_indexr)rrequirementrAr%r%r&
find_packagess
%zPackageIndex.find_packagescsk|j|j|x8||jD])}||kr;|S|jd||q%Wtt|j||S)Nz%s does not match %s)prescanrrjrsuperrobtain)rr	installerrP)	__class__r%r&rs

zPackageIndex.obtaincCsf|j|jd||jsb|jtj|td|jjtj	j
|fdS)z-
        checker is a ContentChecker
        zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N)rrrrrYunlinkrrr3rErV)rcheckerrZtfpr%r%r&
check_hashs

zPackageIndex.check_hashcCsrxk|D]c}|jdksJt|sJ|jdsJtt|rZ|j|q|jj|qWdS)z;Add `urls` to the list that will be prescanned for searchesNzfile:)rrr2rrrappend)rurlsrAr%r%r&add_find_linkss

zPackageIndex.add_find_linkscCs/|jr"tt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrr)rr%r%r&rs	zPackageIndex.prescancCsN||jr |jd}}n|jd}}|||j|jdS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rjrrrr)rrmethrr%r%r&rs

zPackageIndex.not_found_in_indexcCst|tst|}|ry|j|jd||}t|\}}|jdru|j|||}|Stj	j
|r|St|}t|j
||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path

        `spec` may be a ``Requirement`` object, or a string containing a URL,
        an existing local filename, or a project/version requirement spec
        (i.e. the string form of a ``Requirement`` object).  If it is the URL
        of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one
        that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is
        automatically created alongside the downloaded file.

        If `spec` is a ``Requirement`` object or a string containing a
        project/version requirement spec, this method returns the location of
        a matching distribution (possibly after downloading it to `tmpdir`).
        If `spec` is a locally existing file or directory name, it is simply
        returned unchanged.  If `spec` is a URL, it is downloaded to a subpath
        of `tmpdir`, and the local filename is returned.  Various errors may be
        raised if a problem occurs during downloading.
        r8z.pyrUN)rrr
_download_urlrNrIr1	gen_setuprYrErr'rfetch_distribution)rr$tmpdirrCfoundr4rHr%r%r&r9 szPackageIndex.downloadc	s:jd|id}dfdd}|rfjj|||}|r|dk	r|||}|dkrjdk	rj||}|dkr|rj|||}|dkrjdrdp	d|n#jd||jd	|jSdS)
a|Obtain a distribution suitable for fulfilling `requirement`

        `requirement` must be a ``pkg_resources.Requirement`` instance.
        If necessary, or if the `force_scan` flag is set, the requirement is
        searched for in the (online) package index as well as the locally
        installed packages.  If a distribution matching `requirement` is found,
        the returned distribution's ``location`` is the value you would have
        gotten from calling the ``download()`` method with the matching
        distribution's URL or filename.  If no matching distribution is found,
        ``None`` is returned.

        If the `source` flag is set, only source distributions and source
        checkout links will be considered.  Unless the `develop_ok` flag is
        set, development and system eggs (i.e., those using the ``.egg-info``
        format) will be ignored.
        zSearching for %sNcs|dkr}x||jD]}|jtkrere|kr jd|d|.findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %srU)rrrrrcloner)	rrr
force_scanrr	Zlocal_indexrPrr%)r	rr
rrr&rBs0!




zPackageIndex.fetch_distributioncCs/|j||||}|dk	r+|jSdS)a3Obtain a file suitable for fulfilling `requirement`

        DEPRECATED; use the ``fetch_distribution()`` method now instead.  For
        backward compatibility, this routine is identical but returns the
        ``location`` of the downloaded distribution instead of a distribution
        object.
        N)rrU)rrrr
rrPr%r%r&fetchszPackageIndex.fetchc

Cs\tj|}|r=ddt||jddDp@g}t|dkr-tjj|}tjj||krtjj	||}ddl
m}|||stj
|||}ttjj	|dd?}	|	jd|dj|djtjj|dfWdQRX|S|rLtd	||fntd
dS)NcSsg|]}|jr|qSr%)version)r]dr%r%r&
s	z*PackageIndex.gen_setup..r8r)samefilezsetup.pywzIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)rLrMrrNrTrYrErVdirnamercZsetuptools.command.easy_installrshutilcopy2rwriterrsplitextr)
rrZrHrrMrrVdstrrr%r%r&rs2	!"zPackageIndex.gen_setupi c
Cs|jd|d\}}zStj|}|jt|}t|tjjrwt	d||j
|jf|j}d}|j}d	}	d|krt
|d}
ttt|
}	|j|||||	t|dw}xZ|j|}|rK|j||j||d7}|j|||||	qPqW|j|||WdQRX|SWd|r|jXdS)
NzDownloading %szCan't download %s: %s %srr8zcontent-lengthzContent-Lengthwb)NNr<)rrrrrrrrrrrrdl_blocksizermaxrint
reporthookrrrrrr)
rrArZfprrrblocknumbssizesizesrrr%r%r&_download_tos:	


zPackageIndex._download_tocCsdS)Nr%)rrArZr Zblksizer"r%r%r&rszPackageIndex.reporthookcCs|jdrt|Syt||jSWnttjfk
r}zSdjdd|jD}|r|j	||nt
d||fWYdd}~XnItjj
k
r}z	|SWYdd}~Xntjjk
r8}z:|r
|j	||jnt
d||jfWYdd}~Xntjk
r}z:|ri|j	||jnt
d||jfWYdd}~Xn`tjtjfk
r}z4|r|j	||nt
d||fWYdd}~XnXdS)Nzfile: cSsg|]}t|qSr%)rz)r]argr%r%r&rs	z)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r2
local_openopen_with_authrr#r
InvalidURLrcrorrrrrURLErrorreason
BadStatusLineline
HTTPExceptionsocket)rrAwarningvrr%r%r&rs6
(%%zPackageIndex.open_urlcCsKt|\}}|rLx7d|krH|jddjdd}qWnd}|jdrq|dd}tjj||}|dks|jd	r|j||S|d
ks|jdr|j||S|jdr|j	||S|d
kr't
jjt
j
j|dS|j|d|j||SdS)Nz...\_Z__downloaded__z.egg.zipr,svnzsvn+gitzgit+zhg+rr:Tr/)rIreplacer1rYrErcr2
_download_svn
_download_git_download_hgrrurl2pathnamer"r>r_attempt_download)rrCrArr3rHrZr%r%r&r
s$% zPackageIndex._download_urlcCs|j|ddS)NT)r)rrAr%r%r&r'szPackageIndex.scan_urlcCsK|j||}d|jddjkrC|j|||S|SdS)Nrzcontent-typer)r$rr0_download_html)rrArZrr%r%r&r<*szPackageIndex._attempt_downloadcCst|}xT|D]L}|jrtjd|r^|jtj||j||SPqW|jtj|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at )	r���r{���r\���r���r���rY���r���r8��r���)r���rA���r���rZ���r���r-��r%���r%���r&���r=��1��s����




zPackageIndex._download_htmlc�������������C���si��|�j��d�d��d�}�d�}�|�j���j�d��r8d�|�k�r8t�j�j�|��\�}�}�}�}�}�}	�|�r8|�j�d��r8d�|�d	�d���k�r8|�d	�d���j��d�d��\�}�}�t�|��\�}
�}�|
�r8d
�|
�k�r�|
�j��d
�d��\�}�}
�d�|�|
�f�}�n
�d�|
�}�|�}�|�|�|�|�|�|	�f�}�t�j�j�|��}�|��j�d
�|�|��t	�j
�d�|�|�|�f��|�S)Nr;���r8���r���r���zsvn:@z//r7���r:���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)r@���r0���r2���r���r"���r>���r���
urlunparser���rY���system)r���rA���rZ���credsrC���netlocrE���r^���qr���authhostuserpwrB���r%���r%���r&���r8��@��s$����!$,"
zPackageIndex._download_svnc�������������C���s���t��j�j�|���\�}�}�}�}�}�|�j�d�d��d�}�|�j�d�d��d�}�d��}�d�|�k�rw�|�j�d�d��\�}�}�t��j�j�|�|�|�|�d�f��}��|��|�f�S)N+r8���r;���r���r>��r���r<���)r���r"���urlsplitr@���rsplit
urlunsplit)rA���
pop_prefixrC���rC��rE���rG���r���revr%���r%���r&���_vcs_split_rev_from_urlU��s����!!z$PackageIndex._vcs_split_rev_from_urlc�������������C���s���|�j��d�d��d�}�|��j�|�d�d�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k	�r�|��j�d�|��t�j�d	�|�|�f��|�S)
Nr;���r8���r���rM��TzDoing git clone from %s to %szgit clone --quiet %s %szChecking out %sz"(cd %s && git checkout --quiet %s))r@���rO��r���rY���rA��)r���rA���rZ���rN��r%���r%���r&���r9��g��s����	zPackageIndex._download_gitc�������������C���s���|�j��d�d��d�}�|��j�|�d�d�\�}�}�|��j�d�|�|��t�j�d�|�|�f��|�d��k	�r�|��j�d�|��t�j�d	�|�|�f��|�S)
Nr;���r8���r���rM��TzDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %sz(cd %s && hg up -C -r %s >&-))r@���rO��r���rY���rA��)r���rA���rZ���rN��r%���r%���r&���r:��w��s����	zPackageIndex._download_hgc�������������G���s���t��j�|�|��d��S)N)r���r���)r���r���ro���r%���r%���r&���r�����s����zPackageIndex.debugc�������������G���s���t��j�|�|��d��S)N)r���r���)r���r���ro���r%���r%���r&���r�����s����zPackageIndex.infoc�������������G���s���t��j�|�|��d��S)N)r���r���)r���r���ro���r%���r%���r&���r�����s����zPackageIndex.warn)r���)'r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r9���r��r��r��r��r$��r��r���r��r���r<��r=��r8��staticmethodrO��r9��r:��r���r���r���r%���r%���)r���r&���r���!��sL���2
+			#D
)$#z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�������������C���s6���t��|��t��s�|��S|��d�k�r,�t�j�|���St�|���S)N���)r���r��r���unichrchr)cr%���r%���r&���uchr��s
����
rU��c�������������C���s���|��j��d��}�|�j�d��r:�t�|�d�d���d��}�nL�|�j�d��rb�t�|�d�d����}�n$�t�j�j�j�j�|�|��j��d���}�t�|��S)Nr8���z#xr:���r*���r;���r���)	rN���r2���r��r���rf���
html_entitiesname2codepointr���rU��)rM���whatr%���r%���r&���
decode_entity��s����$rY��c�������������C���s
���t��t�|���S)z'Decode HTML entities in the given text.)
entity_subrY��)textr%���r%���r&���r~�����s����r~���c����������������s�����f�d�d���}�|�S)Nc����������������s������f�d�d���}�|�S)Nc�����������������s?���t��j���}�t��j���z���|��|���SWd��t��j�|��Xd��S)N)r/��getdefaulttimeoutsetdefaulttimeout)ro���rp���Zold_timeout)rq���timeoutr%���r&���_socket_timeout��s
����
z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr%���)rq���r_��)r^��)rq���r&���r_����s����z'socket_timeout.<locals>._socket_timeoutr%���)r^��r_��r%���)r^��r&���socket_timeout��s����r`��c�������������C���sI���t��j�j�|���}�|�j���}�t�j�|��}�|�j���}�|�j�d�d��S)aq��
    A function compatible with Python 2.3-3.3 that will encode
    auth from a URL suitable for an HTTP header.
    >>> str(_encode_auth('username%3Apassword'))
    'dXNlcm5hbWU6cGFzc3dvcmQ='

    Long auth strings should not cause a newline to be inserted.
    >>> long_auth = 'username:' + 'password'*10
    >>> chr(10) in str(_encode_auth(long_auth))
    False
    
r���)r���r"���r?���encodebase64encodestringr���r7��)rE��Zauth_sZ
auth_bytesZ
encoded_bytesencodedr%���r%���r&���_encode_auth��s
����rf��c���������������@���s:���e��Z�d��Z�d�Z�d�d���Z�d�d���Z�d�d���Z�d�S)	
Credentialz:
    A username/password pair. Use like a namedtuple.
    c�������������C���s���|�|��_��|�|��_�d��S)N)usernamepassword)r���rh��ri��r%���r%���r&���r�����s����	zCredential.__init__c�������������c���s���|��j��V|��j�Vd��S)N)rh��ri��)r���r%���r%���r&���__iter__��s����zCredential.__iter__c�������������C���s���d�t��|���S)Nz%(username)s:%(password)s)vars)r���r%���r%���r&���__str__��s����zCredential.__str__N)r���r���r���r���r���rj��rl��r%���r%���r%���r&���rg����s���rg��c���������������@���sF���e��Z�d��Z�d�d���Z�e�d�d����Z�d�d���Z�d�d���Z�d	�S)

PyPIConfigc�������������C���sr���t��j�d�d�d�g�d��}�t�j�j�|��|��t�j�j�t�j�j�d��d��}�t�j�j	�|��rn�|��j
�|��d�S)z%
        Load from ~/.pypirc
        rh��ri��
repositoryr���~z.pypircN)dictfromkeysr���RawConfigParserr���rY���rE���rc���
expanduserr���r���)r���defaultsrcr%���r%���r&���r�����s
����!zPyPIConfig.__init__c����������������s5�����f�d�d�����j����D�}�t�t���j�|���S)Nc����������������s.���g��|��]$�}���j��|�d���j���r�|��q�S)rn��)r���r{���)r]���section)r���r%���r&���r����s���	�z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)sectionsrp��r���_get_repo_cred)r���Zsections_with_repositoriesr%���)r���r&���creds_by_repository��s����zPyPIConfig.creds_by_repositoryc�������������C���sO���|��j��|�d��j���}�|�t�|��j��|�d��j���|��j��|�d��j����f�S)Nrn��rh��ri��)r���r{���rg��)r���rv��repor%���r%���r&���rx����s����zPyPIConfig._get_repo_credc�������������C���s7���x0�|��j��j���D]�\�}�}�|�j�|��r�|�Sq�Wd�S)z
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N)ry��itemsr2���)r���rA���rn��credr%���r%���r&���find_credential��s����zPyPIConfig.find_credentialN)r���r���r���r���propertyry��rx��r}��r%���r%���r%���r&���rm����s���	rm��c�������������C���s��t��j�j�|���\�}�}�}�}�}�}�|�j�d��rB�t�j�d���|�d
�k�rc�t�|��\�}�}	�n�d�}�|�s�t���j�|���}
�|
�r�t	�|
��}�|
�j
�|��f�}�t�j�d�|��|�rd�t
�|��}�|�|	�|�|�|�|�f�}�t��j�j�|��}
�t��j�j�|
��}�|�j�d�|��n�t��j�j�|���}�|�j�d	�t��|�|��}�|�rt��j�j�|�j��\�}�}�}�}�}�}�|�|�k�r|�|	�k�r|�|�|�|�|�|�f�}�t��j�j�|��|�_�|�S)z4Open a urllib2 request, handling HTTP authenticationr?��znonnumeric port: ''httphttpsNz*Authenticating as %s for %s (from .pypirc)zBasic 
Authorizationz
User-Agent)r��r��)r���r"���r>���r1���r���r)��r���rm��r}��rz���rh��r���r���rf��r@��r���Request
add_header
user_agentrA���)rA���r���rC���rC��rE���paramsrG���r���rE��rF��r|��r���rB���r���r���r��s2h2path2Zparam2Zquery2Zfrag2r%���r%���r&���r(����s6����$'r(��c�������������C���s���|��S)Nr%���)rA���r%���r%���r&���
fix_sf_url<��s����r��c�������������C���s��t��j�j�|���\�}�}�}�}�}�}�t��j�j�|��}�t�j�j�|��rX�t��j�j�|���S|�j	�d��rNt�j�j
�|��rNg��}�x�t�j�|��D]�}	�t�j�j�|�|	��}
�|	�d�k�r�t
�|
�d���}�|�j���}�Wd�QRXPn�t�j�j
�|
��r�|	�d�7}	�|�j�d�j�d�|	���q�Wd�}
�|
�j�d�|��d	�d
�j�|���}�d�\�}�}�n�d�\�}�}�}�d�d�i�}�t�j�|��}�t��j�j�|��|�|�|�|��S)z7Read a local path, with special support for directoriesr7���z
index.htmlrNz<a href="{name}">{name}</a>r3���zB<html><head><title>{url}{files}rAfilesraOKPath not found	Not foundzcontent-typez	text/html)rr)rrr)rr"r>rr;rYrEisfilerr1rrrcrrrformatrStringIOrr)rArCrDrEparamrGrrZrrfilepathrbodyrstatusmessagerZbody_streamr%r%r&r'@s,$!
!r')\rsysrYr\rr/rcrr	functoolsrurllib.parserImportErrorurllib2Zsetuptools.externrZsetuptools.extern.six.movesrrrrr!
pkg_resourcesr	r
rrr
rrrrrrrr	distutilsrdistutils.errorsrfnmatchrZsetuptools.py26compatrZsetuptools.py27compatrrrLIr|rrMrr@rS__all__Z_SOCKET_TIMEOUTZ_tmplrrrr'rrIrrKr[rrnrsrwrobjectrrrrrZrUrYr~r`rfrgrrrmrrr(rr'r%r%r%r&s~
"R			%	"
!t&.PK!0ک#__pycache__/dep_util.cpython-35.pycnu[

Re@s ddlmZddZdS))newer_groupcCst|t|kr$tdg}g}xStt|D]?}t||||rC|j|||j||qCW||fS)zWalk both arguments in parallel, testing if each source group is newer
    than its corresponding target. Returns a pair of lists (sources_groups,
    targets) where sources is newer than target, according to the semantics
    of 'newer_group()'.
    z5'sources_group' and 'targets' must be the same length)len
ValueErrorrangerappend)Zsources_groupstargets	n_sources	n_targetsir/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr
N)distutils.dep_utilrr
rrrrsPK!̵'__pycache__/archive_util.cpython-35.pycnu[

Re@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
mZddddd	d
dgZGdd	d	eZ
d
dZedddZeddZeddZeddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryContextualZipFileunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)r	z#Couldn't recognize the archive typeN)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/archive_util.pyr	scCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrscCs[xT|ptD]6}y||||Wntk
r>w
Yq
XdSq
Wtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``

    `progress_filter` is a function taking two arguments: a source path
    internal to the archive ('/'-separated), and a filesystem path where it
    will be extracted.  The callback must return the desired extract path
    (which may be the same as the one passed in), or else ``None`` to skip
    that file or directory.  The callback can thus be used to report on the
    progress of the extraction, as well as to filter the items extracted or
    alter their extraction paths.

    `drivers`, if supplied, must be a non-empty sequence of functions with the
    same signature as this function (minus the `drivers` argument), that raise
    ``UnrecognizedFormat`` if they do not support extracting the designated
    archive type.  The `drivers` are tried in sequence until one is found that
    does not raise an error, or until all are exhausted (in which case
    ``UnrecognizedFormat`` is raised).  If you do not supply a sequence of
    drivers, the module's ``extraction_drivers`` constant will be used, which
    means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that
    order.
    Nz!Not a recognized archive type: %s)r
r	)filenameextract_dirprogress_filterZdriversZdriverrrrrs
cCs3tjj|s"td||d|fi}xtj|D]\}}}||\}}xD|D]<}	||	dtjj||	f|tjj||	d|jdkrtq>tj	j
||jd}|||}|sq>|jdrt|nBt||j
|j}t|d}|j|WdQRX|jd?}	|	r>tj||	q>WWdQRXdS)zUnpack zip `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
    by ``zipfile.is_zipfile()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z%s is not a zip filerz..wbN)zipfile
is_zipfiler	rinfolistr
startswithsplitrrrendswithrreadopenwrite
external_attrchmod)
rrrzinfonamer'datar&Zunix_attributesrrrrZs(	$


c
Csytj|}Wn(tjk
r=td|fYnXtj|~dd|_xc|D][}|j}|jdrdd|j	dkrdt
jj||j	d}x|dk	r7|j
s|jr7|j}|jr%tj|j}tj||}tj|}|j|}qW|dk	rd|js\|jrd|||}	|	rd|	jt
jr|	dd	}	y|j||	Wqdtjk
rYqdXqdWdSWdQRXdS)
zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined
    by ``tarfile.open()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z/%s is not a compressed or uncompressed tar filecWsdS)Nr)argsrrrsz unpack_tarfile..rz..NT)tarfiler1TarErrorr	
contextlibclosingchownr7r-r.rrrislnkissymlinkname	posixpathdirnamenormpath
_getmemberisfilerr/sep_extract_memberExtractError)
rrrtarobjmemberr7Z
prelim_dstlinkpathr"Z	final_dstrrrrs8
	%'	$	)rr*r=rrrEr?distutils.errorsr
pkg_resourcesrr__all__r	rrrrrr
rrrrs$"%.PK!X,aa%__pycache__/namespaces.cpython-35.pycnu[

Re@sqddlZddlmZddlZddlmZejjZGdddZ	Gddde	Z
dS)N)log)mapc	@s|eZdZdZddZddZddZdZdZddZ	ddZ
ddZeddZ
dS)	Installerz
-nspkg.pthc	Cs|j}|sdStjj|j\}}||j7}|jj|tj	d|t
|j|}|jrt
|dSt|d}|j|WdQRXdS)Nz
Installing %swt)_get_all_ns_packagesospathsplitext_get_target	nspkg_extoutputsappendrinfor_gen_nspkg_linedry_runlistopen
writelines)selfnspfilenameextlinesfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/namespaces.pyinstall_namespacess
	
zInstaller.install_namespacescCsbtjj|j\}}||j7}tjj|sAdStjd|tj|dS)NzRemoving %s)	rrr	r
rexistsrrremove)rrrrrruninstall_namespaces!s
zInstaller.uninstall_namespacescCs|jS)N)target)rrrrr
)szInstaller._get_targetimport sys, types, os#has_mfs = sys.version_info > (3, 5)$p = os.path.join(%(root)s, *%(pth)r)4importlib = has_mfs and __import__('importlib.util')-has_mfs and __import__('importlib.machinery')m = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))Cm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))7mp = (m or []) and m.__dict__.setdefault('__path__',[])(p not in mp) and mp.append(p)4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']r)rrrr	_get_rootCszInstaller._get_rootcCsyt|}t|jd}|j}|j}|jd\}}}|ra||j7}dj|tdS)N.;
)	strtuplesplitr+_nspkg_tmpl
rpartition_nspkg_tmpl_multijoinlocals)rpkgpthrootZ
tmpl_linesparentsepchildrrrrFs	
zInstaller._gen_nspkg_linecCs.|jjpg}ttt|j|S)z,Return sorted list of all package namespaces)distributionZnamespace_packagessortedflattenr
_pkg_names)rpkgsrrrrQszInstaller._get_all_ns_packagesccs8|jd}x"|r3dj|V|jqWdS)z
        Given a namespace package, yield the components of that
        package.

        >>> names = Installer._pkg_names('a.b.c')
        >>> set(names) == set(['a', 'a.b', 'a.b.c'])
        True
        r,N)r1r5pop)r7partsrrrr@Vs
	zInstaller._pkg_namesN)	r!r"r#r$r%r&r'r(r))r*)__name__
__module____qualname__rrrr
r2r4r+rrstaticmethodr@rrrrrs$rc@s(eZdZddZddZdS)DevelopInstallercCstt|jS)N)reprr/Zegg_path)rrrrr+gszDevelopInstaller._get_rootcCs|jS)N)egg_link)rrrrr
jszDevelopInstaller._get_targetN)rDrErFr+r
rrrrrHfsrH)r	distutilsr	itertoolsZsetuptools.extern.six.movesrchain
from_iterabler?rrHrrrrs[PK!Xmߘ#__pycache__/__init__.cpython-35.pycnu[

Re@sdZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZmZddl
ZddlmZddlmZmZddlmZd	d
lmZddd
ddddgZejjZdZdZdgZGdddeZGdddeZ ej!Z"ej#j$Z$ej%ej#j&Z'Gddde'Z&ddZ(ej)ddZ*ej+dS)z@Extensions to the 'distutils' for large or complex distributionsN)convert_path)fnmatchcase)filtermap)	Extension)DistributionFeature)Require)monkeysetuprrCommandrr	
find_packagesTz
lib2to3.fixesc@sgeZdZdZedfd
ddZeddZedd	Zed
dZ	dS)
PackageFinderzI
    Generate a list of all Python packages found within a directory
    .*cCs7t|jt||jdd||j|S)a	Return a list all Python packages found within directory 'where'

        'where' is the root directory which will be searched for packages.  It
        should be supplied as a "cross-platform" (i.e. URL-style) path; it will
        be converted to the appropriate local path syntax.

        'exclude' is a sequence of package names to exclude; '*' can be used
        as a wildcard in the names, such that 'foo.*' will exclude all
        subpackages of 'foo' (but not 'foo' itself).

        'include' is a sequence of package names to include.  If it's
        specified, only the named packages will be included.  If it's not
        specified, all found packages will be included.  'include' can contain
        shell style wildcard patterns just like 'exclude'.
        Zez_setupz*__pycache__)list_find_packages_iterr
_build_filter)clswhereexcludeincluder/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/__init__.pyfind's		zPackageFinder.findccsxtj|ddD]\}}}|dd}g|dds%
z!PackageFinder._find_packages_itercCstjjtjj|dS)z%Does a directory look like a package?z__init__.py)rrisfiler )rrrrr$Zsz!PackageFinder._looks_like_packagecsfddS)z
        Given a list of patterns, return a callable that will be true only if
        the input matches at least one of the patterns.
        cstfddDS)Nc3s!|]}td|VqdS)patN)r).0r.)namerr	esz@PackageFinder._build_filter....)any)r0)patterns)r0resz-PackageFinder._build_filter..r)r3r)r3rr_szPackageFinder._build_filterN)r)
__name__
__module____qualname____doc__classmethodrrstaticmethodr$rrrrrr"src@s"eZdZeddZdS)PEP420PackageFindercCsdS)NTr)rrrrr$isz'PEP420PackageFinder._looks_like_packageN)r5r6r7r:r$rrrrr;hsr;c@s:eZdZejZdZddZdddZdS)r
FcKs'tj||t|j|dS)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)_Command__init__varsupdate)selfdistkwrrrr=zszCommand.__init__rcKs,tj|||}t|j||S)N)r<reinitialize_commandr>r?)r@commandreinit_subcommandsrBcmdrrrrCszCommand.reinitialize_commandN)r5r6r7r<r8Zcommand_consumes_argumentsr=rCrrrrr
us	cCs5ddtj|ddD}ttjj|S)z%
    Find all files under 'path'
    css:|]0\}}}|D]}tjj||VqqdS)N)rrr )r/baser'r(filerrrr1sz#_find_all_simple..rT)rrrrr-)rresultsrrr_find_all_simples	rJcCsOt|}|tjkrEtjtjjd|}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    start)	rJrcurdir	functoolspartialrr!rr)r)r(Zmake_relrrrfindalls
rO),r8rrMdistutils.core	distutilsdistutils.filelistdistutils.utilrfnmatchrZsetuptools.extern.six.movesrrZsetuptools.version
setuptoolsZsetuptools.extensionrZsetuptools.distrrZsetuptools.dependsr	r__all__version__version__Zbootstrap_install_fromZrun_2to3_on_doctestsZlib2to3_fixer_packagesobjectrr;rrcorerZ
get_unpatchedr
r<rJrLrOZ	patch_allrrrrs6		F	PK!	D}}%__pycache__/py27compat.cpython-35.pycnu[

Re@szdZddlZddlmZddZejrCddZejdko[ejZerjen	dd	Z	dS)
z2
Compatibility Support for Python 2.7 and earlier
N)sixcCs
|j|S)zH
    Given an HTTPMessage, return all headers matching a given key.
    )get_all)messagekeyr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/py27compat.pyget_all_headers
srcCs
|j|S)N)
getheaders)rrrrrrsLinuxcCs|S)Nr)xrrrsr)
__doc__platformZsetuptools.externrrPY2systemZlinux_py2_asciistrZrmtree_saferrrrs		PK!߰YY%__pycache__/py33compat.cpython-35.pycnu[

Re@srddlZddlZddlZddlmZejddZGdddeZe	edeZ
dS)N)sixOpArgz
opcode argc@s(eZdZddZddZdS)Bytecode_compatcCs
||_dS)N)code)selfrr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/py33compat.py__init__szBytecode_compat.__init__ccstjd|jj}t|jj}d}d}x||kr||}|tjkr||d||dd|}|d7}|tjkrtjd	}||d}q9nd}|d7}t	||Vq9WdS)
z>Yield '(op,arg)' pair for each operation in code object 'code'briN)
arrayrco_codelendis
HAVE_ARGUMENTEXTENDED_ARGr
integer_typesr)rbyteseofptrextended_argopargZ	long_typerrr__iter__s 
"


zBytecode_compat.__iter__N)__name__
__module____qualname__r	rrrrrrsrBytecode)rrcollectionsZsetuptools.externr
namedtuplerobjectrgetattrr!rrrrs"PK!*5ƒ__pycache__/glob.cpython-35.pycnu[

ReW@sdZddlZddlZddlZddlmZdddgZdddZdd	dZd
dZ	dd
Z
ddZddZddZ
ejdZejdZddZddZddZdS)z
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * `bytes` changed to `six.binary_type`.
 * Hidden files are not ignored.
N)binary_typeglobiglobescapeFcCstt|d|S)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    	recursive)listr)pathnamerr	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/glob.pyrscCs>t||}|r:t|r:t|}|s:t|S)aReturn an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )_iglob_isrecursivenextAssertionError)rritsr	r	r
r s

ccshtjj|\}}t|s_|rDtjj|r[|Vntjj|r[|VdS|s|rt|rx>t||D]}|VqWnxt||D]}|VqWdS||krt|rt	||}n	|g}t|r|rt|rt}q%t}nt
}x<|D]4}x+|||D]}tjj||VqBWq,WdS)N)ospathsplit	has_magiclexistsisdirrglob2glob1rglob0join)rrdirnamebasenamexdirsglob_in_dirnamer	r	r
r2s4				
rcCso|s3t|tr*tjjd}n	tj}ytj|}Wntk
r^gSYnXtj||S)NASCII)	
isinstancerrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesr	r	r
r]s	
	rcCsN|s"tjj|rJ|gSn(tjjtjj||rJ|gSgS)N)rrrrr)rrr	r	r
rjs
!rccsAt|st|ddVxt|D]}|Vq.WdS)Nr)rr	_rlistdir)rr)rr	r	r
rzsrc
cs|s3t|tr*ttjd}n	tj}ytj|}Wntjk
radSYnXx_|D]W}|V|rtjj||n|}x(t|D]}tjj||VqWqiWdS)Nr!)	r"rrr#r%errorrrr+)rr*rryr	r	r
r+s		
!r+z([*?[])s([*?[])cCs:t|tr!tj|}ntj|}|dk	S)N)r"rmagic_check_bytessearchmagic_check)rmatchr	r	r
rsrcCs't|tr|dkS|dkSdS)Ns**z**)r"r)r)r	r	r
rs
rcCsVtjj|\}}t|tr<tjd|}ntjd|}||S)z#Escape all special characters.
    s[\1]z[\1])rr
splitdriver"rr.subr0)rdriver	r	r
rs
)__doc__rrer'Zsetuptools.extern.sixr__all__rrrrrrr+compiler0r.rrrr	r	r	r
s"+
PK!>HH&__pycache__/ssl_support.cpython-35.pycnu[

Re "@sBddlZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZmZyddl
Z
Wnek
rdZ
YnXdddddgZd	jjZyejjZejZWnek
reZZYnXe
dk	oeeefkZydd
l
mZmZWnWek
ry$ddlmZddlmZWnek
rdZdZYnXYnXesGd
ddeZesdddZddZGdddeZGdddeZdddZ ddZ!e!ddZ"ddZ#ddZ$dS)N)urllibhttp_clientmapfilter)ResolutionErrorExtractionErrorVerifyingHTTPSHandlerfind_ca_bundleis_available
cert_paths
opener_fora
/etc/pki/tls/certs/ca-bundle.crt
/etc/ssl/certs/ca-certificates.crt
/usr/share/ssl/certs/ca-bundle.crt
/usr/local/share/certs/ca-root.crt
/etc/ssl/cert.pem
/System/Library/OpenSSL/certs/cert.pem
/usr/local/share/certs/ca-root-nss.crt
/etc/ssl/ca-bundle.pem
)CertificateErrormatch_hostname)r
)rc@seZdZdS)r
N)__name__
__module____qualname__rr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/ssl_support.pyr
5sr
c
CsUg}|sdS|jd}|d}|dd}|jd}||krjtdt||s|j|jkS|dkr|jdnY|jd	s|jd	r|jtj|n"|jtj|j	d
dx$|D]}|jtj|qWtj
dd
j|dtj}	|	j
|S)zpMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr
reprlowerappend
startswithreescapereplacecompilejoin
IGNORECASEmatch)
dnhostname
max_wildcardspatspartsleftmost	remainder	wildcardsfragpatrrr_dnsname_match;s*
"
&r.cCsO|stdg}|jdf}x@|D]8\}}|dkr1t||r\dS|j|q1W|sx]|jdfD]I}x@|D]8\}}|dkrt||rdS|j|qWqWt|dkrtd|d	jtt|fn;t|dkr?td
||dfntddS)
a=Verify that *cert* (in decoded format as returned by
        SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
        rules are followed, but IP addresses are not accepted for *hostname*.

        CertificateError is raised on failure. On success, the function
        returns nothing.
        zempty or no certificatesubjectAltNameDNSNsubject
commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	
ValueErrorgetr.rlenr
r!rr)certr%dnsnamessankeyvaluesubrrrros.%rc@s.eZdZdZddZddZdS)rz=Simple verifying handler: no auth, subclasses, timeouts, etc.cCs||_tj|dS)N)	ca_bundleHTTPSHandler__init__)selfr<rrrr>s	zVerifyingHTTPSHandler.__init__csjfdd|S)Ncst|j|S)N)VerifyingHTTPSConnr<)hostkw)r?rrsz2VerifyingHTTPSHandler.https_open..)do_open)r?reqr)r?r
https_opensz VerifyingHTTPSHandler.https_openN)rrr__doc__r>rFrrrrrsc@s.eZdZdZddZddZdS)r@z@Simple verifying connection: no auth, subclasses, timeouts, etc.cKs tj|||||_dS)N)HTTPSConnectionr>r<)r?rAr<rBrrrr>szVerifyingHTTPSConn.__init__cCstj|j|jft|dd}t|drjt|ddrj||_|j|j}n	|j}t	j
|dt	jd|j|_yt
|jj|Wn5tk
r|jjtj|jjYnXdS)Nsource_address_tunnel_tunnel_host	cert_reqsca_certs)socketcreate_connectionrAportgetattrhasattrsockrJrKsslwrap_socket
CERT_REQUIREDr<rgetpeercertr
shutdown	SHUT_RDWRclose)r?rSactual_hostrrrconnects$!	
	

zVerifyingHTTPSConn.connectN)rrrrGr>r\rrrrr@sr@cCs"tjjt|ptjS)z@Get a urlopen() replacement that uses ca_bundle for verification)rrequestbuild_openerrr	open)r<rrrrs	cs%tjfdd}|S)Ncs(tds!||_jS)Nalways_returns)rRr`)argskwargs)funcrrwrapperszonce..wrapper)	functoolswraps)rcrdr)rcronces!rgcsryddl}Wntk
r(dSYnXGfddd|j}|jd|jd|jS)Nrcs:eZdZfddZfddZS)z"get_win_certfile..CertFilecs't|jtj|jdS)N)superr>atexitregisterrZ)r?)CertFile	__class__rrr>sz+get_win_certfile..CertFile.__init__cs0yt|jWntk
r+YnXdS)N)rhrZOSError)r?)rkrlrrrZs
z(get_win_certfile..CertFile.close)rrrr>rZr)rk)rlrrksrkCAROOT)wincertstoreImportErrorrkZaddstorename)rpZ	_wincertsr)rkrget_win_certfiles
		

rscCs4ttjjt}tp3t|dp3tS)z*Return an existing CA bundle path, or NoneN)rospathisfilerrsnext_certifi_where)Zextant_cert_pathsrrrr	s	c
Cs6ytdjSWntttfk
r1YnXdS)Ncertifi)
__import__whererqrrrrrrrxsrx)%rtrNrirreZsetuptools.extern.six.movesrrrr
pkg_resourcesrrrTrq__all__striprrr]r=rHAttributeErrorobjectr
r
rZbackports.ssl_match_hostnamer3r.rr@rrgrsr	rxrrrrsP"
	



4)
#	
PK!;d,<,<!__pycache__/config.cpython-35.pycnu[

Re?@sddlmZmZddlZddlZddlZddlmZddlm	Z	ddl
mZmZddl
mZddlmZddd	d
ZddZdd
dZGdddeZGdddeZGdddeZdS))absolute_importunicode_literalsN)defaultdict)partial)DistutilsOptionErrorDistutilsFileError)
import_module)string_typesFc	Csddlm}m}tjj|}tjj|sJtd|tj}tj	tjj
|zi|}|r|jng}||kr|j||j
|d|t||jd|}Wdtj	|Xt|S)a,Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file
        to get options from.

    :param bool find_others: Whether to search for other configuration files
        which could be on in various places.

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :rtype: dict
    r)Distribution
_Distributionz%Configuration file %s does not exist.	filenamesignore_option_errorsN)Zsetuptools.distr
rospathabspathisfilergetcwdchdirdirnamefind_config_filesappendparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict)	filepathZfind_othersr
r
rZcurrent_directorydistrhandlersr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/config.pyread_configuration
s$
	

r cCstt}x|D]w}|j}|j}x\|jD]Q}t|d|d}|dkrot||}n	|}||||s	z-ConfigHandler._parse_list..)
isinstancelist
splitlinessplit)clsr)	separatorrrr_parse_lists
zConfigHandler._parse_listcCstd}i}xa|j|D]P}|j|\}}}||krVtd||j||jsz,ConfigHandler._parse_file..rKrLc3sE|];}j|sdrtjj|rj|VqdS)TN)
_assert_localrrr
_read_file)rMr)rTrrrd	s)rPr	r5lenrSjoin)rTr)Zinclude_directivespecZ	filepathsr)rTr_parse_fileszConfigHandler._parse_filecCs)|jtjs%td|dS)Nz#`file:` directive can not access %s)r5rrr)rrrrreszConfigHandler._assert_localc	Cs-tj|dd}|jSWdQRXdS)Nencodingzutf-8)ioopenread)rfrrrrfszConfigHandler._read_filecCsd}|j|s|S|j|djjd}|j}dj|}|p^d}tjjdt	j
zt|}t||}Wdtjddt_X|S)zRepresents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:r2r3r<rN)
r5r6r7rSpoprhsysrinsertrrrr%)rTr)Zattr_directiveZ
attrs_path	attr_namemodule_namemodulerrr_parse_attrs!zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs'|}xD]}||}q
W|S)Nr)r)parsedmethod)
parse_methodsrrr,Bs
z1ConfigHandler._get_parser_compound..parser)rTrzr,r)rzr_get_parser_compound9s	z"ConfigHandler._get_parser_compoundcCsOi}|pdd}x0|jD]"\}\}}||||Wsz6ConfigHandler._parse_section_to_dict..)r4)rTr;Z
values_parserr)r[_r]rrr_parse_section_to_dictLs

z$ConfigHandler._parse_section_to_dictcCsJxC|jD]5\}\}}y|||.Nr)r~rVr!r4rC)r9r;Zsection_datarrr)rrrs"z1ConfigOptionsHandler.parse_section_packages__findcCs#|j||j}||ds.9PK!~(__pycache__/unicode_utils.cpython-35.pycnu[

Re@sPddlZddlZddlmZddZddZddZdS)	N)sixcCsot|tjr"tjd|Sy4|jd}tjd|}|jd}Wntk
rjYnX|S)NZNFDzutf-8)
isinstancer	text_typeunicodedata	normalizedecodeencodeUnicodeError)pathr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/unicode_utils.py	decomposes
r
cCsrt|tjr|Stjp%d}|df}x7|D]/}y|j|SWq;tk
riw;Yq;Xq;WdS)zY
    Ensure that the given path is decoded,
    NONE when no expected encoding works
    zutf-8N)rrrsysgetfilesystemencodingrUnicodeDecodeError)r
Zfs_enc
candidatesencrrrfilesys_decodes

rcCs.y|j|SWntk
r)dSYnXdS)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrrrr
try_encode's
r)rrZsetuptools.externrr
rrrrrrs
PK!(UU*__pycache__/windows_support.cpython-35.pycnu[

Re@s:ddlZddlZddZeddZdS)NcCs tjdkrddS|S)NWindowsc_sdS)N)argskwargsrr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/windows_support.pyszwindows_only..)platformsystem)funcrrrwindows_onlys
rcCsntdtjjj}tjjtjjf|_tjj	|_
d}|||}|sjtjdS)z
    Set the hidden attribute on a file or directory.

    From http://stackoverflow.com/questions/19622133/

    `path` must be text.
    zctypes.wintypesN)
__import__ctypeswindllkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDargtypesZBOOLrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr	hide_files	
r)rrrrrrrrsPK!q7MM"__pycache__/depends.cpython-35.pycnu[

Re@sddlZddlZddlZddlmZddlmZmZmZmZddl	m
Z
dddd	gZGd
ddZdddZ
ddddZdd
d	ZddZedS)N)
StrictVersion)
PKG_DIRECTORYPY_COMPILED	PY_SOURCE	PY_FROZEN)BytecodeRequirefind_moduleget_module_constantextract_constantc@sseZdZdZdddddZddZdd	Zdd
ddZdd
dZdddZ	dS)r	z7A prerequisite to building or installing a distributionNcCse|dkr|dk	rt}|dk	rH||}|dkrHd}|jjt|`dS)N__version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage	attributeformatr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/depends.py__init__szRequire.__init__cCs*|jdk	r#d|j|jfS|jS)z0Return full package/distribution name, w/versionNz%s-%s)rr)rrrr	full_name szRequire.full_namecCs=|jdkp<|jdkp<t|dko<||jkS)z%Is 'version' sufficiently up-to-date?Nunknown)rrstrr)rversionrrr
version_ok&szRequire.version_okrc
Cs|jdkr[y3t|j|\}}}|r=|j|SWntk
rZdSYnXt|j|j||}|dk	r||k	r|jdk	r|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)
__name__
__module____qualname____doc__rrrr(r)r*rrrrr	s
c
Cs|jd}x|r|jd}tj||\}}\}}}}	|tkrv|pgdg}|g}q|rtd||fqW|	S)z7Just like 'imp.find_module()', but with package support.rrzCan't find %r in %s)splitpopimpr
rr!)
rr"partspartr$pathsuffixmodekindinforrrr
Rs	(c
Csy%t||\}}\}}}Wntk
r=dSYnXz|tkrl|jdtj|}	n|tkrtj|}	nl|t	krt
|j|d}	nE|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]b}|j}	|j}
|	|kr|j|
}qP|
|kr|	|ks|	|kr|S|}qPWdS)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_nameslistindexropcodearg	co_consts)rFrEr#Zname_idx
STORE_NAMESTORE_GLOBAL
LOAD_CONSTconstZ	byte_codeoprNrrrrs		$cCsXtjjdr&tjdkr&dSd}x%|D]}t|=tj|q3WdS)z
    Patch the globals to remove the objects not available on some platforms.

    XXX it'd be better to test assertions about bytecode instead.
    javacliNrr)rr)rAplatform
startswithglobals__all__remove)Zincompatiblerrrr_update_globalss"

r\r])rAr2r=Zdistutils.versionrrrrrZ
py33compatrrZr	r
rrr\rrrrs"C"$PK!K
K
%__pycache__/lib2to3_ex.cpython-35.pycnu[

Re@sxdZddlmZddlmZddlmZmZddl	Z	GdddeZ
Gdd	d	eZdS)
zy
Customized Mixin2to3 support:

 - adds support for converting doctests


This module raises an ImportError on Python 2.
)	Mixin2to3)log)RefactoringToolget_fixers_from_packageNc@s4eZdZddZddZddZdS)DistutilsRefactoringToolcOstj||dS)N)rerror)selfmsgargskwr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/lib2to3_ex.py	log_errorsz"DistutilsRefactoringTool.log_errorcGstj||dS)N)rinfo)rr	r
rrr
log_messagesz$DistutilsRefactoringTool.log_messagecGstj||dS)N)rdebug)rr	r
rrr
	log_debugsz"DistutilsRefactoringTool.log_debugN)__name__
__module____qualname__rrrrrrr
rsrc@s7eZdZdddZddZddZdS)	rFcCs|jjdk	rdS|s dStjddj||j|j|rtjrt	|j
}|j|ddddntj
||dS)NTzFixing  writeZ
doctests_only)distributionZuse_2to3rrjoin_Mixin2to3__build_fixer_names_Mixin2to3__exclude_fixers
setuptoolsZrun_2to3_on_doctestsrfixer_namesrefactor
_Mixin2to3run_2to3)rfilesZdoctestsrrrr
r s

	zMixin2to3.run_2to3cCs|jr
dSg|_x'tjD]}|jjt|q W|jjdk	rx*|jjD]}|jjt|q_WdS)N)rrZlib2to3_fixer_packagesextendrrZuse_2to3_fixers)rprrr
Z__build_fixer_names.s		zMixin2to3.__build_fixer_namescCskt|dg}|jjdk	r7|j|jjx-|D]%}||jkr>|jj|q>WdS)NZexclude_fixers)getattrrZuse_2to3_exclude_fixersr#rremove)rZexcluded_fixersZ
fixer_namerrr
Z__exclude_fixers8s
zMixin2to3.__exclude_fixersN)rrrr rrrrrr
rs
r)__doc__distutils.utilrr	distutilsrlib2to3.refactorrrrrrrrr
sPK!L%__pycache__/site-patch.cpython-35.pycnu[

Re	@s&ddZedkr"e[dS)cCsddl}ddl}|jjd}|dksL|jdkrU|rUg}n|j|j}t|di}|jt	|d}|jj
t}x|D]}||ks|rq|j|}|dk	r|jd}|dk	r|j
dPqy.ddl}	|	jd|g\}
}}Wntk
rSwYnX|
dkrcqz|	j
d|
||Wd|
jXPqWtdtdd|jD}
t|d	d}d|_x|D]}t|qW|j|7_t|d\}}d}g}x|jD]~}t|\}}||kre|dkret	|}||
ks}|dkr|j|q)|j|||d
7}q)W||jdd)s	z__boot..__egginsertr)sysosenvirongetplatformsplitpathsepgetattrpathlendirname__file__find_moduleload_moduleimpImportErrorclosedictr

addsitedirrappendinsert)rrrZpicZstdpathZmydirr	importerloaderrstreamrdescrknown_pathsoldposdZndZ	insert_atnew_pathpnpr
r
r__boots`"	

"
	
r-rN)r-__name__r
r
r
rsGPK!z%__pycache__/py31compat.cpython-35.pycnu[

Rem@sddlZddlZddgZyddlmZmZWn4ek
rtddlmZmZddZYnXyddl	m
Z
Wn@ek
rddlZddl	Z	Gdd	d	eZ
YnXej
ZdejddkodknZerd
dZdS)Nget_config_varsget_path)rr)rget_python_libcCs(|dkrtdt|dkS)NplatlibpurelibzName must be purelib or platlib)rr)
ValueErrorr)namer	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/py31compat.pyrs)TemporaryDirectoryc@s:eZdZdZddZddZddZdS)	rz
        Very simple temporary directory context manager.
        Will try to delete afterward, but will also ignore OS and similar
        errors on deletion.
        cCsd|_tj|_dS)N)rtempfilemkdtemp)selfr	r	r
__init__ s	zTemporaryDirectory.__init__cCs|jS)N)r)rr	r	r
	__enter__$szTemporaryDirectory.__enter__cCs9ytj|jdWntk
r+YnXd|_dS)NT)shutilrmtreerOSError)rexctypeZexcvalueZexctracer	r	r
__exit__'s

zTemporaryDirectory.__exit__N)__name__
__module____qualname____doc__rrrr	r	r	r
rsrcOs9d|kr)|ddkr)tj|ds"

	)PK!`yy"__pycache__/version.cpython-35.pycnu[

Re@sAddlZyejdjZWnek
r<dZYnXdS)N
setuptoolsunknown)
pkg_resourcesget_distributionversion__version__	Exceptionr	r	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/version.pys
PK!cׇww%__pycache__/py26compat.cpython-35.pycnu[

Re@sdZddlZyddlmZWn"ek
rJddlmZYnXddZejd
krrdd	Zydd
lm	Z	Wnek
rddZ	YnXdS)z2
Compatibility Support for Python 2.6 and earlier
N)splittagcCst|\}}|S)z
    In `Python 8280 `_, Python 2.7 and
    later was patched to disregard the fragment when making URL requests.
    Do the same for Python 2.6 and earlier.
    )r)urlfragmentr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/py26compat.pystrip_fragment
srcCs|S)Nr)xrrrsr)
import_modulecCst|ddgS)Nfromlist__name__)
__import__)module_namerrrrsr)rr	)
__doc__sysurllib.parserImportErrorurllibrversion_info	importlibrrrrrs


PK!!__pycache__/launch.cpython-35.pycnu[

Re@sAdZddlZddlZddZedkr=edS)z[
Launch the Python script on the command line after
setuptools is bootstrapped via import.
NcCsttjd}td|dddd}tjddtjdds
PK!||w__pycache__/dist.cpython-35.pycnu[

Rep@s_dgZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
Z
ddlmZddl
mZmZmZddlmZddlmZddlmZmZmZddlmZdd	lmZdd
lmZddlm Z ddl!m"Z"ddl#Z#d
dl$m%Z%e&de&dddZ'ddZ(ddZ)e*e+fZ,ddZ-ddZ.ddZ/ddZ0dd Z1d!d"Z2d#d$Z3d%d&Z4d'd(Z5d)d*Z6d+d,Z7d-d.Z8e ej9j:Z;Gd/dde%e;Z:Gd0d1d1Z<dS)2DistributionN)defaultdict)DistutilsOptionErrorDistutilsPlatformErrorDistutilsSetupError)
rfc822_escape)six)mapfilterfilterfalse)	packaging)Require)windows_support)
get_unpatched)parse_configuration)Distribution_parse_config_filesz)pkg_resources.extern.packaging.specifiersz&pkg_resources.extern.packaging.versioncCstjdtt|S)NzDo not call this function)warningswarnDeprecationWarningr)clsr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/dist.py_get_unpatched!srcCsd}|js3|js3|js3|js3|jr9d}t|drNd}|jd||jd|j|jd|j|jd|j	|jd	|j
|jd
|j|jd|j|jd|j
|jr|jd
|jt|j}|jd|dj|j}|rl|jd||j|d|j|j|d|j|j|d|j|j|d|j|j|d|jt|dr|jd|jdS)z5Write the PKG-INFO format data to a file object.
    z1.0z1.1python_requiresz1.2zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
,z
Keywords: %s
Platform
ClassifierRequiresProvides	ObsoleteszRequires-Python: %s
N)providesrequires	obsoletesclassifiersdownload_urlhasattrwriteget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenserget_long_descriptionjoinget_keywords_write_list
get_platformsget_classifiersget_requiresget_provides
get_obsoletesr)selffileversion	long_desckeywordsrrrwrite_pkg_file's8	r=c	Cs?ttjj|dddd}|j|WdQRXdS)z3Write the PKG-INFO file into the release tree.
    zPKG-INFOwencodingzUTF-8N)openospathr0r=)r8base_dirpkg_inforrrwrite_pkg_infoRsrEcCsey*tjjd|}|js)tWn4ttttfk
r`td||fYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r))	
pkg_resources
EntryPointparseextrasAssertionError	TypeError
ValueErrorAttributeErrorr)distattrvalueeprrrcheck_importable]srRcCsZydj||kstWn4ttttfk
rUtd||fYnXdS)z*Verify that value is a string list or Nonez%%r must be a list of strings (got %r)N)r0rJrKrLrMr)rNrOrPrrrassert_string_lisths
rTcCs|}t|||xq|D]i}|j|sFtdd||jd\}}}|r||krtjjd||qWdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rThas_contents_forr
rpartition	distutilslogr)rNrOrPZns_packagesnspparentsepchildrrr	check_nsprs
	r^c
CsNy ttjt|jWn'tttfk
rItdYnXdS)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N)	list	itertoolsstarmap_check_extraitemsrKrLrMr)rNrOrPrrrcheck_extrass
 rdcCsT|jd\}}}|r=tj|r=td|ttj|dS)N:zInvalid environment marker: )	partitionrFinvalid_markerrr_parse_requirements)extrareqsnamer\markerrrrrbsrbcCs:t||kr6d}t|jd|d|dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r})rOrPN)boolrformat)rNrOrPtmplrrrassert_boolsrpcCsmyttj|WnOttfk
rh}z)d}t|jd|d|WYdd}~XnXdS)z9Verify that install_requires is a valid requirements listzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rOerrorN)r_rFrhrKrLrrn)rNrOrPrqrorrrcheck_requirementss
rrcCsjytjj|WnOtjjk
re}z)d}t|jd|d|WYdd}~XnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rOrqN)r
specifiersSpecifierSetInvalidSpecifierrrn)rNrOrPrqrorrrcheck_specifiers
rvcCsLytjj|Wn1tk
rG}zt|WYdd}~XnXdS)z)Verify that entry_points map is parseableN)rFrG	parse_maprLr)rNrOrPerrrcheck_entry_pointssrycCs"t|tjstddS)Nztest_suite must be a string)
isinstancerstring_typesr)rNrOrPrrrcheck_test_suitesr|cCsxt|trdxR|jD]@\}}t|ts8Pyt|Wqtk
r[PYqXqWdSt|ddS)z@Verify that value is a dictionary of package names to glob listsNzI must be a dictionary mapping package names to lists of wildcard patterns)rzdictrcstriterrKr)rNrOrPkvrrrcheck_package_datas

rcCs:x3|D]+}tjd|stjjd|qWdS)Nz\w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrXrYr)rNrOrPpkgnamerrrcheck_packagess

	rc@seZdZdZdZddZdddZddZd	d
Ze	ddZ
d
dZddZdddZ
ddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Z d9d:Z!d;d<Z"d=d>Z#d?d@Z$dAdBZ%dCdDZ&dS)EraDistribution with support for features, tests, and package data

    This is an enhanced version of 'distutils.dist.Distribution' that
    effectively adds the following new optional keyword arguments to 'setup()':

     'install_requires' -- a string or sequence of strings specifying project
        versions that the distribution requires when installed, in the format
        used by 'pkg_resources.require()'.  They will be installed
        automatically when the package is installed.  If you wish to use
        packages that are not available in PyPI, or want to give your users an
        alternate download location, you can add a 'find_links' option to the
        '[easy_install]' section of your project's 'setup.cfg' file, and then
        setuptools will scan the listed web pages for links that satisfy the
        requirements.

     'extras_require' -- a dictionary mapping names of optional "extras" to the
        additional requirement(s) that using those extras incurs. For example,
        this::

            extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])

        indicates that the distribution can optionally provide an extra
        capability called "reST", but it can only be used if docutils and
        reSTedit are installed.  If the user installs your package using
        EasyInstall and requests one of your extras, the corresponding
        additional requirements will be installed if needed.

     'features' **deprecated** -- a dictionary mapping option names to
        'setuptools.Feature'
        objects.  Features are a portion of the distribution that can be
        included or excluded based on user options, inter-feature dependencies,
        and availability on the current system.  Excluded features are omitted
        from all setup commands, including source and binary distributions, so
        you can create multiple distributions from the same source tree.
        Feature names should be valid Python identifiers, except that they may
        contain the '-' (minus) sign.  Features can be included or excluded
        via the command line options '--with-X' and '--without-X', where 'X' is
        the name of the feature.  Whether a feature is included by default, and
        whether you are allowed to control this from the command line, is
        determined by the Feature object.  See the 'Feature' class for more
        information.

     'test_suite' -- the name of a test suite to run for the 'test' command.
        If the user runs 'python setup.py test', the package will be installed,
        and the named test suite will be run.  The format is the same as
        would be used on a 'unittest.py' command line.  That is, it is the
        dotted name of an object to import and call to generate a test suite.

     'package_data' -- a dictionary mapping package names to lists of filenames
        or globs to use to find data files contained in the named packages.
        If the dictionary has filenames or globs listed under '""' (the empty
        string), those names will be searched for in every package, in addition
        to any names for the specific package.  Data files found using these
        names/globs will be installed along with the package, in the same
        location as the package.  Note that globs are allowed to reference
        the contents of non-package subdirectories, as long as you use '/' as
        a path separator.  (Globs are automatically converted to
        platform-specific paths at runtime.)

    In addition to these new keywords, this class also has several new methods
    for manipulating the distribution's contents.  For example, the 'include()'
    and 'exclude()' methods can be thought of as in-place add and subtract
    commands that add or remove packages, modules, extensions, and so on from
    the distribution.  They are used by the feature subsystem to configure the
    distribution for the included and excluded features.
    NcCs|sd|ksd|kr#dStjt|dj}tjjj|}|dk	r|jdrtjt|d|_	||_
dS)Nrkr:zPKG-INFO)rF	safe_namer~lowerworking_setby_keygethas_metadatasafe_version_version
_patched_dist)r8attrskeyrNrrrpatch_missing_pkg_info'sz#Distribution.patch_missing_pkg_infocCst|d}|si|_|p'i}d|ksBd|krLtjg|_i|_g|_|o||jdd|_|j	||dk	r|jdg|_
t|d|j
|rd|kr|j|dx0t
jdD]}t|j|jdqWtj||t|jjtjrYt|jj|j_|jjdk	ryctjj|jj}t|}|jj|krtjd|jj|f||j_Wn5tjjtfk
rtjd	|jjYnX|j dS)
Npackage_datafeaturesrequire_featuressrc_rootdependency_linksZsetup_requireszdistutils.setup_keywordszNormalizing '%s' to '%s'zThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)!r&rFeaturewarn_deprecatedrr
dist_filespoprrrrTfetch_build_eggsrFiter_entry_pointsvars
setdefaultrk
_Distribution__init__rzmetadatar:numbersNumberr~rVersionrrInvalidVersionrK_finalize_requires)r8rZhave_package_dataZ_attrs_dictrQverZnormalized_versionrrrr4sH	
			
	zDistribution.__init__cCs9t|ddr!|j|j_|j|jdS)z
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rN)getattrrr_convert_extras_requirements"_move_install_requirements_markers)r8rrrrbs
zDistribution._finalize_requirescCst|ddpi}tt|_xf|jD]X\}}|j|x>tj|D]-}|j|}|j||j|q[Wq4WdS)z
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        extras_requireN)	rrr__tmp_extras_requirercrFrh_suffix_forappend)r8Z
spec_ext_reqssectionrrsuffixrrrrlsz)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        rerS)rlr~)reqrrrr{szDistribution._suffix_forcsdd}tddp!f}ttj|}t||}t||}ttt|_x/|D]'}j	dt|j
j|qvWtfddj	j
D_dS)zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jS)N)rl)rrrr
is_simple_reqszFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrec3s:|]0\}}|ddtj|DfVqdS)cSsg|]}t|qSr)r~).0rrrr
s	zMDistribution._move_install_requirements_markers...N)r	
_clean_req)rrr)r8rr	szBDistribution._move_install_requirements_markers..)rr_rFrhr
rr	r~rrrlrr}rcr)r8rZspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsrr)r8rrs

%z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        N)rl)r8rrrrrs	zDistribution._clean_reqcCs1tj|d|t||j|jdS)zYParses configuration files from various levels
        and loads configuration.

        	filenamesN)rparse_config_filesrcommand_optionsr)r8rrrrrszDistribution.parse_config_filescCs&tj|}|jr"|j|S)z3Process features after parsing command line options)rparse_command_liner_finalize_features)r8resultrrrrs	
zDistribution.parse_command_linecCsd|jddS)z;Convert feature name to corresponding option attribute nameZwith_-_)replace)r8rkrrr_feature_attrnameszDistribution._feature_attrnamecCsUtjjtj|d|jdd}x$|D]}tjj|ddq1W|S)zResolve pre-setup requirements	installerreplace_conflictingTr)rFrresolverhfetch_build_eggadd)r8r"Zresolved_distsrNrrrrs			
zDistribution.fetch_build_eggscCstj||jr |jxdtjdD]S}t||jd}|dk	r0|jd|j	|j
||j|q0Wt|ddrdd|jD|_n	g|_dS)Nzdistutils.setup_keywordsrconvert_2to3_doctestscSs"g|]}tjj|qSr)rArBabspath)rprrrrs	z1Distribution.finalize_options..)rfinalize_optionsr_set_global_opts_from_featuresrFrrrkrequirerloadr)r8rQrPrrrrs
	
	zDistribution.finalize_optionsc	Cstjjtjd}tjj|stj|tj|tjj|d}t|d.}|j	d|j	d|j	dWdQRX|S)Nz.eggsz
README.txtr>zcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

zAThis directory caches those eggs to prevent repeated downloads.

z/However, it is safe to delete this directory.

)
rArBr0curdirexistsmkdirrZ	hide_filer@r')r8Z
egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirs



zDistribution.get_egg_cache_dirc
Csfy|j}g|j_Wn=tk
rXddlm}|jddgi}|j|jd}d}x't	|D]}||kr}||=q}W|j
r|j
d
d
}d|kr|ddj|}d|f|d<|j}	||d
dgd|	dddddd
dddddddddd
}|j
||_YnX|j|S)z Fetch an egg needed for buildingr)easy_installscript_argsr
find_links	site_dirs	index_urloptimizeallow_hostsNrsetupargsxinstall_dirZexclude_scriptsTZalways_copyFZbuild_directoryeditableupgradeZ
multi_versionZ	no_reportuser)rrrrrr)Z_egg_fetcherZ
package_indexZto_scanrMZsetuptools.command.easy_installr	__class__rget_option_dictr_rsplitrensure_finalized)
r8rcmdrrNoptsZkeeprlinksrrrrrs6	

	
zDistribution.fetch_build_eggc	Cs	g}|jj}x|jjD]\}}|j|d|j||jr%|j}d}d}|js||}}d|dd||fd|dd||ff}|j	|d||d|.cs2g|](}|kr|jr|qSr)r)rr)rrrrrs	cs8g|].}|jkr|jjr|qSr)rkr)rr)rrrrrs	N)packages
py_modulesext_modules)r8rr)rrrexclude_packagezs
	"	"	zDistribution.exclude_packagecCsD|d}x3|jD]%}||ks8|j|rdSqWdS)z.)rzsequencerrrMr)r8rkrPoldr)rPr
_exclude_miscs
zDistribution._exclude_miscc
st|ts%td||fyt||Wn"tk
r\td|YnXdkr|t|||nOttst|dn-fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecs"g|]}|kr|qSrr)rr)rrrrs	z.Distribution._include_misc..)rzr
rrrMr)r8rkrPrr)rrrs
zDistribution._include_misccKsZxS|jD]E\}}t|d|d}|rB||q
|j||q
WdS)aRemove items from distribution that are named in keyword arguments

        For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
        the distribution's 'py_modules' attribute.  Excluding packages uses
        the 'exclude_package()' method, so all of the package's contained
        packages, modules, and extensions are also excluded.

        Currently, this method only supports exclusion from attributes that are
        lists or tuples.  If you need to add support for excluding from other
        attributes in this or a subclass, you can add an '_exclude_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'exclude()'.  So, 'dist.exclude(foo={"bar":"baz"})'
        will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
        handle whatever special exclusion logic is needed.
        Z	_exclude_N)rcrr)r8rrrexcluderrrrs

zDistribution.excludecCs<t|ts"td|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rzr
rr_r	r
)r8rrrr_exclude_packagesszDistribution._exclude_packagesc
Cs|jj|_|jj|_|d}|jd}xY||kr||\}}||=ddl}|j|d|dd<|d}q:Wtj|||}|j|}	t	|	ddrd|f|j|d<|dk	rgS|S)NraliasesTrZcommand_consumes_argumentszcommand liner)
rrrrshlexrr_parse_command_optsrr)
r8parserrrrsrcaliasrnargs	cmd_classrrrrs"
z Distribution._parse_command_optscCsi}x|jjD]\}}x|jD]\}\}}|dkrPq/|jdd}|dkr|j|}|jj}|jt|dixT|jD]%\}	}
|
|kr|	}d}PqWtdn|dkrd}||j	|i|`_ and will be removed in
    a future version.

    A subset of the distribution that can be excluded if unneeded/wanted

    Features are created using these keyword arguments:

      'description' -- a short, human readable description of the feature, to
         be used in error messages, and option help messages.

      'standard' -- if true, the feature is included by default if it is
         available on the current system.  Otherwise, the feature is only
         included if requested via a command line '--with-X' option, or if
         another included feature requires it.  The default setting is 'False'.

      'available' -- if true, the feature is available for installation on the
         current system.  The default setting is 'True'.

      'optional' -- if true, the feature's inclusion can be controlled from the
         command line, using the '--with-X' or '--without-X' options.  If
         false, the feature's inclusion status is determined automatically,
         based on 'availabile', 'standard', and whether any other feature
         requires it.  The default setting is 'True'.

      'require_features' -- a string or sequence of strings naming features
         that should also be included if this feature is included.  Defaults to
         empty list.  May also contain 'Require' objects that should be
         added/removed from the distribution.

      'remove' -- a string or list of strings naming packages to be removed
         from the distribution if this feature is *not* included.  If the
         feature *is* included, this argument is ignored.  This argument exists
         to support removing features that "crosscut" a distribution, such as
         defining a 'tests' feature that removes all the 'tests' subpackages
         provided by other features.  The default for this argument is an empty
         list.  (Note: the named package(s) or modules must exist in the base
         distribution when the 'setup()' function is initially called.)

      other keywords -- any other keyword arguments are saved, and passed to
         the distribution's 'include()' and 'exclude()' methods when the
         feature is included or excluded, respectively.  So, for example, you
         could pass 'packages=["a","b"]' to cause packages 'a' and 'b' to be
         added or removed from the distribution as appropriate.

    A feature must include at least one 'requires', 'remove', or other
    keyword argument.  Otherwise, it can't affect the distribution in any way.
    Note also that you can subclass 'Feature' to create your own specialized
    feature types that modify the distribution in other ways when included or
    excluded.  See the docstrings for the various methods here for more detail.
    Aside from the methods, the only feature attributes that distributions look
    at are 'description' and 'optional'.
    cCs d}tj|tdddS)NzrFeatures are deprecated and will be removed in a future version. See https://github.com/pypa/setuptools/issues/65.
stacklevel)rrr)msgrrrrszFeature.warn_deprecatedFTc	Ks|j||_||_||_||_t|ttfrL|f}dd|D|_dd|D}|r||d.cSs%g|]}t|ts|qSr)rzr~)rrrrrrs	rzgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.)rrstandard	availablerrzr~r
rremoverIr)	r8rrBrCrrrDrIZerrrrrs$
					
			zFeature.__init__cCs|jo|jS)z+Should this feature be included by default?)rCrB)r8rrrrszFeature.include_by_defaultcCsQ|jst|jd|j|jx|jD]}|j|q6WdS)aEnsure feature and its requirements are included in distribution

        You may override this in a subclass to perform additional operations on
        the distribution.  Note that this method may be called more than once
        per feature, and so should be idempotent.

        z3 is required, but is not available on this platformN)rCrrrrIrr)r8rNrrrrrs		zFeature.include_incCs>|j|j|jr:x|jD]}|j|q#WdS)a2Ensure feature is excluded from distribution

        You may override this in a subclass to perform additional operations on
        the distribution.  This method will be called at most once per
        feature, and only after all included features have been asked to
        include themselves.
        N)rrIrDr
)r8rNrrrrrs		zFeature.exclude_fromcCsCx<|jD]1}|j|s
td|j||fq
WdS)aVerify that feature makes sense in context of distribution

        This method is called by the distribution just before it parses its
        command line.  It checks to ensure that the 'remove' attribute, if any,
        contains only valid package/module names that are present in the base
        distribution when 'setup()' is called.  You may override it in a
        subclass to perform any other required validation of the feature
        against a target distribution.
        zg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN)rDrVrr)r8rNrrrrrs
zFeature.validateN)r:r;r<r=r>rrrrrrrrrrrYs7	r)=__all__rrArrZ
distutils.logrXdistutils.core
distutils.cmddistutils.distr`collectionsrdistutils.errorsrrrdistutils.utilrZsetuptools.externrZsetuptools.extern.six.movesr	r
rZpkg_resources.externrZsetuptools.dependsr

setuptoolsrZsetuptools.monkeyrZsetuptools.configrrFZ
py36compatr
__import__rr=rEr%r_r
rRrTr^rdrbrprrrvryr|rrcorerrrrrrrsX	

+
	zPK!eLL__pycache__/msvc.cpython-35.pycnu[

Re@sdZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZej
dkrddl	mZejZnGd	d
d
ZeZeejjfZyddlmZWnek
rYnXdd
ZdddZddZddZdddZGdddZGdddZGdddZGdddZ dS) a@
Improved support for Microsoft Visual C++ compilers.

Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
    Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
    Microsoft Windows SDK 6.1 (x86, x64, ia64)
    Microsoft Windows SDK 7.0 (x86, x64, ia64)

Microsoft Visual C++ 10.0:
    Microsoft Windows SDK 7.1 (x86, x64, ia64)

Microsoft Visual C++ 14.0:
    Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
    Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
    Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
N)
LegacyVersion)filterfalse)
get_unpatchedWindows)winregc@s(eZdZdZdZdZdZdS)rN)__name__
__module____qualname__
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/msvc.pyr(sr)RegcCsd}|d|f}ytj|d}WnStk
ry&|d|f}tj|d}Wntk
r|d}YnXYnX|rtjjjj|d}tjj|r|Stt|S)a+
    Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
    compiler build for Python (VCForPython). Fall back to original behavior
    when the standalone compiler is not available.

    Redirect the path of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 9.0:
        Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)

    Parameters
    ----------
    version: float
        Required Microsoft Visual C++ version.

    Return
    ------
    vcvarsall.bat path: str
    z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f
installdirzWow6432Node\Nz
vcvarsall.bat)	r	get_valueKeyErrorospathjoinisfilermsvc9_find_vcvarsall)versionZVC_BASEkey
productdir	vcvarsallrrrr?s

rx86cOsy#tt}|||||SWn)tjjk
r=Yntk
rNYnXyt||jSWn>tjjk
r}zt|||WYdd}~XnXdS)a
    Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
    compilers.

    Set environment without use of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 9.0:
        Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
        Microsoft Windows SDK 6.1 (x86, x64, ia64)
        Microsoft Windows SDK 7.0 (x86, x64, ia64)

    Microsoft Visual C++ 10.0:
        Microsoft Windows SDK 7.1 (x86, x64, ia64)

    Parameters
    ----------
    ver: float
        Required Microsoft Visual C++ version.
    arch: str
        Target architecture.

    Return
    ------
    environment: dict
    N)	rmsvc9_query_vcvarsall	distutilserrorsDistutilsPlatformError
ValueErrorEnvironmentInfo
return_env_augment_exception)verarchargskwargsorigexcrrrr js
r cCsytt|SWntjjk
r.YnXyt|ddjSWn;tjjk
r}zt|dWYdd}~XnXdS)a'
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    compilers.

    Set environment without use of "vcvarsall.bat".

    Known supported compilers
    -------------------------
    Microsoft Visual C++ 14.0:
        Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
        Microsoft Visual Studio 2017 (x86, x64, arm, arm64)
        Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)

    Parameters
    ----------
    plat_spec: str
        Target architecture.

    Return
    ------
    environment: dict
    
vc_min_verg,@N)rmsvc14_get_vc_envr!r"r#r%r&r')Z	plat_specr-rrrr/s
r/cOs_dtjkrLddl}t|jtdkrL|jjj||Stt	||S)z
    Patched "distutils._msvccompiler.gen_lib_options" for fix
    compatibility between "numpy.distutils" and "distutils._msvccompiler"
    (for Numpy < 1.11.2)
    znumpy.distutilsrNz1.11.2)
sysmodulesnumpyr__version__r!Z	ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r*r+nprrrr4s
r4rcCs|jd}d|jks1d|jkrd}|jt}d}|dkr|jjddkr|d	7}||d
7}q|d7}n=|dkr|d
7}||d7}n|dkr|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rrzvisual cz0Microsoft Visual C++ {version:0.1f} is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rz* Get it with "Microsoft Windows SDK 7.0": iBz% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zj Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-toolsN)r*lowerformatlocalsfind)r-rr)messagetmplZ
msdownloadrrrr's 
$



r'c@seZdZdZejddjZddZe	ddZ
dd	Zd
dZddd
dZ
ddddZdddZdS)PlatformInfoz
    Current and Target Architectures informations.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturercCs|jjdd|_dS)Nx64amd64)r7replacer))selfr)rrr__init__szPlatformInfo.__init__cCs!|j|jjdddS)N_r)r)r:)rArrr
target_cpuszPlatformInfo.target_cpucCs
|jdkS)Nr)rD)rArrr
target_is_x86szPlatformInfo.target_is_x86cCs
|jdkS)Nr)current_cpu)rArrrcurrent_is_x86szPlatformInfo.current_is_x86FcCs=|jdkr|rdS|jdkr2|r2dSd|jS)uk
        Current platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '†' if architecture is x86.
        x64: bool
            return 'd' and not 'md64' if architecture is amd64.

        Return
        ------
        subfolder: str
            '	arget', or '' (see hidex86 parameter)
        rrr?z\x64z\%s)rF)rAhidex86r>rrrcurrent_dir	szPlatformInfo.current_dircCs=|jdkr|rdS|jdkr2|r2dSd|jS)ar
        Target platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '\x86' if architecture is x86.
        x64: bool
            return '\x64' and not '\amd64' if architecture is amd64.

        Return
        ------
        subfolder: str
            '\current', or '' (see hidex86 parameter)
        rrr?z\x64z\%s)rD)rArHr>rrr
target_dirszPlatformInfo.target_dircCsB|rdn|j}|j|kr(dS|jjdd|S)ao
        Cross platform specific subfolder.

        Parameters
        ----------
        forcex86: bool
            Use 'x86' as current architecture even if current acritecture is
            not x86.

        Return
        ------
        subfolder: str
            '' if target architecture is current architecture,
            '\current_target' if not.
        rr\z\%s_)rFrDrJr@)rAforcex86currentrrr	cross_dir5szPlatformInfo.cross_dirN)rr	r
__doc__safe_envgetr7rFrBpropertyrDrErGrIrJrNrrrrr=sr=c@seZdZdZejejejejfZ	ddZ
eddZeddZ
edd	Zed
dZedd
ZeddZeddZeddZeddZdddZddZdS)RegistryInfoz
    Microsoft Visual Studio related registry informations.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dS)N)pi)rAZ
platform_inforrrrBZszRegistryInfo.__init__cCsdS)z<
        Microsoft Visual Studio root registry key.
        ZVisualStudior)rArrrvisualstudio]szRegistryInfo.visualstudiocCstjj|jdS)z;
        Microsoft Visual Studio SxS registry key.
        ZSxS)rrrrU)rArrrsxsdszRegistryInfo.sxscCstjj|jdS)z8
        Microsoft Visual C++ VC7 registry key.
        ZVC7)rrrrV)rArrrvckszRegistryInfo.vccCstjj|jdS)z;
        Microsoft Visual Studio VS7 registry key.
        ZVS7)rrrrV)rArrrvsrszRegistryInfo.vscCsdS)z?
        Microsoft Visual C++ for Python registry key.
        zDevDiv\VCForPythonr)rArrr
vc_for_pythonyszRegistryInfo.vc_for_pythoncCsdS)z-
        Microsoft SDK registry key.
        zMicrosoft SDKsr)rArrr
microsoft_sdkszRegistryInfo.microsoft_sdkcCstjj|jdS)z>
        Microsoft Windows/Platform SDK registry key.
        r)rrrrZ)rArrrwindows_sdkszRegistryInfo.windows_sdkcCstjj|jdS)z<
        Microsoft .NET Framework SDK registry key.
        ZNETFXSDK)rrrrZ)rArrr	netfx_sdkszRegistryInfo.netfx_sdkcCsdS)z<
        Microsoft Windows Kits Roots registry key.
        zWindows Kits\Installed Rootsr)rArrrwindows_kits_rootsszRegistryInfo.windows_kits_rootsFcCs:|jjs|rdnd}tjjd|d|S)a

        Return key in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        x86: str
            Force x86 software registry.

        Return
        ------
        str: value
        rZWow6432NodeZSoftware	Microsoft)rTrGrrr)rArrZnode64rrr	microsofts!zRegistryInfo.microsoftcCstj}tj}|j}x|jD]}y||||d|}Wnmttfk
r|jjsy"||||dd|}Wqttfk
rw%YqXnw%YnXytj	||dSWq%ttfk
rYq%Xq%WdS)a
        Look for values in registry in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        name: str
            Value name to find.

        Return
        ------
        str: value
        rTN)
rKEY_READOpenKeyr_HKEYSOSErrorIOErrorrTrGQueryValueEx)rArnamer`Zopenkeymshkeybkeyrrrlookups"			"zRegistryInfo.lookupN)rr	r
rOrrrr
rrbrBrRrUrVrWrXrYrZr[r\r]r_rjrrrrrSLs"rSc@seZdZdZejddZejddZejdeZdddZ	d	d
Z
ddZed
dZ
eddZddZddZeddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zd/d0Zdd1d2ZdS)3
SystemInfoz
    Microsoft Windows and Visual Studio related system inormations.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    WinDirrProgramFileszProgramFiles(x86)NcCs1||_|jj|_|p'|j|_dS)N)rirT_find_latest_available_vc_vervc_ver)rAZ
registry_inforprrrrBs	zSystemInfo.__init__cCsCy|jdSWn*tk
r>d}tjj|YnXdS)Nrz%No Microsoft Visual C++ version foundr6)find_available_vc_vers
IndexErrorr!r"r#)rAerrrrrros

z(SystemInfo._find_latest_available_vc_vercCs|jj}|jj|jj|jjf}g}xF|jjD]8}x/|D]'}y%tj|||dtj}Wnt	t
fk
rwMYnXtj|\}}}	xbt|D]T}
y9t
tj||
d}||kr|j|Wqtk
rYqXqWx^t|D]P}
y5t
tj||
}||krZ|j|Wq tk
roYq Xq WqMWq@Wt|S)zC
        Find all available Microsoft Visual C++ versions.
        r)rnr_rWrYrXrbrrar`rcrdZQueryInfoKeyrangefloatZ	EnumValueappendr$EnumKeysorted)rArgZvckeysZvc_versrhrriZsubkeysvaluesrCir(rrrrqs2!
%
	
z!SystemInfo.find_available_vc_verscCsKd|j}tjj|j|}|jj|jjd|jpJ|S)z4
        Microsoft Visual Studio directory.
        zMicrosoft Visual Studio %0.1fz%0.1f)rprrrProgramFilesx86rnrjrX)rArfdefaultrrrVSInstallDir
s
zSystemInfo.VSInstallDircCs|j|jp|j}tjj|jjd|j}|jj	|d}|rqtjj|dn|}|jj	|jj
d|jp|}tjj|sd}tj
j||S)z1
        Microsoft Visual C++ directory.
        z%0.1frZVCz(Microsoft Visual C++ directory not found)r}	_guess_vc_guess_vc_legacyrrrrnrYrprjrWisdirr!r"r#)rAguess_vcZreg_pathZ	python_vcZ
default_vcrmsgrrrVCInstallDirs"!(zSystemInfo.VCInstallDirc
Cs}|jdkrdSd}tjj|j|}y*tj|d}tjj||SWntttfk
rxYnXdS)z*
        Locate Visual C for 2017
        g,@Nz
VC\Tools\MSVCrr6)	rprrrr}listdirrcrdrr)rAr|rZvc_exact_verrrrr~0szSystemInfo._guess_vccCs#d|j}tjj|j|S)z<
        Locate Visual C for versions prior to 2017
        z Microsoft Visual Studio %0.1f\VC)rprrrr{)rAr|rrrr@s
zSystemInfo._guess_vc_legacycCsc|jdkrdS|jdkr&dS|jdkr9dS|jdkrLdS|jdkr_dSdS)zN
        Microsoft Windows SDK versions for specified MSVC++ version.
        g"@7.06.16.0ag$@7.17.0ag&@8.08.0ag(@8.18.1ag,@10.0N)rrr)rr)rr)rr)rr)rp)rArrrWindowsSdkVersionGszSystemInfo.WindowsSdkVersioncCs|jtjj|jdS)z4
        Microsoft Windows SDK last version
        lib)_use_last_dir_namerrr
WindowsSdkDir)rArrrWindowsSdkLastVersionWsz SystemInfo.WindowsSdkLastVersioncCsd}xL|jD]A}tjj|jjd|}|jj|d}|rPqW|sotjj|rtjj|jjd|j	}|jj|d}|rtjj|d}|stjj|rBxd|jD]Y}|d|j
d}d	|}tjj|j|}tjj|r|}qW|s\tjj|rxK|jD]@}d
|}tjj|j|}tjj|rf|}qfW|stjj|jd}|S)z2
        Microsoft Windows SDK directory.
        rzv%sinstallationfolderz%0.1frZWinSDKN.zMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)
rrrrrnr[rjrrYrprfindrmr)rAsdkdirr(locrinstall_baseZintverdrrrr_s6"



zSystemInfo.WindowsSdkDirc	Cs2|jdkrd}d}n<d}|jdkr9dnd}|jjddd	|}d
||jddf}g}|jd
krx6|jD]+}|tjj|jj	||g7}qWx:|j
D]/}|tjj|jjd||g7}qWx*|D]"}|jj|d}|rPqW|S)z=
        Microsoft Windows SDK executable directory.
        g&@#r(g(@TFr>rHzWinSDK-NetFx%dTools%srK-g,@zv%sAr)
rprTrIr@NetFxSdkVersionrrrrnr\rr[rj)	rAZnetfxverr)rHZfxZregpathsr(rZexecpathrrrWindowsSDKExecutablePaths$	)-
z#SystemInfo.WindowsSDKExecutablePathcCsAd|j}tjj|jj|}|jj|dp@dS)z0
        Microsoft Visual F# directory.
        z%0.1f\Setup\F#rr)rprrrrnrUrj)rArrrrFSharpInstallDirs
zSystemInfo.FSharpInstallDircCs_|jdkrd}nf}x4|D],}|jj|jjd|}|r%Pq%W|p^dS)z8
        Microsoft Universal CRT SDK directory.
        g,@1081z
kitsroot%sr)rr)rprnrjr])rAversr(rrrrUniversalCRTSdkDirs	

zSystemInfo.UniversalCRTSdkDircCs|jtjj|jdS)z@
        Microsoft Universal C Runtime SDK last version
        r)rrrrr)rArrrUniversalCRTSdkLastVersionsz%SystemInfo.UniversalCRTSdkLastVersioncCs|jdkrdSfSdS)z8
        Microsoft .NET Framework SDK versions.
        g,@4.6.14.6N)rr)rp)rArrrrszSystemInfo.NetFxSdkVersioncCsUxH|jD]=}tjj|jj|}|jj|d}|r
Pq
W|pTdS)z9
        Microsoft .NET Framework SDK directory.
        Zkitsinstallationfolderr)rrrrrnr\rj)rAr(rrrrrNetFxSdkDirszSystemInfo.NetFxSdkDircCs7tjj|jd}|jj|jjdp6|S)z;
        Microsoft .NET Framework 32bit directory.
        zMicrosoft.NET\FrameworkZframeworkdir32)rrrrlrnrjrW)rAguess_fwrrrFrameworkDir32szSystemInfo.FrameworkDir32cCs7tjj|jd}|jj|jjdp6|S)z;
        Microsoft .NET Framework 64bit directory.
        zMicrosoft.NET\Framework64Zframeworkdir64)rrrrlrnrjrW)rArrrrFrameworkDir64szSystemInfo.FrameworkDir64cCs
|jdS)z:
        Microsoft .NET Framework 32bit versions.
         )_find_dot_net_versions)rArrrFrameworkVersion32szSystemInfo.FrameworkVersion32cCs
|jdS)z:
        Microsoft .NET Framework 64bit versions.
        @)r)rArrrFrameworkVersion64szSystemInfo.FrameworkVersion64cCs|jj|jjd|}t|d|}|pM|j|dpMd}|jdkrn|df}nU|jdkr|jdd	d
krdn|df}n|jd
krd}|jdkrd}|S)z
        Find Microsoft .NET Framework versions.

        Parameters
        ----------
        bits: int
            Platform number of bits: 32 or 64.
        zframeworkver%dzFrameworkDir%dvrg(@zv4.0g$@NZv4z
v4.0.30319v3.5g"@
v2.0.50727g @v3.0)rr)rr)rnrjrWgetattrrrpr7)rAbitsZreg_verZdot_net_dirr(Zframeworkverrrrrs
%z!SystemInfo._find_dot_net_versionscs>fddttjD}t|dp=dS)z
        Return name of the last dir in path or '' if no dir found.

        Parameters
        ----------
        path: str
            Use dirs in this path
        prefix: str
            Use only dirs startings by this prefix
        c3sE|];}tjjtjj|r|jr|VqdS)N)rrrr
startswith).0dir_name)rprefixrr	)s!z0SystemInfo._use_last_dir_name..Nr)reversedrrnext)rArrZ
matching_dirsr)rrrrszSystemInfo._use_last_dir_name) rr	r
rOrPrQrlrmr{rBrorqrRr}rr~rrrrrrrrrrrrrrrrrrrrrks4
&	rkc@seZdZdZddddZeddZedd	Zed
dZedd
Z	eddZ
eddZeddZeddZ
eddZeddZddZeddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zd6d7d8Zd9d:Zdd;d<Z dS)=r%aY
    Return environment variables for specified Microsoft Visual C++ version
    and platform : Lib, Include, Path and libpath.

    This function is compatible with Microsoft Visual C++ 9.0 to 14.0.

    Script created by analysing Microsoft environment configuration files like
    "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ...

    Parameters
    ----------
    arch: str
        Target architecture.
    vc_ver: float
        Required Microsoft Visual C++ version. If not set, autodetect the last
        version.
    vc_min_ver: float
        Minimum Microsoft Visual C++ version.
    NrcCsat||_t|j|_t|j||_|j|kr]d}tjj	|dS)Nz.No suitable Microsoft Visual C++ version found)
r=rTrSrnrksirpr!r"r#)rAr)rpr.rsrrrrBIszEnvironmentInfo.__init__cCs
|jjS)z/
        Microsoft Visual C++ version.
        )rrp)rArrrrpRszEnvironmentInfo.vc_vercsxddg}jdkrajjdddd}|dg7}|dg7}|d	|g7}fd
d|DS)z/
        Microsoft Visual Studio Tools
        zCommon7\IDEz
Common7\Toolsg,@rHTr>z1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scs+g|]!}tjjjj|qSr)rrrrr})rr)rArr
fs	z+EnvironmentInfo.VSTools..)rprTrI)rApathsarch_subdirr)rArVSToolsYs

zEnvironmentInfo.VSToolscCs4tjj|jjdtjj|jjdgS)zL
        Microsoft Visual C++ & Microsoft Foundation Class Includes
        IncludezATLMFC\Include)rrrrr)rArrr
VCIncludeshszEnvironmentInfo.VCIncludescsjdkr'jjdd}njjdd}d|d|g}jdkrp|d|g7}fd	d
|DS)zM
        Microsoft Visual C++ & Microsoft Foundation Class Libraries
        g.@r>TrHzLib%szATLMFC\Lib%sg,@zLib\store%scs+g|]!}tjjjj|qSr)rrrrr)rr)rArrr~s	z/EnvironmentInfo.VCLibraries..)rprTrJ)rArrr)rArVCLibrariespszEnvironmentInfo.VCLibrariescCs/|jdkrgStjj|jjdgS)zA
        Microsoft Visual C++ store references Libraries
        g,@zLib\store\references)rprrrrr)rArrrVCStoreRefsszEnvironmentInfo.VCStoreRefscCs|j}tjj|jdg}|jdkr9dnd}|jj|}|rz|tjj|jd|g7}|jdkrd|jjdd}|tjj|j|g7}n|jdkrm|jj	rd	nd
}|tjj|j||jj
ddg7}|jj|jjkr|tjj|j||jjddg7}n|tjj|jdg7}|S)
z,
        Microsoft Visual C++ Tools
        Z
VCPackagesg$@TFzBin%sg,@rHg.@z
bin\HostX86%sz
bin\HostX64%sr>Bin)
rrrrrrprTrNrIrGrJrFrD)rArtoolsrLrrZhost_dirrrrVCToolss&	#"&)zEnvironmentInfo.VCToolscCs|jdkrJ|jjdddd}tjj|jjd|gS|jjdd}tjj|jjd}|j}tjj|d||fgSdS)	z1
        Microsoft Windows SDK Libraries
        g$@rHTr>zLib%srz%sum%sN)	rprTrJrrrrr_sdk_subdir)rArrZlibverrrrOSLibrariess 	zEnvironmentInfo.OSLibrariescCstjj|jjd}|jdkrC|tjj|dgS|jdkr^|j}nd}tjj|d|tjj|d|tjj|d|gSd	S)
z/
        Microsoft Windows SDK Include
        includeg$@glg,@rz%ssharedz%sumz%swinrtN)rrrrrrpr)rArsdkverrrr
OSIncludesszEnvironmentInfo.OSIncludescCs
tjj|jjd}g}|jdkr=||j7}|jdkrh|tjj|dg7}|jdkr	||tjj|jjdtjj|ddtjj|d	dtjj|d
dtjj|jjddd
|jdddg7}|S)z7
        Microsoft Windows SDK Libraries Paths
        Z
Referencesg"@g&@zCommonConfiguration\Neutralg,@Z
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrrrrrpr)rAreflibpathrrr	OSLibpaths>
					

zEnvironmentInfo.OSLibpathcCst|jS)z-
        Microsoft Windows SDK Tools
        )list
_sdk_tools)rArrrSdkToolsszEnvironmentInfo.SdkToolsccs|jdkrD|jdkr$dnd}tjj|jj|V|jjs|jjdd}d|}tjj|jj|V|jdks|jdkr|jj	rd	}n|jjd
ddd}d|}tjj|jj|Vni|jdkrmtjj|jjd}|jjdd}|jj
}tjj|d||fV|jjr|jjVd
S)z=
        Microsoft Windows SDK Tools paths generator
        g.@g&@rzBin\x86r>TzBin%sg$@rrHzBin\NETFX 4.0 Tools%sz%s%sN)rprrrrrrTrGrIrErr)rAbin_dirrrrrrrrs(
	
zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)z6
        Microsoft Windows SDK version subdir
        z%s\r)rr)rAucrtverrrrrszEnvironmentInfo._sdk_subdircCs/|jdkrgStjj|jjdgS)z-
        Microsoft Windows SDK Setup
        g"@ZSetup)rprrrrr)rArrrSdkSetup%szEnvironmentInfo.SdkSetupcs|j}|j|jdkrDd}|jo>|j}n6|jpY|j}|jdkpw|jdk}g}|r|fddjD7}|r|fddjD7}|S)z0
        Microsoft .NET Framework Tools
        g$@Tr?cs(g|]}tjjj|qSr)rrrr)rr()rrrr@s	z+EnvironmentInfo.FxTools..cs(g|]}tjjj|qSr)rrrr)rr()rrrrCs	)	rTrrprErGrFrDrr)rArTZ	include32Z	include64rr)rrFxTools/s		zEnvironmentInfo.FxToolscCsU|jdks|jjr gS|jjdd}tjj|jjd|gS)z8
        Microsoft .Net Framework SDK Libraries
        g,@r>Tzlib\um%s)rprrrTrJrrr)rArrrrNetFxSDKLibrariesGsz!EnvironmentInfo.NetFxSDKLibrariescCs<|jdks|jjr gStjj|jjdgS)z7
        Microsoft .Net Framework SDK Includes
        g,@z
include\um)rprrrrr)rArrrNetFxSDKIncludesRsz EnvironmentInfo.NetFxSDKIncludescCstjj|jjdgS)z>
        Microsoft Visual Studio Team System Database
        z
VSTSDB\Deploy)rrrrr})rArrrVsTDb\szEnvironmentInfo.VsTDbcCs|jdkrgS|jdkrF|jj}|jjdd}n|jj}d}d|j|f}tjj||g}|jdkr|tjj||dg7}|S)z(
        Microsoft Build Engine
        g(@g.@rHTrzMSBuild\%0.1f\bin%sZRoslyn)	rprr{rTrIr}rrr)rA	base_pathrrbuildrrrMSBuildcszEnvironmentInfo.MSBuildcCs/|jdkrgStjj|jjdgS)z.
        Microsoft HTML Help Workshop
        g&@zHTML Help Workshop)rprrrrr{)rArrrHTMLHelpWorkshopzsz EnvironmentInfo.HTMLHelpWorkshopcCsl|jdkrgS|jjdd}tjj|jjd}|j}tjj|d||fgS)z=
        Microsoft Universal C Runtime SDK Libraries
        g,@r>Trz%sucrt%s)	rprTrJrrrrr_ucrt_subdir)rArrrrrr
UCRTLibrariess	zEnvironmentInfo.UCRTLibrariescCsK|jdkrgStjj|jjd}tjj|d|jgS)z;
        Microsoft Universal C Runtime SDK Include
        g,@rz%sucrt)rprrrrrr)rArrrrUCRTIncludesszEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)zB
        Microsoft Universal C Runtime SDK version subdir
        z%s\r)rr)rArrrrrszEnvironmentInfo._ucrt_subdircCs,|jdkr"|jdkr"gS|jjS)z%
        Microsoft Visual F#
        g&@g(@)rprr)rArrrFSharpszEnvironmentInfo.FSharpcCs|jjdd}|jdkr9|jj}d}n|jjjdd}d}|jdkrldn|j}|||j|f}tjj||S)	zA
        Microsoft Visual C++ runtime redistribuable dll
        r>Tz-redist%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllz\Toolsz\Redistz.onecore%s\Microsoft.VC%d0.CRT\vcruntime%d0.dllg,@)	rTrJrprrr@rrr)rArZredist_pathZ	vcruntimeZdll_verrrrVCRuntimeRedists	zEnvironmentInfo.VCRuntimeRedistTcCstd|jd|j|j|j|jg|d|jd|j|j|j|j	|j
g|d|jd|j|j|j|jg|d|jd|j
|j|j|j|j|j|j|j|jg	|}|jdkrtjj|jr|j|d<|S)z
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.
        rrrrZpy_vcruntime_redist)dict_build_pathsrrrrrrrrrrrrrrrrrrrrprrrr)rAexistsenvrrrr&sD												$
zEnvironmentInfo.return_envc
Cstjj|}tj|djtj}tj||}|rctt	tj
j|n|}|sd|j}t
jj||j|}	tjj|	S)a
        Given an environment variable name and specified paths,
        return a pathsep-separated string of paths containing
        unique, extant, directories from those paths and from
        the environment variable. Raise an error if no paths
        are resolved.
        rz %s environment variable is empty)	itertoolschain
from_iterablerPrQsplitrpathseprfilterrrupperr!r"r#_unique_everseenr)
rArfZspec_path_listsrZ
spec_pathsZ	env_pathsrZextant_pathsrZunique_pathsrrrrs	'zEnvironmentInfo._build_pathsccst}|j}|dkrMxdt|j|D]}|||Vq1Wn8x5|D]-}||}||krT|||VqTWdS)z
        List unique elements, preserving order.
        Remember all elements ever seen.

        _unique_everseen('AAAABBBCCDAABBB') --> A B C D

        _unique_everseen('ABBCcAD', str.lower) --> A B C D
        N)setaddr__contains__)rAiterablerseenZseen_addelementkrrrrs			


z EnvironmentInfo._unique_everseen)!rr	r
rOrBrRrprrrrrrrrrrrrrrrrrrrrrrrr&rrrrrrr%1s:		 -




-r%)!rOrr0platformrdistutils.errorsr!Z&pkg_resources.extern.packaging.versionrZsetuptools.extern.six.movesrZmonkeyrsystemrenvironrPrImportErrorr"r#Z_msvc9_suppress_errorsZdistutils.msvc9compilerrrr r/r4r'r=rSrkr%rrrrs:	
+/&
%[aPK!\;}*extern/__pycache__/__init__.cpython-35.pycnu[

Re@s0ddlmZdZeeedjdS))VendorImportersixzpkg_resources._vendorN)r)Zpkg_resources.externrnames__name__installrr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/extern/__init__.pysPK!.!PAA(command/__pycache__/sdist.cpython-35.pycnu[

Re@sddlmZddljjZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZeZdddZGd	d
d
e
ejZdS))logN)six)sdist_add_defaultsccs@x9tjdD](}x|j|D]}|Vq)WqWdS)z%Find all files under revision controlzsetuptools.file_findersN)
pkg_resourcesiter_entry_pointsload)dirnameepitemr
/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/sdist.pywalk_revctrlsrcs<eZdZdZd-ddddfd.gZiZd/ZddZddZddZ	ddZ
eej
ddZddZejd0kpd1ejkod2knpd3ejkod4knZereZd!d"Zfd#d$Zd%d&Zd'd(Zd)d*Zd+d,ZS)5sdistz=Smart sdist that finds anything supported by revision controlformats=N6formats for source distribution (comma-separated list)z	keep-tempkz1keep the distribution tree around after creating zarchive file(s)	dist-dir=dFdirectory to put the source distribution archive(s) in [default: dist]README
README.rst
README.txtcCs|jd|jd}|j|_|jjtjj|jd|jx!|j	D]}|j|qaWddl
}d|jjkr|j
|jt|jdg}x9|jD].}dd|f}||kr|j|qWdS)Negg_infozSOURCES.txtrcheck
dist_filesrr)run_commandget_finalized_commandfilelistappendospathjoinrcheck_readmeget_sub_commandsdistutils.commandcommand__all__Zcheck_metadatamake_distributiongetattrdistributionZ
archive_files)selfZei_cmdcmd_name	distutilsrfiledatar
r
rrun*s 
"


z	sdist.runcCstjj||jdS)N)origrinitialize_options_default_to_gztar)r,r
r
rr3Dszsdist.initialize_optionscCs#tjdkrdSdg|_dS)Nrbetargztar)r5r6rr7r)sysversion_infoformats)r,r
r
rr4Iszsdist._default_to_gztarc	Cs(|jtjj|WdQRXdS)z%
        Workaround for #516
        N)_remove_os_linkr2rr))r,r
r
rr)Os
zsdist.make_distributionccsqGddd}ttd|}y
t`Wntk
rCYnXz	dVWd||k	rlttd|XdS)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link..NoValueN)__name__
__module____qualname__r
r
r
rNoValue]sr@linkN)r*r!rA	Exceptionsetattr)r@Zorig_valr
r
rr<Vs

	zsdist._remove_os_linkcCs\ytjj|WnAtk
rWtj\}}}|jjjdj	YnXdS)Ntemplate)
r2r
read_templaterBr9exc_infotb_nexttb_framef_localsclose)r,_tbr
r
rZ__read_template_hackks
zsdist.__read_template_hackr5rrcs|jjr|jd}|jj|j|jjsx@|jD]5\}}}|jjfdd|DqJWdS)zgetting python filesbuild_pycs%g|]}tjj|qSr
)r!r"r#).0filename)src_dirr
r
s	z.sdist._add_defaults_python..N)r+has_pure_modulesrrextendZget_source_filesZinclude_package_data
data_files)r,rPrK	filenamesr
)rSr_add_defaults_pythonszsdist._add_defaults_pythoncsPy*tjrtj|n
tjWntk
rKtjdYnXdS)Nz&data_files contains unexpected objects)rPY2r_add_defaults_data_filessuper	TypeErrorrwarn)r,)	__class__r
rr[s	
zsdist._add_defaults_data_filescCsKxD|jD]}tjj|r
dSq
W|jddj|jdS)Nz,standard file not found: should have one of z, )READMESr!r"existsr^r#)r,fr
r
rr$szsdist.check_readmecCstjj|||tjj|d}ttdritjj|ritj||j	d||j
dj|dS)Nz	setup.cfgrAr)r2rmake_release_treer!r"r#hasattrraunlink	copy_filerZsave_version_info)r,base_dirfilesdestr
r
rrcs!
zsdist.make_release_treec	CsTtjj|jsdStj|jd}|j}WdQRX|djkS)NFrbz+# file GENERATED by distutils, do NOT edit
)r!r"isfilemanifestioopenreadlineencode)r,fp
first_liner
r
r_manifest_is_not_generatedsz sdist._manifest_is_not_generatedcCstjd|jt|jd}x|D]}tjrwy|jd}Wn&tk
rvtjd|w,YnX|j	}|j
ds,|rq,|jj|q,W|j
dS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'rjzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforlrnrPY3decodeUnicodeDecodeErrorr^strip
startswithrr rJ)r,rlliner
r
r
read_manifests
	
zsdist.read_manifest)rNr)rrr)rrr)rMrNrM)r5r)r5rrO)r5rM)r5rMr)r=r>r?__doc__user_optionsnegative_optr`r1r3r4r)staticmethod
contextlibcontextmanagerr<Z_sdist__read_template_hackr9r:Zhas_leaky_handlerErYr[r$rcrsr|r
r
)r_rrs8		


r)r.rZdistutils.command.sdistr'rr2r!r9rmrZsetuptools.externrZ
py36compatrrlistZ_default_revctrlrr
r
r
rsPK!ʬ-command/__pycache__/py36compat.cpython-35.pycnu[

Rez@sddlZddlmZddlmZddlmZddlmZGdddZe	ejdrGd	ddZdS)
N)glob)convert_path)sdist)filterc@seZdZdZddZeddZddZdd	Zd
dZ	dd
Z
ddZddZddZ
dS)sdist_add_defaultsz
    Mix-in providing forward-compatibility for functionality as found in
    distutils on Python 3.7.

    Do not edit the code in this class except to update functionality
    as implemented in distutils. Instead, override in the subclass.
    cCsJ|j|j|j|j|j|j|jdS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/py36compat.pyadd_defaultss





zsdist_add_defaults.add_defaultscCsStjj|sdStjj|}tjj|\}}|tj|kS)z
        Case-sensitive path existence check

        >>> sdist_add_defaults._cs_path_exists(__file__)
        True
        >>> sdist_add_defaults._cs_path_exists(__file__.upper())
        False
        F)ospathexistsabspathsplitlistdir)fspathr	directoryfilenamerrr_cs_path_exists(s

z"sdist_add_defaults._cs_path_existscCs|j|jjg}x|D]}t|tr|}d}x4|D],}|j|rDd}|jj|PqDW|s|jddj	|q|j|r|jj|q|jd|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
ZREADMESdistributionscript_name
isinstancetuplerfilelistappendwarnjoin)rZ	standardsfnZaltsZgot_itrrrr9s 

	z*sdist_add_defaults._add_defaults_standardscCsLddg}x9|D]1}ttjjt|}|jj|qWdS)Nz
test/test*.pyz	setup.cfg)rrrisfilerr extend)roptionalpatternfilesrrrrNs
z)sdist_add_defaults._add_defaults_optionalcCs|jd}|jjr4|jj|jxM|jD]B\}}}}x-|D]%}|jjtj	j
||qWWq>WdS)Nbuild_py)get_finalized_commandrhas_pure_modulesr r&get_source_files
data_filesr!rrr#)rr*pkgsrc_dir	build_dir	filenamesrrrrr	Ts
z'sdist_add_defaults._add_defaults_pythoncCs|jjrx|jjD]}t|trbt|}tjj|r|j	j
|q|\}}x<|D]4}t|}tjj|ru|j	j
|quWqWdS)N)rhas_data_filesr.rstrrrrr%r r!)ritemdirnamer2frrrr
ds
z+sdist_add_defaults._add_defaults_data_filescCs8|jjr4|jd}|jj|jdS)N	build_ext)rhas_ext_modulesr+r r&r-)rr8rrrrusz$sdist_add_defaults._add_defaults_extcCs8|jjr4|jd}|jj|jdS)N
build_clib)rhas_c_librariesr+r r&r-)rr:rrrrzsz'sdist_add_defaults._add_defaults_c_libscCs8|jjr4|jd}|jj|jdS)N
build_scripts)rhas_scriptsr+r r&r-)rr<rrrr
sz(sdist_add_defaults._add_defaults_scriptsN)__name__
__module____qualname____doc__rstaticmethodrrrr	r
rrr
rrrrr	srrc@seZdZdS)rN)r>r?r@rrrrrs)
rrdistutils.utilrdistutils.commandrZsetuptools.extern.six.movesrrhasattrrrrrs|PK!2VD::,command/__pycache__/bdist_egg.cpython-35.pycnu[

ReC@sdZddlmZddlmZmZddlmZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZmZdd	lmZdd
lmZddlmZy&ddlmZmZd
dZWn4ek
r4ddlmZmZddZYnXddZ ddZ!GdddeZ"e#j$dj%Z&ddZ'ddZ(ddZ)ddd d!iZ*d"d#Z+d$d%Z,d&d'Z-d(d)d*d+gZ.dddd,d-d.Z/dS)/z6setuptools.command.bdist_egg

Build .egg distributions)DistutilsSetupError)remove_treemkpath)log)CodeTypeN)six)get_build_platformDistributionensure_directory)
EntryPoint)Library)Command)get_pathget_python_versioncCs
tdS)Npurelib)rrr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/bdist_egg.py_get_purelibsr)get_python_librcCs
tdS)NF)rrrrrrscCsEd|kr"tjj|d}|jdrA|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrrstrip_module"s
rc
CsCtjdj}t|d}|j||WdQRXdS)NaR
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, imp
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __loader__ = None; del __bootstrap__, __loader__
            imp.load_dynamic(__name__,__file__)
        __bootstrap__()
        w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr
write_stub*sr'c@seZdZdZd*dddefd+ddd
dfd,d-gZdddgZddZddZddZ	ddZ
ddZddZd d!Z
d"d#Zd$d%Zd&d'Zd(d)Zd	S).	bdist_eggzcreate an "egg" distribution
bdist-dir=b1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s)exclude-source-filesN+remove all .py files from the generated eggz	keep-tempkz/keep the pseudo-installation tree around after z!creating the distribution archive	dist-dir=d-directory to put final built distributions in
skip-build2skip rebuilding everything (for testing/debugging)cCsCd|_d|_d|_d|_d|_d|_d|_dS)Nr)	bdist_dir	plat_name	keep_tempdist_dir
skip_build
egg_outputexclude_source_files)selfrrrinitialize_optionsOs						zbdist_egg.initialize_optionscCs|jd}|_|j|_|jdkr[|jdj}tjj|d|_|jdkrvt	|_|j
dd|jdkrtdd|j
|jt|jjo|jj
}tjj|j|d|_dS)Negg_infobdistZeggr8z.egg)r8r8)get_finalized_commandei_cmdr>r5
bdist_baserrjoinr6rset_undefined_optionsr:r	egg_nameZegg_versionrdistributionhas_ext_modulesr8)r<rArBbasenamerrrfinalize_optionsXs!zbdist_egg.finalize_optionscCs\|j|jd_tjjtjjt}|jj	g}|j_	x|D]}t
|trt|dkrtjj
|drtjj|d}tjj|}||ks|j|tjr|t|dd|df}|jj	j|qVWz0tjd|j|jdddddWd||j_	XdS)	Ninstallrzinstalling package data to %sinstall_dataforceroot)r5r@install_librrnormcaserealpathrrF
data_files
isinstancetuplelenisabs
startswithsepappendrinfocall_command)r<
site_packagesolditemrR
normalizedrrrdo_install_dataps !
!$zbdist_egg.do_install_datacCs
|jgS)N)r:)r<rrrget_outputsszbdist_egg.get_outputscKsmx!tD]}|j||jqW|jd|j|jd|j|j||}|j||S)z8Invoke reinitialized command `cmdname` with keyword argsr9dry_run)INSTALL_DIRECTORY_ATTRS
setdefaultr5r9rcreinitialize_commandrun_command)r<Zcmdnamekwdirnamecmdrrrr\s

zbdist_egg.call_commandc	Cs|jdtjd|j|jd}|j}d|_|jjrg|jrg|jd|j	ddd}||_|j
\}}g|_g}xt|D]\}}t
jj|\}	}
t
jj|jt|	d}|jj|tjd	||js;tt
jj|||j||jt
jd
||zinstalling library code to %srJ
build_clibrPwarn_dirrz.pyzcreating stub loader for %s/zEGG-INFOscriptszinstalling scripts to %sinstall_scriptsinstall_dirZno_eprLznative_libs.txtz
writing %swt
zremoving %szdepends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.verbosercmode
dist_filesr()3rgrr[r5r@rOrFhas_c_librariesr9r\get_ext_outputsstubs	enumeraterrrrCrrZrcr'rHreplacerYbyte_compilerSrarrncopy_metadata_tor
r"r#closeisfileunlinkwrite_safety_flagzip_safeexistsr>warnr;zap_pyfilesmake_zipfiler:rs
gen_headerr7rgetattrr)r<ZinstcmdZold_rootrjall_outputsext_outputsZ
to_compiler,Zext_namerextr%Zarchive_rootr>Z
script_dirZnative_libsZ	libs_filerrrrunsz
		
		
	


	

	


	
$	
	z
bdist_egg.runcCstjdxrt|jD]a\}}}xO|D]G}|jdr3tjj||}tjd|tj	|q3WqWdS)Nz+Removing .py files from temporary directoryz.pyzDeleting %s)
rr[walk_eggr5rrrrCdebugr)r<basedirsfilesnamerrrrrs

zbdist_egg.zap_pyfilescCsEt|jdd}|dk	r%|Stjdt|j|jS)Nrz4zip_safe flag not set; analyzing archive contents...)rrFrranalyze_eggr5rx)r<saferrrrs

zbdist_egg.zip_safec
Cs!tj|jjpd}|jdijd}|dkrFdS|jsY|jrltd|ftj	dd}|j
}dj|j}|jd}tj
j|j}d	t}|jsttj
j|jd
|jt|jd}	|	j||	jdS)Nzsetuptools.installationZeggsecutablerzGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulerraH#!/bin/sh
if [ `basename $0` = "%(basename)s" ]
then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@"
else
  echo $0 is not the correct name for this egg file.
  echo Please rename it back to %(basename)s and try again.
  exec false
fi
rca)r	parse_maprFZentry_pointsgetattrsextrasrsysversionmodule_namerCrrrHr:localsrcrrir"r#r})
r<ZepmeppyverpkgfullrrHheaderr&rrrrs*
	

	"

zbdist_egg.gen_headercCstjj|j}tjj|d}xe|jjjD]T}|j|r:tjj||t	|d}t
||j||q:WdS)z*Copy metadata (egg info) to the target_dirrN)rrnormpathr>rCrAfilelistrrXrVr
	copy_file)r<
target_dirZ
norm_egg_infoprefixrtargetrrrr|s%
zbdist_egg.copy_metadata_tocCszg}g}|jdi}xtj|jD]\}}}xE|D]=}tjj|djtkrD|j|||qDWx3|D]+}|||d|tjj||.visitcompression)zipfilerrrrirr[ZIP_DEFLATED
ZIP_STOREDZipFilerr})
zip_filenamerrsrccompressrtrrrrrirrr)rrcrrs	
r)0__doc__distutils.errorsrdistutils.dir_utilrr	distutilsrtypesrrrrrZsetuptools.externr
pkg_resourcesrr	r
rZsetuptools.extensionr
setuptoolsr
	sysconfigrrrImportErrordistutils.sysconfigrrr'r(rrsplitrrrrrrrrrdrrrrrsF
"
	PK!#?/command/__pycache__/easy_install.cpython-35.pycnu[

ReO@sdZddlmZddlmZddlmZmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZmZddlmZdd	lmZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
l Z dd
l!Z!dd
l"Z"dd
l#Z#dd
l$Z$dd
l%Z%ddl&m'Z'ddl(m)Z)m*Z*dd
l+m,Z,ddl-m.Z.ddl/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddl8m9Z9m:Z:m;Z;ddl4m<Z<m=Z=ddl>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMdd
lNZ>ejOdde>jPddddddgZQddZRd dZSe'jTrd!d"ZUd#d$ZVnd%d"ZUd&d$ZVd'd(ZWGd)dde,ZXd*d+ZYd,d-ZZd.d/Z[d0dZ\d1dZ]Gd2ddeEZ^Gd3d4d4e^Z_ej`jad5d6d7kre_Z^d8d9Zbd:d;Zcd<d=Zdd>d?Zed
d@dAZfdBdCZgdDdEZhdFejikr@ehZjndGdHZjdIdJdKZkdLdMZldNdOZmdPdQZnyddRlmoZpWneqk
rdSdTZpYnXdUdVZoGdWdXdXerZsesjtZuGdYdZdZesZvGd[d\d\ewZxGd]d^d^exZyGd_d`d`eyZzexj{Z{exj|Z|dadbZ}dcddZ~deecdfdgZdhdiZdjdkZd
dldZe"jdmdnZd
S)oa%
Easy Install
------------

A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.

__ https://setuptools.readthedocs.io/en/latest/easy_install.html

)glob)get_platform)convert_path
subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMESSCHEME_KEYS)logdir_util)
first_line_re)find_executableN)six)configparsermap)Command)	run_setup)get_pathget_config_vars)rmtree_safe)setopt)unpack_archive)PackageIndexparse_requirement_arg
URL_SCHEME)	bdist_eggegg_info)yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributionsEnvironmentRequirementDistributionPathMetadataEggMetadata
WorkingSetDistributionNotFoundVersionConflictDEVELOP_DISTdefaultcategorysamefileeasy_installPthDistributionsextract_wininst_cfgmainget_exe_prefixescCstjddkS)NP)structcalcsizer:r:/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/easy_install.pyis_64bitHsr<cCstjj|o!tjj|}ttjdo9|}|rUtjj||Stjjtjj|}tjjtjj|}||kS)z
    Determine if two paths reference the same file.

    Augments os.path.samefile to work on Windows and
    suppresses errors if the path doesn't exist.
    r0)ospathexistshasattrr0normpathnormcase)p1p2Z
both_existZuse_samefileZnorm_p1Znorm_p2r:r:r;r0Ls$cCs|S)Nr:)sr:r:r;	_to_ascii^srFcCs5ytj|ddSWntk
r0dSYnXdS)NasciiTF)r	text_typeUnicodeError)rEr:r:r;isasciias

rJcCs
|jdS)NrG)encode)rEr:r:r;rFiscCs2y|jddSWntk
r-dSYnXdS)NrGTF)rKrI)rEr:r:r;rJls


cCstj|jjddS)N
z; )textwrapdedentstripreplace)textr:r:r;tsrRc@seZdZdZdZdZdddddddddddddddddddddgZdd
dd
dd0d3d9d<g	Zej	rd@ej
ZejdAdefejdAd*diZ
eZdBdCZdDdEZdFdGZedHdIZdJdKZdLdMZdNdOZdPdQZdRdSZdTdUZdVdWZdXdYZdZd[Zejd\j Z!ejd]j Z"ejd^j Z#d_d`Z$dadbZ%dcddZ&dedfZ'dgdhZ(didjZ)e*j+dkdlZ,dmdndoZ-dmdpdqZ.drdsZ/ddtduZ0dvdwZ1dxdyZ2dzd{Z3dd|d}Z4ed~dZ5dfddZ6ddZ7ddZ8ddZ9ddZ:ddZ;ejdj Z<ejdZ=dddZ>ejdj Z?ddZ@ddZAddZBddZCddZDddZEddZFddZGejdj ZHddZIddZJddZKeLdeLddddZMeLddddZNddZOdS)r1z'Manage a download/build/install processz Find/get/install Python packagesTprefix=Ninstallation prefixzip-okzinstall package as a zipfile
multi-versionm%make apps have to require() a versionupgradeU1force upgrade (searches PyPI for latest versions)install-dir=dinstall package to DIRscript-dir=rEinstall scripts to DIRexclude-scriptsxDon't install scriptsalways-copya'Copy all needed packages to install dir
index-url=i base URL of Python Package Indexfind-links=f(additional URL(s) to search for packagesbuild-directory=b/download/extract/build in DIR; keep the results	optimize=Olalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]record=3filename in which to record list of installed filesalways-unzipZ*don't install as a zipfile, no matter what
site-dirs=S)list of directories where .pth files workeditablee+Install specified packages in editable formno-depsNdon't install dependenciesallow-hosts=H$pattern(s) that hostnames must matchlocal-snapshots-okl(allow building eggs from local checkoutsversion"print version information and exit
no-find-links9Don't load find-links defined in packages being installedz!install in user site-package '%s'usercCsd|_d|_|_d|_|_|_d|_d|_d|_d|_	d|_
|_d|_|_
|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_tjrtj |_!tj"|_#nd|_!d|_#d|_$d|_%d|_&|_'d|_(i|_)d|_*d|_+|j,j-|_-|j,j.||j,j/ddS)NrFr1)0rzip_oklocal_snapshots_okinstall_dir
script_direxclude_scripts	index_url
find_linksbuild_directoryargsoptimizerecordr[always_copy
multi_versionr}no_depsallow_hostsrootprefix	no_reportrinstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datainstall_baseinstall_platbasesiteENABLE_USER_SITE	USER_BASEinstall_userbase	USER_SITEinstall_usersite
no_find_links
package_indexpth_filealways_copy_from	site_dirsinstalled_projectssitepy_installed_dry_rundistributionverbose_set_command_optionsget_option_dict)selfr:r:r;initialize_optionssF																								zeasy_install.initialize_optionscCs-dd|D}tt|j|dS)Ncss9|]/}tjj|s-tjj|r|VqdS)N)r=r>r?islink).0filenamer:r:r;	sz/easy_install.delete_blockers..)listr_delete_path)rblockersZextant_blockersr:r:r;delete_blockersszeasy_install.delete_blockerscCsetjd||jrdStjj|o?tjj|}|rNtntj}||dS)NzDeleting %s)	rinfodry_runr=r>isdirrrmtreeunlink)rr>Zis_treeZremoverr:r:r;rs	%zeasy_install._delete_pathcCsHtjdd}td}d}t|jttdS)zT
        Render the Setuptools version and installation details, then exit.
        N
setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver}))sysrr#printformatlocals
SystemExit)verdisttmplr:r:r;_render_versions
zeasy_install._render_versionc	Cs|jo|jtjjd}tdd\}}d|jjd|jjd|jjd|d|dd	d
|d|dd|d|d
|d|dt	tddi|_
tjr|j
|j
d<|j|j
d<|j|j|j|jdddd|jdkr;|j|_|jdkrSd|_|jdd)|jdd*|jr|jr|j|_|j|_|jdd+tttj}t|_|jdk	rjdd|jjdD}xn|D]f}t jj!|s+t"j#d|qt||krPt$|dq|jj%t|qW|j&s}|j'|j(pd |_(|jdd|_)xB|jt|jfD](}||j)kr|j)j*d|qW|j+dk	rd!d|j+jdD}n	d"g}|j,dkrW|j-|j(d#|j)d$||_,t.|j)tj|_/|j0dk	rt1|j0t2j3r|j0j|_0n	g|_0|j4r|j,j5|j)tj|js|j,j6|j0|jdd,t1|j7t8soy;t8|j7|_7d|j7koBdknsMt9Wnt9k
rnt$d&YnX|j&r|j:rt;d'|j<st;d(g|_=dS)-Nrrexec_prefix	dist_namedist_version
dist_fullname
py_versionpy_version_shortrpy_version_nodot
sys_prefixsys_exec_prefixabiflagsuserbaseusersiterrrrFrrinstallrcSs(g|]}tjj|jqSr:)r=r>
expanduserrO)rrEr:r:r;
2s	z1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.python.org/simplecSsg|]}|jqSr:)rO)rrEr:r:r;rGs	*search_pathhostsrz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))rr)rr)rr)rr)>rrrsplitrrget_nameget_versionget_fullnamegetattrconfig_varsrrrr_fix_install_dir_for_user_siteexpand_basedirsexpand_dirs_expandrrrset_undefined_optionsrrrrr r>
get_site_dirs
all_site_dirsrr=rrwarnrappendr}check_site_dirrshadow_pathinsertrrcreate_indexr%local_indexr
isinstancerstring_typesrZscan_egg_linksadd_find_linksrint
ValueErrorrrroutputs)	rrrrrArr_	path_itemrr:r:r;finalize_optionss	


		

	
	
"				

			zeasy_install.finalize_optionscCs|jstjrdS|j|jdkrCd}t||j|_|_tj	j
ddd}|j|dS)z;
        Fix the install_dir if "--user" was used.
        Nz$User base directory is not specifiedposixunix_user)rrrcreate_home_pathrr	rrr=namerP
select_scheme)rmsgZscheme_namer:r:r;rls
z+easy_install._fix_install_dir_for_user_sitecCsx{|D]s}t||}|dk	rtjdksFtjdkrXtjj|}t||j}t|||qWdS)Nrnt)rr=r	r>rrrsetattr)rattrsattrvalr:r:r;
_expand_attrs{s
zeasy_install._expand_attrscCs|jdddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.rrrN)r)rr:r:r;rszeasy_install.expand_basedirscCs)ddddddg}|j|dS)z+Calls `os.path.expanduser` on install dirs.rrrrrrN)r)rdirsr:r:r;rs	zeasy_install.expand_dirscCs|j|jjkr%tj|jzx%|jD]}|j||jq2W|jr|j}|j	rt
|j	}x2tt
|D]}|||d||joinr)rpidr:r:r;pseudo_tempnames

zeasy_install.pseudo_tempnamecCsdS)Nr:)rr:r:r;rsz$easy_install.warn_deprecated_optionscCst|j}tjj|d}||jk}|rS|jrS|j}n~|jd}tjj	|}y7|rtj
|t|djtj
|Wn"t
tfk
r|jYnX|r|jrt|j|r!|jdkr*t||j|_n	d|_|tttkrNd|_n.|jr|tjj	|r|d|_d|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededzeasy-install.pthz.write-testwNT)r rr=r>r$rrcheck_pth_processingr&r?ropencloseOSErrorIOErrorcant_write_to_targetrno_default_version_msgrr2r_pythonpathr)rinstdirrZis_site_dirZtestfileZtest_existsr:r:r;rs4
			zeasy_install.check_site_diraS
        can't create or remove files in install directory

        The following error occurred while trying to add or remove files in the
        installation directory:

            %s

        The installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s
        z
        This directory does not currently exist.  Please create it and try again, or
        choose a different installation directory (using the -d or --install-dir
        option).
        a
        Perhaps your account does not have write access to this directory?  If the
        installation directory is a system-owned directory, you may need to sign in
        as the administrator or "root" account.  If you do not have administrative
        access to this machine, you may wish to choose a different installation
        directory, preferably one that is listed in your PYTHONPATH environment
        variable.

        For information on other options, you may wish to consult the
        documentation at:

          https://setuptools.readthedocs.io/en/latest/easy_install.html

        Please make the appropriate changes for your system and try again.
        cCsj|jtjd|jf}tjj|jsI|d|j7}n|d|j7}t	|dS)NrL)
_easy_install__cant_write_msgrexc_inforr=r>r?_easy_install__not_exists_id_easy_install__access_msgr)rrr:r:r;r-s
 z!easy_install.cant_write_to_targetc
Cs(|j}tjd||jd}|d}tjj|}tdd}yN|rktj|tjj	|}t
jj|ddt
|d}Wn"ttfk
r|jYnDXz|j|jt|jd	}tj}tjd
kritjj|\}}	tjj|d}
|	jdkoZtjj|
}|ri|
}d
dlm}||dddgd
tjj|rtjd|dSWd	|r|jtjj|rtj|tjj|r
tj|X|js$tjd|dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %sz.pthz.okzz
            import os
            f = open({ok_file!r}, 'w')
            f.write('OK')
            f.close()
            rLexist_okTr'Nrzpythonw.exez
python.exer)spawnz-Ez-cpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rrrr&r=r>r?
_one_linerrdirname
pkg_resources
py31compatmakedirsr)r+r,r-writerrr*r
executabler	rr$lowerdistutils.spawnr7rr)
rr0rZok_fileZ	ok_existsrr:rmr?basenameZaltZuse_altr7r:r:r;r(sV	



	

	z!easy_install.check_pth_processingcCsz|jri|jdrixM|jdD]<}|jd|rEq)|j|||jd|q)W|j|dS)z=Write all the scripts for `dist`, unless scripts are excludedscriptszscripts/N)rmetadata_isdirmetadata_listdirinstall_scriptget_metadatainstall_wrapper_scripts)rrscript_namer:r:r;install_egg_scriptsLsz easy_install.install_egg_scriptscCs|tjj|rhxctj|D]?\}}}x-|D]%}|jjtjj||q8Wq"Wn|jj|dS)N)r=r>rwalkrrr$)rr>baserfilesrr:r:r;
add_outputZs

*zeasy_install.add_outputcCs |jrtd|fdS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)r}r)rrr:r:r;not_editablebs	zeasy_install.not_editablecCsT|js
dStjjtjj|j|jrPtd|j|jfdS)Nz2%r already exists in %s; can't do a checkout there)r}r=r>r?r$rkeyr)rrr:r:r;check_editablejs	'zeasy_install.check_editableccsTtjdtjd}zt|VWdtjj|oNtt	|XdS)Nrz
easy_install-)
tempfilemkdtemprustrr=r>r?rr)rtmpdirr:r:r;_tmpdirtszeasy_install._tmpdirFcCs||js|j|jV}t|tst|rx|j||jj||}|j	d|||dSt
jj|r|j||j	d|||dSt
|}|j||jj|||j|j|j|j}|dkr/d|}|jr |d7}t|nB|jtkrX|j|||d|S|j	||j||SWdQRXdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)Using)r}install_site_pyrWrr&rrOrdownloadinstall_itemr=r>r?rrQZfetch_distributionr[rrr
precedencer-process_distributionlocation)rrdepsrVdlrrr:r:r;r1}s2	



	
	
zeasy_install.easy_installcCsx|p|j}|p*tjj||k}|p@|jd}|p||jdk	o|tjjt|t|jk}|r|rx.|j|jD]}|j	|krPqWd}t
jdtjj||r|j
|||}xP|D]}|j|||qWn,|j|g}|j||d|d|dk	rtx|D]}||krZ|SqZWdS)Nz.eggTz
Processing %srrX)rr=r>r:endswithrr rproject_namer^rrrBinstall_eggsr]egg_distribution)rrrZrVr_Zinstall_neededrdistsr:r:r;r[s.


zeasy_install.install_itemcCsRt|}xAtD]9}d|}t||dkrt||||qWdS)z=Sets the install directories by applying the install schemes.install_N)r
rrr
)rr	schemerPattrnamer:r:r;r
s



zeasy_install.select_schemecGs?|j||jj|||j|jkrC|jj||jj||j|||j|jr$rrPr?rrrr:rlistdirrr"shutilmove)rr
dist_filename
setup_basedstrcontentsr:r:r;
maybe_moves"	

zeasy_install.maybe_movecCs>|jr
dSx*tjj|D]}|j|q#WdS)N)rScriptWriterbestget_argswrite_script)rrrr:r:r;rHs	z$easy_install.install_wrapper_scriptscCsmt|j}t||}|rP|j|t}tj||}|j|t|ddS)z/Generate a legacy script wrapper and install itrpN)	rUrois_python_script_load_templaterr|
get_headerrrF)rrrIscript_textdev_pathrZ	is_scriptbodyr:r:r;rFszeasy_install.install_scriptcCs:d}|r|jdd}td|}|jdS)z
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        zscript.tmplz.tmplz (dev).tmplrzutf-8)rPr!decode)rr	Z	raw_bytesr:r:r;r%s
zeasy_install._load_templatetcsjfdd|Dtjd|jtjjj|}j|t}j	st
|tjj|rtj|t
|d|}|j|WdQRXt|d|dS)z1Write an executable file to the scripts directorycs(g|]}tjjj|qSr:)r=r>r$r)rrd)rr:r;r7s	z-easy_install.write_script..zInstalling %s script to %sr'Ni)rrrrr=r>r$rN
current_umaskrr"r?rr)r>chmod)rrIrzmodertargetmaskrmr:)rr;r4s
		

zeasy_install.write_scriptcCs|jjdr(|j||gS|jjdrP|j||gS|}tjj|r|jdrt|||jn$tjj	|rtjj
|}|j|r|jr|dk	r|j
|||}tjj|d}tjj|sttjj|dd}|sRtdtjj
|t|dkrtdtjj
||d	}|jrtj|j||gS|j||SdS)
Nz.eggz.exez.pyzsetup.pyrz"Couldn't find a setup script in %sr1zMultiple setup scripts in %sr)r@rainstall_egginstall_exer=r>isfilerunpack_progressrabspath
startswithrr{r$r?rrrr}rrreport_editablebuild_and_install)rrrwrVrxsetup_scriptZsetupsr:r:r;rcFs8"
	zeasy_install.install_eggscCs[tjj|r3t|tjj|d}nttj|}tj	|d|S)NzEGG-INFOmetadata)
r=r>rr(r$r)	zipimportzipimporterr'
from_filename)regg_pathrr:r:r;rdps
zeasy_install.egg_distributionc
Cstjj|jtjj|}tjj|}|jsIt||j|}t	||stjj
|rtjj|rtj
|d|jn/tjj|r|jtj|fd|yd}tjj
|r$|j|rtjd}}qtjd}}ng|j|rS|j||jd}}n8d}|j|r{tjd}}ntjd}}|j|||f|dtjj|tjj|ft|d	|Wn%tk
rt|d	dYnX|j||j|S)
Nrz	Removing FZMovingZCopyingZ
ExtractingTz	 %s to %sfix_zipimporter_caches)r=r>r$rrBrrr"rdr0rrr
remove_treer?rrrrurvcopytreersmkpathunpack_and_compilecopy2r:update_dist_cachesr rN)rrrVdestinationrZnew_dist_is_zippedrmrYr:r:r;rxsT		
%
	

zeasy_install.install_eggcst|}|dkr(td|tdd|jddd|jdddt}tjj||jd}||_	|d}tjj|d	}tjj|d
}t
|t|||_|j
||tjj|svt|d}	|	jdxR|jdD]A\}
}|
d
kr'|	jd|
jddj|fq'W|	jtjj|d|jfddtj|Dtj||d|jd|j|j||S)Nz(%s is not a valid distutils Windows .exerbrr	rplatformz.eggz.tmpzEGG-INFOzPKG-INFOr'zMetadata-Version: 1.0
target_versionz%s: %s
_-rCcs)g|]}tjj|dqS)r)r=r>r$)rr)rr:r;rs	z,easy_install.install_exe..rr)r3rr'getrr=r>r$egg_namer^r"r(	_provider
exe_to_eggr?r)r>itemsrPtitler*rr|r~rmake_zipfilerrr)rrwrVcfgrregg_tmpZ	_egg_infoZpkg_infrmkvr:)rr;rs<
	


-
zeasy_install.install_execst|ggifdd}t||g}xD]}|jjdrY|jd}|d}tj|dd|dr$rarstrip_modulesplitextrrr)srcryrEoldnewpartsr`)rnative_libsprefixes
to_compile	top_levelr:r;processs$
z(easy_install.exe_to_egg..processz.pydrr1z.pyzEGG-INFOrrz.txtr'rLNrrr)rr)r5rr@rarrrr=r>r$rZ
write_stubbyte_compileZwrite_safety_flagZanalyze_eggrr?r)r>r*)rrwrrZstubsresrresourceZpyfiler	Ztxtrmr:)rrrrrr;rs6






!zeasy_install.exe_to_egga(
        Because this distribution was installed --multi-version, before you can
        import modules from this package in an application, you will need to
        'import pkg_resources' and then use a 'require()' call similar to one of
        these examples, in order to select the desired version:

            pkg_resources.require("%(name)s")  # latest installed version
            pkg_resources.require("%(name)s==%(version)s")  # this exact version
            pkg_resources.require("%(name)s>=%(version)s")  # this version or higher
        z
        Note also that the installation directory must be on sys.path at runtime for
        this to work.  (e.g. by being the application's script directory, by being on
        PYTHONPATH, or by being added to sys.path by your code.)
        Z	Installedc	Csd}|jrV|jrV|d|j7}|jtttjkrV|d|j7}|j	}|j
}|j}d}|tS)z9Helpful installation message for display to package usersz
%(what)s %(eggloc)s%(extras)srLr)
rr_easy_install__mv_warningrrr rr>_easy_install__id_warningr^rbrr)	rreqrwhatrZegglocr	rextrasr:r:r;rl!s			z easy_install.installation_reportaR
        Extracted editable version of %(spec)s to %(dirname)s

        If it uses setuptools in its setup script, you can activate it in
        "development" mode by going to that directory and running::

            %(python)s setup.py develop

        See the setuptools documentation for the "develop" command for more info.
        cCs-tjj|}tj}d|jtS)NrL)r=r>r:rr?_easy_install__editable_msgr)rrrr:pythonr:r:r;r:s	zeasy_install.report_editablecCs(tjjdttjjdtt|}|jdkrid|jd}|jdd|n|jdkr|jdd|jr|jdd	t	j
d
|t|dddj|yt
||Wn?tk
r#}ztd|jdfWYdd}~XnXdS)
Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrr1rrz-qz-nz
Running %s %s zSetup script exited with %s)rmodules
setdefaultrrrrrrrrrr$rrrr)rrrxrrr:r:r;r?s 	*zeasy_install.run_setupc	Csddg}tjdddtjj|}z|jtjj||j||j|||t|g}g}x?|D]7}x.||D]"}|j|j	|j
|qWqW|r|jrtj
d||SWdt|tj|jXdS)Nrz
--dist-dirrz
egg-dist-tmp-dirz+No eggs found in %s (setup script problem?))rRrSr=r>r:_set_fetcher_optionsrrr%rr^rrrrrr)	rrrxrdist_dirZall_eggseggsrPrr:r:r;rSs$	

$	
zeasy_install.build_and_installc	Cs|jjdj}d}i}xC|jD]5\}}||krLq1|d||jdd	r$rZedit_config)	rrLZei_optsZfetch_directivesZ
fetch_optionsrPrsettingsZcfg_filenamer:r:r;rks	z!easy_install._set_fetcher_optionscCs|jdkrdSxx|j|jD]f}|jsE|j|jkr$tjd||jj||j|jkr$|jj|jq$W|js|j|jjkrtjd|nEtjd||jj	||j|jkr|jj
|j|js|jj|jdkrt
jj|jd}t
jj|r`t
j|t|d}|j|jj|jd|jdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filerzsetuptools.pthwtrL)rrPrr^rrrkrpathsrjrrsaver=r>r$rrrr)r>
make_relativer*)rrr_rrmr:r:r;ris4	
	

 zeasy_install.update_pthcCstjd|||S)NzUnpacking %s to %s)rdebug)rrryr:r:r;rszeasy_install.unpack_progresscsggfdd}t|||jjsx9D]1}tj|tjdBd@}t||qQWdS)Ncs~|jdr/|jdr/j|n+|jdsM|jdrZj|j||jrz|p}dS)Nz.pyz	EGG-INFO/z.dllz.so)rarrrr)rry)rto_chmodrr:r;pfs
z+easy_install.unpack_and_compile..pfimi)rrrr=statST_MODEr)rrrrrmrr:)rrrr;rs
	
zeasy_install.unpack_and_compilecCstjr|jddSddlm}zbtj|jd||ddddd|j|j	r||d|j	ddd|jWdtj|jXdS)Nz%byte-compiling is disabled, skipping.r)rr1rforcer)
rdont_write_bytecoderdistutils.utilrrrrrr)rrrr:r:r;rs	
	zeasy_install.byte_compilea
        bad install directory or PYTHONPATH

        You are attempting to install a package to a directory that is not
        on PYTHONPATH and which Python does not read ".pth" files from.  The
        installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s

        and your PYTHONPATH environment variable currently contains:

            %r

        Here are some of your options for correcting the problem:

        * You can choose a different installation directory, i.e., one that is
          on PYTHONPATH or supports .pth files

        * You can add the installation directory to the PYTHONPATH environment
          variable.  (It must then also be on PYTHONPATH whenever you run
          Python and want to use the package(s) you are installing.)

        * You can set up the installation directory to support ".pth" files by
          using one of the approaches described here:

          https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations


        Please make the appropriate changes for your system and try again.cCs)|j}||jtjjddfS)N
PYTHONPATHr)_easy_install__no_default_msgrr=environr)rtemplater:r:r;r.s	z#easy_install.no_default_version_msgcCs-|jr
dStjj|jd}tdd}|jd}d}tjj|rtj	d|jt
j|}|j}WdQRX|j
dstd	|||kr tjd
||jst|t
j|ddd}|j|WdQRX|j|gd
|_dS)z8Make sure there's a site.py in the target dir, if neededNzsite.pyrz
site-patch.pyzutf-8rzChecking existing site.py in %sz
def __boot():z;%s is not a setuptools-generated site.py; please remove it.zCreating %sr'encodingT)rr=r>r$rr!rr?rrior)readrrrrr"r>r)rZsitepysourcecurrentstrmr:r:r;rYs,	
	
zeasy_install.install_site_pycCs|js
dSttjjd}xctj|jD]O\}}|j|r8tjj	|r8|j
d|tj|dq8WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)rrr=r>rr	iteritemsrrrdebug_printr=)rhomer	r>r:r:r;rs	"zeasy_install.create_home_pathrrz/$base/lib/python$py_version_short/site-packagesrz	$base/binz$base/Lib/site-packagesz
$base/ScriptscGs|jdj}|jr|j}|j|d<|jjtj|j}xB|j	D]4\}}t
||ddkr\t|||q\Wddlm
}xi|D]a}t
||}|dk	r|||}tjdkrtjj|}t|||qWdS)NrrLr)rr)get_finalized_commandrrrr
rr=r	DEFAULT_SCHEMErrr
rrr>r)rrrrgrrrr:r:r;r-s 	

zeasy_install._expand)rSNrT)rUrVrW)rXrYrZ)r[r\r])r^r_r`)rarErb)rcrdre)rfrgrh)rirjrk)rlrmrn)rorprq)rrrsrt)ruNrv)rwrxry)rzr{r|)r}r~r)rrr)rrr)rrr)rNr)rNr)P__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsuser_optionsboolean_optionsrrrZhelp_msgrnegative_optrrrrrstaticmethodrrrrrrrr&rrrMrNlstripr2r4r5r-r(rJrNrOrQ
contextlibcontextmanagerrWr1r[r
r]rsr{rHrFrrrcrdrrrrrrlrrrrrrirrrrr.rYrrr
rrr:r:r:r;r1ws		

0	z	*	;
	$$	'	
*6-5			% 
	cCs.tjjddjtj}td|S)Nrr)r=rrrpathsepfilter)rr:r:r;r/Ds!r/cCsg}|jttjg}tjtjkrD|jtjx2|D]*}|rKtjdkr|jtjj	|ddntj
dkr|jtjj	|ddtjdd	dtjj	|dd
gn%|j|tjj	|ddgtjdkrKd|krKtjj
d
}|rKtjj	|ddtjdd	d}|j|qKWtdtdf}x'|D]}||kr|j|qWtjr|jtjy|jtjWntk
rYnXttt|}|S)z&
    Return a list of 'site' dirs
    os2emxriscosLibz
site-packagesrlibrNrzsite-pythondarwinzPython.frameworkHOMELibraryPythonpurelibplatlib)rr)extendr/rrrrrr=r>r$seprrrrrrrgetsitepackagesAttributeErrorrrr )sitedirsrrrZhome_spZ	lib_pathsZsite_libr:r:r;rIsV
"			
	
rccsIi}x<|D]4}t|}||kr.q
d||rrtrar)r$rrr*rrstrip)inputsseenr:rMr	rmlinesliner:r:r;expand_pathss4





rcCst|d}z`tj|}|dkr1dS|d|d|d}|dkr[dS|j|dtjd|jd\}}}|dkrdS|j|d|d
dddi}tj|}yT|j|}	|	j	d
dd}
|
j
tj}
|j
tj|
Wntjk
rEdSYnX|jdsf|jdrjdS|SWd|jXdS)znExtract configuration data from a bdist_wininst .exe

    Returns a configparser.RawConfigParser, or None
    rbN	zegg path translations for a given .exe filePURELIB/rPLATLIB/pywin32_system32PLATLIB/SCRIPTS/EGG-INFO/scripts/DATA/lib/site-packagesrrrzPKG-INFOr1z	.egg-inforNz	EGG-INFO/z.pthz
-nspkg.pthPURELIBPLATLIB\rz%s/%s/cSs(g|]\}}|j|fqSr:)r@)rrdyr:r:r;rs	z$get_exe_prefixes..)r+r)r,r)r-r)r.r/)r0r)r1r2)rZipFileinfolistrrrrarr$upperrrPY3rrrOrPrrr*sortreverse)Zexe_filenamerrVrr	rrzpthr:r:r;r5s>		")"	-

c@syeZdZdZdZfddZddZddZed	d
Z	ddZ
d
dZddZdS)r2z)A .pth file with Distribution paths in itFcCs||_ttt||_ttjj|j|_|j	t
j|gddx6t|j
D]%}tt|jt|dqoWdS)NT)rrrr rr=r>r:basedir_loadr%__init__rrrjr$)rrrr>r:r:r;r>s	
zPthDistributions.__init__cCsug|_d}tj|j}tjj|jr't|jd}x|D]}|j	drmd}qO|j
}|jj||jsO|jj	drqOt
tjj|j|}|jdrrr)rrrrOr r$r<r?popdirtyr*)rZ
saw_importrrmrr>r:r:r;r=s2	
"&
	
	 zPthDistributions._loadc	Cs|js
dStt|j|j}|rtjd|j|j|}dj	|d}t
jj|jrt
j
|jt|jd}|j|WdQRXn8t
jj|jrtjd|jt
j
|jd|_dS)z$Write changed .pth file back to diskNz	Saving %srLrzDeleting empty %sF)rCrrrrrrr_wrap_linesr$r=r>rrr)r>r?)rZ	rel_pathsrdatarmr:r:r;r0s	zPthDistributions.savecCs|S)Nr:)rr:r:r;rDFszPthDistributions._wrap_linescCso|j|jko6|j|jkp6|jtjk}|r[|jj|jd|_tj||dS)z"Add `dist` to the distribution mapTN)	r^rrr=getcwdrrCr%rj)rrnew_pathr:r:r;rjJs	zPthDistributions.addcCsIx2|j|jkr4|jj|jd|_qWtj||dS)z'Remove `dist` from the distribution mapTN)r^rrkrCr%)rrr:r:r;rkXs
zPthDistributions.removecCstjjt|\}}t|j}|g}tjdkrKdpQtj}xut||kr||jkr|jtj	|j
|j|Stjj|\}}|j|qWW|SdS)Nr)r=r>rr rr<altseprrcurdirr:r$)rr>npathlastZbaselenrrr:r:r;r_s	

zPthDistributions.make_relativeN)
rrrrrCr>r=rrrDrjrkrr:r:r:r;r2s	c@s:eZdZeddZedZedZdS)RewritePthDistributionsccs*|jVx|D]}|VqW|jVdS)N)preludepostlude)clsrrr:r:r;rDps
	z#RewritePthDistributions._wrap_linesz?
        import sys
        sys.__plen = len(sys.path)
        z
        import sys
        new = sys.path[sys.__plen:]
        del sys.path[sys.__plen:]
        p = getattr(sys, '__egginsert', 0)
        sys.path[p:p] = new
        sys.__egginsert = p + len(new)
        N)rrrclassmethodrDr9rMrNr:r:r:r;rLos
	rLZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs,ttjtrtStjtjjS)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )rrpatternrUrecompilerr:r:r:r;_first_line_resrUcCs|tjtjgkrAtjdkrAt|tj||Stj\}}}t	j
||d|dd||ffdS)Nrrr1z %s %s)r=rrkr	rrS_IWRITErr3rreraise)funcargexcetZevrr:r:r;
auto_chmods
'
r\cCs=t|}t|tj|r/t|n
t|dS)aa

    Fix any globally cached `dist_path` related data

    `dist_path` should be a path of a newly installed egg distribution (zipped
    or unzipped).

    sys.path_importer_cache contains finder objects that have been cached when
    importing data from the original distribution. Any such finders need to be
    cleared since the replacement distribution might be packaged differently,
    e.g. a zipped egg distribution might get replaced with an unzipped egg
    folder or vice versa. Having the old finders cached may then cause Python
    to attempt loading modules from the replacement distribution using an
    incorrect loader.

    zipimport.zipimporter objects are Python loaders charged with importing
    data packaged inside zip archives. If stale loaders referencing the
    original distribution, are left behind, they can fail to load modules from
    the replacement distribution. E.g. if an old zipimport.zipimporter instance
    is used to load data from a new zipped egg archive, it may cause the
    operation to attempt to locate the requested data in the wrong location -
    one indicated by the original distribution's zip archive directory
    information. Such an operation may then fail outright, e.g. report having
    read a 'bad local file header', or even worse, it may fail silently &
    return invalid data.

    zipimport._zip_directory_cache contains cached zip archive directory
    information for all existing zipimport.zipimporter instances and all such
    instances connected to the same archive share the same cached directory
    information.

    If asked, and the underlying Python implementation allows it, we can fix
    all existing zipimport.zipimporter instances instead of having to track
    them down and remove them one by one, by updating their shared cached zip
    archive directory information. This, of course, assumes that the
    replacement distribution is packaged as a zipped egg.

    If not asked to fix existing zipimport.zipimporter instances, we still do
    our best to clear any remaining zipimport.zipimporter related cached data
    that might somehow later get used when attempting to load data from the new
    distribution and thus cause such load operations to fail. Note that when
    tracking down such remaining stale data, we can not catch every conceivable
    usage from here, and we clear only those that we know of and have found to
    cause problems if left alive. Any remaining caches should be updated by
    whomever is in charge of maintaining them, i.e. they should be ready to
    handle us replacing their zip archives with new distributions at runtime.

    N)r _uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)	dist_pathrnormalized_pathr:r:r;rs
<
rcCsrg}t|}xY|D]Q}t|}|j|r|||dtjdfkr|j|qW|S)ap
    Return zipimporter cache entry keys related to a given normalized path.

    Alternative path spellings (e.g. those using different character case or
    those using alternative path separators) related to the same path are
    included. Any sub-path entries are included as well, i.e. those
    corresponding to zip archives embedded in other zip archives.

    r1r)rr rr=rr)rbcacheresult
prefix_lenpnpr:r:r;"_collect_zipimporter_cache_entriess

#rhcCsZxSt||D]B}||}||=|o9|||}|dk	r|||rjr:r:r;2clear_and_remove_cached_zip_archive_directory_data(szf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_datari)rkr_zip_directory_cache)rbrmr:r:r;r`'sr`Z__pypy__cCs&dd}t|tjd|dS)NcSs/|jtj||jtj||S)N)rlrrupdatern)r>rjr:r:r;)replace_cached_zip_archive_directory_data>s

zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datari)rkrrn)rbrpr:r:r;r_=s
r_zcCs;yt||dWnttfk
r2dSYnXdSdS)z%Is this string a valid Python script?execFTN)rTSyntaxError	TypeError)rQrr:r:r;	is_pythonPs
	rtcCs[y2tj|dd}|jd}WdQRXWnttfk
rP|SYnX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)rzlatin-1rNz#!)rr)rr+r,)r?fpmagicr:r:r;is_shZs	rwcCstj|gS)z@Quote a command line argument according to Windows parsing rules)
subprocesslist2cmdline)rYr:r:r;nt_quote_argdsrzcCsb|jds|jdr"dSt||r5dS|jdr^d|jdjkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    z.pyz.pywTz#!rrF)rartr
splitlinesr@)rrr:r:r;risr)rcGsdS)Nr:)rr:r:r;_chmod{sr|cCsctjd||yt||Wn8tjk
r^}ztjd|WYdd}~XnXdS)Nzchanging mode of %s to %ozchmod failed: %s)rrr|r=error)r>rr~r:r:r;rs
rc@seZdZdZgZeZeddZeddZ	eddZ
edd	Zed
dZdd
Z
eddZddZeddZeddZdS)CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    cCs|S)zV
        Choose the best CommandSpec class based on environmental conditions.
        r:)rOr:r:r;r}szCommandSpec.bestcCs(tjjtj}tjjd|S)N__PYVENV_LAUNCHER__)r=r>rArr?rr)rO_defaultr:r:r;_sys_executableszCommandSpec._sys_executablecCsOt||r|St|tr,||S|dkrB|jS|j|S)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        N)rrfrom_environmentfrom_string)rOparamr:r:r;
from_params

zCommandSpec.from_paramcCs||jgS)N)r)rOr:r:r;rszCommandSpec.from_environmentcCstj||j}||S)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )shlexr
split_args)rOstringrr:r:r;rszCommandSpec.from_stringcCsPtj|j||_tj|}t|sLdg|jdd.z#!rL)rxry)rrr:r:r;rszCommandSpec._renderN)rrrrrrrrPr}rrrrrrrrrrr:r:r:r;r~s		
r~c@seZdZeddZdS)WindowsCommandSpecrFN)rrrrrr:r:r:r;rsrc@seZdZdZejdjZeZ	e
ddddZe
ddddZe
dd	d
Z
eddZe
d
dZe
ddZe
ddZe
ddddZdS)r|z`
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    a
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        __requires__ = %(spec)r
        import re
        import sys
        from pkg_resources import load_entry_point

        if __name__ == '__main__':
            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
            sys.exit(
                load_entry_point(%(spec)r, %(group)r, %(name)r)()
            )
    NFcCsMtjdt|rtntj}|jd||}|j||S)NzUse get_argsr)warningsrDeprecationWarningWindowsScriptWriterr|r}get_script_headerr~)rOrr?wininstwriterheaderr:r:r;get_script_argsszScriptWriter.get_script_argscCsKtjdt|rd}|jjj|}|j||jS)NzUse get_headerz
python.exe)rrrcommand_spec_classr}rrr)rOrr?rcmdr:r:r;rs
zScriptWriter.get_script_headerccs|dkr|j}t|j}xdD]}|d}xn|j|jD]W\}}|j||jt}|j||||}	x|	D]}
|
VqWqWWq1WdS)z
        Yield write_script() argument tuples for a distribution's
        console_scripts and gui_scripts entry points.
        NconsoleguiZ_scripts)rr)	rrUro
get_entry_mapr_ensure_safe_namerr_get_script_args)rOrrrtype_rr	eprrrr:r:r;r~
s

"

zScriptWriter.get_argscCs(tjd|}|r$tddS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)rSsearchr)r	Zhas_path_sepr:r:r;rszScriptWriter._ensure_safe_namecCs*tjdt|r tjS|jS)NzUse best)rrrrr})rOZ
force_windowsr:r:r;
get_writer%szScriptWriter.get_writercCs?tjdks-tjdkr7tjdkr7tjS|SdS)zD
        Select the best ScriptWriter for this environment.
        win32javarN)rrr=r	_namerr})rOr:r:r;r}+s-
zScriptWriter.bestccs|||fVdS)Nr:)rOrr	rrr:r:r;r5szScriptWriter._get_script_argsrcCs/|jjj|}|j||jS)z;Create a #! line, getting options (if any) from script_text)rr}rrr)rOrr?rr:r:r;r:s
zScriptWriter.get_header)rrrrrMrNrrr~rrPrrr~rrrr}rrr:r:r:r;r|s 		
r|c@speZdZeZeddZeddZeddZeddZ	e
d	d
ZdS)rcCstjdt|jS)NzUse best)rrrr})rOr:r:r;rEszWindowsScriptWriter.get_writercCs2tdtd|}tjjdd}||S)zC
        Select the best ScriptWriter suitable for Windows
        r?ZnaturalZSETUPTOOLS_LAUNCHER)rWindowsExecutableLauncherWriterr=rr)rOZ
writer_lookuplauncherr:r:r;r}Ks
	zWindowsScriptWriter.bestc	#stdddd|}|tjdjjdkr]djt}tj|t	ddd	d
dddg}|j
||j||}fd
d|D}|||d|fVdS)z For Windows, add a .py extensionrz.pyarz.pywPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.z.pyz
-script.pyz.pycz.pyoz.execsg|]}|qSr:r:)rrd)r	r:r;res	z8WindowsScriptWriter._get_script_args..rN)rr=rr@rrrrrUserWarningrk_adjust_header)	rOrr	rrextrrrr:)r	r;rXs"
z$WindowsScriptWriter._get_script_argscCsrd}d}|dkr%||}}tjtj|tj}|jd|d|}|j|rn|S|S)z
        Make sure 'pythonw' is used for gui and and 'python' is used for
        console (regardless of what sys.executable is).
        zpythonw.exez
python.exerrrepl)rSrTescape
IGNORECASEsub_use_header)rOrZorig_headerrRrZ
pattern_ob
new_headerr:r:r;rhs
z"WindowsScriptWriter._adjust_headercCs2|ddjd}tjdkp1t|S)z
        Should _adjust_header use the replaced header?

        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        rr1"rr)rOrrr)rZclean_headerr:r:r;rvs	zWindowsScriptWriter._use_headerN)rrrrrrPrr}rrrrr:r:r:r;rBs
rc@s"eZdZeddZdS)rc#s|dkr$d}d}dg}nd}d}dddg}|j||}fd	d
|D}	|||d|	fVdt|d
fVtsd}
|
tdfVdS)zG
        For Windows, add a .py extension and an .exe launcher
        rz-script.pywz.pywcliz
-script.pyz.pyz.pycz.pyocsg|]}|qSr:r:)rrd)r	r:r;rs	zDWindowsExecutableLauncherWriter._get_script_args..rz.exerpz
.exe.manifestN)rget_win_launcherr<load_launcher_manifest)rOrr	rrZ
launcher_typerrhdrrZm_namer:)r	r;rs	
z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrPrr:r:r:r;rsrcCsGd|}tr(|jdd}n|jdd}td|S)z
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    z%s.exe.z-64.z-32.r)r<rPr!)typeZlauncher_fnr:r:r;rs

	rcCs>tjtd}tjr&|tS|jdtSdS)Nzlauncher manifest.xmlzutf-8)r;r!rrPY2varsr)r	manifestr:r:r;rs	rFcCstj|||S)N)rur)r>
ignore_errorsonerrorr:r:r;rsrcCs tjd}tj||S)N)r=umask)tmpr:r:r;rs
rcCsMddl}tjj|jd}|tjdr:__path__rargvrr4)rZargv0r:r:r;	bootstraps

rcsddlm}ddlmGfddd}|dkr[tjdd}t;|ddd	d
g|dtjdpd	d||WdQRXdS)
Nr)setup)r'cs(eZdZdZfddZdS)z-main..DistributionWithoutHelpCommandsrcs(tj|||WdQRXdS)N)_patch_usage
_show_help)rrkw)r'r:r;rs
z8main..DistributionWithoutHelpCommands._show_helpN)rrrcommon_usagerr:)r'r:r;DistributionWithoutHelpCommandssrr1script_argsz-qr1z-vrI	distclass)rrZsetuptools.distr'rrr)rrrrr:)r'r;r4s
c#shddl}tjdjfdd}|jj}||j_z	dVWd||j_XdS)Nrze
        usage: %(script)s [options] requirement_or_url ...
           or: %(script)s --help
        cstdtjj|S)Nscript)rr=r>rB)rI)USAGEr:r;	gen_usages	z_patch_usage..gen_usage)distutils.corerMrNrcorer)rrZsavedr:)rr;rs	r)rrrrrrdistutils.errorsrrrr	distutils.command.installr
rrrr
Zdistutils.command.build_scriptsrrArrr=rrurRrrSrr!rMrrr8rrxrrZsetuptools.externrZsetuptools.extern.six.movesrrrrZsetuptools.sandboxrZsetuptools.py31compatrrZsetuptools.py27compatrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrr;rr r!r"r#r$r%r&r'r(r)r*r+r,r-Zpkg_resources.py31compatfilterwarnings
PEP440Warning__all__r<r0rrFrJr9r1r/rrr3r5r2rLrrrUr\rrhrkr]r`builtin_module_namesr_rtrwrzrrr|ImportErrorrr~rZsys_executablerobjectr|rrrrrrrrrr4rrr:r:r:r;s"d	A))'lR 	


T`A 		
PK!Kl..+command/__pycache__/__init__.cpython-35.pycnu[

ReA@sdddddddddd	d
ddd
ddddddddgZddlmZddlZddlmZdejkrdejds
PK!',ww,command/__pycache__/bdist_rpm.cpython-35.pycnu[

Re@s/ddljjZGdddejZdS)Nc@s.eZdZdZddZddZdS)	bdist_rpmaf
    Override the default bdist_rpm behavior to do the following:

    1. Run egg_info to ensure the name and version are properly calculated.
    2. Always run 'install' using --single-version-externally-managed to
       disable eggs in RPM distributions.
    3. Replace dash with underscore in the version numbers for better RPM
       compatibility.
    cCs!|jdtjj|dS)Negg_info)run_commandorigrrun)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/bdist_rpm.pyrs
z
bdist_rpm.runcs|jj}|jdd}tjj|}d|d|fdd|D}|jd}d|}|j|||S)N-_z%define version csFg|]<}|jddjddjddjqS)zSource0: %{name}-%{version}.tarz)Source0: %{name}-%{unmangled_version}.tarzsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0line)line23line24rr	
s	
z-bdist_rpm._make_spec_file..z%define unmangled_version )distributionget_versionrrr_make_spec_fileindexinsert)rversionZ
rpmversionspecZ
insert_locZunmangled_versionr)rrr	rs




zbdist_rpm._make_spec_fileN)__name__
__module____qualname____doc__rrrrrr	rs	r)Zdistutils.command.bdist_rpmcommandrrrrrr	sPK!0y/)command/__pycache__/upload.cpython-35.pycnu[

Re@s9ddlZddlmZGdddejZdS)N)uploadc@s:eZdZdZddZddZddZdS)	rza
    Override default upload behavior to obtain password
    in a variety of different ways.
    cCsPtjj||jp"tj|_|jpF|jpF|j|_dS)N)	origrfinalize_optionsusernamegetpassgetuserpassword_load_password_from_keyring_prompt_for_password)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/upload.pyrs		zupload.finalize_optionscCs?y&td}|j|j|jSWntk
r:YnXdS)zM
        Attempt to load password from keyring. Suppress Exceptions.
        keyringN)
__import__get_password
repositoryr	Exception)rrrrr
r	s

z"upload._load_password_from_keyringcCs-ytjSWnttfk
r(YnXdS)zH
        Prompt for a password on the tty. Suppress Exceptions.
        N)rrKeyboardInterrupt)rrrr
r
#szupload._prompt_for_passwordN)__name__
__module____qualname____doc__rr	r
rrrr
rs
r)rdistutils.commandrrrrrr
sPK!~t+command/__pycache__/saveopts.cpython-35.pycnu[

Re@s0ddlmZmZGdddeZdS))edit_configoption_basec@s(eZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCs|j}i}xn|jD]c}|dkr.qxK|j|jD]4\}\}}|dkrD||j|i|sPK!͐i``.command/__pycache__/upload_docs.cpython-35.pycnu[

Re@sdZddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZddlmZd	d
lmZddZGd
ddeZdS)zpupload_docs

Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
)standard_b64encode)log)DistutilsOptionErrorN)six)http_clienturllib)iter_entry_points)uploadcCs%tjrdnd}|jd|S)Nsurrogateescapestrictzutf-8)rPY3encode)serrorsr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/upload_docs.py_encodesrc@seZdZdZdZdddejfddgZejZddZd
efgZ	ddZ
ddZddZddZ
eddZeddZddZdS)upload_docszhttps://pypi.python.org/pypi/zUpload documentation to PyPIzrepository=rzurl of repository [default: %s]
show-responseN&display full response text from serverupload-dir=directory to uploadcCs.|jdkr*xtddD]}dSWdS)Nzdistutils.commandsbuild_sphinxT)
upload_dirr)selfeprrr
has_sphinx/szupload_docs.has_sphinxrcCs#tj|d|_d|_dS)N)r
initialize_optionsr
target_dir)rrrrr6s
	zupload_docs.initialize_optionscCstj||jdkrs|jrF|jd}|j|_q|jd}tjj	|j
d|_n|jd|j|_d|jkrt
jd|jd|jdS)NrbuildZdocsrzpypi.python.orgz3Upload_docs command is deprecated. Use RTD instead.zUsing upload directory %s)r
finalize_optionsrrget_finalized_commandZbuilder_target_dirr ospathjoin
build_baseensure_dirname
repositoryrwarnannounce)rrr!rrrr";s


zupload_docs.finalize_optionscCstj|d}z|j|jxtj|jD]\}}}||jkrv|rvd}t||jxp|D]h}tjj||}|t	|jdj
tjj}	tjj|	|}
|j||
q}Wq8WWd|j
XdS)Nwz'no files found in upload directory '%s')zipfileZipFilemkpathr r$walkrr%r&lenlstripsepwriteclose)rfilenamezip_filerootdirsfilestmplnamefullZrelativedestrrrcreate_zipfileKs"
(zupload_docs.create_zipfilecCsx!|jD]}|j|q
Wtj}|jjj}tjj	|d|}z|j
||j|Wdtj
|XdS)Nz%s.zip)get_sub_commandsrun_commandtempfilemkdtempdistributionmetadataget_namer$r%r&r?upload_fileshutilrmtree)rcmd_nameZtmp_dirr<r7rrrrun[s
zupload_docs.runccs|\}}d|}t|ts.|g}x|D]{}t|tri|d|d7}|d}nt|}|Vt|VdV|V|r5|dddkr5dVq5WdS)	Nz*
Content-Disposition: form-data; name="%s"z; filename="%s"rr	s

s
s
)
isinstancelisttupler)itemsep_boundarykeyvaluestitlevaluerrr_build_partis
	

zupload_docs._build_partcCsd}d|}|d}|df}tj|jd|}t||j}tjj|}tj||}	d|jd}
dj	|	|
fS)	z=
        Build up the MIME payload for the POST data
        s3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--s
rQz multipart/form-data; boundary=%sascii)
	functoolspartialrVmapitems	itertoolschain
from_iterabledecoder&)clsdataboundaryrQZend_boundaryZ	end_itemsZbuilderZpart_groupspartsZ
body_itemscontent_typerrr_build_multipart}s

		zupload_docs._build_multipartcCs&t|d}|j}WdQRX|jj}ddd|jdtjj||fi}t|j	d|j
}t|}tj
r|jd}d|}|j|\}}	d	|j}
|j|
tjtjj|j\}}}
}}}|r|r|s t|d
kr>tj|}n.|dkr\tj|}ntd|d
}yw|j|jd|
|	}|jd||jdtt||jd||j |j!|WnEt"j#k
r0}z"|jt|tj$dSWYdd}~XnX|j%}|j&dkrxd|j&|j'f}
|j|
tjn|j&dkr|j(d}|dkrd|j}d|}
|j|
tjn)d|j&|j'f}
|j|
tj$|j)r"t*dd|jdddS)Nrbz:actionZ
doc_uploadr<content:rWzBasic zSubmitting documentation to %shttphttpszunsupported schema POSTzContent-typezContent-length
AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %s-K)+openreadrDrErFr$r%basenamerusernamepasswordrrr
r`rfr)r+rINFOrparseurlparseAssertionErrorrHTTPConnectionHTTPSConnectionconnect
putrequest	putheaderstrr1
endheaderssendsocketerrorERRORgetresponsestatusreason	getheader
show_responseprint)rr6frhmetarbcredentialsauthbodyctmsgZschemanetlocurlparamsquery	fragmentsconnreerlocationrrrrGs`	

'


	zupload_docs.upload_file)rNr)rNr)__name__
__module____qualname__DEFAULT_REPOSITORYdescriptionr
user_optionsboolean_optionsrsub_commandsrr"r?rKstaticmethodrVclassmethodrfrGrrrrrs"
		r)__doc__base64r	distutilsrdistutils.errorsrr$rr-rBrHr]rYZsetuptools.externrZsetuptools.extern.six.movesrr
pkg_resourcesrr
rrrrrrs PK!b<.command/__pycache__/install_lib.cpython-35.pycnu[

Re@s]ddlZddlZddlmZmZddljjZGdddejZdS)N)productstarmapc@seZdZdZddZddZddZedd	Zd
dZ	edd
Z
ddddddZddZdS)install_libz9Don't add compiled flags to filenames of non-Python filescCs3|j|j}|dk	r/|j|dS)N)buildinstallbyte_compile)selfoutfilesr
/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/install_lib.pyrun
s
zinstall_lib.runcsJfddjD}t|j}ttj|S)z
        Return a collections.Sized collections.Container of paths to be
        excluded for single_version_externally_managed installations.
        c3s+|]!}j|D]}|VqqdS)N)
_all_packages).0Zns_pkgpkg)rr
r	sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZall_packagesZ
excl_specsr
)rrget_exclusionsszinstall_lib.get_exclusionscCs,|jd|g}tjj|j|S)zw
        Given a package name and exclusion path within that package,
        compute the full exclusion path.
        .)splitospathjoininstall_dir)rrZexclusion_pathpartsr
r
rrszinstall_lib._exclude_pkg_pathccs.x'|r)|V|jd\}}}qWdS)zn
        >>> list(install_lib._all_packages('foo.bar.baz'))
        ['foo.bar.baz', 'foo.bar', 'foo']
        rN)
rpartition)pkg_namesepchildr
r
rr
's	zinstall_lib._all_packagescCs<|jjsgS|jd}|j}|r8|jjSgS)z
        Get namespace packages (list) but only for
        single_version_externally_managed installations and empty otherwise.
        r)distributionZnamespace_packagesget_finalized_commandZ!single_version_externally_managed)rZinstall_cmdZsvemr
r
rr1s
	zinstall_lib._get_SVEM_NSPsccsidVdVdVttds"dStjjddtj}|dV|d	V|d
V|dVdS)zk
        Generate file paths to be excluded for namespace packages (bytecode
        cache files).
        z__init__.pyz__init__.pycz__init__.pyoget_tagN__pycache__z	__init__.z.pycz.pyoz
.opt-1.pycz
.opt-2.pyc)hasattrimprrrr#)baser
r
rrAs			z install_lib._gen_exclusion_pathsrc	s|r|r|st|jsAtjj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcsP|kr jd|dSjd|tjj|j||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdst)excluder*r	r
rpfgs	
z!install_lib.copy_tree..pf)	AssertionErrorrorigr	copy_treeZsetuptools.archive_utilr)	distutilsr*)	rinfileoutfile
preserve_modepreserve_timespreserve_symlinkslevelr)r2r
)r1r*r	rr5Vs
zinstall_lib.copy_treecs?tjj|}|jr;fdd|DS|S)Ncs"g|]}|kr|qSr
r
)rf)r1r
r
xs	z+install_lib.get_outputs..)r4rget_outputsr)routputsr
)r1rr?ts
zinstall_lib.get_outputsN)
__name__
__module____qualname____doc__rrrstaticmethodr
rrr5r?r
r
r
rrs
r)	rr&	itertoolsrrZdistutils.command.install_libcommandrr4r
r
r
rsPK!J )command/__pycache__/rotate.cpython-35.pycnu[

Ret@sddlmZddlmZddlmZddlZddlZddlm	Z	ddl
mZGdddeZdS)	)convert_path)log)DistutilsOptionErrorN)six)Commandc@sUeZdZdZdZdddgZgZdd
ZddZddZ	dS)rotatezDelete older distributionsz2delete older distributions, keeping N newest filesmatch=mpatterns to match (required)	dist-dir=d%directory where the distributions arekeep=k(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/rotate.pyinitialize_optionss		zrotate.initialize_optionscCs|jdkrtd|jdkr6tdyt|j|_Wntk
rltdYnXt|jtjrdd|jjdD|_|j	dd	dS)
NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSs"g|]}t|jqSr)rstrip).0prrr
+s	z+rotate.finalize_options..,bdistr)rr)
rrrint
ValueError
isinstancerstring_typessplitset_undefined_options)rrrrfinalize_optionss	
"zrotate.finalize_optionscCs|jdddlm}x|jD]}|jjd|}|tjj|j|}dd|D}|j	|j
tjdt
||||jd}x\|D]T\}}tjd||jstjj|rtj|qtj|qWq'WdS)	Negg_infor)glob*cSs(g|]}tjj||fqSr)ospathgetmtime)rfrrrr6s	zrotate.run..z%d file(s) matching %szDeleting %s)run_commandr&rdistributionget_namer(r)joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)rr&patternfilestr+rrrrun/s 


	z
rotate.runN)rr	r
)rrr
)rrr)
__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsrr$r<rrrrrs	r)
distutils.utilr	distutilsrdistutils.errorsrr(r6Zsetuptools.externr
setuptoolsrrrrrrsPK!2b
b
-command/__pycache__/build_clib.cpython-35.pycnu[

Re@s_ddljjZddlmZddlmZddlm	Z	GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@s"eZdZdZddZdS)
build_clibav
    Override the default build_clib behaviour to do the following:

    1. Implement a rudimentary timestamp-based dependency system
       so 'compile()' doesn't run every time.
    2. Add more keys to the 'build_info' dictionary:
        * obj_deps - specify dependencies for each object compiled.
                     this should be a dictionary mapping a key
                     with the source filename to a list of
                     dependencies. Use an empty string for global
                     dependencies.
        * cflags   - specify a list of additional flags to pass to
                     the compiler.
    c
Cs%x|D]\}}|jd}|dksDt|ttfrTtd|t|}tjd||jdt}t|tstd|g}|jdt}t|ttfstd|xx|D]p}|g}	|	j||j|t}
t|
ttfsAtd||	j|
|j	|	qW|j
j|d|j}t
||ggfkr|jd}|jd	}
|jd
}|j
j|d|jd|d	|
d|d|j}|j
j||d|jd|jqWdS)
Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list'
output_dirmacrosinclude_dirscflagsZextra_postargsdebug)get
isinstancelisttuplerrinfodictextendappendcompilerZobject_filenames
build_temprcompiler
Zcreate_static_libr)self	librariesZlib_nameZ
build_inforrZdependenciesZglobal_depssourceZsrc_depsZ
extra_depsZexpected_objectsr
rrZobjectsr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/build_clib.pybuild_librariess`"



	


					zbuild_clib.build_librariesN)__name__
__module____qualname____doc__rrrrrrsr)
Zdistutils.command.build_clibcommandrorigdistutils.errorsr	distutilsrZsetuptools.dep_utilrrrrrsPK!Rנ+command/__pycache__/register.cpython-35.pycnu[

Re@s/ddljjZGdddejZdS)Nc@s(eZdZejjZddZdS)registercCs!|jdtjj|dS)Negg_info)run_commandorigrrun)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/register.pyrs
zregister.runN)__name__
__module____qualname__rr__doc__rrrrr	rsr)Zdistutils.command.registercommandrrrrrr	sPK!.a		2command/__pycache__/install_scripts.cpython-35.pycnu[

Re	@ssddlmZddljjZddlZddlZddlm	Z	m
Z
mZGdddejZdS))logN)DistributionPathMetadataensure_directoryc@s=eZdZdZddZddZdddZd	S)
install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstjj|d|_dS)NF)origrinitialize_optionsno_ep)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/install_scripts.pyrsz"install_scripts.initialize_optionscCs`ddljj}|jd|jjr>tjj|n	g|_	|j
rTdS|jd}t|j
t|j
|j|j|j}|jd}t|dd}|jd}t|dd}|j}|rd}|j}|tjkr|g}|j}|jjj|}	x-|j||	jD]}
|j|
qEWdS)	Nregg_info
build_scripts
executable
bdist_wininstZ_is_runningFz
python.exe)setuptools.command.easy_installcommandeasy_installrun_commanddistributionscriptsrrrunoutfilesr	get_finalized_commandrZegg_baserr
egg_nameZegg_versiongetattrZScriptWriterZWindowsScriptWritersysrbestZcommand_spec_class
from_paramZget_argsZ	as_headerwrite_script)r
eiZei_cmddistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstwritercmdargsrrrrs2
					zinstall_scripts.runtc
Gsddlm}m}tjd||jtjj|j|}|j	j
||}|jst|t
|d|}	|	j||	j||d|dS)z1Write an executable file to the scripts directoryr)chmod
current_umaskzInstalling %s script to %swiN)rr&r'rinfoinstall_dirospathjoinrappenddry_runropenwriteclose)
r
script_namecontentsmodeZignoredr&r'targetmaskfrrrr3s		


zinstall_scripts.write_scriptN)__name__
__module____qualname____doc__rrrrrrrr	s#r)	distutilsrZ!distutils.command.install_scriptsrrrr+r
pkg_resourcesrrrrrrrs
PK!ZFxx*command/__pycache__/develop.cpython-35.pycnu[

ReX@sddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZddlmZddlmZddlZGd	d
d
ejeZGdddeZdS)
)convert_path)log)DistutilsErrorDistutilsOptionErrorN)six)DistributionPathMetadatanormalize_path)easy_install)
namespacesc@seZdZdZdZejddgZejdgZd	Zd
dZ	dd
Z
ddZeddZ
ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode'	uninstalluUninstall this source package	egg-path=N-Set the path to be used in the .egg-link fileFcCsA|jr)d|_|j|jn
|j|jdS)NT)r
Z
multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_options)selfr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/develop.pyruns		


zdevelop.runcCs5d|_d|_tj|d|_d|_dS)N.)r
egg_pathr
initialize_options
setup_pathZalways_copy_from)rrrrr's
		
	zdevelop.initialize_optionscCs|jd}|jr@d}|j|jf}t|||jg|_tj||j|j	|j
jtjd|jd}t
jj|j||_|j|_|jdkrt
jj|j|_t|j}tt
jj|j|j}||kr0td|t|t|t
jj|jd|j|_|j|j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz	.egg-linkzA--egg-path must be a relative path from the install directory to project_name)get_finalized_commandZbroken_egg_inforregg_nameargsr
finalize_optionsexpand_basedirsexpand_dirsZ
package_indexscanglobospathjoininstall_diregg_linkegg_baserabspathr	rrrdist_resolve_setup_pathr)reitemplater Zegg_link_fntargetrrrrr!.s<	




zdevelop.finalize_optionscCs|jtjdjd}|tjkrDd|jdd}ttjj|||}|ttjkrt	d|ttj|S)z
        Generate a path from egg_base back to '.' where the
        setup script resides and ensure that path points to the
        setup path from $install_dir/$egg_path.
        /z../zGCan't get a consistent path to setup script from installation directory)
replacer&seprstripcurdircountr	r'r(r)r+r)rZ
path_to_setupZresolvedrrrr.Xszdevelop._resolve_setup_pathcCstjrt|jddr|jddd|jd|jd}t|j}|jdd||jd|jddd|jd|jd}||_	||j
_t||j
|j
_n-|jd|jddd	|jd|jtjr4|jtjdt_|jtjd
|j|j|jst|jd"}|j|j	d|jWdQRX|jd|j
|jdS)
NZuse_2to3Fbuild_pyZinplacerrr+	build_extr3zCreating %s (link to %s)w
)rPY3getattrdistributionreinitialize_commandrun_commandrr		build_librr-locationrr	_providerZinstall_site_py
setuptoolsZbootstrap_install_fromr
Zinstall_namespacesrinfor*r+dry_runopenwriterZprocess_distributionno_deps)rZbpy_cmdZ
build_pathZei_cmdfrrrris4


	


		
	"zdevelop.install_for_developmentcCstjj|jrtjd|j|jt|j}dd|D}|j||j	g|j	|j
gfkrtjd|dS|jstj
|j|js|j|j|jjrtjddS)NzRemoving %s (link to %s)cSsg|]}|jqSr)r6).0linerrr
s	z*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r&r'existsr*rrFr+rHcloserrwarnrGunlinkZ
update_pthr-r?scripts)rZ
egg_link_filecontentsrrrrs
		zdevelop.uninstall_linkc
Cs||jk	rtj||S|j|x|jjp>gD]k}tjjt	|}tjj
|}tj|}|j
}WdQRX|j||||q?WdS)N)r-r
install_egg_scriptsinstall_wrapper_scriptsr?rSr&r'r,rbasenameiorHreadZinstall_script)rr-script_nameZscript_pathstrmscript_textrrrrUs
zdevelop.install_egg_scriptscCst|}tj||S)N)VersionlessRequirementr
rV)rr-rrrrVszdevelop.install_wrapper_scripts)r
rr)rNr)__name__
__module____qualname____doc__descriptionr
user_optionsboolean_optionsZcommand_consumes_argumentsrrr!staticmethodr.rrrUrVrrrrrs
	*/rc@s:eZdZdZddZddZddZdS)	r]az
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.

    >>> dist = Distribution(project_name='foo', version='1.0')
    >>> str(dist.as_requirement())
    'foo==1.0'
    >>> adapted_dist = VersionlessRequirement(dist)
    >>> str(adapted_dist.as_requirement())
    'foo'
    cCs
||_dS)N)_VersionlessRequirement__dist)rr-rrr__init__szVersionlessRequirement.__init__cCst|j|S)N)r>rf)rnamerrr__getattr__sz"VersionlessRequirement.__getattr__cCs|jS)N)r)rrrras_requirementsz%VersionlessRequirement.as_requirementN)r^r_r`rargrirjrrrrr]sr])distutils.utilr	distutilsrdistutils.errorsrrr&r%rXZsetuptools.externr
pkg_resourcesrrr	Zsetuptools.command.easy_installr
rErZDevelopInstallerrobjectr]rrrrsPK!]m""""'command/__pycache__/test.cpython-35.pycnu[

ReT#@s>ddlZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZdd	lmZGd
ddeZGdd
d
e Z!GdddeZ"dS)N)DistutilsErrorDistutilsOptionError)log)
TestLoader)six)mapfilter)	resource_listdirresource_existsnormalize_pathworking_set_namespace_packagesevaluate_markeradd_activation_listenerrequire
EntryPoint)Command)
unittest_mainc@seZdZdddZdS)ScanningLoaderNcCsg}|jtj||t|drA|j|jt|drxt|jdD]}|jdr|dkr|jd|dd}n-t|j|d	rc|jd|}nqc|j|j	|qcWt
|d
kr|j|S|dSdS)
aReturn a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        additional_tests__path__z.pyz__init__.py.Nz/__init__.pyr)appendrloadTestsFromModulehasattrrr	__name__endswithr
ZloadTestsFromNamelenZ
suiteClass)selfmodulepatterntestsfile	submoduler(/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/test.pyrs
z"ScanningLoader.loadTestsFromModule)r
__module____qualname__rr(r(r(r)rsrc@s+eZdZddZdddZdS)NonDataPropertycCs
||_dS)N)fget)r"r-r(r(r)__init__5szNonDataProperty.__init__NcCs|dkr|S|j|S)N)r-)r"objZobjtyper(r(r)__get__8szNonDataProperty.__get__)rr*r+r.r0r(r(r(r)r,4sr,c@seZdZdZdZd%d&d'gZdd
ZddZeddZ	ddZ
ddZej
gddZeej
ddZeddZddZddZed d!Zed"d#Zd$S)(testz.Command to run unit tests after in-place buildz#run unit tests after in-place buildtest-module=m$Run 'test_suite' in specified moduletest-suite=s9Run single test, case or suite (e.g. 'module.test_suite')test-runner=rTest runner to usecCs(d|_d|_d|_d|_dS)N)
test_suitetest_moduletest_loadertest_runner)r"r(r(r)initialize_optionsJs			ztest.initialize_optionscCs|jr$|jr$d}t||jdkrd|jdkrT|jj|_n|jd|_|jdkrt|jdd|_|jdkrd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz.test_suiter=z&setuptools.command.test:ScanningLoaderr>)r;r<rdistributionr=getattrr>)r"msgr(r(r)finalize_optionsPs	ztest.finalize_optionscCst|jS)N)list
_test_args)r"r(r(r)	test_argscsztest.test_argsccs#|jrdV|jr|jVdS)Nz	--verbose)verboser;)r"r(r(r)rEgs		ztest._test_argsc	Cs|j|WdQRXdS)zI
        Backward compatibility for project_on_sys_path context.
        N)project_on_sys_path)r"funcr(r(r)with_project_on_sys_pathms
ztest.with_project_on_sys_pathc	cstjot|jdd}|r|jddd|jd|jd}t|j}|jdd||jd|jddd|jdn-|jd|jddd	|jd|jd}t	j
dd}t	jj}zyt|j
}t	j
jd|tjtd
dtd|j|jf|j|g
dVWdQRXWd|t	j
ddsz*test.project_on_sys_path..z%s==%s)rPY3rAr@reinitialize_commandrun_commandget_finalized_commandr	build_libsyspathmodulescopyrNinsertrr.rregg_nameZegg_versionpaths_on_pythonpathclearupdate)	r"Z
include_distsZ	with_2to3Zbpy_cmdZ
build_pathZei_cmdold_pathZold_modulesZproject_pathr(r(r)rHts8





ztest.project_on_sys_pathccst}tjjd|}tjjdd}zUtjj|}td||g}tjj|}|r|tjds	z%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_requireitems	itertoolschain)rQZir_dZtr_dZer_dr(r(r)
install_distss
ztest.install_distscCs|j|j}dj|j}|jrB|jd|dS|jd|ttjd|}|j	|#|j
|jWdQRXWdQRXdS)N zskipping "%s" (dry run)zrunning "%s"location)rvr@rh_argvdry_runannounceroperator
attrgetterr^rH	run_tests)r"Zinstalled_distscmdrjr(r(r)runs	
ztest.runc	CsQtjrt|jddr|jjdd}|tkrg}|tjkrb|j	||d7}x-tjD]"}|j
|rv|j	|qvWtttjj
|tjdkrin	ddi}tdd|jd|j|jd	|j|j|}|jjsMd
|j}|j|tjt|dS)NrKFrrexitZ
testLoaderZ
testRunnerzTest failed: %s)rr)rrSrAr@r;splitr
rXrZrrnrDr__delitem__version_inforry_resolve_as_epr=r>resultZ
wasSuccessfulr{rERRORr)r"r#Zdel_modulesnameZ
exit_kwargr1rBr(r(r)r~s*

!	
ztest.run_testscCsdg|jS)Nunittest)rF)r"r(r(r)rysz
test._argvcCs0|dkrdStjd|}|jS)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Nzx=)rparseresolve)valparsedr(r(r)rsztest._resolve_as_epN)r2r3r4)r5r6r7)r8r9r:)rr*r+__doc__descriptionuser_optionsr?rCr,rFrErJ
contextlibcontextmanagerrHstaticmethodr^rvrr~propertyryrr(r(r(r)r1>s(	-r1)#rdr|rXrrtdistutils.errorsrr	distutilsrrrZsetuptools.externrZsetuptools.extern.six.movesrr
pkg_resourcesr	r
rrr
rrrr
setuptoolsrZsetuptools.py31compatrrrcr,r1r(r(r(r)s@ 
PK!Dy*command/__pycache__/install.cpython-35.pycnu[

ReK@sddlmZddlZddlZddlZddlZddljjZ	ddl
Z
e	jZGddde	jZdde	jjDej
e_dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZddd	fd
dd	fgZe	eZ
dd
ZddZddZ
ddZeddZddZdS)installz7Use easy_install to install the package, w/dependenciesold-and-unmanageableNTry not to use this!!single-version-externally-managed5used by system package builders to create 'flat' eggsinstall_egg_infocCsdS)NT)selfr	r	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/install.pyszinstall.install_scriptscCsdS)NTr	)r
r	r	rrscCs&tjj|d|_d|_dS)N)origrinitialize_optionsold_and_unmanageable!single_version_externally_managed)r
r	r	rr s	zinstall.initialize_optionscCsRtjj||jr%d|_n)|jrN|jrN|jrNtddS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordr)r
r	r	rr%s		zinstall.finalize_optionscCs8|js|jr"tjj|Sd|_d|_dS)N)rrrrhandle_extra_path	path_file
extra_dirs)r
r	r	rr0s	zinstall.handle_extra_pathcCsX|js|jr"tjj|S|jtjsJtjj|n
|jdS)N)	rrrrrun_called_from_setupinspectcurrentframedo_egg_install)r
r	r	rr:s
zinstall.runcCs|dkrHd}tj|tjdkrDd}tj|dStj|d}|dd\}tj|}|jjdd	}|d
ko|j	dkS)a
        Attempt to detect whether run() was called from setup() or by another
        command.  If called by setup(), the parent caller will be the
        'run_command' method in 'distutils.dist', and *its* caller will be
        the 'run_commands' method.  If called any other way, the
        immediate caller *might* be 'run_command', but it won't have been
        called by 'run_commands'. Return True in that case or if a call stack
        is unavailable. Return False otherwise.
        Nz4Call stack not available. bdist_* commands may fail.
IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distrun_commands)
warningswarnplatformpython_implementationrgetouterframesgetframeinfo	f_globalsgetfunction)Z	run_framemsgresZcallerinfoZ
caller_moduler	r	rrEs

zinstall._called_from_setupcCs|jjd}||jddd|jd|j}|jd|_|jjtjd|j	d|jj
djg}tj
r|jd	tj
||_|jdt_
dS)
Neasy_installargsxrr.z*.eggZ	bdist_eggr)distributionget_command_classrrensure_finalizedZalways_copy_fromZ
package_indexscanglobrun_commandget_command_objZ
egg_output
setuptoolsZbootstrap_install_frominsertr0r)r
r/cmdr0r	r	rr`s$
	
		
zinstall.do_egg_install)rNr)rNr)r!
__module____qualname____doc__rruser_optionsboolean_optionsnew_commandsdict_ncrrrrstaticmethodrrr	r	r	rrs 	
	

rcCs)g|]}|dtjkr|qS)r)rrD).0r<r	r	r
{s	rG)distutils.errorsrrr7r#r%distutils.command.installcommandrrr:_installsub_commandsrBr	r	r	rs	lPK!}
}
(command/__pycache__/alias.cpython-35.pycnu[

Rez	@snddlmZddlmZddlmZmZmZddZGdddeZ	dd	Z
d
S))DistutilsOptionError)map)edit_configoption_baseconfig_filecCsJx$dD]}||krt|SqW|j|gkrFt|S|S)z4Quote an argument for later parsing by shlex.split()"'\#)rrr	r
)reprsplit)argcr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/alias.pyshquotes

rc@sfeZdZdZdZdZdgejZejdgZddZ	d	d
Z
ddZd
S)aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsTremoverremove (unset) the aliascCs#tj|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs
	zalias.initialize_optionscCs;tj||jr7t|jdkr7tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrr)rrrrr#s
zalias.finalize_optionscCs |jjd}|jsZtdtdx$|D]}tdt||q6WdSt|jdkr|j\}|jrd}q||krtdt||dStd|dSn2|jd}djtt	|jdd}t
|jd||ii|jdS)	NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr )
distributionget_option_dictrprintformat_aliasrrjoinrrrfilenamedry_run)rrrcommandrrrrun+s&	


		
%z	alias.runN)rrr)__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsruser_optionsboolean_optionsrrr&rrrrrs
rcCs{||\}}|tdkr+d}n@|tdkrFd}n%|tdkrad}n
d|}||d|S)	Nglobalz--global-config userz--user-config localz
--filename=%rr)r)namersourcer%rrrr!Fs			
r!N)distutils.errorsrZsetuptools.extern.six.movesrZsetuptools.command.setoptrrrrrr!rrrrs

4PK!q
q
3command/__pycache__/install_egg_info.cpython-35.pycnu[

Re@s~ddlmZmZddlZddlmZddlmZddlmZddl	Z	Gdddej
eZdS))logdir_utilN)Command)
namespaces)unpack_archivec@saeZdZdZdZdgZddZddZd	d
ZddZ	d
dZ
dS)install_egg_infoz.Install an .egg-info directory for the packageinstall-dir=ddirectory to install tocCs
d|_dS)N)install_dir)selfr
/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCs{|jdd|jd}tjdd|j|jjd}|j|_tj	j
|j||_g|_
dS)Ninstall_libregg_infoz	.egg-info)rr)set_undefined_optionsget_finalized_command
pkg_resourcesDistributionegg_nameZegg_versionrsourceospathjoinrtargetoutputs)rZei_cmdbasenamer
r
rfinalize_optionss	z!install_egg_info.finalize_optionscCs|jdtjj|jrTtjj|jrTtj|jd|jn8tjj	|jr|j
tj|jfd|j|jstj
|j|j
|jfd|j|jf|jdS)Nrdry_runz	Removing zCopying %s to %s)run_commandrrisdirrislinkrremove_treerexistsexecuteunlinkrensure_directorycopytreerZinstall_namespaces)rr
r
rrun!s
+#	 zinstall_egg_info.runcCs|jS)N)r)rr
r
rget_outputs.szinstall_egg_info.get_outputscs,fdd}tjj|dS)Ncs[x1dD])}|j|s,d||krdSqWjj|tjd|||S)N.svn/CVS//zCopying %s to %s)r+r,)
startswithrappendrdebug)srcdstskip)rr
rskimmer3s
z*install_egg_info.copytree..skimmer)rrr)rr4r
)rrr(1szinstall_egg_info.copytreeN)rr	r
)__name__
__module____qualname____doc__descriptionuser_optionsrrr)r*r(r
r
r
rr
s	
r)	distutilsrrr
setuptoolsrrZsetuptools.archive_utilrrZ	Installerrr
r
r
rsPK!eL2Y2Y+command/__pycache__/egg_info.cpython-35.pycnu[

Re*a@sddZddlmZddlmZddlmZddlm	Z	ddlZddlZddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&ddl'j(Z(ddl)m*Z*ddl+m,Z,ddZ-GdddeZ.GdddeZGdddeZ/ddZ0ddZ1ddZ2dd Z3d!d"Z4d#d$Z5d%d&Z6d'd(Z7d)d*d+Z8d,d-Z9d.d/Z:dS)0zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError)convert_path)logN)six)map)Command)sdist)walk_revctrl)edit_config)	bdist_egg)parse_requirements	safe_name
parse_versionsafe_versionyield_lines
EntryPointiter_entry_pointsto_filename)glob)	packagingcCszd}|jtjj}tjtj}d|f}xt|D]\}}|t|dk}|dkr|r|d7}qG|d||f7}qGd}t|}	x||	kr>||}
|
dkr||d7}nJ|
d	kr||7}n1|
d
kr|d}||	kr<||dkr<|d}||	krb||dkrb|d}x*||	kr||dkr|d}qeW||	kr|tj|
7}q1||d|}d}
|ddkrd
}
|dd}|
tj|7}
|d|
f7}|}n|tj|
7}|d7}qW|sG||7}qGW|d7}tj|dtj	tj
BS)z
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    z[^%s]z**z.*z
(?:%s+%s)*r*?[!]^Nz[%s]z\Zflags)splitospathsepreescape	enumeratelencompile	MULTILINEDOTALL)rpatchunksr#Z
valid_charcchunk
last_chunkiZ	chunk_lencharZinner_iinner
char_classr4/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/egg_info.pytranslate_pattern$sV






	
r6c@seZdZdZd)d*d+d,gZdgZddiZddZeddZ	e	j
ddZ	ddZddZdddZ
ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(S)-egg_infoz+create a distribution's .egg-info directory	egg-base=eLdirectory containing .egg-info directories (default: top of the source tree)tag-dated0Add date stamp (e.g. 20050528) to version number
tag-build=b-Specify explicit tag to add to version numberno-dateD"Don't include date stamp [default]cCsLd|_d|_d|_d|_d|_d|_d|_d|_dS)NrF)egg_nameegg_versionegg_baser7	tag_buildtag_datebroken_egg_infovtags)selfr4r4r5initialize_optionss							zegg_info.initialize_optionscCsdS)Nr4)rKr4r4r5tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr4)rKvaluer4r4r5rMscCsOttdt}|}|j|dr?r@)rArBrC)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrLpropertyrMsetterrUrqryrrrurYrrSrrgr4r4r4r5r7ws(		
/r7c@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZdS)rcCs|j|\}}}}|dkrt|jddj|x|D]%}|j|sHtjd|qHWnc|dkr|jddj|x:|D]%}|j|stjd|qWn
|dkr&|jd	dj|x|D]%}|j|stjd
|qWn|dkr|jddj|x|D]%}|j|sStjd
|qSWnX|dkr|jd|dj|fx)|D]+}|j	||stjd||qWn|dkrI|jd|dj|fx|D]+}|j
||stjd||qWn|dkr|jd||j|stjd|nO|dkr|jd||j|stjd|nt
d|dS)Nincludezinclude  z%warning: no files found matching '%s'excludezexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include z>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %sz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'graftzgraft z+warning: no directories found matching '%s'prunezprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')Z_parse_template_linedebug_printrfrrrtrglobal_includeglobal_excluderecursive_includerecursive_excluderrr)rKlineactionpatternsdirZdir_patternpatternr4r4r5process_template_line=sd

	
	
		
		
		
	
zFileList.process_template_linecCsod}xbtt|jdddD]A}||j|r&|jd|j||j|=d}q&W|S)z
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Frz
 removing Tr)ranger'filesr)rK	predicatefoundr0r4r4r5
_remove_filess&

zFileList._remove_filescCs0ddt|D}|j|t|S)z#Include files that match 'pattern'.cSs(g|]}tjj|s|qSr4)r!r"isdir).0rr4r4r5
s	z$FileList.include..)rextendbool)rKrrr4r4r5rs
zFileList.includecCst|}|j|jS)z#Exclude files that match 'pattern'.)r6rmatch)rKrrr4r4r5rszFileList.excludecCsNtjj|d|}ddt|ddD}|j|t|S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        z**cSs(g|]}tjj|s|qSr4)r!r"r)rrr4r4r5rs	z.FileList.recursive_include..	recursiveT)r!r"rfrrr)rKrrZfull_patternrr4r4r5rs
zFileList.recursive_includecCs.ttjj|d|}|j|jS)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        z**)r6r!r"rfrr)rKrrrr4r4r5rszFileList.recursive_excludecCs0ddt|D}|j|t|S)zInclude all files from 'dir/'.cSs/g|]%}tjj|D]}|qqSr4)r_rfindall)rZ	match_diritemr4r4r5rs	z"FileList.graft..)rrr)rKrrr4r4r5rs	
zFileList.graftcCs+ttjj|d}|j|jS)zFilter out files from 'dir/'.z**)r6r!r"rfrr)rKrrr4r4r5rszFileList.prunecsg|jdkr|jttjjd|fdd|jD}|j|t|S)z
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nz**cs%g|]}j|r|qSr4)r)rr)rr4r5rs	z+FileList.global_include..)allfilesrr6r!r"rfrr)rKrrr4)rr5rs

zFileList.global_includecCs+ttjjd|}|j|jS)zD
        Exclude all files anywhere that match the pattern.
        z**)r6r!r"rfrr)rKrrr4r4r5rszFileList.global_excludecCsN|jdr|dd}t|}|j|rJ|jj|dS)N
rr)rr
_safe_pathrappend)rKrr"r4r4r5rs
zFileList.appendcCs |jjt|j|dS)N)rrfilterr)rKpathsr4r4r5rszFileList.extendcCs"tt|j|j|_dS)z
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N)r]rrr)rKr4r4r5_repairszFileList._repaircCsd}tj|}|dkr6tjd|dStj|d}|dkrktj||ddSy,tjj|stjj|rdSWn+tk
rtj||t	j
YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T)
unicode_utilsfilesys_decoderrtZ
try_encoder!r"rsUnicodeEncodeErrorsysgetfilesystemencoding)rKr"Zenc_warnZu_pathZ	utf8_pathr4r4r5rs$
zFileList._safe_pathN)rrrrrrrrrrrrrrrrrr4r4r4r5r:sI



rc@seZdZdZddZddZddZdd	Zd
dZdd
Z	e
ddZddZddZ
dS)rzMANIFEST.incCs(d|_d|_d|_d|_dS)Nr)Zuse_defaultsrZ
manifest_onlyZforce_manifest)rKr4r4r5rLs			z!manifest_maker.initialize_optionscCsdS)Nr4)rKr4r4r5rqszmanifest_maker.finalize_optionscCst|_tjj|js+|j|jtjj|jrT|j	|j
|jj|jj|jdS)N)
rrr!r"rsrwrite_manifestadd_defaultstemplateZ
read_templateprune_file_listsortZremove_duplicates)rKr4r4r5r
s





zmanifest_maker.runcCs"tj|}|jtjdS)N/)rrreplacer!r#)rKr"r4r4r5_manifest_normalizesz"manifest_maker._manifest_normalizecsYjjfddjjD}dj}jtj|f|dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        csg|]}j|qSr4)r)rr)rKr4r5r"s	z1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrexecuterr)rKrmsgr4)rKr5rs

zmanifest_maker.write_manifestcCs#|j|stj||dS)N)_should_suppress_warningr	rt)rKrr4r4r5rt&szmanifest_maker.warncCstjd|S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r$r)rr4r4r5r*sz'manifest_maker._should_suppress_warningcCstj||jj|j|jj|jtt}|r[|jj|nt	j
j|jrz|j|j
d}|jj|jdS)Nr7)r	rrrrrr]r
rr!r"rsZ
read_manifestget_finalized_commandrr7)rKZrcfilesZei_cmdr4r4r5r1s

zmanifest_maker.add_defaultscCsy|jd}|jj}|jj|j|jj|tjtj	}|jj
d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)Zis_regexr)rrWget_fullnamerr
build_baser$r%r!r#Zexclude_pattern)rKrbase_dirr#r4r4r5r=szmanifest_maker.prune_file_listN)rrrrrLrqrrrrtstaticmethodrrrr4r4r4r5rsrc	CsHdj|}|jd}t|d}|j|WdQRXdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    
zutf-8rzN)rfr}rr)rTcontentsrr4r4r5rrGsrrcCstjd||js|jj}|j|j|_}|j|j|_}z|j	|j
Wd|||_|_Xt|jdd}tj
|j
|dS)Nz
writing %sZzip_safe)rr{r~rWrhrEr[rDrwrite_pkg_infor7rPrZwrite_safety_flag)cmdbasenamerTrhZoldverZoldnamesafer4r4r5rTs	rcCs#tjj|rtjddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r!r"rsrrt)rrrTr4r4r5warn_depends_obsoletefsrcCs>t|pf}dd}t||}|j|dS)NcSs|dS)Nrr4)rr4r4r5psz%_write_requirements..)rr
writelines)streamreqslinesZ	append_crr4r4r5_write_requirementsnsrcCs|j}tj}t||j|jp1i}x>t|D]0}|jdjt	t|||qAW|j
d||jdS)Nz
[{extra}]
requirements)rWrStringIOrZinstall_requiresextras_requiresortedrformatvarsrygetvalue)rrrTdistrwrextrar4r4r5write_requirementsus	rcCs9t}t||jj|jd||jdS)Nzsetup-requirements)rrrWZsetup_requiresryr)rrrTrwr4r4r5write_setup_requirementss	rcCsOtjdd|jjD}|jd|djt|ddS)NcSs&g|]}|jdddqS).rr)r )rkr4r4r5rs	z(write_toplevel_names..ztop-level namesr)rRfromkeysrWZiter_distribution_namesrrrfr)rrrTpkgsr4r4r5write_toplevel_namess	rcCst|||ddS)NT)	write_arg)rrrTr4r4r5
overwrite_argsrFcCsdtjj|d}t|j|d}|dk	rJdj|d}|j||||dS)Nrr)r!r"splitextrPrWrfry)rrrTrxZargnamerNr4r4r5rs
rcCs|jj}t|tjs*|dkr3|}n|dk	rg}xt|jD]k\}}t|tjstj||}dj	tt
t|j}|j
d||fqXWdj	|}|jd||ddS)Nrz	[%s]
%s

rzentry pointsT)rWZentry_pointsrZrstring_typesritemsrparse_grouprfrstrvaluesrry)rrrTrrwsectionrr4r4r5
write_entriess	$rcCs{tjdttjjdrwtjdC}x9|D]1}tj	d|}|r;t
|jdSq;WWdQRXdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr)warningsrtDeprecationWarningr!r"rsiorr$rintgroup)rrrr4r4r5get_pkg_info_revisions
r);__doc__distutils.filelistrZ	_FileListdistutils.errorsrdistutils.utilrr_rr!r$rrrrrQZsetuptools.externrZsetuptools.extern.six.movesr
setuptoolsrZsetuptools.command.sdistr	r
Zsetuptools.command.setoptrZsetuptools.commandr
pkg_resourcesr
rrrrrrrZsetuptools.unicode_utilsrZsetuptools.globrZpkg_resources.externrr6r7rrrrrrrrrrrrrr4r4r4r5sN:SI

PK!Y+##0command/__pycache__/bdist_wininst.cpython-35.pycnu[

Re}@s/ddljjZGdddejZdS)Nc@s+eZdZdddZddZdS)
bdist_wininstrcCs.|jj||}|dkr*d|_|S)zj
        Supplement reinitialize_command to work around
        http://bugs.python.org/issue20819
        installinstall_libN)rr)distributionreinitialize_commandr)selfcommandreinit_subcommandscmdr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/bdist_wininst.pyrs
		z"bdist_wininst.reinitialize_commandcCs.d|_ztjj|Wdd|_XdS)NTF)Z_is_runningorigrrun)rrrrrs	zbdist_wininst.runN)__name__
__module____qualname__rrrrrrrsr)Zdistutils.command.bdist_wininstrrr
rrrrsPK!W++,command/__pycache__/build_ext.cpython-35.pycnu[

Re2@s,ddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZddlmZdd	lmZyddlmZWnek
reZYnXe
d
ddlmZdd
ZdZdZdZejdkr5dZnGej dkr|y#ddl!Z!e"e!dZZWnek
r{YnXddZ#ddZ$GdddeZesej dkrdddddddddddd
Z%n0dZdddddddddddd
Z%ddZ&dS) N)	build_ext)	copy_file)new_compiler)customize_compilerget_config_var)DistutilsError)log)Library)sixLDSHARED)_config_varscCsstjdkretj}z,dtd;sr cCsQxJddtjDD]/\}}}d|kr9|S|dkr|SqWdS)z;Return the file extension for an abi3-compliant Extension()css(|]}|dtjkr|VqdS)N)impC_EXTENSION).0rrrr	@sz"get_abi3_suffix..z.abi3z.pydN)r"get_suffixes)suffix_rrrget_abi3_suffix>s
)r)c@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZdddZdS)rcCs=|jd}|_tj|||_|r9|jdS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace
_build_extruncopy_extensions_to_source)selfZold_inplacerrrr+Hs

	z
build_ext.runc
Cs|jd}x|jD]}|j|j}|j|}|jd}dj|dd}|j|}tj	j|tj	j
|}tj	j|j|}	t|	|d|j
d|j|jr|j|ptj|dqWdS)Nbuild_py.verbosedry_runT)get_finalized_command
extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename	build_librr1r2_needs_stub
write_stubcurdir)
r-r.extfullnamefilenameZmodpathpackagepackage_dirZ
dest_filenameZsrc_filenamerrrr,Ps
	z#build_ext.copy_extensions_to_sourcecCstj||}||jkr|j|}tjoLt|doLt}|rtd}|dt|}|t}t	|t
rtjj
|\}}|jj|tStr|jrtjj|\}}tjj|d|S|S)NZpy_limited_api
EXT_SUFFIXzdl-)r*r8ext_mapr
PY3getattrr)_get_config_var_837len
isinstancer	r;r<splitextshlib_compilerlibrary_filenamelibtype	use_stubs_links_to_dynamicr9r:)r-rCrDrBZuse_abi3Zso_extfndrrrr8fs"
		
zbuild_ext.get_ext_filenamecCs,tj|d|_g|_i|_dS)N)r*initialize_optionsrOshlibsrH)r-rrrrV{s
		zbuild_ext.initialize_optionscCstj||jpg|_|j|jdd|jD|_|jr[|jx&|jD]}|j|j|_qeWx|jD]}|j}||j	|<||j	|j
dd<|jr|j|pd}|otot
|t}||_||_|j|}|_tjjtjj|j|}|ro||jkro|jj||rtrtj|jkr|jjtjqWdS)NcSs%g|]}t|tr|qSr)rMr	)r$rBrrr
s	z.build_ext.finalize_options..r/r0Fr3)r*finalize_optionsr5Zcheck_extensions_listrWsetup_shlib_compilerr6r7
_full_namerHr9links_to_dynamicrRrMr	rSr?r8
_file_namer;r<dirnamer:r>library_dirsappendrAruntime_library_dirs)r-rBrCZltdnsrDZlibdirrrrrYs,
	
	
		$zbuild_ext.finalize_optionscCsOtd|jd|jd|j}|_t||jdk	rT|j|j|jdk	rx'|jD]\}}|j	||qmW|j
dk	rx|j
D]}|j|qW|jdk	r|j
|j|jdk	r|j|j|jdk	r|j|j|jdk	r9|j|jtj||_dS)Nrr2force)rrr2rcrOrinclude_dirsZset_include_dirsZdefineZdefine_macroZundefZundefine_macro	librariesZ
set_librariesr_Zset_library_dirsZrpathZset_runtime_library_dirsZlink_objectsZset_link_objectslink_shared_object__get__)r-rr7valueZmacrorrrrZs(%
zbuild_ext.setup_shlib_compilercCs&t|tr|jStj||S)N)rMr	export_symbolsr*get_export_symbols)r-rBrrrrjszbuild_ext.get_export_symbolscCs~|j|j}zZt|tr1|j|_tj|||jrl|jdj	}|j
||Wd||_XdS)Nr.)Z_convert_pyx_sources_to_langrrMr	rOr*build_extensionr?r4r>r@)r-rBZ	_compilercmdrrrrks
		zbuild_ext.build_extensioncsntjdd|jDdj|jjddd	dgtfdd|jDS)
z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|]}|jqSr)r[)r$librrrrXs	z.build_ext.links_to_dynamic..r/Nr0rc3s|]}|kVqdS)Nr)r$libname)libnamespkgrrr%sz-build_ext.links_to_dynamic..r3)dictfromkeysrWr:r[r9anyre)r-rBr)rorprr\s,zbuild_ext.links_to_dynamiccCstj||jS)N)r*get_outputs_build_ext__get_stubs_outputs)r-rrrrtszbuild_ext.get_outputscsKfddjD}tj|j}tdd|DS)Nc3s<|]2}|jrtjjj|jjdVqdS)r/N)r?r;r<r:r>r[r9)r$rB)r-rrr%sz0build_ext.__get_stubs_outputs..css|]\}}||VqdS)Nr)r$baseZfnextrrrr%s)r5	itertoolsproduct!_build_ext__get_output_extensionslist)r-Zns_ext_basespairsr)r-rZ__get_stubs_outputss
zbuild_ext.__get_stubs_outputsccs%dVdV|jdjr!dVdS)Nz.pyz.pycr.z.pyo)r4optimize)r-rrrZ__get_output_extensionssz!build_ext.__get_output_extensionsFcCstjd|j|tjj||jjdd}|rctjj|rct|d|j	st
|d}|jdjddd	td
dtjj
|jdd
dtddddtdddtddddg|j|rddlm}||gddddd|j	|jd j}|dkrx||gd|ddd|j	tjj|r|j	rtj|dS)!Nz writing stub loader for %s to %sr/z.pyz already exists! Please delete.w
zdef __bootstrap__():z-   global __bootstrap__, __file__, __loader__z%   import sys, os, pkg_resources, impz, dlz:   __file__ = pkg_resources.resource_filename(__name__,%r)z   del __bootstrap__z    if '__loader__' in globals():z       del __loader__z#   old_flags = sys.getdlopenflags()z   old_dir = os.getcwd()z   try:z(     os.chdir(os.path.dirname(__file__))z$     sys.setdlopenflags(dl.RTLD_NOW)z(     imp.load_dynamic(__name__,__file__)z   finally:z"     sys.setdlopenflags(old_flags)z     os.chdir(old_dir)z__bootstrap__()rr)byte_compiler|rcTr2install_lib)rinfor[r;r<r:r9existsrr2openwriteif_dlr=r]closedistutils.utilrr4r|unlink)r-
output_dirrBcompileZ	stub_filefrr|rrrr@sP	
			

zbuild_ext.write_stubN)__name__
__module____qualname__r+r,r8rVrYrZrjrkr\rtruryr@rrrrrGs
	rc

Cs8|j|j|||||||||	|
||
dS)N)linkZSHARED_LIBRARY)
r-objectsoutput_libnamerrer_raridebug
extra_preargsextra_postargs
build_temptarget_langrrrrfs
rfZstaticc
Cs|dksttjj|\}}
tjj|
\}}|jdjdrj|dd}|j|||||dS)Nxrm)AssertionErrorr;r<r9rNrP
startswithZcreate_static_lib)r-rrrrer_rarirrrrrrDr=rBrrrrf)scCstjdkrd}t|S)z
    In https://github.com/pypa/setuptools/pull/837, we discovered
    Python 3.3.0 exposes the extension suffix under the name 'SO'.
    rr0r)rrr0)rversion_infor)r7rrrrKAsrK)'r;rrwr"Zdistutils.command.build_extrZ
_du_build_extdistutils.file_utilrdistutils.ccompilerrdistutils.sysconfigrrdistutils.errorsr	distutilsrZsetuptools.extensionr	Zsetuptools.externr
ZCython.Distutils.build_extr*ImportErrorrrrrrRrQrr7dlhasattrrr)rfrKrrrrsV

	
				PK!6Hv$v$+command/__pycache__/build_py.cpython-35.pycnu[

Re|%
@sddlmZddlmZddljjZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlmZddlmZmZmZyddlmZWn%ek
rGdddZYnXGd	d
d
ejeZdddZd
dZdS))glob)convert_pathN)six)mapfilterfilterfalse)	Mixin2to3c@seZdZdddZdS)rTcCsdS)z
do nothingN)selffilesZdoctestsr	r	/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/build_py.pyrun_2to3szMixin2to3.run_2to3N)__name__
__module____qualname__r
r	r	r	rrsrc@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages

    The data files are specified via a 'package_data' argument to 'setup()'.
    See 'setuptools.dist.Distribution' for more details.

    Also, this version of the 'build_py' command allows you to specify both
    'py_modules' and 'packages' in the same setup operation.
    cCsctjj||jj|_|jjp.i|_d|jkrM|jd=g|_g|_dS)N
data_files)	origrfinalize_optionsdistributionpackage_dataexclude_package_data__dict___build_py__updated_files_build_py__doctests_2to3)r
r	r	rr!s	
	zbuild_py.finalize_optionscCs|jr|jrdS|jr+|j|jrH|j|j|j|jd|j|jd|j|jd|jt	j
j|dddS)z?Build modules, packages, and copy data files to build directoryNFTZinclude_bytecoder)
py_modulespackagesZ
build_modulesZbuild_packagesbuild_package_datar
rrbyte_compilerrget_outputs)r
r	r	rrun+s	
	

zbuild_py.runcCs5|dkr"|j|_|jStjj||S)zlazily compute data filesr)_get_data_filesrrr__getattr__)r
attrr	r	rr"?szbuild_py.__getattr__cCsktjr*t|tjr*|jd}tjj||||\}}|ra|jj	|||fS)N.)
rPY2
isinstancestring_typessplitrrbuild_modulerappend)r
moduleZmodule_filepackageoutfilecopiedr	r	rr)Fszbuild_py.build_modulecCs)|jtt|j|jp"fS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples)analyze_manifestlistr_get_pkg_data_filesr)r
r	r	rr!Ps
zbuild_py._get_data_filescsi|j|tjj|jg|jd}fdd|j|D}|||fS)Nr$cs%g|]}tjj|qSr	)ospathrelpath).0file)src_dirr	r
^s	z0build_py._get_pkg_data_files..)get_package_dirr2r3join	build_libr(find_data_files)r
r,	build_dir	filenamesr	)r7rr1Us
%zbuild_py._get_pkg_data_filescCs|j|j||}tt|}tjj|}ttj	j
|}tj|jj|g|}|j
|||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrrr	itertoolschain
from_iterablerr2r3isfilemanifest_filesgetexclude_data_files)r
r,r7patternsZglobs_expandedZ
globs_matchesZ
glob_filesrr	r	rr<cs		zbuild_py.find_data_filesc
Csx|jD]\}}}}x|D]}tjj||}|jtjj|tjj||}|j||\}}	tjj|}|	r#||jj	kr#|j
j|q#Wq
WdS)z$Copy data files into build directoryN)rr2r3r:mkpathdirname	copy_fileabspathrZconvert_2to3_doctestsrr*)
r
r,r7r=r>filenametargetsrcfileoutfr.r	r	rrts
zbuild_py.build_package_datacCsVi|_}|jjsdSi}x0|jp2fD]}||t|j|sz.build_py.exclude_data_files..c3s!|]}|kr|VqdS)Nr	)r5fn)badr	rrns)r0r?rr@rArBset_unique_everseen)r
r,r7rrGZmatch_groupsmatchesZkeepersr	)rprrrFs	

zbuild_py.exclude_data_filescsAtj|jdg|j|g}fdd|DS)z
        yield platform-specific path patterns (suitable for glob
        or fn_match) from a glob-based spec (such as
        self.package_data or self.exclude_package_data)
        matching package in src_dir.
        c3s*|] }tjjt|VqdS)N)r2r3r:r)r5rm)r7r	rrnsz2build_py._get_platform_patterns..)r@rArE)specr,r7Zraw_patternsr	)r7rr?s
zbuild_py._get_platform_patternsN)rrr__doc__rr r"r)r!r1r<rr/r[r_rjr9rFstaticmethodr?r	r	r	rrs 


rccst}|j}|dkrMxdt|j|D]}|||Vq1Wn8x5|D]-}||}||krT|||VqTWdS)zHList unique elements, preserving order. Remember all elements ever seen.N)rqaddr__contains__)iterablekeyseenZseen_addelementkr	r	rrrs		


rrcCsOtjj|s|Sddlm}tjdj|}||dS)Nr)DistutilsSetupErrorz
        Error: setup script specifies an absolute path:

            %s

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.
        )r2r3isabsdistutils.errorsrtextwrapdedentlstrip)r3rmsgr	r	rrQsrQ)rdistutils.utilrZdistutils.command.build_pycommandrrr2rlrrarrdr@Zsetuptools.externrZsetuptools.extern.six.movesrrrZsetuptools.lib2to3_exrImportErrorrrrQr	r	r	rs"
PK!"ʋ)command/__pycache__/setopt.cpython-35.pycnu[

Re@sddlmZddlmZddlmZddlZddlZddlmZddl	m
Z
ddd	d
gZdddZd
ddZ
Gdd	d	e
ZGdd
d
eZdS))convert_path)log)DistutilsOptionErrorN)configparser)Commandconfig_fileedit_configoption_basesetoptlocalcCs|dkrdS|dkr>tjjtjjtjdS|dkrtjdkr_dpbd}tjjtd	|St	d
|dS)zGet the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    rz	setup.cfgglobalz
distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N)
ospathjoindirname	distutils__file__name
expanduserr
ValueError)kinddotr/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/command/setopt.pyrs	Fc		Cstjd|tj}|j|gx%|jD]\}}|dkrttjd|||j|q9|j|stjd|||j	|x|jD]\}}|dkr tjd||||j
|||j|sLtjd|||j|qtjd|||||j|||qWq9Wtjd||st
|d	}|j|WdQRXdS)
aYEdit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %sw)rdebugrRawConfigParserreaditemsinforemove_sectionhas_sectionadd_section
remove_optionoptionssetopenwrite)	filenamesettingsdry_runoptssectionr(optionvaluefrrrr!s8

	
c@sIeZdZdZdddgZddgZddZd
dZdS)r	z|jtd|jdk	r]|j|j|sv|jtdt|dkrtd||\|_dS)Nrr
rz/Must specify only one configuration file option)r<appendrr=r,lenr)r>	filenamesrrrfinalize_optionsas			zoption_base.finalize_optionsN)r4r5r6)r7r8r9)r:r3r;)__name__
__module____qualname____doc__user_optionsboolean_optionsr?rDrrrrr	Ls	c@sieZdZdZdZddddgejZejdgZddZddZ	ddZ
dS)r
z#Save command-line options to a filez1set an option in setup.cfg or another config filecommand=ccommand to set an option foroption=o
option to set
set-value=svalue of the optionremoverremove (unset) the valuecCs5tj|d|_d|_d|_d|_dS)N)r	r?commandr1	set_valuerT)r>rrrr?s

			zsetopt.initialize_optionscCs`tj||jdks+|jdkr7td|jdkr\|jr\tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r	rDrWr1rrXrT)r>rrrrDs

zsetopt.finalize_optionscCs;t|j|j|jjdd|jii|jdS)N-_)rr,rWr1replacerXr.)r>rrrruns$z
setopt.runN)rKrLrM)rNrOrP)rQrRrS)rTrUrV)rErFrGrHdescriptionr	rIrJr?rDr\rrrrr
ss
)distutils.utilrrrdistutils.errorsrrZsetuptools.extern.six.movesr
setuptoolsr__all__rrr	r
rrrrs+'PK!ge<e<"__pycache__/sandbox.cpython-37.pycnu[B

Re8@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZejdrddlmmmmZnejejZyeZWnek
rdZYnXeZddddgZd0d	d
Zejd1ddZ ejd
dZ!ejddZ"ejddZ#Gddde$Z%GdddZ&ejddZ'ddZ(ejddZ)ejddZ*dd d!d"d#hZ+d$d%Z,d&d'Z-d(dZ.Gd)ddZ/e0ed*rej1gZ2ngZ2Gd+dde/Z3e4ej5d,d-d.6DZ7Gd/dde
Z8dS)2N)DistutilsError)working_setjavaAbstractSandboxDirectorySandboxSandboxViolation	run_setupc	CsJd}t||}|}WdQRX|dkr.|}t||d}t|||dS)z.
    Python 3 implementation of execfile.
    rbNexec)openreadcompiler
)filenameglobalslocalsmodestreamscriptcoder/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/sandbox.py	_execfile$src
csDtjdd}|dk	r$|tjdd<z
|VWd|tjdd<XdS)N)sysargv)replsavedrrr	save_argv1s
rc
cs.tjdd}z
|VWd|tjdd<XdS)N)rpath)rrrr	save_path<s
rccs2tj|ddtj}|t_z
dVWd|t_XdS)zL
    Monkey-patch tempfile.tempdir with replacement, ensuring it exists
    T)exist_okN)osmakedirstempfiletempdir)replacementrrrr
override_tempEs
r%c	cs.t}t|z
|VWdt|XdS)N)r getcwdchdir)targetrrrrpushdVs


r)c@seZdZdZeddZdS)UnpickleableExceptionzP
    An exception representing another Exception that could not be pickled.
    c	CsJyt|t|fStk
rDddlm}|||t|SXdS)z
        Always return a dumped (pickled) type and exc. If exc can't be pickled,
        wrap it in UnpickleableException first.
        r)r*N)pickledumps	Exceptionsetuptools.sandboxr*dumprepr)typeexcclsrrrr/es
zUnpickleableException.dumpN)__name__
__module____qualname____doc__staticmethodr/rrrrr*`sr*c@s(eZdZdZddZddZddZdS)	ExceptionSaverz^
    A Context Manager that will save an exception, serialized, and restore it
    later.
    cCs|S)Nr)selfrrr	__enter__zszExceptionSaver.__enter__cCs |sdSt|||_||_dS)NT)r*r/_saved_tb)r:r1r2tbrrr__exit__}s
zExceptionSaver.__exit__cCs2dt|krdSttj|j\}}||jdS)z"restore and re-raise any exceptionr<N)varsmapr+loadsr<with_tracebackr=)r:r1r2rrrresumeszExceptionSaver.resumeN)r4r5r6r7r;r?rDrrrrr9tsr9c	#sVtjt}VWdQRXtjfddtjD}t||dS)z
    Context in which imported modules are saved.

    Translates exceptions internal to the context into the equivalent exception
    outside the context.
    Nc3s$|]}|kr|ds|VqdS)z
encodings.N)
startswith).0mod_name)rrr	szsave_modules..)rmodulescopyr9update_clear_modulesrD)	saved_excZdel_modulesr)rrsave_moduless


rNcCsxt|D]}tj|=q
WdS)N)listrrI)Zmodule_namesrGrrrrLsrLc	cs$t}z
|VWdt|XdS)N)
pkg_resources__getstate____setstate__)rrrrsave_pkg_resources_states
rSccstj|d}txtftTtt<t|(t	|t
ddVWdQRXWdQRXWdQRXWdQRXWdQRXWdQRXdS)Ntemp
setuptools)r rjoinrSrNrhide_setuptoolsrr%r)
__import__)	setup_dirtemp_dirrrr
setup_contexts

r[rU	distutilsrPZCython_distutils_hackcCs|ddd}|tkS)aH
    >>> _needs_hiding('setuptools')
    True
    >>> _needs_hiding('pkg_resources')
    True
    >>> _needs_hiding('setuptools_plugin')
    False
    >>> _needs_hiding('setuptools.__init__')
    True
    >>> _needs_hiding('distutils')
    True
    >>> _needs_hiding('os')
    False
    >>> _needs_hiding('Cython')
    True
    .r)split_MODULES_TO_HIDE)rGbase_modulerrr
_needs_hidingsrccCs6tjdd}|dk	r|tttj}t|dS)a%
    Remove references to setuptools' modules from sys.modules to allow the
    invocation to import the most appropriate setuptools. This technique is
    necessary to avoid issues such as #315 where setuptools upgrading itself
    would fail to find a function declared in the metadata.
    r]N)rrIgetZremove_shimfilterrcrL)r]rIrrrrWs
rWcCstjtj|}t|yl|gt|tjdd<tjd|t	
t	jddt
|t|dd}t||WdQRXWn4tk
r}z|jr|jdrWdd}~XYnXWdQRXdS)z8Run a distutils setup script, sandboxed in its directoryNrcSs|S)N)activate)distrrrzrun_setup..__main__)__file__r4)r rabspathdirnamer[rOrrinsertr__init__	callbacksappendrdictr
SystemExitargs)Zsetup_scriptrtrYnsvrrrrs

c@s.eZdZdZdZddZddZddZd	d
ZddZ	d
dZ
x$dD]Zee
erFe
eee<qFWd$ddZer~edeZedeZx$dD]Zee
ereeee<qWddZx$dD]Zee
ereeee<qWddZx$dD]Zee
ereeee<qWddZddZd d!Zd"d#ZdS)%rzDWrap 'os' module and 'open()' builtin for virtualizing setup scriptsFcsfddttD_dS)Ncs$g|]}|dst|r|qS)_)rEhasattr)rFname)r:rr
sz,AbstractSandbox.__init__..)dir_os_attrs)r:r)r:rros
zAbstractSandbox.__init__cCs&x |jD]}tt|t||qWdS)N)r}setattrr getattr)r:sourceryrrr_copyszAbstractSandbox._copycCs(||tr|jt_|jt_d|_dS)NT)r_filebuiltinsfile_openr_active)r:rrrr;s

zAbstractSandbox.__enter__cCs$d|_trtt_tt_|tdS)NF)rrrrrrrr|)r:exc_type	exc_value	tracebackrrrr?!s
zAbstractSandbox.__exit__c	Cs||SQRXdS)zRun 'func' under os sandboxingNr)r:funcrrrrun(szAbstractSandbox.runcsttfdd}|S)Ncs2|jr |j||f||\}}||f||S)N)r_remap_pair)r:srcdstrtkw)ryoriginalrrwrap0sz3AbstractSandbox._mk_dual_path_wrapper..wrap)rr|)ryrr)ryrr_mk_dual_path_wrapper-s
z%AbstractSandbox._mk_dual_path_wrapper)renamelinksymlinkNcs pttfdd}|S)Ncs*|jr|j|f||}|f||S)N)r_remap_input)r:rrtr)ryrrrr>sz5AbstractSandbox._mk_single_path_wrapper..wrap)rr|)ryrrr)ryrr_mk_single_path_wrapper;sz'AbstractSandbox._mk_single_path_wrapperrr)statlistdirr'rchmodchownmkdirremoveunlinkrmdirutimelchownchrootlstatZ	startfilemkfifomknodpathconfaccesscsttfdd}|S)NcsB|jr2|j|f||}||f||S|f||S)N)rr
_remap_output)r:rrtr)ryrrrrcsz4AbstractSandbox._mk_single_with_return..wrap)rr|)ryrr)ryrr_mk_single_with_return`s
z&AbstractSandbox._mk_single_with_return)readlinktempnamcsttfdd}|S)Ncs ||}|jr||S|S)N)rr)r:rtrretval)ryrrrrrs
z'AbstractSandbox._mk_query..wrap)rr|)ryrr)ryrr	_mk_queryos
zAbstractSandbox._mk_query)r&tmpnamcCs|S)z=Called to remap or validate any path, whether input or outputr)r:rrrr_validate_path~szAbstractSandbox._validate_pathcOs
||S)zCalled for path inputs)r)r:	operationrrtrrrrrszAbstractSandbox._remap_inputcCs
||S)zCalled for path outputs)r)r:rrrrrrszAbstractSandbox._remap_outputcOs0|j|d|f|||j|d|f||fS)z?Called for path pairs like rename, link, and symlink operationsz-fromz-to)r)r:rrrrtrrrrrszAbstractSandbox._remap_pair)N)r4r5r6r7rrorr;r?rrryrxr|rrrrrrrrrrrrrrr
s<












devnullc@seZdZdZedddddddd	d
ddd
dg
ZgZefddZ	ddZ
erVd&ddZd'ddZddZ
ddZddZddZd d!Zd(d#d$Zd%S))rz.)
r rrr_sandboxrV_prefix_exceptionsrro)r:Zsandbox
exceptionsrrrroszDirectorySandbox.__init__cOsddlm}||||dS)Nr)r)r.r)r:rrtrrrrr
_violationszDirectorySandbox._violationrcOs:|dkr(||s(|jd||f||t||f||S)N)rrtr	rUUr)_okrr)r:rrrtrrrrrszDirectorySandbox._filecOs:|dkr(||s(|jd||f||t||f||S)N)rrr	rrr)rrr)r:rrrtrrrrrszDirectorySandbox._opencCs|ddS)Nr)r)r:rrrrszDirectorySandbox.tmpnamcCsN|j}z:d|_tjtj|}||p@||jkp@||jS||_XdS)NF)	rr rrr	_exemptedrrEr)r:ractiverrrrrs

zDirectorySandbox._okcs<fdd|jD}fdd|jD}t||}t|S)Nc3s|]}|VqdS)N)rE)rF	exception)filepathrrrHsz-DirectorySandbox._exempted..c3s|]}t|VqdS)N)rematch)rFpattern)rrrrHs)r_exception_patterns	itertoolschainany)r:rZ
start_matchesZpattern_matches
candidatesr)rrrszDirectorySandbox._exemptedcOs4||jkr0||s0|j|tj|f|||S)zCalled for path inputs)	write_opsrrr rr)r:rrrtrrrrrszDirectorySandbox._remap_inputcOs2||r||s*|j|||f||||fS)z?Called for path pairs like rename, link, and symlink operations)rr)r:rrrrtrrrrrszDirectorySandbox._remap_paircOs@|t@r*||s*|jd|||f||tj|||f||S)zCalled for low-level os.open()zos.open)WRITE_FLAGSrrr|r)r:rflagsrrtrrrrrszDirectorySandbox.openN)r)r)r)r4r5r6r7rrfromkeysrr_EXCEPTIONSrorrrrrrrrrrrrrrs6



cCsg|]}tt|dqS)r)rr|)rFarrrrzsrzz4O_WRONLY O_RDWR O_APPEND O_CREAT O_TRUNC O_TEMPORARYc@s&eZdZdZedZddZdS)rzEA setup script attempted to modify the filesystem outside the sandboxa
        SandboxViolation: {cmd}{args!r} {kwargs}

        The package setup script has attempted to modify files on your system
        that are not within the EasyInstall build area, and has been aborted.

        This package cannot be safely installed by EasyInstall, and may not
        support alternate installation locations even if you run its setup
        script by hand.  Please inform the package's author and the EasyInstall
        maintainers to find out if a fix or workaround is available.
        cCs|j\}}}|jjftS)N)rttmplformatr)r:cmdrtkwargsrrr__str__szSandboxViolation.__str__N)	r4r5r6r7textwrapdedentlstriprrrrrrrs
)N)N)9r rr"operator	functoolsrr
contextlibr+rrrPdistutils.errorsrrplatformrEZ$org.python.modules.posix.PosixModulepythonrIposixZPosixModuler|ryrr	NameErrorrr__all__rcontextmanagerrrr%r)r-r*r9rNrLrSr[rarcrWrrrxrrrreduceor_r`rrrrrrsp 



	
		
^PK!izz!__pycache__/errors.cpython-37.pycnu[B

Re@s&dZddlmZGdddeeZdS)zCsetuptools.errors

Provides exceptions used by setuptools modules.
)DistutilsErrorc@seZdZdZdS)RemovedCommandErroraOError used for commands that have been removed in setuptools.

    Since ``setuptools`` is built on ``distutils``, simply removing a command
    from ``setuptools`` will make the behavior fall back to ``distutils``; this
    error is raised if a command exists in ``distutils`` but has been actively
    removed in ``setuptools``.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/errors.pyr	srN)rdistutils.errorsrRuntimeErrorrrrrr	sPK!Fe""%__pycache__/build_meta.cpython-37.pycnu[B

Re((@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZdddddd	d
gZGdd
d
e
ZGdd
d
ejjZejddZddZddZddZGdddeZGdddeZeZejZejZejZejZejZeZdS)a-A PEP 517 interface to setuptools

Previously, when a user or a command line tool (let's call it a "frontend")
needed to make a request of setuptools to take a certain action, for
example, generating a list of installation requirements, the frontend would
would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.

PEP 517 defines a different method of interfacing with setuptools. Rather
than calling "setup.py" directly, the frontend should:

  1. Set the current directory to the directory with a setup.py file
  2. Import this module into a safe python interpreter (one in which
     setuptools can potentially set global variables or crash hard).
  3. Call one of the functions defined in PEP 517.

What each function does is defined in PEP 517. However, here is a "casual"
definition of the functions (this definition should not be relied on for
bug reports or API stability):

  - `build_wheel`: build a wheel in the folder and return the basename
  - `get_requires_for_build_wheel`: get the `setup_requires` to build
  - `prepare_metadata_for_build_wheel`: get the `install_requires`
  - `build_sdist`: build an sdist in the folder and return the basename
  - `get_requires_for_build_sdist`: get the `setup_requires` to build

Again, this is not a formal definition! Just a "taste" of the module.
N)parse_requirementsget_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheelbuild_wheelbuild_sdist
__legacy__SetupRequirementsErrorc@seZdZddZdS)r	cCs
||_dS)N)
specifiers)selfr
r/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/build_meta.py__init__4szSetupRequirementsError.__init__N)__name__
__module____qualname__rrrrr
r	3sc@s&eZdZddZeejddZdS)DistributioncCstttt|}t|dS)N)listmapstrrr	)rr
Zspecifier_listrrr
fetch_build_eggs9szDistribution.fetch_build_eggsccs*tjj}|tj_z
dVWd|tj_XdS)zw
        Replace
        distutils.dist.Distribution with this class
        for the duration of this context.
        N)	distutilscorer)clsorigrrr
patch>s

zDistribution.patchN)rrrrclassmethod
contextlibcontextmanagerrrrrr
r8srccs(tj}ddt_z
dVWd|t_XdS)a
Temporarily disable installing setup_requires

    Under PEP 517, the backend reports build dependencies to the frontend,
    and the frontend is responsible for ensuring they're installed.
    So setuptools (acting as a backend) should not try to install them.
    cSsdS)Nr)attrsrrr
Wz+no_install_setup_requires..N)
setuptoolsZ_install_setup_requires)rrrr
no_install_setup_requiresNs


r#csfddtDS)Ncs&g|]}tjtj|r|qSr)ospathisdirjoin).0name)a_dirrr

_sz1_get_immediate_subdirectories..)r$listdir)r*r)r*r
_get_immediate_subdirectories^sr-csDfddt|D}y
|\}Wntk
r>tdYnX|S)Nc3s|]}|r|VqdS)N)endswith)r(f)	extensionrr
	esz'_file_with_extension..z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r$r,
ValueError)	directoryr0Zmatchingfiler)r0r
_file_with_extensioncs
r5cCs&tj|stdSttdt|S)Nz%from setuptools import setup; setup()open)r$r%existsioStringIOgetattrtokenizer6)setup_scriptrrr
_open_setup_scriptqs
r=c@s`eZdZddZddZdddZdd	d
ZdddZdd
dZddZ	dddZ
dddZdS)_BuildMetaBackendcCs|pi}|dg|S)Nz--global-option)
setdefault)rconfig_settingsrrr
_fix_config{sz_BuildMetaBackend._fix_configc
Csz||}tjdddg|dt_y t|WdQRXWn,tk
rt}z||j7}Wdd}~XYnX|S)Negg_infoz--global-option)rAsysargvrr	run_setupr	r
)rr@requirementserrr
_get_build_requiress

z%_BuildMetaBackend._get_build_requiressetup.pyc	CsD|}d}t|}|dd}WdQRXtt||dtdS)N__main__z\r\nz\nexec)r=readreplacerLcompilelocals)rr<__file__rr/coderrr
rFs

z_BuildMetaBackend.run_setupNcCs||}|j|dgdS)Nwheel)rG)rArI)rr@rrr
rs
z._BuildMetaBackend.get_requires_for_build_wheelcCs||}|j|gdS)N)rG)rArI)rr@rrr
rs
z._BuildMetaBackend.get_requires_for_build_sdistc	Cstjdddd|gt_t|WdQRX|}x`ddt|D}t|dkrtt|dkrtj	|t|d}q:t|dkst
Pq:W||krttj	||d|tj
|dd|dS)	NrBZ	dist_infoz
--egg-basecSsg|]}|dr|qS)z
.dist-info)r.)r(r/rrr
r+szF_BuildMetaBackend.prepare_metadata_for_build_wheel..rT)
ignore_errors)rDrEr#rFr$r,lenr-r%r'AssertionErrorshutilmovermtree)rmetadata_directoryr@Zdist_info_directoryZ
dist_infosrrr
rs(z2_BuildMetaBackend.prepare_metadata_for_build_wheelc
Cs||}tj|}tj|ddtj|d}tjdd|d|g|dt_t	|
WdQRXt||}tj||}tj
|rt|ttj|||WdQRX|S)NT)exist_ok)dirrBz
--dist-dirz--global-option)rAr$r%abspathmakedirstempfileTemporaryDirectoryrDrEr#rFr5r'r7removerename)rZ
setup_commandZresult_extensionZresult_directoryr@Ztmp_dist_dirZresult_basenameresult_pathrrr
_build_with_temp_dirs

 z&_BuildMetaBackend._build_with_temp_dircCs|dgd||S)Nbdist_wheelz.whl)rd)rwheel_directoryr@rZrrr
rs
z_BuildMetaBackend.build_wheelcCs|dddgd||S)Nsdistz	--formatsgztarz.tar.gz)rd)rsdist_directoryr@rrr
rsz_BuildMetaBackend.build_sdist)rJ)N)N)N)NN)N)rrrrArIrFrrrrdrrrrrr
r>ys



!
r>cs"eZdZdZdfdd	ZZS)_BuildMetaLegacyBackendaOCompatibility backend for setuptools

    This is a version of setuptools.build_meta that endeavors
    to maintain backwards
    compatibility with pre-PEP 517 modes of invocation. It
    exists as a temporary
    bridge between the old packaging mechanism and the new
    packaging mechanism,
    and will eventually be removed.
    setup.pyc
sttj}tjtj|}|tjkr6tjd|tjd}|tjd<ztt	|j
|dWd|tjdd<|tjd<XdS)Nr)r<)rrDr%r$dirnamer]insertrEsuperrjrF)rr<sys_pathZ
script_dirZ
sys_argv_0)	__class__rr
rFs



z!_BuildMetaLegacyBackend.run_setup)rk)rrr__doc__rF
__classcell__rr)rpr
rjs
rj) rqr8r$rDr;rWrr_r"r
pkg_resourcesr__all__
BaseExceptionr	distrrr#r-r5r=objectr>rjZ_BACKENDrrrrrrrrrr
s@m)PK!"Nyrææ__pycache__/msvc.cpython-37.pycnu[B

Re@sdZddlZddlmZddlmZmZddlmZm	Z	m
Z
mZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZdd	lmZed
krddlZddlmZnGdd
d
ZeZeejjfZ yddl!m"Z"Wne k
rYnXddZ#d/ddZ$ddZ%ddZ&dddddZ'ddZ(ddZ)d d!Z*d"d#Z+d0d%d&Z,Gd'd(d(Z-Gd)d*d*Z.Gd+d,d,Z/Gd-d.d.Z0dS)1a
Improved support for Microsoft Visual C++ compilers.

Known supported compilers:
--------------------------
Microsoft Visual C++ 9.0:
    Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64)
    Microsoft Windows SDK 6.1 (x86, x64, ia64)
    Microsoft Windows SDK 7.0 (x86, x64, ia64)

Microsoft Visual C++ 10.0:
    Microsoft Windows SDK 7.1 (x86, x64, ia64)

Microsoft Visual C++ 14.X:
    Microsoft Visual C++ Build Tools 2015 (x86, x64, arm)
    Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64)
    Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64)

This may also support compilers shipped with compatible Visual Studio versions.
N)open)listdirpathsep)joinisfileisdirdirname)
LegacyVersion)unique_everseen)
get_unpatchedWindows)environc@seZdZdZdZdZdZdS)winregN)__name__
__module____qualname__
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/msvc.pyr+sr)RegcCsd}|d|f}yt|d}WnJtk
rjy|d|f}t|d}Wntk
rdd}YnXYnX|rt|d}t|r|Stt|S)a
    Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone
    compiler build for Python
    (VCForPython / Microsoft Visual C++ Compiler for Python 2.7).

    Fall back to original behavior when the standalone compiler is not
    available.

    Redirect the path of "vcvarsall.bat".

    Parameters
    ----------
    version: float
        Required Microsoft Visual C++ version.

    Return
    ------
    str
        vcvarsall.bat path
    z-Software\%sMicrosoft\DevDiv\VCForPython\%0.1f
installdirzWow6432Node\Nz
vcvarsall.bat)r	get_valueKeyErrorrrrmsvc9_find_vcvarsall)versionZvc_basekey
productdir	vcvarsallrrrrBs
rx86c
Osytt}|||f||Stjjk
r2Yntk
rDYnXyt||Stjjk
r}zt|||Wdd}~XYnXdS)ao
    Patched "distutils.msvc9compiler.query_vcvarsall" for support extra
    Microsoft Visual C++ 9.0 and 10.0 compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    ver: float
        Required Microsoft Visual C++ version.
    arch: str
        Target architecture.

    Return
    ------
    dict
        environment
    N)	rmsvc9_query_vcvarsall	distutilserrorsDistutilsPlatformError
ValueErrorEnvironmentInfo
return_env_augment_exception)verarchargskwargsorigexcrrrr$lsr$cCsyttjddtjtjB}Wntk
r2dSXd}d}|xtD]}yt||\}}}Wntk
r|PYnX|rL|tj	krLt
|rLytt|}Wnt
tfk
rwLYnX|dkrL||krL||}}qLWWdQRX||fS)z0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7r)NNN)rOpenKeyrKEY_READZKEY_WOW64_32KEYOSError	itertoolscount	EnumValueREG_SZrintfloatr(	TypeError)r best_versionbest_dirivZvc_dirZvtrrrr_msvc14_find_vc2015s0rAcCstdptd}|sdSy>tt|dddddd	d
dd
dd
dddgjddd}Wntjtt	fk
rvdSXt|ddd}t
|rd|fSdS)aPython 3.8 "distutils/_msvccompiler.py" backport

    Returns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)ProgramFiles)NNzMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez-requiresAnyz	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz	-propertyinstallationPathz	-products*mbcsstrict)encodingr&VCZ	AuxiliaryZBuild)rget
subprocesscheck_outputrdecodestripCalledProcessErrorr5UnicodeDecodeErrorr)rootpathrrr_msvc14_find_vc2017s(
rSx64ZarmZarm64)r#Z	x86_amd64Zx86_armZ	x86_arm64c	
Cst\}}d}|tkr t|}nd|kr,dnd}|rt|ddddd|d	d
	}yddl}|j|dd
d}Wntttfk
rd}YnX|st\}}|rt|d|dd
}|sdSt|d}t|sdS|rt|sd}||fS)z0Python 3.8 "distutils/_msvccompiler.py" backportNamd64rTr#z..redistZMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllrT)	recursivezMicrosoft.VC140.CRT)NNz
vcvarsall.bat)	rSPLAT_SPEC_TO_RUNTIMErglobImportErrorr5LookupErrorrAr)		plat_spec_r>	vcruntimeZvcruntime_platZvcredistrZr=r"rrr_msvc14_find_vcvarsalls6




r`c
CsdtkrddtDSt|\}}|s6tjdy&tjd||tj	dj
ddd	}Wn:tjk
r}ztjd
|j|Wdd}~XYnXddd
d|
DD}|r||d<|S)z0Python 3.8 "distutils/_msvccompiler.py" backportZDISTUTILS_USE_SDKcSsi|]\}}||qSr)lower).0r valuerrr
sz&_msvc14_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r&zError executing {}NcSs$i|]\}}}|r|r||qSr)ra)rbr r^rcrrrrdscss|]}|dVqdS)=N)	partition)rblinerrr	sz%_msvc14_get_vc_env..py_vcruntime_redist)ritemsr`r%r&r'rKrLformatSTDOUTrMrOcmd
splitlines)r]r"r_outr1envrrr_msvc14_get_vc_envs*

rsc
Cs@yt|Stjjk
r:}zt|dWdd}~XYnXdS)a*
    Patched "distutils._msvccompiler._get_vc_env" for support extra
    Microsoft Visual C++ 14.X compilers.

    Set environment without use of "vcvarsall.bat".

    Parameters
    ----------
    plat_spec: str
        Target architecture.

    Return
    ------
    dict
        environment
    g,@N)rsr%r&r'r+)r]r1rrrmsvc14_get_vc_env(s

rtcOsBdtjkr4ddl}t|jtdkr4|jjj||Stt	||S)z
    Patched "distutils._msvccompiler.gen_lib_options" for fix
    compatibility between "numpy.distutils" and "distutils._msvccompiler"
    (for Numpy < 1.11.2)
    znumpy.distutilsrNz1.11.2)
sysmodulesnumpyr	__version__r%Z	ccompilerZgen_lib_optionsrmsvc14_gen_lib_options)r.r/nprrrryBs

ryrcCs|jd}d|ks"d|krd}|jft}d}|dkrf|ddkr\|d	7}q|d
7}n.|dkr|d7}||d
7}n|dkr|d7}|f|_dS)zl
    Add details to the exception message to help guide the user
    as to what action will resolve it.
    rr"zvisual cz;Microsoft Visual C++ {version:0.1f} or greater is required.z-www.microsoft.com/download/details.aspx?id=%dg"@Zia64rXz( Get it with "Microsoft Windows SDK 7.0"z% Get it from http://aka.ms/vcpython27g$@z* Get it with "Microsoft Windows SDK 7.1": iW g,@zd Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/N)r.rarmlocalsfind)r1rr-messagetmplZ
msdownloadrrrr+Os


r+c@sbeZdZdZeddZddZe	ddZ
dd	Zd
dZdd
dZ
dddZdddZdS)PlatformInfoz
    Current and Target Architectures information.

    Parameters
    ----------
    arch: str
        Target architecture.
    Zprocessor_architecturercCs|dd|_dS)NrTrU)rarfr-)selfr-rrr__init__szPlatformInfo.__init__cCs|j|jdddS)zs
        Return Target CPU architecture.

        Return
        ------
        str
            Target CPU
        r^rN)r-r|)rrrr
target_cpus
zPlatformInfo.target_cpucCs
|jdkS)z
        Return True if target CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r#)r)rrrr
target_is_x86s	zPlatformInfo.target_is_x86cCs
|jdkS)z
        Return True if current CPU is x86 32 bits..

        Return
        ------
        bool
            CPU is x86 32 bits
        r#)current_cpu)rrrrcurrent_is_x86s	zPlatformInfo.current_is_x86FcCs.|jdkr|rdS|jdkr$|r$dSd|jS)uk
        Current platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '†' if architecture is x86.
        x64: bool
            return 'd' and not 'md64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '	arget', or '' (see hidex86 parameter)
        r#rrUz\x64z\%s)r)rhidex86rTrrrcurrent_dirszPlatformInfo.current_dircCs.|jdkr|rdS|jdkr$|r$dSd|jS)ar
        Target platform specific subfolder.

        Parameters
        ----------
        hidex86: bool
            return '' and not '\x86' if architecture is x86.
        x64: bool
            return '\x64' and not '\amd64' if architecture is amd64.

        Return
        ------
        str
            subfolder: '\current', or '' (see hidex86 parameter)
        r#rrUz\x64z\%s)r)rrrTrrr
target_dirszPlatformInfo.target_dircCs0|rdn|j}|j|krdS|dd|S)ap
        Cross platform specific subfolder.

        Parameters
        ----------
        forcex86: bool
            Use 'x86' as current architecture even if current architecture is
            not x86.

        Return
        ------
        str
            subfolder: '' if target architecture is current architecture,
            '\current_target' if not.
        r#r\z\%s_)rrrrf)rforcex86currentrrr	cross_dirszPlatformInfo.cross_dirN)FF)FF)F)rrr__doc__rrJrarrpropertyrrrrrrrrrrrts

rc@seZdZdZejejejejfZ	ddZ
eddZeddZ
edd	Zed
dZedd
ZeddZeddZeddZeddZdddZddZdS)RegistryInfoz
    Microsoft Visual Studio related registry information.

    Parameters
    ----------
    platform_info: PlatformInfo
        "PlatformInfo" instance.
    cCs
||_dS)N)pi)rZ
platform_inforrrrszRegistryInfo.__init__cCsdS)z
        Microsoft Visual Studio root registry key.

        Return
        ------
        str
            Registry key
        ZVisualStudior)rrrrvisualstudios
zRegistryInfo.visualstudiocCst|jdS)z
        Microsoft Visual Studio SxS registry key.

        Return
        ------
        str
            Registry key
        ZSxS)rr)rrrrsxss
zRegistryInfo.sxscCst|jdS)z|
        Microsoft Visual C++ VC7 registry key.

        Return
        ------
        str
            Registry key
        ZVC7)rr)rrrrvcs
zRegistryInfo.vccCst|jdS)z
        Microsoft Visual Studio VS7 registry key.

        Return
        ------
        str
            Registry key
        ZVS7)rr)rrrrvss
zRegistryInfo.vscCsdS)z
        Microsoft Visual C++ for Python registry key.

        Return
        ------
        str
            Registry key
        zDevDiv\VCForPythonr)rrrr
vc_for_python(s
zRegistryInfo.vc_for_pythoncCsdS)zq
        Microsoft SDK registry key.

        Return
        ------
        str
            Registry key
        zMicrosoft SDKsr)rrrr
microsoft_sdk4s
zRegistryInfo.microsoft_sdkcCst|jdS)z
        Microsoft Windows/Platform SDK registry key.

        Return
        ------
        str
            Registry key
        r
)rr)rrrrwindows_sdk@s
zRegistryInfo.windows_sdkcCst|jdS)z
        Microsoft .NET Framework SDK registry key.

        Return
        ------
        str
            Registry key
        ZNETFXSDK)rr)rrrr	netfx_sdkLs
zRegistryInfo.netfx_sdkcCsdS)z
        Microsoft Windows Kits Roots registry key.

        Return
        ------
        str
            Registry key
        zWindows Kits\Installed Rootsr)rrrrwindows_kits_rootsXs
zRegistryInfo.windows_kits_rootsFcCs$|js|rdnd}td|d|S)a
        Return key in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        x86: str
            Force x86 software registry.

        Return
        ------
        str
            Registry key
        rZWow6432NodeZSoftware	Microsoft)rrr)rr r#Znode64rrr	microsoftdszRegistryInfo.microsoftc	
Cstj}tj}tj}|j}x|jD]}d}y||||d|}WnZttfk
r|j	sy||||dd|}Wqttfk
rw YqXnw YnXz.yt
||dSttfk
rYnXWd|r||Xq WdS)a
        Look for values in registry in Microsoft software registry.

        Parameters
        ----------
        key: str
            Registry key path where look.
        name: str
            Value name to find.

        Return
        ------
        str
            value
        NrT)rr4r3ZCloseKeyrHKEYSr5IOErrorrrQueryValueEx)	rr nameZkey_readZopenkeyZclosekeymshkeybkeyrrrlookupws*


zRegistryInfo.lookupN)F)rrrrrrrrrrrrrrrrrrrrrrrrrrrrs"
rc@s<eZdZdZeddZeddZedeZd7ddZ	d	d
Z
ddZd
dZe
ddZeddZeddZddZddZeddZeddZeddZedd Zed!d"Zed#d$Zed%d&Zed'd(Zed)d*Zed+d,Zed-d.Zed/d0Zed1d2Z d3d4Z!e
d8d5d6Z"dS)9
SystemInfoz
    Microsoft Windows and Visual Studio related system information.

    Parameters
    ----------
    registry_info: RegistryInfo
        "RegistryInfo" instance.
    vc_ver: float
        Required Microsoft Visual C++ version.
    WinDirrrBzProgramFiles(x86)NcCs2||_|jj|_||_|p$||_|_dS)N)rirfind_programdata_vs_versknown_vs_paths_find_latest_available_vs_vervs_vervc_ver)rZ
registry_inforrrrrs

zSystemInfo.__init__cCs>|}|s|jstjdt|}||jt|dS)zm
        Find the latest VC version

        Return
        ------
        float
            version
        z%No Microsoft Visual C++ version foundrX)find_reg_vs_versrr%r&r'setupdatesorted)rZreg_vc_versZvc_versrrrrs	
z(SystemInfo._find_latest_available_vs_vercCs:|jj}|jj|jj|jjf}g}xt|jj|D]\}}yt	|||dtj
}Wnttfk
rrw6YnX|t
|\}}}	xLt|D]@}
tt,tt||
d}||kr||WdQRXqWxJt|D]>}
tt*tt||
}||kr||WdQRXqWWdQRXq6Wt|S)z
        Find Microsoft Visual Studio versions available in registry.

        Return
        ------
        list of float
            Versions
        rN)rrrrrr6productrrr3r4r5rZQueryInfoKeyrange
contextlibsuppressr(r;r8appendEnumKeyr)rrZvckeysZvs_versrr rZsubkeysvaluesr^r?r,rrrrs*	
&zSystemInfo.find_reg_vs_versc	Csi}d}yt|}Wnttfk
r,|SXx|D]~}y\t||d}t|ddd}t|}WdQRX|d}tt|d||||d	<Wq4tttfk
rw4Yq4Xq4W|S)
z
        Find Visual studio 2017+ versions from information in
        "C:\ProgramData\Microsoft\VisualStudio\Packages\_Instances".

        Return
        ------
        dict
            float version as key, path as value.
        z9C:\ProgramData\Microsoft\VisualStudio\Packages\_Instancesz
state.jsonrtzutf-8)rGNrCz
VC\Tools\MSVCZinstallationVersion)	rr5rrrjsonload_as_float_versionr)	rZvs_versionsZ
instances_dirZhashed_namesrZ
state_pathZ
state_filestateZvs_pathrrrrs"

z#SystemInfo.find_programdata_vs_verscCstd|dddS)z
        Return a string version as a simplified float version (major.minor)

        Parameters
        ----------
        version: str
            Version.

        Return
        ------
        float
            version
        .N)r;rsplit)rrrrrszSystemInfo._as_float_versioncCs.t|jd|j}|j|jjd|jp,|S)zp
        Microsoft Visual Studio directory.

        Return
        ------
        str
            path
        zMicrosoft Visual Studio %0.1fz%0.1f)rProgramFilesx86rrrr)rdefaultrrrVSInstallDir)szSystemInfo.VSInstallDircCs,|p|}t|s(d}tj||S)zm
        Microsoft Visual C++ directory.

        Return
        ------
        str
            path
        z(Microsoft Visual C++ directory not found)	_guess_vc_guess_vc_legacyrr%r&r')rrRmsgrrrVCInstallDir:s

zSystemInfo.VCInstallDirc
Cs|jdkrdSy|j|j}Wntk
r8|j}YnXt|d}y"t|d}|||_t||Stt	t
fk
rdSXdS)zl
        Locate Visual C++ for VS2017+.

        Return
        ------
        str
            path
        g,@rz
VC\Tools\MSVCrXN)rrrrrrrrr5r
IndexError)rZvs_dirZguess_vcrrrrrLs	


zSystemInfo._guess_vccCsbt|jd|j}t|jjd|j}|j|d}|rBt|dn|}|j|jjd|jp`|S)z{
        Locate Visual C++ for versions prior to 2017.

        Return
        ------
        str
            path
        z Microsoft Visual Studio %0.1f\VCz%0.1frrH)rrrrrrr)rrZreg_pathZ	python_vcZ
default_vcrrrrjs	zSystemInfo._guess_vc_legacycCsJ|jdkrdS|jdkrdS|jdkr*dS|jdkr8dS|jd	krFd
SdS)z
        Microsoft Windows SDK versions for specified MSVC++ version.

        Return
        ------
        tuple of str
            versions
        g"@)z7.0z6.1z6.0ag$@)z7.1z7.0ag&@)z8.0z8.0ag(@)z8.1z8.1ag,@)z10.0z8.1N)r)rrrrWindowsSdkVersion~s





zSystemInfo.WindowsSdkVersioncCs|t|jdS)zt
        Microsoft Windows SDK last version.

        Return
        ------
        str
            version
        lib)_use_last_dir_namer
WindowsSdkDir)rrrrWindowsSdkLastVersions
z SystemInfo.WindowsSdkLastVersioncCsd}x4|jD]*}t|jjd|}|j|d}|rPqW|rFt|svt|jjd|j}|j|d}|rvt|d}|rt|sx@|jD]6}|d|d}d	|}t|j	|}t|r|}qW|rt|sx.|jD]$}d
|}t|j	|}t|r|}qW|st|j
d}|S)zn
        Microsoft Windows SDK directory.

        Return
        ------
        str
            path
        rzv%sinstallationfolderz%0.1frZWinSDKNrzMicrosoft SDKs\Windows Kits\%szMicrosoft SDKs\Windows\v%sZPlatformSDK)rrrrrrrrrfindrBr)rsdkdirr,locrRinstall_baseZintverdrrrrs6

zSystemInfo.WindowsSdkDirc	Cs|jdkrd}d}n&d}|jdkr&dnd}|jjd|d}d	||d
df}g}|jdkrx$|jD]}|t|jj||g7}qdWx(|jD]}|t|jj	d
||g7}qWx"|D]}|j
|d}|r|SqWdS)zy
        Microsoft Windows SDK executable directory.

        Return
        ------
        str
            path
        g&@#r(g(@TF)rTrzWinSDK-NetFx%dTools%sr-g,@zv%sArN)rrrrfNetFxSdkVersionrrrrrr)	rZnetfxverr-rZfxZregpathsr,rRZexecpathrrrWindowsSDKExecutablePaths"


z#SystemInfo.WindowsSDKExecutablePathcCs&t|jjd|j}|j|dp$dS)zl
        Microsoft Visual F# directory.

        Return
        ------
        str
            path
        z%0.1f\Setup\F#r!r)rrrrr)rrRrrrFSharpInstallDirs
zSystemInfo.FSharpInstallDircCsF|jdkrdnd}x.|D]&}|j|jjd|}|r|p.Nr)reversedrnext)rRrZ
matching_dirsr)rRrrrszSystemInfo._use_last_dir_name)N)r)#rrrrrrJrrBrrrrrstaticmethodrrrrrrrrrrrrrrrrrrrrrrrrrrs:


*+#
rc@sTeZdZdZd=ddZeddZedd	Zed
dZedd
Z	eddZ
eddZeddZeddZ
eddZeddZeddZddZeddZed d!Zed"d#Zed$d%Zed&d'Zed(d)Zed*d+Zed,d-Zed.d/Zed0d1Zed2d3Zed4d5Zed6d7Zd>d9d:Zd;d<Z dS)?r)aY
    Return environment variables for specified Microsoft Visual C++ version
    and platform : Lib, Include, Path and libpath.

    This function is compatible with Microsoft Visual C++ 9.0 to 14.X.

    Script created by analysing Microsoft environment configuration files like
    "vcvars[...].bat", "SetEnv.Cmd", "vcbuildtools.bat", ...

    Parameters
    ----------
    arch: str
        Target architecture.
    vc_ver: float
        Required Microsoft Visual C++ version. If not set, autodetect the last
        version.
    vc_min_ver: float
        Minimum Microsoft Visual C++ version.
    NrcCsBt||_t|j|_t|j||_|j|kr>d}tj	|dS)Nz.No suitable Microsoft Visual C++ version found)
rrrrrsirr%r&r')rr-rZ
vc_min_vererrrrrrs

zEnvironmentInfo.__init__cCs|jjS)zk
        Microsoft Visual Studio.

        Return
        ------
        float
            version
        )rr)rrrrrs
zEnvironmentInfo.vs_vercCs|jjS)zp
        Microsoft Visual C++ version.

        Return
        ------
        float
            version
        )rr)rrrrrs
zEnvironmentInfo.vc_vercsVddg}jdkrDjjddd}|dg7}|dg7}|d|g7}fd	d
|DS)zu
        Microsoft Visual Studio Tools.

        Return
        ------
        list of str
            paths
        zCommon7\IDEz
Common7\Toolsg,@T)rrTz1Common7\IDE\CommonExtensions\Microsoft\TestWindowzTeam Tools\Performance ToolszTeam Tools\Performance Tools%scsg|]}tjj|qSr)rrr)rbrR)rrr
sz+EnvironmentInfo.VSTools..)rrr)rpathsarch_subdirr)rrVSToolss



zEnvironmentInfo.VSToolscCst|jjdt|jjdgS)z
        Microsoft Visual C++ & Microsoft Foundation Class Includes.

        Return
        ------
        list of str
            paths
        IncludezATLMFC\Include)rrr)rrrr
VCIncludess
zEnvironmentInfo.VCIncludescsbjdkrjjdd}njjdd}d|d|g}jdkrP|d|g7}fd	d
|DS)z
        Microsoft Visual C++ & Microsoft Foundation Class Libraries.

        Return
        ------
        list of str
            paths
        g.@T)rT)rzLib%szATLMFC\Lib%sg,@zLib\store%scsg|]}tjj|qSr)rrr)rbrR)rrrrsz/EnvironmentInfo.VCLibraries..)rrr)rrrr)rrVCLibrariess


zEnvironmentInfo.VCLibrariescCs|jdkrgSt|jjdgS)z
        Microsoft Visual C++ store references Libraries.

        Return
        ------
        list of str
            paths
        g,@zLib\store\references)rrrr)rrrrVCStoreRefss

zEnvironmentInfo.VCStoreRefscCs|j}t|jdg}|jdkr"dnd}|j|}|rL|t|jd|g7}|jdkr|d|jjdd}|t|j|g7}n|jdkr|jrd	nd
}|t|j||jjddg7}|jj	|jj
kr|t|j||jjddg7}n|t|jdg7}|S)
zr
        Microsoft Visual C++ Tools.

        Return
        ------
        list of str
            paths
        Z
VCPackagesg$@TFzBin%sg,@)rg.@z
bin\HostX86%sz
bin\HostX64%s)rTBin)rrrrrrrrrrr)rrtoolsrrrRZhost_dirrrrVCTools(s&


zEnvironmentInfo.VCToolscCsh|jdkr.|jjddd}t|jjd|gS|jjdd}t|jjd}|j}t|d||fgSdS)	zw
        Microsoft Windows SDK Libraries.

        Return
        ------
        list of str
            paths
        g$@T)rrTzLib%s)rTrz%sum%sN)rrrrrr_sdk_subdir)rrrZlibverrrrOSLibrariesMs

zEnvironmentInfo.OSLibrariescCsht|jjd}|jdkr&|t|dgS|jdkr8|j}nd}t|d|t|d|t|d|gSd	S)
zu
        Microsoft Windows SDK Include.

        Return
        ------
        list of str
            paths
        includeg$@glg,@rz%ssharedz%sumz%swinrtN)rrrrr)rrsdkverrrr
OSIncludesas


zEnvironmentInfo.OSIncludescCst|jjd}g}|jdkr&||j7}|jdkr@|t|dg7}|jdkr||t|jjdt|ddt|d	dt|d
dt|jjddd
|jdddg7}|S)z}
        Microsoft Windows SDK Libraries Paths.

        Return
        ------
        list of str
            paths
        Z
Referencesg"@g&@zCommonConfiguration\Neutralg,@Z
UnionMetadataz'Windows.Foundation.UniversalApiContractz1.0.0.0z%Windows.Foundation.FoundationContractz,Windows.Networking.Connectivity.WwanContractZ
ExtensionSDKszMicrosoft.VCLibsz%0.1fZCommonConfigurationZneutral)rrrrr)rreflibpathrrr	OSLibpathys*







zEnvironmentInfo.OSLibpathcCst|S)zs
        Microsoft Windows SDK Tools.

        Return
        ------
        list of str
            paths
        )list
_sdk_tools)rrrrSdkToolss
zEnvironmentInfo.SdkToolsccs|jdkr,|jdkrdnd}t|jj|V|js\|jjdd}d|}t|jj|V|jdkr|jrvd	}n|jjddd
}d|}t|jj|VnB|jdkrt|jjd}|jjdd}|jj}t|d||fV|jj	r|jj	Vd
S)z
        Microsoft Windows SDK Tools paths generator.

        Return
        ------
        generator of str
            paths
        g.@g&@rzBin\x86T)rTzBin%s)g$@g&@r)rrTzBin\NETFX 4.0 Tools%sz%s%sN)
rrrrrrrrrr)rbin_dirrrRrrrrrs(	




zEnvironmentInfo._sdk_toolscCs|jj}|rd|SdS)zu
        Microsoft Windows SDK version subdir.

        Return
        ------
        str
            subdir
        z%s\r)rr)rucrtverrrrrs
zEnvironmentInfo._sdk_subdircCs|jdkrgSt|jjdgS)zs
        Microsoft Windows SDK Setup.

        Return
        ------
        list of str
            paths
        g"@ZSetup)rrrr)rrrrSdkSetups

zEnvironmentInfo.SdkSetupcs|j}|j|jdkr0d}|o,|}n$|p>|}|jdkpR|jdk}g}|rt|fddjD7}|r|fddjD7}|S)zv
        Microsoft .NET Framework Tools.

        Return
        ------
        list of str
            paths
        g$@TrUcsg|]}tj|qSr)rr)rbr,)rrrrsz+EnvironmentInfo.FxTools..csg|]}tj|qSr)rr)rbr,)rrrrs)	rrrrrrrrr)rrZ	include32Z	include64rr)rrFxToolss

zEnvironmentInfo.FxToolscCs8|jdks|jjsgS|jjdd}t|jjd|gS)z~
        Microsoft .Net Framework SDK Libraries.

        Return
        ------
        list of str
            paths
        g,@T)rTzlib\um%s)rrrrrr)rrrrrNetFxSDKLibrariess
z!EnvironmentInfo.NetFxSDKLibrariescCs&|jdks|jjsgSt|jjdgS)z}
        Microsoft .Net Framework SDK Includes.

        Return
        ------
        list of str
            paths
        g,@z
include\um)rrrr)rrrrNetFxSDKIncludess
z EnvironmentInfo.NetFxSDKIncludescCst|jjdgS)z
        Microsoft Visual Studio Team System Database.

        Return
        ------
        list of str
            paths
        z
VSTSDB\Deploy)rrr)rrrrVsTDb$s
zEnvironmentInfo.VsTDbcCsv|jdkrgS|jdkr0|jj}|jjdd}n|jj}d}d|j|f}t||g}|jdkrr|t||dg7}|S)zn
        Microsoft Build Engine.

        Return
        ------
        list of str
            paths
        g(@g.@T)rrzMSBuild\%0.1f\bin%sZRoslyn)rrrrrrr)r	base_pathrrRbuildrrrMSBuild0s



zEnvironmentInfo.MSBuildcCs|jdkrgSt|jjdgS)zt
        Microsoft HTML Help Workshop.

        Return
        ------
        list of str
            paths
        g&@zHTML Help Workshop)rrrr)rrrrHTMLHelpWorkshopLs

z EnvironmentInfo.HTMLHelpWorkshopcCsD|jdkrgS|jjdd}t|jjd}|j}t|d||fgS)z
        Microsoft Universal C Runtime SDK Libraries.

        Return
        ------
        list of str
            paths
        g,@T)rTrz%sucrt%s)rrrrrr_ucrt_subdir)rrrrrrr
UCRTLibraries[s

zEnvironmentInfo.UCRTLibrariescCs.|jdkrgSt|jjd}t|d|jgS)z
        Microsoft Universal C Runtime SDK Include.

        Return
        ------
        list of str
            paths
        g,@rz%sucrt)rrrrr)rrrrrUCRTIncludesms

zEnvironmentInfo.UCRTIncludescCs|jj}|rd|SdS)z
        Microsoft Universal C Runtime SDK version subdir.

        Return
        ------
        str
            subdir
        z%s\r)rr)rrrrrr}s
zEnvironmentInfo._ucrt_subdircCs(d|jkrdkrnngS|jjgS)zk
        Microsoft Visual F#.

        Return
        ------
        list of str
            paths
        g&@g(@)rrr)rrrrFSharps
zEnvironmentInfo.FSharpc
Csd|j}|jjddd}g}|jj}t|dd}t|rft	|t
|d}||t	|dg7}|t	|d	g7}d
|jdd
t|jdf}x2t
||D]"\}}t	||||}	t|	r|	SqWdS)
z
        Microsoft Visual C++ runtime redistributable dll.

        Return
        ------
        str
            path
        zvcruntime%d0.dllT)rTrz\Toolsz\RedistrXZonecorerVzMicrosoft.VC%d.CRT
N)rrrrNrrrrfrrrr:rr6rr)
rr_rprefixesZ
tools_pathZredist_pathZcrt_dirsrZcrt_dirrRrrrVCRuntimeRedists

zEnvironmentInfo.VCRuntimeRedistTcCst|d|j|j|j|jg||d|j|j|j|j	|j
g||d|j|j|j|jg||d|j
|j|j|j|j|j|j|j|jg	|d}|jdkrt|jr|j|d<|S)z
        Return environment dict.

        Parameters
        ----------
        exists: bool
            It True, only return existing paths.

        Return
        ------
        dict
            environment
        rrrrR)rrrrRr2rk)dict_build_pathsrrrrrrr	rr
rrrrrrrrrrrrr)rexistsrrrrrr*sD

zEnvironmentInfo.return_envc
Csntj|}t|dt}t||}|rs\
*
&&'$
%s:PK!iPP__pycache__/_imp.cpython-37.pycnu[B

ReX	@sddZddlZddlZddlZddlmZdZdZdZ	dZ
dZd	d
ZdddZ
dd
dZddZdS)zX
Re-implementation of find_module and get_frozen_object
from the deprecated imp module.
N)module_from_speccCs(t|trtjjntjj}|||S)N)
isinstancelist	importlib	machinery
PathFinder	find_specutil)modulepathsfinderr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_imp.pyr
sr
c	CsRt||}|dkrtd||js>t|dr>tjd|j}d}d}t|jt	}|j
dksp|rt|jtjj
rt}d}d}}n|j
dks|rt|jtjjrt}d}d}}n|jr6|j
}tj|d	}|tjjkrd
nd}|tjjkrt}n&|tjjkr
t}n|tjjkrt}|tthkrBt||}nd}d}}|||||ffS)z7Just like 'imp.find_module()', but with package supportNz
Can't find %ssubmodule_search_locationsz__init__.pyfrozenzbuilt-inrrrb)r
ImportErrorhas_locationhasattrr
rspec_from_loaderloaderrtypeorigin
issubclassrFrozenImporter	PY_FROZENBuiltinImporter	C_BUILTINospathsplitextSOURCE_SUFFIXES	PY_SOURCEBYTECODE_SUFFIXESPY_COMPILEDEXTENSION_SUFFIXESC_EXTENSIONopen)	rrspeckindfileZstaticr'suffixmoderrrfind_modulesB


r5cCs&t||}|std||j|S)Nz
Can't find %s)r
rrget_code)rrr0rrrget_frozen_objectGs
r7cCs"t||}|std|t|S)Nz
Can't find %s)r
rr)rrinfor0rrr
get_moduleNs
r9)N)N)__doc__r&importlib.utilr
Zimportlib.machineryZ
py34compatrr*r,r.r%r#r
r5r7r9rrrrs	
*
PK!u%__pycache__/py34compat.cpython-37.pycnu[B

Re@sXddlZyddlZWnek
r(YnXyejjZWnek
rRddZYnXdS)NcCs|j|jS)N)loaderload_modulename)specr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/py34compat.pymodule_from_specsr)	importlibimportlib.utilImportErrorutilrAttributeErrorrrrrsPK!)	ZNN/__pycache__/_deprecation_warning.cpython-37.pycnu[B

Re@sGdddeZdS)c@seZdZdZdS)SetuptoolsDeprecationWarningz
    Base class for warning deprecations in ``setuptools``

    This class is not derived from ``DeprecationWarning``, and as such is
    visible by default.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_deprecation_warning.pyrsrN)WarningrrrrrPK!!!#__pycache__/__init__.cpython-37.pycnu[B

Re@sRdZddlmZddlZddlZddlZddlZddlZddl	Z
ddlmZddl
mZddlmZddlZddlmZdd	lmZdd
lmZddlmZdd
ddddddgZejjZdZGdddZGdddeZ ej!Z"e j!Z#ddZ$ddZ%e
j&j%je%_e'e
j&j(Z)Gddde)Z(ddZ*ej+fddZ,Gd d!d!e-Z.e/dS)"z@Extensions to the 'distutils' for large or complex distributions)fnmatchcaseN)DistutilsOptionError)convert_path)SetuptoolsDeprecationWarning)	Extension)Distribution)Require)monkeysetuprCommandrr	r
find_packagesfind_namespace_packagesc@sBeZdZdZedddZeddZed	d
ZeddZ	d
S)
PackageFinderzI
    Generate a list of all Python packages found within a directory
    .*cCs&t|t||jd||j|S)a	Return a list all Python packages found within directory 'where'

        'where' is the root directory which will be searched for packages.  It
        should be supplied as a "cross-platform" (i.e. URL-style) path; it will
        be converted to the appropriate local path syntax.

        'exclude' is a sequence of package names to exclude; '*' can be used
        as a wildcard in the names, such that 'foo.*' will exclude all
        subpackages of 'foo' (but not 'foo' itself).

        'include' is a sequence of package names to include.  If it's
        specified, only the named packages will be included.  If it's not
        specified, all found packages will be included.  'include' can contain
        shell style wildcard patterns just like 'exclude'.
        ez_setup*__pycache__)rr)list_find_packages_iterr
_build_filter)clswhereexcludeincluderr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/__init__.pyfind-s
zPackageFinder.findccsxtj|ddD]\}}}|dd}g|dd<xl|D]d}tj||}	tj|	|}
|
tjjd}d|ks8||	s|q8||r||s|V||q8WqWdS)zy
        All the packages found in 'where' that pass the 'include' filter, but
        not the 'exclude' filter.
        T)followlinksNr)	oswalkpathjoinrelpathreplacesep_looks_like_packageappend)rrrrrootdirsfilesZall_dirsdir	full_pathrel_pathpackagerrrrGs
z!PackageFinder._find_packages_itercCstjtj|dS)z%Does a directory look like a package?z__init__.py)r r"isfiler#)r"rrrr'csz!PackageFinder._looks_like_packagecsfddS)z
        Given a list of patterns, return a callable that will be true only if
        the input matches at least one of the patterns.
        cstfddDS)Nc3s|]}t|dVqdS))patN)r).0r1)namerr	nsz@PackageFinder._build_filter....)any)r3)patterns)r3rnz-PackageFinder._build_filter..r)r6r)r6rrhszPackageFinder._build_filterN)rrr)
__name__
__module____qualname____doc__classmethodrrstaticmethodr'rrrrrr(src@seZdZeddZdS)PEP420PackageFindercCsdS)NTr)r"rrrr'rsz'PEP420PackageFinder._looks_like_packageN)r9r:r;r>r'rrrrr?qsr?cCsJGdddtjj}||}|jdd|jrFtdt||jdS)Nc@s eZdZdZddZddZdS)z4_install_setup_requires..MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        cs6d}fddt|t@D}tjj||dS)N)Zdependency_linkssetup_requirescsi|]}||qSrr)r2k)attrsrr
szQ_install_setup_requires..MinimalDistribution.__init__..)set	distutilscorer__init__)selfrBZ_inclfilteredr)rBrrGsz=_install_setup_requires..MinimalDistribution.__init__cSsdS)zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr)rHrrrfinalize_optionsszE_install_setup_requires..MinimalDistribution.finalize_optionsN)r9r:r;r<rGrJrrrrMinimalDistribution~srKT)Zignore_option_errorszdsetup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.)	rErFrparse_config_filesr@warningswarnrZfetch_build_eggs)rBrKdistrrr_install_setup_requires{srPcKst|tjjf|S)N)rPrErFr)rBrrrrsc@s:eZdZejZdZddZdddZddZd
d
dZ	dS)rFcKst||t||dS)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)_CommandrGvarsupdate)rHrOkwrrrrGszCommand.__init__NcCsBt||}|dkr"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))getattrsetattr
isinstancestrr)rHoptionwhatdefaultvalrrr_ensure_stringlikes

zCommand._ensure_stringlikecCspt||}|dkrdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|tVqdS)N)rWrX)r2vrrrr4sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r))	rUrWrXrVresplitrallr)rHrYr\okrrrensure_string_lists


zCommand.ensure_string_listrcKs t|||}t|||S)N)rQreinitialize_commandrRrS)rHcommandreinit_subcommandsrTcmdrrrrdszCommand.reinitialize_command)N)r)
r9r:r;rQr<Zcommand_consumes_argumentsrGr]rcrdrrrrrs
cCs&ddtj|ddD}ttjj|S)z%
    Find all files under 'path'
    css,|]$\}}}|D]}tj||VqqdS)N)r r"r#)r2baser*r+filerrrr4sz#_find_all_simple..T)r)r r!filterr"r0)r"resultsrrr_find_all_simplesrlcCs6t|}|tjkr.tjtjj|d}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	rlr curdir	functoolspartialr"r$mapr)r,r+Zmake_relrrrfindalls


rrc@seZdZdZdS)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r9r:r;r<rrrrrssrs)0r<fnmatchrror r_rMZ_distutils_hack.overrideZ_distutils_hackdistutils.corerEdistutils.errorsrdistutils.utilrZ_deprecation_warningrZsetuptools.version
setuptoolsZsetuptools.extensionrZsetuptools.distrZsetuptools.dependsr	r
__all__version__version__Zbootstrap_install_fromrr?rr
rrPrrFZ
get_unpatchedrrQrlrnrrrXrsZ	patch_allrrrrsLI!3PK!P%~!__pycache__/launch.cpython-37.pycnu[B

Re,@s.dZddlZddlZddZedkr*edS)z[
Launch the Python script on the command line after
setuptools is bootstrapped via import.
Nc	Csttjd}t|ddd}tjddtjdd<ttdt}||}|}WdQRX|dd}t	||d}t
||dS)	zP
    Run the script in sys.argv[1] as if it had
    been invoked naturally.
    __main__N)__file____name____doc__openz\r\nz\nexec)__builtins__sysargvdictgetattrtokenizerreadreplacecompiler)script_name	namespaceopen_ZfidscriptZnorm_scriptcoder/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/launch.pyrun
s

rr)rrr
rrrrrrs
PK!rr"__pycache__/version.cpython-37.pycnu[B

Re@s6ddlZyedjZWnek
r0dZYnXdS)N
setuptoolsunknown)
pkg_resourcesget_distributionversion__version__	Exceptionr	r	/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/version.pysPK!zz(__pycache__/unicode_utils.cpython-37.pycnu[B

Re@s,ddlZddlZddZddZddZdS)NcCsTt|trtd|Sy$|d}td|}|d}Wntk
rNYnX|S)NZNFDzutf-8)
isinstancestrunicodedata	normalizedecodeencodeUnicodeError)pathr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/unicode_utils.py	decomposes

rc	CsVt|tr|Stpd}|df}x.|D]&}y
||Stk
rLw(Yq(Xq(WdS)zY
    Ensure that the given path is decoded,
    NONE when no expected encoding works
    zutf-8N)rrsysgetfilesystemencodingrUnicodeDecodeError)r	Zfs_enc
candidatesencr
r
rfilesys_decodes


rcCs$y
||Stk
rdSXdS)z/turn unicode encoding into a functional routineN)rUnicodeEncodeError)stringrr
r
r
try_encode%s
r)rr
rrrr
r
r
rsPK!oK1qq'__pycache__/archive_util.cpython-37.pycnu[B

Re@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddddd	d
dgZGdd	d	eZd
dZ
e
dfddZe
fddZe
fddZddZddZe
fddZeeefZdS)z/Utilities for extracting common archive formatsN)DistutilsError)ensure_directoryunpack_archiveunpack_zipfileunpack_tarfiledefault_filterUnrecognizedFormatextraction_driversunpack_directoryc@seZdZdZdS)rz#Couldn't recognize the archive typeN)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/archive_util.pyrscCs|S)z@The default progress/filter callback; returns True for all filesr)srcdstrrrrsc	CsNxH|ptD]0}y||||Wntk
r4w
Yq
XdSq
Wtd|dS)aUnpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat``

    `progress_filter` is a function taking two arguments: a source path
    internal to the archive ('/'-separated), and a filesystem path where it
    will be extracted.  The callback must return the desired extract path
    (which may be the same as the one passed in), or else ``None`` to skip
    that file or directory.  The callback can thus be used to report on the
    progress of the extraction, as well as to filter the items extracted or
    alter their extraction paths.

    `drivers`, if supplied, must be a non-empty sequence of functions with the
    same signature as this function (minus the `drivers` argument), that raise
    ``UnrecognizedFormat`` if they do not support extracting the designated
    archive type.  The `drivers` are tried in sequence until one is found that
    does not raise an error, or until all are exhausted (in which case
    ``UnrecognizedFormat`` is raised).  If you do not supply a sequence of
    drivers, the module's ``extraction_drivers`` constant will be used, which
    means that ``unpack_zipfile`` and ``unpack_tarfile`` will be tried, in that
    order.
    Nz!Not a recognized archive type: %s)r	r)filenameextract_dirprogress_filterZdriversZdriverrrrrscCstj|std||d|fi}xt|D]\}}}||\}}x4|D],}	||	dtj||	f|tj||	<qLWx\|D]T}
tj||
}|||
|}|sqt|tj||
}
t|
|t	|
|qWq0WdS)z"Unpack" a directory, using the same interface as for archives

    Raises ``UnrecognizedFormat`` if `filename` is not a directory
    z%s is not a directory/N)
ospathisdirrwalkjoinrshutilcopyfilecopystat)rrrpathsbasedirsfilesrrdftargetrrrr
@s 
,
c
Cst|std|ft|}x|D]}|j}|ds.d|dkrRq.tj	j
|f|d}|||}|szq.|drt|n4t||
|j}t|d}||WdQRX|jd?}	|	r.t||	q.WWdQRXdS)zUnpack zip `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a zipfile (as determined
    by ``zipfile.is_zipfile()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z%s is not a zip filerz..wbN)zipfile
is_zipfilerZipFileinfolistr
startswithsplitrrrendswithrreadopenwrite
external_attrchmod)
rrrzinfonamer&datar%Zunix_attributesrrrr[s(




cCsxV|dk	rV|s|rV|j}|rJt|j}t||}t|}||}qW|dk	on|	pn|
}|rx|StddS)z;Resolve any links and extract link targets as normal files.NzGot unknown file type)islnkissymlinkname	posixpathdirnamer7rnormpath
_getmemberisfilerLookupError)tar_objZtar_member_objlinkpathr!Zis_file_or_dirrrr_resolve_tar_file_or_dirs

rDc
csdd|_t|x|D]}|j}|dsd|dkr@qtjj|f|d}yt	||}Wnt
k
r|wYnX|||}|sq|tjr|dd}||fVqWWdQRXdS)z1Emit member-destination pairs from a tar archive.cWsdS)Nr)argsrrrz _iter_open_tar..rz..N)
chown
contextlibclosingr7r-r.rrrrDrAr/sep)rBrrmemberr7Z
prelim_dst	final_dstrrr_iter_open_tars"


rOc
Csyt|}Wn4tjk
rB}ztd|f|Wdd}~XYnXx@t|||D]0\}}y|||WqRtjk
rYqRXqRWdS)zUnpack tar/tar.gz/tar.bz2 `filename` to `extract_dir`

    Raises ``UnrecognizedFormat`` if `filename` is not a tarfile (as determined
    by ``tarfile.open()``).  See ``unpack_archive()`` for an explanation
    of the `progress_filter` argument.
    z/%s is not a compressed or uncompressed tar fileNT)tarfiler1TarErrorrrO_extract_memberExtractError)rrrtarobjerMrNrrrrs

)rr)rPrrr<rJdistutils.errorsr
pkg_resourcesr__all__rrrr
rrDrOrr	rrrrs(
"%PK!"PP!__pycache__/config.cpython-37.pycnu[B

ReSZ@sddlZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZddl
Z
ddlmZmZddlmZmZddlmZGd	d
d
Ze
jddZdddZddZddZdddZGdddZGdddeZGdddeZdS)N)defaultdict)partial)wraps)iglob)DistutilsOptionErrorDistutilsFileError)
LegacyVersionparse)SpecifierSetc@s eZdZdZddZddZdS)StaticModulez0
    Attempt to load the module by the name
    c	CsLtj|}t|j}|}WdQRXt|}t|	t
|`dS)N)	importlibutil	find_specopenoriginreadastr	varsupdatelocalsself)rnamespecstrmsrcmoduler/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/config.py__init__s
zStaticModule.__init__c
sVytfdd|jjDStk
rP}ztdjft|Wdd}~XYnXdS)Nc3sH|]@}t|tjr|jD](}t|tjr|jkrt|jVqqdS)N)
isinstancerZAssigntargetsNameidliteral_evalvalue).0Z	statementtarget)attrrr	$s
z+StaticModule.__getattr__..z#{self.name} has no attribute {attr})nextrbody	ExceptionAttributeErrorformatr)rr'er)r'r__getattr__!s
zStaticModule.__getattr__N)__name__
__module____qualname____doc__rr/rrrrrsrc	cs,ztjd|dVWdtj|XdS)zH
    Add path to front of sys.path for the duration of the context.
    rN)syspathinsertremove)r5rrr
patch_path0s
r8Fc		Csddlm}m}tj|}tj|s4td|t}t	tj
|zJ|}|rb|ng}||krx|||j
||dt||j|d}Wdt	|Xt|S)a,Read given configuration file and returns options from it as a dict.

    :param str|unicode filepath: Path to configuration file
        to get options from.

    :param bool find_others: Whether to search for other configuration files
        which could be on in various places.

    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.

    :rtype: dict
    r)Distribution
_Distributionz%Configuration file %s does not exist.)	filenames)ignore_option_errorsN)Zsetuptools.distr9r:osr5abspathisfilergetcwdchdirdirnamefind_config_filesappendparse_config_filesparse_configurationcommand_optionsconfiguration_to_dict)	filepathZfind_othersr<r9r:Zcurrent_directorydistr;handlersrrrread_configuration<s 
rLcCs.djft}tt||}t|||}|S)z
    Given a target object and option key, get that option from
    the target object, either through a get_{key} method or
    from an attribute directly.
    z	get_{key})r-r	functoolsrgetattr)
target_objkeyZgetter_nameZby_attributegetterrrr_get_optionisrRcCsDtt}x6|D].}x(|jD]}t|j|}|||j|<qWqW|S)zReturns configuration data gathered by given handlers as a dict.

    :param list[ConfigHandler] handlers: Handlers list,
        usually from parse_configuration()

    :rtype: dict
    )rdictset_optionsrRrOsection_prefix)rKZconfig_dicthandleroptionr$rrrrHus
rHcCs6t|||}|t|j|||j}|||fS)aPerforms additional parsing of configuration options
    for a distribution.

    Returns a list of used option handlers.

    :param Distribution distribution:
    :param dict command_options:
    :param bool ignore_option_errors: Whether to silently ignore
        options, values of which could not be resolved (e.g. due to exceptions
        in directives such as file:, attr:, etc.).
        If False exceptions are propagated as expected.
    :rtype: list
    )ConfigOptionsHandlerr	ConfigMetadataHandlermetadatapackage_dir)distributionrGr<optionsmetarrrrFsrFc@seZdZdZdZiZd'ddZeddZdd	Z	e
d(ddZe
d)d
dZe
ddZ
e
ddZe
ddZe
ddZeddZeddZe
d*ddZe
ddZe
d+dd Zd!d"Zd#d$Zd%d&ZdS),
ConfigHandlerz1Handles metadata supplied in configuration files.NFcCsbi}|j}x:|D].\}}||s(q||dd}|||<qW||_||_||_g|_dS)N.)	rUitems
startswithreplacestripr<rOsectionsrT)rrOr]r<rfrUsection_namesection_optionsrrrrs
zConfigHandler.__init__cCstd|jjdS)z.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)NotImplementedError	__class__r0)rrrrparsersszConfigHandler.parsersc	Cst}|j}|j||}t|||}||kr6t||r>dSd}|j|}|ry||}Wn tk
r~d}|jszYnX|rdSt|d|d}|dkrt	|||n|||j
|dS)NFTzset_%s)tuplerOaliasesgetrNKeyErrorrkr+r<setattrrTrD)	rZoption_namer$unknownrOZ
current_valueZskip_optionparsersetterrrr__setitem__s0zConfigHandler.__setitem__,cCs8t|tr|Sd|kr |}n
||}dd|DS)zRepresents value as a list.

        Value is split either by separator (defaults to comma) or by lines.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        
cSsg|]}|r|qSr)re)r%chunkrrr
sz-ConfigHandler._parse_list..)rlist
splitlinessplit)clsr$	separatorrrr_parse_lists



zConfigHandler._parse_listc	snd}|j|d}g}xR|D]Jtfdd|Dr\|tddttjDq|qW|S)aEquivalent to _parse_list() but expands any glob patterns using glob().

        However, unlike with glob() calls, the results remain relative paths.

        :param value:
        :param separator: List items separator character.
        :rtype: list
        )*?[]{})r}c3s|]}|kVqdS)Nr)r%char)r$rrr(sz1ConfigHandler._parse_list_glob..css |]}tj|tVqdS)N)r=r5relpathr@)r%r5rrrr(s)	r~anyextendsortedrr=r5r>rD)r|r$r}Zglob_charactersvaluesZexpanded_valuesr)r$r_parse_list_globs

zConfigHandler._parse_list_globcCsTd}i}xF||D]8}||\}}}||kr.parserr)r|rPrrr)rPr_exclude_files_parser=s	z#ConfigHandler._exclude_files_parsercs\d}t|ts|S||s |S|t|d}dd|dD}dfdd|DS)aORepresents value as a string, allowing including text
        from nearest files using `file:` directive.

        Directive is sandboxed and won't reach anything outside
        directory with setup.py.

        Examples:
            file: README.rst, CHANGELOG.md, src/file.txt

        :param str value:
        :rtype: str
        zfile:Ncss|]}tj|VqdS)N)r=r5r>re)r%r5rrrr(ksz,ConfigHandler._parse_file..rurvc3s.|]&}|stj|r|VqdS)TN)
_assert_localr=r5r?
_read_file)r%r5)r|rrr(ms)rstrrclenr{join)r|r$Zinclude_directiverZ	filepathsr)r|r_parse_fileTs


zConfigHandler._parse_filecCs|tstd|dS)Nz#`file:` directive can not access %s)rcr=r@r)rIrrrrrszConfigHandler._assert_localc	Cs"tj|dd
}|SQRXdS)Nzutf-8)encoding)iorr)rIfrrrrwszConfigHandler._read_filec	Csd}||s|S||dd}|}d|}|p@d}t}|r|d|kr||d}|dd}	t	|	dkrtj
t|	d}|	d}q|}nd|krtj
t|d}t|4ytt
||Stk
rt|}
YnXWdQRXt|
|S)	zRepresents value as a module attribute.

        Examples:
            attr: package.attr
            attr: package.module.attr

        :param str value:
        :rtype: str
        zattr:r`rarr/N)rcrdrer{poprr=r@rsplitrr5r8rNrr+r
import_module)r|r$r[Zattr_directiveZ
attrs_path	attr_namemodule_nameparent_pathZcustom_pathpartsrrrr_parse_attr|s0



zConfigHandler._parse_attrcsfdd}|S)zReturns parser function to represents value as a list.

        Parses a value applying given methods one after another.

        :param parse_methods:
        :rtype: callable
        cs|}xD]}||}q
W|S)Nr)r$parsedmethod)
parse_methodsrrr	s
z1ConfigHandler._get_parser_compound..parser)r|rr	r)rr_get_parser_compounds
z"ConfigHandler._get_parser_compoundcCs:i}|pdd}x$|D]\}\}}||||<qW|S)zParses section options into a dictionary.

        Optionally applies a given parser to values.

        :param dict section_options:
        :param callable values_parser:
        :rtype: dict
        cSs|S)Nr)rrrrz6ConfigHandler._parse_section_to_dict..)rb)r|rhZ
values_parserr$rP_rrrr_parse_section_to_dicts

z$ConfigHandler._parse_section_to_dictc	Cs@x:|D].\}\}}y|||<Wq
tk
r6Yq
Xq
WdS)zQParses configuration file section.

        :param dict section_options:
        N)rbro)rrhrrr$rrr
parse_sections
zConfigHandler.parse_sectioncCsfx`|jD]R\}}d}|r$d|}t|d|ddd}|dkrVtd|j|f||qWdS)zTParses configuration file items from one
        or more related sections.

        r`z_%szparse_section%sra__Nz0Unsupported distribution option section: [%s.%s])rfrbrNrdrrU)rrgrhZmethod_postfixZsection_parser_methodrrrr	szConfigHandler.parsecstfdd}|S)zthis function will wrap around parameters that are deprecated

        :param msg: deprecation message
        :param warning_class: class of warning exception to be raised
        :param func: function to be wrapped around
        cst||S)N)warningswarn)argskwargs)funcmsg
warning_classrrconfig_handlersz@ConfigHandler._deprecated_config_handler..config_handler)r)rrrrrr)rrrr_deprecated_config_handlersz(ConfigHandler._deprecated_config_handler)F)ru)ru)N)N)r0r1r2r3rUrmrpropertyrkrtclassmethodr~rrrrrstaticmethodrrrrrrr	rrrrrr_s0
&
-r_csHeZdZdZdddddZdZdfd	d
	ZeddZd
dZ	Z
S)rYrZurldescriptionclassifiers	platforms)Z	home_pagesummary
classifierplatformFNcstt||||||_dS)N)superrYrr[)rrOr]r<r[)rjrrrs

zConfigMetadataHandler.__init__cCs^|j}|j}|j}|j}|||||dt|||||d||ddt||||j|d
S)z.Metadata item name to parser function mapping.z[The requires parameter is deprecated, please use install_requires for runtime dependencies.licenselicense_filezDThe license_file parameter is deprecated, use license_files instead.)
rkeywordsprovidesrequires	obsoletesrrrZ
license_filesrlong_descriptionversionproject_urls)r~rrrrDeprecationWarningr_parse_version)r
parse_listZ
parse_file
parse_dictZexclude_files_parserrrrrks.
zConfigMetadataHandler.parserscCs||}||krB|}tt|tr>d}t|jft|S|||j	}t
|r^|}t|tst|drd
tt|}nd|}|S)zSParses `version` option value.

        :param value:
        :rtype: str

        zCVersion loaded from {value} does not comply with PEP 440: {version}__iter__raz%s)rrerr	rrr-rrr[callablerhasattrrmap)rr$rtmplrrrr?s


z$ConfigMetadataHandler._parse_version)FN)r0r1r2rUrmZstrict_moderrrkr
__classcell__rr)rjrrYs"rYc@sdeZdZdZeddZddZddZdd	Zd
dZ	dd
Z
ddZddZddZ
ddZdS)rXr]cCsN|j}t|jdd}|j}|j}|j}|||||||||||j|j|t|dS)z.Metadata item name to parser function mapping.;)r})Zzip_safeZinclude_package_datar[scriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ
tests_requirepackagesentry_points
py_modulesZpython_requirescmdclass)r~rrr_parse_cmdclass_parse_packagesrr
)rrZparse_list_semicolonZ
parse_boolrZparse_cmdclassrrrrkgs(zConfigOptionsHandler.parserscs$ddfdd||DS)NcSs8|d}||dd}|d|}t|}t||S)Nrar)rfind
__import__rN)Zqualified_class_nameidx
class_namepkg_namerrrr
resolve_classs

z;ConfigOptionsHandler._parse_cmdclass..resolve_classcsi|]\}}||qSrr)r%kv)rrr
sz8ConfigOptionsHandler._parse_cmdclass..)rrb)rr$r)rrrs	z$ConfigOptionsHandler._parse_cmdclasscCsjddg}|}||kr"||S||dk}||jdi}|rTddlm}nddlm}|f|S)zTParses `packages` option value.

        :param value:
        :rtype: list
        zfind:zfind_namespace:rz
packages.findr)find_namespace_packages)
find_packages)rer~parse_section_packages__findrfrn
setuptoolsrr)rr$Zfind_directivesZ
trimmed_valueZfindnsfind_kwargsrrrrrs
z$ConfigOptionsHandler._parse_packagescsT|||j}dddgtfdd|D}|d}|dk	rP|d|d<|S)zParses `packages.find` configuration file section.

        To be used in conjunction with _parse_packages().

        :param dict section_options:
        whereincludeexcludecs$g|]\}}|kr|r||fqSrr)r%rr)
valid_keysrrrxszEConfigOptionsHandler.parse_section_packages__find..Nr)rr~rSrbrn)rrhZsection_datarrr)rrrs

z1ConfigOptionsHandler.parse_section_packages__findcCs|||j}||d<dS)z`Parses `entry_points` configuration file section.

        :param dict section_options:
        rN)rr~)rrhrrrrparse_section_entry_pointssz/ConfigOptionsHandler.parse_section_entry_pointscCs.|||j}|d}|r*||d<|d=|S)Nrr`)rr~rn)rrhrrootrrr_parse_package_datas
z(ConfigOptionsHandler._parse_package_datacCs|||d<dS)z`Parses `package_data` configuration file section.

        :param dict section_options:
        package_dataN)r)rrhrrrparse_section_package_datasz/ConfigOptionsHandler.parse_section_package_datacCs|||d<dS)zhParses `exclude_package_data` configuration file section.

        :param dict section_options:
        Zexclude_package_dataN)r)rrhrrr"parse_section_exclude_package_datasz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}||||d<dS)zbParses `extras_require` configuration file section.

        :param dict section_options:
        r)r}Zextras_requireN)rr~r)rrhrrrrparse_section_extras_requiresz1ConfigOptionsHandler.parse_section_extras_requirecCs(|||j}dd|D|d<dS)z^Parses `data_files` configuration file section.

        :param dict section_options:
        cSsg|]\}}||fqSrr)r%rrrrrrxszAConfigOptionsHandler.parse_section_data_files..
data_filesN)rrrb)rrhrrrrparse_section_data_filessz-ConfigOptionsHandler.parse_section_data_filesN)r0r1r2rUrrkrrrrrrrrrrrrrrXcs

rX)FF)F) rrr=r4rrMrcollectionsrrrglobr
contextlibdistutils.errorsrrZ#setuptools.extern.packaging.versionrr	Z&setuptools.extern.packaging.specifiersr
rcontextmanagerr8rLrRrHrFr_rYrXrrrrs2
-
c_PK!(%__pycache__/namespaces.cpython-37.pycnu[B

Re@sFddlZddlmZddlZejjZGdddZGdddeZdS)N)logc@sTeZdZdZddZddZddZdZd	Zd
dZ	dd
Z
ddZeddZ
dS)	Installerz
-nspkg.pthc	Cs|}|sdStj|\}}||j7}|j|t	d|t
|j|}|jrdt
|dSt|d}||WdQRXdS)Nz
Installing %swt)_get_all_ns_packagesospathsplitext_get_target	nspkg_extoutputsappendrinfomap_gen_nspkg_linedry_runlistopen
writelines)selfnspfilenameextlinesfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/namespaces.pyinstall_namespaces
s
zInstaller.install_namespacescCsHtj|\}}||j7}tj|s.dStd|t|dS)NzRemoving %s)	rrrr	r
existsrr
remove)rrrrrruninstall_namespacess
zInstaller.uninstall_namespacescCs|jS)N)target)rrrrr	'szInstaller._get_target)	zimport sys, types, osz#has_mfs = sys.version_info > (3, 5)z$p = os.path.join(%(root)s, *%(pth)r)z4importlib = has_mfs and __import__('importlib.util')z-has_mfs and __import__('importlib.machinery')zm = has_mfs and sys.modules.setdefault(%(pkg)r, importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec(%(pkg)r, [os.path.dirname(p)])))zCm = m or sys.modules.setdefault(%(pkg)r, types.ModuleType(%(pkg)r))z7mp = (m or []) and m.__dict__.setdefault('__path__',[])z(p not in mp) and mp.append(p))z4m and setattr(sys.modules[%(parent)r], %(child)r, m)cCsdS)Nz$sys._getframe(1).f_locals['sitedir']r)rrrr	_get_rootEszInstaller._get_rootcCsNt|d}|}|j}|d\}}}|r:||j7}d|tdS)N.;
)tuplesplitr!_nspkg_tmpl
rpartition_nspkg_tmpl_multijoinlocals)rpkgpthrootZ
tmpl_linesparentsepchildrrrrHs
zInstaller._gen_nspkg_linecCs |jjp
g}ttt|j|S)z,Return sorted list of all package namespaces)distributionZnamespace_packagessortedflattenr
_pkg_names)rpkgsrrrrQszInstaller._get_all_ns_packagesccs,|d}x|r&d|V|qWdS)z
        Given a namespace package, yield the components of that
        package.

        >>> names = Installer._pkg_names('a.b.c')
        >>> set(names) == set(['a', 'a.b', 'a.b.c'])
        True
        r"N)r&r*pop)r,partsrrrr5Vs

zInstaller._pkg_namesN)__name__
__module____qualname__r
rrr	r'r)r!rrstaticmethodr5rrrrr	s	rc@seZdZddZddZdS)DevelopInstallercCstt|jS)N)reprstrZegg_path)rrrrr!gszDevelopInstaller._get_rootcCs|jS)N)egg_link)rrrrr	jszDevelopInstaller._get_targetN)r9r:r;r!r	rrrrr=fsr=)	r	distutilsr	itertoolschain
from_iterabler4rr=rrrrs
]PK!pت$__pycache__/extension.cpython-37.pycnu[B

Re@spddlZddlZddlZddlZddlZddlmZddZeZ	eej
jZGdddeZGdd	d	eZ
dS)
N)
get_unpatchedcCs2d}yt|dgdjdStk
r,YnXdS)z0
    Return True if Cython can be imported.
    zCython.Distutils.build_ext	build_ext)fromlistTF)
__import__r	Exception)Zcython_implr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/extension.py_have_cython
sr
c@s eZdZdZddZddZdS)	Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs(|dd|_tj|||f||dS)Npy_limited_apiF)popr
_Extension__init__)selfnamesourcesargskwrrr	r!szExtension.__init__cCsNtr
dS|jpd}|dkr$dnd}ttjd|}tt||j	|_	dS)z
        Replace sources with .pyx extensions to sources with the target
        language extension. This mechanism allows language authors to supply
        pre-converted sources but to prefer the .pyx sources.
        Nzc++z.cppz.cz.pyx$)
r
languagelower	functoolspartialresublistmapr)rlangZ
target_extrrrr	_convert_pyx_sources_to_lang's
z&Extension._convert_pyx_sources_to_langN)__name__
__module____qualname____doc__rrrrrr	rsrc@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#rrrr	r$6sr$)rrdistutils.core	distutilsdistutils.errorsdistutils.extensionZmonkeyrr
Z
have_pyrexcorerrr$rrrr	sPK!凎__pycache__/dist.cpython-37.pycnu[B

ReO@sdgZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZddl
mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd	lmZdd
lm Z m!Z!ddl
m"Z"ddl#m$Z$dd
l%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,Z,ddl-Z,ddl,m.Z.ddl/m0Z0ddl1m2Z2ddl3Z3erpddl4m5Z5e6de6dddZ7ddZ8e9e9dddZ:de9ee9d d!d"Z;de9ee9d d#d$Zd*d+Z?d,d-Z@d.d/ZAeBeCfZDd0d1ZEd2d3ZFd4d5ZGd6d7ZHd8d9ZId:d;ZJdd?ZLd@dAZMdBdCZNdDdEZOdFdGZPdHdIZQe0ejRjSZTGdJddeTZSGdKdLdLe+ZUdS)MDistributionN)	strtobool)DEBUG)translate_longopt)iglob)ListOptional
TYPE_CHECKING)defaultdict)message_from_file)DistutilsOptionErrorDistutilsSetupError)
rfc822_escape)
StrictVersion)	packaging)ordered_set)unique_everseen)SetuptoolsDeprecationWarning)windows_support)
get_unpatched)parse_configuration)Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstdtt|S)NzDo not call this function)warningswarnDistDeprecationWarningr)clsr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/dist.py_get_unpatched2srcCs&t|dd}|dkr"td}||_|S)Nmetadata_versionz2.1)getattrrr )selfmvrrrget_metadata_version7s
r$)contentreturnc
CsJ|}t|dkr |dSd|dtd|ddfS)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr
N)
splitlineslenlstripjointextwrapdedent)r%linesrrrrfc822_unescape?sr/r)msgfieldr&cCs||}|dkrdS|S)zRead Message header field.UNKNOWNNr)r0r1valuerrr_read_field_from_msgGsr4cCst||}|dkr|St|S)z4Read Message header field and apply rfc822_unescape.N)r4r/)r0r1r3rrr_read_field_unescaped_from_msgOs
r5cCs||d}|gkrdS|S)z9Read Message header field and return all results as list.N)get_all)r0r1valuesrrr_read_list_from_msgWsr8)r0r&cCs|}|dkrdS|S)Nr2)get_payloadstrip)r0r3rrr_read_payload_from_msg_sr;cCsVt|}t|d|_t|d|_t|d|_t|d|_t|d|_d|_t|d|_	d|_
t|d|_t|d	|_
d
|krt|d
|_nd|_t|d|_|jdkr|jtdkrt||_t|d|_d
|krt|d
d|_t|d|_t|d|_|jtdkr4t|d|_t|d|_t|d|_nd|_d|_d|_t|d|_dS)z-Reads the metadata values from a file object.zmetadata-versionnameversionsummaryauthorNzauthor-emailz	home-pagelicensezdownload-urldescriptionz2.1keywords,platform
classifierz1.1requiresprovides	obsoleteszlicense-file)rrr r4r<r=rAr?
maintainerauthor_emailmaintainer_emailurlr5r@download_urllong_descriptionr;splitrBr8	platformsclassifiersrFrGrH
license_files)r"filer0rrr
read_pkg_filefs<
rTcCs"d|krtd|dd}|S)Nr'z1newlines not allowed and will break in the future )rrreplace)valrrrsingle_lines
rXc
s|}fdd}|dt||d||d||dt||d|d}x.|D]&\}}t||d	}|d	k	rh|||qhWt|	}|d
||j
r|d|j
x |jD]}	|dd
|	qWd
|}
|
r|d|
x|D]}|d|qW|d||d||d||d|t|drv|d|j|jr|d|j|jrx|jD]}|d|qW|d|jpgd|d	S)z0Write the PKG-INFO format data to a file object.csd||fdS)Nz%s: %s
)write)keyr3)rSrrwrite_fieldsz#write_pkg_file..write_fieldzMetadata-VersionNameVersionZSummaryz	Home-page))ZAuthorr?)zAuthor-emailrJ)Z
MaintainerrI)zMaintainer-emailrKNZLicensezDownload-URLzProject-URLz%s, %srCZKeywordsPlatform
ClassifierRequiresProvides	Obsoletespython_requireszRequires-PythonzDescription-Content-TypezProvides-ExtrazLicense-Filez
%s

)r$strget_nameget_versionrXget_descriptionget_urlr!rget_licenserMproject_urlsitemsr+get_keywords
get_platforms_write_listget_classifiersget_requiresget_provides
get_obsoleteshasattrrclong_description_content_typeprovides_extrasrRrYget_long_description)
r"rSr=r[Zoptional_fieldsr1attrZattr_valr@project_urlrBrDextrar)rSrwrite_pkg_filesH

rzcCs`ytjd|}|jrtWn<ttttfk
rZ}ztd||f|Wdd}~XYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r))	
pkg_resources
EntryPointparseextrasAssertionError	TypeError
ValueErrorAttributeErrorr
)distrwr3eperrrcheck_importablesrcCsjy(t|ttfstd||ks&tWn<ttttfk
rd}ztd||f|Wdd}~XYnXdS)z"Verify that value is a string listz%%r must be a list of strings (got %r)N)	
isinstancelisttuplerr+rrrr
)rrwr3rrrrassert_string_listsrcCsh|}t|||xR|D]J}||s4tdd||d\}}}|r||krtjd||qWdS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)rhas_contents_forr

rpartition	distutilslogr)rrwr3Zns_packagesnspparentsepchildrrr	check_nsps

rc
CsPyttt|Wn2tttfk
rJ}ztd|Wdd}~XYnXdS)z+Verify that extras_require mapping is validz'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N)	r	itertoolsstarmap_check_extrarkrrrr
)rrwr3rrrrcheck_extras
srcCs<|d\}}}|r*t|r*td|tt|dS)N:zInvalid environment marker: )	partitionr{invalid_markerr
rparse_requirements)ryreqsr<rmarkerrrrrsrcCs&t||kr"d}t|j||ddS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rwr3N)boolr
format)rrwr3tmplrrrassert_boolsrcCs,|st|dtdSt|ddS)Nz is ignored.z is invalid.)rrrr
)rrwr3rrrinvalid_unless_false$src
Csly(tt|t|ttfr&tdWn>ttfk
rf}zd}t|j	||d|Wdd}~XYnXdS)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error})rwerrorN)
rr{rrdictsetrrr
r)rrwr3rrrrrcheck_requirements+src
CsXytj|WnBtjjtfk
rR}zd}t|j||d|Wdd}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error})rwrN)r
specifiersSpecifierSetInvalidSpecifierrr
r)rrwr3rrrrrcheck_specifier9s
rc
CsBytj|Wn,tk
r<}zt||Wdd}~XYnXdS)z)Verify that entry_points map is parseableN)r{r|	parse_maprr
)rrwr3rrrrcheck_entry_pointsDsrcCst|tstddS)Nztest_suite must be a string)rrdr
)rrwr3rrrcheck_test_suiteLs
rcCs^t|tstd|x@|D]4\}}t|tsDtd||t|d||q"WdS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)rrr
rrkrdr)rrwr3kvrrrcheck_package_dataQs

rcCs,x&|D]}td|stjd|qWdS)Nz\w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)rematchrrr)rrwr3pkgnamerrrcheck_packages`s

rc@s~eZdZdZddeejdddddZdZdd	Z	dUd
dZ
dd
ZeddZ
eddZddZddZeddZddZddZddZeddZdVd d!Zd"d#Zd$d%Zd&d'ZdWd(d)ZdXd+d,Zd-d.Zd/d0Zed1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"d;d<Z#d=d>Z$d?d@Z%dAdBZ&dCdDZ'dEdFZ(dGdHZ)dIdJZ*dKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/dS)YraGDistribution with support for tests and package data

    This is an enhanced version of 'distutils.dist.Distribution' that
    effectively adds the following new optional keyword arguments to 'setup()':

     'install_requires' -- a string or sequence of strings specifying project
        versions that the distribution requires when installed, in the format
        used by 'pkg_resources.require()'.  They will be installed
        automatically when the package is installed.  If you wish to use
        packages that are not available in PyPI, or want to give your users an
        alternate download location, you can add a 'find_links' option to the
        '[easy_install]' section of your project's 'setup.cfg' file, and then
        setuptools will scan the listed web pages for links that satisfy the
        requirements.

     'extras_require' -- a dictionary mapping names of optional "extras" to the
        additional requirement(s) that using those extras incurs. For example,
        this::

            extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])

        indicates that the distribution can optionally provide an extra
        capability called "reST", but it can only be used if docutils and
        reSTedit are installed.  If the user installs your package using
        EasyInstall and requests one of your extras, the corresponding
        additional requirements will be installed if needed.

     'test_suite' -- the name of a test suite to run for the 'test' command.
        If the user runs 'python setup.py test', the package will be installed,
        and the named test suite will be run.  The format is the same as
        would be used on a 'unittest.py' command line.  That is, it is the
        dotted name of an object to import and call to generate a test suite.

     'package_data' -- a dictionary mapping package names to lists of filenames
        or globs to use to find data files contained in the named packages.
        If the dictionary has filenames or globs listed under '""' (the empty
        string), those names will be searched for in every package, in addition
        to any names for the specific package.  Data files found using these
        names/globs will be installed along with the package, in the same
        location as the package.  Note that globs are allowed to reference
        the contents of non-package subdirectories, as long as you use '/' as
        a path separator.  (Globs are automatically converted to
        platform-specific paths at runtime.)

    In addition to these new keywords, this class also has several new methods
    for manipulating the distribution's contents.  For example, the 'include()'
    and 'exclude()' methods can be thought of as in-place add and subtract
    commands that add or remove packages, modules, extensions, and so on from
    the distribution.
    cCsdS)NrrrrrzDistribution.cCsdS)NrrrrrrrcCsdS)Nrrrrrrr)rtrjrulicense_filerRNcCsl|rd|ksd|krdStt|d}tjj|}|dk	rh|dshtt|d|_	||_
dS)Nr<r=zPKG-INFO)r{	safe_namerdlowerworking_setby_keygethas_metadatasafe_version_version
_patched_dist)r"attrsrZrrrrpatch_missing_pkg_infosz#Distribution.patch_missing_pkg_infocstd}|si_|pi}g_|dd_||dg_|dg_x$t	dD]}t
|jdqbWt
fdd|D|jjj_dS)Npackage_datasrc_rootdependency_linkssetup_requireszdistutils.setup_keywordscs i|]\}}|jkr||qSr)_DISTUTILS_UNSUPPORTED_METADATA).0rr)r"rr
sz)Distribution.__init__..)rsr
dist_filespoprrrrr{iter_entry_pointsvars
setdefaultr<
_Distribution__init__rk_set_metadata_defaults_normalize_version_validate_versionmetadatar=_finalize_requires)r"rZhave_package_datarr)r"rrs&



zDistribution.__init__cCs8x2|jD]$\}}t|j||||qWdS)z
        Fill-in missing metadata fields not supported by distutils.
        Some fields may have been set by other tools (e.g. pbr).
        Those fields (vars(self.metadata)) take precedence to
        supplied attrs.
        N)rrkrrrr)r"roptiondefaultrrrrsz#Distribution._set_metadata_defaultscCsPt|tjs|dkr|Sttj|}||krLd}t|j	ft
|S|S)Nz)Normalizing '{version}' to '{normalized}')r
setuptoolssicrdrr=r]rrrlocals)r=
normalizedrrrrrszDistribution._normalize_versionc	Csbt|tjrt|}|dk	r^ytj|Wn0tjjtfk
r\t	
d|t|SX|S)NzThe version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)
rnumbersNumberrdrr=r]InvalidVersionrrrrr)r=rrrrszDistribution._validate_versioncCsjt|ddr|j|j_t|ddrVx2|jD]$}|dd}|r.|jj|q.W||	dS)z
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rcNextras_requirerr)
r!rcrrkeysrOruadd_convert_extras_requirements"_move_install_requirements_markers)r"ryrrrrs
zDistribution._finalize_requirescCspt|ddpi}tt|_xP|D]D\}}|j|x0t|D]"}||}|j|||qBWq$WdS)z
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        rN)	r!r
r_tmp_extras_requirerkr{r_suffix_forappend)r"Z
spec_ext_reqssectionrrsuffixrrrrs


z)Distribution._convert_extras_requirementscCs|jrdt|jSdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        rr)rrd)reqrrrr!szDistribution._suffix_forcsdd}tddpd}tt|}t||}t||}ttt|_	x&|D]}j
dt|j|qRWt
fddj
D_dS)	zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jS)N)r)rrrr
is_simple_req3szFDistribution._move_install_requirements_markers..is_simple_reqinstall_requiresNrrc3s,|]$\}}|ddtj|DfVqdS)cSsg|]}t|qSr)rd)rrrrr
?szMDistribution._move_install_requirements_markers...N)map
_clean_req)rrr)r"rr	?szBDistribution._move_install_requirements_markers..)r!rr{rfilterrfilterfalserrdrrrrrrkr)r"rZspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsrr)r"rr)s



z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        N)r)r"rrrrrCszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r2||kr2|||dkrF|dkrFd}tt|||j_dS)z>> list(Distribution._expand_patterns(['LICENSE']))
        ['LICENSE']
        >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*']))
        ['setup.cfg', 'LICENSE']
        css:|]2}tt|D] }|dstj|r|VqqdS)~N)sortedrendswithospathisfile)rpatternrrrrrfsz0Distribution._expand_patterns..r)rrrrr]s	zDistribution._expand_patternsc
Csddlm}tjtjkrgnddddddd	d
ddd
ddg
}t|}|dkrR|}tr`|d|}t	|_
x|D]}tj|dd(}tr|dj
ft||WdQRXxt|D]h}||}||}	xN|D]F}
|
dks|
|krq|||
}||
|}
||
|}
||f|	|
<qWqW|qrWd|jkrDdSx|jdD]\}
\}}|j|
}
|
r~t|}n|
dkrt|}yt||
p|
|Wn.tk
r}zt||Wdd}~XYnXqTWdS)z
        Adapted from distutils.dist.Distribution.parse_config_files,
        this method provides the same functionality in subtly-improved
        ways.
        r)ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataprefixzexec-prefixhomeuserrootNz"Distribution.parse_config_files():zutf-8)encodingz  reading {filename}__name__global)verbosedry_run)configparserrsysrbase_prefix	frozensetfind_config_filesrannouncerdoptionxformioopenrr	read_filesectionsoptionsget_option_dictrwarn_dash_deprecationmake_option_lowercasercommand_optionsrknegative_optrsetattrrr)r"	filenamesrignore_optionsparserfilenamereaderrropt_dictoptrWsrcaliasrrrr_parse_config_filesmsd





z Distribution._parse_config_filescCsd|dkr|S|dd}tjj|}|dsF|dkrF||krF|Sd|kr`td||f|S)N)zoptions.extras_requirezoptions.data_files-_rrzrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rVrcommand__all___setuptools_commands
startswithrr)r"r!rZunderscore_optcommandsrrrrs
z"Distribution.warn_dash_deprecationcCs4ytd}t|dStjk
r.gSXdS)Nrzdistutils.commands)r{get_distributionr
get_entry_mapDistributionNotFound)r"rrrrr)s

z!Distribution._setuptools_commandscCs4|dks|r|S|}td|||f|S)NrzlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)islowerrrr)r"r!rZ
lowercase_optrrrrsz"Distribution.make_option_lowercasecCsd|}|dkr||}tr,|d|x0|D]"\}\}}tr^|d|||fydd|jD}Wntk
rg}YnXy
|j}Wntk
ri}YnXy|t|t	}	||kr|	rt
|||t|nJ||kr|	rt
||t|n,t||rt
|||nt
d|||fWq8tk
rZ}
zt
|
|
Wdd}
~
XYq8Xq8WdS)a
        Set the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').

        (Adopted from distutils.dist.Distribution._set_command_options)
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|qSr)r)rorrrrsz5Distribution._set_command_options..z1error in %s: command '%s' has no such option '%s')get_command_namerrrrkboolean_optionsrrrrdrrrsrr)r"command_objoption_dictcommand_namersourcer3	bool_optsneg_opt	is_stringrrrr_set_command_optionss:




z!Distribution._set_command_optionsFcCs0|j|dt||j|d||dS)zYParses configuration files from various levels
        and loads configuration.

        )r)ignore_option_errorsN)r$rrrr)r"rr;rrrparse_config_filess
zDistribution.parse_config_filescCs<tjjt||jdd}x|D]}tjj|ddq W|S)zResolve pre-setup requirementsT)	installerreplace_conflicting)rV)r{rresolverfetch_build_eggr)r"rFZresolved_distsrrrrfetch_build_eggs$s
zDistribution.fetch_build_eggscCsTd}dd}t|}t|j|}tdd|}xt||dD]}||q@WdS)z
        Allow plugins to apply arbitrary operations to the
        distribution. Each hook may optionally define a 'order'
        to influence the order of execution. Smaller numbers
        go first and the default is 0.
        z(setuptools.finalize_distribution_optionscSst|ddS)Norderr)r!)hookrrrby_order8sz/Distribution.finalize_options..by_ordercSs|S)N)load)rrrrr=rz/Distribution.finalize_options..)rZN)r{rrr_removedrr)r"grouprDZdefinedfilteredZloadedrrrrfinalize_options/s
zDistribution.finalize_optionscCsdh}|j|kS)z
        When removing an entry point, if metadata is loaded
        from an older version of Setuptools, that removed
        entry point will attempt to be loaded and will fail.
        See #2765 for more details.
        Z
2to3_doctests)r<)rremovedrrrrFAs
zDistribution._removedcCsNxHtdD]:}t||jd}|dk	r|j|jd|||j|qWdS)Nzdistutils.setup_keywords)r=)r{rr!r<requirer@rE)r"rr3rrr_finalize_setup_keywordsOs
z%Distribution._finalize_setup_keywordsc	Csvtjtjd}tj|srt|t|tj|d}t|d$}|	d|	d|	dWdQRX|S)Nz.eggsz
README.txtwzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

zAThis directory caches those eggs to prevent repeated downloads.

z/However, it is safe to delete this directory.

)
rrr+curdirexistsmkdirrZ	hide_filerrY)r"Z
egg_cache_dirZreadme_txt_filenamefrrrget_egg_cache_dirVs

zDistribution.get_egg_cache_dircCsddlm}|||S)z Fetch an egg needed for buildingr)r@)Zsetuptools.installerr@)r"rr@rrrr@iszDistribution.fetch_build_eggcCs`||jkr|j|Std|}x:|D]&}|j|jd||j|<}|SWt||SdS)z(Pluggable version of get_command_class()zdistutils.commands)r=N)cmdclassr{rrKr@rErget_command_class)r"r'ZepsrrSrrrrTos


zDistribution.get_command_classcCs>x2tdD]$}|j|jkr|}||j|j<qWt|S)Nzdistutils.commands)r{rr<rSr?rprint_commands)r"rrSrrrrU|s
zDistribution.print_commandscCs>x2tdD]$}|j|jkr|}||j|j<qWt|S)Nzdistutils.commands)r{rr<rSr?rget_command_list)r"rrSrrrrVs
zDistribution.get_command_listcKsDx>|D]2\}}t|d|d}|r0||q
|||q
WdS)aAdd items to distribution that are named in keyword arguments

        For example, 'dist.include(py_modules=["x"])' would add 'x' to
        the distribution's 'py_modules' attribute, if it was not already
        there.

        Currently, this method only supports inclusion for attributes that are
        lists or tuples.  If you need to add support for adding to other
        attributes in this or a subclass, you can add an '_include_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'include()'.  So, 'dist.include(foo={"bar":"baz"})'
        will try to call 'dist._include_foo({"bar":"baz"})', which can then
        handle whatever special inclusion logic is needed.
        Z	_include_N)rkr!
_include_misc)r"rrrincluderrrrXs

zDistribution.includecsfd|jr&fdd|jD|_|jrDfdd|jD|_|jrbfdd|jD|_dS)z9Remove packages, modules, and extensions in named packagercs"g|]}|kr|s|qSr)r*)rp)packagepfxrrrsz0Distribution.exclude_package..cs"g|]}|kr|s|qSr)r*)rrY)rZr[rrrscs&g|]}|jkr|js|qSr)r<r*)rrY)rZr[rrrsN)packages
py_modulesext_modules)r"rZr)rZr[rexclude_packageszDistribution.exclude_packagecCs4|d}x&|D]}||ks(||rdSqWdS)z.)rsequencer
r!rr)r"r<r3oldrr)r3r
_exclude_miscs
 zDistribution._exclude_miscc
st|tstd||fyt||Wn0tk
rX}ztd||Wdd}~XYnXdkrpt|||n:ttst|dn"fdd|D}t|||dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|kr|qSrr)rra)rcrrrsz.Distribution._include_misc..)rrbr
r!rr)r"r<r3rnewr)rcrrWs
 
zDistribution._include_misccKsDx>|D]2\}}t|d|d}|r0||q
|||q
WdS)aRemove items from distribution that are named in keyword arguments

        For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
        the distribution's 'py_modules' attribute.  Excluding packages uses
        the 'exclude_package()' method, so all of the package's contained
        packages, modules, and extensions are also excluded.

        Currently, this method only supports exclusion from attributes that are
        lists or tuples.  If you need to add support for excluding from other
        attributes in this or a subclass, you can add an '_exclude_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'exclude()'.  So, 'dist.exclude(foo={"bar":"baz"})'
        will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
        handle whatever special exclusion logic is needed.
        Z	_exclude_N)rkr!rd)r"rrrexcluderrrrfs

zDistribution.excludecCs,t|tstd|ftt|j|dS)Nz.packages: setting must be a list or tuple (%r))rrbr
rrr_)r"r\rrr_exclude_packagess
zDistribution._exclude_packagesc
Cs|jj|_|jj|_|d}|d}xB||krh||\}}||=ddl}||d|dd<|d}q(Wt|||}||}	t	|	ddrd|f||d<|dk	rgS|S)NraliasesTrZcommand_consumes_argumentszcommand lineargs)
	__class__global_optionsrrshlexrOr_parse_command_optsrTr!)
r"rrir'rhr"r#rlnargs	cmd_classrrrrms"




z Distribution._parse_command_optscCsi}x|jD]\}}x|D]\}\}}|dkr8q"|dd}|dkr||}|j}|t|dix<|D]\}	}
|
|kr||	}d}Pq|Wtdn|dkrd}||	|i|<q"WqW|S)	ahReturn a '{cmd: {opt:val}}' map of all command-line options

        Option names are all long, but do not include the leading '--', and
        contain dashes rather than underscores.  If the option doesn't take
        an argument (e.g. '--quiet'), the 'val' is 'None'.

        Note that options provided by config files are intentionally excluded.
        zcommand liner&r%rrNzShouldn't be able to get herer)
rrkrVget_command_objrcopyupdater!rr)r"dcmdoptsr!r"rWZcmdobjr8negposrrrget_cmdline_optionss(



z Distribution.get_cmdline_optionsccsx|jp
dD]
}|VqWx|jp$dD]
}|Vq&WxH|jp>dD]:}t|trX|\}}n|j}|drt|dd}|Vq@WdS)z@Yield all packages, modules, and extension names in distributionrmoduleNi)r\r]r^rrr<r)r"pkgryextr<Z	buildinforrrr`Es




z$Distribution.iter_distribution_namesc
Csddl}|jrt||St|jtjs4t||S|jj	dkrPt||S|jj}|jj
}|jdkrndppd}|jj}t|j
d||||_zt||St|j
|||||_XdS)zIf there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rN)zutf-8utf8win32r'zutf-8)r

help_commandsrhandle_display_optionsrstdoutr
TextIOWrapperrrerrorsrDline_bufferingdetach)r"option_orderr
rrnewlinerrrrrWs"z#Distribution.handle_display_options)N)N)N)NF)0r
__module____qualname____doc__rrZ
OrderedSetrrrrrstaticmethodrrrrrrrrrr$rr)rr:r<rArIrFrLrRr@rTrUrVrXr_rrdrWrfrgrmrxr`rrrrrrmsZ2


O
.


	(c@seZdZdZdS)rzrClass for warning about deprecations in dist in
    setuptools. Not ignored by default, unlike DeprecationWarning.N)rrrrrrrrr|sr)Vr(rr
rrrrZ
distutils.logrdistutils.core
distutils.cmddistutils.distdistutils.commanddistutils.utilrdistutils.debugrdistutils.fancy_getoptrglobrrr,typingrrr	collectionsr
emailrdistutils.errorsrr
rZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrrrrZsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr{
email.messager
__import__rr$rdr/r4r5r8r;rTrXrzrrrbrrrrrrrrrrrrrcorerrrrrrrs-
>

PK!2__pycache__/glob.cpython-37.pycnu[B

Re	@sdZddlZddlZddlZdddgZdddZdddZd	d
ZddZd
dZ	ddZ
ddZedZ
edZddZddZddZdS)z
Filename globbing utility. Mostly a copy of `glob` from Python 3.5.

Changes include:
 * `yield from` and PEP3102 `*` removed.
 * Hidden files are not ignored.
NglobiglobescapeFcCstt||dS)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )	recursive)listr)pathnamerr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/glob.pyrscCs*t||}|r&t|r&t|}|r&t|S)aReturn an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    )_iglob_isrecursivenextAssertionError)rritsrrr	rs

ccstj|\}}|r t|r tnt}t|sZ|rDtj|rV|Vntj|rV|VdS|sr|||EdHdS||krt|rt	||}n|g}t|st
}x0|D](}x"|||D]}tj||VqWqWdS)N)ospathsplitrglob2glob1	has_magiclexistsisdirr
glob0join)rrdirnamebasenameglob_in_dirdirsnamerrr	r
0s(
r
cCsR|s"t|trtjd}ntj}yt|}Wntk
rDgSXt||S)NASCII)	
isinstancebytesrcurdirencodelistdirOSErrorfnmatchfilter)rpatternnamesrrr	rTs
rcCs8|stj|r4|gSntjtj||r4|gSgS)N)rrrrr)rrrrr	rasrccs6t|st|ddVxt|D]
}|Vq$WdS)Nr)rr
	_rlistdir)rr(xrrr	rqsrccs|s"t|trtjd}ntj}yt|}Wntjk
rFdSXxJ|D]B}|V|rjtj||n|}x t	|D]}tj||VqxWqNWdS)Nr)
r r!rr"r#r$errorrrr*)rr)r+ryrrr	r*ys

r*z([*?[])s([*?[])cCs(t|trt|}n
t|}|dk	S)N)r r!magic_check_bytessearchmagic_check)rmatchrrr	rs

rcCst|tr|dkS|dkSdS)Ns**z**)r r!)r(rrr	rs
rcCs<tj|\}}t|tr(td|}ntd|}||S)z#Escape all special characters.
    s[\1]z[\1])rr
splitdriver r!r.subr0)rdriverrr	rs

)F)F)__doc__rrer&__all__rrr
rrrr*compiler0r.rrrrrrr	s 


$


PK!gv*__pycache__/windows_support.cpython-37.pycnu[B

Re@s(ddlZddlZddZeddZdS)NcCstdkrddS|S)NWindowsc_sdS)N)argskwargsrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/windows_support.pyzwindows_only..)platformsystem)funcrrrwindows_onlysrcCsLtdtjjj}tjjtjjf|_tjj	|_
d}|||}|sHtdS)z
    Set the hidden attribute on a file or directory.

    From http://stackoverflow.com/questions/19622133/

    `path` must be text.
    zctypes.wintypesN)
__import__ctypeswindllkernel32ZSetFileAttributesWZwintypesZLPWSTRZDWORDargtypesZBOOLrestypeZWinError)pathZSetFileAttributesFILE_ATTRIBUTE_HIDDENretrrr	hide_files	


r)r	rrrrrrrsPK!l$

$__pycache__/installer.cpython-37.pycnu[B

Re
@spddlZddlZddlZddlZddlZddlmZddlmZddl	Z	ddl
mZddZddZ
d	d
ZdS)N)log)DistutilsError)WheelcCs(t|tr|St|ttfs$t|S)z8Ensure find-links option end-up being a list of strings.)
isinstancestrsplittuplelistAssertionError)
find_linksr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/installer.py_fixup_find_links
s
rcCs@ytdWn$tjk
r2|dtjYnXt|}|d}d|krVtddt	j
kohdt	j
k}dt	j
krzd	}nd
|kr|d
d}nd	}d|krt|ddd	d	ng}|jr|
|jt	j|}t}x(t|D]}||kr||r|SqWt }	tjd
ddddd|	g}
|r>|
d|d	k	rV|

d|fx"|p`gD]}|

d|fqbW|
|jpt|yt|
Wn4tjk
r}ztt||Wd	d	}~XYnXttt	j |	dd}
t	j ||
!}|
"|t#|t	j |d}tj$j%||d}|SQRXd	S)zLFetch an egg needed for building.

    Use pip/wheel to fetch/build a wheel.wheelz,WARNING: The wheel package is not available.easy_installZallow_hostszQthe `allow-hosts` option is not supported when using pip to install requirements.Z	PIP_QUIETZPIP_VERBOSEZ
PIP_INDEX_URLN	index_urlrz-mpipz--disable-pip-version-checkz	--no-depsz-wz--quietz--index-urlz--find-linksz*.whlrzEGG-INFO)metadata)&
pkg_resourcesget_distributionDistributionNotFoundannouncerWARNstrip_markerget_option_dictrosenvironrZdependency_linksextendpathrealpathZget_egg_cache_dirEnvironmentfind_distributionscan_addtempfileTemporaryDirectorysys
executableappendurlr
subprocess
check_callCalledProcessErrorrglobjoinegg_nameZinstall_as_eggPathMetadataDistribution
from_filename)distreqoptsquietrrZeggs_direnvironmentZegg_distZtmpdircmdlinker
dist_locationZ
dist_metadatarrr
fetch_build_eggs^

 

 

r<cCstjt|}d|_|S)z
    Return a new requirement without the environment marker to avoid
    calling pip with something like `babel; extra == "i18n"`, which
    would always be ignored.
    N)rRequirementparsermarker)r4rrr
rXsr)r-rr*r&r$	distutilsrdistutils.errorsrrZsetuptools.wheelrrr<rrrrr
sCPK!L~~(__pycache__/package_index.cpython-37.pycnu[B

ReΛ@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+dd	l,m-Z-e.d
Z/e.dej0Z1e.dZ2e.d
ej0j3Z4d5Z6ddddgZ7dZ8dZ9e9j:dj:ej;edZddZ?dAddZ@dBddZAdCdd ZBdedfd!dZCd"d#ZDe.d$ej0ZEeDd%d&ZFGd'd(d(ZGGd)d*d*eGZHGd+ddeZIe.d,jJZKd-d.ZLd/d0ZMdDd1d2ZNd3d4ZOGd5d6d6ZPGd7d8d8ejQZRejSjTfd9d:ZUd;d<ZVeNe8eUZUd=d>ZWd?d@ZXdS)Ez#PyPI and direct package downloadingN)wraps)

CHECKOUT_DISTDistributionBINARY_DISTnormalize_pathSOURCE_DISTEnvironmentfind_distributions	safe_namesafe_versionto_filenameRequirementDEVELOP_DISTEGG_DIST)log)DistutilsError)	translate)Wheel)unique_everseenz^egg=([-A-Za-z0-9_.+!]+)$zhref\s*=\s*['"]?([^'"> ]+)z([^<]+)\n\s+\(md5\)z([-+.a-z0-9]{2,}):z.tar.gz .tar.bz2 .tar .zip .tgzPackageIndexdistros_for_urlparse_bdist_wininstinterpret_distro_namezz.exe)
r%r
from_locationr
is_compatiblerGrHrrrr
EXTENSIONSlen)rFbasenamerCwheelZwin_baser)platformextrrr r?ps.



r?cCstt|tj||S)zEYield possible egg or source distribution objects based on a filename)r?rosr9rM)filenamerCrrr distros_for_filenamesrSc
cs|d}|s,tdd|ddDr,dSxNtdt|dD]8}t||d|d|d||d|||dVq@WdS)zGenerate alternative interpretations of a source distro name

    Note: if `location` is a filesystem filename, you should call
    ``pkg_resources.normalize_path()`` on it before passing it to this
    routine!
    rEcss|]}td|VqdS)z	py\d\.\d$N)rerA).0prrr 	sz(interpret_distro_name..Nr0)
py_versionr>rO)r4anyrangerLrjoin)rFrMrCrYr>rOr6rVrrr rs
$cstfdd}|S)zs
    Wrap a function returning an iterable such that the resulting iterable
    only ever yields unique items.
    cst||S)N)r)argskwargs)funcrr wrapperszunique_values..wrapper)r)r_r`r)r_r 
unique_valuessraz(<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>c	csxvt|D]h}|\}}tttj|d}d|ksFd|krx,t	|D]}t
j|t
|dVqRWqWxHdD]@}||}|dkr~t	||}|r~t
j|t
|dVq~WdS)zEFind rel="homepage" and rel="download" links in `page`, yielding URLs,Zhomepager-r0)z
Home PagezDownload URLr,N)RELfinditergroupssetmapstrstripr$r4HREFr1rurljoin
htmldecoderBfindsearch)r5pagerAtagrelZrelsposrrr find_external_linkss"

rsc@s(eZdZdZddZddZddZdS)	ContentCheckerzP
    A null content checker that defines the interface for checking content
    cCsdS)z3
        Feed a block of data to the hash.
        Nr)selfblockrrr feedszContentChecker.feedcCsdS)zC
        Check the hash. Return False if validation fails.
        Tr)rurrr is_validszContentChecker.is_validcCsdS)zu
        Call reporter with information about the checker (hash name)
        substituted into the template.
        Nr)rureportertemplaterrr reportszContentChecker.reportN)__name__
__module____qualname____doc__rwrxr{rrrr rtsrtc@sBeZdZedZddZeddZddZ	dd	Z
d
dZdS)
HashCheckerzK(?Psha1|sha224|sha384|sha256|sha512|md5)=(?P[a-f0-9]+)cCs||_t||_||_dS)N)	hash_namehashlibnewhashexpected)rurrrrr __init__szHashChecker.__init__cCs>tj|d}|stS|j|}|s0tS|f|S)z5Construct a (possibly null) ContentChecker from a URLr,)r1rr2rtpatternrn	groupdict)clsr5r<rArrr from_urlszHashChecker.from_urlcCs|j|dS)N)rupdate)rurvrrr rwszHashChecker.feedcCs|j|jkS)N)r	hexdigestr)rurrr rxszHashChecker.is_validcCs||j}||S)N)r)ruryrzmsgrrr r{s
zHashChecker.reportN)r|r}r~rTcompilerrclassmethodrrwrxr{rrrr rsrcsDeZdZdZdLddZdMd	d
ZdNddZdOd
dZddZddZ	ddZ
ddZddZdPddZ
ddZdQfdd	Zdd Zd!d"Zd#d$Zd%d&Zd'd(ZdRd)d*ZdSd+d,Zd-d.Zd/Zd0d1Zd2d3ZdTd4d5Zd6d7Zd8d9Zd:d;Zdd?Z e!dUd@dAZ"dBdCZ#dDdEZ$dFdGZ%dHdIZ&dJdKZ'Z(S)Vrz;A distribution index that scans web pages for download URLshttps://pypi.org/simple/*NTcOsltj|f|||dd|d|_i|_i|_i|_td	t
t|j|_
g|_tjj|_dS)Nr+|)rrr%	index_urlscanned_urlsfetched_urls
package_pagesrTrr\rgrrAallowsto_scanr1requesturlopenopener)rurhostsZ	ca_bundleZ
verify_sslr]kwrrr rszPackageIndex.__init__FcCs||jkr|sdSd|j|<t|s2||dStt|}|r\||sPdS|d||sn|rn||jkrtt|j	|dS||sd|j|<dS|
d|d|j|<d}||||}|dkrdSt|t
jjr|jdkr|
d|jd|j|j<d|jd	d
kr(|dS|j}|}t|tsvt|t
jjrXd}n|jdphd}||d
}|x6t|D](}	t
j|t|	 d}
|!|
qW|"|j#rt$|dddkr|%||}dS)z.)filterrQr9rr	itertoolsstarmap
scan_egg_link)rusearch_pathdirsZ	egg_linksrrr scan_egg_links|szPackageIndex.scan_egg_linksc	Csttj||}ttdttj|}WdQRXt	|dkrDdS|\}}x>t
tj||D](}tjj|f||_t|_
||q`WdS)NrX)openrQr9r\rrrgrhrirLr	rFrr>r)rur9rZ	raw_lineslinesZegg_pathZ
setup_pathrDrrr rs zPackageIndex.scan_egg_linkcCsd}||js|Stttjj|t|jdd}t|dksRd|dkrV|St	|d}t
|d}d|j|
i|<t|t|fS)N)NNr+rXr/r0rT)r&rrrgr1rr3rLr4r
rr
setdefaultr$r)rurZNO_MATCH_SENTINELr6pkgverrrr _scans"zPackageIndex._scanc	
CsxJt|D]<}y"|tj|t|dWqtk
rFYqXqW||\}}|sbdSxVt	||D]H}t
|\}}|dr|s|r|d||f7}n
|||
|qnWtdd|S)z#Process the contents of a PyPI pager0rz.pyz
#egg=%s-%scSsd|dddS)Nz%sr0rX)rB)mrrr z,PackageIndex.process_index..)rjrdrr1rrkrlrBrrsr=r%need_version_infoscan_urlPYPI_MD5sub)	rur5rorArrnew_urlr(fragrrr rs""

zPackageIndex.process_indexcCs|d|dS)NzPPage at %s links to .py file(s) without version info; an index scan is required.)scan_all)rur5rrr rszPackageIndex.need_version_infocGs:|j|jkr*|r |j|f||d||jdS)Nz6Scanning index of all packages (this may take a while))rrrrr)rurr]rrr rszPackageIndex.scan_allcCs~||j|jd|j|js:||j|jd|j|jsR||x&t|j|jdD]}||qhWdS)Nr+r)	rrunsafe_namerrkeyrGnot_found_in_indexr)rurequirementr5rrr 
find_packagess
zPackageIndex.find_packagescsR|||x,||jD]}||kr.|S|d||qWtt|||S)Nz%s does not match %s)prescanrrrsuperrobtain)rur	installerrD)	__class__rr rs
zPackageIndex.obtaincCsL||jd||sH|t|td|jjtj	
|fdS)z-
        checker is a ContentChecker
        zValidating %%s checksum for %sz7%s validation failed for %s; possible download problem?N)r{rrxrrQunlinkrrr'r9rM)rucheckerrRtfprrr 
check_hashs

zPackageIndex.check_hashcCsRxL|D]D}|jdks2t|r2|ds2tt|r>||q|j|qWdS)z;Add `urls` to the list that will be prescanned for searchesNzfile:)rrr&rrrappend)ruurlsr5rrr add_find_linkss


zPackageIndex.add_find_linkscCs"|jrtt|j|jd|_dS)z7Scan urls scheduled for prescanning (e.g. --find-links)N)rrrgr)rurrr rszPackageIndex.prescancCs<||jr|jd}}n|jd}}|||j|dS)Nz#Couldn't retrieve index page for %rz3Couldn't find index page for %r (maybe misspelled?))rrrrr)rurmethrrrr rs
zPackageIndex.not_found_in_indexcCs~t|tsjt|}|rR||d||}t|\}}|drN||||}|Stj	
|rb|St|}t|
||ddS)aLocate and/or download `spec` to `tmpdir`, returning a local path

        `spec` may be a ``Requirement`` object, or a string containing a URL,
        an existing local filename, or a project/version requirement spec
        (i.e. the string form of a ``Requirement`` object).  If it is the URL
        of a .py file with an unambiguous ``#egg=name-version`` tag (i.e., one
        that escapes ``-`` as ``_`` throughout), a trivial ``setup.py`` is
        automatically created alongside the downloaded file.

        If `spec` is a ``Requirement`` object or a string containing a
        project/version requirement spec, this method returns the location of
        a matching distribution (possibly after downloading it to `tmpdir`).
        If `spec` is a locally existing file or directory name, it is simply
        returned unchanged.  If `spec` is a URL, it is downloaded to a subpath
        of `tmpdir`, and the local filename is returned.  Various errors may be
        raised if a problem occurs during downloading.
        r0z.pyrFN)rr
r
_download_urlrBr=r%	gen_setuprQr9rr!rfetch_distribution)rurtmpdirr7foundr(r<rrr r-s

zPackageIndex.downloadc	sd|id}d
fdd	}|rH|||}|s^|dk	r^|||}|dkrjdk	rx||}|dkr|s|||}|dkrdrdpd|nd||j|jd	SdS)a|Obtain a distribution suitable for fulfilling `requirement`

        `requirement` must be a ``pkg_resources.Requirement`` instance.
        If necessary, or if the `force_scan` flag is set, the requirement is
        searched for in the (online) package index as well as the locally
        installed packages.  If a distribution matching `requirement` is found,
        the returned distribution's ``location`` is the value you would have
        gotten from calling the ``download()`` method with the matching
        distribution's URL or filename.  If no matching distribution is found,
        ``None`` is returned.

        If the `source` flag is set, only source distributions and source
        checkout links will be considered.  Unless the `develop_ok` flag is
        set, development and system eggs (i.e., those using the ``.egg-info``
        format) will be ignored.
        zSearching for %sNcs|dkr}x||jD]r}|jtkrHsH|krd|d|<q||ko^|jtkp^}|r|j}||_tj	
|jr|SqWdS)Nz&Skipping development or system egg: %sr0)rr>rrrr-rFdownload_locationrQr9r)reqenvrDtestloc)
develop_okruskippedsourcerrr rmUs z-PackageIndex.fetch_distribution..findz:No local packages or working download links found for %s%sza source distribution of rzBest match: %s)rF)N)rrrrrcloner)	rurr
force_scanrrZlocal_indexrDrmr)rrurrrr r=s0




zPackageIndex.fetch_distributioncCs"|||||}|dk	r|jSdS)a3Obtain a file suitable for fulfilling `requirement`

        DEPRECATED; use the ``fetch_distribution()`` method now instead.  For
        backward compatibility, this routine is identical but returns the
        ``location`` of the downloaded distribution instead of a distribution
        object.
        N)rrF)rurrrrrDrrr fetchszPackageIndex.fetchc
	Cst|}|r*ddt||ddDp,g}t|dkrtj|}tj||krtj	||}ddl
m}|||st
|||}ttj	|dd2}	|	d|dj|djtj|dfWdQRX|S|rtd	||fntd
dS)NcSsg|]}|jr|qSr)rH)rUdrrr 
sz*PackageIndex.gen_setup..r0r)samefilezsetup.pywzIfrom setuptools import setup
setup(name=%r, version=%r, py_modules=[%r])
zCan't unambiguously interpret project/version identifier %r; any dashes in the name or version should be escaped using underscores. %rzpCan't process plain .py files without an '#egg=name-version' suffix to enable automatic setup script generation.)r@rArrBrLrQr9rMdirnamer\Zsetuptools.command.easy_installrshutilcopy2rwriterGrHsplitextr)
rurRr<rrArrMdstrrrrr rs2

 zPackageIndex.gen_setupi c	Cs|d|d}zt|}||}t|tjjrJtd||j	|j
f|}d}|j}d}d|kr|d}	t
tt|	}||||||t|dZ}
xD||}|r|||
||d7}||||||qPqW||||
WdQRX|S|r|XdS)	NzDownloading %szCan't download %s: %s %srr,zcontent-lengthzContent-Lengthwbr0)rrrrrr1rrrrrdl_blocksizeget_allmaxrgint
reporthookrrrwrrr)rur5rRfprrblocknumbssizesizesrrvrrr _download_tos:





zPackageIndex._download_tocCsdS)Nr)rur5rRrZblksizerrrr rszPackageIndex.reporthookc
Cs|drt|Syt||jSttjjfk
r}z>ddd|j	D}|r`|
||ntd||f|Wdd}~XYntj
jk
r}z|Sd}~XYntj
jk
r}z,|r|
||jntd||jf|Wdd}~XYntjjk
rD}z.|r |
||jntd||jf|Wdd}~XYnTtjjtj
fk
r}z*|rt|
||ntd||f|Wdd}~XYnXdS)Nzfile: cSsg|]}t|qSr)rh)rUargrrr rsz)PackageIndex.open_url..z%s %szDownload error for %s: %sz;%s returned a bad status line. The server might be down, %s)r&
local_openopen_with_authrrhttpclient
InvalidURLr\r]rrr1rrURLErrorreason
BadStatusLineline
HTTPExceptionsocket)rur5warningvrrrr rs8
$ zPackageIndex.open_urlcCst|\}}|r4x&d|kr0|dddd}qWnd}|drN|dd}tj||}|dksn|d	rz|||S|d
ks|dr|||S|dr|	||S|d
krt
jt
j
|dS||d|||SdS)Nz...\_Z__downloaded__z.egg.zipr#svnzsvn+gitzgit+zhg+rrXT)r=replacer%rQr9r\r&
_download_svn
_download_git_download_hgr1rurl2pathnamerr2r_attempt_download)rur7r5rr'r<rRrrr rs$


zPackageIndex._download_urlcCs||ddS)NT)r)rur5rrr r)szPackageIndex.scan_urlcCs6|||}d|ddkr.||||S|SdS)Nrzcontent-typer)rrr$_download_html)rur5rRrrrr r3,szPackageIndex._attempt_downloadcCslt|}x@|D]8}|rtd|rD|t||||SPqW|t|td|dS)Nz ([^- ]+ - )?Revision \d+:zUnexpected HTML page found at )	r���ri���rT���rn���r���rQ���r���r/��r���)ru���r5���r���rR���r���r$��r���r���r ���r4��3��s����


zPackageIndex._download_htmlc�������������C���s��t�dt�|ddd�}d}|�drd|krtj|\}}}}}}	|s|drd	|d
d��kr|d
d��d	d\}}t	|\}
}|
rd|
kr|
dd\}}
d||
f�}nd
|
�}|}||||||	f}tj
|}|�d||�t
d|||f��|S�)Nz"SVN download support is deprecatedr/���r0���r���r���zsvn:@z//r+���rX���:z --username=%s --password=%sz --username=z'Doing subversion checkout from %s to %szsvn checkout%s -q %s %s)warningsr���UserWarningr4���r$���r&���r1���r���r2���
_splituser
urlunparser���rQ���system)ru���r5���rR���credsr7���netlocr9���rV���qr���authhostuserpwr6���r���r���r ���r/��B��s&����zPackageIndex._download_svnc�������������C���sp���t�j|�\}}}}}|ddd�}|ddd�}d�}d|krR|dd\}}t�j||||df}�|�|fS�)N+r0���r,���r/���r���r5��r���)r1���r���urlsplitr4���rsplit
urlunsplit)r5���
pop_prefixr7���r=��r9���r;���r���revr���r���r ���_vcs_split_rev_from_urlX��s����z$PackageIndex._vcs_split_rev_from_urlc�������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k	rh|�d|�td	||f��|S�)
Nr/���r0���r���T)rG��zDoing git clone from %s to %szgit clone --quiet %s %szChecking out %szgit -C %s checkout --quiet %s)r4���rI��r���rQ���r;��)ru���r5���rR���rH��r���r���r ���r0��j��s����
zPackageIndex._download_gitc�������������C���sl���|�ddd�}|�j|dd\}}|�d||�td||f��|d�k	rh|�d|�td	||f��|S�)
Nr/���r0���r���T)rG��zDoing hg clone from %s to %szhg clone --quiet %s %szUpdating to %szhg --cwd %s up -C -r %s -q)r4���rI��r���rQ���r;��)ru���r5���rR���rH��r���r���r ���r1��z��s����
zPackageIndex._download_hgc�������������G���s���t�j|f|��d�S�)N)r���r���)ru���r���r]���r���r���r ���r�����s����zPackageIndex.debugc�������������G���s���t�j|f|��d�S�)N)r���r���)ru���r���r]���r���r���r ���r�����s����zPackageIndex.infoc�������������G���s���t�j|f|��d�S�)N)r���r���)ru���r���r]���r���r���r ���r�����s����zPackageIndex.warn)r���r���NT)F)F)F)N)N)FFFN)FF)N)F))r|���r}���r~���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r-���r���r��r���r��r��r��r���r���r���r3��r4��r/��staticmethodrI��r0��r1��r���r���r���
__classcell__r���r���)r���r ���r�����sN����

5




		
#�
J

)$
#z!&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?c�������������C���s���|��d}t|S�)Nr���)rB���r���unescape)rA���whatr���r���r ���
decode_entity��s����
rN��c�������������C���s
���t�t|�S�)a��
    Decode HTML entities in the given text.

    >>> htmldecode(
    ...     'https://../package_name-0.1.2.tar.gz'
    ...     '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz')
    'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz'
    )
entity_subrN��)textr���r���r ���rl�����s����	rl���c����������������s����fdd}|S�)Nc����������������s����fdd}|S�)Nc�����������	������s.���t��}t��z
�|�|S�t�|�X�d�S�)N)r&��getdefaulttimeoutsetdefaulttimeout)r]���r^���Zold_timeout)r_���timeoutr���r ���_socket_timeout��s
����

z@socket_timeout.<locals>._socket_timeout.<locals>._socket_timeoutr���)r_���rT��)rS��)r_���r ���rT����s����z'socket_timeout.<locals>._socket_timeoutr���)rS��rT��r���)rS��r ���socket_timeout��s����rU��c�������������C���s2���t�j|�}|�}t|}|�}|ddS�)a9��
    Encode auth from a URL suitable for an HTTP header.
    >>> str(_encode_auth('username%3Apassword'))
    'dXNlcm5hbWU6cGFzc3dvcmQ='

    Long auth strings should not cause a newline to be inserted.
    >>> long_auth = 'username:' + 'password'*10
    >>> chr(10) in str(_encode_auth(long_auth))
    False
    
r���)r1���r���r3���encodebase64	b64encoder���r.��)r?��Zauth_sZ
auth_bytesZ
encoded_bytesencodedr���r���r ���_encode_auth��s
����
r[��c���������������@���s(���e�Zd�ZdZdd�Zdd�Zdd�ZdS�)	
Credentialz:
    A username/password pair. Use like a namedtuple.
    c�������������C���s���||�_�||�_d�S�)N)usernamepassword)ru���r]��r^��r���r���r ���r�����s����zCredential.__init__c�������������c���s���|�j�V��|�jV��d�S�)N)r]��r^��)ru���r���r���r ���__iter__��s����zCredential.__iter__c�������������C���s���dt�|��S�)Nz%(username)s:%(password)s)vars)ru���r���r���r ���__str__��s����zCredential.__str__N)r|���r}���r~���r���r���r_��ra��r���r���r���r ���r\����s���r\��c���������������@���s0���e�Zd�Zdd�Zedd�Zdd�Zdd�Zd	S�)

PyPIConfigc�������������C���sP���t�dddgd}tj|�|�tjtjdd}tj	|rL|�
|�dS�)z%
        Load from ~/.pypirc
        r]��r^��
repositoryr���~z.pypircN)dictfromkeysconfigparserRawConfigParserr���rQ���r9���r\���
expanduserr���r���)ru���defaultsrcr���r���r ���r�����s
����zPyPIConfig.__init__c����������������s&����fdd���D�}tt�j|S�)Nc����������������s ���g�|�]}��|d��r|qS�)rc��)r���ri���)rU���section)ru���r���r ���r����s����z2PyPIConfig.creds_by_repository.<locals>.<listcomp>)sectionsre��rg���_get_repo_cred)ru���Zsections_with_repositoriesr���)ru���r ���creds_by_repository��s����zPyPIConfig.creds_by_repositoryc�������������C���s6���|��|d�}|t|��|d�|��|d�fS�)Nrc��r]��r^��)r���ri���r\��)ru���rl��repor���r���r ���rn����s����zPyPIConfig._get_repo_credc�������������C���s*���x$|�j��D�]\}}||r|S�qW�dS�)z
        If the URL indicated appears to be a repository defined in this
        config, return the credential for that repository.
        N)ro��itemsr&���)ru���r5���rc��credr���r���r ���find_credential��s����
zPyPIConfig.find_credentialN)r|���r}���r~���r���propertyro��rn��rs��r���r���r���r ���rb����s���	rb��c�������������C���s<��t�j|�}|\}}}}}}|dr2tjd|dkrHt|\}	}
nd}	|	st�	|�}|rt
|}	|j|�f}tj
d	|��|	rdt|	�}	||
||||f}
t�j|
}t�j|}|d|	�nt�j|�}|dt�||}|	r8t�j|j\}}}}}}||kr8||
kr8||||||f}
t�j|
|_|S�)
z4Open a urllib2 request, handling HTTP authenticationr6��znonnumeric port: '')r��httpsN*Authenticating as %s for %s (from .pypirc)zBasic 
Authorizationz
User-Agent)rv��)r1���r���r2���r%���r��r��r ��r9��rb��rs��rh���r]��r���r���r[��r:��r���Request
add_header
user_agentr5���)r5���r���parsedr7���r=��r9���paramsr;���r���r?��addressrr��r���r6���r���r���r��s2h2path2Zparam2Zquery2Zfrag2r���r���r ���r����s8����

r��c�������������C���s ���|��d\}}}�|r|nd|�fS�)zNsplituser('user[:passwd]@host[:port]')
    --> 'user[:passwd]', 'host[:port]'.r5��N)
rpartition)r@��rA��delimr���r���r ���r9��4��s����r9��c�������������C���s���|�S�)Nr���)r5���r���r���r ���
fix_sf_url?��s����r��c����������
���C���s��t�j|�\}}}}}}t�j|}tj|r<t�j|�S�|	drtj
|rg�}xt|D�]b}	tj||	}
|	dkrt
|
d}|�}W�dQ�R�X�P�ntj
|
r|	d7�}	|dj|	d�qbW�d}
|
j|�d|d	}d
\}}n
d\}}}dd
i}t|}t�j|�||||S�)z7Read a local path, with special support for directoriesr+���z
index.htmlrNz<a href="{name}">{name}</a>)r'���zB<html><head><title>{url}{files}rV)r5files)OK)izPath not foundz	Not foundzcontent-typez	text/html)r1rr2rr2rQr9isfilerr%rrr\rrrformatioStringIOrr)r5r7r8r9paramr;rrRrrfilepathrbodyrstatusmessagerZbody_streamrrr rCs,


r)N)N)N)r)YrsysrQrTrr	r&rXrrr7rgrhttp.clientrurllib.parser1urllib.requesturllib.error	functoolsrr
pkg_resourcesrrrrrrr	r
rrr
rr	distutilsrdistutils.errorsrfnmatchrZsetuptools.wheelrZ setuptools.extern.more_itertoolsrrr@IrjrrArr4rK__all__Z_SOCKET_TIMEOUTZ_tmplrversion_inforzr!rr=rr?rSrrarcrsrtrrrrOrNrlrUr[r\rhrbrrrr9rrrrrr s<
	

!
!
!
&/PK!>JJ"__pycache__/depends.cpython-37.pycnu[B

Reb@sddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZdddd	gZGd
ddZ
ddZdddZddd	ZddZedS)N)
StrictVersion)find_modulePY_COMPILED	PY_FROZEN	PY_SOURCE)_impRequirerget_module_constantextract_constantc@sHeZdZdZdddZddZdd	ZdddZdd
dZdddZ	dS)r	z7A prerequisite to building or installing a distributionNcCsF|dkr|dk	rt}|dk	r0||}|dkr0d}|jt|`dS)N__version__)r__dict__updatelocalsself)rnamerequested_versionmoduleZhomepage	attributeformatr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/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_okrcCs||jdkrBy"t|j|\}}}|r*||Stk
r@dSXt|j|j||}|dk	rx||k	rx|jdk	rx||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)rrrcloseImportErrorr
r)rpathsdefaultfpivrrrget_version-s

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



cCs"tjdd}|s|St|S)Ncss
dVdS)NrrrrremptyUszmaybe_close..empty)
contextlibcontextmanagerclosing)r#r.rrrmaybe_closeTsr2c	Csyt||\}}\}}}}	Wntk
r2dSXt|n|tkr\|dt|}
nJ|tkrrt	||}
n4|t
krt||d}
nt|||	}t
||dSWdQRXt|
||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)rr r2rreadmarshalloadrrget_frozen_objectrcompileZ
get_modulegetattrr)rsymbolr"r!r#pathsuffixmodekindinfocodeZimportedrrrr
_s

cCs||jkrdSt|j|}d}d}d}|}xRt|D]D}|j}	|j}
|	|kr^|j|
}q:|
|krz|	|ksv|	|krz|S|}q:WdS)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_nameslistindexdisBytecodeopcodearg	co_consts)rBr<r"Zname_idx
STORE_NAMESTORE_GLOBAL
LOAD_CONSTconstZ	byte_codeoprLrrrr|s
cCsBtjdstjdkrdSd}x|D]}t|=t|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.
    javacliN)rr
)sysplatform
startswithglobals__all__remove)Zincompatiblerrrr_update_globalss
r[)r3N)r3)rUr7r/rIZdistutils.versionrrrrrrrrYr	r2r
rr[rrrrsD

$PK!^#__pycache__/dep_util.cpython-37.pycnu[B

Re@sddlmZddZdS))newer_groupcCslt|t|krtdg}g}xBtt|D]2}t||||r.||||||q.W||fS)zWalk both arguments in parallel, testing if each source group is newer
    than its corresponding target. Returns a pair of lists (sources_groups,
    targets) where sources is newer than target, according to the semantics
    of 'newer_group()'.
    z5'sources_group' and 'targets' must be the same length)len
ValueErrorrangerappend)Zsources_groupstargets	n_sources	n_targetsir/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/dep_util.pynewer_pairwise_groupsr
N)distutils.dep_utilrr
rrrrsPK!j		!__pycache__/monkey.cpython-37.pycnu[B

Rea@sdZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
gZddZddZ
dd	Zd
dZdd
ZddZddZddZdS)z
Monkey patching of distutils.
N)
import_modulecCs"tdkr|f|jSt|S)am
    Returns the bases classes for cls sorted by the MRO.

    Works around an issue on Jython where inspect.getmro will not return all
    base classes if multiple classes share the same name. Instead, this
    function will return a tuple containing the class itself, and the contents
    of cls.__bases__. See https://github.com/pypa/setuptools/issues/1024.
    Jython)platformpython_implementation	__bases__inspectgetmro)clsr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/monkey.py_get_mros	rcCs.t|trtnt|tjrtndd}||S)NcSsdS)Nr
)itemr
r
r(zget_unpatched..)
isinstancetypeget_unpatched_classtypesFunctionTypeget_unpatched_function)r
lookupr
r
r
get_unpatched$srcCs:ddt|D}t|}|jds6d|}t||S)zProtect against re-patching the distutils if reloaded

    Also ensures that no other distutils extension monkeypatched the distutils
    first.
    css|]}|jds|VqdS)
setuptoolsN)
__module__
startswith).0r	r
r
r	4sz&get_unpatched_class..	distutilsz(distutils has already been patched by %r)rnextrrAssertionError)r	Zexternal_basesbasemsgr
r
rr-srcCstjtj_tjdk}|r"tjtj_tjdkp^dtjko@dknp^dtjkoZdkn}|rrd}|tjj	_
tx"tjtjtj
fD]}tjj|_qWtjjtj_tjjtj_dtjkrtjjtjd_tdS)N)r")
)r")r"r')r"r#zhttps://upload.pypi.org/legacy/zdistutils.command.build_ext)rCommandrcoresysversion_infofindallfilelistconfig
PyPIRCCommandDEFAULT_REPOSITORY_patch_distribution_metadatadistcmdDistribution	extension	Extensionmodules#patch_for_msvc_specialized_compiler)Zhas_issue_12885Zneeds_warehouseZ	warehousemoduler
r
r	patch_all?s$





r;cCs.x(dD] }ttj|}ttjj||qWdS)zDPatch write_pkg_file and read_pkg_file for higher metadata standards)write_pkg_file
read_pkg_fileZget_metadata_versionN)getattrrr3setattrrDistributionMetadata)attrnew_valr
r
rr2fs
r2cCs*t||}t|d|t|||dS)z
    Patch func_name in target_mod with replacement

    Important - original must be resolved by name to avoid
    patching an already patched function.
    	unpatchedN)r>vars
setdefaultr?)replacementZ
target_mod	func_nameoriginalr
r
r
patch_funcms
rIcCs
t|dS)NrC)r>)	candidater
r
rr~srcstdtdkrdSfdd}t|d}t|d}yt|dt|d	Wntk
rlYnXyt|d
Wntk
rYnXyt|dWntk
rYnXdS)z\
    Patch functions in distutils to use standalone Microsoft Visual C++
    compilers.
    zsetuptools.msvcWindowsNcsLd|krdnd}||d}t|}t|}t||sBt||||fS)zT
        Prepare the parameters for patch_func to patch indicated function.
        msvc9Zmsvc9_Zmsvc14__)lstripr>rhasattrImportError)mod_namerGZrepl_prefixZ	repl_namereplmod)msvcr
rpatch_paramss

z9patch_for_msvc_specialized_compiler..patch_paramszdistutils.msvc9compilerzdistutils._msvccompilerZfind_vcvarsallZquery_vcvarsallZ_get_vc_envZgen_lib_options)rrsystem	functoolspartialrIrP)rUrLZmsvc14r
)rTrr9s&
r9)__doc__r+distutils.filelistrrrrW	importlibrrr__all__rrrr;r2rIrr9r
r
r
rs"	'PK! __pycache__/wheel.cpython-37.pycnu[B

Re` @sdZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlm
Z
ddlmZddlmZddlmZe	d	e	jjZd
ZddZGd
ddZdS)zWheels support.)get_platform)logN)
parse_version)sys_tags)canonicalize_name)write_requirementsz^(?P.+?)-(?P\d.*?)
    ((-(?P\d.*?))?-(?P.+?)-(?P.+?)-(?P.+?)
    )\.whl$z8__import__('pkg_resources').declare_namespace(__name__)
cCsxt|D]\}}}tj||}x6|D].}tj||}tj|||}t||q*WxXttt|D]D\}	}
tj||
}tj|||
}tj	|snt||||	=qnWqWx.tj|ddD]\}}}|rt
t|qWdS)zDMove everything under `src_dir` to `dst_dir`, and delete the former.T)topdownN)oswalkpathrelpathjoinrenamesreversedlist	enumerateexistsAssertionErrorrmdir)src_dirZdst_dirdirpathdirnames	filenamessubdirfsrcdstndr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/wheel.pyunpacks
r!c@sheZdZddZddZddZddZd	d
ZddZd
dZ	e
ddZe
ddZe
ddZ
dS)WheelcCsTttj|}|dkr$td|||_x$|D]\}}t|||q8WdS)Nzinvalid wheel name: %r)	
WHEEL_NAMEr	rbasename
ValueErrorfilename	groupdictitemssetattr)selfr&matchkvrrr __init__6szWheel.__init__cCs&t|jd|jd|jdS)z>List tags (py_version, abi, platform) supported by this wheel..)	itertoolsproduct
py_versionsplitabiplatform)r*rrr tags>s

z
Wheel.tagscs0tddtDtfdd|DdS)z5Is the wheel is compatible with the current platform?css|]}|j|j|jfVqdS)N)interpreterr4r5).0trrr 	Isz&Wheel.is_compatible..c3s|]}|krdVqdS)TNr)r8r9)supported_tagsrr r:JsF)setrnextr6)r*r)r;r 
is_compatibleFszWheel.is_compatiblecCs,tj|j|j|jdkrdntddS)Nany)project_nameversionr5z.egg)
pkg_resourcesDistributionr@rAr5regg_name)r*rrr rDLszWheel.egg_namecCsJx<|D]0}t|}|dr
t|t|jr
|Sq
WtddS)Nz
.dist-infoz.unsupported wheel format. .dist-info not found)namelist	posixpathdirnameendswithr
startswithr@r%)r*zfmemberrGrrr 
get_dist_infoRs

zWheel.get_dist_infoc	Cs(t|j}|||WdQRXdS)z"Install wheel as an egg directory.N)zipfileZipFiler&_install_as_egg)r*destination_eggdirrJrrr install_as_egg\szWheel.install_as_eggcCs\d|j|jf}||}d|}tj|d}|||||||||||dS)Nz%s-%sz%s.datazEGG-INFO)	r@rArLr	rr
_convert_metadata_move_data_entries_fix_namespace_packages)r*rPrJZ
dist_basename	dist_info	dist_dataegg_inforrr rOas
zWheel._install_as_eggc	sLfdd}|d}t|d}td|ko>tdkn}|sTtd|t||tj|tj	j
|t|dd	d
tt
tfddjD}t|ttj|d
tj|dtj	t|dd}	tjj}
ttjz t|	ddtj|dWdt|
XdS)Nc	s<t| }|d}tj|SQRXdS)Nzutf-8)	openrFr
readdecodeemailparserParserparsestr)namefpvalue)rUrJrr get_metadatamsz-Wheel._convert_metadata..get_metadataZWHEELz
Wheel-Versionz1.0z2.0dev0z$unsupported wheel format version: %s)metadatacSsd|_t|S)N)markerstr)reqrrr raw_reqsz(Wheel._convert_metadata..raw_reqc	s2i|]*}tfddt|fD|qS)c3s|]}|kr|VqdS)Nr)r8rf)install_requiresrr r:sz5Wheel._convert_metadata...)sortedmaprequires)r8extra)distrhrgrr 
sz+Wheel._convert_metadata..METADATAzPKG-INFO)rhextras_require)attrsrWzrequires.txt)rgetr%r	mkdir
extractallrr
rBrC
from_locationPathMetadatarrirjrkextrasrename
setuptoolsdictr_global_log	threshold
set_thresholdWARNrget_command_obj)rJrPrUrWrbwheel_metadata
wheel_versionZwheel_v1rpZ
setup_distZ
log_thresholdr)rmrUrhrgrJr rRksB 



zWheel._convert_metadatacstj|tjd}tj|rtj|dd}t|xRt|D]D}|drrttj||qNttj||tj||qNWt	|x.t
tjjfdddDD]}t||qWtjrt	dS)z,Move data entries to their correct location.scriptszEGG-INFOz.pycc3s|]}tj|VqdS)N)r	rr
)r8r)rVrr r:sz+Wheel._move_data_entries..)dataheaderspurelibplatlibN)r	rr
rrslistdirrHunlinkrxrfilterr!)rPrVZdist_data_scriptsZegg_info_scriptsentryrr)rVr rSs&





zWheel._move_data_entriesc
Cstj|d}tj|rt|}|}WdQRXxt|D]l}tjj|f|d}tj|d}tj|st|tj|s@t|d}|t	WdQRXq@WdS)Nznamespace_packages.txtr/z__init__.pyw)
r	rr
rrXrYr3rswriteNAMESPACE_PACKAGE_INIT)rWrPZnamespace_packagesr`modZmod_dirZmod_initrrr rTs


zWheel._fix_namespace_packagesN)__name__
__module____qualname__r.r6r>rDrLrQrOstaticmethodrRrSrTrrrr r"4s

@r")__doc__distutils.utilr	distutilsrr[r0r	rFrerMrBryrZ setuptools.extern.packaging.tagsrZ!setuptools.extern.packaging.utilsrZsetuptools.command.egg_inforcompileVERBOSEr+r#rr!r"rrrr s(
PK!Q=]__*extern/__pycache__/__init__.cpython-37.pycnu[B

Reg	@s6ddlZddlZGdddZdZeeeddS)Nc@sXeZdZdZdddZeddZdd	Zd
dZdd
Z	ddZ
dddZddZdS)VendorImporterz
    A PEP 302 meta path importer for finding optionally-vendored
    or otherwise naturally-installed packages from root_name.
    NcCs&||_t||_|p|dd|_dS)NZextern_vendor)	root_namesetvendored_namesreplace
vendor_pkg)selfrrr	rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/extern/__init__.py__init__s
zVendorImporter.__init__ccs|jdVdVdS)zL
        Search first the vendor package then as a natural package.
        .N)r	)r
rrrsearch_pathszVendorImporter.search_pathcCs.||jd\}}}|o,tt|j|jS)z,Figure out if the target module is vendored.r
)	partitionranymap
startswithr)r
fullnamerootbasetargetrrr_module_matches_namespacesz(VendorImporter._module_matches_namespacec	Csz||jd\}}}x^|jD]B}y(||}t|tj|}|tj|<|Stk
r^YqXqWtdjftdS)zK
        Iterate over the search path to locate and load fullname.
        r
zThe '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N)	rrr
__import__sysmodulesImportErrorformatlocals)r
rrrrprefixZextantmodrrrload_modules


zVendorImporter.load_modulecCs||jS)N)r!name)r
specrrr
create_module3szVendorImporter.create_modulecCsdS)Nr)r
modulerrrexec_module6szVendorImporter.exec_modulecCs||rtj||SdS)z(Return a module spec for vendored names.N)r	importlibutilspec_from_loader)r
rpathrrrr	find_spec9szVendorImporter.find_speccCs|tjkrtj|dS)zR
        Install this importer into sys.meta_path if not already present.
        N)r	meta_pathappend)r
rrrinstall@s
zVendorImporter.install)rN)NN)
__name__
__module____qualname____doc__rpropertyrrr!r$r&r+r.rrrrrs

r)	packaging	pyparsingZordered_setZmore_itertoolszsetuptools._vendor)importlib.utilr'rrnamesr/r.rrrrsCPK!|*&*&,command/__pycache__/build_ext.cpython-37.pycnu[B

Re3
@stddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZyddlmZed
Wnek
reZYnXedddlmZd
dZdZdZdZejdkrdZn>ej dkr$yddl!Z!e"e!dZZWnek
r"YnXddZ#ddZ$GdddeZesVej dkrbdddZ%ndZd ddZ%dS)!N)EXTENSION_SUFFIXES)	build_ext)	copy_file)new_compiler)customize_compilerget_config_var)DistutilsError)log)LibraryzCython.Compiler.MainLDSHARED)_config_varsc	CsZtjdkrNt}z$dtd<dtd<dtd<t|Wdtt|Xnt|dS)Ndarwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclibCCSHAREDz.dylibSO)sysplatform_CONFIG_VARScopyrclearupdate)compilertmpr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/build_ext.py_customize_compiler_for_shlibs
rFZsharedr
TntRTLD_NOWcCstr|SdS)N)	have_rtld)srrrif_dl>sr cCs*x$tD]}d|kr|S|dkr|SqWdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydN)r)suffixrrrget_abi3_suffixBs

r"c@sveZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZdddZdS)rcCs.|jd}|_t|||_|r*|dS)z;Build extensions in build directory, then copy if --inplacerN)Zinplace
_build_extruncopy_extensions_to_source)selfZold_inplacerrrr$Ls

z
build_ext.runc
Cs|d}x|jD]}||j}||}|d}d|dd}||}tj	|tj	
|}tj	|j|}	t|	||j
|jd|jr||ptj|dqWdS)Nbuild_py.)verbosedry_runT)get_finalized_command
extensionsget_ext_fullnamenameget_ext_filenamesplitjoinZget_package_dirospathbasename	build_librr*r+_needs_stub
write_stubcurdir)
r&r'extfullnamefilenameZmodpathpackagepackage_dirZ
dest_filenameZsrc_filenamerrrr%Ts




z#build_ext.copy_extensions_to_sourcecCstd}|r&tjj|d|}nt||}td}||jkr|j|}t	|do\t
}|r|dt|}t
}||}t|t
rtj|\}}|j|tStr|jrtj|\}}tj|d|S|S)NZSETUPTOOLS_EXT_SUFFIXr(
EXT_SUFFIXZpy_limited_apizdl-)r3getenvr4r2r1r#r0rext_mapgetattrr"len
isinstancer
splitextshlib_compilerlibrary_filenamelibtype	use_stubs_links_to_dynamic)r&r;Zso_extr<r:Zuse_abi3fndrrrr0js&




zbuild_ext.get_ext_filenamecCs t|d|_g|_i|_dS)N)r#initialize_optionsrFshlibsrA)r&rrrrMs
zbuild_ext.initialize_optionscCs4t||jpg|_||jdd|jD|_|jrB|x|jD]}||j|_qJWx|jD]}|j}||j	|<||j	|
dd<|jr||pd}|otot
|t}||_||_||}|_tjtj|j|}|r
||jkr
|j||rhtrhtj|jkrh|jtjqhWdS)NcSsg|]}t|tr|qSr)rDr
).0r:rrr
sz.build_ext.finalize_options..r(r)F)r#finalize_optionsr-Zcheck_extensions_listrNsetup_shlib_compilerr.r/
_full_namerAr1links_to_dynamicrIrDr
rJr7r0
_file_namer3r4dirnamer2r6library_dirsappendr9runtime_library_dirs)r&r:r;Zltdnsr<ZlibdirrrrrQs,

zbuild_ext.finalize_optionscCst|j|j|jd}|_t||jdk	r8||j|jdk	rbx|jD]\}}|	||qJW|j
dk	rx|j
D]}||qtW|jdk	r|
|j|jdk	r||j|jdk	r||j|jdk	r||jt||_dS)N)rr+force)rrr+r[rFrinclude_dirsZset_include_dirsZdefineZdefine_macroZundefZundefine_macro	librariesZ
set_librariesrWZset_library_dirsZrpathZset_runtime_library_dirsZlink_objectsZset_link_objectslink_shared_object__get__)r&rr/valueZmacrorrrrRs(






zbuild_ext.setup_shlib_compilercCst|tr|jSt||S)N)rDr
export_symbolsr#get_export_symbols)r&r:rrrrbs
zbuild_ext.get_export_symbolscCs\||j}z@t|tr"|j|_t|||jrL|dj	}|
||Wd||_XdS)Nr')Z_convert_pyx_sources_to_langrrDr
rFr#build_extensionr7r,r6r8)r&r:Z	_compilercmdrrrrcs
zbuild_ext.build_extensioncsPtdd|jDd|jddddgtfdd|jDS)	z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|]
}|jqSr)rS)rOlibrrrrPsz.build_ext.links_to_dynamic..r(Nr)rc3s|]}|kVqdS)Nr)rOlibname)libnamespkgrr	sz-build_ext.links_to_dynamic..)dictfromkeysrNr2rSr1anyr])r&r:r)rgrhrrTs zbuild_ext.links_to_dynamiccCst||S)N)r#get_outputs_build_ext__get_stubs_outputs)r&rrrrmszbuild_ext.get_outputscs6fddjD}t|}tdd|DS)Nc3s0|](}|jrtjjjf|jdVqdS)r(N)r7r3r4r2r6rSr1)rOr:)r&rrrisz0build_ext.__get_stubs_outputs..css|]\}}||VqdS)Nr)rObaseZfnextrrrris)r-	itertoolsproduct!_build_ext__get_output_extensionslist)r&Zns_ext_basespairsr)r&rZ__get_stubs_outputss

zbuild_ext.__get_stubs_outputsccs"dVdV|djrdVdS)Nz.pyz.pycr'z.pyo)r,optimize)r&rrrZ__get_output_extensionssz!build_ext.__get_output_extensionsFcCs2td|j|tjj|f|jdd}|rJtj|rJt|d|j	st
|d}|dddd	td
dtj
|jdd
dtddddtddddddtddddg||r.ddlm}||gdd|j	d |d!j}|dkr||g|d|j	d tj|r.|j	s.t|dS)"Nz writing stub loader for %s to %sr(z.pyz already exists! Please delete.w
zdef __bootstrap__():z-   global __bootstrap__, __file__, __loader__z0   import sys, os, pkg_resources, importlib.utilz, dlz:   __file__ = pkg_resources.resource_filename(__name__,%r)z   del __bootstrap__z    if '__loader__' in globals():z       del __loader__z#   old_flags = sys.getdlopenflags()z   old_dir = os.getcwd()z   try:z(     os.chdir(os.path.dirname(__file__))z$     sys.setdlopenflags(dl.RTLD_NOW)z3     spec = importlib.util.spec_from_file_location(z#                __name__, __file__)z0     mod = importlib.util.module_from_spec(spec)z!     spec.loader.exec_module(mod)z   finally:z"     sys.setdlopenflags(old_flags)z     os.chdir(old_dir)z__bootstrap__()rr)byte_compileT)rur[r+install_lib)r	inforSr3r4r2r1existsrr+openwriter r5rUclosedistutils.utilrxr,ruunlink)r&
output_dirr:compileZ	stub_filefrxrurrrr8sX



zbuild_ext.write_stubN)F)__name__
__module____qualname__r$r%r0rMrQrRrbrcrTrmrnrrr8rrrrrKs
	rc

Cs(||j|||||||||	|
||
dS)N)linkZSHARED_LIBRARY)
r&objectsoutput_libnamerr]rWrYradebug
extra_preargsextra_postargs
build_temptarget_langrrrr^$s
r^Zstaticc
Cs^|dksttj|\}}
tj|
\}}|ddrH|dd}||||||dS)Nxre)AssertionErrorr3r4r1rErG
startswithZcreate_static_lib)r&rrrr]rWrYrarrrrrr<r5r:rrrr^3s)
NNNNNrNNNN)
NNNNNrNNNN)&r3rrpZimportlib.machineryrZdistutils.command.build_extrZ
_du_build_extdistutils.file_utilrdistutils.ccompilerrdistutils.sysconfigrrdistutils.errorsr	distutilsr	Zsetuptools.extensionr
ZCython.Distutils.build_extr#
__import__ImportErrorrrrrrIrHrr/dlhasattrr r"r^rrrrsV

	W	PK!
Woo+command/__pycache__/register.cpython-37.pycnu[B

Re@s@ddlmZddlmmZddlmZGdddejZdS))logN)RemovedCommandErrorc@seZdZdZddZdS)registerz+Formerly used to register packages on PyPI.cCs"d}|d|tjt|dS)Nz]The register command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr	/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/register.pyrun
szregister.runN)__name__
__module____qualname____doc__rr	r	r	r
rsr)	distutilsrZdistutils.command.registercommandrorigZsetuptools.errorsrr	r	r	r
sPK!	ϖ		3command/__pycache__/install_egg_info.cpython-37.pycnu[B

Re@s\ddlmZmZddlZddlmZddlmZddlmZddl	Z	Gdddej
eZdS))logdir_utilN)Command)
namespaces)unpack_archivec@sBeZdZdZdZdgZddZddZddZd	d
Z	ddZ
d
S)install_egg_infoz.Install an .egg-info directory for the package)zinstall-dir=dzdirectory to install tocCs
d|_dS)N)install_dir)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsV|dd|d}tdd|j|jd}|j|_tj	
|j||_g|_
dS)Ninstall_lib)r	r	egg_infoz	.egg-info)set_undefined_optionsget_finalized_command
pkg_resourcesDistributionegg_nameZegg_versionrsourceospathjoinr	targetoutputs)r
Zei_cmdbasenamerrrfinalize_optionss
z!install_egg_info.finalize_optionscCs|dtj|jr:tj|js:tj|j|jdn(tj	|jrb|
tj|jfd|j|jstt
|j|
|jdd|j|jf|dS)Nr)dry_runz	Removing rzCopying %s to %s)run_commandrrisdirrislinkrremove_treerexistsexecuteunlinkrensure_directorycopytreerZinstall_namespaces)r
rrrrun!s
zinstall_egg_info.runcCs|jS)N)r)r
rrrget_outputs.szinstall_egg_info.get_outputscs fdd}tjj|dS)NcsFx&dD]}||s d||krdSqWj|td|||S)N)z.svn/zCVS//zCopying %s to %s)
startswithrappendrdebug)srcdstskip)r
rrskimmer3s
z*install_egg_info.copytree..skimmer)rrr)r
r0r)r
rr&1szinstall_egg_info.copytreeN)__name__
__module____qualname____doc__descriptionuser_optionsr
rr'r(r&rrrrr
s
r)	distutilsrrr
setuptoolsrrZsetuptools.archive_utilrrZ	InstallerrrrrrsPK!JJ/command/__pycache__/easy_install.cpython-37.pycnu[B

ReN@sdZddlmZddlmZddlmZmZddlmZmZm	Z	m
Z
ddlmZm
Z
ddlmZmZddlmZdd	lmZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
lZdd
l Z dd
l!Z!dd
l"Z"dd
l#Z#dd
l$Z$dd
l%Z%dd
l&Z&ddl'm(Z(m)Z)ddl*m+Z+dd
l*m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6ddl/m7Z7m8Z8ddl9m:Z:ddl;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJdd
l;Z;ejKde;jLddddddgZMddZNddZOdd ZPd!d"ZQd#d$ZRGd%dde,ZSd&d'ZTd(d)ZUd*d+ZVd,dZWd-dZXGd.ddeBZYGd/d0d0eYZZej[\d1d2d3kreZZYd4d5Z]d6d7Z^d8d9Z_d:d;Z`dhdd?Zbd@dAZcdBejdkrecZendCdDZedidFdGZfdHdIZgdJdKZhdLdMZiyddNlmjZkWnelk
r.dOdPZkYnXdQdRZjGdSdTdTemZnenoZpGdUdVdVenZqGdWdXdXZrGdYdZdZerZsGd[d\d\esZterjuZuerjvZvd]d^Zwd_d`Zxdae^fdbdcZydddeZzGdfdgdge+Z{d
S)ja0
Easy Install
------------

A tool for doing automatic download/extract/build of distutils-based Python
packages.  For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.

__ https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html

)glob)get_platform)convert_path
subst_vars)DistutilsArgErrorDistutilsOptionErrorDistutilsErrorDistutilsPlatformError)INSTALL_SCHEMESSCHEME_KEYS)logdir_util)
first_line_re)find_executableN)get_config_varsget_path)SetuptoolsDeprecationWarning)Command)	run_setup)setopt)unpack_archive)PackageIndexparse_requirement_arg
URL_SCHEME)	bdist_eggegg_info)Wheel)yield_linesnormalize_pathresource_stringensure_directoryget_distributionfind_distributionsEnvironmentRequirementDistributionPathMetadataEggMetadata
WorkingSetDistributionNotFoundVersionConflictDEVELOP_DISTdefault)categorysamefileeasy_installPthDistributionsextract_wininst_cfgget_exe_prefixescCstddkS)NP)structcalcsizer7r7/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/easy_install.pyis_64bitJsr9cCsjtj|otj|}ttjdo&|}|r:tj||Stjtj|}tjtj|}||kS)z
    Determine if two paths reference the same file.

    Augments os.path.samefile to work on Windows and
    suppresses errors if the path doesn't exist.
    r.)ospathexistshasattrr.normpathnormcase)p1p2Z
both_existZuse_samefileZnorm_p1Znorm_p2r7r7r8r.NscCs
|dS)Nutf8)encode)sr7r7r8	_to_bytes^srEcCs(y|ddStk
r"dSXdS)NasciiTF)rCUnicodeError)rDr7r7r8isasciibs

rHcCst|ddS)N
z; )textwrapdedentstripreplace)textr7r7r8
_one_linerjsrOc@seZdZdZdZdZdddddd	d
ddd
ddddddddddddddejfgZddddd d!d"d#d$dg
Z	d%diZ
eZd&d'Z
d(d)Zd*d+Zed,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zdd8d9Zd:d;Zdd?Zed@ZedAZedBZ dCdDZ!dEdFZ"dGdHZ#dIdJZ$dKdLZ%dMdNZ&e'j(dOdPZ)ddRdSZ*ddTdUZ+dVdWZ,ddXdYZ-dZd[Z.d\d]Z/d^d_Z0dd`daZ1edbdcZ2ddfdgZ3dhdiZ4djdkZ5dldmZ6dndoZ7dpdqZ8drdsZ9edtZ:eduZ;ddwdxZd|d}Z?d~dZ@ddZAddZBddZCddZDddZEedFZGddZHeIeIddddZJeIdddZKddZLdS)r/z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zzip-okzzinstall package as a zipfile)z
multi-versionmz%make apps have to require() a version)upgradeUz1force upgrade (searches PyPI for latest versions))zinstall-dir=dzinstall package to DIR)zscript-dir=rDzinstall scripts to DIR)zexclude-scriptsxzDon't install scripts)zalways-copyaz'Copy all needed packages to install dir)z
index-url=iz base URL of Python Package Index)zfind-links=fz(additional URL(s) to search for packages)zbuild-directory=bz/download/extract/build in DIR; keep the results)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)zalways-unzipZz*don't install as a zipfile, no matter what)z
site-dirs=Sz)list of directories where .pth files work)editableez+Install specified packages in editable form)zno-depsNzdon't install dependencies)zallow-hosts=Hz$pattern(s) that hostnames must match)zlocal-snapshots-oklz(allow building eggs from local checkouts)versionNz"print version information and exit)z
no-find-linksNz9Don't load find-links defined in packages being installeduserNz!install in user site-package '%s'zzip-okz
multi-versionzexclude-scriptsrRzalways-copyr]zno-depszlocal-snapshots-okrbzalways-unzipcCs2tdtd|_d|_|_d|_|_|_d|_	d|_
d|_d|_d|_
|_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ t!j"rt!j#|_$t!j%|_&nd|_$d|_&d|_'d|_(d|_)|_*d|_+i|_,d|_-|j.j/|_/|j.0||j.1ddS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr/)2warningswarnEasyInstallDeprecationWarningrczip_oklocal_snapshots_okinstall_dir
script_direxclude_scripts	index_url
find_linksbuild_directoryargsoptimizerecordrRalways_copy
multi_versionr]no_depsallow_hostsrootprefix	no_reportrbinstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datainstall_baseinstall_platbasesiteENABLE_USER_SITE	USER_BASEinstall_userbase	USER_SITEinstall_usersite
no_find_links
package_indexpth_filealways_copy_from	site_dirsinstalled_projects_dry_rundistributionverbose_set_command_optionsget_option_dict)selfr7r7r8initialize_optionssJ

zeasy_install.initialize_optionscCs"dd|D}tt|j|dS)Ncss*|]"}tj|stj|r|VqdS)N)r:r;r<islink).0filenamer7r7r8	sz/easy_install.delete_blockers..)listmap_delete_path)rblockersZextant_blockersr7r7r8delete_blockersszeasy_install.delete_blockerscCsJtd||jrdStj|o.tj|}|r8tntj}||dS)NzDeleting %s)	rinfodry_runr:r;isdirrrmtreeunlink)rr;Zis_treeZremoverr7r7r8rszeasy_install._delete_pathcCs4djtj}td}d}t|jfttdS)zT
        Render the Setuptools version and installation details, then exit.
        z{}.{}
setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)formatsysversion_infor!printlocals
SystemExit)verdisttmplr7r7r8_render_versions
zeasy_install._render_versionc
Cs|jo|tjd}tdd\}}|j|j|j||dd|d|d||||t	tddd|_
tjr|j
|j
d	<|j|j
d
<n|jrtd||||dd
dd|jdkr|j|_|jdkrd|_|dd|dd|jr(|jr(|j|_|j|_|ddtttj}t|_ |j!dk	rdd|j!dD}xV|D]N}t"j#|std|n,t||krt$|dn|j %t|qpW|j&s|'|j(pd|_(|j dd|_)x4|jt|jfD] }||j)kr|j)*d|qW|j+dk	rJdd|j+dD}ndg}|j,dkrr|j-|j(|j)|d|_,t.|j)tj|_/|j0dk	rt1|j0t2r|j0|_0ng|_0|j3r|j,4|j)tj|js|j,5|j0|dd t1|j6t7s^y0t7|j6|_6d|j6kr&dks,nt8Wn.t8k
r\}	zt$d!|	Wdd}	~	XYnX|j&rv|j9svt:d"|j;st:d#g|_.sz1easy_install.finalize_options..,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|]}|qSr7)rL)rrDr7r7r8rCs*)search_pathhosts)rprpz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rbrrsplitrrget_nameget_versionget_fullnamegetattrconfig_varsrrrrrcrre_fix_install_dir_for_user_siteexpand_basedirsexpand_dirs_expandrjrirset_undefined_optionsryr}rrr;
get_site_dirs
all_site_dirsrr:rrappendr]check_site_dirrlshadow_pathinsertrurcreate_indexr#local_indexrm
isinstancestrrhZscan_egg_linksadd_find_linksrpint
ValueErrorrnrrooutputs)
rrrwrr>rrT	path_itemrr^r7r7r8finalize_optionss




zeasy_install.finalize_optionscCs\|jrtjsdS||jdkr.d}t||j|_|_tj	
ddd}||dS)z;
        Fix the install_dir if "--user" was used.
        Nz$User base directory is not specifiedposixunix_user)rcrrcreate_home_pathrr	rrr:namerM
select_scheme)rmsgZscheme_namer7r7r8rjs
z+easy_install._fix_install_dir_for_user_sitecCs\xV|D]N}t||}|dk	rtjdks0tjdkr}ztt||Wdd}~XYn2tk
rn}zt||Wdd}~XYnX|js|jrx*|D]"}|j|jkr||qWt	d|dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)
update_pthraddrr+remover%rrrinstallation_reporthas_metadatarrget_metadata_linesrrreas_requirementr$rr(resolver/r)rr*reportr)rrequirementrr7rZdistreqZdistrosr^r7r7r8r5sB



 
z!easy_install.process_distributioncCs2|jdk	r|jS|dr dS|ds.dSdS)Nznot-zip-safeTzzip-safeF)rgrE)rrr7r7r8should_unzips


zeasy_install.should_unzipcCstj|j|j}tj|r:d}t||j|j||Stj|rL|}nRtj	||krft
|t|}t|dkrtj||d}tj|r|}t
|t|||S)Nz<%r already exists in %s; build directory %s will not be keptrr)r:r;rrnr+r<rrerrrlistdirrr shutilmove)rr
dist_filename
setup_basedstrcontentsr7r7r8
maybe_moves"

zeasy_install.maybe_movecCs0|jr
dSx t|D]}|j|qWdS)N)rkScriptWriterbestget_argswrite_script)rrror7r7r8r#sz$easy_install.install_wrapper_scriptscCsNt|}t||}|r8||t}t||}||t|ddS)z/Generate a legacy script wrapper and install itrYN)	rrGis_python_script_load_templaterrT
get_headerrWrE)rrr$script_textdev_pathrZ	is_scriptbodyr7r7r8r!"s
zeasy_install.install_scriptcCs(d}|r|dd}td|}|dS)z
        There are a couple of template scripts in the package. This
        function loads one of them and prepares it for use.
        zscript.tmplz.tmplz (dev).tmplrzutf-8)rMrdecode)r\rZ	raw_bytesr7r7r8rY,s

zeasy_install._load_templatetr7c	sfdd|Dtd|jtjj|}|jrLdSt	}t
|tj|rpt|t
|d|}||WdQRXt|d|dS)z1Write an executable file to the scripts directorycsg|]}tjj|qSr7)r:r;rrj)rrU)rr7r8r>sz-easy_install.write_script..zInstalling %s script to %sNri)rrrrjr:r;rr)r
current_umaskr r<rr	rchmod)rr$rRmodertargetmaskrXr7)rr8rW;s

zeasy_install.write_scriptc	CsT|j|j|jd}y||dd}Wntk
r>YnX|||gS|}tj|rv|dsvt	|||j
ntj|rtj|}|
|r|jr|dk	r||||}tj|d}tj|s&ttj|dd}|stdtj|t|dkrtdtj||d	}|jrDt|||gS|||SdS)
N)z.eggz.exez.whlz.pyzsetup.pyrz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)install_egginstall_exe
install_wheelrKeyErrorr:r;isfiler9runpack_progressrabspath
startswithrnrSrr<rrrr]rrreport_editablebuild_and_install)	rrrOr/Z
installer_mapZinstall_distrPsetup_scriptZsetupsr7r7r8r;OsB

zeasy_install.install_eggscCs>tj|r"t|tj|d}ntt|}tj	||dS)NzEGG-INFO)metadata)
r:r;rr&rr'	zipimportzipimporterr%
from_filename)regg_pathrqr7r7r8r<s

zeasy_install.egg_distributionc	Cstj|jtj|}tj|}|js2t|||}t	||sztj
|rrtj|srtj
||jdn"tj|r|tj|fd|yd}tj
|r||rtjd}}ntjd}}nL||r|||jd}}n*d}||rtjd}}ntjd}}||||f|dtj|tj|ft||d	Wn$tk
rxt|dd	YnX||||S)
N)rz	Removing FZMovingZCopyingZ
ExtractingTz	 %s to %s)fix_zipimporter_caches)r:r;rrirrlrr r<r.rrr
remove_treer<rrrmrMrNcopytreerKmkpathunpack_and_compilecopy2rupdate_dist_cachesrr))rrur/destinationrZnew_dist_is_zippedrXrQr7r7r8rfsT






zeasy_install.install_eggcsTt|}|dkrtd|td|dd|ddtd}tj||d}||_	|d}tj|d}tj|d	}t
|t|||_|
||tj|st|d
}	|	dx<|dD].\}
}|
dkr|	d
|
dd|fqW|	tj|d|fddt|Dtj|||j|jd|||S)Nz(%s is not a valid distutils Windows .exerqrrb)r:rbplatformz.eggz.tmpzEGG-INFOzPKG-INFOrzMetadata-Version: 1.0
target_versionz%s: %s
_-rcsg|]}tj|dqS)r)r:r;r)rro)rjr7r8rsz,easy_install.install_exe..)rr)r1rr%rrr:r;regg_namer6r r&	_provider
exe_to_eggr<r	ritemsrMtitler
rrTrVrmake_zipfilerrrf)rrOr/cfgrruegg_tmpZ	_egg_infoZpkg_infrXkvr7)rjr8rgs<



"
zeasy_install.install_execs>t|ggifdd}t||g}xtD]l}|dr>|d}|d}t|dd|d<tjj	f|}
||
|t||q>W|t
tj	dt|xbdD]Z}	t|	rtj	d|	d	}
tj|
st|
d
}|d	t|	d|qWdS)
z;Extract a bdist_wininst to the directories an egg would usecs|}xԈD]\}}||r||t|d}|d}tjjf|}|}|dsl|drt	|d|d<dtj
|dd<|n4|dr|dkrdtj
|dd<||SqW|d	st
d
|dS)N/z.pydz.dllrrz.pyzSCRIPTS/z.pthzWARNING: can't process %s)rrmrrr:r;rr9rstrip_modulesplitextrrre)srcrQrDoldnewpartsr8)rnative_libsprefixes
to_compile	top_levelr7r8processs$



z(easy_install.exe_to_egg..processz.pydrrz.pyzEGG-INFO)rrz.txtrrIN)r2rrr9rrrr:r;rrZ
write_stubbyte_compileZwrite_safety_flagZanalyze_eggrr<r	rr
)rrOrrZstubsresrresourceZpyfilertxtrXr7)rrrrrr8rs6







zeasy_install.exe_to_eggc
Cst|}|sttj|j|}tj|}|j	sBt
|tj|rltj|slt
j||j	dn"tj|r|tj|fd|z.||j|fdtj|tj|fWdt|ddX||||S)N)rz	Removing zInstalling %s to %sF)rv)r
is_compatibleAssertionErrorr:r;rrirrlrr rrr
rwr<rrZinstall_as_eggrrr|r)r<)r
wheel_pathr/wheelr}r7r7r8rh$s.


zeasy_install.install_wheela(
        Because this distribution was installed --multi-version, before you can
        import modules from this package in an application, you will need to
        'import pkg_resources' and then use a 'require()' call similar to one of
        these examples, in order to select the desired version:

            pkg_resources.require("%(name)s")  # latest installed version
            pkg_resources.require("%(name)s==%(version)s")  # this exact version
            pkg_resources.require("%(name)s>=%(version)s")  # this version or higher
        z
        Note also that the installation directory must be on sys.path at runtime for
        this to work.  (e.g. by being the application's script directory, by being on
        PYTHONPATH, or by being added to sys.path by your code.)
        	Installedc	Cs^d}|jr>|js>|d|j7}|jtttjkr>|d|j7}|j	}|j
}|j}d}|tS)z9Helpful installation message for display to package usersz
%(what)s %(eggloc)s%(extras)srIr)
rsrx_easy_install__mv_warningrirrrr;_easy_install__id_warningr6r:rbr)	rreqrwhatrZegglocrrbextrasr7r7r8rDRsz easy_install.installation_reportaR
        Extracted editable version of %(spec)s to %(dirname)s

        If it uses setuptools in its setup script, you can activate it in
        "development" mode by going to that directory and running::

            %(python)s setup.py develop

        See the setuptools documentation for the "develop" command for more info.
        cCs"tj|}tj}d|jtS)NrI)r:r;rrr_easy_install__editable_msgr)rrrprpythonr7r7r8rnkszeasy_install.report_editablec
Cstjdttjdtt|}|jdkrNd|jd}|dd|n|jdkrd|dd|jrv|dd	t	
d
|t|ddd|yt
||Wn8tk
r}ztd|jdf|Wdd}~XYnXdS)
Nzdistutils.command.bdist_eggzdistutils.command.egg_inforrrrrz-qz-nz
Running %s %s zSetup script exited with %s)rmodules
setdefaultrrrrrrrrrrrrrro)rrprProrr7r7r8rps$

 zeasy_install.run_setupc		Csddg}tjdtj|d}z|tj|||||||t|g}g}x2|D]*}x$||D]}||	|j
|qlWq^W|s|jst
d||St|t|jXdS)Nrz
--dist-dirz
egg-dist-tmp-)rwdirz+No eggs found in %s (setup script problem?))r-r.r:r;r_set_fetcher_optionsrrr#rfr6rrrerrr)	rrprProdist_dirZall_eggseggsr+rr7r7r8ros$



zeasy_install.build_and_installc	Csl|jd}d}i}x*|D]\}}||kr4q"|d||<q"Wt|d}tj|d}t	||dS)a
        When easy_install is about to run bdist_egg on a source dist, that
        source dist might have 'setup_requires' directives, requiring
        additional fetching. Ensure the fetcher options given to easy_install
        are available to that command as well.
        r/)rmrrlrprur)r/z	setup.cfgN)
rrcopyrdictr:r;rrZedit_config)	rr'Zei_optsZfetch_directivesZ
fetch_optionsr+rsettingsZcfg_filenamer7r7r8rs	
z!easy_install._set_fetcher_optionsc	Cs:|jdkrdSxZ|j|jD]J}|js4|j|jkr4qtd||j||j|jkr|j|jqW|js|j|jjkrtd|n2td||j	||j|jkr|j
|j|jrdS|j|jdkrdSt
j|jd}t
j|rt
|t|d}||j|jdWdQRXdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filerzsetuptools.pthwtrI)rr+rsr6rrrCrpathsrBrrsaver:r;rrirrr	r
make_relative)rrrTrrXr7r7r8rAs8



zeasy_install.update_pthcCstd|||S)NzUnpacking %s to %s)rdebug)rrrQr7r7r8rkszeasy_install.unpack_progresscshggfdd}t|||jsdx.D]&}t|tjdBd@}t||q:WdS)NcsZ|dr |ds |n|ds4|dr>|||jrV|pXdS)Nz.pyz	EGG-INFO/z.dllz.so)r9rmrrkr)rrQ)rto_chmodrr7r8pfs
z+easy_install.unpack_and_compile..pfimi)rrrr:statST_MODEra)rrur}rrXrbr7)rrrr8rzs

zeasy_install.unpack_and_compilec	Csjtjr
dSddlm}z@t|jd||dd|jd|jrT|||jd|jdWdt|jXdS)Nr)rr)rpforcer)	rdont_write_bytecodedistutils.utilrrrrrrp)rrrr7r7r8rszeasy_install.byte_compilea
        bad install directory or PYTHONPATH

        You are attempting to install a package to a directory that is not
        on PYTHONPATH and which Python does not read ".pth" files from.  The
        installation directory you specified (via --install-dir, --prefix, or
        the distutils default setting) was:

            %s

        and your PYTHONPATH environment variable currently contains:

            %r

        Here are some of your options for correcting the problem:

        * You can choose a different installation directory, i.e., one that is
          on PYTHONPATH or supports .pth files

        * You can add the installation directory to the PYTHONPATH environment
          variable.  (It must then also be on PYTHONPATH whenever you run
          Python and want to use the package(s) you are installing.)

        * You can set up the installation directory to support ".pth" files by
          using one of the approaches described here:

          https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html#custom-installation-locations


        Please make the appropriate changes for your system and try again.
        cCsf|js
dSttjd}xF|jD]8\}}||r&tj|s&|	d|t
|dq&WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)rcrr:r;rrrrmrdebug_printr)rhomerr;r7r7r8r)szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz	$base/bin)rirj)rz$base/Lib/site-packagesz
$base/ScriptscGs|dj}|jrh|}|j|d<|jtj|j}x0|	D]$\}}t
||ddkr@t|||q@Wddlm
}xJ|D]B}t
||}|dk	rz|||}tjdkrtj|}t|||qzWdS)Nrr'r)rr)get_finalized_commandrrwrr
rr:rDEFAULT_SCHEMErrrrrr;r)rrrr?rrrr7r7r8r?s 




zeasy_install._expand)T)F)F)T)N)r_r7)r)M__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsrruser_optionsboolean_optionsnegative_optrrrrrstaticmethodrrrrrrrrrrrJrKlstriprrrrrr%r)r*r,
contextlibcontextmanagerr0r/r3rr5rKrSr#r!rYrWr;r<rfrgrrhrrrDrrnrrorrArkrzrrLr
rrr
rrr7r7r7r8r/ns
5		
-


	;
	
!
$
(	


3	6.5	

	
)

cCs tjddtj}td|S)Nrr)r:rrrpathsepfilter)rr7r7r8_pythonpathVsrc	s|gttjg}tjtjkr0|tjx|D]}|s@q6tjdkrbtj	|ddnVtj
dkrtj	|ddjtjdtj	|ddgn|tj	|ddgtjdkrq6d	|krq6tj
d
}|sq6tj	|ddd
jtjd}|q6Wtdtdf}fdd|DtjrFtjtttWdQRXtttS)z&
    Return a list of 'site' dirs
    )Zos2emxZriscosLibz
site-packagesrlibzpython{}.{}zsite-pythondarwinzPython.frameworkHOMELibraryPythonz{}.{}purelibplatlibc3s|]}|kr|VqdS)Nr7)rrD)sitedirsr7r8rsz get_site_dirs..N)extendrrrwrrr~r:r;rseprrrrrrrrrsuppressAttributeErrorgetsitepackagesrrr)rrwrZhome_spZ	lib_pathsr7)rr8r[sV





rccsi}x|D]}t|}||kr q
d||<tj|s6q
t|}||fVx|D]}|ds`qP|dkrjqPttj||}tt	|}|
xT|D]L}|drqt|}||krqd||<tj|sq|t|fVqWqPWq
WdS)zBYield sys.path directories that might contain "old-style" packagesrz.pth)zeasy-install.pthzsetuptools.pthimportN)
rr:r;rrLr9r	rrrr
rmrstrip)inputsseenrr(rrXlinesliner7r7r8expand_pathss8






rcCs"t|d}zt|}|dkr$dS|d|d|d}|dkrHdS||dtd|d\}}}|dkrzdS||d|d	d	d
}t|}y<||}	|		ddd
}
|

t}
|
t|
Wntjk
rdSX|dr|dsdS|S|XdS)znExtract configuration data from a bdist_wininst .exe

    Returns a configparser.RawConfigParser, or None
    rbN	zegg path translations for a given .exe file)zPURELIB/r)zPLATLIB/pywin32_system32r)zPLATLIB/r)zSCRIPTS/zEGG-INFO/scripts/)zDATA/lib/site-packagesrrrrzPKG-INFOrz	.egg-inforNz	EGG-INFO/z.pthz
-nspkg.pth)ZPURELIBZPLATLIB\rz%s/%s/rcSsg|]\}}||fqSr7)r)rrUyr7r7r8rsz$get_exe_prefixes..)rZipFileinfolistrrrr9rrupperrr^rrLrMrmrr
sortreverse)Zexe_filenamerrPrrrrRpthr7r7r8r2s:



&
c@sReZdZdZdZdddZddZdd	Zed
dZ	dd
Z
ddZddZdS)r0z)A .pth file with Distribution paths in itFr7cCsp||_ttt||_ttj|j|_|	t
|gddx(t|j
D]}tt|jt|dqNWdS)NT)rrrrrr:r;rbasedir_loadr#__init__rrrBr")rrrr;r7r7r8r
"szPthDistributions.__init__cCs
g|_d}t|j}tj|jrt|jd}x|D]}|	drJd}q6|
}|j||r6|	drvq6t
tj|j|}|jd<tj|r||kr|jd|_q6d||<q6W||jr|sd|_x&|jr|jds|jqWdS)NFrtrT#rr)rrfromkeysrr:r;rjrr	rmrrrLrrrr<popdirtyr
)rZ
saw_importrrXrr;r7r7r8r	+s2



zPthDistributions._loadc	Cs|js
dStt|j|j}|rtd|j||}d	|d}t
j|jr`t

|jt|jd}||WdQRXn(t
j|jrtd|jt

|jd|_dS)z$Write changed .pth file back to diskNz	Saving %srIrzDeleting empty %sF)rrrrrrrr_wrap_linesrr:r;rrr	rr<)rZ	rel_pathsrdatarXr7r7r8rJs
zPthDistributions.savecCs|S)Nr7)rr7r7r8r`szPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jtk}|r>|j|jd|_t||dS)z"Add `dist` to the distribution mapTN)	r6rrr:getcwdrrr#rB)rrnew_pathr7r7r8rBdszPthDistributions.addcCs6x$|j|jkr$|j|jd|_qWt||dS)z'Remove `dist` from the distribution mapTN)r6rrCrr#)rrr7r7r8rCrs
zPthDistributions.removecCstjt|\}}t|j}|g}tjdkr2dp6tj}xVt||kr||jkrn|tj	|
||Stj|\}}||q:W|SdS)Nr)r:r;rrrraltseprrcurdirrr)rr;npathlastZbaselenrrr7r7r8rys


zPthDistributions.make_relativeN)r7)
rrrrrr
r	rrrrBrCrr7r7r7r8r0s
	c@s(eZdZeddZedZedZdS)RewritePthDistributionsccs(|jVx|D]
}|VqW|jVdS)N)preludepostlude)clsrrr7r7r8rs

z#RewritePthDistributions._wrap_linesz?
        import sys
        sys.__plen = len(sys.path)
        z
        import sys
        new = sys.path[sys.__plen:]
        del sys.path[sys.__plen:]
        p = getattr(sys, '__egginsert', 0)
        sys.path[p:p] = new
        sys.__egginsert = p + len(new)
        N)rrrclassmethodrrOrrr7r7r7r8rs
rZSETUPTOOLS_SYS_PATH_TECHNIQUErawZrewritecCs ttjtrtSttjS)z_
    Return a regular expression based on first_line_re suitable for matching
    strings.
    )rrpatternrrecompiler^r7r7r7r8_first_line_resr!cCs\|tjtjgkr.tjdkr.t|tj||St\}}}|d|dd||ffdS)Nrrrz %s %s)	r:rrCrrarS_IWRITErr)funcargexcetZevrr7r7r8
auto_chmods
r'cCs.t|}t|tj|r"t|nt|dS)aa

    Fix any globally cached `dist_path` related data

    `dist_path` should be a path of a newly installed egg distribution (zipped
    or unzipped).

    sys.path_importer_cache contains finder objects that have been cached when
    importing data from the original distribution. Any such finders need to be
    cleared since the replacement distribution might be packaged differently,
    e.g. a zipped egg distribution might get replaced with an unzipped egg
    folder or vice versa. Having the old finders cached may then cause Python
    to attempt loading modules from the replacement distribution using an
    incorrect loader.

    zipimport.zipimporter objects are Python loaders charged with importing
    data packaged inside zip archives. If stale loaders referencing the
    original distribution, are left behind, they can fail to load modules from
    the replacement distribution. E.g. if an old zipimport.zipimporter instance
    is used to load data from a new zipped egg archive, it may cause the
    operation to attempt to locate the requested data in the wrong location -
    one indicated by the original distribution's zip archive directory
    information. Such an operation may then fail outright, e.g. report having
    read a 'bad local file header', or even worse, it may fail silently &
    return invalid data.

    zipimport._zip_directory_cache contains cached zip archive directory
    information for all existing zipimport.zipimporter instances and all such
    instances connected to the same archive share the same cached directory
    information.

    If asked, and the underlying Python implementation allows it, we can fix
    all existing zipimport.zipimporter instances instead of having to track
    them down and remove them one by one, by updating their shared cached zip
    archive directory information. This, of course, assumes that the
    replacement distribution is packaged as a zipped egg.

    If not asked to fix existing zipimport.zipimporter instances, we still do
    our best to clear any remaining zipimport.zipimporter related cached data
    that might somehow later get used when attempting to load data from the new
    distribution and thus cause such load operations to fail. Note that when
    tracking down such remaining stale data, we can not catch every conceivable
    usage from here, and we clear only those that we know of and have found to
    cause problems if left alive. Any remaining caches should be updated by
    whomever is in charge of maintaining them, i.e. they should be ready to
    handle us replacing their zip archives with new distributions at runtime.

    N)r_uncacherpath_importer_cache!_replace_zip_directory_cache_data*_remove_and_clear_zip_directory_cache_data)	dist_pathrvnormalized_pathr7r7r8r|s
<
r|cCsTg}t|}xB|D]:}t|}||r|||dtjdfkr||qW|S)ap
    Return zipimporter cache entry keys related to a given normalized path.

    Alternative path spellings (e.g. those using different character case or
    those using alternative path separators) related to the same path are
    included. Any sub-path entries are included as well, i.e. those
    corresponding to zip archives embedded in other zip archives.

    rr)rrrmr:rr)r-cacheresult
prefix_lenpnpr7r7r8"_collect_zipimporter_cache_entries
s


r3cCsDx>t||D]0}||}||=|o*|||}|dk	r|||<qWdS)a
    Update zipimporter cache data for a given normalized path.

    Any sub-path entries are processed as well, i.e. those corresponding to zip
    archives embedded in other zip archives.

    Given updater is a callable taking a cache entry key and the original entry
    (after already removing the entry from the cache), and expected to update
    the entry and possibly return a new one to be inserted in its place.
    Returning None indicates that the entry should not be replaced with a new
    one. If no updater is given, the cache entries are simply removed without
    any additional processing, the same as if the updater simply returned None.

    N)r3)r-r.updaterr1	old_entryZ	new_entryr7r7r8_update_zipimporter_caches
r6cCst||dS)N)r6)r-r.r7r7r8r(>sr(cCsdd}t|tj|ddS)NcSs|dS)N)clear)r;r5r7r7r82clear_and_remove_cached_zip_archive_directory_dataCszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data)r4)r6rr_zip_directory_cache)r-r8r7r7r8r+Bsr+Z__pypy__cCsdd}t|tj|ddS)NcSs&|t||tj||S)N)r7rrrsupdater9)r;r5r7r7r8)replace_cached_zip_archive_directory_dataYs
zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data)r4)r6rrr9)r-r;r7r7r8r*Xs
r*c	Cs2yt||dWnttfk
r(dSXdSdS)z%Is this string a valid Python script?execFTN)r SyntaxError	TypeError)rNrr7r7r8	is_pythonks
r@c	CsJy(tj|dd}|d}WdQRXWnttfk
r@|SX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)encodingrNz#!)rr	rrr)rfpmagicr7r7r8is_shusrDcCst|gS)z@Quote a command line argument according to Windows parsing rules)
subprocesslist2cmdline)r$r7r7r8nt_quote_argsrGcCsH|ds|drdSt||r&dS|drDd|dkSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc.
    z.pyz.pywTz#!rrF)r9r@rm
splitlinesr)r[rr7r7r8rXs

rX)racGsdS)Nr7)ror7r7r8_chmodsrIc
CsRtd||yt||Wn0tjk
rL}ztd|Wdd}~XYnXdS)Nzchanging mode of %s to %ozchmod failed: %s)rrrIr:error)r;rbr^r7r7r8ras
rac@seZdZdZgZeZeddZeddZ	eddZ
edd	Zed
dZdd
Z
eddZddZeddZeddZdS)CommandSpeczm
    A command spec for a #! header, specified as a list of arguments akin to
    those passed to Popen.
    cCs|S)zV
        Choose the best CommandSpec class based on environmental conditions.
        r7)rr7r7r8rUszCommandSpec.bestcCstjtj}tjd|S)N__PYVENV_LAUNCHER__)r:r;r>rrrr)r_defaultr7r7r8_sys_executableszCommandSpec._sys_executablecCs:t||r|St|tr ||S|dkr0|S||S)zg
        Construct a CommandSpec from a parameter to build_scripts, which may
        be None.
        N)rrfrom_environmentfrom_string)rparamr7r7r8
from_params

zCommandSpec.from_paramcCs||gS)N)rN)rr7r7r8rOszCommandSpec.from_environmentcCstj|f|j}||S)z}
        Construct a command spec from a simple string representing a command
        line parseable by shlex.split.
        )shlexr
split_args)rstringrr7r7r8rPszCommandSpec.from_stringcCs8t|||_t|}t|s4dg|jdd<dS)Nz-xr)rSr_extract_optionsoptionsrErFrH)rr[cmdliner7r7r8install_optionss
zCommandSpec.install_optionscCs:|dd}t|}|r.|dp0dnd}|S)zH
        Extract any options from the first line of the script.
        rIrrr)rHr!matchgrouprL)Zorig_scriptfirstrZrWr7r7r8rVszCommandSpec._extract_optionscCs||t|jS)N)_renderrrW)rr7r7r8	as_headerszCommandSpec.as_headercCs6d}x,|D]$}||r
||r
|ddSq
W|S)Nz"'rr)rmr9)itemZ_QUOTESqr7r7r8
_strip_quotess

zCommandSpec._strip_quotescCs tdd|D}d|dS)Ncss|]}t|VqdS)N)rKrarL)rr_r7r7r8rsz&CommandSpec._render..z#!rI)rErF)rrXr7r7r8r]szCommandSpec._renderN)rrrrrWrrTrrUrNrRrOrPrYrrVr^rar]r7r7r7r8rKs	
rKc@seZdZeddZdS)WindowsCommandSpecF)rN)rrrrrTr7r7r7r8rbsrbc@seZdZdZedZeZ	e
dddZe
dddZe
dd	d
Z
eddZe
d
dZe
ddZe
ddZe
dddZdS)rTz`
    Encapsulates behavior around writing entry point scripts for console and
    gui apps.
    aJ
        # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
        import re
        import sys

        # for compatibility with easy_install; see #2198
        __requires__ = %(spec)r

        try:
            from importlib.metadata import distribution
        except ImportError:
            try:
                from importlib_metadata import distribution
            except ImportError:
                from pkg_resources import load_entry_point


        def importlib_load_entry_point(spec, group, name):
            dist_name, _, _ = spec.partition('==')
            matches = (
                entry_point
                for entry_point in distribution(dist_name).entry_points
                if entry_point.group == group and entry_point.name == name
            )
            return next(matches).load()


        globals().setdefault('load_entry_point', importlib_load_entry_point)


        if __name__ == '__main__':
            sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
            sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)())
        NFcCs6tdt|rtnt}|d||}|||S)NzUse get_argsr)rdrerfWindowsScriptWriterrTrUget_script_headerrV)rrrwininstwriterheaderr7r7r8get_script_args(szScriptWriter.get_script_argscCs$tjdtdd|rd}|||S)NzUse get_headerr)
stacklevelz
python.exe)rdrerfrZ)rr[rrer7r7r8rd0s
zScriptWriter.get_script_headerccs|dkr|}t|}xjdD]b}|d}xT||D]B\}}|||jt}|||||}	x|	D]
}
|
VqrWq>Wq"WdS)z
        Yield write_script() argument tuples for a distribution's
        console_scripts and gui_scripts entry points.
        N)consoleguiZ_scripts)	rZrrG
get_entry_mapr_ensure_safe_nametemplater_get_script_args)rrrgrtype_r[repr[rorr7r7r8rV9s


zScriptWriter.get_argscCstd|}|rtddS)z?
        Prevent paths in *_scripts entry point names.
        z[\\/]z+Path separators not allowed in script namesN)rsearchr)rZhas_path_sepr7r7r8rmKszScriptWriter._ensure_safe_namecCs tdt|rtS|S)NzUse best)rdrerfrcrU)rZ
force_windowsr7r7r8
get_writerTszScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&tS|SdS)zD
        Select the best ScriptWriter for this environment.
        win32javarN)rr~r:r_namercrU)rr7r7r8rUZszScriptWriter.bestccs|||fVdS)Nr7)rrprrgr[r7r7r8rodszScriptWriter._get_script_argsrcCs"|j|}|||S)z;Create a #! line, getting options (if any) from script_text)command_spec_classrUrRrYr^)rr[rcmdr7r7r8rZis
zScriptWriter.get_header)NF)NF)N)rN)rrrrrJrKrrnrKrwrrhrdrVrrmrsrUrorZr7r7r7r8rTs !
	
rTc@sLeZdZeZeddZeddZeddZeddZ	e
d	d
ZdS)rccCstdt|S)NzUse best)rdrerfrU)rr7r7r8rstszWindowsScriptWriter.get_writercCs"tt|d}tjdd}||S)zC
        Select the best ScriptWriter suitable for Windows
        )rZnaturalZSETUPTOOLS_LAUNCHERr)rWindowsExecutableLauncherWriterr:rr)rZ
writer_lookuplauncherr7r7r8rUzs
zWindowsScriptWriter.bestc	#stddd|}|tjddkrBdjft}t|t	dddd	d
ddg}|
||||}fdd
|D}|||d|fVdS)z For Windows, add a .py extensionz.pyaz.pyw)rjrkPATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.z.pyz
-script.pyz.pycz.pyoz.execsg|]}|qSr7r7)rrU)rr7r8rsz8WindowsScriptWriter._get_script_args..r_N)rr:rrrrrrdreUserWarningrC_adjust_header)	rrprrgr[extrrrr7)rr8ros
z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}tt|tj}|j||d}||rJ|S|S)z
        Make sure 'pythonw' is used for gui and 'python' is used for
        console (regardless of what sys.executable is).
        zpythonw.exez
python.exerk)rUrepl)rr escape
IGNORECASEsub_use_header)rrpZorig_headerrrZ
pattern_ob
new_headerr7r7r8r~s
z"WindowsScriptWriter._adjust_headercCs$|ddd}tjdkp"t|S)z
        Should _adjust_header use the replaced header?

        On non-windows systems, always use. On
        Windows systems, only use the replaced header if it resolves
        to an executable on the system.
        rr"rt)rLrr~r)rZclean_headerr7r7r8rs	zWindowsScriptWriter._use_headerN)rrrrbrwrrsrUror~rrr7r7r7r8rcqs
rcc@seZdZeddZdS)ryc#s|dkrd}d}dg}nd}d}dddg}|||}fd	d
|D}	|||d|	fVdt|d
fVtsd}
|
tdfVdS)zG
        For Windows, add a .py extension and an .exe launcher
        rkz-script.pywz.pywcliz
-script.pyz.pyz.pycz.pyocsg|]}|qSr7r7)rrU)rr7r8rszDWindowsExecutableLauncherWriter._get_script_args..r_z.exerYz
.exe.manifestN)r~get_win_launcherr9load_launcher_manifest)rrprrgr[Z
launcher_typerrhdrrZm_namer7)rr8ros
z0WindowsExecutableLauncherWriter._get_script_argsN)rrrrror7r7r7r8rysrycCsJd|}tr4tdkr&|dd}q@|dd}n|dd}td|S)z
    Load the Windows launcher (executable) suitable for launching a script.

    `type` should be either 'cli' or 'gui'

    Returns the executable as a byte string.
    z%s.exez	win-arm64.z-arm64.z-64.z-32.r)r9rrMr)typeZlauncher_fnr7r7r8rs
rcCsttd}|dtS)Nzlauncher manifest.xmlzutf-8)
pkg_resourcesrrr^vars)rmanifestr7r7r8rsrFcCst|||S)N)rMr)r;
ignore_errorsonerrorr7r7r8rsrcCstd}t||S)N)r:umask)tmpr7r7r8r`s

r`c@seZdZdZdS)rfzF
    Warning for EasyInstall deprecations, bypassing suppression.
    N)rrrrr7r7r7r8rfsrf)N)r<)|rrrrrrdistutils.errorsrrrr	distutils.command.installr
rrrr
Zdistutils.command.build_scriptsrrrrr:rrrMr-rrrrrJrdrr5rrErSrr	sysconfigrrrrrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrrrrr r!r"r#r$r%r&r'r(r)r*r+filterwarnings
PEP440Warning__all__r9r.rErHrOr/rrrr1r2r0rrrr!r'r|r3r6r(r+builtin_module_namesr*r@rDrGrXrarIImportErrorrrKrNZsys_executablerbrTrcryrhrdrrrr`rfr7r7r7r8sDqF.)%l	R
 


TtA PK!I22)command/__pycache__/setopt.cpython-37.pycnu[B

Re@sddlmZddlmZddlmZddlZddlZddlZddlm	Z	dddd	gZ
dddZdd
dZGddde	Z
Gdd	d	e
ZdS))convert_path)log)DistutilsOptionErrorN)Commandconfig_fileedit_configoption_basesetoptlocalcCsh|dkrdS|dkr,tjtjtjdS|dkrZtjdkrBdpDd}tjtd	|St	d
|dS)zGet the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    r
z	setup.cfgglobalz
distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N)
ospathjoindirname	distutils__file__name
expanduserr
ValueError)kinddotr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/setopt.pyr
sFc		Cs8td|t}dd|_||gx|D]\}}|dkr^td||||q4|	|std|||
|x||D]p\}}|dkrtd||||||||std||||qtd	|||||
|||qWq4Wtd
||s4t|d}||WdQRXdS)aYEdit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    zReading configuration from %scSs|S)Nr)xrrr*zedit_config..NzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz
Writing %sw)rdebugconfigparserRawConfigParseroptionxformreaditemsinforemove_sectionhas_sectionadd_section
remove_optionoptionssetopenwrite)	filenamesettingsdry_runoptssectionr,optionvaluefrrrr s:




c@s2eZdZdZdddgZddgZddZd	d
ZdS)rz|js>tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rrBrNr5rrOrL)r<rrrrBs

zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr0rNr5replacerOr2)r<rrrrunsz
setopt.runN)rCrDrErFdescriptionrrGrHr=rBrSrrrrr	ss)r
)F)distutils.utilrrrdistutils.errorsrrr"
setuptoolsr__all__rrrr	rrrrs

,'PK!y
-command/__pycache__/py36compat.cpython-37.pycnu[B

ReR@sXddlZddlmZddlmZddlmZGdddZeejdrTGdddZdS)	N)glob)convert_path)sdistc@s\eZdZdZddZeddZddZdd	Zd
dZ	dd
Z
ddZddZddZ
dS)sdist_add_defaultsz
    Mix-in providing forward-compatibility for functionality as found in
    distutils on Python 3.7.

    Do not edit the code in this class except to update functionality
    as implemented in distutils. Instead, override in the subclass.
    cCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/py36compat.pyadd_defaultsszsdist_add_defaults.add_defaultscCs:tj|sdStj|}tj|\}}|t|kS)z
        Case-sensitive path existence check

        >>> sdist_add_defaults._cs_path_exists(__file__)
        True
        >>> sdist_add_defaults._cs_path_exists(__file__.upper())
        False
        F)ospathexistsabspathsplitlistdir)fspathr	directoryfilenamerrr_cs_path_exists&s

z"sdist_add_defaults._cs_path_existscCs|j|jjg}x|D]}t|trn|}d}x(|D] }||r0d}|j|Pq0W|s|dd	|q||r|j|q|d|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
ZREADMESdistributionscript_name
isinstancetuplerfilelistappendwarnjoin)r
Z	standardsfnZaltsZgot_itrrrr7s 




z*sdist_add_defaults._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|}|j|qWdS)Nz
test/test*.pyz	setup.cfg)filterrrisfilerrextend)r
optionalpatternfilesrrrrLs
z)sdist_add_defaults._add_defaults_optionalcCsd|d}|jr$|j|x:|jD]0\}}}}x"|D]}|jtj	
||q>Wq,WdS)Nbuild_py)get_finalized_commandrhas_pure_modulesrr&get_source_files
data_filesr rrr")r
r*pkgsrc_dir	build_dir	filenamesrrrrrRs


z'sdist_add_defaults._add_defaults_pythoncCs|jr~xr|jjD]f}t|trDt|}tj|rz|j	
|q|\}}x,|D]$}t|}tj|rR|j	
|qRWqWdS)N)rhas_data_filesr.rstrrrrr%rr )r
itemdirnamer2frrrr	bs


z+sdist_add_defaults._add_defaults_data_filescCs(|jr$|d}|j|dS)N	build_ext)rhas_ext_modulesr+rr&r-)r
r8rrrr
ss

z$sdist_add_defaults._add_defaults_extcCs(|jr$|d}|j|dS)N
build_clib)rhas_c_librariesr+rr&r-)r
r:rrrrxs

z'sdist_add_defaults._add_defaults_c_libscCs(|jr$|d}|j|dS)N
build_scripts)rhas_scriptsr+rr&r-)r
r<rrrr}s

z(sdist_add_defaults._add_defaults_scriptsN)__name__
__module____qualname____doc__rstaticmethodrrrrr	r
rrrrrrrsrrc@seZdZdS)rN)r>r?r@rrrrrs)rrdistutils.utilrdistutils.commandrrhasattrrrrrs|PK!R?,command/__pycache__/dist_info.cpython-37.pycnu[B

Re@s8dZddlZddlmZddlmZGdddeZdS)zD
Create a dist_info directory
As defined in the wheel specification
N)Command)logc@s.eZdZdZdgZddZddZddZd	S)
	dist_infozcreate a .dist-info directory)z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree)cCs
d|_dS)N)egg_base)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/dist_info.pyinitialize_optionsszdist_info.initialize_optionscCsdS)Nr)rrrr	finalize_optionsszdist_info.finalize_optionscCsn|d}|j|_|||jdtdd}tdt	j
||d}||j|dS)Negg_infoz	.egg-infoz
.dist-infoz
creating '{}'bdist_wheel)
get_finalized_commandrrrunrlenrinfoformatospathabspathZegg2dist)rr
dist_info_dirr
rrr	rs

z
dist_info.runN)__name__
__module____qualname__descriptionuser_optionsr
rrrrrr	rs
r)__doc__rdistutils.corer	distutilsrrrrrr	sPK!}%TT)command/__pycache__/upload.cpython-37.pycnu[B

Re@s:ddlmZddlmZddlmZGdddejZdS))log)upload)RemovedCommandErrorc@seZdZdZddZdS)rz)Formerly used to upload packages to PyPI.cCs"d}|d|tjt|dS)Nz[The upload command has been removed, use twine to upload instead (https://pypi.org/p/twine)zERROR: )announcerERRORr)selfmsgr	/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/upload.pyrun
sz
upload.runN)__name__
__module____qualname____doc__rr	r	r	r
rsrN)	distutilsrdistutils.commandrorigZsetuptools.errorsrr	r	r	r
sPK!tĖ		2command/__pycache__/install_scripts.cpython-37.pycnu[B

Re!
@sdddlmZddlmmZddlmZddlZddl	Z	ddl
mZmZm
Z
GdddejZdS))logN)DistutilsModuleError)DistributionPathMetadataensure_directoryc@s*eZdZdZddZddZd
ddZd	S)install_scriptsz;Do normal script install, plus any egg_info wrapper scriptscCstj|d|_dS)NF)origrinitialize_optionsno_ep)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/install_scripts.pyr	
sz"install_scripts.initialize_optionsc	Csddlmm}|d|jjr2tj|ng|_	|j
rBdS|d}t|j
t|j
|j|j|j}|d}t|dd}y|d}t|dd}Wnttfk
rd}YnX|j}|rd}|j}|tjkr|g}|}|j|}	x$|||	D]}
|j|
qWdS)	Nregg_info
build_scripts
executable
bdist_wininstZ_is_runningFz
python.exe)setuptools.command.easy_installcommandeasy_installrun_commanddistributionscriptsrrrunoutfilesr
get_finalized_commandrZegg_baserregg_nameZegg_versiongetattrImportErrorrZScriptWriterZWindowsScriptWritersysrbestZcommand_spec_class
from_paramZget_argsZ	as_headerwrite_script)reiZei_cmddistZbs_cmdZ
exec_paramZbw_cmdZ
is_wininstwritercmdargsrrr
rs8





zinstall_scripts.runtc
Gsddlm}m}td||jtj|j|}|j	
||}|js~t|t
|d|}	|	||	||d|dS)z1Write an executable file to the scripts directoryr)chmod
current_umaskzInstalling %s script to %swiN)rr(r)rinfoZinstall_dirospathjoinrappenddry_runropenwriteclose)
rscript_namecontentsmodeZignoredr(r)targetmaskfrrr
r!7s
zinstall_scripts.write_scriptN)r')__name__
__module____qualname____doc__r	rr!rrrr
r
s&r)	distutilsrZ!distutils.command.install_scriptsrrrdistutils.errorsrr,r
pkg_resourcesrrrrrrr
sPK!Uȯ+command/__pycache__/__init__.cpython-37.pycnu[B

Re@s<ddlmZddlZdejkr4dejd<ejd[[dS))bdistNZegg)Z	bdist_eggzPython .egg file)Zdistutils.command.bdistrsysZformat_commandsZformat_commandappendrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__init__.pys


PK!]4*command/__pycache__/develop.cpython-37.pycnu[B

Red@sddlmZddlmZddlmZmZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZddl
Z
GdddejeZGd	d
d
ZdS))convert_path)log)DistutilsErrorDistutilsOptionErrorN)easy_install)
namespacesc@sveZdZdZdZejddgZejdgZdZddZ	d	d
Z
ddZed
dZ
ddZddZddZddZdS)developzSet up package for developmentz%install package in 'development mode')	uninstalluzUninstall this source package)z	egg-path=Nz-Set the path to be used in the .egg-link filer	FcCs2|jrd|_||n||dS)NT)r	Z
multi_versionuninstall_linkZuninstall_namespacesinstall_for_developmentZwarn_deprecated_options)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/develop.pyruns
zdevelop.runcCs&d|_d|_t|d|_d|_dS)N.)r	egg_pathrinitialize_options
setup_pathZalways_copy_from)r
rrrr%s

zdevelop.initialize_optionscCs|d}|jr,d}|j|jf}t|||jg|_t|||	|j
td|jd}t
j|j||_|j|_|jdkrt
j|j|_t|j}tt
j|j|j}||krtd|tj|t|t
j|j|jd|_||j|j|j|_dS)Negg_infoz-Please rename %r to %r before using 'develop'z*.eggz	.egg-linkzA--egg-path must be a relative path from the install directory to )project_name)get_finalized_commandZbroken_egg_inforregg_nameargsrfinalize_optionsexpand_basedirsexpand_dirsZ
package_indexscanglobospathjoininstall_diregg_linkegg_baserabspath
pkg_resourcesnormalize_pathrDistributionPathMetadatadist_resolve_setup_pathr)r
eitemplaterZegg_link_fntargetrrrrr,s<




zdevelop.finalize_optionscCsn|tjdd}|tjkr0d|dd}ttj	|||}|ttjkrjt
d|ttj|S)z
        Generate a path from egg_base back to '.' where the
        setup script resides and ensure that path points to the
        setup path from $install_dir/$egg_path.
        /z../zGCan't get a consistent path to setup script from installation directory)replacerseprstripcurdircountr&r'r r!r)r$r"rZ
path_to_setupZresolvedrrrr+Ws
zdevelop._resolve_setup_pathc	Cs|d|jddd|dtjr:|tjdt_|td|j|j	|j
st|jd}||j
d|jWdQRX|d|j|jdS)Nr	build_extr0)ZinplacezCreating %s (link to %s)w
)run_commandreinitialize_command
setuptoolsZbootstrap_install_fromrZinstall_namespacesrinfor#r$dry_runopenwriterrZprocess_distributionr*no_deps)r
frrrrms

 zdevelop.install_for_developmentcCstj|jrztd|j|jt|j}dd|D}|||j	g|j	|j
gfkrhtd|dS|jszt
|j|js||j|jjrtddS)NzRemoving %s (link to %s)cSsg|]}|qSr)r3).0linerrr
sz*develop.uninstall_link..z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)rr existsr#rr<r$r>closerrwarnr=unlinkZ
update_pthr*distributionscripts)r
Z
egg_link_filecontentsrrrrs
zdevelop.uninstall_linkc
Cs||jk	rt||S||x^|jjp,gD]N}tjt	|}tj
|}t|}|
}WdQRX|||||q.WdS)N)r*rinstall_egg_scriptsinstall_wrapper_scriptsrIrJrr r%rbasenameior>readZinstall_script)r
r*script_nameZscript_pathstrmscript_textrrrrLs

zdevelop.install_egg_scriptscCst|}t||S)N)VersionlessRequirementrrM)r
r*rrrrMszdevelop.install_wrapper_scriptsN)__name__
__module____qualname____doc__descriptionruser_optionsboolean_optionsZcommand_consumes_argumentsrrrstaticmethodr+rrrLrMrrrrrs	+rc@s(eZdZdZddZddZddZdS)	rTa
    Adapt a pkg_resources.Distribution to simply return the project
    name as the 'requirement' so that scripts will work across
    multiple versions.

    >>> from pkg_resources import Distribution
    >>> dist = Distribution(project_name='foo', version='1.0')
    >>> str(dist.as_requirement())
    'foo==1.0'
    >>> adapted_dist = VersionlessRequirement(dist)
    >>> str(adapted_dist.as_requirement())
    'foo'
    cCs
||_dS)N)_VersionlessRequirement__dist)r
r*rrr__init__szVersionlessRequirement.__init__cCst|j|S)N)getattrr])r
namerrr__getattr__sz"VersionlessRequirement.__getattr__cCs|jS)N)r)r
rrras_requirementsz%VersionlessRequirement.as_requirementN)rUrVrWrXr^rarbrrrrrTs
rT)distutils.utilr	distutilsrdistutils.errorsrrrrrOr&Zsetuptools.command.easy_installrr;rZDevelopInstallerrrTrrrrsPK!,'command/__pycache__/test.cpython-37.pycnu[B

Re@sddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZGdd	d	eZGd
ddZGdd
d
eZdS)N)DistutilsErrorDistutilsOptionError)log)
TestLoader)resource_listdirresource_existsnormalize_pathworking_setevaluate_markeradd_activation_listenerrequire
EntryPoint)Command)unique_everseenc@seZdZddZdddZdS)ScanningLoadercCst|t|_dS)N)r__init__set_visited)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs||jkrdS|j|g}|t||t|drH||t|drxpt|jdD]`}|	dr|dkr|jd|dd}n"t
|j|d	r`|jd|}nq`|||q`Wt|d
kr|
|S|dSdS)aReturn a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        Nadditional_tests__path__z.pyz__init__.py.z/__init__.pyr)raddappendrloadTestsFromModulehasattrrr__name__endswithrZloadTestsFromNamelenZ
suiteClass)rmodulepatterntestsfile	submodulerrrrs$



z"ScanningLoader.loadTestsFromModule)N)r!
__module____qualname__rrrrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs
||_dS)N)fget)rr,rrrrBszNonDataProperty.__init__NcCs|dkr|S||S)N)r,)robjZobjtyperrr__get__EszNonDataProperty.__get__)N)r!r)r*rr.rrrrr+Asr+c@seZdZdZdZdddgZddZdd	Zed
dZ	dd
Z
ddZej
gfddZeej
ddZeddZddZddZeddZeddZdS)testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated))ztest-module=mz$Run 'test_suite' in specified module)ztest-suite=sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=rzTest runner to usecCsd|_d|_d|_d|_dS)N)
test_suitetest_moduletest_loadertest_runner)rrrrinitialize_optionsZsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n|jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz.test_suiter5z&setuptools.command.test:ScanningLoaderr6)r3r4rdistributionr5getattrr6)rmsgrrrfinalize_options`s




ztest.finalize_optionscCst|S)N)list
_test_args)rrrr	test_argsssztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)Zdiscoverz	--verbose)r3sysversion_infoverbose)rrrrr=wsztest._test_argsc	Cs||WdQRXdS)zI
        Backward compatibility for project_on_sys_path context.
        N)project_on_sys_path)rfuncrrrwith_project_on_sys_paths
ztest.with_project_on_sys_pathc
cs|d|jddd|d|d}tjdd}tj}zbt|j}tj	d|t
tddt
d|j|jf||gdVWdQRXWd|tjdd<tjtj|t
XdS)	Negg_info	build_extr)ZinplacercSs|S)N)activate)distrrrz*test.project_on_sys_path..z%s==%s)run_commandreinitialize_commandget_finalized_commandrApathmodulescopyrZegg_baseinsertr	rrregg_nameZegg_versionpaths_on_pythonpathclearupdate)rZ
include_distsZei_cmdold_pathZold_modulesZproject_pathrrrrDs$





ztest.project_on_sys_pathc
cst}tjd|}tjdd}zBtjt|}td||g}tj|}|r\|tjd<dVWd||kr~tjddn
|tjd<XdS)z
        Add the indicated paths to the head of the PYTHONPATH environment
        variable so that subprocesses will also see the packages at
        these paths.

        Do this in a context that restores the value on exit.
        
PYTHONPATHrN)	objectosenvirongetpathsepjoinrfilterpop)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrrUs


ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        css0|](\}}|drt|ddr|VqdS):rN)
startswithr
).0kvrrr	sz%test.install_dists..)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_requireitems	itertoolschain)rJZir_dZtr_dZer_drrr
install_distssztest.install_distsc
Cs|dtj||j}d|j}|jr>|d|dS|d|tt	
d|}||"||
WdQRXWdQRXdS)NzWARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox. zskipping "%s" (dry run)zrunning "%s"location)announcerWARNrnr8r__argvdry_runmapoperator
attrgetterrUrD	run_tests)rZinstalled_distscmdrbrrrruns
ztest.runcCsVtjdd|j||j||jdd}|jsRd|j}||t	j
t|dS)NF)Z
testLoaderZ
testRunnerexitzTest failed: %s)unittestmainrs_resolve_as_epr5r6resultZ
wasSuccessfulrqrERRORr)rr/r:rrrrxs



ztest.run_testscCsdg|jS)Nr|)r>)rrrrrssz
test._argvcCs$|dkrdStd|}|S)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Nzx=)r
parseresolve)valparsedrrrr~sztest._resolve_as_epN)r!r)r*__doc__descriptionuser_optionsr7r;r+r>r=rF
contextlibcontextmanagerrDstaticmethodrUrnrzrxpropertyrsr~rrrrr/Ks&r/)r[rvrArrlr|distutils.errorsrr	distutilsrr
pkg_resourcesrrrr	r
rrr

setuptoolsrZ setuptools.extern.more_itertoolsrrr+r/rrrrs(
(
PK!N,W	W	(command/__pycache__/alias.cpython-37.pycnu[B

ReM	@sDddlmZddlmZmZmZddZGdddeZddZd	S)
)DistutilsOptionError)edit_configoption_baseconfig_filecCs8xdD]}||krt|SqW||gkr4t|S|S)z4Quote an argument for later parsing by shlex.split())"'\#)reprsplit)argcr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/alias.pyshquotes
rc@sHeZdZdZdZdZdgejZejdgZddZ	dd	Z
d
dZdS)
aliasz3Define a shortcut that invokes one or more commandsz0define a shortcut to invoke one or more commandsT)removerzremove (unset) the aliasrcCst|d|_d|_dS)N)rinitialize_optionsargsr)selfrrrrs
zalias.initialize_optionscCs*t||jr&t|jdkr&tddS)NzFMust specify exactly one argument (the alias name) when using --remove)rfinalize_optionsrlenrr)rrrrr!s
zalias.finalize_optionscCs|jd}|jsDtdtdx|D]}tdt||q(WdSt|jdkr|j\}|jrfd}q||krtdt||dStd|dSn$|jd}dtt	|jdd}t
|jd||ii|jdS)	NaliaseszCommand Aliasesz---------------zsetup.py aliasrz No alias definition found for %rr )
distributionget_option_dictrprintformat_aliasrrjoinmaprrfilenamedry_run)rrrcommandrrrrun)s&

z	alias.runN)__name__
__module____qualname____doc__descriptionZcommand_consumes_argumentsruser_optionsboolean_optionsrrr%rrrrrsrcCsZ||\}}|tdkrd}n,|tdkr0d}n|tdkrBd}nd|}||d|S)	Nglobalz--global-config userz--user-config localz
--filename=%rr)r)namersourcer$rrrrDsrN)	distutils.errorsrZsetuptools.command.setoptrrrrrrrrrrs
4PK!	33,command/__pycache__/bdist_egg.cpython-37.pycnu[B

Re@@s"dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZmZddlmZddlmZdd	lmZmZd
dZdd
ZddZddZGdddeZedZ ddZ!ddZ"ddZ#dddZ$ddZ%d d!Z&d"d#Z'd$d%d&d'gZ(d,d*d+Z)dS)-z6setuptools.command.bdist_egg

Build .egg distributions)remove_treemkpath)log)CodeTypeN)get_build_platformDistributionensure_directory)Library)Command)get_pathget_python_versioncCstdS)Npurelib)rrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/bdist_egg.py_get_purelibsrcCs2d|krtj|d}|dr.|dd}|S)N.rmodulei)ospathsplitextendswith)filenamerrrstrip_modules

rccs:x4t|D]&\}}}|||||fVqWdS)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)rwalksort)dirbasedirsfilesrrrsorted_walk!src	Cs6td}t|d}|||WdQRXdS)Na
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, importlib.util
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __loader__ = None; del __bootstrap__, __loader__
            spec = importlib.util.spec_from_file_location(__name__,__file__)
            mod = importlib.util.module_from_spec(spec)
            spec.loader.exec_module(mod)
        __bootstrap__()
        w)textwrapdedentlstripopenwrite)resourcepyfileZ_stub_templatefrrr
write_stub+s

r)c@seZdZdZddddefdddd	gZd
ddgZd
dZddZddZ	ddZ
ddZddZddZ
ddZddZdd Zd!d"Zd#S)$	bdist_eggzcreate an "egg" distribution)z
bdist-dir=bz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))zexclude-source-filesNz+remove all .py files from the generated egg)z	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=dz-directory to put final built distributions in)z
skip-buildNz2skip rebuilding everything (for testing/debugging)z	keep-tempz
skip-buildzexclude-source-filescCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)	bdist_dir	plat_name	keep_tempdist_dir
skip_build
egg_outputexclude_source_files)selfrrrinitialize_optionsRszbdist_egg.initialize_optionscCs|d}|_|j|_|jdkr>|dj}tj|d|_|jdkrPt	|_|
dd|jdkrtdd|j
|jt|jo|j
}tj|j|d|_dS)Negg_infobdistZegg)r2r2z.egg)get_finalized_commandei_cmdr8r/
bdist_baserrjoinr0rset_undefined_optionsr4regg_nameZegg_versionrdistributionhas_ext_modulesr2)r6r;r<basenamerrrfinalize_options[s


zbdist_egg.finalize_optionscCs|j|d_tjtjt}|jj	g}|j_	x|D]}t
|trt|dkrtj
|drtj|d}tj|}||ks||tjr|t|dd|df}|jj	|q.+)\.(?P[^.]+)\.pycnamez.pyczRenaming file from [%s] to [%s])rrUwalk_eggr/rrr=rdebugryrematchpardirgroupremoveOSErrorrename)
r6rrrrrZpath_oldpatternmZpath_newrrrr~s*




zbdist_egg.zap_pyfilescCs2t|jdd}|dk	r|Stdt|j|jS)Nr{z4zip_safe flag not set; analyzing archive contents...)rr@rr}analyze_eggr/rr)r6saferrrr{s

zbdist_egg.zip_safecCsdS)Nr r)r6rrrrszbdist_egg.gen_headercCsltj|j}tj|d}xJ|jjjD]<}||r(tj||t	|d}t
||||q(WdS)z*Copy metadata (egg info) to the target_dirN)rrnormpathr8r=r;filelistrrRrPr	copy_file)r6
target_dirZ
norm_egg_infoprefixrtargetrrrrvs
zbdist_egg.copy_metadata_tocCsg}g}|jdi}x|t|jD]n\}}}x6|D].}tj|dtkr.||||q.Wx*|D]"}|||d|tj||<qfWqW|j	
r|d}xd|jD]Z}	t
|	trq||	j}
||
}tj|dstjtj|j|r||qW||fS)zAGet a list of relative paths to C extensions in the output distrorrFrg	build_extzdl-)r/rrrrlowerNATIVE_EXTENSIONSrTr=r@rAr:
extensionsrNr	Zget_ext_fullnamerZget_ext_filenamerBrRr|)r6rrpathsrrrrZ	build_cmdrfullnamerrrrqs(


&


zbdist_egg.get_ext_outputsN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsr7rCr[r\rVrr~r{rrvrqrrrrr*;s(
	
Qr*z.dll .so .dylib .pydccsLt|}t|\}}}d|kr(|d|||fVx|D]
}|Vq:WdS)z@Walk an unpacked egg's contents, skipping the metadata directoryzEGG-INFON)rnextr)egg_dirwalkerrrrZbdfrrrr:s

rc	Csx0tD]$\}}tjtj|d|r
|Sq
Wts.visit)compression)zipfilerrrrcrrUZIP_DEFLATED
ZIP_STOREDZipFilerrw)
zip_filenamerrmr]compressrnrrrrrcrrr)rr]rrs	
r)rrTr )*__doc__distutils.dir_utilrr	distutilsrtypesrrrrr!r
pkg_resourcesrrrZsetuptools.extensionr	
setuptoolsr
	sysconfigrrrrrr)r*rrsplitrrrrzrrrrr^rrrrrs<
}"
PK!T(command/__pycache__/sdist.cpython-37.pycnu[B

Re@sxddlmZddlmmZddlZddlZddlZddl	Z	ddl
mZddlZe
Zd
ddZGdd	d	eejZdS))logN)sdist_add_defaultsccs4x.tdD] }x||D]
}|VqWqWdS)z%Find all files under revision controlzsetuptools.file_findersN)
pkg_resourcesiter_entry_pointsload)dirnameepitemr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/sdist.pywalk_revctrlsrcseZdZdZdddddgZiZddd	d
gZeddeDZd
dZ	ddZ
ddZddZe
ejddZfddZddZddZddZfdd Zd!d"Zd#d$Zd%d&Zd'd(ZZS))sdistz=Smart sdist that finds anything supported by revision control)zformats=Nz6formats for source distribution (comma-separated list))z	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]rz.rstz.txtz.mdccs|]}d|VqdS)z	README{0}N)format).0extrrr
	+szsdist.cCs|d|d}|j|_|jtj|jd|x|	D]}||qFW|
t|jdg}x*|j
D] }dd|f}||krv||qvWdS)Negg_infozSOURCES.txt
dist_filesrr)run_commandget_finalized_commandfilelistappendospathjoinrcheck_readmeget_sub_commandsmake_distributiongetattrdistributionZ
archive_files)selfZei_cmdcmd_namerfiledatarrr
run-s


z	sdist.runcCstj||dS)N)origrinitialize_options_default_to_gztar)r&rrr
r,@szsdist.initialize_optionscCstjdkrdSdg|_dS)N)rbetargztar)sysversion_infoformats)r&rrr
r-Es
zsdist._default_to_gztarc	Cs$|tj|WdQRXdS)z%
        Workaround for #516
        N)_remove_os_linkr+rr#)r&rrr
r#Ks
zsdist.make_distributionc
cs^Gddd}ttd|}yt`Wntk
r6YnXz
dVWd||k	rXttd|XdS)zG
        In a context, remove and restore os.link if it exists
        c@seZdZdS)z&sdist._remove_os_link..NoValueN)__name__
__module____qualname__rrrr
NoValueYsr9linkN)r$rr:	Exceptionsetattr)r9Zorig_valrrr
r5Rs
zsdist._remove_os_linkcs&ttjdr"|jddS)Nzpyproject.toml)super_add_defaults_optionalrrisfilerr)r&)	__class__rr
r>gs
zsdist._add_defaults_optionalcCs8|jr4|d}|j||||dS)zgetting python filesbuild_pyN)r%has_pure_modulesrrextendZget_source_files_add_data_files_safe_data_files)r&rArrr
_add_defaults_pythonls

zsdist._add_defaults_pythoncCs|jjrdS|jS)z
        Extracting data_files from build_py is known to cause
        infinite recursion errors when `include_package_data`
        is enabled, so suppress it in that case.
        r)r%Zinclude_package_data
data_files)r&rArrr
rEsszsdist._safe_data_filescCs|jdd|DdS)zA
        Add data files as found in build_py.data_files.
        css.|]&\}}}}|D]}tj||VqqdS)N)rrr )r_src_dir	filenamesnamerrr
rs
z(sdist._add_data_files..N)rrC)r&rGrrr
rD}szsdist._add_data_filescs2ytWntk
r,tdYnXdS)Nz&data_files contains unexpected objects)r=_add_defaults_data_files	TypeErrorrwarn)r&)r@rr
rLszsdist._add_defaults_data_filescCs:x4|jD]}tj|rdSqW|dd|jdS)Nz,standard file not found: should have one of z, )READMESrrexistsrNr )r&frrr
r!szsdist.check_readmecCs^tj|||tj|d}ttdrJtj|rJt||	d||
d|dS)Nz	setup.cfgr:r)r+rmake_release_treerrr hasattrrPunlink	copy_filerZsave_version_info)r&base_dirfilesdestrrr
rRs
zsdist.make_release_treec	Cs@tj|jsdSt|jd}|}WdQRX|dkS)NFrbz+# file GENERATED by distutils, do NOT edit
)rrr?manifestioopenreadlineencode)r&fp
first_linerrr
_manifest_is_not_generatedsz sdist._manifest_is_not_generatedc	Cstd|jt|jd}xd|D]\}y|d}Wn$tk
rVtd|w YnX|}|ds |spq |j	
|q W|dS)zRead the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'rYzUTF-8z"%r not UTF-8 decodable -- skipping#N)rinforZr\decodeUnicodeDecodeErrorrNstrip
startswithrrclose)r&rZlinerrr

read_manifests
zsdist.read_manifest)r6r7r8__doc__user_optionsnegative_optZREADME_EXTENSIONStuplerOr*r,r-r#staticmethod
contextlibcontextmanagerr5r>rFrErDrLr!rRrarj
__classcell__rr)r@r
rs0




r)r)	distutilsrZdistutils.command.sdistcommandrr+rr2r[rpZ
py36compatrrlistZ_default_revctrlrrrrr
s
PK!0966.command/__pycache__/install_lib.cpython-37.pycnu[B

Re#@sHddlZddlZddlmZmZddlmmZGdddejZdS)N)productstarmapc@sZeZdZdZddZddZddZedd	Zd
dZ	edd
Z
dddZddZdS)install_libz9Don't add compiled flags to filenames of non-Python filescCs&||}|dk	r"||dS)N)buildinstallbyte_compile)selfoutfilesr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/install_lib.pyrun
szinstall_lib.runcs4fddD}t|}ttj|S)z
        Return a collections.Sized collections.Container of paths to be
        excluded for single_version_externally_managed installations.
        c3s"|]}|D]
}|VqqdS)N)
_all_packages).0Zns_pkgpkg)rr
r	sz-install_lib.get_exclusions..)_get_SVEM_NSPsr_gen_exclusion_pathssetr_exclude_pkg_path)rZall_packagesZ
excl_specsr
)rrget_exclusionss
zinstall_lib.get_exclusionscCs$|d|g}tjj|jf|S)zw
        Given a package name and exclusion path within that package,
        compute the full exclusion path.
        .)splitospathjoinZinstall_dir)rrZexclusion_pathpartsr
r
rrszinstall_lib._exclude_pkg_pathccs$x|r|V|d\}}}qWdS)zn
        >>> list(install_lib._all_packages('foo.bar.baz'))
        ['foo.bar.baz', 'foo.bar', 'foo']
        rN)
rpartition)pkg_namesepchildr
r
rr
'szinstall_lib._all_packagescCs,|jjsgS|d}|j}|r(|jjSgS)z
        Get namespace packages (list) but only for
        single_version_externally_managed installations and empty otherwise.
        r)distributionZnamespace_packagesget_finalized_commandZ!single_version_externally_managed)rZinstall_cmdZsvemr
r
rr1s

zinstall_lib._get_SVEM_NSPsccsbdVdVdVttds dStjddtjj}|dV|d	V|d
V|dVdS)zk
        Generate file paths to be excluded for namespace packages (bytecode
        cache files).
        z__init__.pyz__init__.pycz__init__.pyoimplementationN__pycache__z	__init__.z.pycz.pyoz
.opt-1.pycz
.opt-2.pyc)hasattrsysrrrr"	cache_tag)baser
r
rrAs



z install_lib._gen_exclusion_pathsrc	sh|r|r|rt|s,tj|||Sddlm}ddlmgfdd}||||S)Nr)unpack_directory)logcs<|krd|dSd|tj|||S)Nz/Skipping installation of %s (namespace package)Fzcopying %s -> %s)warninforrdirnameappend)srcdst)excluder*r	r
rpfhs
z!install_lib.copy_tree..pf)	AssertionErrorrorigr	copy_treeZsetuptools.archive_utilr)	distutilsr*)	rinfileoutfile
preserve_modepreserve_timespreserve_symlinkslevelr)r2r
)r1r*r	rr5Ws
zinstall_lib.copy_treecs.tj|}|r*fdd|DS|S)Ncsg|]}|kr|qSr
r
)rf)r1r
r
ysz+install_lib.get_outputs..)r4rget_outputsr)routputsr
)r1rr?us
zinstall_lib.get_outputsN)r(r(rr()
__name__
__module____qualname____doc__rrrstaticmethodr
rrr5r?r
r
r
rrs

r)	rr%	itertoolsrrZdistutils.command.install_libcommandrr4r
r
r
rsPK!ˡB+command/__pycache__/saveopts.cpython-37.pycnu[B

Re@s$ddlmZmZGdddeZdS))edit_configoption_basec@seZdZdZdZddZdS)saveoptsz#Save command-line options to a filez7save supplied options to setup.cfg or other config filecCsp|j}i}xP|jD]F}|dkr qx6||D]$\}\}}|dkr0|||i|<q0WqWt|j||jdS)Nrzcommand line)distributioncommand_optionsget_option_dictitems
setdefaultrfilenamedry_run)selfdistsettingscmdoptsrcvalr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/saveopts.pyrun	szsaveopts.runN)__name__
__module____qualname____doc__descriptionrrrrrrsrN)Zsetuptools.command.setoptrrrrrrrsPK!MOO+command/__pycache__/build_py.cpython-37.pycnu[B

ReT @sddlmZddlmZddlmmZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlZddlmZddZGdddejZd	d
ZdS))glob)convert_pathN)unique_everseencCst|t|jtjBdS)N)oschmodstatst_modeS_IWRITE)targetr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/build_py.py
make_writablesr
c@seZdZdZddZddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZeddZd S)!build_pyaXEnhanced 'build_py' command that includes data files with packages

    The data files are specified via a 'package_data' argument to 'setup()'.
    See 'setuptools.dist.Distribution' for more details.

    Also, this version of the 'build_py' command allows you to specify both
    'py_modules' and 'packages' in the same setup operation.
    cCs@tj||jj|_|jjp i|_d|jkr6|jd=g|_dS)N
data_files)origrfinalize_optionsdistributionpackage_dataexclude_package_data__dict___build_py__updated_files)selfrrrrs

zbuild_py.finalize_optionscCsN|js|jsdS|jr||jr4|||tjj|dddS)z?Build modules, packages, and copy data files to build directoryNr)Zinclude_bytecode)	
py_modulespackagesZ
build_modulesZbuild_packagesbuild_package_databyte_compilerrget_outputs)rrrrrun$szbuild_py.runcCs&|dkr||_|jStj||S)zlazily compute data filesr)_get_data_filesrrr__getattr__)rattrrrrr4s
zbuild_py.__getattr__cCs.tj||||\}}|r&|j|||fS)N)rrbuild_modulerappend)rmoduleZmodule_filepackageoutfilecopiedrrrr!;szbuild_py.build_modulecCs|tt|j|jpdS)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr)analyze_manifestlistmap_get_pkg_data_filesr)rrrrrAszbuild_py._get_data_filescsJ||tjj|jg|d}fdd||D}|||fS)N.csg|]}tj|qSr)rpathrelpath).0file)src_dirrr
Osz0build_py._get_pkg_data_files..)get_package_dirrr,join	build_libsplitfind_data_files)rr$	build_dir	filenamesr)r0rr*Fs


zbuild_py._get_pkg_data_filescCsX||j||}tt|}tj|}ttj	j
|}t|j|g|}|
|||S)z6Return filenames for package's data files in 'src_dir')_get_platform_patternsrr)r	itertoolschain
from_iterablefilterrr,isfilemanifest_filesgetexclude_data_files)rr$r0patternsZglobs_expandedZ
globs_matchesZ
glob_filesfilesrrrr6Ts
zbuild_py.find_data_filesc
Cs|xv|jD]l\}}}}x^|D]V}tj||}|tj|tj||}|||\}}	t|tj|}qWqWdS)z$Copy data files into build directoryN)	rrr,r3mkpathdirname	copy_filer
abspath)
rr$r0r7r8filenamer
srcfileoutfr&rrrres
zbuild_py.build_package_datacCsi|_}|jjsdSi}x$|jp$dD]}||t||<q&W|d|d}x|jj	D]}t
jt|\}}d}|}	x:|r||kr||kr|}t
j|\}}
t
j
|
|}qW||kr^|dr||	krq^|||g|q^WdS)Nregg_infoz.py)r?rZinclude_package_datarassert_relativer2run_commandget_finalized_commandfilelistrCrr,r5r3endswith
setdefaultr")rZmfZsrc_dirsr$Zei_cmdr,dfprevZoldfZdfrrrr'ps(


zbuild_py.analyze_manifestcCsdS)Nr)rrrrget_data_filesszbuild_py.get_data_filesc	Csy
|j|Stk
rYnXtj|||}||j|<|rF|jjsJ|Sx,|jjD]}||ksn||drTPqTW|St	|d}|
}WdQRXd|krtj
d|f|S)z8Check namespace packages' __init__ for declare_namespacer+rbNsdeclare_namespacezNamespace package problem: %s is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
")packages_checkedKeyErrorrr
check_packagerZnamespace_packages
startswithioopenread	distutilserrorsDistutilsError)rr$package_dirZinit_pypkgrScontentsrrrrYs&


zbuild_py.check_packagecCsi|_tj|dS)N)rWrrinitialize_options)rrrrrdszbuild_py.initialize_optionscCs0tj||}|jjdk	r,tj|jj|S|S)N)rrr2rZsrc_rootrr,r3)rr$resrrrr2szbuild_py.get_package_dircs\t||j||}fdd|D}tj|}t|fddD}tt|S)z6Filter filenames for package's data files in 'src_dir'c3s|]}t|VqdS)N)fnmatchr=)r.pattern)rCrr	sz.build_py.exclude_data_files..c3s|]}|kr|VqdS)Nr)r.fn)badrrrhs)r(r9rr:r;r<setr)rr$r0rCrBZmatch_groupsmatchesZkeepersr)rjrCrrAszbuild_py.exclude_data_filescs.t|dg||g}fdd|DS)z
        yield platform-specific path patterns (suitable for glob
        or fn_match) from a glob-based spec (such as
        self.package_data or self.exclude_package_data)
        matching package in src_dir.
        c3s |]}tjt|VqdS)N)rr,r3r)r.rg)r0rrrhsz2build_py._get_platform_patterns..)r:r;r@)specr$r0Zraw_patternsr)r0rr9s


zbuild_py._get_platform_patternsN)__name__
__module____qualname____doc__rrrr!rr*r6rr'rUrYrdr2rAstaticmethodr9rrrrrs rcCs:tj|s|Sddlm}td|}||dS)Nr)DistutilsSetupErrorz
        Error: setup script specifies an absolute path:

            %s

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.
        )rr,isabsdistutils.errorsrttextwrapdedentlstrip)r,rtmsgrrrrLsrL)rdistutils.utilrZdistutils.command.build_pycommandrrrrfrwr[rvr^r:rZ setuptools.extern.more_itertoolsrr
rLrrrrsEPK!8ZUZU+command/__pycache__/egg_info.cpython-37.pycnu[B

Reb@sdZddlmZddlmZddlmZddlm	Z	ddlZddlZddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZddlmZdd	lmZdd
lmZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%dd
l&m'Z'ddl(m)Z)ddlm*Z*ddZ+GdddZ,Gddde,eZ-GdddeZGdddeZ.ddZ/ddZ0ddZ1d d!Z2d"d#Z3d$d%Z4d&d'Z5d(d)Z6d3d+d,Z7d-d.Z8d/d0Z9Gd1d2d2e*Z:dS)4zUsetuptools.command.egg_info

Create a distribution's .egg-info directory and contents)FileList)DistutilsInternalError)convert_path)logN)Command)sdist)walk_revctrl)edit_config)	bdist_egg)parse_requirements	safe_name
parse_versionsafe_versionyield_lines
EntryPointiter_entry_pointsto_filename)glob)	packaging)SetuptoolsDeprecationWarningcCsd}|tjj}ttj}d|f}xt|D]\}}|t|dk}|dkrv|rd|d7}q4|d||f7}q4d}t|}	x:||	kr||}
|
dkr||d7}n|
d	kr||7}n|
d
kr|d}||	kr||dkr|d}||	kr||dkr|d}x&||	kr6||dkr6|d}qW||	krR|t|
7}nR||d|}d}
|ddkrd
}
|dd}|
t|7}
|d|
f7}|}n|t|
7}|d7}qW|s4||7}q4W|d7}tj|tj	tj
BdS)z
    Translate a file path glob like '*.txt' in to a regular expression.
    This differs from fnmatch.translate which allows wildcards to match
    directory separators. It also knows about '**/' which matches any number of
    directories.
    z[^%s]z**z.*z
(?:%s+%s)*r*?[!]^Nz[%s]z\Z)flags)splitospathsepreescape	enumeratelencompile	MULTILINEDOTALL)rpatchunksr"Z
valid_charcchunk
last_chunkiZ	chunk_lencharZinner_iinner
char_classr3/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/egg_info.pytranslate_pattern#sV




r5c@s@eZdZdZdZeddZddZddZdd	Z	ee	Z
dS)

InfoCommonNcCst|jS)N)rdistributionget_name)selfr3r3r4namezszInfoCommon.namecCst||jS)N)r
_maybe_tagr7get_version)r9r3r3r4tagged_version~szInfoCommon.tagged_versioncCs |jr||jr|S||jS)z
        egg_info may be called more than once for a distribution,
        in which case the version string already contains all tags.
        )vtagsendswith)r9versionr3r3r4r;szInfoCommon._maybe_tagcCs,d}|jr||j7}|jr(|td7}|S)Nrz-%Y%m%d)	tag_buildtag_datetimestrftime)r9r@r3r3r4tagss
zInfoCommon.tags)__name__
__module____qualname__rArBpropertyr:r=r;rEr>r3r3r3r4r6vs
r6c@seZdZdZddddgZdgZddiZdd	Zed
dZ	e	j
ddZ	d
dZddZdddZ
ddZddZddZddZddZdS) egg_infoz+create a distribution's .egg-info directory)z	egg-base=ezLdirectory containing .egg-info directories (default: top of the source tree))ztag-datedz0Add date stamp (e.g. 20050528) to version number)z
tag-build=bz-Specify explicit tag to add to version number)zno-dateDz"Don't include date stamp [default]ztag-datezno-datecCs"d|_d|_d|_d|_d|_dS)NF)egg_baseegg_namerJegg_versionbroken_egg_info)r9r3r3r4initialize_optionss
zegg_info.initialize_optionscCsdS)Nr3)r9r3r3r4tag_svn_revisionszegg_info.tag_svn_revisioncCsdS)Nr3)r9valuer3r3r4rTscCs0t}||d<d|d<t|t|ddS)z
        Materialize the value of date into the
        build tag. Install build keys in a deterministic order
        to avoid arbitrary reordering on subsequent builds.
        rArrB)rJN)collectionsOrderedDictrEr	dict)r9filenamerJr3r3r4save_version_infoszegg_info.save_version_infoc
CsT|j|_||_t|j}y6t|tjj}|r4dnd}t	t
||j|jfWn<tk
r}ztj
d|j|jf|Wdd}~XYnX|jdkr|jj}|pidtj|_|dt|jd|_|jtjkrtj|j|j|_d|jkr||j|jj_|jj}|dk	rP|j|jkrP|j|_t|j|_ d|j_dS)Nz%s==%sz%s===%sz2Invalid distribution name or version syntax: %s-%srrOz	.egg-info-)!r:rPr=rQr

isinstancerr@Versionlistr
ValueError	distutilserrorsDistutilsOptionErrorrOr7package_dirgetr curdirensure_dirnamerrJr!joincheck_broken_egg_infometadataZ
_patched_distkeylower_version_parsed_version)r9parsed_versionZ
is_versionspecrKdirspdr3r3r4finalize_optionss8



zegg_info.finalize_optionsFcCsL|r||||n4tj|rH|dkr>|s>td||dS||dS)aWrite `data` to `filename` or delete if empty

        If `data` is non-empty, this routine is the same as ``write_file()``.
        If `data` is empty but not ``None``, this is the same as calling
        ``delete_file(filename)`.  If `data` is ``None``, then this is a no-op
        unless `filename` exists, in which case a warning is issued about the
        orphaned file (if `force` is false), or deleted (if `force` is true).
        Nz$%s not set in setup(), but %s exists)
write_filer r!existsrwarndelete_file)r9whatrYdataforcer3r3r4write_or_delete_files	
zegg_info.write_or_delete_filecCs>td|||d}|js:t|d}|||dS)zWrite `data` to `filename` (if not a dry run) after announcing it

        `what` is used in a log message to identify what is being written
        to the file.
        zwriting %s to %szutf-8wbN)rinfoencodedry_runopenwriteclose)r9rwrYrxfr3r3r4rs
s


zegg_info.write_filecCs td||jst|dS)z8Delete `filename` (if not a dry run) after announcing itzdeleting %sN)rr|r~r unlink)r9rYr3r3r4rvszegg_info.delete_filecCs||jt|jd|jj}x@tdD]4}|j|d|}|||j	tj
|j|j	q,Wtj
|jd}tj
|r|
||dS)Nzegg_info.writers)	installerznative_libs.txt)mkpathrJr utimer7Zfetch_build_eggrrequireresolver:r!rgrtrvfind_sources)r9repwriternlr3r3r4runs 
zegg_info.runcCs4tj|jd}t|j}||_||j|_dS)z"Generate SOURCES.txt manifest filezSOURCES.txtN)	r r!rgrJmanifest_makerr7manifestrfilelist)r9Zmanifest_filenamemmr3r3r4r-s

zegg_info.find_sourcescCsT|jd}|jtjkr&tj|j|}tj|rPtd||j	|j	|_
||_	dS)Nz	.egg-infoaB------------------------------------------------------------------------------
Note: Your current .egg-info directory has a '-' in its name;
this will not work correctly with "setup.py develop".

Please rename %s to %s to correct this problem.
------------------------------------------------------------------------------)rPrOr rer!rgrtrrurJrR)r9Zbeir3r3r4rh5s

zegg_info.check_broken_egg_infoN)F)rFrGrHdescriptionuser_optionsboolean_optionsnegative_optrSrIrTsetterrZrrrzrsrvrrrhr3r3r3r4rJs$

1

rJc@s|eZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZdS)rc
	Cs||\}}}}|j|j|j|jt|j|t|j||j	|j
d}dddddddd	d}y||}Wn$tk
rtd
j
|dYnX|d}	|d
kr|g}|	r|fnd}
||}|d|g|	r|gng|x&|D]}||stj||f|
qWdS)N)includeexcludezglobal-includezglobal-excludezrecursive-includezrecursive-excludegraftprunez%warning: no files found matching '%s'z9warning: no previously-included files found matching '%s'z>warning: no files found matching '%s' anywhere in distributionzRwarning: no previously-included files matching '%s' found anywhere in distributionz:warning: no files found matching '%s' under directory '%s'zNwarning: no previously-included files matching '%s' found under directory '%s'z+warning: no directories found matching '%s'z6no previously-included directories found matching '%s'z/this cannot happen: invalid action '{action!s}')actionz
recursive->rrr3 )Z_parse_template_linerrglobal_includeglobal_exclude	functoolspartialrecursive_includerecursive_excluderrKeyErrorrformat
startswithdebug_printrgrru)
r9linerpatternsdirZdir_patternZ
action_mapZlog_mapZprocess_actionZaction_is_recursiveZextra_log_argsZlog_tmplpatternr3r3r4process_template_lineHsJ



zFileList.process_template_linecCsVd}xLtt|jdddD]2}||j|r|d|j||j|=d}qW|S)z
        Remove all files from the file list that match the predicate.
        Return True if any matching files were removed
        Frz
 removing T)ranger&filesr)r9	predicatefoundr/r3r3r4
_remove_filesszFileList._remove_filescCs$ddt|D}||t|S)z#Include files that match 'pattern'.cSsg|]}tj|s|qSr3)r r!isdir).0rr3r3r4
sz$FileList.include..)rextendbool)r9rrr3r3r4rs
zFileList.includecCst|}||jS)z#Exclude files that match 'pattern'.)r5rmatch)r9rrr3r3r4rszFileList.excludecCs8tj|d|}ddt|ddD}||t|S)zN
        Include all files anywhere in 'dir/' that match the pattern.
        z**cSsg|]}tj|s|qSr3)r r!r)rrr3r3r4rsz.FileList.recursive_include..T)	recursive)r r!rgrrr)r9rrZfull_patternrr3r3r4rs
zFileList.recursive_includecCs ttj|d|}||jS)zM
        Exclude any file anywhere in 'dir/' that match the pattern.
        z**)r5r r!rgrr)r9rrrr3r3r4rszFileList.recursive_excludecCs$ddt|D}||t|S)zInclude all files from 'dir/'.cSs"g|]}tj|D]}|qqSr3)r`rfindall)rZ	match_diritemr3r3r4rsz"FileList.graft..)rrr)r9rrr3r3r4rs
zFileList.graftcCsttj|d}||jS)zFilter out files from 'dir/'.z**)r5r r!rgrr)r9rrr3r3r4rszFileList.prunecsJ|jdkr|ttjd|fdd|jD}||t|S)z
        Include all files anywhere in the current directory that match the
        pattern. This is very inefficient on large file trees.
        Nz**csg|]}|r|qSr3)r)rr)rr3r4rsz+FileList.global_include..)allfilesrr5r r!rgrr)r9rrr3)rr4rs

zFileList.global_includecCsttjd|}||jS)zD
        Exclude all files anywhere that match the pattern.
        z**)r5r r!rgrr)r9rrr3r3r4rszFileList.global_excludecCs8|dr|dd}t|}||r4|j|dS)N
r)r?r
_safe_pathrappend)r9rr!r3r3r4rs


zFileList.appendcCs|jt|j|dS)N)rrfilterr)r9pathsr3r3r4rszFileList.extendcCstt|j|j|_dS)z
        Replace self.files with only safe paths

        Because some owners of FileList manipulate the underlying
        ``files`` attribute directly, this method must be called to
        repair those paths.
        N)r^rrr)r9r3r3r4_repairszFileList._repairc	Csd}t|}|dkr(td|dSt|d}|dkrNt||ddSy tj|shtj|rldSWn&tk
rt||t	
YnXdS)Nz!'%s' not %s encodable -- skippingz''%s' in unexpected encoding -- skippingFzutf-8T)
unicode_utilsfilesys_decoderruZ
try_encoder r!rtUnicodeEncodeErrorsysgetfilesystemencoding)r9r!Zenc_warnZu_pathZ	utf8_pathr3r3r4rs
zFileList._safe_pathN)rFrGrHrrrrrrrrrrrrrrr3r3r3r4rEsM



rc@sdeZdZdZddZddZddZdd	Zd
dZdd
Z	e
ddZddZddZ
ddZdS)rzMANIFEST.incCsd|_d|_d|_d|_dS)Nr)Zuse_defaultsrZ
manifest_onlyZforce_manifest)r9r3r3r4rSsz!manifest_maker.initialize_optionscCsdS)Nr3)r9r3r3r4rrszmanifest_maker.finalize_optionscCslt|_tj|js||tj|jr<|	|
||j|j
|dS)N)rrr r!rtrwrite_manifestadd_defaultstemplateZ
read_templateadd_license_filesprune_file_listsortZremove_duplicates)r9r3r3r4rs

zmanifest_maker.runcCst|}|tjdS)N/)rrreplacer r")r9r!r3r3r4_manifest_normalize&s
z"manifest_maker._manifest_normalizecsBjfddjjD}dj}tj|f|dS)zo
        Write the file list in 'self.filelist' to the manifest file
        named by 'self.manifest'.
        csg|]}|qSr3)r)rr)r9r3r4r2sz1manifest_maker.write_manifest..zwriting manifest file '%s'N)rrrrexecuters)r9rmsgr3)r9r4r*s

zmanifest_maker.write_manifestcCs||st||dS)N)_should_suppress_warningrru)r9rr3r3r4ru6s
zmanifest_maker.warncCstd|S)z;
        suppress missing-file warnings from sdist
        zstandard file .*not found)r#r)rr3r3r4r:sz'manifest_maker._should_suppress_warningcCst||j|j|j|jtt}|rB|j|nt	j
|jrX|t	j
drp|jd|
d}|j|jdS)Nzsetup.pyrJ)rrrrrrr^rrr r!rtZ
read_manifestget_finalized_commandrrJ)r9ZrcfilesZei_cmdr3r3r4rAs


zmanifest_maker.add_defaultscCs8|jjjpg}x|D]}td|qW|j|dS)Nzadding license file '%s')r7ri
license_filesrr|rr)r9rlfr3r3r4rSs

z manifest_maker.add_license_filescCsZ|d}|j}|j|j|j|ttj	}|jj
d|d|dddS)Nbuildz(^|z)(RCS|CVS|\.svn)r)Zis_regex)rr7get_fullnamerr
build_baser#r$r r"Zexclude_pattern)r9rbase_dirr"r3r3r4rZs

zmanifest_maker.prune_file_listN)rFrGrHrrSrrrrrrustaticmethodrrrrr3r3r3r4r
s
rc	Cs8d|}|d}t|d}||WdQRXdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    
zutf-8r{N)rgr}rr)rYcontentsrr3r3r4rsds

rsc	Cs|td||jsx|jj}|j|j|_}|j|j|_}z|	|j
Wd|||_|_Xt|jdd}t
|j
|dS)Nz
writing %sZzip_safe)rr|r~r7rirQr@rPr:write_pkg_inforJgetattrr
Zwrite_safety_flag)cmdbasenamerYriZoldverZoldnamesafer3r3r4rqsrcCstj|rtddS)NzsWARNING: 'depends.txt' is not used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)r r!rtrru)rrrYr3r3r4warn_depends_obsoletesrcCs,t|pd}dd}t||}||dS)Nr3cSs|dS)Nrr3)rr3r3r4	append_crsz&_write_requirements..append_cr)rmap
writelines)streamreqslinesrr3r3r4_write_requirementss
rcCsn|j}t}t||j|jp"i}x2t|D]&}|djft	t|||q.W|
d||dS)Nz
[{extra}]
requirements)r7ioStringIOrZinstall_requiresextras_requiresortedrrvarsrzgetvalue)rrrYdistrxrextrar3r3r4write_requirementss
rcCs,t}t||jj|d||dS)Nzsetup-requirements)rrrr7Zsetup_requiresrzr)rrrYrxr3r3r4write_setup_requirementssrcCs:tdd|jD}|d|dt|ddS)NcSsg|]}|dddqS).rr)r)rkr3r3r4rsz(write_toplevel_names..ztop-level namesr)rXfromkeysr7Ziter_distribution_namesrsrgr)rrrYpkgsr3r3r4write_toplevel_namessrcCst|||ddS)NT)	write_arg)rrrYr3r3r4
overwrite_argsrFcCsHtj|d}t|j|d}|dk	r4d|d}|||||dS)Nrr)r r!splitextrr7rgrz)rrrYryargnamerUr3r3r4rs
rcCs|jj}t|ts|dkr |}np|dk	rg}xXt|D]H\}}t|tspt||}dtt	t|
}|d||fq:Wd|}|d||ddS)Nrz	[%s]
%s

rzentry pointsT)
r7Zentry_pointsr\strritemsrparse_grouprgrvaluesrrz)rrrYrrxsectionrr3r3r4
write_entriess

rc	Cs^tdttjdrZtd2}x*|D]"}t	d|}|r*t
|dSq*WWdQRXdS)zd
    Get a -r### off of PKG-INFO Version in case this is an sdist of
    a subversion revision.
    z$get_pkg_info_revision is deprecated.zPKG-INFOzVersion:.*-r(\d+)\s*$rNr)warningsruEggInfoDeprecationWarningr r!rtrrr#rintgroup)rrrr3r3r4get_pkg_info_revisions
rc@seZdZdZdS)rz?Deprecated behavior warning for EggInfo, bypassing suppression.N)rFrGrH__doc__r3r3r3r4rsr)F);r	distutils.filelistrZ	_FileListdistutils.errorsrdistutils.utilrr`rrr r#rrrrCrV
setuptoolsrZsetuptools.command.sdistrrZsetuptools.command.setoptr	Zsetuptools.commandr

pkg_resourcesrrr
rrrrrZsetuptools.unicode_utilsrZsetuptools.globrZsetuptools.externrrr5r6rJrrsrrrrrrrrrrrr3r3r3r4sV(S1IW
	

PK!aу*command/__pycache__/install.cpython-37.pycnu[B

Re*@s|ddlmZddlZddlZddlZddlZddlmmZ	ddl
Z
e	jZGddde	jZdde	jjDej
e_dS))DistutilsArgErrorNc@seZdZdZejjddgZejjddgZdddfd	d
dfgZe	eZ
ddZd
dZddZ
ddZeddZddZdS)installz7Use easy_install to install the package, w/dependencies)zold-and-unmanageableNzTry not to use this!)z!single-version-externally-managedNz5used by system package builders to create 'flat' eggszold-and-unmanageablez!single-version-externally-managedinstall_egg_infocCsdS)NT)selfrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/install.pyzinstall.install_scriptscCsdS)NTr)rrrrrr	cCs*tdtjtj|d|_d|_dS)NzRsetup.py install is deprecated. Use build and pip and other standards-based tools.)	warningswarn
setuptoolsZSetuptoolsDeprecationWarningorigrinitialize_optionsold_and_unmanageable!single_version_externally_managed)rrrrr szinstall.initialize_optionscCs8tj||jrd|_n|jr4|js4|js4tddS)NTzAYou must specify --record or --root when building system packages)rrfinalize_optionsrootrrecordr)rrrrr,szinstall.finalize_optionscCs(|js|jrtj|Sd|_d|_dS)N)rrrrhandle_extra_path	path_file
extra_dirs)rrrrr7szinstall.handle_extra_pathcCs@|js|jrtj|S|ts4tj|n|dS)N)	rrrrrun_called_from_setupinspectcurrentframedo_egg_install)rrrrrAs
zinstall.runcCsz|dkr4d}t|tdkr0d}t|dSt|d}|dd\}t|}|jdd	}|d
kox|j	dkS)a
        Attempt to detect whether run() was called from setup() or by another
        command.  If called by setup(), the parent caller will be the
        'run_command' method in 'distutils.dist', and *its* caller will be
        the 'run_commands' method.  If called any other way, the
        immediate caller *might* be 'run_command', but it won't have been
        called by 'run_commands'. Return True in that case or if a call stack
        is unavailable. Return False otherwise.
        Nz4Call stack not available. bdist_* commands may fail.
IronPythonz6For best results, pass -X:Frames to enable call stack.T__name__rzdistutils.distrun_commands)
rrplatformpython_implementationrgetouterframesgetframeinfo	f_globalsgetfunction)Z	run_framemsgresZcallerinfoZ
caller_modulerrrrLs


zinstall._called_from_setupcCs|jd}||jd|j|jd}|d|_|jtd|	d|j
djg}tj
rp|dtj
||_|jdd	dt_
dS)
Neasy_installx)argsrr.z*.eggZ	bdist_eggrF)Zshow_deprecation)distributionget_command_classrrensure_finalizedZalways_copy_fromZ
package_indexscanglobrun_commandget_command_objZ
egg_outputr
Zbootstrap_install_frominsertr/r)rr-cmdr/rrrrgs
zinstall.do_egg_installN)r!
__module____qualname____doc__rruser_optionsboolean_optionsnew_commandsdict_ncrrrrstaticmethodrrrrrrrs


rcCsg|]}|dtjkr|qS)r)rrA).0r9rrr
srD)distutils.errorsrrr5rr#distutils.command.installcommandrrr
_installsub_commandsr?rrrrssPK!O		)command/__pycache__/rotate.cpython-37.pycnu[B

ReP@sTddlmZddlmZddlmZddlZddlZddlm	Z	Gddde	Z
dS))convert_path)log)DistutilsOptionErrorN)Commandc@s:eZdZdZdZdddgZgZddZdd	Zd
dZ	dS)
rotatezDelete older distributionsz2delete older distributions, keeping N newest files)zmatch=mzpatterns to match (required))z	dist-dir=dz%directory where the distributions are)zkeep=kz(number of matching distributions to keepcCsd|_d|_d|_dS)N)matchdist_dirkeep)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/rotate.pyinitialize_optionsszrotate.initialize_optionsc
Cs|jdkrtd|jdkr$tdyt|j|_Wn,tk
r`}ztd|Wdd}~XYnXt|jtrdd|jdD|_|dddS)	NzQMust specify one or more (comma-separated) match patterns (e.g. '.zip' or '.egg')z$Must specify number of files to keepz--keep must be an integercSsg|]}t|qSr)rstrip).0prrr
)sz+rotate.finalize_options..,bdist)rr)	r
rrint
ValueError
isinstancestrsplitset_undefined_options)r
errrfinalize_optionss

zrotate.finalize_optionscCs|dddlm}x|jD]}|jd|}|tj|j|}dd|D}|	|
tdt
||||jd}xD|D]<\}}td||jstj|rt|qt|qWqWdS)	Negg_infor)glob*cSsg|]}tj||fqSr)ospathgetmtime)rfrrrr4szrotate.run..z%d file(s) matching %szDeleting %s)run_commandr r
distributionget_namer"r#joinrsortreverserinfolenrdry_runisdirshutilrmtreeunlink)r
r patternfilestr%rrrrun-s 
z
rotate.runN)
__name__
__module____qualname____doc__descriptionuser_optionsboolean_optionsrrr6rrrrr
sr)distutils.utilr	distutilsrdistutils.errorsrr"r0
setuptoolsrrrrrrsPK!<::,command/__pycache__/bdist_rpm.cpython-37.pycnu[B

Re@s<ddlmmZddlZddlmZGdddejZdS)N)SetuptoolsDeprecationWarningc@s eZdZdZddZddZdS)	bdist_rpma
    Override the default bdist_rpm behavior to do the following:

    1. Run egg_info to ensure the name and version are properly calculated.
    2. Always run 'install' using --single-version-externally-managed to
       disable eggs in RPM distributions.
    cCs&tdt|dtj|dS)Nzjbdist_rpm is deprecated and will be removed in a future version. Use bdist_wheel (wheel packages) instead.egg_info)warningswarnrrun_commandorigrrun)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/bdist_rpm.pyr	s

z
bdist_rpm.runcCstj|}dd|D}|S)NcSs g|]}|ddddqS)zsetup.py install z5setup.py install --single-version-externally-managed z%setupz&%setup -n %{name}-%{unmangled_version})replace).0linerrr
sz-bdist_rpm._make_spec_file..)rr_make_spec_file)r
specrrrrszbdist_rpm._make_spec_fileN)__name__
__module____qualname____doc__r	rrrrrrsr)Zdistutils.command.bdist_rpmcommandrrr
setuptoolsrrrrrsPK!^Ǹ		-command/__pycache__/build_clib.cpython-37.pycnu[B

Re?@sLddlmmZddlmZddlmZddlm	Z	GdddejZdS)N)DistutilsSetupError)log)newer_pairwise_groupc@seZdZdZddZdS)
build_clibav
    Override the default build_clib behaviour to do the following:

    1. Implement a rudimentary timestamp-based dependency system
       so 'compile()' doesn't run every time.
    2. Add more keys to the 'build_info' dictionary:
        * obj_deps - specify dependencies for each object compiled.
                     this should be a dictionary mapping a key
                     with the source filename to a list of
                     dependencies. Use an empty string for global
                     dependencies.
        * cflags   - specify a list of additional flags to pass to
                     the compiler.
    c	Cs|xt|D]j\}}|d}|dks2t|ttfs>td|t|}td||dt}t|tsvtd|g}|dt}t|ttfstd|xX|D]P}|g}	|	|||t}
t|
ttfstd||	|
|	|	qW|j
j||jd}t
||ggfkr\|d}|d	}
|d
}|j
j||j||
||jd|j
j|||j|jdqWdS)
Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' libraryobj_depsz\in 'libraries' option (library '%s'), 'obj_deps' must be a dictionary of type 'source: list')
output_dirmacrosinclude_dirscflags)r	r
rZextra_postargsdebug)r	r
)get
isinstancelisttuplerrinfodictextendappendcompilerZobject_filenames
build_temprcompiler
Zcreate_static_libr)self	librariesZlib_nameZ
build_inforrZdependenciesZglobal_depssourceZsrc_depsZ
extra_depsZexpected_objectsr
rrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/build_clib.pybuild_librariessb









zbuild_clib.build_librariesN)__name__
__module____qualname____doc__rrrrrrsr)
Zdistutils.command.build_clibcommandrorigdistutils.errorsr	distutilsrZsetuptools.dep_utilrrrrrsPK!I.command/__pycache__/upload_docs.cpython-37.pycnu[B

Re2@sdZddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZddlmZd	d
ZGdddeZdS)
z|upload_docs

Implements a Distutils 'upload_docs' subcommand (upload documentation to
sites other than PyPi such as devpi).
)standard_b64encode)log)DistutilsOptionErrorN)iter_entry_points)uploadcCs|ddS)Nzutf-8surrogateescape)encode)sr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/upload_docs.py_encodesr
c@seZdZdZdZdddejfddgZejZdd	Zd
efgZ	ddZ
d
dZddZddZ
eddZeddZddZdS)upload_docszhttps://pypi.python.org/pypi/z;Upload documentation to sites other than PyPi such as devpizrepository=rzurl of repository [default: %s])z
show-responseNz&display full response text from server)zupload-dir=Nzdirectory to uploadcCs$|jdkr xtddD]}dSWdS)Nzdistutils.commandsbuild_sphinxT)
upload_dirr)selfeprrr
has_sphinx-s
zupload_docs.has_sphinxrcCst|d|_d|_dS)N)rinitialize_optionsr
target_dir)rrrrr4s
zupload_docs.initialize_optionscCst||jdkrV|r8|d}t|jd|_qh|d}tj	
|jd|_n|d|j|_d|j
kr|td|d|jdS)	NrhtmlbuildZdocsrzpypi.python.orgzt|d}|}WdQRX|jj}d|tj||fd}t|j	d|j
}t|d}d|}|
|\}}	d|j}
||
tjtj|j\}}}
}}}|s|s|rt|dkrtj|}n"|d	krtj|}ntd
|d}yZ||d|
|	}|d
||dtt||d||| |Wn8t!j"k
r}z|t|tj#dSd}~XYnX|$}|j%dkrd|j%|j&f}
||
tjnb|j%dkr|'d}|dkrd|}d|}
||
tjnd|j%|j&f}
||
tj#|j(r:t)d|ddS)NrbZ
doc_upload)z:actionr4content:rRzBasic zSubmitting documentation to %shttphttpszunsupported schema POSTzContent-typezContent-length
AuthorizationzServer response (%s): %si-ZLocationzhttps://pythonhosted.org/%s/zUpload successful. Visit %szUpload failed (%s): %szK---------------------------------------------------------------------------)*openreadr=r>r?rrbasenamer
usernamepasswordrdecoder`r!r#rINFOurllibparseurlparseAssertionErrorrdclientHTTPConnectionHTTPSConnectionconnect
putrequest	putheaderstrr)
endheaderssendsocketerrorERRORgetresponsestatusreason	getheader
show_responseprint)rr.frbmetar\credentialsauthbodyctmsgZschemanetlocurlparamsquery	fragmentsconnr_erlocationrrrr@s\


zupload_docs.upload_fileN)__name__
__module____qualname__DEFAULT_REPOSITORYdescriptionruser_optionsboolean_optionsrsub_commandsrrr8rDstaticmethodrQclassmethodr`r@rrrrrs 

r)__doc__base64r	distutilsrdistutils.errorsrrr~r%r;rArXrThttp.clientrdurllib.parserq
pkg_resourcesrrr
rrrrrs PK!+_vendor/__pycache__/__init__.cpython-37.pycnu[B

Re@sdS)Nrrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/__init__.pyPK!tGDD,_vendor/__pycache__/pyparsing.cpython-37.pycnu[B

Rexi@sdZdZdZdZddlZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZyddlmZWn ek
rddlmZYnXydd	lmZdd
lmZWn,ek
rdd	l
mZdd
l
mZYnXyddl
mZWnBek
rFyddlmZWnek
r@dZYnXYnXdd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtgiZee	jdduZeddukZ e rpe	j!Z"e#Z$e%Z&e#Z'e(e)e*e+e,ee-e.e/e0e1gZ2nbe	j3Z"e4Z5dvdwZ'gZ2ddl6Z6xBdx7D]6Z8ye29e:e6e8Wne;k
rwYnXqWeGd~dde?Z@ejAejBZCdZDeDdZEeCeDZFe%dZGdHddzejIDZJGdd#d#eKZLGdd%d%eLZMGdd'd'eLZNGdd)d)eNZOGdd,d,eKZPGddde?ZQGdd(d(e?ZReSeRdd?ZTddPZUddMZVddZWddZXddZYddWZZd/ddZ[Gdd*d*e?Z\Gdd2d2e\Z]Gddde]Z^Gddde]Z_Gddde]Z`e`Zae`e\_bGddde]ZcGddde`ZdGdd
d
ecZeGddrdre]ZfGdd5d5e]ZgGdd-d-e]ZhGdd+d+e]ZiGddde]ZjGdd4d4e]ZkGddde]ZlGdddelZmGdddelZnGdddelZoGdd0d0elZpGdd/d/elZqGdd7d7elZrGdd6d6elZsGdd&d&e\ZtGdddetZuGdd"d"etZvGdddetZwGdddetZxGdd$d$e\ZyGdddeyZzGdddeyZ{GdddeyZ|Gddde|Z}Gdd8d8e|Z~Gddde?ZeZGdd!d!eyZGdd.d.eyZGdddeyZGddÄdeZGdd3d3eyZGdddeZGdddeZGdddeZGdd1d1eZGdd d e?ZddhZd0ddFZd1ddBZddЄZddUZddTZddԄZd2ddYZddGZd3ddmZddnZddpZe^dIZendOZeodNZepdgZeqdfZegeGddd܍ddބZehd߃ddބZehdddބZeeBeBejdd{d܍BZeeedeZe`deddee}eeBddZddeZddSZddbZdd`ZddsZeddބZeddބZddZddQZddRZddkZe?e_d4ddqZe@Ze?e_e?e_ededfddoZeZeehdddZeehdddZeehddehddBdZeeadedZdddefddVZd5ddlZedZedZeegeCeFdd\ZZeed	7d
ZehddHeàġd
dZŐddaZeehdddZehddZehdɡdZehddZeehddeBdZeZehddZee}egeJdːdeegde`d˃eoϡdZeeeeBddd@ZGd dtdtZeӐd!kredd"Zedd#ZegeCeFd$Zee֐d%dՐd&eZeee׃d'Zؐd(eBZee֐d%dՐd&eZeeeڃd)ZeԐd*eِd'eeېd)Zeܠݐd+ejޠݐd,ejߠݐd,ejݐd-ddlZej᠝eejejݐd.dS(6a	
pyparsing module - Classes and methods to define and execute parsing grammars
=============================================================================

The pyparsing module is an alternative approach to creating and executing simple grammars,
vs. the traditional lex/yacc approach, or the use of regular expressions.  With pyparsing, you
don't need to learn a new syntax for defining grammars or matching expressions - the parsing module
provides a library of classes that you use to construct the grammar directly in Python.

Here is a program to parse "Hello, World!" (or any greeting of the form 
C{", !"}), built up using L{Word}, L{Literal}, and L{And} elements 
(L{'+'} operator gives L{And} expressions, strings are auto-converted to
L{Literal} expressions)::

    from pyparsing import Word, alphas

    # define grammar of a greeting
    greet = Word(alphas) + "," + Word(alphas) + "!"

    hello = "Hello, World!"
    print (hello, "->", greet.parseString(hello))

The program outputs the following::

    Hello, World! -> ['Hello', ',', 'World', '!']

The Python representation of the grammar is quite readable, owing to the self-explanatory
class names, and the use of '+', '|' and '^' operators.

The L{ParseResults} object returned from L{ParserElement.parseString} can be accessed as a nested list, a dictionary, or an
object with named attributes.

The pyparsing module handles some of the problems that are typically vexing when writing text parsers:
 - extra or missing whitespace (the above program will also handle "Hello,World!", "Hello  ,  World  !", etc.)
 - quoted strings
 - embedded comments


Getting Started -
-----------------
Visit the classes L{ParserElement} and L{ParseResults} to see the base classes that most other pyparsing
classes inherit from. Use the docstrings for examples of how to:
 - construct literal match expressions from L{Literal} and L{CaselessLiteral} classes
 - construct character word-group expressions using the L{Word} class
 - see how to create repetitive expressions using L{ZeroOrMore} and L{OneOrMore} classes
 - use L{'+'}, L{'|'}, L{'^'}, and L{'&'} operators to combine simple expressions into more complex ones
 - associate names with your parsed results using L{ParserElement.setResultsName}
 - find some helpful expression short-cuts like L{delimitedList} and L{oneOf}
 - find more useful common expressions in the L{pyparsing_common} namespace class
z2.2.1z18 Sep 2018 00:49 UTCz*Paul McGuire N)ref)datetime)RLock)Iterable)MutableMapping)OrderedDictAndCaselessKeywordCaselessLiteral
CharsNotInCombineDictEachEmpty
FollowedByForward
GoToColumnGroupKeywordLineEnd	LineStartLiteral
MatchFirstNoMatchNotAny	OneOrMoreOnlyOnceOptionalOrParseBaseExceptionParseElementEnhanceParseExceptionParseExpressionParseFatalExceptionParseResultsParseSyntaxException
ParserElementQuotedStringRecursiveGrammarExceptionRegexSkipTo	StringEndStringStartSuppressTokenTokenConverterWhiteWordWordEnd	WordStart
ZeroOrMore	alphanumsalphas
alphas8bitanyCloseTag
anyOpenTag
cStyleCommentcolcommaSeparatedListcommonHTMLEntitycountedArraycppStyleCommentdblQuotedStringdblSlashComment
delimitedListdictOfdowncaseTokensemptyhexnumshtmlCommentjavaStyleCommentlinelineEnd	lineStartlinenomakeHTMLTagsmakeXMLTagsmatchOnlyAtColmatchPreviousExprmatchPreviousLiteral
nestedExprnullDebugActionnumsoneOfopAssocoperatorPrecedence
printablespunc8bitpythonStyleCommentquotedStringremoveQuotesreplaceHTMLEntityreplaceWith
restOfLinesglQuotedStringsrange	stringEndstringStarttraceParseAction
unicodeStringupcaseTokens
withAttribute
indentedBlockoriginalTextForungroup
infixNotationlocatedExpr	withClass
CloseMatchtokenMappyparsing_commoncCs`t|tr|Syt|Stk
rZt|td}td}|dd|	|SXdS)aDrop-in replacement for str(obj) that tries to be Unicode friendly. It first tries
           str(obj). If that fails with a UnicodeEncodeError, then it tries unicode(obj). It
           then < returns the unicode object | encodes it with the default encoding | ... >.
        xmlcharrefreplacez&#\d+;cSs$dtt|dddddS)Nz\ur)hexint)trx/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.pyz_ustr..N)

isinstanceunicodestrUnicodeEncodeErrorencodesysgetdefaultencodingr)setParseActiontransformString)objretZ
xmlcharrefrxrxry_ustrs
rz6sum len sorted reversed list tuple set any all min maxccs|]
}|VqdS)Nrx).0yrxrxry	srcCs>d}dddD}x"t||D]\}}|||}q"W|S)z/Escape &, <, >, ", ', etc. in a string of data.z&><"'css|]}d|dVqdS)&;Nrx)rsrxrxryrsz_xml_escape..zamp gt lt quot apos)splitzipreplace)datafrom_symbols
to_symbolsfrom_to_rxrxry_xml_escapes
rc@seZdZdS)
_ConstantsN)__name__
__module____qualname__rxrxrxryrsr
0123456789ZABCDEFabcdef\ccs|]}|tjkr|VqdS)N)string
whitespace)rcrxrxryrsc@sPeZdZdZdddZeddZdd	Zd
dZdd
Z	dddZ
ddZdS)rz7base exception class for all parsing runtime exceptionsrNcCs>||_|dkr||_d|_n||_||_||_|||f|_dS)Nr)locmsgpstr
parserElementargs)selfrrrelemrxrxry__init__szParseBaseException.__init__cCs||j|j|j|jS)z
        internal factory method to simplify creating one type of ParseException 
        from another - avoids having __init__ signature conflicts among subclasses
        )rrrr)clsperxrxry_from_exceptionsz"ParseBaseException._from_exceptioncCsN|dkrt|j|jS|dkr,t|j|jS|dkrBt|j|jSt|dS)zsupported attributes by name are:
            - lineno - returns the line number of the exception text
            - col - returns the column number of the exception text
            - line - returns the line containing the exception text
        rL)r;columnrIN)rLrrr;rIAttributeError)ranamerxrxry__getattr__szParseBaseException.__getattr__cCsd|j|j|j|jfS)Nz"%s (at char %d), (line:%d, col:%d))rrrLr)rrxrxry__str__szParseBaseException.__str__cCst|S)N)r)rrxrxry__repr__szParseBaseException.__repr__>!} ('-' operator) indicates that parsing is to stop 
       immediately because an unbacktrackable syntax error has been foundN)rrrrrxrxrxryr%sc@s eZdZdZddZddZdS)r(zZexception thrown by L{ParserElement.validate} if the grammar could be improperly recursivecCs
||_dS)N)parseElementTrace)rparseElementListrxrxryr4sz"RecursiveGrammarException.__init__cCs
d|jS)NzRecursiveGrammarException: %s)r)rrxrxryr7sz!RecursiveGrammarException.__str__N)rrrrrrrxrxrxryr(2sc@s,eZdZddZddZddZddZd	S)
_ParseResultsWithOffsetcCs||f|_dS)N)tup)rp1p2rxrxryr;sz _ParseResultsWithOffset.__init__cCs
|j|S)N)r)rirxrxry__getitem__=sz#_ParseResultsWithOffset.__getitem__cCst|jdS)Nr)reprr)rrxrxryr?sz _ParseResultsWithOffset.__repr__cCs|jd|f|_dS)Nr)r)rrrxrxry	setOffsetAsz!_ParseResultsWithOffset.setOffsetN)rrrrrrrrxrxrxryr:src@seZdZdZd[ddZddddefddZdd	Zefd
dZdd
Z	ddZ
ddZddZeZ
ddZddZddZddZddZereZeZeZn$eZeZeZddZd d!Zd"d#Zd$d%Zd&d'Zd\d(d)Zd*d+Zd,d-Zd.d/Zd0d1Z d2d3Z!d4d5Z"d6d7Z#d8d9Z$d:d;Z%d} - see L{ParserElement.setResultsName})

    Example::
        integer = Word(nums)
        date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))
        # equivalent form:
        # date_str = integer("year") + '/' + integer("month") + '/' + integer("day")

        # parseString returns a ParseResults object
        result = date_str.parseString("1999/12/31")

        def test(s, fn=repr):
            print("%s -> %s" % (s, fn(eval(s))))
        test("list(result)")
        test("result[0]")
        test("result['month']")
        test("result.day")
        test("'month' in result")
        test("'minutes' in result")
        test("result.dump()", str)
    prints::
        list(result) -> ['1999', '/', '12', '/', '31']
        result[0] -> '1999'
        result['month'] -> '12'
        result.day -> '31'
        'month' in result -> True
        'minutes' in result -> False
        result.dump() -> ['1999', '/', '12', '/', '31']
        - day: 31
        - month: 12
        - year: 1999
    NTcCs"t||r|St|}d|_|S)NT)r|object__new___ParseResults__doinit)rtoklistnameasListmodalretobjrxrxryrks


zParseResults.__new__c
Csb|jrvd|_d|_d|_i|_||_||_|dkr6g}||trP|dd|_n||trft||_n|g|_t	|_
|dk	r^|r^|sd|j|<||trt|}||_||t
dttfr|ddgfks^||tr|g}|r(||trt|d||<ntt|dd||<|||_n6y|d||<Wn$tttfk
r\|||<YnXdS)NFrr)r_ParseResults__name_ParseResults__parent_ParseResults__accumNames_ParseResults__asList_ParseResults__modallist_ParseResults__toklist_generatorTypedict_ParseResults__tokdictrvrr
basestringr$rcopyKeyError	TypeError
IndexError)rrrrrr|rxrxryrtsB



$
zParseResults.__init__cCsPt|ttfr|j|S||jkr4|j|ddStdd|j|DSdS)NrtrcSsg|]}|dqS)rrx)rvrxrxry
sz,ParseResults.__getitem__..)r|rvslicerrrr$)rrrxrxryrs


zParseResults.__getitem__cCs||tr0|j|t|g|j|<|d}nD||ttfrN||j|<|}n&|j|tt|dg|j|<|}||trt||_	dS)Nr)
rrgetrrvrrr$wkrefr)rkrr|subrxrxry__setitem__s


"
zParseResults.__setitem__c
Cst|ttfrt|j}|j|=t|trH|dkr:||7}t||d}tt||}|x^|j	
D]F\}}x<|D]4}x.t|D]"\}\}}	t||	|	|k||<qWq|WqnWn|j	|=dS)Nrr)
r|rvrlenrrrangeindicesreverseritems	enumerater)
rrmylenremovedroccurrencesjrvaluepositionrxrxry__delitem__s


$zParseResults.__delitem__cCs
||jkS)N)r)rrrxrxry__contains__szParseResults.__contains__cCs
t|jS)N)rr)rrxrxry__len__r{zParseResults.__len__cCs
|jS)N)r)rrxrxry__bool__r{zParseResults.__bool__cCs
t|jS)N)iterr)rrxrxry__iter__r{zParseResults.__iter__cCst|jdddS)Nrt)rr)rrxrxry__reversed__r{zParseResults.__reversed__cCs$t|jdr|jSt|jSdS)Niterkeys)hasattrrrr)rrxrxry	_iterkeyss
zParseResults._iterkeyscsfddDS)Nc3s|]}|VqdS)Nrx)rr)rrxryrsz+ParseResults._itervalues..)r)rrx)rry_itervaluesszParseResults._itervaluescsfddDS)Nc3s|]}||fVqdS)Nrx)rr)rrxryrsz*ParseResults._iteritems..)r)rrx)rry
_iteritemsszParseResults._iteritemscCst|S)zVReturns all named result keys (as a list in Python 2.x, as an iterator in Python 3.x).)rr)rrxrxrykeysszParseResults.keyscCst|S)zXReturns all named result values (as a list in Python 2.x, as an iterator in Python 3.x).)r
itervalues)rrxrxryvaluesszParseResults.valuescCst|S)zfReturns all named result key-values (as a list of tuples in Python 2.x, as an iterator in Python 3.x).)r	iteritems)rrxrxryrszParseResults.itemscCs
t|jS)zSince keys() returns an iterator, this method is helpful in bypassing
           code that looks for the existence of any defined results names.)boolr)rrxrxryhaskeysszParseResults.haskeyscOs|s
dg}x6|D]*\}}|dkr2|d|f}qtd|qWt|dtsht|dksh|d|kr|d}||}||=|S|d}|SdS)a
        Removes and returns item at specified index (default=C{last}).
        Supports both C{list} and C{dict} semantics for C{pop()}. If passed no
        argument or an integer argument, it will use C{list} semantics
        and pop tokens from the list of parsed tokens. If passed a 
        non-integer argument (most likely a string), it will use C{dict}
        semantics and pop the corresponding value from any defined 
        results names. A second default return value argument is 
        supported, just as in C{dict.pop()}.

        Example::
            def remove_first(tokens):
                tokens.pop(0)
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            print(OneOrMore(Word(nums)).addParseAction(remove_first).parseString("0 123 321")) # -> ['123', '321']

            label = Word(alphas)
            patt = label("LABEL") + OneOrMore(Word(nums))
            print(patt.parseString("AAB 123 321").dump())

            # Use pop() in a parse action to remove named result (note that corresponding value is not
            # removed from list form of results)
            def remove_LABEL(tokens):
                tokens.pop("LABEL")
                return tokens
            patt.addParseAction(remove_LABEL)
            print(patt.parseString("AAB 123 321").dump())
        prints::
            ['AAB', '123', '321']
            - LABEL: AAB

            ['AAB', '123', '321']
        rtdefaultrz-pop() got an unexpected keyword argument '%s'rN)rrr|rvr)rrkwargsrrindexrdefaultvaluerxrxrypops"zParseResults.popcCs||kr||S|SdS)ai
        Returns named result matching the given key, or if there is no
        such name, then returns the given C{defaultValue} or C{None} if no
        C{defaultValue} is specified.

        Similar to C{dict.get()}.
        
        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            result = date_str.parseString("1999/12/31")
            print(result.get("year")) # -> '1999'
            print(result.get("hour", "not specified")) # -> 'not specified'
            print(result.get("hour")) # -> None
        Nrx)rkeydefaultValuerxrxryr3szParseResults.getcCsZ|j||xF|jD]8\}}x.t|D]"\}\}}t||||k||<q,WqWdS)a
        Inserts new element at location index in the list of parsed tokens.
        
        Similar to C{list.insert()}.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']

            # use a parse action to insert the parse location in the front of the parsed results
            def insert_locn(locn, tokens):
                tokens.insert(0, locn)
            print(OneOrMore(Word(nums)).addParseAction(insert_locn).parseString("0 123 321")) # -> [0, '0', '123', '321']
        N)rinsertrrrr)rrinsStrrrrrrrxrxryr
IszParseResults.insertcCs|j|dS)a
        Add single element to end of ParseResults list of elements.

        Example::
            print(OneOrMore(Word(nums)).parseString("0 123 321")) # -> ['0', '123', '321']
            
            # use a parse action to compute the sum of the parsed integers, and add it to the end
            def append_sum(tokens):
                tokens.append(sum(map(int, tokens)))
            print(OneOrMore(Word(nums)).addParseAction(append_sum).parseString("0 123 321")) # -> ['0', '123', '321', 444]
        N)rappend)ritemrxrxryr]szParseResults.appendcCs$t|tr||7}n|j|dS)a
        Add sequence of elements to end of ParseResults list of elements.

        Example::
            patt = OneOrMore(Word(alphas))
            
            # use a parse action to append the reverse of the matched strings, to make a palindrome
            def make_palindrome(tokens):
                tokens.extend(reversed([t[::-1] for t in tokens]))
                return ''.join(tokens)
            print(patt.addParseAction(make_palindrome).parseString("lskdj sdlkjf lksd")) # -> 'lskdjsdlkjflksddsklfjkldsjdksl'
        N)r|r$rextend)ritemseqrxrxryrks

zParseResults.extendcCs|jdd=|jdS)z7
        Clear all elements and results names.
        N)rrclear)rrxrxryr}szParseResults.clearcCsfy||Stk
rdSX||jkr^||jkrD|j|ddStdd|j|DSndSdS)NrrtrcSsg|]}|dqS)rrx)rrrxrxryrsz,ParseResults.__getattr__..)rrrr$)rrrxrxryrs

zParseResults.__getattr__cCs|}||7}|S)N)r)rotherrrxrxry__add__szParseResults.__add__cs|jrnt|jfdd|j}fdd|D}x4|D],\}}|||<t|dtr>t||d_q>W|j|j7_|j	|j|S)Ncs|dkrS|S)Nrrx)a)offsetrxryrzr{z'ParseResults.__iadd__..c	s4g|],\}}|D]}|t|d|dfqqS)rr)r)rrvlistr)	addoffsetrxryrsz)ParseResults.__iadd__..r)
rrrrr|r$rrrupdate)rr
otheritemsotherdictitemsrrrx)rrry__iadd__s


zParseResults.__iadd__cCs&t|tr|dkr|S||SdS)Nr)r|rvr)rrrxrxry__radd__szParseResults.__radd__cCsdt|jt|jfS)Nz(%s, %s))rrr)rrxrxryrszParseResults.__repr__cCsdddd|jDdS)N[z, css(|] }t|trt|nt|VqdS)N)r|r$rr)rrrxrxryrsz'ParseResults.__str__..])rr)rrxrxryrszParseResults.__str__rcCsPg}xF|jD]<}|r"|r"||t|tr:||7}q|t|qW|S)N)rrr|r$
_asStringListr)rsepoutrrxrxryr!s

zParseResults._asStringListcCsdd|jDS)a
        Returns the parse results as a nested list of matching tokens, all converted to strings.

        Example::
            patt = OneOrMore(Word(alphas))
            result = patt.parseString("sldkj lsdkj sldkj")
            # even though the result prints in string-like form, it is actually a pyparsing ParseResults
            print(type(result), result) # ->  ['sldkj', 'lsdkj', 'sldkj']
            
            # Use asList() to create an actual list
            result_list = result.asList()
            print(type(result_list), result_list) # ->  ['sldkj', 'lsdkj', 'sldkj']
        cSs"g|]}t|tr|n|qSrx)r|r$r)rresrxrxryrsz'ParseResults.asList..)r)rrxrxryrszParseResults.asListcs6tr|j}n|j}fddtfdd|DS)a
        Returns the named parse results as a nested dictionary.

        Example::
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
            
            result = date_str.parseString('12/31/1999')
            print(type(result), repr(result)) # ->  (['12', '/', '31', '/', '1999'], {'day': [('1999', 4)], 'year': [('12', 0)], 'month': [('31', 2)]})
            
            result_dict = result.asDict()
            print(type(result_dict), repr(result_dict)) # ->  {'day': '1999', 'year': '12', 'month': '31'}

            # even though a ParseResults supports dict-like access, sometime you just need to have a dict
            import json
            print(json.dumps(result)) # -> Exception: TypeError: ... is not JSON serializable
            print(json.dumps(result.asDict())) # -> {"month": "31", "day": "1999", "year": "12"}
        cs6t|tr.|r|Sfdd|DSn|SdS)Ncsg|]}|qSrxrx)rr)toItemrxryrsz7ParseResults.asDict..toItem..)r|r$rasDict)r)r%rxryr%s

z#ParseResults.asDict..toItemc3s|]\}}||fVqdS)Nrx)rrr)r%rxryrsz&ParseResults.asDict..)PY_3rrr)ritem_fnrx)r%ryr&s
	zParseResults.asDictcCs8t|j}|j|_|j|_|j|j|j|_|S)zA
        Returns a new copy of a C{ParseResults} object.
        )r$rrrrrrr)rrrxrxryrs
zParseResults.copyFcCsPd}g}tdd|jD}|d}|s8d}d}d}d}	|dk	rJ|}	n|jrV|j}	|	sf|rbdSd}	|||d|	d	g7}xt|jD]\}
}t|tr|
|kr||||
|o|dk||g7}n||d|o|dk||g7}qd}|
|kr||
}|s
|rqnd}t	t
|}
|||d|d	|
d
|d	g	7}qW|||d
|	d	g7}d|S)z
        (Deprecated) Returns the parse results as XML. Tags are created for tokens and lists that have defined results names.
        
css(|] \}}|D]}|d|fVqqdS)rNrx)rrrrrxrxryrsz%ParseResults.asXML..z  rNITEM<>z.z
%s%s- %s: z  rcss|]}t|tVqdS)N)r|r$)rvvrxrxryrsz
%s%s[%d]:
%s%s%sr)
rrrrsortedrr|r$dumpranyrr)rr0depthfullr#NLrrrrr=rxrxryr?gs,

4.zParseResults.dumpcOstj|f||dS)a
        Pretty-printer for parsed results as a list, using the C{pprint} module.
        Accepts additional positional or keyword args as defined for the 
        C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})

        Example::
            ident = Word(alphas, alphanums)
            num = Word(nums)
            func = Forward()
            term = ident | num | Group('(' + func + ')')
            func <<= ident + Group(Optional(delimitedList(term)))
            result = func.parseString("fna a,b,(fnb c,d,200),100")
            result.pprint(width=40)
        prints::
            ['fna',
             ['a',
              'b',
              ['(', 'fnb', ['c', 'd', '200'], ')'],
              '100']]
        N)pprintr)rrrrxrxryrDszParseResults.pprintcCs.|j|j|jdk	r|p d|j|jffS)N)rrrrrr)rrxrxry__getstate__s
zParseResults.__getstate__cCsN|d|_|d\|_}}|_i|_|j||dk	rDt||_nd|_dS)Nrr)rrrrrrr)rstater;inAccumNamesrxrxry__setstate__s
zParseResults.__setstate__cCs|j|j|j|jfS)N)rrrr)rrxrxry__getnewargs__szParseResults.__getnewargs__cCstt|t|S)N)rrrr)rrxrxryrszParseResults.__dir__)NNTT)N)r)NFrT)rrT)4rrrrrr|rrrrrrr__nonzero__rrrrrr'rrrrrrrr
rr
rrrrrrrrrr!rr&rr-r9r<r?rDrErHrIrrxrxrxryr$Dsh&
	'	
4

#
=%
-
cCsF|}d|krt|kr4nn||ddkr4dS||dd|S)aReturns current column within a string, counting newlines as line separators.
   The first column is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   rrr))rrfind)rstrgrrxrxryr;s
cCs|dd|dS)aReturns current line number within a string, counting newlines as line separators.
   The first line is number 1.

   Note: the default parsing behavior is to expand tabs in the input string
   before starting the parsing process.  See L{I{ParserElement.parseString}} for more information
   on parsing strings containing C{}s, and suggested methods to maintain a
   consistent view of the parsed string, the parse location, and line and column
   positions within the parsed string.
   r)rr)count)rrLrxrxryrLs
cCsF|dd|}|d|}|dkr2||d|S||ddSdS)zfReturns the line of text containing loc within a string, counting newlines as line separators.
       r)rrN)rKfind)rrLlastCRnextCRrxrxryrIs
cCs8tdt|dt|dt||t||fdS)NzMatch z at loc z(%d,%d))printrrLr;)instringrexprrxrxry_defaultStartDebugActionsrTcCs$tdt|dt|dS)NzMatched z -> )rQrr~r)rRstartlocendlocrStoksrxrxry_defaultSuccessDebugActionsrXcCstdt|dS)NzException raised:)rQr)rRrrSexcrxrxry_defaultExceptionDebugActionsrZcGsdS)zG'Do-nothing' debug action, to suppress debugging output during parsing.Nrx)rrxrxryrSsrscstkrfddSdgdgtdddkrFddd}dd	d
ntj}tjd}|ddd
}|d|d|ffdd}d}ytdtdj}Wntk
rt}YnX||_|S)Ncs|S)Nrx)rlrw)funcrxryrzr{z_trim_arity..rFrs)rqcSs8tdkrdnd}tj||dd|}|ddgS)N)rqr]rr)limitrs)system_version	traceback
extract_stack)r`r
frame_summaryrxrxryrcsz"_trim_arity..extract_stackcSs$tj||d}|d}|ddgS)N)r`rtrs)rb
extract_tb)tbr`framesrdrxrxryresz_trim_arity..extract_tb)r`rtrc	sxy |dd}dd<|Stk
rdr>n4z.td}|dddddksjWd~Xdkrdd7<wYqXqWdS)NrTrtrs)r`r)rrexc_info)rrrf)re
foundArityr\r`maxargspa_call_line_synthrxrywrapper-s"z_trim_arity..wrapperzr	__class__)r)r)	singleArgBuiltinsrarbrcregetattrr	Exceptionr~)r\rkrc	LINE_DIFF	this_linerm	func_namerx)rerjr\r`rkrlry_trim_aritys*
rucseZdZdZdZdZeddZeddZddd	Z	d
dZ
dd
ZdddZdddZ
ddZddZddZddZddZddZddd Zd!d"Zdd#d$Zd%d&Zd'd(ZGd)d*d*eZed+k	rGd,d-d-eZnGd.d-d-eZiZeZd/d/gZ dd0d1Z!eZ"ed2d3Z#dZ$edd5d6Z%dd7d8Z&e'dfd9d:Z(d;d<Z)e'fd=d>Z*e'dfd?d@Z+dAdBZ,dCdDZ-dEdFZ.dGdHZ/dIdJZ0dKdLZ1dMdNZ2dOdPZ3dQdRZ4dSdTZ5dUdVZ6dWdXZ7dYdZZ8dd[d\Z9d]d^Z:d_d`Z;dadbZdgdhZ?ddidjZ@dkdlZAdmdnZBdodpZCdqdrZDgfdsdtZEddudvZFfdwdxZGdydzZHd{d|ZId}d~ZJddZKdddZLdddZMZNS)r&z)Abstract base level parser element class.z 
	
FcCs
|t_dS)a
        Overrides the default whitespace chars

        Example::
            # default whitespace chars are space,  and newline
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def', 'ghi', 'jkl']
            
            # change to just treat newline as significant
            ParserElement.setDefaultWhitespaceChars(" \t")
            OneOrMore(Word(alphas)).parseString("abc def\nghi jkl")  # -> ['abc', 'def']
        N)r&DEFAULT_WHITE_CHARS)charsrxrxrysetDefaultWhitespaceCharsTs
z'ParserElement.setDefaultWhitespaceCharscCs
|t_dS)a
        Set class to be used for inclusion of string literals into a parser.
        
        Example::
            # default literal class used is Literal
            integer = Word(nums)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']


            # change to Suppress
            ParserElement.inlineLiteralsUsing(Suppress)
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")           

            date_str.parseString("1999/12/31")  # -> ['1999', '12', '31']
        N)r&_literalStringClass)rrxrxryinlineLiteralsUsingcsz!ParserElement.inlineLiteralsUsingcCst|_d|_d|_d|_||_d|_tj|_	d|_
d|_d|_t|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)NTFr)NNN)rparseAction
failActionstrReprresultsName
saveAsListskipWhitespacer&rv
whiteCharscopyDefaultWhiteCharsmayReturnEmptykeepTabsignoreExprsdebugstreamlined
mayIndexErrorerrmsgmodalResultsdebugActionsrecallPreparse
callDuringTry)rsavelistrxrxryrxs(zParserElement.__init__cCs<t|}|jdd|_|jdd|_|jr8tj|_|S)a$
        Make a copy of this C{ParserElement}.  Useful for defining different parse actions
        for the same parsing pattern, using copies of the original parse element.
        
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            integerK = integer.copy().addParseAction(lambda toks: toks[0]*1024) + Suppress("K")
            integerM = integer.copy().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
            
            print(OneOrMore(integerK | integerM | integer).parseString("5K 100 640K 256M"))
        prints::
            [5120, 100, 655360, 268435456]
        Equivalent form of C{expr.copy()} is just C{expr()}::
            integerM = integer().addParseAction(lambda toks: toks[0]*1024*1024) + Suppress("M")
        N)rr{rrr&rvr)rcpyrxrxryrs
zParserElement.copycCs*||_d|j|_t|dr&|j|j_|S)af
        Define name for this expression, makes debugging and exception messages clearer.
        
        Example::
            Word(nums).parseString("ABC")  # -> Exception: Expected W:(0123...) (at char 0), (line:1, col:1)
            Word(nums).setName("integer").parseString("ABC")  # -> Exception: Expected integer (at char 0), (line:1, col:1)
        z	Expected 	exception)rrrrr)rrrxrxrysetNames


zParserElement.setNamecCs4|}|dr"|dd}d}||_||_|S)aP
        Define name for referencing matching tokens as a nested attribute
        of the returned parse results.
        NOTE: this returns a *copy* of the original C{ParserElement} object;
        this is so that the client can define a basic element, such as an
        integer, and reference it in multiple places with different names.

        You can also set results names using the abbreviated syntax,
        C{expr("name")} in place of C{expr.setResultsName("name")} - 
        see L{I{__call__}<__call__>}.

        Example::
            date_str = (integer.setResultsName("year") + '/' 
                        + integer.setResultsName("month") + '/' 
                        + integer.setResultsName("day"))

            # equivalent form:
            date_str = integer("year") + '/' + integer("month") + '/' + integer("day")
        *NrtT)rendswithr~r)rrlistAllMatchesnewselfrxrxrysetResultsNames
zParserElement.setResultsNameTcs@|r&|jdfdd	}|_||_nt|jdr<|jj|_|S)zMethod to invoke the Python pdb debugger when this element is
           about to be parsed. Set C{breakFlag} to True to enable, False to
           disable.
        Tcsddl}|||||S)Nr)pdb	set_trace)rRr	doActionscallPreParser)_parseMethodrxrybreakersz'ParserElement.setBreak..breaker_originalParseMethod)TT)_parserr)r	breakFlagrrx)rrysetBreaks
zParserElement.setBreakcOs&tttt||_|dd|_|S)a
        Define one or more actions to perform when successfully matching parse element definition.
        Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
        C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
         - s   = the original string being parsed (see note below)
         - loc = the location of the matching substring
         - toks = a list of the matched tokens, packaged as a C{L{ParseResults}} object
        If the functions in fns modify the tokens, they can return them as the return
        value from fn, and the modified list of tokens will replace the original.
        Otherwise, fn does not need to return any value.

        Optional keyword arguments:
         - callDuringTry = (default=C{False}) indicate if parse action should be run during lookaheads and alternate testing

        Note: the default parsing behavior is to expand tabs in the input string
        before starting the parsing process.  See L{I{parseString}} for more information
        on parsing strings containing C{}s, and suggested methods to maintain a
        consistent view of the parsed string, the parse location, and line and column
        positions within the parsed string.
        
        Example::
            integer = Word(nums)
            date_str = integer + '/' + integer + '/' + integer

            date_str.parseString("1999/12/31")  # -> ['1999', '/', '12', '/', '31']

            # use parse action to convert to ints at parse time
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            date_str = integer + '/' + integer + '/' + integer

            # note that integer fields are now ints, not strings
            date_str.parseString("1999/12/31")  # -> [1999, '/', 12, '/', 31]
        rF)rmaprur{rr)rfnsrrxrxryrs"zParserElement.setParseActioncOs4|jtttt|7_|jp,|dd|_|S)z
        Add one or more parse actions to expression's list of parse actions. See L{I{setParseAction}}.
        
        See examples in L{I{copy}}.
        rF)r{rrrurr)rrrrxrxryaddParseActionszParserElement.addParseActioncsb|dd|ddrtntx(|D] fdd}|j|q&W|jpZ|dd|_|S)aAdd a boolean predicate function to expression's list of parse actions. See 
        L{I{setParseAction}} for function call signatures. Unlike C{setParseAction}, 
        functions passed to C{addCondition} need to return boolean success/fail of the condition.

        Optional keyword arguments:
         - message = define a custom message to be used in the raised exception
         - fatal   = if True, will raise ParseFatalException to stop parsing immediately; otherwise will raise ParseException
         
        Example::
            integer = Word(nums).setParseAction(lambda toks: int(toks[0]))
            year_int = integer.copy()
            year_int.addCondition(lambda toks: toks[0] >= 2000, message="Only support years 2000 and later")
            date_str = year_int + '/' + integer + '/' + integer

            result = date_str.parseString("1999/12/31")  # -> Exception: Only support years 2000 and later (at char 0), (line:1, col:1)
        messagezfailed user-defined conditionfatalFcs$tt|||s ||dS)N)rru)rr[rw)exc_typefnrrxrypa&sz&ParserElement.addCondition..par)rr#r!r{rr)rrrrrx)rrrryaddConditions
zParserElement.addConditioncCs
||_|S)aDefine action to perform if parsing fails at this expression.
           Fail acton fn is a callable function that takes the arguments
           C{fn(s,loc,expr,err)} where:
            - s = string being parsed
            - loc = location where expression match was attempted and failed
            - expr = the parse expression that failed
            - err = the exception thrown
           The function returns no value.  It may throw C{L{ParseFatalException}}
           if it is desired to stop parsing immediately.)r|)rrrxrxry
setFailAction-s
zParserElement.setFailActionc	CsZd}xP|rTd}xB|jD]8}yx|||\}}d}qWWqtk
rLYqXqWqW|S)NTF)rrr!)rrRr
exprsFoundedummyrxrxry_skipIgnorables:szParserElement._skipIgnorablescCsL|jr|||}|jrH|j}t|}x ||krF|||krF|d7}q(W|S)Nr)rrrrr)rrRrwtinstrlenrxrxrypreParseGszParserElement.preParsecCs|gfS)Nrx)rrRrrrxrxry	parseImplSszParserElement.parseImplcCs|S)Nrx)rrRr	tokenlistrxrxry	postParseVszParserElement.postParsec
Cs|j}|s|jr|jdr,|jd||||rD|jrD|||}n|}|}yDy||||\}}Wn(tk
rt|t||j	|YnXWnXt
k
r}	z:|jdr|jd||||	|jr|||||	Wdd}	~	XYnXn|r|jr|||}n|}|}|js&|t|krjy||||\}}Wn*tk
rft|t||j	|YnXn||||\}}||||}t
||j|j|jd}
|jr|s|jr|rXyRxL|jD]B}||||
}|dk	rt
||j|jot|t
tf|jd}
qWWnFt
k
rT}	z&|jdrB|jd||||	Wdd}	~	XYnXnNxL|jD]B}||||
}|dk	r`t
||j|jot|t
tf|jd}
q`W|r|jdr|jd|||||
||
fS)Nrrs)rrr)rr|rrrrrr!rrrrrr$r~rrr{rr|r)rrRrrr	debuggingpreloctokensStarttokenserr	retTokensrrxrxry
_parseNoCacheZsp





zParserElement._parseNoCachecCs>y|j||dddStk
r8t|||j|YnXdS)NF)rr)rr#r!r)rrRrrxrxrytryParseszParserElement.tryParsec	Cs2y|||Wnttfk
r(dSXdSdS)NFT)rr!r)rrRrrxrxrycanParseNexts
zParserElement.canParseNextc@seZdZddZdS)zParserElement._UnboundedCachecs~it|_fdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Ncs|S)N)r)rr)cachenot_in_cacherxryrsz3ParserElement._UnboundedCache.__init__..getcs||<dS)Nrx)rrr)rrxrysetsz3ParserElement._UnboundedCache.__init__..setcsdS)N)r)r)rrxryrsz5ParserElement._UnboundedCache.__init__..clearcstS)N)r)r)rrxry	cache_lensz9ParserElement._UnboundedCache.__init__..cache_len)rrtypes
MethodTyperrrr)rrrrrrx)rrryrsz&ParserElement._UnboundedCache.__init__N)rrrrrxrxrxry_UnboundedCachesrNc@seZdZddZdS)zParserElement._FifoCachecst|_tfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_dS)	Ncs|S)N)r)rr)rrrxryrsz.ParserElement._FifoCache.__init__..getcsB||<x4tkr.setcsdS)N)r)r)rrxryrsz0ParserElement._FifoCache.__init__..clearcstS)N)r)r)rrxryrsz4ParserElement._FifoCache.__init__..cache_len)	rr_OrderedDictrrrrrr)rrrrrrrx)rrrryrsz!ParserElement._FifoCache.__init__N)rrrrrxrxrxry
_FifoCachesrc@seZdZddZdS)zParserElement._FifoCachecst|_itgfdd}fdd}fdd}fdd}t|||_t|||_t|||_t|||_	dS)	Ncs|S)N)r)rr)rrrxryrsz.ParserElement._FifoCache.__init__..getcs8||<x tkr(dq
W|dS)N)rr
popleftr)rrr)rkey_fiforrxryrsz.ParserElement._FifoCache.__init__..setcsdS)N)r)r)rrrxryrsz0ParserElement._FifoCache.__init__..clearcstS)N)r)r)rrxryrsz4ParserElement._FifoCache.__init__..cache_len)
rrcollectionsdequerrrrrr)rrrrrrrx)rrrrryrsz!ParserElement._FifoCache.__init__N)rrrrrxrxrxryrsrcCsd\}}|||||f}tjtj}||}	|	|jkrtj|d7<y|||||}	Wn8tk
r}
z|||
j	|
j
Wdd}
~
XYqX|||	d|	df|	Sn4tj|d7<t|	t
r|	|	d|	dfSWdQRXdS)N)rrrr)r&packrat_cache_lock
packrat_cacherrpackrat_cache_statsrrrrnrrr|rq)rrRrrrHITMISSlookuprrrrxrxry_parseCaches$


zParserElement._parseCachecCs(tjdgttjtjdd<dS)Nr)r&rrrrrxrxrxry
resetCaches
zParserElement.resetCachecCs8tjs4dt_|dkr tt_nt|t_tjt_dS)aEnables "packrat" parsing, which adds memoizing to the parsing logic.
           Repeated parse attempts at the same string location (which happens
           often in many complex grammars) can immediately return a cached value,
           instead of re-executing parsing/validating code.  Memoizing is done of
           both valid results and parsing exceptions.
           
           Parameters:
            - cache_size_limit - (default=C{128}) - if an integer value is provided
              will limit the size of the packrat cache; if None is passed, then
              the cache size will be unbounded; if 0 is passed, the cache will
              be effectively disabled.
            
           This speedup may break existing programs that use parse actions that
           have side-effects.  For this reason, packrat parsing is disabled when
           you first import pyparsing.  To activate the packrat feature, your
           program must call the class method C{ParserElement.enablePackrat()}.  If
           your program uses C{psyco} to "compile as you go", you must call
           C{enablePackrat} before calling C{psyco.full()}.  If you do not do this,
           Python will crash.  For best results, call C{enablePackrat()} immediately
           after importing pyparsing.
           
           Example::
               import pyparsing
               pyparsing.ParserElement.enablePackrat()
        TN)r&_packratEnabledrrrrr)cache_size_limitrxrxry
enablePackrat%szParserElement.enablePackratc
Cst|js|x|jD]}|qW|js<|}y<||d\}}|rv|||}t	t
}|||Wn0tk
r}ztjrn|Wdd}~XYnX|SdS)aC
        Execute the parse expression with the given string.
        This is the main interface to the client code, once the complete
        expression has been built.

        If you want the grammar to require that the entire input string be
        successfully parsed, then set C{parseAll} to True (equivalent to ending
        the grammar with C{L{StringEnd()}}).

        Note: C{parseString} implicitly calls C{expandtabs()} on the input string,
        in order to report proper column numbers in parse actions.
        If the input string contains tabs and
        the grammar uses parse actions that use the C{loc} argument to index into the
        string being parsed, you can ensure you have a consistent view of the input
        string by:
         - calling C{parseWithTabs} on your grammar before calling C{parseString}
           (see L{I{parseWithTabs}})
         - define your parse action using the full C{(s,loc,toks)} signature, and
           reference the input string using the parse action's C{s} argument
         - explicitly expand the tabs in your input string before calling
           C{parseString}
        
        Example::
            Word('a').parseString('aaaaabaaa')  # -> ['aaaaa']
            Word('a').parseString('aaaaabaaa', parseAll=True)  # -> Exception: Expected end of text
        rN)
r&rr
streamlinerr
expandtabsrrrr+rverbose_stacktrace)rrRparseAllrrrserYrxrxryparseStringHs$zParserElement.parseStringc
csB|js|x|jD]}|qW|js8t|}t|}d}|j}|j}t	
d}	yx||kr|	|kry |||}
|||
dd\}}Wntk
r|
d}Yq`X||kr|	d7}	||
|fV|r|||}
|
|kr|}q|d7}n|}q`|
d}q`WWn4tk
r<}zt	j
r(n|Wdd}~XYnXdS)a
        Scan the input string for expression matches.  Each match will return the
        matching tokens, start location, and end location.  May be called with optional
        C{maxMatches} argument, to clip scanning after 'n' matches are found.  If
        C{overlap} is specified, then overlapping matches will be reported.

        Note that the start and end locations are reported relative to the string
        being parsed.  See L{I{parseString}} for more information on parsing
        strings with embedded tabs.

        Example::
            source = "sldjf123lsdjjkf345sldkjf879lkjsfd987"
            print(source)
            for tokens,start,end in Word(alphas).scanString(source):
                print(' '*start + '^'*(end-start))
                print(' '*start + tokens[0])
        
        prints::
        
            sldjf123lsdjjkf345sldkjf879lkjsfd987
            ^^^^^
            sldjf
                    ^^^^^^^
                    lsdjjkf
                              ^^^^^^
                              sldkjf
                                       ^^^^^^
                                       lkjsfd
        rF)rrN)rrrrrrrrrr&rr!rr)rrR
maxMatchesoverlaprrr
preparseFnparseFnmatchesrnextLocrnextlocrYrxrxry
scanStringzsB


zParserElement.scanStringc
Csg}d}d|_yxh||D]Z\}}}|||||rrt|trT||7}nt|trh||7}n
|||}qW|||ddd|D}dtt	t
|Stk
r}ztj
rȂn|Wdd}~XYnXdS)af
        Extension to C{L{scanString}}, to modify matching text with modified tokens that may
        be returned from a parse action.  To use C{transformString}, define a grammar and
        attach a parse action to it that modifies the returned token list.
        Invoking C{transformString()} on a target string will then scan for matches,
        and replace the matched text patterns according to the logic in the parse
        action.  C{transformString()} returns the resulting transformed string.
        
        Example::
            wd = Word(alphas)
            wd.setParseAction(lambda toks: toks[0].title())
            
            print(wd.transformString("now is the winter of our discontent made glorious summer by this sun of york."))
        Prints::
            Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York.
        rTNcSsg|]}|r|qSrxrx)rorxrxryrsz1ParserElement.transformString..r)rrrr|r$rrrrr_flattenrr&r)rrRr#lastErwrrrYrxrxryrs(



zParserElement.transformStringc
CsPytdd|||DStk
rJ}ztjr6n|Wdd}~XYnXdS)a
        Another extension to C{L{scanString}}, simplifying the access to the tokens found
        to match the given parse expression.  May be called with optional
        C{maxMatches} argument, to clip searching after 'n' matches are found.
        
        Example::
            # a capitalized word starts with an uppercase letter, followed by zero or more lowercase letters
            cap_word = Word(alphas.upper(), alphas.lower())
            
            print(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity"))

            # the sum() builtin can be used to merge results into a single ParseResults object
            print(sum(cap_word.searchString("More than Iron, more than Lead, more than Gold I need Electricity")))
        prints::
            [['More'], ['Iron'], ['Lead'], ['Gold'], ['I'], ['Electricity']]
            ['More', 'Iron', 'Lead', 'Gold', 'I', 'Electricity']
        cSsg|]\}}}|qSrxrx)rrwrrrxrxryrsz.ParserElement.searchString..N)r$rrr&r)rrRrrYrxrxrysearchStringszParserElement.searchStringc	csXd}d}x<|j||dD]*\}}}|||V|r>|dV|}qW||dVdS)a[
        Generator method to split a string using the given expression as a separator.
        May be called with optional C{maxsplit} argument, to limit the number of splits;
        and the optional C{includeSeparators} argument (default=C{False}), if the separating
        matching text should be included in the split results.
        
        Example::        
            punc = oneOf(list(".,;:/-!?"))
            print(list(punc.split("This, this?, this sentence, is badly punctuated!")))
        prints::
            ['This', ' this', '', ' this sentence', ' is badly punctuated', '']
        r)rN)r)	rrRmaxsplitincludeSeparatorssplitslastrwrrrxrxryrs

zParserElement.splitcCsFt|trt|}t|ts:tjdt|tdddSt||gS)a
        Implementation of + operator - returns C{L{And}}. Adding strings to a ParserElement
        converts them to L{Literal}s by default.
        
        Example::
            greet = Word(alphas) + "," + Word(alphas) + "!"
            hello = "Hello, World!"
            print (hello, "->", greet.parseString(hello))
        Prints::
            Hello, World! -> ['Hello', ',', 'World', '!']
        z4Cannot combine element of type %s with ParserElementrs)
stacklevelN)	r|rr&rywarningswarnr
SyntaxWarningr)rrrxrxryrs



zParserElement.__add__cCsBt|trt|}t|ts:tjdt|tdddS||S)z]
        Implementation of + operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrs)rN)r|rr&ryrrrr)rrrxrxryr1s



zParserElement.__radd__cCsJt|trt|}t|ts:tjdt|tdddS|t	|S)zQ
        Implementation of - operator, returns C{L{And}} with error stop
        z4Cannot combine element of type %s with ParserElementrs)rN)
r|rr&ryrrrrr
_ErrorStop)rrrxrxry__sub__=s



zParserElement.__sub__cCsBt|trt|}t|ts:tjdt|tdddS||S)z]
        Implementation of - operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrs)rN)r|rr&ryrrrr)rrrxrxry__rsub__Is



zParserElement.__rsub__cst|tr|d}}nt|tr|ddd}|ddkrHd|df}t|dtr|ddkr|ddkrvtS|ddkrtS|dtSqt|dtrt|dtr|\}}||8}qtdt|dt|dntdt||dkrtd|dkrtd	||kr6dkrBnntd
|rfdd|r|dkrt|}ntg||}n|}n|dkr}ntg|}|S)
a
        Implementation of * operator, allows use of C{expr * 3} in place of
        C{expr + expr + expr}.  Expressions may also me multiplied by a 2-integer
        tuple, similar to C{{min,max}} multipliers in regular expressions.  Tuples
        may also include C{None} as in:
         - C{expr*(n,None)} or C{expr*(n,)} is equivalent
              to C{expr*n + L{ZeroOrMore}(expr)}
              (read as "at least n instances of C{expr}")
         - C{expr*(None,n)} is equivalent to C{expr*(0,n)}
              (read as "0 to n instances of C{expr}")
         - C{expr*(None,None)} is equivalent to C{L{ZeroOrMore}(expr)}
         - C{expr*(1,None)} is equivalent to C{L{OneOrMore}(expr)}

        Note that C{expr*(None,n)} does not raise an exception if
        more than n exprs exist in the input stream; that is,
        C{expr*(None,n)} does not enforce a maximum number of expr
        occurrences.  If this behavior is desired, then write
        C{expr*(None,n) + ~expr}
        r)NNNrsrz7cannot multiply 'ParserElement' and ('%s','%s') objectsz0cannot multiply 'ParserElement' and '%s' objectsz/cannot multiply ParserElement by negative valuez@second tuple value must be greater or equal to first tuple valuez+cannot multiply ParserElement by 0 or (0,0)cs(|dkrt|dStSdS)Nr)r)n)makeOptionalListrrxryrsz/ParserElement.__mul__..makeOptionalList)	r|rvtupler4rrr
ValueErrorr)rrminElementsoptElementsrrx)rrry__mul__UsD







zParserElement.__mul__cCs
||S)N)r)rrrxrxry__rmul__szParserElement.__rmul__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zI
        Implementation of | operator - returns C{L{MatchFirst}}
        z4Cannot combine element of type %s with ParserElementrs)rN)	r|rr&ryrrrrr)rrrxrxry__or__s



zParserElement.__or__cCsBt|trt|}t|ts:tjdt|tdddS||BS)z]
        Implementation of | operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrs)rN)r|rr&ryrrrr)rrrxrxry__ror__s



zParserElement.__ror__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zA
        Implementation of ^ operator - returns C{L{Or}}
        z4Cannot combine element of type %s with ParserElementrs)rN)	r|rr&ryrrrrr)rrrxrxry__xor__s



zParserElement.__xor__cCsBt|trt|}t|ts:tjdt|tdddS||AS)z]
        Implementation of ^ operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrs)rN)r|rr&ryrrrr)rrrxrxry__rxor__s



zParserElement.__rxor__cCsFt|trt|}t|ts:tjdt|tdddSt||gS)zC
        Implementation of & operator - returns C{L{Each}}
        z4Cannot combine element of type %s with ParserElementrs)rN)	r|rr&ryrrrrr)rrrxrxry__and__s



zParserElement.__and__cCsBt|trt|}t|ts:tjdt|tdddS||@S)z]
        Implementation of & operator when left operand is not a C{L{ParserElement}}
        z4Cannot combine element of type %s with ParserElementrs)rN)r|rr&ryrrrr)rrrxrxry__rand__s



zParserElement.__rand__cCst|S)zE
        Implementation of ~ operator - returns C{L{NotAny}}
        )r)rrxrxry
__invert__szParserElement.__invert__cCs|dk	r||S|SdS)a

        Shortcut for C{L{setResultsName}}, with C{listAllMatches=False}.
        
        If C{name} is given with a trailing C{'*'} character, then C{listAllMatches} will be
        passed as C{True}.
           
        If C{name} is omitted, same as calling C{L{copy}}.

        Example::
            # these are equivalent
            userdata = Word(alphas).setResultsName("name") + Word(nums+"-").setResultsName("socsecno")
            userdata = Word(alphas)("name") + Word(nums+"-")("socsecno")             
        N)rr)rrrxrxry__call__s
zParserElement.__call__cCst|S)z
        Suppresses the output of this C{ParserElement}; useful to keep punctuation from
        cluttering up returned output.
        )r-)rrxrxrysuppressszParserElement.suppresscCs
d|_|S)a
        Disables the skipping of whitespace before matching the characters in the
        C{ParserElement}'s defined pattern.  This is normally only used internally by
        the pyparsing module, but may be needed in some whitespace-sensitive grammars.
        F)r)rrxrxryleaveWhitespaceszParserElement.leaveWhitespacecCsd|_||_d|_|S)z8
        Overrides the default whitespace chars
        TF)rrr)rrwrxrxrysetWhitespaceChars
sz ParserElement.setWhitespaceCharscCs
d|_|S)z
        Overrides default behavior to expand C{}s to spaces before parsing the input string.
        Must be called before C{parseString} when the input grammar contains elements that
        match C{} characters.
        T)r)rrxrxry
parseWithTabsszParserElement.parseWithTabscCsLt|trt|}t|tr4||jkrH|j|n|jt||S)a
        Define expression to be ignored (e.g., comments) while doing pattern
        matching; may be called repeatedly, to define multiple comment or other
        ignorable patterns.
        
        Example::
            patt = OneOrMore(Word(alphas))
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj']
            
            patt.ignore(cStyleComment)
            patt.parseString('ablaj /* comment */ lskjd') # -> ['ablaj', 'lskjd']
        )r|rr-rrr)rrrxrxryignores


zParserElement.ignorecCs"|pt|pt|ptf|_d|_|S)zT
        Enable display of debugging messages while doing pattern matching.
        T)rTrXrZrr)rstartAction
successActionexceptionActionrxrxrysetDebugActions6s
zParserElement.setDebugActionscCs|r|tttnd|_|S)a
        Enable display of debugging messages while doing pattern matching.
        Set C{flag} to True to enable, False to disable.

        Example::
            wd = Word(alphas).setName("alphaword")
            integer = Word(nums).setName("numword")
            term = wd | integer
            
            # turn on debugging for wd
            wd.setDebug()

            OneOrMore(term).parseString("abc 123 xyz 890")
        
        prints::
            Match alphaword at loc 0(1,1)
            Matched alphaword -> ['abc']
            Match alphaword at loc 3(1,4)
            Exception raised:Expected alphaword (at char 4), (line:1, col:5)
            Match alphaword at loc 7(1,8)
            Matched alphaword -> ['xyz']
            Match alphaword at loc 11(1,12)
            Exception raised:Expected alphaword (at char 12), (line:1, col:13)
            Match alphaword at loc 15(1,16)
            Exception raised:Expected alphaword (at char 15), (line:1, col:16)

        The output shown is that produced by the default debug actions - custom debug actions can be
        specified using L{setDebugActions}. Prior to attempting
        to match the C{wd} expression, the debugging message C{"Match  at loc (,)"}
        is shown. Then if the parse succeeds, a C{"Matched"} message is shown, or an C{"Exception raised"}
        message is shown. Also note the use of L{setName} to assign a human-readable name to the expression,
        which makes debugging and exception messages easier to understand - for instance, the default
        name created for the C{Word} expression without calling C{setName} is C{"W:(ABCD...)"}.
        F)rrTrXrZr)rflagrxrxrysetDebug@s#zParserElement.setDebugcCs|jS)N)r)rrxrxryriszParserElement.__str__cCst|S)N)r)rrxrxryrlszParserElement.__repr__cCsd|_d|_|S)NT)rr})rrxrxryroszParserElement.streamlinecCsdS)Nrx)rrrxrxrycheckRecursiontszParserElement.checkRecursioncCs|gdS)zj
        Check defined expressions for valid structure, check for infinite recursive definitions.
        N)r)r
validateTracerxrxryvalidatewszParserElement.validatecCsy|}Wn2tk
r>t|d}|}WdQRXYnXy|||Stk
r|}ztjrhn|Wdd}~XYnXdS)z
        Execute the parse expression on the given file or filename.
        If a filename is specified (instead of a file object),
        the entire file is opened, read, and closed before parsing.
        rN)readropenrrr&r)rfile_or_filenamer
file_contentsfrYrxrxry	parseFile}szParserElement.parseFilecsHt|tr"||kp t|t|kSt|tr6||Stt||kSdS)N)r|r&varsrrsuper)rr)rnrxry__eq__s



zParserElement.__eq__cCs
||kS)Nrx)rrrxrxry__ne__szParserElement.__ne__cCstt|S)N)hashid)rrxrxry__hash__szParserElement.__hash__cCs||kS)Nrx)rrrxrxry__req__szParserElement.__req__cCs
||kS)Nrx)rrrxrxry__rne__szParserElement.__rne__cCs0y|jt||ddStk
r*dSXdS)a
        Method for quick testing of a parser against a test string. Good for simple 
        inline microtests of sub expressions while building up larger parser.
           
        Parameters:
         - testString - to test against this expression for a match
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests
            
        Example::
            expr = Word(nums)
            assert expr.matches("100")
        )rTFN)rrr)r
testStringrrxrxryrs

zParserElement.matches#cCst|tr"tttj|}t|tr4t|}g}g}d}	x|D]}
|dk	rb|	|
dsj|rv|
sv|
|
qH|
s|qHd||
g}g}y:|
dd}
|j
|
|d}|
|j|d|	o|}	Wntk
rv}
zt|
trdnd	}d|
kr.|
t|
j|
|
d
t|
j|
dd|n|
d
|
jd||
d
t|
|	o`|}	|
}Wdd}
~
XYnDtk
r}z$|
dt||	o|}	|}Wdd}~XYnX|r|r|
d	td||
|
|fqHW|	|fS)a3
        Execute the parse expression on a series of test strings, showing each
        test, the parsed results or where the parse failed. Quick and easy way to
        run a parse expression against a list of sample strings.
           
        Parameters:
         - tests - a list of separate test strings, or a multiline string of test strings
         - parseAll - (default=C{True}) - flag to pass to C{L{parseString}} when running tests           
         - comment - (default=C{'#'}) - expression for indicating embedded comments in the test 
              string; pass None to disable comment filtering
         - fullDump - (default=C{True}) - dump results as list followed by results names in nested outline;
              if False, only dump nested list
         - printResults - (default=C{True}) prints test output to stdout
         - failureTests - (default=C{False}) indicates if these tests are expected to fail parsing

        Returns: a (success, results) tuple, where success indicates that all tests succeeded
        (or failed if C{failureTests} is True), and the results contain a list of lines of each 
        test's output
        
        Example::
            number_expr = pyparsing_common.number.copy()

            result = number_expr.runTests('''
                # unsigned integer
                100
                # negative integer
                -100
                # float with scientific notation
                6.02e23
                # integer with scientific notation
                1e-12
                ''')
            print("Success" if result[0] else "Failed!")

            result = number_expr.runTests('''
                # stray character
                100Z
                # missing leading digit before '.'
                -.100
                # too many '.'
                3.14.159
                ''', failureTests=True)
            print("Success" if result[0] else "Failed!")
        prints::
            # unsigned integer
            100
            [100]

            # negative integer
            -100
            [-100]

            # float with scientific notation
            6.02e23
            [6.02e+23]

            # integer with scientific notation
            1e-12
            [1e-12]

            Success
            
            # stray character
            100Z
               ^
            FAIL: Expected end of text (at char 3), (line:1, col:4)

            # missing leading digit before '.'
            -.100
            ^
            FAIL: Expected {real number with scientific notation | real number | signed integer} (at char 0), (line:1, col:1)

            # too many '.'
            3.14.159
                ^
            FAIL: Expected end of text (at char 4), (line:1, col:5)

            Success

        Each test string must be on a single line. If you want to test a string that spans multiple
        lines, create a test like this::

            expr.runTest(r"this is a test\n of strings that spans \n 3 lines")
        
        (Note that this is a raw string literal, you must include the leading 'r'.)
        TNFr)z\n)r)rBz(FATAL)r r^zFAIL: zFAIL-EXCEPTION: )r|rrrr~rrstrip
splitlinesrrrrrrr?rr#rIrr;rqrQ)rtestsrcommentfullDumpprintResultsfailureTests
allResultscommentssuccessrwr#resultrrrYrxrxryrunTestssNW



$


zParserElement.runTests)F)F)T)T)TT)TT)r)F)N)T)F)T)Tr&TTF)Orrrrrvrstaticmethodrxrzrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr_MAX_INTrrrrrrrrrrrrrrrrrrrrr	r
rrrrrrrrrrrr"r#r$rr4
__classcell__rxrx)rnryr&Os


&




G
"
2G+D
			

)

cs eZdZdZfddZZS)r.zT
    Abstract C{ParserElement} subclass, for defining atomic matching patterns.
    cstt|jdddS)NF)r)rr.r)r)rnrxryr@	szToken.__init__)rrrrrr7rxrx)rnryr.<	scs eZdZdZfddZZS)rz,
    An empty token, will always match.
    cs$tt|d|_d|_d|_dS)NrTF)rrrrrr)r)rnrxryrH	szEmpty.__init__)rrrrrr7rxrx)rnryrD	scs*eZdZdZfddZdddZZS)rz(
    A token that will never match.
    cs*tt|d|_d|_d|_d|_dS)NrTFzUnmatchable token)rrrrrrr)r)rnrxryrS	s
zNoMatch.__init__TcCst|||j|dS)N)r!r)rrRrrrxrxryrZ	szNoMatch.parseImpl)T)rrrrrrr7rxrx)rnryrO	scs*eZdZdZfddZdddZZS)ra
    Token to exactly match a specified string.
    
    Example::
        Literal('blah').parseString('blah')  # -> ['blah']
        Literal('blah').parseString('blahfooblah')  # -> ['blah']
        Literal('blah').parseString('bla')  # -> Exception: Expected "blah"
    
    For case-insensitive matching, use L{CaselessLiteral}.
    
    For keyword matching (force word break before and after the matched string),
    use L{Keyword} or L{CaselessKeyword}.
    cstt|||_t||_y|d|_Wn*tk
rVtj	dt
ddt|_YnXdt
|j|_d|j|_d|_d|_dS)Nrz2null string passed to Literal; use Empty() insteadrs)rz"%s"z	Expected F)rrrmatchrmatchLenfirstMatchCharrrrrrrnrrrrr)rmatchString)rnrxryrl	s

zLiteral.__init__TcCsJ|||jkr6|jdks&||j|r6||j|jfSt|||j|dS)Nr)r:r9
startswithr8r!r)rrRrrrxrxryr	szLiteral.parseImpl)T)rrrrrrr7rxrx)rnryr^	s
csLeZdZdZedZdfdd	Zddd	Zfd
dZe	dd
Z
ZS)ra\
    Token to exactly match a specified string as a keyword, that is, it must be
    immediately followed by a non-keyword character.  Compare with C{L{Literal}}:
     - C{Literal("if")} will match the leading C{'if'} in C{'ifAndOnlyIf'}.
     - C{Keyword("if")} will not; it will only match the leading C{'if'} in C{'if x=1'}, or C{'if(y==2)'}
    Accepts two optional constructor arguments in addition to the keyword string:
     - C{identChars} is a string of characters that would be valid identifier characters,
          defaulting to all alphanumerics + "_" and "$"
     - C{caseless} allows case-insensitive matching, default is C{False}.
       
    Example::
        Keyword("start").parseString("start")  # -> ['start']
        Keyword("start").parseString("starting")  # -> Exception

    For case-insensitive matching, use L{CaselessKeyword}.
    z_$NFcstt||dkrtj}||_t||_y|d|_Wn$tk
r^t	j
dtddYnXd|j|_d|j|_
d|_d|_||_|r||_|}t||_dS)Nrz2null string passed to Keyword; use Empty() insteadrs)rz"%s"z	Expected F)rrrDEFAULT_KEYWORD_CHARSr8rr9r:rrrrrrrrcaselessupper
caselessmatchr
identChars)rr;rAr>)rnrxryr	s&

zKeyword.__init__TcCs|jr|||||j|jkr|t||jksL|||j|jkr|dksj||d|jkr||j|jfSnv|||jkr|jdks||j|r|t||jks|||j|jkr|dks||d|jkr||j|jfSt	|||j
|dS)Nrr)r>r9r?r@rrAr8r:r<r!r)rrRrrrxrxryr	s*&zKeyword.parseImplcstt|}tj|_|S)N)rrrr=rA)rr)rnrxryr	szKeyword.copycCs
|t_dS)z,Overrides the default Keyword chars
        N)rr=)rwrxrxrysetDefaultKeywordChars	szKeyword.setDefaultKeywordChars)NF)T)rrrrr5r=rrrr5rBr7rxrx)rnryr	s
cs*eZdZdZfddZdddZZS)r
al
    Token to match a specified string, ignoring case of letters.
    Note: the matched results will always be in the case of the given
    match string, NOT the case of the input text.

    Example::
        OneOrMore(CaselessLiteral("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD', 'CMD']
        
    (Contrast with example for L{CaselessKeyword}.)
    cs6tt||||_d|j|_d|j|_dS)Nz'%s'z	Expected )rr
rr?returnStringrr)rr;)rnrxryr	szCaselessLiteral.__init__TcCs@||||j|jkr,||j|jfSt|||j|dS)N)r9r?r8rCr!r)rrRrrrxrxryr	szCaselessLiteral.parseImpl)T)rrrrrrr7rxrx)rnryr
	s
cs,eZdZdZdfdd	Zd	ddZZS)
r	z
    Caseless version of L{Keyword}.

    Example::
        OneOrMore(CaselessKeyword("CMD")).parseString("cmd CMD Cmd10") # -> ['CMD', 'CMD']
        
    (Contrast with example for L{CaselessLiteral}.)
    Ncstt|j||dddS)NT)r>)rr	r)rr;rA)rnrxryr	szCaselessKeyword.__init__TcCsj||||j|jkrV|t||jksF|||j|jkrV||j|jfSt|||j|dS)N)r9r?r@rrAr8r!r)rrRrrrxrxryr	s*zCaselessKeyword.parseImpl)N)T)rrrrrrr7rxrx)rnryr		scs,eZdZdZdfdd	Zd	ddZZS)
rnax
    A variation on L{Literal} which matches "close" matches, that is, 
    strings with at most 'n' mismatching characters. C{CloseMatch} takes parameters:
     - C{match_string} - string to be matched
     - C{maxMismatches} - (C{default=1}) maximum number of mismatches allowed to count as a match
    
    The results from a successful parse will contain the matched text from the input string and the following named results:
     - C{mismatches} - a list of the positions within the match_string where mismatches were found
     - C{original} - the original match_string used to compare against the input string
    
    If C{mismatches} is an empty list, then the match was an exact match.
    
    Example::
        patt = CloseMatch("ATCATCGAATGGA")
        patt.parseString("ATCATCGAAXGGA") # -> (['ATCATCGAAXGGA'], {'mismatches': [[9]], 'original': ['ATCATCGAATGGA']})
        patt.parseString("ATCAXCGAAXGGA") # -> Exception: Expected 'ATCATCGAATGGA' (with up to 1 mismatches) (at char 0), (line:1, col:1)

        # exact match
        patt.parseString("ATCATCGAATGGA") # -> (['ATCATCGAATGGA'], {'mismatches': [[]], 'original': ['ATCATCGAATGGA']})

        # close match allowing up to 2 mismatches
        patt = CloseMatch("ATCATCGAATGGA", maxMismatches=2)
        patt.parseString("ATCAXCGAAXGGA") # -> (['ATCAXCGAAXGGA'], {'mismatches': [[4, 9]], 'original': ['ATCATCGAATGGA']})
    rcsBtt|||_||_||_d|j|jf|_d|_d|_dS)Nz&Expected %r (with up to %d mismatches)F)	rrnrrmatch_string
maxMismatchesrrr)rrDrE)rnrxryr

szCloseMatch.__init__TcCs|}t|}|t|j}||kr|j}d}g}	|j}
xtt||||jD]0\}}|\}}
||
krP|	|t|	|
krPPqPW|d}t|||g}|j|d<|	|d<||fSt|||j|dS)Nrroriginal
mismatches)	rrDrErrrr$r!r)rrRrrstartrmaxlocrDmatch_stringlocrGrEs_msrcmatresultsrxrxryr
s("

zCloseMatch.parseImpl)r)T)rrrrrrr7rxrx)rnryrn	s	cs8eZdZdZd
fdd	Zdd	d
ZfddZZS)r1a	
    Token for matching words composed of allowed character sets.
    Defined with string containing all allowed initial characters,
    an optional string containing allowed body characters (if omitted,
    defaults to the initial character set), and an optional minimum,
    maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction. An optional
    C{excludeChars} parameter can list characters that might be found in 
    the input C{bodyChars} string; useful to define a word of all printables
    except for one or two characters, for instance.
    
    L{srange} is useful for defining custom character set strings for defining 
    C{Word} expressions, using range notation from regular expression character sets.
    
    A common mistake is to use C{Word} to match a specific literal string, as in 
    C{Word("Address")}. Remember that C{Word} uses the string argument to define
    I{sets} of matchable characters. This expression would match "Add", "AAA",
    "dAred", or any other word made up of the characters 'A', 'd', 'r', 'e', and 's'.
    To match an exact literal string, use L{Literal} or L{Keyword}.

    pyparsing includes helper strings for building Words:
     - L{alphas}
     - L{nums}
     - L{alphanums}
     - L{hexnums}
     - L{alphas8bit} (alphabetic characters in ASCII range 128-255 - accented, tilded, umlauted, etc.)
     - L{punc8bit} (non-alphabetic characters in ASCII range 128-255 - currency, symbols, superscripts, diacriticals, etc.)
     - L{printables} (any non-whitespace character)

    Example::
        # a word composed of digits
        integer = Word(nums) # equivalent to Word("0123456789") or Word(srange("0-9"))
        
        # a word with a leading capital, and zero or more lowercase
        capital_word = Word(alphas.upper(), alphas.lower())

        # hostnames are alphanumeric, with leading alpha, and '-'
        hostname = Word(alphas, alphanums+'-')
        
        # roman numeral (not a strict parser, accepts invalid mix of characters)
        roman = Word("IVXLCDM")
        
        # any string of non-whitespace characters, except for ','
        csv_value = Word(printables, excludeChars=",")
    NrrFcstt|rFdfdd|D}|rFdfdd|D}||_t||_|rl||_t||_n||_t||_|dk|_	|dkrt
d||_|dkr||_nt
|_|dkr||_||_t||_d|j|_d	|_||_d
|j|jkr|dkr|dkr|dkr|j|jkr8dt|j|_nHt|jdkrfdt|jt|jf|_nd
t|jt|jf|_|jrd|jd|_yt|j|_Wntk
rd|_YnXdS)Nrc3s|]}|kr|VqdS)Nrx)rr)excludeCharsrxryr`
sz Word.__init__..c3s|]}|kr|VqdS)Nrx)rr)rOrxryrb
srrzZcannot specify a minimum length < 1; use Optional(Word()) if zero-length word is permittedz	Expected Fr'z[%s]+z%s[%s]*z	[%s][%s]*z\b)rr1rr
initCharsOrigr	initChars
bodyCharsOrig	bodyCharsmaxSpecifiedrminLenmaxLenr6rrrr	asKeyword_escapeRegexRangeCharsreStringrrescapecompilerq)rrQrSminmaxexactrWrO)rn)rOryr]
sT



0
z
Word.__init__Tc
CsD|jr<|j||}|s(t|||j||}||fS|||jkrZt|||j||}|d7}t|}|j}||j	}t
||}x ||kr|||kr|d7}qWd}	|||jkrd}	|jr||kr|||krd}	|j
r|dkr||d|ks||kr|||krd}	|	r4t|||j|||||fS)NrFTr)rr8r!rendgrouprQrrSrVr\rUrTrW)
rrRrrr3rHr	bodycharsrIthrowExceptionrxrxryr
s6

4zWord.parseImplcstytt|Stk
r"YnX|jdkrndd}|j|jkr^d||j||jf|_nd||j|_|jS)NcSs$t|dkr|dddS|SdS)Nz...)r)rrxrxry
charsAsStr
sz Word.__str__..charsAsStrz	W:(%s,%s)zW:(%s))rr1rrqr}rPrR)rrd)rnrxryr
s
zWord.__str__)NrrrFN)T)rrrrrrrr7rxrx)rnryr1.
s.6
#csFeZdZdZeedZdfdd	ZdddZ	fd	d
Z
ZS)
r)a
    Token for matching strings that match a given regular expression.
    Defined with string specifying the regular expression in a form recognized by the inbuilt Python re module.
    If the given regex contains named groups (defined using C{(?P...)}), these will be preserved as 
    named parse results.

    Example::
        realnum = Regex(r"[+-]?\d+\.\d*")
        date = Regex(r'(?P\d{4})-(?P\d\d?)-(?P\d\d?)')
        # ref: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression
        roman = Regex(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})")
    z[A-Z]rcstt|t|tr|s,tjdtdd||_||_	yt
|j|j	|_
|j|_Wqt
jk
rtjd|tddYqXn2t|tjr||_
t||_|_||_	ntdt||_d|j|_d|_d|_d	S)
zThe parameters C{pattern} and C{flags} are passed to the C{re.compile()} function as-is. See the Python C{re} module for an explanation of the acceptable patterns and flags.z0null string passed to Regex; use Empty() insteadrs)rz$invalid pattern (%s) passed to RegexzCRegex may only be constructed with a string or a compiled RE objectz	Expected FTN)rr)rr|rrrrpatternflagsrr[rY
sre_constantserrorcompiledREtyper~rrrrrr)rrerf)rnrxryr
s.





zRegex.__init__TcCsd|j||}|s"t|||j||}|}t|}|r\x|D]}||||<qHW||fS)N)rr8r!rr_	groupdictr$r`)rrRrrr3drrrxrxryr
s
zRegex.parseImplcsDytt|Stk
r"YnX|jdkr>dt|j|_|jS)NzRe:(%s))rr)rrqr}rre)r)rnrxryr
s
z
Regex.__str__)r)T)rrrrrrr[rirrrr7rxrx)rnryr)
s
"

cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
r'a
    Token for matching strings that are delimited by quoting characters.
    
    Defined with the following parameters:
        - quoteChar - string of one or more characters defining the quote delimiting string
        - escChar - character to escape quotes, typically backslash (default=C{None})
        - escQuote - special quote sequence to escape an embedded quote string (such as SQL's "" to escape an embedded ") (default=C{None})
        - multiline - boolean indicating whether quotes can span multiple lines (default=C{False})
        - unquoteResults - boolean indicating whether the matched text should be unquoted (default=C{True})
        - endQuoteChar - string of one or more characters defining the end of the quote delimited string (default=C{None} => same as quoteChar)
        - convertWhitespaceEscapes - convert escaped whitespace (C{'\t'}, C{'\n'}, etc.) to actual whitespace (default=C{True})

    Example::
        qs = QuotedString('"')
        print(qs.searchString('lsjdf "This is the quote" sldjf'))
        complex_qs = QuotedString('{{', endQuoteChar='}}')
        print(complex_qs.searchString('lsjdf {{This is the "quote"}} sldjf'))
        sql_qs = QuotedString('"', escQuote='""')
        print(sql_qs.searchString('lsjdf "This is the quote with ""embedded"" quotes" sldjf'))
    prints::
        [['This is the quote']]
        [['This is the "quote"']]
        [['This is the quote with "embedded" quotes']]
    NFTc
sNtt|}|s0tjdtddt|dkr>|}n"|}|s`tjdtddt|_t	|_
|d_|_t	|_
|_|_|_|_|rtjtjB_dtjtjd|dk	rt|pdf_n.rt)z|(?:%s)z|(?:%s.)z(.)z)*%sz$invalid pattern (%s) passed to Regexz	Expected FT)%rr'rrrrrSyntaxError	quoteCharrquoteCharLenfirstQuoteCharrlendQuoteCharLenescCharescQuoteunquoteResultsconvertWhitespaceEscapesr	MULTILINEDOTALLrfrZrXrerrescCharReplacePatternr[rYrgrhrrrrr)rrorsrt	multilinerurlrv)rn)rryr/sf




6

zQuotedString.__init__c	Cs|||jkr|j||pd}|s4t|||j||}|}|jr||j|j	}t
|trd|kr|jrddddd}x |
D]\}}|||}qW|jrt|jd|}|jr||j|j}||fS)N\	r)
)z\tz\nz\fz\rz\g<1>)rqrr8r!rr_r`rurprrr|rrvrrrsrryrtrl)	rrRrrr3rws_mapwslitwscharrxrxryrps( 
zQuotedString.parseImplcsFytt|Stk
r"YnX|jdkr@d|j|jf|_|jS)Nz.quoted string, starting with %s ending with %s)rr'rrqr}rorl)r)rnrxryrs
zQuotedString.__str__)NNFTNT)T)rrrrrrrr7rxrx)rnryr'sA
#cs8eZdZdZdfdd	ZdddZfd	d
ZZS)
ra
    Token for matching words composed of characters I{not} in a given set (will
    include whitespace in matched characters if not listed in the provided exclusion set - see example).
    Defined with string containing all disallowed characters, and an optional
    minimum, maximum, and/or exact length.  The default value for C{min} is 1 (a
    minimum value < 1 is not valid); the default values for C{max} and C{exact}
    are 0, meaning no maximum or exact length restriction.

    Example::
        # define a comma-separated-value as anything that is not a ','
        csv_value = CharsNotIn(',')
        print(delimitedList(csv_value).parseString("dkls,lsdkjf,s12 34,@!#,213"))
    prints::
        ['dkls', 'lsdkjf', 's12 34', '@!#', '213']
    rrcstt|d|_||_|dkr*td||_|dkr@||_nt|_|dkrZ||_||_t	||_
d|j
|_|jdk|_d|_
dS)NFrzfcannot specify a minimum length < 1; use Optional(CharsNotIn()) if zero-length char group is permittedrz	Expected )rrrrnotCharsrrUrVr6rrrrr)rrr\r]r^)rnrxryrs 
zCharsNotIn.__init__TcCs|||jkrt|||j||}|d7}|j}t||jt|}x ||krd|||krd|d7}qFW|||jkrt|||j|||||fS)Nr)rr!rr\rVrrU)rrRrrrHnotcharsmaxlenrxrxryrs
zCharsNotIn.parseImplcsdytt|Stk
r"YnX|jdkr^t|jdkrRd|jdd|_nd|j|_|jS)Nrcz
!W:(%s...)z!W:(%s))rrrrqr}rr)r)rnrxryrs
zCharsNotIn.__str__)rrr)T)rrrrrrrr7rxrx)rnryrs
cs<eZdZdZddddddZdfdd	ZdddZZS)r0a
    Special matching class for matching whitespace.  Normally, whitespace is ignored
    by pyparsing grammars.  This class is included when some whitespace structures
    are significant.  Define with a string containing the whitespace characters to be
    matched; default is C{" \t\r\n"}.  Also takes optional C{min}, C{max}, and C{exact} arguments,
    as defined for the C{L{Word}} class.
    zzzzz)r'r|r)r~r} 	
rrcstt|_dfddjDdddjD_d_dj_	|_
|dkrt|_nt_|dkr|_|_
dS)Nrc3s|]}|jkr|VqdS)N)
matchWhite)rr)rrxryrsz!White.__init__..css|]}tj|VqdS)N)r0	whiteStrs)rrrxrxryrsTz	Expected r)
rr0rrr	rrrrrrUrVr6)rwsr\r]r^)rn)rryrs zWhite.__init__TcCs|||jkrt|||j||}|d7}||j}t|t|}x"||krd|||jkrd|d7}qDW|||jkrt|||j|||||fS)Nr)rr!rrVr\rrU)rrRrrrHrIrxrxryr	s
zWhite.parseImpl)rrrr)T)rrrrrrrr7rxrx)rnryr0scseZdZfddZZS)_PositionTokencs(tt||jj|_d|_d|_dS)NTF)rrrrnrrrr)r)rnrxryrs
z_PositionToken.__init__)rrrrr7rxrx)rnryrsrcs2eZdZdZfddZddZd	ddZZS)
rzb
    Token to advance to a specific column of input text; useful for tabular report scraping.
    cstt|||_dS)N)rrrr;)rcolno)rnrxryr$szGoToColumn.__init__cCs`t|||jkr\t|}|jr*|||}x0||krZ||rZt|||jkrZ|d7}q,W|S)Nr)r;rrrisspace)rrRrrrxrxryr(s&zGoToColumn.preParseTcCsDt||}||jkr"t||d|||j|}|||}||fS)NzText not in expected column)r;r!)rrRrrthiscolnewlocrrxrxryr1s

zGoToColumn.parseImpl)T)rrrrrrrr7rxrx)rnryr s	cs*eZdZdZfddZdddZZS)ra
    Matches if current position is at the beginning of a line within the parse string
    
    Example::
    
        test = '''        AAA this line
        AAA and this line
          AAA but not this one
        B AAA and definitely not this one
        '''

        for t in (LineStart() + 'AAA' + restOfLine).searchString(test):
            print(t)
    
    Prints::
        ['AAA', ' this line']
        ['AAA', ' and this line']    

    cstt|d|_dS)NzExpected start of line)rrrr)r)rnrxryrOszLineStart.__init__TcCs*t||dkr|gfSt|||j|dS)Nr)r;r!r)rrRrrrxrxryrSszLineStart.parseImpl)T)rrrrrrr7rxrx)rnryr:scs*eZdZdZfddZdddZZS)rzU
    Matches if current position is at the end of a line within the parse string
    cs,tt||tjddd|_dS)Nr)rzExpected end of line)rrrr	r&rvrr)r)rnrxryr\szLineEnd.__init__TcCsb|t|kr6||dkr$|ddfSt|||j|n(|t|krN|dgfSt|||j|dS)Nr)r)rr!r)rrRrrrxrxryraszLineEnd.parseImpl)T)rrrrrrr7rxrx)rnryrXscs*eZdZdZfddZdddZZS)r,zM
    Matches if current position is at the beginning of the parse string
    cstt|d|_dS)NzExpected start of text)rr,rr)r)rnrxryrpszStringStart.__init__TcCs0|dkr(|||dkr(t|||j||gfS)Nr)rr!r)rrRrrrxrxryrtszStringStart.parseImpl)T)rrrrrrr7rxrx)rnryr,lscs*eZdZdZfddZdddZZS)r+zG
    Matches if current position is at the end of the parse string
    cstt|d|_dS)NzExpected end of text)rr+rr)r)rnrxryrszStringEnd.__init__TcCs^|t|krt|||j|n<|t|kr6|dgfS|t|krJ|gfSt|||j|dS)Nr)rr!r)rrRrrrxrxryrszStringEnd.parseImpl)T)rrrrrrr7rxrx)rnryr+{scs.eZdZdZeffdd	ZdddZZS)r3ap
    Matches if the current position is at the beginning of a Word, and
    is not preceded by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordStart(alphanums)}. C{WordStart} will also match at the beginning of
    the string being parsed, or at the beginning of a line.
    cs"tt|t||_d|_dS)NzNot at the start of a word)rr3rr	wordCharsr)rr)rnrxryrs
zWordStart.__init__TcCs@|dkr8||d|jks(|||jkr8t|||j||gfS)Nrr)rr!r)rrRrrrxrxryrs
zWordStart.parseImpl)T)rrrrrXrrr7rxrx)rnryr3scs.eZdZdZeffdd	ZdddZZS)r2aZ
    Matches if the current position is at the end of a Word, and
    is not followed by any character in a given set of C{wordChars}
    (default=C{printables}). To emulate the C{} behavior of regular expressions,
    use C{WordEnd(alphanums)}. C{WordEnd} will also match at the end of
    the string being parsed, or at the end of a line.
    cs(tt|t||_d|_d|_dS)NFzNot at the end of a word)rr2rrrrr)rr)rnrxryrs
zWordEnd.__init__TcCsPt|}|dkrH||krH|||jks8||d|jkrHt|||j||gfS)Nrr)rrr!r)rrRrrrrxrxryrszWordEnd.parseImpl)T)rrrrrXrrr7rxrx)rnryr2scseZdZdZdfdd	ZddZddZd	d
ZfddZfd
dZ	fddZ
dfdd	ZgfddZfddZ
ZS)r"z^
    Abstract subclass of ParserElement, for combining and post-processing parsed tokens.
    Fcstt||t|tr"t|}t|tr.F)rr"rr|rrrr&ryexprsrallrrr)rrr)rnrxryrs


zParseExpression.__init__cCs
|j|S)N)r)rrrxrxryrszParseExpression.__getitem__cCs|j|d|_|S)N)rrr})rrrxrxryrszParseExpression.appendcCs4d|_dd|jD|_x|jD]}|q W|S)z~Extends C{leaveWhitespace} defined in base class, and also invokes C{leaveWhitespace} on
           all contained expressions.FcSsg|]}|qSrx)r)rrrxrxryrsz3ParseExpression.leaveWhitespace..)rrr)rrrxrxryrs
zParseExpression.leaveWhitespacecszt|trF||jkrvtt||xP|jD]}||jdq,Wn0tt||x|jD]}||jdq^W|S)Nrt)r|r-rrr"rr)rrr)rnrxryrs

zParseExpression.ignorecsLytt|Stk
r"YnX|jdkrFd|jjt|jf|_|jS)Nz%s:(%s))	rr"rrqr}rnrrr)r)rnrxryrs
zParseExpression.__str__cs.tt|x|jD]}|qWt|jdkr|jd}t||jr|js|jdkr|j	s|jdd|jdg|_d|_
|j|jO_|j|jO_|jd}t||jr|js|jdkr|j	s|jdd|jdd|_d|_
|j|jO_|j|jO_dt
||_|S)Nrsrrrtz	Expected )rr"rrrr|rnr{r~rr}rrrr)rrr)rnrxryrs0


zParseExpression.streamlinecstt|||}|S)N)rr"r)rrrr)rnrxryr
szParseExpression.setResultsNamecCs:|dd|g}x|jD]}||qW|gdS)N)rrr)rrtmprrxrxryr
szParseExpression.validatecs$tt|}dd|jD|_|S)NcSsg|]}|qSrx)r)rrrxrxryr%
sz(ParseExpression.copy..)rr"rr)rr)rnrxryr#
szParseExpression.copy)F)F)rrrrrrrrrrrrrrr7rxrx)rnryr"s	
"csTeZdZdZGdddeZdfdd	ZdddZd	d
ZddZ	d
dZ
ZS)ra

    Requires all given C{ParseExpression}s to be found in the given order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'+'} operator.
    May also be constructed using the C{'-'} operator, which will suppress backtracking.

    Example::
        integer = Word(nums)
        name_expr = OneOrMore(Word(alphas))

        expr = And([integer("id"),name_expr("name"),integer("age")])
        # more easily written as:
        expr = integer("id") + name_expr("name") + integer("age")
    cseZdZfddZZS)zAnd._ErrorStopcs&ttj|j||d|_|dS)N-)rrrrrr)rrr)rnrxryr9
szAnd._ErrorStop.__init__)rrrrr7rxrx)rnryr8
srTcsRtt|||tdd|jD|_||jdj|jdj|_d|_	dS)Ncss|]}|jVqdS)N)r)rrrxrxryr@
szAnd.__init__..rT)
rrrrrrr	rrr)rrr)rnrxryr>
s
zAnd.__init__c	Cs|jdj|||dd\}}d}x|jddD]}t|tjrFd}q0|ry||||\}}Wqtk
rvYqtk
r}zd|_t|Wdd}~XYqt	k
rt|t
||j|YqXn||||\}}|s|r0||7}q0W||fS)NrF)rrT)
rrr|rrr%r
__traceback__rrrrr)	rrRrr
resultlist	errorStopr
exprtokensrrxrxryrE
s(z
And.parseImplcCst|trt|}||S)N)r|rr&ryr)rrrxrxryr^
s

zAnd.__iadd__cCs8|dd|g}x |jD]}|||jsPqWdS)N)rrr)rrsubRecCheckListrrxrxryrc
s

zAnd.checkRecursioncCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nr{r'css|]}t|VqdS)N)r)rrrxrxryro
szAnd.__str__..})rrr}rr)rrxrxryrj
s


 zAnd.__str__)T)T)rrrrrrrrrrrr7rxrx)rnryr(
s
csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the expression that matches the longest string will be used.
    May be constructed using the C{'^'} operator.

    Example::
        # construct Or using '^' operator
        
        number = Word(nums) ^ Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789"))
    prints::
        [['123'], ['3.1416'], ['789']]
    Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdS)N)r)rrrxrxryr
szOr.__init__..T)rrrrr@r)rrr)rnrxryr
szOr.__init__TcCsTd}d}g}x|jD]}y|||}Wnvtk
rd}	zd|	_|	j|krT|	}|	j}Wdd}	~	XYqtk
rt||krt|t||j|}t|}YqX|||fqW|r*|j	dddx`|D]X\}
}y|
|||Stk
r$}	z d|	_|	j|kr|	}|	j}Wdd}	~	XYqXqW|dk	rB|j|_|nt||d|dS)NrtcSs
|dS)Nrrx)xrxrxryrz
r{zOr.parseImpl..)rz no defined alternatives to match)rrr!rrrrrrsortrr)rrRrr	maxExcLocmaxExceptionrrloc2r_rxrxryr
s<

zOr.parseImplcCst|trt|}||S)N)r|rr&ryr)rrrxrxry__ixor__
s

zOr.__ixor__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz ^ css|]}t|VqdS)N)r)rrrxrxryr
szOr.__str__..r)rrr}rr)rrxrxryr
s


 z
Or.__str__cCs0|dd|g}x|jD]}||qWdS)N)rr)rrrrrxrxryr
szOr.checkRecursion)F)T)
rrrrrrrrrr7rxrx)rnryrt
s

&	csDeZdZdZdfdd	ZdddZdd	Zd
dZdd
ZZ	S)ra
    Requires that at least one C{ParseExpression} is found.
    If two expressions match, the first one listed is the one that will match.
    May be constructed using the C{'|'} operator.

    Example::
        # construct MatchFirst using '|' operator
        
        # watch the order of expressions to match
        number = Word(nums) | Combine(Word(nums) + '.' + Word(nums))
        print(number.searchString("123 3.1416 789")) #  Fail! -> [['123'], ['3'], ['1416'], ['789']]

        # put more selective expression first
        number = Combine(Word(nums) + '.' + Word(nums)) | Word(nums)
        print(number.searchString("123 3.1416 789")) #  Better -> [['123'], ['3.1416'], ['789']]
    Fcs:tt||||jr0tdd|jD|_nd|_dS)Ncss|]}|jVqdS)N)r)rrrxrxryr
sz&MatchFirst.__init__..T)rrrrr@r)rrr)rnrxryr
szMatchFirst.__init__Tc	Csd}d}x|jD]}y||||}|Stk
r\}z|j|krL|}|j}Wdd}~XYqtk
rt||krt|t||j|}t|}YqXqW|dk	r|j|_|nt||d|dS)Nrtz no defined alternatives to match)rrr!rrrrr)	rrRrrrrrrrrxrxryr
s$
zMatchFirst.parseImplcCst|trt|}||S)N)r|rr&ryr)rrrxrxry__ior__
s

zMatchFirst.__ior__cCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz | css|]}t|VqdS)N)r)rrrxrxryr
sz%MatchFirst.__str__..r)rrr}rr)rrxrxryr
s


 zMatchFirst.__str__cCs0|dd|g}x|jD]}||qWdS)N)rr)rrrrrxrxryrszMatchFirst.checkRecursion)F)T)
rrrrrrrrrr7rxrx)rnryr
s
	cs<eZdZdZdfdd	ZdddZddZd	d
ZZS)
ram
    Requires all given C{ParseExpression}s to be found, but in any order.
    Expressions may be separated by whitespace.
    May be constructed using the C{'&'} operator.

    Example::
        color = oneOf("RED ORANGE YELLOW GREEN BLUE PURPLE BLACK WHITE BROWN")
        shape_type = oneOf("SQUARE CIRCLE TRIANGLE STAR HEXAGON OCTAGON")
        integer = Word(nums)
        shape_attr = "shape:" + shape_type("shape")
        posn_attr = "posn:" + Group(integer("x") + ',' + integer("y"))("posn")
        color_attr = "color:" + color("color")
        size_attr = "size:" + integer("size")

        # use Each (using operator '&') to accept attributes in any order 
        # (shape and posn are required, color and size are optional)
        shape_spec = shape_attr & posn_attr & Optional(color_attr) & Optional(size_attr)

        shape_spec.runTests('''
            shape: SQUARE color: BLACK posn: 100, 120
            shape: CIRCLE size: 50 color: BLUE posn: 50,80
            color:GREEN size:20 shape:TRIANGLE posn:20,40
            '''
            )
    prints::
        shape: SQUARE color: BLACK posn: 100, 120
        ['shape:', 'SQUARE', 'color:', 'BLACK', 'posn:', ['100', ',', '120']]
        - color: BLACK
        - posn: ['100', ',', '120']
          - x: 100
          - y: 120
        - shape: SQUARE


        shape: CIRCLE size: 50 color: BLUE posn: 50,80
        ['shape:', 'CIRCLE', 'size:', '50', 'color:', 'BLUE', 'posn:', ['50', ',', '80']]
        - color: BLUE
        - posn: ['50', ',', '80']
          - x: 50
          - y: 80
        - shape: CIRCLE
        - size: 50


        color: GREEN size: 20 shape: TRIANGLE posn: 20,40
        ['color:', 'GREEN', 'size:', '20', 'shape:', 'TRIANGLE', 'posn:', ['20', ',', '40']]
        - color: GREEN
        - posn: ['20', ',', '40']
          - x: 20
          - y: 40
        - shape: TRIANGLE
        - size: 20
    Tcs8tt|||tdd|jD|_d|_d|_dS)Ncss|]}|jVqdS)N)r)rrrxrxryr?sz Each.__init__..T)rrrrrrrinitExprGroups)rrr)rnrxryr=sz
Each.__init__c	s|jrtdd|jD|_dd|jD}dd|jD}|||_dd|jD|_dd|jD|_dd|jD|_|j|j7_d	|_|}|jdd}|jddg}d
}	x|	rp||j|j}
g}x~|
D]v}y|||}Wn t	k
r|
|YqX|
|jt||||krD|
|q|kr
|qWt|t|
krd	}	qW|rddd|D}
t	||d
|
|fdd|jD7}g}x*|D]"}||||\}}|
|qWt|tg}||fS)Ncss&|]}t|trt|j|fVqdS)N)r|rr!rS)rrrxrxryrEsz!Each.parseImpl..cSsg|]}t|tr|jqSrx)r|rrS)rrrxrxryrFsz"Each.parseImpl..cSs g|]}|jrt|ts|qSrx)rr|r)rrrxrxryrGscSsg|]}t|tr|jqSrx)r|r4rS)rrrxrxryrIscSsg|]}t|tr|jqSrx)r|rrS)rrrxrxryrJscSs g|]}t|tttfs|qSrx)r|rr4r)rrrxrxryrKsFTz, css|]}t|VqdS)N)r)rrrxrxryrfsz*Missing one or more required elements (%s)cs$g|]}t|tr|jkr|qSrx)r|rrS)rr)tmpOptrxryrjs)rrropt1map	optionalsmultioptionals
multirequiredrequiredrr!rrr!removerrrsumr$)rrRrropt1opt2tmpLoctmpReqd
matchOrderkeepMatchingtmpExprsfailedrmissingrrNfinalResultsrx)rryrCsP



zEach.parseImplcCs@t|dr|jS|jdkr:dddd|jDd|_|jS)Nrrz & css|]}t|VqdS)N)r)rrrxrxryryszEach.__str__..r)rrr}rr)rrxrxryrts


 zEach.__str__cCs0|dd|g}x|jD]}||qWdS)N)rr)rrrrrxrxryr}szEach.checkRecursion)T)T)	rrrrrrrrr7rxrx)rnryrs
5
1	csleZdZdZdfdd	ZdddZdd	Zfd
dZfdd
ZddZ	gfddZ
fddZZS)r za
    Abstract subclass of C{ParserElement}, for combining and post-processing parsed tokens.
    Fcstt||t|tr@ttjtr2t|}ntt	|}||_
d|_|dk	r|j|_|j
|_
||j|j|_|j|_|j|_|j|jdS)N)rr rr|r
issubclassr&ryr.rrSr}rrr	rrrrrr)rrSr)rnrxryrs
zParseElementEnhance.__init__TcCs2|jdk	r|jj|||ddStd||j|dS)NF)rr)rSrr!r)rrRrrrxrxryrs
zParseElementEnhance.parseImplcCs*d|_|j|_|jdk	r&|j|S)NF)rrSrr)rrxrxryrs


z#ParseElementEnhance.leaveWhitespacecsrt|trB||jkrntt|||jdk	rn|j|jdn,tt|||jdk	rn|j|jd|S)Nrt)r|r-rrr rrS)rr)rnrxryrs



zParseElementEnhance.ignorecs&tt||jdk	r"|j|S)N)rr rrS)r)rnrxryrs

zParseElementEnhance.streamlinecCsB||krt||g|dd|g}|jdk	r>|j|dS)N)r(rSr)rrrrxrxryrs

z"ParseElementEnhance.checkRecursioncCs6|dd|g}|jdk	r(|j||gdS)N)rSrr)rrrrxrxryrs
zParseElementEnhance.validatecsVytt|Stk
r"YnX|jdkrP|jdk	rPd|jjt|jf|_|jS)Nz%s:(%s))	rr rrqr}rSrnrr)r)rnrxryrszParseElementEnhance.__str__)F)T)
rrrrrrrrrrrrr7rxrx)rnryr s
cs*eZdZdZfddZdddZZS)ra
    Lookahead matching of the given parse expression.  C{FollowedBy}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression matches at the current
    position.  C{FollowedBy} always returns a null token list.

    Example::
        # use FollowedBy to match a label only if it is followed by a ':'
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        OneOrMore(attr_expr).parseString("shape: SQUARE color: BLACK posn: upper left").pprint()
    prints::
        [['shape', 'SQUARE'], ['color', 'BLACK'], ['posn', 'upper left']]
    cstt||d|_dS)NT)rrrr)rrS)rnrxryrszFollowedBy.__init__TcCs|j|||gfS)N)rSr)rrRrrrxrxryrszFollowedBy.parseImpl)T)rrrrrrr7rxrx)rnryrscs2eZdZdZfddZd	ddZddZZS)
ra
    Lookahead to disallow matching with the given parse expression.  C{NotAny}
    does I{not} advance the parsing position within the input string, it only
    verifies that the specified parse expression does I{not} match at the current
    position.  Also, C{NotAny} does I{not} skip over leading whitespace. C{NotAny}
    always returns a null token list.  May be constructed using the '~' operator.

    Example::
        
    cs0tt||d|_d|_dt|j|_dS)NFTzFound unwanted token, )rrrrrrrSr)rrS)rnrxryrszNotAny.__init__TcCs&|j||rt|||j||gfS)N)rSrr!r)rrRrrrxrxryrszNotAny.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrz~{r)rrr}rrS)rrxrxryrs


zNotAny.__str__)T)rrrrrrrr7rxrx)rnryrs

cs(eZdZdfdd	ZdddZZS)	_MultipleMatchNcsFtt||d|_|}t|tr.t|}|dk	r<|nd|_dS)NT)	rrrrr|rr&ry	not_ender)rrSstopOnender)rnrxryrs

z_MultipleMatch.__init__Tc	Cs|jj}|j}|jdk	}|r$|jj}|r2|||||||dd\}}yZ|j}	xJ|rb||||	rr|||}
n|}
|||
|\}}|s|rT||7}qTWWnttfk
rYnX||fS)NF)r)	rSrrrrrrr!r)rrRrrself_expr_parseself_skip_ignorablescheck_ender
try_not_enderrhasIgnoreExprsr	tmptokensrxrxryrs,



z_MultipleMatch.parseImpl)N)T)rrrrrr7rxrx)rnryr
src@seZdZdZddZdS)ra
    Repetition of one or more of the given expression.
    
    Parameters:
     - expr - expression that must match one or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: BLACK"
        OneOrMore(attr_expr).parseString(text).pprint()  # Fail! read 'color' as data instead of next label -> [['shape', 'SQUARE color']]

        # use stopOn attribute for OneOrMore to avoid reading label string as part of the data
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        OneOrMore(attr_expr).parseString(text).pprint() # Better -> [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'BLACK']]
        
        # could also be written as
        (attr_expr * (1,)).parseString(text).pprint()
    cCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz}...)rrr}rrS)rrxrxryrJs


zOneOrMore.__str__N)rrrrrrxrxrxryr0scs8eZdZdZd
fdd	Zdfdd	Zdd	ZZS)r4aw
    Optional repetition of zero or more of the given expression.
    
    Parameters:
     - expr - expression that must match zero or more times
     - stopOn - (default=C{None}) - expression for a terminating sentinel
          (only required if the sentinel would ordinarily match the repetition 
          expression)          

    Example: similar to L{OneOrMore}
    Ncstt|j||dd|_dS)N)rT)rr4rr)rrSr)rnrxryr_szZeroOrMore.__init__Tc	s6ytt||||Sttfk
r0|gfSXdS)N)rr4rr!r)rrRrr)rnrxryrcszZeroOrMore.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrz]...)rrr}rrS)rrxrxryris


zZeroOrMore.__str__)N)T)rrrrrrrr7rxrx)rnryr4Ssc@s eZdZddZeZddZdS)
_NullTokencCsdS)NFrx)rrxrxryrssz_NullToken.__bool__cCsdS)Nrrx)rrxrxryrvsz_NullToken.__str__N)rrrrrJrrxrxrxryrrsrcs6eZdZdZeffdd	Zd	ddZddZZS)
raa
    Optional matching of the given expression.

    Parameters:
     - expr - expression that must match zero or more times
     - default (optional) - value to be returned if the optional expression is not found.

    Example::
        # US postal code can be a 5-digit zip, plus optional 4-digit qualifier
        zip = Combine(Word(nums, exact=5) + Optional('-' + Word(nums, exact=4)))
        zip.runTests('''
            # traditional ZIP code
            12345
            
            # ZIP+4 form
            12101-0001
            
            # invalid ZIP
            98765-
            ''')
    prints::
        # traditional ZIP code
        12345
        ['12345']

        # ZIP+4 form
        12101-0001
        ['12101-0001']

        # invalid ZIP
        98765-
             ^
        FAIL: Expected end of text (at char 5), (line:1, col:6)
    cs.tt|j|dd|jj|_||_d|_dS)NF)rT)rrrrSrrr)rrSr)rnrxryrs
zOptional.__init__Tc	Cszy|jj|||dd\}}WnTttfk
rp|jtk	rh|jjr^t|jg}|j||jj<ql|jg}ng}YnX||fS)NF)r)rSrr!rr_optionalNotMatchedr~r$)rrRrrrrxrxryrs


zOptional.parseImplcCs4t|dr|jS|jdkr.dt|jd|_|jS)Nrrr )rrr}rrS)rrxrxryrs


zOptional.__str__)T)	rrrrrrrrr7rxrx)rnryrzs"
cs,eZdZdZd	fdd	Zd
ddZZS)r*a	
    Token for skipping over all undefined text until the matched expression is found.

    Parameters:
     - expr - target expression marking the end of the data to be skipped
     - include - (default=C{False}) if True, the target expression is also parsed 
          (the skipped text and target expression are returned as a 2-element list).
     - ignore - (default=C{None}) used to define grammars (typically quoted strings and 
          comments) that might contain false matches to the target expression
     - failOn - (default=C{None}) define expressions that are not allowed to be 
          included in the skipped test; if found before the target expression is found, 
          the SkipTo is not a match

    Example::
        report = '''
            Outstanding Issues Report - 1 Jan 2000

               # | Severity | Description                               |  Days Open
            -----+----------+-------------------------------------------+-----------
             101 | Critical | Intermittent system crash                 |          6
              94 | Cosmetic | Spelling error on Login ('log|n')         |         14
              79 | Minor    | System slow when running too many reports |         47
            '''
        integer = Word(nums)
        SEP = Suppress('|')
        # use SkipTo to simply match everything up until the next SEP
        # - ignore quoted strings, so that a '|' character inside a quoted string does not match
        # - parse action will call token.strip() for each matched token, i.e., the description body
        string_data = SkipTo(SEP, ignore=quotedString)
        string_data.setParseAction(tokenMap(str.strip))
        ticket_expr = (integer("issue_num") + SEP 
                      + string_data("sev") + SEP 
                      + string_data("desc") + SEP 
                      + integer("days_open"))
        
        for tkt in ticket_expr.searchString(report):
            print tkt.dump()
    prints::
        ['101', 'Critical', 'Intermittent system crash', '6']
        - days_open: 6
        - desc: Intermittent system crash
        - issue_num: 101
        - sev: Critical
        ['94', 'Cosmetic', "Spelling error on Login ('log|n')", '14']
        - days_open: 14
        - desc: Spelling error on Login ('log|n')
        - issue_num: 94
        - sev: Cosmetic
        ['79', 'Minor', 'System slow when running too many reports', '47']
        - days_open: 47
        - desc: System slow when running too many reports
        - issue_num: 79
        - sev: Minor
    FNcs`tt||||_d|_d|_||_d|_t|t	rFt
||_n||_dt
|j|_dS)NTFzNo match found for )rr*r
ignoreExprrrincludeMatchrr|rr&ryfailOnrrSr)rrincluderr)rnrxryrs
zSkipTo.__init__Tc	Cs,|}t|}|j}|jj}|jdk	r,|jjnd}|jdk	rB|jjnd}	|}
x|
|kr|dk	rh|||
rhP|	dk	rx*y|	||
}
Wqrtk
rPYqrXqrWy|||
dddWn tt	fk
r|
d7}
YqLXPqLWt|||j
||
}|||}t|}|jr$||||dd\}}
||
7}||fS)NF)rrr)r)
rrSrrrrrrr!rrr$r)rrRrrrUrrS
expr_parseself_failOn_canParseNextself_ignoreExpr_tryParsetmplocskiptext
skipresultrMrxrxryrs<

zSkipTo.parseImpl)FNN)T)rrrrrrr7rxrx)rnryr*s6
csbeZdZdZdfdd	ZddZddZd	d
ZddZgfd
dZ	ddZ
fddZZS)raK
    Forward declaration of an expression to be defined later -
    used for recursive grammars, such as algebraic infix notation.
    When the expression is known, it is assigned to the C{Forward} variable using the '<<' operator.

    Note: take care when assigning to C{Forward} not to overlook precedence of operators.
    Specifically, '|' has a lower precedence than '<<', so that::
        fwdExpr << a | b | c
    will actually be evaluated as::
        (fwdExpr << a) | b | c
    thereby leaving b and c out as parseable alternatives.  It is recommended that you
    explicitly group the values inserted into the C{Forward}::
        fwdExpr << (a | b | c)
    Converting to use the '<<=' operator instead will avoid this problem.

    See L{ParseResults.pprint} for an example of a recursive parser created using
    C{Forward}.
    Ncstt|j|dddS)NF)r)rrr)rr)rnrxryr@szForward.__init__cCsjt|trt|}||_d|_|jj|_|jj|_||jj	|jj
|_
|jj|_|j
|jj|S)N)r|rr&ryrSr}rrr	rrrrr)rrrxrxry
__lshift__Cs





zForward.__lshift__cCs||>S)Nrx)rrrxrxry__ilshift__PszForward.__ilshift__cCs
d|_|S)NF)r)rrxrxryrSszForward.leaveWhitespacecCs$|js d|_|jdk	r |j|S)NT)rrSr)rrxrxryrWs


zForward.streamlinecCs>||kr0|dd|g}|jdk	r0|j||gdS)N)rSrr)rrrrxrxryr^s

zForward.validatecCs>t|dr|jS|jjdSd}Wd|j|_X|jjd|S)Nrz: ...Nonez: )rrrnrZ_revertClass_ForwardNoRecurserSr)r	retStringrxrxryres

zForward.__str__cs.|jdk	rtt|St}||K}|SdS)N)rSrrr)rr)rnrxryrvs

zForward.copy)N)
rrrrrrrrrrrrr7rxrx)rnryr-s
c@seZdZddZdS)rcCsdS)Nz...rx)rrxrxryrsz_ForwardNoRecurse.__str__N)rrrrrxrxrxryr~srcs"eZdZdZdfdd	ZZS)r/zQ
    Abstract subclass of C{ParseExpression}, for converting parsed results.
    Fcstt||d|_dS)NF)rr/rr)rrSr)rnrxryrszTokenConverter.__init__)F)rrrrrr7rxrx)rnryr/scs6eZdZdZd
fdd	ZfddZdd	ZZS)ra
    Converter to concatenate all matching tokens to a single string.
    By default, the matching patterns must also be contiguous in the input string;
    this can be disabled by specifying C{'adjacent=False'} in the constructor.

    Example::
        real = Word(nums) + '.' + Word(nums)
        print(real.parseString('3.1416')) # -> ['3', '.', '1416']
        # will also erroneously match the following
        print(real.parseString('3. 1416')) # -> ['3', '.', '1416']

        real = Combine(Word(nums) + '.' + Word(nums))
        print(real.parseString('3.1416')) # -> ['3.1416']
        # no match when there are internal spaces
        print(real.parseString('3. 1416')) # -> Exception: Expected W:(0123...)
    rTcs8tt|||r|||_d|_||_d|_dS)NT)rrrradjacentr
joinStringr)rrSrr)rnrxryrszCombine.__init__cs(|jrt||ntt|||S)N)rr&rrr)rr)rnrxryrszCombine.ignorecCsP|}|dd=|td||jg|jd7}|jrH|rH|gS|SdS)Nr)r)rr$rr!rrr~r)rrRrrretToksrxrxryrs
"zCombine.postParse)rT)rrrrrrrr7rxrx)rnryrs
cs(eZdZdZfddZddZZS)ra
    Converter to return the matched tokens as a list - useful for returning tokens of C{L{ZeroOrMore}} and C{L{OneOrMore}} expressions.

    Example::
        ident = Word(alphas)
        num = Word(nums)
        term = ident | num
        func = ident + Optional(delimitedList(term))
        print(func.parseString("fn a,b,100"))  # -> ['fn', 'a', 'b', '100']

        func = ident + Group(Optional(delimitedList(term)))
        print(func.parseString("fn a,b,100"))  # -> ['fn', ['a', 'b', '100']]
    cstt||d|_dS)NT)rrrr)rrS)rnrxryrszGroup.__init__cCs|gS)Nrx)rrRrrrxrxryrszGroup.postParse)rrrrrrr7rxrx)rnryrs
cs(eZdZdZfddZddZZS)r
aW
    Converter to return a repetitive expression as a list, but also as a dictionary.
    Each element can also be referenced using the first token in the expression as its key.
    Useful for tabular report scraping when the first column can be used as a item key.

    Example::
        data_word = Word(alphas)
        label = data_word + FollowedBy(':')
        attr_expr = Group(label + Suppress(':') + OneOrMore(data_word).setParseAction(' '.join))

        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        
        # print attributes as plain groups
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        # instead of OneOrMore(expr), parse using Dict(OneOrMore(Group(expr))) - Dict will auto-assign names
        result = Dict(OneOrMore(Group(attr_expr))).parseString(text)
        print(result.dump())
        
        # access named fields as dict entries, or output as dict
        print(result['shape'])        
        print(result.asDict())
    prints::
        ['shape', 'SQUARE', 'posn', 'upper left', 'color', 'light blue', 'texture', 'burlap']

        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        {'color': 'light blue', 'posn': 'upper left', 'texture': 'burlap', 'shape': 'SQUARE'}
    See more examples at L{ParseResults} of accessing fields by results name.
    cstt||d|_dS)NT)rr
rr)rrS)rnrxryrsz
Dict.__init__cCsxt|D]\}}t|dkr q
|d}t|trBt|d}t|dkr^td|||<q
t|dkrt|dtst|d|||<q
|}|d=t|dkst|tr|	rt||||<q
t|d|||<q
W|j
r|gS|SdS)Nrrrrs)rrr|rvrrrr$rrr~)rrRrrrtokikey	dictvaluerxrxryrs$
zDict.postParse)rrrrrrr7rxrx)rnryr
s#c@s eZdZdZddZddZdS)r-aV
    Converter for ignoring the results of a parsed expression.

    Example::
        source = "a, b, c,d"
        wd = Word(alphas)
        wd_list1 = wd + ZeroOrMore(',' + wd)
        print(wd_list1.parseString(source))

        # often, delimiters that are useful during parsing are just in the
        # way afterward - use Suppress to keep them out of the parsed output
        wd_list2 = wd + ZeroOrMore(Suppress(',') + wd)
        print(wd_list2.parseString(source))
    prints::
        ['a', ',', 'b', ',', 'c', ',', 'd']
        ['a', 'b', 'c', 'd']
    (See also L{delimitedList}.)
    cCsgS)Nrx)rrRrrrxrxryrszSuppress.postParsecCs|S)Nrx)rrxrxryr"szSuppress.suppressN)rrrrrrrxrxrxryr-sc@s(eZdZdZddZddZddZdS)	rzI
    Wrapper for parse actions, to ensure they are only called once.
    cCst||_d|_dS)NF)rucallablecalled)r
methodCallrxrxryr*s
zOnlyOnce.__init__cCs.|js||||}d|_|St||ddS)NTr)rrr!)rrr[rwrNrxrxryr-s
zOnlyOnce.__call__cCs
d|_dS)NF)r)rrxrxryreset3szOnlyOnce.resetN)rrrrrrrrxrxrxryr&scs:tfdd}yj|_Wntk
r4YnX|S)at
    Decorator for debugging parse actions. 
    
    When the parse action is called, this decorator will print C{">> entering I{method-name}(line:I{current_source_line}, I{parse_location}, I{matched_tokens})".}
    When the parse action completes, the decorator will print C{"<<"} followed by the returned value, or any exception that the parse action raised.

    Example::
        wd = Word(alphas)

        @traceParseAction
        def remove_duplicate_chars(tokens):
            return ''.join(sorted(set(''.join(tokens))))

        wds = OneOrMore(wd).setParseAction(remove_duplicate_chars)
        print(wds.parseString("slkdjs sld sldd sdlf sdljf"))
    prints::
        >>entering remove_duplicate_chars(line: 'slkdjs sld sldd sdlf sdljf', 0, (['slkdjs', 'sld', 'sldd', 'sdlf', 'sdljf'], {}))
        <>entering %s(line: '%s', %d, %r)
z<.z)rurr)rrrx)rryrd6s
,FcCs`t|dt|dt|d}|rBt|t|||S|tt|||SdS)a
    Helper to define a delimited list of expressions - the delimiter defaults to ','.
    By default, the list elements and delimiters can have intervening whitespace, and
    comments, but this can be overridden by passing C{combine=True} in the constructor.
    If C{combine} is set to C{True}, the matching tokens are returned as a single token
    string, with the delimiters included; otherwise, the matching tokens are returned
    as a list of tokens, with the delimiters suppressed.

    Example::
        delimitedList(Word(alphas)).parseString("aa,bb,cc") # -> ['aa', 'bb', 'cc']
        delimitedList(Word(hexnums), delim=':', combine=True).parseString("AA:BB:CC:DD:EE") # -> ['AA:BB:CC:DD:EE']
    z [r'z]...N)rrr4rr-)rSdelimcombinedlNamerxrxryrBbs
$csjtfdd}|dkr0ttdd}n|}|d|j|dd|d	td
S)a:
    Helper to define a counted list of expressions.
    This helper defines a pattern of the form::
        integer expr expr expr...
    where the leading integer tells how many expr expressions follow.
    The matched tokens returns the array of expr tokens as a list - the leading count token is suppressed.
    
    If C{intExpr} is specified, it should be a pyparsing expression that produces an integer value.

    Example::
        countedArray(Word(alphas)).parseString('2 ab cd ef')  # -> ['ab', 'cd']

        # in this parser, the leading integer value is given in binary,
        # '10' indicating that 2 values are in the array
        binaryConstant = Word('01').setParseAction(lambda t: int(t[0], 2))
        countedArray(Word(alphas), intExpr=binaryConstant).parseString('10 ab cd ef')  # -> ['ab', 'cd']
    cs.|d}|r ttg|p&tt>gS)Nr)rrrE)rr[rwr)	arrayExprrSrxrycountFieldParseActions"z+countedArray..countFieldParseActionNcSst|dS)Nr)rv)rwrxrxryrzr{zcountedArray..arrayLenT)rz(len) z...)rr1rTrrrrr)rSintExprrrx)rrSryr>us
cCs:g}x0|D](}t|tr(|t|q
||q
W|S)N)r|rrrr)Lrrrxrxryrs

rcs6tfdd}|j|dddt|S)a*
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousLiteral(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches a
    previous literal, will also match the leading C{"1:1"} in C{"1:10"}.
    If this is not desired, use C{matchPreviousExpr}.
    Do I{not} use with packrat parsing enabled.
    csP|rBt|dkr|d>qLt|}tdd|D>n
t>dS)Nrrcss|]}t|VqdS)N)r)rttrxrxryrszDmatchPreviousLiteral..copyTokenToRepeater..)rrrrr)rr[rwtflat)reprxrycopyTokenToRepeatersz1matchPreviousLiteral..copyTokenToRepeaterT)rz(prev) )rrrr)rSrrx)rryrQs


csFt|}|Kfdd}|j|dddt|S)aS
    Helper to define an expression that is indirectly defined from
    the tokens matched in a previous expression, that is, it looks
    for a 'repeat' of a previous expression.  For example::
        first = Word(nums)
        second = matchPreviousExpr(first)
        matchExpr = first + ":" + second
    will match C{"1:1"}, but not C{"1:2"}.  Because this matches by
    expressions, will I{not} match the leading C{"1:1"} in C{"1:10"};
    the expressions are evaluated first, and then compared, so
    C{"1"} is compared with C{"10"}.
    Do I{not} use with packrat parsing enabled.
    cs*t|fdd}j|dddS)Ncs$t|}|kr tddddS)Nrr)rrr!)rr[rwtheseTokens)matchTokensrxrymustMatchTheseTokensszLmatchPreviousExpr..copyTokenToRepeater..mustMatchTheseTokensT)r)rrr)rr[rwr)r)rryrsz.matchPreviousExpr..copyTokenToRepeaterT)rz(prev) )rrrrr)rSe2rrx)rryrPscCs>xdD]}||t|}qW|dd}|dd}t|S)Nz\^-]r)z\nr|z\t)r_bslashr)rrrxrxryrXs

rXTc
s|rdd}dd}tndd}dd}tg}t|trF|}n$t|trZt|}ntjdt	dd|stt
Sd	}x|t|d
kr||}xnt||d
dD]N\}}	||	|r|||d
=Pq|||	r|||d
=|
||	|	}PqW|d
7}qzW|s|ryht|td|krVtd
ddd|Dd|Stddd|Dd|SWn&tk
rtjdt	ddYnXtfdd|Dd|S)a
    Helper to quickly define a set of alternative Literals, and makes sure to do
    longest-first testing when there is a conflict, regardless of the input order,
    but returns a C{L{MatchFirst}} for best performance.

    Parameters:
     - strs - a string of space-delimited literals, or a collection of string literals
     - caseless - (default=C{False}) - treat all literals as caseless
     - useRegex - (default=C{True}) - as an optimization, will generate a Regex
          object; otherwise, will generate a C{MatchFirst} object (if C{caseless=True}, or
          if creating a C{Regex} raises an exception)

    Example::
        comp_oper = oneOf("< = > <= >= !=")
        var = Word(alphas)
        number = Word(nums)
        term = var | number
        comparison_expr = term + comp_oper + term
        print(comparison_expr.searchString("B = 12  AA=23 B<=AA AA>12"))
    prints::
        [['B', '=', '12'], ['AA', '=', '23'], ['B', '<=', 'AA'], ['AA', '>', '12']]
    cSs||kS)N)r?)rbrxrxryrzr{zoneOf..cSs||S)N)r?r<)rrrxrxryrzr{cSs||kS)Nrx)rrrxrxryrzr{cSs
||S)N)r<)rrrxrxryrzr{z6Invalid argument to oneOf, expected string or iterablers)rrrNrz[%s]css|]}t|VqdS)N)rX)rsymrxrxryrszoneOf..z | |css|]}t|VqdS)N)rrZ)rrrxrxryrsz7Exception creating Regex for oneOf, building MatchFirstc3s|]}|VqdS)Nrx)rr)parseElementClassrxryr$s)r
rr|rrrrrrrrrrr
rr)rrqr)
strsr>useRegexisequalmaskssymbolsrcurrrrx)rryrUsL






((cCsttt||S)a
    Helper to easily and clearly define a dictionary by specifying the respective patterns
    for the key and value.  Takes care of defining the C{L{Dict}}, C{L{ZeroOrMore}}, and C{L{Group}} tokens
    in the proper order.  The key pattern can include delimiting markers or punctuation,
    as long as they are suppressed, thereby leaving the significant key text.  The value
    pattern can include named results, so that the C{Dict} results can include named token
    fields.

    Example::
        text = "shape: SQUARE posn: upper left color: light blue texture: burlap"
        attr_expr = (label + Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join))
        print(OneOrMore(attr_expr).parseString(text).dump())
        
        attr_label = label
        attr_value = Suppress(':') + OneOrMore(data_word, stopOn=label).setParseAction(' '.join)

        # similar to Dict, but simpler call format
        result = dictOf(attr_label, attr_value).parseString(text)
        print(result.dump())
        print(result['shape'])
        print(result.shape)  # object attribute access works too
        print(result.asDict())
    prints::
        [['shape', 'SQUARE'], ['posn', 'upper left'], ['color', 'light blue'], ['texture', 'burlap']]
        - color: light blue
        - posn: upper left
        - shape: SQUARE
        - texture: burlap
        SQUARE
        SQUARE
        {'color': 'light blue', 'shape': 'SQUARE', 'posn': 'upper left', 'texture': 'burlap'}
    )r
r4r)rrrxrxryrC&s!cCs^tdd}|}d|_|d||d}|r@dd}ndd}|||j|_|S)	a
    Helper to return the original, untokenized text for a given expression.  Useful to
    restore the parsed fields of an HTML start tag into the raw tag text itself, or to
    revert separate tokens with intervening whitespace back to the original matching
    input text. By default, returns astring containing the original parsed text.  
       
    If the optional C{asString} argument is passed as C{False}, then the return value is a 
    C{L{ParseResults}} containing any results names that were originally matched, and a 
    single token containing the original matched text from the input string.  So if 
    the expression passed to C{L{originalTextFor}} contains expressions with defined
    results names, you must set C{asString} to C{False} if you want to preserve those
    results name values.

    Example::
        src = "this is test  bold text  normal text "
        for tag in ("b","i"):
            opener,closer = makeHTMLTags(tag)
            patt = originalTextFor(opener + SkipTo(closer) + closer)
            print(patt.searchString(src)[0])
    prints::
        [' bold text ']
        ['text']
    cSs|S)Nrx)rrrwrxrxryrzar{z!originalTextFor..F_original_start
_original_endcSs||j|jS)N)rr)rr[rwrxrxryrzfr{cSs&||d|dg|dd<dS)Nrr)r
)rr[rwrxrxryextractTexthsz$originalTextFor..extractText)rrrrr)rSasString	locMarkerendlocMarker	matchExprrrxrxryriIs

cCst|ddS)zp
    Helper to undo pyparsing's default grouping of And expressions, even
    if all but one are non-empty.
    cSs|dS)Nrrx)rwrxrxryrzsr{zungroup..)r/r)rSrxrxryrjnscCs4tdd}t|d|d|dS)a
    Helper to decorate a returned token with its starting and ending locations in the input string.
    This helper adds the following results names:
     - locn_start = location where matched expression begins
     - locn_end = location where matched expression ends
     - value = the actual parsed results

    Be careful if the input text contains C{} characters, you may want to call
    C{L{ParserElement.parseWithTabs}}

    Example::
        wd = Word(alphas)
        for match in locatedExpr(wd).searchString("ljsdf123lksdjjf123lkkjj1222"):
            print(match)
    prints::
        [[0, 'ljsdf', 5]]
        [[8, 'lksdjjf', 15]]
        [[18, 'lkkjj', 23]]
    cSs|S)Nrx)rr[rwrxrxryrzr{zlocatedExpr..
locn_startrlocn_end)rrrrr)rSlocatorrxrxryrlusz\[]-*.$+^?()~ )r^cCs|ddS)Nrrrx)rr[rwrxrxryrzr{rzz\\0?[xX][0-9a-fA-F]+cCstt|dddS)Nrz\0x)unichrrvlstrip)rr[rwrxrxryrzr{z	\\0[0-7]+cCstt|ddddS)Nrr)rrv)rr[rwrxrxryrzr{z\]rrr(negatebodyr csBddy dfddt|jDStk
r<dSXdS)a
    Helper to easily define string ranges for use in Word construction.  Borrows
    syntax from regexp '[]' string range definitions::
        srange("[0-9]")   -> "0123456789"
        srange("[a-z]")   -> "abcdefghijklmnopqrstuvwxyz"
        srange("[a-z$_]") -> "abcdefghijklmnopqrstuvwxyz$_"
    The input string must be enclosed in []'s, and the returned string is the expanded
    character set joined into a single string.
    The values enclosed in the []'s may be:
     - a single character
     - an escaped character with a leading backslash (such as C{\-} or C{\]})
     - an escaped hex character with a leading C{'\x'} (C{\x21}, which is a C{'!'} character) 
         (C{\0x##} is also supported for backwards compatibility) 
     - an escaped octal character with a leading C{'\0'} (C{\041}, which is a C{'!'} character)
     - a range of any of the above, separated by a dash (C{'a-z'}, etc.)
     - any combination of the above (C{'aeiouy'}, C{'a-zA-Z0-9_$'}, etc.)
    cSs<t|ts|Sdddtt|dt|ddDS)Nrcss|]}t|VqdS)N)r)rrrxrxryrsz+srange....rr)r|r$rrord)prxrxryrzr{zsrange..rc3s|]}|VqdS)Nrx)rpart)	_expandedrxryrszsrange..N)r_reBracketExprrrrq)rrx)rryras
 csfdd}|S)zt
    Helper method for defining parse actions that require matching at a specific
    column in the input text.
    cs"t||krt||ddS)Nzmatched token not at column %d)r;r!)rLlocnrW)rrxry	verifyColsz!matchOnlyAtCol..verifyColrx)rrrx)rryrOscsfddS)a
    Helper method for common parse actions that simply return a literal value.  Especially
    useful when used with C{L{transformString}()}.

    Example::
        num = Word(nums).setParseAction(lambda toks: int(toks[0]))
        na = oneOf("N/A NA").setParseAction(replaceWith(math.nan))
        term = na | num
        
        OneOrMore(term).parseString("324 234 N/A 234") # -> [324, 234, nan, 234]
    csgS)Nrx)rr[rw)replStrrxryrzr{zreplaceWith..rx)rrx)rryr^scCs|dddS)a
    Helper parse action for removing quotation marks from parsed quoted strings.

    Example::
        # by default, quotation marks are included in parsed results
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]

        # use removeQuotes to strip quotation marks from parsed results
        quotedString.setParseAction(removeQuotes)
        quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
    rrrtrx)rr[rwrxrxryr\scsNfdd}ytdtdj}Wntk
rBt}YnX||_|S)aG
    Helper to define a parse action by mapping a function to all elements of a ParseResults list.If any additional 
    args are passed, they are forwarded to the given function as additional arguments after
    the token, as in C{hex_integer = Word(hexnums).setParseAction(tokenMap(int, 16))}, which will convert the
    parsed data to an integer using base 16.

    Example (compare the last to example in L{ParserElement.transformString}::
        hex_ints = OneOrMore(Word(hexnums)).setParseAction(tokenMap(int, 16))
        hex_ints.runTests('''
            00 11 22 aa FF 0a 0d 1a
            ''')
        
        upperword = Word(alphas).setParseAction(tokenMap(str.upper))
        OneOrMore(upperword).runTests('''
            my kingdom for a horse
            ''')

        wd = Word(alphas).setParseAction(tokenMap(str.title))
        OneOrMore(wd).setParseAction(' '.join).runTests('''
            now is the winter of our discontent made glorious summer by this sun of york
            ''')
    prints::
        00 11 22 aa FF 0a 0d 1a
        [0, 17, 34, 170, 255, 10, 13, 26]

        my kingdom for a horse
        ['MY', 'KINGDOM', 'FOR', 'A', 'HORSE']

        now is the winter of our discontent made glorious summer by this sun of york
        ['Now Is The Winter Of Our Discontent Made Glorious Summer By This Sun Of York']
    csfdd|DS)Ncsg|]}|fqSrxrx)rtokn)rr\rxryrsz(tokenMap..pa..rx)rr[rw)rr\rxryrsztokenMap..parrn)rprrqr~)r\rrrtrx)rr\ryros cCst|S)N)rr?)rwrxrxryrzr{cCst|S)N)rlower)rwrxrxryrzr{c	Cst|tr|}t||d}n|j}tttd}|rt	t
}td|dtt
t|td|tddgdd		d
dtd}nd
ddtD}t	t
t|B}td|dtt
t|	tttd|tddgdd		ddtd}ttd|d}|dd
|ddd|}|dd
|ddd|}||_||_||fS)zRInternal helper to construct opening and closing tag expressions, given a tag name)r>z_-:r+tag=/F)rrEcSs|ddkS)Nrrrx)rr[rwrxrxryrzr{z_makeTags..r,rcss|]}|dkr|VqdS)r,Nrx)rrrxrxryrsz_makeTags..cSs|ddkS)Nrrrx)rr[rwrxrxryrzr{zr_z)r|rrrr1r6r5r@rrr\r-r
r4rrrrrXr[rDr_Lrtitlerrr)tagStrxmlresnametagAttrNametagAttrValueopenTagZprintablesLessRAbrackcloseTagrxrxry	_makeTagss"
T\..r$cCs
t|dS)a 
    Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches
    tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.

    Example::
        text = 'More info at the pyparsing wiki page'
        # makeHTMLTags returns pyparsing expressions for the opening and closing tags as a 2-tuple
        a,a_end = makeHTMLTags("A")
        link_expr = a + SkipTo(a_end)("link_text") + a_end
        
        for link in link_expr.searchString(text):
            # attributes in the  tag (like "href" shown here) are also accessible as named results
            print(link.link_text, '->', link.href)
    prints::
        pyparsing -> http://pyparsing.wikispaces.com
    F)r$)rrxrxryrM(scCs
t|dS)z
    Helper to construct opening and closing tag expressions for XML, given a tag name. Matches
    tags only in the given upper/lower case.

    Example: similar to L{makeHTMLTags}
    T)r$)rrxrxryrN;scs8|r|ddn|ddDfdd}|S)a<
    Helper to create a validating parse action to be used with start tags created
    with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
    with a required attribute value, to avoid false matches on common tags such as
    C{} or C{
}. Call C{withAttribute} with a series of attribute names and values. Specify the list of filter attributes names and values as: - keyword arguments, as in C{(align="right")}, or - as an explicit dict with C{**} operator, when an attribute name is also a Python reserved word, as in C{**{"class":"Customer", "align":"right"}} - a list of name-value tuples, as in ( ("ns1:class", "Customer"), ("ns2:align","right") ) For attribute names with a namespace prefix, you must use the second form. Attribute names are matched insensitive to upper/lower case. If just testing for C{class} (with or without a namespace), use C{L{withClass}}. To verify that the attribute exists, but without specifying a value, pass C{withAttribute.ANY_VALUE} as the value. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this has no type
''' div,div_end = makeHTMLTags("div") # only match div tag having a type attribute with value "grid" div_grid = div().setParseAction(withAttribute(type="grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) # construct a match with any div tag having a type attribute, regardless of the value div_any_type = div().setParseAction(withAttribute(type=withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 NcSsg|]\}}||fqSrxrx)rrrrxrxryrzsz!withAttribute..cs^xXD]P\}}||kr&t||d||tjkr|||krt||d||||fqWdS)Nzno matching attribute z+attribute '%s' has value '%s', must be '%s')r!rg ANY_VALUE)rr[rattrName attrValue)attrsrxryr{s zwithAttribute..pa)r)rattrDictrrx)r(ryrgDs 2 cCs|r d|nd}tf||iS)a Simplified version of C{L{withAttribute}} when matching on a div class - made difficult because C{class} is a reserved word in Python. Example:: html = '''
Some text
1 4 0 1 0
1,3 2,3 1,1
this <div> has no class
''' div,div_end = makeHTMLTags("div") div_grid = div().setParseAction(withClass("grid")) grid_expr = div_grid + SkipTo(div | div_end)("body") for grid_header in grid_expr.searchString(html): print(grid_header.body) div_any_type = div().setParseAction(withClass(withAttribute.ANY_VALUE)) div_expr = div_any_type + SkipTo(div | div_end)("body") for div_header in div_expr.searchString(html): print(div_header.body) prints:: 1 4 0 1 0 1 4 0 1 0 1,3 2,3 1,1 z%s:classclass)rg) classname namespace classattrrxrxryrms (rmcCst}||||B}xzt|D]l\}}|ddd\}} } } | dkrTd|nd|} | dkr|dksxt|dkrtd|\} }t| }| tjkrb| d krt||t|t |}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkrXt|| |||t|| |||}ntd n| tj krF| d krt |t st |}t|j |t||}n| dkr|dk rt|||t|t ||}nt||t|t |}nD| dkr= '0' && hchar <= '9') { return (ord(hchar)-ord('0')); } else { return (10+ord(hchar)-ord('A')); } } ''' for func in c_function.searchString(source_code): print("%(name)s (%(type)s) args: %(args)s" % func) prints:: is_odd (int) args: [['int', 'x']] dec_to_hex (int) args: [['char', 'hchar']] z.opening and closing strings cannot be the sameNr)r^cSs |dS)Nr)r)rwrxrxryrzgr{znestedExpr..cSs |dS)Nr)r)rwrxrxryrzjr{cSs |dS)Nr)r)rwrxrxryrzpr{cSs |dS)Nr)r)rwrxrxryrztr{zOopening and closing arguments must be strings if no content expression is givenznested %s%s expression)rr|rrr rr r&rvrrErrrrr-r4r)openerclosercontentrrrxrxryrR%s4:     *$c sfdd}fdd}fdd}ttd}tt|d}t|d }t|d } |rtt||t|t|t|| } n$tt|t|t|t|} | t t| d S) a Helper method for defining space-delimited indentation blocks, such as those used to define block statements in Python source code. Parameters: - blockStatementExpr - expression defining syntax of statement that is repeated within the indented block - indentStack - list created by caller to manage indentation stack (multiple statementWithIndentedBlock expressions within a single grammar should share a common indentStack) - indent - boolean indicating whether block must be indented beyond the the current level; set to False for block of left-most statements (default=C{True}) A valid block must contain at least one C{blockStatement}. Example:: data = ''' def A(z): A1 B = 100 G = A2 A2 A3 B def BB(a,b,c): BB1 def BBA(): bba1 bba2 bba3 C D def spam(x,y): def eggs(z): pass ''' indentStack = [1] stmt = Forward() identifier = Word(alphas, alphanums) funcDecl = ("def" + identifier + Group( "(" + Optional( delimitedList(identifier) ) + ")" ) + ":") func_body = indentedBlock(stmt, indentStack) funcDef = Group( funcDecl + func_body ) rvalue = Forward() funcCall = Group(identifier + "(" + Optional(delimitedList(rvalue)) + ")") rvalue << (funcCall | identifier | Word(nums)) assignment = Group(identifier + "=" + rvalue) stmt << ( funcDef | assignment | identifier ) module_body = OneOrMore(stmt) parseTree = module_body.parseString(data) parseTree.pprint() prints:: [['def', 'A', ['(', 'z', ')'], ':', [['A1'], [['B', '=', '100']], [['G', '=', 'A2']], ['A2'], ['A3']]], 'B', ['def', 'BB', ['(', 'a', 'b', 'c', ')'], ':', [['BB1'], [['def', 'BBA', ['(', ')'], ':', [['bba1'], ['bba2'], ['bba3']]]]]], 'C', 'D', ['def', 'spam', ['(', 'x', 'y', ')'], ':', [[['def', 'eggs', ['(', 'z', ')'], ':', [['pass']]]]]]] csN|t|krdSt||}|dkrJ|dkr>t||dt||ddS)Nrtzillegal nestingznot a peer entry)rr;r#r!)rr[rwcurCol) indentStackrxrycheckPeerIndents     z&indentedBlock..checkPeerIndentcs2t||}|dkr"|n t||ddS)Nrtznot a subentry)r;rr!)rr[rwrD)rErxrycheckSubIndents   z%indentedBlock..checkSubIndentcsN|t|krdSt||}r6|dkr6|dksBt||ddS)Nrtr_znot an unindent)rr;r!r )rr[rwrD)rErxry checkUnindents    z$indentedBlock..checkUnindentz INDENTrUNINDENTzindented block) rrr rrrrrrr r) blockStatementExprrEr0rFrGrHrCrIPEERUNDENTsmExprrx)rEryrhsN   ,z#[\0xc0-\0xd6\0xd8-\0xf6\0xf8-\0xff]z[\0xa1-\0xbf\0xd7\0xf7]z_:zany tagzgt lt amp nbsp quot aposz><& "'z &(?Prz);zcommon HTML entitycCs t|jS)zRHelper parser action to replace common HTML entities with their special characters)_htmlEntityMaprentity)rwrxrxryr]sz/\*(?:[^*]|\*(?!/))*z*/zC style commentzz HTML commentz.*z rest of linez//(?:\\\n|[^\n])*z // commentzC++ style commentz#.*zPython style comment)rOz commaItem)rc@seZdZdZeeZeeZe e  d eZ e e d eedZed d eZe ede e dZed d eeeed eB d Zeeed  d eZed d eZeeBeBZed d eZe eded dZed dZ ed dZ!e!de!d dZ"ee!de!ddee!de!d dZ#e#$dd d e  d!Z%e&e"e%Be#B d" d"Z'ed# d$Z(e)d=d&d'Z*e)d>d)d*Z+ed+ d,Z,ed- d.Z-ed/ d0Z.e/e0BZ1e)d1d2Z2e&e3e4d3e5e e6d3d4ee7d5 d6Z8e9ee:;e8Bd7d8 d9Zd}, L{reals}, L{scientific notation}) - common L{programming identifiers} - network addresses (L{MAC}, L{IPv4}, L{IPv6}) - ISO8601 L{dates} and L{datetime} - L{UUID} - L{comma-separated list} Parse actions: - C{L{convertToInteger}} - C{L{convertToFloat}} - C{L{convertToDate}} - C{L{convertToDatetime}} - C{L{stripHTMLTags}} - C{L{upcaseTokens}} - C{L{downcaseTokens}} Example:: pyparsing_common.number.runTests(''' # any int or real number, returned as the appropriate type 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.fnumber.runTests(''' # any int or real number, returned as float 100 -100 +100 3.14159 6.02e23 1e-12 ''') pyparsing_common.hex_integer.runTests(''' # hex numbers 100 FF ''') pyparsing_common.fraction.runTests(''' # fractions 1/2 -3/4 ''') pyparsing_common.mixed_integer.runTests(''' # mixed fractions 1 1/2 -3/4 1-3/4 ''') import uuid pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID)) pyparsing_common.uuid.runTests(''' # uuid 12345678-1234-5678-1234-567812345678 ''') prints:: # any int or real number, returned as the appropriate type 100 [100] -100 [-100] +100 [100] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # any int or real number, returned as float 100 [100.0] -100 [-100.0] +100 [100.0] 3.14159 [3.14159] 6.02e23 [6.02e+23] 1e-12 [1e-12] # hex numbers 100 [256] FF [255] # fractions 1/2 [0.5] -3/4 [-0.75] # mixed fractions 1 [1] 1/2 [0.5] -3/4 [-0.75] 1-3/4 [1.75] # uuid 12345678-1234-5678-1234-567812345678 [UUID('12345678-1234-5678-1234-567812345678')] integerz hex integerrz[+-]?\d+zsigned integerrfractioncCs|d|dS)Nrrtrx)rwrxrxryrzr{zpyparsing_common.rz"fraction or mixed integer-fractionz [+-]?\d+\.\d*z real numberz+[+-]?\d+([eE][+-]?\d+|\.\d*([eE][+-]?\d+)?)z$real number with scientific notationz[+-]?\d+\.?\d*([eE][+-]?\d+)?fnumberr identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}z IPv4 addressz[0-9a-fA-F]{1,4} hex_integerrzfull IPv6 address)rrhz::zshort IPv6 addresscCstdd|DdkS)Ncss|]}tj|rdVqdS)rN)rp _ipv6_partr)rrrxrxryrsz,pyparsing_common...r )r)rwrxrxryrzr{z::ffff:zmixed IPv6 addressz IPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}z MAC address%Y-%m-%dcsfdd}|S)a Helper to create a parse action for converting parsed date string to Python datetime.date Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%d"}) Example:: date_expr = pyparsing_common.iso8601_date.copy() date_expr.setParseAction(pyparsing_common.convertToDate()) print(date_expr.parseString("1999-12-31")) prints:: [datetime.date(1999, 12, 31)] c sLyt|dStk rF}zt||t|Wdd}~XYnXdS)Nr)rstrptimedaterr!r~)rr[rwve)fmtrxrycvt_fnsz.pyparsing_common.convertToDate..cvt_fnrx)r]r^rx)r]ry convertToDates zpyparsing_common.convertToDate%Y-%m-%dT%H:%M:%S.%fcsfdd}|S)a Helper to create a parse action for converting parsed datetime string to Python datetime.datetime Params - - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"}) Example:: dt_expr = pyparsing_common.iso8601_datetime.copy() dt_expr.setParseAction(pyparsing_common.convertToDatetime()) print(dt_expr.parseString("1999-12-31T23:59:59.999")) prints:: [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)] c sHyt|dStk rB}zt||t|Wdd}~XYnXdS)Nr)rrZrr!r~)rr[rwr\)r]rxryr^sz2pyparsing_common.convertToDatetime..cvt_fnrx)r]r^rx)r]ryconvertToDatetimes z"pyparsing_common.convertToDatetimez7(?P\d{4})(?:-(?P\d\d)(?:-(?P\d\d))?)?z ISO8601 datez(?P\d{4})-(?P\d\d)-(?P\d\d)[T ](?P\d\d):(?P\d\d)(:(?P\d\d(\.\d*)?)?)?(?PZ|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}UUIDcCstj|dS)a Parse action to remove HTML tags from web page HTML source Example:: # strip HTML links from normal text text = 'More info at the
pyparsing wiki page' td,td_end = makeHTMLTags("TD") table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end print(table_text.parseString(text).body) # -> 'More info at the pyparsing wiki page' r)rp_html_stripperr)rr[rrxrxry stripHTMLTagss zpyparsing_common.stripHTMLTagsr)rOz rQr)rzcomma separated listcCs t|S)N)rr?)rwrxrxryrz"r{cCs t|S)N)rr)rwrxrxryrz%r{N)rY)r`)?rrrrrorvconvertToIntegerfloatconvertToFloatr1rTrrrRrFrVr)signed_integerrSrrr mixed_integerrrealsci_realrnumberrTr6r5rU ipv4_addressrX_full_ipv6_address_short_ipv6_addressr_mixed_ipv6_addressr ipv6_address mac_addressr5r_ra iso8601_dateiso8601_datetimeuuidr9r8rcrdrrrrXr0 _commasepitemrBr[rcomma_separated_listrfrDrxrxrxryrpsN"" 2   8__main__selectfromz_$r)rcolumnsrZtablescommandaK # '*' as column list and dotted table name select * from SYS.XYZZY # caseless match on "SELECT", and casts back to "select" SELECT * from XYZZY, ABC # list of column names, and mixed case SELECT keyword Select AA,BB,CC from Sys.dual # multiple tables Select A, B, C from Sys.dual, Table2 # invalid SELECT keyword - should fail Xelect A, B, C from Sys.dual # incomplete command - should fail Select # invalid column name - should fail Select ^^^ frox Sys.dual z] 100 -100 +100 3.14159 6.02e23 1e-12 z 100 FF z6 12345678-1234-5678-1234-567812345678 )rs)rF)N)FT)T)r)T)r __version____versionTime__ __author__rweakrefrrrrrrrgrrDrbrr_threadr ImportError threadingcollections.abcrrrrZ ordereddict__all__r version_inforar'maxsizer6r~rchrrrrrr>reversedrrr@rr\r]roZmaxintxranger __builtin__rfnamerrprrrrrrascii_uppercaseascii_lowercaser6rTrFr5rr printablerXrqrr!r#r%r(rr$registerr;rLrIrTrXrZrSrur&r.rrrrryrr r rnr1r)r'r r0rrrrr,r+r3r2r"rrrrr rrrrr4rrrr*rrr/r rr r-rrdrBr>rrQrPrXrUrCrirjrlrrErKrJrcrbr _escapedPunc_escapedHexChar_escapedOctChar _singleChar _charRangerrrarOr^r\rorfrDr$rMrNrgr%rmrVr/r0rkrWr@r`r[rerRrhr7rYr9r8rrrOrr=r]r:rGrr_rAr?rHrZrrvr<rprZ selectTokenZ fromTokenidentZ columnNameZcolumnNameListZ columnSpecZ tableNameZ tableNameListZ simpleSQLr4rlrTrVrurbrxrxrxryKs                   8      @v &A= I G3pLOD|M &#@sQ,A,    I# %     0 ,   ? #p Zr   (  0     "PK!ޭ@_D@D@._vendor/__pycache__/ordered_set.cpython-37.pycnu[B Re;@s|dZddlZddlmZyddlmZmZWn$ek rPddlmZmZYnXe dZ dZ ddZ Gdd d eeZ dS) z An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Based on a recipe originally posted to ActiveState Recipes by Raymond Hettiger, and released under the MIT license. N)deque) MutableSetSequencez3.1cCs"t|do t|t o t|t S)a  Are we being asked to look up a list of things, instead of a single thing? We check for the `__iter__` attribute so that this can cover types that don't have to be known by this module, such as NumPy arrays. Strings, however, should be considered as atomic values to look up, not iterables. The same goes for tuples, since they are immutable and therefore valid entries. We don't need to check for the Python 2 `unicode` type, because it doesn't have an `__iter__` attribute anyway. __iter__)hasattr isinstancestrtuple)objr /builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py is_iterables  r c@seZdZdZd;ddZddZddZd d Zd d Zd dZ ddZ ddZ e Z ddZ ddZeZeZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Z d7d8Z!d9d:Z"dS)< OrderedSetz An OrderedSet is a custom MutableSet that remembers its order, so that every entry has an index that can be looked up. Example: >>> OrderedSet([1, 1, 2, 3, 2]) OrderedSet([1, 2, 3]) NcCs g|_i|_|dk r||O}dS)N)itemsmap)selfiterabler r r __init__4szOrderedSet.__init__cCs t|jS)z Returns the number of unique elements in the ordered set Example: >>> len(OrderedSet([])) 0 >>> len(OrderedSet([1, 2])) 2 )lenr)rr r r __len__:s zOrderedSet.__len__cs|t|tr|tkrSt|r4fdd|DSt|dsHt|trlj|}t|trf|S|Sn t d|dS)aQ Get the item at a given index. If `index` is a slice, you will get back that slice of items, as a new OrderedSet. If `index` is a list or a similar iterable, you'll get a list of items corresponding to those indices. This is similar to NumPy's "fancy indexing". The result is not an OrderedSet because you may ask for duplicate indices, and the number of elements returned should be the number of elements asked for. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset[1] 2 csg|]}j|qSr )r).0i)rr r [sz*OrderedSet.__getitem__.. __index__z+Don't know how to index an OrderedSet by %rN) rslice SLICE_ALLcopyr rrlist __class__ TypeError)rindexresultr )rr __getitem__Fs   zOrderedSet.__getitem__cCs ||S)z Return a shallow copy of this object. Example: >>> this = OrderedSet([1, 2, 3]) >>> other = this.copy() >>> this == other True >>> this is other False )r)rr r r res zOrderedSet.copycCst|dkrdSt|SdS)Nr)N)rr)rr r r __getstate__ss zOrderedSet.__getstate__cCs"|dkr|gn ||dS)N)N)r)rstater r r __setstate__s zOrderedSet.__setstate__cCs ||jkS)z Test if the item is in this ordered set Example: >>> 1 in OrderedSet([1, 3, 2]) True >>> 5 in OrderedSet([1, 3, 2]) False )r)rkeyr r r __contains__s zOrderedSet.__contains__cCs0||jkr&t|j|j|<|j||j|S)aE Add `key` as an item to this OrderedSet, then return its index. If `key` is already in the OrderedSet, return the index it already had. Example: >>> oset = OrderedSet() >>> oset.append(3) 0 >>> print(oset) OrderedSet([3]) )rrrappend)rr&r r r adds  zOrderedSet.addcCsJd}yx|D]}||}q WWn$tk rDtdt|YnX|S)a< Update the set with the given iterable sequence, then return the index of the last element inserted. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.update([3, 1, 5, 1, 4]) 4 >>> print(oset) OrderedSet([1, 2, 3, 5, 4]) Nz(Argument needs to be an iterable, got %s)r)r ValueErrortype)rsequenceZ item_indexitemr r r updates  zOrderedSet.updatecs$t|rfdd|DSj|S)aH Get the index of a given entry, raising an IndexError if it's not present. `key` can be an iterable of entries that is not a string, in which case this returns a list of indices. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.index(2) 1 csg|]}|qSr )r )rsubkey)rr r rsz$OrderedSet.index..)r r)rr&r )rr r s zOrderedSet.indexcCs,|jstd|jd}|jd=|j|=|S)z Remove and return the last element from the set. Raises KeyError if the set is empty. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.pop() 3 z Set is empty)rKeyErrorr)relemr r r pops  zOrderedSet.popcCsT||krP|j|}|j|=|j|=x,|jD]\}}||kr.|d|j|<q.WdS)a Remove an element. Do not raise an exception if absent. The MutableSet mixin uses this to implement the .remove() method, which *does* raise an error when asked to remove a non-existent item. Example: >>> oset = OrderedSet([1, 2, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) >>> oset.discard(2) >>> print(oset) OrderedSet([1, 3]) N)rr)rr&rkvr r r discards zOrderedSet.discardcCs|jdd=|jdS)z8 Remove all items from this OrderedSet. N)rrclear)rr r r r8s zOrderedSet.clearcCs t|jS)zb Example: >>> list(iter(OrderedSet([1, 2, 3]))) [1, 2, 3] )iterr)rr r r rszOrderedSet.__iter__cCs t|jS)zf Example: >>> list(reversed(OrderedSet([1, 2, 3]))) [3, 2, 1] )reversedr)rr r r __reversed__ szOrderedSet.__reversed__cCs&|sd|jjfSd|jjt|fS)Nz%s()z%s(%r))r__name__r)rr r r __repr__szOrderedSet.__repr__cCsPt|ttfrt|t|kSy t|}Wntk r>dSXt||kSdS)a Returns true if the containers have the same items. If `other` is a Sequence, then order is checked, otherwise it is ignored. Example: >>> oset = OrderedSet([1, 3, 2]) >>> oset == [1, 3, 2] True >>> oset == [1, 2, 3] False >>> oset == [2, 3] False >>> oset == OrderedSet([3, 2, 1]) False FN)rrrrsetr)rotherZ other_as_setr r r __eq__s zOrderedSet.__eq__cGs<t|tr|jnt}ttt|g|}tj|}||S)a Combines all unique items. Each items order is defined by its first appearance. Example: >>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0]) >>> print(oset) OrderedSet([3, 1, 4, 5, 2, 0]) >>> oset.union([8, 9]) OrderedSet([3, 1, 4, 5, 2, 0, 8, 9]) >>> oset | {10} OrderedSet([3, 1, 4, 5, 2, 0, 10]) )rrrrritchain from_iterable)rsetsclsZ containersrr r r union6s zOrderedSet.unioncCs ||S)N) intersection)rr?r r r __and__IszOrderedSet.__and__csHt|tr|jnt}|r>> oset = OrderedSet.intersection(OrderedSet([0, 1, 2, 3]), [1, 2, 3]) >>> print(oset) OrderedSet([1, 2, 3]) >>> oset.intersection([2, 4, 5], [1, 2, 3, 4]) OrderedSet([2]) >>> oset.intersection() OrderedSet([1, 2, 3]) c3s|]}|kr|VqdS)Nr )rr-)commonr r ^sz*OrderedSet.intersection..)rrrr>rGr)rrDrErr )rIr rGMs zOrderedSet.intersectioncs:|j}|r.tjtt|fdd|D}n|}||S)a Returns all elements that are in this set but not the others. Example: >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2])) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3])) OrderedSet([1]) >>> OrderedSet([1, 2, 3]) - OrderedSet([2]) OrderedSet([1, 3]) >>> OrderedSet([1, 2, 3]).difference() OrderedSet([1, 2, 3]) c3s|]}|kr|VqdS)Nr )rr-)r?r r rJtsz(OrderedSet.difference..)rr>rFr)rrDrErr )r?r differencecs zOrderedSet.differencecs*t|tkrdStfdd|DS)a7 Report whether another set contains this set. Example: >>> OrderedSet([1, 2, 3]).issubset({1, 2}) False >>> OrderedSet([1, 2, 3]).issubset({1, 2, 3, 4}) True >>> OrderedSet([1, 2, 3]).issubset({1, 4, 3, 5}) False Fc3s|]}|kVqdS)Nr )rr-)r?r r rJsz&OrderedSet.issubset..)rall)rr?r )r?r issubsetys zOrderedSet.issubsetcs*tt|krdStfdd|DS)a= Report whether this set contains another set. Example: >>> OrderedSet([1, 2]).issuperset([1, 2, 3]) False >>> OrderedSet([1, 2, 3, 4]).issuperset({1, 2, 3}) True >>> OrderedSet([1, 4, 3, 5]).issuperset({1, 2, 3}) False Fc3s|]}|kVqdS)Nr )rr-)rr r rJsz(OrderedSet.issuperset..)rrL)rr?r )rr issupersets zOrderedSet.issupersetcCs:t|tr|jnt}|||}|||}||S)a Return the symmetric difference of two OrderedSets as a new set. That is, the new set will contain all elements that are in exactly one of the sets. Their order will be preserved, with elements from `self` preceding elements from `other`. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference(other) OrderedSet([4, 5, 9, 2]) )rrrrKrF)rr?rEZdiff1Zdiff2r r r symmetric_differenceszOrderedSet.symmetric_differencecCs||_ddt|D|_dS)zt Replace the 'items' list of this OrderedSet with a new one, updating self.map accordingly. cSsi|]\}}||qSr r )ridxr-r r r sz,OrderedSet._update_items..N)r enumerater)rrr r r _update_itemsszOrderedSet._update_itemscs>tx|D]}t|Oq W|fdd|jDdS)a Update this OrderedSet to remove items from one or more other sets. Example: >>> this = OrderedSet([1, 2, 3]) >>> this.difference_update(OrderedSet([2, 4])) >>> print(this) OrderedSet([1, 3]) >>> this = OrderedSet([1, 2, 3, 4, 5]) >>> this.difference_update(OrderedSet([2, 4]), OrderedSet([1, 4, 6])) >>> print(this) OrderedSet([3, 5]) csg|]}|kr|qSr r )rr-)items_to_remover r rsz0OrderedSet.difference_update..N)r>rSr)rrDr?r )rTr difference_updates zOrderedSet.difference_updatecs&t|fdd|jDdS)a^ Update this OrderedSet to keep only items in another set, preserving their order in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.intersection_update(other) >>> print(this) OrderedSet([1, 3, 7]) csg|]}|kr|qSr r )rr-)r?r r rsz2OrderedSet.intersection_update..N)r>rSr)rr?r )r?r intersection_updates zOrderedSet.intersection_updatecs<fdd|D}t|fddjD|dS)a Update this OrderedSet to remove items from another set, then add items from the other set that were not present in this set. Example: >>> this = OrderedSet([1, 4, 3, 5, 7]) >>> other = OrderedSet([9, 7, 1, 3, 2]) >>> this.symmetric_difference_update(other) >>> print(this) OrderedSet([4, 5, 9, 2]) csg|]}|kr|qSr r )rr-)rr r rsz:OrderedSet.symmetric_difference_update..csg|]}|kr|qSr r )rr-)rTr r rsN)r>rSr)rr?Z items_to_addr )rTrr symmetric_difference_updates z&OrderedSet.symmetric_difference_update)N)#r< __module__ __qualname____doc__rrr"rr#r%r'r)r(r.r Zget_locZ get_indexerr3r7r8rr;r=r@rFrHrGrKrMrNrOrSrUrVrWr r r r r*s@    r)rZ itertoolsrA collectionsrcollections.abcrr ImportErrorrr __version__r rr r r r s PK!7Hp4_vendor/packaging/__pycache__/_compat.cpython-37.pycnu[B Reh@s~ddlmZmZmZddlZddlmZerDddlmZm Z m Z m Z ej ddkZ ej ddkZerlefZnefZdd ZdS) )absolute_importdivisionprint_functionN) TYPE_CHECKING)AnyDictTupleTypecs&Gfddd}t|ddiS)z/ Create a base class with a metaclass. cseZdZfddZdS)z!with_metaclass..metaclasscs ||S)N)clsname this_basesd)basesmetar /builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/_compat.py__new__"sz)with_metaclass..metaclass.__new__N)__name__ __module__ __qualname__rr )rrr r metaclass!srtemporary_classr )typer)rrrr )rrrwith_metaclasssr) __future__rrrsys_typingrtypingrrr r version_infoPY2PY3str string_types basestringrr r r rs PK!{Wjj5_vendor/packaging/__pycache__/__init__.cpython-37.pycnu[B Re2@sTddlmZmZmZddlmZmZmZmZm Z m Z m Z m Z dddddd d d gZ d S) )absolute_importdivisionprint_function) __author__ __copyright__ __email__ __license__ __summary__ __title____uri__ __version__r r r r rrr rN) __future__rrr __about__rrrr r r r r __all__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/__init__.pys( PK!: 8_vendor/packaging/__pycache__/_structures.cpython-37.pycnu[B Re@sDddlmZmZmZGdddeZeZGdddeZeZdS))absolute_importdivisionprint_functionc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS) InfinityTypecCsdS)NInfinity)selfrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/_structures.py__repr__szInfinityType.__repr__cCs tt|S)N)hashrepr)rrrr __hash__ szInfinityType.__hash__cCsdS)NFr)rotherrrr __lt__szInfinityType.__lt__cCsdS)NFr)rrrrr __le__szInfinityType.__le__cCs t||jS)N) isinstance __class__)rrrrr __eq__szInfinityType.__eq__cCst||j S)N)rr)rrrrr __ne__szInfinityType.__ne__cCsdS)NTr)rrrrr __gt__ szInfinityType.__gt__cCsdS)NTr)rrrrr __ge__$szInfinityType.__ge__cCstS)N)NegativeInfinity)rrrr __neg__(szInfinityType.__neg__N) __name__ __module__ __qualname__r r rrrrrrrrrrr rsrc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS)NegativeInfinityTypecCsdS)Nz -Infinityr)rrrr r 1szNegativeInfinityType.__repr__cCs tt|S)N)r r )rrrr r 5szNegativeInfinityType.__hash__cCsdS)NTr)rrrrr r9szNegativeInfinityType.__lt__cCsdS)NTr)rrrrr r=szNegativeInfinityType.__le__cCs t||jS)N)rr)rrrrr rAszNegativeInfinityType.__eq__cCst||j S)N)rr)rrrrr rEszNegativeInfinityType.__ne__cCsdS)NFr)rrrrr rIszNegativeInfinityType.__gt__cCsdS)NFr)rrrrr rMszNegativeInfinityType.__ge__cCstS)N)r)rrrr rQszNegativeInfinityType.__neg__N) rrrr r rrrrrrrrrrr r0srN) __future__rrrobjectrrrrrrrr s&&PK!334_vendor/packaging/__pycache__/version.cpython-37.pycnu[B Ren< @sddlmZmZmZddlZddlZddlZddlmZm Z ddl m Z e r.ddl m Z mZmZmZmZmZmZddlmZmZeeefZeeeeeffZeeeefZeeeeeeeefeeeffdffZeeeedfeeeefZeeeedffZe eeefeeefgefZd d d d d gZ e!dddddddgZ"dd Z#Gdd d e$Z%Gddde&Z'Gdd d e'Z(e)dej*Z+ddddddZ,dd Z-d!d"Z.d#Z/Gd$d d e'Z0d%d&Z1e)d'Z2d(d)Z3d*d+Z4dS),)absolute_importdivisionprint_functionN)InfinityNegativeInfinity) TYPE_CHECKING)CallableIteratorListOptional SupportsIntTupleUnion) InfinityTypeNegativeInfinityType.parseVersion LegacyVersionInvalidVersionVERSION_PATTERN_VersionepochreleasedevprepostlocalcCs&yt|Stk r t|SXdS)z Parse the given version string and return either a :class:`Version` object or a :class:`LegacyVersion` object depending on if the given version is a valid PEP 440 version or a legacy version. N)rrr)versionr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/version.pyr0sc@seZdZdZdS)rzF An invalid version was found, users should refer to PEP 440. N)__name__ __module__ __qualname____doc__rrrr r=sc@sPeZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dS) _BaseVersionNcCs t|jS)N)hash_key)selfrrr __hash__Fsz_BaseVersion.__hash__cCs||ddS)NcSs||kS)Nr)sorrr Lz%_BaseVersion.__lt__..)_compare)r(otherrrr __lt__Jsz_BaseVersion.__lt__cCs||ddS)NcSs||kS)Nr)r*r+rrr r,Pr-z%_BaseVersion.__le__..)r.)r(r/rrr __le__Nsz_BaseVersion.__le__cCs||ddS)NcSs||kS)Nr)r*r+rrr r,Tr-z%_BaseVersion.__eq__..)r.)r(r/rrr __eq__Rsz_BaseVersion.__eq__cCs||ddS)NcSs||kS)Nr)r*r+rrr r,Xr-z%_BaseVersion.__ge__..)r.)r(r/rrr __ge__Vsz_BaseVersion.__ge__cCs||ddS)NcSs||kS)Nr)r*r+rrr r,\r-z%_BaseVersion.__gt__..)r.)r(r/rrr __gt__Zsz_BaseVersion.__gt__cCs||ddS)NcSs||kS)Nr)r*r+rrr r,`r-z%_BaseVersion.__ne__..)r.)r(r/rrr __ne__^sz_BaseVersion.__ne__cCst|tstS||j|jS)N) isinstancer%NotImplementedr')r(r/methodrrr r.bs z_BaseVersion._compare) r!r"r#r'r)r0r1r2r3r4r5r.rrrr r%Csr%c@seZdZddZddZddZeddZed d Zed d Z ed dZ eddZ eddZ eddZ eddZeddZeddZeddZdS)rcCst||_t|j|_dS)N)str_version_legacy_cmpkeyr')r(rrrr __init__ks zLegacyVersion.__init__cCs|jS)N)r:)r(rrr __str__pszLegacyVersion.__str__cCsdtt|S)Nz)formatreprr9)r(rrr __repr__tszLegacyVersion.__repr__cCs|jS)N)r:)r(rrr publicxszLegacyVersion.publiccCs|jS)N)r:)r(rrr base_version}szLegacyVersion.base_versioncCsdS)Nr)r(rrr rszLegacyVersion.epochcCsdS)Nr)r(rrr rszLegacyVersion.releasecCsdS)Nr)r(rrr rszLegacyVersion.precCsdS)Nr)r(rrr rszLegacyVersion.postcCsdS)Nr)r(rrr rszLegacyVersion.devcCsdS)Nr)r(rrr rszLegacyVersion.localcCsdS)NFr)r(rrr is_prereleaseszLegacyVersion.is_prereleasecCsdS)NFr)r(rrr is_postreleaseszLegacyVersion.is_postreleasecCsdS)NFr)r(rrr is_devreleaseszLegacyVersion.is_devreleaseN)r!r"r#r<r=r@propertyrArBrrrrrrrDrErFrrrr rjs          z(\d+ | [a-z]+ | \.| -)czfinal-@)rpreview-rcrccs`xTt|D]F}t||}|r |dkr*q |dddkrH|dVq d|Vq WdVdS)N.r 0123456789*z*final)_legacy_version_component_resplit_legacy_version_replacement_mapgetzfill)r*partrrr _parse_version_partss  rWcCsd}g}xlt|D]\}|drh|dkrJx|rH|ddkrH|q.Wx|rf|ddkrf|qLW||qW|t|fS)NrCrPz*finalz*final-00000000)rWlower startswithpopappendtuple)rrpartsrVrrr r;s   r;a v? (?: (?:(?P[0-9]+)!)? # epoch (?P[0-9]+(?:\.[0-9]+)*) # release segment (?P
                                          # pre-release
            [-_\.]?
            (?P(a|b|c|rc|alpha|beta|pre|preview))
            [-_\.]?
            (?P[0-9]+)?
        )?
        (?P                                         # post release
            (?:-(?P[0-9]+))
            |
            (?:
                [-_\.]?
                (?Ppost|rev|r)
                [-_\.]?
                (?P[0-9]+)?
            )
        )?
        (?P                                          # dev release
            [-_\.]?
            (?Pdev)
            [-_\.]?
            (?P[0-9]+)?
        )?
    )
    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
c@seZdZededejejBZddZ	ddZ
ddZed	d
Z
eddZed
dZeddZeddZeddZeddZeddZeddZeddZeddZedd Zed!d"Zed#d$Zd%S)&rz^\s*z\s*$c
Cs|j|}|std|t|dr8t|dndtdd|ddDt	|d|d	t	|d
|dp|dt	|d
|dt
|dd|_t|jj
|jj|jj|jj|jj|jj|_dS)NzInvalid version: '{0}'rrcss|]}t|VqdS)N)int).0irrr 	sz#Version.__init__..rrMpre_lpre_npost_lpost_n1post_n2dev_ldev_nr)rrrrrr)_regexsearchrr>rgroupr_r]rR_parse_letter_version_parse_local_versionr:_cmpkeyrrrrrrr')r(rmatchrrr r<s$zVersion.__init__cCsdtt|S)Nz)r>r?r9)r(rrr r@-szVersion.__repr__cCsg}|jdkr |d|j|ddd|jD|jdk	rb|ddd|jD|jdk	r~|d|j|jdk	r|d	|j|jdk	r|d
|jd|S)Nrz{0}!rMcss|]}t|VqdS)N)r9)r`xrrr rb:sz"Version.__str__..css|]}t|VqdS)N)r9)r`rqrrr rb>sz.post{0}z.dev{0}z+{0})	rr\r>joinrrrrr)r(r^rrr r=1s




zVersion.__str__cCs|jj}|S)N)r:r)r(_epochrrr rNsz
Version.epochcCs|jj}|S)N)r:r)r(_releaserrr rTszVersion.releasecCs|jj}|S)N)r:r)r(_prerrr rZszVersion.precCs|jjr|jjdSdS)Nr)r:r)r(rrr r`szVersion.postcCs|jjr|jjdSdS)Nr)r:r)r(rrr reszVersion.devcCs(|jjr ddd|jjDSdSdS)NrMcss|]}t|VqdS)N)r9)r`rqrrr rbnsz Version.local..)r:rrs)r(rrr rjsz
Version.localcCst|dddS)N+rr)r9rR)r(rrr rArszVersion.publiccCsFg}|jdkr |d|j|ddd|jDd|S)Nrz{0}!rMcss|]}t|VqdS)N)r9)r`rqrrr rbsz'Version.base_version..rr)rr\r>rsr)r(r^rrr rBws

zVersion.base_versioncCs|jdk	p|jdk	S)N)rr)r(rrr rDszVersion.is_prereleasecCs
|jdk	S)N)r)r(rrr rEszVersion.is_postreleasecCs
|jdk	S)N)r)r(rrr rFszVersion.is_devreleasecCst|jdkr|jdSdS)Nrr)lenr)r(rrr majorsz
Version.majorcCst|jdkr|jdSdS)Nrr)rxr)r(rrr minorsz
Version.minorcCst|jdkr|jdSdS)Nrzr)rxr)r(rrr microsz
Version.microN)r!r"r#recompilerVERBOSE
IGNORECASErjr<r@r=rGrrrrrrrArBrDrErFryr{r}rrrr rs$cCsv|rZ|dkrd}|}|dkr&d}n(|dkr4d}n|dkrBd}n|dkrNd	}|t|fS|sr|rrd	}|t|fSdS)
Nralphaabetab)rHrrJrL)revrr)rYr_)letternumberrrr rms"rmz[\._-]cCs$|dk	r tddt|DSdS)zR
    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
    Ncss&|]}|s|nt|VqdS)N)isdigitrYr_)r`rVrrr rbsz'_parse_local_version..)r]_local_version_separatorsrR)rrrr rns
rncCsttttddt|}|dkr>|dkr>|dk	r>t}n|dkrLt}n|}|dkr^t}n|}|dkrpt}	n|}	|dkrt}
ntdd|D}
|||||	|
fS)NcSs|dkS)Nrr)rqrrr r,r-z_cmpkey..css(|] }t|tr|dfnt|fVqdS)rrN)r6r_r)r`rarrr rbsz_cmpkey..)r]reversedlist	itertools	dropwhilerr)rrrrrrrurv_post_dev_localrrr ros$	ro)5
__future__rrrcollectionsrr~_structuresrr_typingrtypingr	r
rrr
rrrrZ
InfiniteTypesr9r_ZPrePostDevTypeZSubLocalTypeZ	LocalTypeZCmpKeyZLegacyCmpKeyboolZVersionComparisonMethod__all__
namedtuplerr
ValueErrorrobjectr%rrrrQrSrWr;rrrmrrnrorrrr s\$

'F;&

PK!D9_vendor/packaging/__pycache__/requirements.cpython-37.pycnu[B

Re5@sddlmZmZmZddlZddlZddlmZmZm	Z	m
Z
ddlmZmZm
Z
mZmZddlmZddlmZddlmZdd	lmZmZdd
lmZmZmZerddlmZGdd
d
e Z!eej"ej#Z$ed%Z&ed%Z'ed%Z(ed%Z)ed%Z*ed%Z+ed%Z,edZ-e$ee-e$BZ.ee$ee.Z/e/dZ0e/Z1eddZ2e,e2Z3e1ee*e1Z4e&e
e4e'dZ5eej6ej7ej8BZ9eej6ej7ej8BZ:e9e:AZ;ee;ee*e;ddddZdde	e=dZ?e?>d de	ed!Ze>d"de+Z@e@eZAe?e
eAZBe3e
eAZCe0e
e5eCeBBZDeeDeZEeEFd#Gd$d%d%eGZHdS)&)absolute_importdivisionprint_functionN)stringStart	stringEndoriginalTextForParseException)
ZeroOrMoreWordOptionalRegexCombine)Literal)parse)
TYPE_CHECKING)MARKER_EXPRMarker)LegacySpecifier	SpecifierSpecifierSet)Listc@seZdZdZdS)InvalidRequirementzJ
    An invalid requirement was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/requirements.pyrsr[](),;@z-_.namez[^ ]+urlextrasF)
joinStringadjacent	_raw_speccCs
|jpdS)N)r+)sltrrr;r0	specifiercCs|dS)Nrr)r-r.r/rrrr0>r1markercCst||j|jS)N)r_original_start
_original_end)r-r.r/rrrr0Br1zx[]c@s(eZdZdZddZddZddZdS)	RequirementzParse a requirement.

    Parse a given requirement string into its parts, such as name, specifier,
    URL, and extras. Raises InvalidRequirement on a badly-formed requirement
    string.
    c
Csyt|}WnDtk
rR}z&td||j|jd|jWdd}~XYnX|j|_|jrt		|j}|j
dkrt	||jkrtdn(|j
r|jr|j
s|jstd|j|j|_nd|_t
|jr|jng|_t|j|_|jr|jnd|_dS)NzParse error at "{0!r}": {1}filezInvalid URL givenzInvalid URL: {0})REQUIREMENTparseStringrrformatlocmsgr&r'urlparsescheme
urlunparsenetlocsetr(asListrr2r3)selfrequirement_stringreqe
parsed_urlrrr__init___s(.


zRequirement.__init__cCs|jg}|jr*|ddt|j|jr@|t|j|jrh|d|j|j	rh|d|j	r|d|j	d|S)Nz[{0}]r#z@ {0} z; {0}r,)
r&r(appendr;joinsortedr2strr'r3)rDpartsrrr__str__{s
zRequirement.__str__cCsdt|S)Nz)r;rN)rDrrr__repr__szRequirement.__repr__N)rrrrrIrPrQrrrrr6Rsr6)I
__future__rrrstringreZsetuptools.extern.pyparsingrrrrr	r
rrr
rLurllibrr>_typingrmarkersrr
specifiersrrrtypingr
ValueErrorr
ascii_lettersdigitsALPHANUMsuppressLBRACKETRBRACKETLPARENRPARENCOMMA	SEMICOLONATPUNCTUATIONIDENTIFIER_END
IDENTIFIERNAMEEXTRAURIURLEXTRAS_LISTEXTRAS
_regex_strVERBOSE
IGNORECASEVERSION_PEP440VERSION_LEGACYVERSION_ONEVERSION_MANY
_VERSION_SPECsetParseActionVERSION_SPECMARKER_SEPARATORMARKERVERSION_AND_MARKERURL_AND_MARKERNAMED_REQUIREMENTr9r:objectr6rrrrsd

PK!=4_vendor/packaging/__pycache__/_typing.cpython-37.pycnu[B

Re@s.dZddgZdZer"ddlmZnddZdS)a;For neatly implementing static typing in packaging.

`mypy` - the static type analysis tool we use - uses the `typing` module, which
provides core functionality fundamental to mypy's functioning.

Generally, `typing` would be imported at runtime and used in that fashion -
it acts as a no-op at runtime and does not have any run-time overhead by
design.

As it turns out, `typing` is not vendorable - it uses separate sources for
Python 2/Python 3. Thus, this codebase can not expect it to be present.
To work around this, mypy allows the typing import to be behind a False-y
optional to prevent it from running at runtime and type-comments can be used
to remove the need for the types to be accessible directly during runtime.

This module provides the False-y guard in a nicely named fashion so that a
curious maintainer can reach here to read this.

In packaging, all static-typing related imports should be guarded as follows:

    from packaging._typing import TYPE_CHECKING

    if TYPE_CHECKING:
        from typing import ...

Ref: https://github.com/python/mypy/issues/3216

TYPE_CHECKINGcastF)rcCs|S)N)type_valuerr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/_typing.pyr/sN)__doc____all__rtypingrrrrrs
PK!kxCC1_vendor/packaging/__pycache__/tags.cpython-37.pycnu[B

Re^@sNddlmZddlZyddlmZWn0ek
rTddlZddeDZ[YnXddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZerddlmZmZmZmZmZmZmZmZmZmZeeZ eeefZ!eeefZ"e	#e$Z%d	d
ddd
dZ&ej'dkZ(Gddde)Z*ddZ+ddZ,dSddZ-ddZ.ddZ/dTddZ0dUdd Z1d!d"Z2dVd#d$Z3d%d&Z4dWd'd(Z5e(fd)d*Z6d+d,Z7dXd-d.Z8d/d0Z9d1d2Z:d3d4Z;d5d6ZGd;d<dZ@d?d@ZAdAdBZBdCdDZCe(fdEdFZDdGdHZEdIdJZFdKdLZGdMdNZHdOdPZIdQdRZJdS)Y)absolute_importN)EXTENSION_SUFFIXEScCsg|]}|dqS)r).0xrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/tags.py
sr)
TYPE_CHECKINGcast)
Dict	FrozenSetIOIterableIteratorListOptionalSequenceTupleUnionpycpppipjy)pythoncpythonpypy
ironpythonjythonlc@sfeZdZdZdddgZddZeddZed	d
ZeddZ	d
dZ
ddZddZddZ
dS)Tagz
    A representation of the tag triple for a wheel.

    Instances are considered immutable and thus are hashable. Equality checking
    is also supported.
    _interpreter_abi	_platformcCs"||_||_||_dS)N)lowerr!r"r#)selfinterpreterabiplatformrrr__init__Fs

zTag.__init__cCs|jS)N)r!)r%rrrr&LszTag.interpretercCs|jS)N)r")r%rrrr'QszTag.abicCs|jS)N)r#)r%rrrr(VszTag.platformcCs2t|tstS|j|jko0|j|jko0|j|jkS)N)
isinstancer NotImplementedr(r'r&)r%otherrrr__eq__[s

z
Tag.__eq__cCst|j|j|jfS)N)hashr!r"r#)r%rrr__hash__fszTag.__hash__cCsd|j|j|jS)Nz{}-{}-{})formatr!r"r#)r%rrr__str__jszTag.__str__cCsdj|t|dS)Nz<{self} @ {self_id}>)r%self_id)r0id)r%rrr__repr__nszTag.__repr__N)__name__
__module____qualname____doc__	__slots__r)propertyr&r'r(r-r/r1r4rrrrr <s
r c	Cslt}|d\}}}xL|dD]>}x8|dD]*}x$|dD]}|t|||qBWq2Wq"Wt|S)z
    Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.

    Returning a set is required due to the possibility that the tag is a
    compressed tag set.
    -.)setsplitaddr 	frozenset)tagtagsinterpretersabis	platformsr&r'	platform_rrr	parse_tagssrGcCsP|sdSt|dksd|krH|ddtt|}td|||dS)z[
    Backwards-compatibility with Python 2.7 to allow treating 'warn' as keyword-only.
    Fr	warnNz,{}() got an unexpected keyword argument {!r})lenpopnextiterkeys	TypeErrorr0)	func_namekwargsargrrr_warn_keyword_parametersrRFcCs&t|}|dkr"|r"td||S)Nz>Config variable '%s' is unset, Python ABI tag may be incorrect)	sysconfigget_config_varloggerdebug)namerHvaluerrr_get_config_vars

rYcCs|ddddS)Nr<_r;)replace)stringrrr_normalize_stringsr]cCst|dkot|dkS)zj
    Determine if the Python version supports abi3.

    PEP 384 was first implemented in Python 3.2.
    r	))rItuple)python_versionrrr
_abi3_appliessrbc	Cst|}g}t|dd}d}}}td|}ttd}dtk}	|sX|dkr\|sX|	r\d}|dkrtd|}
|
sz|
dkr~d	}|d
krtd|}|dks|dkrtjd
krd}n|r|dj|d|	ddj||||d|S)Nr_Py_DEBUGgettotalrefcountz_d.pydd)r^
WITH_PYMALLOCm)r^r^Py_UNICODE_SIZEiuzcp{version})versionrz"cp{version}{debug}{pymalloc}{ucs4})rmrVpymallocucs4)
r`_version_nodotrYhasattrsysr
maxunicodeappendr0insert)
py_versionrHrDrmrVrnro
with_debughas_refcounthas_ext
with_pymallocunicode_sizerrr
_cpython_abiss2



r|c
	+sztd|}|stjdd}dt|dd|dkrVt|dkrRt||}ng}t|}x0dD](}y||Wqdt	k
rYqdXqdWt|pt
}x(|D] }x|D]}t||VqWqWt|rx fdd|DD]
}|VqWx"fd	d|DD]}|VqWt|rvxTt
|dddd
D]<}	x4|D],}djt|d|	fd
td|Vq@Wq6WdS)a
    Yields the tags for a CPython interpreter.

    The tags consist of:
    - cp--
    - cp-abi3-
    - cp-none-
    - cp-abi3-  # Older Python versions down to 3.2.

    If python_version only specifies a major version then user-provided ABIs and
    the 'none' ABItag will be used.

    If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
    their normal position and not at the beginning.
    cpython_tagsNr_zcp{}r	)abi3nonec3s|]}td|VqdS)r~N)r )rrF)r&rr	szcpython_tags..c3s|]}td|VqdS)rN)r )rrF)r&rrrszcp{version}r)rmr~)rRrrversion_infor0rprIr|listremove
ValueError_platform_tagsr rbrange)
rarDrErPrHexplicit_abir'rFrA
minor_versionr)r&rr}s:







r}ccstd}|rt|VdS)NSOABI)rSrTr])r'rrr_generic_abis
rc	kstd|}|s,t}t|d}d||g}|dkr:t}t|pDt}t|}d|krb|dx(|D] }x|D]}t|||VqrWqhWdS)z
    Yields the tags for a generic interpreter.

    The tags consist of:
    - --

    The "none" ABI will be added if it was not explicitly provided.
    generic_tags)rHrcNr)	rRinterpreter_nameinterpreter_versionjoinrrrrtr )	r&rDrErPrHinterp_nameinterp_versionr'rFrrrrs




rccst|dkr&djt|dddVdj|ddVt|dkr|x6t|ddd	d	D]}djt|d|fdVqZWdS)
z
    Yields Python versions in descending order.

    After the latest version, the major-only version will be yielded, and then
    all previous versions of that major version.
    r	zpy{version}Nr_)rmz	py{major}r)majorr)rIr0rpr)rvminorrrr_py_interpreter_range4srccs|stjdd}t|pt}x,t|D] }x|D]}t|d|Vq4Wq*W|r`t|ddVxt|D]}t|ddVqjWdS)z
    Yields the sequence of tags that are compatible with a specific version of Python.

    The tags consist of:
    - py*-none-
    - -none-any  # ... if `interpreter` is provided.
    - py*-none-any
    Nr_rany)rrrrrrr )rar&rErmrFrrrcompatible_tagsDs
rcCs|s|S|drdSdS)Nppci386)
startswith)archis_32bitrrr	_mac_arch^s

rcCs|g}|dkr,|dkrgS|dddgnp|dkrR|dkr@gS|dddgnJ|dkrz|d	ksj|dkrngS|dn"|d
kr|dkrgS|ddg|d|S)
Nx86_64)
rkintelfat64fat32rfatppc64)rr)r	universal)extendrt)rmcpu_archformatsrrr_mac_binary_formatsis&
rc	cst\}}}|dkr:tdttt|ddd}n|}|dkrPt|}n|}xVt|dddD]B}|d|f}t	||}x&|D]}dj
|d|d|d	VqWqfWdS)
aD
    Yields the platform tags for a macOS system.

    The `version` parameter is a two-item tuple specifying the macOS version to
    generate platform tags for. The `arch` parameter is the CPU architecture to
    generate platform tags for. Both parameters default to the appropriate value
    for the current system.
    N
MacVersionr<r_r	rrz&macosx_{major}_{minor}_{binary_format})rr
binary_format)r(mac_verrr`mapintr>rrrr0)	rmrversion_strrZrrcompat_versionbinary_formatsrrrr
mac_platformss
$


rc	Cs<yddl}tt||dSttfk
r2YnXt|S)Nr_compatible)
_manylinuxboolgetattrImportErrorAttributeError_have_compatible_glibc)rW
glibc_versionrrrr_is_manylinux_compatiblesrcCstp
tS)N)_glibc_version_string_confstr_glibc_version_string_ctypesrrrr_glibc_version_stringsrcCsHy&td}|dk	st|\}}Wnttttfk
rBdSX|S)zJ
    Primary implementation of glibc_version_string using os.confstr.
    CS_GNU_LIBC_VERSIONN)osconfstrAssertionErrorr>rOSErrorr)version_stringrZrmrrrrs	rcCsryddl}Wntk
r dSX|d}y
|j}Wntk
rJdSX|j|_|}t|tsn|	d}|S)zG
    Fallback implementation of glibc_version_string using ctypes.
    rNascii)
ctypesrCDLLgnu_get_libc_versionrc_char_prestyper*strdecode)rprocess_namespacerrrrrrs



rcCsHtd|}|s$td|tdSt|d|koFt|d|kS)Nz$(?P[0-9]+)\.(?P[0-9]+)z=Expected glibc version with 2 components major.minor, got: %sFrr)rematchwarningsrHRuntimeWarningrgroup)rrequired_major
minimum_minorrirrr_check_glibc_versionsrcCst}|dkrdSt|||S)NF)rr)rrrrrrrsrc@sTeZdZGdddeZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
dZdS)_ELFFileHeaderc@seZdZdZdS)z$_ELFFileHeader._InvalidELFFileHeaderz7
        An invalid ELF file header was found.
        N)r5r6r7r8rrrr_InvalidELFFileHeadersriFLEr	r_r^(>l~iicsrfdd}|d|_|j|jkr*t|d|_|j|j|jhkrNt|d|_|j|j|j	hkrrt|d|_
|d|_|d|_
d|_|j|jkrdnd}|j|jkrdnd}|j|jkrd	nd
}|j|jkr|n|}|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_|||_dS)NcsByt|t|\}Wntjk
r<tYnX|S)N)structunpackreadcalcsizeerrorrr)fmtresult)filerrr)sz'_ELFFileHeader.__init__..unpackz>IBzHzQ)
e_ident_magicELF_MAGIC_NUMBERrr
e_ident_class
ELFCLASS32
ELFCLASS64e_ident_dataELFDATA2LSBELFDATA2MSBe_ident_version
e_ident_osabie_ident_abiversionre_ident_pade_type	e_machine	e_versione_entrye_phoffe_shoffe_flagse_ehsizee_phentsizee_phnume_shentsizee_shnum
e_shstrndx)r%rrformat_hformat_iformat_qformat_pr)rrr)'s>


















z_ELFFileHeader.__init__N)r5r6r7rrrrrrrEM_386EM_S390EM_ARM	EM_X86_64EF_ARM_ABIMASKEF_ARM_ABI_VER5EF_ARM_ABI_FLOAT_HARDr)rrrrrsrcCsHy$ttjd}t|}WdQRXWnttttjfk
rBdSX|S)Nrb)openrr
executablerIOErrorrrNr)f
elf_headerrrr_get_elf_headerSsrcCsnt}|dkrdS|j|jk}||j|jkM}||j|jkM}||j|j@|j	kM}||j|j
@|j
kM}|S)NF)rrrrrrrrrrr	)rrrrr_is_linux_armhf]s



rcCsBt}|dkrdS|j|jk}||j|jkM}||j|jkM}|S)NF)rrrrrrr)rrrrr_is_linux_i686qsrcCs |dkrtS|dkrtSdS)Narmv7li686T)rr)rrrr_have_compatible_manylinux_abi|s
rccsttj}|r,|dkr d}n|dkr,d}g}|dd\}}t|rv|dkrZ|d|d	krv|d
|dt|}x*|D]"\}}t||r|	d|VPqWx|D]\}}|	d|VqW|VdS)
Nlinux_x86_64
linux_i686
linux_aarch64linux_armv7lrZr	>s390xrrrppc64leaarch64r)
manylinux2014)r_>rr)
manylinux2010)r_)
manylinux1)r_rlinux)
r]	distutilsutilget_platformr>rrtrLrr[)rr"manylinux_supportrZrmanylinux_support_iterrWrrrr_linux_platformss2
r(ccsttjVdS)N)r]r#r$r%rrrr_generic_platformssr)cCs.tdkrtStdkr$tStSdS)z;
    Provides the platform tags for this installation.
    DarwinLinuxN)r(systemrr(r)rrrrrs
rcCs<ytjj}Wn tk
r,t}YnXt|p:|S)z6
    Returns the name of the running interpreter.
    )	rrimplementationrWrr(python_implementationr$INTERPRETER_SHORT_NAMESget)rWrrrrs
rcKs:td|}td|d}|r$t|}nttjdd}|S)z9
    Returns the version of the running interpreter.
    rpy_version_nodot)rHNr_)rRrYrrprrr)rPrHrmrrrrs

rcCs,tdd|Drd}nd}|tt|S)Ncss|]}|dkVqdS)rNr)rvrrrrsz!_version_nodot..rZrc)rrrr)rmseprrrrpsrpcksdtd|}t}|dkr4x0t|dD]
}|Vq$WnxtD]
}|Vqs0


7



&
9


#@
	!

	PK!QvfPfP7_vendor/packaging/__pycache__/specifiers.cpython-37.pycnu[B

Re|@sXddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZerddlmZmZmZmZmZmZmZmZmZeeefZeeeefZeeege fZ!Gd	d
d
e"Z#Gddde
ej$e%Z&Gd
dde&Z'Gddde'Z(ddZ)Gddde'Z*e+dZ,ddZ-ddZ.Gddde&Z/dS))absolute_importdivisionprint_functionN)string_typeswith_metaclass)
TYPE_CHECKING)canonicalize_version)Version
LegacyVersionparse)	ListDictUnionIterableIteratorOptionalCallableTuple	FrozenSetc@seZdZdZdS)InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/specifiers.pyr"src@seZdZejddZejddZejddZejddZej	d	d
Z
e
jdd
Z
ejdd
dZejdddZ
dS)
BaseSpecifiercCsdS)z
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr)selfrrr__str__)szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nr)rrrr__hash__1szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr)rotherrrr__eq__8szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nr)rr!rrr__ne__@szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rrrrprereleasesHszBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rvaluerrrr$PsNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr)ritemr$rrrcontainsXszBaseSpecifier.containscCsdS)z
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)riterabler$rrrfilter_szBaseSpecifier.filter)N)N)rrrabcabstractmethodrr r"r#abstractpropertyr$setterr'r)rrrrr(src@seZdZiZd"ddZddZddZed	d
ZddZ	d
dZ
ddZddZddZ
eddZeddZeddZejddZddZd#ddZd$d d!ZdS)%_IndividualSpecifierNcCsF|j|}|std||d|df|_||_dS)NzInvalid specifier: '{0}'operatorversion)_regexsearchrformatgroupstrip_spec_prereleases)rspecr$matchrrr__init__lsz_IndividualSpecifier.__init__cCs0|jdk	rd|jnd}d|jjt||S)Nz, prereleases={0!r}r/z<{0}({1!r}{2})>)r8r4r$	__class__rstr)rprerrr__repr__zsz_IndividualSpecifier.__repr__cCsdj|jS)Nz{0}{1})r4r7)rrrrrsz_IndividualSpecifier.__str__cCs|jdt|jdfS)Nrr)r7r	)rrrr_canonical_specsz$_IndividualSpecifier._canonical_speccCs
t|jS)N)hashr@)rrrrr sz_IndividualSpecifier.__hash__cCsPt|tr4y|t|}WqDtk
r0tSXnt||jsDtS|j|jkS)N)
isinstancerr<r=rNotImplementedr@)rr!rrrr"s
z_IndividualSpecifier.__eq__cCsPt|tr4y|t|}WqDtk
r0tSXnt||jsDtS|j|jkS)N)rBrr<r=rrCr7)rr!rrrr#s
z_IndividualSpecifier.__ne__cCst|d|j|}|S)Nz_compare_{0})getattrr4
_operators)ropoperator_callablerrr
_get_operatorsz"_IndividualSpecifier._get_operatorcCst|ttfst|}|S)N)rBrr
r)rr1rrr_coerce_versionsz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr)r7)rrrrr0sz_IndividualSpecifier.operatorcCs
|jdS)Nr)r7)rrrrr1sz_IndividualSpecifier.versioncCs|jS)N)r8)rrrrr$sz _IndividualSpecifier.prereleasescCs
||_dS)N)r8)rr%rrrr$scCs
||S)N)r')rr&rrr__contains__sz!_IndividualSpecifier.__contains__cCs>|dkr|j}||}|jr&|s&dS||j}|||jS)NF)r$rI
is_prereleaserHr0r1)rr&r$normalized_itemrGrrrr's

z_IndividualSpecifier.containsccsd}g}d|dk	r|ndi}xJ|D]B}||}|j|f|r"|jrZ|sZ|jsZ||q"d}|Vq"W|s|rx|D]
}|VqvWdS)NFr$T)rIr'rKr$append)rr(r$yieldedfound_prereleaseskwr1parsed_versionrrrr)s




z_IndividualSpecifier.filter)r/N)N)N)rrrrEr;r?rpropertyr@r r"r#rHrIr0r1r$r-rJr'r)rrrrr.hs"


r.c@sveZdZdZededejejBZdddddd	d
Z	ddZ
d
dZddZddZ
ddZddZddZdS)LegacySpecifiera
        (?P(==|!=|<=|>=|<|>))
        \s*
        (?P
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        z^\s*z\s*$equal	not_equalless_than_equalgreater_than_equal	less_thangreater_than)z==z!=z<=z>=<>cCst|tstt|}|S)N)rBrr=)rr1rrrrI s
zLegacySpecifier._coerce_versioncCs|||kS)N)rI)rprospectiver9rrr_compare_equal&szLegacySpecifier._compare_equalcCs|||kS)N)rI)rr\r9rrr_compare_not_equal*sz"LegacySpecifier._compare_not_equalcCs|||kS)N)rI)rr\r9rrr_compare_less_than_equal.sz(LegacySpecifier._compare_less_than_equalcCs|||kS)N)rI)rr\r9rrr_compare_greater_than_equal2sz+LegacySpecifier._compare_greater_than_equalcCs|||kS)N)rI)rr\r9rrr_compare_less_than6sz"LegacySpecifier._compare_less_thancCs|||kS)N)rI)rr\r9rrr_compare_greater_than:sz%LegacySpecifier._compare_greater_thanN)rrr
_regex_strrecompileVERBOSE
IGNORECASEr2rErIr]r^r_r`rarbrrrrrSsrScstfdd}|S)Ncst|tsdS|||S)NF)rBr
)rr\r9)fnrrwrappedCs
z)_require_version_compare..wrapped)	functoolswraps)rhrir)rhr_require_version_compare?srlc	@seZdZdZededejejBZdddddd	d
ddZ	e
d
dZe
ddZe
ddZ
e
ddZe
ddZe
ddZe
ddZddZeddZejddZd S)!	Specifiera
        (?P(~=|==|!=|<=|>=|<|>|===))
        (?P
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?=rZr[z===cCsNdttddt|dd}|d7}|d||oL|d||S)N.cSs|do|dS)Npostdev)
startswith)xrrrz/Specifier._compare_compatible..z.*z>=z==)joinlist	itertools	takewhile_version_splitrH)rr\r9prefixrrr_compare_compatibles

zSpecifier._compare_compatiblec	Csz|drVt|j}t|dd}tt|}|dt|}t||\}}||kSt|}|jsnt|j}||kSdS)Nz.*)endswithr
publicr|r=len_pad_versionlocal)	rr\r9
split_specsplit_prospectiveshortened_prospectivepadded_specpadded_prospectivespec_versionrrrr]s


zSpecifier._compare_equalcCs|||S)N)r])rr\r9rrrr^szSpecifier._compare_not_equalcCst|jt|kS)N)r
r)rr\r9rrrr_sz"Specifier._compare_less_than_equalcCst|jt|kS)N)r
r)rr\r9rrrr`
sz%Specifier._compare_greater_than_equalcCs<t|}||ksdS|js8|jr8t|jt|jkr8dSdS)NFT)r
rKbase_version)rr\spec_strr9rrrraszSpecifier._compare_less_thancCs^t|}||ksdS|js8|jr8t|jt|jkr8dS|jdk	rZt|jt|jkrZdSdS)NFT)r
is_postreleaserr)rr\rr9rrrrb1s
zSpecifier._compare_greater_thancCst|t|kS)N)r=lower)rr\r9rrr_compare_arbitraryRszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|dkrN|dkr@|dr@|dd}t|jrNdSdS)N)z==z>=z<=z~=z===z==z.*rTF)r8r7rrrK)rr0r1rrrr$Vs


zSpecifier.prereleasescCs
||_dS)N)r8)rr%rrrr$psN)rrrrcrdrerfrgr2rErlr~r]r^r_r`rarbrrRr$r-rrrrrmMs(])		!rmz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCsDg}x:|dD],}t|}|r2||q||qW|S)Nrp)split
_prefix_regexr3extendgroupsrM)r1resultr&r:rrrr|ys
r|c
Csgg}}|ttdd||ttdd|||t|dd||t|dd|ddgtdt|dt|d|ddgtdt|dt|dttj|ttj|fS)NcSs|S)N)isdigit)rtrrrrurvz_pad_version..cSs|S)N)r)rtrrrrurvrr0)rMryrzr{rinsertmaxchain)leftright
left_splitright_splitrrrrs
,,rc@seZdZdddZddZddZd	d
ZddZd
dZddZ	ddZ
ddZeddZ
e
jddZ
ddZdddZd ddZdS)!SpecifierSetr/Nc	Csrdd|dD}t}xB|D]:}y|t|Wq tk
rX|t|Yq Xq Wt||_||_dS)NcSsg|]}|r|qSr)r6).0srrr
sz)SpecifierSet.__init__..,)	rsetaddrmrrS	frozenset_specsr8)r
specifiersr$split_specifiersparsed	specifierrrrr;s

zSpecifierSet.__init__cCs*|jdk	rd|jnd}dt||S)Nz, prereleases={0!r}r/z)r8r4r$r=)rr>rrrr?szSpecifierSet.__repr__cCsdtdd|jDS)Nrcss|]}t|VqdS)N)r=)rrrrr	sz'SpecifierSet.__str__..)rxsortedr)rrrrrszSpecifierSet.__str__cCs
t|jS)N)rAr)rrrrr szSpecifierSet.__hash__cCst|trt|}nt|ts"tSt}t|j|jB|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr|j|_ntd|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)rBrrrCrrr8
ValueError)rr!rrrr__and__s





zSpecifierSet.__and__cCs6t|ttfrtt|}nt|ts*tS|j|jkS)N)rBrr.rr=rCr)rr!rrrr"s

zSpecifierSet.__eq__cCs6t|ttfrtt|}nt|ts*tS|j|jkS)N)rBrr.rr=rCr)rr!rrrr#s

zSpecifierSet.__ne__cCs
t|jS)N)rr)rrrr__len__szSpecifierSet.__len__cCs
t|jS)N)iterr)rrrr__iter__szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd|jDS)Ncss|]}|jVqdS)N)r$)rrrrrrsz+SpecifierSet.prereleases..)r8rany)rrrrr$s

zSpecifierSet.prereleasescCs
||_dS)N)r8)rr%rrrr$scCs
||S)N)r')rr&rrrrJszSpecifierSet.__contains__csLtttfstdkr$|js2jr2dStfdd|jDS)NFc3s|]}|jdVqdS))r$N)r')rr)r&r$rrr*sz(SpecifierSet.contains..)rBrr
rr$rKallr)rr&r$r)r&r$rr's
zSpecifierSet.containscCs|dkr|j}|jr:x |jD]}|j|t|d}qW|Sg}g}xX|D]P}t|ttfsdt|}n|}t|trtqH|jr|s|s|	|qH|	|qHW|s|r|dkr|S|SdS)N)r$)
r$rr)boolrBrr
rrKrM)rr(r$r9filteredrOr&rQrrrr),s*




zSpecifierSet.filter)r/N)N)N)rrrr;r?rr rr"r#rrrRr$r-rJr'r)rrrrrs

		
r)0
__future__rrrr*rjrzrd_compatrr_typingrutilsr	r1r
rrtypingr
rrrrrrrrZ
ParsedVersionr=ZUnparsedVersionrZCallableOperatorrrABCMetaobjectrr.rSrlrmrerr|rrrrrrs4,@ 8+
PK!O6_vendor/packaging/__pycache__/__about__.cpython-37.pycnu[B

Re@sPddlmZmZmZdddddddd	gZd
ZdZdZd
ZdZ	dZ
dZde	ZdS))absolute_importdivisionprint_function	__title____summary____uri____version__
__author__	__email____license__
__copyright__	packagingz"Core utilities for Python packagesz!https://github.com/pypa/packagingz20.4z)Donald Stufft and individual contributorszdonald@stufft.iozBSD-2-Clause or Apache-2.0zCopyright 2014-2019 %sN)
__future__rrr__all__rrrrr	r
rrrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/__about__.pys PK!|l$l$4_vendor/packaging/__pycache__/markers.cpython-37.pycnu[B

Re%%	@sddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZmZddlm
Z
mZmZmZddlmZddlmZddlmZdd	lmZmZerdd
lmZmZmZmZmZm Z m!Z!ee"e"ge#fZ$ddd
ddgZ%Gddde&Z'Gddde&Z(Gdd
d
e&Z)Gddde*Z+Gddde+Z,Gddde+Z-Gddde+Z.ededBedBedBedBed Bed!Bed"Bed#Bed$Bed%Bed&Bed'Bed(Bed)Bed*Bed+Bed,BZ/d%d$d d!ddd-Z0e/1d.d/ed0ed1Bed2Bed3Bed4Bed5Bed6Bed7BZ2e2ed8Bed9BZ3e31d:d/ed;ed<BZ4e41d=d/ed>ed?BZ5e/e4BZ6ee6e3e6Z7e71d@d/edA8Z9edB8Z:eZ;e7ee9e;e:BZee;eZ=dCdDZ>dWdFdGZ?dHd/dId/ej@ejAejBejCejDejEdJZFdKdLZGGdMdNdNe*ZHeHZIdOdPZJdQdRZKdSdTZLdUdZMGdVdde*ZNdS)X)absolute_importdivisionprint_functionN)ParseExceptionParseResultsstringStart	stringEnd)
ZeroOrMoreGroupForwardQuotedString)Literal)string_types)
TYPE_CHECKING)	SpecifierInvalidSpecifier)AnyCallableDictListOptionalTupleUnion
InvalidMarkerUndefinedComparisonUndefinedEnvironmentNameMarkerdefault_environmentc@seZdZdZdS)rzE
    An invalid marker was found, users should refer to PEP 508.
    N)__name__
__module____qualname____doc__r#r#/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/markers.pyr"sc@seZdZdZdS)rzP
    An invalid operation was attempted on a value that doesn't support it.
    N)rr r!r"r#r#r#r$r(sc@seZdZdZdS)rz\
    A name was attempted to be used that does not exist inside of the
    environment.
    N)rr r!r"r#r#r#r$r.sc@s,eZdZddZddZddZddZd	S)
NodecCs
||_dS)N)value)selfr&r#r#r$__init__6sz
Node.__init__cCs
t|jS)N)strr&)r'r#r#r$__str__:szNode.__str__cCsd|jjt|S)Nz<{0}({1!r})>)format	__class__rr))r'r#r#r$__repr__>sz
Node.__repr__cCstdS)N)NotImplementedError)r'r#r#r$	serializeBszNode.serializeN)rr r!r(r*r-r/r#r#r#r$r%5sr%c@seZdZddZdS)VariablecCst|S)N)r))r'r#r#r$r/HszVariable.serializeN)rr r!r/r#r#r#r$r0Gsr0c@seZdZddZdS)ValuecCs
d|S)Nz"{0}")r+)r'r#r#r$r/NszValue.serializeN)rr r!r/r#r#r#r$r1Msr1c@seZdZddZdS)OpcCst|S)N)r))r'r#r#r$r/TszOp.serializeN)rr r!r/r#r#r#r$r2Ssr2implementation_versionplatform_python_implementationimplementation_namepython_full_versionplatform_releaseplatform_versionplatform_machineplatform_systempython_versionsys_platformos_namezos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationpython_implementationextra)zos.namezsys.platformzplatform.versionzplatform.machinezplatform.python_implementationr>cCstt|d|dS)Nr)r0ALIASESget)sltr#r#r$urEz===z==z>=z<=z!=z~=>sz(_coerce_parse_result..)
isinstancer)resultsr#r#r$rQs
rQTcCst|tttfstt|trHt|dkrHt|dttfrHt|dSt|trdd|D}|rnd|Sdd|dSn"t|trddd	|DS|SdS)
Nrrcss|]}t|ddVqdS)F)firstN)_format_marker)rRmr#r#r$	sz!_format_marker.. rOrPcSsg|]}|qSr#)r/)rRrYr#r#r$rTsz"_format_marker..)rUlistrNrAssertionErrorlenrXjoin)markerrWinnerr#r#r$rXs



rXcCs||kS)Nr#)lhsrhsr#r#r$rErFcCs||kS)Nr#)rbrcr#r#r$rErF)rIznot inrHz<=z==z!=z>=rGcCslytd||g}Wntk
r.YnX||St|}|dkrbtd||||||S)Nz#Undefined {0!r} on {1!r} and {2!r}.)	rr_r/rcontains
_operatorsrArr+)rboprcspecoperr#r#r$_eval_ops
rjc@seZdZdS)	UndefinedN)rr r!r#r#r#r$rksrkcCs(||t}t|tr$td||S)Nz/{0!r} does not exist in evaluation environment.)rA
_undefinedrUrkrr+)environmentnamer&r#r#r$_get_envs

roc	Csgg}x|D]}t|tttfs$tt|trD|dt||qt|tr|\}}}t|trvt||j	}|j	}n|j	}t||j	}|dt
|||q|dkst|dkr|gqWtdd|DS)N)rLrMrMcss|]}t|VqdS)N)all)rRitemr#r#r$rZsz$_evaluate_markers..)rUr\rNrr]append_evaluate_markersr0ror&rjany)	markersrmgroupsr`rbrgrc	lhs_value	rhs_valuer#r#r$rts"




rtcCs2d|}|j}|dkr.||dt|j7}|S)Nz{0.major}.{0.minor}.{0.micro}finalr)r+releaselevelr)serial)infoversionkindr#r#r$format_full_versions

rcCsrttdr ttjj}tjj}nd}d}||tjtt	t
tttd
tddtjdS)Nimplementation0rd.)r5r3r=r9r7r:r8r6r4r;r<)hasattrsysrrr~rnosplatformmachinereleasesystemr;r>r_python_version_tuple)iverr5r#r#r$rs 

c@s.eZdZddZddZddZd
dd	ZdS)rc
Cs`ytt||_WnFtk
rZ}z(d|||j|jd}t|Wdd}~XYnXdS)Nz+Invalid marker: {0!r}, parse error at {1!r})rQMARKERparseString_markersrr+locr)r'r`eerr_strr#r#r$r((szMarker.__init__cCs
t|jS)N)rXr)r'r#r#r$r*2szMarker.__str__cCsdt|S)Nz)r+r))r'r#r#r$r-6szMarker.__repr__NcCs$t}|dk	r||t|j|S)a$Evaluate a marker.

        Return the boolean from evaluating the given marker against the
        environment. environment is an optional argument to override all or
        part of the determined environment.

        The environment is determined from the current Python process.
        N)rupdatertr)r'rmcurrent_environmentr#r#r$evaluate:s

zMarker.evaluate)N)rr r!r(r*r-rr#r#r#r$r's
)T)O
__future__rrroperatorrrrZsetuptools.extern.pyparsingrrrrr	r
rrr
L_compatr_typingr
specifiersrrtypingrrrrrrrr)boolOperator__all__
ValueErrorrrrobjectr%r0r1r2VARIABLEr@setParseActionVERSION_CMP	MARKER_OPMARKER_VALUEBOOLOP
MARKER_VARMARKER_ITEMsuppressLPARENRPARENMARKER_EXPRMARKER_ATOMrrQrXltleeqnegegtrfrjrkrlrortrrrr#r#r#r$s$@

	PK!__2_vendor/packaging/__pycache__/utils.cpython-37.pycnu[B

Re@sxddlmZmZmZddlZddlmZmZddlm	Z	m
Z
erZddlmZm
Z
edeZedZd	d
ZddZdS)
)absolute_importdivisionprint_functionN)
TYPE_CHECKINGcast)InvalidVersionVersion)NewTypeUnionNormalizedNamez[-_.]+cCstd|}td|S)N-r)_canonicalize_regexsublowerr)namevaluer/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/packaging/utils.pycanonicalize_namesrc
Csyt|}Wntk
r |SXg}|jdkrB|d|j|tddddd|jD|j	dk	r|dd	d|j	D|j
dk	r|d
|j
|jdk	r|d|j|jdk	r|d|jd|S)
z
    This is very similar to Version.__str__, but has one subtle difference
    with the way it handles the release segment.
    rz{0}!z(\.0)+$.css|]}t|VqdS)N)str).0xrrr	/sz'canonicalize_version..Ncss|]}t|VqdS)N)r)rrrrrr3sz.post{0}z.dev{0}z+{0})
r	repochappendformatrerjoinreleaseprepostdevlocal)_versionversionpartsrrrcanonicalize_versions"
&



r))
__future__rrrr_typingrrr'rr	typingr
rrrcompilerrr)rrrrs

PK!~Ș6_vendor/more_itertools/__pycache__/more.cpython-37.pycnu[B

ReS@sjddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$dd	l%m&Z&m'Z'dd
l(m(Z(m)Z)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3dd
l4m5Z5ddl6m7Z7m8Z8m9Z9m:Z:m;Z;md?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbgSZ=e>Z?ddddZ@e?fded&ZAe?fdfd0ZBe?fdgd6ZCGdhd?d?ZDdidZEdjdZFdkd(ZGdld-ZHdmdYZIddnd:ZJddod!ZKddpd+ZLdqdVZMddrdXZNdsdSZOddtdTZPGduddZQddvdPZRdwd*ZSdxd)ZTddydZUddzdHZVdd{dIZWdd}dKZXdd~dMZYdddLZZdddNZ[ddOZ\ddd<Z]ddd@Z^dd"Z_dddQZ`GddZdZeaZbddZcdd[Zddcdddd\ZedddJZfddWZgdd#ZheiejffddZkdddZlddd'ZmGdd9d9ejejnZodddZpddZqerdfdd1Zsdd2ZtddCZuddRZvGdd,d,ZwddZxddZyddfddZze.fddddZ{GddGdGeZ|GddFdFZ}GddDdDZ~erfdd$ZddZddd3Zddd5ZerdfddBZdddAZdd=Zddd>ZGddUdUZddd;Zdd.Zdd Zdd%Zdd4ZddZddZdddEZddd/ZGdddeZGdddZdd]Zddd^Zdd8Zdd7Zdd_Zdd`ZddaZddbZGdddZdS)N)Counterdefaultdictdequeabc)Sequence)ThreadPoolExecutor)partialreducewraps)mergeheapifyheapreplaceheappop)chaincompresscountcycle	dropwhilegroupbyislicerepeatstarmap	takewhileteezip_longest)exp	factorialfloorlog)EmptyQueue)random	randrangeuniform)
itemgettermulsubgtlt)
hexversionmaxsize)	monotonic)consumeflattenpairwisepowersettakeunique_everseenAbortThreadadjacentalways_iterablealways_reversiblebucket
callback_iterchunkedcircular_shiftscollapsecollateconsecutive_groupsconsumer	countablecount_cycle	mark_ends
differencedistinct_combinationsdistinct_permutations
distributedivide	exactly_n
filter_exceptfirstgroupby_transformileninterleave_longest
interleaveintersperseislice_extendediterateichunked	is_sortedlastlocatelstripmake_decorator
map_except
map_reducenth_or_lastnth_permutationnth_product
numeric_rangeoneonlypadded
partitionsset_partitionspeekablerepeat_lastreplacerlocaterstrip
run_lengthsampleseekableSequenceViewside_effectsliced
sort_togethersplit_atsplit_aftersplit_before
split_when
split_intospystaggerstrip
substringssubstrings_indexestime_limitedunique_to_eachunzipwindowed	with_iterUnequalIterablesError	zip_equal
zip_offsetwindowed_complete
all_uniquevalue_chain
product_indexcombination_indexpermutation_indexFcs:tttt|g|r2fdd}t|SSdS)aJBreak *iterable* into lists of length *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6], 3))
        [[1, 2, 3], [4, 5, 6]]

    By the default, the last yielded list will have fewer than *n* elements
    if the length of *iterable* is not divisible by *n*:

        >>> list(chunked([1, 2, 3, 4, 5, 6, 7, 8], 3))
        [[1, 2, 3], [4, 5, 6], [7, 8]]

    To use a fill-in value instead, see the :func:`grouper` recipe.

    If the length of *iterable* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    list is yielded.

    c3s,x&D]}t|krtd|VqWdS)Nziterable is not divisible by n.)len
ValueError)chunk)iteratorn/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/more_itertools/more.pyrets
zchunked..retN)iterrr1)iterablerstrictrr)rrrr9s

c
CsFytt|Stk
r@}z|tkr0td||Sd}~XYnXdS)aReturn the first item of *iterable*, or *default* if *iterable* is
    empty.

        >>> first([0, 1, 2, 3])
        0
        >>> first([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.

    :func:`first` is useful when you have a generator of expensive-to-retrieve
    values and want any arbitrary one. It is marginally shorter than
    ``next(iter(iterable), default)``.

    zKfirst() was called on an empty iterable, and no default value was provided.N)nextr
StopIteration_markerr)rdefaulterrrrIsc
CstyDt|tr|dSt|dr2tdkr2tt|St|dddSWn*ttt	fk
rn|t
krjtd|SXdS)aReturn the last item of *iterable*, or *default* if *iterable* is
    empty.

        >>> last([0, 1, 2, 3])
        3
        >>> last([], 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    __reversed__ir,)maxlenzDlast() was called on an empty iterable, and no default was provided.N)
isinstancerhasattrr)rreversedr
IndexError	TypeErrorrrr)rrrrrrSs
cCstt||d|dS)agReturn the nth or the last item of *iterable*,
    or *default* if *iterable* is empty.

        >>> nth_or_last([0, 1, 2, 3], 2)
        2
        >>> nth_or_last([0, 1], 2)
        1
        >>> nth_or_last([], 0, 'some default')
        'some default'

    If *default* is not provided and there are no items in the iterable,
    raise ``ValueError``.
    r,)r)rSr)rrrrrrrYsc@sTeZdZdZddZddZddZefdd	Zd
dZ	dd
Z
ddZddZdS)rbaWrap an iterator to allow lookahead and prepending elements.

    Call :meth:`peek` on the result to get the value that will be returned
    by :func:`next`. This won't advance the iterator:

        >>> p = peekable(['a', 'b'])
        >>> p.peek()
        'a'
        >>> next(p)
        'a'

    Pass :meth:`peek` a default value to return that instead of raising
    ``StopIteration`` when the iterator is exhausted.

        >>> p = peekable([])
        >>> p.peek('hi')
        'hi'

    peekables also offer a :meth:`prepend` method, which "inserts" items
    at the head of the iterable:

        >>> p = peekable([1, 2, 3])
        >>> p.prepend(10, 11, 12)
        >>> next(p)
        10
        >>> p.peek()
        11
        >>> list(p)
        [11, 12, 1, 2, 3]

    peekables can be indexed. Index 0 is the item that will be returned by
    :func:`next`, index 1 is the item after that, and so on:
    The values up to the given index will be cached.

        >>> p = peekable(['a', 'b', 'c', 'd'])
        >>> p[0]
        'a'
        >>> p[1]
        'b'
        >>> next(p)
        'a'

    Negative indexes are supported, but be aware that they will cache the
    remaining items in the source iterator, which may require significant
    storage.

    To check whether a peekable is exhausted, check its truth value:

        >>> p = peekable(['a', 'b'])
        >>> if p:  # peekable has items
        ...     list(p)
        ['a', 'b']
        >>> if not p:  # peekable is exhausted
        ...     list(p)
        []

    cCst||_t|_dS)N)r_itr_cache)selfrrrr__init__%s
zpeekable.__init__cCs|S)Nr)rrrr__iter__)szpeekable.__iter__cCs&y|Wntk
r dSXdS)NFT)peekr)rrrr__bool__,s
zpeekable.__bool__cCsF|js>> p = peekable([1, 2, 3])
            >>> p.prepend(10, 11, 12)
            >>> next(p)
            10
            >>> list(p)
            [11, 12, 1, 2, 3]

        It is possible, by prepending items, to "resurrect" a peekable that
        previously raised ``StopIteration``.

            >>> p = peekable([])
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration
            >>> p.prepend(1)
            >>> next(p)
            1
            >>> next(p)
            Traceback (most recent call last):
              ...
            StopIteration

        N)r
extendleftr)ritemsrrrprependCszpeekable.prependcCs|jr|jSt|jS)N)rpopleftrr)rrrr__next__bs
zpeekable.__next__cCs|jdkrdn|j}|dkrF|jdkr*dn|j}|jdkr>tn|j}n@|dkr~|jdkr\dn|j}|jdkrvtdn|j}ntd|dks|dkr|j|jn>tt	||dt}t
|j}||kr|jt|j||t|j|S)Nr,rrzslice step cannot be zero)
stepstartstopr*rrextendrminmaxrrlist)rindexrrrr	cache_lenrrr
_get_slicehs
zpeekable._get_slicecCsdt|tr||St|j}|dkr6|j|jn$||krZ|jt|j|d||j|S)Nrr,)rslicerrrrrr)rrrrrr__getitem__s


zpeekable.__getitem__N)
__name__
__module____qualname____doc__rrrrrrrrrrrrrrbs9cOstdtt||S)aReturn a sorted merge of the items from each of several already-sorted
    *iterables*.

        >>> list(collate('ACDZ', 'AZ', 'JKL'))
        ['A', 'A', 'C', 'D', 'J', 'K', 'L', 'Z', 'Z']

    Works lazily, keeping only the next value from each iterable in memory. Use
    :func:`collate` to, for example, perform a n-way mergesort of items that
    don't fit in memory.

    If a *key* function is specified, the iterables will be sorted according
    to its result:

        >>> key = lambda s: int(s)  # Sort by numeric value, not by string
        >>> list(collate(['1', '10'], ['2', '11'], key=key))
        ['1', '2', '10', '11']


    If the *iterables* are sorted in descending order, set *reverse* to
    ``True``:

        >>> list(collate([5, 3, 1], [4, 2, 0], reverse=True))
        [5, 4, 3, 2, 1, 0]

    If the elements of the passed-in iterables are out of order, you might get
    unexpected results.

    On Python 3.5+, this function is an alias for :func:`heapq.merge`.

    z>> @consumer
        ... def tally():
        ...     i = 0
        ...     while True:
        ...         print('Thing number %s is %s.' % (i, (yield)))
        ...         i += 1
        ...
        >>> t = tally()
        >>> t.send('red')
        Thing number 0 is red.
        >>> t.send('fish')
        Thing number 1 is fish.

    Without the decorator, you would have to call ``next(t)`` before
    ``t.send()`` could be used.

    cs||}t||S)N)r)argsrgen)funcrrwrappers
zconsumer..wrapper)r
)rrr)rrr>scCs t}tt||ddt|S)zReturn the number of items in *iterable*.

        >>> ilen(x for x in range(1000000) if x % 3 == 0)
        333334

    This consumes the iterable, so handle with care.

    r)r)rrzipr)rcounterrrrrKsccsx|V||}qWdS)zReturn ``start``, ``func(start)``, ``func(func(start))``, ...

    >>> from itertools import islice
    >>> list(islice(iterate(lambda x: 2*x, 1), 10))
    [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]

    Nr)rrrrrrPsc	cs|}|EdHWdQRXdS)a:Wrap an iterable in a ``with`` statement, so it closes once exhausted.

    For example, this will close the file when the iterator is exhausted::

        upper_lines = (line.upper() for line in with_iter(open('foo')))

    Any context manager which returns an iterable is a candidate for
    ``with_iter``.

    Nr)Zcontext_managerrrrrr|sc
Cst|}yt|}Wn0tk
rD}z|p0td|Wdd}~XYnXyt|}Wntk
rfYnXd||}|p~t||S)aReturn the first item from *iterable*, which is expected to contain only
    that item. Raise an exception if *iterable* is empty or has more than one
    item.

    :func:`one` is useful for ensuring that an iterable contains only one item.
    For example, it can be used to retrieve the result of a database query
    that is expected to return a single row.

    If *iterable* is empty, ``ValueError`` will be raised. You may specify a
    different exception with the *too_short* keyword:

        >>> it = []
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: too many items in iterable (expected 1)'
        >>> too_short = IndexError('too few items')
        >>> one(it, too_short=too_short)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        IndexError: too few items

    Similarly, if *iterable* contains more than one item, ``ValueError`` will
    be raised. You may specify a different exception with the *too_long*
    keyword:

        >>> it = ['too', 'many']
        >>> one(it)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        ValueError: Expected exactly one item in iterable, but got 'too',
        'many', and perhaps more.
        >>> too_long = RuntimeError
        >>> one(it, too_long=too_long)  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        RuntimeError

    Note that :func:`one` attempts to advance *iterable* twice to ensure there
    is only one item. See :func:`spy` or :func:`peekable` to check iterable
    contents less destructively.

    z&too few items in iterable (expected 1)NzLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)rrrrformat)rZ	too_shorttoo_longitfirst_valuersecond_valuemsgrrrr]s,
csrfdd}dd}t|}t||dkr0}d|krDkrbnn|krX||S|||St|rldndS)	aYield successive distinct permutations of the elements in *iterable*.

        >>> sorted(distinct_permutations([1, 0, 1]))
        [(0, 1, 1), (1, 0, 1), (1, 1, 0)]

    Equivalent to ``set(permutations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    Duplicate permutations arise when there are duplicated elements in the
    input iterable. The number of items returned is
    `n! / (x_1! * x_2! * ... * x_n!)`, where `n` is the total number of
    items input, and each `x_i` is the count of a distinct item in the input
    sequence.

    If *r* is given, only the *r*-length permutations are yielded.

        >>> sorted(distinct_permutations([1, 0, 1], r=2))
        [(0, 1), (1, 0), (1, 1)]
        >>> sorted(distinct_permutations(range(3), r=2))
        [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

    c3sxt|Vx2tdddD]}||||dkrPqWdSx*td|dD]}||||krRPqRW||||||<||<|d|d||dd<qWdS)Nrr,)tuplerange)Aij)sizerr_full^s
z$distinct_permutations.._fullc	ss@|d|||d}}t|ddd}tt|}xt|V|d}x&|D]}|||krdP||}qRWdSxr|D]0}||||krz||||||<||<PqzWx8|D]0}||||kr||||||<||<PqW||d||d7}|d7}|d|||||d||d<|dd<q:WdS)Nr,r)rrr)	rrheadtailZright_head_indexesZleft_tail_indexesZpivotrrrrr_partialvs,



z'distinct_permutations.._partialNrr)r)sortedrr)rrrrrr)rrrDEs'cCs^|dkrtdnH|dkr0ttt||ddSt|g}t||}ttt||ddSdS)a6Intersperse filler element *e* among the items in *iterable*, leaving
    *n* items between each filler element.

        >>> list(intersperse('!', [1, 2, 3, 4, 5]))
        [1, '!', 2, '!', 3, '!', 4, '!', 5]

        >>> list(intersperse(None, [1, 2, 3, 4, 5], n=2))
        [1, 2, None, 3, 4, None, 5]

    rz
n must be > 0r,N)rrrMrr9r.)rrrZfillerchunksrrrrNs


csFdd|D}tttt|fddDfdd|DS)aReturn the elements from each of the input iterables that aren't in the
    other input iterables.

    For example, suppose you have a set of packages, each with a set of
    dependencies::

        {'pkg_1': {'A', 'B'}, 'pkg_2': {'B', 'C'}, 'pkg_3': {'B', 'D'}}

    If you remove one package, which dependencies can also be removed?

    If ``pkg_1`` is removed, then ``A`` is no longer necessary - it is not
    associated with ``pkg_2`` or ``pkg_3``. Similarly, ``C`` is only needed for
    ``pkg_2``, and ``D`` is only needed for ``pkg_3``::

        >>> unique_to_each({'A', 'B'}, {'B', 'C'}, {'B', 'D'})
        [['A'], ['C'], ['D']]

    If there are duplicates in one input iterable that aren't in the others
    they will be duplicated in the output. Input order is preserved::

        >>> unique_to_each("mississippi", "missouri")
        [['p', 'p'], ['o', 'u', 'r']]

    It is assumed that the elements of each iterable are hashable.

    cSsg|]}t|qSr)r).0rrrr
sz"unique_to_each..csh|]}|dkr|qS)r,r)relement)countsrr	sz!unique_to_each..csg|]}ttj|qSr)rfilter__contains__)rr)uniquesrrrs)rr
from_iterablemapset)rpoolr)rrrrysccs|dkrtd|dkr$tVdS|dkr4tdt|d}|}x.t|j|D]}|d8}|sP|}t|VqPWt|}||krtt|t|||Vn6d|krt||krnn||f|7}t|VdS)aMReturn a sliding window of width *n* over the given iterable.

        >>> all_windows = windowed([1, 2, 3, 4, 5], 3)
        >>> list(all_windows)
        [(1, 2, 3), (2, 3, 4), (3, 4, 5)]

    When the window is larger than the iterable, *fillvalue* is used in place
    of missing values:

        >>> list(windowed([1, 2, 3], 4))
        [(1, 2, 3, None)]

    Each window will advance in increments of *step*:

        >>> list(windowed([1, 2, 3, 4, 5, 6], 3, fillvalue='!', step=2))
        [(1, 2, 3), (3, 4, 5), (5, 6, '!')]

    To slide into the iterable's items, use :func:`chain` to add filler items
    to the left:

        >>> iterable = [1, 2, 3, 4]
        >>> n = 3
        >>> padding = [None] * (n - 1)
        >>> list(windowed(chain(padding, iterable), 3))
        [(None, None, 1), (None, 1, 2), (1, 2, 3), (2, 3, 4)]
    rzn must be >= 0Nr,zstep must be >= 1)r)	rrrrrrrrr)seqr	fillvaluerZwindowr_rrrrr{s(
ccsg}x"t|D]}|||fVqWt|}t|}xBtd|dD]0}x*t||dD]}||||Vq^WqHWdS)aFYield all of the substrings of *iterable*.

        >>> [''.join(s) for s in substrings('more')]
        ['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']

    Note that non-string iterables can also be subdivided.

        >>> list(substrings([0, 1, 2]))
        [(0,), (1,), (2,), (0, 1), (1, 2), (0, 1, 2)]

    rr,N)rrrrr)rritem
item_countrrrrrrvs

cs0tdtd}|rt|}fdd|DS)a@Yield all substrings and their positions in *seq*

    The items yielded will be a tuple of the form ``(substr, i, j)``, where
    ``substr == seq[i:j]``.

    This function only works for iterables that support slicing, such as
    ``str`` objects.

    >>> for item in substrings_indexes('more'):
    ...    print(item)
    ('m', 0, 1)
    ('o', 1, 2)
    ('r', 2, 3)
    ('e', 3, 4)
    ('mo', 0, 2)
    ('or', 1, 3)
    ('re', 2, 4)
    ('mor', 0, 3)
    ('ore', 1, 4)
    ('more', 0, 4)

    Set *reverse* to ``True`` to yield the same items in the opposite order.


    r,c3sB|]:}tt|dD] }||||||fVqqdS)r,N)rr)rLr)rrr	Osz%substrings_indexes..)rrr)rreverserr)rrrw1sc@s:eZdZdZd
ddZddZddZd	d
ZddZdS)r7aWrap *iterable* and return an object that buckets it iterable into
    child iterables based on a *key* function.

        >>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
        >>> s = bucket(iterable, key=lambda x: x[0])  # Bucket by 1st character
        >>> sorted(list(s))  # Get the keys
        ['a', 'b', 'c']
        >>> a_iterable = s['a']
        >>> next(a_iterable)
        'a1'
        >>> next(a_iterable)
        'a2'
        >>> list(s['b'])
        ['b1', 'b2', 'b3']

    The original iterable will be advanced and its items will be cached until
    they are used by the child iterables. This may require significant storage.

    By default, attempting to select a bucket to which no items belong  will
    exhaust the iterable and cache all values.
    If you specify a *validator* function, selected buckets will instead be
    checked against it.

        >>> from itertools import count
        >>> it = count(1, 2)  # Infinite sequence of odd numbers
        >>> key = lambda x: x % 10  # Bucket by last digit
        >>> validator = lambda x: x in {1, 3, 5, 7, 9}  # Odd digits only
        >>> s = bucket(it, key=key, validator=validator)
        >>> 2 in s
        False
        >>> list(s[2])
        []

    NcCs,t||_||_tt|_|p$dd|_dS)NcSsdS)NTr)xrrr{z!bucket.__init__..)rr_keyrrr
_validator)rrkey	validatorrrrrws

zbucket.__init__cCsH||sdSyt||}Wntk
r2dSX|j||dS)NFT)rrrr
appendleft)rvaluerrrrr}s
zbucket.__contains__ccsx|j|r|j|Vqx^yt|j}Wntk
rBdSX||}||kr`|VPq ||r |j||q WqWdS)z
        Helper to yield items from the parent iterator that match *value*.
        Items that don't match are stored in the local cache as they
        are encountered.
        N)rrrrrrrr)rrr
item_valuerrr_get_valuess


zbucket._get_valuesccsHx2|jD](}||}||r|j||qW|jEdHdS)N)rrrrrkeys)rrrrrrrs


zbucket.__iter__cCs||stdS||S)Nr)rrr)rrrrrrs
zbucket.__getitem__)N)	rrrrrrrrrrrrrr7Ss"

cCs$t|}t||}|t||fS)aReturn a 2-tuple with a list containing the first *n* elements of
    *iterable*, and an iterator with the same items as *iterable*.
    This allows you to "look ahead" at the items in the iterable without
    advancing it.

    There is one item in the list by default:

        >>> iterable = 'abcdefg'
        >>> head, iterable = spy(iterable)
        >>> head
        ['a']
        >>> list(iterable)
        ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    You may use unpacking to retrieve items instead of lists:

        >>> (head,), iterable = spy('abcdefg')
        >>> head
        'a'
        >>> (first, second), iterable = spy('abcdefg', 2)
        >>> first
        'a'
        >>> second
        'b'

    The number of items requested can be larger than the number of items in
    the iterable:

        >>> iterable = [1, 2, 3, 4, 5]
        >>> head, iterable = spy(iterable, 10)
        >>> head
        [1, 2, 3, 4, 5]
        >>> list(iterable)
        [1, 2, 3, 4, 5]

    )rr1copyr)rrrrrrrrss%
cGstt|S)a4Return a new iterable yielding from each iterable in turn,
    until the shortest is exhausted.

        >>> list(interleave([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7]

    For a version that doesn't terminate after the shortest iterable is
    exhausted, see :func:`interleave_longest`.

    )rrr)rrrrrMscGs"tt|dti}dd|DS)asReturn a new iterable yielding from each iterable in turn,
    skipping any that are exhausted.

        >>> list(interleave_longest([1, 2, 3], [4, 5], [6, 7, 8]))
        [1, 4, 6, 2, 5, 7, 3, 8]

    This function produces the same output as :func:`roundrobin`, but may
    perform better for some inputs (in particular when the number of iterables
    is large).

    rcss|]}|tk	r|VqdS)N)r)rrrrrrsz%interleave_longest..)rrrr)rrrrrrLsc#s$fdd|dEdHdS)a>Flatten an iterable with multiple levels of nesting (e.g., a list of
    lists of tuples) into non-iterable types.

        >>> iterable = [(1, 2), ([3, 4], [[5], [6]])]
        >>> list(collapse(iterable))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and
    will not be collapsed.

    To avoid collapsing other types, specify *base_type*:

        >>> iterable = ['ab', ('cd', 'ef'), ['gh', 'ij']]
        >>> list(collapse(iterable, base_type=tuple))
        ['ab', ('cd', 'ef'), 'gh', 'ij']

    Specify *levels* to stop flattening after a certain level:

    >>> iterable = [('a', ['b']), ('c', ['d'])]
    >>> list(collapse(iterable))  # Fully flattened
    ['a', 'b', 'c', 'd']
    >>> list(collapse(iterable, levels=1))  # Only one level flattened
    ['a', ['b'], 'c', ['d']]

    c3sdk	r|ks0t|ttfs0dk	r:t|r:|VdSyt|}Wntk
r`|VdSXx |D]}||dEdHqhWdS)Nr,)rstrbytesrr)nodeleveltreechild)	base_typelevelswalkrrrs
zcollapse..walkrNr)rrrr)rrrrr;sccstz^|dk	r||dkr6xB|D]}|||VqWn&x$t||D]}|||EdHqBWWd|dk	rn|XdS)auInvoke *func* on each item in *iterable* (or on each *chunk_size* group
    of items) before yielding the item.

    `func` must be a function that takes a single argument. Its return value
    will be discarded.

    *before* and *after* are optional functions that take no arguments. They
    will be executed before iteration starts and after it ends, respectively.

    `side_effect` can be used for logging, updating progress bars, or anything
    that is not functionally "pure."

    Emitting a status message:

        >>> from more_itertools import consume
        >>> func = lambda item: print('Received {}'.format(item))
        >>> consume(side_effect(func, range(2)))
        Received 0
        Received 1

    Operating on chunks of items:

        >>> pair_sums = []
        >>> func = lambda chunk: pair_sums.append(sum(chunk))
        >>> list(side_effect(func, [0, 1, 2, 3, 4, 5], 2))
        [0, 1, 2, 3, 4, 5]
        >>> list(pair_sums)
        [1, 5, 9]

    Writing to a file-like object:

        >>> from io import StringIO
        >>> from more_itertools import consume
        >>> f = StringIO()
        >>> func = lambda x: print(x, file=f)
        >>> before = lambda: print(u'HEADER', file=f)
        >>> after = f.close
        >>> it = [u'a', u'b', u'c']
        >>> consume(side_effect(func, it, before=before, after=after))
        >>> f.closed
        True

    N)r9)rr
chunk_sizebeforeafterrrrrrrk,s,
csDttfddtdD|r<fdd}t|SSdS)apYield slices of length *n* from the sequence *seq*.

    >>> list(sliced((1, 2, 3, 4, 5, 6), 3))
    [(1, 2, 3), (4, 5, 6)]

    By the default, the last yielded slice will have fewer than *n* elements
    if the length of *seq* is not divisible by *n*:

    >>> list(sliced((1, 2, 3, 4, 5, 6, 7, 8), 3))
    [(1, 2, 3), (4, 5, 6), (7, 8)]

    If the length of *seq* is not divisible by *n* and *strict* is
    ``True``, then ``ValueError`` will be raised before the last
    slice is yielded.

    This function will only work for iterables that support slicing.
    For non-sliceable iterables, see :func:`chunked`.

    c3s|]}||VqdS)Nr)rr)rrrrr}szsliced..rc3s,x&D]}t|krtd|VqWdS)Nzseq is not divisible by n.)rr)Z_slice)rrrrrs
zsliced..retN)rrrr)rrrrr)rrrrrlis
 
rccs|dkrt|VdSg}t|}xT|D]L}||rj|V|rF|gV|dkr\t|VdSg}|d8}q(||q(W|VdS)a<Yield lists of items from *iterable*, where each list is delimited by
    an item where callable *pred* returns ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b'))
        [['a'], ['c', 'd', 'c'], ['a']]

        >>> list(split_at(range(10), lambda n: n % 2 == 1))
        [[0], [2], [4], [6], [8], []]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_at(range(10), lambda n: n % 2 == 1, maxsplit=2))
        [[0], [2], [4, 5, 6, 7, 8, 9]]

    By default, the delimiting items are not included in the output.
    The include them, set *keep_separator* to ``True``.

        >>> list(split_at('abcdcba', lambda x: x == 'b', keep_separator=True))
        [['a'], ['b'], ['c', 'd', 'c'], ['b'], ['a']]

    rNr,)rrr)rpredmaxsplitZkeep_separatorbufrrrrrrns"



ccs|dkrt|VdSg}t|}xP|D]H}||rf|rf|V|dkrZ|gt|VdSg}|d8}||q(W|r~|VdS)a\Yield lists of items from *iterable*, where each list ends just before
    an item for which callable *pred* returns ``True``:

        >>> list(split_before('OneTwo', lambda s: s.isupper()))
        [['O', 'n', 'e'], ['T', 'w', 'o']]

        >>> list(split_before(range(10), lambda n: n % 3 == 0))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_before(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8, 9]]
    rNr,)rrr)rrrr	rrrrrrps 

ccs||dkrt|VdSg}t|}xJ|D]B}||||r(|r(|V|dkr^t|VdSg}|d8}q(W|rx|VdS)a[Yield lists of items from *iterable*, where each list ends with an
    item where callable *pred* returns ``True``:

        >>> list(split_after('one1two2', lambda s: s.isdigit()))
        [['o', 'n', 'e', '1'], ['t', 'w', 'o', '2']]

        >>> list(split_after(range(10), lambda n: n % 3 == 0))
        [[0], [1, 2, 3], [4, 5, 6], [7, 8, 9]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_after(range(10), lambda n: n % 3 == 0, maxsplit=2))
        [[0], [1, 2, 3], [4, 5, 6, 7, 8, 9]]

    rNr,)rrr)rrrr	rrrrrros 



ccs|dkrt|VdSt|}yt|}Wntk
r>dSX|g}xR|D]J}|||r|V|dkr||gt|VdSg}|d8}|||}qLW|VdS)aSplit *iterable* into pieces based on the output of *pred*.
    *pred* should be a function that takes successive pairs of items and
    returns ``True`` if the iterable should be split in between them.

    For example, to find runs of increasing numbers, split the iterable when
    element ``i`` is larger than element ``i + 1``:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2], lambda x, y: x > y))
        [[1, 2, 3, 3], [2, 5], [2, 4], [2]]

    At most *maxsplit* splits are done. If *maxsplit* is not specified or -1,
    then there is no limit on the number of splits:

        >>> list(split_when([1, 2, 3, 3, 2, 5, 2, 4, 2],
        ...                 lambda x, y: x > y, maxsplit=2))
        [[1, 2, 3, 3], [2, 5], [2, 4, 2]]

    rNr,)rrrrr)rrrrZcur_itemr	Z	next_itemrrrrqs(



ccs@t|}x2|D]*}|dkr(t|VdStt||VqWdS)aYield a list of sequential items from *iterable* of length 'n' for each
    integer 'n' in *sizes*.

        >>> list(split_into([1,2,3,4,5,6], [1,2,3]))
        [[1], [2, 3], [4, 5, 6]]

    If the sum of *sizes* is smaller than the length of *iterable*, then the
    remaining items of *iterable* will not be returned.

        >>> list(split_into([1,2,3,4,5,6], [2,3]))
        [[1, 2], [3, 4, 5]]

    If the sum of *sizes* is larger than the length of *iterable*, fewer items
    will be returned in the iteration that overruns *iterable* and further
    lists will be empty:

        >>> list(split_into([1,2,3,4], [1,2,3,4]))
        [[1], [2, 3], [4], []]

    When a ``None`` object is encountered in *sizes*, the returned list will
    contain items up to the end of *iterable* the same way that itertools.slice
    does:

        >>> list(split_into([1,2,3,4,5,6,7,8,9,0], [2,3,None]))
        [[1, 2], [3, 4, 5], [6, 7, 8, 9, 0]]

    :func:`split_into` can be useful for grouping a series of items where the
    sizes of the groups are not uniform. An example would be where in a row
    from a table, multiple columns represent elements of the same feature
    (e.g. a point represented by x,y,z) but, the format is not the same for
    all columns.
    N)rrr)rsizesrrrrrrr+s#

c	cst|}|dkr&t|t|EdHnb|dkr8tdnPd}x|D]}|V|d7}qBW|rh|||n||}xt|D]
}|VqzWdS)aYield the elements from *iterable*, followed by *fillvalue*, such that
    at least *n* items are emitted.

        >>> list(padded([1, 2, 3], '?', 5))
        [1, 2, 3, '?', '?']

    If *next_multiple* is ``True``, *fillvalue* will be emitted until the
    number of items emitted is a multiple of *n*::

        >>> list(padded([1, 2, 3, 4], n=3, next_multiple=True))
        [1, 2, 3, 4, None, None]

    If *n* is ``None``, *fillvalue* will be emitted indefinitely.

    Nr,zn must be at least 1r)rrrrr)	rrrZ
next_multiplerrr	remainingrrrrr_Xs

ccs:t}x|D]
}|Vq
W|tkr$|n|}t|EdHdS)a"After the *iterable* is exhausted, keep yielding its last element.

        >>> list(islice(repeat_last(range(3)), 5))
        [0, 1, 2, 2, 2]

    If the iterable is empty, yield *default* forever::

        >>> list(islice(repeat_last(range(0), 42), 5))
        [42, 42, 42, 42, 42]

    N)rr)rrrfinalrrrrcxs


cs0dkrtdt|}fddt|DS)aDistribute the items from *iterable* among *n* smaller iterables.

        >>> group_1, group_2 = distribute(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 3, 5]
        >>> list(group_2)
        [2, 4, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = distribute(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 4, 7], [2, 5], [3, 6]]

    If the length of *iterable* is smaller than *n*, then the last returned
    iterables will be empty:

        >>> children = distribute(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function uses :func:`itertools.tee` and may require significant
    storage. If you need the order items in the smaller iterables to match the
    original iterable, see :func:`divide`.

    r,zn must be at least 1csg|]\}}t||dqS)N)r)rrr)rrrrszdistribute..)rr	enumerate)rrchildrenr)rrrEs
rrr,cCs t|t|}t||||dS)a[Yield tuples whose elements are offset from *iterable*.
    The amount by which the `i`-th item in each tuple is offset is given by
    the `i`-th item in *offsets*.

        >>> list(stagger([0, 1, 2, 3]))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3)]
        >>> list(stagger(range(8), offsets=(0, 2, 4)))
        [(0, 2, 4), (1, 3, 5), (2, 4, 6), (3, 5, 7)]

    By default, the sequence will end when the final element of a tuple is the
    last item in the iterable. To continue until the first element of a tuple
    is the last item in the iterable, set *longest* to ``True``::

        >>> list(stagger([0, 1, 2, 3], longest=True))
        [(None, 0, 1), (0, 1, 2), (1, 2, 3), (2, 3, None), (3, None, None)]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    )offsetslongestr)rrr)rrrrrrrrrtscseZdZdfdd	ZZS)r}Ncs*d}|dk	r|dj|7}t|dS)Nz Iterables have different lengthsz/: index 0 has length {}; index {} has length {})rsuperr)rdetailsr)	__class__rrrs
zUnequalIterablesError.__init__)N)rrrr
__classcell__rr)rrr}sccs>x8t|dtiD]&}x|D]}|tkrtqW|VqWdS)Nr)rrr})rZcombovalrrr_zip_equal_generators


rcGstdkrtdtyZt|d}x8t|dddD]\}}t|}||kr6Pq6Wt|St|||fdWntk
rt	|SXdS)a ``zip`` the input *iterables* together, but raise
    ``UnequalIterablesError`` if they aren't all the same length.

        >>> it_1 = range(3)
        >>> it_2 = iter('abc')
        >>> list(zip_equal(it_1, it_2))
        [(0, 'a'), (1, 'b'), (2, 'c')]

        >>> it_1 = range(3)
        >>> it_2 = iter('abcd')
        >>> list(zip_equal(it_1, it_2)) # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
        ...
        more_itertools.more.UnequalIterablesError: Iterables have different
        lengths

    i
zwzip_equal will be removed in a future version of more-itertools. Use the builtin zip function with strict=True instead.rr,N)r)
r)rrrrr
rr}rr)rZ
first_sizerrrrrrr~s)rrcGst|t|krtdg}x^t||D]P\}}|dkrR|tt|||q(|dkrn|t||dq(||q(W|rt|d|iSt|S)aF``zip`` the input *iterables* together, but offset the `i`-th iterable
    by the `i`-th item in *offsets*.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1)))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e')]

    This can be used as a lightweight alternative to SciPy or pandas to analyze
    data sets in which some series have a lead or lag relationship.

    By default, the sequence will end when the shortest iterable is exhausted.
    To continue until the longest iterable is exhausted, set *longest* to
    ``True``.

        >>> list(zip_offset('0123', 'abcdef', offsets=(0, 1), longest=True))
        [('0', 'b'), ('1', 'c'), ('2', 'd'), ('3', 'e'), (None, 'f')]

    By default, ``None`` will be used to replace offsets beyond the end of the
    sequence. Specify *fillvalue* to use some other value.

    z,Number of iterables and offsets didn't matchrNr)rrrrrrrr)rrrrZ	staggeredrrrrrrsrcsndkrt|}nBt|}t|dkr>|dfdd}nt|fdd}tttt|||dS)aReturn the input iterables sorted together, with *key_list* as the
    priority for sorting. All iterables are trimmed to the length of the
    shortest one.

    This can be used like the sorting function in a spreadsheet. If each
    iterable represents a column of data, the key list determines which
    columns are used for sorting.

    By default, all iterables are sorted using the ``0``-th iterable::

        >>> iterables = [(4, 3, 2, 1), ('a', 'b', 'c', 'd')]
        >>> sort_together(iterables)
        [(1, 2, 3, 4), ('d', 'c', 'b', 'a')]

    Set a different key list to sort according to another iterable.
    Specifying multiple keys dictates how ties are broken::

        >>> iterables = [(3, 1, 2), (0, 1, 0), ('c', 'b', 'a')]
        >>> sort_together(iterables, key_list=(1, 2))
        [(2, 3, 1), (0, 0, 1), ('a', 'c', 'b')]

    To sort by a function of the elements of the iterable, pass a *key*
    function. Its arguments are the elements of the iterables corresponding to
    the key list::

        >>> names = ('a', 'b', 'c')
        >>> lengths = (1, 2, 3)
        >>> widths = (5, 2, 1)
        >>> def area(length, width):
        ...     return length * width
        >>> sort_together([names, lengths, widths], key_list=(1, 2), key=area)
        [('c', 'b', 'a'), (3, 2, 1), (1, 2, 5)]

    Set *reverse* to ``True`` to sort in descending order.

        >>> sort_together([(1, 2, 3), ('c', 'b', 'a')], reverse=True)
        [(3, 2, 1), ('a', 'b', 'c')]

    Nr,rcs|S)Nr)zipped_items)r
key_offsetrrrfrzsort_together..cs|S)Nr)r)
get_key_itemsrrrrks)rr)r$rrrr)rZkey_listrrZkey_argumentr)rrrrrm2s(
csPtt|\}}|sdS|d}t|t|}ddtfddt|DS)aThe inverse of :func:`zip`, this function disaggregates the elements
    of the zipped *iterable*.

    The ``i``-th iterable contains the ``i``-th element from each element
    of the zipped iterable. The first element is used to to determine the
    length of the remaining elements.

        >>> iterable = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> letters, numbers = unzip(iterable)
        >>> list(letters)
        ['a', 'b', 'c', 'd']
        >>> list(numbers)
        [1, 2, 3, 4]

    This is similar to using ``zip(*iterable)``, but it avoids reading
    *iterable* into memory. Note, however, that this function uses
    :func:`itertools.tee` and thus may require significant storage.

    rrcsfdd}|S)Ncs&y|Stk
r tYnXdS)N)rr)obj)rrrgetters
z)unzip..itemgetter..getterr)rrr)rrr$szunzip..itemgetterc3s |]\}}t||VqdS)N)r)rrr)r$rrrszunzip..)rsrrrrr
)rrrr)r$rrztsc	Cs|dkrtdy|ddWntk
r<t|}YnX|}tt||\}}g}d}xHtd|dD]6}|}|||kr|dn|7}|t|||qlW|S)aDivide the elements from *iterable* into *n* parts, maintaining
    order.

        >>> group_1, group_2 = divide(2, [1, 2, 3, 4, 5, 6])
        >>> list(group_1)
        [1, 2, 3]
        >>> list(group_2)
        [4, 5, 6]

    If the length of *iterable* is not evenly divisible by *n*, then the
    length of the returned iterables will not be identical:

        >>> children = divide(3, [1, 2, 3, 4, 5, 6, 7])
        >>> [list(c) for c in children]
        [[1, 2, 3], [4, 5], [6, 7]]

    If the length of the iterable is smaller than n, then the last returned
    iterables will be empty:

        >>> children = divide(5, [1, 2, 3])
        >>> [list(c) for c in children]
        [[1], [2], [3], [], []]

    This function will exhaust the iterable before returning and may require
    significant storage. If order is not important, see :func:`distribute`,
    which does not first pull the iterable into memory.

    r,zn must be at least 1Nr)rrrdivmodrrrr)	rrrqrrrrrrrrrFscCsT|dkrtdS|dk	r,t||r,t|fSyt|Stk
rNt|fSXdS)axIf *obj* is iterable, return an iterator over its items::

        >>> obj = (1, 2, 3)
        >>> list(always_iterable(obj))
        [1, 2, 3]

    If *obj* is not iterable, return a one-item iterable containing *obj*::

        >>> obj = 1
        >>> list(always_iterable(obj))
        [1]

    If *obj* is ``None``, return an empty iterable:

        >>> obj = None
        >>> list(always_iterable(None))
        []

    By default, binary and text strings are not considered iterable::

        >>> obj = 'foo'
        >>> list(always_iterable(obj))
        ['foo']

    If *base_type* is set, objects for which ``isinstance(obj, base_type)``
    returns ``True`` won't be considered iterable.

        >>> obj = {'a': 1}
        >>> list(always_iterable(obj))  # Iterate over the dict's keys
        ['a']
        >>> list(always_iterable(obj, base_type=dict))  # Treat dicts as a unit
        [{'a': 1}]

    Set *base_type* to ``None`` to avoid any special handling and treat objects
    Python considers iterable as iterable:

        >>> obj = 'foo'
        >>> list(always_iterable(obj, base_type=None))
        ['f', 'o', 'o']
    Nr)rrr)rrrrrr5s)
cCsZ|dkrtdt|\}}dg|}t|t|||}ttt|d|d}t||S)asReturn an iterable over `(bool, item)` tuples where the `item` is
    drawn from *iterable* and the `bool` indicates whether
    that item satisfies the *predicate* or is adjacent to an item that does.

    For example, to find whether items are adjacent to a ``3``::

        >>> list(adjacent(lambda x: x == 3, range(6)))
        [(False, 0), (False, 1), (True, 2), (True, 3), (True, 4), (False, 5)]

    Set *distance* to change what counts as adjacent. For example, to find
    whether items are two places away from a ``3``:

        >>> list(adjacent(lambda x: x == 3, range(6), distance=2))
        [(False, 0), (True, 1), (True, 2), (True, 3), (True, 4), (True, 5)]

    This is useful for contextualizing the results of a search function.
    For example, a code comparison tool might want to identify lines that
    have changed, but also surrounding lines to give the viewer of the diff
    context.

    The predicate function will only be called once for each item in the
    iterable.

    See also :func:`groupby_transform`, which can be used with this function
    to group ranges of items with the same `bool` value.

    rzdistance must be at least 0Frr,)rrrranyr{r)	predicaterdistancei1i2paddingselectedZadjacent_to_selectedrrrr4
s
cs:t||}r fdd|D}r6fdd|D}|S)aAn extension of :func:`itertools.groupby` that can apply transformations
    to the grouped data.

    * *keyfunc* is a function computing a key value for each item in *iterable*
    * *valuefunc* is a function that transforms the individual items from
      *iterable* after grouping
    * *reducefunc* is a function that transforms each group of items

    >>> iterable = 'aAAbBBcCC'
    >>> keyfunc = lambda k: k.upper()
    >>> valuefunc = lambda v: v.lower()
    >>> reducefunc = lambda g: ''.join(g)
    >>> list(groupby_transform(iterable, keyfunc, valuefunc, reducefunc))
    [('A', 'aaa'), ('B', 'bbb'), ('C', 'ccc')]

    Each optional argument defaults to an identity function if not specified.

    :func:`groupby_transform` is useful when grouping elements of an iterable
    using a separate iterable as the key. To do this, :func:`zip` the iterables
    and pass a *keyfunc* that extracts the first element and a *valuefunc*
    that extracts the second element::

        >>> from operator import itemgetter
        >>> keys = [0, 0, 1, 1, 1, 2, 2, 2, 3]
        >>> values = 'abcdefghi'
        >>> iterable = zip(keys, values)
        >>> grouper = groupby_transform(iterable, itemgetter(0), itemgetter(1))
        >>> [(k, ''.join(g)) for k, g in grouper]
        [(0, 'ab'), (1, 'cde'), (2, 'fgh'), (3, 'i')]

    Note that the order of items in the iterable is significant.
    Only adjacent items are grouped together, so if you don't want any
    duplicate groups, you should sort the iterable by the key function.

    c3s |]\}}|t|fVqdS)N)r)rkg)	valuefuncrrrZsz$groupby_transform..c3s|]\}}||fVqdS)Nr)rr'r()
reducefuncrrr\s)r)rkeyfuncr)r*rr)r*r)rrJ4s$
c@seZdZdZeeddZddZddZddZ	d	d
Z
ddZd
dZddZ
ddZddZddZddZddZddZddZdd Zd!S)"r\a<An extension of the built-in ``range()`` function whose arguments can
    be any orderable numeric type.

    With only *stop* specified, *start* defaults to ``0`` and *step*
    defaults to ``1``. The output items will match the type of *stop*:

        >>> list(numeric_range(3.5))
        [0.0, 1.0, 2.0, 3.0]

    With only *start* and *stop* specified, *step* defaults to ``1``. The
    output items will match the type of *start*:

        >>> from decimal import Decimal
        >>> start = Decimal('2.1')
        >>> stop = Decimal('5.1')
        >>> list(numeric_range(start, stop))
        [Decimal('2.1'), Decimal('3.1'), Decimal('4.1')]

    With *start*, *stop*, and *step*  specified the output items will match
    the type of ``start + step``:

        >>> from fractions import Fraction
        >>> start = Fraction(1, 2)  # Start at 1/2
        >>> stop = Fraction(5, 2)  # End at 5/2
        >>> step = Fraction(1, 2)  # Count by 1/2
        >>> list(numeric_range(start, stop, step))
        [Fraction(1, 2), Fraction(1, 1), Fraction(3, 2), Fraction(2, 1)]

    If *step* is zero, ``ValueError`` is raised. Negative steps are supported:

        >>> list(numeric_range(3, -1, -1.0))
        [3.0, 2.0, 1.0, 0.0]

    Be aware of the limitations of floating point numbers; the representation
    of the yielded numbers may be surprising.

    ``datetime.datetime`` objects can be used for *start* and *stop*, if *step*
    is a ``datetime.timedelta`` object:

        >>> import datetime
        >>> start = datetime.datetime(2019, 1, 1)
        >>> stop = datetime.datetime(2019, 1, 3)
        >>> step = datetime.timedelta(days=1)
        >>> items = iter(numeric_range(start, stop, step))
        >>> next(items)
        datetime.datetime(2019, 1, 1, 0, 0)
        >>> next(items)
        datetime.datetime(2019, 1, 2, 0, 0)

    rcGst|}|dkr@|\|_t|jd|_t|j|jd|_nl|dkrl|\|_|_t|j|jd|_n@|dkr|\|_|_|_n&|dkrtd|ntd|t|jd|_|j|jkrtd|j|jk|_	|
dS)Nr,rrz2numeric_range expected at least 1 argument, got {}z2numeric_range expected at most 3 arguments, got {}z&numeric_range() arg 3 must not be zero)r_stoptype_start_steprr_zeror_growing	_init_len)rrZargcrrrrs,
znumeric_range.__init__cCs"|jr|j|jkS|j|jkSdS)N)r2r/r-)rrrrrsznumeric_range.__bool__cCsr|jr:|j|kr|jkrnnqn||j|j|jkSn4|j|krR|jkrnnn|j||j|jkSdS)NF)r2r/r-r0r1)relemrrrrsznumeric_range.__contains__cCsdt|tr\t|}t|}|s&|r.|o,|S|j|jkoX|j|jkoX|d|dkSndSdS)NrF)rr\boolr/r0
_get_by_index)rotherZ
empty_selfZempty_otherrrr__eq__s


znumeric_range.__eq__cCst|tr||St|tr|jdkr.|jn
|j|j}|jdksR|j|jkrZ|j}n |j|jkrn|j	}n||j}|j
dks|j
|jkr|j	}n"|j
|jkr|j}n||j
}t|||Std
t|jdS)Nz8numeric range indices must be integers or slices, not {})rintr6rrr0r_lenr/r-rr\rrr.r)rrrrrrrrrs$


znumeric_range.__getitem__cCs&|rt|j|d|jfS|jSdS)Nr)hashr/r6r0_EMPTY_HASH)rrrr__hash__sznumeric_range.__hash__csBfddtD}jr,tttj|Stttj|SdS)Nc3s|]}j|jVqdS)N)r/r0)rr)rrrrsz)numeric_range.__iter__..)rr2rrr'r-r()rvaluesr)rrrsznumeric_range.__iter__cCs|jS)N)r:)rrrr__len__sznumeric_range.__len__cCsr|jr|j}|j}|j}n|j}|j}|j}||}||jkrHd|_n&t||\}}t|t||jk|_dS)Nr)r2r/r-r0r1r:rr9)rrrrr"rrrrrr3s
znumeric_range._init_lencCst|j|j|jffS)N)r\r/r-r0)rrrr
__reduce__
sznumeric_range.__reduce__cCsF|jdkr"dt|jt|jSdt|jt|jt|jSdS)Nr,znumeric_range({}, {})znumeric_range({}, {}, {}))r0rreprr/r-)rrrr__repr__s

znumeric_range.__repr__cCs"tt|d|j|j|jS)Nr)rr\r6r/r0)rrrrrsznumeric_range.__reversed__cCst||kS)N)r9)rrrrrr!sznumeric_range.countcCs|jrL|j|kr|jkrnqt||j|j\}}||jkrt|SnF|j|krd|jkrnn*t|j||j\}}||jkrt|Std|dS)Nz{} is not in numeric range)	r2r/r-rr0r1r9rr)rrrrrrrr$s


znumeric_range.indexcCs<|dkr||j7}|dks$||jkr,td|j||jS)Nrz'numeric range object index out of range)r:rr/r0)rrrrrr62s

znumeric_range._get_by_indexN)rrrrr;rr<rrrr8rr=rr?r3r@rBrrrr6rrrrr\as"2

cs<tstdS|dkr"tnt|}fdd|DS)aCycle through the items from *iterable* up to *n* times, yielding
    the number of completed cycles along with each item. If *n* is omitted the
    process repeats indefinitely.

    >>> list(count_cycle('AB', 3))
    [(0, 'A'), (0, 'B'), (1, 'A'), (1, 'B'), (2, 'A'), (2, 'B')]

    rNc3s |]}D]}||fVq
qdS)Nr)rrr)rrrrGszcount_cycle..)rrrr)rrrr)rrr@:s
	ccst|}yt|}Wntk
r(dSXy0x*tD] }|}t|}|dkd|fVq4WWn$tk
r~|dkd|fVYnXdS)aHYield 3-tuples of the form ``(is_first, is_last, item)``.

    >>> list(mark_ends('ABC'))
    [(True, False, 'A'), (False, False, 'B'), (False, True, 'C')]

    Use this when looping over an iterable to take special action on its first
    and/or last items:

    >>> iterable = ['Header', 100, 200, 'Footer']
    >>> total = 0
    >>> for is_first, is_last, item in mark_ends(iterable):
    ...     if is_first:
    ...         continue  # Skip the header
    ...     if is_last:
    ...         continue  # Skip the footer
    ...     total += item
    >>> print(total)
    300
    NrFT)rrrr)rrbrarrrrAJscCsJ|dkrttt||S|dkr*tdt||td}ttt||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(locate([0, 1, 1, 0, 1, 0, 0]))
        [1, 2, 4]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item.

        >>> list(locate(['a', 'b', 'c', 'b'], lambda x: x == 'b'))
        [1, 3]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(locate(iterable, pred=pred, window_size=3))
        [1, 5, 9]

    Use with :func:`seekable` to find indexes and then retrieve the associated
    items:

        >>> from itertools import count
        >>> from more_itertools import seekable
        >>> source = (3 * n + 1 if (n % 2) else n // 2 for n in count())
        >>> it = seekable(source)
        >>> pred = lambda x: x > 100
        >>> indexes = locate(it, pred=pred)
        >>> i = next(indexes)
        >>> it.seek(i)
        >>> next(it)
        106

    Nr,zwindow size must be at least 1)r)rrrrr{rr)rrwindow_sizerrrrrTos&cCs
t||S)aYield the items from *iterable*, but strip any from the beginning
    for which *pred* returns ``True``.

    For example, to remove a set of items from the start of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(lstrip(iterable, pred))
        [1, 2, None, 3, False, None]

    This function is analogous to to :func:`str.lstrip`, and is essentially
    an wrapper for :func:`itertools.dropwhile`.

    )r)rrrrrrUsccsJg}|j}|j}x4|D],}||r,||q|EdH||VqWdS)aYield the items from *iterable*, but strip any from the end
    for which *pred* returns ``True``.

    For example, to remove a set of items from the end of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(rstrip(iterable, pred))
        [None, False, None, 1, 2, None, 3]

    This function is analogous to :func:`str.rstrip`.

    N)rclear)rrcacheZcache_appendcache_clearrrrrrfs


cCstt|||S)aYield the items from *iterable*, but strip any from the
    beginning and end for which *pred* returns ``True``.

    For example, to remove a set of items from both ends of an iterable:

        >>> iterable = (None, False, None, 1, 2, None, 3, False, None)
        >>> pred = lambda x: x in {None, False, ''}
        >>> list(strip(iterable, pred))
        [1, 2, None, 3]

    This function is analogous to :func:`str.strip`.

    )rfrU)rrrrrrusc@s0eZdZdZddZddZddZdd	Zd
S)rOaAn extension of :func:`itertools.islice` that supports negative values
    for *stop*, *start*, and *step*.

        >>> iterable = iter('abcdefgh')
        >>> list(islice_extended(iterable, -4, -1))
        ['e', 'f', 'g']

    Slices with negative values require some caching of *iterable*, but this
    function takes care to minimize the amount of memory required.

    For example, you can use a negative step with an infinite iterator:

        >>> from itertools import count
        >>> list(islice_extended(count(), 110, 99, -2))
        [110, 108, 106, 104, 102, 100]

    You can also use slice notation directly:

        >>> iterable = map(str, count())
        >>> it = islice_extended(iterable)[10:20:2]
        >>> list(it)
        ['10', '12', '14', '16', '18']

    cGs(t|}|rt|t||_n||_dS)N)r_islice_helperr	_iterable)rrrrrrrrszislice_extended.__init__cCs|S)Nr)rrrrrszislice_extended.__iter__cCs
t|jS)N)rrJ)rrrrr	szislice_extended.__next__cCs&t|trtt|j|StddS)Nz4islice_extended.__getitem__ argument must be a slice)rrrOrIrJr)rrrrrr	s
zislice_extended.__getitem__N)rrrrrrrrrrrrrOs
ccs|j}|j}|jdkrtd|jp&d}|dkr||dkr>dn|}|dkrtt|d|d}|rn|ddnd}t||d}|dkr|}n"|dkrt||}nt||d}||}	|	dkrdSxt|d|	|D]\}
}|VqWn|dk	rd|dkrdt	t|||dtt|||d}xRt|D]0\}
}|
}|
|dkrR|V||q.Wnt||||EdHn8|dkrdn|}|dk	r(|dkr(|d}	tt|d|	d}|r|ddnd}|dkr||}}nt||dd}}xt||||D]\}
}|VqWn|dk	rL|d}
t	t||
|
d|dkr`|}d}	n2|dkrxd}|d}	nd}||}	|	dkrdStt||	}||d|EdHdS)Nrz1step argument must be a non-zero integer or None.r,)rr)
rrrrrr
rrrrrrr)rsrrrrGlen_iterrrrrrZcached_itemmrrrrI
	sn









rIcCs*yt|Stk
r$tt|SXdS)aAn extension of :func:`reversed` that supports all iterables, not
    just those which implement the ``Reversible`` or ``Sequence`` protocols.

        >>> print(*always_reversible(x for x in range(3)))
        2 1 0

    If the iterable is already reversible, this function returns the
    result of :func:`reversed()`. If the iterable is not reversible,
    this function will cache the remaining items in the iterable and
    yield them in reverse order, which may require significant storage.
    N)rrr)rrrrr6j	scCs|S)Nr)rrrrr|	rrc#s:x4tt|fdddD]\}}ttd|VqWdS)aYield groups of consecutive items using :func:`itertools.groupby`.
    The *ordering* function determines whether two items are adjacent by
    returning their position.

    By default, the ordering function is the identity function. This is
    suitable for finding runs of numbers:

        >>> iterable = [1, 10, 11, 12, 20, 30, 31, 32, 33, 40]
        >>> for group in consecutive_groups(iterable):
        ...     print(list(group))
        [1]
        [10, 11, 12]
        [20]
        [30, 31, 32, 33]
        [40]

    For finding runs of adjacent letters, try using the :meth:`index` method
    of a string of letters:

        >>> from string import ascii_lowercase
        >>> iterable = 'abcdfgilmnop'
        >>> ordering = ascii_lowercase.index
        >>> for group in consecutive_groups(iterable, ordering):
        ...     print(list(group))
        ['a', 'b', 'c', 'd']
        ['f', 'g']
        ['i']
        ['l', 'm', 'n', 'o', 'p']

    Each group of consecutive items is an iterator that shares it source with
    *iterable*. When an an output group is advanced, the previous group is
    no longer available unless its elements are copied (e.g., into a ``list``).

        >>> iterable = [1, 2, 11, 12, 21, 22]
        >>> saved_groups = []
        >>> for group in consecutive_groups(iterable):
        ...     saved_groups.append(list(group))  # Copy group elements
        >>> saved_groups
        [[1, 2], [11, 12], [21, 22]]

    cs|d|dS)Nrr,r)r)orderingrrr	rz$consecutive_groups..)rr,N)rr
rr$)rrNr'r(r)rNrr=|	s*)initialcCsVt|\}}yt|g}Wntk
r2tgSX|dk	r@g}t|t|t||S)aThis function is the inverse of :func:`itertools.accumulate`. By default
    it will compute the first difference of *iterable* using
    :func:`operator.sub`:

        >>> from itertools import accumulate
        >>> iterable = accumulate([0, 1, 2, 3, 4])  # produces 0, 1, 3, 6, 10
        >>> list(difference(iterable))
        [0, 1, 2, 3, 4]

    *func* defaults to :func:`operator.sub`, but other functions can be
    specified. They will be applied as follows::

        A, B, C, D, ... --> A, func(B, A), func(C, B), func(D, C), ...

    For example, to do progressive division:

        >>> iterable = [1, 2, 6, 24, 120]
        >>> func = lambda x, y: x // y
        >>> list(difference(iterable, func))
        [1, 2, 3, 4, 5]

    If the *initial* keyword is set, the first element will be skipped when
    computing successive differences.

        >>> it = [10, 11, 13, 16]  # from accumulate([1, 2, 3], initial=10)
        >>> list(difference(it, initial=10))
        [1, 2, 3]

    N)rrrrrrr)rrrOrDrCrIrrrrB	s
c@s0eZdZdZddZddZddZdd	Zd
S)rjaSReturn a read-only view of the sequence object *target*.

    :class:`SequenceView` objects are analogous to Python's built-in
    "dictionary view" types. They provide a dynamic view of a sequence's items,
    meaning that when the sequence updates, so does the view.

        >>> seq = ['0', '1', '2']
        >>> view = SequenceView(seq)
        >>> view
        SequenceView(['0', '1', '2'])
        >>> seq.append('3')
        >>> view
        SequenceView(['0', '1', '2', '3'])

    Sequence views support indexing, slicing, and length queries. They act
    like the underlying sequence, except they don't allow assignment:

        >>> view[1]
        '1'
        >>> view[1:-1]
        ['1', '2']
        >>> len(view)
        4

    Sequence views are useful as an alternative to copying, as they don't
    require (much) extra storage.

    cCst|tst||_dS)N)rrr_target)rtargetrrrr	s
zSequenceView.__init__cCs
|j|S)N)rP)rrrrrr	szSequenceView.__getitem__cCs
t|jS)N)rrP)rrrrr?	szSequenceView.__len__cCsd|jjt|jS)Nz{}({}))rrrrArP)rrrrrB	szSequenceView.__repr__N)rrrrrrr?rBrrrrrj	s
c@sNeZdZdZdddZddZddZd	d
ZefddZ	d
dZ
ddZdS)ria
Wrap an iterator to allow for seeking backward and forward. This
    progressively caches the items in the source iterable so they can be
    re-visited.

    Call :meth:`seek` with an index to seek to that position in the source
    iterable.

    To "reset" an iterator, seek to ``0``:

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> it.seek(0)
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> next(it)
        '3'

    You can also seek forward:

        >>> it = seekable((str(n) for n in range(20)))
        >>> it.seek(10)
        >>> next(it)
        '10'
        >>> it.seek(20)  # Seeking past the end of the source isn't a problem
        >>> list(it)
        []
        >>> it.seek(0)  # Resetting works even after hitting the end
        >>> next(it), next(it), next(it)
        ('0', '1', '2')

    Call :meth:`peek` to look ahead one item without advancing the iterator:

        >>> it = seekable('1234')
        >>> it.peek()
        '1'
        >>> list(it)
        ['1', '2', '3', '4']
        >>> it.peek(default='empty')
        'empty'

    Before the iterator is at its end, calling :func:`bool` on it will return
    ``True``. After it will return ``False``:

        >>> it = seekable('5678')
        >>> bool(it)
        True
        >>> list(it)
        ['5', '6', '7', '8']
        >>> bool(it)
        False

    You may view the contents of the cache with the :meth:`elements` method.
    That returns a :class:`SequenceView`, a view that updates automatically:

        >>> it = seekable((str(n) for n in range(10)))
        >>> next(it), next(it), next(it)
        ('0', '1', '2')
        >>> elements = it.elements()
        >>> elements
        SequenceView(['0', '1', '2'])
        >>> next(it)
        '3'
        >>> elements
        SequenceView(['0', '1', '2', '3'])

    By default, the cache grows as the source iterable progresses, so beware of
    wrapping very large or infinite iterables. Supply *maxlen* to limit the
    size of the cache (this of course limits how far back you can seek).

        >>> from itertools import count
        >>> it = seekable((str(n) for n in count()), maxlen=2)
        >>> next(it), next(it), next(it), next(it)
        ('0', '1', '2', '3')
        >>> list(it.elements())
        ['2', '3']
        >>> it.seek(0)
        >>> next(it), next(it), next(it), next(it)
        ('2', '3', '4', '5')
        >>> next(it)
        '6'

    NcCs0t||_|dkrg|_ntg||_d|_dS)N)r_sourcerr_index)rrrrrrrY
s

zseekable.__init__cCs|S)Nr)rrrrra
szseekable.__iter__cCsb|jdk	rHy|j|j}Wntk
r4d|_YnX|jd7_|St|j}|j||S)Nr,)rSrrrrRr)rrrrrrd
s

zseekable.__next__cCs&y|Wntk
r dSXdS)NFT)rr)rrrrrr
s
zseekable.__bool__cCsTyt|}Wntk
r*|tkr&|SX|jdkrBt|j|_|jd8_|S)Nr,)rrrrSrr)rrZpeekedrrrry
s
z
seekable.peekcCs
t|jS)N)rjr)rrrrelements
szseekable.elementscCs*||_|t|j}|dkr&t||dS)Nr)rSrrr-)rr	remainderrrrseek
sz
seekable.seek)N)rrrrrrrrrrrTrVrrrrri
sT
c@s(eZdZdZeddZeddZdS)rga
    :func:`run_length.encode` compresses an iterable with run-length encoding.
    It yields groups of repeated items with the count of how many times they
    were repeated:

        >>> uncompressed = 'abbcccdddd'
        >>> list(run_length.encode(uncompressed))
        [('a', 1), ('b', 2), ('c', 3), ('d', 4)]

    :func:`run_length.decode` decompresses an iterable that was previously
    compressed with run-length encoding. It yields the items of the
    decompressed iterable:

        >>> compressed = [('a', 1), ('b', 2), ('c', 3), ('d', 4)]
        >>> list(run_length.decode(compressed))
        ['a', 'b', 'b', 'c', 'c', 'c', 'd', 'd', 'd', 'd']

    cCsddt|DS)Ncss|]\}}|t|fVqdS)N)rK)rr'r(rrrr
sz$run_length.encode..)r)rrrrencode
szrun_length.encodecCstdd|DS)Ncss|]\}}t||VqdS)N)r)rr'rrrrr
sz$run_length.decode..)rr)rrrrdecode
szrun_length.decodeN)rrrrstaticmethodrWrXrrrrrg
scCstt|dt|||kS)aReturn ``True`` if exactly ``n`` items in the iterable are ``True``
    according to the *predicate* function.

        >>> exactly_n([True, True, False], 2)
        True
        >>> exactly_n([True, True, False], 1)
        False
        >>> exactly_n([0, 1, 2, 3, 4, 5], 3, lambda x: x < 3)
        True

    The iterable will be advanced until ``n + 1`` truthy items are encountered,
    so avoid calling it on infinite iterables.

    r,)rr1r)rrr!rrrrG
scCs$t|}tt|tt|t|S)zReturn a list of circular shifts of *iterable*.

    >>> circular_shifts(range(4))
    [(0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2)]
    )rr1rr{r)rlstrrrr:
scsfdd}|S)aReturn a decorator version of *wrapping_func*, which is a function that
    modifies an iterable. *result_index* is the position in that function's
    signature where the iterable goes.

    This lets you use itertools on the "production end," i.e. at function
    definition. This can augment what the function returns without changing the
    function's code.

    For example, to produce a decorator version of :func:`chunked`:

        >>> from more_itertools import chunked
        >>> chunker = make_decorator(chunked, result_index=0)
        >>> @chunker(3)
        ... def iter_range(n):
        ...     return iter(range(n))
        ...
        >>> list(iter_range(9))
        [[0, 1, 2], [3, 4, 5], [6, 7, 8]]

    To only allow truthy items to be returned:

        >>> truth_serum = make_decorator(filter, result_index=1)
        >>> @truth_serum(bool)
        ... def boolean_test():
        ...     return [0, 1, '', ' ', False, True]
        ...
        >>> list(boolean_test())
        [1, ' ', True]

    The :func:`peekable` and :func:`seekable` wrappers make for practical
    decorators:

        >>> from more_itertools import peekable
        >>> peekable_function = make_decorator(peekable)
        >>> @peekable_function()
        ... def str_range(*args):
        ...     return (str(x) for x in range(*args))
        ...
        >>> it = str_range(1, 20, 2)
        >>> next(it), next(it), next(it)
        ('1', '3', '5')
        >>> it.peek()
        '7'
        >>> next(it)
        '7'

    csfdd}|S)Ncsfdd}|S)Ncs(||}t}|||S)N)rinsert)rrresultZwrapping_args_)fresult_index
wrapping_args
wrapping_funcwrapping_kwargsrr
inner_wrapper
s
zOmake_decorator..decorator..outer_wrapper..inner_wrapperr)r]rb)r^r_r`ra)r]r
outer_wrapper
sz8make_decorator..decorator..outer_wrapperr)r_rarc)r^r`)r_rar	decorator
s	z!make_decorator..decoratorr)r`r^rdr)r^r`rrV
s2c	Cs||dkrddn|}tt}x*|D]"}||}||}|||q"W|dk	rrx |D]\}}||||<qZWd|_|S)aReturn a dictionary that maps the items in *iterable* to categories
    defined by *keyfunc*, transforms them with *valuefunc*, and
    then summarizes them by category with *reducefunc*.

    *valuefunc* defaults to the identity function if it is unspecified.
    If *reducefunc* is unspecified, no summarization takes place:

        >>> keyfunc = lambda x: x.upper()
        >>> result = map_reduce('abbccc', keyfunc)
        >>> sorted(result.items())
        [('A', ['a']), ('B', ['b', 'b']), ('C', ['c', 'c', 'c'])]

    Specifying *valuefunc* transforms the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> result = map_reduce('abbccc', keyfunc, valuefunc)
        >>> sorted(result.items())
        [('A', [1]), ('B', [1, 1]), ('C', [1, 1, 1])]

    Specifying *reducefunc* summarizes the categorized items:

        >>> keyfunc = lambda x: x.upper()
        >>> valuefunc = lambda x: 1
        >>> reducefunc = sum
        >>> result = map_reduce('abbccc', keyfunc, valuefunc, reducefunc)
        >>> sorted(result.items())
        [('A', 1), ('B', 2), ('C', 3)]

    You may want to filter the input iterable before applying the map/reduce
    procedure:

        >>> all_items = range(30)
        >>> items = [x for x in all_items if 10 <= x <= 20]  # Filter
        >>> keyfunc = lambda x: x % 2  # Evens map to 0; odds to 1
        >>> categories = map_reduce(items, keyfunc=keyfunc)
        >>> sorted(categories.items())
        [(0, [10, 12, 14, 16, 18, 20]), (1, [11, 13, 15, 17, 19])]
        >>> summaries = map_reduce(items, keyfunc=keyfunc, reducefunc=sum)
        >>> sorted(summaries.items())
        [(0, 90), (1, 75)]

    Note that all items in the iterable are gathered into a list before the
    summarization step, which may require significant storage.

    The returned object is a :obj:`collections.defaultdict` with the
    ``default_factory`` set to ``None``, such that it behaves like a normal
    dictionary.

    NcSs|S)Nr)rrrrr<rzmap_reduce..)rrrrdefault_factory)	rr+r)r*rrrrZ
value_listrrrrX	s3
csV|dkrBy$t|fddtt||DStk
r@YnXttt|||S)aYield the index of each item in *iterable* for which *pred* returns
    ``True``, starting from the right and moving left.

    *pred* defaults to :func:`bool`, which will select truthy items:

        >>> list(rlocate([0, 1, 1, 0, 1, 0, 0]))  # Truthy at 1, 2, and 4
        [4, 2, 1]

    Set *pred* to a custom function to, e.g., find the indexes for a particular
    item:

        >>> iterable = iter('abcb')
        >>> pred = lambda x: x == 'b'
        >>> list(rlocate(iterable, pred))
        [3, 1]

    If *window_size* is given, then the *pred* function will be called with
    that many items. This enables searching for sub-sequences:

        >>> iterable = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3]
        >>> pred = lambda *args: args == (1, 2, 3)
        >>> list(rlocate(iterable, pred=pred, window_size=3))
        [9, 5, 1]

    Beware, this function won't return anything for infinite iterables.
    If *iterable* is reversible, ``rlocate`` will reverse it and search from
    the right. Otherwise, it will search from the left and return the results
    in reverse order.

    See :func:`locate` to for other example applications.

    Nc3s|]}|dVqdS)r,Nr)rr)rLrrrpszrlocate..)rrTrrr)rrrEr)rLrreLs!c	cs|dkrtdt|}t|tg|d}t||}d}x`|D]X}||r~|dks\||kr~|d7}|EdHt||dq@|r@|dtk	r@|dVq@WdS)aYYield the items from *iterable*, replacing the items for which *pred*
    returns ``True`` with the items from the iterable *substitutes*.

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
        >>> pred = lambda x: x == 0
        >>> substitutes = (2, 3)
        >>> list(replace(iterable, pred, substitutes))
        [1, 1, 2, 3, 1, 1, 2, 3, 1, 1]

    If *count* is given, the number of replacements will be limited:

        >>> iterable = [1, 1, 0, 1, 1, 0, 1, 1, 0]
        >>> pred = lambda x: x == 0
        >>> substitutes = [None]
        >>> list(replace(iterable, pred, substitutes, count=2))
        [1, 1, None, 1, 1, None, 1, 1, 0]

    Use *window_size* to control the number of items passed as arguments to
    *pred*. This allows for locating and replacing subsequences.

        >>> iterable = [0, 1, 2, 5, 0, 1, 2, 5]
        >>> window_size = 3
        >>> pred = lambda *args: args == (0, 1, 2)  # 3 items passed to pred
        >>> substitutes = [3, 4] # Splice in these items
        >>> list(replace(iterable, pred, substitutes, window_size=window_size))
        [3, 4, 5, 3, 4, 5]

    r,zwindow_size must be at least 1rN)rrrrr{r-)	rrZsubstitutesrrErZwindowsrwrrrrdws


c#sPt|t}x:ttd|D](}fddtd|||fDVq WdS)a"Yield all possible order-preserving partitions of *iterable*.

    >>> iterable = 'abc'
    >>> for part in partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['a', 'b', 'c']

    This is unrelated to :func:`partition`.

    r,csg|]\}}||qSrr)rrr)sequencerrrszpartitions..)rN)rrr0rr)rrrr)rgrr`sc#st|}t|}|dk	r6|dkr*tdn||kr6dSfdd|dkrtx8td|dD]}||EdHqZWn||EdHdS)a
    Yield the set partitions of *iterable* into *k* parts. Set partitions are
    not order-preserving.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable, 2):
    ...     print([''.join(p) for p in part])
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']


    If *k* is not given, every set partition is generated.

    >>> iterable = 'abc'
    >>> for part in set_partitions(iterable):
    ...     print([''.join(p) for p in part])
    ['abc']
    ['a', 'bc']
    ['ab', 'c']
    ['b', 'ac']
    ['a', 'b', 'c']

    Nr,z6Can't partition in a negative or zero number of groupsc3st|}|dkr|gVn||kr4dd|DVn|^}}x$||dD]}|gf|VqLWxV||D]H}xBtt|D]2}|d||g||g||ddVqWqnWdS)Nr,cSsg|]
}|gqSrr)rrKrrrrszAset_partitions..set_partitions_helper..)rr)rr'rrMpr)set_partitions_helperrrrjs
z-set_partitions..set_partitions_helper)rrrr)rr'rrr)rjrrasc@s(eZdZdZddZddZddZdS)	rxa
    Yield items from *iterable* until *limit_seconds* have passed.
    If the time limit expires before all items have been yielded, the
    ``timed_out`` parameter will be set to ``True``.

    >>> from time import sleep
    >>> def generator():
    ...     yield 1
    ...     yield 2
    ...     sleep(0.2)
    ...     yield 3
    >>> iterable = time_limited(0.1, generator())
    >>> list(iterable)
    [1, 2]
    >>> iterable.timed_out
    True

    Note that the time is checked before each item is yielded, and iteration
    stops if  the time elapsed is greater than *limit_seconds*. If your time
    limit is 1 second, but it takes 2 seconds to generate the first item from
    the iterable, the function will run for 2 seconds and not yield anything.

    cCs2|dkrtd||_t||_t|_d|_dS)Nrzlimit_seconds must be positiveF)r
limit_secondsrrJr+_start_time	timed_out)rrkrrrrrs
ztime_limited.__init__cCs|S)Nr)rrrrr!sztime_limited.__iter__cCs*t|j}t|j|jkr&d|_t|S)NT)rrJr+rlrkrmr)rrrrrr$s

ztime_limited.__next__N)rrrrrrrrrrrrxscCsPt|}t||}yt|}Wntk
r2YnXd||}|pJt||S)a*If *iterable* has only one item, return it.
    If it has zero items, return *default*.
    If it has more than one item, raise the exception given by *too_long*,
    which is ``ValueError`` by default.

    >>> only([], default='missing')
    'missing'
    >>> only([1])
    1
    >>> only([1, 2])  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    ValueError: Expected exactly one item in iterable, but got 1, 2,
     and perhaps more.'
    >>> only([1, 2], too_long=TypeError)  # doctest: +IGNORE_EXCEPTION_DETAIL
    Traceback (most recent call last):
    ...
    TypeError

    Note that :func:`only` attempts to advance *iterable* twice to ensure there
    is only one item.  See :func:`spy` or :func:`peekable` to check
    iterable contents less destructively.
    zLExpected exactly one item in iterable, but got {!r}, {!r}, and perhaps more.)rrrrr)rrrrrrrrrrr^-s
ccsRt|}xDt|t}|tkr dStt|g|\}}t||Vt||q
WdS)aBreak *iterable* into sub-iterables with *n* elements each.
    :func:`ichunked` is like :func:`chunked`, but it yields iterables
    instead of lists.

    If the sub-iterables are read in order, the elements of *iterable*
    won't be stored in memory.
    If they are read out of order, :func:`itertools.tee` is used to cache
    elements as necessary.

    >>> from itertools import count
    >>> all_chunks = ichunked(count(), 4)
    >>> c_1, c_2, c_3 = next(all_chunks), next(all_chunks), next(all_chunks)
    >>> list(c_2)  # c_1's elements have been cached; c_3's haven't been
    [4, 5, 6, 7]
    >>> list(c_1)
    [0, 1, 2, 3]
    >>> list(c_3)
    [8, 9, 10, 11]

    N)rrrrrrr-)rrsourcerrrrrrQVs
ccs|dkrtdn|dkr$dVdSt|}tt|tddg}dg|}d}x|ryt|d\}}Wn&tk
r||d8}wRYnX|||<|d|krt|VqR|tt||dd|dtdd|d7}qRWdS)aBYield the distinct combinations of *r* items taken from *iterable*.

        >>> list(distinct_combinations([0, 0, 1], 2))
        [(0, 0), (0, 1)]

    Equivalent to ``set(combinations(iterable))``, except duplicates are not
    generated and thrown away. For larger input sequences this is much more
    efficient.

    rzr must be non-negativerNr,)rr)	rrr2r
r$rrpopr)rrr
generatorsZ
current_comborZcur_idxrirrrrC{s0

c	gs:x4|D],}y||Wn|k
r*YqX|VqWdS)aYield the items from *iterable* for which the *validator* function does
    not raise one of the specified *exceptions*.

    *validator* is called for each item in *iterable*.
    It should be a function that accepts one argument and raises an exception
    if that item is not valid.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(filter_except(int, iterable, ValueError, TypeError))
    ['1', '2', '4']

    If an exception other than one given by *exceptions* is raised by
    *validator*, it is raised like normal.
    Nr)rr
exceptionsrrrrrHs
c	gs6x0|D](}y||VWq|k
r,YqXqWdS)aTransform each item from *iterable* with *function* and yield the
    result, unless *function* raises one of the specified *exceptions*.

    *function* is called to transform each item in *iterable*.
    It should be a accept one argument.

    >>> iterable = ['1', '2', 'three', '4', None]
    >>> list(map_except(int, iterable, ValueError, TypeError))
    [1, 2, 4]

    If an exception other than one given by *exceptions* is raised by
    *function*, it is raised like normal.
    Nr)functionrrqrrrrrWs

cCst||}ttt|}|ttttd|}xbt||D]T\}}||krF||t|<|ttt|9}|ttttd|d7}qFW|S)Nr,)r1rrr!rr
r")rr'	reservoirWZ
next_indexrrrrr_sample_unweighteds
&rucsdd|D}t|t||td\}}tt|}x~t||D]p\}}||krd\}}t||}	t|	d}
t|
|}t||fd\}}tt|}qL||8}qLWfddt|DS)Ncss|]}tt|VqdS)N)rr!)rweightrrrrsz#_sample_weighted..rr,csg|]}tdqS)r,)r)rr)rsrrr

sz$_sample_weighted..)	r1rrrr!rr#r
r)rr'weightsZweight_keysZsmallest_weight_keyrZweights_to_skiprvrZt_wZr_2Z
weight_keyr)rsr_sample_weighteds 
rxcCs>|dkrgSt|}|dkr&t||St|}t|||SdS)afReturn a *k*-length list of elements chosen (without replacement)
    from the *iterable*. Like :func:`random.sample`, but works on iterables
    of unknown length.

    >>> iterable = range(100)
    >>> sample(iterable, 5)  # doctest: +SKIP
    [81, 60, 96, 16, 4]

    An iterable with *weights* may also be given:

    >>> iterable = range(100)
    >>> weights = (i * i + 1 for i in range(100))
    >>> sampled = sample(iterable, 5, weights=weights)  # doctest: +SKIP
    [79, 67, 74, 66, 78]

    The algorithm can also be used to generate weighted random permutations.
    The relative weight of each item determines the probability that it
    appears late in the permutation.

    >>> data = "abcdefgh"
    >>> weights = range(1, len(data) + 1)
    >>> sample(data, k=len(data), weights=weights)  # doctest: +SKIP
    ['c', 'a', 'b', 'e', 'g', 'd', 'h', 'f']
    rN)rrurx)rr'rwrrrrh

s
cCs6|rtnt}|dkr|nt||}tt|t|S)aReturns ``True`` if the items of iterable are in sorted order, and
    ``False`` otherwise. *key* and *reverse* have the same meaning that they do
    in the built-in :func:`sorted` function.

    >>> is_sorted(['1', '2', '3', '4', '5'], key=int)
    True
    >>> is_sorted([5, 4, 3, 1, 2], reverse=True)
    False

    The function returns ``False`` after encountering the first out-of-order
    item. If there are no out-of-order items, the iterable is exhausted.
    N)r(r'rr rr/)rrrcomparerrrrrR1
sc@seZdZdS)r3N)rrrrrrrr3D
sc@sZeZdZdZdddZddZdd	Zd
dZdd
Ze	ddZ
e	ddZddZdS)r8aConvert a function that uses callbacks to an iterator.

    Let *func* be a function that takes a `callback` keyword argument.
    For example:

    >>> def func(callback=None):
    ...     for i, c in [(1, 'a'), (2, 'b'), (3, 'c')]:
    ...         if callback:
    ...             callback(i, c)
    ...     return 4


    Use ``with callback_iter(func)`` to get an iterator over the parameters
    that are delivered to the callback.

    >>> with callback_iter(func) as it:
    ...     for args, kwargs in it:
    ...         print(args)
    (1, 'a')
    (2, 'b')
    (3, 'c')

    The function will be called in a background thread. The ``done`` property
    indicates whether it has completed execution.

    >>> it.done
    True

    If it completes successfully, its return value will be available
    in the ``result`` property.

    >>> it.result
    4

    Notes:

    * If the function uses some keyword argument besides ``callback``, supply
      *callback_kwd*.
    * If it finished executing, but raised an exception, accessing the
      ``result`` property will raise the same exception.
    * If it hasn't finished executing, accessing the ``result``
      property from within the ``with`` block will raise ``RuntimeError``.
    * If it hasn't finished executing, accessing the ``result`` property from
      outside the ``with`` block will raise a
      ``more_itertools.AbortThread`` exception.
    * Provide *wait_seconds* to adjust how frequently the it is polled for
      output.

    callback皙?cCs8||_||_d|_d|_||_tdd|_||_dS)NFr,)max_workers)	_func
_callback_kwd_aborted_future
_wait_secondsr	_executor_reader	_iterator)rrZcallback_kwdZwait_secondsrrrr{
szcallback_iter.__init__cCs|S)Nr)rrrr	__enter__
szcallback_iter.__enter__cCsd|_|jdS)NT)rrshutdown)rexc_type	exc_value	tracebackrrr__exit__
szcallback_iter.__exit__cCs|S)Nr)rrrrr
szcallback_iter.__iter__cCs
t|jS)N)rr)rrrrr
szcallback_iter.__next__cCs|jdkrdS|jS)NF)rdone)rrrrr
s
zcallback_iter.donecCs|jstd|jS)NzFunction has not yet completed)rRuntimeErrorrr\)rrrrr\
szcallback_iter.resultc#stfdd}jjjfj|i_xFyjjd}Wntk
rVYnX	|Vj
r0Pq0Wg}x:y}Wntk
rPYq|X	||q|W
|EdHdS)Ncs jrtd||fdS)Nzcanceled by user)rr3put)rr)rrrrrz
sz'callback_iter._reader..callback)timeout)r rZsubmitr}r~rgetrr	task_doner
get_nowaitrjoin)rrzrrr)rrrr
s.
zcallback_iter._readerN)rzr{)
rrrrrrrrrpropertyrr\rrrrrr8H
s1
	ccs|dkrtdt|}t|}||kr0tdxPt||dD]<}|d|}||||}|||d}|||fVqBWdS)a
    Yield ``(beginning, middle, end)`` tuples, where:

    * Each ``middle`` has *n* items from *iterable*
    * Each ``beginning`` has the items before the ones in ``middle``
    * Each ``end`` has the items after the ones in ``middle``

    >>> iterable = range(7)
    >>> n = 3
    >>> for beginning, middle, end in windowed_complete(iterable, n):
    ...     print(beginning, middle, end)
    () (0, 1, 2) (3, 4, 5, 6)
    (0,) (1, 2, 3) (4, 5, 6)
    (0, 1) (2, 3, 4) (5, 6)
    (0, 1, 2) (3, 4, 5) (6,)
    (0, 1, 2, 3) (4, 5, 6) ()

    Note that *n* must be at least 0 and most equal to the length of
    *iterable*.

    This function will exhaust the iterable and may require significant
    storage.
    rzn must be >= 0zn must be <= len(seq)r,N)rrrr)rrrrrZ	beginningZmiddleendrrrr
sc	Csxt}|j}g}|j}x\|r&t||n|D]F}y||kr>> all_unique('ABCB')
        False

    If a *key* function is specified, it will be used to make comparisons.

        >>> all_unique('ABCb')
        True
        >>> all_unique('ABCb', str.lower)
        False

    The function returns as soon as the first non-unique element is
    encountered. Iterables with a mix of hashable and unhashable items can
    be used, but the function will be slower for unhashable items.
    FT)raddrrr)rrZseensetZseenset_addZseenlistZseenlist_addrrrrr
scGstttt|}ttt|}tt|}|dkr:||7}d|krN|ksTntg}x0t||D]"\}}|	|||||}qdWtt|S)aEquivalent to ``list(product(*args))[index]``.

    The products of *args* can be ordered lexicographically.
    :func:`nth_product` computes the product at sort position *index* without
    computing the previous products.

        >>> nth_product(8, range(2), range(2), range(2), range(2))
        (1, 0, 0, 0)

    ``IndexError`` will be raised if the given *index* is invalid.
    r)
rrrrrr	r%rrr)rrpoolsnscr\rrrrrr[s
c
Cs(t|}t|}|dks ||kr0|t|}}n0d|krD|ksLntnt|t||}|dkrp||7}d|kr|ksnt|dkrtSdg|}||kr|t||n|}xXtd|dD]F}t||\}}	d||kr|kr
nn|	|||<|dkrPqWtt|j	|S)a'Equivalent to ``list(permutations(iterable, r))[index]```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`nth_permutation`
    computes the subsequence at sort position *index* directly, without
    computing the previous subsequences.

        >>> nth_permutation('ghijk', 2, 5)
        ('h', 'i')

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    Nrr,)
rrrrrrrrrro)
rrrrrrr\rdrrrrrZ.s,
c	gsRxL|D]D}t|ttfr |Vqy|EdHWqtk
rH|VYqXqWdS)aYield all arguments passed to the function in the same order in which
    they were passed. If an argument itself is iterable then iterate over its
    values.

        >>> list(value_chain(1, 2, 3, [4, 5, 6]))
        [1, 2, 3, 4, 5, 6]

    Binary and text strings are not considered iterable and are emitted
    as-is:

        >>> list(value_chain('12', '34', ['56', '78']))
        ['12', '34', '56', '78']


    Multiple levels of nesting are not flattened.

    N)rrrr)rrrrrr\s
cGsZd}xPt||tdD]>\}}|tks,|tkr4tdt|}|t|||}qW|S)aEquivalent to ``list(product(*args)).index(element)``

    The products of *args* can be ordered lexicographically.
    :func:`product_index` computes the first index of *element* without
    computing the previous products.

        >>> product_index([8, 2], range(10), range(5))
        42

    ``ValueError`` will be raised if the given *element* isn't in the product
    of *args*.
    r)rz element is not a product of args)rrrrrr)rrrrrrrrrxs
c
Cst|}t|d\}}|dkr"dSg}t|}xH|D]8\}}||kr4||t|d\}}|dkrhPq4|}q4Wtdt||dfd\}}	d}
xLtt|ddD]8\}}||}||kr|
t|t|t||7}
qWt|dt|dt|||
S)aEquivalent to ``list(combinations(iterable, r)).index(element)``

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`combination_index` computes the index of the
    first *element*, without computing the previous combinations.

        >>> combination_index('adf', 'abcdefg')
        10

    ``ValueError`` will be raised if the given *element* isn't one of the
    combinations of *iterable*.
    )NNNrz(element is not a combination of iterable)rr,)r)r
rrrrSrr)
rrr'yZindexesrrrtmprrrrrrrrs*

$cCsPd}t|}x>ttt|dd|D]$\}}||}|||}||=q$W|S)aEquivalent to ``list(permutations(iterable, r)).index(element)```

    The subsequences of *iterable* that are of length *r* where order is
    important can be ordered lexicographically. :func:`permutation_index`
    computes the index of the first *element* directly, without computing
    the previous permutations.

        >>> permutation_index([1, 3, 2], range(5))
        19

    ``ValueError`` will be raised if the given *element* isn't one of the
    permutations of *iterable*.
    rr)rrrrr)rrrrrrrrrrrs 

c@s(eZdZdZddZddZddZdS)	r?aWrap *iterable* and keep a count of how many items have been consumed.

    The ``items_seen`` attribute starts at ``0`` and increments as the iterable
    is consumed:

        >>> iterable = map(str, range(10))
        >>> it = countable(iterable)
        >>> it.items_seen
        0
        >>> next(it), next(it)
        ('0', '1')
        >>> list(it)
        ['2', '3', '4', '5', '6', '7', '8', '9']
        >>> it.items_seen
        10
    cCst||_d|_dS)Nr)rr
items_seen)rrrrrrs
zcountable.__init__cCs|S)Nr)rrrrrszcountable.__iter__cCst|j}|jd7_|S)Nr,)rrr)rrrrrrs
zcountable.__next__N)rrrrrrrrrrrr?s)F)NN)N)r,)Nr,)F)r,)NN)NNN)F)rF)r)r)r)NNF)N)rFN)rNF)r,)NNN)N)r)NN)Nr,)N)NN)N)NF)N)rcollectionsrrrrcollections.abcrconcurrent.futuresr	functoolsrr	r
heapqrrr
r	itertoolsrrrrrrrrrrrrmathrrrrqueuerr r!r"r#operatorr$r%r&r'r(sysr)r*timer+Zrecipesr-r.r/r0r1r2__all__objectrr9rIrSrYrbr<r>rKrPr|r]rDrNryr{rvrwr7rsrMrLr;rkrlrnrprorqrrr_rcrErtrr}rr~rrmrzrFrrr5r4rJHashabler\r@rAr5rTrUrfrurOrIr6r=rBrjrirgrGr:rVrXrerdr`rarxr^rQrCrHrWrurxrhrR
BaseExceptionr3r8rrr[rZrrrrr?rrrrsv8 

!&& 

C
d
!
3
"`
+
0
=
"
,
#
$
--
 
#
.'
B135
'
-Z
%0.`0*-


A
C+
=
8-
)%(#
$
|(
#.+PK!=I99:_vendor/more_itertools/__pycache__/__init__.cpython-37.pycnu[B

ReR@sddlTddlTdZdS))*z8.8.0N)ZmoreZrecipes__version__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/more_itertools/__init__.pysPK!tEE9_vendor/more_itertools/__pycache__/recipes.cpython-37.pycnu[B

Re?@sdZddlZddlmZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZddlZddlmZmZmZdddd	d
ddd
ddddddddddddddddddd d!d"gZd#d ZdDd$dZd%dZdEd&dZdFd'dZd(dZefd)dZd*dZeZd+dZd,d	Z d-dZ!dGd.dZ"d/d0Z#ydd1lm$Z%Wne&k
rDe#Z$YnXd2dZ$e#je$_dHd3dZ'd4dZ(d5dZ)d6dZ*dId7d!Z+dJd8d"Z,dKd9d
Z-dLd:d
Z.d;d<d=dZ/dMd>dZ0d?dZ1d@dZ2dAdZ3dBdZ4dCdZ5dS)NaImported from the recipes section of the itertools documentation.

All functions taken from the recipes section of the itertools library docs
[1]_.
Some backward-compatible usability improvements have been made.

.. [1] http://docs.python.org/library/itertools.html#recipes

N)deque)
chaincombinationscountcyclegroupbyislicerepeatstarmapteezip_longest)	randrangesamplechoice	all_equalconsumeconvolve
dotproduct
first_trueflattengrouperiter_exceptncyclesnthnth_combinationpadnonepad_nonepairwise	partitionpowersetprependquantify#random_combination_with_replacementrandom_combinationrandom_permutationrandom_product
repeatfunc
roundrobintabulatetailtakeunique_everseenunique_justseencCstt||S)zReturn first *n* items of the iterable as a list.

        >>> take(3, range(10))
        [0, 1, 2]

    If there are fewer than *n* items in the iterable, all of them are
    returned.

        >>> take(10, range(3))
        [0, 1, 2]

    )listr)niterabler0/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_vendor/more_itertools/recipes.pyr*<s
cCst|t|S)aReturn an iterator over the results of ``func(start)``,
    ``func(start + 1)``, ``func(start + 2)``...

    *func* should be a function that accepts one integer argument.

    If *start* is not specified it defaults to 0. It will be incremented each
    time the iterator is advanced.

        >>> square = lambda x: x ** 2
        >>> iterator = tabulate(square, -3)
        >>> take(4, iterator)
        [9, 4, 1, 0]

    )mapr)functionstartr0r0r1r(LscCstt||dS)zReturn an iterator over the last *n* items of *iterable*.

    >>> t = tail(3, 'ABCDEFG')
    >>> list(t)
    ['E', 'F', 'G']

    )maxlen)iterr)r.r/r0r0r1r)^scCs,|dkrt|ddntt|||ddS)aXAdvance *iterable* by *n* steps. If *n* is ``None``, consume it
    entirely.

    Efficiently exhausts an iterator without returning values. Defaults to
    consuming the whole iterator, but an optional second argument may be
    provided to limit consumption.

        >>> i = (x for x in range(10))
        >>> next(i)
        0
        >>> consume(i, 3)
        >>> next(i)
        4
        >>> consume(i)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    If the iterator has fewer items remaining than the provided limit, the
    whole iterator will be consumed.

        >>> i = (x for x in range(3))
        >>> consume(i, 5)
        >>> next(i)
        Traceback (most recent call last):
          File "", line 1, in 
        StopIteration

    Nr)r5)rnextr)iteratorr.r0r0r1ris cCstt||d|S)zReturns the nth item or a default value.

    >>> l = range(10)
    >>> nth(l, 3)
    3
    >>> nth(l, 20, "zebra")
    'zebra'

    N)r7r)r/r.defaultr0r0r1rs
cCst|}t|dot|dS)z
    Returns ``True`` if all the elements are equal to each other.

        >>> all_equal('aaaa')
        True
        >>> all_equal('aaab')
        False

    TF)rr7)r/gr0r0r1rs
cCstt||S)zcReturn the how many times the predicate is true.

    >>> quantify([True, False, True])
    2

    )sumr2)r/predr0r0r1r!scCst|tdS)aReturns the sequence of elements and then returns ``None`` indefinitely.

        >>> take(5, pad_none(range(3)))
        [0, 1, 2, None, None]

    Useful for emulating the behavior of the built-in :func:`map` function.

    See also :func:`padded`.

    N)rr	)r/r0r0r1rscCsttt||S)zvReturns the sequence elements *n* times

    >>> list(ncycles(["a", "b"], 3))
    ['a', 'b', 'a', 'b', 'a', 'b']

    )r
from_iterabler	tuple)r/r.r0r0r1rscCstttj||S)zcReturns the dot product of the two iterables.

    >>> dotproduct([10, 10], [20, 20])
    400

    )r;r2operatormul)Zvec1Zvec2r0r0r1rscCs
t|S)zReturn an iterator flattening one level of nesting in a list of lists.

        >>> list(flatten([[0, 1], [2, 3]]))
        [0, 1, 2, 3]

    See also :func:`collapse`, which can flatten multiple levels of nesting.

    )rr=)ZlistOfListsr0r0r1rs	cGs&|dkrt|t|St|t||S)aGCall *func* with *args* repeatedly, returning an iterable over the
    results.

    If *times* is specified, the iterable will terminate after that many
    repetitions:

        >>> from operator import add
        >>> times = 4
        >>> args = 3, 5
        >>> list(repeatfunc(add, times, *args))
        [8, 8, 8, 8]

    If *times* is ``None`` the iterable will not terminate:

        >>> from random import randrange
        >>> times = None
        >>> args = 1, 11
        >>> take(6, repeatfunc(randrange, times, *args))  # doctest:+SKIP
        [2, 4, 8, 1, 8, 4]

    N)r
r	)functimesargsr0r0r1r&sccs*t|\}}t|dt||EdHdS)zReturns an iterator of paired items, overlapping, from the original

    >>> take(4, pairwise(count()))
    [(0, 1), (1, 2), (2, 3), (3, 4)]

    On Python 3.10 and above, this is an alias for :func:`itertools.pairwise`.

    N)rr7zip)r/abr0r0r1	_pairwises	
rG)rccst|EdHdS)N)itertools_pairwise)r/r0r0r1rscCs<t|tr tdt||}}t|g|}t|d|iS)zCollect data into fixed-length chunks or blocks.

    >>> list(grouper('ABCDEFG', 3, 'x'))
    [('A', 'B', 'C'), ('D', 'E', 'F'), ('G', 'x', 'x')]

    z+grouper expects iterable as first parameter	fillvalue)
isinstanceintwarningswarnDeprecationWarningr6r)r/r.rIrCr0r0r1rs

cgsnt|}tdd|D}xN|rhyx|D]}|Vq(WWqtk
rd|d8}tt||}YqXqWdS)aJYields an item from each iterable, alternating between them.

        >>> list(roundrobin('ABC', 'D', 'EF'))
        ['A', 'D', 'E', 'B', 'F', 'C']

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    css|]}t|jVqdS)N)r6__next__).0itr0r0r1	9szroundrobin..N)lenr
StopIterationr)	iterablespendingZnextsr7r0r0r1r',s
csFdkrtfdd|D}t|\}}dd|Ddd|DfS)a
    Returns a 2-tuple of iterables derived from the input iterable.
    The first yields the items that have ``pred(item) == False``.
    The second yields the items that have ``pred(item) == True``.

        >>> is_odd = lambda x: x % 2 != 0
        >>> iterable = range(10)
        >>> even_items, odd_items = partition(is_odd, iterable)
        >>> list(even_items), list(odd_items)
        ([0, 2, 4, 6, 8], [1, 3, 5, 7, 9])

    If *pred* is None, :func:`bool` is used.

        >>> iterable = [0, 1, False, True, '', ' ']
        >>> false_items, true_items = partition(None, iterable)
        >>> list(false_items), list(true_items)
        ([0, False, ''], [1, True, ' '])

    Nc3s|]}||fVqdS)Nr0)rPx)r<r0r1rRZszpartition..css|]\}}|s|VqdS)Nr0)rPcondrXr0r0r1rR]scss|]\}}|r|VqdS)Nr0)rPrYrXr0r0r1rR^s)boolr)r<r/Zevaluationst1t2r0)r<r1rCscs,t|tfddttdDS)aYields all possible subsets of the iterable.

        >>> list(powerset([1, 2, 3]))
        [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]

    :func:`powerset` will operate on iterables that aren't :class:`set`
    instances, so repeated elements in the input will produce repeated elements
    in the output. Use :func:`unique_everseen` on the input to avoid generating
    duplicates:

        >>> seq = [1, 1, 0]
        >>> list(powerset(seq))
        [(), (1,), (1,), (0,), (1, 1), (1, 0), (1, 0), (1, 1, 0)]
        >>> from more_itertools import unique_everseen
        >>> list(powerset(unique_everseen(seq)))
        [(), (1,), (0,), (1, 0)]

    c3s|]}t|VqdS)N)r)rPr)sr0r1rRvszpowerset..rS)r-rr=rangerT)r/r0)r^r1rbsc		cst}|j}g}|j}|dk	}xb|D]Z}|r4||n|}y||krP|||VWq$tk
r|||krx|||VYq$Xq$WdS)a
    Yield unique elements, preserving order.

        >>> list(unique_everseen('AAAABBBCCDAABBB'))
        ['A', 'B', 'C', 'D']
        >>> list(unique_everseen('ABBCcAD', str.lower))
        ['A', 'B', 'C', 'D']

    Sequences with a mix of hashable and unhashable items can be used.
    The function will be slower (i.e., `O(n^2)`) for unhashable items.

    Remember that ``list`` objects are unhashable - you can use the *key*
    parameter to transform the list to a tuple (which is hashable) to
    avoid a slowdown.

        >>> iterable = ([1, 2], [2, 3], [1, 2])
        >>> list(unique_everseen(iterable))  # Slow
        [[1, 2], [2, 3]]
        >>> list(unique_everseen(iterable, key=tuple))  # Faster
        [[1, 2], [2, 3]]

    Similary, you may want to convert unhashable ``set`` objects with
    ``key=frozenset``. For ``dict`` objects,
    ``key=lambda x: frozenset(x.items())`` can be used.

    N)setaddappend	TypeError)	r/keyZseensetZseenset_addZseenlistZseenlist_addZuse_keyelementkr0r0r1r+ys

cCsttttdt||S)zYields elements in order, ignoring serial duplicates

    >>> list(unique_justseen('AAAABBBCCDAABBB'))
    ['A', 'B', 'C', 'D', 'A', 'B']
    >>> list(unique_justseen('ABBCcAD', str.lower))
    ['A', 'B', 'C', 'A', 'D']

    rS)r2r7r?
itemgetterr)r/rdr0r0r1r,s	ccs<y"|dk	r|Vx|VqWWn|k
r6YnXdS)aXYields results from a function repeatedly until an exception is raised.

    Converts a call-until-exception interface to an iterator interface.
    Like ``iter(func, sentinel)``, but uses an exception instead of a sentinel
    to end the loop.

        >>> l = [0, 1, 2]
        >>> list(iter_except(l.pop, IndexError))
        [2, 1, 0]

    Nr0)rA	exceptionfirstr0r0r1rscCstt|||S)a
    Returns the first true value in the iterable.

    If no true value is found, returns *default*

    If *pred* is not None, returns the first item for which
    ``pred(item) == True`` .

        >>> first_true(range(10))
        1
        >>> first_true(range(10), pred=lambda x: x > 5)
        6
        >>> first_true(range(10), default='missing', pred=lambda x: x > 9)
        'missing'

    )r7filter)r/r9r<r0r0r1rsrS)r	cGs$dd|D|}tdd|DS)aDraw an item at random from each of the input iterables.

        >>> random_product('abc', range(4), 'XYZ')  # doctest:+SKIP
        ('c', 3, 'Z')

    If *repeat* is provided as a keyword argument, that many items will be
    drawn from each iterable.

        >>> random_product('abcd', range(4), repeat=2)  # doctest:+SKIP
        ('a', 2, 'd', 3)

    This equivalent to taking a random selection from
    ``itertools.product(*args, **kwarg)``.

    cSsg|]}t|qSr0)r>)rPpoolr0r0r1
sz"random_product..css|]}t|VqdS)N)r)rPrkr0r0r1rRsz!random_product..)r>)r	rCpoolsr0r0r1r%scCs*t|}|dkrt|n|}tt||S)abReturn a random *r* length permutation of the elements in *iterable*.

    If *r* is not specified or is ``None``, then *r* defaults to the length of
    *iterable*.

        >>> random_permutation(range(5))  # doctest:+SKIP
        (3, 4, 0, 1, 2)

    This equivalent to taking a random selection from
    ``itertools.permutations(iterable, r)``.

    N)r>rTr)r/r]rkr0r0r1r$s
cs8t|t}ttt||}tfdd|DS)zReturn a random *r* length subsequence of the elements in *iterable*.

        >>> random_combination(range(5), 3)  # doctest:+SKIP
        (2, 3, 4)

    This equivalent to taking a random selection from
    ``itertools.combinations(iterable, r)``.

    c3s|]}|VqdS)Nr0)rPi)rkr0r1rRsz%random_combination..)r>rTsortedrr_)r/r]r.indicesr0)rkr1r#s
cs@t|ttfddt|D}tfdd|DS)aSReturn a random *r* length subsequence of elements in *iterable*,
    allowing individual elements to be repeated.

        >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
        (0, 0, 1, 2, 2)

    This equivalent to taking a random selection from
    ``itertools.combinations_with_replacement(iterable, r)``.

    c3s|]}tVqdS)N)r
)rPrn)r.r0r1rRsz6random_combination_with_replacement..c3s|]}|VqdS)Nr0)rPrn)rkr0r1rRs)r>rTror_)r/r]rpr0)r.rkr1r"sc	Cst|}t|}|dks ||kr$td}t|||}x*td|dD]}|||||}qFW|dkrr||7}|dks||krtg}xj|r||||d|d}}}x.||kr||8}|||||d}}qW||d|qWt|S)aEquivalent to ``list(combinations(iterable, r))[index]``.

    The subsequences of *iterable* that are of length *r* can be ordered
    lexicographically. :func:`nth_combination` computes the subsequence at
    sort position *index* directly, without computing the previous
    subsequences.

        >>> nth_combination(range(5), 3, 5)
        (0, 3, 4)

    ``ValueError`` will be raised If *r* is negative or greater than the length
    of *iterable*.
    ``IndexError`` will be raised if the given *index* is invalid.
    rrS)r>rT
ValueErrorminr_
IndexErrorrb)	r/r]indexrkr.crfrnresultr0r0r1r"s( 
cCst|g|S)aYield *value*, followed by the elements in *iterator*.

        >>> value = '0'
        >>> iterator = ['1', '2', '3']
        >>> list(prepend(value, iterator))
        ['0', '1', '2', '3']

    To prepend multiple values, see :func:`itertools.chain`
    or :func:`value_chain`.

    )r)valuer8r0r0r1r Lsccslt|ddd}t|}tdg|d|}x:t|td|dD]"}||tttj	||VqBWdS)aBConvolve the iterable *signal* with the iterable *kernel*.

        >>> signal = (1, 2, 3, 4, 5)
        >>> kernel = [3, 2, 1]
        >>> list(convolve(signal, kernel))
        [3, 8, 14, 20, 26, 14, 5]

    Note: the input arguments are not interchangeable, as the *kernel*
    is immediately consumed and stored.

    Nrqr)r5rS)
r>rTrrr	rbr;r2r?r@)signalkernelr.ZwindowrXr0r0r1r[s
)r)N)N)N)N)N)N)N)NN)N)6__doc__rLcollectionsr	itertoolsrrrrrrr	r
rrr?randomr
rr__all__r*r(r)rrrrZr!rrrrrr&rGrrHImportErrorrr'rrr+r,rrr%r$r#r"rr rr0r0r0r1	s0

(








-



*PK!ų-\,_distutils/__pycache__/errors.cpython-37.pycnu[B

Re
@s8dZGdddeZGdddeZGdddeZGdddeZGd	d
d
eZGdddeZGd
ddeZGdddeZ	GdddeZ
GdddeZGdddeZGdddeZ
GdddeZGdddeZGdddeZGdd d eZGd!d"d"eZGd#d$d$eZGd%d&d&eZd'S)(adistutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".c@seZdZdZdS)DistutilsErrorzThe root of all Distutils evil.N)__name__
__module____qualname____doc__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/errors.pyrsrc@seZdZdZdS)DistutilsModuleErrorzUnable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes).N)rrrrrrrrrsrc@seZdZdZdS)DistutilsClassErrorzSome command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface.N)rrrrrrrrr	sr	c@seZdZdZdS)DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.N)rrrrrrrrr
sr
c@seZdZdZdS)DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage.N)rrrrrrrrrsrc@seZdZdZdS)DistutilsFileErrorzAny problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised.N)rrrrrrrrr$src@seZdZdZdS)DistutilsOptionErroraSyntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead.N)rrrrrrrrr
*sr
c@seZdZdZdS)DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'.N)rrrrrrrrr3src@seZdZdZdS)DistutilsPlatformErrorzWe don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass.N)rrrrrrrrr8src@seZdZdZdS)DistutilsExecErrorz`Any problems executing an external program (such as the C
    compiler, when compiling C files).N)rrrrrrrrr>src@seZdZdZdS)DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!).N)rrrrrrrrrCsrc@seZdZdZdS)DistutilsTemplateErrorz%Syntax error in a file list template.N)rrrrrrrrrHsrc@seZdZdZdS)DistutilsByteCompileErrorzByte compile error.N)rrrrrrrrrKsrc@seZdZdZdS)CCompilerErrorz#Some compile/link operation failed.N)rrrrrrrrrOsrc@seZdZdZdS)PreprocessErrorz.Failure to preprocess one or more C/C++ files.N)rrrrrrrrrRsrc@seZdZdZdS)CompileErrorz2Failure to compile one or more C/C++ source files.N)rrrrrrrrrUsrc@seZdZdZdS)LibErrorzKFailure to create a static library from one or more C/C++ object
    files.N)rrrrrrrrrXsrc@seZdZdZdS)	LinkErrorz]Failure to link one or more C/C++ object files into an executable
    or shared library file.N)rrrrrrrrr\src@seZdZdZdS)UnknownFileErrorz(Attempt to process an unknown file type.N)rrrrrrrrr`srN)r	Exceptionrrr	r
rrr
rrrrrrrrrrrrrrrr	s&	PK!dͮ66)_distutils/__pycache__/cmd.cpython-37.pycnu[B

ReF@sbdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZGdddZ
dS)ztdistutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
N)DistutilsOptionError)utildir_util	file_utilarchive_utildep_util)logc@s"eZdZdZgZddZddZddZdd	Zd
dZ	dCddZ
ddZdDddZddZ
dEddZdFddZddZdGddZdd Zd!d"Zd#d$Zd%d&ZdHd'd(ZdId*d+Zd,d-Zd.d/Zd0d1ZdJd2d3ZdKd5d6ZdLd7d8ZdMd9d:ZdNd;d<ZdOd=d>Z dPd?d@Z!dQdAdBZ"dS)RCommanda}Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    cCsbddlm}t||std|jtkr0td||_|d|_	|j
|_
d|_d|_d|_
dS)zCreate and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        r)Distributionz$dist must be a Distribution instancezCommand is an abstract classN)distutils.distr

isinstance	TypeError	__class__r	RuntimeErrordistributioninitialize_options_dry_runverboseforcehelp	finalized)selfdistr
r/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/cmd.py__init__/s


zCommand.__init__cCs<|dkr0t|d|}|dkr*t|j|S|Snt|dS)Ndry_run_)getattrrAttributeError)rattrmyvalrrr__getattr___szCommand.__getattr__cCs|js|d|_dS)N)rfinalize_options)rrrrensure_finalizediszCommand.ensure_finalizedcCstd|jdS)aSet default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        z,abstract method -- subclass %s must overrideN)rr)rrrrr{s
zCommand.initialize_optionscCstd|jdS)aSet final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        z,abstract method -- subclass %s must overrideN)rr)rrrrr$szCommand.finalize_optionsNcCsddlm}|dkr d|}|j||tjd|d}x\|jD]R\}}}||}|ddkrp|dd}t||}|j|d||ftjdqDWdS)	Nr)
longopt_xlatezcommand options for '%s':)levelz  =z%s = %s)	distutils.fancy_getoptr'get_command_nameannouncerINFOuser_options	translater)rheaderindentr'optionrvaluerrrdump_optionss

zCommand.dump_optionscCstd|jdS)aA command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        z,abstract method -- subclass %s must overrideN)rr)rrrrruns
zCommand.runr#cCst||dS)zmIf the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        N)r)rmsgr(rrrr-szCommand.announcecCs&ddlm}|r"t|tjdS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugr8printsysstdoutflush)rr7r8rrrdebug_printszCommand.debug_printcCsBt||}|dkr"t||||St|ts>td|||f|S)Nz'%s' must be a %s (got `%s`))rsetattrrstrr)rr3whatdefaultvalrrr_ensure_stringlikes

zCommand._ensure_stringlikecCs||d|dS)zWEnsure that 'option' is a string; if not defined, set it to
        'default'.
        stringN)rD)rr3rBrrr
ensure_stringszCommand.ensure_stringcCspt||}|dkrdSt|tr6t||td|n6t|trTtdd|D}nd}|sltd||fdS)zEnsure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|tVqdS)N)rr@).0vrrr	sz-Command.ensure_string_list..Fz''%s' must be a list of strings (got %r))	rrr@r?resplitlistallr)rr3rCokrrrensure_string_lists


zCommand.ensure_string_listcCs6||||}|dk	r2||s2td|||fdS)Nzerror in '%s' option: )rDr)rr3testerrA	error_fmtrBrCrrr_ensure_tested_stringszCommand._ensure_tested_stringcCs||tjjdddS)z5Ensure that 'option' is the name of an existing file.filenamez$'%s' does not exist or is not a fileN)rRospathisfile)rr3rrrensure_filenameszCommand.ensure_filenamecCs||tjjdddS)Nzdirectory namez)'%s' does not exist or is not a directory)rRrTrUisdir)rr3rrrensure_dirnameszCommand.ensure_dirnamecCst|dr|jS|jjSdS)Ncommand_name)hasattrrZr__name__)rrrrr,	s
zCommand.get_command_namecGsJ|j|}|x0|D](\}}t||dkrt||t||qWdS)a>Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        N)rget_command_objr%rr?)rsrc_cmdoption_pairssrc_cmd_obj
src_option
dst_optionrrrset_undefined_optionss
zCommand.set_undefined_optionscCs|j||}||S)zWrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        )rr]r%)rcommandcreatecmd_objrrrget_finalized_command$szCommand.get_finalized_commandrcCs|j||S)N)rreinitialize_command)rrdreinit_subcommandsrrrrh0szCommand.reinitialize_commandcCs|j|dS)zRun some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        N)rrun_command)rrdrrrrj4szCommand.run_commandcCs6g}x,|jD]"\}}|dks$||r||qW|S)akDetermine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        N)sub_commandsappend)rcommandscmd_namemethodrrrget_sub_commands;s
zCommand.get_sub_commandscCstd||dS)Nzwarning: %s: %s
)rwarnr,)rr7rrrrqKszCommand.warncCstj||||jddS)N)r)rexecuter)rfuncargsr7r(rrrrrNszCommand.executecCstj|||jddS)N)r)rmkpathr)rnamemoderrrrvQszCommand.mkpathc	Cstj|||||j||jdS)zCopy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.))r)r	copy_filerr)rinfileoutfile
preserve_modepreserve_timeslinkr(rrrryTs

zCommand.copy_filec	Cstj||||||j|jdS)z\Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        )r)r	copy_treerr)rrzr{r|r}preserve_symlinksr(rrrr]s
zCommand.copy_treecCstj|||jdS)z$Move a file respecting dry-run flag.)r)r	move_filer)rsrcdstr(rrrrfszCommand.move_filecCs ddlm}||||jddS)z2Spawn an external command respecting dry-run flag.r)spawn)rN)distutils.spawnrr)rcmdsearch_pathr(rrrrrjsz
Command.spawnc	Cstj|||||j||dS)N)rownergroup)rmake_archiver)r	base_nameformatroot_dirbase_dirrrrrrroszCommand.make_archivecCs|dkrd|}t|tr"|f}nt|ttfs8td|dkrRd|d|f}|jsdt||rv|	||||n
t
|dS)aSpecial case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr@rLtupler
joinrrnewer_grouprrrdebug)rinfilesr{rsrtexec_msgskip_msgr(rrr	make_fileus

zCommand.make_file)Nr&)r#)N)N)N)r#)r)Nr#)ru)r#r#Nr#)r#r#rr#)r#)r#r#)NNNN)NNr#)#r\
__module____qualname____doc__rkrr"r%rr$r5r6r-r>rDrFrOrRrWrYr,rcrgrhrjrprqrrrvryrrrrrrrrrr	sF0
















r	)rr;rTrJdistutils.errorsr	distutilsrrrrrrr	rrrrs
PK!=)3_distutils/__pycache__/unixccompiler.cpython-37.pycnu[B

Re8@sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZmZmZmZddlmZejdkrddlZGd	d
d
e
ZdS)a9distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
N)	sysconfig)newer)	CCompilergen_preprocess_optionsgen_lib_options)DistutilsExecErrorCompileErrorLibError	LinkError)logdarwinc
@seZdZdZddgdgdgddgdgddgddZejddd	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkrdZd,ddZddZd-ddZd.d d!Zd"d#Zd$d%Zd&d'Zd(d)Zd/d*d+ZdS)0
UnixCCompilerunixNccz-sharedarz-cr)preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiverranlibrrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%scygwinz.exec
Cs|d||}|\}}}t||}	|j|	}
|r>|
d|g|rN||
dd<|r\|
||
||js~|dks~t||r|r|tj	
|y||
Wn*tk
r}zt
|Wdd}~XYnXdS)Nz-or)Z_fix_compile_argsrrextendappendforcermkpathospathdirnamespawnrr)selfsourceZoutput_fileZmacrosinclude_dirs
extra_preargsextra_postargs
fixed_argsignorepp_optsZpp_argsmsgr,/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py
preprocessUs$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t|||}y ||||d|g|Wn*tk
rj}zt|Wdd}~XYnXdS)Nrz-o)rsysplatform_osx_supportcompiler_fixupr"rr)	r#objsrcextZcc_argsr'r*rr+r,r,r-_compileos

zUnixCCompiler._compilerc
Cs|||\}}|j||d}|||r|tj|||j|g||j	|j
ry||j
|gWqtk
r}zt|Wdd}~XYqXnt
d|dS)N)
output_dirzskipping %s (up-to-date))_fix_object_argslibrary_filename
_need_linkrrr r!r"robjectsrrr	rdebug)r#r;Zoutput_libnamer7r<target_langoutput_filenamer+r,r,r-create_static_libzszUnixCCompiler.create_static_libc
Cs|||\}}||||}|\}}}t||||}t|ttdfsPtd|dk	rftj	||}|
||r||j|d|g}|	rdg|dd<|
r|
|dd<|r|||
tj|y|tjkr|jdd}n|jdd}|
dkrv|jrvd}tj|ddkrDd}xd||krB|d7}q(Wtj||d	kr`d}nd}|j||||<tjd
krt||}|||Wn,tk
r}zt|Wdd}~XYnXntd|dS)Nz%'output_dir' must be a string or Nonez-oz-grzc++env=Z	ld_so_aixrzskipping %s (up-to-date))r8Z
_fix_lib_argsr
isinstancestrtype	TypeErrorrr joinr:r;rrr!rZ
EXECUTABLErrrbasenamer/r0r1r2r"rr
rr<)r#Ztarget_descr;r>r7	librarieslibrary_dirsruntime_library_dirsexport_symbolsr<r&r'
build_tempr=r(Zlib_optsZld_argsZlinkerioffsetr+r,r,r-linksN


zUnixCCompiler.linkcCsd|S)Nz-Lr,)r#dirr,r,r-library_dir_optionsz UnixCCompiler.library_dir_optioncCsd|kpd|kS)Ngcczg++r,)r#Z
compiler_namer,r,r-_is_gccszUnixCCompiler._is_gcccCstjttdd}tjdddkrjddl	m
}m}|}|r`||ddgkr`d|Sd	|SnNtjdd
dkrd|Stjddd
kr||rdd	|gSdd	|gStddkrd|Sd|SdS)NCCrrr)get_macosx_target_ver
split_version
z-Wl,-rpath,z-LZfreebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+sGNULDyesz-Wl,--enable-new-dtags,-Rz-Wl,-R)
rr rHshlexsplitrget_config_varr/r0distutils.utilrVrWrT)r#rQrrVrWZmacosx_target_verr,r,r-runtime_library_dir_options 

z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr,)r#libr,r,r-library_optionszUnixCCompiler.library_optioncCs|j|dd}|j|dd}|j|dd}|j|dd}tjdkrptd}td|}	|	dkrfd	}
n
|	d
}
x|D]}tj	
||}tj	
||}
tj	
||}tj	
||}tjdkrD|ds|drD|d
sDtj	
|
|d
d|}tj	
|
|d
d|}
tj	
|
|d
d|}tj	
|
|d
d|}tj	|
rV|
Stj	|rh|Stj	|rz|Stj	|rx|SqxWdS)Nshared)Zlib_typedylib
xcode_stubstaticrCFLAGSz-isysroot\s*(\S+)/rAz/System/z/usr/z/usr/local/)
r9r/r0rr_researchgrouprr rG
startswithexists)r#dirsrbr<Zshared_fZdylib_fZxcode_stub_fZstatic_fcflagsmZsysrootrQrdrergrfr,r,r-find_library_files>



zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)__name__
__module____qualname__
compiler_typeZexecutablesr/r0Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionr.r6r?rPrRrTrarcrrr,r,r,r-r
-sD




>'r
)__doc__rr/rjr]	distutilsrdistutils.dep_utilrdistutils.ccompilerrrrdistutils.errorsrrr	r
rr0r1r
r,r,r,r-s 
PK!wqq+_distutils/__pycache__/spawn.cpython-37.pycnu[B

Re
@s\dZddlZddlZddlZddlmZmZddlmZddl	m
Z
dddZdd	d
ZdS)
zdistutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
N)DistutilsPlatformErrorDistutilsExecError)DEBUG)logc
Cst|}tt||r dS|r@t|d}|dk	r@||d<|dk	rL|nttj}t	j
dkrddlm}m
}|}|r|||<y tj||d}	|	|	j}
WnFtk
r}z(ts|d}td||jdf|Wdd}~XYnX|
rts|d}td||
fdS)	aRun another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    Nrdarwin)MACOSX_VERSION_VARget_macosx_target_ver)envzcommand %r failed: %sz#command %r failed with exit code %s)listrinfo
subprocesslist2cmdlinefind_executabledictosenvironsysplatformdistutils.utilrr	Popenwait
returncodeOSErrorrrargs)cmdsearch_pathverbosedry_runr

executablerr	Zmacosx_target_verprocexitcodeexcr$/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/spawn.pyspawns8

(r&c	Cstj|\}}tjdkr*|dkr*|d}tj|r:|S|dkrtjdd}|dkrytd}Wnt	t
fk
rtj}YnX|sdS|tj
}x*|D]"}tj||}tj|r|SqWdS)zTries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    win32z.exeNPATHCS_PATH)rpathsplitextrrisfilergetconfstrAttributeError
ValueErrordefpathsplitpathsepjoin)r r*_extpathspfr$r$r%rHs(
r)rrrN)N)
__doc__rrrdistutils.errorsrrdistutils.debugr	distutilsrr&rr$r$r$r%s
6PK!¬q._distutils/__pycache__/__init__.cpython-37.pycnu[B

Re@s*dZddlZejdejdZdZdS)zdistutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
N T)__doc__sysversionindex__version__localr	r	/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/__init__.py	sPK!F,,*_distutils/__pycache__/core.cpython-37.pycnu[B

Re"@sdZddlZddlZddlmZddlTddlmZddlm	Z	ddl
mZddlm
Z
d	Zd
dZdadadZd
ZddZdddZdS)a#distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
N)DEBUG)*)Distribution)Command)
PyPIRCCommand)	Extensionzusage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj|}ttS)N)ospathbasenameUSAGEvars)script_namescriptr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/core.py	gen_usage sr)	distclassr
script_argsoptionsnameversionauthorauthor_email
maintainermaintainer_emailurllicensedescriptionlong_descriptionkeywords	platformsclassifiersdownload_urlrequiresprovides	obsoletes)rsourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_args	swig_optsexport_symbolsdependslanguagec
Ks|d}|r|d=nt}d|kr8tjtjd|d<d|krRtjdd|d<y||a}WnLtk
r}z.d|krt	d|nt	d	|d|fWdd}~XYnXt
d
kr|S|trt
d|t
dkr|Sy|}Wn:tk
r*}zt	t|jd
|Wdd}~XYnXtrBt
d|t
dkrP|S|ry|Wntk
rt	dYntk
r}z.trtjd|fnt	d|fWdd}~XYnBttfk
r}ztrnt	dt|Wdd}~XYnX|S)aThe gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    rr
rrNrzerror in setup command: %szerror in %s setup command: %sinitz%options (after parsing config files):configz

error: %sz%options (after parsing command line):commandlineinterruptedz
error: %s
z	error: %szerror: )getrrr	r
sysargv_setup_distributionDistutilsSetupError
SystemExit_setup_stop_afterparse_config_filesrprintdump_option_dictsparse_command_lineDistutilsArgErrorrr
run_commandsKeyboardInterruptOSErrorstderrwriteDistutilsErrorCCompilerErrorstr)attrsklassdistmsgokexcrrrsetup9s`%
"(
"rSrunc	Cs|dkrtd|f|atj}d|i}yZzH|tjd<|dk	rP|tjdd<t|d}t||WdQRXWd|t_daXWntk
rYnXt	dkrt
d|t	S)	a.Run a setup script in a somewhat controlled environment, and
    return the Distribution instance that drives things.  This is useful
    if you need to find out the distribution meta-data (passed as
    keyword args from 'script' to 'setup()', or the contents of the
    config files or command-line.

    'script_name' is a file that will be read and run with 'exec()';
    'sys.argv[0]' will be replaced with 'script' for the duration of the
    call.  'script_args' is a list of strings; if supplied,
    'sys.argv[1:]' will be replaced by 'script_args' for the duration of
    the call.

    'stop_after' tells 'setup()' when to stop processing; possible
    values:
      init
        stop after the Distribution instance has been created and
        populated with the keyword arguments to 'setup()'
      config
        stop after config files have been parsed (and their data
        stored in the Distribution instance)
      commandline
        stop after the command-line ('sys.argv[1:]' or 'script_args')
        have been parsed (and the data stored in the Distribution)
      run [default]
        stop after all commands have been run (the same as if 'setup()'
        had been called in the usual way

    Returns the Distribution instance, which provides all information
    used to drive the Distutils.
    )r5r6r7rTz"invalid value for 'stop_after': %r__file__rNr4rbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)
ValueErrorr?r:r;copyopenexecreadr>r<RuntimeError)r
r
stop_after	save_argvgfrrr	run_setups(


ra)NrT)__doc__rr:distutils.debugrdistutils.errorsdistutils.distr
distutils.cmdrdistutils.configrdistutils.extensionrrrr?r<setup_keywordsextension_keywordsrSrarrrrs 	qPK!*v._distutils/__pycache__/dir_util.cpython-37.pycnu[B

Reb@spdZddlZddlZddlmZmZddlmZiadddZ	dd	d
Z
dddZd
dZdddZ
ddZdS)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.N)DistutilsFileErrorDistutilsInternalError)logcCsnt|tstd|ftj|}g}tj|s<|dkr@|Sttj	|rV|Stj
|\}}|g}x4|r|rtj|stj
|\}}|d|qnWx|D]}tj||}tj	|}	t|	rq|dkrt
d||s^yt||WnVtk
rR}
z6|
jtjkr,tj|sBtd||
jdfWdd}
~
XYnX||dt|	<qW|S)	aCreate a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    z(mkpath: 'name' must be a string (got %r)rrzcreating %szcould not create '%s': %sN)
isinstancestrrospathnormpathisdir
_path_createdgetabspathsplitinsertjoinrinfomkdirOSErrorerrnoEEXISTrargsappend)namemodeverbosedry_runcreated_dirsheadtailtailsdabs_headexcr'/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/dir_util.pymkpaths>


&
r)c	CsVt}x(|D] }|tj|tj|qWx t|D]}t||||dq:WdS)aCreate all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    )rrN)setaddrrrdirnamesortedr))base_dirfilesrrrneed_dirfiledirr'r'r(create_treePs

 r3c
Csdddlm}|s(tj|s(td|yt|}	Wn>tk
rt}
z |rRg}	ntd||
jfWdd}
~
XYnX|st	||dg}x|	D]}tj
||}
tj
||}|drq|rtj|
rt
|
}|dkrtd	|||st||||qtj|
r<|t|
|||||||d
q||
||||||d
||qW|S)aCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    r)	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %s)rr)distutils.file_utilr4rrrrlistdirrstrerrorr)r
startswithislinkreadlinkrrsymlinkrextend	copy_tree)srcdst
preserve_modepreserve_timespreserve_symlinksupdaterrr4nameseoutputsnsrc_namedst_name	link_destr'r'r(r=csH
"


r=cCsjxTt|D]F}tj||}tj|rBtj|sBt||q|tj|fqW|tj	|fdS)zHelper for remove_tree().N)
rr6rrrr9_build_cmdtuplerremovermdir)r	cmdtuplesfreal_fr'r'r(rKsrKcCs|dkrtd||rdSg}t||xp|D]h}y2|d|dtj|d}|tkrdt|=Wq0tk
r}ztd||Wdd}~XYq0Xq0WdS)zRecursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)	rrrKrrrrrwarn)	directoryrrrNcmdrr&r'r'r(remove_trees


rTcCs6tj|\}}|ddtjkr2||dd}|S)zTake the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    rrN)rr
splitdrivesep)rdriver'r'r(ensure_relativesrX)rrr)rrr)rrrrrr)rr)__doc__rrdistutils.errorsrr	distutilsrrr)r3r=rKrTrXr'r'r'r(s
?

D

PK!k0j5j53_distutils/__pycache__/_msvccompiler.cpython-37.pycnu[B

ReMQ	@sdZddlZddlZddlZddlZddlZeeddl	Z	WdQRXddl
mZmZm
Z
mZmZddlmZmZddlmZddlmZddlmZdd	Zd
dZdd
dddZddZddZdddZdddddZGdddeZ dS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platform)countcCsytjtjdtjtjBd}Wntk
r<tddSXd}d}|xtD]}yt	||\}}}Wntk
rPYnX|rT|tj
krTtj
|rTytt|}Wnttfk
rwTYnX|dkrT||krT||}}qTWWdQRX||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registered)NNr)winreg	OpenKeyExHKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEYOSErrorr	debugrZ	EnumValueREG_SZospathisdirintfloat
ValueError	TypeError)keybest_versionbest_dirivZvc_dirZvtversionr!/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/_msvccompiler.py_find_vc2015 s0
r#c
Cstjdptjd}|s dSy8tjtj|dddddd	d
ddd
dg	ddd}Wntjt	t
fk
rtdSXtj|ddd}tj|rd|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    zProgramFiles(x86)ZProgramFiles)NNzMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products*mbcsstrict)encodingerrorsZVCZ	AuxiliaryZBuild)renvironget
subprocesscheck_outputrjoinstripCalledProcessErrorrUnicodeDecodeErrorr)rootrr!r!r"_find_vc2017<s$
r3x86Zx64ZarmZarm64)r4	x86_amd64x86_arm	x86_arm64cCs\t\}}|st\}}|s*tddStj|d}tj|sTtd|dS|dfS)Nz$No suitable Visual C++ version found)NNz
vcvarsall.batz%s cannot be found)r3r#r	rrrr.isfile)	plat_spec_rr	vcvarsallr!r!r"_find_vcvarsallcs


r<c
CstdrddtjDSt|\}}|s6tdy&tjd||tj	dj
ddd	}Wn@tjk
r}z t
|jtd
|jWdd}~XYnXdddd
|DD}|S)NZDISTUTILS_USE_SDKcSsi|]\}}||qSr!)lower).0rvaluer!r!r"
wsz_get_vc_env..zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)stderrzutf-16lereplace)r(zError executing {}cSs$i|]\}}}|r|r||qSr!)r=)r>rr:r?r!r!r"r@scss|]}|dVqdS)=N)	partition)r>liner!r!r"	sz_get_vc_env..)rgetenvr*itemsr<rr,r-formatSTDOUTdecoder0r	erroroutputcmd
splitlines)r9r;r:outexcenvr!r!r"_get_vc_envus$


rScCsN|stdtj}x2|D]*}tjtj||}tj|r|SqW|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rrGsplitpathseprr.abspathr8)Zexepathspfnr!r!r"	_find_exes	
rZr5r6r7)win32z	win-amd64z	win-arm32z	win-arm64c
seZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd*ddZd+ddZd,ddZd-ddZd.ddZd/ddZfddZejfd d!Zd"d#Zd$d%Zd&d'Zd0d(d)ZZ S)1MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxxz.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t||||d|_d|_dS)NF)r__init__	plat_nameinitialized)selfverbosedry_runforcer!r!r"r]szMSVCCompiler.__init__NcCs|jrtd|dkrt}|tkr6tdttt|}t|}|sRtd|dd|_	|j	
tj}t
d||_t
d||_t
d||_t
d	||_t
d
||_t
d||_x2|dd
tjD]}|r||tjqWx6|d
d
tjD]}|r||tjqWd|_ddddddg|_ddddddg|_dddg}ddddg}|d!|_|d"|_|d#|_|d$|_||_||_ t!j"df|jt!j"df|jt!j"d f|jt!j#df|jt!j#df|jt!j#d f|jt!j$df|jt!j$df|jt!j$d f|j i	|_%d |_dS)%Nzdon't init multiple timesz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.rzcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeincludelibz/nologoz/O2z/W3z/GLz/DNDEBUGz/MDz/Odz/MDdz/Ziz/D_DEBUGz/INCREMENTAL:NOz/LTCGz/DEBUG:FULL/MANIFEST:EMBED,ID=1/DLL/MANIFEST:EMBED,ID=2/MANIFESTUAC:NOFT)rg)rg)rhrirj)rhrirj)&r_AssertionErrorr
PLAT_TO_VCVARSrrItuplerSr+_pathsrTrrUrZcclinkerrfrcmcmtZadd_include_dirrstripsepZadd_library_dirZpreprocess_optionscompile_optionscompile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY_ldflags)r`r^r9Zvc_envrWdirldflagsZ
ldflags_debugr!r!r"
initializesZ




zMSVCCompiler.initializerdcsTfddjDfddjjDp4dfdd}tt||S)Ncsi|]}j|qSr!)
obj_extension)r>ext)r`r!r"r@&sz1MSVCCompiler.object_filenames..csi|]}j|qSr!)
res_extension)r>r})r`r!r"r@'srdcstj|\}}r"tj|}n2tj|\}}|tjjtjjfrT|dd}ytj||St	k
rt
d|YnXdS)NzDon't know how to compile {})rrsplitextbasename
splitdrive
startswithrualtsepr.LookupErrorrrI)rXbaser}r:)ext_map
output_dir	strip_dirr!r"
make_out_path,sz4MSVCCompiler.object_filenames..make_out_path)src_extensions_rc_extensions_mc_extensionslistmap)r`Zsource_filenamesrrrr!)rrr`rr"object_filenames!s
zMSVCCompiler.object_filenamesc	Cs|js||||||||}	|	\}}
}}}|p6g}
|
d|rT|
|jn|
|jd}x|
D]}y||\}}Wntk
rwlYnX|rtj	
|}||jkrd|}nD||jkrd|}d}n*||j
krB|}d|}y||jg|||gWqltk
r<}zt|Wdd}~XYqlXqln||jkrtj	|}tj	|}y\||jd|d||gtj	tj	|\}}tj	||d	}||jd||gWqltk
r}zt|Wdd}~XYqlXqlntd
|||jg|
|}|r$|d|||d|||y||Wqltk
r}zt|Wdd}~XYqlXqlW|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rz.rcz"Don't know how to compile {} to {}z/EHscz/Fo)r_r{Z_setup_compileappendextendrwrvKeyErrorrrrV
_c_extensions_cpp_extensionsrspawnrqrrrdirnamerrrrr.rIro)r`sourcesrZmacrosinclude_dirsr
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsZadd_cpp_optsobjsrcr}Z	input_optZ
output_optmsgZh_dirZrc_dirrr:Zrc_fileargsr!r!r"compileBsn








zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||r|d|g}|rJy,td|jd||	|jg|Wqt
k
r}zt|Wdd}~XYqXntd|dS)N)rz/OUT:zExecuting "%s" %s zskipping %s (up-to-date))r_r{_fix_object_argslibrary_filename
_need_linkr	rrfr.rrr)	r`rZoutput_libnamerrtarget_langoutput_filenameZlib_argsrr!r!r"create_static_libszMSVCCompiler.create_static_libc
Cs|js||||\}}||||}|\}}}|rL|dt|t||||}|dk	rptj	||}|
||r|j||	f}dd|pgD}||||d|g}tj|d}|dk	rtj
tj|\}}tj	|||}|d||
r|
|dd<|r.||tjtj|}||y,td|jd	|||jg|Wn,tk
r}zt|Wdd}~XYnXntd	|dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|qS)z/EXPORT:r!)r>symr!r!r"
sz%MSVCCompiler.link..z/OUT:rz/IMPLIB:zExecuting "%s" %srzskipping %s (up-to-date))r_r{rZ
_fix_lib_argswarnstrrrrr.rrxrrrrrrrVmkpathr	rrprrr)r`Ztarget_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsrrr
build_temprZ
fixed_argsZlib_optsrzZexport_optsZld_argsZdll_nameZdll_extZimplib_filerr!r!r"linksL



zMSVCCompiler.linkc	s:ttj|jd}|||}tj||dSQRX|jS)N)PATH)rR)dictrr*rn_fallback_spawnsuperrr?)r`rNrRfallback)	__class__r!r"rszMSVCCompiler.spawnc
#stddi}y
|VWn0tk
rH}zdt|kr8Wdd}~XYnXdStdtjd|t	||_
WdQRXdS)z
        Discovered in pypa/distutils#15, some tools monkeypatch the compiler,
        so the 'env' kwarg causes a TypeError. Detect this condition and
        restore the legacy, unsafe behavior.
        ZBagr!z!unexpected keyword argument 'env'Nz>Fallback spawn triggered. Please update distutils monkeypatch.z
os.environ)typerrwarningsrunittestZmockpatchrrr?)r`rNrRZbagrQ)rr!r"rs
zMSVCCompiler._fallback_spawncCsd|S)Nz	/LIBPATH:r!)r`ryr!r!r"library_dir_optionszMSVCCompiler.library_dir_optioncCstddS)Nz:don't know how to set runtime library search path for MSVC)r)r`ryr!r!r"runtime_library_dir_optionsz'MSVCCompiler.runtime_library_dir_optioncCs
||S)N)r)r`rfr!r!r"library_option szMSVCCompiler.library_optioncCs`|r|d|g}n|g}xB|D]6}x0|D](}tj|||}tj|r(|Sq(WqWdSdS)NZ_d)rrr.rr8)r`dirsrfrZ	try_namesrynameZlibfiler!r!r"find_library_file#s

zMSVCCompiler.find_library_file)rrr)N)rrd)NNNrNNN)NrN)
NNNNNrNNNN)r)!__name__
__module____qualname____doc__
compiler_typeZexecutablesrrrrrr~r|Zstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr]r{rrrrr
contextlibcontextmanagerrrrrr
__classcell__r!r!)rr"r\sN


P

[

8r\)N)!rrr,rrZ
unittest.mockrsuppressImportErrorrdistutils.errorsrrrrrdistutils.ccompilerrr	distutilsr	distutils.utilr
	itertoolsrr#r3ZPLAT_SPEC_TO_RUNTIMEr<rSrZrlr\r!r!r!r"s4!
PK!E"HH-_distutils/__pycache__/version.cpython-37.pycnu[B

Re0@s>dZddlZGdddZGdddeZGdddeZdS)	aProvides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
Nc@sJeZdZdZdddZddZddZd	d
ZddZd
dZ	ddZ
dS)VersionzAbstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    NcCs|r||dS)N)parse)selfvstringr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/version.py__init__&szVersion.__init__cCsd|jjt|fS)Nz	%s ('%s'))	__class____name__str)rrrr__repr__*szVersion.__repr__cCs||}|tkr|S|dkS)Nr)_cmpNotImplemented)rothercrrr__eq__-s
zVersion.__eq__cCs||}|tkr|S|dkS)Nr)r
r)rrrrrr__lt__3s
zVersion.__lt__cCs||}|tkr|S|dkS)Nr)r
r)rrrrrr__le__9s
zVersion.__le__cCs||}|tkr|S|dkS)Nr)r
r)rrrrrr__gt__?s
zVersion.__gt__cCs||}|tkr|S|dkS)Nr)r
r)rrrrrr__ge__Es
zVersion.__ge__)N)r

__module____qualname____doc__rrrrrrrrrrrrs
rc@s<eZdZdZedejejBZddZ	ddZ
ddZd	S)

StrictVersiona?Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs|j|}|std||ddddd\}}}}}|rTttt|||g|_nttt||gd|_|r|dt|f|_nd|_dS)	Nzinvalid version number '%s')rr)	
version_rematch
ValueErrorgrouptuplemapintversion
prerelease)rrr majorminorpatchr'Zprerelease_numrrrrszStrictVersion.parsecCsb|jddkr*dtt|jdd}ndtt|j}|jr^||jdt|jd}|S)Nrr.r)r&joinr$rr')rrrrr__str__szStrictVersion.__str__cCst|trt|}nt|ts"tS|j|jkrB|j|jkr>dSdS|jsR|jsRdS|jrb|jsbdS|jsr|jrrdS|jr|jr|j|jkrdS|j|jkrdSdSndstddS)NrrFznever get here)
isinstancerrrr&r'AssertionError)rrrrrr
s*


zStrictVersion._cmpN)r
rrrrecompileVERBOSEASCIIrrr-r
rrrrr]s#
rc@sHeZdZdZedejZdddZddZ	dd	Z
d
dZdd
ZdS)LooseVersionaVersion numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    z(\d+ | [a-z]+ | \.)NcCs|r||dS)N)r)rrrrrr0szLooseVersion.__init__c	Csb||_dd|j|D}x:t|D].\}}yt|||<Wq&tk
rRYq&Xq&W||_dS)NcSsg|]}|r|dkr|qS)r+r).0xrrr
:sz&LooseVersion.parse..)rcomponent_resplit	enumerater%r!r&)rr
componentsiobjrrrr5s
zLooseVersion.parsecCs|jS)N)r)rrrrr-EszLooseVersion.__str__cCsdt|S)NzLooseVersion ('%s'))r)rrrrrIszLooseVersion.__repr__cCsVt|trt|}nt|ts"tS|j|jkr2dS|j|jkrBdS|j|jkrRdSdS)Nrr.r)r/rr5rr&)rrrrrr
Ms


zLooseVersion._cmp)N)
r
rrrr1r2r3r9rrr-rr
rrrrr5
s
r5)rr1rrr5rrrrs
>1PK!s""5_distutils/__pycache__/cygwinccompiler.cpython-37.pycnu[B

Re*B@sdZddlZddlZddlZddlmZmZmZddlZddl	m
Z
ddlmZddl
mZmZmZmZddlmZddlmZd	d
ZGddde
ZGd
ddeZdZdZdZddZedZddZddZ ddZ!dS)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
N)PopenPIPEcheck_output)
UnixCCompiler)
write_file)DistutilsExecErrorCCompilerErrorCompileErrorUnknownFileError)LooseVersion)find_executablecCstjd}|dkr|tj|d|d}|dkr8dgS|dkrFdgS|d	krTd
gS|dkrbdgS|d
krpdgStd|dS)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)sysversionfind
ValueError)Zmsc_posZmsc_verr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/cygwinccompiler.py	get_msvcr?src
@sReZdZdZdZdZdZdZdZdZ	dZ
dd
dZdd
ZdddZ
dddZdS)CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    cygwinz.oz.az.dllzlib%s%sz%s%sz.exercCsHt||||t\}}|d||f|tk	rB|d|tjdd|_	tjdd|_
d|j	krt\|_|_
|_||jd|j|j
|jf|j
dkr|j	|_nd	|_|j
d
krd}qd}n|j	|_d}|jd
|j	d|j	d
|j
d|j	d|j|fdd|j	kr<|jdkrrrrobject_filenamess 
z CygwinCCompiler.object_filenames)rrr)
NNNNNrNNNN)rrW)__name__
__module____qualname____doc__r0rYZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr#rArLr\rrrrrYs
@
Krc@seZdZdZdZdddZdS)Mingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows.
    Zmingw32rc	Cst||||d|jkr*|jdkr*d}nd}d|jkrH|jdkrHd}nd}t|jr^td|jd	|jd
|jd	|jd|jd|j	||fd
g|_
t|_
dS)Nrz2.13z
-mdll -staticz-sharedz2.91.57z--entry _DllMain@12rWz1Cygwin gcc cannot be used with --compiler=mingw32z%s -O -Wallz%s -mdll -O -Wallz%sz%s %s %s)rrrr r!)rr#r+r/r.is_cygwinccrr2r,r1r3r)r4r5r6r7r:entry_pointrrrr#s&
zMingw32CCompiler.__init__N)rrr)r]r^r_r`r0r#rrrrrbsrbokznot okZ	uncertainc
Csddlm}dtjkrtdfSdtjkr0tdfS|}y@t|}z(d|kr\td|fStd	|fSWd
|	XWn0t
k
r}ztd||jffSd
}~XYnXd
S)awCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r)	sysconfigZGCCzsys.version mentions 'GCC'ZClangzsys.version mentions 'Clang'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'Nzcouldn't read '%s': %s)
	distutilsrfrrr&get_config_h_filenameopenreadCONFIG_H_NOTOKcloseOSErrorCONFIG_H_UNCERTAINstrerror)rffnconfig_hexcrrrr$Ms 

r$s(\d+\.\d+(\.\d+)*)cCsl|d}t|dkrdSt|dtdj}z|}Wd|Xt|}|dkrZdSt	|
dS)zFind the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    rNT)shellstdout)splitrrrrtrjrl
RE_VERSIONsearchrgroupdecode)cmd
executableout
out_stringresultrrr_find_exe_version~s

rcCsdddg}tdd|DS)zg Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    zgcc -dumpversionzld -vzdllwrap --versioncSsg|]}t|qSr)r).0r{rrr
sz get_versions..)tuple)commandsrrrr-s
r-cCst|dg}|dS)zCTry to determine if the compiler that would be used is from cygwin.z-dumpmachinescygwin)rstripendswith)r+r~rrrrcsrc)"r`r(rrC
subprocessrrrreZdistutils.unixccompilerrdistutils.file_utilrdistutils.errorsrrr	r
Zdistutils.versionrdistutils.spawnrrrrbr&rkrnr$compilerwrr-rcrrrrs,+@1/
PK!Ol2_distutils/__pycache__/archive_util.cpython-37.pycnu[B

Re|!@sDdZddlZddlmZddlZyddlZWnek
rDdZYnXddlmZddl	m
Z
ddlmZddl
mZyddlmZWnek
rdZYnXydd	lmZWnek
rdZYnXd
dZdd
Zd#ddZd$ddZedgdfedgdfedgdfedgdfedgdfegdfdZdd Zd%d!d"ZdS)&zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).N)warn)DistutilsExecError)spawn)mkpath)log)getpwnam)getgrnamcCsNtdks|dkrdSyt|}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N)rKeyError)nameresultr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/archive_util.py_get_gids
rcCsNtdks|dkrdSyt|}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr	)rr
)rrr
r
r_get_uid+s
rgzipcs.dddddd}dddd	d
}|dk	r:||kr:td|d
}	|dkrZ|	||d7}	ttj|	|dddl}
t	dt
tfdd}|s|
|	d||}z|j
||dWd|X|dkr*tdt|	||}
tjdkr||	|
g}n
|d|	g}t||d|
S|	S)a=Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    gzbz2xz)rbzip2rNcompressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr)dry_runrzCreating tar archivecs,dk	r|_|_dk	r(|_|_|S)N)gidgnameuiduname)tarinfo)rgroupownerrr
r_set_uid_gidasz"make_tarball.._set_uid_gidzw|%s)filterz'compress' will be deprecated.win32z-f)keys
ValueErrorgetrospathdirnametarfilerinforropenaddcloserPendingDeprecationWarningsysplatformr)	base_namebase_dirrverboserrrtar_compressioncompress_extarchive_namer)r tarcompressed_namecmdr
)rrrrrmake_tarball7s<
	



r:c
Cs|d}ttj||dtdkrp|r.d}nd}ytd|||g|dWn tk
rjtd|YnXnDtd|||sytj	|d	tj
d
}Wn&tk
rtj	|d	tjd
}YnX||tj
krtjtj|d}|||td|xt|D]\}}	}
x>|	D]6}tjtj||d}|||td|qWxJ|
D]B}tjtj||}tj|r^|||td|q^WqWWdQRX|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.zip)rNz-rz-rqzipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to itw)compressionrzadding '%s')rr&r'r(zipfilerrrr*ZipFileZIP_DEFLATEDRuntimeError
ZIP_STOREDcurdirnormpathjoinwritewalkisfile)r1r2r3rzip_filename
zipoptionsr;r'dirpathdirnames	filenamesrr
r
rmake_zipfilesJ	

"rN)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)gztarbztarxztarztarr7r;cCsx|D]}|tkr|SqWdS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)ARCHIVE_FORMATS)formatsformatr
r
rcheck_archive_formatss
rVc
Cst}|dk	r6td|tj|}|s6t||dkrDtj}d|i}	yt|}
Wn t	k
rxt
d|YnX|
d}x|
dD]\}}
|
|	|<qW|dkr||	d<||	d	<z|||f|	}Wd|dk	rtd
|t|X|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'rr;rrzchanging back to '%s')r&getcwdrdebugr'abspathchdirrCrSr
r$)r1rUroot_dirr2r3rrrsave_cwdkwargsformat_infofuncargvalfilenamer
r
rmake_archives2
rd)rrrNN)rr)NNrrNN)__doc__r&warningsrr/r>ImportErrordistutils.errorsrdistutils.spawnrdistutils.dir_utilr	distutilsrpwdrgrprrrr:rNrSrVrdr
r
r
rsB



G
=





PK!

,_distutils/__pycache__/config.cpython-37.pycnu[B

Re@s<dZddlZddlmZddlmZdZGdddeZdS)zdistutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
N)RawConfigParser)CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sheZdZdZdZdZdZdZdddefdgZd	gZ	d
dZ
dd
ZddZddZ
ddZddZdS)
PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/pypiNzrepository=rzurl of repository [default: %s])z
show-responseNz&display full response text from serverz
show-responsecCstjtjddS)zReturns rc file path.~z.pypirc)ospathjoin
expanduser)selfr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/config.py_get_rc_file&szPyPIRCCommand._get_rc_filec	CsH|}tt|tjtjBdd}|t||fWdQRXdS)zCreates a default .pypirc file.iwN)rrfdopenopenO_CREATO_WRONLYwriteDEFAULT_PYPIRC)rusernamepasswordrcfr
r
r
_store_pypirc*s zPyPIRCCommand._store_pypirccCs|}tj|r|d||jp.|j}t}|||	}d|krF|
dd}dd|dD}|gkrd|krdg}niSx|D]}d|i}|
|d	|d	<xHd
|jfd|jfdfD].\}	}
|
||	r|
||	||	<q|
||	<qW|dkr"||jdfkr"|j|d
<|S|d|ks<|d
|kr|SqWnRd
|krd
}|
|d
rp|
|d
}n|j}|
|d	|
|d|||jdSiS)zReads the .pypirc file.zUsing PyPI login from %s	distutilsz
index-serverscSs g|]}|dkr|qS))strip).0serverr
r
r
=sz.PyPIRCCommand._read_pypirc..
rr r
repositoryrealm)rNzserver-loginr)rrr#r r$)rrr	existsannouncer#DEFAULT_REPOSITORYrreadsectionsgetsplit
DEFAULT_REALM
has_option)rrr#configr)
index_servers_serversr currentkeydefaultr
r
r_read_pypirc0sV









zPyPIRCCommand._read_pypirccCs8ddl}|dd}||ddd}||S)z%Read and decode a PyPI HTTP response.rNzcontent-typez
text/plaincharsetascii)cgi	getheaderparse_headerr*r(decode)rresponser8content_typeencodingr
r
r_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)zInitialize options.Nr)r#r$
show_response)rr
r
rinitialize_optionswsz PyPIRCCommand.initialize_optionscCs(|jdkr|j|_|jdkr$|j|_dS)zFinalizes options.N)r#r'r$r,)rr
r
rfinalize_options}s

zPyPIRCCommand.finalize_options)__name__
__module____qualname____doc__r'r,r#r$user_optionsboolean_optionsrrr4r?rArBr
r
r
rrs @r)rFrconfigparserr
distutils.cmdrrrr
r
r
rs

PK!HۑC**+_distutils/__pycache__/debug.cpython-37.pycnu[B

Re@sddlZejdZdS)NZDISTUTILS_DEBUG)osenvirongetDEBUGrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/debug.pysPK!.0_distutils/__pycache__/py35compat.cpython-37.pycnu[B

Re@s(ddlZddlZddZeedeZdS)NcCs*g}tjj}|dkr&|dd||S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r-O)sysflagsoptimizeappend)argsvaluer
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/py35compat.py#__optim_args_from_interpreter_flagss
r"_optim_args_from_interpreter_flags)r
subprocessrgetattrr
r
r
r
rs
PK!Uss/_distutils/__pycache__/ccompiler.cpython-37.pycnu[B

Re@sdZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZGd
ddZdZdd
dZddddddZddZdddZddZddZdS)zdistutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.N)*)spawn)	move_file)mkpath)newer_group)split_quotedexecute)logc
@seZdZdZdZdZdZdZdZdZ	dZ
dZddddddZdddgZ
dqdd	Zd
dZdd
ZddZddZdrddZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Z d.d/Z!dsd0d1Z"d2d3Z#d4d5Z$d6d7Z%d8d9Z&dtd:d;Z'dudd?Z)dvd@dAZ*dBZ+dCZ,dDZ-dwdEdFZ.dxdGdHZ/dydIdJZ0dzdKdLZ1dMdNZ2dOdPZ3dQdRZ4d{dSdTZ5d|dUdVZ6d}dXdYZ7d~dZd[Z8dd\d]Z9dd_d`Z:ddbdcZ;dddeZdjdkZ?dldmZ@ddodpZAdS)	CCompileraAbstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    Nczc++Zobjc)z.cz.ccz.cppz.cxxz.mrcCsf||_||_||_d|_g|_g|_g|_g|_g|_g|_	x$|j
D]}|||j
|qHWdS)N)
dry_runforceverbose
output_dirmacrosinclude_dirs	librarieslibrary_dirsruntime_library_dirsobjectsexecutableskeysset_executable)selfrrr
keyr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py__init__UszCCompiler.__init__cKs@x:|D]2}||jkr(td||jjf||||qWdS)aDefine the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        z$unknown executable '%s' for class %sN)r
ValueError	__class____name__r)rkwargsrrrrset_executablesys


zCCompiler.set_executablescCs,t|trt||t|nt|||dS)N)
isinstancestrsetattrr)rrvaluerrrrs
zCCompiler.set_executablecCs0d}x&|jD]}|d|kr |S|d7}qWdS)Nr)r)rnameidefnrrr_find_macroszCCompiler._find_macrocCsdx^|D]V}t|trHt|dkrHt|dts:|ddkrHt|dtstd|ddqWdS)zEnsures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r'r'Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r#tuplelenr$	TypeError)rZdefinitionsr*rrr_check_macro_definitionss


z"CCompiler._check_macro_definitionscCs.||}|dk	r|j|=|j||fdS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        N)r+rappend)rr(r&r)rrrdefine_macros	
zCCompiler.define_macrocCs0||}|dk	r|j|=|f}|j|dS)aUndefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        N)r+rr1)rr(r)Zundefnrrrundefine_macros

zCCompiler.undefine_macrocCs|j|dS)zAdd 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr1)rdirrrradd_include_dirszCCompiler.add_include_dircCs|dd|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        N)r)rdirsrrrset_include_dirsszCCompiler.set_include_dirscCs|j|dS)aAdd 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr1)rlibnamerrradd_libraryszCCompiler.add_librarycCs|dd|_dS)zSet the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)rZlibnamesrrr
set_librariesszCCompiler.set_librariescCs|j|dS)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr1)rr4rrradd_library_dirszCCompiler.add_library_dircCs|dd|_dS)zSet the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)r)rr6rrrset_library_dirsszCCompiler.set_library_dirscCs|j|dS)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr1)rr4rrradd_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd|_dS)zSet the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)r)rr6rrrset_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j|dS)zAdd 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr1)robjectrrradd_link_object szCCompiler.add_link_objectcCs|dd|_dS)zSet the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)rrrrrset_link_objects(szCCompiler.set_link_objectscCs.|dkr|j}nt|ts"td|dkr2|j}n"t|trL||jpFg}ntd|dkrd|j}n*t|ttfrt||jpg}ntd|dkrg}|j|d|d}t	|t	|kst
t||}i}	xRtt	|D]B}
||
}||
}t
j|d}
|t
j|||
f|	|<qW|||||	fS)z;Process arguments and decide which source files to compile.Nz%'output_dir' must be a string or Nonez/'macros' (if supplied) must be a list of tuplesz6'include_dirs' (if supplied) must be a list of stringsr)	strip_dirrr')rr#r$r/rlistrr-object_filenamesr.AssertionErrorgen_preprocess_optionsrangeospathsplitextrdirname)rZoutdirrZincdirssourcesdependsextrarpp_optsbuildr)srcobjextrrr_setup_compile6s:


zCCompiler._setup_compilecCs0|dg}|rdg|dd<|r,||dd<|S)Nz-cz-grr)rrOdebugbeforecc_argsrrr_get_cc_argsas
zCCompiler._get_cc_argscCs|dkr|j}nt|ts"td|dkr2|j}n"t|trL||jpFg}ntd|dkrd|j}n*t|ttfrt||jpg}ntd|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        Nz%'output_dir' must be a string or Nonez/'macros' (if supplied) must be a list of tuplesz6'include_dirs' (if supplied) must be a list of strings)rr#r$r/rrCrr-)rrrrrrr_fix_compile_argsjs 


zCCompiler._fix_compile_argscCs*|j||d}t|t|ks"t|ifS)a,Decide which source files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rDr.rE)rrLrrMrrrr
_prep_compiles	zCCompiler._prep_compilecCsHt|ttfstdt|}|dkr.|j}nt|ts@td||fS)zTypecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNz%'output_dir' must be a string or None)r#rCr-r/rr$)rrrrrr_fix_object_argss
zCCompiler._fix_object_argscCs|dkr|j}n*t|ttfr2t||jp,g}ntd|dkrJ|j}n*t|ttfrlt||jpfg}ntd|dkr|j}n*t|ttfrt||jpg}ntd|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr#rCr-r/rr)rrrrrrr
_fix_lib_argss&zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd}n
t||}|SdS)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        Tnewer)missingN)r
rr)rroutput_filer]rrr
_need_links
zCCompiler._need_linkc		Cst|ts|g}d}t|j}x^|D]V}tj|\}}|j|}y |j	|}||krb|}|}Wq$t
k
rxYq$Xq$W|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r#rCr.language_orderrHrIrJlanguage_mapgetindexr)	rrLlangrdsourcebaserSZextlangZextindexrrrdetect_languages



zCCompiler.detect_languagecCsdS)aPreprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nr)rrfr_rr
extra_preargsextra_postargsrrr
preprocessszCCompiler.preprocessc		Csz|||||||\}}	}}
}||
||}xH|	D]@}
y||
\}}Wntk
r\w2YnX||
|||||
q2W|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )rTrXKeyError_compile)rrLrrrrUrirjrMrrOrPrWrRrQrSrrrcompiles6
zCCompiler.compilecCsdS)zCompile 'src' to product 'obj'.Nr)rrRrQrSrWrjrOrrrrmCszCCompiler._compilecCsdS)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nr)rroutput_libnamerrUtarget_langrrrcreate_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library
executablecCstdS)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        N)NotImplementedError)rZtarget_descroutput_filenamerrrrexport_symbolsrUrirj
build_temprprrrlinkis9zCCompiler.linkc

Cs2|tj||j|dd|||||||	|
||
dS)Nshared)lib_type)rwr
SHARED_LIBRARYlibrary_filename)
rrrorrrrrurUrirjrvrprrrlink_shared_libs
zCCompiler.link_shared_libc

Cs(|tj|||||||||	|
||
dS)N)rwr

SHARED_OBJECT)
rrrtrrrrrurUrirjrvrprrrlink_shared_objects

zCCompiler.link_shared_objectcCs.|tj|||||||d|||	d|

dS)N)rwr

EXECUTABLEexecutable_filename)rrZoutput_prognamerrrrrUrirjrprrrlink_executables

zCCompiler.link_executablecCstdS)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        N)rs)rr4rrrlibrary_dir_optionszCCompiler.library_dir_optioncCstdS)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        N)rs)rr4rrrruntime_library_dir_optionsz$CCompiler.runtime_library_dir_optioncCstdS)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        N)rs)rlibrrrlibrary_optionszCCompiler.library_optionc

Cs0ddl}|dkrg}|dkr g}|dkr,g}|dkr8g}|jd|dd\}}t|d}	z.x|D]}
|	d|
q`W|	d|Wd|	Xz.y|j|g|d	}Wntk
rd
SXWdt|Xz@y|j	|d||dWnt
tfk
rd
SXtdWdx|D]}t|qWXdS)
zReturn a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNz.cT)textwz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
)rFza.out)rr)tempfilemkstemprHfdopenwriteclosernCompileErrorremover	LinkErrorr/)
rfuncnameZincludesrrrrfdfnamefZinclrfnrrrhas_functions@	



zCCompiler.has_functioncCstdS)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        N)rs)rr6rrUrrrfind_library_file+szCCompiler.find_library_filecCs|dkrd}g}x|D]|}tj|\}}tj|d}|tj|d}||jkrhtd||f|rxtj|}|tj	|||j
qW|S)Nrr'z"unknown file type '%s' (from '%s'))rHrIrJ
splitdriveisabssrc_extensionsUnknownFileErrorbasenamer1join
obj_extension)rZsource_filenamesrBrZ	obj_namessrc_namergrSrrrrDVs

zCCompiler.object_filenamescCs0|dk	st|rtj|}tj|||jS)N)rErHrIrrshared_lib_extension)rrrBrrrrshared_object_filenamegsz CCompiler.shared_object_filenamecCs4|dk	st|rtj|}tj|||jp.dS)Nr)rErHrIrr
exe_extension)rrrBrrrrrmszCCompiler.executable_filenamestaticc
Csl|dk	st|dkrtdt||d}t||d}tj|\}}|||f}	|r\d}tj|||	S)N)rrxZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr)rErgetattrrHrIsplitr)
rr8ryrBrfmtrSr4rgfilenamerrrr{sszCCompiler.library_filenamer'cCst|dS)N)r	rU)rmsglevelrrrannounceszCCompiler.announcecCsddlm}|rt|dS)Nr)DEBUG)distutils.debugrprint)rrrrrrdebug_printszCCompiler.debug_printcCstjd|dS)Nzwarning: %s
)sysstderrr)rrrrrwarnszCCompiler.warncCst||||jdS)N)rr)rfuncargsrrrrrrszCCompiler.executecKst|fd|ji|dS)Nr)rr)rcmdr!rrrrszCCompiler.spawncCst|||jdS)N)r)rr)rrQdstrrrrszCCompiler.move_filecCst|||jddS)N)r)rr)rr(moderrrrszCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr)rr)rr)rrr)r')Nr')r)Br 
__module____qualname____doc__
compiler_typerrZstatic_lib_extensionrZstatic_lib_formatZshared_lib_formatrrbrarr"rr+r0r2r3r5r7r9r:r;r<r=r>r@rArTrXrYrZr[r\r`rhrkrnrmrqr}rzrrwr|r~rrrrrrrDrrr{rrrrrrrrrrrr
s


$ 

+	 
"


B

4



2
+





r
))zcygwin.*unix)posixr)ntmsvccCsV|dkrtj}|dkrtj}x4tD],\}}t||dk	sJt||dk	r"|Sq"WdS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr)rHr(rplatform_default_compilersrematch)osnamerpatterncompilerrrrget_default_compilers
r)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)rZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)rrcygwinZmingw32ZbcppcCs\ddlm}g}x,tD] }|d|dt|dfqW|||}|ddS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)FancyGetoptz	compiler=Nr,zList of available compilers:)distutils.fancy_getoptrcompiler_classrr1sort
print_help)rZ	compilersrZpretty_printerrrrshow_compilerssrcCs|dkrtj}y"|dkr t|}t|\}}}Wn8tk
rhd|}|dk	r\|d|}t|YnXy*d|}t|tj|}	t	|	|}
WnBt
k
rtd|Yn$tk
rtd||fYnX|
d||S)a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rHr(rrrlDistutilsPlatformError
__import__rmodulesvarsImportErrorDistutilsModuleError)platrrrr
module_name
class_namelong_descriptionrmoduleklassrrrnew_compilers2
rcCsg}x|D]}t|tr2dt|kr0dks>ntd|t|dkr^|d|dq
t|dkr
|ddkr|d|dq
|d|q
Wx|D]}|d	|qW|S)
aGenerate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    r'r,zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srNz-D%sz-D%s=%sz-I%s)r#r-r.r/r1)rrrOZmacror4rrrrFs
$
rFcCsg}x|D]}|||q
Wx4|D],}||}t|trJ||}q(||q(Wx^|D]V}tj|\}}	|r||g|	}
|
r||
q|	d|q^||
|q^W|S)acGenerate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    z6no library file corresponding to '%s' found (skipping))r1rrr#rCrHrIrrrr)rrrrZlib_optsr4optrlib_dirZlib_nameZlib_filerrrgen_lib_options?s$






r)NN)NNrrr)rrrHrdistutils.errorsdistutils.spawnrdistutils.file_utilrdistutils.dir_utilrdistutils.dep_utilrdistutils.utilrr	distutilsr	r
rrrrrrFrrrrrs6 

--PK!%I7SS/_distutils/__pycache__/extension.cpython-37.pycnu[B

Re)@s.dZddlZddlZGdddZddZdS)zmdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.Nc@s"eZdZdZdddZddZdS)	ExtensionaJust a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    NcKst|tstdt|tr.tdd|Ds6td||_||_|pHg|_|pRg|_|p\g|_	|pfg|_
|ppg|_|pzg|_|	pg|_
|
pg|_|pg|_|pg|_|
pg|_|pg|_||_||_t|dkrdd|D}dt|}d	|}t|dS)
Nz'name' must be a stringcss|]}t|tVqdS)N)
isinstancestr).0vr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/extension.py	jsz%Extension.__init__..z#'sources' must be a list of stringsrcSsg|]}t|qSr)repr)roptionrrr
sz&Extension.__init__..z, zUnknown Extension options: %s)rrAssertionErrorlistallnamesourcesinclude_dirs
define_macrosundef_macroslibrary_dirs	librariesruntime_library_dirs
extra_objectsextra_compile_argsextra_link_argsexport_symbols	swig_optsdependslanguageoptionallenjoinsortedwarningswarn)selfrrrrrrrrrrrrrrrrkwoptionsmsgrrr__init__Vs4













zExtension.__init__cCsd|jj|jj|jt|fS)Nz<%s.%s(%r) at %#x>)	__class__
__module____qualname__rid)r%rrr__repr__s
zExtension.__repr__)NNNNNNNNNNNNNN)__name__r+r,__doc__r)r.rrrrrs ?
!rcCsddlm}m}m}ddlm}ddlm}||}||dddddd}zhg}x\|}	|	dkrfP|	|	rrqT|	d|	dkrd	krnn|
d
|	qT||	|}	||	}
|
d}t|g}d}
x|
ddD]}|
dk	r|
|d}
qt
j|d}|dd}|dd}|dkr8|j|q|d
krP|j|q|dkr|d}|dkr|j|dfn$|j|d|||ddfq|dkr|j|q|dkr|j|q|dkr|j|q|dkr|j|q|dkr|j|q|dkr0|j}
q|dkrB|j}
q|dkrT|j}
q|dkrx|j||s|j}
q|dkr|j|q|
d|qW||qTWWd|X|S)z3Reads a Setup file and returns Extension instances.r)parse_makefileexpand_makefile_vars_variable_rx)TextFile)split_quoted)strip_commentsskip_blanks
join_lines	lstrip_ws	rstrip_wsN*z'%s' lines not handled yet)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')distutils.sysconfigr1r2r3distutils.text_filer4distutils.utilr5readlinematchr$rappendospathsplitextrrfindrrrrrrrrclose)filenamer1r2r3r4r5varsfile
extensionslinewordsmoduleextappend_next_wordwordsuffixswitchvalueequalsrrrread_setup_files

 


















rY)r0rFr#rrYrrrrszPK!J*_distutils/__pycache__/dist.cpython-37.pycnu[B

Re@sdZddlZddlZddlZddlmZyddlZWnek
rLdZYnXddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZed	Zd
dZGdd
d
ZGdddZddZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
N)message_from_file)*)FancyGetopttranslate_longopt)
check_environ	strtobool
rfc822_escape)log)DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsLt|trnWarning: '{fieldname}' should be a list, got type '{typename}')	
isinstancestrlisttype__name__formatlocalsr	WARN)value	fieldnametypenamemsgr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/dist.py_ensure_lists


rc@speZdZdZdddddgZdZdd	d
ddd
dddddddddddddddgZddeDZdd iZdad"d#Z	d$d%Z
dbd'd(Zd)d*Zdcd+d,Z
d-d.Zd/d0Zd1d2Zd3d4Zd5d5gfd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdddDdEZdedFdGZdfdIdJZejfdKdLZdMdNZdOdPZ dQdRZ!dSdTZ"dUdVZ#dWdXZ$dYdZZ%d[d\Z&d]d^Z'd_d`Z(d!S)gDistributionaThe core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    )verbosevzrun verbosely (default))quietqz!run quietly (turns verbosity off))zdry-runnzdon't actually do anything)helphzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryzCommon commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
)z
help-commandsNzlist all available commands)nameNzprint package name)versionVzprint package version)fullnameNzprint -)authorNzprint the author's name)zauthor-emailNz print the author's email address)
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)urlNzprint the URL for this package)licenseNz print the license of the package)licenceNzalias for --license)descriptionNzprint the package description)zlong-descriptionNz"print the long package description)	platformsNzprint the list of platforms)classifiersNzprint the list of classifiers)keywordsNzprint the list of keywords)providesNz+print the list of packages/modules provided)requiresNz+print the list of packages/modules required)	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|dqS)r)r).0xrrr
szDistribution.rrNcCsld|_d|_d|_x|jD]}t||dqWt|_x,|jjD] }d|}t||t|j|q@Wi|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r|d}|dk	rH|d=xD|D]8\}}| |}x"|D]\}	}
d|
f||	<q(WqWd|kr|d|d	<|d=d
}t!dk	r~t!"|nt#j$%|dx|D]\}}
t&|jd|rt|jd||
nNt&|j|rt|j||
n0t&||rt|||
nd
t'|}t!"|qWd|_(|jdk	r`x0|jD]&}
|
)dsHP|
dkr6d|_(Pq6W|*dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rrget_Noptionszsetup scriptr,r+z:'licence' distribution option is deprecated; use 'license'
set_zUnknown distribution option: %sT-z
--no-user-cfgF)+rdry_runr!display_option_namessetattrDistributionMetadatametadata_METHOD_BASENAMESgetattrcmdclasscommand_packagesscript_namescript_argscommand_options
dist_filespackagespackage_datapackage_dir
py_modules	librariesheadersext_modulesext_packageinclude_dirs
extra_pathscripts
data_filespasswordcommand_objhave_rungetitemsget_option_dictwarningswarnsysstderrwritehasattrrepr
want_user_cfg
startswithfinalize_options)selfattrsattrbasenamemethod_namer9commandcmd_optionsopt_dictoptvalrkeyargrrr__init__s~





zDistribution.__init__cCs&|j|}|dkr"i}|j|<|S)zGet the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rHrY)rfrkdictrrrr['szDistribution.get_option_dictr8c	Csddlm}|dkr"t|j}|dk	r@||||d}|sV||ddSxt|D]l}|j|}|dkr||d|q\||d|||}x$|dD]}||d|qWq\WdS)Nr)pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:)pprintrtsortedrHkeysannouncerYsplit)	rfheadercommandsindentrtcmd_namermoutlinerrrdump_option_dicts2s&
zDistribution.dump_option_dictscCsg}ttjtjdj}tj|d}tj|rB|	|tj
dkrRd}nd}|jrtjtjd|}tj|r|	|d}tj|r|	|t
r|dd	||S)
aFind as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        	distutilsz
distutils.cfgposixz.pydistutils.cfgzpydistutils.cfg~z	setup.cfgzusing config files: %sz, )rospathdirnamer^modules__file__joinisfileappendr#rc
expanduserr
rx)rffilessys_dirsys_file
user_filename	user_file
local_filerrrfind_config_filesNs&



zDistribution.find_config_filesc
Csddlm}tjtjkr8ddddddd	d
ddd
ddg
}ng}t|}|dkrT|}trb|d|}x|D]}tr|d||	|xf|
D]Z}||}||}x@|D]8}	|	dkr|	|kr|
||	}
|	dd}	||
f||	<qWqW|qnWd|jkrx|jdD]\}	\}}
|j
|	}yF|rRt||t|
n(|	dkrnt||	t|
nt||	|
Wn,tk
r}
zt|
Wdd}
~
XYnXqWdS)Nr)ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-dataprefixzexec-prefixhomeuserrootz"Distribution.parse_config_files():z  reading %srr<_global)rr=)configparserrr^rbase_prefix	frozensetrr
rxreadsectionsr9r[rYreplacerrrHrZnegative_optr?r
ValueErrorDistutilsOptionError)rf	filenamesrignore_optionsparserfilenamesectionr9rmrnrosrcaliasrrrrparse_config_files~sJ






zDistribution.parse_config_filescCs|}g|_t||j}||j|ddi|j|j|d}|	}t
|j|
|rhdSx |r|||}|dkrjdSqjW|jr|j|t|jdk|jddS|jstddS)	aParse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r,r+)argsobjectNr)display_optionsr{zno commands suppliedT)_get_toplevel_optionsr{rrset_negative_aliasesrset_aliasesgetoptrGget_option_orderr	
set_verbosityrhandle_display_options_parse_command_optsr!
_show_helplenDistutilsArgError)rftoplevel_optionsrroption_orderrrrparse_command_lines,	

zDistribution.parse_command_linecCs|jdgS)zReturn the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)global_options)rfrrrrsz"Distribution._get_toplevel_optionsc
Csddlm}|d}t|s*td||j|y||}Wn*tk
rn}zt	|Wdd}~XYnXt
||std|t|drt
|jtsd}t|||j}t|dr|}||jt|d	rt
|jtrt|j}ng}||j|j|||||d
d\}}	t|	drV|	jrV|j|d|gddSt|d	rt
|jtrd}
xP|jD]F\}}}
}t|	||r|d
}
t|r|ntd
||fq|W|
rdS||}x&t|	D]\}}d|f||<qW|S)aParse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        r)Commandzinvalid command name '%s'Nz&command class %s must subclass Commanduser_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)rhelp_optionsrr!)rr{zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) 
distutils.cmdr
command_rematch
SystemExitr{rget_command_classDistutilsModuleErrorr
issubclassDistutilsClassErrorrarrr
rcopyupdaterfix_help_optionsset_option_tablerrrr!r
get_attr_namecallabler[varsrZ)rfrrrrk	cmd_classrrroptshelp_option_foundhelp_optionshortdescfuncrmr#rrrrrsb










z Distribution._parse_command_optscCsTxNdD]F}t|j|}|dkr qt|trdd|dD}t|j||qWdS)zSet final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        )r0r.NcSsg|]}|qSr)strip)r4elmrrrr6ksz1Distribution.finalize_options..,)rCrArrryr?)rfrhrrrrreas

zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|}n|j}||||jdt	d|rt||j
|dt	dx|jD]z}t|t
rt||r|}	n
||}	t|	drt|	jtr||	jt|	jn||	j|d|	jt	dq|Wt	||jd	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r)	gen_usage)rz
Global options:r8zKInformation display options (just display information, ignore any commands)rzOptions for '%s' command:N)distutils.corerrrrrr
print_helpcommon_usageprintrr{rrrrrarr
rrrrF)
rfrrrr{rrr9rkklassrrrrns4



zDistribution._show_helpc	Csddlm}|jr4|tdt||jdSd}i}x|jD]}d||d<qDWxt|D]l\}}|r^||r^t|}t	|j
d|}|dkrtd|n |dkrtd	|nt|d}q^W|S)
zIf there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        r)rr8rr7)r0r.r)r/r1r2r3r:)rr
help_commandsprint_commandsrrFrrYrrCrAr)	rfrrany_display_optionsis_display_optionoptionrnrorrrrrs*z#Distribution.handle_display_optionsc	Csnt|dx\|D]T}|j|}|s0||}y
|j}Wntk
rRd}YnXtd|||fqWdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        :z(no description available)z
  %-*s  %sN)rrDrYrr-AttributeError)rfr{rz
max_lengthcmdrr-rrrprint_command_lists



zDistribution.print_command_listcCsddl}|jj}i}x|D]}d||<qWg}x&|jD]}||s:||q:Wd}x$||D]}t||krdt|}qdW||d||rt	||d|dS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
distutils.commandrk__all__rDrwrYrrrr)rfrstd_commandsis_stdrextra_commandsrrrrrs*

zDistribution.print_commandsc		Csddl}|jj}i}x|D]}d||<qWg}x&|jD]}||s:||q:Wg}x\||D]P}|j|}|s||}y
|j}Wnt	k
rd}YnX|||fqdW|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrz(no description available))
rrkrrDrwrYrrr-r)	rfrrrrrrvrr-rrrget_command_lists(	




zDistribution.get_command_listcCsN|j}t|tsJ|dkrd}dd|dD}d|krD|dd||_|S)z9Return a list of packages from which commands are loaded.Nr8cSsg|]}|dkr|qS)r8)r)r4pkgrrrr6"sz5Distribution.get_command_packages..rzdistutils.commandr)rErr
ryinsert)rfpkgsrrrget_command_packagess
z!Distribution.get_command_packagesc	Cs|j|}|r|Sx|D]}d||f}|}yt|tj|}Wntk
r^wYnXyt||}Wn&tk
rt	d|||fYnX||j|<|SWt	d|dS)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s'N)
rDrYr
__import__r^rImportErrorrCrr)rfrkrpkgnamemodule_name
klass_namemodulerrrr(s(
zDistribution.get_command_classcCsl|j|}|sh|rhtr&|d|||}||}|j|<d|j|<|j|}|rh||||S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z.z1error in %s: command '%s' has no such option '%s')get_command_namer[r
rxrZboolean_optionsrrrrr?rrarr)rfrWoption_dictcommand_namersourcer	bool_optsneg_opt	is_stringrrrrris>	






z!Distribution._set_command_optionsrcCsddlm}t||s&|}||}n|}|js8|S|d|_d|j|<|||r|x|	D]}|
||qhW|S)aReinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        r)r)rrrrr	finalizedinitialize_optionsrXrget_sub_commandsreinitialize_command)rfrkreinit_subcommandsrrsubrrrrs


z!Distribution.reinitialize_commandcCst||dS)N)r	)rfrlevelrrrrxszDistribution.announcecCsx|jD]}||qWdS)zRun each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)r{run_command)rfrrrrrun_commandsszDistribution.run_commandscCsD|j|rdStd|||}||d|j|<dS)aDo whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)rXrYr	inforensure_finalizedrun)rfrkrrrrrs	
zDistribution.run_commandcCst|jp|jpgdkS)Nr)rrJrM)rfrrrhas_pure_modulesszDistribution.has_pure_modulescCs|jot|jdkS)Nr)rPr)rfrrrhas_ext_modulesszDistribution.has_ext_modulescCs|jot|jdkS)Nr)rNr)rfrrrhas_c_librariesszDistribution.has_c_librariescCs|p|S)N)rr)rfrrrhas_modulesszDistribution.has_modulescCs|jot|jdkS)Nr)rOr)rfrrrhas_headersszDistribution.has_headerscCs|jot|jdkS)Nr)rTr)rfrrrhas_scriptsszDistribution.has_scriptscCs|jot|jdkS)Nr)rUr)rfrrrhas_data_filesszDistribution.has_data_filescCs|o|o|S)N)rrr)rfrrris_pures
zDistribution.is_pure)N)NNr8)N)r)N)r))r
__module____qualname____doc__rrrr>rrrr[rrrrrrrerrrrrrrrrrr	INFOrxrrrrrrrrrrrrrrr-s|

0
:C[
1(!"&

,
)
rc@seZdZdZdZdBddZddZdd	Zd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZddZddZd d!Zd"d#ZeZd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Z d:d;Z!dd?Z#d@dAZ$dS)Cr@z]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r#r$r'author_emailr(maintainer_emailr*r+r-long_descriptionr0r.r&r)
contact_emailr/download_urlr1r2r3NcCs|dk	r|t|nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dS)N)
read_pkg_fileopenr#r$r'r r(r!r*r+r-r"r0r.r/r$r1r2r3)rfrrrrrrs&zDistributionMetadata.__init__cst|fdd}fdd}d}|d|_|d|_|d|_|d	|_d
|_|d|_d
|_|d|_|d
|_	dkr|d|_
nd
|_
|d|_|d|_dkr|dd|_
|d|_|d|_|dkr|d|_|d|_|d|_nd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs|}|dkrdS|S)NUNKNOWNr)r#r)rrr_read_field)sz7DistributionMetadata.read_pkg_file.._read_fieldcs|d}|gkrdS|S)N)get_all)r#values)rrr
_read_list/sz6DistributionMetadata.read_pkg_file.._read_listzmetadata-versionr#r$summaryr'Nzauthor-emailz	home-pager+zdownload-urlr-r0rplatform
classifierz1.1r2r1r3)rr#r$r-r'r(r r!r*r+r$r"ryr0r.r/r2r1r3)rffiler(r+metadata_versionr)rrr%%s:












z"DistributionMetadata.read_pkg_filec	Cs2ttj|dddd}||WdQRXdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFOwzUTF-8)encodingN)r&rrrwrite_pkg_file)rfbase_dirpkg_inforrrwrite_pkg_infoYs
z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|d||d||d||d||d|	|d|
|d	||d
||jr|d|jt
|}|d|d
|}|r|d|||d|||d|||d|||d|||d|dS)z9Write the PKG-INFO format data to a file object.
        z1.0z1.1zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
rz
Keywords: %s
Platform
ClassifierRequiresProvides	ObsoletesN)r1r2r3r/r$r`get_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenserget_long_descriptionrget_keywords_write_list
get_platformsget_classifiersget_requiresget_provides
get_obsoletes)rfr/r$	long_descr0rrrr3`s0z#DistributionMetadata.write_pkg_filecCs$x|D]}|d||fqWdS)Nz%s: %s
)r`)rfr/r#r*rrrrrEs
z DistributionMetadata._write_listcCs
|jpdS)Nr')r#)rfrrrr<szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r$)rfrrrr=sz DistributionMetadata.get_versioncCsd||fS)Nz%s-%s)r<r=)rfrrrget_fullnamesz!DistributionMetadata.get_fullnamecCs
|jpdS)Nr')r')rfrrr
get_authorszDistributionMetadata.get_authorcCs
|jpdS)Nr')r )rfrrrget_author_emailsz%DistributionMetadata.get_author_emailcCs
|jpdS)Nr')r()rfrrrget_maintainersz#DistributionMetadata.get_maintainercCs
|jpdS)Nr')r!)rfrrrget_maintainer_emailsz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdS)Nr')r(r')rfrrrr@sz DistributionMetadata.get_contactcCs|jp|jpdS)Nr')r!r )rfrrrrAsz&DistributionMetadata.get_contact_emailcCs
|jpdS)Nr')r*)rfrrrr?szDistributionMetadata.get_urlcCs
|jpdS)Nr')r+)rfrrrrBsz DistributionMetadata.get_licensecCs
|jpdS)Nr')r-)rfrrrr>sz$DistributionMetadata.get_descriptioncCs
|jpdS)Nr')r")rfrrrrCsz)DistributionMetadata.get_long_descriptioncCs
|jpgS)N)r0)rfrrrrDsz!DistributionMetadata.get_keywordscCst|d|_dS)Nr0)rr0)rfrrrrset_keywordssz!DistributionMetadata.set_keywordscCs|jp
dgS)Nr')r.)rfrrrrFsz"DistributionMetadata.get_platformscCst|d|_dS)Nr.)rr.)rfrrrr
set_platformssz"DistributionMetadata.set_platformscCs
|jpgS)N)r/)rfrrrrGsz$DistributionMetadata.get_classifierscCst|d|_dS)Nr/)rr/)rfrrrrset_classifierssz$DistributionMetadata.set_classifierscCs
|jpdS)Nr')r$)rfrrrget_download_urlsz%DistributionMetadata.get_download_urlcCs
|jpgS)N)r2)rfrrrrHsz!DistributionMetadata.get_requirescCs0ddl}x|D]}|j|qWt||_dS)Nr)distutils.versionpredicateversionpredicateVersionPredicater
r2)rfrrrrrrset_requiress
z!DistributionMetadata.set_requirescCs
|jpgS)N)r1)rfrrrrIsz!DistributionMetadata.get_providescCs:dd|D}x |D]}ddl}|j|qW||_dS)NcSsg|]}|qSr)r)r4rrrrr6sz5DistributionMetadata.set_provides..r)rUrVsplit_provisionr1)rfrrrrrrset_providess

z!DistributionMetadata.set_providescCs
|jpgS)N)r3)rfrrrrJsz"DistributionMetadata.get_obsoletescCs0ddl}x|D]}|j|qWt||_dS)Nr)rUrVrWr
r3)rfrrrrrr
set_obsoletess
z"DistributionMetadata.set_obsoletes)N)%rrrrrBrrr%r6r3rEr<r=rLrMrNrOrPr@rAr?rBget_licencer>rCrDrQrFrRrGrSrTrHrXrIrZrJr[rrrrr@sD	
4"r@cCs(g}x|D]}||ddq
W|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r)r)r9new_options
help_tuplerrrrs
r)rr^rreemailrr\rdistutils.errorsdistutils.fancy_getoptrrdistutils.utilrrrrr	distutils.debugr
compilerrrr@rrrrrs4

ZcPK!UII6_distutils/__pycache__/versionpredicate.cpython-37.pycnu[B

Re
@sdZddlZddlZddlZedejZedZedZ	ddZ
ejejej
ejejejdZGd	d
d
ZdaddZdS)
zBModule for parsing and testing package version predicate strings.
Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t|}|std||\}}|tj|fS)zVParse a single version comparison.

    Return (comparison string, StrictVersion)
    z"bad package restriction syntax: %r)re_splitComparisonmatch
ValueErrorgroups	distutilsversion
StrictVersion)predrescompZverStrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/versionpredicate.pysplitUps

r)z>=z!=c@s(eZdZdZddZddZddZdS)	VersionPredicateaParse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    cCs|}|stdt|}|s.td||\|_}|}|rt|}|sbtd||d}dd|dD|_|jstd|ng|_d	S)
z*Parse a version predicate string.
        zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|qSr)r).0ZaPredrrr

tsz-VersionPredicate.__init__..,zempty parenthesized list in %rN)	striprre_validPackagerrnamere_parensplitr	)selfZversionPredicateStrrZparenstrrrr
__init__`s$


zVersionPredicate.__init__cCs8|jr.dd|jD}|jdd|dS|jSdS)NcSs g|]\}}|dt|qS) )r)rcondverrrr
r}sz,VersionPredicate.__str__..z (z, ))r	rjoin)rseqrrr
__str__{szVersionPredicate.__str__cCs*x$|jD]\}}t|||sdSqWdS)zTrue if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        FT)r	compmap)rrrrrrr
satisfied_byszVersionPredicate.satisfied_byN)__name__
__module____qualname____doc__rr#r%rrrr
rs?rcCsdtdkrtdtja|}t|}|s8td||dpDd}|rVtj	
|}|d|fS)a9Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r)
_provision_rxrecompileASCIIrrrgrouprrr)valuemrrrr
split_provisions
r3)r)r-Zdistutils.versionroperatorr.r/rrrrltleeqgtgener$rr,r3rrrr
s

nPK!))2_distutils/__pycache__/fancy_getopt.cpython-37.pycnu[B

RexE@sdZddlZddlZddlZddlZddlTdZedeZedeefZ	e
ddZGd	d
d
Z
ddZd
dejDZddZddZGdddZedkrdZx2dD]*ZedeedeeeeqWdS)a6distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
N)*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$-_c@seZdZdZdddZddZddZd d	d
ZddZd
dZ	ddZ
ddZddZddZ
d!ddZddZd"ddZd#ddZdS)$FancyGetoptaWrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    NcCsN||_i|_|jr|i|_i|_g|_g|_i|_i|_i|_	g|_
dS)N)option_tableoption_index_build_indexaliasnegative_alias
short_opts	long_opts
short2long	attr_name	takes_argoption_order)selfrr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/fancy_getopt.py__init__)s	zFancyGetopt.__init__cCs,|jx|jD]}||j|d<qWdS)Nr)rclearr)roptionrrrrQs
zFancyGetopt._build_indexcCs||_|dS)N)rr)rrrrrset_option_tableVszFancyGetopt.set_option_tablecCs<||jkrtd|n |||f}|j|||j|<dS)Nz'option conflict: already an option '%s')rDistutilsGetoptErrorrappend)rlong_optionshort_optionhelp_stringrrrr
add_optionZs

zFancyGetopt.add_optioncCs
||jkS)zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)r)rrrrr
has_optioncszFancyGetopt.has_optioncCs
|tS)zTranslate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.)	translate
longopt_xlate)rrrrr
get_attr_namehszFancyGetopt.get_attr_namecCs`t|tstxL|D]@\}}||jkr= 2Nz:invalid short option '%s': must a single character or None=:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)rrr
rrepeatrlen
ValueErrorr"strrrrr
getr	
longopt_rematchr!r)rrlongshorthelpr3alias_torrr_grok_option_tables^






zFancyGetopt._grok_option_tablec
Cs|dkrtjdd}|dkr*t}d}nd}|d|j}yt|||j\}}Wn,tjk
r}zt	|Wdd}~XYnXx|D]\}}t
|dkr|ddkr|j|d}n,t
|dkr|ddd	kst|dd}|j
|}	|	r|	}|j|s@|d
ks td|j|}	|	r<|	}d}nd}|j|}
|rr|j|
dk	rrt||
dd}t||
||j||fqW|r||fS|SdS)aParse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr/TF r.rrz--zboolean option can't have value)sysargvOptionDummyr>joinrgetoptrerrorDistutilsArgErrorr4r
r$r	r7rr
rr3getattrsetattrrr)rargsobjectcreated_objectroptsmsgr(valr	attrrrrrEsF 
zFancyGetopt.getoptcCs|jdkrtdn|jSdS)zReturns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        Nz!'getopt()' hasn't been called yet)rRuntimeError)rrrrget_option_orders

zFancyGetopt.get_option_ordercCsvd}xV|jD]L}|d}|d}t|}|ddkr<|d}|dk	rL|d}||kr|}qW|ddd}d}||}	d	|}
|r|g}nd
g}x|jD]}|dd\}}}t||	}
|ddkr|dd}|dkr|
r|d|||
dfn|d
||fn:d||f}|
r:|d|||
dfn|d|x$|
ddD]}||
|qVWqW|S)zGenerate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        rr/r0r1Nr.Nr?zOption summary:r,z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr4	wrap_textr)rheadermax_optrr:r;l	opt_width
line_width
text_width
big_indentlinesr<text	opt_namesrrr
generate_helpsF

zFancyGetopt.generate_helpcCs4|dkrtj}x ||D]}||dqWdS)N
)rAstdoutr`write)rrVfilelinerrr
print_helphszFancyGetopt.print_help)N)NN)NN)N)NN)__name__
__module____qualname____doc__rrrrrr!r)r*r+r>rErRr`rfrrrrrs

(
	
M
=

OrcCst|}|||||S)N)rr+rE)optionsnegative_optrKrJparserrrrfancy_getoptos
rncCsi|]}dt|qS)r?)ord).0Z_wscharrrr
usrqcCs"|dkrgSt||kr|gS|}|t}td|}dd|D}g}x|rg}d}xZ|rt|d}|||kr||d|d=||}q`|r|dddkr|d=Pq`W|r
|dkr||dd||d|d|d<|dddkr
|d=|d|qPW|S)	zwrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)cSsg|]}|r|qSrr)rpchrrr
szwrap_text..rr0r?r@)r4
expandtabsrWS_TRANSresplitrrD)r^widthchunksr]cur_linecur_lenrXrrrrUws:

rUcCs
|tS)zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    )rr )r(rrrtranslate_longoptsr|c@seZdZdZgfddZdS)rCz_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCsx|D]}t||dqWdS)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rI)rrkr(rrrrs
zOptionDummy.__init__N)rgrhrirjrrrrrrCsrC__main__zTra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))
(z	width: %dra)rjrAstringrvrEdistutils.errorslongopt_patcompiler8neg_alias_rer6	maketransr rrn
whitespacerurUr|rCrgr^wprintrDrrrr	s*T6
PK!w"9"92_distutils/__pycache__/msvccompiler.cpython-37.pycnu[B

Re[@sdZddlZddlZddlmZmZmZmZmZddl	m
Z
mZddlm
Z
dZy,ddlZdZeZejZejZejZejZWnhek
ry4ddlZddlZdZeZejZejZejZejZWnek
re
dYnXYnXerejejejej fZ!d	d
Z"ddZ#d
dZ$GdddZ%ddZ&ddZ'ddZ(Gddde
Z)e&dkr~e
*de)Z+ddl,m)Z)ddl,m%Z%dS)zdistutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)logFTzWarning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsnyt||}Wntk
r"dSXg}d}x||j
kr>|}d|}y"||jg||g|gWqhtk
r8}zt|Wdd}~XYqhXqhn||jkrtj	|}tj	|}yl||jgd|d|g|gtj	tj	|\}}tj	||d}||jgd|g|gWqhtk
r}zt|Wdd}~XYqhXqhntd||fd	|}y&||jg|
|||g|Wqhtk
rj}zt|Wdd}~XYqhXqhW|
S)
Nz/cz/Tcz/Tpz/foz-hz-rz.rcz"Don't know how to compile %s to %sz/Fo)rZroZ_setup_compilerextendrlrkr/rNr-abspath
_c_extensions_cpp_extensionsrvspawnrfrrrxdirnamergrqrurjrd)r)sourcesrzr'include_dirsdebug
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsobjsrcr|Z	input_optZ
output_optmsgZh_dirZrc_dirr_Zrc_filerrrcompileWsj




zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||r|d|g}|rJy||jg|Wqtk
r}zt|Wdd}~XYqXnt	
d|dS)N)rzz/OUT:zskipping %s (up-to-date))rZro_fix_object_argslibrary_filename
_need_linkrr^rrr	r)	r)rZoutput_libnamerzrtarget_langoutput_filenameZlib_argsrrrrcreate_static_libszMSVCCompiler.create_static_libc
Cs|js||||\}}||||}|\}}}|rL|dt|t||||}|dk	rptj	||}|
||r|tjkr|	r|j
dd}q|jdd}n|	r|j
}n|j}g}x|pgD]}|d|qW||||d|g}|dk	rLtjtj|\}}tj	tj|d||}|d||
r^|
|dd<|rn|||tj|y||jg|Wn,tk
r}zt|Wdd}~XYnXntd|dS)Nz5I don't know what to do with 'runtime_library_dirs': r
z/EXPORT:z/OUT:rz/IMPLIB:zskipping %s (up-to-date))rZrorZ
_fix_lib_argswarnstrrrNr-rjrrZ
EXECUTABLErnrmrrqrurrr~mkpathrrerrr	r)r)Ztarget_descrrrz	librarieslibrary_dirsruntime_library_dirsexport_symbolsrrr
build_temprZ
fixed_argsZlib_optsZldflagsZexport_optssymZld_argsZdll_nameZdll_extZimplib_filerrrrlinksV



zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:r)r)dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCstddS)NztjddD]*}tjtj||}tj|rH|SqHW|S)aReturn path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        Pathr`)rarNr-rjrisfilerbrE)r)Zexer2fnrrrrc5s	zMSVCCompiler.find_exex86cCstsgS|d}|jdkr,d|j|jf}nd|j|f}xHtD]@}t||}|r@|jdkrr|j||dS||dSq@W|jdkrx,tD]$}t|d|jdk	r|d	PqWgS)
zGet a list of devstudio directories (include, lib or path).

        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        z dirsrTz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr`r<z%s\6.0NzIt seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.)	
_can_read_regrUrWr,rrXr7rEr)r)r-platformrrrrrrrhKs(






zMSVCCompiler.get_msvc_pathscCs6|dkr|d}n
||}|r2d|tj|<dS)zSet environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        r^Zlibraryr`N)rhrjrNrb)r)rr2rrrrios

zMSVCCompiler.set_path_env_var)rrr)rrp)NNNrNNN)NrN)
NNNNNrNNNN)r)r)r8r9r:__doc__
compiler_typeZexecutablesrrrvrxrtrwryZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr+ror}rrrrrrrrcrhrirrrrrSsP

B

V

F

$rSg @z3Importing new compiler from distutils.msvc9compiler)rS)r&)-rrBrNdistutils.errorsrrrrrdistutils.ccompilerrr	distutilsr	rwinregZhkey_mod	OpenKeyExrEnumKeyr
Z	EnumValuererrorrImportErrorwin32apiZwin32coninfoZ
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTr,rrrr&rIrMrRrSrZOldMSVCCompilerZdistutils.msvc9compilerrrrrs^


	-
9
PK!0_distutils/__pycache__/py38compat.cpython-37.pycnu[B

Re@sddZdS)cCs4yddl}|Stk
r$YnXd|||fS)Nz%s-%s.%s)_aix_supportaix_platformImportError)osnameversionreleaserr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/py38compat.pyrsrN)rrrrr	PK!ů D D3_distutils/__pycache__/msvc9compiler.cpython-37.pycnu[B

Rev@sNdZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZddlmZddlZejZejZejZejZejejejejfZej dkoej!dkZ"e"rd	Z#d
Z$dZ%ndZ#d
Z$dZ%dddZ&GdddZ'GdddZ(ddZ)ddZ*ddZ+ddZ,d$ddZ-e)Z.e.d kr:ed!e.Gd"d#d#eZ/dS)%adistutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
N)DistutilsExecErrorDistutilsPlatformErrorCompileErrorLibError	LinkError)	CCompilergen_lib_options)log)get_platformwin32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFrameworkx86amd64)rz	win-amd64c@sPeZdZdZddZeeZddZeeZddZeeZdd	Ze	eZd
S)Regz2Helper class to read values from the registry
    cCs:x,tD]$}|||}|r||kr||SqWt|dS)N)HKEYSread_valuesKeyError)clspathkeybasedr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/msvc9compiler.py	get_value?s

z
Reg.get_valuecCsnyt||}Wntk
r"dSXg}d}xr9NET_BASErrWINSDK_BASErrrrrrr7)r;r<prhrrrrrr:s.

zMacroExpander.load_macroscCs(x"|jD]\}}|||}qW|S)N)r7itemsreplace)r;r.r"vrrrsubszMacroExpander.subN)r0r1r2r=r>r:rGrrrrr6ysr6cCsd}tj|}|dkrdS|t|}tj|ddd\}}t|ddd}|dkrf|d7}t|d	d
d}|dkrd}|dkr||SdS)
zReturn the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.N r
g$@r)sysr<findlensplitint)prefixr!r.restZmajorVersionZminorVersionrrrget_build_versionsrVcCs4g}x*|D]"}tj|}||kr
||q
W|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )osrnormpathr)pathsZ
reduced_pathsrBnprrrnormalize_and_reduce_pathss
r[cCs@|tj}g}x|D]}||kr||qWtj|}|S)z8Remove duplicate values of an environment variable.
    )rRrWpathseprjoin)variableZoldListZnewListr!ZnewVariablerrrremoveDuplicatess
r_cCst|}ytd|d}Wn"tk
r>tdd}YnX|rPtj|sd|}tj	
|d}|rtj|rtj|tjtjd}tj
|}tj|std|dSntd||std	dStj|d
}tj|r|StddS)zFind the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    z%s\Setup\VCr?z%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.batzUnable to find vcvarsall.bat)r8rrrr	debugrWrisdirenvirongetr]pardirabspathisfile)r<r9r?ZtoolskeyZtoolsdir	vcvarsallrrrfind_vcvarsalls2





rhcCs<t|}ddddh}i}|dkr(tdtd||tjd||ftjtjd	}z|\}}|d
krzt|	d|	d}xr|
dD]d}t|}d
|krq|
}|
d
d\}	}
|	}	|	|kr|
tjr|
dd}
t|
||	<qWWd|j|jXt|t|kr8ttt||S)zDLaunch vcvarsall.bat and read the settings from its environment
    includelibZlibpathrNzUnable to find vcvarsall.batz'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)stdoutstderrrr+
=rrH)rhrr	r`
subprocessPopenPIPEcommunicatewaitr*rRrr&stripr%endswithrWr\r_rkcloserlrQ
ValueErrorstrlistkeys)r<archrginterestingresultpopenrkrllinerr(rrrquery_vcvarsalls<



rg @z(VC %0.1f is not supported by this modulec
@seZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd.ddZd/ddZd0ddZd1ddZd2ddZd3ddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd4d*d+Zd,d-ZdS)5MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxxz.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t||||t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr=VERSION_MSVCCompiler__versionZ_MSVCCompiler__root_MSVCCompiler__paths	plat_name_MSVCCompiler__archinitialized)r;verbosedry_runforcerrrr=HszMSVCCompiler.__init__NcCs,|jrtd|dkrt}d}||kr6td|fdtjkrtdtjkrt|drtd|_d|_d|_	d	|_
d
|_n|tks|dkrt|}nttdt|}t
t|}|d
tj|_|dtjd<|dtjd<t|jdkrtd|j|d|_|d|_|d|_	|d	|_
|d
|_y,x&tjd
dD]}|j|qJWWntk
rxYnXt|j|_d|jtjd
<d|_|jdkrdddddg|_ddddddg|_n&ddddddg|_dddddddg|_dddg|_|jd krddd!d"g|_dg|_d#|_dS)$Nzdon't init multiple times)rz	win-amd64z--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer_rrjrirzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.;rz/nologoz/O2z/MDz/W3z/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOz/INCREMENTAL:noz/DEBUGT) rAssertionErrorr
rrWrbfind_execclinkerrjrcmcPLAT_TO_VCVARSrrrRr\rrQZ_MSVCCompiler__productrrr[r]Zpreprocess_optionsrcompile_optionscompile_options_debugldflags_sharedrldflags_shared_debugZldflags_static)r;rZok_platsZ	plat_specZvc_envrBrrr
initializeSsf







zMSVCCompiler.initializecCs|dkrd}g}x|D]}tj|\}}tj|d}|tj|d}||jkrdtd||rttj|}||jkr|	tj
|||jq||jkr|	tj
|||jq|	tj
|||j
qW|S)NrrzDon't know how to compile %s)rWrsplitext
splitdriveisabssrc_extensionsrbasename_rc_extensionsrr]
res_extension_mc_extensions
obj_extension)r;Zsource_filenamesZ	strip_dir
output_dirZ	obj_namessrc_namerextrrrobject_filenamess(



zMSVCCompiler.object_filenamesc	Cst|js||||||||}	|	\}}
}}}|p6g}
|
d|rT|
|jn|
|jx|
D]}y||\}}Wntk
rwhYnX|rtj	
|}||jkrd|}nT||jkrd|}n>||j
kr>|}d|}y"||jg||g|gWqhtk
r8}zt|Wdd}~XYqhXqhn||jkrtj	|}tj	|}yl||jgd|d|g|gtj	tj	|\}}tj	||d}||jgd|g|gWqhtk
r}zt|Wdd}~XYqhXqhntd||fd	|}y&||jg|
|||g|Wqhtk
rj}zt|Wdd}~XYqhXqhW|
S)
Nz/cz/Tcz/Tpz/foz-hz-rz.rcz"Don't know how to compile %s to %sz/Fo)rrZ_setup_compilerextendrrrrWrre
_c_extensions_cpp_extensionsrspawnrrrrdirnamerrrr]r)r;sourcesrr7include_dirsr`
extra_preargsextra_postargsdependsZcompile_infoobjectsZpp_optsbuildZcompile_optsobjsrcrZ	input_optZ
output_optmsgZh_dirZrc_dirrrZrc_filerrrcompilesj




zMSVCCompiler.compilec	
Cs|js||||\}}|j||d}|||r|d|g}|rJy||jg|Wqtk
r}zt|Wdd}~XYqXnt	
d|dS)N)rz/OUT:zskipping %s (up-to-date))rr_fix_object_argslibrary_filename
_need_linkrrjrrr	r`)	r;rZoutput_libnamerr`target_langoutput_filenameZlib_argsrrrrcreate_static_libszMSVCCompiler.create_static_libc
CsX|js||||\}}||||}|\}}}|rL|dt|t||||}|dk	rptj	||}|
||rH|tjkr|	r|j
dd}q|jdd}n|	r|j
}n|j}g}x|pgD]}|d|qW||||d|g}tj|d}|dk	rPtjtj|\}}tj	|||}|d||||||
rp|
|dd<|r|||tj|y||jg|Wn,tk
r}zt|Wdd}~XYnX|||}|dk	rT|\}}d||f}y|dd	d
||gWn,tk
rD}zt|Wdd}~XYnXntd|dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:z/OUT:rz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestzskipping %s (up-to-date))rrrZ
_fix_lib_argswarnrxrrWrr]rr
EXECUTABLErrrrrrrmanifest_setup_ldargsrmkpathrrrrmanifest_get_embed_infor	r`)r;target_descrrr	librarieslibrary_dirsruntime_library_dirsexport_symbolsr`rr
build_temprZ
fixed_argsZlib_optsZldflagsZexport_optssymld_argsZdll_nameZdll_extZimplib_filerZmfinfoZ
mffilenamemfidZout_argrrrlink5sl





zMSVCCompiler.linkcCs,tj|tj|d}|d|dS)Nz	.manifestz/MANIFESTFILE:)rWrr]rr)r;rrr
temp_manifestrrrrsz"MSVCCompiler.manifest_setup_ldargscCs`x,|D] }|dr|ddd}PqWdS|tjkr>d}nd}||}|dkrXdS||fS)Nz/MANIFESTFILE::rrM)
startswithrRrr_remove_visual_c_ref)r;rrargrrrrrrs



z$MSVCCompiler.manifest_get_embed_infocCsyt|}z|}Wd|Xtdtj}t|d|}d}t|d|}tdtj}t||dkrrdSt|d}z|||S|XWnt	k
rYnXdS)NzU|)rz*\s*zI|)w)
openreadrvrerDOTALLrGsearchwriteOSError)r;Z
manifest_fileZ
manifest_fZmanifest_bufpatternrrrrs.	


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:r)r;dirrrrlibrary_dir_optionszMSVCCompiler.library_dir_optioncCstddS)NztjddD]*}tjtj||}tj|rH|SqHW|S)aReturn path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        Pathr)rrWrr]rerfrbrR)r;ZexerBfnrrrrs	zMSVCCompiler.find_exe)rrr)N)rr)NNNrNNN)NrN)
NNNNNrNNNN)r) r0r1r2r3
compiler_typeZexecutablesrrrrrrrZstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr=rrrrrrrrrrrrrrrrrr*sR


W

V

R+
r)r)0r3rWrorOrdistutils.errorsrrrrrdistutils.ccompilerrr	distutilsr	distutils.utilr
winreg	OpenKeyExrEnumKeyrZ	EnumValuer$errorrZ
HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOTrplatformmaxsizeZNATIVE_WIN64r8rAr@rrr6rVr[r_rhrrrrrrrsL>.#
)
PK!ceg2_distutils/__pycache__/bcppcompiler.cpython-37.pycnu[B

Re.:@spdZddlZddlmZmZmZmZmZddlm	Z	m
Z
ddlmZddl
mZddlmZGdd	d	e	ZdS)
zdistutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
N)DistutilsExecErrorCompileErrorLibError	LinkErrorUnknownFileError)	CCompilergen_preprocess_options)
write_file)newer)logc
@seZdZdZdZiZdgZdddgZeeZdZ	dZ
d	Zd
ZZ
dZdd
dZdddZdddZd ddZd!ddZd"ddZd#ddZdS)$BCPPCompilerzConcrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    Zbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCst||||d|_d|_d|_d|_ddddg|_ddddg|_d	d
ddg|_d	d
ddg|_	g|_
d
ddg|_d
dddg|_dS)
Nz	bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r__init__cclinkerlibZpreprocess_optionscompile_optionscompile_options_debugldflags_sharedldflags_shared_debugZldflags_staticldflags_exeldflags_exe_debug)selfverbosedry_runforcer/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/bcppcompiler.pyr
5szBCPPCompiler.__init__Nc	Cs|||||||\}}	}}
}|p$g}|d|rB||jn||jxD|	D]:}
y||
\}}Wntk
rwVYnXtj|}tj|
}
|	tj
|
|dkrqV|dkry|dd|
|gWqVtk
r}zt
|Wdd}~XYqVXqV||jkrd}n||jkr,d}nd}d|
}y,||jg||
||g||gWqVtk
r}zt
|Wdd}~XYqVXqVW|	S)	Nz-cz.resz.rcZbrcc32z-foz-Pz-o)Z_setup_compileappendextendrrKeyErrorospathnormpathmkpathdirnamespawnrr
_c_extensions_cpp_extensionsr)rsources
output_dirmacrosinclude_dirsdebug
extra_preargsextra_postargsdependsobjectspp_optsbuildZcompile_optsobjsrcextmsgZ	input_optZ
output_optrrrcompileQsF

(zBCPPCompiler.compilec	
Cs|||\}}|j||d}|||r~|dg|}|r:y||jg|Wqtk
rz}zt|Wdd}~XYqXntd|dS)N)r*z/uzskipping %s (up-to-date))	_fix_object_argslibrary_filename
_need_linkr&rrrrr-)	rr1Zoutput_libnamer*r-target_langoutput_filenameZlib_argsr7rrrcreate_static_libszBCPPCompiler.create_static_libc 
Cs|||\}}||||\}}}|r8tdt||dk	rNtj||}|||r|t	j
krd}|	r~|jdd}q|jdd}n&d}|	r|j
dd}n|jdd}|dkrd}ntj|\}}tj|\}}tj|d}tj|d|}dg}x&|pgD]}|d||fqW|t||fd	|ttjj|}|g}g}xF|D]>}tjtj|\}}|d
kr||n
||qfWx$|D]}|dtj|qW|d|||d
|g|dx<|D]4}||||	}|dkr(||n
||qW|d|d|d
|g|d
|||
r|
|dd<|r|||tj|y||jg|Wn,tk
r}zt|Wdd}~XYnXntd|dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32rrz%s.defZEXPORTSz  %s=_%sz
writing %sz.resz/L%sz/L.,z,,Zimport32Zcw32mtzskipping %s (up-to-date)) r9Z
_fix_lib_argsrwarnstrr!r"joinr;rZ
EXECUTABLErrrrsplitsplitextr%rexecuter	mapr#normcaserfind_library_filer$r&rrrr-) rZtarget_descr1r=r*	librarieslibrary_dirsruntime_library_dirsexport_symbolsr-r.r/
build_tempr<Zstartup_objZld_argsZdef_fileheadtailmodnamer6temp_dircontentssymZobjects2	resourcesfilebaselrlibfiler7rrrlinks|
















zBCPPCompiler.linkc	Csv|r"|d}|d|d||f}n|d|f}xB|D]6}x0|D](}tj|||}tj|r>|Sq>Wq4WdSdS)NZ_dZ_bcpp)r!r"rBr:exists)	rdirsrr-ZdlibZ	try_namesdirnamerXrrrrH4s


zBCPPCompiler.find_library_filercCs|dkrd}g}x|D]}tjtj|\}}||jddgkrTtd||f|rdtj|}|dkr|tj|||q|dkr|tj||dq|tj|||j	qW|S)Nrz.rcz.resz"unknown file type '%s' (from '%s'))
r!r"rDrGsrc_extensionsrbasenamerrB
obj_extension)rZsource_filenamesZ	strip_dirr*Z	obj_namessrc_namerVr6rrrobject_filenamesNs"
zBCPPCompiler.object_filenamesc
Cs|d||\}}}t||}dg|}	|dk	r>|	d||rN||	dd<|r\|	||	||js~|dks~t||r|r|tj	|y|
|	Wn2tk
r}
zt|
t
|
Wdd}
~
XYnXdS)Nz	cpp32.exez-or)Z_fix_compile_argsrrrrr
r$r!r"r%r&rprintr)rsourceZoutput_filer+r,r.r/_r2Zpp_argsr7rrr
preprocessis$	



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr)NNNNN)__name__
__module____qualname____doc__
compiler_typeZexecutablesr'r(r^r`Zstatic_lib_extensionshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr
r8r>rYrHrbrfrrrrrsJ


B

|

r)rjr!distutils.errorsrrrrrdistutils.ccompilerrrdistutils.file_utilr	distutils.dep_utilr
	distutilsrrrrrrs
PK!8 i	i	)_distutils/__pycache__/log.cpython-37.pycnu[B

Re@sldZdZdZdZdZdZddlZGdd	d	ZeZej	Z	ej
Z
ejZejZej
Z
ejZd
dZdd
ZdS)z,A simple log mechanism styled after PEP 282.Nc@sPeZdZefddZddZddZddZd	d
ZddZ	d
dZ
ddZdS)LogcCs
||_dS)N)	threshold)selfrr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/log.py__init__szLog.__init__cCs|tttttfkr"tdt|||jkr|r8||}|tttfkrNtj	}ntj
}y|d|Wn:tk
r|j
}||d|}|d|YnX|dS)Nz%s wrong log levelz%s
backslashreplace)DEBUGINFOWARNERRORFATAL
ValueErrorstrrsysstderrstdoutwriteUnicodeEncodeErrorencodingencodedecodeflush)r	levelmsgargsstreamrr
r
r_logs
zLog._logcGs||||dS)N)r")r	rrr r
r
rlog'szLog.logcGs|t||dS)N)r"r)r	rr r
r
rdebug*sz	Log.debugcGs|t||dS)N)r"r)r	rr r
r
rinfo-szLog.infocGs|t||dS)N)r"r)r	rr r
r
rwarn0szLog.warncGs|t||dS)N)r"r)r	rr r
r
rerror3sz	Log.errorcGs|t||dS)N)r"r)r	rr r
r
rfatal6sz	Log.fatalN)__name__
__module____qualname__rrr"r#r$r%r&r'r(r
r
r
rrsrcCstj}|t_|S)N)_global_logr)roldr
r
r
set_thresholdAsr.cCs8|dkrttn"|dkr$ttn|dkr4ttdS)Nrrr)r.rrr)vr
r
r
set_verbosityGs

r0)__doc__rrrrrrrr,r#r$r%r&r'r(r.r0r
r
r
rs +PK!w7w7*_distutils/__pycache__/util.cpython-37.pycnu[B

ReO@s(dZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	lmZd
dZdd
ZejdkrdadZddZddZddZddZddZddZdaddZddZd/d!d"Z da!a"a#d#d$Z$d%d&Z%d0d'd(Z&d)d*Z'd1d+d,Z(d-d.Z)dS)2zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
N)DistutilsPlatformError)newer)spawn)log)DistutilsByteCompileError)"_optim_args_from_interpreter_flagscCstjdkrFdtjkrdSdtjkr.dSdtjkr@dStjSdtjkrZtjdStjd	ksnttd
sttjSt\}}}}}|	dd}|	d
d}|	dd}|dddkrd||fS|dddkr,|ddkrd}dt
|dd|ddf}ddd}|d|tj7}n|dddkrVd d!lm
}||||S|dd"d#krd#}td$tj}||}|r|}n>|dd"d%krddl}	ddl}
|	|
j|||\}}}d&|||fS)'aReturn a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    ntamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64_PYTHON_HOST_PLATFORMposixuname/ _-Nlinuxz%s-%ssunosr5solarisz%d.%s32bit64bit)ilz.%saixr)aix_platformcygwinz[\d.]+darwinz%s-%s-%s)osnamesysversionlowerplatformenvironhasattrr
replaceintmaxsizeZ
py38compatrrecompileASCIImatchgroup_osx_supportdistutils.sysconfigget_platform_osx	sysconfigget_config_vars)osnamehostreleaser$machinebitnessrrel_remr1	distutilsr>/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/util.pyget_host_platformsN


 


r@cCs:tjdkr0ddddd}|tjdp.tStSdS)Nr	win32z	win-amd64z	win-arm32z	win-arm64)Zx86Zx64ZarmZarm64ZVSCMD_ARG_TGT_ARCH)r!r"getr'r@)ZTARGET_TO_PLATr>r>r?get_platformds
rCr MACOSX_DEPLOYMENT_TARGETcCsdadS)zFor testing only. Do not call.N)_syscfg_macosx_verr>r>r>r?_clear_cached_macosx_verusrFcCs.tdkr*ddlm}|tp d}|r*|atS)zGet the version of macOS latched in the Python interpreter configuration.
    Returns the version as a string or None if can't obtain one. Cached.Nr)r4r)rEr=r4get_config_varMACOSX_VERSION_VAR)r4verr>r>r?!get_macosx_target_ver_from_syscfgzsrJcCs^t}tjt}|rZ|rVt|ddgkrVt|ddgkrVdtd||f}t||S|S)aReturn the version of macOS for which we are building.

    The target version defaults to the version in sysconfig latched at time
    the Python interpreter was built, unless overridden by an environment
    variable. If neither source has a value, then None is returned
r$zE mismatch: now "%s" but "%s" during configure; must use 10.3 or later)rJr!r'rBrH
split_versionr)Z
syscfg_verZenv_vermy_msgr>r>r?get_macosx_target_versrOcCsdd|dDS)zEConvert a dot-separated string into a list of numbers for comparisonscSsg|]}t|qSr>)r*).0nr>r>r?
sz!split_version...)split)sr>r>r?rMsrMcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}xd|krf|dqRW|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absolutezpath '%s' cannot end with '/'rS)r!sep
ValueErrorrTremovecurdirpathjoin)pathnamepathsr>r>r?convert_paths	


r_cCstjdkrr>r?change_roots

rec	CsxtrdStjdkrZdtjkrZy$ddl}|tdtjd<Wnttfk
rXYnXdtjkrpt	tjd<dadS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    NrHOMErrPLATr)
_environ_checkedr!r"r'pwdgetpwuidgetuidImportErrorKeyErrorrC)rir>r>r?
check_environs	
rnc
CsTt|fdd}ytd||Stk
rN}ztd|Wdd}~XYnXdS)aPerform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    cSs,|d}||krt||Stj|SdS)Nr)r0strr!r')r/
local_varsvar_namer>r>r?_substs
zsubst_vars.._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rnr,subrmrX)rUrprrvarr>r>r?
subst_varss	ruerror: cCs|t|S)N)ro)excprefixr>r>r?grok_environment_error
srycCs(tdtjatdatdadS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r,r-string
whitespace
_wordchars_re
_squote_re
_dquote_rer>r>r>r?_init_regexs
rcCstdkrt|}g}d}x`|rt||}|}|t|kr\||d|P||tjkr||d|||d	}d}n||dkr|d|||dd}|d}n||dkrt
||}n*||dkrt||}ntd|||dkr"t
d|||\}}|d|||d|d||d}|d	}|t|kr"||Pq"W|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nrr`r'"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)r|rstripr/endlenappendrzr{lstripr}r~RuntimeErrorrXspan)rUwordsposr<rbegr>r>r?split_quoteds@


,
rcCsP|dkr6d|j|f}|dddkr6|ddd}t||sL||dS)aPerform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%rz,)r))__name__rinfo)funcargsmsgverbosedry_runr>r>r?executeYs	
rcCs2|}|dkrdS|dkr dStd|fdS)zConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )yyesttrueon1r)rQnoffalseoff0rzinvalid truth value %rN)r%rX)valr>r>r?	strtoboollsrc	CsXddl}tjrtd|dkr*do(|dk}|s>yddlm}	|	d\}
}Wn.tk
rzddlm}d|d}
}YnXt	d||s|
dk	rt
|
d	}
n
t|d	}
|
B|

d
|

dtt|d|

d
|||||fWdQRXtjg}|t||t||dtt
j|fd||dnddlm}x|D]}|dddkrlqR|dkr|dkrdn|}tjj||d}ntj|}|}|r|dt||krtd||f|t|d}|rt
j||}t
j |}|rR|st!||r@t	d|||sN||||nt"d||qRWdS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.T)mkstempz.py)mktempz$writing byte-compilation script '%s'wz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rzremoving %s)r-r)optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#
subprocessr#dont_write_bytecodertempfilerrlrrrr!fdopenopenwriter\maprepr
executableextendrrrrrY
py_compiler-	importlibutilcache_from_sourcerrXr[basenamerdebug)py_filesoptimizeforcerxbase_dirrrdirectrr	script_fdscript_namerscriptcmdr-fileoptcfiledfile
cfile_baser>r>r?byte_compile|sl$


rcCs|d}d}||S)zReturn a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    
z	
        )rTr\)headerlinesrWr>r>r?
rfc822_escapes
r)rv)Nrr)rrNNrrN)*__doc__r!r,importlib.utilrrzr#distutils.errorsrdistutils.dep_utilrdistutils.spawnrr=rrZ
py35compatrr@rCr&rErHrFrJrOrMr_rerhrnruryr|r}r~rrrrrrr>r>r>r?sJP

=

PK!b*b*._distutils/__pycache__/filelist.cpython-37.pycnu[B

Re_4@sdZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdddZdd	Z
Gd
ddeZejfdd
ZddZdddZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
N)convert_path)DistutilsTemplateErrorDistutilsInternalError)logc@s|eZdZdZdddZddZejfddZd	d
Z	ddZ
d
dZddZddZ
ddZddZdddZdddZdS) FileListaA list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    NcCsd|_g|_dS)N)allfilesfiles)selfwarndebug_printr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/filelist.py__init__ szFileList.__init__cCs
||_dS)N)r)r	rrrr
set_allfiles&szFileList.set_allfilescCst||_dS)N)findallr)r	dirrrr
r)szFileList.findallcCsddlm}|rt|dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)DEBUGN)distutils.debugrprint)r	msgrrrr
r,szFileList.debug_printcCs|j|dS)N)rappend)r	itemrrr
r6szFileList.appendcCs|j|dS)N)rextend)r	itemsrrr
r9szFileList.extendcCs@tttjj|j}g|_x |D]}|jtjj|q WdS)N)sortedmapospathsplitrrjoin)r	Zsortable_filesZ
sort_tuplerrr
sort<s
z
FileList.sortcCsDx>tt|jdddD]$}|j||j|dkr|j|=qWdS)Nr)rangelenr)r	irrr
remove_duplicatesEszFileList.remove_duplicatescCs|}|d}d}}}|dkrTt|dkr  ...cSsg|]}t|qSr)r).0wrrr

Xsz1FileList._parse_template_line..r!)zrecursive-includezrecursive-excludez,'%s' expects    ...cSsg|]}t|qSr)r)r*r+rrr
r,^s)graftprunez#'%s' expects a single zunknown action '%s')rr$rr)r	linewordsactionpatternsrdir_patternrrr
_parse_template_lineMs*


zFileList._parse_template_linecCs\||\}}}}|dkrZ|dd|x&|D]}|j|dds4td|q4Wn|dkr|dd|x&|D]}|j|dds|td	|q|Wn|d
kr|dd|x&|D]}|j|ddstd
|qWnn|dkr8|dd|x*|D]"}|j|ddstd|qWn |dkr|d|d|fx|D](}|j||ds`d}t|||q`Wn|dkr|d|d|fx|D]$}|j||dstd||qWnx|dkr|d||jd|dsXtd|nB|dkrL|d||jd|dsXtd|ntd|dS)Nr'zinclude  r!)anchorz%warning: no files found matching '%s'r(zexclude z9warning: no previously-included files found matching '%s'zglobal-includezglobal-include rz>warning: no files found matching '%s' anywhere in distributionzglobal-excludezglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionzrecursive-includezrecursive-include %s %s)prefixz:warning: no files found matching '%s' under directory '%s'zrecursive-excludezrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r.zgraft z+warning: no directories found matching '%s'r/zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r5rrinclude_patternrr
exclude_patternr)r	r0r2r3rr4patternrrrr
process_template_lineisf










zFileList.process_template_liner!rcCspd}t||||}|d|j|jdkr4|x6|jD],}||r<|d||j|d}q)r	r;r7r8r?r@rAr%rrr
r:s
zFileList.exclude_pattern)NN)r!Nr)r!Nr)__name__
__module____qualname____doc__rrrcurdirrrrrr r&r5r<r9r:rrrr
rs


	M
+rcCs0ttj|dd}dd|D}ttjj|S)z%
    Find all files under 'path'
    T)followlinkscss,|]$\}}}|D]}tj||VqqdS)N)rrr)r*basedirsrfilerrr
	sz#_find_all_simple..)_UniqueDirsfilterrwalkrisfile)rZ
all_uniqueresultsrrr
_find_all_simplesrRc@s$eZdZdZddZeddZdS)rMz
    Exclude previously-seen dirs from walk results,
    avoiding infinite recursion.
    Ref https://bugs.python.org/issue44497.
    cCsF|\}}}t|}|j|jf}||k}|r6|dd=|||S)z
        Given an item from an os.walk result, determine
        if the item represents a unique dir for this instance
        and if not, prevent further traversal.
        N)rstatst_devst_inoadd)r	Z	walk_itemrIrJrrS	candidatefoundrrr
__call__	s



z_UniqueDirs.__call__cCst||S)N)rN)clsrrrr
rNsz_UniqueDirs.filterN)rCrDrErFrYclassmethodrNrrrr
rMsrMcCs6t|}|tjkr.tjtjj|d}t||}t|S)z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	rRrrG	functoolspartialrrelpathrlist)rrZmake_relrrr
rs


rcCs8t|}tj}tjdkrd}d|}td||}|S)zTranslate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    \z\\\\z\1[^%s]z((?sf
PK!^?1?1/_distutils/__pycache__/sysconfig.cpython-37.pycnu[B

Re~T@sdZddlZddlZddlZddlZddlmZdejkZej	
ejZej	
ej
Zej	
ejZej	
ejZdejkrej	ejdZn&ejrej	ej	ejZneZddZeed	dZejd
krddZeeZeeZd
dZeZdZ yesej!Z Wne"k
r$YnXddZ#d-ddZ$d.ddZ%ddZ&ddZ'ddZ(d/ddZ)e*dZ+e*dZ,e*d Z-d0d!d"Z.d#d$Z/da0d%d&Z1d'd(Z2d)d*Z3d+d,Z4dS)1aProvide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        
N)DistutilsPlatformErrorZ__pypy__Z_PYTHON_PROJECT_BASEcCs.x(dD] }tjtj|d|rdSqWdS)N)ZSetupzSetup.localModulesTF)ospathisfilejoin)dfnr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/sysconfig.py_is_python_source_dir,s
r
_homentcCs0|r,tj|tjtjtdr,tS|S)NZPCbuild)rrnormcase
startswithrPREFIX)r	rrr_fix_pcbuild5srcCstrttSttS)N)	_sys_homer
project_baserrrr
_python_build=srcCsdtjddS)zReturn a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dN)sysversion_inforrrrget_python_versionQsrcCs|dkr|rtpt}tjdkrtr:tjdkr:tj|dSt	rh|rJt
pHtStjtdd}tj
|Strpdnd}|tt}tj|d|Stjd	krt	rtj|dtjjtj|d
Stj|dStdtjdS)aReturn the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    Nposix)includesrcdirIncludepypypythonrPCzFI don't know where Python installs its C header files on platform '%s')BASE_EXEC_PREFIXBASE_PREFIXrnameIS_PYPYrrrrpython_buildrrget_config_varnormpathrbuild_flagspathsepr)
plat_specificprefixincdirimplementation
python_dirrrrget_python_incYs*

r3cCstrBtjdkrB|dkrt}|r4tj|dtjdStj|dS|dkrh|r\|rVtpXt	}n|rdt
pft}tjdkr|sz|rttdd}nd}trd	nd
}tj|||t
}|r|Stj|dSn
s\




+
8K





jKPK!JRc

._distutils/__pycache__/dep_util.cpython-37.pycnu[B

Re
@s6dZddlZddlmZddZddZdd	d
ZdS)zdistutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis.N)DistutilsFileErrorcCs`tj|s tdtj|tj|s0dSddlm}t||}t||}||kS)aReturn true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    zfile '%s' does not existr)ST_MTIME)ospathexistsrabspathstatr)sourcetargetrmtime1mtime2r/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/dep_util.pynewersrcCslt|t|krtdg}g}xBtt|D]2}t||||r.||||||q.W||fS)zWalk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    z+'sources' and 'targets' must be same length)len
ValueErrorrangerappend)sourcestargets	n_sources	n_targetsirrrnewer_pairwise srerrorcCstj|sdSddlm}t||}xX|D]L}tj|sb|dkrJn|dkrVq0n|dkrbdSt||}||kr0dSq0WdSdS)aReturn true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    rr)rrignorerN)rrrr	r)rrmissingrtarget_mtimer
source_mtimerrrnewer_group6s 
r )r)__doc__rdistutils.errorsrrrr rrrrs
PK!mW!W!/_distutils/__pycache__/text_file.cpython-37.pycnu[B

Re0@s&dZddlZddlZGdddZdS)ztext_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.Nc@steZdZdZddddddddZdddZd	d
ZddZdd
dZdddZ	dddZ
ddZddZddZ
dS)TextFileaProvides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not.rstrict)strip_commentsskip_blanks	lstrip_ws	rstrip_ws
join_lines
collapse_joinerrorsNcKs|dkr|dkrtdx>|jD]0}||krBt||||q$t|||j|q$Wx&|D]}||jkrbtd|qbW|dkr||n||_||_d|_g|_	dS)zConstruct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
RuntimeErrordefault_optionskeyssetattrKeyErroropenfilenamefilecurrent_linelinebuf)selfrroptionsoptr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/text_file.py__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd|_d|_dS)zyOpen a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor.r)rrN)riorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|dS)ziClose the current file and forget everything we know about it
           (filename, current line number).N)rrrclose)rrrrrrvs
zTextFile.closecCsjg}|dkr|j}||jdt|ttfrD|dt|n|d||t|d|S)Nz, z
lines %d-%d: z	line %d: )rappendr
isinstancelisttuplestrjoin)rmsglineZoutmsgrrr	gen_errorszTextFile.gen_errorcCstd|||dS)Nzerror: )
ValueErrorr()rr&r'rrrerrorszTextFile.errorcCs tjd|||ddS)aPrint (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line.z	warning: 
N)sysstderrwriter()rr&r'rrrwarnsz
TextFile.warncCs|jr|jd}|jd=|Sd}x|j}|dkr:d}|jr|r|d}|dkrXnX|dksp||ddkr|ddkrdpd}|d||}|dkrq$n|d	d}|jr"|r"|dkr|d
|S|j	r|
}||}t|jt
r|jdd|jd<n|j|jdg|_n:|dkr0dSt|jt
rP|jdd|_n|jd|_|jrv|jrv|}n"|jr|
}n|jr|}|dks|dkr|jrq$|jr|ddkr|dd}q$|dddkr|ddd}q$|SdS)
aURead and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not.rN#rr\r+z\#z2continuation line immediately precedes end-of-filez\
)rrreadlinerfindstripreplacer	r/r
lstripr!rr"rrrstripr)rr'Zbuildup_lineposeolrrrr4sf




	



zTextFile.readlinecCs,g}x"|}|dkr|S||qWdS)zWRead and return the list of all logical lines remaining in the
           current file.N)r4r )rlinesr'rrr	readlinesszTextFile.readlinescCs|j|dS)zPush 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead.N)rr )rr'rrr
unreadlineszTextFile.unreadline)NN)N)N)N)__name__
__module____qualname____doc__r
rrrr(r*r/r4r=r>rrrrr
s"9
!	



x
r)rBr,rrrrrrsPK!{ii/_distutils/__pycache__/file_util.cpython-37.pycnu[B

Re@sZdZddlZddlmZddlmZddddZdd
dZdd
dZdddZ	ddZ
dS)zFdistutils.file_util

Utility functions for operating on single files.
N)DistutilsFileError)logcopyingzhard linkingzsymbolically linking)Nhardsym@c
Csd}d}zvyt|d}Wn4tk
rN}ztd||jfWdd}~XYnXtj|ryt|Wn4tk
r}ztd||jfWdd}~XYnXyt|d}Wn4tk
r}ztd||jfWdd}~XYnXxy||}Wn6tk
r*}ztd||jfWdd}~XYnX|s4Py|	|Wqtk
rx}ztd||jfWdd}~XYqXqWWd|r|
|r|
XdS)	a5Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    Nrbzcould not open '%s': %szcould not delete '%s': %swbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)openOSErrorrstrerrorospathexistsunlinkreadwriteclose)srcdstbuffer_sizefsrcfdstebufr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/file_util.py_copy_file_contentssF	$"""*rcCsddlm}ddlm}	m}
m}m}tj	|s %srr)distutils.dep_utilrstatr r!r"r#r
risfilerisdirjoinbasenamedirnamerdebug_copy_actionKeyError
ValueErrorinforsamefilelinkrsymlinkrutimechmod)rr
preserve_modepreserve_timesupdater1verbosedry_runrr r!r"r#diractionstrrr	copy_fileCsT!





r=cCsddlm}m}m}m}m}ddl}	|dkr:td|||rB|S||sVt	d|||rrt
j|||}n||rt	d||f|||st	d||fd	}
yt

||WnPtk
r
}z0|j\}}
||	jkrd
}
nt	d|||
fWdd}~XYnX|
rt|||dyt
|Wnhtk
r}zH|j\}}
yt
|Wntk
rpYnXt	d
||||
fWdd}~XYnX|S)a%Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    r)rr&r'r)r*Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r8zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)os.pathrr&r'r)r*errnorr/rr
rr(renamerargsEXDEVr=r)rrr8r9rr&r'r)r*r?copy_itrnummsgrrr	move_filesR

"
"rFcCs:t|d}z x|D]}||dqWWd|XdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    w
N)r
rr)filenamecontentsflinerrr
write_files


rM)r)rrrNrr)rr)__doc__r
distutils.errorsr	distutilsrr,rr=rFrMrrrrs
3
c
=PK!66?6?7_distutils/command/__pycache__/build_ext.cpython-37.pycnu[B

Re{@sdZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZdd
lmZedZddZGdddeZdS)zdistutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).N)Command)*)customize_compilerget_python_version)get_config_h_filename)newer_group)	Extension)get_platform)log)
py37compat)	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|dS)Nr)show_compilers)distutils.ccompilerr)rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.pyrsrc@seZdZdZdejZdddddefdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%Zd&d'Z
d(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zejd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdDdEZdFdGZd"S)H	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=bz(directory for compiled extension modules)zbuild-temp=tz1directory for temporary files (build by-products)z
plat-name=pz>platform name to cross-compile for, if supported (default: %s))inplaceiziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link withz
library-dirs=Lz.directories to search for external C libraries)zrpath=Rz7directories to search for shared C libraries at runtime)z
link-objects=Oz2extra explicit link objects to include in the link)debuggz'compile/link with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)zswig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)userNz#add user include, library and rpathrrr!zswig-cppr%z
help-compilerNzlist available compilerscCsd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)
extensions	build_lib	plat_name
build_temprpackageinclude_dirsdefineundef	librarieslibrary_dirsrpathlink_objectsrr!compilerswigswig_cpp	swig_optsr%parallel)selfrrrinitialize_optionsks*zbuild_ext.initialize_optionsc

Csddlm}|ddddddd	d
|jdkr8|jj|_|jj|_|}|jdd}|j	dkrn|jj	pjg|_	t
|j	tr|j	t
j|_	tjtjkr|j	t
jtjd
|j	|t
jj||kr|j	|t
jj|d|d|jdkrg|_|jdkrg|_nt
|jtr:|jt
j|_|jdkrNg|_nt
|jtrl|jt
j|_t
jdkrh|jt
jtjdtjtjkr|jt
jtjd|jrt
j|jd|_nt
j|jd|_|j	t
jtt tdd}|r|j||j!dkr*d}n|j!dd}t
jtjd}|r\t
j||}|j|tj"dddkr|j#s|jt
jtjddt$dn|jd|%dr|j#s|j|%dn|jd|j&r|j&d }d!d"|D|_&|j'r"|j'd |_'|j(dkr6g|_(n|j(d#|_(|j)rt
jt*d
}t
jt*d}	t
j+|r|j	|t
j+|	r|j|	|j|	t
|j,tryt-|j,|_,Wnt.k
rt/d$YnXdS)%Nr)	sysconfigbuild)r'r')r)r))r2r2)rr)r!r!)r6r6)r(r(r)
plat_specificincluder.r1ntZlibsZDebugZRelease_homewin32ZPCbuildcygwinlibpythonconfig.Py_ENABLE_SHAREDLIBDIR,cSsg|]}|dfqS)1r).0symbolrrr
sz.build_ext.finalize_options.. zparallel should be an integer)0	distutilsr9set_undefined_optionsr*distributionext_packageext_modulesr&get_python_incr+
isinstancestrsplitospathsepsysexec_prefixbase_exec_prefixappendpathjoinextendensure_string_listr.r/r0nameprefixrr)dirnamergetattrr(platformpython_buildrget_config_varr,r-r5r%r
isdirr6int
ValueErrorDistutilsOptionError)
r7r9Z
py_includeZplat_py_include	_sys_homesuffixZnew_libZdefinesZuser_includeZuser_librrrfinalize_optionss






zbuild_ext.finalize_optionscCsrddlm}|jsdS|jrL|d}|j|p:g|j	
|j||j|j
|j|jd|_t|jtjdkr|jtkr|j|j|jdk	r|j|j|jdk	rx |jD]\}}|j||qW|jdk	rx|jD]}|j|qW|jdk	r|j|j|j	dk	r2|j|j	|jdk	rL|j|j|j dk	rf|j!|j |"dS)Nr)new_compiler
build_clib)r2verbosedry_runr!r=)#rrpr&rQhas_c_librariesget_finalized_commandr.r`Zget_library_namesr/r]rqr2rrrsr!rrXrbr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objectsbuild_extensions)r7rprqrbvaluemacrorrrruns>





z
build_ext.runc
Cst|tstdxjt|D]\\}}t|tr4qt|trJt|dkrRtd|\}}td|t|t	rzt
|stdt|tstdt||d}x*dD]"}|
|}|d	k	rt|||qW|
d
|_d|krtd|
d
}|rtg|_g|_xj|D]b}	t|	tr,t|	dks4tdt|	dkrT|j|	dnt|	dkr|j|	qW|||<qWd	S)aEnsure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instanceszMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)sources)r+r/r.
extra_objectsextra_compile_argsextra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supportedmacros)rrzz9'macros' element of build info dict must be 1- or 2-tuplerr)rUlistDistutilsSetupError	enumeratertuplelenr
warnrVextension_name_rematchdictgetsetattrruntime_library_dirs
define_macrosundef_macrosr])
r7r&rextext_nameZ
build_infokeyvalrrxrrrcheck_extensions_listWsP










zbuild_ext.check_extensions_listcCs0||jg}x|jD]}||jqW|S)N)rr&r`r{)r7	filenamesrrrrget_source_filess
zbuild_ext.get_source_filescCs6||jg}x |jD]}|||jqW|S)N)rr&r]get_ext_fullpathrb)r7outputsrrrrget_outputss
zbuild_ext.get_outputscCs(||j|jr|n|dS)N)rr&r6_build_extensions_parallel_build_extensions_serial)r7rrrrvs
zbuild_ext.build_extensionscsj}jdkrt}yddlm}Wntk
r@d}YnX|dkrVdS||dTfddjD}x6tj|D]&\}}	||
WdQRXqWWdQRXdS)NTr)ThreadPoolExecutor)max_workerscsg|]}j|qSr)Zsubmitbuild_extension)rKr)executorr7rrrMsz8build_ext._build_extensions_parallel..)r6rX	cpu_countconcurrent.futuresrImportErrorrr&zip_filter_build_errorsresult)r7workersrZfuturesrZfutr)rr7rrs 


z$build_ext._build_extensions_parallelc
Cs4x.|jD]$}||||WdQRXqWdS)N)r&rr)r7rrrrrsz"build_ext._build_extensions_serialc
csTy
dVWnDtttfk
rN}z |js*|d|j|fWdd}~XYnXdS)Nz"building extension "%s" failed: %s)CCompilerErrorDistutilsErrorCompileErroroptionalrrb)r7rerrrrs
zbuild_ext._filter_build_errorsc
CsT|j}|dkst|ttfs*td|jt|}||j}||j}|j	slt
||dsltd|jdSt
d|j|||}|jpg}|jdd}x|jD]}||fqW|jj||j||j|j||jd}|dd|_|jr||j|jpg}|jp|j|}	|jj|||||j|j ||!||j|j|	d
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)
output_dirrr+rextra_postargsdepends)r.r/rrexport_symbolsrr)Ztarget_lang)"r{rUrrrrbsortedrrr!rr
rinfoswig_sourcesr}rrr]r2compiler)r+Z_built_objectsr|r`r~languageZdetect_languageZlink_shared_object
get_librariesr/rget_export_symbols)
r7rr{ext_pathr
extra_argsrr-ZobjectsrrrrrsN



zbuild_ext.build_extensioncCs0g}g}i}|jrtd|js6d|jks6d|jkr





zbuild_ext.swig_sourcescCs`tjdkrdStjdkrNxBdD]&}tjd|d}tj|r|SqWdSntdtjdS)	zReturn the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        posixr3r=)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rXrbr^r_isfileDistutilsPlatformError)r7versfnrrrris


zbuild_ext.find_swigcCs||}|d}||d}|jsRtjj|dd|g}tj|j|Sd|dd}|d}tj	|
|}tj||S)zReturns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rFrNrbuild_py)get_ext_fullnamerWget_ext_filenamerrXr^r_r'ruabspathZget_package_dir)r7rfullnameZmodpathfilenamer*rpackage_dirrrrrs


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrF)r*)r7rrrrrs
zbuild_ext.get_ext_fullnamecCs.ddlm}|d}|d}tjj||S)zConvert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r)rhrF
EXT_SUFFIX)distutils.sysconfigrhrWrXr^r_)r7rrhrZ
ext_suffixrrrrs
zbuild_ext.get_ext_filenamecCs||jdd}y|dWn0tk
rNd|dddd}Yn
Xd|}d	|}||jkrv|j||jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        rFrasciiZU_punycode-__ZPyInit)rbrWencodeUnicodeEncodeErrorreplacedecoderr])r7rrbrnZ
initfunc_namerrrrs"
zbuild_ext.get_export_symbolscCstjdkr^ddlm}t|j|sd}|jr4|d}|tjd?tjd?d@f}|j|gSndd	l	m
}d
}|drttdrd
}ns$PK!*w!w!6_distutils/command/__pycache__/register.cpython-37.pycnu[B

Re-@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGddde	Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
N)warn)
PyPIRCCommand)*)logc@seZdZdZejddgZejdddgZddd	fgZd
dZdd
Z	ddZ
ddZddZddZ
ddZddZddZdddZdS) registerz7register the distribution with the Python package index)zlist-classifiersNz list the valid Trove classifiers)strictNzBWill stop the registering if the meta-data are not fully compliantverifyzlist-classifiersrcheckcCsdS)NT)selfr
r
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/register.pyzregister.cCst|d|_d|_dS)Nr)rinitialize_optionslist_classifiersr)rr
r
rrs
zregister.initialize_optionscCs*t|d|jfdd}||jjd<dS)Nr)r)rrestructuredtextr	)rfinalize_optionsrdistributioncommand_options)r
check_optionsr
r
rr$s
zregister.finalize_optionscCsX||x|D]}||qW|jr<|n|jrL|n|dS)N)	r_set_configget_sub_commandsrun_commanddry_runverify_metadatarclassifiers
send_metadata)rcmd_namer
r
rrun+s

zregister.runcCs8tdt|jd}||j|_d|_|dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr	rN)rPendingDeprecationWarningrget_command_objensure_finalizedrrr)rr	r
r
rcheck_metadata:szregister.check_metadatacCsz|}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        usernamepassword
repositoryrealmTpypiz%s not found in .pypircFN)_read_pypircr$r%r&r'
has_configDEFAULT_REPOSITORY
ValueError)rconfigr
r
rrDs




zregister._set_configcCs*|jd}tj|}t||dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r&urllibrequesturlopenrinfo_read_pypi_response)rurlresponser
r
rrUs
zregister.classifierscCs&||d\}}td||dS)zF Send the metadata to the package index server to be checked.
        rzServer response (%s): %sN)post_to_serverbuild_post_datarr1)rcoderesultr
r
rr\szregister.verify_metadatac
Cs|jrd}|j}|j}nd}d}}d}x:||krf|dtjt}|sTd}q.||kr.tdq.W|dkr|x|std}qtWx|st		d}qWt
j}t
j
|jd	}||j|||||d
|\}}|d||ftj|dkr|jr||j_nj|d
tj|d|tjd}x&|dkr\td}|s8d}q8W|dkr|||n|dkrddi}	d|	d<|	d<|	d<d|	d<x|	dstd|	d<qWx|	d|	dkrNx|	dst		d|	d<qWx|	dst		d|	d<qW|	d|	dkrd|	d<d|	d<tdqWx|	dsltd|	d<qRW||	\}}|dkrtd||ntdtd nT|d!krdd"i}	d|	d<x|	dstd#|	d<qW||	\}}td||dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        1xz1 2 3 4zWe need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitzServer response (%s): %szAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)XZynzSave your login (y/N)?ny2z:actionusernamer%emailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.3Zpassword_resetzYour email address: )r*r$r%splitannouncerINFOinputprintgetpassr.r/HTTPPasswordMgrparseurlparser&add_passwordr'r5r6r_get_rc_filelower
_store_pypircr1)
rchoicer$r%choicesauthhostr7r8datar
r
rrcs











zregister.send_metadatacCs|jj}|d||||||||	|
|||
|||d}|ds|ds|drd|d<|S)Nz1.0)z:actionmetadata_versionrBversionsummaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformrdownload_urlprovidesrequires	obsoletesrarbrcz1.1rW)rmetadataget_nameget_versionget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes)ractionmetarVr
r
rr6s*zregister.build_post_dataNc
Csd|kr$|d|d|jftjd}d|}|d}t}x|D]\}}t|tgtdfkrp|g}xZ|D]R}t|}|	||	d||	d|	||rv|d	d
krv|	dqvWqJW|	||	d|
d}d
|tt|d}	t
j|j||	}
t
jt
jj|d}d}y||
}Wnxt
jjk
r}
z"|jrl|
j}|
j|
jf}Wdd}
~
XYnJt
jjk
r}
zdt|
f}Wdd}
~
XYnX|jr||}d}|jrdd|df}||tj|S)zC Post a query to the server, and return a string response.
        rBzRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--r
z*
Content-Disposition: form-data; name="%s"z



zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)password_mgrr;Ni)r<OKzK---------------------------------------------------------------------------)rFr&rrGioStringIOitemstypestrwritegetvalueencodelenr.r/Requestbuild_openerHTTPBasicAuthHandleropenerror	HTTPError
show_responsefpreadr7msgURLErrorr2join)rrVrTboundaryZsep_boundaryZend_boundarybodykeyvalueheadersreqopenerr8err
r
rr5sV







zregister.post_to_server)N)__name__
__module____qualname__r]ruser_optionsboolean_optionssub_commandsrrrr#rrrrr6r5r
r
r
rrs"
zr)__doc__rJr{urllib.parser.urllib.requestwarningsrdistutils.corerdistutils.errors	distutilsrrr
r
r
rsPK!}>_distutils/command/__pycache__/install_egg_info.cpython-37.pycnu[B

Re+
@sddZddlmZddlmZmZddlZddlZddlZGdddeZ	ddZ
d	d
ZddZdS)
zdistutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.)Command)logdir_utilNc@s:eZdZdZdZdgZddZddZdd	Zd
dZ	dS)
install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=dzdirectory to install tocCs
d|_dS)N)install_dir)selfr	/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/install_egg_info.pyinitialize_optionssz#install_egg_info.initialize_optionscCsb|dddtt|jtt|jftjdd}t	j
|j||_
|j
g|_dS)Ninstall_lib)rrz%s-%s-py%d.%d.egg-info)set_undefined_optionsto_filename	safe_namedistributionget_namesafe_versionget_versionsysversion_infoospathjoinrtargetoutputs)rbasenamer	r	r
finalize_optionssz!install_egg_info.finalize_optionsc	Cs|j}tj|r0tj|s0tj||jdnNtj|rV|	tj
|jfd|n(tj|js~|	tj|jfd|jt
d||jst|ddd}|jj|WdQRXdS)N)dry_runz	Removing z	Creating z
Writing %swzUTF-8)encoding)rrrisdirislinkrremove_treerexistsexecuteunlinkrmakedirsrinfoopenrmetadatawrite_pkg_file)rrfr	r	r
run szinstall_egg_info.runcCs|jS)N)r)rr	r	r
get_outputs.szinstall_egg_info.get_outputsN)
__name__
__module____qualname____doc__descriptionuser_optionsrrr-r.r	r	r	r
rs
rcCstdd|S)zConvert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    z[^A-Za-z0-9.]+-)resub)namer	r	r
r6srcCs|dd}tdd|S)zConvert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
     .z[^A-Za-z0-9.]+r5)replacer6r7)versionr	r	r
r>srcCs|ddS)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r5_)r;)r8r	r	r
rHsr)
r2
distutils.cmdr	distutilsrrrrr6rrrrr	r	r	r
s+
PK!昲Q!Q!;_distutils/command/__pycache__/bdist_wininst.cpython-37.pycnu[B

Re>@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.N)Command)get_platform)remove_tree)*)get_python_version)logc
seZdZdZddddefdddd	d
ddd
dddg
ZddddgZejdkZ	fddZ
ddZddZddZ
ddZd'd!d"Zd#d$Zd%d&ZZS)(
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))z	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)zno-target-compilecz/do not compile .py to .pyc on the target system)zno-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)zbitmap=bz>bitmap to use for the installer instead of python-powered logo)ztitle=tz?title to display on the installer background instead of default)z
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nzspecify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACz	keep-tempzno-target-compilezno-target-optimizez
skip-buildwin32cs tj||tdtddS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead)super__init__warningswarnDeprecationWarning)selfargskw)	__class__/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/bdist_wininst.pyr?szbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
	bdist_dir	plat_name	keep_tempno_target_compileno_target_optimizetarget_versiondist_dirbitmaptitle
skip_buildinstall_scriptpre_install_scriptuser_access_control)rrrrinitialize_optionsEsz bdist_wininst.initialize_optionscCs|dd|jdkrR|jr6|jr6|jd}|j|_|dj}tj	
|d|_|js^d|_|js|jrt
}|jr|j|krtd|f||_|ddd|jrx2|jjD]}|jtj	|krPqWtd|jdS)	Nbdist)r&r&ZwininstzMtarget version can only be %s, or the '--skip-build' option must be specified)r#r#)rrz(install_script '%s' not found in scripts)set_undefined_optionsrr&rdistributionget_command_objget_finalized_command
bdist_baseospathjoinr"has_ext_modulesrDistutilsOptionErrorr'scriptsbasename)rr+r1Z
short_versionscriptrrrfinalize_optionsUs4

zbdist_wininst.finalize_optionsc
Cstjdkr&|js|jr&td|js6|d|jddd}|j	|_
|j|_d|_|j|_|d}d|_
d|_|jr|j}|s|jstd	d
tjdd}d|j|f}|d}tj|jd
||_x4dD],}|}|dkr|d}t|d||qWtd|j	|tjdtj|j	d|tjd=ddlm }|}	|j!}
|j"|	d|j	d}|#||
|j$|jrt%}nd}|jj&'d||(|
ft)d|t*||j+st,|j	|j-ddS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platformbuildinstall)reinit_subcommandsrinstall_libz Should have already checked thisz%d.%drz.%s-%slib)purelibplatlibheadersr7datarCz/Include/$dist_nameinstall_zinstalling to %sZPURELIB)mktempzip)root_diranyrzremoving temporary file '%s')dry_run).sysplatformr.r5has_c_librariesDistutilsPlatformErrorr&run_commandreinitialize_commandrrootwarn_dirrcompileoptimizer"AssertionErrorversion_infor0r2r3r4
build_base	build_libuppersetattrrinfoensure_finalizedinsertruntempfilerFget_fullnamemake_archive
create_exer$r
dist_filesappendget_installer_filenamedebugremoverrrJ)
rr<r?r"plat_specifierr;keyvaluerFZarchive_basenamefullnamearcnameZ	pyversionrrrr^{sf












zbdist_wininst.runcCs^g}|jj}|d|jpdd}dd}xJdD]B}t||d}|r2|d|||f}|d|||fq2W|d	|jr|d
|j|d|||d|j|d
|j|j	r|d|j	|j
r|d|j
|jp
|j}|d||ddl
}ddl}	d||
|	jf}
|d|
d|S)Nz
[metadata]r,
cSs|ddS)Nrmz\n)replace)srrrescapesz)bdist_wininst.get_inidata..escape)authorauthor_emaildescription
maintainermaintainer_emailnameurlversionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r.metadatardlong_descriptiongetattr
capitalizer'r r!r"r)r%r`time	distutilsctime__version__r4)rlinesryr[rprvrDr%r}r~Z
build_inforrrget_inidatas:


zbdist_wininst.get_inidataNc
CsHddl}||j|}||}|d||r`t|d}|}WdQRXt|}	nd}	t|d}
|
	|
|r|
	|t|tr|
d}|d}|jrt|jddd	}|
d}WdQRX||d
}n|d}|
	||ddt||	}
|
	|
t|d}|
	|WdQRXWdQRXdS)
Nrzcreating %srbwbmbcsrzlatin-1)encodings
z







zbdist_wininst.create_execCsD|jr&tj|jd||j|jf}ntj|jd||jf}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r"r2r3r4r#r)rrkrrrrre1s

z$bdist_wininst.get_installer_filenamec	Cs t}|jrl|j|krl|jdkr&d}q|jdkr6d}q|jdkrFd}q|jdkrVd}q|jdkrfd	}qd
}n@yddlm}Wntk
rd
}YnX|d
d}|d}tjt	}|j
dkr|j
dddkr|j
dd}nd}tj|d||f}t|d}z|
S|XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)CRT_ASSEMBLY_VERSION.z.0rwinr,zwininst-%s%s.exer)rr"msvcrtrImportError	partitionr2r3dirname__file__rr4rrclose)	rZcur_versionZbvrmajor	directoryZsfixfilenamerrrrr>s8	






zbdist_wininst.get_exe_bytes)N)__name__
__module____qualname__rsruser_optionsboolean_optionsrKrLZ_unsupportedrr*r:r^rrbrer
__classcell__rr)rrrs6
&Q.
7
r)__doc__r2rKrdistutils.corerdistutils.utilrdistutils.dir_utilrdistutils.errorsdistutils.sysconfigrr~rrrrrrsPK!!4_distutils/command/__pycache__/upload.cpython-37.pycnu[B

Re@sdZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZdd	lmZeed
deeddeeddd
ZGdddeZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
N)standard_b64encode)urlopenRequest	HTTPError)urlparse)DistutilsErrorDistutilsOptionError)
PyPIRCCommand)spawn)logmd5sha256blake2b)Z
md5_digestZ
sha256_digestZblake2_256_digestc@sJeZdZdZejddgZejdgZddZddZd	d
Z	ddZ
d
S)uploadzupload binary package to PyPI)signszsign files to upload using gpg)z	identity=izGPG identity used to sign filesrcCs,t|d|_d|_d|_d|_d|_dS)NrF)r	initialize_optionsusernamepassword
show_responseridentity)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/upload.pyr)s
zupload.initialize_optionscCsrt||jr|jstd|}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr
repositoryrealm)r	finalize_optionsrrr_read_pypircrrrrdistribution)rconfigrrrr1s




zupload.finalize_optionscCs>|jjsd}t|x$|jjD]\}}}||||qWdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))r 
dist_filesrupload_file)rmsgcommand	pyversionfilenamerrrrunCs
z
upload.runc"Cst|j\}}}}}}	|s"|s"|	r0td|j|dkrDtd||jr|ddd|g}
|jrnd|jg|
dd<t|
|jd	t|d
}z|}Wd|	X|j
j}
dd|
|

tj||f||d
|
|
|
|
|
|
|
|
|
|
|
|
|
d}d|d<xPtD]D\}}|dkrFq0y|| ||<Wnt!k
rpYnXq0W|jrt|dd
"}tj|d|f|d<WdQRX|j"d|j#$d}dt%|&d}d}d|$d}|d}t'(}x|D]\}}d|}t)|t*s,|g}xr|D]j}t+|t,kr^|d|d7}|d}nt-|$d}|.||.|$d|.d|.|q2Wq
W|.||/}d||jf}|0|t1j2d |t-t3||d!}t4|j||d"}yt5|}|6}|j7}Wnft8k
rF} z| j9}| j7}Wdd} ~ XYn8t:k
r|} z|0t-| t1j;Wdd} ~ XYnX|d#kr|0d$||ft1j2|j<r|=|}!d%>d&|!d&f}|0|t1j2n"d'||f}|0|t1j;t?|dS)(NzIncompatible url %s)httphttpszunsupported schema Zgpgz
--detach-signz-az--local-user)dry_runrbZfile_upload1z1.0)z:actionZprotocol_versionnameversioncontentZfiletyper&metadata_versionsummaryZ	home_pageauthorauthor_emaillicensedescriptionkeywordsplatformclassifiersdownload_urlprovidesrequires	obsoletesrcommentz.ascZ
gpg_signature:asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"rzutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-length
Authorization)dataheaderszServer response (%s): %s
zK---------------------------------------------------------------------------zUpload failed (%s): %s)@rrAssertionErrorrrr
r,openreadcloser metadataget_nameget_versionospathbasenameget_descriptionget_urlget_contactget_contact_emailget_licenceget_long_descriptionget_keywords
get_platformsget_classifiersget_download_urlget_providesget_requires
get_obsoletes_FILE_CONTENT_DIGESTSitems	hexdigest
ValueErrorrrencoderdecodeioBytesIO
isinstancelisttypetuplestrwritegetvalueannouncerINFOlenrrgetcoder$rcodeOSErrorERRORr_read_pypi_responsejoinr)"rr%r&r'Zschemanetlocurlparamsquery	fragmentsZgpg_argsfr1metarDZdigest_namedigest_cons	user_passauthboundaryZsep_boundaryZend_boundarybodykeyvaluetitler$rErequestresultstatusreasonetextrrrr#Ks












zupload.upload_fileN)__name__
__module____qualname__r7r	user_optionsboolean_optionsrrr(r#rrrrrsr)__doc__rOrehashlibbase64rurllib.requestrrrurllib.parserdistutils.errorsrrdistutils.corer	distutils.spawnr
	distutilsrgetattrr_rrrrrs

PK!D=_distutils/command/__pycache__/install_scripts.cpython-37.pycnu[B

Re@sDdZddlZddlmZddlmZddlmZGdddeZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.N)Command)log)ST_MODEc@sLeZdZdZddddgZddgZdd	Zd
dZdd
ZddZ	ddZ
dS)install_scriptsz%install scripts (Python or otherwise))zinstall-dir=dzdirectory to install scripts to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))z
skip-buildNzskip the build stepsrz
skip-buildcCsd|_d|_d|_d|_dS)Nr)install_dirr	build_dir
skip_build)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/install_scripts.pyinitialize_optionssz"install_scripts.initialize_optionscCs |dd|dddddS)Nbuild)
build_scriptsrinstall)rr
)rr)rr)set_undefined_options)r
rrrfinalize_options!s
z install_scripts.finalize_optionscCs|js|d||j|j|_tjdkrxT|D]H}|j	rNt
d|q6t|t
dBd@}t
d||t||q6WdS)Nrposixzchanging mode of %simizchanging mode of %s to %o)rrun_command	copy_treerr
outfilesosnameget_outputsdry_runrinfostatrchmod)r
filemoderrrrun)s

zinstall_scripts.runcCs|jjp
gS)N)distributionscripts)r
rrr
get_inputs8szinstall_scripts.get_inputscCs
|jpgS)N)r)r
rrrr;szinstall_scripts.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrr#r&rrrrrrsr)	__doc__rdistutils.corer	distutilsrrrrrrrrs
PK!]6_distutils/command/__pycache__/__init__.cpython-37.pycnu[B

Re@s2dZddddddddd	d
ddd
ddddddgZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.buildbuild_py	build_ext
build_clib
build_scriptscleaninstallinstall_libinstall_headersinstall_scriptsinstall_datasdistregisterbdist
bdist_dumb	bdist_rpm
bdist_wininstcheckuploadN)__doc____all__rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/__init__.pys&PK!sPK!`)()(4_distutils/command/__pycache__/config.cpython-37.pycnu[B

Re=3@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	ZGd
ddeZddd
Z
dS)adistutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c	@seZdZdZdddddddd	d
g	ZddZd
dZddZddZddZ	ddZ
ddZddZddZ
d0dd Zd1d!d"Zd2d#d$Zd3d%d&Zd4d'd(Zd5d*d+Zdddgfd,d-Zd6d.d/ZdS)7configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z
libraries=lz!external C libraries to link with)z
library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N)compilerccinclude_dirs	librarieslibrary_dirsr
dump_source
temp_files)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/config.pyinitialize_options3szconfig.initialize_optionscCs|jdkr|jjpg|_nt|jtr6|jtj|_|jdkrHg|_nt|jtr^|jg|_|jdkrpg|_nt|jtr|jtj|_dS)N)	rdistribution
isinstancestrsplitospathseprr)rrrrfinalize_optionsBs



zconfig.finalize_optionscCsdS)Nr)rrrrrunRsz
config.runcCszddlm}m}t|j|sv||j|jdd|_t|j|jrN|j|j|j	rb|j
|j	|jrv|j|jdS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)	CCompilernew_compilerr)rdry_runforceN)
distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr_check_compilerYs
zconfig._check_compilerc	Cspdt|}t|dP}|rBx|D]}|d|q"W|d|||ddkrb|dWdQRX|S)NZ_configtestwz#include <%s>

)LANG_EXTopenwrite)rbodyheaderslangfilenamefileheaderrrr_gen_temp_sourcefileks


zconfig._gen_temp_sourcefilecCs<||||}d}|j||g|jj|||d||fS)Nz
_configtest.i)r)r4rextendr
preprocess)rr.r/rr0srcoutrrr_preprocessws
zconfig._preprocesscCs\||||}|jr"t|d||j|g\}|j||g|jj|g|d||fS)Nzcompiling '%s':)r)r4r	dump_filerZobject_filenamesrr5compile)rr.r/rr0r7objrrr_compile~szconfig._compilec
Csr|||||\}}tjtj|d}	|jj|g|	|||d|jjdk	r\|	|jj}	|j	|	|||	fS)Nr)rrZtarget_lang)
r=rpathsplitextbasenamerZlink_executableZ
exe_extensionrappend)
rr.r/rrrr0r7r<progrrr_linkszconfig._linkc	GsX|s|j}g|_tdd|x0|D](}yt|Wq(tk
rNYq(Xq(WdS)Nzremoving: %s )rrinfojoinrremoveOSError)r	filenamesr1rrr_cleans
z
config._cleanNrcCsRddlm}|d}y|||||Wn|k
rDd}YnX||S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        r)CompileErrorTF)r&rKr'r9rJ)rr.r/rr0rKokrrrtry_cpps
zconfig.try_cppc	Cs|||||||\}}t|tr0t|}t|2}d}	x&|}
|
dkrRP||
r@d}	Pq@WWdQRX|	|	S)aConstruct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        FTN)
r'r9rrrer;r,readlinesearchrJ)rpatternr.r/rr0r7r8r2matchlinerrr
search_cpps	



zconfig.search_cppcCsdddlm}|y|||||d}Wn|k
rDd}YnXt|rRdpTd||S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        r)rKTFzsuccess!zfailure.)r&rKr'r=rrErJ)rr.r/rr0rKrLrrrtry_compiles
zconfig.try_compilec
	Cspddlm}m}|y|||||||d}	Wn||fk
rPd}	YnXt|	r^dp`d||	S)zTry to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        r)rK	LinkErrorTFzsuccess!zfailure.)r&rKrWr'rCrrErJ)
rr.r/rrrr0rKrWrLrrrtry_links


zconfig.try_linkc

Csddlm}m}|y.|||||||\}	}
}||gd}Wn||tfk
rdd}YnXt|rrdptd|	|S)zTry to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        r)rKrWTFzsuccess!zfailure.)
r&rKrWr'rCspawnrrrErJ)
rr.r/rrrr0rKrWr7r<ZexerLrrrtry_runs

zconfig.try_runrc	Cst|g}|r|d||d|r<|d|n|d||dd|d}||||||S)aDetermine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;}r))r'rArFrX)	rfuncr/rrrdeclcallr.rrr
check_funcs


zconfig.check_funccCs ||d|||g||S)aDetermine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r'rX)rZlibraryrr/rZother_librariesrrr	check_lib4s

zconfig.check_libcCs|jd|g|dS)zDetermine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r.r/r)rM)rr3rrr0rrrcheck_headerBs
zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)__name__
__module____qualname__descriptionuser_optionsrr r!r'r4r9r=rCrJrMrUrVrXrZr_r`rarrrrrsB	






rcCsJ|dkrtd|n
t|t|}zt|Wd|XdS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrEr,readclose)r1headr2rrrr:Ks
r:)N)__doc__rrOdistutils.corerdistutils.errorsrdistutils.sysconfigr	distutilsrr+rr:rrrr
s
8PK!j73_distutils/command/__pycache__/bdist.cpython-37.pycnu[B

Re@sHdZddlZddlmZddlTddlmZddZGdd	d	eZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).N)Command)*)get_platformcCsTddlm}g}x,tjD]"}|d|dtj|dfqW||}|ddS)zFPrint list of available formats (arguments to "--format" option).
    r)FancyGetoptzformats=Nz'List of available distribution formats:)distutils.fancy_getoptrbdistformat_commandsappendformat_command
print_help)rformatsformatZpretty_printerr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/bdist.pyshow_formatssrc
@seZdZdZddddefdddd	d
gZdgZdd
defgZdZ	dddZ
dddddddddg	Zddddddd d!d"d#	Zd$d%Z
d&d'Zd(d)Zd
S)*rz$create a built (binary) distribution)zbdist-base=bz4temporary directory for creating built distributionsz
plat-name=pz;platform name to embed in generated filenames (default: %s))zformats=Nz/formats for distribution (comma-separated list))z	dist-dir=dz=directory to put final built distributions in [default: dist])z
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]z
skip-buildzhelp-formatsNz$lists available distribution formats)	bdist_rpmgztarzip)posixntrpmbztarxztarztartarwininstmsi)rzRPM distribution)
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)
bdist_base	plat_namer
dist_dir
skip_buildgroupowner)selfrrrinitialize_optionsQszbdist.initialize_optionscCs|jdkr(|jrt|_n|dj|_|jdkrT|dj}tj|d|j|_|	d|j
dkry|jtjg|_
Wn"t
k
rtdtjYnX|jdkrd|_dS)Nbuildzbdist.r
z;don't know how to create built distributions on platform %sdist)r&r(rget_finalized_commandr%
build_baseospathjoinensure_string_listr
default_formatnameKeyErrorDistutilsPlatformErrorr')r+r0rrrfinalize_optionsZs$





zbdist.finalize_optionsc	Csg}xH|jD]>}y||j|dWqtk
rHtd|YqXqWxztt|jD]h}||}||}||jkr|j||_	|dkr|j
|_
|j|_|||ddkrd|_|
|q^WdS)Nrzinvalid format '%s'r#r)r
r
rr7DistutilsOptionErrorrangelenreinitialize_commandno_format_optionrr*r)Z	keep_temprun_command)r+commandsricmd_nameZsub_cmdrrrrunvs"

z	bdist.run)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsr>r5r	rr,r9rCrrrrrs<

	r)	__doc__r1distutils.corerdistutils.errorsdistutils.utilrrrrrrrsPK!c׍993_distutils/command/__pycache__/sdist.cpython-37.pycnu[B

Re=J@sdZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZddZGdddeZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).N)glob)warn)Command)dir_util)	file_util)archive_util)TextFile)FileList)log)convert_path)DistutilsTemplateErrorDistutilsOptionErrorcCsdddlm}ddlm}g}x,|D] }|d|d||dfq&W|||ddS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)FancyGetopt)ARCHIVE_FORMATSzformats=Nz.List of available source distribution formats:)distutils.fancy_getoptrZdistutils.archive_utilrkeysappendsort
print_help)rrformatsformatr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/sdist.pyshow_formatssrc@s"eZdZdZddZdddddd	d
ddd
ddddgZddddddgZdddefgZdddZ	defgZ
dZddZd d!Z
d"d#Zd$d%Zd&d'Zd(d)Zed*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Zdd?Zd@dAZdBdCZdDdEZ dFdGZ!dHdIZ"dS)Jsdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)metadata_check)selfrrrchecking_metadata(szsdist.checking_metadata)z	template=tz5name of manifest template file [default: MANIFEST.in])z	manifest=mz)name of manifest file [default: MANIFEST])zuse-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])zno-defaultsNz"don't include the default file set)pruneNzspecifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])zno-pruneNz$don't automatically exclude anything)z
manifest-onlyozEjust regenerate the manifest and then stop (implies --force-manifest))zforce-manifestfzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)zformats=Nz6formats for source distribution (comma-separated list))z	keep-tempkz@keep the distribution tree around after creating archive file(s))z	dist-dir=dzFdirectory to put the source distribution archive(s) in [default: dist])zmetadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]zuse-defaultsr!z
manifest-onlyzforce-manifestz	keep-tempzmetadata-checkzhelp-formatsNz#list available distribution formats)zno-defaultszno-prunecheck)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)Nrgztar)
templatemanifestuse_defaultsr!
manifest_onlyZforce_manifestr	keep_tempdist_dir
archive_filesrownergroup)rrrrinitialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|dt|j}|rFtd||jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'dist)r,r+ensure_string_listrcheck_archive_formatsrr
r0)rZ
bad_formatrrrfinalize_options|s




zsdist.finalize_optionscCsBt|_x|D]}||qW||jr6dS|dS)N)r	filelistget_sub_commandsrun_command
get_file_listr.make_distribution)rcmd_namerrrrunsz	sdist.runcCs*tdt|jd}||dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr(N)rPendingDeprecationWarningdistributionget_command_objensure_finalizedr?)rr(rrrcheck_metadatas
zsdist.check_metadatacCstj|j}|s:|r:||j|jdS|sN|	d|j|j
|jrf||rr|
|jr||j|j|dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))ospathisfiler+_manifest_is_not_generated
read_manifestr9rZremove_duplicatesrfindallr-add_defaults
read_templater!prune_file_listwrite_manifest)rZtemplate_existsrrrr<s&





zsdist.get_file_listcCs<|||||||dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)_add_defaults_standards_add_defaults_optional_add_defaults_python_add_defaults_data_files_add_defaults_ext_add_defaults_c_libs_add_defaults_scripts)rrrrrKszsdist.add_defaultscCs:tj|sdStj|}tj|\}}|t|kS)z
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rErFexistsabspathsplitlistdir)fspathrW	directoryfilenamerrr_cs_path_existss

zsdist._cs_path_existscCs|j|jjg}x|D]}t|trn|}d}x(|D] }||r0d}|j|Pq0W|s|dd	|q||r|j|q|d|qWdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
READMESrAscript_name
isinstancetupler]r9rrjoin)rZ	standardsfnZaltsZgot_itrrrrOs 




zsdist._add_defaults_standardscCs8ddg}x*|D]"}ttjjt|}|j|qWdS)Nz
test/test*.pyz	setup.cfg)filterrErFrGrr9extend)roptionalpatternfilesrrrrPs
zsdist._add_defaults_optionalcCsd|d}|jr$|j|x:|jD]0\}}}}x"|D]}|jtj	
||q>Wq,WdS)Nbuild_py)get_finalized_commandrAhas_pure_modulesr9reget_source_files
data_filesrrErFrb)rripkgsrc_dir	build_dir	filenamesr\rrrrQs


zsdist._add_defaults_pythoncCs|jr~xr|jjD]f}t|trDt|}tj|rz|j	
|q|\}}x,|D]$}t|}tj|rR|j	
|qRWqWdS)N)rAhas_data_filesrmr`strrrErFrGr9r)ritemdirnamerqr#rrrrR$s


zsdist._add_defaults_data_filescCs(|jr$|d}|j|dS)N	build_ext)rAhas_ext_modulesrjr9rerl)rrvrrrrS5s

zsdist._add_defaults_extcCs(|jr$|d}|j|dS)N
build_clib)rAhas_c_librariesrjr9rerl)rrxrrrrT:s

zsdist._add_defaults_c_libscCs(|jr$|d}|j|dS)N
build_scripts)rAhas_scriptsrjr9rerl)rrzrrrrU?s

zsdist._add_defaults_scriptsc
Cstd|jt|jddddddd}zlxf|}|dkrsPK!zo009_distutils/command/__pycache__/install_lib.cpython-37.pycnu[B

Re @sLdZddlZddlZddlZddlmZddlmZdZ	GdddeZ
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).N)Command)DistutilsOptionErrorz.pyc@seZdZdZdddddddgZd	d
dgZdd
iZd
dZddZddZ	ddZ
ddZddZddZ
ddZddZdd Zd!S)"install_libz7install all Python modules (extensions and pure Python))zinstall-dir=dzdirectory to install to)z
build-dir=bz'build directory (where to install from))forcefz-force installation (overwrite existing files))compileczcompile .py to .pyc [default])z
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])z
skip-buildNzskip the build stepsrr	z
skip-buildz
no-compilecCs(d|_d|_d|_d|_d|_d|_dS)Nr)install_dir	build_dirrr	optimize
skip_build)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/install_lib.pyinitialize_options3szinstall_lib.initialize_optionsc	Cs|ddddddd|jdkr&d|_|jdkr6d	|_t|jtsyt|j|_|jd
kr^tWn ttfk
rtdYnXdS)Ninstall)	build_libr
)rr)rr)r	r	)rr)rrTF)rzoptimize must be 0, 1, or 2)set_undefined_optionsr	r
isinstanceintAssertionError
ValueErrorr)rrrrfinalize_options<s$


zinstall_lib.finalize_optionscCs0||}|dk	r,|jr,||dS)N)buildrdistributionhas_pure_modulesbyte_compile)routfilesrrrrunVszinstall_lib.runcCs2|js.|jr|d|jr.|ddS)Nbuild_py	build_ext)rrr run_commandhas_ext_modules)rrrrrfs



zinstall_lib.buildcCs8tj|jr ||j|j}n|d|jdS|S)Nz3'%s' does not exist -- no Python modules to install)ospathisdirr
	copy_treerwarn)rr"rrrrms
zinstall_lib.installcCsrtjr|ddSddlm}|dj}|jrH||d|j||j	d|j
dkrn|||j
|j||j|j	ddS)Nz%byte-compiling is disabled, skipping.r)r!r)rrprefixdry_run)rrr-verboser.)sysdont_write_bytecoder,distutils.utilr!get_finalized_commandrootr	rr.rr/)rfilesr!Zinstall_rootrrrr!vs


zinstall_lib.byte_compilec
	Csh|sgS||}|}t||}t|ttj}g}x(|D] }	|tj||	|dq@W|S)N)	r3get_outputsgetattrlenr(sepappendr)join)
rZhas_anyZ	build_cmdZ
cmd_option
output_dirZbuild_filesr

prefix_lenoutputsfilerrr_mutate_outputss


 zinstall_lib._mutate_outputscCsvg}xl|D]d}tjtj|d}|tkr0q
|jrL|tjj	|dd|j
dkr
|tjj	||j
dq
W|S)Nr)optimizationr)r(r)splitextnormcasePYTHON_SOURCE_EXTENSIONr	r:	importlibutilcache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileextrrr_bytecode_filenamess



zinstall_lib._bytecode_filenamescCsR||jdd|j}|jr*||}ng}||jdd|j}|||S)zReturn the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r$rr%)r@rr rr	rJr')rZpure_outputsZbytecode_outputsZext_outputsrrrr6szinstall_lib.get_outputscCsLg}|jr&|d}|||jrH|d}|||S)zGet the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r$r%)rr r3extendr6r')rinputsr$r%rrr
get_inputss



zinstall_lib.get_inputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrrr#rrr!r@rJr6rMrrrrrs(
		r)__doc__r(importlib.utilrFr0distutils.corerdistutils.errorsrrErrrrrsPK!t;_distutils/command/__pycache__/build_scripts.cpython-37.pycnu[B

ReK@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddlm
Z
ddlZed	ZGd
ddeZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.N)ST_MODE)	sysconfig)Command)newer)convert_path)logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZddZdd	Zd
dZdd
Z	ddZ
dS)
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=dzdirectory to "build" (copy) to)forcefz1forcibly build everything (ignore file timestamps)zexecutable=ez*specify final destination interpreter pathr
cCs"d|_d|_d|_d|_d|_dS)N)	build_dirscriptsr

executableoutfiles)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build_scripts.pyinitialize_optionss
z build_scripts.initialize_optionscCs|dddd|jj|_dS)Nbuild)rr
)r
r
)rr)set_undefined_optionsdistributionr)rrrrfinalize_options%s
zbuild_scripts.finalize_optionscCs|jS)N)r)rrrrget_source_files,szbuild_scripts.get_source_filescCs|js
dS|dS)N)rcopy_scripts)rrrrrun/szbuild_scripts.runc
Cs||jg}g}x(|jD]}d}t|}tj|jtj|}|||j	spt
||sptd|qyt
|d}Wn tk
r|jsd}YnXXt|j\}}|d|}	|	s|d|qt|	}
|
rd}|
dpd	}|rtd
||j|||jstjs.|j}n(tjtddtd
tdf}t|}d||d}
y|
dWn$tk
rt d!|
YnXy|
|Wn&tk
rt d!|
|YnXt
|d}|"|
|#|$WdQRX|r<|%q|r&|%|||&||qWtj'dkrxh|D]`}|jrltd|nDt(|t)d@}|dBd@}||krRtd|||t*||qRW||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)rbNrz%s is an empty file (skipping)Tzcopying and adjusting %s -> %sBINDIRz
python%s%sVERSIONEXEs#!
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})wbposixzchanging mode of %siimz!changing mode of %s from %o to %o)+mkpathr
rrospathjoinbasenameappendr
rrdebugopenOSErrordry_runtokenizedetect_encodingreadlineseekwarn
first_line_rematchgroupinforpython_buildrget_config_varfsencodedecodeUnicodeDecodeError
ValueErrorformatwrite
writelines	readlinesclose	copy_filenamestatrchmod)rrZ
updated_filesscriptadjustoutfilerencodinglines
first_liner5post_interprshebangoutffileZoldmodeZnewmoderrrr5s












zbuild_scripts.copy_scriptsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrrrrrrrrrsr)__doc__r&rerEr	distutilsrdistutils.corerdistutils.dep_utilrdistutils.utilrrr/compiler4rrrrrs
PK!M0,,8_distutils/command/__pycache__/py37compat.cpython-37.pycnu[B

Re@sPddlZddZddZejdkrHejdkrHejddd	krHeeeneZdS)
NccsDddlm}|dsdSdtjd?tjd?d@|d	VdS)
zj
    On Python 3.7 and earlier, distutils would include the Python
    library. See pypa/distutils#9.
    r)	sysconfigZPy_ENABLED_SHAREDNz
python{}.{}{}ABIFLAGS)	distutilsrget_config_varformatsys
hexversion)rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/py37compat.py_pythonlib_compats
rcsfddS)Ncs||S)Nr)argskwargs)f1f2rr
zcompose..r)rrr)rrr
composesr)darwinraix)r
rrversion_infoplatformlistZ	pythonlibrrrr
s

PK!knO&&6_distutils/command/__pycache__/build_py.cpython-37.pycnu[B

Reo@@sddZddlZddlZddlZddlZddlmZddlTddl	m
Z
ddlmZGdddeZ
dS)	zHdistutils.command.build_py

Implements the Distutils 'build_py' command.N)Command)*)convert_path)logc@seZdZdZdddddgZddgZd	diZd
dZdd
ZddZ	ddZ
ddZddZddZ
ddZddZddZddZd d!Zd"d#Zd$d%Zd2d'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1S)3build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=dzdirectory to "build" (copy) to)compileczcompile .py to .pyc)z
no-compileNz!don't compile .py files [default])z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz2forcibly build everything (ignore file timestamps)rrz
no-compilecCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	build_lib
py_modulespackagepackage_datapackage_dirroptimizer)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build_py.pyinitialize_options szbuild_py.initialize_optionsc	Cs|ddd|jj|_|jj|_|jj|_i|_|jjrbx&|jjD]\}}t||j|<qHW||_	t
|jtsy,t|j|_d|jkrdksnt
Wn tt
fk
rtdYnXdS)Nbuild)r
r
)rrrzoptimize must be 0, 1, or 2)set_undefined_optionsdistributionpackagesrrritemsrget_data_files
data_files
isinstancerintAssertionError
ValueErrorDistutilsOptionError)rnamepathrrrfinalize_options*s"



 zbuild_py.finalize_optionscCs:|jr||jr$||||jdddS)Nr)include_bytecode)r
build_modulesrbuild_packagesbuild_package_databyte_compileget_outputs)rrrrrunCszbuild_py.runcsg}|js|Sxr|jD]h}||}tjj|jg|d}d|rRt|dfdd|||D}|	||||fqW|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples.rcsg|]}|dqS)Nr).0file)plenrr
tsz+build_py.get_data_files..)
rget_package_dirosr%joinr
splitlenfind_data_filesappend)rdatarsrc_dir	build_dir	filenamesr)r2rras
zbuild_py.get_data_filescsh|jdg|j|g}gxB|D]:}ttjt|t|}fdd|Dq&WS)z6Return filenames for package's data files in 'src_dir'cs$g|]}|krtj|r|qSr)r5r%isfile)r0fn)filesrrr3s
z,build_py.find_data_files..)	rgetglobr5r%r6escaperextend)rrr<Zglobspatternfilelistr)rBrr9ys
zbuild_py.find_data_filescCshd}x^|jD]T\}}}}xF|D]>}tj||}|tj||jtj|||ddqWqWdS)z$Copy data files into build directoryNF)
preserve_mode)rr5r%r6mkpathdirname	copy_file)rZlastdirrr<r=r>filenametargetrrrr*s
zbuild_py.build_package_datacCs|d}|js&|r tjj|SdSng}x|ry|jd|}Wn*tk
rn|d|d|d=Yq,X|d|tjj|Sq,W|jd}|dk	r|d||rtjj|SdSdS)zReturn the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r.r?rN)r7rr5r%r6KeyErrorinsertrC)rrr%tailZpdirrrrr4s(
	zbuild_py.get_package_dircCsj|dkr8tj|s td|tj|s8td||rftj|d}tj|rZ|Std|dS)Nr?z%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r5r%existsDistutilsFileErrorisdirr6r@rwarn)rrrinit_pyrrr
check_packages
zbuild_py.check_packagecCs&tj|std||dSdSdS)Nz!file %s (for module %s) not foundFT)r5r%r@rrV)rmodulemodule_filerrrcheck_moduleszbuild_py.check_modulec	Cs|||ttjt|d}g}tj|jj}xX|D]P}tj|}||krtj	tj
|d}||||fq@|d|q@W|S)Nz*.pyrzexcluding %s)
rXrDr5r%r6rEabspathrscript_namesplitextbasenamer:debug_print)	rrrZmodule_filesmodulesZsetup_scriptrZabs_frYrrrfind_package_moduless
zbuild_py.find_package_modulesc	Csi}g}x|jD]}|d}d|dd}|d}y||\}}Wn"tk
rj||}d}YnX|s|||}	|df||<|	r||d|	ftj||d}
|	||
sq||||
fqW|S)aFinds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r.rrOr/__init__z.py)
rr7r6rPr4rXr:r5r%r[)rrrarYr%rZmodule_basercheckedrWrZrrrfind_moduless*


zbuild_py.find_modulescCsRg}|jr|||jrNx.|jD]$}||}|||}||q&W|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrFrerr4rb)rrarrmrrrfind_all_moduless
zbuild_py.find_all_modulescCsdd|DS)NcSsg|]}|dqS)rOr)r0rYrrrr3-sz-build_py.get_source_files..)rg)rrrrget_source_files,szbuild_py.get_source_filescCs$|gt||dg}tjj|S)Nz.py)listr5r%r6)rr=rrYZoutfile_pathrrrget_module_outfile/szbuild_py.get_module_outfiler/cCs|}g}xx|D]p\}}}|d}||j||}|||r|jr`|tjj|dd|j	dkr|tjj||j	dqW|dd|j
D7}|S)Nr.r?)optimizationrcSs,g|]$\}}}}|D]}tj||qqSr)r5r%r6)r0rr<r=r>rMrrrr3Cs
z(build_py.get_outputs..)rgr7rjr
r:r	importlibutilcache_from_sourcerr)rr'raoutputsrrYrZrMrrrr,3s"




zbuild_py.get_outputscCsbt|tr|d}nt|ttfs,td||j||}tj	
|}|||j||ddS)Nr.z:'package' must be a string (dot-separated), list, or tupler)rI)
rstrr7rituple	TypeErrorrjr
r5r%rKrJrL)rrYrZroutfiledirrrrbuild_moduleJs

zbuild_py.build_modulecCs.|}x |D]\}}}||||qWdS)N)reru)rrarrYrZrrrr(Yszbuild_py.build_modulescCsXxR|jD]H}||}|||}x,|D]$\}}}||ks>t||||q(WqWdS)N)rr4rbr!ru)rrrraZpackage_rYrZrrrr)bs

zbuild_py.build_packagescCstjr|ddSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d|jdkr||||j|j	||j
ddS)Nz%byte-compiling is disabled, skipping.r)r+rO)rrprefixdry_run)sysdont_write_bytecoderVdistutils.utilr+r
r5seprrrwr)rrBr+rvrrrr+vs


zbuild_py.byte_compileN)r/)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optrr&r-rr9r*r4rXr[rbrergrhrjr,rur(r)r+rrrrrs6


'4
	r)__doc__r5importlib.utilrlrxrDdistutils.corerdistutils.errorsrzr	distutilsrrrrrrsPK!BWW3_distutils/command/__pycache__/build.cpython-37.pycnu[B

Re@sTdZddlZddlZddlmZddlmZddlmZddZ	Gdd	d	eZ
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.N)Command)DistutilsOptionError)get_platformcCsddlm}|dS)Nr)show_compilers)distutils.ccompilerr)rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build.pyrsrc@seZdZdZdddddddd	d
efddd
ddgZddgZdddefgZddZ	ddZ
ddZddZddZ
dd Zd!d"Zd#efd$e
fd%efd&efgZdS)'buildz"build everything needed to install)zbuild-base=bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=tztemporary build directoryz
plat-name=pz6platform name to build for, if supported (default: %s))z	compiler=czspecify the compiler type)z	parallel=jznumber of parallel build jobs)debuggz;compile extensions and libraries with debugging information)forcefz2forcibly build everything (ignore file timestamps))zexecutable=ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)
build_base
build_purelib
build_platlib	build_lib
build_temp
build_scriptscompiler	plat_namerr
executableparallel)selfrrrinitialize_options8szbuild.initialize_optionscCsd|jdkrt|_ntjdkr&tdd|jftjdd}ttdrR|d7}|jdkrntj	
|jd|_|jdkrtj	
|jd||_|j
dkr|jr|j|_
n|j|_
|jdkrtj	
|jd||_|jdkrtj	
|jd	tjdd|_|jdkr"tjr"tj	tj|_t|jtr`yt|j|_Wntk
r^td
YnXdS)NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%dgettotalrefcountz-pydebuglibtempz
scripts-%d.%dzparallel should be an integer)rrosnamersysversion_infohasattrrpathjoinrrrdistributionhas_ext_modulesrrrnormpath
isinstancerstrint
ValueError)rplat_specifierrrrfinalize_optionsHs<













zbuild.finalize_optionscCs x|D]}||q
WdS)N)get_sub_commandsrun_command)rcmd_namerrrrunsz	build.runcCs
|jS)N)r,has_pure_modules)rrrrr9szbuild.has_pure_modulescCs
|jS)N)r,has_c_libraries)rrrrr:szbuild.has_c_librariescCs
|jS)N)r,r-)rrrrr-szbuild.has_ext_modulescCs
|jS)N)r,has_scripts)rrrrr;szbuild.has_scriptsbuild_py
build_clib	build_extr)__name__
__module____qualname__descriptionruser_optionsboolean_optionsrhelp_optionsrr4r8r9r:r-r;sub_commandsrrrrr	s:
8r	)__doc__r'r%distutils.corerdistutils.errorsrdistutils.utilrrr	rrrrsPK!ۆ3_distutils/command/__pycache__/clean.cpython-37.pycnu[B

Re
@sDdZddlZddlmZddlmZddlmZGdddeZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.N)Command)remove_tree)logc@s>eZdZdZddddddgZdgZd	d
ZddZd
dZdS)cleanz-clean up temporary files from 'build' command)zbuild-base=bz2base build directory (default: 'build.build-base'))z
build-lib=Nzs
PK!v6v65_distutils/command/__pycache__/install.cpython-37.pycnu[B

Rek
@s:dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZddddddZddddddddddddedddddddddddddZer"dddd d!ded"<ddd#d$d!ded%<dZGd&d'd'eZdS)(zFdistutils.command.install

Implements the Distutils 'install' command.N)log)Command)DEBUG)get_config_vars)DistutilsPlatformError)
write_file)convert_path
subst_varschange_root)get_platform)DistutilsOptionError)	USER_BASE)	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)purelibplatlibheadersscriptsdataz/$base/lib/python$py_version_short/site-packagesz;$platbase/$platlibdir/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/$platlibdir/pythonz$base/include/python/$dist_namez$base/site-packagesz$base/include/$dist_name)unix_prefix	unix_homentpypypypy_ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbasent_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`edddefedddiZ	ddZ
ddZdd Zd!d"Z
d#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Zd=d>Zd?d@ZdAdBZdCdDZdEefdFefdGefdHefdIdJdKfgZdS)Linstallz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz)r2r\rrT
isinstancestrrZlenrr	path_filern)r9rrnr:r:r;rjs$



zinstall.handle_extra_pathc	Gs4x.|D]&}d|}t||t|jt||qWdS)z:Change the install directories pointed by name using root.rN)rr
r(ra)r9rrSrr:r:r;ro!s
zinstall.change_rootscCsf|js
dSttjd}xF|jD]8\}}||r&tj|s&|	d|t
|dq&WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i)r!rrRrlrrbitems
startswithisdirdebug_printmakedirs)r9r%rSrlr:r:r;rg'szinstall.create_home_pathcCs*|js6|d|jdj}|jr6|tkr6tdx|D]}||q@W|j	r`|
|jr|}|j
rt|j
}x(tt|D]}|||d||<qW|t|j|fd|jttjjtj}ttjj|}tjtj|j}|jr&|j	r|js&||kr&td|jdS)zRuns the command.rQz"Can't install when cross-compilingNz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r4run_commandr\get_command_obj	plat_namer5rrget_sub_commandsrcreate_path_filer8get_outputsr(rrangeexecutermaprRrlrrXnormcaser,r3rrw)r9
build_platcmd_nameoutputsroot_lencountersys_pathr,r:r:r;run3s6



zinstall.runcCsJtj|j|jd}|jr8|t||jgfd|n|	d|dS)zCreates the .pth filez.pthzcreating %szpath file '%s' not createdN)
rRrlrmrkrr3rrrnrT)r9filenamer:r:r;r_s

zinstall.create_path_filecCspg}x>|D]2}||}x"|D]}||kr&||q&WqW|jrl|jrl|tj|j	|jd|S)z.Assembles the outputs of all the sub-commands.z.pth)
rget_finalized_commandrappendrr3rRrlrmrk)r9rrcmdrr:r:r;rms
zinstall.get_outputscCs2g}x(|D]}||}||qW|S)z*Returns the inputs of all the sub-commands)rrextend
get_inputs)r9inputsrrr:r:r;r~s

zinstall.get_inputscCs|jp|jS)zSReturns true if the current distribution has any Python
        modules to install.)r\has_pure_modulesrh)r9r:r:r;has_libs
zinstall.has_libcCs
|jS)zLReturns true if the current distribution has any headers to
        install.)r\has_headers)r9r:r:r;rszinstall.has_headerscCs
|jS)zMReturns true if the current distribution has any scripts to.
        install.)r\has_scripts)r9r:r:r;rszinstall.has_scriptscCs
|jS)zJReturns true if the current distribution has any data to.
        install.)r\has_data_files)r9r:r:r;has_dataszinstall.has_datar,r+r-r.install_egg_infocCsdS)NTr:)r9r:r:r;zinstall.) __name__
__module____qualname__descriptionrxboolean_optionsrcrrryr<rqrUrVrWrrrdrfrirjrorgrrrrrrrrsub_commandsr:r:r:r;rWsh	

N(	",r)__doc__rXrR	distutilsrdistutils.corerdistutils.debugrdistutils.sysconfigrdistutils.errorsrdistutils.file_utilrdistutils.utilrr	r
rrsiter
rrcWINDOWS_SCHEMErrrr:r:r:r;sjPK!_007_distutils/command/__pycache__/bdist_rpm.cpython-37.pycnu[B

Re!T@stdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
TddlmZddl
mZGd	d
d
eZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).N)Command)DEBUG)
write_file)*)get_python_version)logc)@seZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0Zd1d2Zd3d4Zd5d6Z	d7d8Z
d9d:Zd;d<Zd=d>Z
d?S)@	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow ") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe ") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)z
no-autoreqNz+do not automatically calculate dependencies)z	keep-tempkz"don't clean up RPM build directory)zno-keep-tempNz&clean up RPM build directory [default])zuse-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)zno-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)z	rpm3-modeNz"RPM 3 compatibility mode (default))z	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nzrr)ZREADMEz
README.txtr1rrrrr r!r"r#r$r%r&r'r(r*r+r,r-r.r3)
ensure_stringrEget_contactget_contact_emailensure_string_list
isinstancerlistr>r?existsappend_format_changelogrensure_filename)r4Zreadmer5r5r6rGs>





















zbdist_rpm.finalize_package_datacCstrr?r@rrEget_nameexecuter_make_spec_file
dist_filesreinitialize_commandrformatsrun_commandZget_archive_files	copy_filerrPDistutilsFileErrorrinforrQrextendrr1abspathr/rpopenreadlinestripsplitlenAssertionErrorcloseDistutilsExecErrorreprspawndry_runrFr	move_filebasename)r4Zspec_dirZrpm_dirr	Z	spec_pathZsaved_dist_filesrYsource
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmdoutZbinary_rpmsZ
source_rpmlinelstatusZ	pyversionZsrpmfilenamer9r5r5r6runs















z
bdist_rpm.runcCstj|jtj|S)N)r>r?r@rrx)r4r?r5r5r6
_dist_pathszbdist_rpm._dist_pathc
CsRd|jd|jddd|jd|jdddd|jg}td	}d
dd|	D}d
}d}|||}||kr|
d|
d|d
|dddg|jr|
dn
|
d|d|j
d|jddg|js|js&|
dn|
d|jx^dD]V}t||}t|trd|
d|d|fn|dk	r,|
d||fq,W|jd kr|
d!|j|jr|
d"|j|jr|
d#d|j|jr|
d$tj|j|jr|
d%|dd&|jgd'|jtjtj d(f}d)|}	|j!r\d*|	}	d+|}
d,d-d.|	fd/d0|
fd1d2d3d4d5d6g	}xv|D]n\}}
}t||
}|s|r|dd7|g|rt"|}||#$d
WdQRXn
|
|qW|dd8d9g|j%r,|
d:d|j%|j&rN|dd;g||j&|S)sz-bdist_rpm._make_spec_file..zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerProvidesRequiresZ	Conflicts	Obsoletesz%s: %s NUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r)r z&%setup -n %{name}-%{unmangled_version}buildr!installr")cleanr#zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr$N)prer%N)postr&N)Zpreunr'N)Zpostunr(N%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rEr`get_versionreplacerget_description
subprocess	getoutputr@
splitlinesrQrjrget_licenserr3rFgetattrlowerrNrOget_urlrr-rr>r?rxr2get_long_descriptionrrAargvr0openreadrorr)r4Z	spec_fileZvendor_hookproblemZfixedZ
fixed_hookfieldvalZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_optattrdefaultfr5r5r6rbs


	





 zbdist_rpm._make_spec_filecCs|s|Sg}x`|dD]N}|}|ddkrD|d|gq|ddkr\||q|d|qW|ds||d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rrrrrz  )rnrorjrQ)r4rZ
new_changelogr|r5r5r6rR0szbdist_rpm._format_changelogN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsnegative_optr7rHrGrrrbrRr5r5r5r6rsp--*r)__doc__rrAr>distutils.corerdistutils.debugrdistutils.file_utilrdistutils.errorsdistutils.sysconfigr	distutilsrrr5r5r5r6sPK!7%oo8_distutils/command/__pycache__/build_clib.cpython-37.pycnu[B

ReV@sTdZddlZddlmZddlTddlmZddlmZddZ	Gd	d
d
eZ
dS)zdistutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.N)Command)*)customize_compiler)logcCsddlm}|dS)Nr)show_compilers)distutils.ccompilerr)rr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
ZddZ	ddZ
ddZddZddZ
ddZd
S)
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=bz%directory to build C/C++ libraries to)zbuild-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z	compiler=czspecify the compiler typer
rz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r

build_temp	librariesinclude_dirsdefineundefr
rcompiler)selfrrr	initialize_options4szbuild_clib.initialize_optionscCsh|dddddd|jj|_|jr0||j|jdkrH|jjpDg|_t|jtrd|jtj	|_dS)Nbuild)rr
)rr)rr)r
r
)rr)
set_undefined_optionsdistributionrcheck_library_listr
isinstancestrsplitospathsep)rrrr	finalize_optionsDs

zbuild_clib.finalize_optionscCs|js
dSddlm}||j|j|jd|_t|j|jdk	rN|j|j|j	dk	rzx |j	D]\}}|j
||q`W|jdk	rx|jD]}|j|qW|
|jdS)Nr)new_compiler)rdry_runr)rrr$rr%rrrZset_include_dirsrZdefine_macrorZundefine_macrobuild_libraries)rr$namevalueZmacrorrr	run^s 



zbuild_clib.runcCst|tstdx|D]z}t|ts:t|dkr:td|\}}t|tsTtdd|ksptjdkrtj|krtd|dt|tstdqWd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuplesz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	rlistDistutilsSetupErrortuplelenrr!sepdict)rrlibr'
build_inforrr	rvs"




zbuild_clib.check_library_listcCs0|js
dSg}x|jD]\}}||qW|S)N)rappend)rZ	lib_nameslib_namer3rrr	get_library_namesszbuild_clib.get_library_namescCs^||jg}xH|jD]>\}}|d}|dks@t|ttfsLtd|||qW|S)Nsourceszfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rrgetrr,r.r-extend)r	filenamesr5r3r7rrr	get_source_filess
zbuild_clib.get_source_filescCsx|D]\}}|d}|dks.t|ttfs:td|t|}td||d}|d}|jj||j	|||j
d}|jj|||j|j
dqWdS)Nr7zfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenameszbuilding '%s' librarymacrosr)
output_dirr<rr
)r=r
)
r8rr,r.r-rinforcompilerr
Zcreate_static_libr
)rrr5r3r7r<rZobjectsrrr	r&s$




zbuild_clib.build_libraries)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrhelp_optionsrr#r)rr6r;r&rrrr	r
s 
$r
)__doc__r!distutils.corerdistutils.errorsdistutils.sysconfigr	distutilsrrr
rrrr	sPK!~=_distutils/command/__pycache__/install_headers.cpython-37.pycnu[B

Re@s$dZddlmZGdddeZdS)zdistutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.)Commandc@sFeZdZdZddgZdgZddZddZd	d
ZddZ	d
dZ
dS)install_headerszinstall C/C++ header files)zinstall-dir=dz$directory to install header files to)forcefz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)install_dirroutfiles)selfr
/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/install_headers.pyinitialize_optionssz"install_headers.initialize_optionscCs|ddddS)Ninstall)rr)rr)set_undefined_options)r	r
r
rfinalize_optionssz install_headers.finalize_optionscCsL|jj}|sdS||jx*|D]"}|||j\}}|j|q"WdS)N)distributionheadersmkpathr	copy_filerappend)r	rheaderout_r
r
rrun!s
zinstall_headers.runcCs|jjp
gS)N)rr)r	r
r
r
get_inputs+szinstall_headers.get_inputscCs|jS)N)r)r	r
r
rget_outputs.szinstall_headers.get_outputsN)__name__
__module____qualname__descriptionuser_optionsboolean_optionsrrrrrr
r
r
rr
s
rN)__doc__distutils.corerrr
r
r
rsPK!.0ecc3_distutils/command/__pycache__/check.cpython-37.pycnu[B

Re@sdZddlmZddlmZyHddlmZddlmZddl	m
Z
ddl	mZGdd	d	eZd
Z
Wnek
r|dZ
YnXGdd
d
eZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
)Command)DistutilsSetupError)Reporter)Parser)frontend)nodesc@seZdZd	ddZddZdS)
SilentReporterNrasciireplacec
Cs"g|_t||||||||dS)N)messagesr__init__)selfsourcereport_level
halt_levelstreamdebugencoding
error_handlerr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/check.pyrszSilentReporter.__init__cOs6|j||||ftj|f|||j|d|S)N)leveltype)rappendrsystem_messagelevels)r
rmessagechildrenkwargsrrrrszSilentReporter.system_message)Nrr	r
)__name__
__module____qualname__rrrrrrrs
rTFc@s`eZdZdZdZdddgZdddgZd	d
ZddZd
dZ	ddZ
ddZddZddZ
dS)checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)metadatamzVerify meta-data)restructuredtextrzEChecks if long string meta-data syntax are reStructuredText-compliant)strictsz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.rN)r%r#r'	_warnings)r
rrrinitialize_options0szcheck.initialize_optionscCsdS)Nr)r
rrrfinalize_options7szcheck.finalize_optionscCs|jd7_t||S)z*Counts the number of warnings that occurs.r))r*rwarn)r
msgrrrr-:sz
check.warncCsL|jr||jr0tr"|n|jr0td|jrH|jdkrHtddS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#check_metadatar%HAS_DOCUTILScheck_restructuredtextr'rr*)r
rrrrun?s
z	check.runcCs|jj}g}x*dD]"}t||r*t||s||qW|rP|dd||jrh|js|dn"|j	r|j
s|dn
|ddS)aEnsures that all required elements of meta-data are supplied.

        Required fields:
            name, version, URL

        Recommended fields:
            (author and author_email) or (maintainer and maintainer_email))

        Warns if any are missing.
        )nameversionurlzmissing required meta-data: %sz, zNmissing meta-data: if 'author' supplied, 'author_email' should be supplied toozVmissing meta-data: if 'maintainer' supplied, 'maintainer_email' should be supplied toozkmissing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be suppliedN)distributionr#hasattrgetattrrr-joinauthorauthor_email
maintainermaintainer_email)r
r#missingattrrrrr/Os
zcheck.check_metadatacCs\|j}xL||D]>}|dd}|dkr:|d}nd|d|f}||qWdS)z4Checks if the long string fields are reST-compliant.lineNr)z%s (line %s))r6get_long_description_check_rst_datagetr-)r
datawarningrArrrr1ps

zcheck.check_restructuredtextc
Cs|jjp
d}t}tjtfd}d|_d|_d|_t	||j
|j|j|j
|j|jd}tj|||d}||dy|||Wn:tk
r}z|jdd|d	ifWdd}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)
componentsN)rrrr)rr@z!Could not finish the parsing: %s.)r6script_namerrOptionParserget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesrrrZwarning_streamrZerror_encodingZerror_encoding_error_handlerrdocumentZnote_sourceparseAttributeErrorrr)r
rEsource_pathparsersettingsZreporterrMerrrrC{s*
$zcheck._check_rst_dataN)rr r!__doc__descriptionuser_optionsboolean_optionsr+r,r-r2r/r1rCrrrrr"#s
!r"N)rTdistutils.corerdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrrrr0	Exceptionr"rrrrs
PK!HC?(MM7_distutils/command/__pycache__/bdist_msi.cpython-37.pycnu[B

Re@sdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
d
eZGdddeZdS)z#
Implements the bdist_msi command.
N)Command)remove_tree)get_python_version)
StrictVersion)DistutilsOptionError)get_platform)log)schemasequencetext)	DirectoryFeatureDialogadd_datac@sFeZdZdZddZddZddd	ZdddZdddZddZ	dS)PyDialogzDialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs>tj|f||jd}d|d}|dd||jddS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)$iHZ
BottomLinerN)r__init__hlinew)selfargskwZrulerZbmwidthr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|ddddddd|dS)	z,Set the title text of the dialog at the top.Title
i@<iz{\VerdanaBold10}%sN)r)rtitlerrrr %szPyDialog.titleBackc
Cs,|r
d}nd}||d|jddd|||S)zAdd a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr"8)
pushbuttonr)rr nextnameactiveflagsrrrback,sz
PyDialog.backCancelc
Cs,|r
d}nd}||d|jddd|||S)zAdd a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr#r"i0r%r&r')r(r)rr r)r*r+r,rrrcancel7szPyDialog.cancelNextc
Cs,|r
d}nd}||d|jddd|||S)zAdd a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr#r"r%r&r')r(r)rr r)r*r+r,rrrr)Bsz
PyDialog.nextc
Cs,||t|j|d|jdddd||S)zAdd a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associatedr%r&r'r#)r(intrr)rr*r r)ZxposrrrxbuttonMszPyDialog.xbuttonN)r!r")r.r")r0r")
__name__
__module____qualname____doc__rr r-r/r)r4rrrrrs



rcseZdZdZddddefdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zfd'd(Z	d)d*Z
d+d,Zd-d.Zd/d0Z
d1d2Zd3d4Zd5d6Zd7d8ZZS)9	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))z	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)zno-target-compilecz/do not compile .py to .pyc on the target system)zno-target-optimizeoz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=dz-directory to put final built distributions in)z
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionz	keep-tempzno-target-compilezno-target-optimizez
skip-buildz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9Xcs tj||tdtddS)NzZbdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead)superrwarningswarnDeprecationWarning)rrr)	__class__rrrszbdist_msi.__init__cCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)	bdist_dir	plat_name	keep_tempZno_target_compileZno_target_optimizetarget_versiondist_dir
skip_buildinstall_scriptpre_install_scriptversions)rrrrinitialize_optionsszbdist_msi.initialize_optionscCs|dd|jdkr2|dj}tj|d|_t}|jsN|j	
rN||_|jr|jg|_|js|j	
r|j|krt
d|fnt|j|_|ddd|jrt
d|jrx2|j	jD]}|jtj|krPqWt
d|jd|_dS)	Nbdist)rKrKZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rJrJ)rGrGz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)set_undefined_optionsrFget_finalized_command
bdist_baseospathjoinrrIdistributionhas_ext_modulesrNrKrlistall_versionsrMrLscriptsbasenameinstall_script_key)rrSZ
short_versionscriptrrrfinalize_optionss:



zbdist_msi.finalize_optionscCs|js|d|jddd}|j|_|j|_d|_|d}d|_d|_|j	r|j
}|s~|jsltddtj
dd	}d
|j|f}|d}tj|jd||_td|j|tjdtj|jd
|tjd=||j|j}||}tj|}tj|r0t ||jj!}|j"}	|	sJ|j#}	|	sTd}	|$}
dt%|
j&}|j}|j
rd|j
|f}nd|}t'(|t)|t'*||	|_+t',|j+t-d|
fg}
|j.p|j/}|r|
0d|f|j1r|
0d|j1f|
rt2|j+d|
|3|4|5|6|j+7t8|jdrld|j
pXd|f}|jj90||j:st;|j|j}|d?d%d@dAd%d)dB|d7d-dCdDd-d)dE|dFd-dGdHdddI|dJdKd-dLdHdMdNdOddd|jd1dPd1d/}|
d0d1|j	dPd}|d?d%d@dAd%d)d|d7d-d-dDd-d)d|dFd-ddHddd|ddd-ddHdddddd|ddndd
d0d9t|d||||||ddd"}|d|dd%ddtddddXd	}|dd ddd-d|dd ddd-d|jd#dd d!|	dd"}|
dddd|j
d0d9dd|d"d}|
ddst|d||||||d"d"d"d=d>}|d?d-d%dAd%d)d|dFddddwddġ|ddddd-ddơ|dd&d|d&d-dd}|ddF|ddddZddRddddd}|ddˡ|jddd=d!|j	dd"d=d!|d"d#
ddst|d||||||ddd"}|d͡|dd%ddHdhddС|dd%ddHddddXd	}|dd ddAd{d֡|dd ddAd{d١|jddd=d!|	dd"}|
dddd|
dddd@|
ddddN|
dddd|
dddd|
dddd|
dddd|
dddd|
d0d9dd-|d"dѡ
ddsdS)Nriri,z[ProductName] Setupr#r" rf)Z
DefaultUIFontDlgFont8)ZErrorDialogErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)MaintenanceForm_ActionRepair)
WhichUsersALLZ	TextStyle)rTahoma	Nr)ZDlgFontBold8rNr")Z
VerdanaBold10VerdanarNr")ZVerdanaRed9rrrr)
PrepareDlgz(Not Privileged or Windows9x or Installed)
WhichUsersDlgz.Privileged and not Windows9x and not Installed)SelectFeaturesDlgz
Not Installedi)MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi)ProgressDlgNi
ActionTextUITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r+r.r!ZDescription1rFi@Piz[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2z.Click the Finish button to exit the Installer.)r*Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerDescriptionZReturnZ
FilesInUseRetryF)Zbitmaprz{\DlgFontBold8}Files in Useiz8Some files that need to be updated are currently in use.Text7iJzThe following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ListZListBoxkZFileInUseProcessIgnorerreiZ	ErrorTextr0rNxHQZNoZErrorNoYZYesZErrorYesAZAbortZ
ErrorAbortC*ZErrorCancelIZErrorIgnoreOZOkZErrorOkRZ
ErrorRetryZ	CancelDlgiUz;Are you sure you want to cancel [ProductName] installation?9r&r'ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.fr(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] InstallernzPondering...Z
ActionDatar0ZSpawnDialogrzSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogr@ZFeaturesZ
SelectionTreerZFEATUREZPathEditz[FEATURE_SELECTED]1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHiderZDiskCostDlgOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostListdiz{120}{70}{70}{70}{70}g?rZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.rrzInstall for all usersZJUSTMEzInstall just for mez
[ALLUSERS]zWhichUsers="ALL"rz({\DlgFontBold8}[Progress1] [ProductName]#AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressProgressrz)Welcome to the [ProductName] Setup WizardZBodyText?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGrouplrrrz&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallrz[REMOVE]zMaintenanceForm_Action="Remove"ZRemovingZremoves
z MaintenanceForm_Action<>"Change")rrrrrrr r-r/r)eventcontrolrr(mappingrWrzrNr	conditionr4Z
radiogroupadd)rrxyrrr modalZmodelessZtrack_disk_spacefatalr<Z	user_exitZexit_dialogZinuseerrorr/ZcostingprepZseldlgorderrrZinstall_other_condZdont_install_other_condZcostZ
whichusersgprogressZmaintrrrrs







       












zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj|j|}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rIrGrTrUrVrJ)rr	base_namerrrrr{sz bdist_msi.get_installer_filename)r5r6r7descriptionruser_optionsboolean_optionsrZrrrOr_rxrrrrr{
__classcell__rr)rErr9Us>



([66&@r9)r8rTrqrBdistutils.corerdistutils.dir_utilrdistutils.sysconfigrZdistutils.versionrdistutils.errorsrdistutils.utilr	distutilsrrr	r
rrr
rrrr9rrrrs>PK!^KK8_distutils/command/__pycache__/bdist_dumb.cpython-37.pycnu[B

Re1@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
d
eZdS)zdistutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).N)Command)get_platform)remove_treeensure_relative)*)get_python_version)logc	@s^eZdZdZddddefdddd	d
ddg	Zd
ddgZdddZddZddZ	ddZ
dS)
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=dz1temporary directory for creating the distributionz
plat-name=pz;platform name to embed in generated filenames (default: %s))zformat=fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))z	keep-tempkzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)z
skip-buildNz2skip rebuilding everything (for testing/debugging))relativeNz7build the archive using relative paths (default: false))zowner=uz@Owner name used when creating a tar file [default: current user])zgroup=gzAGroup name used when creating a tar file [default: current group]z	keep-tempz
skip-buildrgztarzip)posixntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)		bdist_dir	plat_nameformat	keep_tempdist_dir
skip_buildrownergroup)selfr/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/command/bdist_dumb.pyinitialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|dj}tj|d|_|jdkrfy|jtj|_Wn"t	k
rdt
dtjYnX|dddddS)NbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rget_finalized_command
bdist_baseospathjoinrdefault_formatnameKeyErrorDistutilsPlatformErrorset_undefined_options)rr#rrrfinalize_options=s

zbdist_dumb.finalize_optionscCs(|js|d|jddd}|j|_|j|_d|_td|j|dd|j	|j
f}tj
|j|}|js~|j}nJ|jr|j|jkrtdt|jt|jfntj
|jt|j}|j||j||j|jd	}|jrt}nd
}|jjd||f|js$t|j|jddS)
Nbuildinstall)reinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))root_dirrranyr	)dry_run) rrun_commandreinitialize_commandrrootwarn_dirrinfodistributionget_fullnamerr$r%r&rrhas_ext_modulesinstall_baseinstall_platbaser*reprrmake_archiverrrr
dist_filesappendrrr3)rr.Zarchive_basenameZpseudoinstall_rootZarchive_rootfilenameZ	pyversionrrrrunOs>






zbdist_dumb.runN)__name__
__module____qualname__descriptionruser_optionsboolean_optionsr'r r,rCrrrrr	s$
r	)__doc__r$distutils.corerdistutils.utilrdistutils.dir_utilrrdistutils.errorsdistutils.sysconfigr	distutilsrr	rrrrsPK!2\msvc.pynu[PK!ssֶ__init__.pynu[PK!c
namespaces.pynu[PK!0FF
@py31compat.pynu[PK!$l		extern/__init__.pynu[PK!t	t	0extern/__pycache__/__init__.cpython-38.opt-1.pycnu[PK!t	t	*extern/__pycache__/__init__.cpython-38.pycnu[PK!
ywindows_support.pynu[PK!eQarchive_util.pynu[PK!bdist.pynu[PK![

@depends.pynu[PK!Okglob.pynu[PK!Bך
unicode_utils.pynu[PK!>extension.pynu[PK!;script (dev).tmplnu[PK!3Vwheel.pynu[PK!VD
,9py34compat.pynu[PK!#__pycache__/windows_support.cpython-38.opt-1.pycnu[PK!ϚϚ{'__pycache__/msvc.cpython-38.pycnu[PK!!+__pycache__/py31compat.cpython-38.opt-1.pycnu[PK!A.__pycache__/unicode_utils.cpython-38.opt-1.pycnu[PK!5) XX)x__pycache__/__init__.cpython-38.opt-1.pycnu[PK!KӤӤ)__pycache__/dist.cpython-38.pycnu[PK!C;bb%K__pycache__/_imp.cpython-38.opt-1.pycnu[PK!$$"__pycache__/version.cpython-38.pycnu[PK!{BB
!
!+x__pycache__/build_meta.cpython-38.opt-1.pycnu[PK!C;bb__pycache__/_imp.cpython-38.pycnu[PK!M]]-__pycache__/archive_util.cpython-38.opt-1.pycnu[PK!9@##%__pycache__/pep425tags.cpython-38.pycnu[PK!8H,n__pycache__/ssl_support.cpython-38.opt-1.pycnu[PK!yʀʀ(__pycache__/package_index.cpython-38.pycnu[PK!8H&__pycache__/ssl_support.cpython-38.pycnu[PK!+Ъ__pycache__/py27compat.cpython-38.opt-1.pycnu[PK!tEE!__pycache__/config.cpython-38.pycnu[PK!@Řtt&&__pycache__/wheel.cpython-38.opt-1.pycnu[PK!>T5__pycache__/_deprecation_warning.cpython-38.opt-1.pycnu[PK!cc%Y__pycache__/glob.cpython-38.opt-1.pycnu[PK!  +%__pycache__/namespaces.cpython-38.opt-1.pycnu[PK!A(3__pycache__/unicode_utils.cpython-38.pycnu[PK!A88!c8__pycache__/launch.cpython-38.pycnu[PK!  %;__pycache__/namespaces.cpython-38.pycnu[PK![g``(aJ__pycache__/depends.cpython-38.opt-1.pycnu[PK!b'/&___pycache__/glibc.cpython-38.opt-1.pycnu[PK!ĺ<<(ie__pycache__/sandbox.cpython-38.opt-1.pycnu[PK!\h+q__pycache__/py33compat.cpython-38.opt-1.pycnu[PK!ĺ<<"L__pycache__/sandbox.cpython-38.pycnu[PK!C33#N__pycache__/dep_util.cpython-38.pycnu[PK!>T/__pycache__/_deprecation_warning.cpython-38.pycnu[PK!\h%7__pycache__/py33compat.cpython-38.pycnu[PK!b'/ __pycache__/glibc.cpython-38.pycnu[PK!ߧ}%V__pycache__/dist.cpython-38.opt-1.pycnu[PK!$$(0__pycache__/version.cpython-38.opt-1.pycnu[PK!ϚϚ%__pycache__/msvc.cpython-38.opt-1.pycnu[PK!M]]'8__pycache__/archive_util.cpython-38.pycnu[PK!վ%/M__pycache__/site-patch.cpython-38.pycnu[PK!FS__pycache__/glob.cpython-38.pycnu[PK!$$!*b__pycache__/monkey.cpython-38.pycnu[PK!`['##+t__pycache__/pep425tags.cpython-38.opt-1.pycnu[PK!5) XX#__pycache__/__init__.cpython-38.pycnu[PK!yʀʀ.ȯ__pycache__/package_index.cpython-38.opt-1.pycnu[PK!%0	__pycache__/py27compat.cpython-38.pycnu[PK!8	_vendor/__init__.pynu[PK!v]8	_vendor/packaging/__init__.pynu[PK!iJ\\:	_vendor/packaging/_compat.pynu[PK! S>	_vendor/packaging/_structures.pynu[PK!yt9+D	_vendor/packaging/__pycache__/requirements.cpython-38.pycnu[PK!"""4S	_vendor/packaging/__pycache__/markers.cpython-38.pycnu[PK!*q6v	_vendor/packaging/__pycache__/__about__.cpython-38.pycnu[PK!rj;z	_vendor/packaging/__pycache__/__init__.cpython-38.opt-1.pycnu[PK!dR

8|	_vendor/packaging/__pycache__/_structures.cpython-38.pycnu[PK!gn݇))4Ň	_vendor/packaging/__pycache__/version.cpython-38.pycnu[PK!4	_vendor/packaging/__pycache__/_compat.cpython-38.pycnu[PK!*HMHM7	_vendor/packaging/__pycache__/specifiers.cpython-38.pycnu[PK!dR

>
_vendor/packaging/__pycache__/_structures.cpython-38.opt-1.pycnu[PK!:
_vendor/packaging/__pycache__/_compat.cpython-38.opt-1.pycnu[PK!*q<
_vendor/packaging/__pycache__/__about__.cpython-38.opt-1.pycnu[PK!6	83
_vendor/packaging/__pycache__/utils.cpython-38.opt-1.pycnu[PK!*HMHM=j
_vendor/packaging/__pycache__/specifiers.cpython-38.opt-1.pycnu[PK!yt?f
_vendor/packaging/__pycache__/requirements.cpython-38.opt-1.pycnu[PK!6	2u
_vendor/packaging/__pycache__/utils.cpython-38.pycnu[PK!gn݇)):w
_vendor/packaging/__pycache__/version.cpython-38.opt-1.pycnu[PK!$ʤl"l":͡
_vendor/packaging/__pycache__/markers.cpython-38.opt-1.pycnu[PK!rj5
_vendor/packaging/__pycache__/__init__.cpython-38.pycnu[PK!'&
_vendor/packaging/utils.pynu[PK!H/ / 
_vendor/packaging/markers.pynu[PK!ơ$-$-
_vendor/packaging/version.pynu[PK!vЁ!_vendor/packaging/requirements.pynu[PK!|EymymH(_vendor/packaging/specifiers.pynu[PK!<)X_vendor/packaging/__about__.pynu[PK!XMZuu._vendor/six.pynu[PK!NB21_vendor/__pycache__/__init__.cpython-38.opt-1.pycnu[PK!L_k_k_&_vendor/__pycache__/six.cpython-38.pycnu[PK!3"@@.o_vendor/__pycache__/ordered_set.cpython-38.pycnu[PK!,4_vendor/__pycache__/pyparsing.cpython-38.pycnu[PK!3"@@4/_vendor/__pycache__/ordered_set.cpython-38.opt-1.pycnu[PK!L_k_k_,_vendor/__pycache__/six.cpython-38.opt-1.pycnu[PK!~2vd_vendor/__pycache__/pyparsing.cpython-38.opt-1.pycnu[PK!NB2+wx_vendor/__pycache__/__init__.cpython-38.pycnu[PK!D*;;ly_vendor/ordered_set.pynu[PK!fww̴_vendor/pyparsing.pynu[PK![D?_imp.pynu[PK!cHː	mHmonkey.pynu[PK!Ƶc}%}%
6]build_meta.pynu[PK!}s`zzcommand/py36compat.pynu[PK!ARRRcommand/__init__.pynu[PK!P#z	z	Dcommand/alias.pynu[PK!۵?KKcommand/install.pynu[PK!\Ҩcommand/install_egg_info.pynu[PK!pqcommand/setopt.pynu[PK!l90	G	Gcommand/bdist_egg.pynu[PK!4command/saveopts.pynu[PK!F?		command/install_scripts.pynu[PK! u}}&command/bdist_wininst.pynu[PK!ƏG)command/upload_docs.pynu[PK!ZqFcommand/upload.pynu[PK!`command/dist_info.pynu[PK!tdcommand/bdist_rpm.pynu[PK!Ԥtt$kcommand/rotate.pynu[PK!dMGG/scommand/__pycache__/easy_install.cpython-38.pycnu[PK!e4scommand/__pycache__/install_lib.cpython-38.opt-1.pycnu[PK!C5݃command/__pycache__/easy_install.cpython-38.opt-1.pycnu[PK!"
6\command/__pycache__/bdist_wininst.cpython-38.opt-1.pycnu[PK!U3.|command/__pycache__/install_lib.cpython-38.pycnu[PK!4#n)c	c	9command/__pycache__/install_egg_info.cpython-38.opt-1.pycnu[PK!j7		/¡command/__pycache__/rotate.cpython-38.opt-1.pycnu[PK!1q.command/__pycache__/sdist.cpython-38.opt-1.pycnu[PK!"
0command/__pycache__/bdist_wininst.cpython-38.pycnu[PK!IG/command/__pycache__/setopt.cpython-38.opt-1.pycnu[PK!Ilee0 command/__pycache__/develop.cpython-38.opt-1.pycnu[PK!ɀX	X	.command/__pycache__/alias.cpython-38.opt-1.pycnu[PK!4#n)c	c	3command/__pycache__/install_egg_info.cpython-38.pycnu[PK!~hyy+a
command/__pycache__/saveopts.cpython-38.pycnu[PK!Th!!'5command/__pycache__/test.cpython-38.pycnu[PK!$8/command/__pycache__/install_scripts.cpython-38.opt-1.pycnu[PK!e08command/__pycache__/install.cpython-38.opt-1.pycnu[PK!HH3Hcommand/__pycache__/py36compat.cpython-38.opt-1.pycnu[PK!j7		)L[command/__pycache__/rotate.cpython-38.pycnu[PK!k1}ecommand/__pycache__/__init__.cpython-38.opt-1.pycnu[PK!e|&&,hcommand/__pycache__/build_ext.cpython-38.pycnu[PK!I&&2Ïcommand/__pycache__/build_ext.cpython-38.opt-1.pycnu[PK!
QQ2command/__pycache__/dist_info.cpython-38.opt-1.pycnu[PK!
L4acommand/__pycache__/upload_docs.cpython-38.opt-1.pycnu[PK!1q(command/__pycache__/sdist.cpython-38.pycnu[PK!ɀX	X	(command/__pycache__/alias.cpython-38.pycnu[PK!M2f7f72Ncommand/__pycache__/bdist_egg.cpython-38.opt-1.pycnu[PK!/X11command/__pycache__/register.cpython-38.opt-1.pycnu[PK!/X+j4command/__pycache__/register.cpython-38.pycnu[PK!
QQ,7command/__pycache__/dist_info.cpython-38.pycnu[PK!~hyy1e=command/__pycache__/saveopts.cpython-38.opt-1.pycnu[PK!.?UU+?Acommand/__pycache__/egg_info.cpython-38.pycnu[PK!e*command/__pycache__/install.cpython-38.pycnu[PK!UTSS)command/__pycache__/upload.cpython-38.pycnu[PK!EP2;command/__pycache__/bdist_rpm.cpython-38.opt-1.pycnu[PK!.?UU1command/__pycache__/egg_info.cpython-38.opt-1.pycnu[PK!Ilee*command/__pycache__/develop.cpython-38.pycnu[PK!Ėką		-1command/__pycache__/build_clib.cpython-38.pycnu[PK!IG);command/__pycache__/setopt.cpython-38.pycnu[PK!EP,Mcommand/__pycache__/bdist_rpm.cpython-38.pycnu[PK!Ėką		3Ucommand/__pycache__/build_clib.cpython-38.opt-1.pycnu[PK!UTSS/^command/__pycache__/upload.cpython-38.opt-1.pycnu[PK!$2scommand/__pycache__/install_scripts.cpython-38.pycnu[PK!M2f7f7,|command/__pycache__/bdist_egg.cpython-38.pycnu[PK!Xr!!+command/__pycache__/build_py.cpython-38.pycnu[PK!Dѳ.command/__pycache__/upload_docs.cpython-38.pycnu[PK!Xr!!1command/__pycache__/build_py.cpython-38.opt-1.pycnu[PK!HH-8command/__pycache__/py36compat.cpython-38.pycnu[PK!k+#command/__pycache__/__init__.cpython-38.pycnu[PK!Th!!-&command/__pycache__/test.cpython-38.opt-1.pycnu[PK!])BttLHcommand/launcher manifest.xmlnu[PK!ݖς%%
Kcommand/test.pynu[PK!=pcommand/develop.pynu[PK!/(config/_validate_pyproject/__pycache__/formats.cpython-311.pycnu[PK!"rhM	M	?(config/_validate_pyproject/__pycache__/__init__.cpython-311.pycnu[PK!
rP(config/_validate_pyproject/__pycache__/fastjsonschema_exceptions.cpython-311.pycnu[PK!ֿQ(config/_validate_pyproject/__pycache__/fastjsonschema_validations.cpython-311.pycnu[PK!H@+config/_validate_pyproject/__pycache__/extra_validations.cpython-311.pycnu[PK!V@0O0OFB+config/_validate_pyproject/__pycache__/error_reporting.cpython-311.pycnu[PK!G/F,config/_validate_pyproject/extra_validations.pynu[PK!o^7LL7K,config/_validate_pyproject/fastjsonschema_exceptions.pynu[PK!N,,-{R,config/_validate_pyproject/error_reporting.pynu[PK!fLL8~,config/_validate_pyproject/fastjsonschema_validations.pynu[PK![&0config/_validate_pyproject/__init__.pynu[PK!aAA+0config/__pycache__/setupcfg.cpython-311.pycnu[PK!Ɠnn)#1config/__pycache__/expand.cpython-311.pycnu[PK!--+z1config/__pycache__/__init__.cpython-311.pycnu[PK!'	qkqk01config/__pycache__/pyprojecttoml.cpython-311.pycnu[PK!ԽDXDX72config/__pycache__/_apply_pyprojecttoml.cpython-311.pycnu[PK!v??~_2config/expand.pynu[PK!Tnbnb}2config/setupcfg.pynu[PK!*aa-3config/__init__.pynu[PK!E_V4V43config/_apply_pyprojecttoml.pynu[PK!zkK
hKhKt;3config/pyprojecttoml.pynu[PK!i7?Q?Q#3discovery.pynu[PK!xii+3extern/__pycache__/__init__.cpython-311.pycnu[PK!Q	b3errors.pynu[PK!6
3_importlib.pynu[PK!.3command/build.pynu[PK!#l2yy4command/editable_wheel.pynu[PK!9V9V-4command/__pycache__/build_ext.cpython-311.pycnu[PK!l*4command/__pycache__/rotate.cpython-311.pycnu[PK!~ţ.4command/__pycache__/py36compat.cpython-311.pycnu[PK!&g4**+
5command/__pycache__/develop.cpython-311.pycnu[PK!+/d/d-85command/__pycache__/bdist_egg.cpython-311.pycnu[PK!w3s5command/__pycache__/install_scripts.cpython-311.pycnu[PK!+,9:command/__pycache__/register.cpython-311.pycnu[PK!,544)>:command/__pycache__/sdist.cpython-311.pycnu[PK!II/s:command/__pycache__/install_lib.cpython-311.pycnu[PK!6_!==*:command/__pycache__/setopt.cpython-311.pycnu[PK!kAe.6:command/__pycache__/build_clib.cpython-311.pycnu[PK!arSUSU/:_vendor/__pycache__/ordered_set.cpython-311.pycnu[PK!/,;_vendor/__pycache__/__init__.cpython-311.pycnu[PK!0>>(';_vendor/__pycache__/zipp.cpython-311.pycnu[PK!	51S;_vendor/__pycache__/typing_extensions.cpython-311.pycnu[PK!kh

&0<_vendor/importlib_resources/_compat.pynu[PK!D

&=_vendor/importlib_resources/readers.pynu[PK!OT{{@\=_vendor/importlib_resources/__pycache__/__init__.cpython-311.pycnu[PK!s  ?G=_vendor/importlib_resources/__pycache__/readers.cpython-311.pycnu[PK!7?6=_vendor/importlib_resources/__pycache__/_common.cpython-311.pycnu[PK!{tt;G=_vendor/importlib_resources/__pycache__/abc.cpython-311.pycnu[PK!BBe=_vendor/importlib_resources/__pycache__/_itertools.cpython-311.pycnu[PK!iE?l=_vendor/importlib_resources/__pycache__/_legacy.cpython-311.pycnu[PK!_,00>=_vendor/importlib_resources/__pycache__/simple.cpython-311.pycnu[PK!bY?=_vendor/importlib_resources/__pycache__/_compat.cpython-311.pycnu[PK!8*8*A=_vendor/importlib_resources/__pycache__/_adapters.cpython-311.pycnu[PK!.1

&=_vendor/importlib_resources/_legacy.pynu[PK!0Q}

&=_vendor/importlib_resources/_common.pynu[PK!'(=_vendor/importlib_resources/_adapters.pynu[PK!c%>_vendor/importlib_resources/simple.pynu[PK!oq'>_vendor/importlib_resources/__init__.pynu[PK!htt)i>_vendor/importlib_resources/_itertools.pynu[PK!}>.."6>_vendor/importlib_resources/abc.pynu[PK!{$$%,>_vendor/importlib_metadata/_compat.pynu[PK!C/4>_vendor/importlib_metadata/__pycache__/_collections.cpython-311.pycnu[PK!=	?r=>_vendor/importlib_metadata/__pycache__/__init__.cpython-311.pycnu[PK!vY?_vendor/importlib_metadata/__pycache__/_compat.cpython-311.pycnu[PK!bEE@d?_vendor/importlib_metadata/__pycache__/_adapters.cpython-311.pycnu[PK!:oiOO(t?_vendor/importlib_metadata/_functools.pynu[PK!xvv#'?_vendor/importlib_metadata/_text.pynu[PK!mFF'?_vendor/importlib_metadata/_adapters.pynu[PK!.#?_vendor/importlib_metadata/_meta.pynu[PK!suu&b?_vendor/importlib_metadata/__init__.pynu[PK!*j@_vendor/importlib_metadata/_collections.pynu[PK!:(@_vendor/importlib_metadata/_itertools.pynu[PK!aLmTmT@_vendor/typing_extensions.pynu[PK!:@@5kA_vendor/packaging/__pycache__/markers.cpython-311.pycnu[PK!  :
A_vendor/packaging/__pycache__/requirements.cpython-311.pycnu[PK!s7A_vendor/packaging/__pycache__/__about__.cpython-311.pycnu[PK!}uu6A_vendor/packaging/__pycache__/__init__.cpython-311.pycnu[PK!٧9A_vendor/packaging/__pycache__/_structures.cpython-311.pycnu[PK!}]]3A_vendor/packaging/__pycache__/utils.cpython-311.pycnu[PK!6SS2jA_vendor/packaging/__pycache__/tags.cpython-311.pycnu[PK!:HUU5rOB_vendor/packaging/__pycache__/version.cpython-311.pycnu[PK!B338B_vendor/packaging/__pycache__/_manylinux.cpython-311.pycnu[PK!!8B_vendor/packaging/__pycache__/_musllinux.cpython-311.pycnu[PK!w\#}}8B_vendor/packaging/__pycache__/specifiers.cpython-311.pycnu[PK!'^^C_vendor/packaging/tags.pynu[PK!t1C_vendor/packaging/_musllinux.pynu[PK!*:c,,dC_vendor/packaging/_manylinux.pynu[PK!ahD_vendor/more_itertools/more.pynu[PK!DJree;E_vendor/more_itertools/__pycache__/__init__.cpython-311.pycnu[PK!|N]]:E_vendor/more_itertools/__pycache__/recipes.cpython-311.pycnu[PK!FF7IF_vendor/more_itertools/__pycache__/more.cpython-311.pycnu[PK!!Q8RR"`H_vendor/more_itertools/__init__.pynu[PK!ʀ??!H_vendor/more_itertools/recipes.pynu[PK!(p"h"h8H_vendor/jaraco/text/__pycache__/__init__.cpython-311.pycnu[PK!]"ʝ<<_:I_vendor/jaraco/text/__init__.pynu[PK!2& ,,KwI_vendor/jaraco/context.pynu[PK!aP3I_vendor/jaraco/__pycache__/__init__.cpython-311.pycnu[PK!A%%2+I_vendor/jaraco/__pycache__/context.cpython-311.pycnu[PK!vtxOxO4I_vendor/jaraco/__pycache__/functools.cpython-311.pycnu[PK!44xJ_vendor/jaraco/functools.pynu[PK!8J_vendor/jaraco/__init__.pynu[PK!28J_vendor/tomli/__pycache__/__init__.cpython-311.pycnu[PK!0;J_vendor/tomli/__pycache__/_types.cpython-311.pycnu[PK!*?Syxx1M=J_vendor/tomli/__pycache__/_parser.cpython-311.pycnu[PK!X\-tJ_vendor/tomli/__pycache__/_re.cpython-311.pycnu[PK!iiXiXJ_vendor/tomli/_parser.pynu[PK!u1P!K_vendor/tomli/_re.pynu[PK!%-K_vendor/tomli/__init__.pynu[PK!g.K_vendor/tomli/_types.pynu[PK!zx#*#*-0K_vendor/pyparsing/unicode.pynu[PK!e~22ZK_vendor/pyparsing/common.pynu[PK!<ǀ>A>AoK_vendor/pyparsing/core.pynu[PK!ڊ::4N_vendor/pyparsing/__pycache__/common.cpython-311.pycnu[PK!=  6\	O_vendor/pyparsing/__pycache__/__init__.cpython-311.pycnu[PK!Z772*O_vendor/pyparsing/__pycache__/util.cpython-311.pycnu[PK!ÉeF<F<5bO_vendor/pyparsing/__pycache__/unicode.cpython-311.pycnu[PK!g;P!P!5O_vendor/pyparsing/__pycache__/actions.cpython-311.pycnu[PK!Ga<<2OO_vendor/pyparsing/__pycache__/core.cpython-311.pycnu[PK!}228wS_vendor/pyparsing/__pycache__/exceptions.cpython-311.pycnu[PK!­5tLtL51T_vendor/pyparsing/__pycache__/testing.cpython-311.pycnu[PK!-5x~T_vendor/pyparsing/__pycache__/helpers.cpython-311.pycnu[PK!y5PU_vendor/pyparsing/__pycache__/results.cpython-311.pycnu[PK!*٘٘U_vendor/pyparsing/helpers.pynu[PK!/HW_vendor/pyparsing/diagram/__pycache__/__init__.cpython-311.pycnu[PK!-2Ut\t\% W_vendor/pyparsing/diagram/__init__.pynu[PK!Bq8  VX_vendor/zipp.pynu[PK!ˆбxX_distutils/log.pynu[PK!

X_distutils/spawn.pynu[PK!Q800X_distutils/text_file.pynu[PK!5<*B*BX_distutils/cygwinccompiler.pynu[PK!MQMQqY_distutils/_msvccompiler.pynu[PK!IS^""	SY_distutils/core.pynu[PK!:k[[uY_distutils/msvccompiler.pynu[PK!k"#

5Y_distutils/dep_util.pynu[PK!]II*Y_distutils/__pycache__/cmd.cpython-311.pycnu[PK!@>)-O*Z_distutils/__pycache__/errors.cpython-311.pycnu[PK!G,G,0wEZ_distutils/__pycache__/text_file.cpython-311.pycnu[PK!-p!!3rZ_distutils/__pycache__/_collections.cpython-311.pycnu[PK!R1VV+Z_distutils/__pycache__/_log.cpython-311.pycnu[PK!6RVV4ÕZ_distutils/__pycache__/msvc9compiler.cpython-311.pycnu[PK!e7vii3}[_distutils/__pycache__/msvccompiler.cpython-311.pycnu[PK!3PwVwV0z[_distutils/__pycache__/sysconfig.cpython-311.pycnu[PK!

*Q[_distutils/__pycache__/log.cpython-311.pycnu[PK!>	E	E/p[_distutils/__pycache__/filelist.cpython-311.pycnu[PK![++0*\_distutils/__pycache__/ccompiler.cpython-311.pycnu[PK!FkMoo/c\_distutils/__pycache__/__init__.cpython-311.pycnu[PK!8((/1\_distutils/__pycache__/dir_util.cpython-311.pycnu[PK!vtsO+M]_distutils/__pycache__/dist.cpython-311.pycnu[PK!m['1]_distutils/__pycache__/py39compat.cpython-311.pycnu[PK!BCC3']_distutils/__pycache__/fancy_getopt.cpython-311.pycnu[PK!5PQQ+.^_distutils/__pycache__/util.cpython-311.pycnu[PK!W@@4%^_distutils/__pycache__/unixccompiler.cpython-311.pycnu[PK!$+9))37^_distutils/__pycache__/archive_util.cpython-311.pycnu[PK!vF1V^_distutils/__pycache__/py38compat.cpython-311.pycnu[PK!,e^_distutils/__pycache__/debug.cpython-311.pycnu[PK!c
'
'+C^_distutils/__pycache__/core.cpython-311.pycnu[PK!O/__distutils/__pycache__/dep_util.cpython-311.pycnu[PK!/0b0b4'__distutils/__pycache__/_msvccompiler.cpython-311.pycnu[PK!9-k__distutils/__pycache__/config.cpython-311.pycnu[PK!5))0__distutils/__pycache__/file_util.cpython-311.pycnu[PK!fE((0__distutils/__pycache__/extension.cpython-311.pycnu[PK!S
R1M__distutils/__pycache__/_functools.cpython-311.pycnu[PK!443K__distutils/__pycache__/bcppcompiler.cpython-311.pycnu[PK!Jzz4t.`_distutils/__pycache__/_macos_compat.cpython-311.pycnu[PK!vQ,,.R1`_distutils/__pycache__/version.cpython-311.pycnu[PK!eM,C^`_distutils/__pycache__/spawn.cpython-311.pycnu[PK!x5x561p`_distutils/__pycache__/cygwinccompiler.cpython-311.pycnu[PK!Ժ/7`_distutils/__pycache__/versionpredicate.cpython-311.pycnu[PK!. A~`_distutils/dist.pynu[PK!Oa_distutils/_functools.pynu[PK!~T~Ta_distutils/sysconfig.pynu[PK!>vv]a_distutils/msvc9compiler.pynu[PK!n

Wb_distutils/errors.pynu[PK!8700eb_distutils/version.pynu[PK!w11 b_distutils/command/bdist_dumb.pynu[PK!SOVNN'b_distutils/command/_framework_compat.pynu[PK!'b_distutils/command/build.pynu[PK!  !b_distutils/command/install_lib.pynu[PK!--b_distutils/command/register.pynu[PK!_IƂvv8+c_distutils/command/__pycache__/build_ext.cpython-311.pycnu[PK!rg[4c_distutils/command/__pycache__/clean.cpython-311.pycnu[PK!>+c_distutils/command/__pycache__/install_scripts.cpython-311.pycnu[PK!!Jxg((5/c_distutils/command/__pycache__/upload.cpython-311.pycnu[PK!S@c_distutils/command/__pycache__/_framework_compat.cpython-311.pycnu[PK!rr6c_distutils/command/__pycache__/install.cpython-311.pycnu[PK!^^7Pd_distutils/command/__pycache__/__init__.cpython-311.pycnu[PK!?@?DSd_distutils/command/__pycache__/install_egg_info.cpython-311.pycnu[PK!􅰬4Uhd_distutils/command/__pycache__/check.cpython-311.pycnu[PK!EE7Od_distutils/command/__pycache__/build_py.cpython-311.pycnu[PK!{CC9d_distutils/command/__pycache__/py37compat.cpython-311.pycnu[PK!aL[[8bd_distutils/command/__pycache__/bdist_rpm.cpython-311.pycnu[PK!_
;-e_distutils/command/__pycache__/install_data.cpython-311.pycnu[PK!-e??5?=e_distutils/command/__pycache__/config.cpython-311.pycnu[PK!+~4C}e_distutils/command/__pycache__/build.cpython-311.pycnu[PK!ؘx==7e_distutils/command/__pycache__/register.cpython-311.pycnu[PK!Z=]]4e_distutils/command/__pycache__/sdist.cpython-311.pycnu[PK!  " ":x0f_distutils/command/__pycache__/install_lib.cpython-311.pycnu[PK!Ga4Sf_distutils/command/__pycache__/bdist.cpython-311.pycnu[PK!RU<kf_distutils/command/__pycache__/build_scripts.cpython-311.pycnu[PK!O)o	o	>qf_distutils/command/__pycache__/install_headers.cpython-311.pycnu[PK!є9Nf_distutils/command/__pycache__/build_clib.cpython-311.pycnu[PK!W9Kf_distutils/command/__pycache__/bdist_dumb.cpython-311.pycnu[PK!,

Mf_distutils/command/clean.pynu[PK!t=J=Jpf_distutils/command/sdist.pynu[PK!9R)S+
+
&g_distutils/command/install_egg_info.pynu[PK!my*g_distutils/command/check.pynu[PK!Ch @g_distutils/command/py37compat.pynu[PK!iTkkCg_distutils/command/install.pynu[PK!jPg_distutils/command/upload.pynu[PK!d]!T!Tg_distutils/command/bdist_rpm.pynu[PK!{{!h_distutils/command/build_ext.pynu[PK!7=3=3h_distutils/command/config.pynu[PK!v3;VV h_distutils/command/build_clib.pynu[PK!84,KK#=h_distutils/command/build_scripts.pynu[PK!:%i_distutils/command/install_scripts.pynu[PK!;i_distutils/command/__init__.pynu[PK!.o@o@~i_distutils/command/build_py.pynu[PK!n1;Ui_distutils/command/bdist.pynu[PK!"@ki_distutils/command/install_data.pynu[PK!*Rj&%vi_distutils/command/install_headers.pynu[PK!	OO{i_distutils/util.pynu[PK!];Fi_distutils/_macos_compat.pynu[PK!=&-++i_distutils/_log.pynu[PK!i_distutils/py38compat.pynu[PK!3bbi_distutils/dir_util.pynu[PK!5|!|!Ci_distutils/archive_util.pynu[PK!	j_distutils/file_util.pynu[PK!۟FF$/j_distutils/cmd.pynu[PK!]4:))vj_distutils/extension.pynu[PK!2

^j_distutils/versionpredicate.pynu[PK!%_4_4j_distutils/filelist.pynu[PK!$Fq^j_distutils/config.pynu[PK!_H%}j_distutils/debug.pynu[PK!C
cKj_distutils/py39compat.pynu[PK!Bj_distutils/__init__.pynu[PK!| Rk_distutils/ccompiler.pynu[PK!F9.:.:k_distutils/bcppcompiler.pynu[PK!1xExEk_distutils/fancy_getopt.pynu[PK!`a:l_distutils/_collections.pynu[PK!188Ol_distutils/unixccompiler.pynu[PK!T
l_itertools.pynu[PK!‹l_reqs.pynu[PK!
{AA
lconfig.pycnu[PK!KK
!lpy36compat.pynu[PK!Oxlarchive_util.pyonu[PK!"lunicode_utils.pyonu[PK!x-llib2to3_ex.pycnu[PK!c.gmdep_util.pycnu[PK!<k$jj	mpy31compat.pyonu[PK!g[⣠mmsvc.pyonu[PK!Dm..cmpy36compat.pyonu[PK!kBBϺmversion.pycnu[PK!qqLmextern/__init__.pyonu[PK!qqmextern/__init__.pycnu[PK!j!m__init__.pyonu[PK!jKmglob.pycnu[PK!I
??npackage_index.pyonu[PK!OxCnarchive_util.pycnu[PK!qzndist.pyonu[PK!Zonamespaces.pycnu[PK!A|<D!D!nossl_support.pyonu[PK!I
??opackage_index.pycnu[PK!%Yr	r	
+pextension.pycnu[PK!Mc[65ppy27compat.pyonu[PK!X9pwindows_support.pyonu[PK!Mc[>ppy27compat.pycnu[PK!%Yr	r	
Cpextension.pyonu[PK!g[⣠Lpmsvc.pycnu[PK!x-plib2to3_ex.pyonu[PK!Üv$v$ppep425tags.pycnu[PK!
{AA
Nqconfig.pyonu[PK!HJMM!]q_vendor/packaging/_structures.pyonu[PK!>;j8j8nq_vendor/packaging/version.pycnu[PK!kVFccզq_vendor/packaging/__init__.pyonu[PK!fq_vendor/packaging/_compat.pycnu[PK!b
bb q_vendor/packaging/specifiers.pyonu[PK!90r_vendor/packaging/__about__.pyonu[PK!:=..Rr_vendor/packaging/markers.pycnu[PK!90VDr_vendor/packaging/__about__.pycnu[PK!&p,,"Gr_vendor/packaging/requirements.pyonu[PK!HJMM!8\r_vendor/packaging/_structures.pycnu[PK!-.-.lr_vendor/packaging/markers.pyonu[PK!5WRRPr_vendor/packaging/utils.pycnu[PK!fr_vendor/packaging/_compat.pyonu[PK!>;j8j8r_vendor/packaging/version.pyonu[PK!&p,,"r_vendor/packaging/requirements.pycnu[PK!5WRRKr_vendor/packaging/utils.pyonu[PK!kVFccr_vendor/packaging/__init__.pycnu[PK!b
bb r_vendor/packaging/specifiers.pycnu[PK!nMeXs_vendor/__init__.pyonu[PK!V!o{o{Ys_vendor/six.pycnu[PK!IE`s_vendor/pyparsing.pyonu[PK!V!o{o{[dw_vendor/six.pyonu[PK!IE	w_vendor/pyparsing.pycnu[PK!nMeo{_vendor/__init__.pycnu[PK!I
o{launch.pyonu[PK!	IIt{sandbox.pyonu[PK!Gi2{command/setopt.pyonu[PK!PJ{command/rotate.pycnu[PK!~{command/register.pycnu[PK!PJ{command/rotate.pyonu[PK!-υ9{command/upload_docs.pyonu[PK!|command/py36compat.pyonu[PK!ѽUrYY%|command/install.pyonu[PK!n[rr9|command/__init__.pyonu[PK!
+KKK=|command/install_scripts.pyonu[PK!tddH|command/upload.pycnu[PK!хO|command/dist_info.pycnu[PK!'zzV|command/bdist_rpm.pycnu[PK!Gl((^|command/test.pyonu[PK!x(L|command/sdist.pyonu[PK!|command/develop.pycnu[PK!g|command/upload_docs.pycnu[PK!&99|command/easy_install.pycnu[PK! 99~command/easy_install.pyonu[PK!Pz{UXcommand/alias.pycnu[PK!500O_vendor/packaging/__pycache__/_structures.cpython-36.opt-1.pycnu[PK!098Z_vendor/packaging/__pycache__/utils.cpython-36.opt-1.pycnu[PK!tsMM7\_vendor/packaging/__pycache__/specifiers.cpython-36.pycnu[PK!\Ov?~_vendor/packaging/__pycache__/requirements.cpython-36.opt-1.pycnu[PK!{

8_vendor/packaging/__pycache__/_structures.cpython-36.pycnu[PK!1EŜ:Ō_vendor/packaging/__pycache__/_compat.cpython-36.opt-1.pycnu[PK!1EŜ4
Ɍ_vendor/packaging/__pycache__/_compat.cpython-36.pycnu[PK!ckX5
͌_vendor/packaging/__pycache__/__init__.cpython-36.pycnu[PK!tsMM=Lό_vendor/packaging/__pycache__/specifiers.cpython-36.opt-1.pycnu[PK!ckX;_vendor/packaging/__pycache__/__init__.cpython-36.opt-1.pycnu[PK! \I0a"a"4 _vendor/packaging/__pycache__/markers.cpython-36.pycnu[PK!092A_vendor/packaging/__pycache__/utils.cpython-36.pycnu[PK!Z_Z_&C_vendor/__pycache__/six.cpython-36.pycnu[PK!0
KK,_vendor/__pycache__/pyparsing.cpython-36.pycnu[PK!Z_Z_,6_vendor/__pycache__/six.cpython-36.opt-1.pycnu[PK!-Kqq+_vendor/__pycache__/__init__.cpython-36.pycnu[PK!-Kqq1_vendor/__pycache__/__init__.cpython-36.opt-1.pycnu[PK!0
KK2_vendor/__pycache__/pyparsing.cpython-36.opt-1.pycnu[PK!ޅ&/7(command/__pycache__/setopt.cpython-36.opt-1.pycnu[PK!'Ex%%2D:command/__pycache__/dist_info.cpython-36.opt-1.pycnu[PK!WQ^99*?command/__pycache__/install.cpython-36.pycnu[PK!V\9:	:	3^Ocommand/__pycache__/install_egg_info.cpython-36.pycnu[PK!}'Xcommand/__pycache__/test.cpython-36.pycnu[PK!d-.W.xcommand/__pycache__/sdist.cpython-36.opt-1.pycnu[PK!(882푔command/__pycache__/bdist_egg.cpython-36.opt-1.pycnu[PK!)w##)Qʔcommand/__pycache__/upload.cpython-36.pycnu[PK!Fa.ϔcommand/__pycache__/upload_docs.cpython-36.pycnu[PK!-/command/__pycache__/easy_install.cpython-36.pycnu[PK!c!QQ+command/__pycache__/egg_info.cpython-36.pycnu[PK!.
		/7command/__pycache__/rotate.cpython-36.opt-1.pycnu[PK!{AD	D	-Acommand/__pycache__/build_clib.cpython-36.pycnu[PK!9Y5	5	(Kcommand/__pycache__/alias.cpython-36.pycnu[PK!uPP1Ucommand/__pycache__/saveopts.cpython-36.opt-1.pycnu[PK!}-Xcommand/__pycache__/test.cpython-36.opt-1.pycnu[PK!}5xcommand/__pycache__/easy_install.cpython-36.opt-1.pycnu[PK!0!0!+vcommand/__pycache__/build_py.cpython-36.pycnu[PK!c!QQ1(command/__pycache__/egg_info.cpython-36.opt-1.pycnu[PK!V~g&&2$command/__pycache__/build_ext.cpython-36.opt-1.pycnu[PK!Kpp4[command/__pycache__/upload_docs.cpython-36.opt-1.pycnu[PK!(88,/)command/__pycache__/bdist_egg.cpython-36.pycnu[PK!V1acommand/__pycache__/register.cpython-36.opt-1.pycnu[PK!V,ccommand/__pycache__/bdist_rpm.cpython-36.pycnu[PK!'Ex%%,jcommand/__pycache__/dist_info.cpython-36.pycnu[PK!wY6o0tpcommand/__pycache__/bdist_wininst.cpython-36.pycnu[PK!uPP+Ytcommand/__pycache__/saveopts.cpython-36.pycnu[PK!I%8xcommand/__pycache__/install_scripts.cpython-36.opt-1.pycnu[PK!hrԃ4command/__pycache__/install_lib.cpython-36.opt-1.pycnu[PK!d-.W(퐘command/__pycache__/sdist.cpython-36.pycnu[PK!I%2command/__pycache__/install_scripts.cpython-36.pycnu[PK!VR3鲘command/__pycache__/py36compat.cpython-36.opt-1.pycnu[PK!WQ^990Řcommand/__pycache__/install.cpython-36.opt-1.pycnu[PK!V2Ԙcommand/__pycache__/bdist_rpm.cpython-36.opt-1.pycnu[PK!e.ۘcommand/__pycache__/install_lib.cpython-36.pycnu[PK!V\9:	:	9command/__pycache__/install_egg_info.cpython-36.opt-1.pycnu[PK!.
		)Vcommand/__pycache__/rotate.cpython-36.pycnu[PK!)w##/vcommand/__pycache__/upload.cpython-36.opt-1.pycnu[PK!ޅ&)command/__pycache__/setopt.cpython-36.pycnu[PK!VR-command/__pycache__/py36compat.cpython-36.pycnu[PK!0!0!1)command/__pycache__/build_py.cpython-36.opt-1.pycnu[PK!&&,Jcommand/__pycache__/build_ext.cpython-36.pycnu[PK!5+qcommand/__pycache__/__init__.cpython-36.pycnu[PK!9Y5	5	.tcommand/__pycache__/alias.cpython-36.opt-1.pycnu[PK!51~command/__pycache__/__init__.cpython-36.opt-1.pycnu[PK!͆*~command/__pycache__/develop.cpython-36.pycnu[PK!V+command/__pycache__/register.cpython-36.pycnu[PK!{AD	D	3command/__pycache__/build_clib.cpython-36.opt-1.pycnu[PK!͆0command/__pycache__/develop.cpython-36.opt-1.pycnu[PK!wY6o6ۿcommand/__pycache__/bdist_wininst.cpython-36.opt-1.pycnu[PK!T`55!Ù__pycache__/monkey.cpython-39.pycnu[PK!W'L֙__pycache__/archive_util.cpython-39.pycnu[PK!v~__pycache__/dist.cpython-39.pycnu[PK!3p-##%g|__pycache__/build_meta.cpython-39.pycnu[PK!!]__pycache__/launch.cpython-39.pycnu[PK! (c__pycache__/unicode_utils.cpython-39.pycnu[PK!Ѭ(E__pycache__/package_index.cpython-39.pycnu[PK!谌߇I)__pycache__/msvc.cpython-39.pycnu[PK! ћ__pycache__/wheel.cpython-39.pycnu[PK!işӉ#__pycache__/dep_util.cpython-39.pycnu[PK!QT$__pycache__/installer.cpython-39.pycnu[PK!_,
+$B__pycache__/extension.cpython-39.pycnu[PK!4<0QQ!^__pycache__/config.cpython-39.pycnu[PK!|%9W__pycache__/py34compat.cpython-39.pycnu[PK!"Y__pycache__/depends.cpython-39.pycnu[PK!v8tt"n__pycache__/version.cpython-39.pycnu[PK!R)Egp__pycache__/glob.cpython-39.pycnu[PK!s@@%T__pycache__/namespaces.cpython-39.pycnu[PK!>7!鍜__pycache__/errors.cpython-39.pycnu[PK!On*"*"#__pycache__/__init__.cpython-39.pycnu[PK!g=="9__pycache__/sandbox.cpython-39.pycnu[PK!UUG__pycache__/_imp.cpython-39.pycnu[PK!{cVV/__pycache__/_deprecation_warning.cpython-39.pycnu[PK!//*__pycache__/windows_support.cpython-39.pycnu[PK!c*)extern/__pycache__/__init__.cpython-39.pycnu[PK!KDD/command/__pycache__/easy_install.cpython-39.pycnu[PK!wrr)command/__pycache__/setopt.cpython-39.pycnu[PK!vL-command/__pycache__/py36compat.cpython-39.pycnu[PK!Z8>33,-command/__pycache__/bdist_egg.cpython-39.pycnu[PK!Pnss	s	({`command/__pycache__/alias.cpython-39.pycnu[PK!f*,Fjcommand/__pycache__/dist_info.cpython-39.pycnu[PK!f'@		-Epcommand/__pycache__/build_clib.cpython-39.pycnu[PK!?		3vzcommand/__pycache__/install_egg_info.cpython-39.pycnu[PK!CAA.command/__pycache__/upload_docs.cpython-39.pycnu[PK!r仦		2#command/__pycache__/install_scripts.cpython-39.pycnu[PK!g++command/__pycache__/build_py.cpython-39.pycnu[PK!4gVV.@ƞcommand/__pycache__/install_lib.cpython-39.pycnu[PK!U*֞command/__pycache__/install.cpython-39.pycnu[PK!Ŧv}}+command/__pycache__/register.cpython-39.pycnu[PK!tU))*command/__pycache__/develop.cpython-39.pycnu[PK!K"d+2command/__pycache__/__init__.cpython-39.pycnu[PK!/J
V
V+6command/__pycache__/egg_info.cpython-39.pycnu[PK!#$+\command/__pycache__/saveopts.cpython-39.pycnu[PK!3nk(`command/__pycache__/sdist.cpython-39.pycnu[PK!)'({command/__pycache__/test.cpython-39.pycnu[PK!``,command/__pycache__/bdist_rpm.cpython-39.pycnu[PK!cWbb)ȡcommand/__pycache__/upload.cpython-39.pycnu[PK![v&&,command/__pycache__/build_ext.cpython-39.pycnu[PK!Z
-		)r̟command/__pycache__/rotate.cpython-39.pycnu[PK!Ng,֟_vendor/__pycache__/pyparsing.cpython-39.pycnu[PK!|y.@.@._vendor/__pycache__/ordered_set.cpython-39.pycnu[PK!U+Y*_vendor/__pycache__/__init__.cpython-39.pycnu[PK!.3v8+_vendor/packaging/__pycache__/_structures.cpython-39.pycnu[PK!V647_vendor/packaging/__pycache__/_compat.cpython-39.pycnu[PK!spc2<_vendor/packaging/__pycache__/utils.cpython-39.pycnu[PK!s}##9C_vendor/packaging/__pycache__/requirements.cpython-39.pycnu[PK!%|:4:443T_vendor/packaging/__pycache__/version.cpython-39.pycnu[PK!xO.f6ш_vendor/packaging/__pycache__/__about__.cpython-39.pycnu[PK!=WbPP7'_vendor/packaging/__pycache__/specifiers.cpython-39.pycnu[PK!"[/CC1'ݣ_vendor/packaging/__pycache__/tags.cpython-39.pycnu[PK!"AVV5(!_vendor/packaging/__pycache__/__init__.cpython-39.pycnu[PK!GG$$4#_vendor/packaging/__pycache__/markers.cpython-39.pycnu[PK!{4H_vendor/packaging/__pycache__/_typing.cpython-39.pycnu[PK!n:O_vendor/packaging/_typing.pynu[PK!.->F>F9V_vendor/more_itertools/__pycache__/recipes.cpython-39.pycnu[PK!Dw6A_vendor/more_itertools/__pycache__/more.cpython-39.pycnu[PK!hx"N==:K_vendor/more_itertools/__pycache__/__init__.cpython-39.pycnu[PK!v;992̧_distutils/__pycache__/msvccompiler.cpython-39.pycnu[PK!\C.5_distutils/__pycache__/dep_util.cpython-39.pycnu[PK!R/_distutils/__pycache__/file_util.cpython-39.pycnu[PK!DOoo6*_distutils/__pycache__/versionpredicate.cpython-39.pycnu[PK!Goo/?_distutils/__pycache__/extension.cpython-39.pycnu[PK!ONl33,d[_distutils/__pycache__/config.cpython-39.pycnu[PK!W77*i_distutils/__pycache__/util.cpython-39.pycnu[PK!
+2_distutils/__pycache__/bcppcompiler.cpython-39.pycnu[PK!)-J_distutils/__pycache__/version.cpython-39.pycnu[PK!$6u	u	)٨_distutils/__pycache__/log.cpython-39.pycnu[PK!Y1Y1/_distutils/__pycache__/sysconfig.cpython-39.pycnu[PK!T^Ј""5D_distutils/__pycache__/cygwinccompiler.cpython-39.pycnu[PK!p##.18_distutils/__pycache__/dir_util.cpython-39.pycnu[PK!
Bc!c!/O_distutils/__pycache__/text_file.cpython-39.pycnu[PK!C,tq_distutils/__pycache__/errors.cpython-39.pycnu[PK!&%6%63_distutils/__pycache__/_msvccompiler.cpython-39.pycnu[PK!Xg.F_distutils/__pycache__/__init__.cpython-39.pycnu[PK!
Mhh*_distutils/__pycache__/core.cpython-39.pycnu[PK!5y0`ک_distutils/__pycache__/py35compat.cpython-39.pycnu[PK!VB3fݩ_distutils/__pycache__/unixccompiler.cpython-39.pycnu[PK!7o&66)_distutils/__pycache__/cmd.cpython-39.pycnu[PK!N+/_distutils/__pycache__/spawn.cpython-39.pycnu[PK!N<DD3;_distutils/__pycache__/msvc9compiler.cpython-39.pycnu[PK!gP3_distutils/command/__pycache__/bdist.cpython-39.pycnu[PK!:G٠!!;؏_distutils/command/__pycache__/bdist_wininst.cpython-39.pycnu[PK!Ֆ3_distutils/command/__pycache__/check.cpython-39.pycnu[PK!4(::8ƪ_distutils/command/__pycache__/py37compat.cpython-39.pycnu[PK!W	nn8ʪ_distutils/command/__pycache__/bdist_dumb.cpython-39.pycnu[PK!lŻ**8٪_distutils/command/__pycache__/build_clib.cpython-39.pycnu[PK!_3_distutils/command/__pycache__/clean.cpython-39.pycnu[PK!r$66>_distutils/command/__pycache__/install_egg_info.cpython-39.pycnu[PK!&T=_distutils/command/__pycache__/install_headers.cpython-39.pycnu[PK!nSN(N(4*
_distutils/command/__pycache__/config.cpython-39.pycnu[PK!c=2_distutils/command/__pycache__/install_scripts.cpython-39.pycnu[PK!$&&6<_distutils/command/__pycache__/build_py.cpython-39.pycnu[PK!]	uW	W	:c_distutils/command/__pycache__/install_data.cpython-39.pycnu[PK!!DD9l_distutils/command/__pycache__/install_lib.cpython-39.pycnu[PK!|4j6j65_distutils/command/__pycache__/install.cpython-39.pycnu[PK!fo!o!6X_distutils/command/__pycache__/register.cpython-39.pycnu[PK!,EE6-ګ_distutils/command/__pycache__/__init__.cpython-39.pycnu[PK!Q;ܫ_distutils/command/__pycache__/build_scripts.cpython-39.pycnu[PK!883%_distutils/command/__pycache__/sdist.cpython-39.pycnu[PK!9+0+07&_distutils/command/__pycache__/bdist_rpm.cpython-39.pycnu[PK!Db4W_distutils/command/__pycache__/upload.cpython-39.pycnu[PK!ZmMM75l_distutils/command/__pycache__/bdist_msi.cpython-39.pycnu[PK!٤K??7@_distutils/command/__pycache__/build_ext.cpython-39.pycnu[PK!3e_distutils/command/__pycache__/build.cpython-39.pycnu[PK!oYW
_distutils/command/bdist_msi.pynu[PK!d->>#_distutils/command/bdist_wininst.pynu[PK!iYY&ԭ__pycache__/namespaces.cpython-310.pycnu[PK!!e==#A__pycache__/sandbox.cpython-310.pycnu[PK!Ur+RR"Y!__pycache__/monkey.cpython-310.pycnu[PK!4"3__pycache__/errors.cpython-310.pycnu[PK!{ѳ&7__pycache__/py34compat.cpython-310.pycnu[PK!XL )G:__pycache__/unicode_utils.cpython-310.pycnu[PK!A&!/?__pycache__/wheel.cpython-310.pycnu[PK!4!!)m\__pycache__/package_index.cpython-310.pycnu[PK!,

(ۮ__pycache__/archive_util.cpython-310.pycnu[PK!A|=f"L__pycache__/launch.cpython-310.pycnu[PK!Cc]]0`__pycache__/_deprecation_warning.cpython-310.pycnu[PK!^Y%__pycache__/extension.cpython-310.pycnu[PK!YSS C__pycache__/_imp.cpython-310.pycnu[PK!rmƦƦ 
__pycache__/msvc.cpython-310.pycnu[PK!|]xܐ$__pycache__/dep_util.cpython-310.pycnu[PK!^Of"f"$൯__pycache__/__init__.cpython-310.pycnu[PK!C
o

%د__pycache__/installer.cpython-310.pycnu[PK!VQQ"__pycache__/config.cpython-310.pycnu[PK!#6__pycache__/depends.cpython-310.pycnu[PK!{2{{#:K__pycache__/version.cpython-310.pycnu[PK!3%k488+M__pycache__/windows_support.cpython-310.pycnu[PK!oc Q__pycache__/dist.cpython-310.pycnu[PK!;.##&߰__pycache__/build_meta.cpython-310.pycnu[PK![ __pycache__/glob.cpython-310.pycnu[PK!R{+extern/__pycache__/__init__.cpython-310.pycnu[PK!>v		.command/__pycache__/build_clib.cpython-310.pycnu[PK!7j@@+-)command/__pycache__/develop.cpython-310.pycnu[PK!da,Acommand/__pycache__/build_py.cpython-310.pycnu[PK!ee*acommand/__pycache__/upload.cpython-310.pycnu[PK!mm-dcommand/__pycache__/bdist_rpm.cpython-310.pycnu[PK!.8N,kcommand/__pycache__/saveopts.cpython-310.pycnu[PK!Lb&&-ocommand/__pycache__/build_ext.cpython-310.pycnu[PK!f3f3-
command/__pycache__/bdist_egg.cpython-310.pycnu[PK!n+ʱcommand/__pycache__/install.cpython-310.pycnu[PK!kf

*۱command/__pycache__/rotate.cpython-310.pycnu[PK!J!		)(command/__pycache__/alias.cpython-310.pycnu[PK!-command/__pycache__/dist_info.cpython-310.pycnu[PK!pt		3command/__pycache__/install_scripts.cpython-310.pycnu[PK!}VV) command/__pycache__/sdist.cpython-310.pycnu[PK!+,command/__pycache__/__init__.cpython-310.pycnu[PK!ab,command/__pycache__/register.cpython-310.pycnu[PK!+_m* command/__pycache__/setopt.cpython-310.pycnu[PK!>畴		43command/__pycache__/install_egg_info.cpython-310.pycnu[PK!LX^^/=command/__pycache__/upload_docs.cpython-310.pycnu[PK!䷆(lVcommand/__pycache__/test.cpython-310.pycnu[PK!YΕh/vcommand/__pycache__/install_lib.cpython-310.pycnu[PK!ܿ.command/__pycache__/py36compat.cpython-310.pycnu[PK!b&0command/__pycache__/easy_install.cpython-310.pycnu[PK!HGG9Ծ_distutils/command/__pycache__/py37compat.cpython-310.pycnu[PK!s\70708rپ_distutils/command/__pycache__/bdist_rpm.cpython-310.pycnu[PK!!u?M?M8
_distutils/command/__pycache__/bdist_msi.cpython-310.pycnu[PK!F!!<W_distutils/command/__pycache__/bdist_wininst.cpython-310.pycnu[PK!??8z_distutils/command/__pycache__/build_ext.cpython-310.pycnu[PK!NU6U66:_distutils/command/__pycache__/install.cpython-310.pycnu[PK!p'4_distutils/command/__pycache__/clean.cpython-310.pycnu[PK!ig_distutils/command/__pycache__/install_headers.cpython-310.pycnu[PK!ll4_distutils/command/__pycache__/build.cpython-310.pycnu[PK!hd>S_distutils/command/__pycache__/install_scripts.cpython-310.pycnu[PK!Ç884_distutils/command/__pycache__/sdist.cpython-310.pycnu[PK!mJJ7S_distutils/command/__pycache__/__init__.cpython-310.pycnu[PK!(9k;ss9~V_distutils/command/__pycache__/bdist_dumb.cpython-310.pycnu[PK!""""7Ze_distutils/command/__pycache__/register.cpython-310.pycnu[PK!JPPH((5_distutils/command/__pycache__/config.cpython-310.pycnu[PK!Z~<ٰ_distutils/command/__pycache__/build_scripts.cpython-310.pycnu[PK!}GG?(_distutils/command/__pycache__/install_egg_info.cpython-310.pycnu[PK!94_distutils/command/__pycache__/check.cpython-310.pycnu[PK!4
_distutils/command/__pycache__/bdist.cpython-310.pycnu[PK!(2kk:_distutils/command/__pycache__/install_lib.cpython-310.pycnu[PK!Iqq
py26compat.pynu[PK!\jfBfB"__pycache__/sandbox.cpython-35.pycnu[PK!		%gK__pycache__/py36compat.cpython-35.pycnu[PK!"{@!=U__pycache__/monkey.cpython-35.pycnu[PK!][[$Fk__pycache__/extension.cpython-35.pycnu[PK!aɊɊ(s__pycache__/package_index.cpython-35.pycnu[PK!0ک#__pycache__/dep_util.cpython-35.pycnu[PK!̵'__pycache__/archive_util.cpython-35.pycnu[PK!X,aa%__pycache__/namespaces.cpython-35.pycnu[PK!Xmߘ#(__pycache__/__init__.cpython-35.pycnu[PK!	D}}%@__pycache__/py27compat.cpython-35.pycnu[PK!߰YY%D__pycache__/py33compat.cpython-35.pycnu[PK!*5ƒ;J__pycache__/glob.cpython-35.pycnu[PK!>HH&
[__pycache__/ssl_support.cpython-35.pycnu[PK!;d,<,<!w__pycache__/config.cpython-35.pycnu[PK!~((__pycache__/unicode_utils.cpython-35.pycnu[PK!(UU*__pycache__/windows_support.cpython-35.pycnu[PK!q7MM";__pycache__/depends.cpython-35.pycnu[PK!K
K
%__pycache__/lib2to3_ex.cpython-35.pycnu[PK!L%z__pycache__/site-patch.cpython-35.pycnu[PK!z%__pycache__/py31compat.cpython-35.pycnu[PK!`yy"__pycache__/version.cpython-35.pycnu[PK!cׇww%__pycache__/py26compat.cpython-35.pycnu[PK!!__pycache__/launch.cpython-35.pycnu[PK!||w__pycache__/dist.cpython-35.pycnu[PK!eLL|__pycache__/msvc.cpython-35.pycnu[PK!\;}*extern/__pycache__/__init__.cpython-35.pycnu[PK!.!PAA( command/__pycache__/sdist.cpython-35.pycnu[PK!ʬ-;command/__pycache__/py36compat.cpython-35.pycnu[PK!2VD::,hOcommand/__pycache__/bdist_egg.cpython-35.pycnu[PK!#?/scommand/__pycache__/easy_install.cpython-35.pycnu[PK!Kl..+command/__pycache__/__init__.cpython-35.pycnu[PK!',ww,Jcommand/__pycache__/bdist_rpm.cpython-35.pycnu[PK!0y/)command/__pycache__/upload.cpython-35.pycnu[PK!~t+Ycommand/__pycache__/saveopts.cpython-35.pycnu[PK!͐i``.command/__pycache__/upload_docs.cpython-35.pycnu[PK!b<.wcommand/__pycache__/install_lib.cpython-35.pycnu[PK!J )command/__pycache__/rotate.cpython-35.pycnu[PK!2b
b
-<command/__pycache__/build_clib.cpython-35.pycnu[PK!Rנ+command/__pycache__/register.cpython-35.pycnu[PK!.a		2command/__pycache__/install_scripts.cpython-35.pycnu[PK!ZFxx**command/__pycache__/develop.cpython-35.pycnu[PK!]m""""'command/__pycache__/test.cpython-35.pycnu[PK!Dy*u?command/__pycache__/install.cpython-35.pycnu[PK!}
}
(Pcommand/__pycache__/alias.cpython-35.pycnu[PK!q
q
3}[command/__pycache__/install_egg_info.cpython-35.pycnu[PK!eL2Y2Y+Qfcommand/__pycache__/egg_info.cpython-35.pycnu[PK!Y+##0޿command/__pycache__/bdist_wininst.cpython-35.pycnu[PK!W++,acommand/__pycache__/build_ext.cpython-35.pycnu[PK!6Hv$v$+command/__pycache__/build_py.cpython-35.pycnu[PK!"ʋ)command/__pycache__/setopt.cpython-35.pycnu[PK!ge<e<"s(__pycache__/sandbox.cpython-37.pycnu[PK!izz!*e__pycache__/errors.cpython-37.pycnu[PK!Fe""%h__pycache__/build_meta.cpython-37.pycnu[PK!"Nyrææ-__pycache__/msvc.cpython-37.pycnu[PK!iPP?3__pycache__/_imp.cpython-37.pycnu[PK!u%;__pycache__/py34compat.cpython-37.pycnu[PK!)	ZNN/?>__pycache__/_deprecation_warning.cpython-37.pycnu[PK!!!#@__pycache__/__init__.cpython-37.pycnu[PK!P%~!c__pycache__/launch.cpython-37.pycnu[PK!rr"f__pycache__/version.cpython-37.pycnu[PK!zz(h__pycache__/unicode_utils.cpython-37.pycnu[PK!oK1qq'm__pycache__/archive_util.cpython-37.pycnu[PK!"PP![__pycache__/config.cpython-37.pycnu[PK!(%a__pycache__/namespaces.cpython-37.pycnu[PK!pت$__pycache__/extension.cpython-37.pycnu[PK!凎__pycache__/dist.cpython-37.pycnu[PK!2z__pycache__/glob.cpython-37.pycnu[PK!gv*b__pycache__/windows_support.cpython-37.pycnu[PK!l$

$ٍ__pycache__/installer.cpython-37.pycnu[PK!L~~(__pycache__/package_index.cpython-37.pycnu[PK!>JJ"k__pycache__/depends.cpython-37.pycnu[PK!^#,__pycache__/dep_util.cpython-37.pycnu[PK!j		!/__pycache__/monkey.cpython-37.pycnu[PK! 7B__pycache__/wheel.cpython-37.pycnu[PK!Q=]__*^extern/__pycache__/__init__.cpython-37.pycnu[PK!|*&*&,:jcommand/__pycache__/build_ext.cpython-37.pycnu[PK!
Woo+command/__pycache__/register.cpython-37.pycnu[PK!	ϖ		3command/__pycache__/install_egg_info.cpython-37.pycnu[PK!JJ/command/__pycache__/easy_install.cpython-37.pycnu[PK!I22),command/__pycache__/setopt.cpython-37.pycnu[PK!y
-command/__pycache__/py36compat.cpython-37.pycnu[PK!R?,command/__pycache__/dist_info.cpython-37.pycnu[PK!}%TT)command/__pycache__/upload.cpython-37.pycnu[PK!tĖ		2command/__pycache__/install_scripts.cpython-37.pycnu[PK!Uȯ+command/__pycache__/__init__.cpython-37.pycnu[PK!]4*command/__pycache__/develop.cpython-37.pycnu[PK!,'command/__pycache__/test.cpython-37.pycnu[PK!N,W	W	(command/__pycache__/alias.cpython-37.pycnu[PK!	33,Dcommand/__pycache__/bdist_egg.cpython-37.pycnu[PK!T(Ccommand/__pycache__/sdist.cpython-37.pycnu[PK!0966.]command/__pycache__/install_lib.cpython-37.pycnu[PK!ˡB+Kncommand/__pycache__/saveopts.cpython-37.pycnu[PK!MOO+mrcommand/__pycache__/build_py.cpython-37.pycnu[PK!8ZUZU+command/__pycache__/egg_info.cpython-37.pycnu[PK!aу*command/__pycache__/install.cpython-37.pycnu[PK!O		)command/__pycache__/rotate.cpython-37.pycnu[PK!<::,command/__pycache__/bdist_rpm.cpython-37.pycnu[PK!^Ǹ		-zcommand/__pycache__/build_clib.cpython-37.pycnu[PK!I.command/__pycache__/upload_docs.cpython-37.pycnu[PK!+*_vendor/__pycache__/__init__.cpython-37.pycnu[PK!tGDD,,_vendor/__pycache__/pyparsing.cpython-37.pycnu[PK!ޭ@_D@D@.E_vendor/__pycache__/ordered_set.cpython-37.pycnu[PK!7Hp4a_vendor/packaging/__pycache__/_compat.cpython-37.pycnu[PK!{Wjj5o_vendor/packaging/__pycache__/__init__.cpython-37.pycnu[PK!:8>_vendor/packaging/__pycache__/_structures.cpython-37.pycnu[PK!334p_vendor/packaging/__pycache__/version.cpython-37.pycnu[PK!D9\_vendor/packaging/__pycache__/requirements.cpython-37.pycnu[PK!=4_vendor/packaging/__pycache__/_typing.cpython-37.pycnu[PK!kxCC1+_vendor/packaging/__pycache__/tags.cpython-37.pycnu[PK!QvfPfP7(_vendor/packaging/__pycache__/specifiers.cpython-37.pycnu[PK!O6Zy_vendor/packaging/__pycache__/__about__.cpython-37.pycnu[PK!|l$l$4|_vendor/packaging/__pycache__/markers.cpython-37.pycnu[PK!__2_vendor/packaging/__pycache__/utils.cpython-37.pycnu[PK!~Ș6_vendor/more_itertools/__pycache__/more.cpython-37.pycnu[PK!=I99:U_vendor/more_itertools/__pycache__/__init__.cpython-37.pycnu[PK!tEE93W_vendor/more_itertools/__pycache__/recipes.cpython-37.pycnu[PK!ų-\,|_distutils/__pycache__/errors.cpython-37.pycnu[PK!dͮ66)_distutils/__pycache__/cmd.cpython-37.pycnu[PK!=)3_distutils/__pycache__/unixccompiler.cpython-37.pycnu[PK!wqq+_distutils/__pycache__/spawn.cpython-37.pycnu[PK!¬q._distutils/__pycache__/__init__.cpython-37.pycnu[PK!F,,*_distutils/__pycache__/core.cpython-37.pycnu[PK!*v.Y._distutils/__pycache__/dir_util.cpython-37.pycnu[PK!k0j5j53E_distutils/__pycache__/_msvccompiler.cpython-37.pycnu[PK!E"HH-{_distutils/__pycache__/version.cpython-37.pycnu[PK!s""5=_distutils/__pycache__/cygwinccompiler.cpython-37.pycnu[PK!Ol2_distutils/__pycache__/archive_util.cpython-37.pycnu[PK!

,_distutils/__pycache__/config.cpython-37.pycnu[PK!HۑC**+P_distutils/__pycache__/debug.cpython-37.pycnu[PK!.0_distutils/__pycache__/py35compat.cpython-37.pycnu[PK!Uss/_distutils/__pycache__/ccompiler.cpython-37.pycnu[PK!%I7SS/k_distutils/__pycache__/extension.cpython-37.pycnu[PK!J*U_distutils/__pycache__/dist.cpython-37.pycnu[PK!UII6_distutils/__pycache__/versionpredicate.cpython-37.pycnu[PK!))2b#_distutils/__pycache__/fancy_getopt.cpython-37.pycnu[PK!w"9"92M_distutils/__pycache__/msvccompiler.cpython-37.pycnu[PK!0_distutils/__pycache__/py38compat.cpython-37.pycnu[PK!ů D D3L_distutils/__pycache__/msvc9compiler.cpython-37.pycnu[PK!ceg2_distutils/__pycache__/bcppcompiler.cpython-37.pycnu[PK!8 i	i	)_distutils/__pycache__/log.cpython-37.pycnu[PK!w7w7*w_distutils/__pycache__/util.cpython-37.pycnu[PK!b*b*.H)_distutils/__pycache__/filelist.cpython-37.pycnu[PK!^?1?1/T_distutils/__pycache__/sysconfig.cpython-37.pycnu[PK!JRc

._distutils/__pycache__/dep_util.cpython-37.pycnu[PK!mW!W!/_distutils/__pycache__/text_file.cpython-37.pycnu[PK!{ii/_distutils/__pycache__/file_util.cpython-37.pycnu[PK!66?6?7_distutils/command/__pycache__/build_ext.cpython-37.pycnu[PK!*w!w!6
_distutils/command/__pycache__/register.cpython-37.pycnu[PK!}>+_distutils/command/__pycache__/install_egg_info.cpython-37.pycnu[PK!昲Q!Q!;i8_distutils/command/__pycache__/bdist_wininst.cpython-37.pycnu[PK!!4%Z_distutils/command/__pycache__/upload.cpython-37.pycnu[PK!D=
o_distutils/command/__pycache__/install_scripts.cpython-37.pycnu[PK!]6/x_distutils/command/__pycache__/__init__.cpython-37.pycnu[PK!